index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341
  1. <template>
  2. <view class="container">
  3. <!-- #ifdef H5 -->
  4. <view class="vheigh"></view>
  5. <!-- #endif -->
  6. <view class="user-info">
  7. <image src="http://ygs.hqgjsmc.com/baseimg/u-bg.png" mode="" class="user-info-bg"></image>
  8. <!-- #ifndef MP-WEIXIN -->
  9. <view class="user-info-tit">
  10. 个人中心
  11. </view>
  12. <!-- #endif -->
  13. <image src="../../static/user/u-set.png" mode="" class="u-set"
  14. @click.stop="navto('/pages/users/user_info/index')"></image>
  15. <view class="user-wrap">
  16. <view class="info-left flex">
  17. <view class="user-name">
  18. <image :src="userInfo.avatar" mode="" v-if="userInfo.avatar"></image>
  19. <image src="../../static/error/missing-face.png" mode="" v-else></image>
  20. <view class="user-font">
  21. <view class="name clamp">{{ userInfo.nickname }}</view>
  22. <view class="name clamp" @click="navto('/pages/users/login/index')"
  23. v-if="!userInfo.nickname ">登录</view>
  24. <view class="phone">{{ userInfo.phone | phone }}</view>
  25. <view class="yqm" v-if="userInfo.uid"><text class="yqm-left">邀请码</text>{{ userInfo.uid }}
  26. </view>
  27. </view>
  28. </view>
  29. <view class="kpi" v-if="userInfo && userInfo.level">
  30. <image src="http://ygs.hqgjsmc.com/baseimg/menber-bg.png" mode=""></image>
  31. <view class="user-level">V{{ userInfo.level }}会员</view>
  32. </view>
  33. </view>
  34. <!-- <view class="flex">
  35. <view class="info-right" @click="authTo('/pages/users/user_money/index')">
  36. <image class="iright-icon" src="../../static/user/user3.png" mode=""></image>
  37. <view class="iright-font">钱包余额:{{ userInfo.now_money || 0 }}</view>
  38. </view>
  39. <view class="info-right" @click="authTo('/pages/users/user_payment/index')">
  40. <image class="iright-icon" src="../../static/user/user3.png" mode=""></image>
  41. <view class="iright-font">充值钱包</view>
  42. </view>
  43. </view> -->
  44. </view>
  45. </view>
  46. <view class="u-ye flex">
  47. <view class="info-right" @click="authTo('/pages/users/user_money/index')">
  48. <image class="iright-icon" src="../../static/user/u-ye.png" mode="widthFix"></image>
  49. <view class="iright-font">余额:{{ userInfo.now_money || 0 }}</view>
  50. </view>
  51. <view class="" style="width: 4rpx;height: 35rpx;background: #FFFFFF;">
  52. </view>
  53. <view class="info-right" @click="authTo('/pages/users/user_payment/index')">
  54. <image class="iright-icon" src="../../static/user/u-cz.png" mode="widthFix"></image>
  55. <view class="iright-font">充值</view>
  56. </view>
  57. </view>
  58. <view class="u-up" @click="navto('/pages/store/settled/index')">
  59. <image src="../../static/user/u-up.png" mode="" class="u-up-bg"></image>
  60. <view class="u-up-tit">
  61. 申请成为供应商享受更多福利
  62. </view>
  63. <view class="u-up-btn">
  64. 去申请
  65. </view>
  66. </view>
  67. <view class="main-box">
  68. <view class="title flex">
  69. <view class="title-left">
  70. <view class="title-font">易博健康</view>
  71. </view>
  72. </view>
  73. <view class="main flex">
  74. <view class="item" @click="authTo('/pages/user/qyjf')">
  75. <image src="../../static/user/u-qy.png" mode="heightFix" class="item-img"></image>
  76. <view class="item-font">权益积分</view>
  77. <view class="item-num">{{ userInfo.healthy_integral * 1 || 0 }}</view>
  78. </view>
  79. <view class="item" @click="authTo('/pages/user/qyjf')">
  80. <image src="../../static/user/u-dsf.png" mode="heightFix" class="item-img"></image>
  81. <view class="item-font">待释放</view>
  82. <view class="item-num">{{ dsf * 1 || 0 }}</view>
  83. </view>
  84. <view class="item" @click="authTo('/pages/user/qyjf')">
  85. <image src="../../static/user/u-sr.png" mode="heightFix" class="item-img"></image>
  86. <view class="item-font">累计收入</view>
  87. <view class="item-num">{{ sr * 1 || 0 }}</view>
  88. </view>
  89. <view class="item" @click="authTo('/pages/user/qyjf')">
  90. <image src="../../static/user/u-zc.png" mode="heightFix" class="item-img"></image>
  91. <view class="item-font">累计支出</view>
  92. <view class="item-num">{{ zc * 1 || 0 }}</view>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="main-box">
  97. <view class="title flex">
  98. <view class="title-left">
  99. <view class="title-font">环球优购</view>
  100. </view>
  101. </view>
  102. <view class="main flex">
  103. <view class="item" @click="authTo('/pages/user/myjf')">
  104. <image src="../../static/user/u-djf.png" mode="heightFix" class="item-img"></image>
  105. <view class="item-font">动态积分</view>
  106. <view class="item-num">{{ userInfo.dynamic_integral * 1 || 0 }}</view>
  107. </view>
  108. <view class="item" @click="authTo('/pages/user/mygwjf')">
  109. <image src="../../static/user/u-jjf.png" mode="heightFix" class="item-img"></image>
  110. <view class="item-font">静态积分</view>
  111. <view class="item-num">{{ userInfo.integral * 1 || 0 }}</view>
  112. </view>
  113. <view class="item" @click="authTo('/pages/user/mythq')">
  114. <image src="../../static/user/u-xfq.png" mode="heightFix" class="item-img"></image>
  115. <view class="item-font">消费券</view>
  116. <view class="item-num">{{ userInfo.consumption * 1 || 0 }}</view>
  117. </view>
  118. <view class="item" @click="authTo('/pages/user/myggz')">
  119. <image src="../../static/user/u-gxz.png" mode="heightFix" class="item-img"></image>
  120. <view class="item-font">贡献值</view>
  121. <view class="item-num">{{ userInfo.contribution * 1 || 0 }}</view>
  122. </view>
  123. </view>
  124. </view>
  125. <view class="main-box">
  126. <view class="title flex" @click="authTo('/pages/users/order_list/index')">
  127. <view class="title-left">
  128. <!-- <image class="title-icon" src="../../static/user/user5.png" mode=""></image> -->
  129. <view class="title-font">我的订单</view>
  130. </view>
  131. <image class="title-right" src="../../static/img/back.png" mode=""></image>
  132. </view>
  133. <view class="main flex">
  134. <view class="oitem" @click="authTo('/pages/users/order_list/index?state=0')">
  135. <image class="oitem-image" src="../../static/user/user6.png" mode=""></image>
  136. <view class="oitem-font">待付款</view>
  137. </view>
  138. <view class="oitem" @click="authTo('/pages/users/order_list/index?state=1')">
  139. <image class="oitem-image" src="../../static/user/user7.png" mode=""></image>
  140. <view class="oitem-font">待发货</view>
  141. </view>
  142. <view class="oitem" @click="authTo('/pages/users/order_list/index?state=2')">
  143. <image class="oitem-image" src="../../static/user/user8.png" mode=""></image>
  144. <view class="oitem-font">待收货</view>
  145. </view>
  146. <view class="oitem" @click="authTo('/pages/users/order_list/index?state=3')">
  147. <image class="oitem-image" src="../../static/user/user9.png" mode=""></image>
  148. <view class="oitem-font">已完成</view>
  149. </view>
  150. </view>
  151. </view>
  152. <view class="my-tools">
  153. <view class="my-order">
  154. <view class="order">我的功能</view>
  155. <!-- <image src="../../static/img/xiangxia.png" mode="scaleToFill"></image> -->
  156. </view>
  157. <view class="tool flex">
  158. <!-- #ifndef APP-PLUS -->
  159. <view class="tool-item" @click="authTo('/pages/users/promoter-list/index')">
  160. <view class="tool-img">
  161. <image src="../../static/icon/gn1.png" mode=""></image>
  162. </view>
  163. <view class="tool-name">我的推广</view>
  164. </view>
  165. <!-- #endif -->
  166. <view class="tool-item" @click="authTo('/pages/users/user_spread_code/index')">
  167. <view class="tool-img">
  168. <image src="../../static/icon/gn2.png" mode=""></image>
  169. </view>
  170. <view class="tool-name">邀请有礼</view>
  171. </view>
  172. <view class="tool-item" @click="authTo('/pages/users/user_goods_collection/index')">
  173. <view class="tool-img">
  174. <image src="../../static/icon/gn3.png" mode=""></image>
  175. </view>
  176. <view class="tool-name">我的收藏</view>
  177. </view>
  178. <view class="tool-item" @click="authTo('/pages/users/retrievePassword/index')">
  179. <view class="tool-img">
  180. <image src="../../static/icon/i8.png" mode=""></image>
  181. </view>
  182. <view class="tool-name">修改密码</view>
  183. </view>
  184. <view class="tool-item" @click="openKf()">
  185. <view class="tool-img">
  186. <image src="../../static/icon/gn5.png" mode=""></image>
  187. </view>
  188. <view class="tool-name">客服中心</view>
  189. </view>
  190. <view class="tool-item" @click="authTo('/pages/users/user_address_list/index')">
  191. <view class="tool-img">
  192. <image src="../../static/icon/gn6.png" mode=""></image>
  193. </view>
  194. <view class="tool-name">收货地址</view>
  195. </view>
  196. <view class="tool-item" @click="authTo('/pages/users/user_info/index')">
  197. <view class="tool-img">
  198. <image src="../../static/icon/gn7.png" mode=""></image>
  199. </view>
  200. <view class="tool-name">设置</view>
  201. </view>
  202. </view>
  203. </view>
  204. <view class="" style="height: 100rpx;"></view>
  205. <uni-popup ref="popupkf" type="center">
  206. <view class="popup-box">
  207. <view class="img">
  208. <image src="http://ygs.hqgjsmc.com/baseimg/img009.png" mode=""></image>
  209. </view>
  210. <view class="mian">
  211. <view class="delivery">
  212. <view class="title">已经为您定制专属客服</view>
  213. <image src="http://ygs.hqgjsmc.com/baseimg/img010.png" mode=""></image>
  214. </view>
  215. <view class="nocancel" @click.stop="makePhone">联系电话:{{ lxphone }}</view>
  216. <view class="nocancel">客服VX:{{ text }}</view>
  217. <view class="comfirm-box">
  218. <view class="cancel" @click="cancel">取消</view>
  219. <view class="comfirm" @click="comfirm(text)">复制微信</view>
  220. </view>
  221. </view>
  222. </view>
  223. </uni-popup>
  224. <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"
  225. :isGoIndex="false"></authorize> -->
  226. <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
  227. <!-- #ifndef H5 -->
  228. <passwordPopup></passwordPopup>
  229. <!-- #endif -->
  230. </view>
  231. </template>
  232. <script>
  233. import {
  234. userBalance,
  235. healthyIntegrallist
  236. } from '@/api/wallet.js';
  237. import {
  238. getMenuList,
  239. getUserInfo,
  240. setVisit
  241. } from '@/api/user.js';
  242. import {
  243. orderData
  244. } from '@/api/order.js';
  245. import {
  246. mapGetters,
  247. mapMutations
  248. } from 'vuex';
  249. import authorize from '@/components/Authorize';
  250. // #ifndef H5
  251. import passwordPopup from '@/components/passwordPopup';
  252. // #endif
  253. import {
  254. configMap
  255. } from '@/utils';
  256. import Auth from '../../libs/wechat';
  257. import {
  258. HTTP_REQUEST_URL
  259. } from '@/config/app';
  260. const app = getApp();
  261. export default {
  262. components: {
  263. // #ifndef H5
  264. passwordPopup,
  265. // #endif
  266. authorize
  267. },
  268. computed: configMap({
  269. mer_intention_open: 0,
  270. hide_mer_status: 1,
  271. recharge_switch: 0,
  272. integral_status: 0,
  273. member_status: 0,
  274. balance_func_status: 0,
  275. copyright_status: '',
  276. copyright_image: '',
  277. copyright_context: ''
  278. },
  279. mapGetters(['isLogin', 'viewColor', 'keyColor'])
  280. ),
  281. data() {
  282. return {
  283. lxphone: '0575-87601131',
  284. text: 'yibo2709', //客服微信
  285. domain: HTTP_REQUEST_URL,
  286. showSkeleton: true, //骨架屏显示隐藏
  287. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  288. orderMenu: [{
  289. img: '/static/diy/order1',
  290. title: '待付款',
  291. url: '/pages/users/order_list/index?status=0',
  292. num: 0
  293. },
  294. {
  295. img: '/static/diy/order2',
  296. title: '待发货',
  297. url: '/pages/users/order_list/index?status=1',
  298. num: 0
  299. },
  300. {
  301. img: '/static/diy/order3',
  302. title: '待收货',
  303. url: '/pages/users/order_list/index?status=2',
  304. num: 0
  305. },
  306. {
  307. img: '/static/diy/order4',
  308. title: '待评价',
  309. url: '/pages/users/order_list/index?status=3',
  310. num: 0
  311. },
  312. {
  313. img: '/static/diy/order5',
  314. title: '售后/退款',
  315. url: '/pages/users/refund/list',
  316. num: 0
  317. }
  318. ],
  319. imgUrls: [{
  320. url: '',
  321. pic: ''
  322. }],
  323. userMenu: [],
  324. skeletonMenu: [],
  325. personalMenu: [{
  326. pic: '',
  327. name: '',
  328. isShow: true
  329. },
  330. {
  331. pic: '',
  332. name: '',
  333. isShow: true
  334. },
  335. {
  336. pic: '',
  337. name: '',
  338. isShow: true
  339. },
  340. {
  341. pic: '',
  342. name: '',
  343. isShow: true
  344. },
  345. {
  346. pic: '',
  347. name: '',
  348. isShow: true
  349. },
  350. {
  351. pic: '',
  352. name: '',
  353. isShow: true
  354. },
  355. {
  356. pic: '',
  357. name: '',
  358. isShow: true
  359. },
  360. {
  361. pic: '',
  362. name: '',
  363. isShow: true
  364. },
  365. {
  366. pic: '',
  367. name: '',
  368. isShow: true
  369. },
  370. {
  371. pic: '',
  372. name: '',
  373. isShow: true
  374. },
  375. {
  376. pic: '',
  377. name: '',
  378. isShow: true
  379. },
  380. {
  381. pic: '',
  382. name: '',
  383. isShow: true
  384. }
  385. ],
  386. autoplay: true,
  387. circular: true,
  388. interval: 3000,
  389. duration: 500,
  390. isAuto: false, //没有授权的不会自动授权
  391. isShowAuth: false, //是否隐藏授权
  392. orderStatusNum: {},
  393. userInfo: {
  394. aratar: '/static/f.png'
  395. },
  396. MyMenus: [],
  397. is_promoter: 0, //推广人开关 1开
  398. extension_status: 0,
  399. dsf: 0,
  400. zc: 0,
  401. sr: 0
  402. };
  403. },
  404. onLoad() {
  405. setTimeout(() => {
  406. this.showSkeleton = false;
  407. }, 500);
  408. },
  409. onReady() {
  410. this.isNodes++;
  411. },
  412. filters: {
  413. phone(value) {
  414. if (!value) return '';
  415. let str = value;
  416. str = str.replace(new RegExp("[^0-9]+", "g"), "")
  417. if (str.length == 11) {
  418. str = str.toString().replace(/(\d{3})\d*(\d{4})/, '$1****$2')
  419. } else {
  420. str = str.toString().replace(/(\d{3})\d*(\d{4})/, '$1****$2')
  421. }
  422. return str;
  423. }
  424. },
  425. mounted: function() {},
  426. onShow: function() {
  427. let that = this;
  428. if (that.isLogin) {
  429. this.getUserInfo();
  430. this.orderNum();
  431. } else {
  432. this.userInfo = {};
  433. this.orderMenu.forEach(v => {
  434. v.num = 0;
  435. });
  436. this.getMyMenus();
  437. setTimeout(() => {
  438. this.isAuto = true;
  439. this.isShowAuth = true
  440. }, 300);
  441. }
  442. },
  443. methods: {
  444. ...mapMutations(['UPDATE_USERINFO']),
  445. makePhone() {
  446. uni.makePhoneCall({
  447. phoneNumber: this.lxphone
  448. })
  449. },
  450. authTo(url) {
  451. if (this.isLogin) {
  452. uni.navigateTo({
  453. url
  454. });
  455. } else {
  456. this.openAuto();
  457. }
  458. },
  459. navto(url) {
  460. uni.navigateTo({
  461. url,
  462. fail() {
  463. uni.switchTab({
  464. url
  465. })
  466. }
  467. })
  468. },
  469. toService(mer) {
  470. uni.navigateTo({
  471. url: '/pages/admin/business/index?is_sys=' + (mer ? '0' : '1')
  472. });
  473. },
  474. // 菜单显示
  475. filterMenus: function(item) {
  476. let that = this;
  477. if (item.url == '/pages/users/user_money/index') item.isShow = that.balance_func_status == 1;
  478. else if (item.url == '/pages/users/user_spread_user/index') {
  479. if (that.extension_status == 0) {
  480. item.isShow = false;
  481. } else if (that.extension_status == 1) {
  482. if (that.is_promoter == 1) {
  483. item.isShow = that.is_promoter == 1 && that.extension_status == 1;
  484. } else if (that.is_promoter == 0) {
  485. item.isShow = that.is_promoter == 0 && that.extension_status == 1;
  486. item.url = '/pages/users/distributor/index';
  487. }
  488. }
  489. } else if (item.url == '/pages/store/settled/index') item.isShow = that.mer_intention_open == 1 && that
  490. .hide_mer_status != 1;
  491. else if (item.url == '/pages/users/user_grade/index') item.isShow = that.member_status == 1;
  492. else if (item.url == '/pages/users/user_integral/index') item.isShow = that.integral_status == 1;
  493. else item.isShow = true;
  494. },
  495. showMenu(menu) {
  496. return !menu || ['integral', 'service', 'admin_order', 'verify_order', 'intention', 'promoter', 'balance']
  497. .indexOf(menu) === -1;
  498. },
  499. goUrl(url) {
  500. if (url.indexOf('http') != -1) {
  501. // #ifdef H5
  502. location.href = url;
  503. // #endif
  504. } else {
  505. if (['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart', '/pages/user/index',
  506. '/pages/plant_grass/index'
  507. ].indexOf(url) == -1) {
  508. uni.navigateTo({
  509. url: url
  510. });
  511. } else {
  512. uni.switchTab({
  513. url: url
  514. });
  515. }
  516. }
  517. },
  518. // 去聊天列表
  519. goChat() {
  520. let type = this.userInfo.service ? 1 : 0;
  521. uni.navigateTo({
  522. url: `/pages/chat/customer_list/index?type=${type}`
  523. });
  524. },
  525. // 记录会员访问
  526. setVisit() {
  527. setVisit({
  528. url: '/pages/user/index'
  529. }).then(res => {});
  530. },
  531. // 打开授权
  532. openAuto() {
  533. this.isAuto = true;
  534. this.isShowAuth = true;
  535. },
  536. // 授权回调
  537. onLoadFun() {
  538. this.getUserInfo();
  539. this.getMyMenus();
  540. this.orderNum();
  541. this.isShowAuth = false;
  542. },
  543. Setting: function() {
  544. uni.openSetting({
  545. success: function(res) {}
  546. });
  547. },
  548. // 授权关闭
  549. authColse: function(e) {
  550. this.isShowAuth = e;
  551. },
  552. // 绑定手机
  553. bindPhone() {
  554. uni.navigateTo({
  555. url: '/pages/users/user_phone/index'
  556. });
  557. },
  558. /**
  559. * 获取个人用户信息
  560. */
  561. getUserInfo: function() {
  562. let that = this;
  563. getUserInfo().then(res => {
  564. this.UPDATE_USERINFO(res.data);
  565. (that.userInfo = res.data), (that.is_promoter = res.data.is_promoter);
  566. that.extension_status = res.data.extension_status;
  567. that.getMyMenus();
  568. that.getHealthy()
  569. });
  570. },
  571. //获取健康数据
  572. getHealthy() {
  573. healthyIntegrallist().then(res => {
  574. this.dsf = res.data.dsf
  575. this.zc = res.data.zc
  576. this.sr = res.data.sr
  577. })
  578. },
  579. // 订单数字
  580. orderNum() {
  581. orderData().then(({
  582. data
  583. }) => {
  584. this.orderMenu.forEach((item, index) => {
  585. switch (item.title) {
  586. case '待付款':
  587. item.num = data.noPay;
  588. break;
  589. case '待发货':
  590. item.num = data.noPostage;
  591. break;
  592. case '待收货':
  593. item.num = data.noDeliver;
  594. break;
  595. case '待评价':
  596. item.num = data.noComment;
  597. break;
  598. case '售后/退款':
  599. item.num = data.refund;
  600. break;
  601. }
  602. });
  603. });
  604. },
  605. /**
  606. *
  607. * 获取个人中心图标
  608. */
  609. getMyMenus: function() {
  610. let that = this;
  611. if (this.MyMenus.length) return;
  612. getMenuList().then(res => {
  613. that.personalMenu = [];
  614. res.data.menu.forEach((item, index) => {
  615. that.filterMenus(item);
  616. that.personalMenu.push(item);
  617. });
  618. that.imgUrls = res.data.banner;
  619. });
  620. },
  621. // 编辑页面
  622. goEdit() {
  623. if (this.isLogin) {
  624. uni.navigateTo({
  625. url: '/pages/users/user_info/index'
  626. });
  627. } else {
  628. this.openAuto();
  629. }
  630. },
  631. goSetting() {
  632. if (this.isLogin) {
  633. uni.navigateTo({
  634. url: '/pages/users/user_setting/index'
  635. });
  636. } else {
  637. this.openAuto();
  638. }
  639. },
  640. // 签到
  641. goSignIn() {
  642. uni.navigateTo({
  643. url: '/pages/users/user_sgin/index'
  644. });
  645. },
  646. // goMenuPage
  647. goMenuPage(url) {
  648. if (this.isLogin) {
  649. uni.navigateTo({
  650. url
  651. });
  652. } else {
  653. this.openAuto();
  654. }
  655. },
  656. // 复制客服微信
  657. comfirm(text) {
  658. console.log(text);
  659. const result = this.uniCopy(text);
  660. if (result === false) {
  661. uni.showToast({
  662. title: '不支持'
  663. });
  664. } else {
  665. uni.showToast({
  666. title: '复制成功',
  667. icon: 'none'
  668. });
  669. }
  670. this.$refs.popupkf.close();
  671. },
  672. // 打开客服
  673. openKf() {
  674. this.$refs.popupkf.open();
  675. },
  676. // 关闭客服
  677. cancel() {
  678. this.$refs.popupkf.close();
  679. },
  680. uniCopy(content) {
  681. /**
  682. * 小程序端 和 app端的复制逻辑
  683. */
  684. //#ifndef H5
  685. uni.setClipboardData({
  686. data: content,
  687. success: function() {
  688. console.log('success');
  689. return true;
  690. }
  691. });
  692. //#endif
  693. /**
  694. * H5端的复制逻辑
  695. */
  696. // #ifdef H5
  697. if (!document.queryCommandSupported('copy')) {
  698. //为了兼容有些浏览器 queryCommandSupported 的判断
  699. // 不支持
  700. return false;
  701. }
  702. let textarea = document.createElement('textarea');
  703. textarea.value = content;
  704. textarea.readOnly = 'readOnly';
  705. document.body.appendChild(textarea);
  706. textarea.select(); // 选择对象
  707. textarea.setSelectionRange(0, content.length); //核心
  708. let result = document.execCommand('copy'); // 执行浏览器复制命令
  709. textarea.remove();
  710. return result;
  711. // #endif
  712. },
  713. }
  714. };
  715. </script>
  716. <style lang="scss">
  717. %flex-center {
  718. display: flex;
  719. flex-direction: column;
  720. justify-content: center;
  721. align-items: center;
  722. }
  723. %section {
  724. display: flex;
  725. justify-content: space-around;
  726. align-content: center;
  727. background: #fff;
  728. border-radius: 10rpx;
  729. }
  730. .container,
  731. page {
  732. min-height: 100%;
  733. height: auto;
  734. background-color: #fff;
  735. // background-color: $page-color-base;
  736. }
  737. .vheigh {
  738. height: var(--status-bar-height);
  739. background-color: #fff;
  740. }
  741. .top-image {
  742. position: absolute;
  743. top: 0;
  744. left: 0;
  745. right: 0;
  746. height: 230rpx;
  747. image {
  748. width: 100%;
  749. height: 100%;
  750. }
  751. }
  752. .tool-list {
  753. width: 690rpx;
  754. margin: auto;
  755. margin-top: 20rpx;
  756. background: #ffffff;
  757. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  758. border-radius: 20rpx;
  759. }
  760. .popup-box {
  761. width: 522rpx;
  762. height: 605rpx;
  763. background-color: #ffffff;
  764. border-radius: 20rpx;
  765. position: relative;
  766. .img {
  767. position: relative;
  768. top: -56rpx;
  769. left: 0;
  770. width: 522rpx;
  771. height: 132rpx;
  772. display: flex;
  773. justify-content: center;
  774. image {
  775. border-radius: 20rpx 20rpx 0 0;
  776. width: 450rpx;
  777. height: 132rpx;
  778. }
  779. }
  780. .mian {
  781. margin-top: -44rpx;
  782. display: flex;
  783. flex-direction: column;
  784. align-items: center;
  785. // padding: 32rpx 32rpx;
  786. background-color: #ffffff;
  787. border-radius: 0 0 20rpx 20rpx;
  788. text-align: center;
  789. .delivery {
  790. font-size: 40rpx;
  791. color: #333333;
  792. display: flex;
  793. align-items: center;
  794. flex-direction: column;
  795. image {
  796. margin-top: 48rpx;
  797. width: 172rpx;
  798. height: 160rpx;
  799. }
  800. }
  801. .nocancel {
  802. font-size: 32rpx;
  803. color: #333333;
  804. margin-top: 14rpx;
  805. }
  806. .comfirm-box {
  807. margin-top: 52rpx;
  808. display: flex;
  809. // margin-bottom: 32rpx;
  810. // justify-content: space-around;
  811. .cancel {
  812. display: flex;
  813. align-items: center;
  814. justify-content: center;
  815. width: 197rpx;
  816. height: 74rpx;
  817. border: 1px solid #dcc786;
  818. border-radius: 38rpx;
  819. font-size: 32rpx;
  820. color: #605128;
  821. }
  822. .comfirm {
  823. margin-left: 32rpx;
  824. display: flex;
  825. align-items: center;
  826. justify-content: center;
  827. width: 197rpx;
  828. height: 74rpx;
  829. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  830. border-radius: 38px;
  831. font-size: 32rpx;
  832. color: #605128;
  833. }
  834. }
  835. }
  836. }
  837. .popup {
  838. width: 560rpx;
  839. padding-bottom: 45rpx;
  840. background-color: #ffffff;
  841. border-radius: 15rpx;
  842. text-align: center;
  843. line-height: 1;
  844. .popup-dox {
  845. position: relative;
  846. .popup-logo {
  847. margin: -160rpx auto 0;
  848. width: 400rpx;
  849. height: 200rpx;
  850. }
  851. }
  852. .popup-title {
  853. margin-top: 85rpx;
  854. font-size: 40rpx;
  855. font-family: PingFang SC;
  856. font-weight: bold;
  857. color: #2a2a2a;
  858. text {
  859. font-size: 56rpx;
  860. color: #e83f30;
  861. }
  862. }
  863. .popup-tip {
  864. margin-top: 20rpx;
  865. font-size: 28rpx;
  866. font-family: PingFang SC;
  867. font-weight: 500;
  868. color: #8c8c8c;
  869. text {
  870. color: #e83f30;
  871. }
  872. }
  873. .popup-btn {
  874. margin: 58rpx auto 0;
  875. width: 270rpx;
  876. height: 66rpx;
  877. background: #f0c838;
  878. border-radius: 34rpx;
  879. text-align: center;
  880. line-height: 66rpx;
  881. font-size: 36rpx;
  882. font-family: Source Han Sans CN;
  883. font-weight: 500;
  884. color: #ffffff;
  885. }
  886. }
  887. .user-wrap {
  888. position: absolute;
  889. z-index: 10;
  890. width: 690rpx;
  891. // height: 283rpx;
  892. // background: #ffffff;
  893. // box-shadow: 0px 4rpx 13rpx 0px rgba(229, 229, 229, 0.46);
  894. border-radius: 20rpx;
  895. margin: auto;
  896. // top: 0;
  897. bottom: 133rpx;
  898. .info-left {
  899. padding-left: 34rpx;
  900. .user-name {
  901. display: flex;
  902. align-items: center;
  903. image {
  904. width: 120rpx;
  905. height: 120rpx;
  906. border-radius: 50%;
  907. }
  908. .user-font {
  909. padding-left: 34rpx;
  910. .name {
  911. width: 250rpx;
  912. font-size: 40rpx;
  913. font-family: Source Han Sans CN;
  914. font-weight: 400;
  915. color: #fff;
  916. }
  917. .phone {
  918. margin: 10rpx 0;
  919. font-size: 20rpx;
  920. font-family: PingFang SC;
  921. font-weight: 500;
  922. color: #fff;
  923. }
  924. .yqm {
  925. height: 30rpx;
  926. line-height: 30rpx;
  927. display: inline-block;
  928. border-radius: 15rpx;
  929. background-color: #474758;
  930. padding: 0 15rpx 0 0;
  931. color: #FBD9A1;
  932. font-size: 18rpx;
  933. .yqm-left {
  934. padding: 0 10rpx;
  935. margin-right: 10rpx;
  936. display: inline-block;
  937. background: linear-gradient(-58deg, #C49B5C 0%, #EED9A7 100%);
  938. border-radius: 15rpx;
  939. color: #474758;
  940. font-size: 16rpx;
  941. }
  942. }
  943. }
  944. }
  945. .kpi {
  946. width: 178rpx;
  947. height: 60rpx;
  948. position: relative;
  949. image {
  950. position: absolute;
  951. top: 0;
  952. left: 0;
  953. width: 178rpx;
  954. height: 60rpx;
  955. }
  956. .user-level {
  957. position: absolute;
  958. top: 0;
  959. right: 0;
  960. height: 60rpx;
  961. line-height: 60rpx;
  962. width: 120rpx;
  963. // background-color: red;
  964. font-size: 28rpx;
  965. font-weight: 500;
  966. color: #93794b;
  967. text-align: right;
  968. padding-right: 24rpx;
  969. }
  970. }
  971. }
  972. .info-right {
  973. display: flex;
  974. align-items: center;
  975. margin-top: 54rpx;
  976. padding: 0 34rpx;
  977. .iright-icon {
  978. width: 32rpx;
  979. height: 32rpx;
  980. }
  981. .iright-font {
  982. margin-left: 12rpx;
  983. font-size: 28rpx;
  984. font-family: PingFang SC;
  985. font-weight: bold;
  986. color: #333333;
  987. }
  988. }
  989. }
  990. .user-set {
  991. justify-content: flex-end;
  992. height: 100rpx;
  993. view {
  994. flex-shrink: 0;
  995. }
  996. padding: 30rpx;
  997. image {
  998. height: 40rpx;
  999. width: 40rpx;
  1000. }
  1001. }
  1002. .main-box {
  1003. margin: 20rpx auto 0;
  1004. width: 710rpx;
  1005. background: #ffffff;
  1006. // box-shadow: 0px 4rpx 14rpx 0px rgba(229, 229, 229, 0.46);
  1007. border-radius: 20rpx;
  1008. .title {
  1009. display: flex;
  1010. justify-content: space-between;
  1011. align-items: center;
  1012. padding: 24rpx;
  1013. padding-left: 0;
  1014. // border-bottom: 1px solid #eeeeee;
  1015. .title-left {
  1016. display: flex;
  1017. align-items: center;
  1018. .title-icon {
  1019. width: 32rpx;
  1020. height: 32rpx;
  1021. }
  1022. .title-font {
  1023. // margin-left: 20rpx;
  1024. font-size: 28rpx;
  1025. font-family: PingFang SC;
  1026. font-weight: bold;
  1027. color: #333333;
  1028. }
  1029. }
  1030. .title-right {
  1031. width: 14rpx;
  1032. height: 24rpx;
  1033. }
  1034. }
  1035. .main {
  1036. padding: 30rpx 0 0rpx;
  1037. // flex-wrap: wrap;
  1038. justify-content: flex-start;
  1039. .jg {
  1040. width: 1px;
  1041. height: 100rpx;
  1042. background: #eeeeee;
  1043. margin-top: 20rpx;
  1044. }
  1045. .item {
  1046. // padding-bottom: 20rpx;
  1047. width: 25%;
  1048. display: flex;
  1049. flex-direction: column;
  1050. align-items: center;
  1051. margin-top: 20rpx;
  1052. font-size: 24rpx;
  1053. font-weight: 500;
  1054. .item-img {
  1055. height: 47rpx;
  1056. }
  1057. .item-num {
  1058. color: #999999;
  1059. }
  1060. .item-font {
  1061. color: #333333;
  1062. padding-top: 15rpx;
  1063. }
  1064. }
  1065. .oitem {
  1066. width: 25%;
  1067. display: flex;
  1068. flex-direction: column;
  1069. align-items: center;
  1070. .oitem-image {
  1071. height: 50rpx;
  1072. width: 48rpx;
  1073. }
  1074. .oitem-font {
  1075. margin-top: 20rpx;
  1076. font-size: 24rpx;
  1077. font-family: PingFang SC;
  1078. font-weight: 500;
  1079. color: #333333;
  1080. }
  1081. }
  1082. }
  1083. }
  1084. .gpai {
  1085. width: 100rpx;
  1086. line-height: 40rpx;
  1087. border-radius: 25rpx;
  1088. position: absolute;
  1089. top: 120rpx;
  1090. left: 40rpx;
  1091. font-size: 24rpx;
  1092. color: #c6914e;
  1093. text-align: center;
  1094. background-color: #f2d4ae;
  1095. }
  1096. .my-tools {
  1097. width: 710rpx;
  1098. // height: 418rpx;
  1099. background: #ffffff;
  1100. // box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  1101. border-radius: 20rpx;
  1102. margin: 20rpx auto;
  1103. // background-color: red;
  1104. .my-order {
  1105. height: 73rpx;
  1106. width: 100%;
  1107. // border-bottom: 2rpx solid #f5f5f5;
  1108. display: flex;
  1109. align-items: center;
  1110. justify-content: flex-start;
  1111. .order {
  1112. font-size: 30rpx;
  1113. font-family: PingFang SC;
  1114. font-weight: bold;
  1115. color: #333333;
  1116. // margin-left: 36rpx;
  1117. margin-right: 520rpx;
  1118. }
  1119. image {
  1120. width: 12rpx;
  1121. height: 22rpx;
  1122. }
  1123. }
  1124. .tool {
  1125. flex-wrap: wrap;
  1126. justify-content: flex-start;
  1127. align-items: center;
  1128. .tool-item {
  1129. width: 25%;
  1130. height: 160rpx;
  1131. // background-color: #bfa;
  1132. display: flex;
  1133. align-items: center;
  1134. flex-direction: column;
  1135. justify-content: center;
  1136. .tool-img {
  1137. width: 42rpx;
  1138. height: 42rpx;
  1139. image {
  1140. width: 100%;
  1141. height: 100%;
  1142. }
  1143. }
  1144. .tool-name {
  1145. padding-top: 20rpx;
  1146. font-size: 24rpx;
  1147. font-family: PingFang SC;
  1148. font-weight: 500;
  1149. color: #333333;
  1150. }
  1151. }
  1152. }
  1153. }
  1154. .user-info {
  1155. width: 750rpx;
  1156. height: 433rpx;
  1157. position: relative;
  1158. .user-info-bg {
  1159. width: 750rpx;
  1160. height: 433rpx;
  1161. }
  1162. .user-info-tit {
  1163. width: 100%;
  1164. position: absolute;
  1165. /* #ifdef H5 */
  1166. top: 24rpx;
  1167. /* #endif */
  1168. /* #ifdef APP-PLUS */
  1169. top: 44px;
  1170. /* #endif */
  1171. text-align: center;
  1172. font-size: 34rpx;
  1173. font-weight: 500;
  1174. color: #FFFFFF;
  1175. }
  1176. .u-set {
  1177. display: block;
  1178. width: 46rpx;
  1179. height: 48rpx;
  1180. position: absolute;
  1181. right: 32rpx;
  1182. bottom: 210rpx;
  1183. }
  1184. }
  1185. .u-ye {
  1186. width: 750rpx;
  1187. height: 80rpx;
  1188. background: #D66650;
  1189. align-items: center;
  1190. color: #fff;
  1191. .info-right {
  1192. width: 50%;
  1193. display: flex;
  1194. align-items: center;
  1195. padding: 0 34rpx;
  1196. justify-content: center;
  1197. .iright-icon {
  1198. width: 32rpx;
  1199. // height: 32rpx;
  1200. }
  1201. .iright-font {
  1202. margin-left: 12rpx;
  1203. font-size: 26rpx;
  1204. font-weight: bold;
  1205. }
  1206. }
  1207. }
  1208. .u-up {
  1209. width: 690rpx;
  1210. height: 90rpx;
  1211. margin: 20rpx auto;
  1212. position: relative;
  1213. image {
  1214. width: 690rpx;
  1215. height: 90rpx;
  1216. }
  1217. .u-up-tit {
  1218. font-size: 30rpx;
  1219. font-weight: 500;
  1220. color: #FFE1AA;
  1221. line-height: 90rpx;
  1222. position: absolute;
  1223. top: 0;
  1224. left: 73rpx;
  1225. }
  1226. .u-up-btn {
  1227. position: absolute;
  1228. right: 20rpx;
  1229. top: 0;
  1230. bottom: 0;
  1231. margin: auto;
  1232. width: 148rpx;
  1233. height: 50rpx;
  1234. line-height: 50rpx;
  1235. background: linear-gradient(-90deg, #FFD070 0%, #FFDEA2 99%);
  1236. border-radius: 25px;
  1237. font-size: 28rpx;
  1238. font-weight: 500;
  1239. color: #1C1E1F;
  1240. text-align: center;
  1241. }
  1242. }
  1243. </style>