9 Commits

Author SHA1 Message Date
@fawn-nine
060f72abf5 订单列表订单数bug 2024-10-23 16:31:16 +08:00
@fawn-nine
2471c703b6 添加复读订单功能 2024-10-23 15:03:52 +08:00
@fawn-nine
31bf1f301b 添加复读功能 2024-10-22 17:13:31 +08:00
@fawn-nine
c851585ba0 添加不可用原因 2024-10-22 10:05:22 +08:00
@fawn-nine
a94c9d2c21 优惠券限制 2024-10-21 16:52:04 +08:00
@fawn-nine
4f8b4bba11 样式修改 2024-10-21 13:58:23 +08:00
@fawn-nine
379c3dd751 合并selfStudy后 2024-10-18 15:39:23 +08:00
@fawn-nine
9b9849bf72 优惠券 2024-10-18 15:16:09 +08:00
@fawn-nine
d46f419846 优惠券 2024-10-17 16:58:54 +08:00
13 changed files with 3013 additions and 2075 deletions

267
components/orderCoupon.vue Normal file
View File

@@ -0,0 +1,267 @@
<template>
<view>
<!-- 优惠券弹出 -->
<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;">
<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>
<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>
</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 class="" style="background-color: #d9d9d9; border-radius: 10rpx; 0 0 10rpx; text-align: center;" v-if="item.canUse == 0">
<text
style="color: #999; "
>不可用</text>
</view> -->
<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>
<u-icon name="checkmark-circle-fill" color="#fd6004" size="20" v-if="youhuiIndex === index">
</u-icon>
</template>
</view>
<br clear="both">
</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>
<view class="" style="width: 48%;">
<button type="primary" @click="confirmCoupon()">选好了</button>
</view>
</view>
</template>
<view class="" v-else>
<u-divider text="暂无可用优惠券哦"></u-divider>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
name: "orderCoupon",
props: ['list', 'curCouponId','sumMeony'],
data() {
return {
youhuiShow: true,
youhuiIndex: undefined
};
},
mounted() {
console.log('进入了', this.curCouponId, this.sumMeony);
if (this.curCouponId) {
this.youhuiIndex = this.list.findIndex(item => item.couponEntity.id === this.curCouponId);
console.log('查找后的结果', this.youhuiIndex);
}
},
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: {
},
methods: {
closePup() {
this.youhuiIndex = undefined
this.$emit('close')
},
// 确定选中优惠券
confirmCoupon(str) {
console.log(str, '6666');
if (str && str == 'none') {
// 清空优惠券操作
this.$emit('confirmCoupon')
setTimeout(() => {
this.closePup()
}, 300)
return
}
if (this.youhuiIndex == 0 || this.youhuiIndex) {
this.$emit('confirmCoupon', this.list[this.youhuiIndex])
setTimeout(() => {
this.closePup()
}, 300)
} else {
uni.showToast({
title: '请选择您要使用的优惠券',
icon: "none"
})
}
},
// 选择优惠券
choseYouhui(e) {
if(this.list[e].canUse == 0 ){
return
}
console.log('选中优惠券e', e);
this.youhuiIndex = e
},
}
}
</script>
<style lang="scss" scoped>
.btnBox {
margin-top: 20rpx;
}
.tanchu {
padding: 40rpx 30rpx 40rpx 30rpx;
position: relative;
// max-height: 60vh;
// overflow-y: scroll;
.dp_title {
font-size: 32rpx;
margin-bottom: 50rpx;
color: #555;
text-align: center;
font-weight: bold;
}
.dp_add {
position: absolute;
top: 40rpx;
right: 30rpx;
font-size: 22rpx;
background-color: #fd6004;
color: #fff;
border-radius: 10rpx;
padding: 5rpx 10rpx;
.u-icon {
display: inline-block;
margin-right: 5rpx;
}
}
.addressItem {
border: 2px dashed #d9d9d9;
border-radius: 10rpx;
width: 100%;
display: flex;
padding: 20rpx 10rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
.addrContent {
margin-left: 40rpx;
flex: 1;
.addrContentTop {
display: flex;
align-items: flex-end;
margin: 0 0 15rpx 0;
position: relative;
.userName {
font-size: 35rpx;
font-weight: bold;
margin-right: 30rpx;
}
.userTel {
font-size: 25rpx;
color: #888;
}
.userMoren {
border: 1px solid #fd6004;
color: #fd6004;
padding: 3rpx 10rpx;
font-size: 22rpx;
border-radius: 10rpx;
margin: 0 0 0 20rpx;
}
.chooseCheck {
position: absolute;
top: 3rpx;
right: 6rpx;
}
}
.addrContentBottom {
font-size: 32rpx;
}
}
}
.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>

View File

@@ -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/";

View File

@@ -748,7 +748,14 @@
{
"navigationBarTitleText" : "自考考试"
}
}
},
{
"path" : "pages/mine/wallet/couponList",
"style" :
{
"navigationBarTitleText" : "用户优惠券列表"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

View File

@@ -166,6 +166,23 @@
<br clear="both" />
</view>
<view class="orderContent" v-if="orderContet.orderType == 'relearn'">
<image
src="/static/icon/fugou.png"
mode="aspectFill"
style="width: 100rpx; height: 100rpx"
></image>
<view class="itemJian">
<view class="orderTitle" style="line-height: 100rpx">
<text>{{ orderContet.remark }}</text>
</view>
<view class="orderPrice">
<text style="font-weight: bold"></text>
</view>
<br clear="both" />
</view>
<br clear="both" />
</view>
<view class="orderContent" v-if="orderContet.orderType == 'vip'">
<image
src="/static/icon/vip.png"
@@ -215,8 +232,14 @@
<span style="color: #666; margin-right: 10rpx; float: left"
>运费 :
</span>
<span>¥</span>{{ orderContet.shippingMoney }}
<span>¥</span>{{ orderContet.shippingMoney }}
</view>
<view class="orderReal" v-if="orderContet.couponId && orderContet.couponId != null">
<span style="color: #666; margin-right: 10rpx; float: left"
>优惠券 :
</span>
<span>- ¥</span>{{ orderContet.couponAmount }}
</view>
<view class="orderReal" v-if="orderContet.orderType == 'order'">
<span style="color: #666; margin-right: 10rpx; float: left"
>积分 :
@@ -888,11 +911,33 @@ export default {
orderTabCLi(e) {
this.orderListTab = e;
},
async getCouponDetail(id){
await this.$http
.request({
url: "common/coupon/getCouponHistoryInfo",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
id
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
if(res.code != 0) return this.$commonJS.showToast(res.errMsg);
this.orderContet.couponAmount = res.couponHistory.couponEntity.couponAmount
}).catch(e => {
console.log(e);
this.$commonJS.showToast(e.errMsg);
})
},
// 获取订单详情
getOrderList() {
async getOrderList() {
console.log("this.orderType", this.orderType);
this.$http
await this.$http
.request({
url: "common/buyOrder/commonOrderDetail",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
@@ -904,12 +949,16 @@ export default {
"Content-Type": "application/json",
},
})
.then((res) => {
.then(async (res) => {
this.customButton = [];
console.log("订单详情", res);
this.orderContet = res.data.buyOrder;
this.goodsList = res.data.productInfo;
this.consigneeShow = true;
// 存在优惠券信息,就查询优惠券集体金额
if(this.orderContet.couponId && this.orderContet.couponId != null){
await this.getCouponDetail(this.orderContet.couponId)
}
if (
this.orderContet.orderStatus == 2 &&
this.sheetList.length > 0 &&

View File

@@ -128,7 +128,40 @@
>
</view>
</view>
<view
v-if="slotProps.row.orderType == 'relearn'"
class="bookinfolist"
>
<image
class="feng fengPoint"
src="/static/icon/fugou.png"
mode="aspectFill"
></image>
<!-- <view class="description" >课程复读订单
</view> -->
<view class="btns flexbox">
<view class="booknameleft">
{{ slotProps.row.remark }}
</view>
<view
style="
line-height: 58rpx;
color: #333;
font-size: 26rpx;
font-weight: 700;
"
>
<text style="font-size: 20rpx"></text>
</view>
</view>
<!-- <view
class="btns flexbox"
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx"
>
下单时间{{ slotProps.row.createTime }}
</view> -->
</view>
<view
v-if="slotProps.row.orderType == 'vip'"
class="bookinfolist"
@@ -866,7 +899,9 @@ export default {
e.badge = {
value: numList[0].num,
};
}
}else{
e.badge = {};
}
} else {
e.badge = {};
}
@@ -897,7 +932,7 @@ export default {
},
})
.then((res) => {
// console.log(res, "内容获取成功");
console.log("订单列表内容获取成功",res );
that.pagination.total = res.data.total;
if (res.data.total == 0) {
this.isLoadingHide = true;
@@ -1001,6 +1036,7 @@ export default {
},
// 取消订单
canceOrder(item) {
console.log('item.orderSn',item);
uni.showModal({
title: "提示",
content: "确定要取消订单吗?",
@@ -1011,7 +1047,9 @@ export default {
success: (res) => {
if (res.confirm) {
this.$http
.get("book/buyOrder/cancelOrder?orderSn=" + item.orderSn)
.post(
"book/buyOrder/appDelete?orderId=" + item.orderId
)
.then((res) => {
if (res.code == 0) {
uni.showToast({

View File

@@ -44,8 +44,8 @@
<view
class="related_courses_name"
:class="`goods_item ${
selectGoodsData &&
selectGoodsData.productId == slotProps.row.productId
!isFudu && selectGoodsData &&
selectGoodsData.productId == slotProps.row.productId || isFudu && selectGoodsData.productName == slotProps.row.productName
? 'isSelectGoods color_shandow'
: ''
}`"
@@ -109,6 +109,7 @@ export default {
"selectGoodsData",
"customButtonGroup1",
"buyOptions",
"isFudu", // 是否复读
],
data() {
return {

View File

@@ -229,7 +229,7 @@
<text style="line-height: 50rpx;">课程有效期截止到{{librayList[curIndex].endTime}} </text>
<!-- 自己买的可以续费 -->
<text class="xufeiBtn"
@click="handleClickGetGoodsList(librayList[curIndex])">续费</text>
@click="handleClickGetGoodsList(librayList[curIndex])">续费</text>
</template>
</view>
</view>
@@ -243,6 +243,10 @@
<view class="tag-view flex_box">
<u-button class="btn" type="warning" size="small"
@click="handleClickGetGoodsList(librayList[curIndex])" text="购买课程"></u-button>
<u-button class="btn" type="success" size="small"
@click="goNewPay(librayList[curIndex])" text="复读" v-if="showNewPayBtn"></u-button>
<!-- <text class="xufeiBtn"
@click="goNewPay(librayList[curIndex])" >复读</text> -->
<u-button size="small" v-if="isAndorid" class="btn" type="primary"
@click="onPageJump('/pages/mine/vip/index')" text="开通VIP"></u-button>
<!-- <uni-tag size="normal" style="margin-left: 20rpx;" text="" type="success" /> -->
@@ -463,10 +467,10 @@
</view>
<common-select-goods ref="commonSelectGoods" :selectGoodsData="selectGoodsData" :goodsList="goodsList"
<common-select-goods ref="commonSelectGoods" isFudu="isFudu" :selectGoodsData="selectGoodsData" :goodsList="goodsList"
:buyOptions="buyOptions" :customButtonGroup1="customButtonGroup1" @selectGoods="handleClickSelectGoods"
@onHandleClickBuy="
$refs.commonSelectGoods.close();
$refs.commonSelectGoods.close();
protocolShow = true;
"></common-select-goods>
<u-popup :show="protocolShow" mode="center" round="6" v-if="protocolShow">
@@ -623,6 +627,8 @@
list: "sociology/course/getCourseDetail",
goodsList: "sociology/product/getProductListForCourse",
startStudyForMF: "sociology/course/startStudyForMF",
newPayment:"common/courseRelearn/courseCatalogueCanRelearn", // 检查复读地址
newPaymentList:"common/courseRelearn/relearnShopProductList", // 获取复读列表
},
isAndorid: true,
oprateOsName: '',
@@ -638,6 +644,9 @@
showNextTestDate: undefined,
canJoinTestTime: false, //时间上是否可以参加自考考试
courseCompletion: undefined, // 课程学习进度
showNewPayBtn:false,
newPaymentProList:[],
isFudu:false, // 是否复读
};
},
//第一次加载
@@ -663,7 +672,7 @@
}
},
computed: {
...mapState(["userInfo"]),
...mapState(["userInfo"]),
},
//页面显示
async onShow() {
@@ -1108,6 +1117,7 @@
typeId: 0,
navTitle: this.course.title,
title: this.course.title,
isFudu: this.isFudu
// sourceType: "curriculum",
}); // 这里转换成 字符串
uni.navigateTo({
@@ -1119,6 +1129,69 @@
this.pricespop = false;
this.protocolShow = true;
},
// 查询课程复读列表
async getNewPaymentList(id){
uni.showLoading({
title:'加载中'
})
await this.$http
.request({
url: this.urlList.newPaymentList,
method: "POST",
data: {
catalogueId: id,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log("复读列表", res);
uni.hideLoading()
if(res.code != 0){return this.$commonJS.showToast(res.errMsg);}
// if (res.code == 0) {
this.newPaymentProList = res.productList
// }
this.$forceUpdate();
}).catch(e => {
uni.hideLoading()
console.log('e',e);
this.newPaymentProList = []
this.$commonJS.showToast(e.errMsg);
});
},
// 查询目录续费情况
async checkRenewPayment(id){
var ss = false
await this.$http
.request({
url: this.urlList.newPayment,
method: "POST",
data: {
courseCatalogueId: id,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log("res at line 493:", res);
if(res.code != 0){return this.$commonJS.showToast(res.errMsg);}
if (res.code == 0) {
ss = res.canRelearn
}
this.$forceUpdate();
}).catch(e => {
console.log('e',e);
ss = false
this.$commonJS.showToast(e.errMsg);
});
return ss
},
//获取相关关联课程商品
handleClickGetGoodsList(v) {
// console.log("data at line 313:", data);
@@ -1140,7 +1213,7 @@
.then(async (res) => {
console.log("res at line 493:", res);
if (res.code == 0) {
this.getCourseDescriptionData();
this.getCourseDescriptionData(v);
// this.$commonJS.showToast("");
}
this.$forceUpdate();
@@ -1153,32 +1226,36 @@
showCancel: false
})
} else {
this.$http
.request({
url: this.urlList.goodsList,
method: "POST",
data: {
id: v.id,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
if (res.productList.length > 0) {
this.goodsList = res.productList;
this.selectGoodsData = this.goodsList[0];
this.$refs.commonSelectGoods.open();
this.show = true;
} else {
this.$commonJS.showToast("此课程暂无购买方式");
}
this.$forceUpdate();
})
this.getCourseDescriptionData(v);
}
},
getCourseDescriptionData(v){
this.isFudu = false
this.$http
.request({
url: this.urlList.goodsList,
method: "POST",
data: {
id: v.id,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
if (res.productList.length > 0) {
this.goodsList = res.productList;
this.selectGoodsData = this.goodsList[0];
this.$refs.commonSelectGoods.open();
this.show = true;
} else {
this.$commonJS.showToast("此课程暂无购买方式");
}
this.$forceUpdate();
})
},
getUserInfo() {
this.$http.post("common/user/getUserInfo").then((res) => {
console.log("res at line 505:", res);
@@ -1683,10 +1760,11 @@
this.curId = this.librayList[0].id;
this.curIndex = 0
console.log('首次加载');
}
this.chapterList = await this.getChapterList(this.catalogueId)
// console.log('目录列表', this.librayList)
}
console.log('this.librayList[0]',this.librayList[0]);
this.clicklib(this.librayList[0], 0)
// this.chapterList = await this.getChapterList(this.catalogueId)
console.log('目录列表', this.librayList)
// console.log('外面得到的方法列表', this.chapterList);
if (
res.data.shopProductList &&
@@ -1778,14 +1856,41 @@
console.log("datas at line 1300:", datas);
return datas;
},
async clicklib(item, index) {
if (item.id == this.curId) {
return;
// 选择复读选项
async goNewPay(item){
this.showNewPayBtn ? await this.getNewPaymentList(item.id) : ''
if(this.newPaymentProList.length > 0){
// this.getCourseDescriptionData(v);
this.goodsList = this.newPaymentProList;
this.selectGoodsData = this.goodsList[0];
this.$refs.commonSelectGoods.open();
this.isFudu = true
this.show = true;
}else{
this.show = false
this.isFudu = false
this.$commonJS.showToast('暂无复读方案');
}
},
async clicklib(item, index) {
console.log('hhhhhhhhhhhhhhhhhhh++++++++', item);
// if (item.id == this.curId) {
// return;
// }
this.catalogueId = item.id
this.curIndex = index;
this.curId = item.id;
if(item.isBuy == 0 && this.userMsg.vip != 2 && this.userMsg.vip != 1 ){
console.log('hhhhhhhhhhhhhhhhhhh++++++++');
this.showNewPayBtn = await this.checkRenewPayment(item.id)
console.log('可以复读吗?', this.showNewPayBtn );
}else{ // this.showNewPayBtn = await this.checkRenewPayment(item.id)
console.log('不用复读');
}
this.chapterList = await this.getChapterList(item.id);
},
toZhedie() {
this.fold = true;

File diff suppressed because it is too large Load Diff

View File

@@ -89,7 +89,7 @@
</view>
</view>
</view>
<view class="pay_box" style="margin-top: 20rpx">
<view class="pay_box" style="margin-top: 20rpx" v-if="!options.isFudu">
<view @click="openOrderModal(v)" class="curriulum_title_box goods_item pay_item"
v-for="(v, i) in orderInfoList" :key="i">
<view class="top">
@@ -133,7 +133,7 @@
<u-icon v-if="v.icon" name="map-fill" color="#018F89" size="23"
style="display: inline-block"></u-icon>
<text> {{ v.text }}</text><template v-if="v.type == 3">
<text> {{ v.text }}</text><template v-if="v.type == 4">
<text style="color: #aaa; margin-left: 10rpx">
(全部积分{{ initData.user.jf }})</text>
</template>
@@ -147,12 +147,29 @@
}}</text>
</template>
<template v-if="v.type == 3">
<template v-if="!curCoupon.id">
<template v-if="couponHistoryList.length > 0">
<text style="color: #999" @click="showCouponPup = true">({{couponHistoryList.length}})</text>
<text @click="showCouponPup = true" style="display: inline-block; margin-left: 20rpx; background-color: #fe6035; color: #fff; border-radius: 30rpx;font-size: 26rpx; border: 4rpx #fe6035 solid; ">选择优惠券</text>
</template>
<template v-else>
<text style="color: #999">暂无可用优惠券</text>
</template>
<!-- <text style="color: #fe6035"> -{{ jfNumberShow }}</text> -->
</template>
<template v-else>
<text style="color: #fe6035" >- {{curCoupon.couponEntity.couponAmount}}</text>
<text @click="showCouponPup = true" style="display: inline-block; margin-left: 20rpx; background-color: #fe6035; color: #fff; border-radius: 30rpx;font-size: 26rpx; border: 4rpx #fe6035 solid; ">重新选择</text>
</template>
</template>
<template v-if="v.type == 4">
<text style="color: #fe6035"> -{{ jfNumberShow }}</text>
</template>
</view>
</view>
<view class="bottom jf_box" v-if="v.type == 3">
<view class="bottom jf_box" v-if="v.type == 4">
<view class="jf_box">
<text style="color: #258feb; font-weight: 600">可用积分({{ jfNumberMax }})</text>
<view class="jf_input">
@@ -360,12 +377,14 @@
@click="onHandleClickBuy" @buttonClick="onHandleClickBuy" />
</view>
</view>
</u-popup>
</u-popup>
<order-coupon v-if="showCouponPup" :sumMeony="totalPrice" :curCouponId="curCouponId" :list="couponHistoryList" ref="orderCoupon" @confirmCoupon="confirmCoupon" @close="closeCoupon"></order-coupon>
<!-- <z-navigation></z-navigation> -->
</view>
</template>
<script>
import orderCoupon from "@/components/orderCoupon.vue";
import courseDescription from "@/pages/component/commonComponents/list";
import {
setPay,
@@ -382,6 +401,7 @@
export default {
components: {
courseDescription, //课程说明
orderCoupon, // 优惠券弹出
},
watch: {
isDefaultCurrency: {
@@ -551,6 +571,7 @@
detailInfo: "app/phoneDoctor.do?getTaiHuClassInfo_new",
addressList: "common/userAddress/getUserAddress",
freightNum: "book/buyOrder/calculateTransportPrice", //运费
renewPayment:'common/courseRelearn/relearnSave' , // 复读下单地址
},
customButton: [{
width: "340rpx",
@@ -567,6 +588,10 @@
haveCourse: false, // 结算队列是否有课程类型的商品
isAndorid: null, //操作系统
beizhuShow: false, // 是否显示天医币说明?
couponHistoryList:[], // 可用优惠券
showCouponPup:false, // 是否显示优惠券弹窗
curCoupon:{}, // 选中的优惠券信息
curCouponId:undefined
};
},
async onLoad(options) {
@@ -607,6 +632,7 @@
// this.searchList = []
},
async onShow() {
this.curCouponId = undefined
console.log("调用了onShow方法");
var that = this;
await uni.$on("returnData", function(data) {
@@ -625,6 +651,7 @@
console.log("没有接受到数据");
}
});
await this.getActiveCouponList()
// this.selectPayIndex = 0;
console.log("this.addressData at line 416:", this.addressData);
// #ifdef APP-PLUS
@@ -635,6 +662,78 @@
...mapState(["userInfo"]),
},
methods: {
closeCoupon(){
this.showCouponPup = false
},
confirmCoupon(data){
console.log('选中的优惠券是',data);
if(data){
this.curCoupon = data
this.curCouponId = data.couponEntity.id
// this.getTotalPrice()
}else{
this.curCoupon = {}
this.curCouponId = undefined
}
this.getTotalPrice()
},
// 查询商品可用优惠券
async getActiveCouponList(){
console.log('this.goodsDataList',this.goodsDataList);
if(this.goodsDataList.length <= 0){
uni.showToast({
title:'商品参数错误,无法获取优惠券',
icon:'none'
})
return
}
var idsString = (this.goodsDataList.map( item => item.productId)).join(',')
console.log('idsString',idsString);
// var idsString = ''
this.$http
.request({
// url: "book/buyOrder/buySave",
url: 'common/coupon/getCouponListPayment',
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data:{
shopProductIds:idsString
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
if(res.code != 0){
uni.showToast({
title:res.errMsg,
icon:'none'
})
return
}
if (res.code == 0) {
console.log("可用优惠券列表", res);
res.couponHistoryList.forEach( item =>{
if(item.couponEntity.useLevel > this.totalPrice){
item.canUse = 0
item.canUseReason = "未到使用门槛"
}
})
this.couponHistoryList = res.couponHistoryList
}
this.$forceUpdate();
// await that.getDetailInfo();
}).catch(e=>{
console.log("可用优惠券列表报错", e);
uni.showToast({
title:e.errMsg,
icon:'none'
})
});
},
// 获得操作系统
getOS() {
let oprateOs = ''
@@ -668,9 +767,13 @@
// value = value.replace(/[^\d]/g, "");
this.jfNumber = Number(value);
this.jfNumberShow = this.jfNumber.toFixed(2);
}
this.actualPayment = this.totalPrice - this.jfNumber + this.freightNum;
}
var couponAmount = 0
if(this.curCouponId && this.curCoupon.couponEntity.id){
couponAmount = this.curCoupon.couponEntity.couponAmount
}
// that.actualPayment = that.actualPayment - that.couponAmount; // 减去优惠券的金额
this.actualPayment = this.totalPrice - couponAmount - this.jfNumber + this.freightNum;
if (this.actualPayment == 0) {
this.isDefaultCurrency = true;
@@ -702,6 +805,19 @@
},
// 获取订单初始话
async initPrepareOrder() {
if(this.options.isFudu){
this.priceBreakdownList = [{
text: "商品总价",
imgUrl: "",
type: 1,
},
{
text: "运费",
imgUrl: "",
type: 2,
}
];
}else{
this.priceBreakdownList = [{
text: "商品总价",
imgUrl: "",
@@ -712,7 +828,13 @@
imgUrl: "",
type: 2,
},
{
text: "优惠券",
imgUrl: "",
type: 3,
}
];
}
// this.goodsDataList
console.log("this.goodsDataList at line 595:", this.goodsDataList);
@@ -744,13 +866,12 @@
console.log("res at line 374:", res);
if (res.code == 0) {
this.initData = res.data;
this.isShowAddress = res.data.is_course ? false : true;
if (!this.isShowAddress) {
if (!this.isShowAddress && !this.options.isFudu) {
this.priceBreakdownList.push({
text: "积分",
imgUrl: require("@/static/icon/jifen.png"),
type: 3,
type: 4,
});
}
@@ -897,12 +1018,18 @@
} else {
that.jfNumberShow = that.jfNumber.toFixed(2);
that.actualPayment = that.totalPrice - that.jfNumber;
}
}
that.actualPayment = that.actualPayment + that.freightNum;
} else {
that.actualPayment = that.totalPrice + that.freightNum;
}
var couponAmount = 0
if(that.curCouponId && that.curCoupon.couponEntity.id){
couponAmount = that.curCoupon.couponEntity.couponAmount
}
console.log('couponAmount优惠券金额',couponAmount);
that.actualPayment = that.actualPayment - couponAmount; // 减去优惠券的金额
if (this.actualPayment == 0 && !this.isShowAddress) {
this.isDefaultCurrency = true;
} else {
@@ -978,47 +1105,61 @@
// productId: this.cartList[i].productId,
// quantity: this.cartList[i].productAmount,
// });
// }
if (this.options.goods[0].goodsType != "05") {
if (!this.addressData.id) {
this.$commonJS.showToast("请选择收货地址");
return false;
// }
console.log('99999999999',this.options);
let data = {}
if(this.options.isFudu){
console.log(888888888, this.goodsDataList.map((e) => e.productId +","+ e.productName ).join(','));
data = {
paymentMethod: this.payType, //支付方式 2支付宝1微信3ios内购 4天医币购买
orderMoney: this.totalPrice, //订单金额
realMoney: this.actualPayment, //实收金额
remark: this.goodsDataList.map((e) => e.productId +","+ e.productName ).join(','), //productId,商品名
come: "2",
};
}else{
if (this.options.goods[0].goodsType != "05") {
if (!this.addressData.id) {
this.$commonJS.showToast("请选择收货地址");
return false;
}
}
}
data = {
buyType: this.options.typeId, //0- 商品页直接下单 1- 购物车结算
userId: this.userInfo.id, //下单人ID
shippingUser: this.addressData ? this.addressData.consigneeName : "111", //收货人姓名
userPhone: this.addressData.consigneePhone, //收货人手机号
jfDeduction: this.jfNumber,
paymentMethod: this.payType, //支付方式 2支付宝1微信3ios内购 4天医币购买
orderMoney: this.totalPrice, //订单金额
realMoney: this.actualPayment, //实收金额
shippingMoney: this.freightNum, //运费
remark: this.remark, //备注
couponId: this.curCouponId ? this.curCoupon.id : null, //优惠券Id
// isSend: this.isSend,
couponName: this.curCouponId && this.curCoupon.id ? this.curCoupon.couponEntity.couponName : '', //优惠券名称
districtMoney: 0, //优惠金额
productList: this.goodsDataList.map((e) => {
return {
productId: e.productId,
quantity: 1,
};
}), //订单列表商品
orderType: "order", //订单类型
addressId: this.options.goods[0].goodsType != "05" ? this.addressData.id : 0, // 地址ID
appName: "wumen",
come: "2",
};
var productList = [...data.productList]
var thisproduct = productList.map(item => {
return item.productId+"_"+item.quantity
})
thisproduct = thisproduct.join(',')
}
let data = {
buyType: this.options.typeId, //0- 商品页直接下单 1- 购物车结算
userId: this.userInfo.id, //下单人ID
shippingUser: this.addressData ? this.addressData.consigneeName : "111", //收货人姓名
userPhone: this.addressData.consigneePhone, //收货人手机号
jfDeduction: this.jfNumber,
paymentMethod: this.payType, //支付方式 2支付宝1微信3ios内购 4天医币购买
orderMoney: this.totalPrice, //订单金额
realMoney: this.actualPayment, //实收金额
shippingMoney: this.freightNum, //运费
remark: this.remark, //备注
couponId: null, //优惠券Id
// isSend: this.isSend,
couponName: "", //优惠券名称
districtMoney: 0, //优惠金额
productList: this.goodsDataList.map((e) => {
return {
productId: e.productId,
quantity: 1,
};
}), //订单列表商品
orderType: "order", //订单类型
addressId: this.options.goods[0].goodsType != "05" ? this.addressData.id : 0, // 地址ID
appName: "wumen",
come: "2",
};
var productList = [...data.productList]
var thisproduct = productList.map(item => {
return item.productId+"_"+item.quantity
})
thisproduct = thisproduct.join(',')
console.log("data at line 477:", data);
console.log("data at line 477 提交后台的下单数据:", data);
// console.log('成功信息',product,thisproduct,data.addressId, data.realMoney);
if(this.historyOrderInfo &&
thisproduct == this.historyOrderInfo.product &&
@@ -1054,11 +1195,12 @@
})
// this.buyingFlag = false
console.log('进来请求了吗?');
let that = this
let that = this
await $http
.request({
// url: "book/buyOrder/buySave",
url: that.urlList.buyOrder,
url: that.options.isFudu ? that.urlList.renewPayment : that.urlList.buyOrder,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
@@ -1067,18 +1209,19 @@
},
})
.then(async (res) => {
that.buyingFlag = false
var product = data.productList.map(item => {
return item.productId+"_"+item.quantity
})
product = product.join(',')
that.historyOrderInfo = {
'product':product,
'addressId':data.addressId,
'realMoney':data.realMoney
}
console.log("res at line 598系统下单返回结果:", res);
that.buyingFlag = false
if(!that.options.isFudu){
var product = data.productList.map(item => {
return item.productId+"_"+item.quantity
})
product = product.join(',')
that.historyOrderInfo = {
'product':product,
'addressId':data.addressId,
'realMoney':data.realMoney
}
}
if (res.code == 0) {
if (res.orderSn == null) {
uni.showToast({

View File

@@ -7,10 +7,10 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<view class="setIcon" @click="goSetting">
<u-icon class="" labelColor="#258feb" labelPos="bottom" label="设置" name="setting"
<u-icon class="" labelColor="#258feb" labelPos="bottom" label="设置" name="setting"
:style="`top:${(10 + statusBarHeight) * 2}rpx`" color="#258feb" size="28"></u-icon>
</view>
<view class="bg_top flex_box flex_between">
<view class="per_mes">
<view class="per_mes_user">
@@ -19,7 +19,7 @@
class="per_mes_img color_shandow"></image>
<image src="@/static/icon/home_icon_logo.png" v-if="userMes.avatar == null"
class="per_mes_img color_shandow"></image>
</view>
</view>
<view class="user_vip_box ">
<view v-if="userMes.vip == 1" class="user_vip super">超级VIP</view>
<view v-if="userMes.vip == 3" class="user_vip">众妙之门VIP</view>
@@ -46,7 +46,7 @@
</view>
<br clear="both" />
</view>
</view>
<view class="mine_box" :style="`top:${(45 + statusBarHeight) * 2}rpx`">
@@ -145,6 +145,20 @@
userMes.jf ? userMes.jf : 0
}}</view>
</view>
<view class="chong_list_item" style="
display: flex;
align-items: center;
flex-direction: column;
justify-content: space-between;
" @click="onPageJump('/pages/mine/wallet/couponList')">
<view class="pay_item_img">
优惠券
</view>
<view class="text" style="line-height: 40rpx">{{
userCouponNum
}}</view>
</view>
</view>
<!-- v-if="iosHide" -->
@@ -268,6 +282,7 @@
signShow: false,
signContent: "是否要退出登录?",
playData: {},
userCouponNum:0, // 优惠券数量
directorShow: false, // 主任是否显示班级入口
monitorShow: false, // 其他管理是否显示班级入口
isAndorid: true,
@@ -335,10 +350,11 @@
...mapState(["userInfo"]),
},
//页面显示
onShow() {
async onShow() {
// console.log(this.userInfo, "11111111111111");
this.getData();
this.getUserRole()
await this.getUserCouponList()
// 隐藏原生的tabbar
// uni.hideTabBar();
},
@@ -348,6 +364,34 @@
//方法
methods: {
...mapMutations(["setUserInfo"]),
// 获取用户优惠券列表
async getUserCouponList(){
await this.$http
.request({
url: "common/coupon/getCouponHistoryList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"page":1,
"limit":10,
"getType":"",//获取类型 0 后台赠送 1 主动获取
"status":"0",//使用状态 0 未使用 1 已使用 2 已过期
"userInfo":"",//用户信息
"userId":this.userInfo.id
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
if(res.code != 0) return this.$commonJS.showToast(res.errMsg);
this.userCouponNum = res.couponList.total
}).catch(e => {
console.log(e);
this.$commonJS.showToast(e.errMsg);
})
},
openInfo() {
this.infoShow = true;
},
@@ -588,8 +632,11 @@
</script>
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.per_mes_user{display: block !important;}
.per_mes_user {
display: block !important;
}
.per_mes {
width: 100%;
position: relative;
@@ -898,14 +945,16 @@
overflow: hidden;
// position: relative;
}
.setIcon {
position: absolute;
right: 30rpx;
top: 70rpx;
z-index: 2;
}
.setIcon {
position: absolute;
right: 30rpx;
top: 70rpx;
z-index: 2;
}
.mine_box {
width: 100%;

View File

@@ -0,0 +1,297 @@
<template>
<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>
</view>
<!-- -->
<view class="tanchu">
<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>
</view>
<!-- <view style="font-size: 20rpx;color: #aaa;margin-top: 30rpx;">* 每笔订单只能使用一张优惠价</view> -->
</view>
<view class="" v-else>
<u-divider v-show="listStatus == 2" text="已加载全部"></u-divider>
<u-divider v-show="listStatus == 3" text="暂无数据"></u-divider>
<u-divider v-show="listStatus == 1" text="加载中..."></u-divider>
</view>
</view>
</view>
<z-navigation></z-navigation>
</view>
</template>
<script>
import $http from '@/config/requestConfig.js';
import {
mapState
} from "vuex";
export default {
data() {
return {
list:[], // 优惠券列表
listStatus:88,
curTagIndex:0, // 当前索引
tabList: [{
name: '未使用',
id: '0'
},
{
name: '已使用',
id: '1'
},
{
name: '已过期',
id: '2'
}
],
activeStyle:{
background:'#fff',
color:'#666',
padding:"10rpx",
borderRadius:"10rpx"
},
page:0,
limit:15,
status:0,
flag:false, // 请求标记
}
},
onLoad() {
this.page = 1
this.getUserCouponList()
},
async onReachBottom() {
console.log('触底',this.listStatus,this.flag);
if(this.listStatus != 1 && this.listStatus != 2){
if(!this.flag){
this.page++
await this.getUserCouponList()
}
}
},
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: {
async tabClick(e) {
console.log('e', e);
this.status = e.id
// this.curTagIndex = e.index
this.page = 0
this.page += 1
this.list = []
await this.getUserCouponList()
},
async getUserCouponList(){
console.log('进入函数了妈');
this.listStatus = 1
this.flag = true
uni.showLoading({
title:'加载中'
})
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
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.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)
if (res.couponList.pages > this.page) {
this.listStatus = 0
} else {
this.listStatus = 2
}
} else {
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);
})
},
}
}
</script>
<style lang="scss" scoped>
.btnBox {
margin-top: 20rpx;
}
.tanchu {
padding: 0 30rpx 40rpx 30rpx;
position: relative;
// max-height: 60vh;
// overflow-y: scroll;
.dp_title {
font-size: 32rpx;
margin-bottom: 50rpx;
color: #555;
text-align: center;
font-weight: bold;
}
.dp_add {
position: absolute;
top: 40rpx;
right: 30rpx;
font-size: 22rpx;
background-color: #fd6004;
color: #fff;
border-radius: 10rpx;
padding: 5rpx 10rpx;
.u-icon {
display: inline-block;
margin-right: 5rpx;
}
}
.addressItem {
border: 2px dashed #d9d9d9;
border-radius: 10rpx;
width: 100%;
display: flex;
padding: 20rpx 10rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
.addrContent {
margin-left: 40rpx;
flex: 1;
.addrContentTop {
display: flex;
align-items: flex-end;
margin: 0 0 15rpx 0;
position: relative;
.userName {
font-size: 35rpx;
font-weight: bold;
margin-right: 30rpx;
}
.userTel {
font-size: 25rpx;
color: #888;
}
.userMoren {
border: 1px solid #fd6004;
color: #fd6004;
padding: 3rpx 10rpx;
font-size: 22rpx;
border-radius: 10rpx;
margin: 0 0 0 20rpx;
}
.chooseCheck {
position: absolute;
top: 3rpx;
right: 6rpx;
}
}
.addrContentBottom {
font-size: 32rpx;
}
}
}
.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>

View File

@@ -343,7 +343,7 @@
</template>
<template
v-if="!item.reply && thisClass.state == '1'">
<text class="no" v-if="index+1<=currentStudyNumber">未提交答案 点击开始答题</text>
<text class="no" v-if="index+1 <= currentStudyNumber || currentStudyNumber == 0">未提交答案 点击开始答题</text>
<text class="no" v-else style="color: #a0a1a7;">暂未开始学习</text>
</template>
<template
@@ -1491,7 +1491,7 @@
})
return
}
if(index+1<=this.currentStudyNumber){
if(index+1<=this.currentStudyNumber || this.currentStudyNumber == 0){
uni.navigateTo({
url: `/pages/miniClass/taskDetail?id=${item.id}&classState=${this.thisClass.state}`
})

BIN
static/icon/fugou.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB