Commit 1eb2dead authored by Mac's avatar Mac

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

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