修改
This commit is contained in:
parent
ea4ae6d7ff
commit
f12372cbb2
@ -23,10 +23,12 @@
|
||||
info() {
|
||||
selectNurseAppletPersonTrainingItemDetailsList(this.trainingItemId, this.nurseStationPersonId).then(
|
||||
res => {
|
||||
res.data.trainingItemContent = res.data.trainingItemContent.replace(/\<img/gi,
|
||||
"<br/> <img class='richPic'")
|
||||
res.data.trainingItemContent = res.data.trainingItemContent.replace(/\<p/gi,
|
||||
"<p class='ptext'")
|
||||
if (res.data.trainingItemContent) {
|
||||
res.data.trainingItemContent = res.data.trainingItemContent.replace(/\<img/gi,
|
||||
"<br/> <img class='richPic'")
|
||||
res.data.trainingItemContent = res.data.trainingItemContent.replace(/\<p/gi,
|
||||
"<p class='ptext'")
|
||||
}
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
|
||||
@ -66,9 +66,15 @@
|
||||
},
|
||||
//跳转图文或者视频学习
|
||||
gographicvideo(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/learning/learning?trainingParentId=${item.id}`
|
||||
})
|
||||
if (item.trainingItemType == 'VIDEO_LEARNING') {
|
||||
uni.navigateTo({
|
||||
url: `/pages/Videolearning/Videolearning?trainingItemId=${item.id}&&trainingItemType=${item.trainingItemType}`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/pages/learning/learning?trainingParentId=${item.id}`
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
onReachBottom() { //下滑加载
|
||||
|
||||
@ -66,9 +66,15 @@
|
||||
},
|
||||
//我的学习
|
||||
goOrderlearning(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/Orderlearning/Orderlearning?trainingOrderStatus=${item.trainingOrderStatus}&trainingParentId=${item.trainingItemId}&trainingOrderNo=${item.trainingOrderNo}`
|
||||
})
|
||||
if (item.trainingItemType == 'VIDEO_LEARNING') {
|
||||
uni.navigateTo({
|
||||
url: `/pages/Ordervideolearning/Ordervideolearning?trainingItemType=${item.trainingItemType}&trainingOrderStatus=${item.trainingOrderStatus}&trainingItemId=${item.trainingItemId}&trainingOrderNo=${item.trainingOrderNo}&trainingOrderDetailsId=${item.trainingOrderDetailsId}`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/pages/Orderlearning/Orderlearning?trainingOrderStatus=${item.trainingOrderStatus}&trainingParentId=${item.trainingItemId}&trainingOrderNo=${item.trainingOrderNo}`
|
||||
})
|
||||
}
|
||||
},
|
||||
//列表信息
|
||||
info() {
|
||||
|
||||
@ -4,7 +4,90 @@
|
||||
margin: 15rpx auto;
|
||||
color: #666666;
|
||||
background-color: #fff;
|
||||
.popup {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
|
||||
.buyselect {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
margin: 40rpx auto 0;
|
||||
position: absolute;
|
||||
top: 100rpx;
|
||||
|
||||
image {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 48rpx;
|
||||
transform: translateY(-50%);
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
position: absolute;
|
||||
left: 150rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
line-height: 100rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.buybtn {
|
||||
width: 70%;
|
||||
height: 70rpx;
|
||||
background: #4271B9;
|
||||
border-radius: 5rpx;
|
||||
line-height: 70rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
bottom: 40rpx;
|
||||
left: 15%;
|
||||
}
|
||||
|
||||
.popuptitle {
|
||||
width: 100%;
|
||||
font-size: 41rpx;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 40rpx;
|
||||
}
|
||||
}
|
||||
.bottomitem {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 1rpx 21rpx 0rpx rgba(204, 204, 204, 0.75);
|
||||
|
||||
.buy {
|
||||
width: 150rpx;
|
||||
height: 70rpx;
|
||||
background: #4271B9;
|
||||
line-height: 70rpx;
|
||||
border-radius: 5rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
right: 50rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.price {
|
||||
position: absolute;
|
||||
left: 50rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
font-size: 42rpx;
|
||||
font-weight: 500;
|
||||
color: #EA706A;
|
||||
line-height: 130rpx;
|
||||
}
|
||||
}
|
||||
.directory {
|
||||
padding-bottom: 420rpx;
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
<view class="Introduce">
|
||||
{{item.itemDirectoryIntroduce?item.itemDirectoryIntroduce:''}}
|
||||
</view>
|
||||
<view class="" v-if="trainingOrderStatus=='PAY'">
|
||||
<view class="" v-if="list.trainingOrderStatus=='PAY'">
|
||||
<view class="play" @tap='videoplay(item)'
|
||||
:style="item.itemDirectoryWatchStatus=='NOT_WATCHED'?'background-color: #3D7DCA;color:#fff':''"
|
||||
v-if="item.itemDirectoryWatchStatus=='NOT_WATCHED'&&!item.videoshow">
|
||||
@ -74,6 +74,26 @@
|
||||
@play='videoplays'></video>
|
||||
</u-popup> -->
|
||||
<u-toast ref="uToast" />
|
||||
<view class="bottomitem" v-if="bottombuyshow&&list.trainingOrderStatus=='WAIT_PAY'">
|
||||
<view class="price">
|
||||
¥{{list.trainingItemPrice?list.trainingItemPrice:0}}
|
||||
</view>
|
||||
<view class="buy" @tap='buy'>
|
||||
购买
|
||||
</view>
|
||||
</view>
|
||||
<u-popup v-model="buyshow" mode='bottom' height='500' class='popup' safe-area-inset-bottom>
|
||||
<view class="popuptitle">请选择支付方式</view>
|
||||
<view class="buyselect">
|
||||
<image src="../../static/wechat.png" mode=""></image>
|
||||
<view class="text">
|
||||
微信支付
|
||||
</view>
|
||||
</view>
|
||||
<view class="buybtn" @tap='tobuy'>
|
||||
确认支付{{list.trainingItemPrice?list.trainingItemPrice:0}}元
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
<view class="" v-else style="padding-top: 100rpx;">
|
||||
<u-empty text="暂无内容" mode="list" icon-size='240' font-size='32'></u-empty>
|
||||
@ -86,6 +106,10 @@
|
||||
insertTrainingItemWatchRecord,
|
||||
getTrainingItemWatchRecord
|
||||
} from '@/api/Ordervideolearning/index.js'
|
||||
import {
|
||||
trainingItemOrder,
|
||||
appletTrainingOrderPay
|
||||
} from '@/api/learning/index.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -104,10 +128,12 @@
|
||||
videoitem: {
|
||||
watchTime: 0,
|
||||
}, //视频对象
|
||||
trainingOrderStatus: undefined,
|
||||
// trainingOrderStatus: undefined,
|
||||
trainingOrderDetailsId: undefined,
|
||||
videoerroshow: true,
|
||||
videoContext: undefined,
|
||||
bottombuyshow: false, //下面的购买divcss
|
||||
buyshow: false, //购买弹框
|
||||
};
|
||||
},
|
||||
onUnload() {
|
||||
@ -141,6 +167,100 @@
|
||||
// });
|
||||
// },
|
||||
methods: {
|
||||
//购买
|
||||
tobuy() {
|
||||
var that = this
|
||||
const nurseStationId = uni.getStorageSync('nurseStationId');
|
||||
if (nurseStationId) {
|
||||
var obj = {
|
||||
"trainingItemId": undefined,
|
||||
"nurseStationId": undefined,
|
||||
"nurseStationPersonId": undefined,
|
||||
"trainingOrderAmount": undefined,
|
||||
"nursePersonName": undefined,
|
||||
}
|
||||
obj.trainingItemId = this.list.trainingItemId
|
||||
obj.nurseStationId = uni.getStorageSync('nurseStationId');
|
||||
obj.nurseStationPersonId = this.nurseStationPersonId
|
||||
obj.nursePersonName = uni.getStorageSync('nursePersonName');
|
||||
obj.trainingOrderAmount = this.list.trainingItemPrice
|
||||
trainingItemOrder(obj).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data.trainingOrderAmount > 0) {
|
||||
let objs = {
|
||||
"openid": uni.getStorageSync('openid'),
|
||||
"nurseStationPersonId": res.data.nurseStationPersonId,
|
||||
"orderNo": res.data.trainingOrderNo,
|
||||
"payType": "WECHAT_PAY",
|
||||
"orderChannel": "WECHAT_APPLET",
|
||||
"buySource": "TRAINING",
|
||||
"paymentPrice": res.data.trainingOrderAmount,
|
||||
}
|
||||
appletTrainingOrderPay(objs).then(response => {
|
||||
if (response.code == 200) {
|
||||
uni.requestPayment({
|
||||
timeStamp: response.data.timeStamp,
|
||||
nonceStr: response.data.nonceStr,
|
||||
package: response.data.prepayId,
|
||||
signType: response.data.signType,
|
||||
paySign: response.data.paySign,
|
||||
success: function(res) {
|
||||
that.buyshow = false
|
||||
that.bottombuyshow = false
|
||||
that.info();
|
||||
that.$refs.uToast.show({
|
||||
title: '支付成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
that.$refs.uToast.show({
|
||||
title: '取消支付',
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
url: `/pages/Orderdetails/Orderdetails?trainingOrderNo=${res.data.trainingOrderNo}`
|
||||
})
|
||||
that.buyshow = false
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.buyshow = false
|
||||
this.$refs.uToast.show({
|
||||
title: response.msg,
|
||||
type: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.buyshow = false
|
||||
that.bottombuyshow = false
|
||||
that.info();
|
||||
}
|
||||
} else {
|
||||
this.buyshow = false
|
||||
this.$refs.uToast.show({
|
||||
title: res.msg,
|
||||
type: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.buyshow = false
|
||||
that.$refs.uToast.show({
|
||||
title: '请您重新登录',
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
}
|
||||
},
|
||||
//打开购买弹框
|
||||
buy() {
|
||||
this.buyshow = true
|
||||
},
|
||||
//播放到末尾
|
||||
videoended(e) {
|
||||
this.videoContext.stop()
|
||||
@ -327,7 +447,7 @@
|
||||
watchTime: 0
|
||||
}
|
||||
this.baseurl = baseurl
|
||||
this.trainingOrderStatus = options.trainingOrderStatus
|
||||
// this.trainingOrderStatus = options.trainingOrderStatus
|
||||
this.trainingItemId = options.trainingItemId
|
||||
this.trainingOrderNo = options.trainingOrderNo
|
||||
this.trainingOrderDetailsId = options.trainingOrderDetailsId
|
||||
@ -336,6 +456,9 @@
|
||||
if (value) {
|
||||
that.nurseStationPersonId = value
|
||||
} else {}
|
||||
if (options.trainingItemType) {
|
||||
this.bottombuyshow = true
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -4,7 +4,90 @@
|
||||
margin: 15rpx auto;
|
||||
color: #666666;
|
||||
background-color: #fff;
|
||||
.popup {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
|
||||
.buyselect {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
margin: 40rpx auto 0;
|
||||
position: absolute;
|
||||
top: 100rpx;
|
||||
|
||||
image {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 48rpx;
|
||||
transform: translateY(-50%);
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
position: absolute;
|
||||
left: 150rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
line-height: 100rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.buybtn {
|
||||
width: 70%;
|
||||
height: 70rpx;
|
||||
background: #4271B9;
|
||||
border-radius: 5rpx;
|
||||
line-height: 70rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
bottom: 40rpx;
|
||||
left: 15%;
|
||||
}
|
||||
|
||||
.popuptitle {
|
||||
width: 100%;
|
||||
font-size: 41rpx;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 40rpx;
|
||||
}
|
||||
}
|
||||
.bottomitem {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 1rpx 21rpx 0rpx rgba(204, 204, 204, 0.75);
|
||||
|
||||
.buy {
|
||||
width: 150rpx;
|
||||
height: 70rpx;
|
||||
background: #4271B9;
|
||||
line-height: 70rpx;
|
||||
border-radius: 5rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
right: 50rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.price {
|
||||
position: absolute;
|
||||
left: 50rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
font-size: 42rpx;
|
||||
font-weight: 500;
|
||||
color: #EA706A;
|
||||
line-height: 130rpx;
|
||||
}
|
||||
}
|
||||
.directory {
|
||||
padding-bottom: 420rpx;
|
||||
|
||||
|
||||
@ -71,6 +71,26 @@
|
||||
<!-- <u-popup v-model="videoshow" mode="center" closeable @close='videoshowfalse'>
|
||||
</u-popup> -->
|
||||
<u-toast ref="uToast" />
|
||||
<view class="bottomitem" v-if="bottombuyshow&&list.trainingOrderDetailsBuy=='NOT_BUY'">
|
||||
<view class="price">
|
||||
¥{{list.trainingItemPrice?list.trainingItemPrice:0}}
|
||||
</view>
|
||||
<view class="buy" @tap='buy'>
|
||||
购买
|
||||
</view>
|
||||
</view>
|
||||
<u-popup v-model="buyshow" mode='bottom' height='500' class='popup' safe-area-inset-bottom>
|
||||
<view class="popuptitle">请选择支付方式</view>
|
||||
<view class="buyselect">
|
||||
<image src="../../static/wechat.png" mode=""></image>
|
||||
<view class="text">
|
||||
微信支付
|
||||
</view>
|
||||
</view>
|
||||
<view class="buybtn" @tap='tobuy'>
|
||||
确认支付{{list.trainingItemPrice?list.trainingItemPrice:0}}元
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
<view class="" v-else style="padding-top: 100rpx;">
|
||||
<u-empty text="暂无内容" mode="list" icon-size='240' font-size='32'></u-empty>
|
||||
@ -83,6 +103,10 @@
|
||||
insertTrainingItemWatchRecord,
|
||||
getTrainingItemWatchRecord
|
||||
} from '@/api/Videolearning/index.js'
|
||||
import {
|
||||
trainingItemOrder,
|
||||
appletTrainingOrderPay
|
||||
} from '@/api/learning/index.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -102,6 +126,8 @@
|
||||
}, //视频对象
|
||||
videoContext: null,
|
||||
videoerroshow: true,
|
||||
bottombuyshow: false, //下面的购买divcss
|
||||
buyshow: false, //购买弹框
|
||||
};
|
||||
},
|
||||
onUnload() {
|
||||
@ -135,6 +161,100 @@
|
||||
plus.screen.lockOrientation("portrait-primary");
|
||||
},
|
||||
methods: {
|
||||
//购买
|
||||
tobuy() {
|
||||
var that = this
|
||||
const nurseStationId = uni.getStorageSync('nurseStationId');
|
||||
if (nurseStationId) {
|
||||
var obj = {
|
||||
"trainingItemId": undefined,
|
||||
"nurseStationId": undefined,
|
||||
"nurseStationPersonId": undefined,
|
||||
"trainingOrderAmount": undefined,
|
||||
"nursePersonName": undefined,
|
||||
}
|
||||
obj.trainingItemId = this.list.trainingItemId
|
||||
obj.nurseStationId = uni.getStorageSync('nurseStationId');
|
||||
obj.nurseStationPersonId = this.nurseStationPersonId
|
||||
obj.nursePersonName = uni.getStorageSync('nursePersonName');
|
||||
obj.trainingOrderAmount = this.list.trainingItemPrice
|
||||
trainingItemOrder(obj).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data.trainingOrderAmount > 0) {
|
||||
let objs = {
|
||||
"openid": uni.getStorageSync('openid'),
|
||||
"nurseStationPersonId": res.data.nurseStationPersonId,
|
||||
"orderNo": res.data.trainingOrderNo,
|
||||
"payType": "WECHAT_PAY",
|
||||
"orderChannel": "WECHAT_APPLET",
|
||||
"buySource": "TRAINING",
|
||||
"paymentPrice": res.data.trainingOrderAmount,
|
||||
}
|
||||
appletTrainingOrderPay(objs).then(response => {
|
||||
if (response.code == 200) {
|
||||
uni.requestPayment({
|
||||
timeStamp: response.data.timeStamp,
|
||||
nonceStr: response.data.nonceStr,
|
||||
package: response.data.prepayId,
|
||||
signType: response.data.signType,
|
||||
paySign: response.data.paySign,
|
||||
success: function(res) {
|
||||
that.buyshow = false
|
||||
that.bottombuyshow = false
|
||||
that.info();
|
||||
that.$refs.uToast.show({
|
||||
title: '支付成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
that.$refs.uToast.show({
|
||||
title: '取消支付',
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
url: `/pages/Orderdetails/Orderdetails?trainingOrderNo=${res.data.trainingOrderNo}`
|
||||
})
|
||||
that.buyshow = false
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.buyshow = false
|
||||
this.$refs.uToast.show({
|
||||
title: response.msg,
|
||||
type: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.buyshow = false
|
||||
that.bottombuyshow = false
|
||||
that.info();
|
||||
}
|
||||
} else {
|
||||
this.buyshow = false
|
||||
this.$refs.uToast.show({
|
||||
title: res.msg,
|
||||
type: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.buyshow = false
|
||||
that.$refs.uToast.show({
|
||||
title: '请您重新登录',
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
}
|
||||
},
|
||||
//打开购买弹框
|
||||
buy() {
|
||||
this.buyshow = true
|
||||
},
|
||||
//播放到末尾
|
||||
videoended(e) {
|
||||
this.videoContext.stop()
|
||||
@ -324,6 +444,9 @@
|
||||
that.nurseStationPersonId = value
|
||||
that.info();
|
||||
} else {}
|
||||
if (options.trainingItemType) {
|
||||
this.bottombuyshow = true
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -257,10 +257,12 @@
|
||||
//主信息
|
||||
infos() {
|
||||
selectNurseAppletPersonTrainingParent(this.trainingParentId, this.nurseStationPersonId).then(res => {
|
||||
res.rows[0].trainingItemContent = res.rows[0].trainingItemContent.replace(/\<img/gi,
|
||||
"<br/> <img class='richPic'")
|
||||
res.rows[0].trainingItemContent = res.rows[0].trainingItemContent.replace(/\<p/gi,
|
||||
"<p class='ptext'")
|
||||
if (res.rows[0].trainingItemContent) {
|
||||
res.rows[0].trainingItemContent = res.rows[0].trainingItemContent.replace(/\<img/gi,
|
||||
"<br/> <img class='richPic'")
|
||||
res.rows[0].trainingItemContent = res.rows[0].trainingItemContent.replace(/\<p/gi,
|
||||
"<p class='ptext'")
|
||||
}
|
||||
this.infoslist = res.rows[0]
|
||||
})
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user