Commit 1eb2dead authored by Mac's avatar Mac

甲鹤活动列表和详情的分享处理

parent a5bba7ae
...@@ -304,7 +304,7 @@ ...@@ -304,7 +304,7 @@
</style> </style>
<template> <template>
<view class="Jiaheactivitydetails"> <view class="Jiaheactivitydetails" v-if="!loading">
<view style="width: 100%;height: 450rpx;" @click="previewImage(detial.CoverImg)"> <view style="width: 100%;height: 450rpx;" @click="previewImage(detial.CoverImg)">
<image :src="detial.CoverImg" style="width: 100%;height: 100%;" mode="aspectFill"></image> <image :src="detial.CoverImg" style="width: 100%;height: 100%;" mode="aspectFill"></image>
</view> </view>
...@@ -507,15 +507,21 @@ ...@@ -507,15 +507,21 @@
</view> </view>
</view> </view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth='gbAuth'></auth>
</view> </view>
</template> </template>
<script> <script>
import auth from "@/components/auth/index.vue";
export default{ export default{
components: {
auth
},
data(){ data(){
return{ return{
loading:true,
pageTitle: "活动详情", pageTitle: "活动详情",
showAuth:false,
mainColor:'', mainColor:'',
pricecolor:'', pricecolor:'',
Id:0, Id:0,
...@@ -542,11 +548,10 @@ ...@@ -542,11 +548,10 @@
} }
let title = this.detial.ActivityName ? this.detial.ActivityName : '活动详情'; let title = this.detial.ActivityName ? this.detial.ActivityName : '活动详情';
let imageUrl = this.detial.CoverImg ? this.detial.CoverImg:''; let imageUrl = this.detial.CoverImg ? this.detial.CoverImg:'';
let id = this.Id;
this.Up = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").UserPageType:0; this.Up = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").UserPageType:0;
return { return {
title: title, title: title,
query: "id=" + this.id + "&user_id=" + uid + "&SmallShopId=" + SmallShopId + "&Up=" + this.Up, query: "Id=" + this.Id + "&user_id=" + uid + "&SmallShopId=" + SmallShopId + "&Up=" + this.Up,
imageUrl: imageUrl, imageUrl: imageUrl,
}; };
}, },
...@@ -591,11 +596,13 @@ ...@@ -591,11 +596,13 @@
}) })
}, },
GetActivityDetial(){ GetActivityDetial(){
console.log(this.Id)
this.request2({ this.request2({
url: '/api/AppletEducation/GetActivityDetial', url: '/api/AppletEducation/GetActivityDetial',
data: {Id:this.Id} data: {Id:this.Id}
}, },
res => { res => {
this.loading = false;
this.detial = res.data; this.detial = res.data;
let tempRichtext="" let tempRichtext=""
tempRichtext = this.detial.ActivityInfo.replace(/<img[^>]*>/gi, function(match, capture) { tempRichtext = this.detial.ActivityInfo.replace(/<img[^>]*>/gi, function(match, capture) {
...@@ -621,10 +628,20 @@ ...@@ -621,10 +628,20 @@
}); });
}, },
gosignUp(){ gosignUp(){
let dataList = encodeURIComponent(JSON.stringify(this.detial)) let u = uni.getStorageSync("mall_UserInfo");
uni.navigateTo({ if (!u) {
url: '/pages/school/jieheactivityBM?details=' + dataList u = {
}) nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else {
let dataList = encodeURIComponent(JSON.stringify(this.detial))
uni.navigateTo({
url: '/pages/school/jieheactivityBM?details=' + dataList
})
}
}, },
previewImage(x){ previewImage(x){
uni.previewImage({ uni.previewImage({
...@@ -645,6 +662,15 @@ ...@@ -645,6 +662,15 @@
}, },
}); });
}, },
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth=false;
this.GetActivityDetial()
},
//关闭登录窗口
gbAuth(){
this.showAuth=false
},
} }
} }
</script> </script>
......
...@@ -156,14 +156,19 @@ ...@@ -156,14 +156,19 @@
</view> </view>
<view class="details-box" v-for="(x,y) in item.list" :key='y' @click="gourl(x)"> <view class="details-box" v-for="(x,y) in item.list" :key='y' @click="gourl(x)">
<view v-if="x.IsJoinActivity == 0"> <view v-if="x.IsJoinActivity == 0">
<view class="details-box-top-z" v-if="(x.TotalMan-x.JoinNum)>0" :style="{background:mainColor}"></view> <view class="details-box-top-z" v-if="(x.TotalMan-x.JoinNum)>0 && current==1" :style="{background:mainColor}"></view>
<view class="details-box-t-positions" v-if="(x.TotalMan-x.JoinNum)>0" :style="{background:mainColor}"> <view class="details-box-t-positions" v-if="(x.TotalMan-x.JoinNum)>0 && current==1" :style="{background:mainColor}">
<text>{{(x.TotalMan-x.JoinNum)>=6?'可预约':(x.TotalMan-x.JoinNum)<6?'剩余'+(x.TotalMan-x.JoinNum)+'个空位':''}}</text> <text>{{(x.TotalMan-x.JoinNum)>=6?'可预约':(x.TotalMan-x.JoinNum)<6?'剩余'+(x.TotalMan-x.JoinNum)+'个空位':''}}</text>
</view> </view>
<view class="details-box-top-f" v-if="(x.TotalMan-x.JoinNum)<1" ></view> <view class="details-box-top-f" v-if="(x.TotalMan-x.JoinNum)<1" ></view>
<view class="details-box-t-positions" v-if="(x.TotalMan-x.JoinNum)<1" style="background:#e2e2e2;color: #999999;"> <view class="details-box-t-positions" v-if="(x.TotalMan-x.JoinNum)<1" style="background:#e2e2e2;color: #999999;">
爆满 爆满
</view> </view>
<view class="details-box-top-f" v-if="(x.TotalMan-x.JoinNum)>0 && current==3" ></view>
<view v-if="current==3 && (x.TotalMan-x.JoinNum)>0" class="details-box-t-positions" style="background:#e2e2e2;color: #999999;">
已结束
</view>
</view> </view>
<view v-if="x.IsJoinActivity == 1"> <view v-if="x.IsJoinActivity == 1">
<view class="details-box-top-f" style="background: #40766E;" ></view> <view class="details-box-top-f" style="background: #40766E;" ></view>
...@@ -172,6 +177,7 @@ ...@@ -172,6 +177,7 @@
</view> </view>
</view> </view>
<!-- 内容 --> <!-- 内容 -->
<view class="details-b-center"> <view class="details-b-center">
<view class="details-b-center-l"> <view class="details-b-center-l">
...@@ -291,6 +297,45 @@ ...@@ -291,6 +297,45 @@
tabbarH:0, tabbarH:0,
}; };
}, },
onShareTimeline() {
let uid = uni.getStorageSync("mall_UserInfo") ? uni.getStorageSync("mall_UserInfo").UserId : 0;
if (uid == 0) {
uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0
}
let SmallShopId = uni.getStorageSync("mall_UserInfo") ?
uni.getStorageSync("mall_UserInfo").SmallShopId :
0;
if (SmallShopId == 0) { //如果微店id为0 去找所属微店id
SmallShopId = uni.getStorageSync("mall_UserInfo") ?
uni.getStorageSync("mall_UserInfo").UserSmallShopId : 0;
}
let id = this.Id;
let Up = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").UserPageType:0;
return {
title: '甲鹤活动',
query:"user_id=" + uid + "&SmallShopId=" + SmallShopId + "&Up=" + Up,
imageUrl: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/ActivitySharing.png',
};
},
onShareAppMessage(res) {
let u = uni.getStorageSync("mall_UserInfo");
let uid = u.UserId ? u.UserId : 0;
if (uid == 0) {
uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0
}
let SmallShopId = u.SmallShopId ? u.SmallShopId : 0;
if (SmallShopId == 0) { //如果微店id为0 去找所属微店id
SmallShopId = u.UserSmallShopId ? u.UserSmallShopId : 0
}
let Up = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo").UserPageType:0;
return {
title: '甲鹤活动',
path: "/pages/school/Jiaheactivity?user_id=" + uid + "&SmallShopId=" + SmallShopId + "&Up=" + Up ,
imageUrl: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/ActivitySharing.png'
};
},
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.pricecolor = this.$uiConfig.pricecolor; this.pricecolor = this.$uiConfig.pricecolor;
...@@ -306,16 +351,16 @@ ...@@ -306,16 +351,16 @@
}, },
onLoad: function(option) { onLoad: function(option) {
this.u = uni.getStorageSync("mall_UserInfo"); // this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { // if (!this.u) {
this.u = { // this.u = {
nickName: "未登录", // nickName: "未登录",
avatarUrl: "" // avatarUrl: ""
}; // };
this.showAuth = true; // this.showAuth = true;
} else { // } else {
this.GetActivityTypeList() this.GetActivityTypeList()
} // }
}, },
...@@ -415,6 +460,9 @@ ...@@ -415,6 +460,9 @@
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
this.GetActivityTypeList() this.GetActivityTypeList()
if (Object.keys(this.$refs).length > 0 && this.$refs.children) { //判断
this.$refs.children.getfzuj()
}
}, },
//关闭登录窗口 //关闭登录窗口
gbAuth() { gbAuth() {
...@@ -426,10 +474,7 @@ ...@@ -426,10 +474,7 @@
this.msg.SelectIsEnd=1 this.msg.SelectIsEnd=1
this.msg.pageIndex=1; this.msg.pageIndex=1;
this.init() this.init()
}else{ }else if(type==1){
this.msg.SelectIsEnd=0
}
if(type==1){//TODO 暂时不知道接口
this.msg.pageIndex=1; this.msg.pageIndex=1;
this.msg.SelectIsEnd=0 this.msg.SelectIsEnd=0
this.init() this.init()
......
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