提交优惠券
This commit is contained in:
@@ -4,38 +4,81 @@
|
||||
<u-popup :show="youhuiShow" :round="10" @close="closePup">
|
||||
<view class="tanchu">
|
||||
<view class="dp_title">请选择优惠券</view>
|
||||
<template v-if="list.length > 0" >
|
||||
<view style="max-height:40vh;overflow-y: scroll;">
|
||||
<view :class="youhuiIndex === index ? 'youhuiItem youItem_style' : 'youhuiItem'"
|
||||
v-for="(item,index) in list" :key="index" @click="choseYouhui(index)">
|
||||
<view style="width: 25%;color:#fd6004;text-align: center;">
|
||||
<template v-if="list.length > 0">
|
||||
<view style="max-height: 40vh; overflow-y: scroll">
|
||||
<view v-for="(item, index) in list" :key="index">
|
||||
<view
|
||||
:class="`youhuiItem ${
|
||||
youhuiIndex === index ? ' youItem_style' : ''
|
||||
} ${item.canUse === 0 ? 'disableSelect' : ''}`"
|
||||
@click="choseYouhui(index)"
|
||||
><text
|
||||
class="border_radius_10"
|
||||
style="
|
||||
position: absolute;
|
||||
top: 10rpx;
|
||||
right: 10rpx;
|
||||
font-size: 25rpx;
|
||||
background-color: #ffe3e9;
|
||||
color: #c81346;
|
||||
padding: 6rpx;
|
||||
"
|
||||
>{{ item.couponEntity.couponRange | couponType }}</text
|
||||
>
|
||||
<view
|
||||
style="width: 25%; color: #ff0043; text-align: center"
|
||||
class="couponPrice"
|
||||
>
|
||||
<text>¥</text>
|
||||
<b style="font-size: 45rpx;">{{item.couponEntity.couponAmount}}</b>
|
||||
<b style="font-size: 45rpx">{{
|
||||
item.couponEntity.couponAmount
|
||||
}}</b>
|
||||
<text
|
||||
style="display: block;color: #666;font-size: 25rpx;margin-top: 10rpx;">满{{item.couponEntity.useLevel}}元可用</text>
|
||||
class="useLevel"
|
||||
style="
|
||||
display: block;
|
||||
color: #666;
|
||||
font-size: 25rpx;
|
||||
margin-top: 10rpx;
|
||||
"
|
||||
>满{{ item.couponEntity.useLevel }}元可用</text
|
||||
>
|
||||
</view>
|
||||
<view style="width: 68%;padding-left: 5%;">
|
||||
<view style="width: 68%; padding-left: 5%">
|
||||
<view>
|
||||
<text style="display: inline-block; margin-right: 6rpx;">{{item.couponEntity.couponName}}</text>
|
||||
<text class="border_radius_10" style="font-size: 24rpx; background-color: #fad4bd; color: #666;">{{item.couponEntity.couponRange | couponType}}</text>
|
||||
<text
|
||||
style="
|
||||
display: inline-block;
|
||||
margin-right: 6rpx;
|
||||
line-height: 36rpx;
|
||||
"
|
||||
>{{ item.couponEntity.couponName }}</text
|
||||
>
|
||||
</view>
|
||||
<text
|
||||
style="display: block;font-size: 20rpx;color: #999;margin-top: 10rpx;">到期时间:{{item.effectType == 0 ? '永久有效' : item.endTime}}</text>
|
||||
<template v-if="item.canUse == 0" >
|
||||
<view class="" style="font-size:20rpx; display: inline-block; padding:0 10rpx ; background-color: #d9d9d9; border-radius: 10rpx;">
|
||||
<text
|
||||
style="color: #999; "
|
||||
>不可用:</text>
|
||||
<text
|
||||
style="color: #999; "
|
||||
>{{item.canUseReason}}</text>
|
||||
style="
|
||||
display: block;
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
margin-top: 10rpx;
|
||||
"
|
||||
>有效期至:{{
|
||||
item.effectType == 0 ? "永久有效" : item.endTime
|
||||
}}</text
|
||||
>
|
||||
<template v-if="item.canUse == 0">
|
||||
<view
|
||||
class=""
|
||||
style="font-size: 20rpx; display: inline-block"
|
||||
>
|
||||
<text style="color: #333">不可用原因:</text>
|
||||
<text style="color: #333">{{ item.canUseReason }}</text>
|
||||
</view>
|
||||
</template>
|
||||
<text v-else
|
||||
style="display: block;font-size: 20rpx;color: #999;margin-top: 4rpx;">说明:{{item.couponEntity.remark}}</text>
|
||||
|
||||
</view>
|
||||
<view style="width: 7%;">
|
||||
<view
|
||||
style="width: 7%; position: absolute; right: 20rpx; top: 43%"
|
||||
>
|
||||
<!-- <view class="" style="background-color: #d9d9d9; border-radius: 10rpx; 0 0 10rpx; text-align: center;" v-if="item.canUse == 0">
|
||||
<text
|
||||
style="color: #999; "
|
||||
@@ -44,25 +87,72 @@
|
||||
|
||||
<template v-if="item.canUse == 1">
|
||||
<text
|
||||
style="border: 1px solid #d9d9d9;width: 35rpx;height:35rpx;display:inline-block;border-radius: 30rpx;"
|
||||
v-if="youhuiIndex !== index"></text>
|
||||
style="
|
||||
border: 1px solid #d9d9d9;
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
display: inline-block;
|
||||
border-radius: 30rpx;
|
||||
"
|
||||
v-if="youhuiIndex !== index"
|
||||
></text>
|
||||
|
||||
<u-icon name="checkmark-circle-fill" color="#fd6004" size="20" v-if="youhuiIndex === index">
|
||||
<u-icon
|
||||
name="checkmark-circle-fill"
|
||||
color="#fd6004"
|
||||
size="20"
|
||||
v-if="youhuiIndex === index"
|
||||
>
|
||||
</u-icon>
|
||||
</template>
|
||||
</view>
|
||||
<br clear="both">
|
||||
<br clear="both" />
|
||||
</view>
|
||||
<u-collapse
|
||||
v-if="source != 'goodsDetail' && item.couponEntity.remark"
|
||||
style="
|
||||
margin-top: 0rpx;
|
||||
z-index: 10 !important;
|
||||
background-color: #fafafa;
|
||||
border-bottom-left-radius: 10rpx;
|
||||
border-bottom-right-radius: 10rpx;
|
||||
"
|
||||
:border="false"
|
||||
>
|
||||
<u-collapse-item title="详细信息" name="Docs guide">
|
||||
<view
|
||||
v-if="item.couponEntity.remark"
|
||||
style="
|
||||
font-size: 22rpx;
|
||||
width: 100%;
|
||||
margin-right: 20rpx !important;
|
||||
"
|
||||
>使用说明:{{ item.couponEntity.remark }}</view
|
||||
>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
</view>
|
||||
|
||||
<!-- <view style="font-size: 20rpx;color: #aaa;margin-top: 30rpx;">* 每笔订单只能使用一张优惠价</view> -->
|
||||
</view>
|
||||
<view class="btnBox flex_box flex_between">
|
||||
<view class="" style="width: 48%;">
|
||||
<button type="default" @click="confirmCoupon('none')">不使用优惠券</button>
|
||||
<view class="btnBox flex_box flex_between" v-if="selectcouponList.length>0">
|
||||
<view class="" style="width: 48%">
|
||||
<button type="default" @click="confirmCoupon('none')">
|
||||
不使用优惠券
|
||||
</button>
|
||||
</view>
|
||||
<view class="" style="width: 48%;">
|
||||
<view class="" style="width: 48%">
|
||||
<button type="primary" @click="confirmCoupon()">选好了</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnBox flex_box flex_between" v-else>
|
||||
<view class="" style="width: 100%">
|
||||
<button type="default" @click="confirmCoupon('none')">
|
||||
取消
|
||||
</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<view class="" v-else>
|
||||
<u-divider text="暂无可用优惠券哦"></u-divider>
|
||||
@@ -73,89 +163,89 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
export default {
|
||||
name: "orderCoupon",
|
||||
props: ['list', 'curCouponId','sumMeony'],
|
||||
props: ["list", "curCouponId", "sumMeony", "addressId",'selectcouponList'],
|
||||
data() {
|
||||
return {
|
||||
youhuiShow: true,
|
||||
youhuiIndex: undefined
|
||||
youhuiIndex: undefined,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
console.log('进入了', this.curCouponId, this.sumMeony);
|
||||
console.log("进入了", this.curCouponId, this.sumMeony);
|
||||
if (this.curCouponId) {
|
||||
this.youhuiIndex = this.list.findIndex(item => item.couponEntity.id === this.curCouponId);
|
||||
console.log('查找后的结果', this.youhuiIndex);
|
||||
this.youhuiIndex = this.list.findIndex(
|
||||
(item) => item.couponEntity.id === this.curCouponId
|
||||
);
|
||||
console.log("查找后的结果", this.youhuiIndex);
|
||||
}
|
||||
},
|
||||
filters:{
|
||||
couponType(type){
|
||||
filters: {
|
||||
couponType(type) {
|
||||
// 0无限制 1课程卷 2课程品类卷
|
||||
var str = ''
|
||||
switch (type){
|
||||
var str = "";
|
||||
switch (type) {
|
||||
case 0:
|
||||
str = '全场通用'
|
||||
str = "全场通用";
|
||||
break;
|
||||
case 1:
|
||||
str = '指定课程可用'
|
||||
str = "指定课程可用";
|
||||
break;
|
||||
case 2:
|
||||
str = '指定课程品类可用'
|
||||
str = "指定课程品类可用";
|
||||
break;
|
||||
}
|
||||
return str
|
||||
}
|
||||
return str;
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
closePup() {
|
||||
this.youhuiIndex = undefined
|
||||
this.$emit('close')
|
||||
this.youhuiIndex = undefined;
|
||||
this.$emit("close");
|
||||
},
|
||||
// 确定选中优惠券
|
||||
confirmCoupon(str) {
|
||||
console.log(str, '6666');
|
||||
if (str && str == 'none') {
|
||||
console.log(str, "6666");
|
||||
if (str && str == "none") {
|
||||
// 清空优惠券操作
|
||||
this.$emit('confirmCoupon')
|
||||
this.$emit("confirmCoupon");
|
||||
setTimeout(() => {
|
||||
this.closePup()
|
||||
}, 300)
|
||||
return
|
||||
this.closePup();
|
||||
}, 300);
|
||||
return;
|
||||
}
|
||||
if (this.youhuiIndex == 0 || this.youhuiIndex) {
|
||||
this.$emit('confirmCoupon', this.list[this.youhuiIndex])
|
||||
this.$emit("confirmCoupon", this.list[this.youhuiIndex]);
|
||||
setTimeout(() => {
|
||||
this.closePup()
|
||||
}, 300)
|
||||
this.closePup();
|
||||
}, 300);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '请选择您要使用的优惠券',
|
||||
icon: "none"
|
||||
})
|
||||
title: "请选择您要使用的优惠券",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
},
|
||||
// 选择优惠券
|
||||
choseYouhui(e) {
|
||||
if(this.list[e].canUse == 0 ){
|
||||
return
|
||||
if (this.list[e].canUse == 0) {
|
||||
return;
|
||||
}
|
||||
console.log('选中优惠券e', e);
|
||||
this.youhuiIndex = e
|
||||
console.log("选中优惠券e", e);
|
||||
this.youhuiIndex = e;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btnBox {
|
||||
.btnBox {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.tanchu {
|
||||
.tanchu {
|
||||
padding: 40rpx 30rpx 40rpx 30rpx;
|
||||
position: relative;
|
||||
// max-height: 60vh;
|
||||
@@ -225,7 +315,6 @@
|
||||
margin: 0 0 0 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.chooseCheck {
|
||||
position: absolute;
|
||||
top: 3rpx;
|
||||
@@ -239,29 +328,61 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.addressItem.addItem_style {
|
||||
border-color: #fd6004;
|
||||
}
|
||||
|
||||
.youhuiItem {
|
||||
position: relative;
|
||||
background: linear-gradient(to top right, #fff, #fef2f4);
|
||||
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
padding: 20rpx 10rpx;
|
||||
|
||||
padding: 50rpx 20rpx 20rpx;
|
||||
margin: 25rpx 0 0 0;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.youhuiItem>view {
|
||||
.disableSelect {
|
||||
background: linear-gradient(to top right, #fafafa, #fafafa) !important;
|
||||
|
||||
color: #979797 !important;
|
||||
.couponPrice {
|
||||
color: #979797 !important;
|
||||
}
|
||||
.useLevel {
|
||||
color: #979797 !important;
|
||||
}
|
||||
.border_radius_10 {
|
||||
color: #98989a !important;
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
}
|
||||
.youhuiItem > view {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.youhuiItem.youItem_style {
|
||||
border-color: #fd6004;
|
||||
}
|
||||
}
|
||||
::v-deep .u-cell__body {
|
||||
padding-top: 0 !important ;
|
||||
padding-bottom: 0 !important ;
|
||||
z-index: 10 !important ;
|
||||
.u-cell__title-text {
|
||||
color: #333 !important;
|
||||
font-size: 24rpx !important;
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .u-collapse-item__content__text {
|
||||
padding: 10rpx 20rpx !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
@@ -6,9 +6,9 @@ if (process.env.NODE_ENV === 'development') {
|
||||
// socketUrl = "ws://localhost:6001/";
|
||||
// baseUrl = "https://twin-ui.com/demo/";
|
||||
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
|
||||
baseUrl = "https://api.nuttyreading.com/"; // 线上正式
|
||||
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式
|
||||
// baseUrl = "http://192.168.110.110:9200/pb/"; // 磊哥
|
||||
// baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
|
||||
baseUrl = "http://192.168.110.100:9200/pb/"; // 张川川
|
||||
// baseUrl = "http://59.110.212.44:9200/pb/";
|
||||
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
|
||||
// baseUrl = "http://192.168.110.110:9200/pb/";
|
||||
@@ -16,11 +16,12 @@ if (process.env.NODE_ENV === 'development') {
|
||||
// socketUrl = "ws://8.129.186.35:6001/";
|
||||
} else if (process.env.NODE_ENV === 'production') {
|
||||
// 生产环境11
|
||||
|
||||
// baseUrl = "http://59.110.212.44:9100/pb/";
|
||||
// baseUrl = "https://testapi.nuttyreading.com/";
|
||||
// baseUrl = "http://192.168.110.110:9200/pb/";//磊哥
|
||||
baseUrl = "https://api.nuttyreading.com/"; //1
|
||||
// baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
|
||||
// baseUrl = "https://api.nuttyreading.com/"; //1
|
||||
baseUrl = "http://192.168.110.100:9200/pb/"; // 张川川
|
||||
// baseUrl = "ws://twin-ui.com:6001/";
|
||||
// socketUrl = "ws://twin-ui.com:6001/";
|
||||
}
|
||||
|
||||
2
main.js
2
main.js
@@ -88,6 +88,8 @@ import commonList from '@/pages/component/commonComponents/list.vue'
|
||||
Vue.component('common-list', commonList);
|
||||
import commonVideo from '@/pages/component/commonComponents/video/index.vue'
|
||||
Vue.component('common-video', commonVideo);
|
||||
import commonCoupon from '@/pages/component/commonComponents/coupon/index.vue'
|
||||
Vue.component('common-coupon', commonCoupon);
|
||||
import commonGoodsList from '@/pages/component/commonComponents/goodsList.vue'
|
||||
Vue.component('common-goods-list', commonGoodsList);
|
||||
import commonCurriculumList from '@/pages/component/commonComponents/curriculum.vue'
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
"src" : "图片路径"
|
||||
}
|
||||
],
|
||||
"versionName" : "1.0.28",
|
||||
"versionCode" : 1028,
|
||||
"versionName" : "1.0.31",
|
||||
"versionCode" : 1031,
|
||||
"app-plus" : {
|
||||
"nvueCompiler" : "weex",
|
||||
"compatible" : {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
287
pages/component/commonComponents/coupon/index.vue
Normal file
287
pages/component/commonComponents/coupon/index.vue
Normal file
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-for="(item, index) in List" :key="index">
|
||||
<view :class="`youhuiItem ${itemClass}`">
|
||||
<view class="centerbg">
|
||||
<view class="centerView" style="position: relative"
|
||||
><text
|
||||
v-if="source == 'mine'"
|
||||
class="border_radius_10"
|
||||
style="
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
top: 10rpx;
|
||||
font-size: 25rpx;
|
||||
/* background-color: #fad4bd; */
|
||||
color: #ed2a2e;
|
||||
"
|
||||
>{{ item.couponEntity.couponRange | couponType }}</text
|
||||
>
|
||||
<view style="color: #fd4347; width: 200rpx">
|
||||
<view
|
||||
style="position: relative; border-right: 1px dashed #fa8277"
|
||||
>
|
||||
<text
|
||||
style="
|
||||
font-weight: 700;
|
||||
font-size: 40rpx;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 0rpx;
|
||||
"
|
||||
>¥</text
|
||||
>
|
||||
<text
|
||||
style="
|
||||
font-size: 64rpx;
|
||||
letter-spacing: 0.1px;
|
||||
font-weight: 700;
|
||||
margin-left: 40rpx;
|
||||
"
|
||||
>{{ item.couponEntity.couponAmount }}</text
|
||||
>
|
||||
<text
|
||||
v-if="source == 'mine'"
|
||||
style="
|
||||
display: block;
|
||||
color: #333;
|
||||
font-size: 25rpx;
|
||||
margin-left: 0rpx;
|
||||
margin-top: 0rpx;
|
||||
"
|
||||
>满{{ item.couponEntity.useLevel }}元可用</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: calc(100% - 220rpx)">
|
||||
<view>
|
||||
<view
|
||||
style="color: #fd4347; font-size: 44rpx; font-weight: bold;"
|
||||
>{{
|
||||
item.couponEntity.couponType == 0 ? "现金" : "折扣"
|
||||
}}优惠券
|
||||
|
||||
|
||||
<!-- <text v-if="source == 'mine'" style="box-sizing: border-box;padding:4rpx 20rpx;margin-left: 10rpx;font-size: 24rpx;background-color: #fff;border-radius: 24rpx;float: right;">去使用</text> -->
|
||||
|
||||
|
||||
|
||||
|
||||
</view
|
||||
>
|
||||
|
||||
|
||||
<text
|
||||
v-if="source != 'goodsDetail'"
|
||||
style="
|
||||
display: block;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
margin-top: 10rpx;
|
||||
"
|
||||
>有效期至:{{
|
||||
item.effectType == 0 ? "永久有效" : item.endTime
|
||||
}}</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bottombg">
|
||||
<view
|
||||
style="
|
||||
width: 100%;
|
||||
padding: 16rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
margin-right: 6rpx;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
<view
|
||||
class="title"
|
||||
style="
|
||||
line-height: 34rpx;
|
||||
margin-bottom: 10rpx;
|
||||
color: #fff;
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
"
|
||||
>
|
||||
{{ item.couponEntity.couponName }}
|
||||
</view>
|
||||
<view
|
||||
v-if="item.couponEntity.remark"
|
||||
style="
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
bottom: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
font-size: 22rpx;
|
||||
color: #fafafa;
|
||||
"
|
||||
>
|
||||
<!-- 详细信息
|
||||
<u-icon
|
||||
size="20rpx"
|
||||
color="#fafafa"
|
||||
style="color: #fafafa; float: right;margin-left: 4rpx;"
|
||||
name="arrow-down-fill"
|
||||
></u-icon> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-collapse
|
||||
v-if="source != 'goodsDetail'&&item.couponEntity.remark"
|
||||
style="
|
||||
margin-top: 0rpx;
|
||||
z-index: 10 !important;
|
||||
background-color: #fafafa;
|
||||
border-bottom-left-radius: 10rpx;
|
||||
border-bottom-right-radius: 10rpx;
|
||||
"
|
||||
:border="false"
|
||||
>
|
||||
<u-collapse-item title="详细信息" name="Docs guide">
|
||||
<view
|
||||
style="
|
||||
font-size: 22rpx;
|
||||
width: 100%;
|
||||
margin-right: 20rpx !important;
|
||||
"
|
||||
>使用说明:{{ item.couponEntity.remark }}</view
|
||||
>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $http from "@/config/requestConfig.js";
|
||||
import { mapState } from "vuex";
|
||||
export default {
|
||||
props: ["List", "source", "itemClass"],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
filters: {
|
||||
couponType(type) {
|
||||
// 0无限制 1课程卷 2课程品类卷
|
||||
var str = "";
|
||||
switch (type) {
|
||||
case 0:
|
||||
str = "全场通用";
|
||||
break;
|
||||
case 1:
|
||||
str = "指定课程可用";
|
||||
break;
|
||||
case 2:
|
||||
str = "指定课程品类可用";
|
||||
break;
|
||||
}
|
||||
return str;
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(["userInfo"]),
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.youhuiItem {
|
||||
min-height: 320rpx;
|
||||
position: relative;
|
||||
background: linear-gradient(to top right, #fd4c50, #fe393d);
|
||||
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
|
||||
padding: 26rpx;
|
||||
margin: 25rpx 0 0 0;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.centerbg {
|
||||
width: 100%;
|
||||
background-image: linear-gradient(60deg, #ffefd3 0%, #f8be85 100%);
|
||||
|
||||
height: calc(100%);
|
||||
border-radius: 10rpx;
|
||||
padding-bottom: 86rpx;
|
||||
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.centerView {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
padding: 30rpx 20rpx 0 40rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.bottombg {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
|
||||
background-image: url("@/static/icon/coupon/bottom.png") !important;
|
||||
}
|
||||
|
||||
.youhuiItem > view {
|
||||
}
|
||||
|
||||
.youhuiItem.youItem_style {
|
||||
border-color: #fd6004;
|
||||
}
|
||||
|
||||
::v-deep .u-cell__body {
|
||||
padding-top: 0 !important ;
|
||||
padding-bottom: 0 !important ;
|
||||
z-index: 10 !important ;
|
||||
.u-cell__title-text {
|
||||
color: #333 !important;
|
||||
font-size: 24rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .u-collapse-item__content__text {
|
||||
padding: 10rpx 20rpx !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
::v-deep.itemCouponClass {
|
||||
min-height: 180rpx !important;
|
||||
.bottombg {
|
||||
.title {
|
||||
font-size: 26rpx !important;
|
||||
}
|
||||
}
|
||||
.centerbg {
|
||||
padding-bottom: 60rpx !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,36 +1,43 @@
|
||||
<template>
|
||||
<view >
|
||||
<view>
|
||||
<public-module></public-module>
|
||||
<z-nav-bar title="我的优惠券"></z-nav-bar>
|
||||
<view class="">
|
||||
<view class="">
|
||||
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="tabClick" :current="curTagIndex"
|
||||
:activeStyle="activeStyle" :scrollable="false" :list="tabList"
|
||||
itemStyle="padding-left:10rpx; background-color:#fff; padding-right: 10rpx; height: 50px; font-size:26rpx"></u-tabs>
|
||||
<u-tabs
|
||||
v-if="tabList.length > 0"
|
||||
:class="['tabList']"
|
||||
@click="tabClick"
|
||||
:current="curTagIndex"
|
||||
:activeStyle="activeStyle"
|
||||
:scrollable="false"
|
||||
:list="tabList"
|
||||
itemStyle="padding-left:10rpx; background-color:#fff; padding-right: 10rpx; height: 50px; font-size:26rpx"
|
||||
></u-tabs>
|
||||
</view>
|
||||
<!-- -->
|
||||
<view class="tanchu">
|
||||
<view class="tanchu" style="position: relative">
|
||||
|
||||
<view
|
||||
v-if="status!=0"
|
||||
style="
|
||||
min-height: 80vh;
|
||||
z-index: 100;
|
||||
background-color: #f0f0f0;
|
||||
opacity: 0.55;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
"
|
||||
></view>
|
||||
<view class="listBox" v-if="list.length > 0">
|
||||
<view style="max-height: 40vh;overflow-y: scroll;" :class="'youhuiItem'"
|
||||
v-for="(item,index) in list" :key="index" >
|
||||
<view style="width: 25%;color:#fd6004;text-align: center;">
|
||||
<text>¥</text>
|
||||
<b style="font-size: 45rpx;">{{item.couponEntity.couponAmount}}</b>
|
||||
<text
|
||||
style="display: block;color: #666;font-size: 25rpx;margin-top: 10rpx;">满{{item.couponEntity.useLevel}}元可用</text>
|
||||
</view>
|
||||
<view style="width: 68%;padding-left: 5%;">
|
||||
<view>
|
||||
<text style="display: inline-block; margin-right: 6rpx;">{{item.couponEntity.couponName}}</text>
|
||||
<text class="border_radius_10" style="font-size: 24rpx; background-color: #fad4bd; color: #666;">{{item.couponEntity.couponRange | couponType}}</text>
|
||||
</view>
|
||||
<text
|
||||
style="display: block;font-size: 20rpx;color: #999;margin-top: 10rpx;">到期时间:{{item.effectType == 0 ? '永久有效' : item.endTime}}</text>
|
||||
<text
|
||||
style="display: block;font-size: 20rpx;color: #999;margin-top: 4rpx;">说明:{{item.couponEntity.remark}}</text>
|
||||
<view style="min-height: 40vh; overflow-y: scroll">
|
||||
<common-coupon :List="list" :source="'mine'"> </common-coupon>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view style="font-size: 20rpx;color: #aaa;margin-top: 30rpx;">* 每笔订单只能使用一张优惠价</view> -->
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
@@ -45,107 +52,114 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
export default {
|
||||
import $http from "@/config/requestConfig.js";
|
||||
import { mapState } from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list:[], // 优惠券列表
|
||||
listStatus:88,
|
||||
curTagIndex:0, // 当前索引
|
||||
tabList: [{
|
||||
name: '未使用',
|
||||
id: '0'
|
||||
list: [], // 优惠券列表
|
||||
listStatus: 88,
|
||||
curTagIndex: 0, // 当前索引
|
||||
tabList: [
|
||||
{
|
||||
name: "未使用",
|
||||
id: "0",
|
||||
},
|
||||
{
|
||||
name: '已使用',
|
||||
id: '1'
|
||||
name: "已使用",
|
||||
id: "1",
|
||||
},
|
||||
{
|
||||
name: '已过期',
|
||||
id: '2'
|
||||
}
|
||||
|
||||
name: "已过期",
|
||||
id: "2",
|
||||
},
|
||||
],
|
||||
activeStyle:{
|
||||
background:'#fff',
|
||||
color:'#666',
|
||||
padding:"10rpx",
|
||||
borderRadius:"10rpx"
|
||||
activeStyle: {
|
||||
background: "#fff",
|
||||
color: "#666",
|
||||
padding: "10rpx",
|
||||
borderRadius: "10rpx",
|
||||
},
|
||||
page:0,
|
||||
limit:15,
|
||||
status:0,
|
||||
flag:false, // 请求标记
|
||||
}
|
||||
page: 0,
|
||||
limit: 15,
|
||||
status: 0,
|
||||
flag: false, // 请求标记
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.page = 1
|
||||
this.getUserCouponList()
|
||||
this.page = 1;
|
||||
this.getUserCouponList();
|
||||
},
|
||||
async onReachBottom() {
|
||||
console.log('触底',this.listStatus,this.flag);
|
||||
console.log("触底", this.listStatus, this.flag);
|
||||
|
||||
if(this.listStatus != 1 && this.listStatus != 2){
|
||||
if(!this.flag){
|
||||
this.page++
|
||||
await this.getUserCouponList()
|
||||
if (this.listStatus != 1 && this.listStatus != 2) {
|
||||
if (!this.flag) {
|
||||
this.page++;
|
||||
await this.getUserCouponList();
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
filters:{
|
||||
couponType(type){
|
||||
filters: {
|
||||
couponType(type) {
|
||||
// 0无限制 1课程卷 2课程品类卷
|
||||
var str = ''
|
||||
switch (type){
|
||||
var str = "";
|
||||
switch (type) {
|
||||
case 0:
|
||||
str = '全场通用'
|
||||
str = "全场通用";
|
||||
break;
|
||||
case 1:
|
||||
str = '指定课程可用'
|
||||
str = "指定课程可用";
|
||||
break;
|
||||
case 2:
|
||||
str = '指定课程品类可用'
|
||||
str = "指定课程品类可用";
|
||||
break;
|
||||
}
|
||||
return str
|
||||
}
|
||||
return str;
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(["userInfo"]),
|
||||
},
|
||||
methods: {
|
||||
async tabClick(e) {
|
||||
console.log('e', e);
|
||||
this.status = e.id
|
||||
console.log("e", e);
|
||||
this.status = e.id;
|
||||
// this.curTagIndex = e.index
|
||||
this.page = 0
|
||||
this.page += 1
|
||||
this.list = []
|
||||
await this.getUserCouponList()
|
||||
|
||||
this.page = 0;
|
||||
this.page += 1;
|
||||
this.list = [];
|
||||
await this.getUserCouponList();
|
||||
},
|
||||
async getUserCouponList(){
|
||||
console.log('进入函数了妈');
|
||||
this.listStatus = 1
|
||||
this.flag = true
|
||||
async getUserCouponList() {
|
||||
console.log("进入函数了妈");
|
||||
this.listStatus = 1;
|
||||
this.flag = true;
|
||||
uni.showLoading({
|
||||
title:'加载中'
|
||||
})
|
||||
title: "加载中",
|
||||
});
|
||||
console.log(
|
||||
{
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
getType: "", //获取类型 0 后台赠送 1 主动获取
|
||||
status: this.status, //使用状态 0 未使用 1 已使用 2 已过期
|
||||
userInfo: "", //用户信息
|
||||
userId: this.userInfo.id,
|
||||
},
|
||||
111111111111111111111111111
|
||||
);
|
||||
await this.$http
|
||||
.request({
|
||||
url: "common/coupon/getCouponHistoryList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"page": this.page,
|
||||
"limit": this.limit,
|
||||
"getType":"",//获取类型 0 后台赠送 1 主动获取
|
||||
"status": this.status,//使用状态 0 未使用 1 已使用 2 已过期
|
||||
"userInfo":"",//用户信息
|
||||
"userId":this.userInfo.id
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
getType: "", //获取类型 0 后台赠送 1 主动获取
|
||||
status: this.status, //使用状态 0 未使用 1 已使用 2 已过期
|
||||
userInfo: "", //用户信息
|
||||
userId: this.userInfo.id,
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
@@ -153,38 +167,39 @@
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
uni.hideLoading()
|
||||
if(res.code != 0) return this.$commonJS.showToast(res.errMsg);
|
||||
if(res.couponList.records.length > 0){
|
||||
this.list = this.list.concat(res.couponList.records)
|
||||
console.log(res, "1111111111111");
|
||||
uni.hideLoading();
|
||||
if (res.code != 0) return this.$commonJS.showToast(res.errMsg);
|
||||
if (res.couponList.records.length > 0) {
|
||||
this.list = this.list.concat(res.couponList.records);
|
||||
if (res.couponList.pages > this.page) {
|
||||
this.listStatus = 0
|
||||
this.listStatus = 0;
|
||||
} else {
|
||||
this.listStatus = 2
|
||||
this.listStatus = 2;
|
||||
}
|
||||
} else {
|
||||
this.listStatus = 3 // 暂无数据
|
||||
this.listStatus = 3; // 暂无数据
|
||||
}
|
||||
this.flag = false
|
||||
|
||||
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
console.log(e);
|
||||
this.flag = false
|
||||
this.listStatus = 3
|
||||
console.log(e, '数据报错')
|
||||
this.$commonJS.showToast(e.errMsg);
|
||||
this.flag = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
uni.hideLoading();
|
||||
console.log(e);
|
||||
this.flag = false;
|
||||
this.listStatus = 3;
|
||||
console.log(e, "数据报错");
|
||||
this.$commonJS.showToast(e.errMsg);
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btnBox {
|
||||
.btnBox {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.tanchu {
|
||||
padding: 0 30rpx 40rpx 30rpx;
|
||||
position: relative;
|
||||
@@ -255,7 +270,6 @@
|
||||
margin: 0 0 0 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.chooseCheck {
|
||||
position: absolute;
|
||||
top: 3rpx;
|
||||
@@ -269,29 +283,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.addressItem.addItem_style {
|
||||
border-color: #fd6004;
|
||||
}
|
||||
|
||||
.youhuiItem {
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
padding: 20rpx 10rpx;
|
||||
margin: 25rpx 0 0 0;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.youhuiItem>view {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.youhuiItem.youItem_style {
|
||||
border-color: #fd6004;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
BIN
static/icon/coupon/bottom.png
Normal file
BIN
static/icon/coupon/bottom.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
BIN
unpackage/wumen20241101103101.wgt
Normal file
BIN
unpackage/wumen20241101103101.wgt
Normal file
Binary file not shown.
Reference in New Issue
Block a user