From 3f1976ac62b8b53e536e28f54bd1116460a8e9fd Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Fri, 21 Jun 2024 17:41:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E5=8D=A1=E4=B8=AD=E5=BF=83=20-=20=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user.js | 10 +-- pages/annex/vip_center/index.vue | 131 +++++++++++++++++++++---------- pages/user/index.vue | 26 +++++- 3 files changed, 116 insertions(+), 51 deletions(-) diff --git a/api/user.js b/api/user.js index 30b2225..12adfa9 100644 --- a/api/user.js +++ b/api/user.js @@ -627,13 +627,9 @@ export function memberCard() { export function memberCardCreate(id, data) { return request.post(`svip/pay/${id}`, data) } -/** - * 付费会员权益 - * @param object data - * - */ -export function memberEquity() { - return request.get(`svip/user_info`, {}, {noAuth: true}) +// 付费会员权益 +export function memberEquity(data = {}) { + return request.get(`svip/user_info`, data, {noAuth: true}) } /** * 付费会员优惠券 diff --git a/pages/annex/vip_center/index.vue b/pages/annex/vip_center/index.vue index 11e4cc7..9e939c9 100644 --- a/pages/annex/vip_center/index.vue +++ b/pages/annex/vip_center/index.vue @@ -27,17 +27,6 @@ 立即续费 - - - - - - {{item.name}} - {{item.info}} - - - - @@ -68,11 +57,17 @@ --> - - - 会员续费 - 续费可继续享受优惠价 - + + + + + + + + 会员等级 + + + @@ -81,6 +76,24 @@ ¥{{item.value && item.value.cost_price | moneyFormat}} + + + + 会员权益 + + + + + + + + {{item.name}} + {{item.info}} + + + + + 立即支付 @@ -214,13 +227,21 @@ //员工邀请开通会员卡 bind_mer_id: 0, bind_staff_id: 0, + currentType: {}, + title_left: '', + title_right: '', } }, watch: { }, computed: mapGetters(['isLogin','uid']), + onReady() { + this.title_left = `${HTTP_REQUEST_URL}/static/images/icon/title_left.png`; + this.title_right = `${HTTP_REQUEST_URL}/static/images/icon/title_right.png`; + + }, onLoad(options) { // 二维码参数接收 if(options.scene){ @@ -235,18 +256,16 @@ } } - this.getCouponLst(); if (this.isLogin) { + this.getCouponLst(); this.getMemberCard(); - this.memberEquity(); this.groomList(); + // 关系处理 + if(options.spread) spread(options.spread, this.isLogin) } else { this.isAuto = true; this.isShowAuth = true } - - // 关系处理 - if(options.spread) spread(options.spread, this.isLogin) }, onShow(){ @@ -255,18 +274,16 @@ this.groomList(); }, methods: { - onLunch() { - this.getMemberCard(); - this.memberEquity(); - this.getCouponLst(); - }, + // 授权回调 onLoadFun() { - this.isShowAuth = false; - this.getMemberCard(); - this.memberEquity(); + if(this.isLogin){ + this.isShowAuth = false; + this.getMemberCard(); + this.getCouponLst(); + } }, // 授权关闭 - authColse: function(e) { + authColse(e) { this.isShowAuth = e }, goUrl(url){ @@ -300,6 +317,8 @@ this.totalPrice = res.data.def.price.toString(); this.pay_order_id = res.data.def.group_data_id.toString(); this.svip_type = res.data.def.svip_type; + this.currentType = Object.assign({}, this.memberType[0]); + this.memberEquity(); }).catch(err => { uni.showToast({ title: err, @@ -309,7 +328,11 @@ }, // 付费会员权益 memberEquity() { - memberEquity().then(res => { + let memberType = Object.assign({}, this.currentType); + let interests = memberType.value.interests || {}; + let interestsId = Object.values(interests).toString(); + + memberEquity({ interests_id: interestsId,is_appoint: 1 }).then(res => { this.memberRights = res.data.interests; this.userInfo = res.data.user; }).catch(err => { @@ -619,6 +642,8 @@ this.svip_type = svip.value.svip_type; this.pay_order_id = svip.group_data_id.toString(); this.totalPrice = svip.value.price.toString(); + this.currentType = Object.assign({}, svip); + this.memberEquity(); }, goDetail(id) { uni.navigateTo({ @@ -690,6 +715,7 @@ // #endif } + diff --git a/pages/user/index.vue b/pages/user/index.vue index 6a722fa..ae55baa 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -89,10 +89,15 @@ {{userInfo.wine_available || 0}} 坛封酒积分 - - {{userInfo.oil_available || 0}} - 加油卡积分 + + {{ integral_surplus || 0}} + 餐费积分 + + + + + @@ -343,6 +348,7 @@ import { HTTP_REQUEST_URL } from '@/config/app'; import { getUserExchangeQrcode } from '@/api/exchange.js'; import {identityList} from "@/api/agent"; + import {merShareholdersIntegralStatistics} from "@/api/user"; const app = getApp(); export default { @@ -458,6 +464,7 @@ }, identityCurrent:{}, identityCurrentName: '', + integral_surplus: '', } }, onLoad(options) { @@ -483,6 +490,7 @@ this.getUserInfo(); this.orderNum(); this.getIdentityList(); + this.shareholdersIntegralInfo(); } else { // this.userInfo = { // is_svip: 0 @@ -627,6 +635,7 @@ this.getMyMenus(); this.orderNum(); this.getIdentityList(); + this.shareholdersIntegralInfo(); this.isShowAuth = false; }, Setting: function() { @@ -927,6 +936,17 @@ }, }) }, + // 餐费积分 - 获取当前用户可用餐费积分 + shareholdersIntegralInfo(){ + let _this = this; + merShareholdersIntegralStatistics({}).then(res => { + _this.integral_surplus = res.data.sum_used_surplus || 0; + }).catch(err => { + this.$util.Tips({title: err}); + }); + }, + + }, onPullDownRefresh: function(){