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' 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 "pages": [ //pageshttps://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",

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> </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

View File

@ -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

View File

@ -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',