UserCenter.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <template>
  2. <view class="contentColumn">
  3. <customNav :shownav="true" :title="$t('user.gerenzhongxin')" tinColor="#006AFF" jiantou="0"></customNav>
  4. <view style="background-color: #006AFF;">
  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. this.ketixianJE=r.data.data.sum;
  235. this.balanceList=r.data.data.list;
  236. })
  237. .catch(err => {
  238. console.log(err)
  239. })
  240. },
  241. rtState(state){
  242. if(state==0){
  243. return this.$t('order.wancheng')
  244. }
  245. if(state==1){
  246. return this.$t('index.quxiao')
  247. }
  248. if(state==2){
  249. return this.$t('index.quxiao')
  250. }
  251. if(state==3){
  252. return this.$t('order.weizhifu')
  253. }
  254. },
  255. rtType(type){
  256. if(type==0){
  257. return this.$t('zhanghu.peisongsr')
  258. }
  259. if(type==1){
  260. return this.$t('tixian.chongzhi')
  261. }
  262. if(type==2){
  263. return this.$t('tixian.tixian')
  264. }
  265. },
  266. }
  267. }
  268. </script>
  269. <style lang="scss">
  270. @import '@/common/common.scss';
  271. page{
  272. background-color: whitesmoke;
  273. }
  274. .iconImg{
  275. margin-top: 20rpx;
  276. margin-bottom: 20rpx;
  277. width: 110rpx;
  278. height: 110rpx;
  279. border-radius: 55rpx;
  280. background-color: #1A1A1A;
  281. }
  282. .jiantouImg{
  283. width: 40rpx;
  284. height: 40rpx;
  285. }
  286. .jiantouImgS{
  287. width: 30rpx;
  288. height: 30rpx;
  289. }
  290. .nameText{
  291. font-size: 32rpx;
  292. color: white;
  293. }
  294. .phoneText{
  295. font-size: 26rpx;
  296. color: white;
  297. }
  298. .titleText{
  299. color: white;
  300. font-size: 26rpx;
  301. }
  302. .dingdanText{
  303. font-size: 28rpx;
  304. color: lightgrey;
  305. }
  306. .dengjiView{
  307. margin-top: -40rpx;
  308. width: 94%;
  309. margin-left: 3%;
  310. height: 80rpx;
  311. align-items: center;
  312. //background-color: #616A89;
  313. background-image: url('/static/imags/huituceng@3x.png');
  314. background-size: 100% 100%;
  315. }
  316. .dengjiText{
  317. color: white;
  318. font-size: 28rpx;
  319. padding-left: 30rpx;
  320. }
  321. .actListView{
  322. width: 92%;
  323. margin-left: 4%;
  324. border-radius: 10rpx;
  325. box-shadow: 0px 0rpx 10rpx 0rpx darkgray;
  326. background-color: white;
  327. }
  328. .jinriText{
  329. color: #1A1A1A;
  330. font-size: 28rpx;
  331. padding-left: 40rpx;
  332. }
  333. .jinricontent{
  334. margin-top: 30rpx;
  335. width: 92%;
  336. margin-left: 4%;
  337. border-radius: 10rpx;
  338. box-shadow: 0px 0rpx 10rpx 0rpx darkgray;
  339. background-color: white;
  340. padding-bottom: 30rpx;
  341. }
  342. .shournote{
  343. color: darkgray;
  344. font-size: 26rpx;
  345. padding-left: 20rpx;
  346. }
  347. .ruzhangNote{
  348. padding-left: 10rpx;
  349. overflow:hidden;
  350. text-overflow:ellipsis;
  351. display:-webkit-box;
  352. -webkit-line-clamp:2;
  353. -webkit-box-orient:vertical;
  354. }
  355. .timeText{
  356. color: #1A1A1A;
  357. font-size: 26rpx;
  358. padding-left: 20rpx;
  359. }
  360. .yujidzText{
  361. color: sandybrown;
  362. font-size: 26rpx;
  363. padding-left: 20rpx;
  364. }
  365. .duoyuyanctv{
  366. margin-top: 20rpx;
  367. padding: 30rpx;
  368. border: solid lavender;
  369. border-width: 0px 0px 1rpx 0px;
  370. }
  371. .duoyuyIcon{
  372. width: 40rpx;
  373. height: 40rpx;
  374. }
  375. </style>