Commit a7895cad authored by Mac's avatar Mac

司导分享

parent 35cd5e0e
...@@ -288,30 +288,6 @@ export default { ...@@ -288,30 +288,6 @@ export default {
this.generterConfig.bgType = this.types[v].clsName == "fill" ? 1 : 2; this.generterConfig.bgType = this.types[v].clsName == "fill" ? 1 : 2;
} }
}, },
// init() {
// let h = this.apiheader();
// this.request(
// {
// url: "",
// header: h,
// data: {
// r: "plugin/quick_share/api/poster/config",
// goods_id: this.id,
// },
// },
// (res) => {
// this.config = res.data.config;
// this.info = res.data.info;
// this.loading = false;
// this.generterConfig.bgColor = this.config.color[0];
// let temp = parseInt(this.config.image_style[0]);
// for (let i = 0; i < temp; i++) {
// this.generterConfig.images.push(this.info.multi_map[i]);
// }
// this.newInit();
// }
// );
// },
init() { init() {
let u = uni.getStorageSync("mall_UserInfo"); let u = uni.getStorageSync("mall_UserInfo");
let SmallShopId = uni.getStorageSync("mall_UserInfo") let SmallShopId = uni.getStorageSync("mall_UserInfo")
...@@ -330,8 +306,8 @@ export default { ...@@ -330,8 +306,8 @@ export default {
goodsId: this.id, goodsId: this.id,
// path: "/pages/goods/goods?id=" + this.id + "&user_id=" + u.UserId, // path: "/pages/goods/goods?id=" + this.id + "&user_id=" + u.UserId,
path: "/pages/index/index?id=" + this.id + "&user_id=" + u.UserId+ "&SmallShopId=" + SmallShopId path: "/pages/index/index?id=" + this.id + "&user_id=" + u.UserId+ "&SmallShopId=" + SmallShopId
+'&address='+this.address +'&address='+encodeURIComponent(JSON.stringify(this.address))
+'&Pickcar='+this.Pickcar +'&Pickcar='+encodeURIComponent(JSON.stringify(this.Pickcar))
+'&StartTime='+this.StartTime +'&StartTime='+this.StartTime
+'&EndTime='+this.EndTime +'&EndTime='+this.EndTime
+'&JumpType=3', +'&JumpType=3',
......
...@@ -128,10 +128,11 @@ export default { ...@@ -128,10 +128,11 @@ export default {
}, },
genernalHandler() { genernalHandler() {
//this.goodId //this.goodId
console.log(this.address,this.pickcar,this.startTime,this.endTime)
uni.navigateTo({ uni.navigateTo({
url: "/pages/guidecar/components/guidecarDraw?id="+this.goodId url: "/pages/guidecar/components/guidecarDraw?id="+this.goodId
+'&address='+this.address
+'&Pickcar='+this.pickcar
+'&StartTime='+this.startTime +'&StartTime='+this.startTime
+'&EndTime='+this.endTime +'&EndTime='+this.endTime
}); });
......
...@@ -229,16 +229,24 @@ ...@@ -229,16 +229,24 @@
:advertising="g.advertising" :advertising="g.advertising"
@close="closeShare" @close="closeShare"
></share> ></share>
<coupon
v-if="showCoupons"
:coupon-message="couponMessage"
@goLook="goLook"
@closeBtn="closeBtn"
></coupon>
</view> </view>
</template> </template>
<script> <script>
import hParse from "@/components/u-parse/parse.vue"; import hParse from "@/components/u-parse/parse.vue";
import share from "./components/guidecarShare.vue"; import share from "./components/guidecarShare.vue";
import coupon from "@/components/coupons/coupons";
export default { export default {
components: { components: {
hParse, hParse,
share share,
coupon
}, },
data() { data() {
return { return {
...@@ -262,12 +270,31 @@ ...@@ -262,12 +270,31 @@
Pickcar:'', Pickcar:'',
StartTime:"", StartTime:"",
EndTime:'', EndTime:'',
couponMessage: "",//弹出优惠券的内容
showCoupons: false,
SmallShopId:0,//分享微店id
uid:0,//分享的上级id
} }
}, },
onLoad(option){ onLoad(option){
console.log(option,'option')
if(option && option.GoodsId){ if(option && option.GoodsId){
this.GoodsId = option.GoodsId this.GoodsId = option.GoodsId
} }
if (option && option.custom_params) {
let custom_params = JSON.parse(decodeURIComponent(option.custom_params));
console.log(custom_params);
if (custom_params.user_id) {
uni.setStorageSync("pid", { pid: custom_params.user_id });
}
}
if (option && option.user_id) {
uni.setStorageSync("pid", { pid: option.user_id });
}
if (option && option.SmallShopId) {
uni.setStorageSync("SmallShopId", { SmallShopId: option.SmallShopId });
}
if(option && option.address){ if(option && option.address){
this.address = option.address this.address = option.address
} }
...@@ -282,6 +309,7 @@ ...@@ -282,6 +309,7 @@
this.ETime = this.getTime(option.EndTime) this.ETime = this.getTime(option.EndTime)
this.EndTime= option.EndTime this.EndTime= option.EndTime
} }
if(option&& option.StartTime && option.EndTime){ if(option&& option.StartTime && option.EndTime){
let startTime = new Date(option.StartTime); // 开始时间 let startTime = new Date(option.StartTime); // 开始时间
let endTime = new Date(option.EndTime); // 结束时间 let endTime = new Date(option.EndTime); // 结束时间
...@@ -308,8 +336,67 @@ ...@@ -308,8 +336,67 @@
this.init()//商品详情 this.init()//商品详情
this.getAppletGoodsCommentPageList()//获取商品评论数 this.getAppletGoodsCommentPageList()//获取商品评论数
let u = uni.getStorageSync("mall_UserInfo"); let u = uni.getStorageSync("mall_UserInfo");
let uid = u.UserId ? u.UserId : 0; this.uid = u.UserId ? u.UserId : 0;
this.path = '/pages/index/index?id=' + this.GoodsId + "&user_id=" + uid+'&JumpType=3'; this.SmallShopId = uni.getStorageSync("mall_UserInfo")? uni.getStorageSync("mall_UserInfo").SmallShopId: 0;
if(this.SmallShopId == 0){//如果微店id为0 去找所属微店id
this.SmallShopId = uni.getStorageSync("mall_UserInfo")? uni.getStorageSync("mall_UserInfo").UserSmallShopId: 0;
}
this.path = "/pages/index/index?GoodsId=" + this.GoodsId + "&user_id=" + this.uid+ "&SmallShopId=" + this.SmallShopId+'&JumpType=3'
+'&address='+encodeURIComponent(JSON.stringify(this.address))
+'&Pickcar='+encodeURIComponent(JSON.stringify(this.Pickcar))
+'&StartTime='+this.StartTime
+'&EndTime='+this.EndTime;
wx.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"],
});
},
onShareTimeline() {
setTimeout(() => {
console.log("分享朋友圈调用");
this.getReceive();
}, 2500);
if(this.uid==0){
this.uid = uni.getStorageSync("pid")?uni.getStorageSync("pid").pid:0
}
let title = this.g.app_share_title != null && this.g.app_share_title != ""
? this.g.app_share_title: this.g.name;
let imageUrl =
this.g.app_share_pic != null && this.g.app_share_pic != ""? this.g.app_share_pic: this.g.pic_url[0].pic_url;
return {
title: title,
query: "GoodsId=" + this.GoodsId + "&user_id=" + this.uid+ "&SmallShopId=" + this.SmallShopId
+'&address='+this.address
+'&Pickcar='+this.Pickcar
+'&StartTime='+this.StartTime
+'&EndTime='+this.EndTime,
imageUrl: imageUrl,
};
},
onShareAppMessage(res) {
setTimeout(() => {
console.log("分享好友调用");
this.getReceive();
}, 2500);
if(this.uid==0){
this.uid = uni.getStorageSync("pid")?uni.getStorageSync("pid").pid:0
}
return {
title: this.g.app_share_title != null && this.g.app_share_title != "" ? this.g.app_share_title : this.g.name,
path: "/pages/index/index?GoodsId=" + this.GoodsId + "&user_id=" + this.uid+ "&SmallShopId=" + this.SmallShopId+'&JumpType=3'
+'&address='+encodeURIComponent(JSON.stringify(this.address))
+'&Pickcar='+encodeURIComponent(JSON.stringify(this.Pickcar))
+'&StartTime='+this.StartTime
+'&EndTime='+this.EndTime,
imageUrl:
this.g.app_share_pic != null && this.g.app_share_pic != ""
? this.g.app_share_pic
: this.g.pic_url[0].pic_url,
};
}, },
created(){ created(){
...@@ -346,6 +433,7 @@ ...@@ -346,6 +433,7 @@
this.g.pic_url.forEach((x) => { this.g.pic_url.forEach((x) => {
this.imgs.push(x.pic_url); this.imgs.push(x.pic_url);
}); });
this.g.marketingLogo = JSON.parse(this.g.marketingLogo);
this.isAllowShare = res.data.goods.isAllowShare; //1为可以分享 2为不能分享 this.isAllowShare = res.data.goods.isAllowShare; //1为可以分享 2为不能分享
if (this.isAllowShare == 2) { if (this.isAllowShare == 2) {
//隐藏分享的按钮 //隐藏分享的按钮
...@@ -459,7 +547,35 @@ ...@@ -459,7 +547,35 @@
}) })
} },
getReceive() {
//分享进入调取领券接口
// 1-分享,2-购买并付款
this.request2(
{
url: "/api/AppletUser/ShareCoupon",
data: {
TriggerType: 1,
},
},
(res) => {
console.log(res, "res");
if (res.couponResultCode == 1) {
this.couponMessage = res.couponMessage;
this.showCoupons = true;
}
}
);
},
goLook() {
this.showCoupons = true;
uni.navigateTo({
url: "/pages/coupon/index/index",
});
},
closeBtn() {
this.showCoupons = false;
},
} }
} }
...@@ -475,6 +591,22 @@ ...@@ -475,6 +591,22 @@
background: #fff; background: #fff;
padding: 10px; padding: 10px;
} }
.guidecarOrderdetails .g-name{
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 16px;
height: 45px;
}
.guidecarOrderdetails .Logo {
padding: 1px 5px;
display: inline-block;
font-size: 22rpx;
margin-right: 5rpx;
border-radius: 4px;
}
.guidecarOrderdetails .g-info .g-price-box { .guidecarOrderdetails .g-info .g-price-box {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
......
...@@ -162,6 +162,7 @@ export default { ...@@ -162,6 +162,7 @@ export default {
loading: "努力加载中", loading: "努力加载中",
nomore: "没有更多了", nomore: "没有更多了",
}, },
PagePath:'',
}; };
}, },
...@@ -216,6 +217,7 @@ export default { ...@@ -216,6 +217,7 @@ export default {
this.getCarClassList()//车辆类型 this.getCarClassList()//车辆类型
this.init(); this.init();
this.getGuideCarBrandList()//车辆品牌 this.getGuideCarBrandList()//车辆品牌
this.getPagePath()//获取详情跳转详情地址
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
...@@ -345,13 +347,35 @@ getGuideCarBrandList(){ ...@@ -345,13 +347,35 @@ getGuideCarBrandList(){
this.init() this.init()
}, },
getPagePath(){
this.request2(
{
url: "/api/AppletGuideCar/GetGuideCarInfoForPagePath",
data: {},
},
(res) => {
if(res.resultCode==1){
this.PagePath = res.data.PagePath
}
}
);
},
goDetails(x){//跳转商品详情 goDetails(x){//跳转商品详情
if(this.PagePath!=''){
uni.navigateTo({ uni.navigateTo({
url:'/pages/guidecar/guidecarGoodsdetails?GoodsId='+x.id +'&address='+this.address+'&Pickcar='+this.Pickcar+ url:this.PagePath+'?GoodsId='+x.id +'&address='+this.address+'&Pickcar='+this.Pickcar+
'&StartTime='+this.msg.StartTime+ '&StartTime='+this.msg.StartTime+
'&EndTime='+this.msg.EndTime '&EndTime='+this.msg.EndTime
}) })
}else{//如果没有跳转地址的时候 默认
uni.navigateTo({
url:'/pages/guidecar/guidecarGoodsdetails?GoodsId='+x.id +'&address='+this.address+'&Pickcar='+this.Pickcar+
'&StartTime='+this.msg.StartTime+
'&EndTime='+this.msg.EndTime
})
}
}, },
lower(e) { lower(e) {
......
...@@ -131,6 +131,7 @@ export default { ...@@ -131,6 +131,7 @@ export default {
shopData: {}, shopData: {},
JumpType: 0, JumpType: 0,
GoodsId: 29, GoodsId: 29,
guidecar:{},
}; };
}, },
components: { components: {
...@@ -208,7 +209,7 @@ export default { ...@@ -208,7 +209,7 @@ export default {
uni.setStorageSync("SmallShopId", { SmallShopId: options.SmallShopId }); uni.setStorageSync("SmallShopId", { SmallShopId: options.SmallShopId });
console.log(uni.getStorageSync("SmallShopId")); console.log(uni.getStorageSync("SmallShopId"));
} }
if (options && options.scene) { if (options && options.scene) {
//兼容之前小程序的调转 //兼容之前小程序的调转
this.getjump(options.scene); this.getjump(options.scene);
...@@ -220,8 +221,15 @@ export default { ...@@ -220,8 +221,15 @@ export default {
menus: ["shareAppMessage", "shareTimeline"], menus: ["shareAppMessage", "shareTimeline"],
}); });
if (options && options.JumpType) { if (options && options.JumpType) {
//跳转类型 1为详情2为直播列表 //跳转类型 1为详情2为直播列表3为司导
this.JumpType = options.JumpType; this.JumpType = options.JumpType;
if(options.JumpType == 3){
this.guidecar.GoodsId = options.GoodsId;
this.guidecar.address = options.address?JSON.parse(decodeURIComponent(options.address)):'';
this.guidecar.Pickcar = options.Pickcar?JSON.parse(decodeURIComponent(options.Pickcar)):'';
this.guidecar.StartTime = options.StartTime?options.StartTime:'';
this.guidecar.EndTime = options.EndTime?options.EndTime:'';
}
} }
if (options && options.id) { if (options && options.id) {
//商品详情 //商品详情
...@@ -250,6 +258,9 @@ export default { ...@@ -250,6 +258,9 @@ export default {
} else if (that.JumpType == 2) { } else if (that.JumpType == 2) {
//直播列表 //直播列表
uni.navigateTo({ url: "/pages/live/index" }); uni.navigateTo({ url: "/pages/live/index" });
}else if (that.JumpType == 3) {
//司导详情
that.goguidecar()
} }
}, 500); }, 500);
} else { } else {
...@@ -444,7 +455,10 @@ export default { ...@@ -444,7 +455,10 @@ export default {
} else if (that.JumpType == 2) { } else if (that.JumpType == 2) {
//直播列表 //直播列表
uni.navigateTo({ url: "/pages/live/index" }); uni.navigateTo({ url: "/pages/live/index" });
} }else if (that.JumpType == 3) {
//司导详情
that.goguidecar()
}
}, 500); }, 500);
} else { } else {
if (!that.u) { if (!that.u) {
...@@ -743,13 +757,23 @@ export default { ...@@ -743,13 +757,23 @@ export default {
} else if (this.JumpType == 2) { } else if (this.JumpType == 2) {
//直播列表 //直播列表
uni.navigateTo({ url: "/pages/live/index" }); uni.navigateTo({ url: "/pages/live/index" });
} }else if (this.JumpType == 3) {
//司导详情
this.goguidecar()
}
}, 500); }, 500);
}, },
//关闭登录窗口 //关闭登录窗口
gbAuth() { gbAuth() {
this.showAuth = false; this.showAuth = false;
}, },
goguidecar(){
uni.navigateTo({
url:'/pages/guidecar/guidecarGoodsdetails?GoodsId='+this.guidecar.GoodsId +'&address='+this.guidecar.address+'&Pickcar='+this.guidecar.Pickcar+
'&StartTime='+this.guidecar.StartTime+
'&EndTime='+this.guidecar.EndTime
})
}
}, },
}; };
</script> </script>
......
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