index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905
  1. <template>
  2. <!-- 个人中心模块 -->
  3. <view class="user-page" :style="colorStyle">
  4. <template v-if="userInfo && isObjectData(diyData)">
  5. <user-member :userInfo="userInfo" :memberData="diyData.member" :orderAdminData="orderAdminData"
  6. :balanceStatus="balanceStatus" :isScrolling="isScrolling"></user-member>
  7. <view class="num-wrapper"
  8. :class="[member_style==3?'unNum-wrapper':member_style==2?'Tnum-wrapper':'',((vip_type==2 && stu) || (vip_type==1 && memberStatus))?'':'height']"
  9. v-if="userInfo.uid&&showApp">
  10. <!-- <view class="num-item" v-show="userInfo.balance_func_status"
  11. @click="goMenuPage('/pages/users/user_money/index')">
  12. <text class="num">{{userInfo.now_money || 0}}</text>
  13. <view class="txt">余额</view>
  14. </view> -->
  15. <view class="num-item" @click="goMenuPage('/pages/users/user_integral/greed')">
  16. <view class="txt flex">
  17. <image class="userIcon" src="../../static/images/user01.png" mode="scaleToFill"></image>
  18. <text>绿积分</text>
  19. </view>
  20. <text class="num">{{userInfo.green_integral || 0}}</text>
  21. </view>
  22. <!-- <view class="num-item" @click="goMenuPage('/pages/users/user_integral/integral')"> -->
  23. <view class="num-item">
  24. <view class="txt flex">
  25. <image class="userIcon" src="../../static/images/user02.png" mode="scaleToFill"></image>
  26. <text>提货额度</text>
  27. </view>
  28. <text class="num">{{userInfo.award_range}}</text>
  29. </view>
  30. <view class="num-item">
  31. <view class="txt flex">
  32. <image class="userIcon" src="../../static/images/user04.png" mode="scaleToFill"></image>
  33. <text>冻结金</text>
  34. </view>
  35. <text class="num">{{userInfo.freeze_award}}</text>
  36. </view>
  37. <!-- <view class="payGreenIn" @click="goMenuPage('/pages/users/user_integral/itemuser')">
  38. 购买绿积分
  39. </view> -->
  40. <!-- <view class="num-item" @click="goMenuPage('/pages/users/user_integral/integral')">
  41. <text class="num">{{userInfo.static_integral || 0}}</text>
  42. <view class="txt">消费分</view>
  43. </view> -->
  44. </view>
  45. <view class="num-wrapper lexall"
  46. :class="[member_style==3?'unNum-wrapper':member_style==2?'Tnum-wrapper':'',((vip_type==2 && stu) || (vip_type==1 && memberStatus))?'':'height']"
  47. v-if="userInfo.uid&&showApp">
  48. <view class="num-item" style="flex-grow: 0;" @click="goMenuPage('/pages/users/user_integral/red')">
  49. <view class="txt flex" >
  50. <image class="userIcon" src="../../static/images/user03.png" mode="scaleToFill"></image>
  51. <text>红积分</text>
  52. </view>
  53. <text class="num">{{userInfo.red_integral || 0}}</text>
  54. </view>
  55. <view class="num-item" style="flex-grow: 0;" @click="goMenuPage('/pages/users/user_integral/red')">
  56. <view class="txt flex" >
  57. <image class="userIcon" src="../../static/images/user05.png" mode="scaleToFill"></image>
  58. <text>价格</text>
  59. </view>
  60. <text class="num">{{indexData.price*1}}</text>
  61. </view>
  62. <view class="payRedIn ">
  63. <view class="targetMoney" @click="goMenuPage('/pages/users/user_integral/redTarget')">
  64. 转佣金
  65. </view>
  66. <view class="openDetail" @click="goMenuPage('/pages/users/user_integral/red')">
  67. 查看详细
  68. </view>
  69. </view>
  70. </view>
  71. <user-order :orderMenu="orderMenu" :orderAdminData="orderAdminData" :userInfo="userInfo"
  72. :memberData="diyData.member" :orderData="diyData.order"></user-order>
  73. <user-order-static v-if="isObjectData(orderAdminData) && orderAdminData.order.user_order"
  74. :orderAdminData="orderAdminData.order" :orderStaticData="diyData.orderStatic"></user-order-static>
  75. <user-poster :posterData="diyData.poster"></user-poster>
  76. <user-menu :menuData="diyData.menu"></user-menu>
  77. <user-mer-menu v-if="diyData.merMenu.list.length" :merMenuData="diyData.merMenu"></user-mer-menu>
  78. <user-store-menu v-if="diyData.storeMenu.list.length" :storeMenuData="diyData.storeMenu"></user-store-menu>
  79. <view class="copy_right pb-20">
  80. <template v-if="copyRightText">
  81. <image :src="copyRightImg" mode="aspectFill" class="copyRightImg"></image>
  82. <view class="copyRightText">
  83. {{ copyRightText }}
  84. </view>
  85. </template>
  86. <image v-else :src="copyRightImg" mode="aspectFill" class="support"></image>
  87. </view>
  88. </template>
  89. <!-- 店员推广码 extension-->
  90. <view class="fixed-ct w-620 h-690 bg--w111-fff rd-24rpx ml-f310 mt-f400 z-1000" v-show="isextension"
  91. @touchmove.stop.prevent>
  92. <view class="fs-32 text-#333 fw-500 mt-48 mb-48 text-center">店员推广码</view>
  93. <view class="acea-row row-center-wrapper">
  94. <!-- #ifdef MP -->
  95. <image :src="extension.code" class="w-380 h-380" @click="downloadCode"></image>
  96. <!-- #endif -->
  97. <!-- #ifndef MP -->
  98. <view class="acea-row row-center-wrapper" @click="downloadCode">
  99. <w-qrcode id="hah" :options="extension" @generate="hello"></w-qrcode>
  100. </view>
  101. <!-- #endif -->
  102. <view class="fs-26 text--w111-999 mt-40 w-312 text-center">如遇到扫码失败,</view>
  103. <view class="fs-26 text--w111-999 mt-10 w-312 text-center">请将屏幕调至最亮重新扫码</view>
  104. </view>
  105. <view class="iconfont icon-ic_close1 text--w111-fff absolute fs-50 bottom-f100rpx left-50 ml-f25"
  106. @click="closeCode"></view>
  107. </view>
  108. <view class="fixed-lt bg-w111-000-s111-80 w-full h-full z-999" v-show="isextension" @touchmove.stop.prevent>
  109. </view>
  110. <pageFooter :style="colorStyle"></pageFooter>
  111. <ewcomerPop v-if="isComerGift" :comerGift="comerGift" @comerPop="comerPop"></ewcomerPop>
  112. <!-- #ifdef MP -->
  113. <editUserModal :isShow="editModal" @closeEdit="closeEdit" @editSuccess="editSuccess"></editUserModal>
  114. <!-- #endif -->
  115. </view>
  116. </template>
  117. <script>
  118. import {
  119. storeCardApi
  120. } from '@/api/store.js';
  121. import {
  122. newcomerGift
  123. } from '@/api/activity.js';
  124. import {
  125. copyRight
  126. } from '@/api/api.js';
  127. import {
  128. getMenuList,
  129. getUserInfo,
  130. setVisit,
  131. updateUserInfo,
  132. getRandCode,
  133. updateWechatInfo,
  134. getMenuData,
  135. loadIndexs
  136. } from '@/api/user.js';
  137. import {
  138. wechatAuthV2,
  139. silenceAuth
  140. } from '@/api/public.js';
  141. import {
  142. toLogin
  143. } from '@/libs/login.js';
  144. import {
  145. mapState,
  146. mapGetters
  147. } from 'vuex';
  148. // #ifdef H5
  149. import Auth from '@/libs/wechat';
  150. // #endif
  151. import {
  152. HTTP_REQUEST_URL
  153. } from '@/config/app';
  154. const app = getApp();
  155. import ewcomerPop from '@/components/ewcomerPop/index.vue';
  156. import pageFooter from '@/components/pageFooter/index.vue';
  157. import dayjs from '@/plugin/dayjs/dayjs.min.js';
  158. import Routine from '@/libs/routine';
  159. import colors from '@/mixins/color';
  160. // #ifdef MP
  161. import editUserModal from '@/components/eidtUserModal/index.vue';
  162. // #endif
  163. import userMember from './components/member/index.vue';
  164. import userOrder from './components/order/index.vue';
  165. import userOrderStatic from './components/order_static/index.vue';
  166. import userMenu from './components/menus/index.vue';
  167. import userMerMenu from './components/merMenus/index.vue';
  168. import userStoreMenu from './components/storeMenus/index.vue';
  169. import userPoster from './components/poster/index.vue';
  170. export default {
  171. components: {
  172. userMember,
  173. userOrder,
  174. userOrderStatic,
  175. userMenu,
  176. userMerMenu,
  177. userStoreMenu,
  178. userPoster,
  179. pageFooter,
  180. ewcomerPop,
  181. // #ifdef MP
  182. editUserModal
  183. // #endif
  184. },
  185. computed: {
  186. ...mapGetters({
  187. cartNum: 'cartNum',
  188. isLogin: 'isLogin'
  189. }),
  190. // userFhed() {
  191. // const userInfo = this.userInfo;
  192. // if (userInfo.award_range) {
  193. // return +(userInfo.award_range / (userInfo.award_range + userInfo.send_award_range) * 100).toFixed(2);
  194. // } else {
  195. // return 0
  196. // }
  197. // },
  198. },
  199. filters: {},
  200. mixins: [colors],
  201. provide() {
  202. return {
  203. tapQrCode: this.tapQrCode,
  204. bindPhone: this.bindPhone,
  205. intoPage: this.intoPage,
  206. goMenuPage: this.goMenuPage,
  207. getMenuData: this.getMenuData,
  208. goEdit: this.goEdit
  209. };
  210. },
  211. data() {
  212. return {
  213. diyData: {},
  214. orderAdminData: {},
  215. // #ifdef MP
  216. getHeight: this.$util.getWXStatusHeight(),
  217. // #endif
  218. vipStatus: 0,
  219. stu: false,
  220. orderMenu: [{
  221. icon: '',
  222. title: '待付款',
  223. url: '/pages/goods/order_list/index?status=0'
  224. },
  225. {
  226. icon: '',
  227. title: '待发货',
  228. url: '/pages/goods/order_list/index?status=1'
  229. },
  230. {
  231. icon: '',
  232. title: '待收货',
  233. url: '/pages/goods/order_list/index?status=2'
  234. },
  235. {
  236. icon: '',
  237. title: '待评价',
  238. url: '/pages/goods/order_list/index?status=3'
  239. },
  240. {
  241. icon: '',
  242. title: '售后/退款',
  243. url: '/pages/users/user_return_list/index'
  244. }
  245. ],
  246. imgUrls: [],
  247. orderStatusNum: {},
  248. userInfo: '',
  249. showStatus: 1,
  250. // #ifdef H5 || MP
  251. pageHeight: '100%',
  252. routineContact: 0,
  253. // #endif
  254. // #ifdef APP-PLUS
  255. pageHeight: app.globalData.windowHeight,
  256. // #endif
  257. // #ifdef H5
  258. isWeixin: Auth.isWeixin(),
  259. //#endif
  260. footerSee: false,
  261. member_style: 1,
  262. my_banner_status: 1,
  263. menu_status: 1,
  264. service_status: 1,
  265. newcomer_status: 1,
  266. isextension: false,
  267. extension: {
  268. code: '',
  269. size: 380, // 二维码大小
  270. level: 3, //等级 0~4
  271. bgColor: '#FFFFFF', //二维码背景色 默认白色
  272. color: ['#333', '#333'] //边框颜色支持渐变色
  273. },
  274. imgHost: HTTP_REQUEST_URL,
  275. copyRightText: '',
  276. copyRightImg: '',
  277. giftPic: '',
  278. vip_type: 1,
  279. newcomer_style: 1,
  280. newList: [],
  281. newBg: '',
  282. comerGift: {},
  283. isComerGift: false,
  284. memberStatus: 0,
  285. balanceStatus: 0, // 余额是否展示
  286. editModal: false, // 编辑头像信息
  287. isScrolling: false,
  288. orderStyle: {
  289. 1: ['icon-ic_daifukuan12', 'icon-ic_daifahuo11', 'icon-ic_daishouhuo1', 'icon-ic_daipingjia1',
  290. 'icon-ic_daituikuan1'
  291. ],
  292. 2: ['icon-ic_daifukuan2', 'icon-ic_daifahuo2', 'icon-ic_daishouhuo2', 'icon-ic_daipingji2',
  293. 'icon-ic_daituikuan2'
  294. ],
  295. 3: ['icon-ic_daifukuan', 'icon-ic_daifahuo', 'icon-ic_daishouhuo', 'icon-ic_daipingjia',
  296. 'icon-ic_daituikuan'
  297. ]
  298. },
  299. codeImg: '',
  300. indexData:{},
  301. // #ifdef APP
  302. showApp:false
  303. // #endif
  304. // #ifndef APP
  305. showApp:true
  306. // #endif
  307. };
  308. },
  309. created() {
  310. let that = this;
  311. // #ifdef MP
  312. // 小程序静默授权
  313. if (!this.$store.getters.isLogin) {
  314. // Routine.getCode()
  315. // .then(code => {
  316. // Routine.silenceAuth(code).then(res => {
  317. // this.onLoadFun();
  318. // })
  319. // })
  320. // .catch(res => {
  321. // uni.hideLoading();
  322. // });
  323. }
  324. // #endif
  325. // #ifdef APP-PLUS
  326. that.$set(that, 'pageHeight', app.globalData.windowHeight);
  327. // #endif
  328. },
  329. async onLoad(option) {
  330. if (this.isLogin) {
  331. // this.getNewcomerGift();
  332. }
  333. // #ifdef H5
  334. if (this.isLogin && Auth.isWeixin() && option.code) {
  335. try {
  336. let res = await updateWechatInfo({
  337. code: option.code
  338. });
  339. this.userInfo.nickname = res.data.nickname;
  340. this.userInfo.avatar = res.data.avatar;
  341. this.userInfo.is_complete = 1;
  342. } catch (e) {}
  343. }
  344. // #endif
  345. this.colorData();
  346. },
  347. onReady() {
  348. loadIndexs().then(({data})=>{
  349. this.indexData = data;
  350. console.log(data,'data')
  351. }).catch((err)=>{
  352. console.log(err)
  353. })
  354. },
  355. onShow() {
  356. // #ifdef APP
  357. this.showApp = uni.getStorageSync("showAppHistary")||false
  358. // #endif
  359. if (!this.isLogin) {
  360. this.userInfo = '';
  361. toLogin();
  362. return;
  363. }
  364. if (this.cartNum > 0) {
  365. uni.setTabBarBadge({
  366. index: 3,
  367. text: this.cartNum > 99 ? '99+' : this.cartNum + ''
  368. });
  369. } else {
  370. uni.hideTabBarRedDot({
  371. index: 3
  372. });
  373. }
  374. this.copyRightText = uni.getStorageSync('copyNameInfo');
  375. this.copyRightImg = uni.getStorageSync('copyImageInfo');
  376. uni.removeStorageSync('form_type_cart');
  377. if (!this.copyRightText) {
  378. this.getCopyRight();
  379. }
  380. let that = this;
  381. // #ifdef APP-PLUS
  382. uni.getSystemInfo({
  383. success: function(res) {
  384. that.pageHeight = res.windowHeight + 'px';
  385. }
  386. });
  387. // #endif
  388. if (that.isLogin) {
  389. this.getUserInfo();
  390. this.getMyMenus();
  391. this.setVisit();
  392. this.getMenuData();
  393. }
  394. },
  395. // #ifdef MP || APP-PLUS
  396. onPageScroll(e) {
  397. if (e.scrollTop > 50) {
  398. this.isScrolling = true;
  399. } else if (e.scrollTop < 50) {
  400. this.isScrolling = false;
  401. }
  402. },
  403. // #endif
  404. methods: {
  405. hello(res) {
  406. this.codeImg = res.img.tempFilePath;
  407. },
  408. downloadCode() {
  409. let that = this
  410. // #ifdef H5
  411. var canvas = document.getElementById("hah").getElementsByTagName("canvas")
  412. var imgURL = canvas[0].toDataURL("image/png")
  413. var dlLink = document.createElement('a');
  414. dlLink.download = "店员推广码";
  415. dlLink.href = imgURL;
  416. dlLink.dataset.downloadurl = ["image/png", dlLink.download, dlLink.href].join(':');
  417. document.body.appendChild(dlLink);
  418. dlLink.click();
  419. document.body.removeChild(dlLink);
  420. // #endif
  421. // #ifdef MP
  422. uni.downloadFile({
  423. url: that.extension.code, //仅为示例,并非真实的资源
  424. success: (res) => {
  425. if (res.statusCode === 200) {
  426. uni.saveImageToPhotosAlbum({
  427. filePath: res.tempFilePath,
  428. success: function(res) {
  429. that.$util.Tips({
  430. title: '保存成功',
  431. icon: 'success'
  432. });
  433. },
  434. fail: function(res) {
  435. console.log(res)
  436. that.$util.Tips({
  437. title: '保存失败'
  438. });
  439. }
  440. });
  441. }
  442. }
  443. });
  444. // #endif
  445. // #ifdef APP-PLUS
  446. uni.saveImageToPhotosAlbum({
  447. filePath: that.codeImg,
  448. success: function(res) {
  449. that.$util.Tips({
  450. title: '保存成功',
  451. icon: 'success'
  452. });
  453. },
  454. fail: function(res) {
  455. that.$util.Tips({
  456. title: '保存失败'
  457. });
  458. }
  459. });
  460. // #endif
  461. },
  462. closeCode() {
  463. this.isextension = false
  464. },
  465. isObjectData(obj) {
  466. return Object.keys(obj).length !== 0;
  467. },
  468. // #ifdef MP
  469. editSuccess() {
  470. this.editModal = false;
  471. this.getUserInfo();
  472. },
  473. closeEdit() {
  474. this.editModal = false;
  475. },
  476. // #endif
  477. getCopyRight() {
  478. copyRight()
  479. .then((res) => {
  480. let data = res.data;
  481. if (!data.copyrightContext && !data.copyrightImage) {
  482. data.copyrightImage = '/static/images/support.png';
  483. }
  484. uni.setStorageSync('copyNameInfo', data.copyrightContext);
  485. uni.setStorageSync('copyImageInfo', data.copyrightImage);
  486. this.copyRightText = data.copyrightContext;
  487. this.copyRightImg = data.copyrightImage;
  488. })
  489. .catch((err) => {
  490. return this.$util.Tips({
  491. title: err.msg
  492. });
  493. });
  494. },
  495. // 查看订单
  496. intoPage(url) {
  497. if (this.isLogin) {
  498. if (['/pages/users/user_vip/index', '/pages/annex/vip_grade_active/index'].includes(url) && !this
  499. .userInfo.member_func_status) {
  500. this.$util.Tips({
  501. title: '会员卡功能暂未开启'
  502. });
  503. } else {
  504. this.$util.JumpPath(url);
  505. }
  506. } else {
  507. toLogin();
  508. }
  509. },
  510. // 编辑页面
  511. goEdit() {
  512. if (this.isLogin == false || !this.userInfo.uid) {
  513. toLogin();
  514. } else {
  515. // #ifdef MP
  516. if (this.userInfo.is_default_avatar) {
  517. this.editModal = true;
  518. return;
  519. }
  520. // #endif
  521. uni.navigateTo({
  522. url: '/pages/users/user_set/index'
  523. });
  524. }
  525. },
  526. goDetail(item) {
  527. uni.navigateTo({
  528. url: `/pages/goods_details/index?id=${item.id}&fromPage='newVip'`
  529. });
  530. },
  531. comerPop() {
  532. this.isComerGift = false;
  533. },
  534. getNewcomerGift() {
  535. if (uni.getStorageSync('newcomerGift')) {
  536. return (this.isComerGift = false);
  537. }
  538. newcomerGift()
  539. .then((res) => {
  540. this.comerGift = res.data;
  541. if (Object.prototype.toString.call(this.comerGift) == '[object Object]') {
  542. if (res.data.coupon_count || res.data.product_count || res.data.register_give_money || res
  543. .data.first_order_discount || res.data.register_give_integral) {
  544. uni.setStorageSync('newcomerGift', true);
  545. this.isComerGift = true;
  546. }
  547. }
  548. })
  549. .catch((err) => {
  550. return this.$util.Tips({
  551. title: err
  552. });
  553. });
  554. },
  555. tapQrCode() {
  556. uni.navigateTo({
  557. url: '/pages/users/user_member_code/index'
  558. });
  559. },
  560. getRoutineUserInfo(e) {
  561. updateUserInfo({
  562. userInfo: e.detail.userInfo
  563. })
  564. .then((res) => {
  565. this.getUserInfo();
  566. return this.$util.Tips('更新用户信息成功');
  567. })
  568. .catch((err) => {
  569. return this.$util.Tips(err);
  570. });
  571. },
  572. // 记录会员访问
  573. setVisit() {
  574. setVisit({
  575. url: '/pages/user/index'
  576. }).then((res) => {});
  577. },
  578. // 打开授权
  579. openAuto() {
  580. toLogin();
  581. },
  582. // 授权回调
  583. onLoadFun(e) {
  584. this.getUserInfo(e);
  585. this.getMyMenus();
  586. this.setVisit();
  587. },
  588. // 绑定手机
  589. bindPhone() {
  590. uni.navigateTo({
  591. url: '/pages/users/user_phone/index'
  592. });
  593. },
  594. // 获取行销数据
  595. getMenuData() {
  596. getMenuData().then((res) => {
  597. this.orderAdminData = res.data;
  598. });
  599. },
  600. /**
  601. * 获取个人用户信息
  602. */
  603. getUserInfo() {
  604. let that = this;
  605. getUserInfo().then((res) => {
  606. that.userInfo = res.data;
  607. that.stu = res.data.svip_open;
  608. that.balanceStatus = res.data.balance_func_status;
  609. that.memberStatus = parseInt(res.data.member_func_status);
  610. that.vipStatus = res.data.vip_status;
  611. that.$store.commit('SETUID', res.data.uid);
  612. that.$store.commit('UPDATE_USERINFO', res.data);
  613. that.orderMenu.forEach((item, index) => {
  614. switch (item.title) {
  615. case '待付款':
  616. this.$set(item, 'num', res.data.orderStatusNum.unpaid_count);
  617. break;
  618. case '待发货':
  619. this.$set(item, 'num', res.data.orderStatusNum.unshipped_count);
  620. break;
  621. case '待收货':
  622. this.$set(item, 'num', res.data.orderStatusNum.received_count);
  623. break;
  624. case '待评价':
  625. this.$set(item, 'num', res.data.orderStatusNum.evaluated_count);
  626. break;
  627. case '售后/退款':
  628. this.$set(item, 'num', res.data.orderStatusNum.refunding_count);
  629. break;
  630. }
  631. });
  632. });
  633. },
  634. getMyMenus: function() {
  635. let that = this;
  636. getMenuList().then((res) => {
  637. this.diyData = res.data.diy_data;
  638. this.switchTab(this.diyData.order.style);
  639. this.my_banner_status = res.data.diy_data.my_banner_status;
  640. this.menu_status = res.data.diy_data.menu_status;
  641. this.service_status = res.data.diy_data.service_status;
  642. this.vip_type = res.data.diy_data.vip_type;
  643. this.newcomer_style = res.data.diy_data.newcomer_style;
  644. this.newcomer_status = res.data.diy_data.newcomer_status;
  645. this.imgUrls = res.data.routine_my_banner;
  646. this.routineContact = Number(res.data.routine_contact_type);
  647. });
  648. },
  649. switchTab(style) {
  650. this.orderMenu.forEach((item, index) => {
  651. item.icon = this.orderStyle[style][index];
  652. });
  653. },
  654. goMenuPage(url, name) {
  655. console.log(url);
  656. if (this.isLogin) {
  657. let arr = url.split('@APPID=');
  658. if (arr.length > 1) {
  659. //#ifdef MP
  660. uni.navigateToMiniProgram({
  661. appId: arr[arr.length - 1], // 此为生活缴费appid
  662. path: arr[0], // 此为生活缴费首页路径
  663. envVersion: 'release',
  664. success: (res) => {
  665. console.log('打开成功', res);
  666. },
  667. fail: (err) => {
  668. console.log('sgdhgf', err);
  669. }
  670. });
  671. //#endif
  672. //#ifndef MP
  673. this.Tips({
  674. title: 'h5与app端不支持跳转外部小程序'
  675. });
  676. //#endif
  677. } else {
  678. if (url == '/pages/extension/customer_list/chat' || url == 'https://chat.crmeb.net/chat/mobile') {
  679. this.$util.getCustomer(this.userInfo);
  680. } else {
  681. if (url.indexOf('http') === -1) {
  682. // #ifdef H5
  683. if (name && name === '订单核销') {
  684. return (window.location.href = `${location.origin}${url}`);
  685. }
  686. // #endif
  687. // #ifdef MP
  688. if (url != '#' && url == '/pages/users/user_set/index') {
  689. uni.openSetting({
  690. success: function(res) {}
  691. });
  692. }
  693. // #endif
  694. if (url == '/pages/store_spread/index') {
  695. storeCardApi()
  696. .then((res) => {
  697. this.isextension = true;
  698. this.$nextTick(function() {
  699. this.extension.code = res.data.url;
  700. });
  701. })
  702. .catch((err) => {
  703. uni.hideLoading();
  704. this.$util.Tips({
  705. title: err
  706. });
  707. });
  708. }
  709. if (
  710. ['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart',
  711. '/pages/user/index', '/pages/store_cate/store_cate', '/pages/index/index'
  712. ].indexOf(url) == -1
  713. ) {
  714. uni.navigateTo({
  715. url: url
  716. });
  717. } else {
  718. uni.reLaunch({
  719. url: url
  720. });
  721. }
  722. } else {
  723. // #ifdef H5
  724. this.$util.JumpPath(url);
  725. // #endif
  726. // #ifndef H5
  727. uni.navigateTo({
  728. url: `/pages/annex/web_view/index?url=${url}`
  729. });
  730. // #endif
  731. }
  732. }
  733. }
  734. }
  735. }
  736. }
  737. };
  738. </script>
  739. <style lang="scss" scoped>
  740. .payRedIn{
  741. display: flex;
  742. flex-grow: 1;
  743. justify-content: flex-end;
  744. padding: 0 30rpx;
  745. line-height: 1;
  746. flex-shrink: 0;
  747. .targetMoney.openDetail{
  748. padding: 10rpx 0rpx 10rpx 10rpx;
  749. }
  750. .targetMoney{
  751. border-right: 1px solid #999999;
  752. margin-right: 20rpx;
  753. padding-right: 20rpx;
  754. }
  755. .openDetail{
  756. }
  757. }
  758. .footer-placeholder {
  759. height: calc(98rpx+ constant(safe-area-inset-bottom));
  760. height: calc(98rpx + env(safe-area-inset-bottom));
  761. height: 98rpx;
  762. }
  763. .user-page {
  764. padding-bottom: calc(100rpx+ constant(safe-area-inset-bottom));
  765. padding-bottom: calc(100rpx + env(safe-area-inset-bottom));
  766. padding-bottom: 100rpx;
  767. }
  768. .copy_right {
  769. text-align: center;
  770. color: #ccc;
  771. font-size: 22rpx;
  772. margin-top: 40rpx;
  773. .copyRightImg {
  774. width: 219rpx;
  775. height: 74rpx;
  776. margin: 16rpx auto;
  777. display: block;
  778. }
  779. .support {
  780. width: 219rpx;
  781. height: 74rpx;
  782. margin: 54rpx auto;
  783. display: block;
  784. }
  785. .copyRightText {
  786. margin-top: 0rpx;
  787. color: #ccc;
  788. font-size: 20rpx;
  789. margin-bottom: 20rpx;
  790. }
  791. }
  792. .num-wrapper {
  793. background-color: #fff;
  794. z-index: 29;
  795. position: relative;
  796. display: flex;
  797. align-items: center;
  798. justify-content: space-between;
  799. margin-top: 22rpx;
  800. color: #333;
  801. margin: 20rpx 20rpx 20rpx 20rpx;
  802. border-radius: 16rpx;
  803. height: 160rpx;
  804. &.on {
  805. height: 128rpx;
  806. margin-top: -68rpx;
  807. .gift {
  808. color: var(--view-theme);
  809. margin-left: 10rpx;
  810. font-weight: bold;
  811. }
  812. }
  813. .img {
  814. margin-left: 38rpx;
  815. width: 76rpx;
  816. height: 68rpx;
  817. }
  818. .text {
  819. font-size: 28rpx;
  820. font-weight: 400;
  821. color: #333333;
  822. margin-left: -60rpx;
  823. }
  824. .btn-login {
  825. width: 144rpx;
  826. height: 56rpx;
  827. // background: linear-gradient(270deg, #FF7931 0%, #E93323 100%);
  828. background-color: var(--view-theme);
  829. border-radius: 28rpx;
  830. text-align: center;
  831. line-height: 56rpx;
  832. margin-right: 32rpx;
  833. font-size: 28rpx;
  834. font-weight: 500;
  835. color: #FFFFFF;
  836. }
  837. .payGreenIn{
  838. color: #FFF;
  839. background: linear-gradient(-30deg, #FF8F3B, #FF3106);
  840. padding: 20rpx 30rpx;
  841. margin-right: 30rpx;
  842. border-radius: 20rpx;
  843. }
  844. .num-item {
  845. width: 33.33%;
  846. text-align: center;
  847. flex-grow: 1;
  848. &~.num-item {
  849. position: relative;
  850. &:before {
  851. content: '';
  852. position: absolute;
  853. width: 1rpx;
  854. height: 28rpx;
  855. top: 50%;
  856. margin-top: -14rpx;
  857. background-color: rgba(255, 255, 255, 0.4);
  858. left: 0;
  859. }
  860. }
  861. .num {
  862. font-size: 36rpx;
  863. font-weight: bold;
  864. }
  865. .txt {
  866. margin-top: 8rpx;
  867. font-size: 26rpx;
  868. color: #555;
  869. display: flex;
  870. justify-content: center;
  871. align-items: center;
  872. color:#666666;
  873. line-height: 1;
  874. padding-bottom: 20rpx;
  875. .userIcon {
  876. width: 28rpx;
  877. height: 28rpx;
  878. margin-right: 10rpx;
  879. }
  880. }
  881. }
  882. }
  883. </style>