userInfoView.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. <template>
  2. <view>
  3. <customNav :shownav="false" :title="$t('index.User')" titledetl=""></customNav>
  4. <view class="contentV">
  5. <view class="nodetail" @click="userIconsel">
  6. <view class="viewinrow" >
  7. <netImage class="userIcon" width="120" height="120" bradius="60" :mysrc="avatar" mymode="scaleToFill"></netImage>
  8. <!-- <myImage class="userIcon" :isIcon="true" :mysrc="avatar" mymode="scaleToFill"></myImage> -->
  9. <view class="">
  10. <view class="viewinrow">
  11. <image class="vipicon" src="/static/images/VIP@3x.png" mode="widthFix"></image>
  12. <view class="userName">{{nickName}}</view>
  13. </view>
  14. <text class="usernont">{{userName}}</text>
  15. </view>
  16. </view>
  17. <image class="fanhuiimg" src="/static/images/fanhui@3x.png" mode="widthFix"></image>
  18. </view>
  19. <view style="height: 80rpx;"></view>
  20. </view>
  21. <view class="contentInRowS dengjiView" @click="tixian">
  22. <text class="dengjiText">{{$t('zhanghu.yuer')}}:{{$formPr(ketixianJE)}}{{$t('locale.huobidw')}}</text>
  23. <view class="contentInRowL" style="align-items: center;margin-right: 30rpx;">
  24. <text class="dengjiText">{{$t('tixian.tixian')}}</text>
  25. <image class="jiantouImgS" src="/static/imags/fanhui@3x.png" mode="scaleToFill"></image>
  26. </view>
  27. </view>
  28. <!-- <scrollViewR class="actListView" style="margin-top: 30rpx;padding-top: 10rpx;padding-bottom: 10rpx;" :itemList="actList" v-on:EitemSelect="actIndex"></scrollViewR> -->
  29. <view class="contentColumnC actListView" style="margin-top: 30rpx;padding-top: 10rpx;padding-bottom: 10rpx;">
  30. <view class="contentInRowS" style="margin-top: 20rpx;">
  31. <view v-for="(item,index) in actListA">
  32. <view class="contentColumnC" style="width: 200rpx;padding-right: 12rpx" @click="itemSelectA(index)">
  33. <image class="itemImage" :src="item.imagStr" mode="widthFix"></image>
  34. <text class="itemTitle">{{item.title}}</text>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="contentInRowS" style="margin-top: 30rpx;">
  39. <view v-for="(item,index) in actListB">
  40. <view class="contentColumnC" style="width: 200rpx;padding-right: 12rpx" @click="itemSelectB(index)">
  41. <image class="itemImage" :src="item.imagStr" mode="widthFix"></image>
  42. <text class="itemTitle">{{item.title}}</text>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="contentInRowS" style="margin-top: 30rpx;">
  47. <view v-for="(item,index) in actListC">
  48. <view class="contentColumnC" style="width: 200rpx;padding-right: 12rpx" @click="itemSelectC(index)">
  49. <image class="itemImage" :src="item.imagStr" mode="widthFix"></image>
  50. <text class="itemTitle">{{item.title}}</text>
  51. </view>
  52. </view>
  53. <view>
  54. <view class="contentColumnC" style="width: 200rpx;padding-right: 12rpx">
  55. </view>
  56. </view>
  57. <view>
  58. <view class="contentColumnC" style="width: 200rpx;padding-right: 12rpx" >
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="contentInRowC" style="margin-top: 80rpx;width: 80%;margin-left: 10%;">
  64. <text class="zhuceBt" @click="listClick(6)">{{$t('user.tuichudl')}}</text>
  65. </view>
  66. <view class="contentInRowC" style="margin-top: 40rpx;">
  67. <text class="sanchuzh" @click="listClick(7)">{{$t('user.zhuxiaozhh')}}</text>
  68. </view>
  69. <view class="contentInRowC" style="margin-top: 30rpx;">
  70. <text class="dangqbb">{{$t('user.dangqianbb')}}: v{{appversionN}}</text>
  71. </view>
  72. <view style="height: 80rpx;"></view>
  73. </view>
  74. </template>
  75. <script>
  76. import api from "@/pages/api/api.js"
  77. export default {
  78. data() {
  79. return {
  80. dataList: [{id: "1", name: 'A'}, {id: "2", name: 'B'}, {id: "3", name: 'C'}],
  81. goods:[],
  82. actListA:[],
  83. actListB:[],
  84. actListC:[],
  85. token:'',
  86. login:false,
  87. userInfo:[],
  88. phone:'',
  89. userType:'',
  90. nickName:'',
  91. userName:'',
  92. avatar:'',
  93. isShangjia:false,
  94. ketixianJE:0,
  95. appversionN:'',
  96. }
  97. },
  98. onLoad() {
  99. var info = uni.getSystemInfoSync();
  100. this.appversionN=info.appVersion;
  101. this.actListA=[
  102. { imagStr:'/static/msdshj/bangzhu@3x.png', title: this.$t('zhanghu.zhanghumingxi') },
  103. { imagStr:'/static/msdshj/yinhangqia.png', title: this.$t('zhanghu.yinhangka') },
  104. { imagStr:'/static/msdshj/zaixiankf@3x.png', title: this.$t('index.kefuzhx') },
  105. ];
  106. this.actListB=[
  107. { imagStr:'/static/msdshj/yinsizhc@3x.png', title: this.$t('index.xiugaimima') },
  108. { imagStr:'/static/msdshj/fuwutiaok@3x.png', title: this.$t('user.fuwutiaok')},
  109. { imagStr:'/static/msdshj/yinsizhc@3x.png', title: this.$t('user.yinsizhc')},
  110. ];
  111. this.actListC=[
  112. { imagStr:'/static/msdshj/guanyuwomen.png', title: this.$t('user.guanyuwm') },
  113. ];
  114. },
  115. onShow() {
  116. var that =this;
  117. try {//读取
  118. that.token = uni.getStorageSync("token");
  119. //console.log('2222',that.token)
  120. if(that.token == '' || that.token == undefined || that.token == null){
  121. that.login=false;
  122. that.phone='';
  123. that.nickName='';
  124. that.userName='';
  125. that.avatar='';
  126. return;
  127. }
  128. else{
  129. that.login=true;
  130. that.getUserMsg(that.token);
  131. that.getUsbalance();
  132. return;
  133. }
  134. } catch(e){//错误
  135. return;
  136. }
  137. },
  138. methods: {
  139. tixian(){
  140. if(!this.login){
  141. uni.navigateTo({
  142. url:'/pages/UserCenter/LoginView'
  143. })
  144. return;
  145. }
  146. uni.navigateTo({
  147. url:'/pages/tixian/Tixian'
  148. })
  149. },
  150. itemSelectA(index){
  151. if(index==0){
  152. this.gotoNextView('/pages/tixian/Zhanghumingxi')
  153. }
  154. if(index==1){
  155. this.gotoNextView('/pages/tixian/Wodeyanhangka?state=0')
  156. }
  157. if(index==2){
  158. var that = this;
  159. uni.showModal({
  160. title: that.$t('api.message'),
  161. content: that.$t('api.nqdbddh'),
  162. cancelText: that.$t('order.quxiao'), // 取消按钮的文字
  163. confirmText: that.$t('comp.queren'), // 确认按钮的文字
  164. success: function (res) {
  165. if (res.confirm) { //这里是点击了确定以
  166. plus.device.dial('0938088913', false );
  167. } else { //这里是点击了取消以后
  168. console.log('用户点击取消')
  169. }
  170. }
  171. })
  172. return;
  173. }
  174. },
  175. itemSelectB(index){
  176. if(index==0){
  177. this.listClick(5);
  178. }
  179. if(index==1){
  180. this.openWebView(2)
  181. }
  182. if(index==2){
  183. this.listClick(8)
  184. }
  185. },
  186. itemSelectC(index){
  187. if(index==0){
  188. this.openWebView(5)
  189. }
  190. },
  191. gotoNextView(url){
  192. if(this.login){
  193. uni.navigateTo({
  194. url:url
  195. })
  196. }
  197. else{
  198. uni.navigateTo({
  199. url:'/pages/UserCenter/LoginView'
  200. })
  201. }
  202. },
  203. listClick(e){
  204. switch(e){
  205. case 1:
  206. break;
  207. case 2:
  208. break;
  209. case 3:
  210. uni.navigateTo({
  211. url:'/pages/kefuzhongxin/fuwuleixing'
  212. })
  213. break;
  214. case 4://语言
  215. uni.navigateTo({
  216. url:'/pages/UserCenter/yonghushezhi/duoyuyan'
  217. })
  218. break;
  219. case 5://修改密码
  220. if(this.login){
  221. this.xiugaimima();
  222. }
  223. else{
  224. uni.navigateTo({
  225. url:'/pages/UserCenter/LoginView'
  226. })
  227. }
  228. break;
  229. case 6://退出登录
  230. if(this.login){
  231. this.tuichudengl();
  232. }
  233. else{
  234. uni.navigateTo({
  235. url:'/pages/UserCenter/LoginView'
  236. })
  237. }
  238. break;
  239. case 7://删除注销账号
  240. if(this.login){
  241. this.deleuser();
  242. }
  243. else{
  244. uni.navigateTo({
  245. url:'/pages/UserCenter/LoginView'
  246. })
  247. }
  248. break;
  249. case 8:
  250. uni.navigateTo({
  251. url:'/pages/index/mindex/yinszhengc'
  252. })
  253. break;
  254. }
  255. },
  256. userIconsel(){
  257. if(this.login){
  258. //用户信息编辑页
  259. uni.navigateTo({
  260. url:'/pages/UserCenter/userMsgMenager'
  261. })
  262. }else{
  263. uni.navigateTo({
  264. url:'/pages/UserCenter/LoginView'
  265. })
  266. }
  267. },
  268. xiugaimima(){
  269. uni.navigateTo({
  270. url:'/pages/UserCenter/yonghushezhi/Shezhixiugai?state='+1
  271. })
  272. },
  273. tuichudengl(){
  274. var that = this;
  275. uni.showModal({
  276. cancelText: that.$t('order.quxiao'), // 取消按钮的文字
  277. confirmText: that.$t('comp.queren'), // 确认按钮的文字
  278. title: that.$t('api.message'),
  279. content: that.$t('user.querentcdq'),
  280. success: function (res) {
  281. if (res.confirm) { //这里是点击了确定以后
  282. uni.setStorageSync('userInfo','');
  283. uni.setStorageSync('token','');
  284. uni.navigateTo({
  285. url:'/pages/UserCenter/LoginView'
  286. })
  287. } else { //这里是点击了取消以后
  288. console.log('用户点击取消')
  289. }
  290. }
  291. })
  292. },
  293. // async pushMsg(token){//消息推送
  294. // await this.$http.get(`${pushMsg}`, {
  295. // cid:'',
  296. // title:'qqqqqq',
  297. // content:'aaaaaaaa'
  298. // },false)
  299. // .then(async r => {
  300. // console.log(r)
  301. // })
  302. // .catch(err => {
  303. // console.log(err)
  304. // })
  305. // },
  306. getUserMsg(token){
  307. var that = this;
  308. api('getUserMsg',{},
  309. res=>{
  310. console.log(res)
  311. this.userInfo=res.data.data;
  312. this.phone=res.data.data.phone;
  313. this.nickName=res.data.data.nickName;
  314. this.userName=res.data.data.userName;
  315. this.avatar=res.data.data.avatar;
  316. //console.log('this.avatar',this.avatar)
  317. let items = JSON.stringify(res.data.data);
  318. uni.setStorageSync('userInfo',items);
  319. if(res.data.data.userType==1){
  320. this.isShangjia=true;
  321. }
  322. },failc=>{
  323. //console.log('getadvertis----',failc)
  324. });
  325. },
  326. getUsbalance(){
  327. //console.log('getUsbalance')
  328. api('getUsbalance',{
  329. type:'',
  330. page:1,
  331. size:10,
  332. sort:true
  333. },
  334. res=>{
  335. console.log(res)
  336. this.ketixianJE=res.data.data.sum;
  337. },failc=>{
  338. //console.log('getadvertis----',failc)
  339. });
  340. },
  341. deleuser(){
  342. var that = this;
  343. uni.showModal({
  344. cancelText: that.$t('order.quxiao'), // 取消按钮的文字
  345. confirmText: that.$t('comp.queren'), // 确认按钮的文字
  346. title: that.$t('api.message'),
  347. content: that.$t('user.zhuxiaodqzh'),
  348. success: function (res) {
  349. if (res.confirm) { //这里是点击了确定以后
  350. that.updatazuxiao();
  351. } else { //这里是点击了取消以后
  352. console.log('用户点击取消')
  353. }
  354. }
  355. })
  356. },
  357. updatazuxiao(){
  358. api('deleuser',{},
  359. res=>{
  360. console.log(res)
  361. uni.setStorageSync('userInfo','');
  362. uni.setStorageSync('token','');
  363. uni.reLaunch({
  364. url:'/pages/index/index'
  365. })
  366. },failc=>{
  367. //console.log('getadvertis----',failc)
  368. });
  369. },
  370. openWebView(index){
  371. var url=''
  372. if(index==1){
  373. url='https://cityexpress168.com.vn/bao-mat-thong-tin'
  374. }
  375. if(index==2){
  376. url='https://cityexpress168.com.vn/dieu-khoan-su-dung'
  377. }
  378. if(index==3){
  379. url='https://cityexpress168.com.vn/quy-che-hoat-dong'
  380. }
  381. if(index==4){
  382. url='https://cityexpress168.com.vn/quy-trinh-giai-quyet-tranh-chap-khieu-nai'
  383. }
  384. if(index==5){
  385. url='https://cityexpress168.com.vn/dia-chi-cong-ty'
  386. }
  387. uni.navigateTo({
  388. url:'/pages/index/Openwebview?url='+url
  389. })
  390. },
  391. }
  392. }
  393. </script>
  394. <style>
  395. page{
  396. background-color: #F2F3F7;
  397. }
  398. .contentV{
  399. width: 100%;
  400. background-color: #40AE36;
  401. }
  402. .viewinrow{
  403. display: flex;
  404. flex-direction: row;
  405. align-items: center;
  406. }
  407. .nodetail{
  408. display: flex;
  409. flex-direction: row;
  410. justify-content: space-between;
  411. align-items: center;
  412. background-color: #40AE36;
  413. padding: 20rpx;
  414. }
  415. .userIcon{
  416. margin: 20rpx;
  417. width: 120rpx;
  418. height: 120rpx;
  419. border-radius: 60rpx;
  420. background-color: white;
  421. }
  422. .vipicon{
  423. width: 30rpx;
  424. }
  425. .userName{
  426. font-size: 30rpx;
  427. padding-left: 16rpx;
  428. color: white;
  429. }
  430. .nameText{
  431. font-size: 32rpx;
  432. color: white;
  433. }
  434. .titleText{
  435. color: white;
  436. font-size: 26rpx;
  437. }
  438. .usernont{
  439. font-size: 26rpx;
  440. color: white;
  441. padding-left: 16rpx;
  442. }
  443. .usernameCt{
  444. padding-left: 10rpx;
  445. text-align: left;
  446. font-size: 22rpx;
  447. line-height: 32rpx;
  448. }
  449. .fanhuiimg{
  450. width: 30rpx;
  451. height: 30rpx;
  452. margin-right: 50rpx;
  453. }
  454. .huiyuanxct{
  455. margin-top: 30rpx;
  456. width: 94%;
  457. margin-left: 3%;
  458. }
  459. .actBTVshang{
  460. width: 70%;
  461. padding-left: 15%;
  462. display: flex;
  463. flex-direction: row;
  464. justify-content:space-between;
  465. align-items: center;
  466. background-color: #40AE36;
  467. }
  468. .actBTV{
  469. width: 100%;
  470. display: flex;
  471. flex-direction: row;
  472. justify-content:space-between;
  473. align-items: center;
  474. background-color: #40AE36;
  475. }
  476. .actBTVn{
  477. margin-left: 3%;
  478. width: 94%;
  479. display: flex;
  480. flex-direction: row;
  481. justify-content:space-between;
  482. align-items: center;
  483. background-color: white;
  484. border-radius: 10rpx;
  485. box-shadow: -2rpx 2rpx 5rpx lightgrey;
  486. }
  487. .actbt{
  488. width: 20%;
  489. height: 140rpx;
  490. margin-top: 10rpx;
  491. align-items: center;
  492. justify-content: center;
  493. }
  494. .bticon{
  495. width: 80rpx;
  496. }
  497. .bticonb{
  498. width: 70rpx;
  499. }
  500. .acttext{
  501. font-size: 24rpx;
  502. color: white;
  503. text-align: center;
  504. }
  505. .acttextw{
  506. font-size: 24rpx;
  507. color: black;
  508. text-align: center;
  509. }
  510. .dangdanrukouT{
  511. height: 62rpx;
  512. background-color: #40AE36;
  513. }
  514. .dingdantext{
  515. width: 100%;
  516. font-size: 30rpx;
  517. padding-left: 20rpx;
  518. padding-top: 20rpx;
  519. background-color: white;
  520. }
  521. .ddactbt{
  522. width: 20%;
  523. height: 120rpx;
  524. flex-direction: column;
  525. align-items: center;
  526. justify-content: center;
  527. }
  528. .ddbticon{
  529. width: 100%;
  530. height: 80rpx;
  531. display: flex;
  532. align-items: center;
  533. justify-content: center;
  534. }
  535. .ddtext{
  536. text-align: center;
  537. font-size: 20rpx;
  538. color: black;
  539. }
  540. .listcontent{
  541. margin-top: 30rpx;
  542. margin-left: 3%;
  543. width: 94%;
  544. display: flex;
  545. box-shadow: -4rpx 6rpx 2rpx lightgrey;
  546. }
  547. .dengjiView{
  548. margin-top: -50rpx;
  549. width: 94%;
  550. margin-left: 3%;
  551. height: 100rpx;
  552. align-items: center;
  553. //background-color: #616A89;
  554. background-image: url('/static/images/huituceng@3x.png');
  555. background-size: 100% 100%;
  556. }
  557. .dengjiText{
  558. color: white;
  559. font-size: 28rpx;
  560. padding-left: 30rpx;
  561. }
  562. .jiantouImgS{
  563. width: 30rpx;
  564. height: 30rpx;
  565. }
  566. .actListView{
  567. width: 92%;
  568. margin-left: 4%;
  569. border-radius: 10rpx;
  570. box-shadow: 0px 0rpx 10rpx 0rpx darkgray;
  571. background-color: white;
  572. }
  573. .dangqbb{
  574. padding-top: 10rpx;
  575. font-size: 28rpx;
  576. }
  577. .itemImage{
  578. width: 50rpx;
  579. }
  580. .itemTitle{
  581. font-size: 26rpx;
  582. color: #1A1A1A;
  583. text-align: center;
  584. line-height: 36rpx;
  585. }
  586. .zhuceBt{
  587. margin-top: 30rpx;
  588. width: 100%;
  589. height: 60rpx;
  590. line-height: 60rpx;
  591. padding: 10rpx;
  592. border-radius: 20rpx;
  593. border: solid #40AE36;
  594. border-width: 0px 0px 6rpx 0px;
  595. text-align: center;
  596. justify-content: center;
  597. background-color: #40AE36;
  598. color: white;
  599. box-shadow: 0rpx 0rpx 10rpx 0rpx #40AE36;
  600. }
  601. .sanchuzh{
  602. width:80%;
  603. text-align: center;
  604. font-size: 36rpx;
  605. height: 80rpx;
  606. line-height: 80rpx;
  607. color: white;
  608. background-color:crimson;
  609. border-radius: 10rpx;
  610. }
  611. </style>