index.vue 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  1. <template>
  2. <view :data-theme="theme">
  3. <!-- #ifdef MP -->
  4. <view class="cart_nav" :style='"height:"+navH+"rpx;"'>
  5. <nav-bar iconColor='#fff' ref="navBarRef" navTitle="个人中心">
  6. </nav-bar>
  7. </view>
  8. <!-- #endif -->
  9. <tui-skeleton v-if="showSkeleton"></tui-skeleton>
  10. <view class="new-users copy-data tui-skeleton">
  11. <view class="mid" style="flex:1;overflow: hidden;">
  12. <scroll-view scroll-y="true">
  13. <view class="head borderPad">
  14. <view class="bg"
  15. :style="{'background-image': `url(${urlDomain}crmebimage/presets/user_bg.png)`}">
  16. <view class="user-card">
  17. <view class="user-info">
  18. <image class="avatar tui-skeleton-rect" :src='userInfo.avatar'
  19. v-if="userInfo.avatar" @click="goEdit()"></image>
  20. <image v-else class="avatar tui-skeleton-rect"
  21. :src="urlDomain+'crmebimage/presets/morenT.png'" mode="" @click="goEdit()">
  22. </image>
  23. <view class="info">
  24. <view class="name" v-if="!isLogin" @tap="openAuto">
  25. 请点击登录
  26. </view>
  27. <view class="name" v-if="userInfo && uid">
  28. <view @click="goEdit()">
  29. {{userInfo && userInfo.nickname && uid ? userInfo.nickname : ''}}
  30. </view>
  31. <view class="vip" v-if="userInfo.vipIcon" @click="goEdit()">
  32. <image :src="userInfo.vipIcon" alt=""></image>
  33. </view>
  34. <view class="vip" v-if="userInfo.isPaidMember"
  35. @click="menusTap('/pages/activity/vip_paid/index')">
  36. <image
  37. :style="{'background-image': `url(${urlDomain}crmebimage/presets/viptu.png)`}">
  38. </image>
  39. </view>
  40. </view>
  41. <view class="num mt10" v-if="userInfo && userInfo.phone && uid"
  42. @click="goEdit()">
  43. <view class="num-txt">{{userInfo.phone}}</view>
  44. </view>
  45. </view>
  46. <view class="app_set" @click="handleUserSetting()">
  47. <text class="iconfont icon-shezhi"></text>
  48. </view>
  49. </view>
  50. <view class="num-wrapper tui-skeleton-rect">
  51. <view class="num-item" @click="goMenuPage('/pages/merchant/user_integral/index')">
  52. <text class="num">{{userInfo.integral && uid ? userInfo.integral: 0}}</text>
  53. <view class="txt">积分</view>
  54. </view>
  55. <view class="num-item" @click="goMenuPage('/pages/users/user_coupon/index')">
  56. <text
  57. class="num">{{userInfo.couponCount && uid ? userInfo.couponCount : 0}}</text>
  58. <view class="txt">优惠券</view>
  59. </view>
  60. <view class="num-item"
  61. @click="goMenuPage('/pages/goods/user_goods_collection/index')">
  62. <text
  63. class="num">{{userInfo.collectCount && uid ? userInfo.collectCount : 0}}</text>
  64. <view class="txt">收藏</view>
  65. </view>
  66. <view class="num-item" @click="goMenuPage('/pages/goods/browsing_history/index')">
  67. <text class="num">{{userInfo.browseNum && uid ? userInfo.browseNum:0}}</text>
  68. <view class="txt">浏览记录</view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <view v-show="userInfo.paidMemberPaidEntrance===1"
  74. @click="menusTap('/pages/activity/vip_paid/index')" class="h-128 svip-box px-30"
  75. :style="{'background-image': `url(${urlDomain}crmebimage/presets/cardbj.png)`}">
  76. <view class="acea-row row-middle row-between h-94">
  77. <view class="acea-row">
  78. <view class="w-34 h-28 no-repeat vipicon"
  79. :style="{'background-image': `url(${urlDomain}crmebimage/presets/huangguan.png)`}">
  80. </view>
  81. <view class="f-s-24 text ml-12">加入SVIP畅享精彩</view>
  82. </view>
  83. <view class="acea-row row-middle">
  84. <view class="f-s-24 text mr10">{{userInfo.isPaidMember?'去查看':'去开通'}}</view>
  85. <text class="iconfont icon-gengduo3 text f-s-20"></text>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="order-wrapper tui-skeleton-rect"
  90. :class="userInfo.paidMemberPaidEntrance===1?'mt34rpx':''" v-if="orderMenu.length">
  91. <view class="order-hd flex">
  92. <view class="left">订单中心</view>
  93. <view class="right flex" @click="menusTap('/pages/goods/order_list/index')">查看全部
  94. <text class="iconfont icon-xiangyou"></text>
  95. </view>
  96. </view>
  97. <view class="order-bd">
  98. <block v-for="(item,index) in orderMenu" :key="index">
  99. <view class="order-item" @click="menusTap(item.url)">
  100. <view class="pic">
  101. <image :src="item.pic" class="image"></image>
  102. <!-- <text class="iconfont pic_status" :class="item.img"></text> -->
  103. <text class="order-status-num" v-if="item.num > 0">{{ item.num }}</text>
  104. </view>
  105. <view class="txt tui-skeleton-rect">{{item.title}}</view>
  106. </view>
  107. </block>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="contenBox borderPad" id="pageIndex">
  112. <!-- 轮播 -->
  113. <view class="slider-wrapper tui-skeleton-rect" @click.native="bindEdit('userBanner')"
  114. v-if="centerBanner != null && centerBanner.length > 0">
  115. <swiper v-if="centerBanner.length>0" indicator-dots="true" :autoplay="autoplay"
  116. :circular="circular" :interval="interval" :duration="duration"
  117. indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
  118. <block v-for="(item,index) in centerBanner" :key="index">
  119. <swiper-item class="borRadius14">
  120. <image :src="item.pic" class="slide-image" @click="navito(item.url)"></image>
  121. </swiper-item>
  122. </block>
  123. </swiper>
  124. </view>
  125. <!-- 会员菜单 -->
  126. <view class="user-menus mt20" @click.native="bindEdit('userMenus')">
  127. <view class="menu-title">我的服务</view>
  128. <view class="list-box">
  129. <block v-for="(item,index) in centerMenu" :key="index">
  130. <view class="item tui-skeleton-rect" @click="menusTap(item.url)"
  131. v-if="!(item.url =='/pages/service/index' || (item.url =='/pages/users/user_spread_user/index' && !userInfo.isPromoter)||(!isEmployee&&item.url=='/pages/admin/work/index'))">
  132. <image :src="item.pic"></image>
  133. <text>{{item.name}}</text>
  134. </view>
  135. </block>
  136. <!-- #ifndef MP -->
  137. <view class="item" @click="kefuClick">
  138. <image :src="servicePic"></image>
  139. <text>联系客服</text>
  140. </view>
  141. <!-- #endif -->
  142. <!-- #ifdef MP -->
  143. <button class="item" hover-class='none' @click="kefuClick"
  144. v-if="chatConfig.telephone_service_switch === 'true'">
  145. <image :src="servicePic"></image>
  146. <text>联系客服</text>
  147. </button>
  148. <button class="item" open-type='contact' hover-class='none' v-else>
  149. <image :src="servicePic"></image>
  150. <text>联系客服</text>
  151. </button>
  152. <!-- #endif -->
  153. </view>
  154. </view>
  155. <!-- 商家管理 -->
  156. <view class="user-menus mt20" v-if="isEmployee && isLogin">
  157. <view class="menu-title">店铺管理</view>
  158. <view class="list-box">
  159. <view class="item" @click="toggle('bottom')">
  160. <image :src="urlDomain+'crmebimage/presets/adminImg/sjgl.png'"></image>
  161. <text>商家管理</text>
  162. </view>
  163. </view>
  164. </view>
  165. <!-- 骑手管理 -->
  166. <view class="user-menus mt20" v-if="userInfo.isRider && isLogin">
  167. <view class="menu-title">骑手管理</view>
  168. <view class="list-box">
  169. <view class="item" @click="menusTap('/pages/rider_index/work/index')">
  170. <image :src="urlDomain+'crmebimage/presets/adminImg/ic-rider.png'"></image>
  171. <text>骑手管理</text>
  172. </view>
  173. </view>
  174. </view>
  175. </view>
  176. <image :src="copyImage" alt="" class='support'></image>
  177. </scroll-view>
  178. </view>
  179. </view>
  180. <!-- <view v-if="bottomNavigationIsCustom" class="footerBottom"></view> -->
  181. <!-- <pageFooter></pageFooter> -->
  182. <uni-popup ref="popup" type="bottom" background-color="rgba(0,0,0,0)" border-radius="10px 10px 0 0">
  183. <view class="popup-content">
  184. <view class="item" v-for="(item,index) in merchantEmployeeList" :key="index"
  185. :class="{bottom_border:index!=merchantEmployeeList.length-1}">
  186. <view class="item_main">
  187. <image :src="item.currentMerchant.avatar" mode="" class="item_img"></image>
  188. <view class="item_name" :class="{nameColor:item.merId==selectMerId}">
  189. {{item.currentMerchant.name}}</view>
  190. </view>
  191. <text v-if="item.merId==selectMerId" class="iconfont icon-xuanzhong11 icon-size icon_color"></text>
  192. <text v-else class="iconfont icon-weixuan icon-size" @click="radioChange(item)"></text>
  193. </view>
  194. </view>
  195. </uni-popup>
  196. <!-- 底部导航距离,做兼容处理的-->
  197. <view v-if="bottomNavigationIsCustom" class="footerBottom"></view>
  198. <pageFooter></pageFooter>
  199. </view>
  200. </template>
  201. <script>
  202. let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  203. import Cache from '@/utils/cache';
  204. import navBar from '@/components/navBar';
  205. import {
  206. goPage
  207. } from '@/libs/iframe.js'
  208. import {
  209. BACK_URL,
  210. USER_INFO
  211. } from '@/config/cache';
  212. import {
  213. userCenterInfo,
  214. copyrightImageApi,
  215. getOrderMenu
  216. } from '@/api/user.js';
  217. import {
  218. MerchantBelongListApi,
  219. merchantActive
  220. } from '@/api/work.js';
  221. import {
  222. orderNum
  223. } from '@/api/order.js';
  224. import {
  225. toLogin
  226. } from '@/libs/login.js';
  227. import {
  228. mapGetters
  229. } from "vuex";
  230. import {
  231. getCityList
  232. } from "@/utils";
  233. import {
  234. tokenIsExistApi
  235. } from '@/api/api.js';
  236. // #ifdef H5
  237. import Auth from '@/libs/wechat';
  238. // #endif
  239. import {
  240. getShare
  241. } from '@/api/public.js';
  242. import {
  243. setThemeColor
  244. } from '@/utils/setTheme.js'
  245. import animationType from '@/utils/animationType.js'
  246. import {
  247. chatConfig
  248. } from '@/utils/consumerType.js'
  249. import tuiSkeleton from '@/components/base/tui-skeleton.vue';
  250. import pageFooter from "@/components/pageFooter/index.vue";
  251. const app = getApp();
  252. export default {
  253. computed: mapGetters(['isLogin', 'chatUrl', 'uid', 'globalData', 'bottomNavigationIsCustom',
  254. 'merchantEmployeeList', 'isEmployee', 'selectMerId'
  255. ]),
  256. data() {
  257. return {
  258. scrollHeight: 0,
  259. triggered: false,
  260. isRefresher: false, //下拉刷新状态
  261. urlDomain: this.$Cache.get("imgHost"),
  262. showSkeleton: true, //骨架屏显示隐藏
  263. orderMenu:[],
  264. // orderMenu: [{
  265. // img: 'icon-daifukuan',
  266. // title: '待付款',
  267. // url: '/pages/goods/order_list/index?status=0',
  268. // num: 0
  269. // },
  270. // {
  271. // img: 'icon-daifahuo',
  272. // title: '待取餐',
  273. // url: '/pages/goods/order_list/index?status=1',
  274. // num: 0
  275. // },
  276. // {
  277. // img: 'icon-daihexiao',
  278. // title: '待核销',
  279. // url: '/pages/goods/order_list/index?status=3',
  280. // num: 0
  281. // },
  282. // {
  283. // img: 'icon-daishouhuo',
  284. // title: '配送中',
  285. // url: '/pages/goods/order_list/index?status=4',
  286. // num: 0
  287. // },
  288. // {
  289. // img: 'icon-daipingjia',
  290. // title: '待评价',
  291. // url: '/pages/goods/evaluation_list/index',
  292. // num: 0
  293. // },
  294. // {
  295. // img: 'icon-a-shouhoutuikuan',
  296. // title: '售后/退款',
  297. // url: '/pages/goods/user_return_list/index',
  298. // num: 0
  299. // },
  300. // ],
  301. centerBanner: [],
  302. userMenu: [],
  303. autoplay: true,
  304. circular: true,
  305. interval: 3000,
  306. duration: 500,
  307. isAuto: false, //没有授权的不会自动授权
  308. isShowAuth: false, //是否隐藏授权
  309. orderStatusNum: {},
  310. centerMenu: [],
  311. wechatUrl: [],
  312. servicePic: '',
  313. sysHeight: sysHeight,
  314. // #ifdef MP
  315. pageHeight: '100%',
  316. // #endif
  317. // #ifdef H5 || APP-PLUS
  318. pageHeight: '',
  319. // #endif
  320. // #ifdef H5
  321. isWeixin: Auth.isWeixin(),
  322. //#endif
  323. configApi: {}, //分享类容配置
  324. theme: app.globalData.theme,
  325. bgColor: '#e93323',
  326. userInfo: {},
  327. copyImage: '',
  328. navH:''
  329. }
  330. },
  331. components: {
  332. tuiSkeleton,
  333. pageFooter,
  334. navBar
  335. },
  336. onLoad() {
  337. this.servicePic = this.urlDomain + 'crmebimage/presets/customer.png'
  338. this.getTokenIsExist();
  339. // #ifdef MP
  340. this.navH = this.globalData.navHeight;
  341. // #endif
  342. // #ifndef MP
  343. this.navH = 96;
  344. // #endif
  345. if (this.globalData.isIframe) {
  346. setTimeout(() => {
  347. let active;
  348. document.getElementById('pageIndex').children.forEach(dom => {
  349. dom.addEventListener('click', (e) => {
  350. e.stopPropagation();
  351. e.preventDefault();
  352. if (dom === active) return;
  353. dom.classList.add('borderShow');
  354. active && active.classList.remove('borderShow');
  355. active = dom;
  356. })
  357. })
  358. });
  359. }
  360. // #ifdef APP-PLUS
  361. setTimeout(()=>{
  362. uni.setNavigationBarColor({
  363. frontColor: '#ffffff',
  364. backgroundColor:that.bgColor,
  365. });
  366. },500)
  367. // #endif
  368. let that = this;
  369. // #ifdef H5 || APP-PLUS
  370. that.$set(that, 'pageHeight', this.globalData.windowHeight);
  371. // #endif
  372. that.$set(that, 'centerMenu', this.globalData.centerMenu);
  373. that.bgColor = setThemeColor();
  374. },
  375. onShow: function() {
  376. if (this.isLogin) {
  377. this.getUserCenterInfo();
  378. this.getOrderMenu();
  379. this.getMerchantList();
  380. }
  381. this.copyrightImage();
  382. this.showSkeleton = false
  383. let that = this;
  384. if (!that.$Cache.get('cityList')) getCityList();
  385. // #ifdef H5
  386. uni.getSystemInfo({
  387. success: function(res) {
  388. that.pageHeight = res.windowHeight + 'px'
  389. }
  390. });
  391. // #endif
  392. // #ifdef MP
  393. let query = uni.createSelectorQuery();
  394. let dom = query.select('.new-users');
  395. // #endif
  396. },
  397. methods: {
  398. /**
  399. * 获取用户订单状态菜单
  400. */
  401. async getOrderMenu() {
  402. const { data } = await getOrderMenu();
  403. this.orderMenu = data.map(item => {
  404. return {...item,title: item.name,num: 0}
  405. });
  406. this.getOrderData();
  407. },
  408. /**
  409. * 发现列表滑动中用到的方法
  410. */
  411. onScroll() {
  412. uni.$emit('scroll');
  413. },
  414. toggle(type) {
  415. if (this.merchantEmployeeList.length == 1) {
  416. merchantActive(this.merchantEmployeeList[0].merId).then(res => {
  417. this.$store.commit('SetSelectMerId', this.merchantEmployeeList[0].merId);
  418. this.$store.commit('SetSelectMerchantRole', this.merchantEmployeeList[0].role);
  419. this.$store.commit('SET_MANAGER_TOKEN', {
  420. managerToken: res.data.token
  421. });
  422. Cache.set('electrPrintingSwitch', res.data.electrPrintingSwitch);
  423. uni.navigateTo({
  424. url: '/pages/admin/work/index'
  425. })
  426. return
  427. })
  428. return
  429. }
  430. if (this.selectMerId) {
  431. uni.navigateTo({
  432. url: '/pages/admin/work/index'
  433. })
  434. } else {
  435. this.type = type
  436. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  437. this.$refs.popup.open(type)
  438. }
  439. },
  440. //选中商户
  441. radioChange(item) {
  442. let that = this
  443. merchantActive(item.merId).then(res => {
  444. if (res.code == 200) {
  445. that.$store.commit('SET_MANAGER_TOKEN', {
  446. managerToken: res.data.token
  447. });
  448. Cache.set('electrPrintingSwitch', res.data.electrPrintingSwitch);
  449. that.$store.commit('SetSelectMerId', item.merId);
  450. this.$store.commit('SetSelectMerchantRole', item.role);
  451. this.$refs.popup.close()
  452. uni.navigateTo({
  453. url: '/pages/admin/work/index'
  454. })
  455. }
  456. })
  457. },
  458. //获取商户列表
  459. getMerchantList() {
  460. let that = this
  461. MerchantBelongListApi().then(res => {
  462. if (this.selectMerId) {
  463. let flag = res.data.find(item => item.merId === this.selectMerId);
  464. !flag && that.$store.commit('CLEAR_SELECTMERID');
  465. }
  466. this.$store.commit("SetMerchantEmployeeList", res.data);
  467. })
  468. },
  469. //校验token是否有效,true为有效,false为无效
  470. getTokenIsExist() {
  471. tokenIsExistApi().then(res => {
  472. let tokenIsExist = res.data;
  473. if (!tokenIsExist) {
  474. this.$store.commit('UPDATE_LOGIN', '');
  475. this.$store.commit('UPDATE_USERINFO', {});
  476. }
  477. })
  478. },
  479. copyrightImage() {
  480. copyrightImageApi().then(res => {
  481. if (res.data) {
  482. this.copyImage = res.data;
  483. } else {
  484. this.copyImage = `${this.urlDomain}crmebimage/presets/support.png`;
  485. }
  486. }).catch(err => {
  487. return this.$util.Tips({
  488. title: err
  489. })
  490. });
  491. },
  492. bindEdit(name) {
  493. if (this.globalData.isIframe) {
  494. window.parent.postMessage({
  495. name: name
  496. },
  497. '*'
  498. );
  499. return;
  500. }
  501. },
  502. menusTap(url) {
  503. if (!this.isLogin) {
  504. this.openAuto();
  505. } else {
  506. if (url === '/pages/activity/vip_paid/index' && this.userInfo.paidMemberPaidEntrance === 0) return
  507. this.$util.navigateTo(url);
  508. }
  509. },
  510. //轮播图跳转
  511. navito(url) {
  512. this.$util.navigateTo(url);
  513. },
  514. kefuClick() {
  515. chatConfig(this.$Cache.getItem('platChatConfig'));
  516. },
  517. getOrderData() {
  518. let that = this;
  519. orderNum().then(res => {
  520. that.orderMenu.forEach((item, index) => {
  521. switch (item.title) {
  522. case '待付款':
  523. item.num = res.data.awaitPayCount
  524. break
  525. case '待取餐':
  526. item.num = res.data.awaitShippedCount
  527. break
  528. case '配送中':
  529. item.num = res.data.receiptCount
  530. break
  531. case '待核销':
  532. item.num = res.data.verificationCount
  533. break
  534. case '待评价':
  535. item.num = res.data.awaitReplyCount
  536. break
  537. default:
  538. item.num = res.data.refundCount
  539. }
  540. })
  541. that.$set(that, 'orderMenu', that.orderMenu);
  542. })
  543. },
  544. // 绑定手机
  545. bindPhone() {
  546. uni.navigateTo({
  547. animationType: animationType.type,
  548. animationDuration: animationType.duration,
  549. url: '/pages/users/app_login/index'
  550. })
  551. },
  552. /**
  553. *
  554. * 获取个人中心详情
  555. */
  556. getUserCenterInfo: function() {
  557. userCenterInfo().then(res => {
  558. let data = res.data;
  559. this.userInfo = data;
  560. this.$store.commit("SETUID", data.id);
  561. this.$store.commit("SetIsEmployee", data.isEmployee);
  562. this.$set(this, 'centerMenu', data.centerMenu);
  563. this.$store.commit('UPDATE_USERINFO', {
  564. avatar: data.avatar,
  565. nickname: data.nickname,
  566. phone: data.phone
  567. });
  568. if (data.centerBanner) {
  569. this.centerBanner = data.centerBanner
  570. }
  571. this.showSkeleton = false;
  572. }).catch(err => {
  573. this.showSkeleton = false;
  574. });
  575. },
  576. // 编辑页面
  577. goEdit() {
  578. if (this.isLogin == false) {
  579. this.openAuto();
  580. } else {
  581. uni.navigateTo({
  582. animationType: animationType.type,
  583. animationDuration: animationType.duration,
  584. url: '/pages/users/user_info/index'
  585. })
  586. }
  587. },
  588. goMenuPage(url) {
  589. if (this.isLogin) {
  590. uni.navigateTo({
  591. animationType: animationType.type,
  592. animationDuration: animationType.duration,
  593. url
  594. })
  595. } else {
  596. // #ifdef MP
  597. this.openAuto()
  598. // #endif
  599. }
  600. },
  601. // 打开授权
  602. openAuto() {
  603. Cache.set(BACK_URL, '')
  604. toLogin();
  605. },
  606. // 去设置页面
  607. handleUserSetting() {
  608. if (!this.isLogin) {
  609. return this.openAuto();
  610. }
  611. uni.navigateTo({
  612. url: '/pages/users/user_setting/index'
  613. })
  614. },
  615. shareApi: function() {
  616. getShare().then(res => {
  617. this.$set(this, 'configApi', res.data);
  618. // #ifdef H5
  619. this.setOpenShare(res.data);
  620. // #endif
  621. })
  622. },
  623. // 微信分享;
  624. setOpenShare: function() {
  625. let that = this;
  626. if (that.$wechat.isWeixin()) {
  627. let configAppMessage = {
  628. desc: 'crmeb',
  629. title: 'crmeb',
  630. link: location.href,
  631. imgUrl: ''
  632. };
  633. that.$wechat.wechatEvevt([
  634. "updateAppMessageShareData",
  635. "updateTimelineShareData",
  636. "onMenuShareAppMessage",
  637. "onMenuShareTimeline",
  638. ],
  639. configAppMessage);
  640. }
  641. }
  642. }
  643. }
  644. </script>
  645. <style lang="scss" scoped>
  646. .vipicon {
  647. background-size: 100% 100%;
  648. }
  649. .mt34rpx {
  650. margin-top: -34rpx;
  651. }
  652. .svip-box {
  653. width: 702rpx;
  654. background-repeat: no-repeat;
  655. background-size: 702rpx 128rpx;
  656. .text {
  657. color: #FFD89C;
  658. }
  659. }
  660. .num-txt {
  661. padding: 6rpx 20rpx;
  662. border-radius: 36rpx;
  663. background: rgba(255, 255, 255, 0.2);
  664. }
  665. page,
  666. body {
  667. height: 100%;
  668. margin: 0;
  669. }
  670. .ma .mp-header {
  671. @include main_bg_color(theme);
  672. }
  673. .bg {
  674. width: 100%;
  675. background-repeat: no-repeat;
  676. background-size: 100% 100%;
  677. }
  678. .support {
  679. width: 219rpx;
  680. height: 74rpx;
  681. margin: 20rpx auto;
  682. display: block;
  683. }
  684. .new-users {
  685. display: flex;
  686. flex-direction: column;
  687. height: 100%;
  688. .sys-head {
  689. position: relative;
  690. width: 100%;
  691. background: linear-gradient(90deg, $bg-star1 0%, $bg-end1 100%);
  692. .sys-title {
  693. z-index: 10;
  694. position: relative;
  695. height: 43px;
  696. text-align: center;
  697. line-height: 43px;
  698. font-size: 36rpx;
  699. color: #FFFFFF;
  700. }
  701. }
  702. .head {
  703. width: 100%;
  704. background-repeat: no-repeat;
  705. background-size: 100% 100%;
  706. @include index-gradient(theme);
  707. .user-card {
  708. width: 100%;
  709. margin: 0 auto;
  710. padding: 35rpx 0 40rpx 0;
  711. .user-info {
  712. z-index: 20;
  713. display: flex;
  714. align-items: center;
  715. color: #fff;
  716. .avatar {
  717. width: 120rpx;
  718. height: 120rpx;
  719. border-radius: 50%;
  720. }
  721. .app_set {
  722. color: #fff;
  723. width: 140rpx;
  724. height: 110rpx;
  725. text-align: right;
  726. line-height: 110rpx;
  727. .icon-shezhi {
  728. font-size: 36rpx;
  729. }
  730. }
  731. .info {
  732. flex: 1;
  733. display: flex;
  734. flex-direction: column;
  735. justify-content: space-between;
  736. margin-left: 20rpx;
  737. padding: 15rpx 0;
  738. .name {
  739. display: flex;
  740. align-items: center;
  741. color: #fff;
  742. font-size: 31rpx;
  743. .vip {
  744. display: flex;
  745. align-items: center;
  746. border-radius: 18px;
  747. font-size: 20rpx;
  748. margin-left: 14rpx;
  749. image {
  750. width: 27rpx;
  751. height: 27rpx;
  752. background-repeat: no-repeat;
  753. background-size: 100% 100%;
  754. }
  755. }
  756. }
  757. .num {
  758. display: flex;
  759. align-items: center;
  760. font-size: 26rpx;
  761. color: rgba(255, 255, 255, 0.6);
  762. image {
  763. width: 22rpx;
  764. height: 23rpx;
  765. margin-left: 20rpx;
  766. }
  767. }
  768. }
  769. }
  770. .num-wrapper {
  771. z-index: 30;
  772. position: relative;
  773. display: flex;
  774. align-items: center;
  775. justify-content: space-between;
  776. margin-top: 30rpx;
  777. color: #fff;
  778. .num-item {
  779. width: 33.33%;
  780. text-align: center;
  781. .num {
  782. font-size: 42rpx;
  783. font-weight: bold;
  784. }
  785. .txt {
  786. margin-top: 10rpx;
  787. font-size: 26rpx;
  788. color: rgba(255, 255, 255, 0.6);
  789. }
  790. }
  791. }
  792. .sign {
  793. z-index: 200;
  794. position: absolute;
  795. right: -12rpx;
  796. top: 80rpx;
  797. display: flex;
  798. align-items: center;
  799. justify-content: center;
  800. width: 120rpx;
  801. height: 60rpx;
  802. background: linear-gradient(90deg, rgba(255, 225, 87, 1) 0%, rgba(238, 193, 15, 1) 100%);
  803. border-radius: 29rpx 4rpx 4rpx 29rpx;
  804. color: #282828;
  805. font-size: 28rpx;
  806. font-weight: bold;
  807. }
  808. }
  809. .order-wrapper {
  810. background-color: #fff;
  811. border-radius: 14rpx;
  812. padding: 30rpx 16rpx;
  813. position: relative;
  814. z-index: 11;
  815. .order-hd {
  816. justify-content: space-between;
  817. font-size: 30rpx;
  818. color: #282828;
  819. margin-bottom: 40rpx;
  820. padding: 0 16rpx;
  821. .left {
  822. color: #282828;
  823. font-size: 30rpx;
  824. font-weight: 600;
  825. }
  826. .right {
  827. align-items: center;
  828. color: #666666;
  829. font-size: 26rpx;
  830. .icon-xiangyou {
  831. margin-left: 5rpx;
  832. font-size: 24rpx;
  833. }
  834. }
  835. }
  836. .order-bd {
  837. display: flex;
  838. justify-content: space-between;
  839. padding: 0;
  840. .order-item {
  841. display: flex;
  842. flex-direction: column;
  843. justify-content: center;
  844. align-items: center;
  845. .pic {
  846. position: relative;
  847. text-align: center;
  848. image {
  849. width: 48rpx;
  850. height: 48rpx;
  851. }
  852. }
  853. .txt {
  854. margin-top: 15rpx;
  855. font-size: 26rpx;
  856. color: #454545;
  857. }
  858. }
  859. }
  860. }
  861. }
  862. .slider-wrapper {
  863. margin: 20rpx 0;
  864. height: 138rpx;
  865. swiper,
  866. swiper-item {
  867. height: 100%;
  868. }
  869. image {
  870. width: 100%;
  871. height: 100%;
  872. }
  873. }
  874. .user-menus {
  875. background-color: #fff;
  876. border-radius: 14rpx;
  877. .menu-title {
  878. padding: 30rpx 30rpx 40rpx;
  879. font-size: 30rpx;
  880. color: #282828;
  881. font-weight: 600;
  882. }
  883. .list-box {
  884. display: flex;
  885. flex-wrap: wrap;
  886. padding: 0;
  887. }
  888. .item {
  889. position: relative;
  890. display: flex;
  891. align-items: center;
  892. justify-content: space-between;
  893. flex-direction: column;
  894. width: 25%;
  895. margin-bottom: 47rpx;
  896. font-size: 26rpx;
  897. color: #333333;
  898. image {
  899. width: 52rpx;
  900. height: 52rpx;
  901. margin-bottom: 18rpx;
  902. }
  903. &:last-child::before {
  904. display: none;
  905. }
  906. }
  907. button {
  908. font-size: 28rpx;
  909. }
  910. }
  911. .phone {
  912. color: #fff;
  913. }
  914. .pic_status {
  915. font-size: 43rpx;
  916. @include main_color(theme);
  917. }
  918. .order-status-num {
  919. min-width: 13rpx;
  920. background-color: #fff;
  921. @include main_color(theme);
  922. border-radius: 15px;
  923. position: absolute;
  924. right: -14rpx;
  925. top: -15rpx;
  926. font-size: 20rpx;
  927. padding: 0 8rpx;
  928. @include coupons_border_color(theme);
  929. }
  930. }
  931. .sub_btn {
  932. width: 690rpx;
  933. height: 86rpx;
  934. line-height: 86rpx;
  935. margin-top: 60rpx;
  936. background: $theme-color;
  937. border-radius: 43rpx;
  938. color: #fff;
  939. font-size: 28rpx;
  940. text-align: center;
  941. }
  942. .popup-content {
  943. border-radius: 16rpx 16rpx 0px 0px;
  944. .bottom_border {
  945. border-bottom: 1px solid #F5F5F5;
  946. }
  947. .item {
  948. display: flex;
  949. align-items: center;
  950. justify-content: space-between;
  951. padding: 20rpx;
  952. .icon_color {
  953. color: #2A7EFB;
  954. }
  955. .item_main {
  956. display: flex;
  957. align-items: center;
  958. .item_name {
  959. margin-left: 20rpx;
  960. font-weight: 500;
  961. font-size: 28rpx;
  962. }
  963. }
  964. .item_img {
  965. width: 60rpx;
  966. height: 60rpx;
  967. border-radius: 60rpx;
  968. }
  969. }
  970. }
  971. </style>