From fb48777cd4c3f086f77b5b26e1d03aebf995f4f5 Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期四, 12 九月 2024 18:40:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master-2.0' into master-2.0
---
sub_pages/customer/self/member-center.vue | 197 ++++++++++++++++++------
pages/home/home.vue | 102 ++++++++++--
sub_pages/customer/coupon/coupon-self.vue | 5
pages/user/user-customer.scss | 3
sub_pages/customer/coupon/good-all.vue | 5
plugins/http.js | 2
App.vue | 19 +
static/images/customer/coupon/coupon-out.png | 0
/dev/null | 0
sub_pages/customer/coupon/coupon.scss | 20 ++
manifest.json | 2
sub_pages/customer/shopping/confirm.vue | 13 +
components/banner3d/banner3d.vue | 27 ++-
pages/order/order.vue | 3
pages/order/order-detail.vue | 36 +++-
sub_pages/customer/coupon/good-self.vue | 39 +++-
16 files changed, 356 insertions(+), 117 deletions(-)
diff --git a/App.vue b/App.vue
index f240031..4356fc2 100644
--- a/App.vue
+++ b/App.vue
@@ -6,6 +6,12 @@
export default {
onLaunch: async function(options) {
+ //清除一些缓存
+ this.$storage.removeItem('cache_home_show_coupon')
+ // #ifdef PUB_PARTNER
+ // this.$storage.removeItem('cache_partner_info')
+ // #endif
+
var query = options.q && decodeURIComponent(options.q) || ''
var querydto = {}
if (query) {
@@ -23,7 +29,8 @@
if (!querydto.partnerUserId) {
if (options.query && options.query.scene || options.scene) {
//说明是特殊小程序二维码扫码跳转的
- var keyvalues = decodeURIComponent(options.query&&options.query.scene || options.scene).split("&")
+ var keyvalues = decodeURIComponent(options.query && options.query.scene || options.scene)
+ .split("&")
for (var item of keyvalues) {
var tarr = item.split("=")
querydto[tarr[0]] = tarr[1]
@@ -52,8 +59,8 @@
}
});
// #ifdef MP
- if (true && storage.getItem('token')) {
- const res = await this.$store.dispatch('getCurrentInfo');
+ if (true && storage.getItem('token')) {
+ const res = await this.$store.dispatch('getCurrentInfo');
setTimeout(async () => {
// #ifndef PUB_CUSTOMER
if (this.currentInfo && this.currentInfo.id && !this.currentInfo.openId) {
@@ -86,9 +93,9 @@
// 需要处理一下,判断是跳转登录还是原封不动
if (!!querydto.partnerUserId) {
//需要去注册页面
- console.log('options', options)
- //说明走的是特殊微信小程序,那么就要专门处理了
-
+ console.log('options', options)
+ //说明走的是特殊微信小程序,那么就要专门处理了
+
} else {
// uni.reLaunch({
diff --git a/components/banner3d/banner3d.vue b/components/banner3d/banner3d.vue
index a4004cf..926f03f 100644
--- a/components/banner3d/banner3d.vue
+++ b/components/banner3d/banner3d.vue
@@ -3,9 +3,9 @@
<swiper :style="{width: '100vw', height: '410rpx'}" :indicator-dots="swiperConfig.indicatorDots"
:indicator-color="swiperConfig.indicatorColor" :indicator-active-color="swiperConfig.indicatorActiveColor"
:autoplay="swiperConfig.autoplay" :interval="swiperConfig.interval" :duration="swiperConfig.duration"
- :circular="swiperConfig.circular" :previous-margin="swiperConfig.previousMargin"
+ :circular="swiperConfig.circular" :previous-margin="swiperConfig.previousMargin" v-if="init"
:next-margin="swiperConfig.nextMargin" @change="swiperChange" @animationfinish="animationfinish">
-
+
<swiper-item v-for="(item, i) in bannerList" :key="i">
<!-- 1.当前展示为第1项时,bannerList最后一项和第二项的justifyContent值分别为flex-end和flex-start,其余项值为center -->
<!-- 2.当前展示为最后一项时,bannerList倒数第2项和第1项的justifyContent值分别为flex-end和flex-start,其余项值为center -->
@@ -19,26 +19,27 @@
<image :src="item.bg" class="slide-image">
</image>
- <view v-if="item.currentMsg" class="top-msg" :class="[`v${i+1}`]">
+ <view v-if="item.currentMsg" class="top-msg" :class="[`v${bannerList[i].key|| (i+1)}`]">
{{item.currentMsg}}
</view>
- <image :src="item.picture" class="icon-image" :class="[`v${i+1}`]" mode="aspectFit"></image>
- <view class="container" :class="[`v${i+1}`]">
+ <image :src="item.picture" class="icon-image" :class="[`v${bannerList[i].key||(i+1)}`]"
+ mode="aspectFit"></image>
+ <view class="container" :class="[`v${bannerList[i].key|| (i+1)}`]">
<view class="title">{{bannerList[i].title}}</view>
<view class="line-component" v-if="bannerList[i].point">
<view class="line-bg">
<view class="tip"
- :style="{'left':(bannerList[i].point.end&&(bannerList[i].point.current/bannerList[i].point.end)||0).toFixed(2)*100+'%'}">
+ :style="{'left':(bannerList[i].point.current<=bannerList[i].point.endPoint)?((bannerList[i].point.endPoint&&(bannerList[i].point.current/bannerList[i].point.endPoint)||0).toFixed(2)*100+'%'):'100%'}">
{{bannerList[i].point.current || 0}}
</view>
<view class="tip-loc"
- :style="{'left':(bannerList[i].point.end&&(bannerList[i].point.current/bannerList[i].point.end)||0).toFixed(2)*100+'%'}">
+ :style="{'left':(bannerList[i].point.current<=bannerList[i].point.endPoint)?((bannerList[i].point.endPoint&&(bannerList[i].point.current/bannerList[i].point.endPoint)||0).toFixed(2)*100+'%'):'100%'}">
</view>
</view>
<view class="desc">
<span
- v-if="bannerList[i].point.end">{{bannerList[i].point.current || 0}}/{{bannerList[i].point.end}},升级还需{{bannerList[i].point.end-bannerList[i].point.current}}成长值</span>
+ v-if="bannerList[i].point.endPoint&&(bannerList[i].point.current<=bannerList[i].point.endPoint)">{{bannerList[i].point.current || 0}}/{{bannerList[i].point.endPoint}},升级还需{{bannerList[i].point.endPoint - bannerList[i].point.current}}成长值</span>
<span v-else>当前成长值:{{bannerList[i].point.current || 0}}</span>
</view>
</view>
@@ -95,10 +96,17 @@
return {
curIndex: 0,
descIndex: 0,
- isDescAnimating: false
+ isDescAnimating: false,
+ init: true
}
},
methods: {
+
+ // swiperChangeIndex(index){
+ // this.curIndex = index || 0
+ // this.init = true
+ // this.$forceUpdate()
+ // },
swiperChange(e) {
const that = this
this.curIndex = e.mp.detail.current
@@ -107,6 +115,7 @@
that.descIndex = e.mp.detail.current
clearTimeout(timer)
}, 150)
+ this.$emit('changeIndex',this.curIndex)
},
animationfinish(e) {
this.isDescAnimating = false
diff --git a/manifest.json b/manifest.json
index 782394c..2848179 100644
--- a/manifest.json
+++ b/manifest.json
@@ -49,7 +49,7 @@
"quickapp" : {},
/* 快应用特有相关 */
"mp-weixin" : {
- "appid" : "wx6d0ecc4e18710458",
+ "appid" : "wx1441324401626290",
"setting" : {
"urlCheck" : false,
"es6" : true,
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 5bd64bd..8afe209 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -75,7 +75,38 @@
</view>
<common-footer flg="0"></common-footer>
- <uni-popup ref="coupon_home" type="bottom" border-radius="10px 10px 0 0">底部弹出 Popup 自定义圆角</uni-popup>
+ <uni-popup ref="coupon_home" type="center" border-radius="10px 10px 0 0">
+ <view class="coupon-container" style="width: 690rpx;">
+ <view class="coupont-item all">
+ <view class="flex container img100">
+ <view class="info-price">
+ <view class="price1">
+ {{dto_home_coupon.maxDiscountAmount?(`${dto_home_coupon.maxDiscountAmount}折`):(`¥${dto_home_coupon.couponDiscountValue}`)}}
+ </view>
+ <view class="price2">
+ {{dto_home_coupon.minOrderAmount?(`满¥${dto_home_coupon.minOrderAmount}可用`):'无门槛'}}
+ </view>
+ </view>
+ <view class="info flex1">
+ <view class="title">
+ {{dto_home_coupon.couponName||'-'}}
+ </view>
+ <view class="time" v-if="dto_home_coupon.getEndDate">
+ <!-- 领取后{{dto_home_coupon.usageTimeNum||''}}{{dto_home_coupon.usageTimeTypeName||''}}有效 -->
+ {{dto_home_coupon.getEndDate|| '-'}}前有效
+ </view>
+ <view class="button" @click="getCoupon(dto_home_coupon)">
+ 立即领取
+ </view>
+ </view>
+ </view>
+
+ <view class="tip">
+ <span class="t-red">*</span>此券每人限领1张。仅限用于花满芜鲜花交易平台鲜切花花款满额使用,不可与其他优惠同享、不可叠加使用
+ </view>
+ </view>
+ </view>
+ </uni-popup>
</view>
@@ -111,10 +142,10 @@
},
onPullDownRefresh() {
// 下拉刷新方法
- this.init()
+ this.init()
this.$message.showLoading()
this.init_children()
- setTimeout(() => {
+ setTimeout(() => {
this.$message.hideLoading()
uni.stopPullDownRefresh()
}, 2000)
@@ -175,7 +206,8 @@
hide_footer: false,
noticeList: [],
currentNoticeIndex: 0,
- currentNotice: {}
+ currentNotice: {},
+ dto_home_coupon: {}
};
},
onShareAppMessage() {
@@ -211,6 +243,28 @@
this.init()
},
methods: {
+ async getCoupon(item) {
+ if (!this.currentInfo.id) {
+ await this.$message.confirm('请先前往登录')
+ this.$storage.removeItem('cache_home_show_coupon')
+ return
+ }
+ this.$message.showLoading()
+ const {
+ code,
+ data
+ } = await this.$http.request('post', '/api/v2/coupon/app/receive', {
+ data: {
+ couponId: item.id,
+ num: 1
+ }
+ })
+ if (code == 0) {
+ this.$refs.coupon_home.close()
+
+ this.$message.showToast('领取成功')
+ }
+ },
init_children() {
this.$refs.home_top_flow && this.$refs.home_top_flow.init && this.$refs.home_top_flow.init()
this.$refs.home_category && this.$refs.home_category.init && this.$refs.home_category.init()
@@ -357,18 +411,30 @@
}
})
- // let tmp = this
- // //首页优惠券
- // this.$http.request('get', '/api/v2/coupon/app' + `/home/list`).then(res => {
- // if (res.code == 0) {
- // var list = res.data || []
- // var dto = list.length >= 1 ? list[0] : undefined
- // if (dto) {
- // // 显示弹窗图片
- // tmp.$refs.coupon_home.open()
- // }
- // }
- // })
+ if (tmp.currentInfo.id) {
+ let tmp = this
+ //延迟2秒
+ setTimeout(() => {
+ var value = tmp.$storage.getItem('cache_home_show_coupon')
+ if (!value) {
+ //首页优惠券
+ tmp.$storage.setItem('cache_home_show_coupon', '1')
+ var u = '/api/v2/coupon/home/alert'
+ u = '/api/v2/coupon/app/home/list'
+ tmp.$http.request('get', u).then(res => {
+ if (res.code == 0) {
+ var list = res.data || []
+ var dto = list.length >= 1 ? list[0] : undefined
+ if (dto) {
+ // 显示弹窗图片
+ tmp.dto_home_coupon = dto
+ tmp.$refs.coupon_home.open()
+ }
+ }
+ })
+ }
+ }, 2000)
+ }
},
clickBanner(item) {
@@ -427,4 +493,8 @@
<style lang="scss" scoped>
@import "./home.scss";
+
+ /* #ifdef PUB_CUSTOMER */
+ @import "@/sub_pages/customer/coupon/coupon.scss";
+ /* #endif */
</style>
\ No newline at end of file
diff --git a/pages/order/order-detail.vue b/pages/order/order-detail.vue
index 8a31a49..c93affa 100644
--- a/pages/order/order-detail.vue
+++ b/pages/order/order-detail.vue
@@ -200,6 +200,7 @@
tmp.$message.hideLoading()
if (code === 0) {
tmp.getDetail()
+ tmp.$store.dispatch('getCurrentInfo')
}
},
fail(e) {
@@ -584,11 +585,29 @@
</view>
</view>
<view class="info-container bg-white br-4 m-t-12" v-if="!showSales">
- <view class="form-item">
+ <view class="form-item flex">
<view class="label">订单金额:</view>
- <view class="value">{{ dto.totalAmount || '-' }}</view>
+ <view class="value m-l-a m-r-0 text-right">+{{ dto.totalAmount || '0' }}</view>
</view>
- <view class="form-item">
+ <view class="form-item flex">
+ <view class="label">运费:</view>
+ <view class="value m-l-a m-r-0 text-right">+{{ dto.transportFee || '0' }}</view>
+ </view>
+ <view class="form-item flex">
+ <view class="label">打包费:</view>
+ <view class="value m-l-a m-r-0 text-right">+{{ dto.packingFee || '0' }}</view>
+ </view>
+ <view class="form-item flex t-red">
+ <view class="label">优惠:</view>
+ <view class="value m-l-a m-r-0 text-right">-{{ dto.memberCouponAmount || '0' }}</view>
+ </view>
+ <view class="form-item flex t-red">
+ <view class="label">实际支付:</view>
+ <view class="value m-l-a m-r-0 text-right">¥{{ dto.paymentAmount || '0' }}</view>
+ </view>
+
+
+ <!-- <view class="form-item">
<view class="label">支付金额:</view>
<view class="value">{{ dto.paymentAmount || '-' }}</view>
</view>
@@ -596,10 +615,7 @@
<view class="label">商品金额:</view>
<view class="value">{{ dto.flowerAmount || '-' }}</view>
</view>
- <view class="form-item">
- <view class="label">运费:</view>
- <view class="value">{{ dto.transportFee || '-' }}</view>
- </view>
+
<view class="form-item">
<view class="label">折扣类型:</view>
<view class="value">{{ dto.memberDiscountTypeStr || '-' }}</view>
@@ -611,11 +627,11 @@
<view class="form-item">
<view class="label">优惠券:</view>
<view class="value">{{ dto.memberCouponName || '-' }}</view>
- </view>
- <view class="form-item">
+ </view> -->
+ <!-- <view class="form-item">
<view class="label">优惠金额:</view>
<view class="value">{{ dto.memberCouponAmount || '-' }}</view>
- </view>
+ </view> -->
</view>
<view class="info-container bg-white br-4 m-t-12"
v-if="!showSales&& dto.pointGoodsList&& dto.pointGoodsList.length>0">
diff --git a/pages/order/order.vue b/pages/order/order.vue
index 0859686..35db184 100644
--- a/pages/order/order.vue
+++ b/pages/order/order.vue
@@ -155,6 +155,8 @@
tmp.$message.hideLoading()
if (code === 0) {
tmp.refreshList()
+ //刷新积分
+ tmp.$store.dispatch('getCurrentInfo')
}
},
fail(e) {
@@ -284,6 +286,7 @@
if (code === 0) {
// this.$store.dispatch('sign_add', 'order')
this.refreshList()
+
}
}
break
diff --git a/pages/user/user-customer.scss b/pages/user/user-customer.scss
index d4fc338..cf7811b 100644
--- a/pages/user/user-customer.scss
+++ b/pages/user/user-customer.scss
@@ -38,7 +38,8 @@
border-radius: 8rpx;
// border: 2rpx solid;
// border-image: linear-gradient(180deg, rgba(238, 217, 173, 1), rgba(219, 182, 105, 1)) 2 2;
- background-image: url('../../static/images/customer/coupon/coupon-bg-user.png');
+ // background-image: url('../../static/images/customer/coupon/coupon-bg-user.png');
+ background-image: url('https://hmy-flower.oss-cn-shanghai.aliyuncs.com/69/69b8683eb7084e06a9d7645764a92a4ayJwLQzpZIQ5f7c5070054319d93cf972f05d429ad10c.png');
background-size: 100% 100%;
.title{
font-weight: 600;
diff --git a/plugins/http.js b/plugins/http.js
index f393090..083f90c 100644
--- a/plugins/http.js
+++ b/plugins/http.js
@@ -52,6 +52,7 @@
dataType: options.dataType ? options.dataType : 'json',
data: options.data || null,
header,
+ timeout: 30000,
success: async (res) => {
if (!options.ignore) {
message.hideLoading()
@@ -219,6 +220,7 @@
if (!options.ignore) {
message.hideLoading()
}
+ message.showToast('网络异常')
reject({
data: null,
code: 9999,
diff --git a/static/images/customer/coupon/coupon-bg-user.png b/static/images/customer/coupon/coupon-bg-user.png
deleted file mode 100644
index 7abf9f2..0000000
--- a/static/images/customer/coupon/coupon-bg-user.png
+++ /dev/null
Binary files differ
diff --git a/static/images/customer/coupon/coupon-out.png b/static/images/customer/coupon/coupon-out.png
new file mode 100644
index 0000000..92a14d3
--- /dev/null
+++ b/static/images/customer/coupon/coupon-out.png
Binary files differ
diff --git a/static/images/customer/coupon/good-top-bg.png b/static/images/customer/coupon/good-top-bg.png
deleted file mode 100644
index fdfb444..0000000
--- a/static/images/customer/coupon/good-top-bg.png
+++ /dev/null
Binary files differ
diff --git a/sub_pages/customer/coupon/coupon-self.vue b/sub_pages/customer/coupon/coupon-self.vue
index cb9f53c..94f7a31 100644
--- a/sub_pages/customer/coupon/coupon-self.vue
+++ b/sub_pages/customer/coupon/coupon-self.vue
@@ -30,10 +30,13 @@
</view>
<view class="time">
- {{item.effectiveStart&&(item.effectiveStart+' 生效,') || ''}}
+ <!-- {{item.effectiveStart&&(item.effectiveStart+' 生效,') || ''}} -->
{{item.effectiveEnd&&('有效期至 '+item.effectiveEnd) || '长久有效'}}
</view>
</view>
+ <view class="img-out">
+
+ </view>
</view>
<view class="tip">
<span
diff --git a/sub_pages/customer/coupon/coupon.scss b/sub_pages/customer/coupon/coupon.scss
index 2c5896b..535cc84 100644
--- a/sub_pages/customer/coupon/coupon.scss
+++ b/sub_pages/customer/coupon/coupon.scss
@@ -3,8 +3,11 @@
.coupont-item.expired {
- filter: grayscale(100%);
+ filter: grayscale(95%);
.img-has {
+ display: unset;
+ }
+ .img-out {
display: unset;
}
}
@@ -18,10 +21,21 @@
position: absolute;
right: -20rpx;
top: 20rpx;
- background-image: url('../../../static/images/customer/coupon/coupon-has.png');
+ background-image: url('@/static/images/customer/coupon/coupon-has.png');
background-size: 100% 100%;
width: 264rpx;
height: 264rpx;
+ }
+ .img-out {
+ display: none;
+ position: absolute;
+ right: 10rpx;
+ top: -20rpx;
+ background-image: url('@/static/images/customer/coupon/coupon-out.png');
+ background-size: 100% 100%;
+ width: 196rpx;
+ height: 124rpx;
+
}
.tip {
@@ -40,7 +54,7 @@
.container {
z-index: 2;
- background-image: url('../../../static/images/customer/coupon/coupon-bg1.png');
+ background-image: url('@/static/images/customer/coupon/coupon-bg1.png');
// width: 722rpx;
padding: 16rpx 16rpx 16rpx 0rpx;
height: 220rpx;
diff --git a/sub_pages/customer/coupon/good-all.vue b/sub_pages/customer/coupon/good-all.vue
index 9e36900..1fc2515 100644
--- a/sub_pages/customer/coupon/good-all.vue
+++ b/sub_pages/customer/coupon/good-all.vue
@@ -48,7 +48,8 @@
<view class="good-container p15 flex">
<view v-for="(item,index) of list" :key="index" class="good-item" @click="toDetail(item)">
- <image class="cover" :src="item.cover" :lazy-load="true" mode="scaleToFill">
+ <image class="cover" :src="item.cover" :lazy-load="true" mode="scaleToFill"
+ :class="[dto.stock===0?'component-stock-zero':'']">
</image>
<view class="title">
@@ -209,7 +210,7 @@
<style lang="scss" scoped>
@import './coupon.scss';
-
+
.good-list-container {
.good-container {
.good-item {
diff --git a/sub_pages/customer/coupon/good-self.vue b/sub_pages/customer/coupon/good-self.vue
index e336979..c544aaa 100644
--- a/sub_pages/customer/coupon/good-self.vue
+++ b/sub_pages/customer/coupon/good-self.vue
@@ -6,11 +6,11 @@
</top-tabs>
</view>
<no-data v-if="!list||list.length==0" style="width: 100%;"></no-data>
-
+
<view class="p10">
<view v-for="(item,index) of list" :key="index" class="good-item" :class="[query.status]">
- <view class="flex container img100">
+ <view class="flex container img100" @click="selectItem(item)">
<view class="info-price">
<image :lazy-load="true" :src="item.cover" class="cover" mode="scaleToFill"></image>
</view>
@@ -18,20 +18,20 @@
<view class="title flex">
{{item.name||''}}
<!-- <radio :checked="isIngood(item)" @click.stop="updateSelectGood(item)" v-if="source==='shopping'" class="select-coupon"></radio> -->
-
- <view :style="{ 'margin-right': '20rpx'}" @click.stop="updateSelectGood(item)"
- class="component-radio m-l-a" :class="[isIngood(item)?'cur':'']" v-if="source==='shopping'">
-
+
+ <view :style="{ 'margin-right': '20rpx'}" class="component-radio m-l-a"
+ :class="[isIngood(item)?'cur':'']" v-if="source==='shopping'">
+
</view>
-
+
</view>
<view class="time word-e">
{{item.description||''}}
</view>
- <view class="button m-l-a m-r-10" @click="getPointGood(item)" v-if="source!=='shopping'">
+ <view class="button m-l-a m-r-10" v-if="source!=='shopping'">
查看详情
</view>
- <!-- <view class="button" @click="updateSelectGood(item)" v-if="source=='shopping'">
+ <!-- <view class="button" @click="updateSelectGood(item)" v-if="source=='shopping'">
{{isIngood(item)?'移除':'添加'}}
</view> -->
</view>
@@ -110,6 +110,15 @@
},
methods: {
+ selectItem(item) {
+ if (this.source === 'shopping') {
+ //选择
+ this.updateSelectGood(item)
+ } else {
+ //详情
+ this.getPointGood(item)
+ }
+ },
isIngood(item) {
for (var tmp of this.cache_goods) {
if (tmp.id == item.id) {
@@ -186,8 +195,10 @@
height: unset;
padding: 20rpx;
margin-top: 0rpx;
+
.container {
background-color: #fff;
+
.info-price {
.cover {
width: 150rpx;
@@ -198,6 +209,7 @@
.info {
margin-left: 20rpx;
position: relative;
+
.title {
font-weight: 600;
font-size: 36rpx;
@@ -206,13 +218,14 @@
text-align: left;
position: relative;
margin-top: 20rpx;
- .select-coupon{
+
+ .select-coupon {
position: absolute;
right: 10rpx;
top: -6rpx;
}
}
-
+
.time {
font-weight: 400;
font-size: 28rpx;
@@ -222,8 +235,8 @@
margin-top: 10rpx;
word-break: break-all;
}
-
-
+
+
.button {
width: 150rpx;
diff --git a/sub_pages/customer/self/member-center.vue b/sub_pages/customer/self/member-center.vue
index 999f936..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">
@@ -15,9 +16,10 @@
</view>
</view> -->
- <view class="member-infos info bg-white p20 "
- v-if="currentInfo.customerDTO&¤tInfo.customerDTO.userGrowthRecord
- &¤tInfo.customerDTO.userGrowthRecord.targetMemberInfos&¤tInfo.customerDTO.userGrowthRecord.targetMemberInfos.length>=1">
+ <!-- v-if="currentInfo.customerDTO&¤tInfo.customerDTO.userGrowthRecord
+ &¤tInfo.customerDTO.userGrowthRecord.targetMemberInfos&¤tInfo.customerDTO.userGrowthRecord.targetMemberInfos.length>=1"
+ -->
+ <view class="member-infos info bg-white p20 ">
<view class="text-center w-fit flex m-auto top-title ">
<view class="left-line"></view>
<view class="title">会员权益</view>
@@ -28,16 +30,52 @@
<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.targetMemberInfos[0].targetStartPoint || '-'}}
+ <!-- 积分达到{{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">
优惠
- {{currentInfo.customerDTO.userGrowthRecord.targetMemberInfos[0].targetDiscountAmount || '-'}}元/扎
+ <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>
+ {{bannerList[curIndex].point.discountAmount || '0'}}元/扎
+ <!-- {{currentInfo.customerDTO.userGrowthRecord.currentDiscountAmount || '-'}}元/扎 -->
+ </span>
+ <!-- serGrowthRecord: {currentMemberLevel: "银卡会员", currentGrowthValue: 4941, currentDiscountType:
+ "ratio",…}
+ currentDiscountAmount: 0
+ currentDiscountRatio: 5
+ currentDiscountType: "ratio"
+ currentDiscountTypeStr: "百分比"
+ currentGrowthValue: 4941
+ currentMemberLevel: "银卡会员" -->
+
+ <!-- {{currentInfo.customerDTO.userGrowthRecord.targetMemberInfos[0].targetDiscountAmount || '-'}}元/扎 -->
+
</view>
</view>
@@ -57,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>
@@ -73,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
@@ -97,55 +164,74 @@
// targetStartPoint: 10001
//计算下一个等级的差距
let name = this.currentInfo.customerDTO.userGrowthRecord.currentMemberLevel
-
+ var currentindex = -1
+ var j = -1
for (var tmp of this.bannerList) {
- tmp.point = {
- current: this.currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || 0
- }
+ j += 1
+ // tmp.point = {
+ // current: this.currentInfo.customerDTO.userGrowthRecord.currentGrowthValue || 0
+ // }
tmp.currentMsg = ''
if (tmp.title === name) {
//说明是当前等级,其他待定
tmp.currentMsg = '当前等级'
+ currentindex = j
+ }
+
+
+
+ }
+ //重新排序,当前等级第一个
+ var newBannerSort = []
+ for (var i = currentindex; i < 2 * j; i++) {
+ newBannerSort.push(this.bannerList[i % (j + 1)])
+ if (newBannerSort.length >= this.bannerList.length) {
+ break
}
}
- 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.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,
+ // }
+ // }
+ // }
+ // }
+ // }
this.init = true
- this.$nextTick(() => {
- // var name = this.currentInfo.customerDTO.userGrowthRecord.currentMemberLevel
- var index = -1
- for (var tmp of this.bannerList) {
- index += 1
- if (tmp.title === name) {
- this.$refs.banner3d.swiperChange({
- mp: {
- detail: {
- current: index
- }
- }
- })
- break
- }
- }
- })
+ // this.$nextTick(() => {
+ // // var name = this.currentInfo.customerDTO.userGrowthRecord.currentMemberLevel
+ // var index = -1
+ // for (var tmp of this.bannerList) {
+ // index += 1
+ // if (tmp.title === name) {
+ // // this.$refs.banner3d.swiperChange({
+ // // mp: {
+ // // detail: {
+ // // current: index
+ // // }
+ // // }
+ // // })
+ // this.$refs.banner3d.swiperChangeIndex(index)
+
+ // break
+ // }
+ // }
+ // })
}
})
+
},
data() {
return {
@@ -156,26 +242,36 @@
title: '普通会员',
// description: '一万年太久,就现在,给你爱',
path: '',
- point: undefined,
+ point: {},
+ key: '1',
}, {
bg: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/25/2534864ad275400b9e8db4042b87bfeaBv7NbzOZG0ptc7fca5df83dcd97fd02b4027518cc593.png',
picture: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/07/075db9222f7a41e981c5b263d7210ed5Ztljs5yDHKILd37c3399011f84f401b755477bb8a323.png',
title: '银卡会员',
// description: '花中樱,鱼乃鲷花中樱,鱼乃鲷',
path: '',
+ key: '2',
+ point: {},
+
// currentMsg:''
}, {
bg: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/4d/4d8ab63e75ca462fa9e3bb480ff2da68ID5KnLIH9DwM23f9a04d99cc1f3306a8655c1eff34bf.png',
picture: 'https://hmy-flower.oss-cn-shanghai.aliyuncs.com/f1/f192b651606045ddba5c5f04a34a00c2R8MmH6mVsprH81cab47fbe889222f6088f4ca2cf20d5.png',
title: '金卡会员',
// description: '取材自湘西苗族传统的烟熏文化',
- path: ''
+ 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',
title: '钻石会员',
// description: '在自己的小世界里,日日好日,夜夜好清宵',
- path: ''
+ path: '',
+ key: '4',
+ point: {},
+
}],
swiperConfig: {
indicatorDots: true,
@@ -187,7 +283,8 @@
circular: true,
previousMargin: '58rpx',
nextMargin: '58rpx'
- }
+ },
+ curIndex: 0,
}
},
components: {
@@ -271,7 +368,7 @@
.protocol {
font-weight: 400;
- font-size: 24rpx;
+ font-size: 28rpx;
color: #AD790F;
line-height: 34rpx;
text-align: center;
diff --git a/sub_pages/customer/shopping/confirm.vue b/sub_pages/customer/shopping/confirm.vue
index 5b1c334..7a9a7fb 100644
--- a/sub_pages/customer/shopping/confirm.vue
+++ b/sub_pages/customer/shopping/confirm.vue
@@ -170,7 +170,7 @@
// if (total >= this.cache_coupon.minOrderAmount) {
// return this.cache_coupon.couponDiscountValue || 0
// }
-
+
uni.navigateTo({
url: `/sub_pages/customer/coupon/coupon-self?source=shopping&paymoney=${total}`
})
@@ -232,7 +232,7 @@
var goodsRecordIds = []
if (this.dto.goodsRecordIdListStr) {
for (var t of this.cache_goods) {
- t.push(t.id)
+ goodsRecordIds.push(t.id)
}
}
@@ -451,14 +451,17 @@
</view>
</view>
<view class="form-item flex flex-wrap-normal">
- <view class="label">兑换券</view>
+ <view class="label" style="min-width: 130rpx;">兑换券</view>
<view class="m-l-a m-r-0 flex" style="word-break: break-all;"
:class="[!dto.goodsRecordIdList||dto.goodsRecordIdList.length==0?'desc-gray':'']"
@click="toSelectGood">
- {{dto.goodsRecordIdListStr|| '请选择'}}
+ <view> {{dto.goodsRecordIdListStr|| '请选择'}}
+ </view>
<!-- <view>{{dto.goodsRecordIdListStr|| '请选择'}}</view> -->
- <u-icon class="m-l-a" name="arrow-right"></u-icon>
+ <view style="min-width: 60rpx;">
+ <u-icon class="m-l-a" name="arrow-right"></u-icon>
+ </view>
</view>
</view>
</view>
--
Gitblit v1.9.3