Commit 9fd577df authored by Mac's avatar Mac

1

parent 331b6c38
......@@ -381,6 +381,7 @@ import {gegerateDates, dateEqual,formatDate} from './components/zzx-calendar/gen
this.showAuth = false;
},
goconfirm(item){
console.log(item)
uni.navigateTo({
url: '/pages/appointment/confirmAppointment?CourseId='+item.ID
});
......
<style>
.stu_StutasImg{
width:22px;
height:36px;
}
.confirmAppointment .top-item{
width: 100%;
height: 43px;
border-bottom: 1px solid rgba(223, 221, 216, 0.5);
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
font-size: 14px;
color: #111111;
}
.confirmAppointment .t-item-r{
font-weight: bold;
}
.confirmAppointment .bottoms{
width: 100%;
height: 100px;
display: flex;
align-items: center;
justify-content: center;
padding: 23px;
position: absolute;
left: 0;
bottom: 0;
}
.bottoms-box{
width:100% ;
height: 40px;
border-radius: 4px;
background: #40766E;
font-size: 14px;
color: #FFFFFF;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
</style>
<template>
<view class="confirmAppointment">
<view class="box">
<view class="box-top">
<text style=""></text>
<view class="row-c">
<image src="../../static/images/ygs.png" class="stu_StutasImg"></image>
<text style="font-size: 16px;color: #111111;margin-left: 12px;font-weight: bold;">{{data.CourseName}}</text>
</view>
<view class="top-item" style="margin-top: 10px;">
<text>上课时间</text>
<text class="t-item-r">{{data.StudyDateStr}}</text>
</view>
<view class="top-item">
<text>上课老师</text>
<view class="row-c">
<u-avatar :src="data.TeacherLogo" size='48' mode="circle"></u-avatar>
<text class="t-item-r" style="margin-left: 5px;">{{data.TeacherName}}</text>
</view>
</view>
<view class="top-item">
<text>课程类型</text>
<text class="t-item-r">{{data.StudentNumTypeName}}</text>
</view>
<view class="top-item">
<text>花费点数</text>
<text class="t-item-r" :style="{color:mainColor}">{{data.PointNum}}</text>
</view>
<view class="top-item">
<text>课程时长</text>
<text class="t-item-r" >{{data.StudyDuration}}{{data.DurationUnitName}}</text>
</view>
<view class="top-item" style="border: none;">
<text>最少约课时长</text>
<text class="t-item-r" >{{data.MinDuration}}{{data.DurationUnitName}}</text>
</view>
</view>
<view class="box-top" style="margin-top: 15px;">
<view class="top-item">
<text>预约课节</text>
<input class="uni-input " type="number" v-model="classDay" style='text-align: right;' placeholder="输入课节" @blur='totalsc'/>
</view>
<view class="top-item" style="border: none;" @click="show=true">
<text>选择预约时间</text>
<text v-if="addMsg.StudyDate==''" style="font-size: 14px;color: #777777;">请选择预约时间</text>
<text class="t-item-r" v-else>{{addMsg.StudyDate}}</text>
</view>
</view>
<view class="box-top" style="margin-top: 15px;" v-if="orderList.length>0">
<view class="row-c">
<view style="font-size: 14px;color: #111111;font-weight: bold;">已预约的时间段</view>
</view>
<view class=""></view>
</view>
</view>
<view class="bottoms">
<view class="bottoms-box" @click="xiadan">
支付 {{addMsg.TotalPointNum}}
</view>
</view>
<u-picker mode="time" v-model="show" :params="params" @confirm = 'confirm'></u-picker>
</view>
</template>
......@@ -14,6 +112,31 @@
return{
mainColor: '',
secondary: '',
data:{},
show:false,
params: {
year: false,
month: false,
day: false,
hour: true,
minute: true,
second: false
},
addMsg:{
CourseId:0,//课程id
StudyDuration:0,//基础学习时长
DurationUnit:0,//时间单位
OrderStaus:0,//订单状态
BasePointNum:0,//基础点数
StudyDate:'',//预约时间
TotalStudyDuration:0,//总时长
TotalPointNum:0,//总的点数
},
classDay:1,
ifvalue:1,
}
},
onLoad(options) {
......@@ -34,9 +157,66 @@
data: {CourseId:id}
},
res => {
this.data = res.data
this.data = res.data;
this.addMsg.CourseId = this.data.ID;
this.addMsg.StudyDuration = this.data.StudyDuration;
this.addMsg.DurationUnit = this.data.DurationUnit;
this.addMsg.BasePointNum = this.data.PointNum;
let cday = parseInt(this.data.MinDuration/this.data.StudyDuration);
if(this.data.MinDuration%this.data.StudyDuration>0){
cday= cday+1
}
this.classDay = cday
this.ifvalue =cday
this.totalsc()
}
);
},
totalsc(){//总时长计算和点数的计算
if(this.classDay<this.ifvalue){
uni.showToast({
title: "不能小于"+this.ifvalue+'课节',
icon:'none'
})
this.classDay = this.ifvalue
}
this.addMsg.TotalStudyDuration = this.classDay * Number(this.data.StudyDuration)
this.addMsg.TotalPointNum = this.classDay * Number(this.data.PointNum)
},
confirm(e){
this.addMsg.StudyDate = e.hour+':'+e.minute
this.request2({
url: '/api/AppletPoint/GetTeacherCourseOrder',
data: this.addMsg
},
res => {
}
);
},
xiadan(){
let that = this;
if(that.addMsg.TotalPointNum==''){
uni.showToast({
title: '请选择预约时间',
icon:'none'
})
return
}
uni.requestSubscribeMessage({
tmplIds: that.data.template_message_list,
success (res) {
},
fail(err){
uni.showToast({
title: '没订阅不能预约课程哦!',
icon:'none'
})
}
})
}
}
}
......@@ -59,5 +239,10 @@
padding: 15px;
}
.row-c{
display: flex;
flex-direction: row;
align-items: center;
}
</style>
......@@ -36,12 +36,16 @@
<view class="DetailList">
<view class="item" v-for="(x, i) in g" :key="i" >
<view style="flex: 1;width: 1px;">
<text>{{x.Description}}</text>
<text style="font-size: 11px;color: #999999;margin-top: 10px;">{{x.CreateDate}}</text>
<div v-if='current==0'>{{x.Description}}</div>
<div v-if='current==1'>充值金额:{{x.Income}}元({{x.PaymentWayName}})</div>
<div style="font-size: 11px;color: #999999;margin-top: 10px;">{{x.CreateDate}}</div>
</view>
<view style="width: 200px;text-align: right;">
<view class="item-r" :style="{color: x.Type==1?mainColor:'#111111'}" v-if='current==0'>
{{x.Type==1?'+'+x.PonitNum:'-'+x.PonitNum}}
</view>
<view class="item-r" v-if='current==1' :style="{color: mainColor}">
点数+{{x.PonitNum}}
</view>
</view>
</view>
......@@ -51,7 +55,7 @@
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
bg-color="#FFFFFF"
/>
</scroll-view>
</view>
......@@ -80,9 +84,14 @@
current:0,
msg:{
pageIndex:1,
pageSize:15,
pageSize:10,
Type:0
},
msg2:{
pageIndex:1,
pageSize:10,
OrderNo:0
},
g:[],
PointNum:0,
page_count: 1,
......@@ -117,33 +126,67 @@
},
methods:{
init(){
let url = ''
let msg = {}
if(this.current==0){
url = '/api/AppletPoint/GetAppletUserPointDetailPageList'
msg= this.msg
}else{
url = '/api/AppletPoint/GetAppletUserPointOrderPageList'
msg= this.msg2
}
this.request2({
url: '/api/AppletPoint/GetAppletUserPointDetailPageList',
data: this.msg
url:url ,
data: msg
},
res => {
this.PointNum = res.data.pageData.PointNum
this.g= res.data.pageData.List
if(this.current==0){
this.PointNum = res.data.pageData.PointNum
this.page_count = res.data.pageCount
this.g= this.g.concat(res.data.pageData.List)
}else{
this.g= this.g.concat(res.data.pageData)
this.page_count = res.data.pageCount
}
if (this.page_count == 1) {
this.status = "nomore";
}
}
);
},
change(index) {
this.current = index
this.msg.Type = index+1;
this.msg.pageIndex = 1;
this.g = [];
this.init();
if(this.current==0){
this.msg.pageIndex = 1;
this.g = [];
this.init();
}else{
this.msg2.pageIndex = 1;
this.g = [];
this.init();
}
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
if(this.current==0){
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
}else{
if (this.msg2.pageIndex < this.page_count) {
this.msg2.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
}
},
gopointRecharge(){
uni.navigateTo({
......@@ -205,5 +248,9 @@
justify-content: space-between;
font-size: 14px;
color: #111111;
border-bottom: 1px solid #E2E2E2;
}
.pointBalance .item-r{
width: 100px;text-align: right;
}
</style>
......@@ -75,7 +75,7 @@
},
btnRecharge(item){//点击充值
this.show= true;
this.content= '确定花费'+item.SellingPrice+'充值点数'+item.PonitNum+'吗?'
this.content= '确定花费'+item.SellingPrice+'充值点数'+item.PonitNum+'吗?'
this.RechargeMsg.Income = item.SellingPrice;
this.RechargeMsg.PointGoodsId = item.ID;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment