index.vue 31 KB

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