Commit 3afc5849 authored by Mac's avatar Mac

修改

parent abef5d16
...@@ -358,10 +358,10 @@ ...@@ -358,10 +358,10 @@
},{ },{
"path": "courseInfo" "path": "courseInfo"
},{ },{
"path":"courseContent", "path":"courseContent"
"style": { // "style": {
"navigationStyle": "custom" // "navigationStyle": "custom"
} // }
},{ },{
"path":"teacherDetails", "path":"teacherDetails",
"style": { "style": {
......
...@@ -96,9 +96,18 @@ export default { ...@@ -96,9 +96,18 @@ export default {
); );
}, },
redictToOrders() { redictToOrders() {
if(this.payInfo.type){
if(this.payInfo.type==1){//跳到课程订单
uni.reLaunch({
url:'/pages/school/personal/orderList?status=2'
});
}
}else{
uni.reLaunch({ uni.reLaunch({
url: "/pages/order/index/index?status=2", url: "/pages/order/index/index?status=2",
}); });
}
}, },
goHome() { goHome() {
uni.reLaunch({ uni.reLaunch({
......
...@@ -238,7 +238,8 @@ ...@@ -238,7 +238,8 @@
OpenId: 'ow_7I5XC1-RGwwk8QANBmWKYKmOc', OpenId: 'ow_7I5XC1-RGwwk8QANBmWKYKmOc',
OrderId: '', OrderId: '',
OrderPayType: 1, OrderPayType: 1,
GoodsName: '' GoodsName: '',
type:1,//标记是从课程过去的
}, },
userInt:false, userInt:false,
mchs:{}, mchs:{},
...@@ -311,6 +312,12 @@ ...@@ -311,6 +312,12 @@
// 提交订单 // 提交订单
submitOrderHandler(){ submitOrderHandler(){
let that = this; let that = this;
if(that.checked==true && that.ds.total_price<=0){
uni.showToast({
title: '金额为0不能代付',
icon: 'none',
});
}else{
console.log('进入') console.log('进入')
if (!this.submitOrder) { if (!this.submitOrder) {
this.submitOrder = true; this.submitOrder = true;
...@@ -352,9 +359,21 @@ ...@@ -352,9 +359,21 @@
//TODO 需要看跳转哪里 //TODO 需要看跳转哪里
that.path = '/pages/index/index?OrderId=' + res.data.OrderId + "&user_id=" + uid+ "&Up=" + Up+ "&SmallShopId=" + SmallShopId+'&JumpType=5' ; that.path = '/pages/index/index?OrderId=' + res.data.OrderId + "&user_id=" + uid+ "&Up=" + Up+ "&SmallShopId=" + SmallShopId+'&JumpType=5' ;
}else{ }else{
if( that.ds.total_price>0){
that.payBtn = true; that.payBtn = true;
that.payInfo.OrderId = res.data.OrderId; that.payInfo.OrderId = res.data.OrderId;
that.payInfo.total_price = that.ds.total_price; that.payInfo.total_price = that.ds.total_price;
}else{
uni.showToast({
title: '交易成功',
icon: 'none',
duration: 2000
});
setTimeout(()=>{
uni.redirectTo({ url: '/pages/school/personal/orderDetail?OrderId='+res.data.OrderId})
},2000)
}
} }
} }
...@@ -371,6 +390,7 @@ ...@@ -371,6 +390,7 @@
} }
}); });
} }
}
}, },
init(){ init(){
this.request2( this.request2(
......
...@@ -3,8 +3,27 @@ ...@@ -3,8 +3,27 @@
<view class="course-top"> <view class="course-top">
<video id="myVideo" v-if="selectcourse.Type==1" :src="selectcourse.FilePath" <video id="myVideo"
@error="videoErrorCallback" controls duration='selectcourse.VideoTime'></video> v-if="selectcourse.Type==1"
:src="selectcourse.FilePath"
@error="videoErrorCallback" controls
enable-play-gesture='true'
></video>
<view v-if="selectcourse.Type!=1" class="studyimg">
<swiper
indicator-dots
:autoplay="true"
:interval="5000"
style="height:100%;"
>
<block v-for="(item, index) in selectcourse.ImageList" :key="index">
<swiper-item>
<image @click="previewImage(index)" v-if="item.Path" style="width:100%;height:100%;" :src="item.Path" mode=""></image>
</swiper-item>
</block>
</swiper>
</view>
</view> </view>
<view class="course-t"> <view class="course-t">
<view class="course-t-item"> <view class="course-t-item">
...@@ -36,24 +55,28 @@ ...@@ -36,24 +55,28 @@
</view> </view>
<view style="width: 100%;height: 1px;background: #E2E2E2;"></view> <view style="width: 100%;height: 1px;background: #E2E2E2;"></view>
<view v-if="courseList.length > 0" style=" <view v-if="courseList.length > 0" style="
height: calc(100vh - 405px);
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
"> ">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" <!-- <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true"
style="height: 100%;"> style="height: 100%;"> -->
<view class="scrollitem" v-for="(cl, ci) in courseList" :key="ci" @click="gocourse(cl,ci)"> <view class="scrollitem" v-for="(cl, ci) in courseList" :key="ci" @click="gocourse(cl,ci)">
<view class="catalog-box-l" :style="{color:index==ci?'#00D6A6':'#121212'}"> <view class="catalog-box-l" :style="{color:index==ci?'#00D6A6':'#121212'}">
<view class="cb-l-bt" :style="{border:index==ci?'0.5px solid #00D6A6':'0.5px solid #121212'}">{{cl.TypeName}}</view> <view class="cb-l-bt" :style="{border:index==ci?'0.5px solid #00D6A6':'0.5px solid #121212'}">{{cl.TypeName}}</view>
{{cl.SortName}}{{cl.Name}} {{cl.SortName}}{{cl.Name}}
</view> </view>
<!-- IsPay 0不可看 1已付款 2已下单 -->
<view :style="{color:mc}" class="catalog-box-r" v-if="cl.IsPay!=1">
{{cl.IsTrySee==1?'可试看':'购买'}}
</view> </view>
</scroll-view> </view>
<!-- </scroll-view> -->
</view> </view>
<view class="goback" @click="goback" :style="{'padding-top':paddingHTop}"> <!-- <view class="goback" @click="goback" :style="{'padding-top':paddingHTop}">
<u-icon name="arrow-left" size="48" color="#fff"></u-icon> <u-icon name="arrow-left" size="48" color="#fff"></u-icon>
</view> </view> -->
<coupon <coupon
v-if="showCoupons" v-if="showCoupons"
:coupon-message="couponMessage" :coupon-message="couponMessage"
...@@ -85,6 +108,7 @@ ...@@ -85,6 +108,7 @@
timer:null, timer:null,
showCoupons: false, showCoupons: false,
couponMessage: "", couponMessage: "",
img:[],
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -95,10 +119,10 @@ ...@@ -95,10 +119,10 @@
this.name = options.name this.name = options.name
this.getGoodsCourseList()//获取课程目录 this.getGoodsCourseList()//获取课程目录
this.getAppletCourseCollect()//获取课程是否收藏 this.getAppletCourseCollect()//获取课程是否收藏
this.setMyStudyTime()//增加课程学习时间 // this.setMyStudyTime()//增加课程学习时间
this.timer = setInterval(()=>{ // this.timer = setInterval(()=>{
this.setMyStudyTime(10) // this.setMyStudyTime(10)
},10000) // },10000)
} }
// 多反了个字段 IsRead 是否已学习, 1是 2否 // 多反了个字段 IsRead 是否已学习, 1是 2否
...@@ -138,6 +162,13 @@ ...@@ -138,6 +162,13 @@
imageUrl: '' imageUrl: ''
}; };
}, },
//图片预览
previewImage(index) {
uni.previewImage({
urls: this.img,
current: index,
});
},
goback(){ goback(){
uni.navigateBack({}) uni.navigateBack({})
}, },
...@@ -149,6 +180,11 @@ ...@@ -149,6 +180,11 @@
res => { res => {
this.courseList = res.data.pageData; this.courseList = res.data.pageData;
this.selectcourse=this.courseList[this.index]; this.selectcourse=this.courseList[this.index];
this.img=[];
this.courseList[this.index].ImageList.forEach((x) => {
this.img.push(x.Path);
});
this.selectcourse.ImageList = this.selectcourse.ImageList.splice(0,8)
this.setMyCourseStudyOK()//课程已阅读 this.setMyCourseStudyOK()//课程已阅读
} }
); );
...@@ -183,9 +219,64 @@ ...@@ -183,9 +219,64 @@
}) })
}, },
gocourse(item,index){ gocourse(item,index){
if(item.IsPay!=1){//判断是否购买
if(item.IsTrySee==1){//试看的情况
this.index = index;
this.selectcourse=item;
this.img=[];
item.ImageList.forEach((x) => {
this.img.push(x.Path);
});
this.selectcourse.ImageList = this.selectcourse.ImageList.splice(0,8);
this.setMyCourseStudyOK()//在换章节的时候标记
}else{
let that =this
if(item.IsPay==2){//判断是否下单
uni.showModal({
title: '提示',
content: '已下单,去订单列表付款?',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url:'/pages/school/personal/orderList?status=1'
})
} else if (res.cancel) { }
}
});
}else{
uni.showModal({
title: '提示',
content: '购买后观看,是否去购买?',
success: function (res) {
if (res.confirm) {
let DetailList = [];
let obj={
GoodsId:that.id,
Number:1,
}
DetailList.push(obj)
uni.navigateTo({
url:'/pages/school/course-submit?DetailList='+encodeURIComponent(JSON.stringify(DetailList))
})
} else if (res.cancel) { }
}
});
}
}
} else{
this.index = index; this.index = index;
this.selectcourse=item this.selectcourse=item
this.img=[];
item.ImageList.forEach((x) => {
this.img.push(x.Path);
});
this.selectcourse.ImageList = this.selectcourse.ImageList.splice(0,8)
this.setMyCourseStudyOK()//在换章节的时候标记 this.setMyCourseStudyOK()//在换章节的时候标记
}
}, },
setMyStudyTime(time=1){ setMyStudyTime(time=1){
this.request2({ this.request2({
...@@ -289,6 +380,13 @@ ...@@ -289,6 +380,13 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
} }
.courseContent .catalog-box-r{
width: 40px;
font-size: 10px;
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.courseContent .cb-l-bt{ .courseContent .cb-l-bt{
font-size: 9px; font-size: 9px;
border-radius: 2px; border-radius: 2px;
...@@ -296,4 +394,8 @@ ...@@ -296,4 +394,8 @@
padding: 1px; padding: 1px;
margin-right: 5px; margin-right: 5px;
} }
.courseContent .studyimg{
width: 100%;
height: 100%;
}
</style> </style>
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
{{cl.IsTrySee==1?'可试看':'购买'}} {{cl.IsTrySee==1?'可试看':'购买'}}
</view> </view>
</view> </view>
<view class="ckcatalog" v-if="courseShow ==true" @click="gocourse(cl,0)"> <view class="ckcatalog" v-if="courseShow ==true" @click="gocourse({IsTrySee:1},0)">
查看更多目录 查看更多目录
</view> </view>
</view> </view>
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
<view class="gwuche" :style="{'border':'1px solid'+mc}" @click="joinCar()" v-if="g.price!=0 && g.is_pay==false && g.is_orders==false"> <view class="gwuche" :style="{'border':'1px solid'+mc}" @click="joinCar()" v-if="g.price!=0 && g.is_pay==false && g.is_orders==false">
<text :style="{color:mc}">加入购物车</text> <text :style="{color:mc}">加入购物车</text>
</view> </view>
<view class="gwuche" :style="{background:mc,'border':'1px solid'+mc}" v-if='g.is_pay==false && g.is_orders==true && g.price!=0'> <view class="gwuche" :style="{background:mc,'border':'1px solid'+mc}" v-if='g.is_pay==false && g.is_orders==true && g.price!=0' @click="goorderList()">
<text style="color: #fff;" >去支付</text> <text style="color: #fff;" >去支付</text>
</view> </view>
<view class="gwuche" :style="{background:mc,'border':'1px solid'+mc}" v-if='g.is_pay==false && g.is_orders==false && g.price!=0' @click="goSettlement"> <view class="gwuche" :style="{background:mc,'border':'1px solid'+mc}" v-if='g.is_pay==false && g.is_orders==false && g.price!=0' @click="goSettlement">
...@@ -573,6 +573,7 @@ export default { ...@@ -573,6 +573,7 @@ export default {
gocourse(item,index){//跳入课程详情 gocourse(item,index){//跳入课程详情
if(item.IsPay!=1){
if(item.IsTrySee==1){ if(item.IsTrySee==1){
uni.navigateTo({ uni.navigateTo({
url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&index='+index url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&index='+index
...@@ -584,6 +585,12 @@ export default { ...@@ -584,6 +585,12 @@ export default {
duration: 2000 duration: 2000
}); });
} }
}else{
uni.navigateTo({
url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&index='+index
})
}
}, },
goMystudy(){//学习中心 goMystudy(){//学习中心
...@@ -650,6 +657,11 @@ export default { ...@@ -650,6 +657,11 @@ export default {
}) })
} }
}, },
goorderList(){//去支付
uni.navigateTo({
url:'/pages/school/personal/orderList?status=1'
})
},
closeBtn() { closeBtn() {
this.showCoupons = false; this.showCoupons = false;
}, },
......
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
}, 1000); }, 1000);
}, },
onLoad(option) { onLoad(option) {
this.current = option.status || -1; this.current = option.status || 0;
this.getHeadList(); this.getHeadList();
this.payInfo.OpenId=uni.getStorageSync('mall_UserInfo').OpenId; this.payInfo.OpenId=uni.getStorageSync('mall_UserInfo').OpenId;
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
...@@ -271,7 +271,7 @@ ...@@ -271,7 +271,7 @@
Name: '全部' Name: '全部'
} }
this.headData.unshift(obj) this.headData.unshift(obj)
this.msg.OrderStatus=0; this.msg.OrderStatus=this.headData[this.current].Id;
this.getContent(); this.getContent();
} }
} }
......
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