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() {
uni.reLaunch({ if(this.payInfo.type){
url: "/pages/order/index/index?status=2", if(this.payInfo.type==1){//跳到课程订单
}); uni.reLaunch({
url:'/pages/school/personal/orderList?status=2'
});
}
}else{
uni.reLaunch({
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,65 +312,84 @@ ...@@ -311,65 +312,84 @@
// 提交订单 // 提交订单
submitOrderHandler(){ submitOrderHandler(){
let that = this; let that = this;
console.log('进入') if(that.checked==true && that.ds.total_price<=0){
if (!this.submitOrder) { uni.showToast({
this.submitOrder = true; title: '金额为0不能代付',
uni.requestSubscribeMessage({ icon: 'none',
tmplIds: this.ds.template_message_list, });
complete(res) { }else{
console.log(res) console.log('进入')
that.submitOrder = false; if (!this.submitOrder) {
let form = {}; this.submitOrder = true;
form.BuyerMessage = '';//留言 uni.requestSubscribeMessage({
form.DetailList = that.formdata.DetailList;//课程列表 tmplIds: this.ds.template_message_list,
form.User_Coupon_Id = that.formdata.User_Coupon_Id;//使用优惠券id complete(res) {
form.CouponMoney = that.couponPrice;//优惠金额 console.log(res)
form.Use_Education_Id = that.formdata.Use_Education_Id;//使用课程卡id that.submitOrder = false;
form.EducationMoney = that.EducationMoney;//课程卡抵扣金额 let form = {};
form.Income = that.ds.total_price;//实际付款金额 form.BuyerMessage = '';//留言
form.IsFormShoppingCart = that.IsFormShoppingCart;//来自购物车 form.DetailList = that.formdata.DetailList;//课程列表
form.Use_Integral = that.formdata.Use_Integral;//使用积分 form.User_Coupon_Id = that.formdata.User_Coupon_Id;//使用优惠券id
form.ShoppingCartIdList = that.ShoppingCartIdList;//购物车id form.CouponMoney = that.couponPrice;//优惠金额
form.AnchorName = uni.getStorageSync("AnchorName")?uni.getStorageSync("AnchorName").AnchorName:''; //直播名称 form.Use_Education_Id = that.formdata.Use_Education_Id;//使用课程卡id
that.request2( form.EducationMoney = that.EducationMoney;//课程卡抵扣金额
{ form.Income = that.ds.total_price;//实际付款金额
url: '/api/AppletOrder/SetAppletCourseOrderInfo', form.IsFormShoppingCart = that.IsFormShoppingCart;//来自购物车
data: form form.Use_Integral = that.formdata.Use_Integral;//使用积分
}, form.ShoppingCartIdList = that.ShoppingCartIdList;//购物车id
res => { form.AnchorName = uni.getStorageSync("AnchorName")?uni.getStorageSync("AnchorName").AnchorName:''; //直播名称
if (res.resultCode == 1) { that.request2(
if(that.checked==true){ {
that.zhaoren = true; url: '/api/AppletOrder/SetAppletCourseOrderInfo',
data: form
let u = uni.getStorageSync("mall_UserInfo"); },
let uid = u.UserId ? u.UserId : 0; res => {
let Up = u.UserPageType ? u.UserPageType:0; if (res.resultCode == 1) {
let SmallShopId = u.SmallShopId ? u.SmallShopId : 0; if(that.checked==true){
if (SmallShopId == 0) { that.zhaoren = true;
//如果微店id为0 去找所属微店id
SmallShopId = u.UserSmallShopId ? u.UserSmallShopId : 0; let u = uni.getStorageSync("mall_UserInfo");
let uid = u.UserId ? u.UserId : 0;
let Up = u.UserPageType ? u.UserPageType:0;
let SmallShopId = u.SmallShopId ? u.SmallShopId : 0;
if (SmallShopId == 0) {
//如果微店id为0 去找所属微店id
SmallShopId = u.UserSmallShopId ? u.UserSmallShopId : 0;
}
//TODO 需要看跳转哪里
that.path = '/pages/index/index?OrderId=' + res.data.OrderId + "&user_id=" + uid+ "&Up=" + Up+ "&SmallShopId=" + SmallShopId+'&JumpType=5' ;
}else{
if( that.ds.total_price>0){
that.payBtn = true;
that.payInfo.OrderId = res.data.OrderId;
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)
}
} }
//TODO 需要看跳转哪里
that.path = '/pages/index/index?OrderId=' + res.data.OrderId + "&user_id=" + uid+ "&Up=" + Up+ "&SmallShopId=" + SmallShopId+'&JumpType=5' ;
}else{
that.payBtn = true;
that.payInfo.OrderId = res.data.OrderId;
that.payInfo.total_price = that.ds.total_price;
} }
else{
} that.$refs.uToast.show({
else{ title: res.data.message,
that.$refs.uToast.show({ type: 'warning'
title: res.data.message, });
type: 'warning' }
}); uni.hideNavigationBarLoading();
} }
uni.hideNavigationBarLoading(); );
}
); }
});
} }
});
} }
}, },
init(){ init(){
......
...@@ -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> </view>
</scroll-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否
...@@ -136,7 +160,14 @@ ...@@ -136,7 +160,14 @@
title: this.name, title: this.name,
path: "/pages/index/index?id=" + this.id + "&user_id=" + uid+ "&SmallShopId=" + SmallShopId+ "&Up=" + this.Up+'&JumpType=5', path: "/pages/index/index?id=" + this.id + "&user_id=" + uid+ "&SmallShopId=" + SmallShopId+ "&Up=" + this.Up+'&JumpType=5',
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){
this.index = index;
this.selectcourse=item if(item.IsPay!=1){//判断是否购买
this.setMyCourseStudyOK()//在换章节的时候标记 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.selectcourse=item
this.img=[];
item.ImageList.forEach((x) => {
this.img.push(x.Path);
});
this.selectcourse.ImageList = this.selectcourse.ImageList.splice(0,8)
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,18 +573,25 @@ export default { ...@@ -573,18 +573,25 @@ export default {
gocourse(item,index){//跳入课程详情 gocourse(item,index){//跳入课程详情
if(item.IsTrySee==1){ if(item.IsPay!=1){
if(item.IsTrySee==1){
uni.navigateTo({
url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&index='+index
})
}else{
uni.showToast({
title: '购买之后才能观看',
icon: 'none',
duration: 2000
});
}
}else{
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
}) })
}else{
uni.showToast({
title: '购买之后才能观看',
icon: 'none',
duration: 2000
});
} }
}, },
goMystudy(){//学习中心 goMystudy(){//学习中心
uni.navigateTo({ uni.navigateTo({
...@@ -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