From 3995eec885dd7a1458a3dcb9eaf85a8768a62df3 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期三, 18 九月 2024 16:08:13 +0800
Subject: [PATCH] update 积分历史
---
sub_pages/customer/self/member-center.vue | 120 ++++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 89 insertions(+), 31 deletions(-)
diff --git a/sub_pages/customer/self/member-center.vue b/sub_pages/customer/self/member-center.vue
index 1697959..1e36a79 100644
--- a/sub_pages/customer/self/member-center.vue
+++ b/sub_pages/customer/self/member-center.vue
@@ -3,7 +3,8 @@
<image src="../../../static/images/customer/coupon/member/member-level-bg.png" mode="aspectFit"
class="img100 member-level-image"></image>
<view class="banner">
- <banner3d ref="banner3d" v-if="init" :banner-list="bannerList" :swiper-config="swiperConfig"></banner3d>
+ <banner3d @changeIndex="changeIndex" ref="banner3d" v-if="init" :banner-list="bannerList"
+ :swiper-config="swiperConfig"></banner3d>
</view>
<view class="p20" style="padding-top: 0rpx;">
<!-- <view class="info bg-white p20">
@@ -29,22 +30,42 @@
<image class="m-auto icon img100 " mode="scaleToFill"
src="../../../static/images/customer/coupon/member/icon-member-info-1.png"></image>
<view class="desc">
- 积分达到{{currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || '-'}}
+ <!-- 积分达到{{currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || '-'}} -->
+ 积分达到{{bannerList[curIndex].point.startPoint || '0'}}
</view>
</view>
<view class="m-t-12 flex1">
<image class="m-auto icon img100" mode="scaleToFill"
src="../../../static/images/customer/coupon/member/icon-member-info-2.png"></image>
+ <!-- createName: "孙凯悦"
+createTime: "2024-09-10 14:47:29"
+discountAmount: null
+discountRatio: 95
+discountType: "ratio"
+discountTypeStr: "百分比"
+downgradeValue: 30
+endPoint: 15000
+growthValue: 1
+id: 34
+name: "金卡会员7"
+startPoint: 10000
+updateTime: "2024-09-12 14:09:19"
+ -->
+
+
<view class="desc">
- 优惠
- <span v-if="currentInfo.customerDTO.userGrowthRecord.currentDiscountType=='ratio'">
- {{(currentInfo.customerDTO.userGrowthRecord.currentDiscountRatio) || '-'}}%/扎
+ 优惠
+ <span v-if="bannerList[curIndex].point.discountType=='ratio'">
+ <!-- currentInfo.customerDTO.userGrowthRecord.currentDiscountType=='ratio' -->
+ <!-- {{(currentInfo.customerDTO.userGrowthRecord.currentDiscountRatio) || '-'}}%/扎 -->
+ {{ ((bannerList[curIndex].point.discountRatio)/10).toFixed(1) || '-'}}折/扎
</span>
<span v-else>
- {{currentInfo.customerDTO.userGrowthRecord.currentDiscountAmount || '-'}}元/扎
+ {{bannerList[curIndex].point.discountAmount || '0'}}元/扎
+ <!-- {{currentInfo.customerDTO.userGrowthRecord.currentDiscountAmount || '-'}}元/扎 -->
</span>
- <!-- serGrowthRecord: {currentMemberLevel: "银卡会员", currentGrowthValue: 4941, currentDiscountType:
+ <!-- serGrowthRecord: {currentMemberLevel: "银卡会员", currentGrowthValue: 4941, currentDiscountType:
"ratio",…}
currentDiscountAmount: 0
currentDiscountRatio: 5
@@ -74,7 +95,7 @@
</view>
</view>
<view class="protocol" @click="goto('/pages/help/content?id=会员协议',false)">会员协议 <uni-icons type="right"
- size="16" color="#AD790F"></uni-icons>
+ size="14" color="#AD790F"></uni-icons>
</view>
</view>
</view>
@@ -90,10 +111,39 @@
uni.stopPullDownRefresh()
},
methods: {
-
+ changeIndex(index) {
+ console.log('changeIndex', index, this.bannerList)
+ this.curIndex = index || 0
+ this.$forceUpdate()
+ }
},
async onLoad() {
await this.$store.dispatch('getCurrentInfo')
+ const {
+ code,
+ data
+ } = await this.$http.request('get', '/api/member/list')
+ if (code == 0 && data && data.records) {
+ console.log('member-data', data)
+ //循环赋值吧。用name包含来兼容
+ for (var tmp of this.bannerList) {
+ for (var info of data.records) {
+ if (info.name && info.name.indexOf(tmp.title) >= 0) {
+ // 设置value
+ tmp.point = {
+ ...info,
+ current: this.currentInfo.customerDTO.userGrowthRecord
+ .currentGrowthValue || 0
+ }
+
+ break
+
+ }
+ }
+ }
+ }
+ consumptionAmount: 1
+
this.$nextTick(() => {
if (this.currentInfo.customerDTO && this.currentInfo.customerDTO.userGrowthRecord && this
.currentInfo
@@ -118,9 +168,9 @@
var j = -1
for (var tmp of this.bannerList) {
j += 1
- tmp.point = {
- current: this.currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || 0
- }
+ // tmp.point = {
+ // current: this.currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || 0
+ // }
tmp.currentMsg = ''
if (tmp.title === name) {
//说明是当前等级,其他待定
@@ -141,22 +191,22 @@
}
this.bannerList = newBannerSort
- if (this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) {
- var t = -1
- for (var tmp of this.bannerList) {
- t += 1
- for (var k of this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) {
- if (tmp.title === k.targetMemberLevel) {
- console.log('eq', k, tmp)
- tmp.point = {
- current: this.currentInfo.customerDTO.userGrowthRecord
- .currentGrowthValue || 0,
- end: k.targetStartPoint || 0,
- }
- }
- }
- }
- }
+ // if (this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) {
+ // var t = -1
+ // for (var tmp of this.bannerList) {
+ // t += 1
+ // for (var k of this.currentInfo.customerDTO.userGrowthRecord.targetMemberInfos) {
+ // if (tmp.title === k.targetMemberLevel) {
+ // console.log('eq', k, tmp)
+ // tmp.point = {
+ // current: this.currentInfo.customerDTO.userGrowthRecord
+ // .currentGrowthValue || 0,
+ // end: k.targetStartPoint || 0,
+ // }
+ // }
+ // }
+ // }
+ // }
this.init = true
// this.$nextTick(() => {
@@ -181,6 +231,7 @@
}
})
+
},
data() {
return {
@@ -191,7 +242,7 @@
title: '普通会员',
// description: '一万年太久,就现在,给你爱',
path: '',
- point: undefined,
+ point: {},
key: '1',
}, {
bg: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/25/2534864ad275400b9e8db4042b87bfeaBv7NbzOZG0ptc7fca5df83dcd97fd02b4027518cc593.png',
@@ -200,6 +251,8 @@
// description: '花中樱,鱼乃鲷花中樱,鱼乃鲷',
path: '',
key: '2',
+ point: {},
+
// currentMsg:''
}, {
bg: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/4d/4d8ab63e75ca462fa9e3bb480ff2da68ID5KnLIH9DwM23f9a04d99cc1f3306a8655c1eff34bf.png',
@@ -208,6 +261,8 @@
// description: '取材自湘西苗族传统的烟熏文化',
path: '',
key: '3',
+ point: {},
+
}, {
bg: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/db/db6b0cefdbb949cca9c8da824a5ebdebXsPsk2ROfxZu22f9b09e3feece76753b0df971fdc301.png',
picture: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/c9/c94d8f444af94b899d1e1593cebb933eDyZyhyoyDxTRaf60a4d692f097e5d790cdb88fae9d0c.png',
@@ -215,6 +270,8 @@
// description: '在自己的小世界里,日日好日,夜夜好清宵',
path: '',
key: '4',
+ point: {},
+
}],
swiperConfig: {
indicatorDots: true,
@@ -226,7 +283,8 @@
circular: true,
previousMargin: '58rpx',
nextMargin: '58rpx'
- }
+ },
+ curIndex: 0,
}
},
components: {
@@ -310,7 +368,7 @@
.protocol {
font-weight: 400;
- font-size: 24rpx;
+ font-size: 28rpx;
color: #AD790F;
line-height: 34rpx;
text-align: center;
--
Gitblit v1.9.3