UserCenter.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. <template>
  2. <view>
  3. <customNav :shownav="false" title="" 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="heightFix"></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">{{phone}}</view>
  13. </view>
  14. <text class="usernont">{{nickName}}</text>
  15. </view>
  16. </view>
  17. <image class="fanhuiimg" src="/static/images/fanhui@3x.png" mode="widthFix"></image>
  18. </view>
  19. </view>
  20. <view class="">
  21. <view style="width: 100%;height: 50rpx;background-color: #00A6FF;"></view>
  22. <view class="actBTVn" style="margin-top: -50rpx;">
  23. <view class="actbt" @click="gouwuche">
  24. <view class="ddbticon">
  25. <image class="bticonb" src="/static/images/gouwuch@3x.png" mode="widthFix"></image>
  26. </view>
  27. <view class="acttextw textfontB5">
  28. <text >{{$t('gouwu.gouwuche')}}</text>
  29. </view>
  30. </view>
  31. <view class="actbt" @click="wodeshoucang">
  32. <view class="ddbticon">
  33. <image class="bticonb" src="/static/images/shoucangh@3x.png" mode="widthFix"></image>
  34. </view>
  35. <view class="acttextw textfontB5">
  36. <text >{{$t('index.shouchang')}}</text>
  37. </view>
  38. </view>
  39. <view class="actbt" @click="wodezhuji">
  40. <view class="ddbticon">
  41. <image class="bticonb" src="/static/images/zhujih@3x.png" mode="widthFix"></image>
  42. </view>
  43. <view class="acttextw textfontB5">
  44. <text >{{$t('index.zhuji')}}</text>
  45. </view>
  46. </view>
  47. <view class="actbt" @click="hongbaokq">
  48. <view class="ddbticon">
  49. <image class="bticonb" src="/static/images/hongbkqh@3x.png" mode="widthFix"></image>
  50. </view>
  51. <view class="acttextw textfontB5">
  52. <text >{{$t('index.hongbaokq')}}</text>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <scroll-view :style="'height:'+scrollHeight+'rpx;'" scroll-y="true">
  58. <uni-list class="listcontent">
  59. <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/dizhi@3x.png" thumb-size="sm" :title="$t('index.shouhuodz')" @click="listClick(1)" link/>
  60. <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/yuyan@3x.png" thumb-size="sm" title="Ngôn ngữ/语言" @click="listClick(4)" link/>
  61. <!-- <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/zhoubianfw.png" thumb-size="sm" :title="$t('index.zhoubianfw')" @click="listClick(5)" link/> -->
  62. <!-- <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/gengduozx.png" thumb-size="sm" :title="$t('user.baomizc')" @click="openWebView(1)" link/> -->
  63. <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/gengduozx.png" thumb-size="sm" :title="$t('user.fuwutiaok')" @click="openWebView(2)" link/>
  64. <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/gengduozx.png" thumb-size="sm" :title="$t('user.caozuogz')" @click="openWebView(3)" link/>
  65. <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/gengduozx.png" thumb-size="sm" :title="$t('user.zengyihts')" @click="openWebView(4)" link/>
  66. <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/sanchuzh.png" thumb-size="sm" :title="$t('user.zhuxiaozhh')" @click="zhuxiaozhangh" link/>
  67. <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/yinszct.png" thumb-size="sm" :title="$t('user.yinsizhc')" @click="yinsizhc" link/>
  68. <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/guanyu.png" thumb-size="sm" :title="$t('user.guanyuwm')" @click="openWebView(5)" link/>
  69. <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/fankuishtj.png" thumb-size="sm" :title="$t('user.tijiaoshzzfk')" @click="listClick(9)" link/>
  70. <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/shehuifklb.png" thumb-size="sm" :title="$t('user.shehuizjfkb')" @click="listClick(10)" link/>
  71. <!-- <uni-list-item :show-extra-icon="true" showArrow thumb="/static/images/shezhi@3x.png" thumb-size="sm" :title="$t('index.setting')" @click="listClick(7)" link/> -->
  72. </uni-list>
  73. <view class="contentColumnC" style="margin-top: 80rpx;">
  74. <text class="tuichudl" @click="tuichudengl">{{$t('user.tuichudl')}}</text>
  75. <text class="dangqbb">{{$t('user.dangqianbb')}}: v{{appversionN}}</text>
  76. </view>
  77. <view class="contentColumnC" @tap="gotogvWebview">
  78. <netImage style="margin-top: 30rpx;" width="200" height="75" bradius="0" mysrc="http://online.gov.vn/Content/EndUser/LogoCCDVSaleNoti/logoCCDV.png" mymode="aspectFit"></netImage>
  79. </view>
  80. <view style="height: 80rpx;"></view>
  81. </scroll-view>
  82. <popViewGG :tips="$t('index.zhoubianfw')" :show="showpop" :acttips="$t('order.queding')" :maskClosable="true" :isCancel="true" @chooseCancel="chooseCancel">
  83. <picker-view :indicator-style="indicatorStyle" :value="pvalue" @change="bindChange" class="picker-view">
  84. <picker-view-column>
  85. <view class="item" v-for="(item,index) in range" :key="index">{{item}}</view>
  86. </picker-view-column>
  87. </picker-view>
  88. </popViewGG>
  89. </view>
  90. </template>
  91. <script>
  92. import uniList from '@/uni_modules/uni-list/uni-list.vue';
  93. import uniListItem from '@/uni_modules/uni-list-item/uni-list-item.vue';
  94. import uniAd from '@/uni_modules/uni-list-ad/uni-list-ad.vue';
  95. import uniChat from '@/uni_modules/uni-list-chat/uni-list-chat.vue';
  96. import api from "@/pages/api/api.js"
  97. export default {
  98. components:{
  99. uniList,uniListItem,uniAd,uniChat
  100. },
  101. data() {
  102. return {
  103. range: ["3Km","5Km","10Km","15Km","20Km"],
  104. showpop:false,
  105. indicatorStyle: 'height: 50px;',
  106. pvalue: [0],
  107. juli:3,
  108. goods:[],
  109. token:'',
  110. login:false,
  111. userInfo:[],
  112. phone:'',
  113. userType:'',
  114. nickName:this.$t('index.dengluzhuce'),
  115. avatar:'',
  116. isShangjia:false,
  117. appversionN:'',
  118. scrollHeight:0
  119. }
  120. },
  121. onLoad() {
  122. var info = uni.getSystemInfoSync();
  123. this.appversionN=info.appVersion;
  124. this.scrollHeight=info.windowHeight*(750/info.windowWidth)-440-info.statusBarHeight*(750/info.windowWidth);
  125. },
  126. onShow() {
  127. var that =this;
  128. try {//读取
  129. that.token = uni.getStorageSync("token");
  130. //console.log('2222',that.token)
  131. if(that.token == '' || that.token == undefined || that.token == null){
  132. that.login=false;
  133. that.phone='';
  134. that.nickName=that.$t('index.dengluzhuce');
  135. that.avatar='';
  136. return;
  137. }
  138. else{
  139. that.login=true;
  140. that.getUserMsg(that.token);
  141. return;
  142. }
  143. } catch(e){//错误
  144. return;
  145. }
  146. },
  147. methods: {
  148. gouwuche(){
  149. uni.navigateTo({
  150. url:'/pages/OrderList/buy/gouwuche'
  151. })
  152. },
  153. wodeshoucang(){
  154. if(this.login){
  155. uni.navigateTo({
  156. url:'/pages/OrderList/buy/wodezhuji?listType=1'
  157. })
  158. }else{
  159. uni.navigateTo({
  160. url:'/pages/UserCenter/LoginView'
  161. })
  162. }
  163. },
  164. wodezhuji(){
  165. if(this.login){
  166. uni.navigateTo({
  167. url:'/pages/OrderList/buy/wodezhuji?listType=2'
  168. })
  169. }else{
  170. uni.navigateTo({
  171. url:'/pages/UserCenter/LoginView'
  172. })
  173. }
  174. },
  175. hongbaokq(){
  176. uni.navigateTo({
  177. url:'/pages/OrderList/buy/hongbaokq'
  178. })
  179. },
  180. listClick(e){
  181. switch(e){
  182. case 1:
  183. if(this.login){
  184. uni.navigateTo({
  185. url:'/pages/UserCenter/dizhi/dizhilist'
  186. })
  187. }else{
  188. uni.navigateTo({
  189. url:'/pages/UserCenter/LoginView'
  190. })
  191. }
  192. break;
  193. case 2:
  194. uni.navigateTo({
  195. url:'/pages/UserCenter/huiyuan/huiyuan'
  196. })
  197. break;
  198. case 3:
  199. uni.navigateTo({
  200. url:'/pages/kefuzhongxin/fuwuleixing'
  201. })
  202. break;
  203. case 4://语言
  204. uni.navigateTo({
  205. url:'/pages/UserCenter/yonghushezhi/duoyuyan'
  206. })
  207. break;
  208. case 5://选择服务距离
  209. this.showpop=true;
  210. break;
  211. case 6://外送员
  212. break;
  213. case 7:
  214. if(this.login){
  215. uni.navigateTo({
  216. url:'/pages/UserCenter/yonghushezhi/shezhi'
  217. })
  218. }else{
  219. uni.navigateTo({
  220. url:'/pages/UserCenter/LoginView'
  221. })
  222. }
  223. break;
  224. case 8:
  225. uni.navigateTo({
  226. url:'/pages/UserCenter/yonghushezhi/bangzhu'
  227. })
  228. break;
  229. case 9:
  230. uni.navigateTo({
  231. url:'/pages/pinglun/Addshehuizuzhifk'
  232. })
  233. break;
  234. case 10:
  235. uni.navigateTo({
  236. url:'/pages/pinglun/Shehuizuzhifk'
  237. })
  238. break;
  239. }
  240. },
  241. userIconsel(){
  242. if(this.login){
  243. //用户信息编辑页
  244. uni.navigateTo({
  245. url:'/pages/UserCenter/userMsgMenager'
  246. })
  247. }else{
  248. uni.navigateTo({
  249. url:'/pages/UserCenter/LoginView'
  250. })
  251. }
  252. },
  253. getUserMsg(token){
  254. //console.log('getUserMsg')
  255. api('getUserMsg',{
  256. },res=>{
  257. //console.log(res.data)
  258. if(res.data.code==200){
  259. this.userInfo=res.data.data;
  260. this.phone=res.data.data.phone;
  261. this.nickName=res.data.data.nickName;
  262. this.avatar=res.data.data.avatar;
  263. //console.log('this.avatar',this.avatar)
  264. uni.setStorageSync('userInfo',res.data.data);
  265. if(res.data.data.userType==1){
  266. this.isShangjia=true;
  267. }
  268. }
  269. },failc=>{
  270. //console.log('getadvertis----',failc)
  271. })
  272. },
  273. bindChange (e) {
  274. var val = e.detail.value[0];
  275. console.log(val)
  276. if(val==0){
  277. this.juli=3;
  278. }
  279. else{
  280. this.juli=5*val;
  281. }
  282. },
  283. chooseCancel(){
  284. this.showpop=false;
  285. this.juli=3000
  286. uni.setStorageSync('FuWujuli',this.juli);
  287. console.log(this.juli);
  288. },
  289. tuichudengl(){
  290. var that = this;
  291. uni.showModal({
  292. title: that.$t('api.message'),
  293. content: that.$t('user.querentcdq'),
  294. cancelText:that.$t('order.quxiao'),
  295. confirmText:that.$t('comp.queren'),
  296. success: function (res) {
  297. if (res.confirm) { //这里是点击了确定以后
  298. uni.setStorageSync('userInfo','');
  299. uni.setStorageSync('token','');
  300. uni.setStorageSync('userId',false);
  301. getApp().globalData.token='';
  302. that.disconectGoeasy();
  303. uni.navigateTo({
  304. url:'/pages/UserCenter/LoginView'
  305. })
  306. } else { //这里是点击了取消以后
  307. console.log('用户点击取消')
  308. }
  309. }
  310. })
  311. },
  312. zhuxiaozhangh(){
  313. var that = this;
  314. uni.showModal({
  315. title: that.$t('user.zhuxiaozhh'),
  316. content: that.$t('user.zhuxiaodqzh'),
  317. cancelText:that.$t('order.quxiao'),
  318. confirmText:that.$t('comp.queren'),
  319. success: function (res) {
  320. if (res.confirm) { //这里是点击了确定以后
  321. this.updatazuxiao();
  322. } else { //这里是点击了取消以后
  323. console.log('用户点击取消')
  324. }
  325. }
  326. })
  327. },
  328. updatazuxiao(){
  329. var that = this;
  330. api('deleuser',{
  331. },res=>{
  332. console.log(res)
  333. uni.setStorageSync('userInfo','');
  334. uni.setStorageSync('token','');
  335. that.disconectGoeasy();
  336. uni.navigateTo({
  337. url:'/pages/UserCenter/LoginView'
  338. })
  339. },failc=>{
  340. //console.log('getadvertis----',failc)
  341. })
  342. },
  343. disconectGoeasy(){
  344. this.goEasy.disconnect({
  345. onSuccess: function(){
  346. console.log("GoEasy disconnect successfully.")
  347. getApp().globalData.goEasycnt=false;
  348. },
  349. onFailed: function(error){
  350. console.log("Failed to disconnect GoEasy, code:"+error.code+ ",error:"+error.content);
  351. }
  352. });
  353. },
  354. yinsizhc(){
  355. uni.navigateTo({
  356. url:'/pages/index/mindex/yinszhengc'
  357. })
  358. },
  359. openWebView(index){
  360. var url=''
  361. if(index==1){
  362. url='https://cityexpress168.com.vn/bao-mat-thong-tin'
  363. }
  364. if(index==2){
  365. url='https://cityexpress168.com.vn/dieu-khoan-su-dung'
  366. }
  367. if(index==3){
  368. url='https://backend.cityexpress168.com.vn/operatingRegulations.html'
  369. }
  370. if(index==4){
  371. url='https://cityexpress168.com.vn/quy-trinh-giai-quyet-tranh-chap-khieu-nai'
  372. }
  373. if(index==5){
  374. url='https://cityexpress168.com.vn/dia-chi-cong-ty'
  375. }
  376. uni.navigateTo({
  377. url:'/pages/UserCenter/OpenWebview?url='+url
  378. })
  379. },
  380. gotogvWebview(){
  381. uni.navigateTo({
  382. url:'/pages/UserCenter/OpenWebview?url=http://online.gov.vn/UngDung/chi-tiet-3269'
  383. })
  384. }
  385. }
  386. }
  387. </script>
  388. <style>
  389. page{
  390. background-color: #F2F3F7;
  391. }
  392. .contentV{
  393. width: 100%;
  394. background-color: #00A6FF;
  395. }
  396. .viewinrow{
  397. display: flex;
  398. flex-direction: row;
  399. align-items: center;
  400. }
  401. .nodetail{
  402. display: flex;
  403. flex-direction: row;
  404. justify-content: space-between;
  405. align-items: center;
  406. background-color: #00A6FF;
  407. padding: 30rpx;
  408. }
  409. .userIcon{
  410. margin: 20rpx;
  411. width: 120rpx;
  412. height: 120rpx;
  413. border-radius: 60rpx;
  414. background-color: white;
  415. }
  416. .vipicon{
  417. width: 30rpx;
  418. }
  419. .userName{
  420. font-size: 30rpx;
  421. padding-left: 16rpx;
  422. color: white;
  423. }
  424. .usernont{
  425. font-size: 26rpx;
  426. color: white;
  427. padding-left: 16rpx;
  428. }
  429. .usernameCt{
  430. padding-left: 10rpx;
  431. text-align: left;
  432. font-size: 22rpx;
  433. line-height: 32rpx;
  434. }
  435. .fanhuiimg{
  436. width: 30rpx;
  437. height: 30rpx;
  438. margin-right: 50rpx;
  439. }
  440. .huiyuanxct{
  441. margin-top: 30rpx;
  442. width: 94%;
  443. margin-left: 3%;
  444. }
  445. .actBTVshang{
  446. width: 70%;
  447. padding-left: 15%;
  448. display: flex;
  449. flex-direction: row;
  450. justify-content:space-between;
  451. align-items: center;
  452. background-color: #00A6FF;
  453. }
  454. .actBTV{
  455. width: 100%;
  456. display: flex;
  457. flex-direction: row;
  458. justify-content:space-between;
  459. align-items: center;
  460. background-color: #00A6FF;
  461. }
  462. .actBTVn{
  463. margin-left: 3%;
  464. width: 94%;
  465. display: flex;
  466. flex-direction: row;
  467. justify-content:space-between;
  468. align-items: center;
  469. background-color: white;
  470. border-radius: 10rpx;
  471. box-shadow: -2rpx 2rpx 5rpx lightgrey;
  472. }
  473. .actbt{
  474. width: 25%;
  475. height: 160rpx;
  476. margin-top: 10rpx;
  477. align-items: center;
  478. justify-content: center;
  479. }
  480. .bticon{
  481. width: 80rpx;
  482. }
  483. .bticonb{
  484. width: 70rpx;
  485. }
  486. .acttext{
  487. color: white;
  488. text-align: center;
  489. }
  490. .acttextw{
  491. color: black;
  492. text-align: center;
  493. }
  494. .dangdanrukouT{
  495. height: 62rpx;
  496. background-color: #00A6FF;
  497. }
  498. .dingdantext{
  499. width: 100%;
  500. font-size: 30rpx;
  501. padding-left: 20rpx;
  502. padding-top: 20rpx;
  503. background-color: white;
  504. }
  505. .ddactbt{
  506. width: 20%;
  507. height: 120rpx;
  508. flex-direction: column;
  509. align-items: center;
  510. justify-content: center;
  511. }
  512. .ddbticon{
  513. width: 100%;
  514. height: 80rpx;
  515. display: flex;
  516. align-items: center;
  517. justify-content: center;
  518. }
  519. .ddtext{
  520. text-align: center;
  521. font-size: 20rpx;
  522. color: black;
  523. }
  524. .listcontent{
  525. margin-left: 3%;
  526. width: 94%;
  527. display: flex;
  528. box-shadow: -4rpx 6rpx 2rpx lightgrey;
  529. }
  530. .picker-view {
  531. width: 750rpx;
  532. height: 300rpx;
  533. margin-top: 10rpx;
  534. }
  535. .item {
  536. line-height: 100rpx;
  537. text-align: center;
  538. }
  539. .dangqbb{
  540. padding-top: 10rpx;
  541. font-size: 28rpx;
  542. }
  543. .tuichudl{
  544. padding: 10rpx 50rpx 10rpx 50rpx;
  545. border-radius: 20rpx;
  546. border: solid #00A6FF;
  547. border-width: 0px 0px 6rpx 0px;
  548. text-align: center;
  549. justify-content: center;
  550. background-color: #00A6FF;
  551. color: white;
  552. box-shadow: 0rpx 0rpx 10rpx 0rpx #00A6FF;
  553. }
  554. </style>