Merge branch 'coupon' of https://gitee.com/wjl2008_admin/medicine_app
This commit is contained in:
2
App.vue
2
App.vue
@@ -26,7 +26,7 @@
|
||||
onLaunch: function(e) {
|
||||
// 检测自动更新
|
||||
// #ifdef APP-PLUS
|
||||
updata();
|
||||
// updata();
|
||||
// #endif
|
||||
|
||||
uni.getSystemInfo({
|
||||
|
||||
267
components/orderCoupon.vue
Normal file
267
components/orderCoupon.vue
Normal 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>
|
||||
@@ -19,7 +19,8 @@ if (process.env.NODE_ENV === 'development') {
|
||||
// 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 = "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/";
|
||||
}
|
||||
|
||||
14
pages.json
14
pages.json
@@ -741,6 +741,20 @@
|
||||
{
|
||||
"navigationBarTitleText" : "我的证书"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/selfStudy/selfStudy",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "自考考试"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/mine/wallet/couponList",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "用户优惠券列表"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
||||
@@ -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"
|
||||
@@ -217,6 +234,12 @@
|
||||
</span>
|
||||
<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 &&
|
||||
|
||||
@@ -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,6 +899,8 @@ 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({
|
||||
|
||||
@@ -10,13 +10,14 @@
|
||||
<view class="item" v-for="(item,index) in certificateList" :key="index">
|
||||
<view class="flex_box flex_between align-items_box">
|
||||
<h3 style="font-size: 28rpx;">编号:{{item.certificateNo}}</h3>
|
||||
|
||||
<text style="font-size: 26rpx; color: #999;">获得时间:{{item.createTime.substring(0, 10)}}</text>
|
||||
</view>
|
||||
<view class="flex_box flex_center" v-if="item.certificateUrlList.length <= 0" >
|
||||
<text class="small_btn border_radius_10"
|
||||
style="display: block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff"
|
||||
v-if="item.certificateUrlList.length <= 0"
|
||||
@click="showSubmit(item.id)">立即获取证书</text>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="imgBox flex_box flex_between" v-if="item.certificateUrlList.length > 0">
|
||||
<view class="img" v-for="(item1,index1) in item.certificateUrlList" :key="index1">
|
||||
<image @click="preveImg(item1)" :src="item1" mode="heightFix"></image>
|
||||
@@ -243,7 +244,10 @@
|
||||
$http.request({
|
||||
url: "common/userCertificate/getUserCertificateList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {},
|
||||
data: {
|
||||
"type":"", //证书类型A a证 B b证 ZK自考
|
||||
"courseId":"" //课程id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -51,15 +51,13 @@
|
||||
<view :class="`${isHideCourseInfo ? 'hidden2' : ''}`"
|
||||
style="font-size: 30rpx; text-align: justify;" v-html="course.content">
|
||||
</view>
|
||||
<text @click="isHideCourseInfo = !isHideCourseInfo"
|
||||
style="
|
||||
<text @click="isHideCourseInfo = !isHideCourseInfo" style="
|
||||
position: absolute;
|
||||
background-color: #f2f8ff; padding: 4rpx ;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
color: #838588;
|
||||
"
|
||||
>
|
||||
">
|
||||
{{ isHideCourseInfo ? "展开" : "收起" }}
|
||||
</text>
|
||||
</view>
|
||||
@@ -68,24 +66,118 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- {{selfStudyCertificate.length}}-{{classInfo.id}}-{{classInfo.state}}- -->
|
||||
<!-- 自考入口 没有加入班级的时候暴漏入口-->
|
||||
<view class="selfStudyBox"
|
||||
v-if="course.canzk == '1' && librayList[curIndex] && (!classInfo.id || classInfo.state == '2' || selfStudyCertificate.length >= 0)">
|
||||
|
||||
<view style="padding: 20rpx;"
|
||||
v-if="selfStudyCertificate.length > 0 || selfStudyPaperList.length > 0 || selfStudyCertificate.length == 0 && (!classInfo.id || classInfo.state == '2')">
|
||||
|
||||
<view class="">
|
||||
<view class="" style="line-height: 40rpx; font-size: 28rpx;"
|
||||
v-if="selfStudyCertificate.length == 0">
|
||||
<text>课程学习进度大于等于70%时,您可以参与本门课程的自考考试,考试成绩大于60分即可获得本门课程的自考证书,如您想获得本门课程的A级或B级证书可参加小班教学</text>
|
||||
</view>
|
||||
<view :class="['testRecode',!zhedieTestRecode?'zhedie':'']"
|
||||
v-if="selfStudyPaperList.length > 0 && !testingPaper.id">
|
||||
<view class="item flex_box flex_between align-items_box"
|
||||
v-for="(item, index) in selfStudyPaperList" :key="index">
|
||||
<text style="color: #999; font-size: 26rpx;">第{{index + 1}}次自考成绩</text>
|
||||
<text class="score PM_font">{{item.score}}分</text>
|
||||
<view class="seePaper" @click.stop="seePaper(item.id)">
|
||||
<!-- <image
|
||||
src="../../static/icon/testPaperIcon.png"
|
||||
mode="widthFix"
|
||||
></image> -->
|
||||
查看试卷
|
||||
</view>
|
||||
</view>
|
||||
<view class="opbutn" v-if="selfStudyPaperList.length >= 3"
|
||||
@click="zhedieTestRecode = !zhedieTestRecode">
|
||||
{{zhedieTestRecode ? '收起' : '展开'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if="selfStudyCertificate.length > 0"
|
||||
style="font-size: 30rpx; text-align: center; margin: 20rpx 0;">
|
||||
<view class="congritulations">
|
||||
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="">
|
||||
<text>恭喜!您已通过自考考试获得本门课程的自考证书,如您想获得本门课程的A级或B级证书可参加小班教学</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class=" " style="margin-top: 20rpx; text-align: center;">
|
||||
|
||||
<!-- <view class=""> -->
|
||||
<!-- {{canJoinTestTime}} -->
|
||||
<!-- {{selfStudyPaperList.length % 2}} -->
|
||||
<template v-if="selfStudyCertificate.length <= 0 && (!classInfo.id || classInfo.state == '2')">
|
||||
|
||||
<template v-if="!testingPaper.id">
|
||||
<button @click="onPageJump('/pages/selfStudy/selfStudy',courseId)"
|
||||
style="padding: 0 20rpx" type="primary"
|
||||
v-if="canJoinTestTime && selfStudyPaperList.length % 2 == 0"
|
||||
:disabled="courseCompletion < 70 ">参加自考考试</button>
|
||||
|
||||
<button v-if="selfStudyPaperList.length % 2 != 0 && canJoinTestTime"
|
||||
@click="onPageJump('/pages/selfStudy/selfStudy',courseId)" style="padding: 0 20rpx"
|
||||
type="primary" :disabled="courseCompletion < 70">再考一次</button>
|
||||
<button v-if="!canJoinTestTime && showNextTestDate"
|
||||
@click="onPageJump('/pages/selfStudy/selfStudy',courseId)" style="padding: 0 20rpx"
|
||||
type="primary" :disabled="!canJoinTestTime">{{showNextTestDate.nextZKTime}}
|
||||
后可参与自考</button>
|
||||
</template>
|
||||
<button v-else @click="onPageJump('/pages/miniClass/continueTest',testingPaper.id)"
|
||||
style="padding: 0 20rpx" type="primary" :disabled="courseCompletion < 70">
|
||||
继续自考考试
|
||||
<template v-if="showCountDown" style="font-size: 26rpx;"> (剩余时间
|
||||
<uni-countdown style="display: inline-block; " @timeup="timeup" :font-size="20"
|
||||
:show-day="false" :hour="timeDif.hour" :minute="timeDif.minutes"
|
||||
:second="timeDif.second" color="#fff" splitorColor="#fff" />)
|
||||
</template>
|
||||
</button>
|
||||
</template>
|
||||
<button style="padding: 0 20rpx" v-if="selfStudyCertificate.length > 0" type="primary"
|
||||
@click="onPageJump('/pages/certificate/certificate')">查看证书</button>
|
||||
<!-- </view> -->
|
||||
<!-- <view class="" v-if="!classInfo.id">
|
||||
<button style="background-color: #00e1ec;" type="primary" size="mini">查看可加入的小班</button>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 小班入口 -->
|
||||
<view class="classEntrance" style="text-align: center;" v-if="classCertificate.length > 0 ">
|
||||
<view class="congritulations">
|
||||
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view style="margin: 10rpx 0;"><text>恭喜!您在小班学习中取得了本课程的{{classCertificate[0].type}}级证书</text></view>
|
||||
<button type="primary" style="background-color: #ffaa7f;"
|
||||
@click="onPageJump('/pages/certificate/certificate')">前往查看</button>
|
||||
</view>
|
||||
<template v-else>
|
||||
<view class="classEntrance" v-if="linkClassList.length > 0 ">
|
||||
<view class="flex_box" style="justify-content: space-between;">
|
||||
<view class="flex_box classTitleBox">
|
||||
<image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;"></image>
|
||||
<image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;">
|
||||
</image>
|
||||
<text class="mainTxt">
|
||||
<span style="font-weight: bold; padding: 0 16rpx;"></span>
|
||||
加入班级开始更加系统的学习</text>
|
||||
</view>
|
||||
<view class="btntext">
|
||||
<text @click="goClassLIst('/pages/miniClass/courseClassList', course.id,course.title)">前往查看 >></text>
|
||||
<text @click="goClassLIst('/pages/miniClass/courseClassList', course.id,course.title)">前往查看
|
||||
>></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="classEntrance" v-if="classInfo.id">
|
||||
<view class="flex_box" style="justify-content: space-between;">
|
||||
<view class="flex_box classTitleBox">
|
||||
<image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;"></image>
|
||||
<image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;">
|
||||
</image>
|
||||
<text class="mainTxt">
|
||||
<span style="font-weight: bold; padding: 0 16rpx;"></span>
|
||||
班级:{{classInfo.title}}</text>
|
||||
@@ -95,6 +187,18 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="classEntrance" v-if="linkClassList.length == 0 && !classInfo.id">
|
||||
<view class="flex_box" style="justify-content: space-between;">
|
||||
<view class="flex_box classTitleBox">
|
||||
<image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;">
|
||||
</image>
|
||||
<text class="mainTxt">
|
||||
<span style="font-weight: bold; padding: 0 16rpx;"></span>
|
||||
暂无可加入的小班</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="containerBg2">
|
||||
<!-- 目录 -->
|
||||
<view :class="['coursePart','flexbox', (userMsg.vip == 1 || userMsg.vip == 2) ? 'vipBgColor':'']"
|
||||
@@ -139,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" /> -->
|
||||
@@ -148,7 +256,8 @@
|
||||
</template>
|
||||
|
||||
<view class="shiting_content">
|
||||
<view :class="['chapter_content', (userMsg.vip == 1 || userMsg.vip == 2) ? 'vipchapter_content' : '']"
|
||||
<view
|
||||
:class="['chapter_content', (userMsg.vip == 1 || userMsg.vip == 2) ? 'vipchapter_content' : '']"
|
||||
v-if="chapterList.length > 0">
|
||||
<view class="vipSee" v-if="userMsg && (userMsg.vip == 1 || userMsg.vip == 2)">
|
||||
<text>VIP畅学权益生效中</text>
|
||||
@@ -195,7 +304,7 @@
|
||||
v-if="librayList.length > 0 && librayList[curIndex].completion > 0"> -->
|
||||
<!-- {{librayList[curIndex]}} -->
|
||||
<view class="progress-box">
|
||||
<progress v-if="librayList[curIndex]" :percent="librayList[curIndex].completion ? librayList[curIndex].completion : 0" show-info stroke-width="3" />
|
||||
<progress v-if="course.id" :percent="courseCompletion" show-info stroke-width="3" />
|
||||
</view>
|
||||
<!-- </uni-section> -->
|
||||
</view>
|
||||
@@ -350,14 +459,15 @@
|
||||
</view>
|
||||
<view class="sbmitBox">
|
||||
<button class="submit" @click="submitSay" type="default">发 布</button>
|
||||
<button style="background-color: #fff !important; color: ; " @click="sayclose" type="default">取 消</button>
|
||||
<button style="background-color: #fff !important; color: ; " @click="sayclose" type="default">取
|
||||
消</button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
</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();
|
||||
@@ -413,6 +523,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
zhedieTestRecode: false, // 是否折叠自考的记录
|
||||
goodsList: [],
|
||||
currentCateIndex: 0,
|
||||
protocolShow: false,
|
||||
@@ -516,11 +627,26 @@
|
||||
list: "sociology/course/getCourseDetail",
|
||||
goodsList: "sociology/product/getProductListForCourse",
|
||||
startStudyForMF: "sociology/course/startStudyForMF",
|
||||
newPayment:"common/courseRelearn/courseCatalogueCanRelearn", // 检查复读地址
|
||||
newPaymentList:"common/courseRelearn/relearnShopProductList", // 获取复读列表
|
||||
},
|
||||
isAndorid: true,
|
||||
oprateOsName: '',
|
||||
linkClassList: [], // 可加入关联班级数组
|
||||
classInfo:[] // 所在班级信息
|
||||
classInfo: [], // 所在班级信息
|
||||
selfStudyCertificate: [], // 自考证书
|
||||
classCertificate: [], // 小班学习证书
|
||||
testingPaper: {}, // 当前课程正在考试信息
|
||||
timeDif: {},
|
||||
showCountDown: false,
|
||||
showSecondTestBtn: false, // 先否显示二次考试按钮
|
||||
selfStudyPaperList: [], ///自考考试记录
|
||||
showNextTestDate: undefined,
|
||||
canJoinTestTime: false, //时间上是否可以参加自考考试
|
||||
courseCompletion: undefined, // 课程学习进度
|
||||
showNewPayBtn:false,
|
||||
newPaymentProList:[],
|
||||
isFudu:false, // 是否复读
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
@@ -536,8 +662,6 @@
|
||||
// await this.getData(e.id);
|
||||
this.getSayList();
|
||||
this.getOS()
|
||||
|
||||
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
@@ -555,12 +679,14 @@
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
console.log('this.courseId', this.courseId);
|
||||
this.canJoinTestTime = false
|
||||
await this.getData(this.courseId);
|
||||
// #ifdef APP-PLUS
|
||||
plus.screen.unlockOrientation();
|
||||
plus.screen.lockOrientation("portrait-primary");
|
||||
// #endif
|
||||
this.getLinkClassList()
|
||||
await this.request()
|
||||
|
||||
},
|
||||
onUnload() {
|
||||
this.selectGoodsData = {};
|
||||
@@ -577,7 +703,9 @@
|
||||
// this.showSearchList = false
|
||||
// this.searchList = []
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
async onPullDownRefresh() {
|
||||
await this.getData(this.courseId);
|
||||
await this.request()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
@@ -593,6 +721,227 @@
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
async request(){
|
||||
var newCertificate = await this.getCertificateInfo()
|
||||
console.log('5555555证书资料', newCertificate);
|
||||
this.selfStudyCertificate = []
|
||||
this.classCertificate = []
|
||||
if (newCertificate && newCertificate.length > 0) {
|
||||
newCertificate.forEach(item => {
|
||||
if (item.classId != '' && item.classId > 0) {
|
||||
this.classCertificate.push(item)
|
||||
} else {
|
||||
this.selfStudyCertificate.push(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
if(this.classCertificate.length <= 0){ // 已经在班级内获得证书就不再检查班级的情况了
|
||||
this.getLinkClassList()
|
||||
}
|
||||
var historyPaper = await this.getingPaper()
|
||||
console.log('historyPaper正在考试的信息', historyPaper);
|
||||
if (historyPaper && historyPaper.id && historyPaper.type == '2' && historyPaper.relationId == this
|
||||
.courseId) {
|
||||
// this.testingPaper = historyPaper
|
||||
this.testingPaper = historyPaper
|
||||
var paperEndTime = historyPaper.planEndTime
|
||||
var severNowTime = await this.getServerTime()
|
||||
if (severNowTime > -1 && paperEndTime - severNowTime > 0) {
|
||||
var secondTimeDif = paperEndTime - severNowTime
|
||||
this.timeDif.hour = parseInt((secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
|
||||
this.timeDif.minutes = parseInt((secondTimeDif % (1000 * 60 * 60)) / (1000 * 60));
|
||||
this.timeDif.second = (secondTimeDif % (1000 * 60)) / 1000
|
||||
this.showCountDown = true
|
||||
console.log('时间符合吗?', this.showCountDown, secondTimeDif);
|
||||
} else {
|
||||
this.showCountDown = false
|
||||
}
|
||||
}else{
|
||||
this.testingPaper = {}
|
||||
this.showCountDown = false
|
||||
}
|
||||
if(this.course.canzk == '0'){ // 如果没有开启自考,就不走自考相关的逻辑
|
||||
console.log('没有打开自考开关');
|
||||
return
|
||||
}
|
||||
var selfStudyPaperList = await this.getSelfStudyPaperList()
|
||||
this.selfStudyPaperList = selfStudyPaperList
|
||||
console.log('selfStudyPaperList', selfStudyPaperList);
|
||||
if (this.selfStudyCertificate.length <= 0) { // 没有获得自考证书时查询下次可以自考的时间
|
||||
if (selfStudyPaperList && selfStudyPaperList.length <= 2) {
|
||||
this.canJoinTestTime = true
|
||||
}
|
||||
if (selfStudyPaperList && selfStudyPaperList.length >= 2) {
|
||||
if(selfStudyPaperList.length % 2 != 0){
|
||||
this.canJoinTestTime = true
|
||||
return
|
||||
}
|
||||
this.showNextTestDate = await this.getNextTestDate()
|
||||
console.log('下次考试时间', this.showNextTestDate);
|
||||
if (this.showNextTestDate.nextLongTime == null || this.showNextTestDate.nextLongTime == null) {
|
||||
this.canJoinTestTime = false
|
||||
}
|
||||
var now = new Date()
|
||||
if (this.showNextTestDate.nextLongTime < now) {
|
||||
this.canJoinTestTime = true
|
||||
} else {
|
||||
this.canJoinTestTime = false
|
||||
}
|
||||
}
|
||||
if (selfStudyPaperList && selfStudyPaperList.length > 0) {
|
||||
selfStudyPaperList.forEach((item, index) => {
|
||||
if (item.score < 60 && index % 2 != 0) {
|
||||
this.showSecondTestBtn = true
|
||||
} else {
|
||||
this.showSecondTestBtn = false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
// 查询下次可以考试的时间
|
||||
async getNextTestDate() {
|
||||
var time = {
|
||||
nextLongTime: 0,
|
||||
nextZKTime: ''
|
||||
}
|
||||
await $http.request({
|
||||
url: "common/classExam/getNextZKTime",
|
||||
method: "POST",
|
||||
data: {
|
||||
"courseId": parseInt(this.courseId)
|
||||
},
|
||||
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);
|
||||
time.nextZKTime = res.nextZKTime
|
||||
time.nextLongTime = res.nextLongTime
|
||||
}
|
||||
}).catch(e => {
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
});
|
||||
return time
|
||||
},
|
||||
seePaper(val) {
|
||||
// console.log('点击了');
|
||||
uni.navigateTo({
|
||||
url: `/pages/miniClass/paperBack?id=${val}`,
|
||||
});
|
||||
},
|
||||
async timeup() {
|
||||
this.showCountDown = false
|
||||
setTimeout(async () => {
|
||||
var selfStudyPaperList = await this.getSelfStudyPaperList()
|
||||
this.selfStudyPaperList = selfStudyPaperList
|
||||
console.log('selfStudyPaperList', selfStudyPaperList);
|
||||
if (selfStudyPaperList && selfStudyPaperList.length > 0) {
|
||||
selfStudyPaperList.forEach((item, index) => {
|
||||
if (item.score < 60 && index < 2) {
|
||||
this.showSecondTestBtn = true
|
||||
} else {
|
||||
this.showSecondTestBtn = false
|
||||
}
|
||||
})
|
||||
}
|
||||
}, 3000)
|
||||
},
|
||||
// 获取自考试卷列表
|
||||
async getSelfStudyPaperList() {
|
||||
var list = undefined
|
||||
await $http.request({
|
||||
url: "common/classExam/getZKExamPaperList",
|
||||
method: "POST",
|
||||
data: {
|
||||
"courseId": parseInt(this.courseId)
|
||||
},
|
||||
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);
|
||||
list = res.ZKExamUserList
|
||||
}
|
||||
}).catch(e => {
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
});
|
||||
return list
|
||||
},
|
||||
// 获取服务器时间
|
||||
async getServerTime() {
|
||||
var time = 0
|
||||
await $http.request({
|
||||
url: "common/classExam/getServerTime",
|
||||
method: "POST",
|
||||
data: {},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.code == 0) {
|
||||
time = res.serverTime
|
||||
} else {
|
||||
time = -1
|
||||
}
|
||||
}).catch(e => {
|
||||
time = -1
|
||||
});
|
||||
return time
|
||||
},
|
||||
// 获取进行中的考试
|
||||
async getingPaper() {
|
||||
var obj = undefined
|
||||
await $http.request({
|
||||
url: "common/classExam/examingPaper",
|
||||
method: "POST",
|
||||
data: {},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
console.log('考试中', res);
|
||||
if (res.code == 0 && res.classExamUser != null) {
|
||||
obj = {
|
||||
...res.classExamUser,
|
||||
planEndTime: res.planEndTime
|
||||
}
|
||||
} else {
|
||||
obj = undefined
|
||||
}
|
||||
}).catch(e => {
|
||||
obj = undefined
|
||||
});
|
||||
return obj
|
||||
|
||||
},
|
||||
// 获得课程关联的班级
|
||||
getLinkClassList() {
|
||||
this.$http
|
||||
@@ -612,6 +961,7 @@
|
||||
.then(async (res) => {
|
||||
if (res.code == 0 && res.result.length > 0) {
|
||||
this.linkClassList = res.result
|
||||
this.classInfo = {}
|
||||
} else {
|
||||
this.linkClassList = []
|
||||
// 查询是否有所在的班级
|
||||
@@ -767,6 +1117,7 @@
|
||||
typeId: 0,
|
||||
navTitle: this.course.title,
|
||||
title: this.course.title,
|
||||
isFudu: this.isFudu
|
||||
// sourceType: "curriculum",
|
||||
}); // 这里转换成 字符串
|
||||
uni.navigateTo({
|
||||
@@ -778,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);
|
||||
@@ -799,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();
|
||||
@@ -812,6 +1226,11 @@
|
||||
showCancel: false
|
||||
})
|
||||
} else {
|
||||
this.getCourseDescriptionData(v);
|
||||
}
|
||||
},
|
||||
getCourseDescriptionData(v){
|
||||
this.isFudu = false
|
||||
this.$http
|
||||
.request({
|
||||
url: this.urlList.goodsList,
|
||||
@@ -836,7 +1255,6 @@
|
||||
|
||||
this.$forceUpdate();
|
||||
})
|
||||
}
|
||||
},
|
||||
getUserInfo() {
|
||||
this.$http.post("common/user/getUserInfo").then((res) => {
|
||||
@@ -1252,7 +1670,9 @@
|
||||
this.courseList = [];
|
||||
// console.log("at line 1167:", "调用了几次");
|
||||
var that = this;
|
||||
|
||||
uni.showLoading({
|
||||
title:'获取课程信息'
|
||||
})
|
||||
await $http
|
||||
.request({
|
||||
url: "sociology/course/getCourseDetail",
|
||||
@@ -1266,6 +1686,14 @@
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
uni.hideLoading()
|
||||
if(res.code != 0) {
|
||||
uni.showToast({
|
||||
title:res.errMsg,
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (res.code == 0) {
|
||||
this.course = res.data.course;
|
||||
//0 购买 1 续费 2 升级
|
||||
@@ -1302,6 +1730,22 @@
|
||||
this.pageTitle = this.course.title;
|
||||
this.librayList = [...res.data.catalogues];
|
||||
console.log('获取课程详情=》', res.data);
|
||||
if (this.librayList.length > 0) {
|
||||
var ll = this.librayList.map(item => item.completion)
|
||||
var sums = 0
|
||||
ll.forEach(item => {
|
||||
sums += item
|
||||
})
|
||||
if (sums > 0) {
|
||||
this.courseCompletion = (sums / ll.length).toFixed(2)
|
||||
} else {
|
||||
this.courseCompletion = 0
|
||||
}
|
||||
|
||||
} else {
|
||||
this.courseCompletion = 0
|
||||
}
|
||||
console.log('lllllll', this.courseCompletion);
|
||||
that.$forceUpdate();
|
||||
if (this.librayList.length > 0) {
|
||||
if (this.catalogueId) {
|
||||
@@ -1317,9 +1761,10 @@
|
||||
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 &&
|
||||
@@ -1334,14 +1779,8 @@
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e, "获取目录数据报错");
|
||||
// if(e.statusCode == 0){
|
||||
// uni.showToast({
|
||||
// title:'获取课程信息失败,请稍后尝试',
|
||||
// icon:'none',
|
||||
// duration: 5000
|
||||
// })
|
||||
// }
|
||||
uni.hideLoading()
|
||||
console.log(e, "获取课程数据报错666");
|
||||
});
|
||||
},
|
||||
goBuy() {
|
||||
@@ -1417,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;
|
||||
@@ -1450,7 +1916,6 @@
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.code == 0 && res.chapterList.length > 0) {
|
||||
|
||||
list = res.chapterList;
|
||||
// console.log("方法里面得到的章节列表:", list);
|
||||
} else {
|
||||
@@ -1467,6 +1932,49 @@
|
||||
url: `${url}?id=${id}`,
|
||||
});
|
||||
},
|
||||
// 查询证书情况
|
||||
async getCertificateInfo() {
|
||||
var list = undefined
|
||||
await $http.request({
|
||||
url: "common/userCertificate/getUserCertificateList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"type": '', //证书类型A a证 B b证 ZK自考
|
||||
"courseId": this.courseId //课程id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code != 0) {
|
||||
uni.showToast({
|
||||
title: res.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (res.code == 0) {
|
||||
res.certificateList.forEach(item => {
|
||||
item.certificateUrl && item.certificateUrl != '' ? item
|
||||
.certificateUrlList = item.certificateUrl.split(',') : item
|
||||
.certificateUrlList = []
|
||||
})
|
||||
list = res.certificateList
|
||||
}
|
||||
console.log('证书接口请求结果', res);
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
});
|
||||
return list
|
||||
},
|
||||
goClassLIst(url, id, title) {
|
||||
uni.navigateTo({
|
||||
url: `${url}?courseId=${id}&courseTitle=${title}`,
|
||||
@@ -1477,26 +1985,65 @@
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "@/style/mixin.scss";
|
||||
.classEntrance{background-color: #d0ecc1; padding:20rpx;
|
||||
.congritulations {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
text-align: center;
|
||||
margin: 10rpx auto;
|
||||
display: block;
|
||||
image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.selfStudyBox {
|
||||
position: relative;
|
||||
background-color: #fff0e7;
|
||||
}
|
||||
|
||||
.classEntrance {
|
||||
background-color: #d0ecc1;
|
||||
padding: 20rpx;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
.flex_box{align-items: center;}
|
||||
|
||||
.flex_box {
|
||||
align-items: center;
|
||||
}
|
||||
.btntext{color: $themeColor; }
|
||||
.classTitleBox{font-size: 28rpx; flex: 1;
|
||||
.mainTxt{font-size: 30rpx; flex: 1; padding-left: 10rpx;}
|
||||
}
|
||||
.completionBg { padding: 10rpx 0;
|
||||
background-color: #fff; border-bottom: 1px solid #eee;
|
||||
|
||||
.btntext {
|
||||
color: $themeColor;
|
||||
}
|
||||
|
||||
.classTitleBox {
|
||||
font-size: 28rpx;
|
||||
flex: 1;
|
||||
|
||||
.mainTxt {
|
||||
font-size: 30rpx;
|
||||
flex: 1;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.completionBg {
|
||||
padding: 10rpx 0;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.endBox {
|
||||
// @include theme("vipbtnbg");
|
||||
color: #333;
|
||||
font-size: 26rpx;
|
||||
// margin: 20rpx 0;
|
||||
padding: 10rpx 20rpx;
|
||||
|
||||
.box {
|
||||
// background-color: #258feb;
|
||||
}
|
||||
|
||||
.flexbox {
|
||||
justify-content: space-between;
|
||||
}
|
||||
@@ -1552,9 +2099,15 @@
|
||||
// height: 100rpx !important;}
|
||||
}
|
||||
|
||||
.img{ width: 60rpx;
|
||||
.img {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
image{width:60rpx; height: 60rpx; border-radius: 100%;}
|
||||
|
||||
image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1595,7 +2148,9 @@
|
||||
}
|
||||
|
||||
.xufeiBtn {
|
||||
display: block; line-height: 50rpx; height: 50rpx;
|
||||
display: block;
|
||||
line-height: 50rpx;
|
||||
height: 50rpx;
|
||||
padding: 0 10rpx;
|
||||
border: 1px solid #333;
|
||||
border-radius: 10rpx;
|
||||
@@ -2185,7 +2740,12 @@
|
||||
// margin-bottom: 10rpx;
|
||||
|
||||
}
|
||||
::v-deep .prof img{ width: 100px; height: 100px;}
|
||||
|
||||
::v-deep .prof img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.catalogueTitle {
|
||||
justify-content: space-between;
|
||||
overflow: hidden;
|
||||
@@ -2310,7 +2870,11 @@
|
||||
/deep/.u-icon__icon--warning {
|
||||
color: #fff !important;
|
||||
}
|
||||
/deep/.uni-tag{border-width: 2rpx !important;}
|
||||
|
||||
/deep/.uni-tag {
|
||||
border-width: 2rpx !important;
|
||||
}
|
||||
|
||||
/deep/.uni-section {
|
||||
background: transparent !important;
|
||||
}
|
||||
@@ -2465,7 +3029,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.hidden2{line-height: 50rpx; height: 100rpx;}
|
||||
|
||||
.hidden2 {
|
||||
line-height: 50rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
.subLine {
|
||||
* {
|
||||
display: inline !important;
|
||||
@@ -2612,4 +3181,57 @@
|
||||
padding: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.testRecode {
|
||||
position: relative;
|
||||
margin-top: 20rpx;
|
||||
background-color: rgba(255, 255, 255, .8);
|
||||
padding: 20rpx;
|
||||
// padding-bottom: 30rpx;
|
||||
.item {
|
||||
margin-bottom: 20rpx;
|
||||
border-bottom: 1px solid #e1e1e1;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
.item:last-child {
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.score {
|
||||
color: #35a6ff;
|
||||
font-size: 46rpx;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
.opbutn {
|
||||
position: absolute;
|
||||
padding-bottom: 0;
|
||||
width: 100rpx;
|
||||
text-align: center;
|
||||
font-size: 26rpx; border-radius: 10rpx 10rpx 0 0;
|
||||
color: #fff; background-color: #aaaaff;
|
||||
bottom: 0;
|
||||
left: calc(50vw - 50rpx);
|
||||
z-index: 1;
|
||||
}
|
||||
.testRecode.zhedie {
|
||||
max-height: 280rpx;
|
||||
// padding-bottom: 30rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.seePaper {
|
||||
color: #35a6ff;
|
||||
font-size: 32rpx;
|
||||
// width: 50rpx;
|
||||
// height: 50rpx;
|
||||
|
||||
// image {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// }
|
||||
}
|
||||
</style>
|
||||
@@ -21,7 +21,7 @@
|
||||
<uni-collapse-item v-for="(item,index) in courseList" :key="index" :title="item.courseMedicine.title"
|
||||
:thumb="item.courseMedicine.icon">
|
||||
<view class="content" v-show="item.courseList.length > 1" style="padding:20rpx;">
|
||||
<view :class="['courseItemleve1',userMsg.vip != 0 ? 'isVip' :'']"
|
||||
<view :class="['courseItemleve1',(userMsg.vip != 0 && userMsg.vip != 3) ? 'isVip' :'']"
|
||||
v-for="(item1, index1) in item.courseList" :key="index1"
|
||||
@click="onPageJump('/pages/course/courseDetail',item1.id)">
|
||||
<view class="vipSee" v-if="userMsg.vip != 0 && userMsg.vip != 3">
|
||||
@@ -31,8 +31,9 @@
|
||||
size="24"></u-icon><text style="font-size: 32rpx;">{{item1.title}}</text>
|
||||
</view>
|
||||
<template v-if="item1.courseCatalogueEntityList && item1.courseCatalogueEntityList.length > 0">
|
||||
|
||||
<view class="" v-for="(item2, index2) in item1.courseCatalogueEntityList" :key="index2">
|
||||
<view :class="['priceItem', item2.isBuy == 1 && userMsg.vip == 0 ? 'isBuy' : '']">
|
||||
<view :class="['priceItem', item2.isBuy == 1 && (userMsg.vip == 0 || userMsg.vip == 3) ? 'isBuy' : '']">
|
||||
<text class="text mname" v-if="item1.courseCatalogueEntityList.length > 1"
|
||||
style="font-weight: bold; margin-right: 10rpx;">【{{item2.title}}】</text>
|
||||
<view class="pbox flexbox">
|
||||
@@ -40,11 +41,13 @@
|
||||
height: 40rpx; text-align: center; line-height: 40rpx; color: #ffb861;">V</text>
|
||||
<text class="text">半年:¥{{item2.halfFee}} 元</text><text class="text"
|
||||
style="margin-left: 20rpx;">整年:¥{{item2.fee}} 元</text>
|
||||
<!-- <pre>
|
||||
{{userMsg}}-{{item2.isBuy}}
|
||||
</pre> -->
|
||||
<text class="buybtns" @click.stop="goBuy(item2)"
|
||||
v-if="item2.isBuy == 0 && userMsg.vip == 0">立即购买</text>
|
||||
v-if="item2.isBuy == 0 && (userMsg.vip == 0 || userMsg.vip == 3)">立即购买</text>
|
||||
</view>
|
||||
<i class="haveBuy" v-if="item2.isBuy == 1 && userMsg.vip == 0">已购买</i>
|
||||
|
||||
<i class="haveBuy" v-if="item2.isBuy == 1 && (userMsg.vip == 0 || userMsg.vip == 3)">已购买</i>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -4,29 +4,13 @@
|
||||
<public-module></public-module>
|
||||
<z-nav-bar title="商品详情" bgColor="#258feb" fontColor="#fff"></z-nav-bar>
|
||||
|
||||
<view
|
||||
class="contentBox commonPageContentBox"
|
||||
v-if="!this.$store.state.loadingShow"
|
||||
>
|
||||
<view class="contentBox commonPageContentBox" v-if="!this.$store.state.loadingShow">
|
||||
<!-- :indicator-dots="true" -->
|
||||
<swiper
|
||||
:autoplay="true"
|
||||
:interval="3000"
|
||||
:duration="1000"
|
||||
style="width: 100%; height: 750rpx; background-color: #f5f5f5"
|
||||
>
|
||||
<swiper-item
|
||||
v-for="(item, index) in swiperList"
|
||||
:key="index"
|
||||
style="width: 100%; height: 100%"
|
||||
>
|
||||
<swiper :autoplay="true" :interval="3000" :duration="1000"
|
||||
style="width: 100%; height: 750rpx; background-color: #f5f5f5">
|
||||
<swiper-item v-for="(item, index) in swiperList" :key="index" style="width: 100%; height: 100%">
|
||||
<!-- <image :src="curriculumData.explainsImg" mode="widthFix" class="headImage"></image> -->
|
||||
<image
|
||||
:src="item"
|
||||
mode="aspectFit"
|
||||
style="width: 100%; height: 100%"
|
||||
@click="previewImage(item)"
|
||||
>
|
||||
<image :src="item" mode="aspectFit" style="width: 100%; height: 100%" @click="previewImage(item)">
|
||||
</image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
@@ -36,17 +20,14 @@
|
||||
<view v-if="this.options.isMiaosha==1" class="miaosha_box">
|
||||
<view class="price_box">
|
||||
<view class="price_left">
|
||||
<template
|
||||
v-if="
|
||||
<template v-if="
|
||||
curriculumData.activityPrice &&
|
||||
curriculumData.activityPrice > 0
|
||||
"
|
||||
>
|
||||
">
|
||||
<text class="aui-text-danger price">
|
||||
¥{{ curriculumData.activityPrice }}
|
||||
</text>
|
||||
<text class="price original_price"
|
||||
>原价:¥{{ curriculumData.price }}
|
||||
<text class="price original_price">原价:¥{{ curriculumData.price }}
|
||||
</text>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -55,8 +36,7 @@
|
||||
</text>
|
||||
</template>
|
||||
|
||||
<view class="price original_price sales_number"
|
||||
>已售 {{ curriculumData.sumSales }}件
|
||||
<view class="price original_price sales_number">已售 {{ curriculumData.sumSales }}件
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -72,23 +52,19 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="curriulum_title"
|
||||
>{{ curriculumData.productName }}
|
||||
<view class="curriulum_title">{{ curriculumData.productName }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="normal_box">
|
||||
<view class="price_box">
|
||||
<template
|
||||
v-if="
|
||||
<template v-if="
|
||||
curriculumData.activityPrice &&
|
||||
curriculumData.activityPrice > 0
|
||||
"
|
||||
>
|
||||
">
|
||||
<text class="aui-text-danger price">
|
||||
¥{{ curriculumData.activityPrice }}
|
||||
</text>
|
||||
<text class="price original_price"
|
||||
>原价:¥{{ curriculumData.price }}
|
||||
<text class="price original_price">原价:¥{{ curriculumData.price }}
|
||||
</text>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -96,15 +72,12 @@
|
||||
¥{{ curriculumData.price }}
|
||||
</text>
|
||||
</template>
|
||||
<text
|
||||
class="price original_price sales_number"
|
||||
style="float: right"
|
||||
>已售 {{ curriculumData.sumSales }}件
|
||||
<text class="price original_price sales_number" style="float: right">已售
|
||||
{{ curriculumData.sumSales }}件
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class="curriulum_title" style="margin-top: 40rpx;"
|
||||
>{{ curriculumData.productName }}
|
||||
<view class="curriulum_title" style="margin-top: 40rpx;">{{ curriculumData.productName }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -113,89 +86,35 @@
|
||||
</view>
|
||||
|
||||
<template>
|
||||
<common-sticky
|
||||
label="title"
|
||||
:itemStyle="`width:${
|
||||
<common-sticky label="title" :itemStyle="`width:${
|
||||
cateList.length == 2 ? '50' : '33'
|
||||
}%;padding-left: 15px; padding-right: 15px; height: 68rpx;`"
|
||||
:list="cateList"
|
||||
:currentCateIndex="currentCateIndex"
|
||||
@handleselectCate="handleselectCate"
|
||||
>
|
||||
}%;padding-left: 15px; padding-right: 15px; height: 68rpx;`" :list="cateList"
|
||||
:currentCateIndex="currentCateIndex" @handleselectCate="handleselectCate">
|
||||
</common-sticky>
|
||||
</template>
|
||||
|
||||
<!-- <view :class="`priceDetail`" v-if="this.statusList[this.currentStatusIndex].type == 'price'">
|
||||
|
||||
<scroll-view scroll-y="true" class="scroll-Y">
|
||||
<price ref="priceDetail" type="price" :oid="this.statusList[this.currentStatusIndex].oid"></price>
|
||||
|
||||
</scroll-view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
<view :class="`priceDetail`" v-else-if="this.statusList[this.currentStatusIndex].type == 'purchaseNotice'">
|
||||
|
||||
<scroll-view scroll-y="true" class="scroll-Y">
|
||||
<price ref="purchaseNotice" :oid="this.statusList[this.currentStatusIndex].oid"></price>
|
||||
|
||||
</scroll-view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
-->
|
||||
|
||||
<view :class="`dataList `">
|
||||
<view
|
||||
class="goods_detail_list_title bg_box_shandow color_shandow bg_color PM_font"
|
||||
style="background-color: #C7E9FB"
|
||||
>
|
||||
<view class="goods_detail_list_title bg_box_shandow color_shandow bg_color PM_font"
|
||||
style="background-color: #C7E9FB">
|
||||
<view class="left" style="color: #258feb;">
|
||||
<u-icon
|
||||
name="grid"
|
||||
color="#258feb"
|
||||
size="23"
|
||||
style="display: inline-block; margin-right: 10rpx"
|
||||
></u-icon>
|
||||
商品规格</view
|
||||
>
|
||||
|
||||
<text class="right" @click="openPopup"
|
||||
>共{{ goodsList.length }}种商品可选择</text
|
||||
>
|
||||
<u-icon name="grid" color="#258feb" size="23"
|
||||
style="display: inline-block; margin-right: 10rpx"></u-icon>
|
||||
商品规格
|
||||
</view>
|
||||
<common-goods-list
|
||||
imgUrl="url"
|
||||
isNoIcon
|
||||
imgMode="aspectFit"
|
||||
class="color_shandow"
|
||||
defaultUrl=""
|
||||
:isCondition="true"
|
||||
:dataList="goodsList"
|
||||
@hancleClick="selectGoods"
|
||||
label="title"
|
||||
>
|
||||
|
||||
<text class="right" @click="openPopup">共{{ goodsList.length }}种商品可选择</text>
|
||||
</view>
|
||||
<common-goods-list imgUrl="url" isNoIcon imgMode="aspectFit" class="color_shandow" defaultUrl=""
|
||||
:isCondition="true" :dataList="goodsList" @hancleClick="selectGoods" label="title">
|
||||
<template slot="labelSlot" slot-scope="slotProps">
|
||||
<!-- isSelectGoods -->
|
||||
<view
|
||||
class="related_courses_name goodsList"
|
||||
:class="`goods_item ${
|
||||
<view class="related_courses_name goodsList" :class="`goods_item ${
|
||||
selectGoodsData &&
|
||||
selectGoodsData.productId == slotProps.row.productId
|
||||
? ''
|
||||
: ''
|
||||
}`"
|
||||
>
|
||||
}`">
|
||||
<view class="image_box">
|
||||
<image
|
||||
:src="slotProps.row.productImages"
|
||||
mode="aspectFit"
|
||||
class="goods_image"
|
||||
></image>
|
||||
<image :src="slotProps.row.productImages" mode="aspectFit" class="goods_image"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -233,39 +152,21 @@
|
||||
</common-goods-list>
|
||||
</view>
|
||||
<view :class="`dataList parameterList`" v-if="booksList.length > 0">
|
||||
<view
|
||||
class="goods_detail_list_title bg_box_shandow color_shandow bg_color PM_font"
|
||||
>
|
||||
<view class="goods_detail_list_title bg_box_shandow color_shandow bg_color PM_font">
|
||||
<view class="left" style="color:#3C77BE !important">
|
||||
<u-icon
|
||||
name="list"
|
||||
color="#3C77BE"
|
||||
size="23"
|
||||
style="display: inline-block; margin-right: 10rpx"
|
||||
></u-icon>
|
||||
书籍信息</view
|
||||
>
|
||||
<u-icon name="list" color="#3C77BE" size="23"
|
||||
style="display: inline-block; margin-right: 10rpx"></u-icon>
|
||||
书籍信息
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<common-list
|
||||
imgUrl="url"
|
||||
isNoIcon
|
||||
imgMode="aspectFit"
|
||||
class="color_shandow parameter_box book_box"
|
||||
defaultUrl=""
|
||||
:isCondition="true"
|
||||
:dataList="booksList"
|
||||
label="title"
|
||||
>
|
||||
<common-list imgUrl="url" isNoIcon imgMode="aspectFit" class="color_shandow parameter_box book_box"
|
||||
defaultUrl="" :isCondition="true" :dataList="booksList" label="title">
|
||||
<template slot="labelSlot" slot-scope="slotProps">
|
||||
<!-- isSelectGoods -->
|
||||
<view class="related_courses_name" :class="`goods_item `">
|
||||
<view class="image_box" style="margin-right: 10rpx">
|
||||
<image
|
||||
:src="slotProps.row.images"
|
||||
mode="aspectFit"
|
||||
class="goods_image"
|
||||
></image>
|
||||
<image :src="slotProps.row.images" mode="aspectFit" class="goods_image"></image>
|
||||
</view>
|
||||
<view :class="`goods_info `">
|
||||
<view class="name">
|
||||
@@ -279,39 +180,21 @@
|
||||
</common-list>
|
||||
</view>
|
||||
<view :class="`dataList parameterList`" v-if="coursesList.length > 0">
|
||||
<view
|
||||
class="goods_detail_list_title bg_box_shandow color_shandow bg_color PM_font"
|
||||
>
|
||||
<view class="goods_detail_list_title bg_box_shandow color_shandow bg_color PM_font">
|
||||
<view class="left" style="color: #018f89 !important">
|
||||
<u-icon
|
||||
name="list"
|
||||
color="#018F89"
|
||||
size="23"
|
||||
style="display: inline-block; margin-right: 10rpx"
|
||||
></u-icon>
|
||||
课程信息</view
|
||||
>
|
||||
<u-icon name="list" color="#018F89" size="23"
|
||||
style="display: inline-block; margin-right: 10rpx"></u-icon>
|
||||
课程信息
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<common-list
|
||||
imgUrl="url"
|
||||
isNoIcon
|
||||
imgMode="aspectFit"
|
||||
class="color_shandow parameter_box"
|
||||
defaultUrl=""
|
||||
:isCondition="true"
|
||||
:dataList="coursesList"
|
||||
label="title"
|
||||
>
|
||||
<common-list imgUrl="url" isNoIcon imgMode="aspectFit" class="color_shandow parameter_box" defaultUrl=""
|
||||
:isCondition="true" :dataList="coursesList" label="title">
|
||||
<template slot="labelSlot" slot-scope="slotProps">
|
||||
<!-- isSelectGoods -->
|
||||
<view class="related_courses_name" :class="`goods_item `">
|
||||
<view class="image_box" style="margin-right: 10rpx">
|
||||
<image
|
||||
:src="slotProps.row.images"
|
||||
mode="aspectFit"
|
||||
class="goods_image"
|
||||
></image>
|
||||
<image :src="slotProps.row.images" mode="aspectFit" class="goods_image"></image>
|
||||
</view>
|
||||
<view :class="`goods_info `">
|
||||
<view class="name">
|
||||
@@ -324,42 +207,49 @@
|
||||
</template>
|
||||
</common-list>
|
||||
</view>
|
||||
<template v-if="canGetCouponList.length > 0">
|
||||
<u-divider text="购买本商品赠送如下优惠券" :hairline="true" textColor="#333" lineColor="#b0b0b0"></u-divider>
|
||||
<view class="tanchu">
|
||||
<view class="listBox" >
|
||||
<view style="max-height: 40vh;overflow-y: scroll;" :class="'youhuiItem'"
|
||||
v-for="(item,index) in canGetCouponList" :key="index">
|
||||
<view style="width: 25%;color:#fd6004;text-align: center;">
|
||||
<text>¥</text>
|
||||
<b style="font-size: 60rpx;">{{item.couponEntity.couponAmount}}</b>
|
||||
</view>
|
||||
<view style="width: 68%;padding-left: 5%;">
|
||||
<view>
|
||||
<text
|
||||
style="display: inline-block; font-size: 30rpx; margin-right: 6rpx; color:rgb(253, 96, 4);">{{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: 4rpx;">说明:{{item.couponEntity.remark}}</text>
|
||||
|
||||
<u-divider
|
||||
text="商品参数"
|
||||
:hairline="true"
|
||||
textColor="#333"
|
||||
lineColor="#b0b0b0"
|
||||
></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view style="font-size: 20rpx;color: #aaa;margin-top: 30rpx;">* 每笔订单只能使用一张优惠价</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<u-divider text="商品参数" :hairline="true" textColor="#333" lineColor="#b0b0b0"></u-divider>
|
||||
<view class="parameter_info_box">
|
||||
<common-list
|
||||
imgUrl="url"
|
||||
isNoIcon
|
||||
imgMode="aspectFit"
|
||||
class="parameter_box parameter_info"
|
||||
defaultUrl=""
|
||||
:isCondition="true"
|
||||
:dataList="parameterList"
|
||||
@hancleClick="selectGoods"
|
||||
label="name"
|
||||
>
|
||||
<common-list imgUrl="url" isNoIcon imgMode="aspectFit" class="parameter_box parameter_info"
|
||||
defaultUrl="" :isCondition="true" :dataList="parameterList" @hancleClick="selectGoods" label="name">
|
||||
<template slot="labelSlot" slot-scope="slotProps">
|
||||
<!-- isSelectGoods -->
|
||||
<view
|
||||
class="related_courses_name"
|
||||
:class="`goods_item ${
|
||||
<view class="related_courses_name" :class="`goods_item ${
|
||||
selectGoodsData &&
|
||||
selectGoodsData.productId == slotProps.row.productId
|
||||
? ''
|
||||
: ''
|
||||
}`"
|
||||
>
|
||||
}`">
|
||||
<view :class="`goods_info `">
|
||||
<view class="name">
|
||||
<text style="color: #333"> {{ slotProps.row.name }}:</text>
|
||||
<text v-if="slotProps.row.isTime">
|
||||
{{ slotProps.row.value | formatDate }}</text
|
||||
>
|
||||
{{ slotProps.row.value | formatDate }}</text>
|
||||
<text v-else> {{ slotProps.row.value }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -399,12 +289,7 @@
|
||||
</common-list>
|
||||
</view>
|
||||
|
||||
<u-divider
|
||||
text="商品详情"
|
||||
:hairline="true"
|
||||
textColor="#333"
|
||||
lineColor="#b0b0b0"
|
||||
></u-divider>
|
||||
<u-divider text="商品详情" :hairline="true" textColor="#333" lineColor="#b0b0b0"></u-divider>
|
||||
<view class="small_class_teaching_box" style="background-color: #B7E0E2">
|
||||
<view class="common_divider divider_box"> </view>
|
||||
|
||||
@@ -454,28 +339,16 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="small_class_teaching_box related_courses_box"
|
||||
v-if="relatedCoursesList.length > 0"
|
||||
>
|
||||
<view class="small_class_teaching_box related_courses_box" v-if="relatedCoursesList.length > 0">
|
||||
<view class="small_class_teaching_top">
|
||||
<view class="small_class_teaching_top_left">
|
||||
<image
|
||||
src="@/static/icon/course_ic.png"
|
||||
mode="aspectFil"
|
||||
class="icon1"
|
||||
></image>
|
||||
<image src="@/static/icon/course_ic.png" mode="aspectFil" class="icon1"></image>
|
||||
<text>相关课程</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="small_class_teaching_content">
|
||||
<common-curriculum-list
|
||||
imgUrl="url"
|
||||
:isCondition="true"
|
||||
:dataList="relatedCoursesList"
|
||||
@hancleClick="goCourseDescription"
|
||||
label="title"
|
||||
>
|
||||
<common-curriculum-list imgUrl="url" :isCondition="true" :dataList="relatedCoursesList"
|
||||
@hancleClick="goCourseDescription" label="title">
|
||||
<template slot="labelSlot" slot-scope="slotProps">
|
||||
<view class="related_courses_name hidden1">{{
|
||||
slotProps.row.title
|
||||
@@ -488,8 +361,7 @@
|
||||
<!-- {{ slotProps.row.bxType }} -->
|
||||
|
||||
<text class="aui-text-danger">
|
||||
¥{{ slotProps.row.courseFee }}</text
|
||||
>
|
||||
¥{{ slotProps.row.courseFee }}</text>
|
||||
|
||||
<view> </view>
|
||||
</template>
|
||||
@@ -498,13 +370,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods_nav_box" v-if="!this.$store.state.loadingShow">
|
||||
<uni-goods-nav
|
||||
:fill="true"
|
||||
:options="buyOptions"
|
||||
:button-group="customButtonGroup1"
|
||||
@click="onHandleClickBuy"
|
||||
@buttonClick="onHandleClickBuy1"
|
||||
/>
|
||||
<uni-goods-nav :fill="true" :options="buyOptions" :button-group="customButtonGroup1"
|
||||
@click="onHandleClickBuy" @buttonClick="onHandleClickBuy1" />
|
||||
</view>
|
||||
<!--
|
||||
<u-modal
|
||||
@@ -515,82 +382,43 @@
|
||||
@confirm="hancleModalConfirm"
|
||||
@cancel="hancleModalCancel"
|
||||
></u-modal> -->
|
||||
<common-select-goods
|
||||
ref="commonSelectGoods"
|
||||
:selectGoodsData="selectGoodsData"
|
||||
:goodsList="goodsList"
|
||||
:buyOptions="buyOptions"
|
||||
:customButtonGroup1="customButtonGroup1"
|
||||
@selectGoods="selectGoods"
|
||||
@onHandleClickBuy="onHandleClickBuy"
|
||||
></common-select-goods>
|
||||
<u-popup
|
||||
:show="showInfo"
|
||||
mode="bottom"
|
||||
@close="closeShowInfo"
|
||||
class="popup_box"
|
||||
>
|
||||
<common-select-goods ref="commonSelectGoods" :selectGoodsData="selectGoodsData" :goodsList="goodsList"
|
||||
:buyOptions="buyOptions" :customButtonGroup1="customButtonGroup1" @selectGoods="selectGoods"
|
||||
@onHandleClickBuy="onHandleClickBuy"></common-select-goods>
|
||||
<u-popup :show="showInfo" mode="bottom" @close="closeShowInfo" class="popup_box">
|
||||
<view class="popup_top">
|
||||
<view class="product_image">
|
||||
<image
|
||||
:src="selectGoodsData.productImages"
|
||||
mode="aspectFit"
|
||||
class="goods_image"
|
||||
></image>
|
||||
<image :src="selectGoodsData.productImages" mode="aspectFit" class="goods_image"></image>
|
||||
</view>
|
||||
<view class="title">已选:{{ selectGoodsData.productName }}</view>
|
||||
</view>
|
||||
|
||||
<view :class="`common_radius_box goods_box popup_content`">
|
||||
<view class="title title_box"
|
||||
><text class="title_price">¥{{ selectGoodsData.price }}</text
|
||||
><u-icon
|
||||
name="close"
|
||||
color="#333"
|
||||
size="18"
|
||||
@click="close"
|
||||
style="display: inline-block"
|
||||
></u-icon
|
||||
></view>
|
||||
<view class="title title_list"
|
||||
><text>商品列表({{ goodsList.length }})</text></view
|
||||
>
|
||||
<view class="title title_box"><text class="title_price">¥{{ selectGoodsData.price }}</text><u-icon
|
||||
name="close" color="#333" size="18" @click="close" style="display: inline-block"></u-icon>
|
||||
</view>
|
||||
<view class="title title_list"><text>商品列表({{ goodsList.length }})</text></view>
|
||||
|
||||
<common-list
|
||||
imgUrl="url"
|
||||
isNoIcon
|
||||
imgMode="aspectFit"
|
||||
defaultUrl=""
|
||||
:isCondition="true"
|
||||
:dataList="goodsList"
|
||||
@hancleClick="selectGoods"
|
||||
label="title"
|
||||
>
|
||||
<common-list imgUrl="url" isNoIcon imgMode="aspectFit" defaultUrl="" :isCondition="true"
|
||||
:dataList="goodsList" @hancleClick="selectGoods" label="title">
|
||||
<template slot="labelSlot" slot-scope="slotProps">
|
||||
<!-- isSelectGoods -->
|
||||
<view
|
||||
class="related_courses_name"
|
||||
:class="`goods_item ${
|
||||
<view class="related_courses_name" :class="`goods_item ${
|
||||
selectGoodsData &&
|
||||
selectGoodsData.productId == slotProps.row.productId
|
||||
? 'isSelectGoods color_shandow'
|
||||
: ''
|
||||
}`"
|
||||
>
|
||||
}`">
|
||||
<view class="image_box" style="margin-right: 10rpx">
|
||||
<image
|
||||
:src="slotProps.row.productImages"
|
||||
mode="aspectFit"
|
||||
class="goods_image"
|
||||
></image>
|
||||
<image :src="slotProps.row.productImages" mode="aspectFit" class="goods_image"></image>
|
||||
</view>
|
||||
|
||||
<view :class="`goods_info `">
|
||||
<view class="name">{{ slotProps.row.productName }}</view>
|
||||
<view class="price" style="color: #258feb">{{
|
||||
slotProps.row.price
|
||||
}}</view></view
|
||||
>
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <text v-if="slotProps.row.conditions!='03'">【试听】</text> -->
|
||||
@@ -598,13 +426,8 @@
|
||||
</common-list>
|
||||
|
||||
<view class="goods_nav_box">
|
||||
<uni-goods-nav
|
||||
:fill="true"
|
||||
:options="buyOptions"
|
||||
:button-group="customButtonGroup1"
|
||||
@click="onHandleClickBuy"
|
||||
@buttonClick="onHandleClickBuy"
|
||||
/>
|
||||
<uni-goods-nav :fill="true" :options="buyOptions" :button-group="customButtonGroup1"
|
||||
@click="onHandleClickBuy" @buttonClick="onHandleClickBuy" />
|
||||
</view>
|
||||
<!-- <view>
|
||||
<text @click="handleClickClose">取消</text>
|
||||
@@ -620,7 +443,9 @@
|
||||
import courseDescription from "@/pages/component/commonComponents/list";
|
||||
|
||||
import $http from "@/config/requestConfig.js";
|
||||
import { mapState } from "vuex";
|
||||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
export default {
|
||||
components: {
|
||||
courseDescription, //课程说明
|
||||
@@ -673,8 +498,7 @@ export default {
|
||||
playData: {},
|
||||
taiHuClassInfo: {},
|
||||
searchValue: "",
|
||||
teachingList: [
|
||||
{
|
||||
teachingList: [{
|
||||
title: "临床实践",
|
||||
|
||||
type: "02",
|
||||
@@ -712,6 +536,7 @@ export default {
|
||||
limitTitle: "提示",
|
||||
limitContent: "",
|
||||
scrollViewHeight: 0,
|
||||
canGetCouponList: [], // 可获得优惠券列表
|
||||
urlList: {
|
||||
list: "app/phone.do?getCourseDetail_new",
|
||||
curriculumInfo: "app/phone.do?getCourseInfo",
|
||||
@@ -719,14 +544,12 @@ export default {
|
||||
goodsList: "book/shopproduct/getGlProductList",
|
||||
visitorDetailInfo: "visitor/getProductDetail", // 游客状态下的商品详情
|
||||
},
|
||||
customButtonGroup1: [
|
||||
{
|
||||
customButtonGroup1: [{
|
||||
with: 200,
|
||||
text: "立即购买",
|
||||
backgroundColor: "linear-gradient(90deg, #FE6035, #EF1224)",
|
||||
color: "#fff",
|
||||
},
|
||||
],
|
||||
}, ],
|
||||
requestType: '', // 数据请求类型是否为游客登陆状态
|
||||
};
|
||||
},
|
||||
@@ -810,6 +633,32 @@ export default {
|
||||
...mapState(["userInfo"]),
|
||||
},
|
||||
methods: {
|
||||
// 获取购买后可获得优惠券列表
|
||||
async getCanGetCouponList() {
|
||||
await this.$http
|
||||
.request({
|
||||
url: "common/coupon/couponToProductList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"page": 1,
|
||||
"limit": 100,
|
||||
"productId": this.curriculumData.productId
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.code != 0) return this.$commonJS.showToast(res.errMsg);
|
||||
console.log('res优惠券', res);
|
||||
this.canGetCouponList = res.couponToShopproductPage.records
|
||||
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
this.$commonJS.showToast(e.errMsg);
|
||||
})
|
||||
},
|
||||
closeShowInfo() {
|
||||
this.showInfo = false;
|
||||
},
|
||||
@@ -872,16 +721,14 @@ export default {
|
||||
"this.selectGoodsDatathis.selectGoodsDatathis.selectGoodsData"
|
||||
);
|
||||
var mynavData = JSON.stringify({
|
||||
goods: [
|
||||
{
|
||||
goods: [{
|
||||
productImages: this.selectGoodsData.productImages,
|
||||
productId: this.selectGoodsData.productId,
|
||||
productName: this.selectGoodsData.productName,
|
||||
activityPrice: this.selectGoodsData.activityPrice,
|
||||
price: this.selectGoodsData.price,
|
||||
goodsType: this.selectGoodsData.goodsType,
|
||||
},
|
||||
],
|
||||
}, ],
|
||||
|
||||
navTitle: this.options.navTitle,
|
||||
title: this.options.title,
|
||||
@@ -938,8 +785,7 @@ export default {
|
||||
}
|
||||
this.modalInfo = {
|
||||
title: "提示信息",
|
||||
content:
|
||||
"用户您好,该课程已到期,通过支付" +
|
||||
content: "用户您好,该课程已到期,通过支付" +
|
||||
fee +
|
||||
"元,本门课程可获得" +
|
||||
days +
|
||||
@@ -1009,6 +855,7 @@ export default {
|
||||
.then(async (res) => {
|
||||
that.selectGoodsData = res.data.GLProducts[0];
|
||||
that.curriculumData = res.data.detail;
|
||||
await this.getCanGetCouponList()
|
||||
that.booksList = res.data.books ? res.data.books : [];
|
||||
that.coursesList = res.data.courses ? res.data.courses : [];
|
||||
that.goodsList = res.data.GLProducts;
|
||||
@@ -1328,7 +1175,9 @@ export default {
|
||||
transformData(inputData) {
|
||||
const result = {};
|
||||
inputData.forEach((item) => {
|
||||
const { letter } = item;
|
||||
const {
|
||||
letter
|
||||
} = item;
|
||||
if (!result[letter]) {
|
||||
result[letter] = [];
|
||||
}
|
||||
@@ -1498,6 +1347,117 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
||||
.u-grid-list {
|
||||
// height: 40rpx;
|
||||
}
|
||||
@@ -2040,12 +2000,14 @@ export default {
|
||||
border: 2rpx solid #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
box-sizing: border-box;
|
||||
// font-weight: bold;
|
||||
margin-bottom: 40rpx;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
.image_box {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
@@ -2057,6 +2019,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.goods_info {
|
||||
width: calc(100%);
|
||||
// padding: 10rpx 20rpx;
|
||||
@@ -2066,27 +2029,34 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
float: left;
|
||||
|
||||
.name {
|
||||
font-size: 26rpx;
|
||||
// font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 26rpx;
|
||||
color: #aaa;
|
||||
}
|
||||
}
|
||||
|
||||
.isSelectGoods {
|
||||
color: $themeColor !important;
|
||||
|
||||
.name {
|
||||
color: $themeColor !important;
|
||||
}
|
||||
|
||||
.price {
|
||||
color: $themeColor !important;
|
||||
}
|
||||
|
||||
border: 2rpx solid $themeColor;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
/deep/.list_item {
|
||||
// border-bottom: none;
|
||||
padding: 10rpx 0 !important;
|
||||
@@ -2101,17 +2071,21 @@ export default {
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.parameter_box {
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
.goods_item {
|
||||
padding-top: 5rpx !important;
|
||||
padding-bottom: 5rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.parameter_info_box {
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.parameter_info {
|
||||
/deep/.list_item {
|
||||
// border-bottom: none;
|
||||
@@ -2119,10 +2093,12 @@ export default {
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.goods_item {
|
||||
border: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.goodsList {
|
||||
.image_box {
|
||||
width: 80rpx;
|
||||
@@ -2131,23 +2107,28 @@ export default {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/.u-popup__content {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
/deep/.u-popup__content__close {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.title_box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-left: 0;
|
||||
|
||||
.title_price {
|
||||
color: #ef1224;
|
||||
font-size: 40rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.title_list {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
@@ -2157,6 +2138,7 @@ export default {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
|
||||
.goods_info {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -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">
|
||||
@@ -361,11 +378,13 @@
|
||||
</view>
|
||||
</view>
|
||||
</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 = ''
|
||||
@@ -669,8 +768,12 @@
|
||||
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,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -902,6 +1023,12 @@
|
||||
} 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;
|
||||
@@ -979,14 +1106,25 @@
|
||||
// quantity: this.cartList[i].productAmount,
|
||||
// });
|
||||
// }
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
let data = {
|
||||
data = {
|
||||
buyType: this.options.typeId, //0- 商品页直接下单 1- 购物车结算
|
||||
userId: this.userInfo.id, //下单人ID
|
||||
shippingUser: this.addressData ? this.addressData.consigneeName : "111", //收货人姓名
|
||||
@@ -997,9 +1135,9 @@
|
||||
realMoney: this.actualPayment, //实收金额
|
||||
shippingMoney: this.freightNum, //运费
|
||||
remark: this.remark, //备注
|
||||
couponId: null, //优惠券Id
|
||||
couponId: this.curCouponId ? this.curCoupon.id : null, //优惠券Id
|
||||
// isSend: this.isSend,
|
||||
couponName: "", //优惠券名称
|
||||
couponName: this.curCouponId && this.curCoupon.id ? this.curCoupon.couponEntity.couponName : '', //优惠券名称
|
||||
districtMoney: 0, //优惠金额
|
||||
|
||||
productList: this.goodsDataList.map((e) => {
|
||||
@@ -1018,7 +1156,10 @@
|
||||
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 &&
|
||||
@@ -1055,10 +1196,11 @@
|
||||
// this.buyingFlag = false
|
||||
console.log('进来请求了吗?');
|
||||
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,7 +1209,9 @@
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
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
|
||||
})
|
||||
@@ -1077,8 +1221,7 @@
|
||||
'addressId':data.addressId,
|
||||
'realMoney':data.realMoney
|
||||
}
|
||||
|
||||
console.log("res at line 598系统下单返回结果:", res);
|
||||
}
|
||||
if (res.code == 0) {
|
||||
if (res.orderSn == null) {
|
||||
uni.showToast({
|
||||
|
||||
@@ -143,6 +143,20 @@
|
||||
|
||||
<view class="text" style="line-height: 40rpx">{{
|
||||
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>
|
||||
@@ -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;
|
||||
},
|
||||
@@ -589,7 +633,10 @@
|
||||
<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;
|
||||
@@ -900,12 +947,14 @@
|
||||
|
||||
|
||||
}
|
||||
|
||||
.setIcon {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 70rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.mine_box {
|
||||
width: 100%;
|
||||
|
||||
|
||||
297
pages/mine/wallet/couponList.vue
Normal file
297
pages/mine/wallet/couponList.vue
Normal 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>
|
||||
@@ -343,10 +343,8 @@
|
||||
</template>
|
||||
<template
|
||||
v-if="!item.reply && thisClass.state == '1'">
|
||||
<text class="no" >未提交答案 点击开始答题</text>
|
||||
<!-- <text class="no" v-else style="color: #a0a1a7;">暂未开始学习</text> -->
|
||||
<!-- <text class="no" v-if="index+1<=currentStudyNumber">未提交答案 点击开始答题</text>
|
||||
<text class="no" v-else style="color: #a0a1a7;">暂未开始学习</text> -->
|
||||
<text class="no" v-if="index+1 <= currentStudyNumber || currentStudyNumber == 0">未提交答案 点击开始答题</text>
|
||||
<text class="no" v-else style="color: #a0a1a7;">暂未开始学习</text>
|
||||
</template>
|
||||
<template
|
||||
v-if="!item.reply && (thisClass.state == '2' || thisClass.state == '3')">
|
||||
@@ -1497,12 +1495,11 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log('item', this.thisClass);
|
||||
// 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}`
|
||||
})
|
||||
// }
|
||||
}
|
||||
|
||||
},
|
||||
delClass() {
|
||||
|
||||
@@ -290,6 +290,10 @@
|
||||
</template>
|
||||
</text>
|
||||
<text class="txt555" v-else> 匿名用户 </text>
|
||||
<!-- {{item.buyState}} -->
|
||||
<view class="" style="width: 50rpx; height: 50rpx;">
|
||||
<image style="width: 50rpx; height: 50rpx;" :src="item.buyState.includes('未购买') ? '../../static/icon/notbuy.png' : '../../static/icon/yesbuy.png'" mode="widthFix"></image>
|
||||
</view>
|
||||
<text
|
||||
@click.stop="outClass(item.student.id)"
|
||||
class="outBtn"
|
||||
|
||||
@@ -11,9 +11,31 @@
|
||||
<view class="scoreBox">
|
||||
本次考试卷面成绩为:<text class="score PM_font">{{exameResult.score}} 分</text>
|
||||
</view>
|
||||
<view class="" v-if="testPaper.type == '2'" style="margin: 20rpx 0; text-align: center;" >
|
||||
<template v-if="exameResult.score >= 60 && selfStudyCertificate.length > 0">
|
||||
<view class="">
|
||||
<view class="congritulations">
|
||||
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="">
|
||||
<text>恭喜!您本次考试获得了自考证书,请前往 我的->我的证书查看</text>
|
||||
<<view class="" style="text-align: center;">
|
||||
<text class="small_btn border_radius_10"
|
||||
style="display: inline-block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff"
|
||||
@click="onPageJump('/pages/certificate/certificate')">查看证书</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text>很遗憾本次考试您没有获得自考证书,祝您下次考试旗开得胜!!</text>
|
||||
</template>
|
||||
</view>
|
||||
<view class="flex_box flex_between">
|
||||
<button type="primary" size="mini" @click="goToClass">返回班级</button>
|
||||
<button type="warn" size="mini" @click="goToPaper">查看试卷</button>
|
||||
<button size="mini" type="primary" v-if="testPaper.type == '2'" @click="goToCourse">返回课程</button>
|
||||
<button size="mini" type="primary" v-else @click="goToClass">返回班级</button>
|
||||
<button size="mini" type="warn" @click="goToPaper">查看试卷</button>
|
||||
</view>
|
||||
<view class="result_imgBox">
|
||||
<image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image>
|
||||
@@ -32,7 +54,7 @@
|
||||
</view>
|
||||
<view class="flex_box align-items_box" v-if="secondTimeDif > 0">
|
||||
<view class="" style="font-size: 26rpx;">
|
||||
剩余时间:
|
||||
剩余时间:
|
||||
</view>
|
||||
<view class="">
|
||||
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false"
|
||||
@@ -86,10 +108,15 @@
|
||||
<u-popup key="1" :show="showPopup" :round="10" @close="hidePopup">
|
||||
<view class="guanli">
|
||||
<h3>考试说明</h3>
|
||||
<view class="tips border_radius_10">
|
||||
<view class="tips border_radius_10" v-if="testPaper.type == '1'">
|
||||
<text>①、每位学员共有两次考试的机会,考试成绩以两次成绩的最高分作为最终的卷面成绩,请认真对待每次考试;<br />
|
||||
②、请在倒计时结束前完成答题,倒计时结束后将自动交卷。</text>
|
||||
</view>
|
||||
<view class="tips border_radius_10" v-if="testPaper.type == '2'">
|
||||
<text>①、每位学员共有两次考试的机会,如第一次考试成绩达标则不用进行第二次的考试,请认真对待每次考试;<br />
|
||||
②、请在倒计时结束前完成答题,倒计时结束后将自动交卷;<br/>
|
||||
③、考试时间为 45 分钟。</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup key="2" :show="showQuestIndex" :round="10" @close="hidePopup">
|
||||
@@ -125,6 +152,7 @@
|
||||
showPopup: false,
|
||||
code: 0, // 英文code
|
||||
classId: undefined,
|
||||
courseId:undefined,
|
||||
testPaper: {},
|
||||
curQuestion: {
|
||||
answerIds: []
|
||||
@@ -139,7 +167,7 @@
|
||||
step: 8, /// 步长
|
||||
// questIndexList: [],
|
||||
nowPart: 1,
|
||||
|
||||
selfStudyCertificate:[],
|
||||
maxNumber: 0,
|
||||
minNumber: 0,
|
||||
noAnswerList: [],
|
||||
@@ -150,12 +178,12 @@
|
||||
questionList:[],
|
||||
answerIdsList:[],
|
||||
wantSubmit:false, // 想要提交
|
||||
|
||||
flag : false,
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
console.log('收到得值',e);
|
||||
this.classId = e.classId
|
||||
// this.classId = e.classId
|
||||
this.examId = e.id
|
||||
this.wantSubmit = false
|
||||
this.getTestPage()
|
||||
@@ -180,6 +208,49 @@
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setPaperEndTime']),
|
||||
// 查询证书情况
|
||||
async getCertificateInfo() {
|
||||
var list = undefined
|
||||
await $http.request({
|
||||
url: "common/userCertificate/getUserCertificateList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"type": '', //证书类型A a证 B b证 ZK自考
|
||||
"courseId": this.courseId //课程id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code != 0) {
|
||||
uni.showToast({
|
||||
title: res.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (res.code == 0) {
|
||||
res.certificateList.forEach(item => {
|
||||
item.certificateUrl && item.certificateUrl != '' ? item
|
||||
.certificateUrlList = item.certificateUrl.split(',') : item
|
||||
.certificateUrlList = []
|
||||
})
|
||||
list = res.certificateList
|
||||
}
|
||||
console.log('证书接口请求结果', res);
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
});
|
||||
return list
|
||||
},
|
||||
async getServerTime() {
|
||||
var time = 0
|
||||
await $http.request({
|
||||
@@ -279,15 +350,21 @@
|
||||
this.isOvertime = true
|
||||
this.sumbitPaper()
|
||||
let that = this
|
||||
var urll = ''
|
||||
if(that.testPaper.type == '1'){
|
||||
urll = `/pages/miniClass/classInfo?id=${that.classId}`
|
||||
}else if(that.testPaper.type == '2'){
|
||||
urll = `/pages/course/courseDetail?id=${that.courseId}`
|
||||
}
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: "考试结束,系统已为您自动交卷,点击按钮返回所在班级",
|
||||
content: "考试结束,系统已为您自动交卷,点击按钮返回",
|
||||
confirmText: '知道了',
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/miniClass/classInfo?id=${that.classId}`
|
||||
url: urll
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -324,49 +401,60 @@
|
||||
},300)
|
||||
},
|
||||
// q请求提交试卷
|
||||
sumbitPaper(ids) {
|
||||
async sumbitPaper(ids) {
|
||||
let that = this
|
||||
if(that.flag){
|
||||
return
|
||||
}
|
||||
that.flag = true
|
||||
uni.showLoading({
|
||||
title:'正在交卷'
|
||||
})
|
||||
let that = this
|
||||
$http.request({
|
||||
await $http.request({
|
||||
url: "common/classExam/submitExamPaper",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: that.examId
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
header: { //默认 无 说明:请求头1
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
.then(async res => {
|
||||
uni.hideLoading()
|
||||
|
||||
if (res.code == 0) {
|
||||
console.log('交卷结果',res);
|
||||
uni.showToast({
|
||||
title: '交卷成功',
|
||||
icon: 'success'
|
||||
})
|
||||
setTimeout( ()=>{
|
||||
setTimeout(async ()=>{
|
||||
that.exameResult = res.examPaper
|
||||
// this.timeup()
|
||||
that.showQuestIndex = false
|
||||
that.secondTimeDif = 0
|
||||
that.isOvertime = true
|
||||
uni.setStorage({
|
||||
key:'paperEndTime',
|
||||
data:{
|
||||
time: 0,
|
||||
examId: undefined
|
||||
},
|
||||
success: function () {
|
||||
console.log('时间存储成功');
|
||||
if(that.testPaper.type == '2' && that.exameResult.score >= 60) {
|
||||
// if(that.exameResult.score >= 60){
|
||||
var newCertificate = await that.getCertificateInfo()
|
||||
console.log('5555555证书资料', newCertificate);
|
||||
that.selfStudyCertificate = []
|
||||
if (newCertificate && newCertificate.length > 0) {
|
||||
newCertificate.forEach(item => {
|
||||
if (item.classId != '' && item.classId > 0) {
|
||||
// this.classCertificate.push(item)
|
||||
} else {
|
||||
that.selfStudyCertificate.push(item)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
// }
|
||||
}
|
||||
},300)
|
||||
|
||||
}else{
|
||||
that.flag = false
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'error'
|
||||
@@ -374,6 +462,7 @@
|
||||
}
|
||||
|
||||
}).catch(e => {
|
||||
that.flag = true
|
||||
uni.hideLoading()
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
@@ -493,6 +582,11 @@
|
||||
this.haveAnswerList = this.gethaveAnswerList()
|
||||
// console.log('this.answerIdsList', this.answerIdsList);
|
||||
this.testPaper = res.examPaper
|
||||
if(this.testPaper.type == '1'){ // 班级考试
|
||||
this.classId = this.testPaper.relationId
|
||||
}else if(this.testPaper.type == '2'){
|
||||
this.courseId = this.testPaper.relationId
|
||||
}
|
||||
// var planEndTimeDate = new Date(res.planEndTime)
|
||||
// this.endTime = planEndTimeDate.getTime();
|
||||
this.endTime = res.planEndTime
|
||||
@@ -569,6 +663,12 @@
|
||||
url: `/pages/miniClass/classInfo?id=${this.classId}`
|
||||
})
|
||||
},
|
||||
goToCourse(){
|
||||
uni.navigateTo({
|
||||
// url: `/pages/miniClass/classInfo?id=${this.classId}`
|
||||
url: `/pages/course/courseDetail?id=${this.courseId}`
|
||||
})
|
||||
},
|
||||
hidePopup() {
|
||||
this.showPopup = false
|
||||
this.showQuestIndex = false
|
||||
@@ -602,7 +702,17 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/style/mixin.scss";
|
||||
|
||||
.congritulations {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
text-align: center;
|
||||
margin: 10rpx auto;
|
||||
display: block;
|
||||
image {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
}
|
||||
.questIndx { overflow: hidden;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
|
||||
<public-module></public-module>
|
||||
<z-nav-bar title="试卷答案">
|
||||
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
|
||||
@click="showPopup = true">考试说明</text>
|
||||
<!-- <text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
|
||||
@click="showPopup = true">考试说明</text> -->
|
||||
</z-nav-bar>
|
||||
<!-- 有考试结果时候 -->
|
||||
<template>
|
||||
@@ -78,6 +78,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="margin-top: 20rpx;">
|
||||
<text style="color: #666; font-size: 28rpx;">开始时间:{{testPaper.startTime}} <br/> 结束时间:{{testPaper.endTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<u-popup key="1" :show="showPopup" :round="10" @close="hidePopup">
|
||||
@@ -223,8 +226,6 @@ checkAnswer(id){
|
||||
if (res.code == 0) {
|
||||
// that.isHave = true
|
||||
var subOptions = JSON.parse(res.examPaper.subject)
|
||||
|
||||
|
||||
subOptions.forEach(item => {
|
||||
var code = 0
|
||||
item.options.forEach(item1 => {
|
||||
@@ -236,6 +237,7 @@ checkAnswer(id){
|
||||
|
||||
this.questionList = subOptions
|
||||
this.testPaper = res.examPaper
|
||||
console.log('试卷信息', this.testPaper);
|
||||
this.answerIdsList = JSON.parse(res.examPaper.answer)
|
||||
var newList = JSON.parse(res.examPaper.answer)
|
||||
newList = newList.map(item => {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</view>
|
||||
<view class="flex_box align-items_box" v-if="secondTimeDif > 0">
|
||||
<view class="">
|
||||
剩余时间:
|
||||
剩余时间:
|
||||
</view>
|
||||
<view class="">
|
||||
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false"
|
||||
@@ -168,6 +168,7 @@
|
||||
showQuestIndex:false,
|
||||
secondTimeDif:undefined,
|
||||
pagetitle:'', // 页面标题
|
||||
flag:false,
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
@@ -353,10 +354,15 @@
|
||||
},
|
||||
// q请求提交试卷
|
||||
sumbitPaper(ids) {
|
||||
let that = this
|
||||
if(that.flag){
|
||||
return
|
||||
}
|
||||
that.flag = true
|
||||
uni.showLoading({
|
||||
title:'正在交卷'
|
||||
})
|
||||
let that = this
|
||||
|
||||
$http.request({
|
||||
url: "common/classExam/submitExamPaper",
|
||||
method: "POST",
|
||||
@@ -394,6 +400,7 @@
|
||||
|
||||
},300)
|
||||
}else{
|
||||
that.flag = false
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'error'
|
||||
@@ -401,6 +408,7 @@
|
||||
}
|
||||
|
||||
}).catch(e => {
|
||||
that.flag = false
|
||||
uni.hideLoading()
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
|
||||
@@ -397,9 +397,9 @@
|
||||
// paperEndTime = planEndTimeDate.getTime(); // 结束的时间戳
|
||||
paperEndTime = historyPaper.planEndTime
|
||||
this.examId = historyPaper.id
|
||||
this.classId = historyPaper.relationId
|
||||
// this.classId = historyPaper.relationId
|
||||
}else{
|
||||
this.classId = undefined
|
||||
// this.classId = undefined
|
||||
this.examId = undefined
|
||||
paperEndTime = 0
|
||||
}
|
||||
@@ -474,7 +474,8 @@
|
||||
// 继续考试
|
||||
continueTest(id,classId) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/miniClass/continueTest?id=${id}&classId=${classId}`
|
||||
// url: `/pages/miniClass/continueTest?id=${id}&classId=${classId}`
|
||||
url: `/pages/miniClass/continueTest?id=${id}`
|
||||
})
|
||||
},
|
||||
// 获取考试中的试卷
|
||||
@@ -535,7 +536,8 @@
|
||||
},
|
||||
})
|
||||
.then(async res => {
|
||||
if (res.code == 0) {
|
||||
console.log(res);
|
||||
if (res && res.code == 0) {
|
||||
if (res.result.length > 0) {
|
||||
_list = res.result
|
||||
}
|
||||
@@ -579,8 +581,8 @@
|
||||
this.$http
|
||||
.post('medical/home/getCourseMedicalTree')
|
||||
.then(res => {
|
||||
// console.log(res)
|
||||
if (res.code == 0) {
|
||||
console.log(res)
|
||||
if (res && res.code == 0) {
|
||||
if (res.labels.length > 0) {
|
||||
this.curseTagList = res.labels
|
||||
this.tabsid = res.labels[0].id
|
||||
|
||||
959
pages/selfStudy/selfStudy.vue
Normal file
959
pages/selfStudy/selfStudy.vue
Normal file
@@ -0,0 +1,959 @@
|
||||
<template style="">
|
||||
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
|
||||
<public-module></public-module>
|
||||
<z-nav-bar :title="pagetitle" backState="2000">
|
||||
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
|
||||
@click="showPopup = true">考试说明</text>
|
||||
</z-nav-bar>
|
||||
<!-- 有考试结果时候 -->
|
||||
<template v-if="exameResult.id">
|
||||
<view class="border_radius_10 haveResult">
|
||||
<view class="scoreBox">
|
||||
本次考试卷面成绩为:<text class="score PM_font">{{exameResult.score}} 分</text>
|
||||
</view>
|
||||
<view class="" style="margin: 20rpx 0; text-align: center;">
|
||||
<template v-if="exameResult.score >= 60 && selfStudyCertificate.length > 0">
|
||||
<view class="">
|
||||
<view class="congritulations">
|
||||
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="">
|
||||
<text>恭喜!您本次考试获得了自考证书,请前往 我的->我的证书查看</text>
|
||||
<view class="" style="text-align: center;">
|
||||
<text class="small_btn border_radius_10"
|
||||
style="display: inline-block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff"
|
||||
@click="onPageJump('/pages/certificate/certificate')">查看证书</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text>很遗憾本次考试您没有获得自考证书,祝您下次考试旗开得胜!!</text>
|
||||
</template>
|
||||
</view>
|
||||
<view class="flex_box flex_between">
|
||||
<button type="primary" size="mini" @click="goToClass">返回课程</button>
|
||||
<button type="warn" size="mini" @click="goToPaper">查看试卷</button>
|
||||
</view>
|
||||
<view class="result_imgBox">
|
||||
<image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- 没有考试结果的时候 -->
|
||||
<template v-else>
|
||||
<view style="padding: 20rpx; " class="timeBox border_radius_10 flex_box flex_between align-items_box"
|
||||
v-if="secondTimeDif > 0">
|
||||
<!-- <view class=""> -->
|
||||
<view class="">
|
||||
<text><i style="color: #00aaff; font-style: normal; margin-right: 10rpx;" class="">{{curIndex1+1}}
|
||||
</i> / {{testPaper.length}}</text>
|
||||
<text class="checkQuestBtn small_btn border_radius_10" @click="showQuestIndex = true">全部题目</text>
|
||||
</view>
|
||||
<view class="flex_box align-items_box" v-if="secondTimeDif > 0">
|
||||
<view class="">
|
||||
剩余时间:
|
||||
</view>
|
||||
<view class="">
|
||||
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false"
|
||||
:hour="timeDif.hour"
|
||||
:minute="timeDif.minutes"
|
||||
:second="timeDif.second"
|
||||
color="#ffaa7f" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- </view> -->
|
||||
<!-- <pre>{{testPaper}}</pre> -->
|
||||
</view>
|
||||
<view class="question border_radius_10" v-if="curQuestion.id">
|
||||
<view class="">
|
||||
<text class="questionType">{{curQuestion.type == 0 ? '单选题' : '多选题'}}</text>
|
||||
<!-- <text class="checkQuestBtn small_btn border_radius_10" @click="showQuestIndex = true">检查</text> -->
|
||||
<view class="questionItem" v-if="curQuestion.id">
|
||||
<view class="">
|
||||
<text>{{curQuestion.content}}</text>
|
||||
</view>
|
||||
<view class="optionsBox">
|
||||
<view
|
||||
:class="['item','border_radius_10',curQuestion.answerIds.includes(item.id) ? 'choosed' : '']"
|
||||
@click="clickOption(item, index)" v-for="(item, index) in curQuestion.options"
|
||||
:key="index">
|
||||
<text>{{item.content}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnBox " style="overflow: hidden;">
|
||||
<view class="flex_box flex_between">
|
||||
<view class="item">
|
||||
<button @click="showPrevQuestion" type="default" plain="true" :disabled="curIndex1 == 0"
|
||||
size="mini">上一题</button>
|
||||
</view>
|
||||
<view class="item" v-show="curIndex1 == testPaper.length-1 && !isOvertime">
|
||||
<button @click="sumitAnswer" type="primary" size="mini">交 卷</button>
|
||||
</view>
|
||||
<view class="item">
|
||||
<button @click="showNextQuestion" type="primary"
|
||||
:disabled="curIndex1 == testPaper.length-1" size="mini">下一题</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<u-popup key="1" :show="showPopup" :round="10" @close="hidePopup">
|
||||
<view class="guanli">
|
||||
<h3>考试说明</h3>
|
||||
<view class="tips border_radius_10">
|
||||
<text>①、每位学员共有两次考试的机会,如第一次考试成绩达标则不用进行第二次的考试,请认真对待每次考试;<br />
|
||||
②、请在倒计时结束前完成答题,倒计时结束后将自动交卷。</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup key="2" :show="showQuestIndex" :round="10" @close="hidePopup">
|
||||
<view class="guanli">
|
||||
<h3>题目索引</h3>
|
||||
<view class="" style="text-align: center; font-size: 28rpx; line-height: 50rpx; color: #666;">
|
||||
<text>红框标识未作答,绿色框标识已选定答案,灰色框标识您未查看的题目</text>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="questIndx questIndxPup flex_box">
|
||||
<!-- <scroll-view class="scroll-view_H" scroll-x="true">
|
||||
<view class="scroll-view-item_H" v-for="index of getallLIst" :key="index"> -->
|
||||
<text v-for="index of getallLIst" @click="clickIndex(index)" :key="index"
|
||||
:class="[ haveAnswerList.includes(index-1) ? 'green' : '', noAnswerList.includes(index-1) ? 'red' : '',(curIndex1+1) == index ? 'cur' :'']">{{index}}</text>
|
||||
<!-- </view>
|
||||
</scroll-view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup :show="protocolShow" mode="center" round="6" :key="3">
|
||||
<view class="popup_box">
|
||||
<view class="title">温馨提示</view>
|
||||
<view class="content">
|
||||
<view class="center">
|
||||
用户您好,本次考试时间为 <text style="color: red; font-weight: bold; font-size: 30rpx;">{{testDuration}}</text> 分钟<br />
|
||||
<view style="color: red; font-weight: bold"> 注: </view>
|
||||
<view>
|
||||
<text>①、每位学员共有两次考试的机会,如第一次考试成绩达标则不用进行第二次的考试,请认真对待每次考试;<br />
|
||||
②、请在倒计时结束前完成答题,倒计时结束后将自动交卷;</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="button_box">
|
||||
<u-button size="small" text="稍后再考" @click="cancelClick"></u-button>
|
||||
<u-button text="开始考试" color="#258feb" size="small" @click="onHandleClickBuy"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import debounce from "@/common/debounce.js";
|
||||
import {
|
||||
mapState,mapMutations
|
||||
} from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
testDuration:'45', // 考试时长
|
||||
protocolShow:false,
|
||||
flag:false,
|
||||
showPopup: false,
|
||||
code: 0, // 英文code
|
||||
courseId: undefined,
|
||||
testPaper: [],
|
||||
curQuestion: {
|
||||
answerIds: []
|
||||
},
|
||||
result: {}, // 考试结果
|
||||
curIndex1: 0,
|
||||
paperCreateTime: 0,
|
||||
examId: undefined,
|
||||
endTime: undefined, // 结束时间戳
|
||||
timeDif:{}, // 时间差(结束 - 现在)
|
||||
isOvertime: false, // 是否超时
|
||||
step: 8, /// 步长
|
||||
// questIndexList: [],
|
||||
nowPart: 1,
|
||||
|
||||
maxNumber: 0,
|
||||
minNumber: 0,
|
||||
noAnswerList: [],
|
||||
haveAnswerList:[],
|
||||
exameResult:{},
|
||||
showQuestIndex:false,
|
||||
secondTimeDif:undefined,
|
||||
pagetitle:'', // 页面标题
|
||||
selfStudyCertificate:[],
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
console.log('收到得值',e);
|
||||
this.courseId = e.id
|
||||
// this.testDuration = e.testDuration
|
||||
this.protocolShow = true
|
||||
this.pagetitle = '准备考试'
|
||||
},
|
||||
onHide() {
|
||||
if (!this.isOvertime) {}
|
||||
},
|
||||
onShow() {
|
||||
// this.endTime = this.hourUp(1)
|
||||
// console.log('this.endTime', this.endTime.getTime());
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.isOvertime) { // 如果中途退出
|
||||
// this.giveZero()
|
||||
}
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapState(["userInfo"]),
|
||||
getallLIst() {
|
||||
const numbers = Array.from(Array(this.testPaper.length).keys(), n => n + 1);
|
||||
console.log('numbers', numbers);
|
||||
return numbers
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setPaperEndTime']),
|
||||
cancelClick(){
|
||||
this.protocolShow = false
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
});
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/course/courseDetail?id=${this.courseId}`
|
||||
// })
|
||||
},
|
||||
onHandleClickBuy(){ // 确定开始考试
|
||||
debounce(async () => {
|
||||
this.protocolShow = false
|
||||
if (this.testPaper.length <= 0) {
|
||||
this.pagetitle = '获取试卷'
|
||||
this.getTestPage()
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'页面发生错误,请退出后重新进入页面或联系客服人员',
|
||||
icon:'none',
|
||||
duration:3000
|
||||
})
|
||||
}
|
||||
},300)
|
||||
},
|
||||
// 获取服务器时间
|
||||
async getServerTime() {
|
||||
var time = 0
|
||||
await $http.request({
|
||||
url: "common/classExam/getServerTime",
|
||||
method: "POST",
|
||||
data: {},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.code == 0) {
|
||||
time = res.serverTime
|
||||
} else {
|
||||
time = -1
|
||||
}
|
||||
}).catch(e => {
|
||||
time = -1
|
||||
});
|
||||
return time
|
||||
},
|
||||
// 单个题的提交
|
||||
saveQuestAnswer(paperId,questIndex,ids){
|
||||
console.log('收到的值',paperId,questIndex,ids);
|
||||
$http.request({
|
||||
url: "common/classExam/submitOption",
|
||||
method: "POST",
|
||||
data: {
|
||||
"id": paperId, //试卷id
|
||||
"no": questIndex, // 提索引 1....
|
||||
"answer": ids // 答案id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
|
||||
if (res.code == 0) {
|
||||
console.log('提交成功');
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
|
||||
}).catch(e => {
|
||||
console.log(e, '数据报错')
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'error'
|
||||
})
|
||||
});
|
||||
},
|
||||
getNoAnswerList() {
|
||||
var list = []
|
||||
// if (this.curIndex1 > 0) {
|
||||
for (var i = 0; i < this.testPaper.length; i++) {
|
||||
if (this.testPaper[i].answerIds.length == 0 && this.testPaper[i].hadOpend) {
|
||||
console.log('fuhe?');
|
||||
list.push(i)
|
||||
}
|
||||
}
|
||||
// }
|
||||
return list
|
||||
},
|
||||
gethaveAnswerList() {
|
||||
var list = []
|
||||
// if (this.curIndex1 > 0) {
|
||||
for (var i = 0; i < this.testPaper.length; i++) {
|
||||
if (this.testPaper[i].answerIds.length > 0 && this.testPaper[i].hadOpend) {
|
||||
// console.log('fuhe?');
|
||||
list.push(i)
|
||||
}
|
||||
}
|
||||
// }
|
||||
return list
|
||||
},
|
||||
// 倒计时结束 (超时)
|
||||
timeup() {
|
||||
this.isOvertime = true
|
||||
this.sumbitPaper()
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: "考试结束,系统已为您自动交卷,点击按钮返回课程",
|
||||
confirmText: '知道了',
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// that.goToClass()
|
||||
uni.navigateTo({
|
||||
url: `/pages/course/courseDetail?id=${that.courseId}`
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
goToPaper(){
|
||||
uni.navigateTo({
|
||||
url: `/pages/miniClass/paperBack?id=${this.examId}`
|
||||
})
|
||||
|
||||
},
|
||||
// 获取交卷数据
|
||||
sumitAnswer() {
|
||||
debounce(async () => {
|
||||
let that = this
|
||||
// this.noAnswerList = await this.getNoAnswerList()
|
||||
if(this.noAnswerList.length > 0){
|
||||
this.showQuestIndex = true
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:'您有未作答的题目,是否继续交卷操作?',
|
||||
cancelText:'点错了',
|
||||
confirmText:'确定',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
that.sumbitPaper()
|
||||
}
|
||||
},
|
||||
})
|
||||
}else{
|
||||
that.sumbitPaper()
|
||||
}
|
||||
},300)
|
||||
},
|
||||
// q请求提交试卷
|
||||
async sumbitPaper(ids) {
|
||||
let that = this
|
||||
if(that.flag){
|
||||
return
|
||||
}
|
||||
that.flag = true
|
||||
uni.showLoading({
|
||||
title:'正在交卷'
|
||||
})
|
||||
await $http.request({
|
||||
url: "common/classExam/submitExamPaper",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: that.examId
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(async res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
console.log('交卷结果',res);
|
||||
uni.showToast({
|
||||
title: '交卷成功',
|
||||
icon: 'success'
|
||||
})
|
||||
setTimeout( async ()=>{
|
||||
that.exameResult = res.examPaper
|
||||
// this.timeup()
|
||||
that.showQuestIndex = false
|
||||
that.secondTimeDif = 0
|
||||
that.isOvertime = true
|
||||
if(that.exameResult.score >= 60){
|
||||
var newCertificate = await that.getCertificateInfo()
|
||||
console.log('5555555证书资料', newCertificate);
|
||||
that.selfStudyCertificate = []
|
||||
if (newCertificate && newCertificate.length > 0) {
|
||||
newCertificate.forEach(item => {
|
||||
if (item.classId != '' && item.classId > 0) {
|
||||
// this.classCertificate.push(item)
|
||||
} else {
|
||||
that.selfStudyCertificate.push(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
},300)
|
||||
}else{
|
||||
that.flag = false
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
|
||||
}).catch(e => {
|
||||
that.flag = false
|
||||
uni.hideLoading()
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'error'
|
||||
})
|
||||
});
|
||||
},
|
||||
showPrevQuestion() {
|
||||
// 上一题
|
||||
this.curIndex1--
|
||||
// this.curQuestion.answerIds = []
|
||||
this.curQuestion = {
|
||||
...this.testPaper[this.curIndex1]
|
||||
}
|
||||
this.testPaper[this.curIndex1].hadOpend = true
|
||||
console.log('----------------', this.testPaper );
|
||||
this.noAnswerList = this.getNoAnswerList()
|
||||
this.haveAnswerList = this.gethaveAnswerList()
|
||||
},
|
||||
showNextQuestion() {
|
||||
debounce(async () => {
|
||||
// 下一题
|
||||
this.curIndex1++
|
||||
// this.curQuestion.answerIds = []
|
||||
this.curQuestion = {
|
||||
...this.testPaper[this.curIndex1]
|
||||
}
|
||||
this.testPaper[this.curIndex1].hadOpend = true
|
||||
// console.log('+++++++++++++++', this.testPaper, );
|
||||
this.noAnswerList = this.getNoAnswerList()
|
||||
this.haveAnswerList = this.gethaveAnswerList()
|
||||
},300)
|
||||
},
|
||||
clickOption(item, index) {
|
||||
// debounce(async () => {
|
||||
console.log('item', item, index, this.curIndex1);
|
||||
if (this.curQuestion.type == 0) {
|
||||
this.testPaper[this.curIndex1].answerIds = [item.id]
|
||||
this.curQuestion.answerIds = [item.id]
|
||||
// console.log('666666666', this.testPaper, this.curQuestion.answerIds);
|
||||
this.$forceUpdate()
|
||||
} else if (this.curQuestion.type == 1) {
|
||||
console.log('多选');
|
||||
var isIN = this.curQuestion.answerIds.findIndex(itemss => {
|
||||
return itemss == item.id
|
||||
})
|
||||
if (isIN >= 0) {
|
||||
console.log('有重复的,删除对应的', isIN);
|
||||
this.testPaper[this.curIndex1].answerIds.splice(isIN, 1)
|
||||
this.curQuestion.answerIds.splice(isIN, 1)
|
||||
} else {
|
||||
this.testPaper[this.curIndex1].answerIds.push(item.id)
|
||||
|
||||
this.curQuestion.answerIds = [...this.testPaper[this.curIndex1].answerIds]
|
||||
}
|
||||
}
|
||||
this.noAnswerList = this.getNoAnswerList()
|
||||
this.haveAnswerList = this.gethaveAnswerList()
|
||||
console.log('this.testPaper.',this.testPaper.id);
|
||||
this.saveQuestAnswer(this.examId,this.curIndex1+1,this.curQuestion.answerIds.join(','))
|
||||
console.log('noAnswerList', this.noAnswerList)
|
||||
// },300)
|
||||
},
|
||||
onPageJump(url, id) {
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}`,
|
||||
});
|
||||
},
|
||||
setDesc() {
|
||||
const letterArr = []
|
||||
// 字母A的code值是65,但因为已经到字母D了,所以直接从69E开始循环
|
||||
for (let i = 65; i < 91; i++) {
|
||||
letterArr[i] = String.fromCharCode(i)
|
||||
}
|
||||
return letterArr
|
||||
},
|
||||
async getTestPage() {
|
||||
uni.showLoading({
|
||||
title: '正在生成试卷'
|
||||
})
|
||||
console.log('this.courseId',this.courseId);
|
||||
await $http.request({
|
||||
url: "common/classExam/generateExamPaper",
|
||||
method: "POST",
|
||||
data: {
|
||||
// "classId":
|
||||
"type":"2",//考试类型 1小班 2自考
|
||||
"relationId": parseInt(this.courseId), //小班id、课程id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(async res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
// that.isHave = true
|
||||
res.examPaper.forEach(item => {
|
||||
item.answerIds = []
|
||||
item.hadOpend = false // 是否呗打开过
|
||||
var code = 0
|
||||
item.options.forEach(item1 => {
|
||||
const randomAbc = this.setDesc().splice(65)
|
||||
item1.content = randomAbc[code] + '、' + item1.content
|
||||
code++
|
||||
})
|
||||
})
|
||||
this.testPaper = res.examPaper
|
||||
this.examId = res.id
|
||||
this.paperCreateTime = 1
|
||||
this.endTime = res.planEndTime
|
||||
var severNowTime = await this.getServerTime()
|
||||
this.secondTimeDif = this.endTime - severNowTime // 时间差 毫秒
|
||||
let that = this
|
||||
if(this.secondTimeDif > 0){
|
||||
this.timeDif.hour = parseInt((this.secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
|
||||
this.timeDif.minutes = parseInt((this.secondTimeDif % (1000 * 60 * 60)) / (1000 * 60))
|
||||
this.timeDif.second = (this.secondTimeDif % (1000 * 60)) / 1000
|
||||
console.log('this.endTime',this.timeDif.hour, this.timeDif.minutes, this.timeDif.second);
|
||||
}else{
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:'您的时间已经结束,即将返回课程页面',
|
||||
confirmText:'好的',
|
||||
showCancel:fals,
|
||||
success: (res) => {
|
||||
if(res.confirm){
|
||||
that.goToClass()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.curQuestion = {
|
||||
...this.testPaper[this.curIndex1]
|
||||
}
|
||||
this.testPaper[this.curIndex1].hadOpend = true
|
||||
uni.showToast({
|
||||
title: '获取成功',
|
||||
icon: 'success'
|
||||
})
|
||||
console.log(res, '试卷', this.curQuestion)
|
||||
this.pagetitle = '正在考试'
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.errMsg,
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.goToClass()
|
||||
},1000)
|
||||
});
|
||||
},
|
||||
// 查询证书情况
|
||||
async getCertificateInfo() {
|
||||
var list = undefined
|
||||
await $http.request({
|
||||
url: "common/userCertificate/getUserCertificateList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"type": '', //证书类型A a证 B b证 ZK自考
|
||||
"courseId": this.courseId //课程id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code != 0) {
|
||||
uni.showToast({
|
||||
title: res.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (res.code == 0) {
|
||||
res.certificateList.forEach(item => {
|
||||
item.certificateUrl && item.certificateUrl != '' ? item
|
||||
.certificateUrlList = item.certificateUrl.split(',') : item
|
||||
.certificateUrlList = []
|
||||
})
|
||||
list = res.certificateList
|
||||
}
|
||||
console.log('证书接口请求结果', res);
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
});
|
||||
return list
|
||||
},
|
||||
giveZero() {
|
||||
// 没有完成完成考试,记为0分
|
||||
},
|
||||
showElart() {
|
||||
// uni.showModal({
|
||||
// title:'提示',
|
||||
// content:"您还没有完成考试,确定要离开吗?离开后成绩会记为0分,是否继续?"
|
||||
// })
|
||||
},
|
||||
goToClass() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/course/courseDetail?id=${this.courseId}`
|
||||
})
|
||||
},
|
||||
hidePopup() {
|
||||
this.showPopup = false
|
||||
this.showQuestIndex = false
|
||||
},
|
||||
clickIndex(val) {
|
||||
this.curIndex1 = val - 1
|
||||
console.log('val', val, this.curIndex1, this.testPaper.length);
|
||||
for (var i = 0; i < this.curIndex1; i++) {
|
||||
this.testPaper[i].hadOpend = true
|
||||
}
|
||||
this.curQuestion = this.testPaper[this.curIndex1]
|
||||
this.testPaper[this.curIndex1].hadOpend = true
|
||||
this.hidePopup()
|
||||
this.noAnswerList = this.getNoAnswerList()
|
||||
this.haveAnswerList = this.gethaveAnswerList()
|
||||
},
|
||||
hourUp(start,e) {
|
||||
// 比现在多几个小时
|
||||
// var end = Date.now()
|
||||
var startTimeDate = new Date(start)
|
||||
var startTime = startTimeDate.getTime();
|
||||
var step = 1000 * 60 * 60 * e // 时间间隔
|
||||
var interval = startTime + step; //开始 + 时长 = 结束的毫秒数
|
||||
// var a = new Date(interval)
|
||||
console.log('aaaaaaaaaa结束时间的毫秒数,时间戳',interval);
|
||||
return interval
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/style/mixin.scss";
|
||||
.congritulations {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
text-align: center;
|
||||
margin: 10rpx auto;
|
||||
display: block;
|
||||
image {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
}
|
||||
.popup_box {
|
||||
padding-bottom: 20rpx;
|
||||
width: 85vw;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
height: auto;
|
||||
|
||||
.title {
|
||||
font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
|
||||
font-weight: normal;
|
||||
font-size: 46rpx;
|
||||
color: $themeColor;
|
||||
background-color: #f5f5f5;
|
||||
// line-height: 46rpx;
|
||||
padding: 20rpx;
|
||||
// border-leradius: 6px;
|
||||
border-top-left-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 26rpx;
|
||||
letter-spacing: 0.15rpx;
|
||||
padding: 20rpx;
|
||||
color: #3f3f3f;
|
||||
|
||||
.top {
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
|
||||
.center {
|
||||
line-height: 40rpx;
|
||||
// padding:0 10rpx;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
width: 100%;
|
||||
margin-top: 60rpx;
|
||||
|
||||
font-size: 24rpx;
|
||||
line-height: 26rpx;
|
||||
color: #b0b0b0;
|
||||
}
|
||||
}
|
||||
|
||||
.button_box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.u-button {
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
|
||||
.u-button:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.questIndx { overflow: hidden;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
span{padding: 20rpx 0; display: inline-block;}
|
||||
.red{border-color: #f56c6c; color: #f56c6c;}
|
||||
.green{
|
||||
border-color: #67c23a; color: #67c23a;
|
||||
}
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
background-color: #fff;
|
||||
// padding: 6rpx 10rpx;
|
||||
display: flex;
|
||||
// justify-content: center;
|
||||
border-radius: 10rpx;
|
||||
// align-items: center;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
.cur {
|
||||
background-color: #409eff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.guanli {
|
||||
padding: 40rpx;
|
||||
max-height: 60vh;
|
||||
overflow-y: scroll;
|
||||
h3 {
|
||||
text-align: center;
|
||||
margin-bottom: 20rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
background: #fbe8e8;
|
||||
color: #f56c6c;
|
||||
line-height: 50rpx;
|
||||
font-size: 28rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.questionType {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 20rpx;
|
||||
background-color: $themeColor;
|
||||
color: #fff;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 0 50rpx 50rpx 0;
|
||||
}
|
||||
.checkQuestBtn {
|
||||
margin-left: 10rpx;
|
||||
// position: absolute;
|
||||
// right: 20rpx;
|
||||
// top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
// border: 1px solid $themeColor;
|
||||
background-color: #409eff;
|
||||
color: #fff;
|
||||
// padding: 10rpx 20rpx;
|
||||
// border-radius: 0 50rpx 50rpx 0;
|
||||
}
|
||||
// .checkQuestBtn {
|
||||
// position: absolute;
|
||||
// right: 20rpx;
|
||||
// top: 20rpx;
|
||||
// border: 1px solid $themeColor;
|
||||
// color: $themeColor;
|
||||
// // padding: 10rpx 20rpx;
|
||||
// // border-radius: 0 50rpx 50rpx 0;
|
||||
// }
|
||||
.scroll-Y {
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.scroll-view_H {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.scroll-view-item {
|
||||
// height: 300rpx;
|
||||
line-height: 300rpx;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.scroll-view-item_H {
|
||||
display: inline-block;
|
||||
width: 13%;
|
||||
// height: 300rpx;
|
||||
overflow: hidden;
|
||||
// line-height: 300rpx;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.haveResult {
|
||||
background-color: #fff;
|
||||
padding: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.scoreBox {
|
||||
margin-top: 100rpx;
|
||||
color: #333;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.score {
|
||||
font-size: 50rpx;
|
||||
}
|
||||
|
||||
.question {
|
||||
padding: 20rpx;
|
||||
padding-top: 100rpx;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.optionsBox {
|
||||
margin: 30rpx 0;
|
||||
|
||||
.item {
|
||||
border: 1px solid #eee;
|
||||
padding: 20rpx 16rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.choosed {
|
||||
border-color: #b3d8ff;
|
||||
color: #409eff;
|
||||
background-color: #ecf5ff;
|
||||
}
|
||||
|
||||
.right {
|
||||
border-color: #c2e7b0;
|
||||
color: #67c23a;
|
||||
background-color: #f0f9eb;
|
||||
}
|
||||
|
||||
.wrong {
|
||||
border-color: #fbc4c4;
|
||||
color: #f56c6c;
|
||||
background-color: #fef0f0;
|
||||
}
|
||||
}
|
||||
|
||||
.result_imgBox {
|
||||
width: 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.timeBox {
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.questIndx {
|
||||
|
||||
.cur {
|
||||
border-color:#409eff ;
|
||||
background-color: #409eff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.questIndxPup{
|
||||
justify-content: space-around;
|
||||
flex-wrap: wrap;
|
||||
text{
|
||||
display: inline-block; margin: 10rpx;
|
||||
}
|
||||
}
|
||||
.btnBox {
|
||||
.item {
|
||||
width: 40%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -267,12 +267,13 @@
|
||||
});
|
||||
this.getOS()
|
||||
// #endif
|
||||
this.getCountyCode()
|
||||
this.getSettlement()
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
// this.closeMusic()
|
||||
this.getCountyCode()
|
||||
this.getSettlement()
|
||||
|
||||
},
|
||||
|
||||
//方法
|
||||
|
||||
BIN
static/icon/fugou.png
Normal file
BIN
static/icon/fugou.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
static/icon/notbuy.png
Normal file
BIN
static/icon/notbuy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
static/icon/xunzhang.png
Normal file
BIN
static/icon/xunzhang.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
BIN
static/icon/yesbuy.png
Normal file
BIN
static/icon/yesbuy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Reference in New Issue
Block a user