index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  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">
  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">
  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. };
  302. },
  303. created() {
  304. let that = this;
  305. // #ifdef MP
  306. // 小程序静默授权
  307. if (!this.$store.getters.isLogin) {
  308. // Routine.getCode()
  309. // .then(code => {
  310. // Routine.silenceAuth(code).then(res => {
  311. // this.onLoadFun();
  312. // })
  313. // })
  314. // .catch(res => {
  315. // uni.hideLoading();
  316. // });
  317. }
  318. // #endif
  319. // #ifdef APP-PLUS
  320. that.$set(that, 'pageHeight', app.globalData.windowHeight);
  321. // #endif
  322. },
  323. async onLoad(option) {
  324. if (this.isLogin) {
  325. // this.getNewcomerGift();
  326. }
  327. // #ifdef H5
  328. if (this.isLogin && Auth.isWeixin() && option.code) {
  329. try {
  330. let res = await updateWechatInfo({
  331. code: option.code
  332. });
  333. this.userInfo.nickname = res.data.nickname;
  334. this.userInfo.avatar = res.data.avatar;
  335. this.userInfo.is_complete = 1;
  336. } catch (e) {}
  337. }
  338. // #endif
  339. this.colorData();
  340. },
  341. onReady() {
  342. loadIndexs().then(({data})=>{
  343. this.indexData = data;
  344. console.log(data,'data')
  345. }).catch((err)=>{
  346. console.log(err)
  347. })
  348. },
  349. onShow() {
  350. if (!this.isLogin) {
  351. this.userInfo = '';
  352. toLogin();
  353. return;
  354. }
  355. if (this.cartNum > 0) {
  356. uni.setTabBarBadge({
  357. index: 3,
  358. text: this.cartNum > 99 ? '99+' : this.cartNum + ''
  359. });
  360. } else {
  361. uni.hideTabBarRedDot({
  362. index: 3
  363. });
  364. }
  365. this.copyRightText = uni.getStorageSync('copyNameInfo');
  366. this.copyRightImg = uni.getStorageSync('copyImageInfo');
  367. uni.removeStorageSync('form_type_cart');
  368. if (!this.copyRightText) {
  369. this.getCopyRight();
  370. }
  371. let that = this;
  372. // #ifdef APP-PLUS
  373. uni.getSystemInfo({
  374. success: function(res) {
  375. that.pageHeight = res.windowHeight + 'px';
  376. }
  377. });
  378. // #endif
  379. if (that.isLogin) {
  380. this.getUserInfo();
  381. this.getMyMenus();
  382. this.setVisit();
  383. this.getMenuData();
  384. }
  385. },
  386. // #ifdef MP || APP-PLUS
  387. onPageScroll(e) {
  388. if (e.scrollTop > 50) {
  389. this.isScrolling = true;
  390. } else if (e.scrollTop < 50) {
  391. this.isScrolling = false;
  392. }
  393. },
  394. // #endif
  395. methods: {
  396. hello(res) {
  397. this.codeImg = res.img.tempFilePath;
  398. },
  399. downloadCode() {
  400. let that = this
  401. // #ifdef H5
  402. var canvas = document.getElementById("hah").getElementsByTagName("canvas")
  403. var imgURL = canvas[0].toDataURL("image/png")
  404. var dlLink = document.createElement('a');
  405. dlLink.download = "店员推广码";
  406. dlLink.href = imgURL;
  407. dlLink.dataset.downloadurl = ["image/png", dlLink.download, dlLink.href].join(':');
  408. document.body.appendChild(dlLink);
  409. dlLink.click();
  410. document.body.removeChild(dlLink);
  411. // #endif
  412. // #ifdef MP
  413. uni.downloadFile({
  414. url: that.extension.code, //仅为示例,并非真实的资源
  415. success: (res) => {
  416. if (res.statusCode === 200) {
  417. uni.saveImageToPhotosAlbum({
  418. filePath: res.tempFilePath,
  419. success: function(res) {
  420. that.$util.Tips({
  421. title: '保存成功',
  422. icon: 'success'
  423. });
  424. },
  425. fail: function(res) {
  426. console.log(res)
  427. that.$util.Tips({
  428. title: '保存失败'
  429. });
  430. }
  431. });
  432. }
  433. }
  434. });
  435. // #endif
  436. // #ifdef APP-PLUS
  437. uni.saveImageToPhotosAlbum({
  438. filePath: that.codeImg,
  439. success: function(res) {
  440. that.$util.Tips({
  441. title: '保存成功',
  442. icon: 'success'
  443. });
  444. },
  445. fail: function(res) {
  446. that.$util.Tips({
  447. title: '保存失败'
  448. });
  449. }
  450. });
  451. // #endif
  452. },
  453. closeCode() {
  454. this.isextension = false
  455. },
  456. isObjectData(obj) {
  457. return Object.keys(obj).length !== 0;
  458. },
  459. // #ifdef MP
  460. editSuccess() {
  461. this.editModal = false;
  462. this.getUserInfo();
  463. },
  464. closeEdit() {
  465. this.editModal = false;
  466. },
  467. // #endif
  468. getCopyRight() {
  469. copyRight()
  470. .then((res) => {
  471. let data = res.data;
  472. if (!data.copyrightContext && !data.copyrightImage) {
  473. data.copyrightImage = '/static/images/support.png';
  474. }
  475. uni.setStorageSync('copyNameInfo', data.copyrightContext);
  476. uni.setStorageSync('copyImageInfo', data.copyrightImage);
  477. this.copyRightText = data.copyrightContext;
  478. this.copyRightImg = data.copyrightImage;
  479. })
  480. .catch((err) => {
  481. return this.$util.Tips({
  482. title: err.msg
  483. });
  484. });
  485. },
  486. // 查看订单
  487. intoPage(url) {
  488. if (this.isLogin) {
  489. if (['/pages/users/user_vip/index', '/pages/annex/vip_grade_active/index'].includes(url) && !this
  490. .userInfo.member_func_status) {
  491. this.$util.Tips({
  492. title: '会员卡功能暂未开启'
  493. });
  494. } else {
  495. this.$util.JumpPath(url);
  496. }
  497. } else {
  498. toLogin();
  499. }
  500. },
  501. // 编辑页面
  502. goEdit() {
  503. if (this.isLogin == false || !this.userInfo.uid) {
  504. toLogin();
  505. } else {
  506. // #ifdef MP
  507. if (this.userInfo.is_default_avatar) {
  508. this.editModal = true;
  509. return;
  510. }
  511. // #endif
  512. uni.navigateTo({
  513. url: '/pages/users/user_set/index'
  514. });
  515. }
  516. },
  517. goDetail(item) {
  518. uni.navigateTo({
  519. url: `/pages/goods_details/index?id=${item.id}&fromPage='newVip'`
  520. });
  521. },
  522. comerPop() {
  523. this.isComerGift = false;
  524. },
  525. getNewcomerGift() {
  526. if (uni.getStorageSync('newcomerGift')) {
  527. return (this.isComerGift = false);
  528. }
  529. newcomerGift()
  530. .then((res) => {
  531. this.comerGift = res.data;
  532. if (Object.prototype.toString.call(this.comerGift) == '[object Object]') {
  533. if (res.data.coupon_count || res.data.product_count || res.data.register_give_money || res
  534. .data.first_order_discount || res.data.register_give_integral) {
  535. uni.setStorageSync('newcomerGift', true);
  536. this.isComerGift = true;
  537. }
  538. }
  539. })
  540. .catch((err) => {
  541. return this.$util.Tips({
  542. title: err
  543. });
  544. });
  545. },
  546. tapQrCode() {
  547. uni.navigateTo({
  548. url: '/pages/users/user_member_code/index'
  549. });
  550. },
  551. getRoutineUserInfo(e) {
  552. updateUserInfo({
  553. userInfo: e.detail.userInfo
  554. })
  555. .then((res) => {
  556. this.getUserInfo();
  557. return this.$util.Tips('更新用户信息成功');
  558. })
  559. .catch((err) => {
  560. return this.$util.Tips(err);
  561. });
  562. },
  563. // 记录会员访问
  564. setVisit() {
  565. setVisit({
  566. url: '/pages/user/index'
  567. }).then((res) => {});
  568. },
  569. // 打开授权
  570. openAuto() {
  571. toLogin();
  572. },
  573. // 授权回调
  574. onLoadFun(e) {
  575. this.getUserInfo(e);
  576. this.getMyMenus();
  577. this.setVisit();
  578. },
  579. // 绑定手机
  580. bindPhone() {
  581. uni.navigateTo({
  582. url: '/pages/users/user_phone/index'
  583. });
  584. },
  585. // 获取行销数据
  586. getMenuData() {
  587. getMenuData().then((res) => {
  588. this.orderAdminData = res.data;
  589. });
  590. },
  591. /**
  592. * 获取个人用户信息
  593. */
  594. getUserInfo() {
  595. let that = this;
  596. getUserInfo().then((res) => {
  597. that.userInfo = res.data;
  598. that.stu = res.data.svip_open;
  599. that.balanceStatus = res.data.balance_func_status;
  600. that.memberStatus = parseInt(res.data.member_func_status);
  601. that.vipStatus = res.data.vip_status;
  602. that.$store.commit('SETUID', res.data.uid);
  603. that.$store.commit('UPDATE_USERINFO', res.data);
  604. that.orderMenu.forEach((item, index) => {
  605. switch (item.title) {
  606. case '待付款':
  607. this.$set(item, 'num', res.data.orderStatusNum.unpaid_count);
  608. break;
  609. case '待发货':
  610. this.$set(item, 'num', res.data.orderStatusNum.unshipped_count);
  611. break;
  612. case '待收货':
  613. this.$set(item, 'num', res.data.orderStatusNum.received_count);
  614. break;
  615. case '待评价':
  616. this.$set(item, 'num', res.data.orderStatusNum.evaluated_count);
  617. break;
  618. case '售后/退款':
  619. this.$set(item, 'num', res.data.orderStatusNum.refunding_count);
  620. break;
  621. }
  622. });
  623. });
  624. },
  625. getMyMenus: function() {
  626. let that = this;
  627. getMenuList().then((res) => {
  628. this.diyData = res.data.diy_data;
  629. this.switchTab(this.diyData.order.style);
  630. this.my_banner_status = res.data.diy_data.my_banner_status;
  631. this.menu_status = res.data.diy_data.menu_status;
  632. this.service_status = res.data.diy_data.service_status;
  633. this.vip_type = res.data.diy_data.vip_type;
  634. this.newcomer_style = res.data.diy_data.newcomer_style;
  635. this.newcomer_status = res.data.diy_data.newcomer_status;
  636. this.imgUrls = res.data.routine_my_banner;
  637. this.routineContact = Number(res.data.routine_contact_type);
  638. });
  639. },
  640. switchTab(style) {
  641. this.orderMenu.forEach((item, index) => {
  642. item.icon = this.orderStyle[style][index];
  643. });
  644. },
  645. goMenuPage(url, name) {
  646. console.log(url);
  647. if (this.isLogin) {
  648. let arr = url.split('@APPID=');
  649. if (arr.length > 1) {
  650. //#ifdef MP
  651. uni.navigateToMiniProgram({
  652. appId: arr[arr.length - 1], // 此为生活缴费appid
  653. path: arr[0], // 此为生活缴费首页路径
  654. envVersion: 'release',
  655. success: (res) => {
  656. console.log('打开成功', res);
  657. },
  658. fail: (err) => {
  659. console.log('sgdhgf', err);
  660. }
  661. });
  662. //#endif
  663. //#ifndef MP
  664. this.Tips({
  665. title: 'h5与app端不支持跳转外部小程序'
  666. });
  667. //#endif
  668. } else {
  669. if (url == '/pages/extension/customer_list/chat' || url == 'https://chat.crmeb.net/chat/mobile') {
  670. this.$util.getCustomer(this.userInfo);
  671. } else {
  672. if (url.indexOf('http') === -1) {
  673. // #ifdef H5
  674. if (name && name === '订单核销') {
  675. return (window.location.href = `${location.origin}${url}`);
  676. }
  677. // #endif
  678. // #ifdef MP
  679. if (url != '#' && url == '/pages/users/user_set/index') {
  680. uni.openSetting({
  681. success: function(res) {}
  682. });
  683. }
  684. // #endif
  685. if (url == '/pages/store_spread/index') {
  686. storeCardApi()
  687. .then((res) => {
  688. this.isextension = true;
  689. this.$nextTick(function() {
  690. this.extension.code = res.data.url;
  691. });
  692. })
  693. .catch((err) => {
  694. uni.hideLoading();
  695. this.$util.Tips({
  696. title: err
  697. });
  698. });
  699. }
  700. if (
  701. ['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart',
  702. '/pages/user/index', '/pages/store_cate/store_cate', '/pages/index/index'
  703. ].indexOf(url) == -1
  704. ) {
  705. uni.navigateTo({
  706. url: url
  707. });
  708. } else {
  709. uni.reLaunch({
  710. url: url
  711. });
  712. }
  713. } else {
  714. // #ifdef H5
  715. this.$util.JumpPath(url);
  716. // #endif
  717. // #ifndef H5
  718. uni.navigateTo({
  719. url: `/pages/annex/web_view/index?url=${url}`
  720. });
  721. // #endif
  722. }
  723. }
  724. }
  725. }
  726. }
  727. }
  728. };
  729. </script>
  730. <style lang="scss" scoped>
  731. .payRedIn{
  732. display: flex;
  733. flex-grow: 1;
  734. justify-content: flex-end;
  735. padding: 0 30rpx;
  736. line-height: 1;
  737. flex-shrink: 0;
  738. .targetMoney.openDetail{
  739. padding: 10rpx 0rpx 10rpx 10rpx;
  740. }
  741. .targetMoney{
  742. border-right: 1px solid #999999;
  743. margin-right: 20rpx;
  744. padding-right: 20rpx;
  745. }
  746. .openDetail{
  747. }
  748. }
  749. .footer-placeholder {
  750. height: calc(98rpx+ constant(safe-area-inset-bottom));
  751. height: calc(98rpx + env(safe-area-inset-bottom));
  752. height: 98rpx;
  753. }
  754. .user-page {
  755. padding-bottom: calc(100rpx+ constant(safe-area-inset-bottom));
  756. padding-bottom: calc(100rpx + env(safe-area-inset-bottom));
  757. padding-bottom: 100rpx;
  758. }
  759. .copy_right {
  760. text-align: center;
  761. color: #ccc;
  762. font-size: 22rpx;
  763. margin-top: 40rpx;
  764. .copyRightImg {
  765. width: 219rpx;
  766. height: 74rpx;
  767. margin: 16rpx auto;
  768. display: block;
  769. }
  770. .support {
  771. width: 219rpx;
  772. height: 74rpx;
  773. margin: 54rpx auto;
  774. display: block;
  775. }
  776. .copyRightText {
  777. margin-top: 0rpx;
  778. color: #ccc;
  779. font-size: 20rpx;
  780. margin-bottom: 20rpx;
  781. }
  782. }
  783. .num-wrapper {
  784. background-color: #fff;
  785. z-index: 29;
  786. position: relative;
  787. display: flex;
  788. align-items: center;
  789. justify-content: space-between;
  790. margin-top: 22rpx;
  791. color: #333;
  792. margin: 20rpx 20rpx 20rpx 20rpx;
  793. border-radius: 16rpx;
  794. height: 160rpx;
  795. &.on {
  796. height: 128rpx;
  797. margin-top: -68rpx;
  798. .gift {
  799. color: var(--view-theme);
  800. margin-left: 10rpx;
  801. font-weight: bold;
  802. }
  803. }
  804. .img {
  805. margin-left: 38rpx;
  806. width: 76rpx;
  807. height: 68rpx;
  808. }
  809. .text {
  810. font-size: 28rpx;
  811. font-weight: 400;
  812. color: #333333;
  813. margin-left: -60rpx;
  814. }
  815. .btn-login {
  816. width: 144rpx;
  817. height: 56rpx;
  818. // background: linear-gradient(270deg, #FF7931 0%, #E93323 100%);
  819. background-color: var(--view-theme);
  820. border-radius: 28rpx;
  821. text-align: center;
  822. line-height: 56rpx;
  823. margin-right: 32rpx;
  824. font-size: 28rpx;
  825. font-weight: 500;
  826. color: #FFFFFF;
  827. }
  828. .payGreenIn{
  829. color: #FFF;
  830. background: linear-gradient(-30deg, #FF8F3B, #FF3106);
  831. padding: 20rpx 30rpx;
  832. margin-right: 30rpx;
  833. border-radius: 20rpx;
  834. }
  835. .num-item {
  836. width: 33.33%;
  837. text-align: center;
  838. flex-grow: 1;
  839. &~.num-item {
  840. position: relative;
  841. &:before {
  842. content: '';
  843. position: absolute;
  844. width: 1rpx;
  845. height: 28rpx;
  846. top: 50%;
  847. margin-top: -14rpx;
  848. background-color: rgba(255, 255, 255, 0.4);
  849. left: 0;
  850. }
  851. }
  852. .num {
  853. font-size: 36rpx;
  854. font-weight: bold;
  855. }
  856. .txt {
  857. margin-top: 8rpx;
  858. font-size: 26rpx;
  859. color: #555;
  860. display: flex;
  861. justify-content: center;
  862. align-items: center;
  863. color:#666666;
  864. line-height: 1;
  865. padding-bottom: 20rpx;
  866. .userIcon {
  867. width: 28rpx;
  868. height: 28rpx;
  869. margin-right: 10rpx;
  870. }
  871. }
  872. }
  873. }
  874. </style>