index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323
  1. <template>
  2. <view class="new-users copy-data" :style="{height:pageHeight}">
  3. <view class="top" :style="colorStyle">
  4. <!-- #ifdef MP || APP-PLUS -->
  5. <view class="sys-head">
  6. <view class="sys-bar" :style="{height:sysHeight}"></view>
  7. <!-- #ifdef MP -->
  8. <view class="sys-title" :style="member_style==3?'color:#333':''">个人中心</view>
  9. <!-- #endif -->
  10. <view class="bg" :style="member_style==3?'background:#f5f5f5':''"></view>
  11. </view>
  12. <!-- #endif -->
  13. </view>
  14. <view class="mid" style="flex:1;overflow: hidden;" :style="colorStyle">
  15. <scroll-view scroll-y="true" style="height: 100%;">
  16. <view class="head">
  17. <view class="user-card" :class="member_style==3?'unBg':''">
  18. <view class="bg"></view>
  19. <view class="user-info">
  20. <view>
  21. <!-- 注释这个是加的bnt -->
  22. <!-- #ifdef H5 -->
  23. <button class="bntImg" v-if="userInfo.is_complete == 0 && isWeixin"
  24. @click="getWechatuserinfo">
  25. <image class="avatar" src='/static/images/f.png'></image>
  26. <view class="avatarName">获取头像</view>
  27. </button>
  28. <!-- #endif -->
  29. <!-- #ifdef MP -->
  30. <button class="bntImg" v-if="userInfo.is_complete == 0" @tap="getUserProfile">
  31. <image class="avatar" src='/static/images/f.png'></image>
  32. <view class="avatarName">获取头像</view>
  33. </button>
  34. <!-- #endif -->
  35. <!-- #ifndef APP-PLUS -->
  36. <view v-else class="avatar-box" :class="{on:userInfo.is_money_level}">
  37. <image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar"
  38. @click="goEdit()">
  39. </image>
  40. <image v-else class="avatar" src="/static/images/f.png" mode="" @click="goEdit()">
  41. </image>
  42. <view class="headwear" v-if="userInfo.is_money_level && userInfo.svip_open">
  43. <image src="/static/images/headwear.png"></image>
  44. </view>
  45. </view>
  46. <!-- #endif -->
  47. <!-- #ifdef APP-PLUS -->
  48. <view class="avatar-box" :class="{on:userInfo.is_money_level}">
  49. <image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar"
  50. @click="goEdit()">
  51. </image>
  52. <image v-else class="avatar" src="/static/images/f.png" mode="" @click="goEdit()">
  53. </image>
  54. <view class="headwear" v-if="userInfo.is_money_level && userInfo.svip_open">
  55. <image src="/static/images/headwear.png"></image>
  56. </view>
  57. </view>
  58. <!-- #endif -->
  59. </view>
  60. <view class="info">
  61. <!-- #ifdef MP -->
  62. <view class="name" v-if="!userInfo.uid" @click="openAuto"
  63. style="height: 100%; display: flex; align-items: center;">
  64. 请点击授权
  65. </view>
  66. <!-- #endif -->
  67. <!-- #ifdef H5 -->
  68. <view class="name" v-if="!userInfo.uid && isWeixin" @click="openAuto"
  69. style="height: 100%; display: flex; align-items: center;">
  70. 请点击授权
  71. </view>
  72. <!-- #endif -->
  73. <view class="name" v-if="userInfo.uid">
  74. {{userInfo.nickname}}
  75. <image class="live" :src="userInfo.vip_icon" v-if="userInfo.vip_icon"></image>
  76. </view>
  77. <view class="num" v-if="userInfo.phone" @click="goEdit()">
  78. <view class="num-txt">ID:{{userInfo.uid}}</view>
  79. <!-- <view class="icon">
  80. <image src="/static/images/edit.png" mode=""></image>
  81. </view> -->
  82. </view>
  83. <view class="phone" v-if="!userInfo.phone && isLogin" @tap="bindPhone">绑定手机号</view>
  84. </view>
  85. <view class="message">
  86. <navigator url="/pages/users/message_center/index" hover-class="none">
  87. <view v-if="userInfo.service_num" class="num">
  88. {{userInfo.service_num >= 100 ? '99+' : userInfo.service_num}}
  89. </view>
  90. <view class="iconfont icon-s-kefu"></view>
  91. </navigator>
  92. </view>
  93. <!-- #ifdef MP -->
  94. <!-- <view class="setting" @click="Setting"><text class="iconfont icon-shezhi"></text></view> -->
  95. <!-- #endif -->
  96. </view>
  97. <view class="num-wrapper">
  98. <view class="num-item" v-if="userInfo.balance_func_status"
  99. @click="goMenuPage('/pages/users/user_money/index')">
  100. <text class="num">{{userInfo.now_money || 0}}</text>
  101. <view class="txt">余额</view>
  102. </view>
  103. <view class="num-item" v-else
  104. @click="goMenuPage('/pages/users/user_goods_collection/index')">
  105. <text class="num">{{userInfo.collectCount || 0}}</text>
  106. <view class="txt">收藏</view>
  107. </view>
  108. <view class="num-item" @click="goMenuPage('/pages/users/user_integral/index')">
  109. <text class="num">{{userInfo.integral || 0}}</text>
  110. <view class="txt">积分</view>
  111. </view>
  112. <view class="num-item" @click="goMenuPage('/pages/users/user_coupon/index')">
  113. <text class="num">{{userInfo.couponCount || 0}}</text>
  114. <view class="txt">优惠券</view>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="order-wrapper" :class="userInfo.svip_open?'':'height'">
  119. <view class="order-hd flex">
  120. <view class="left">订单中心</view>
  121. <navigator class="right flex" hover-class="none" url="/pages/users/order_list/index"
  122. open-type="navigate">
  123. 查看全部
  124. <text class="iconfont icon-xiangyou"></text>
  125. </navigator>
  126. </view>
  127. <view class="order-bd">
  128. <block v-for="(item,index) in orderMenu" :key="index">
  129. <navigator class="order-item" hover-class="none" :url="item.url">
  130. <view class="pic">
  131. <!-- <image :src="item.img" mode=""></image> -->
  132. <text class="iconfont" :class="item.img"></text>
  133. <text class="order-status-num" v-if="item.num > 0">{{ item.num }}</text>
  134. </view>
  135. <view class="txt">{{item.title}}</view>
  136. </navigator>
  137. </block>
  138. </view>
  139. </view>
  140. </view>
  141. <!-- 轮播 -->
  142. <view class="slider-wrapper" v-if="imgUrls.length>0 && my_banner_status">
  143. <swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval"
  144. :duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
  145. <block v-for="(item,index) in imgUrls" :key="index">
  146. <swiper-item>
  147. <navigator @click="goMenuPage(item.url)"
  148. class='slide-navigator acea-row row-between-wrapper' hover-class='none'>
  149. <image :src="item.pic" class="slide-image"></image>
  150. </navigator>
  151. </swiper-item>
  152. </block>
  153. </swiper>
  154. </view>
  155. <!-- 会员菜单 -->
  156. <view class="user-menus" style="margin-top: 20rpx;">
  157. <view class="menu-title">我的服务</view>
  158. <view class="list-box">
  159. <!-- #ifdef APP-PLUS || H5 -->
  160. <block v-for="(item,index) in MyMenus" :key="index">
  161. <view class="item" v-if="item.url!='#' && item.url!='/pages/service/index'"
  162. @click="goMenuPage(item.url, item.name)">
  163. <image :src="item.pic"></image>
  164. <text>{{item.name}}</text>
  165. </view>
  166. </block>
  167. <!-- #endif -->
  168. <!-- #ifdef MP -->
  169. <block v-for="(item,index) in MyMenus" :key="index">
  170. <view class="item" v-if="item.url!='#'
  171. && item.url!='/pages/service/index'
  172. && item.url!='/pages/customer_list/chat'
  173. || (item.url=='/pages/customer_list/chat' && routineContact == 0)" @click="goMenuPage(item.url, item.name)">
  174. <image :src="item.pic"></image>
  175. <text>{{item.name}}</text>
  176. </view>
  177. </block>
  178. <button class="item" open-type='contact' v-if="routineContact == 1">
  179. <image src="/static/images/contact.png"></image>
  180. <text>联系客服</text>
  181. </button>
  182. <!-- #endif -->
  183. <!-- #ifdef APP-PLUS -->
  184. <view class="item" hover-class="none" @click="goMenuPage('/pages/users/privacy/index')">
  185. <image src="/static/images/menu.png"></image>
  186. <text>隐私协议</text>
  187. </view>
  188. <!-- #endif -->
  189. </view>
  190. </view>
  191. <view class="user-menus" style="margin-top: 20rpx;" v-if="storeMenu.length">
  192. <view class="menu-title">商家管理</view>
  193. <view class="list-box">
  194. <block v-for="(item,index) in storeMenu" :key="index">
  195. <view class="item" :url="item.url" hover-class="none"
  196. v-if="item.url!='#' && item.url!='/pages/service/index'"
  197. @click="goMenuPage(item.url, item.name)">
  198. <image :src="item.pic"></image>
  199. <text>{{item.name}}</text>
  200. </view>
  201. </block>
  202. </view>
  203. </view>
  204. <image src="/static/images/support.png" alt="" class='support'></image>
  205. <view class="uni-p-b-98"></view>
  206. </scroll-view>
  207. </view>
  208. <tabBar :pagePath="'/pages/user/index'"></tabBar>
  209. </view>
  210. </template>
  211. <script>
  212. let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  213. import {
  214. getMenuList,
  215. getUserInfo,
  216. setVisit,
  217. updateUserInfo
  218. } from '@/api/user.js';
  219. import {
  220. wechatAuthV2,
  221. getNavigation,
  222. silenceAuth
  223. } from '@/api/public.js'
  224. import {
  225. toLogin
  226. } from '@/libs/login.js';
  227. import {
  228. mapState,
  229. mapGetters
  230. } from "vuex";
  231. // #ifdef H5
  232. import Auth from '@/libs/wechat';
  233. // #endif
  234. const app = getApp();
  235. import dayjs from '@/plugin/dayjs/dayjs.min.js';
  236. import Routine from '@/libs/routine';
  237. import colors from '@/mixins/color';
  238. import tabBar from "@/pages/index/components/tabBar.vue";
  239. import {
  240. getCustomer
  241. } from '@/utils/index.js'
  242. export default {
  243. components: {
  244. tabBar,
  245. },
  246. // computed: mapGetters(['isLogin','cartNum']),
  247. computed: {
  248. ...mapGetters({
  249. cartNum: 'cartNum',
  250. isLogin: 'isLogin'
  251. })
  252. },
  253. filters: {
  254. coundTime(val) {
  255. var setTime = val * 1000
  256. var nowTime = new Date()
  257. var rest = setTime - nowTime.getTime()
  258. var day = parseInt(rest / (60 * 60 * 24 * 1000))
  259. // var hour = parseInt(rest/(60*60*1000)%24) //小时
  260. return day + '天'
  261. },
  262. dateFormat: function(value) {
  263. return dayjs(value * 1000).format('YYYY-MM-DD');
  264. }
  265. },
  266. mixins: [colors],
  267. data() {
  268. return {
  269. storeMenu: [], // 商家管理
  270. orderMenu: [{
  271. img: 'icon-daifukuan',
  272. title: '待付款',
  273. url: '/pages/users/order_list/index?status=0'
  274. },
  275. {
  276. img: 'icon-daifahuo',
  277. title: '待发货',
  278. url: '/pages/users/order_list/index?status=1'
  279. },
  280. {
  281. img: 'icon-daishouhuo',
  282. title: '待收货',
  283. url: '/pages/users/order_list/index?status=2'
  284. },
  285. {
  286. img: 'icon-daipingjia',
  287. title: '待评价',
  288. url: '/pages/users/order_list/index?status=3'
  289. },
  290. {
  291. img: 'icon-a-shouhoutuikuan',
  292. title: '售后/退款',
  293. url: '/pages/users/user_return_list/index'
  294. },
  295. ],
  296. imgUrls: [],
  297. autoplay: true,
  298. circular: true,
  299. interval: 3000,
  300. duration: 500,
  301. isAuto: false, //没有授权的不会自动授权
  302. isShowAuth: false, //是否隐藏授权
  303. orderStatusNum: {},
  304. userInfo: {},
  305. MyMenus: [],
  306. sysHeight: sysHeight,
  307. mpHeight: 0,
  308. showStatus: 1,
  309. newData: {},
  310. activeRouter: '',
  311. // #ifdef H5 || MP
  312. pageHeight: '100%',
  313. routineContact: 0,
  314. // #endif
  315. // #ifdef APP-PLUS
  316. pageHeight: app.globalData.windowHeight,
  317. // #endif
  318. // #ifdef H5
  319. isWeixin: Auth.isWeixin(),
  320. //#endif
  321. footerSee: false,
  322. member_style: 1,
  323. my_banner_status: 1
  324. }
  325. },
  326. created() {
  327. uni.hideTabBar()
  328. let that = this;
  329. // if (uni.getStorageSync('FOOTER_BAR')) {
  330. // this.footerSee = true
  331. // uni.hideTabBar()
  332. // } else {
  333. // }
  334. // #ifdef MP
  335. // 小程序静默授权
  336. if (!this.$store.getters.isLogin) {
  337. Routine.getCode()
  338. .then(code => {
  339. Routine.silenceAuth(code).then(res => {
  340. this.onLoadFun();
  341. })
  342. })
  343. .catch(res => {
  344. uni.hideLoading();
  345. });
  346. }
  347. // #endif
  348. // #ifdef H5 || APP-PLUS
  349. if (that.isLogin == false) {
  350. toLogin()
  351. }
  352. // #endif
  353. // #ifdef APP-PLUS
  354. that.$set(that, 'pageHeight', app.globalData.windowHeight);
  355. // #endif
  356. let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
  357. let curRoute = routes[routes.length - 1].route //获取当前页面路由
  358. this.activeRouter = '/' + curRoute
  359. },
  360. onReady() {
  361. let self = this
  362. // #ifdef MP
  363. let info = uni.createSelectorQuery().select(".sys-head");
  364. info.boundingClientRect(function(data) { //data - 各种参数
  365. self.mpHeight = data.height
  366. }).exec()
  367. // #endif
  368. },
  369. onShow: function() {
  370. let that = this;
  371. // #ifdef APP-PLUS
  372. uni.getSystemInfo({
  373. success: function(res) {
  374. that.pageHeight = res.windowHeight + 'px'
  375. }
  376. });
  377. // #endif
  378. if (that.isLogin) {
  379. this.getUserInfo();
  380. this.getMyMenus();
  381. this.setVisit();
  382. };
  383. },
  384. methods: {
  385. getWechatuserinfo() {
  386. //#ifdef H5
  387. Auth.isWeixin() && Auth.oAuth('snsapi_userinfo', '/pages/user/index');
  388. //#endif
  389. },
  390. getRoutineUserInfo(e) {
  391. updateUserInfo({
  392. userInfo: e.detail.userInfo
  393. }).then(res => {
  394. this.getUserInfo();
  395. return this.$util.Tips('更新用户信息成功');
  396. }).catch(res => {
  397. })
  398. },
  399. // 记录会员访问
  400. setVisit() {
  401. setVisit({
  402. url: '/pages/user/index'
  403. }).then(res => {})
  404. },
  405. // 打开授权
  406. openAuto() {
  407. toLogin();
  408. },
  409. // 授权回调
  410. onLoadFun() {
  411. this.getUserInfo();
  412. this.getMyMenus();
  413. this.setVisit();
  414. },
  415. Setting: function() {
  416. uni.openSetting({
  417. success: function(res) {}
  418. });
  419. },
  420. // 授权关闭
  421. authColse: function(e) {
  422. this.isShowAuth = e
  423. },
  424. // 绑定手机
  425. bindPhone() {
  426. uni.navigateTo({
  427. url: '/pages/users/user_phone/index'
  428. })
  429. },
  430. /**
  431. * 获取个人用户信息
  432. */
  433. getUserInfo: function() {
  434. let that = this;
  435. getUserInfo().then(res => {
  436. that.userInfo = res.data
  437. that.$store.commit("SETUID", res.data.uid);
  438. that.orderMenu.forEach((item, index) => {
  439. switch (item.title) {
  440. case '待付款':
  441. item.num = res.data.orderStatusNum.unpaid_count
  442. break
  443. case '待发货':
  444. item.num = res.data.orderStatusNum.unshipped_count
  445. break
  446. case '待收货':
  447. item.num = res.data.orderStatusNum.received_count
  448. break
  449. case '待评价':
  450. item.num = res.data.orderStatusNum.evaluated_count
  451. break
  452. case '售后/退款':
  453. item.num = res.data.orderStatusNum.refunding_count
  454. break
  455. }
  456. })
  457. });
  458. },
  459. //小程序授权api替换 getUserInfo
  460. getUserProfile() {
  461. uni.showLoading({
  462. title: '获取中'
  463. });
  464. let self = this;
  465. Routine.getUserProfile()
  466. .then(res => {
  467. Routine.getCode()
  468. .then(code => {
  469. let userInfo = res.userInfo;
  470. userInfo.code = code;
  471. userInfo.spread_spid = app.globalData.spid; //获取推广人ID
  472. userInfo.spread_code = app.globalData.code; //获取推广人分享二维码ID
  473. Routine.authUserInfo(userInfo)
  474. .then(res => {
  475. if (res.data.key !== undefined && res.data.key) {
  476. uni.hideLoading();
  477. self.authKey = res.data.key;
  478. self.isPhoneBox = true;
  479. } else {
  480. uni.hideLoading();
  481. let time = res.data.expires_time - self.$Cache.time();
  482. self.$store.commit('LOGIN', {
  483. token: res.data.token,
  484. time: time
  485. });
  486. this.getUserInfo()
  487. }
  488. })
  489. .catch(res => {
  490. uni.hideLoading();
  491. uni.showToast({
  492. title: res.msg,
  493. icon: 'none',
  494. duration: 2000
  495. });
  496. });
  497. })
  498. .catch(res => {
  499. uni.hideLoading();
  500. });
  501. })
  502. .catch(res => {
  503. uni.hideLoading();
  504. });
  505. },
  506. /**
  507. *
  508. * 获取个人中心图标
  509. */
  510. switchTab(order) {
  511. this.orderMenu.forEach((item, index) => {
  512. switch (item.title) {
  513. case '待付款':
  514. item.img = order.dfk
  515. break
  516. case '待发货':
  517. item.img = order.dfh
  518. break
  519. case '待收货':
  520. item.img = order.dsh
  521. break
  522. case '待评价':
  523. item.img = order.dpj
  524. break
  525. case '售后/退款':
  526. item.img = order.sh
  527. break
  528. }
  529. })
  530. },
  531. getMyMenus: function() {
  532. let that = this;
  533. // if (this.MyMenus.length) return;
  534. getMenuList().then(res => {
  535. let storeMenu = []
  536. let myMenu = []
  537. res.data.routine_my_menus.forEach((el, index, arr) => {
  538. if (el.url == '/pages/admin/order/index' || el.url ==
  539. '/pages/admin/order_cancellation/index' || el.name ==
  540. '客服接待') {
  541. storeMenu.push(el)
  542. } else {
  543. myMenu.push(el)
  544. }
  545. })
  546. this.member_style = Number(res.data.diy_data.value)
  547. this.my_banner_status = res.data.diy_data.my_banner_status
  548. let order01 = {
  549. dfk: 'icon-daifukuan',
  550. dfh: 'icon-daifahuo',
  551. dsh: 'icon-daishouhuo',
  552. dpj: 'icon-daipingjia',
  553. sh: 'icon-a-shouhoutuikuan'
  554. }
  555. let order02 = {
  556. dfk: 'icon-daifukuan-lan',
  557. dfh: 'icon-daifahuo-lan',
  558. dsh: 'icon-daishouhuo-lan',
  559. dpj: 'icon-daipingjia-lan',
  560. sh: 'icon-shouhou-tuikuan-lan'
  561. }
  562. let order03 = {
  563. dfk: 'icon-daifukuan-ju',
  564. dfh: 'icon-daifahuo-ju',
  565. dsh: 'icon-daishouhuo-ju',
  566. dpj: 'icon-daipingjia-ju',
  567. sh: 'icon-shouhou-tuikuan-ju'
  568. }
  569. let order04 = {
  570. dfk: 'icon-daifukuan-fen',
  571. dfh: 'icon-daifahuo-fen',
  572. dsh: 'icon-daishouhuo-fen',
  573. dpj: 'icon-daipingjia-fen',
  574. sh: 'icon-a-shouhoutuikuan-fen'
  575. }
  576. let order05 = {
  577. dfk: 'icon-daifukuan-lv',
  578. dfh: 'icon-daifahuo-lv',
  579. dsh: 'icon-daishouhuo-lv',
  580. dpj: 'icon-daipingjia-lv',
  581. sh: 'icon-shouhou-tuikuan-lv'
  582. }
  583. switch (res.data.diy_data.order_status) {
  584. case 1:
  585. this.switchTab(order01)
  586. break
  587. case 2:
  588. this.switchTab(order02)
  589. break
  590. case 3:
  591. this.switchTab(order03)
  592. break
  593. case 4:
  594. this.switchTab(order04)
  595. break
  596. case 5:
  597. this.switchTab(order05)
  598. break
  599. }
  600. that.$set(that, 'MyMenus', myMenu);
  601. that.$set(that, 'storeMenu', storeMenu);
  602. this.imgUrls = res.data.routine_my_banner
  603. this.routineContact = Number(res.data.routine_contact_type)
  604. });
  605. },
  606. // 编辑页面
  607. goEdit() {
  608. if (this.isLogin == false) {
  609. toLogin();
  610. } else {
  611. uni.navigateTo({
  612. url: '/pages/users/user_info/index'
  613. })
  614. }
  615. },
  616. // 签到
  617. goSignIn() {
  618. uni.navigateTo({
  619. url: '/pages/users/user_sgin/index'
  620. })
  621. },
  622. // goMenuPage
  623. goMenuPage(url, name) {
  624. if (this.isLogin) {
  625. if (url.indexOf('http') === -1) {
  626. // #ifdef H5
  627. if (name && name === '客服接待') {
  628. return uni.navigateTo({
  629. url: `/pages/annex/web_view/index?url=${location.origin}${url}`
  630. });
  631. } else if (name && name === '联系客服') {
  632. return getCustomer(url)
  633. } else if (name === '订单核销') {
  634. return window.location.href = `${location.origin}${url}`
  635. }
  636. // #endif
  637. // #ifdef MP
  638. if (url != '#' && url == '/pages/users/user_info/index') {
  639. uni.openSetting({
  640. success: function(res) {}
  641. });
  642. }
  643. // #endif
  644. uni.navigateTo({
  645. url: url
  646. })
  647. } else {
  648. uni.navigateTo({
  649. url: `/pages/annex/web_view/index?url=${url}`
  650. });
  651. }
  652. } else {
  653. // #ifdef MP
  654. this.openAuto()
  655. // #endif
  656. }
  657. },
  658. goRouter(item) {
  659. var pages = getCurrentPages();
  660. var page = (pages[pages.length - 1]).$page.fullPath;
  661. if (item.link == page) return
  662. uni.switchTab({
  663. url: item.link,
  664. fail(err) {
  665. uni.redirectTo({
  666. url: item.link
  667. })
  668. }
  669. })
  670. }
  671. }
  672. }
  673. </script>
  674. <style lang="scss">
  675. page,
  676. body {
  677. height: 100%;
  678. }
  679. .height {
  680. margin-top: -100rpx !important;
  681. }
  682. .unBg {
  683. background-color: unset !important;
  684. .user-info {
  685. .info {
  686. .name {
  687. color: #333333 !important;
  688. font-weight: 600;
  689. }
  690. .num {
  691. color: #333 !important;
  692. .num-txt {
  693. height: 38rpx;
  694. background-color: rgba(51, 51, 51, 0.13);
  695. padding: 0 12rpx;
  696. border-radius: 16rpx;
  697. }
  698. }
  699. }
  700. }
  701. .num-wrapper {
  702. color: #333 !important;
  703. font-weight: 600;
  704. .num-item {
  705. .txt {
  706. color: rgba(51, 51, 51, 0.7) !important;
  707. }
  708. }
  709. }
  710. .message {
  711. .iconfont {
  712. color: #333 !important;
  713. }
  714. .num {
  715. color: #fff !important;
  716. background-color: var(--view-theme) !important;
  717. }
  718. }
  719. .setting {
  720. .iconfont {
  721. color: #333 !important;
  722. }
  723. }
  724. }
  725. .cardVipB {
  726. background-color: #343A48;
  727. width: 100%;
  728. height: 124rpx;
  729. border-radius: 16rpx 16rpx 0 0;
  730. padding: 22rpx 30rpx 0 30rpx;
  731. margin-top: 16px;
  732. .left-box {
  733. .small {
  734. color: #F8D5A8;
  735. font-size: 28rpx;
  736. margin-left: 18rpx;
  737. }
  738. .pictrue {
  739. width: 40rpx;
  740. height: 45rpx;
  741. image {
  742. width: 100%;
  743. height: 100%;
  744. }
  745. }
  746. }
  747. .btn {
  748. color: #BBBBBB;
  749. font-size: 26rpx;
  750. }
  751. .icon-xiangyou {
  752. margin-top: 6rpx;
  753. }
  754. }
  755. .cardVipA {
  756. position: absolute;
  757. background: url('~@/static/images/member.png') no-repeat;
  758. background-size: 100% 100%;
  759. width: 750rpx;
  760. height: 84rpx;
  761. bottom: -2rpx;
  762. left: 0;
  763. padding: 0 56rpx 0 135rpx;
  764. .left-box {
  765. font-size: 26rpx;
  766. color: #905100;
  767. font-weight: 400;
  768. }
  769. .btn {
  770. color: #905100;
  771. font-weight: 400;
  772. font-size: 24rpx;
  773. }
  774. .iconfont {
  775. font-size: 20rpx;
  776. margin: 4rpx 0 0 4rpx;
  777. }
  778. }
  779. .new-users {
  780. display: flex;
  781. flex-direction: column;
  782. height: 100%;
  783. .sys-head {
  784. position: relative;
  785. width: 100%;
  786. // background: linear-gradient(90deg, $bg-star1 0%, $bg-end1 100%);
  787. .bg {
  788. position: absolute;
  789. left: 0;
  790. top: 0;
  791. width: 100%;
  792. height: 100%;
  793. // background: url("~@/static/images/user-sys.png") no-repeat;
  794. background: var(--view-theme);
  795. background-size: 100% auto;
  796. background-position: left bottom;
  797. }
  798. .sys-title {
  799. z-index: 10;
  800. position: relative;
  801. height: 43px;
  802. text-align: center;
  803. line-height: 43px;
  804. font-size: 36rpx;
  805. color: #FFFFFF;
  806. }
  807. }
  808. .head {
  809. // background: #fff;
  810. .user-card {
  811. position: relative;
  812. width: 100%;
  813. height: 360rpx;
  814. margin: 0 auto;
  815. padding: 35rpx 28rpx;
  816. background-image: url("~@/static/images/user01.png");
  817. background-size: 100% auto;
  818. background-color: var(--view-theme);
  819. .user-info {
  820. z-index: 20;
  821. position: relative;
  822. display: flex;
  823. .headwear {
  824. position: absolute;
  825. right: -4rpx;
  826. top: -14rpx;
  827. width: 44rpx;
  828. height: 44rpx;
  829. image {
  830. width: 100%;
  831. height: 100%;
  832. }
  833. }
  834. .live {
  835. width: 28rpx;
  836. height: 28rpx;
  837. margin-left: 20rpx;
  838. }
  839. .bntImg {
  840. width: 120rpx;
  841. height: 120rpx;
  842. border-radius: 50%;
  843. text-align: center;
  844. line-height: 120rpx;
  845. background-color: unset;
  846. position: relative;
  847. .avatarName {
  848. font-size: 16rpx;
  849. color: #fff;
  850. text-align: center;
  851. background-color: rgba(0, 0, 0, 0.6);
  852. height: 37rpx;
  853. line-height: 37rpx;
  854. position: absolute;
  855. bottom: 0;
  856. left: 0;
  857. width: 100%;
  858. }
  859. }
  860. .avatar-box {
  861. position: relative;
  862. display: flex;
  863. align-items: center;
  864. justify-content: center;
  865. width: 120rpx;
  866. height: 120rpx;
  867. border-radius: 50%;
  868. &.on {
  869. .avatar {
  870. border: 2px solid #FFAC65;
  871. border-radius: 50%;
  872. }
  873. }
  874. }
  875. .avatar {
  876. position: relative;
  877. width: 120rpx;
  878. height: 120rpx;
  879. border-radius: 50%;
  880. }
  881. .info {
  882. flex: 1;
  883. display: flex;
  884. flex-direction: column;
  885. justify-content: space-between;
  886. margin-left: 20rpx;
  887. padding: 15rpx 0;
  888. .name {
  889. display: flex;
  890. align-items: center;
  891. color: #fff;
  892. font-size: 31rpx;
  893. .vip {
  894. margin-left: 10rpx;
  895. image {
  896. width: 78rpx;
  897. height: 30rpx;
  898. display: block;
  899. }
  900. }
  901. }
  902. .num {
  903. display: flex;
  904. align-items: center;
  905. font-size: 26rpx;
  906. color: rgba(255, 255, 255, 0.6);
  907. image {
  908. width: 22rpx;
  909. height: 23rpx;
  910. margin-left: 20rpx;
  911. }
  912. }
  913. }
  914. }
  915. .message {
  916. align-self: flex-start;
  917. position: relative;
  918. margin-top: 15rpx;
  919. margin-right: 20rpx;
  920. .num {
  921. position: absolute;
  922. top: -8rpx;
  923. left: 18rpx;
  924. padding: 0 6rpx;
  925. height: 28rpx;
  926. border-radius: 12rpx;
  927. background-color: #fff;
  928. font-size: 18rpx;
  929. line-height: 28rpx;
  930. text-align: center;
  931. color: var(--view-theme);
  932. }
  933. .iconfont {
  934. font-size: 40rpx;
  935. color: #fff;
  936. }
  937. }
  938. .num-wrapper {
  939. z-index: 30;
  940. position: relative;
  941. display: flex;
  942. align-items: center;
  943. justify-content: space-between;
  944. margin-top: 22rpx;
  945. // padding: 0 47rpx;
  946. color: #fff;
  947. .num-item {
  948. width: 33.33%;
  949. text-align: center;
  950. &~.num-item {
  951. position: relative;
  952. &:before {
  953. content: '';
  954. position: absolute;
  955. width: 1rpx;
  956. height: 28rpx;
  957. top: 50%;
  958. margin-top: -14rpx;
  959. background-color: rgba(255, 255, 255, 0.4);
  960. left: 0;
  961. }
  962. }
  963. .num {
  964. font-size: 42rpx;
  965. font-weight: bold;
  966. }
  967. .txt {
  968. margin-top: 8rpx;
  969. font-size: 26rpx;
  970. color: rgba(255, 255, 255, 0.6);
  971. }
  972. }
  973. }
  974. .sign {
  975. z-index: 200;
  976. position: absolute;
  977. right: -12rpx;
  978. top: 80rpx;
  979. display: flex;
  980. align-items: center;
  981. justify-content: center;
  982. width: 120rpx;
  983. height: 60rpx;
  984. background: linear-gradient(90deg, rgba(255, 225, 87, 1) 0%, rgba(238, 193, 15, 1) 100%);
  985. border-radius: 29rpx 4rpx 4rpx 29rpx;
  986. color: #282828;
  987. font-size: 28rpx;
  988. font-weight: bold;
  989. }
  990. }
  991. .order-wrapper {
  992. background: #fff;
  993. margin: 0 30rpx;
  994. border-radius: 16rpx;
  995. position: relative;
  996. margin-top: -80rpx;
  997. .order-hd {
  998. justify-content: space-between;
  999. padding: 30rpx 20rpx 10rpx 30rpx;
  1000. margin-top: 25rpx;
  1001. font-size: 30rpx;
  1002. color: #282828;
  1003. .left {
  1004. font-weight: bold;
  1005. }
  1006. .right {
  1007. display: flex;
  1008. align-items: center;
  1009. color: #666666;
  1010. font-size: 26rpx;
  1011. .icon-xiangyou {
  1012. margin-left: 5rpx;
  1013. font-size: 26rpx;
  1014. }
  1015. }
  1016. }
  1017. .order-bd {
  1018. display: flex;
  1019. padding: 0 0;
  1020. .order-item {
  1021. display: flex;
  1022. flex-direction: column;
  1023. justify-content: center;
  1024. align-items: center;
  1025. width: 20%;
  1026. height: 140rpx;
  1027. .pic {
  1028. position: relative;
  1029. text-align: center;
  1030. .iconfont {
  1031. font-size: 48rpx;
  1032. color: var(--view-theme);
  1033. }
  1034. image {
  1035. width: 58rpx;
  1036. height: 48rpx;
  1037. }
  1038. }
  1039. .txt {
  1040. margin-top: 6rpx;
  1041. font-size: 26rpx;
  1042. color: #333;
  1043. }
  1044. }
  1045. }
  1046. }
  1047. }
  1048. .slider-wrapper {
  1049. margin: 20rpx 30rpx;
  1050. height: 130rpx;
  1051. swiper,
  1052. swiper-item {
  1053. height: 100%;
  1054. }
  1055. image {
  1056. width: 100%;
  1057. height: 130rpx;
  1058. border-radius: 16rpx;
  1059. }
  1060. }
  1061. .user-menus {
  1062. background-color: #fff;
  1063. margin: 0 30rpx;
  1064. border-radius: 16rpx;
  1065. .menu-title {
  1066. padding: 30rpx 30rpx 40rpx;
  1067. font-size: 30rpx;
  1068. color: #282828;
  1069. font-weight: bold;
  1070. }
  1071. .list-box {
  1072. display: flex;
  1073. flex-wrap: wrap;
  1074. padding: 0;
  1075. }
  1076. .item {
  1077. position: relative;
  1078. display: flex;
  1079. align-items: center;
  1080. justify-content: space-between;
  1081. flex-direction: column;
  1082. width: 25%;
  1083. margin-bottom: 47rpx;
  1084. font-size: 26rpx;
  1085. color: #333333;
  1086. image {
  1087. width: 52rpx;
  1088. height: 52rpx;
  1089. margin-bottom: 18rpx;
  1090. }
  1091. &:last-child::before {
  1092. display: none;
  1093. }
  1094. }
  1095. button {
  1096. font-size: 28rpx;
  1097. }
  1098. }
  1099. .phone {
  1100. color: #fff;
  1101. background-color: #CCC;
  1102. border-radius: 15px;
  1103. width: max-content;
  1104. padding: 0 10px;
  1105. }
  1106. .order-status-num {
  1107. min-width: 12rpx;
  1108. background-color: #fff;
  1109. color: var(--view-theme);
  1110. border-radius: 15px;
  1111. position: absolute;
  1112. right: -14rpx;
  1113. top: -15rpx;
  1114. font-size: 20rpx;
  1115. padding: 0 8rpx;
  1116. border: 1px solid var(--view-theme);
  1117. }
  1118. .support {
  1119. width: 219rpx;
  1120. height: 74rpx;
  1121. margin: 54rpx auto;
  1122. display: block;
  1123. }
  1124. }
  1125. .card-vip {
  1126. display: flex;
  1127. align-items: center;
  1128. justify-content: space-between;
  1129. position: relative;
  1130. width: 690rpx;
  1131. height: 134rpx;
  1132. margin: -72rpx auto 0;
  1133. background-size: cover;
  1134. padding-left: 118rpx;
  1135. padding-right: 34rpx;
  1136. .left-box {
  1137. font-size: 24rpx;
  1138. color: #AE5A2A;
  1139. .big {
  1140. font-size: 28rpx;
  1141. }
  1142. .small {
  1143. opacity: 0.8;
  1144. margin-top: 10rpx;
  1145. }
  1146. }
  1147. .btn {
  1148. height: 52rpx;
  1149. line-height: 52rpx;
  1150. padding: 0 20rpx;
  1151. text-align: center;
  1152. background: #fff;
  1153. border-radius: 28rpx;
  1154. font-size: 26rpx;
  1155. color: #AE5A2A;
  1156. }
  1157. }
  1158. .setting {
  1159. margin-top: 15rpx;
  1160. margin-left: 15rpx;
  1161. color: #fff;
  1162. .iconfont {
  1163. font-size: 40rpx;
  1164. }
  1165. }
  1166. .page-footer {
  1167. position: fixed;
  1168. bottom: 0;
  1169. z-index: 30;
  1170. display: flex;
  1171. align-items: center;
  1172. justify-content: space-around;
  1173. width: 100%;
  1174. height: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1175. height: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1176. box-sizing: border-box;
  1177. border-top: solid 1rpx #F3F3F3;
  1178. background-color: #fff;
  1179. box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32);
  1180. padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
  1181. padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
  1182. .foot-item {
  1183. display: flex;
  1184. width: max-content;
  1185. align-items: center;
  1186. justify-content: center;
  1187. flex-direction: column;
  1188. position: relative;
  1189. .count-num {
  1190. position: absolute;
  1191. display: flex;
  1192. justify-content: center;
  1193. align-items: center;
  1194. width: 40rpx;
  1195. height: 40rpx;
  1196. top: 0rpx;
  1197. right: -15rpx;
  1198. color: #fff;
  1199. font-size: 20rpx;
  1200. background-color: #FD502F;
  1201. border-radius: 50%;
  1202. padding: 4rpx;
  1203. }
  1204. }
  1205. .foot-item image {
  1206. height: 50rpx;
  1207. width: 50rpx;
  1208. text-align: center;
  1209. margin: 0 auto;
  1210. }
  1211. .foot-item .txt {
  1212. font-size: 24rpx;
  1213. &.active {}
  1214. }
  1215. }
  1216. .new-users {
  1217. padding-bottom: 0;
  1218. padding-bottom: constant(safe-area-inset-bottom);
  1219. padding-bottom: env(safe-area-inset-bottom);
  1220. }
  1221. </style>