index.vue 26 KB

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