UserCenter.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <template>
  2. <view class="contentColumn">
  3. <customNav :shownav="true" :title="$t('user.gerenzhongxin')" tinColor="#40AE36" jiantou="0"></customNav>
  4. <view style="background-color: #40AE36;">
  5. <view style="width: 92%;margin-left: 4%;">
  6. <view class="contentInRowS" style="align-items: center;" @click="userIconkl">
  7. <view class="contentInRowL" style="align-items: center;margin-top: 20rpx;">
  8. <myImage class="iconImg" :isIcon="true" :mysrc="userInfo.avatar" mymode="scaleToFill"></myImage>
  9. <view class="contentColumn" style="padding-left: 20rpx;">
  10. <text class="nameText">{{nickName}}</text>
  11. <!-- <text class="phoneText">{{userName}}</text> -->
  12. </view>
  13. </view>
  14. <image class="jiantouImg" src="/static/imags/fanhui1@3x.png" mode="scaleToFill"></image>
  15. </view>
  16. <view style="height: 100rpx;"></view>
  17. <!-- <view class="contentInRowS" style="align-items: center;width: 80%;margin-left: 10%;padding-bottom: 50rpx;">
  18. <view class="contentColumn" style="padding-top: 20rpx;" >
  19. <text class="titleText" style="margin-bottom: 16rpx;">{{$t('zhanghu.jinriwanch')}}</text>
  20. <text class="nameText" style="margin-bottom: 16rpx;">0</text>
  21. </view>
  22. <label style="width: 6rpx;height: 100rpx;background-color:royalblue"></label>
  23. <view class="contentColumn" style="padding-top: 20rpx;">
  24. <text class="titleText" style="margin-bottom: 16rpx;">{{$t('zhanghu.jinrishour')}}</text>
  25. <text class="nameText" style="margin-bottom: 16rpx;">0</text>
  26. </view>
  27. </view> -->
  28. </view>
  29. </view>
  30. <view class="contentInRowS dengjiView" @click="tixian">
  31. <text class="dengjiText">{{$t('zhanghu.yuer')}}: {{$formPr(ketixianJE)}}{{$t('api.huobidanwei')}}</text>
  32. <view class="contentInRowL" style="align-items: center;margin-right: 30rpx;">
  33. <text class="dengjiText">{{$t('tixian.tixian')}}</text>
  34. <image class="jiantouImgS" src="/static/imags/fanhui1@3x.png" mode="scaleToFill"></image>
  35. </view>
  36. </view>
  37. <scrollViewR class="actListView" style="margin-top: 30rpx;" :itemList="actList" v-on:EitemSelect="actIndex"></scrollViewR>
  38. <!-- <view class="contentInRowS" style="margin-top: 30rpx;">
  39. <text class="jinriText">{{$t('zhanghu.jinrizhangd')}}</text>
  40. </view>
  41. <view class="jinricontent">
  42. <view class="contentInRowS" style="padding-top: 30rpx;width: 84%;margin-left: 8%;">
  43. <view class="contentColumn" style="align-items: center;">
  44. <text>+100.5</text>
  45. <text>{{$t('zhanghu.yujishouru')}}</text>
  46. </view>
  47. <view class="contentColumn" style="align-items: center;">
  48. <text>+0.00</text>
  49. <text>{{$t('zhanghu.yujizhichu')}}</text>
  50. </view>
  51. </view>
  52. <view style="width: 94%;margin-left: 3%;height: 4rpx;background-color: lavender;"></view>
  53. <text class="shournote">{{$t('zhanghu.peisongsr')}}100.05,{{$t('zhanghu.huodongsr')}}0</text>
  54. </view> -->
  55. <!-- <view class="">
  56. <view class="contentInRowS duoyuyanctv" @click="duoyuyan">
  57. <view class="contentInRowL">
  58. <image class="duoyuyIcon" src="/static/imags/yuyan@3x.png" mode="scaleToFill"></image>
  59. <text>Ngôn ngữ/语言</text>
  60. </view>
  61. <image style="width: 30rpx;" src="/static/imags/youjian@3x.png" mode="widthFix"></image>
  62. </view>
  63. </view> -->
  64. <view style="width: 94%;margin-left: 3%;background-color: white;margin-top: 30rpx;">
  65. <view v-for="(item,index) in balanceList">
  66. <view class="contentInRowL" style="padding-top: 20rpx;">
  67. <view class="contentColumn" style="width: 97%;padding-left: 1%;">
  68. <view class="contentInRowS">
  69. <text class="timeText">{{rtType(item.type)}}</text>
  70. <text class="yujidzText" style="margin-left: auto;margin-right: 10rpx;">No.{{item.ddId}}</text>
  71. </view>
  72. <view class="contentInRowS">
  73. <text class="timeText">{{$formPr(item.amount)}}{{$t('api.huobidanwei')}}</text>
  74. <!-- <text class="yujidzText" style="margin-left: auto;margin-right: 10rpx;">{{$formPr(item.divvy)}}{{$t('api.huobidanwei')}}</text> -->
  75. </view>
  76. <view class="contentInRowS">
  77. <text class="timeText">{{item.cretim}}</text>
  78. <text class="yujidzText" style="margin-left: auto;margin-right: 10rpx;">{{$t('zhanghu.zhuangtai')}}: {{rtState(item.state)}}</text>
  79. </view>
  80. </view>
  81. </view>
  82. <view style="width: 94%;margin-left: 3%;height: 4rpx;background-color: lavender;margin-top: 10rpx;"></view>
  83. </view>
  84. <view style="height: 40rpx;"></view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. import {
  90. getUserMsg
  91. } from '@/pages/api/login';
  92. import {
  93. getUsbalance
  94. } from '@/pages/api/basic.js';
  95. export default {
  96. data() {
  97. return {
  98. imageURL:'/static/imags/huituceng@3x.png',
  99. isLogin:true,
  100. actList:[],
  101. userInfo:'',
  102. userName:'',
  103. nickName:'',
  104. avatar:'',
  105. ketixianJE:0.00,
  106. balanceList:''
  107. }
  108. },
  109. onShow() {
  110. this.actList=[
  111. { imagStr:'/static/imags/zhanghumingxi@3x.png', title: this.$t('zhanghu.zhanghumingxi') },
  112. // { imagStr:'/static/imags/shouzhitj@3x.png', title: this.$t('zhanghu.shouzhitj')},
  113. // { imagStr:'/static/imags/baozhengjin@3x.png', title: this.$t('zhanghu.baozhegnjin')},
  114. { imagStr:'/static/imags/yinhangka@3x.png', title: this.$t('zhanghu.yinhangka') },
  115. // { imagStr:'/static/imags/tixianjilu@3x.png', title:'打IM'},
  116. { imagStr:'/static/imags/kefu.png', title: this.$t('user.kefuzhongxin') },
  117. ];
  118. var that =this;
  119. try {//读取
  120. that.token = uni.getStorageSync("token");
  121. //console.log('2222',that.token)
  122. if(that.token == '' || that.token == undefined || that.token == null){
  123. that.isLogin=false;
  124. that.userName='';
  125. that.nickName='';
  126. that.avatar='';
  127. return;
  128. }
  129. else{
  130. that.isLogin=true;
  131. that.getUserMsg(that.token);
  132. that.getUsbalance();
  133. return;
  134. }
  135. } catch(e){//错误
  136. return;
  137. }
  138. },
  139. methods: {
  140. userIconkl(){
  141. this.gotoNextView('/pages/user/Usermanager')
  142. },
  143. tixian(){
  144. this.gotoNextView('/pages/tixian/Tixian')
  145. },
  146. duoyuyan(){
  147. uni.navigateTo({
  148. url:'/pages/user/duoyuyan'
  149. })
  150. },
  151. actIndex(index){
  152. var url = '';
  153. if(index==0){
  154. this.gotoNextView('/pages/order/Zhanghumingxi')
  155. }
  156. // if(index==1){
  157. // this.gotoNextView('/pages/order/Myorderlist')
  158. // }
  159. // if(index==1){
  160. // this.gotoNextView('/pages/tixian/Baozhengjin')
  161. // }
  162. if(index==1){
  163. this.gotoNextView('/pages/tixian/Wodeyanhangka?state=0')
  164. }
  165. if(index==2){
  166. var that = this;
  167. uni.showModal({
  168. title: that.$t('api.message'),
  169. content: that.$t('api.nqdbddh'),
  170. cancelText: that.$t('index.quxiao'), // 取消按钮的文字
  171. confirmText: that.$t('index.queren'), // 确认按钮的文字
  172. success: function (res) {
  173. if (res.confirm) { //这里是点击了确定以
  174. plus.device.dial('0938088913', false );
  175. } else { //这里是点击了取消以后
  176. console.log('用户点击取消')
  177. }
  178. }
  179. })
  180. return;
  181. }
  182. // if(index==3){
  183. // uni.navigateTo({
  184. // url:'/pages/imcall/vidioCall?caller=1'
  185. // })
  186. // return;
  187. // }
  188. if(index==4){
  189. this.gotoNextView('/pages/order/Tixianjilv')
  190. }
  191. },
  192. gotoNextView(url){
  193. if(this.isLogin){
  194. uni.navigateTo({
  195. url:url
  196. })
  197. }
  198. else{
  199. uni.navigateTo({
  200. url:'/pages/user/LoginView'
  201. })
  202. }
  203. },
  204. async getUserMsg(token){
  205. //console.log('getUserMsg')
  206. await this.$http.get(`${getUserMsg}`, {
  207. },true)
  208. .then(async r => {
  209. console.log(r.data)
  210. this.userInfo=r.data.data;
  211. getApp().globalData.auditStatus=this.userInfo.auditStatus;
  212. this.userName=r.data.data.userName;
  213. this.nickName=r.data.data.nickName;
  214. this.avatar=r.data.data.avatar;
  215. //console.log('this.avatar',this.avatar)
  216. uni.setStorageSync('userInfo',r.data.data);
  217. if(r.data.data.userType==1){
  218. this.isShangjia=true;
  219. }
  220. })
  221. .catch(err => {
  222. console.log(err)
  223. })
  224. },
  225. async getUsbalance(){
  226. //console.log('getUserMsg')
  227. await this.$http.get(`${getUsbalance}`, {
  228. type:'',
  229. sort:false,
  230. page:1,
  231. size:20,
  232. },true)
  233. .then(async r => {
  234. console.log(r)
  235. this.ketixianJE=r.data.data.sum;
  236. this.balanceList=r.data.data.list;
  237. })
  238. .catch(err => {
  239. console.log(err)
  240. })
  241. },
  242. rtState(state){
  243. if(state==0){
  244. return this.$t('order.wancheng')
  245. }
  246. if(state==1){
  247. return this.$t('index.quxiao')
  248. }
  249. if(state==2){
  250. return this.$t('index.quxiao')
  251. }
  252. if(state==3){
  253. return this.$t('order.weizhifu')
  254. }
  255. },
  256. rtType(type){
  257. if(type==0){
  258. return this.$t('zhanghu.peisongsr')
  259. }
  260. if(type==1){
  261. return this.$t('tixian.chongzhi')
  262. }
  263. if(type==2){
  264. return this.$t('tixian.tixian')
  265. }
  266. },
  267. }
  268. }
  269. </script>
  270. <style lang="scss">
  271. @import '@/common/common.scss';
  272. page{
  273. background-color: whitesmoke;
  274. }
  275. .iconImg{
  276. margin-top: 20rpx;
  277. margin-bottom: 20rpx;
  278. width: 110rpx;
  279. height: 110rpx;
  280. border-radius: 55rpx;
  281. background-color: #1A1A1A;
  282. }
  283. .jiantouImg{
  284. width: 40rpx;
  285. height: 40rpx;
  286. }
  287. .jiantouImgS{
  288. width: 30rpx;
  289. height: 30rpx;
  290. }
  291. .nameText{
  292. font-size: 32rpx;
  293. color: white;
  294. }
  295. .phoneText{
  296. font-size: 26rpx;
  297. color: white;
  298. }
  299. .titleText{
  300. color: white;
  301. font-size: 26rpx;
  302. }
  303. .dingdanText{
  304. font-size: 28rpx;
  305. color: lightgrey;
  306. }
  307. .dengjiView{
  308. margin-top: -40rpx;
  309. width: 94%;
  310. margin-left: 3%;
  311. height: 80rpx;
  312. align-items: center;
  313. //background-color: #616A89;
  314. background-image: url('/static/imags/huituceng@3x.png');
  315. background-size: 100% 100%;
  316. }
  317. .dengjiText{
  318. color: white;
  319. font-size: 28rpx;
  320. padding-left: 30rpx;
  321. }
  322. .actListView{
  323. width: 92%;
  324. margin-left: 4%;
  325. border-radius: 10rpx;
  326. box-shadow: 0px 0rpx 10rpx 0rpx darkgray;
  327. background-color: white;
  328. }
  329. .jinriText{
  330. color: #1A1A1A;
  331. font-size: 28rpx;
  332. padding-left: 40rpx;
  333. }
  334. .jinricontent{
  335. margin-top: 30rpx;
  336. width: 92%;
  337. margin-left: 4%;
  338. border-radius: 10rpx;
  339. box-shadow: 0px 0rpx 10rpx 0rpx darkgray;
  340. background-color: white;
  341. padding-bottom: 30rpx;
  342. }
  343. .shournote{
  344. color: darkgray;
  345. font-size: 26rpx;
  346. padding-left: 20rpx;
  347. }
  348. .ruzhangNote{
  349. padding-left: 10rpx;
  350. overflow:hidden;
  351. text-overflow:ellipsis;
  352. display:-webkit-box;
  353. -webkit-line-clamp:2;
  354. -webkit-box-orient:vertical;
  355. }
  356. .timeText{
  357. color: #1A1A1A;
  358. font-size: 26rpx;
  359. padding-left: 20rpx;
  360. }
  361. .yujidzText{
  362. color: sandybrown;
  363. font-size: 26rpx;
  364. padding-left: 20rpx;
  365. }
  366. .duoyuyanctv{
  367. margin-top: 20rpx;
  368. padding: 30rpx;
  369. border: solid lavender;
  370. border-width: 0px 0px 1rpx 0px;
  371. }
  372. .duoyuyIcon{
  373. width: 40rpx;
  374. height: 40rpx;
  375. }
  376. </style>