修改
This commit is contained in:
parent
ea4ae6d7ff
commit
f12372cbb2
@ -23,10 +23,12 @@
|
|||||||
info() {
|
info() {
|
||||||
selectNurseAppletPersonTrainingItemDetailsList(this.trainingItemId, this.nurseStationPersonId).then(
|
selectNurseAppletPersonTrainingItemDetailsList(this.trainingItemId, this.nurseStationPersonId).then(
|
||||||
res => {
|
res => {
|
||||||
res.data.trainingItemContent = res.data.trainingItemContent.replace(/\<img/gi,
|
if (res.data.trainingItemContent) {
|
||||||
"<br/> <img class='richPic'")
|
res.data.trainingItemContent = res.data.trainingItemContent.replace(/\<img/gi,
|
||||||
res.data.trainingItemContent = res.data.trainingItemContent.replace(/\<p/gi,
|
"<br/> <img class='richPic'")
|
||||||
"<p class='ptext'")
|
res.data.trainingItemContent = res.data.trainingItemContent.replace(/\<p/gi,
|
||||||
|
"<p class='ptext'")
|
||||||
|
}
|
||||||
this.list = res.data
|
this.list = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@ -66,9 +66,15 @@
|
|||||||
},
|
},
|
||||||
//跳转图文或者视频学习
|
//跳转图文或者视频学习
|
||||||
gographicvideo(item) {
|
gographicvideo(item) {
|
||||||
uni.navigateTo({
|
if (item.trainingItemType == 'VIDEO_LEARNING') {
|
||||||
url: `/pages/learning/learning?trainingParentId=${item.id}`
|
uni.navigateTo({
|
||||||
})
|
url: `/pages/Videolearning/Videolearning?trainingItemId=${item.id}&&trainingItemType=${item.trainingItemType}`
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/learning/learning?trainingParentId=${item.id}`
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onReachBottom() { //下滑加载
|
onReachBottom() { //下滑加载
|
||||||
|
|||||||
@ -66,9 +66,15 @@
|
|||||||
},
|
},
|
||||||
//我的学习
|
//我的学习
|
||||||
goOrderlearning(item) {
|
goOrderlearning(item) {
|
||||||
uni.navigateTo({
|
if (item.trainingItemType == 'VIDEO_LEARNING') {
|
||||||
url: `/pages/Orderlearning/Orderlearning?trainingOrderStatus=${item.trainingOrderStatus}&trainingParentId=${item.trainingItemId}&trainingOrderNo=${item.trainingOrderNo}`
|
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() {
|
info() {
|
||||||
|
|||||||
@ -4,7 +4,90 @@
|
|||||||
margin: 15rpx auto;
|
margin: 15rpx auto;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
background-color: #fff;
|
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 {
|
.directory {
|
||||||
padding-bottom: 420rpx;
|
padding-bottom: 420rpx;
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
<view class="Introduce">
|
<view class="Introduce">
|
||||||
{{item.itemDirectoryIntroduce?item.itemDirectoryIntroduce:''}}
|
{{item.itemDirectoryIntroduce?item.itemDirectoryIntroduce:''}}
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-if="trainingOrderStatus=='PAY'">
|
<view class="" v-if="list.trainingOrderStatus=='PAY'">
|
||||||
<view class="play" @tap='videoplay(item)'
|
<view class="play" @tap='videoplay(item)'
|
||||||
:style="item.itemDirectoryWatchStatus=='NOT_WATCHED'?'background-color: #3D7DCA;color:#fff':''"
|
:style="item.itemDirectoryWatchStatus=='NOT_WATCHED'?'background-color: #3D7DCA;color:#fff':''"
|
||||||
v-if="item.itemDirectoryWatchStatus=='NOT_WATCHED'&&!item.videoshow">
|
v-if="item.itemDirectoryWatchStatus=='NOT_WATCHED'&&!item.videoshow">
|
||||||
@ -74,6 +74,26 @@
|
|||||||
@play='videoplays'></video>
|
@play='videoplays'></video>
|
||||||
</u-popup> -->
|
</u-popup> -->
|
||||||
<u-toast ref="uToast" />
|
<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>
|
||||||
<view class="" v-else style="padding-top: 100rpx;">
|
<view class="" v-else style="padding-top: 100rpx;">
|
||||||
<u-empty text="暂无内容" mode="list" icon-size='240' font-size='32'></u-empty>
|
<u-empty text="暂无内容" mode="list" icon-size='240' font-size='32'></u-empty>
|
||||||
@ -86,6 +106,10 @@
|
|||||||
insertTrainingItemWatchRecord,
|
insertTrainingItemWatchRecord,
|
||||||
getTrainingItemWatchRecord
|
getTrainingItemWatchRecord
|
||||||
} from '@/api/Ordervideolearning/index.js'
|
} from '@/api/Ordervideolearning/index.js'
|
||||||
|
import {
|
||||||
|
trainingItemOrder,
|
||||||
|
appletTrainingOrderPay
|
||||||
|
} from '@/api/learning/index.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -104,10 +128,12 @@
|
|||||||
videoitem: {
|
videoitem: {
|
||||||
watchTime: 0,
|
watchTime: 0,
|
||||||
}, //视频对象
|
}, //视频对象
|
||||||
trainingOrderStatus: undefined,
|
// trainingOrderStatus: undefined,
|
||||||
trainingOrderDetailsId: undefined,
|
trainingOrderDetailsId: undefined,
|
||||||
videoerroshow: true,
|
videoerroshow: true,
|
||||||
videoContext: undefined,
|
videoContext: undefined,
|
||||||
|
bottombuyshow: false, //下面的购买divcss
|
||||||
|
buyshow: false, //购买弹框
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
@ -141,6 +167,100 @@
|
|||||||
// });
|
// });
|
||||||
// },
|
// },
|
||||||
methods: {
|
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) {
|
videoended(e) {
|
||||||
this.videoContext.stop()
|
this.videoContext.stop()
|
||||||
@ -327,7 +447,7 @@
|
|||||||
watchTime: 0
|
watchTime: 0
|
||||||
}
|
}
|
||||||
this.baseurl = baseurl
|
this.baseurl = baseurl
|
||||||
this.trainingOrderStatus = options.trainingOrderStatus
|
// this.trainingOrderStatus = options.trainingOrderStatus
|
||||||
this.trainingItemId = options.trainingItemId
|
this.trainingItemId = options.trainingItemId
|
||||||
this.trainingOrderNo = options.trainingOrderNo
|
this.trainingOrderNo = options.trainingOrderNo
|
||||||
this.trainingOrderDetailsId = options.trainingOrderDetailsId
|
this.trainingOrderDetailsId = options.trainingOrderDetailsId
|
||||||
@ -336,6 +456,9 @@
|
|||||||
if (value) {
|
if (value) {
|
||||||
that.nurseStationPersonId = value
|
that.nurseStationPersonId = value
|
||||||
} else {}
|
} else {}
|
||||||
|
if (options.trainingItemType) {
|
||||||
|
this.bottombuyshow = true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -4,7 +4,90 @@
|
|||||||
margin: 15rpx auto;
|
margin: 15rpx auto;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
background-color: #fff;
|
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 {
|
.directory {
|
||||||
padding-bottom: 420rpx;
|
padding-bottom: 420rpx;
|
||||||
|
|
||||||
|
|||||||
@ -71,6 +71,26 @@
|
|||||||
<!-- <u-popup v-model="videoshow" mode="center" closeable @close='videoshowfalse'>
|
<!-- <u-popup v-model="videoshow" mode="center" closeable @close='videoshowfalse'>
|
||||||
</u-popup> -->
|
</u-popup> -->
|
||||||
<u-toast ref="uToast" />
|
<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>
|
||||||
<view class="" v-else style="padding-top: 100rpx;">
|
<view class="" v-else style="padding-top: 100rpx;">
|
||||||
<u-empty text="暂无内容" mode="list" icon-size='240' font-size='32'></u-empty>
|
<u-empty text="暂无内容" mode="list" icon-size='240' font-size='32'></u-empty>
|
||||||
@ -83,6 +103,10 @@
|
|||||||
insertTrainingItemWatchRecord,
|
insertTrainingItemWatchRecord,
|
||||||
getTrainingItemWatchRecord
|
getTrainingItemWatchRecord
|
||||||
} from '@/api/Videolearning/index.js'
|
} from '@/api/Videolearning/index.js'
|
||||||
|
import {
|
||||||
|
trainingItemOrder,
|
||||||
|
appletTrainingOrderPay
|
||||||
|
} from '@/api/learning/index.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -102,6 +126,8 @@
|
|||||||
}, //视频对象
|
}, //视频对象
|
||||||
videoContext: null,
|
videoContext: null,
|
||||||
videoerroshow: true,
|
videoerroshow: true,
|
||||||
|
bottombuyshow: false, //下面的购买divcss
|
||||||
|
buyshow: false, //购买弹框
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
@ -135,6 +161,100 @@
|
|||||||
plus.screen.lockOrientation("portrait-primary");
|
plus.screen.lockOrientation("portrait-primary");
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
videoended(e) {
|
||||||
this.videoContext.stop()
|
this.videoContext.stop()
|
||||||
@ -324,6 +444,9 @@
|
|||||||
that.nurseStationPersonId = value
|
that.nurseStationPersonId = value
|
||||||
that.info();
|
that.info();
|
||||||
} else {}
|
} else {}
|
||||||
|
if (options.trainingItemType) {
|
||||||
|
this.bottombuyshow = true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -257,10 +257,12 @@
|
|||||||
//主信息
|
//主信息
|
||||||
infos() {
|
infos() {
|
||||||
selectNurseAppletPersonTrainingParent(this.trainingParentId, this.nurseStationPersonId).then(res => {
|
selectNurseAppletPersonTrainingParent(this.trainingParentId, this.nurseStationPersonId).then(res => {
|
||||||
res.rows[0].trainingItemContent = res.rows[0].trainingItemContent.replace(/\<img/gi,
|
if (res.rows[0].trainingItemContent) {
|
||||||
"<br/> <img class='richPic'")
|
res.rows[0].trainingItemContent = res.rows[0].trainingItemContent.replace(/\<img/gi,
|
||||||
res.rows[0].trainingItemContent = res.rows[0].trainingItemContent.replace(/\<p/gi,
|
"<br/> <img class='richPic'")
|
||||||
"<p class='ptext'")
|
res.rows[0].trainingItemContent = res.rows[0].trainingItemContent.replace(/\<p/gi,
|
||||||
|
"<p class='ptext'")
|
||||||
|
}
|
||||||
this.infoslist = res.rows[0]
|
this.infoslist = res.rows[0]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user