Commit 3cc424f6 authored by zhengke's avatar zhengke

Merge branch 'master' of http://gitlab.oytour.com/viitto/mallapp

parents a36cbab3 b7b4a8e3
......@@ -10,7 +10,7 @@
"
>
<Text class="grid-text" v-if='IsEducation!=1'>商品库存有限,请尽快下单哦</Text>
<Text class="grid-text" v-if='IsEducation==1'>{{list[0].GoodsList.length}}个课程</Text>
<Text class="grid-text" v-if='IsEducation==1'>{{list[0].GoodsList.length?list[0].GoodsList.length:'0'}}个课程</Text>
<Text @click="edit" v-if="editType == false && list[0].GoodsList.length>0" class="grid-text_r">编辑</Text>
<Text @click="edit" v-if="editType == true" class="grid-text_r">完成</Text>
</view>
......
......@@ -156,19 +156,29 @@ export default {
);
},
addComment(){//新增留言
this.request2({
url: '/api/AppletEducation/SetArticleCommentInfo',
data: this.commentMsg
},
res => {
uni.showToast({
title: res.message,
icon: 'none',
});
this.commentMsg.Content = '';
this.getArticleCommentPageList()//留言了之后调取留言列表
}
);
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
this.request2({
url: '/api/AppletEducation/SetArticleCommentInfo',
data: this.commentMsg
},
res => {
uni.showToast({
title: res.message,
icon: 'none',
});
this.commentMsg.Content = '';
this.getArticleCommentPageList()//留言了之后调取留言列表
}
);
}
},
//图片预览
previewImage2(index, images) {
......
......@@ -363,6 +363,7 @@ export default {
},
onShow(){
this.init();
this.u = uni.getStorageSync("mall_UserInfo");
},
onShareTimeline() {
setTimeout(() => {
......@@ -564,7 +565,8 @@ export default {
);
},
joinCar(){//加入购物车
this.request2(
if (this.u) {
this.request2(
{
url: '/api/AppletOrder/SetGoodsShoppingCartInfo',
data: {
......@@ -580,25 +582,35 @@ export default {
duration: 2000
});
}
);
);
} else {
this.showAuth = true;
}
},
setFavorite(){
this.request2(
{
url: '/api/AppletUser/SetUserCollectionInfo',
data: {
GoodsId: this.id
}
},
res => {
this.g.favorite = !this.g.favorite;
}
);
if (this.u) {
this.request2(
{
url: '/api/AppletUser/SetUserCollectionInfo',
data: {
GoodsId: this.id
}
},
res => {
this.g.favorite = !this.g.favorite;
}
);
} else {
this.showAuth = true;
}
},
gocourse(item,index){//跳入课程详情
if(item.IsPay!=1){
if (this.u) {
if(item.IsPay!=1){
if(item.IsTrySee==1){
uni.navigateTo({
url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&cover_pic='+this.g.cover_pic+'&index='+index
......@@ -610,13 +622,17 @@ export default {
duration: 2000
});
}
}else{
}else{
uni.navigateTo({
url:'/pages/school/courseContent?id='+this.id+'&name='+this.g.name+'&cover_pic='+this.g.cover_pic+'&index='+index
})
}
} else {
this.showAuth = true;
}
},
gocomments(){
uni.navigateTo({
......
......@@ -139,9 +139,7 @@
if(options && options.ID){
this.id = options.ID;
this.msg.TeacherId = options.ID;
if(uni.getStorageSync("mall_UserInfo")){
this.UserId = uni.getStorageSync("mall_UserInfo").UserId ? uni.getStorageSync("mall_UserInfo").UserId:0
}
this.getTeacher()//根据老师id获取老师详情
this.init()//根据老师id获取老师的课程列表
}
......@@ -183,6 +181,9 @@
);
},
getTeacher(){
if(uni.getStorageSync("mall_UserInfo")){
this.UserId = uni.getStorageSync("mall_UserInfo").UserId ? uni.getStorageSync("mall_UserInfo").UserId:0
}
this.request2({
url: '/api/AppletSchool/GetTeacherModel',
data: {ID: this.id,UserId:this.UserId }
......@@ -247,7 +248,7 @@
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.followTeacher()
this.getTeacher()
},
gob(){
this.showAuth = false;
......
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