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. { imagStr:'/static/msdshj/guanyuwomen.png', title: this.$t('user.guanyuwm') },
  111. ];
  112. this.actListC=[
  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.listClick(8)
  181. }
  182. if(index==2){
  183. this.openWebView(5)
  184. }
  185. },
  186. itemSelectC(index){
  187. if(index==0){
  188. }
  189. },
  190. gotoNextView(url){
  191. if(this.login){
  192. uni.navigateTo({
  193. url:url
  194. })
  195. }
  196. else{
  197. uni.navigateTo({
  198. url:'/pages/UserCenter/LoginView'
  199. })
  200. }
  201. },
  202. listClick(e){
  203. switch(e){
  204. case 1:
  205. break;
  206. case 2:
  207. break;
  208. case 3:
  209. uni.navigateTo({
  210. url:'/pages/kefuzhongxin/fuwuleixing'
  211. })
  212. break;
  213. case 4://语言
  214. uni.navigateTo({
  215. url:'/pages/UserCenter/yonghushezhi/duoyuyan'
  216. })
  217. break;
  218. case 5://修改密码
  219. if(this.login){
  220. this.xiugaimima();
  221. }
  222. else{
  223. uni.navigateTo({
  224. url:'/pages/UserCenter/LoginView'
  225. })
  226. }
  227. break;
  228. case 6://退出登录
  229. if(this.login){
  230. this.tuichudengl();
  231. }
  232. else{
  233. uni.navigateTo({
  234. url:'/pages/UserCenter/LoginView'
  235. })
  236. }
  237. break;
  238. case 7://删除注销账号
  239. if(this.login){
  240. this.deleuser();
  241. }
  242. else{
  243. uni.navigateTo({
  244. url:'/pages/UserCenter/LoginView'
  245. })
  246. }
  247. break;
  248. case 8:
  249. uni.navigateTo({
  250. url:'/pages/index/mindex/yinszhengc'
  251. })
  252. break;
  253. }
  254. },
  255. userIconsel(){
  256. if(this.login){
  257. //用户信息编辑页
  258. uni.navigateTo({
  259. url:'/pages/UserCenter/userMsgMenager'
  260. })
  261. }else{
  262. uni.navigateTo({
  263. url:'/pages/UserCenter/LoginView'
  264. })
  265. }
  266. },
  267. xiugaimima(){
  268. uni.navigateTo({
  269. url:'/pages/UserCenter/yonghushezhi/Shezhixiugai?state='+1
  270. })
  271. },
  272. tuichudengl(){
  273. var that = this;
  274. uni.showModal({
  275. cancelText: that.$t('order.quxiao'), // 取消按钮的文字
  276. confirmText: that.$t('comp.queren'), // 确认按钮的文字
  277. title: that.$t('api.message'),
  278. content: that.$t('user.querentcdq'),
  279. success: function (res) {
  280. if (res.confirm) { //这里是点击了确定以后
  281. uni.setStorageSync('userInfo','');
  282. uni.setStorageSync('token','');
  283. uni.navigateTo({
  284. url:'/pages/UserCenter/LoginView'
  285. })
  286. } else { //这里是点击了取消以后
  287. console.log('用户点击取消')
  288. }
  289. }
  290. })
  291. },
  292. // async pushMsg(token){//消息推送
  293. // await this.$http.get(`${pushMsg}`, {
  294. // cid:'',
  295. // title:'qqqqqq',
  296. // content:'aaaaaaaa'
  297. // },false)
  298. // .then(async r => {
  299. // console.log(r)
  300. // })
  301. // .catch(err => {
  302. // console.log(err)
  303. // })
  304. // },
  305. getUserMsg(token){
  306. var that = this;
  307. api('getUserMsg',{},
  308. res=>{
  309. console.log(res)
  310. this.userInfo=res.data.data;
  311. this.phone=res.data.data.phone;
  312. this.nickName=res.data.data.nickName;
  313. this.userName=res.data.data.userName;
  314. this.avatar=res.data.data.avatar;
  315. //console.log('this.avatar',this.avatar)
  316. let items = JSON.stringify(res.data.data);
  317. uni.setStorageSync('userInfo',items);
  318. if(res.data.data.userType==1){
  319. this.isShangjia=true;
  320. }
  321. },failc=>{
  322. //console.log('getadvertis----',failc)
  323. });
  324. },
  325. getUsbalance(){
  326. //console.log('getUsbalance')
  327. api('getUsbalance',{
  328. type:'',
  329. page:1,
  330. size:10,
  331. sort:true
  332. },
  333. res=>{
  334. console.log(res)
  335. this.ketixianJE=res.data.data.sum;
  336. },failc=>{
  337. //console.log('getadvertis----',failc)
  338. });
  339. },
  340. deleuser(){
  341. var that = this;
  342. uni.showModal({
  343. cancelText: that.$t('order.quxiao'), // 取消按钮的文字
  344. confirmText: that.$t('comp.queren'), // 确认按钮的文字
  345. title: that.$t('api.message'),
  346. content: that.$t('user.zhuxiaodqzh'),
  347. success: function (res) {
  348. if (res.confirm) { //这里是点击了确定以后
  349. that.updatazuxiao();
  350. } else { //这里是点击了取消以后
  351. console.log('用户点击取消')
  352. }
  353. }
  354. })
  355. },
  356. updatazuxiao(){
  357. api('deleuser',{},
  358. res=>{
  359. console.log(res)
  360. uni.setStorageSync('userInfo','');
  361. uni.setStorageSync('token','');
  362. uni.reLaunch({
  363. url:'/pages/index/index'
  364. })
  365. },failc=>{
  366. //console.log('getadvertis----',failc)
  367. });
  368. },
  369. openWebView(index){
  370. var url=''
  371. if(index==1){
  372. url='https://cityexpress168.com.vn/bao-mat-thong-tin'
  373. }
  374. if(index==2){
  375. url='https://www.awayqtw.com'
  376. }
  377. if(index==3){
  378. url='https://cityexpress168.com.vn/quy-che-hoat-dong'
  379. }
  380. if(index==4){
  381. url='https://cityexpress168.com.vn/quy-trinh-giai-quyet-tranh-chap-khieu-nai'
  382. }
  383. if(index==5){
  384. url='https://www.awayqtw.com'
  385. }
  386. uni.navigateTo({
  387. url:'/pages/index/Openwebview?url='+url
  388. })
  389. },
  390. }
  391. }
  392. </script>
  393. <style>
  394. page{
  395. background-color: #F2F3F7;
  396. }
  397. .contentV{
  398. width: 100%;
  399. background-color: #40AE36;
  400. }
  401. .viewinrow{
  402. display: flex;
  403. flex-direction: row;
  404. align-items: center;
  405. }
  406. .nodetail{
  407. display: flex;
  408. flex-direction: row;
  409. justify-content: space-between;
  410. align-items: center;
  411. background-color: #40AE36;
  412. padding: 20rpx;
  413. }
  414. .userIcon{
  415. margin: 20rpx;
  416. width: 120rpx;
  417. height: 120rpx;
  418. border-radius: 60rpx;
  419. background-color: white;
  420. }
  421. .vipicon{
  422. width: 30rpx;
  423. }
  424. .userName{
  425. font-size: 30rpx;
  426. padding-left: 16rpx;
  427. color: white;
  428. }
  429. .nameText{
  430. font-size: 32rpx;
  431. color: white;
  432. }
  433. .titleText{
  434. color: white;
  435. font-size: 26rpx;
  436. }
  437. .usernont{
  438. font-size: 26rpx;
  439. color: white;
  440. padding-left: 16rpx;
  441. }
  442. .usernameCt{
  443. padding-left: 10rpx;
  444. text-align: left;
  445. font-size: 22rpx;
  446. line-height: 32rpx;
  447. }
  448. .fanhuiimg{
  449. width: 30rpx;
  450. height: 30rpx;
  451. margin-right: 50rpx;
  452. }
  453. .huiyuanxct{
  454. margin-top: 30rpx;
  455. width: 94%;
  456. margin-left: 3%;
  457. }
  458. .actBTVshang{
  459. width: 70%;
  460. padding-left: 15%;
  461. display: flex;
  462. flex-direction: row;
  463. justify-content:space-between;
  464. align-items: center;
  465. background-color: #40AE36;
  466. }
  467. .actBTV{
  468. width: 100%;
  469. display: flex;
  470. flex-direction: row;
  471. justify-content:space-between;
  472. align-items: center;
  473. background-color: #40AE36;
  474. }
  475. .actBTVn{
  476. margin-left: 3%;
  477. width: 94%;
  478. display: flex;
  479. flex-direction: row;
  480. justify-content:space-between;
  481. align-items: center;
  482. background-color: white;
  483. border-radius: 10rpx;
  484. box-shadow: -2rpx 2rpx 5rpx lightgrey;
  485. }
  486. .actbt{
  487. width: 20%;
  488. height: 140rpx;
  489. margin-top: 10rpx;
  490. align-items: center;
  491. justify-content: center;
  492. }
  493. .bticon{
  494. width: 80rpx;
  495. }
  496. .bticonb{
  497. width: 70rpx;
  498. }
  499. .acttext{
  500. font-size: 24rpx;
  501. color: white;
  502. text-align: center;
  503. }
  504. .acttextw{
  505. font-size: 24rpx;
  506. color: black;
  507. text-align: center;
  508. }
  509. .dangdanrukouT{
  510. height: 62rpx;
  511. background-color: #40AE36;
  512. }
  513. .dingdantext{
  514. width: 100%;
  515. font-size: 30rpx;
  516. padding-left: 20rpx;
  517. padding-top: 20rpx;
  518. background-color: white;
  519. }
  520. .ddactbt{
  521. width: 20%;
  522. height: 120rpx;
  523. flex-direction: column;
  524. align-items: center;
  525. justify-content: center;
  526. }
  527. .ddbticon{
  528. width: 100%;
  529. height: 80rpx;
  530. display: flex;
  531. align-items: center;
  532. justify-content: center;
  533. }
  534. .ddtext{
  535. text-align: center;
  536. font-size: 20rpx;
  537. color: black;
  538. }
  539. .listcontent{
  540. margin-top: 30rpx;
  541. margin-left: 3%;
  542. width: 94%;
  543. display: flex;
  544. box-shadow: -4rpx 6rpx 2rpx lightgrey;
  545. }
  546. .dengjiView{
  547. margin-top: -50rpx;
  548. width: 94%;
  549. margin-left: 3%;
  550. height: 100rpx;
  551. align-items: center;
  552. //background-color: #616A89;
  553. background-image: url('/static/images/huituceng@3x.png');
  554. background-size: 100% 100%;
  555. }
  556. .dengjiText{
  557. color: white;
  558. font-size: 28rpx;
  559. padding-left: 30rpx;
  560. }
  561. .jiantouImgS{
  562. width: 30rpx;
  563. height: 30rpx;
  564. }
  565. .actListView{
  566. width: 92%;
  567. margin-left: 4%;
  568. border-radius: 10rpx;
  569. box-shadow: 0px 0rpx 10rpx 0rpx darkgray;
  570. background-color: white;
  571. }
  572. .dangqbb{
  573. padding-top: 10rpx;
  574. font-size: 28rpx;
  575. }
  576. .itemImage{
  577. width: 50rpx;
  578. }
  579. .itemTitle{
  580. font-size: 26rpx;
  581. color: #1A1A1A;
  582. text-align: center;
  583. line-height: 36rpx;
  584. }
  585. .zhuceBt{
  586. margin-top: 30rpx;
  587. width: 100%;
  588. height: 60rpx;
  589. line-height: 60rpx;
  590. padding: 10rpx;
  591. border-radius: 20rpx;
  592. border: solid #40AE36;
  593. border-width: 0px 0px 6rpx 0px;
  594. text-align: center;
  595. justify-content: center;
  596. background-color: #40AE36;
  597. color: white;
  598. box-shadow: 0rpx 0rpx 10rpx 0rpx #40AE36;
  599. }
  600. .sanchuzh{
  601. width:80%;
  602. text-align: center;
  603. font-size: 36rpx;
  604. height: 80rpx;
  605. line-height: 80rpx;
  606. color: white;
  607. background-color:crimson;
  608. border-radius: 10rpx;
  609. }
  610. </style>