Commit d1ec7fc9 by 侯体倬

导购 id 处理

parent 7e6b25f8
......@@ -78,6 +78,12 @@ export default {
if(wx.getStorageSync("workBox")){
this.params += `&workBox=${wx.getStorageSync("workBox")}`
}
// 判断当前是否为导购分享
const guideEmployeeId = wx.getStorageSync(this.$store.state.mixid + 'guideEmployeeId');
if (guideEmployeeId) {
this.params += `&setGuideEmployeeId=${guideEmployeeId}`;
}
// tabbar 跳转
let homeIndex = checkTabbarPage("/");
console.log(homeIndex,tabIndex,'--tabIndex')
......
......@@ -83,6 +83,11 @@ export default {
let { latitude, longitude } = locationObj;
this.params+=`&latitude=${latitude}&longitude=${longitude}`
}
// 判断当前是否为导购分享
const guideEmployeeId = wx.getStorageSync(this.$store.state.mixid + 'guideEmployeeId');
if (guideEmployeeId) {
this.params += `&setGuideEmployeeId=${guideEmployeeId}`;
}
console.log(this.link,'=======',this.page,'++++++++++++++',this.params,'************')
let pageUrl1 = (this.page.startsWith('http://') || this.page.startsWith('https://'))? (this.page + this.params) : this.link+this.page+this.params
console.log(pageUrl1,'--------pageUrl1--')
......@@ -339,6 +344,10 @@ export default {
offlineShopName:paramsObj.offlineShopName,
});
}
// 判断是否为导购分享进入
if (paramsObj.guideEmployeeId) {
wx.setStorageSync(this.$store.state.mixid+'guideEmployeeId', paramsObj.guideEmployeeId);
}
wx.setStorageSync('attractingCustomerChannelId',paramsObj.attractingCustomerChannelId);
wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId);
wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId);
......
import store from '../store/index'
console.log(store.state.mixid,'store.state')
let shopMixid = store.state.mixid;
// 获取请求头
const getRequestHeader = (extraHeader = {}) => {
// 共用请求头
const BASE_HEADER = {
"Shop-Mixid": store.state.mixid,
"Authorization": wx.getStorageSync('sessionid') || "",
"Offline-Shop-Code": wx.getStorageSync('offlineShopCode') || "",
"Area-Id": wx.getStorageSync('location') ? JSON.parse(wx.getStorageSync('location')).id : '',
"Region-id": wx.getStorageSync('location') ? JSON.parse(wx.getStorageSync('location')).systemRegionId : '',
}
// 判断是否存在导购员 id
const guideEmployeeId = wx.getStorageSync(store.state.mixid + 'guideEmployeeId');
if (guideEmployeeId) {
BASE_HEADER['Guide-Employee-Id'] = guideEmployeeId;
}
return Object.assign(BASE_HEADER, extraHeader);
}
// wx.getStore
export async function requestGET(url, options) {
return new Promise((resolve, reject) => {
......@@ -11,14 +27,7 @@ export async function requestGET(url, options) {
url: url,
data: options,
method: "GET",
header: {
"Shop-Mixid": store.state.mixid,
"Offline-Shop-Code": wx.getStorageSync('offlineShopCode') || "",
"Authorization": wx.getStorageSync('sessionid') || "",
"Region-id" : wx.getStorageSync('location') ? JSON.parse(wx.getStorageSync('location')).systemRegionId : '',
"Area-Id": wx.getStorageSync('location') ? JSON.parse(wx.getStorageSync('location')).id : '',
// "dubbo-tag": "ljx"
},
header: getRequestHeader(),
success: function (res) {
resolve(res)
},
......@@ -41,15 +50,9 @@ export async function requestPOST(url, options) {
url: url,
data: options,
method: "POST",
header: {
"Shop-Mixid": store.state.mixid,
"Authorization": wx.getStorageSync('sessionid') || "",
"Offline-Shop-Code": wx.getStorageSync('offlineShopCode') || "",
"openId": wx.getStorageSync("openid") || '',
"Region-id": wx.getStorageSync('location') ? JSON.parse(wx.getStorageSync('location')).systemRegionId : '',
"Area-Id": wx.getStorageSync('location') ? JSON.parse(wx.getStorageSync('location')).id : '',
// "dubbo-tag": "ljx"
},
header: getRequestHeader({
openId: wx.getStorageSync("openid") || ''
}),
success: function (res) {
resolve(res)
},
......@@ -72,15 +75,9 @@ export function requestPOST1(url, options) {
url: url,
data: options,
method: "POST",
header: {
"Content-Type": "application/x-www-form-urlencoded",
"Shop-Mixid": store.state.mixid,
Authorization: wx.getStorageSync('sessionid') || "",
"Offline-Shop-Code": wx.getStorageSync('offlineShopCode') || "",
"Region-id": wx.getStorageSync('location') ? JSON.parse(wx.getStorageSync('location')).systemRegionId : '',
"Area-Id": wx.getStorageSync('location') ? JSON.parse(wx.getStorageSync('location')).id : '',
// "dubbo-tag": "ljx"
},
header: getRequestHeader({
"Content-Type": "application/x-www-form-urlencoded"
}),
success: function (res) {
resolve(res)
},
......
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