This commit is contained in:
曹辉 2023-04-24 10:49:20 +08:00
parent 187a9145c9
commit fe7b1cb158
6 changed files with 105 additions and 18 deletions

View File

@ -6,3 +6,13 @@ export function personTrainingItem(pageNum, pageSize, trainingCategoryId, nurseS
method: 'GET'
})
}
//生成订单
export function trainingItemOrder(data) {
return request({
url: `/nurseApplet/personLearn/trainingItemOrder`,
method: 'POST',
data,
})
}

View File

@ -4,18 +4,18 @@
},
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/startup/startup",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},{
"path": "pages/Videolearning/Videolearning",
"style": {
"navigationBarTitleText": "视频学习",
"onReachBottomDistance": 50, // px
"enablePullDownRefresh": true //true
}
}, {
"path": "pages/startup/startup",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},{
"path": "pages/MyLearning/MyLearning",
"style": {
@ -129,7 +129,16 @@
"enablePullDownRefresh": false
}
}
],
,{
"path" : "pages/Orderlist/Orderlist",
"style" :
{
"navigationBarTitleText": "订单列表",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "",

View File

@ -0,0 +1,19 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>

View File

@ -20,7 +20,7 @@
</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="buyselect">
<image src="../../static/wechat.png" mode=""></image>
@ -28,16 +28,18 @@
微信支付
</view>
</view>
<view class="buybtn">
<view class="buybtn" @tap='tobuy'>
确认支付{{buylist.trainingItemPrice}}
</view>
</u-popup>
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
personTrainingItem
personTrainingItem,
trainingItemOrder
} from '@/api/Videolearning/index.js'
import baseurl from '@/api/baseurl.js'
export default {
@ -68,6 +70,31 @@
},
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) {
this.buylist = item
this.buyshow = true

View File

@ -4,9 +4,6 @@
<view class="title">
{{list.trainingItemTitle}}
</view>
<!-- <view class="time">
有效期2023.12.31
</view> -->
<view class="border"></view>
<u-tabs :list="tablist" :is-scroll="false" :current="tabcurrent" @change="change" font-size='34' bar-height='3'>
</u-tabs>
@ -61,7 +58,6 @@
</u-popup>
</view>
</template>
<script>
import baseurl from '@/api/baseurl.js'
import {
@ -94,9 +90,8 @@
},
//
videoshowfalse() {
insertTrainingItemWatchRecord(this.videoitem).then(res => {
console.log(res)
})
this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime)
insertTrainingItemWatchRecord(this.videoitem).then(res => {})
},
//
videoplay(item) {
@ -113,6 +108,7 @@
if (res.code == 200) {
if (res.data.watchTime) {
this.videoitem.watchTime = res.data.watchTime
this.videoitem.watchTime = this.formatsecond(this.videoitem.watchTime)
}
this.videoshow = true
}
@ -121,7 +117,31 @@
//tabs
change(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) {
this.baseurl = baseurl

View File

@ -48,6 +48,8 @@
}
uni.setStorageSync("personRoleLoginFlag", res.data.personRoleLoginFlag)
uni.setStorageSync("phone", res.data.phone)
uni.setStorageSync("nursePersonName", res.data.nursePersonName)
uni.setStorageSync("nurseStationId", res.data.nurseStationId)
this.$refs.uToast.show({
title: '登录成功',
type: 'success',