Commit 3afc5849 authored by Mac's avatar Mac

修改

parent abef5d16
......@@ -358,10 +358,10 @@
},{
"path": "courseInfo"
},{
"path":"courseContent",
"style": {
"navigationStyle": "custom"
}
"path":"courseContent"
// "style": {
// "navigationStyle": "custom"
// }
},{
"path":"teacherDetails",
"style": {
......
......@@ -96,9 +96,18 @@ export default {
);
},
redictToOrders() {
uni.reLaunch({
url: "/pages/order/index/index?status=2",
});
if(this.payInfo.type){
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() {
uni.reLaunch({
......
......@@ -238,7 +238,8 @@
OpenId: 'ow_7I5XC1-RGwwk8QANBmWKYKmOc',
OrderId: '',
OrderPayType: 1,
GoodsName: ''
GoodsName: '',
type:1,//标记是从课程过去的
},
userInt:false,
mchs:{},
......@@ -311,65 +312,84 @@
// 提交订单
submitOrderHandler(){
let that = this;
console.log('进入')
if (!this.submitOrder) {
this.submitOrder = true;
uni.requestSubscribeMessage({
tmplIds: this.ds.template_message_list,
complete(res) {
console.log(res)
that.submitOrder = false;
let form = {};
form.BuyerMessage = '';//留言
form.DetailList = that.formdata.DetailList;//课程列表
form.User_Coupon_Id = that.formdata.User_Coupon_Id;//使用优惠券id
form.CouponMoney = that.couponPrice;//优惠金额
form.Use_Education_Id = that.formdata.Use_Education_Id;//使用课程卡id
form.EducationMoney = that.EducationMoney;//课程卡抵扣金额
form.Income = that.ds.total_price;//实际付款金额
form.IsFormShoppingCart = that.IsFormShoppingCart;//来自购物车
form.Use_Integral = that.formdata.Use_Integral;//使用积分
form.ShoppingCartIdList = that.ShoppingCartIdList;//购物车id
form.AnchorName = uni.getStorageSync("AnchorName")?uni.getStorageSync("AnchorName").AnchorName:''; //直播名称
that.request2(
{
url: '/api/AppletOrder/SetAppletCourseOrderInfo',
data: form
},
res => {
if (res.resultCode == 1) {
if(that.checked==true){
that.zhaoren = true;
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;
if(that.checked==true && that.ds.total_price<=0){
uni.showToast({
title: '金额为0不能代付',
icon: 'none',
});
}else{
console.log('进入')
if (!this.submitOrder) {
this.submitOrder = true;
uni.requestSubscribeMessage({
tmplIds: this.ds.template_message_list,
complete(res) {
console.log(res)
that.submitOrder = false;
let form = {};
form.BuyerMessage = '';//留言
form.DetailList = that.formdata.DetailList;//课程列表
form.User_Coupon_Id = that.formdata.User_Coupon_Id;//使用优惠券id
form.CouponMoney = that.couponPrice;//优惠金额
form.Use_Education_Id = that.formdata.Use_Education_Id;//使用课程卡id
form.EducationMoney = that.EducationMoney;//课程卡抵扣金额
form.Income = that.ds.total_price;//实际付款金额
form.IsFormShoppingCart = that.IsFormShoppingCart;//来自购物车
form.Use_Integral = that.formdata.Use_Integral;//使用积分
form.ShoppingCartIdList = that.ShoppingCartIdList;//购物车id
form.AnchorName = uni.getStorageSync("AnchorName")?uni.getStorageSync("AnchorName").AnchorName:''; //直播名称
that.request2(
{
url: '/api/AppletOrder/SetAppletCourseOrderInfo',
data: form
},
res => {
if (res.resultCode == 1) {
if(that.checked==true){
that.zhaoren = true;
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({
title: res.data.message,
type: 'warning'
});
else{
that.$refs.uToast.show({
title: res.data.message,
type: 'warning'
});
}
uni.hideNavigationBarLoading();
}
uni.hideNavigationBarLoading();
}
);
}
});
);
}
});
}
}
},
init(){
......
......@@ -3,8 +3,27 @@
<view class="course-top">
<video id="myVideo" v-if="selectcourse.Type==1" :src="selectcourse.FilePath"
@error="videoErrorCallback" controls duration='selectcourse.VideoTime'></video>
<video id="myVideo"
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 class="course-t">
<view class="course-t-item">
......@@ -36,24 +55,28 @@
</view>
<view style="width: 100%;height: 1px;background: #E2E2E2;"></view>
<view v-if="courseList.length > 0" style="
height: calc(100vh - 405px);
width: 100%;
overflow: hidden;
">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true"
style="height: 100%;">
<!-- <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true"
style="height: 100%;"> -->
<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="cb-l-bt" :style="{border:index==ci?'0.5px solid #00D6A6':'0.5px solid #121212'}">{{cl.TypeName}}</view>
{{cl.SortName}}{{cl.Name}}
</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>
<!-- </scroll-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>
</view>
</view> -->
<coupon
v-if="showCoupons"
:coupon-message="couponMessage"
......@@ -85,6 +108,7 @@
timer:null,
showCoupons: false,
couponMessage: "",
img:[],
}
},
onLoad(options) {
......@@ -95,10 +119,10 @@
this.name = options.name
this.getGoodsCourseList()//获取课程目录
this.getAppletCourseCollect()//获取课程是否收藏
this.setMyStudyTime()//增加课程学习时间
this.timer = setInterval(()=>{
this.setMyStudyTime(10)
},10000)
// this.setMyStudyTime()//增加课程学习时间
// this.timer = setInterval(()=>{
// this.setMyStudyTime(10)
// },10000)
}
// 多反了个字段 IsRead 是否已学习, 1是 2否
......@@ -136,7 +160,14 @@
title: this.name,
path: "/pages/index/index?id=" + this.id + "&user_id=" + uid+ "&SmallShopId=" + SmallShopId+ "&Up=" + this.Up+'&JumpType=5',
imageUrl: ''
};
};
},
//图片预览
previewImage(index) {
uni.previewImage({
urls: this.img,
current: index,
});
},
goback(){
uni.navigateBack({})
......@@ -149,6 +180,11 @@
res => {
this.courseList = res.data.pageData;
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()//课程已阅读
}
);
......@@ -183,9 +219,64 @@
})
},
gocourse(item,index){
this.index = index;
this.selectcourse=item
this.setMyCourseStudyOK()//在换章节的时候标记
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.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){
this.request2({
......@@ -289,6 +380,13 @@
flex-direction: row;
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{
font-size: 9px;
border-radius: 2px;
......@@ -296,4 +394,8 @@
padding: 1px;
margin-right: 5px;
}
.courseContent .studyimg{
width: 100%;
height: 100%;
}
</style>
......@@ -179,7 +179,7 @@
{{cl.IsTrySee==1?'可试看':'购买'}}
</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>
......@@ -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">
<text :style="{color:mc}">加入购物车</text>
</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>
</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">
......@@ -573,18 +573,25 @@ export default {
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({
url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&index='+index
})
}else{
uni.showToast({
title: '购买之后才能观看',
icon: 'none',
duration: 2000
});
}
},
goMystudy(){//学习中心
uni.navigateTo({
......@@ -650,6 +657,11 @@ export default {
})
}
},
goorderList(){//去支付
uni.navigateTo({
url:'/pages/school/personal/orderList?status=1'
})
},
closeBtn() {
this.showCoupons = false;
},
......
......@@ -241,7 +241,7 @@
}, 1000);
},
onLoad(option) {
this.current = option.status || -1;
this.current = option.status || 0;
this.getHeadList();
this.payInfo.OpenId=uni.getStorageSync('mall_UserInfo').OpenId;
this.u = uni.getStorageSync("mall_UserInfo");
......@@ -271,7 +271,7 @@
Name: '全部'
}
this.headData.unshift(obj)
this.msg.OrderStatus=0;
this.msg.OrderStatus=this.headData[this.current].Id;
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