Commit 5c4ba6cc by 李嘉林

feat: 下单加进店方式

parent e33ba3ee
......@@ -360,6 +360,7 @@ export default {
},
async onLoad(options) {
log.info('home-onLoad')
console.log('home-onLoad-options->', options);
if(this.$options) {
Object.assign(this.$data, this.$options.data());
}
......@@ -406,6 +407,7 @@ export default {
methods: {
async pageInit(options) {
wx.setStorageSync("entryMode", '');
log.info(options, '---------home----options')
let h5Params = options && options.params ? JSON.parse(decodeURIComponent(options.params)) : {};
this.h5Params = h5Params;
......@@ -437,8 +439,14 @@ export default {
});
log.info(wx.getStorageSync("becomeInfo"),'home---wx.getStorageSync("becomeInfo")')
}
if (options.share) {
log.info('options.share', options.share)
console.log('home-options-share->', options);
wx.setStorageSync("entryMode", 'share');
}
if(options.scene){
wx.setStorageSync("firstView", 1);
wx.setStorageSync("entryMode", 'scene');
this.reloadPage = true;
//新二维码扫码进入
let res = await indexApi.getShareSceneRecord(options.scene);
......@@ -1277,6 +1285,7 @@ export default {
let newHref = '/pages/home/main';
let title = app.globalData.shopInfo.shopName;
let hasInvitationStatus = 0;
let newData = {}
if(wx.getStorageSync("sessionid")) {
await app.fenxiaoModel.getSpokesmanidByShare().then(data=>{
log.info(data,'onShareAppMessage-getSpokesmanidByShare')
......@@ -1288,7 +1297,6 @@ export default {
log.info(hasInvitationStatus,'onShareAppMessage-hasInvitationStatus')
await app.fenxiaoModel.getSpokesmanInfo().then(data=>{
log.info('onShareAppMessage调用getSpokesmanInfo')
let newData = {}
log.info(data,'getSpokesmanInfo.data')
if(data != null ) {
if (hasInvitationStatus == 1) {
......@@ -1318,6 +1326,9 @@ export default {
imageUrl = JSON.parse(this.pageInfo.pageSettingData).shareImg
}
log.info(newHref,3333555666,title,res)
newHref = concatUrl(newHref, {
share: 1
})
return {
title: title, // 默认是小程序的名称
path: newHref, // 默认是当前页面
......
......@@ -168,6 +168,7 @@ export default {
},
onLoad(options) {
let { offlineShopCode, offlineShopName } = getStoreInfo();
wx.setStorageSync("entryMode", '');
// 新用户首次扫码进入此页没缓存认定为第一次访问
if (offlineShopCode) {
wx.removeStorageSync("firstView");
......@@ -243,6 +244,7 @@ export default {
this.checkLogin();
this.options = options;
if (options.share) {
wx.setStorageSync("entryMode", 'share');
log.info('options.share',options.share)
//来自分享
this.link = decodeURIComponent(options.share);
......@@ -350,6 +352,7 @@ export default {
this.params += "&" + serialize(options.params);
} else if (options.scene) {
log.info('options.scene',options)
wx.setStorageSync("entryMode", 'scene');
if(options.scene.indexOf('_') == -1){
log.info("新版本(scene参数)分享进入")
this.withoutScene = false;
......@@ -511,6 +514,11 @@ export default {
}
}
// 加进入方式参数
let entryMode = wx.getStorageSync('entryMode') ? wx.getStorageSync('entryMode') : '';
if (entryMode) {
this.params += `&entryMode=${entryMode}`;
}
this.newPageUrl = this.removeEmptyQueryParams(this.pageUrl);
console.log('this.newPageUrl', this.newPageUrl)
// 商品分享进入 (卡片分享、扫码、点击小程序链接)
......
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