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