修改
This commit is contained in:
parent
187a9145c9
commit
fe7b1cb158
@ -6,3 +6,13 @@ export function personTrainingItem(pageNum, pageSize, trainingCategoryId, nurseS
|
|||||||
method: 'GET'
|
method: 'GET'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//生成订单
|
||||||
|
export function trainingItemOrder(data) {
|
||||||
|
return request({
|
||||||
|
url: `/nurseApplet/personLearn/trainingItemOrder`,
|
||||||
|
method: 'POST',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
21
pages.json
21
pages.json
@ -4,18 +4,18 @@
|
|||||||
},
|
},
|
||||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||||
{
|
{
|
||||||
|
"path": "pages/startup/startup",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},{
|
||||||
"path": "pages/Videolearning/Videolearning",
|
"path": "pages/Videolearning/Videolearning",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "视频学习",
|
"navigationBarTitleText": "视频学习",
|
||||||
"onReachBottomDistance": 50, //距离底部多远时触发 单位为px
|
"onReachBottomDistance": 50, //距离底部多远时触发 单位为px
|
||||||
"enablePullDownRefresh": true //设置参数为true
|
"enablePullDownRefresh": true //设置参数为true
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
"path": "pages/startup/startup",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},{
|
},{
|
||||||
"path": "pages/MyLearning/MyLearning",
|
"path": "pages/MyLearning/MyLearning",
|
||||||
"style": {
|
"style": {
|
||||||
@ -129,6 +129,15 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
,{
|
||||||
|
"path" : "pages/Orderlist/Orderlist",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "订单列表",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
|
|||||||
19
pages/Orderlist/Orderlist.vue
Normal file
19
pages/Orderlist/Orderlist.vue
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-popup v-model="buyshow" mode='bottom' height='500' class='popup'>
|
<u-popup v-model="buyshow" mode='bottom' height='500' class='popup' safe-area-inset-bottom>
|
||||||
<view class="popuptitle">请选择支付方式</view>
|
<view class="popuptitle">请选择支付方式</view>
|
||||||
<view class="buyselect">
|
<view class="buyselect">
|
||||||
<image src="../../static/wechat.png" mode=""></image>
|
<image src="../../static/wechat.png" mode=""></image>
|
||||||
@ -28,16 +28,18 @@
|
|||||||
微信支付
|
微信支付
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="buybtn">
|
<view class="buybtn" @tap='tobuy'>
|
||||||
确认支付¥{{buylist.trainingItemPrice}}
|
确认支付¥{{buylist.trainingItemPrice}}
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
personTrainingItem
|
personTrainingItem,
|
||||||
|
trainingItemOrder
|
||||||
} from '@/api/Videolearning/index.js'
|
} from '@/api/Videolearning/index.js'
|
||||||
import baseurl from '@/api/baseurl.js'
|
import baseurl from '@/api/baseurl.js'
|
||||||
export default {
|
export default {
|
||||||
@ -68,6 +70,31 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//购买
|
//购买
|
||||||
|
tobuy() {
|
||||||
|
var obj = {
|
||||||
|
"trainingItemIdList": [],
|
||||||
|
"nurseStationId": undefined,
|
||||||
|
"nurseStationPersonId": undefined,
|
||||||
|
"trainingOrderAmount": undefined,
|
||||||
|
"nursePersonName": undefined
|
||||||
|
}
|
||||||
|
obj.nurseStationId = uni.getStorageSync('nurseStationId');
|
||||||
|
obj.nursePersonName = uni.getStorageSync('nursePersonName');
|
||||||
|
obj.trainingItemIdList.push(this.buylist.trainingItemId)
|
||||||
|
obj.nurseStationPersonId = this.nurseStationPersonId
|
||||||
|
obj.trainingOrderAmount = this.buylist.trainingItemPrice
|
||||||
|
trainingItemOrder(obj).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.buyshow = false
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '支付成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: '1500'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//打开购买弹框
|
||||||
buy(item) {
|
buy(item) {
|
||||||
this.buylist = item
|
this.buylist = item
|
||||||
this.buyshow = true
|
this.buyshow = true
|
||||||
|
|||||||
@ -4,9 +4,6 @@
|
|||||||
<view class="title">
|
<view class="title">
|
||||||
{{list.trainingItemTitle}}
|
{{list.trainingItemTitle}}
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="time">
|
|
||||||
有效期:2023.12.31
|
|
||||||
</view> -->
|
|
||||||
<view class="border"></view>
|
<view class="border"></view>
|
||||||
<u-tabs :list="tablist" :is-scroll="false" :current="tabcurrent" @change="change" font-size='34' bar-height='3'>
|
<u-tabs :list="tablist" :is-scroll="false" :current="tabcurrent" @change="change" font-size='34' bar-height='3'>
|
||||||
</u-tabs>
|
</u-tabs>
|
||||||
@ -61,7 +58,6 @@
|
|||||||
</u-popup>
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import baseurl from '@/api/baseurl.js'
|
import baseurl from '@/api/baseurl.js'
|
||||||
import {
|
import {
|
||||||
@ -94,9 +90,8 @@
|
|||||||
},
|
},
|
||||||
//关闭播放弹出框
|
//关闭播放弹出框
|
||||||
videoshowfalse() {
|
videoshowfalse() {
|
||||||
insertTrainingItemWatchRecord(this.videoitem).then(res => {
|
this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime)
|
||||||
console.log(res)
|
insertTrainingItemWatchRecord(this.videoitem).then(res => {})
|
||||||
})
|
|
||||||
},
|
},
|
||||||
//视频播放
|
//视频播放
|
||||||
videoplay(item) {
|
videoplay(item) {
|
||||||
@ -113,6 +108,7 @@
|
|||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
if (res.data.watchTime) {
|
if (res.data.watchTime) {
|
||||||
this.videoitem.watchTime = res.data.watchTime
|
this.videoitem.watchTime = res.data.watchTime
|
||||||
|
this.videoitem.watchTime = this.formatsecond(this.videoitem.watchTime)
|
||||||
}
|
}
|
||||||
this.videoshow = true
|
this.videoshow = true
|
||||||
}
|
}
|
||||||
@ -121,7 +117,31 @@
|
|||||||
//点击tabs
|
//点击tabs
|
||||||
change(index) {
|
change(index) {
|
||||||
this.tabcurrent = index;
|
this.tabcurrent = index;
|
||||||
}
|
},
|
||||||
|
//时分秒转秒
|
||||||
|
formatsecond(value) {
|
||||||
|
value = value.split(':')
|
||||||
|
value.forEach(e => {
|
||||||
|
e = Number(e)
|
||||||
|
})
|
||||||
|
value[0] = value[0] * 24 * 60
|
||||||
|
value[1] = value[1] * 60
|
||||||
|
value = value[0] + value[1] + value[2]
|
||||||
|
return value
|
||||||
|
},
|
||||||
|
//秒转时分秒
|
||||||
|
formatSeconds(value) {
|
||||||
|
let result = parseInt(value)
|
||||||
|
let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);
|
||||||
|
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result /
|
||||||
|
60 % 60));
|
||||||
|
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
|
||||||
|
let res = '';
|
||||||
|
res += `${h}:`;
|
||||||
|
res += `${m}:`;
|
||||||
|
res += `${s}`;
|
||||||
|
return res;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.baseurl = baseurl
|
this.baseurl = baseurl
|
||||||
|
|||||||
@ -48,6 +48,8 @@
|
|||||||
}
|
}
|
||||||
uni.setStorageSync("personRoleLoginFlag", res.data.personRoleLoginFlag)
|
uni.setStorageSync("personRoleLoginFlag", res.data.personRoleLoginFlag)
|
||||||
uni.setStorageSync("phone", res.data.phone)
|
uni.setStorageSync("phone", res.data.phone)
|
||||||
|
uni.setStorageSync("nursePersonName", res.data.nursePersonName)
|
||||||
|
uni.setStorageSync("nurseStationId", res.data.nurseStationId)
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '登录成功',
|
title: '登录成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user