Commit 3524bea4 by 李嘉林

fix

parent a7538e4b
...@@ -35,33 +35,36 @@ export default { ...@@ -35,33 +35,36 @@ export default {
}; };
}, },
onLoad() { onLoad() {
if (this.openThousandsStoresFlag) {
this.getLocationHandle(() => { this.getLocationHandle(() => {
this.getShopList(); this.getShopList();
}); });
}
}, },
computed: { computed: {
shopName() { shopName() {
return app.globalData.shopInfo.shopName; return app.globalData && app.globalData.shopInfo && app.globalData.shopInfo.shopName;
}, },
shopLogo() { shopLogo() {
return DFSImg(app.globalData.shopInfo.logoUrl, 400, 400); return app.globalData && app.globalData.shopInfo && DFSImg(app.globalData.shopInfo.logoUrl, 400, 400);
}, },
// 开启连锁商城(千店千面) // 开启连锁商城(千店千面)
openThousandsStoresFlag() { openThousandsStoresFlag() {
return app.globalData.shopInfo.openThousandsStoresFlag == 1 return app.globalData && app.globalData.shopInfo && app.globalData.shopInfo.openThousandsStoresFlag == 1
} }
}, },
methods: { methods: {
getLocationHandle(callback) { getLocationHandle(callback) {
let _this = this; let _this = this;
wx.getLocation({ wx.getLocation({
type: "wgs84", type: "gcj02", // gcj02 wgs84
isHighAccuracy: true,
success: res => { success: res => {
// latitude longitude speed accuracy // latitude longitude speed accuracy
log.info("~~~~~~~~~1~~~~~~~", res); log.info("~~~~~~~~~1~~~~~~~", res);
console.log("~~~~~~~~~1~~~~~~~", res); console.log("~~~~~~~~~1~~~~~~~", res);
this.offlineStoreReq.latitude = res.latitude; _this.offlineStoreReq.latitude = res.latitude;
this.offlineStoreReq.longitude = res.longitude; _this.offlineStoreReq.longitude = res.longitude;
// 存缓存 // 存缓存
wx.setStorageSync("locationObj", JSON.stringify(res)); wx.setStorageSync("locationObj", JSON.stringify(res));
callback(res); callback(res);
...@@ -86,8 +89,8 @@ export default { ...@@ -86,8 +89,8 @@ export default {
// 进店规则获取门店id // 进店规则获取门店id
let query = { let query = {
channelType: 2, //设备类型(0:pc,1:app,2:小程序) channelType: 2, //设备类型(0:pc,1:app,2:小程序)
consumerLongitude: this.$store.state.wxLocation.longitude, //经度,小程序和app可以获取到就要传,没有不传 consumerLongitude: this.offlineStoreReq.longitude, //经度,小程序和app可以获取到就要传,没有不传
consumerLatitude: this.$store.state.wxLocation.latitude, //纬度,小程序和app可以获取到就要传,没有不传 consumerLatitude: this.offlineStoreReq.latitude, //纬度,小程序和app可以获取到就要传,没有不传
distributionOfficerShopId: "" //分销员门店id,没有不传 distributionOfficerShopId: "" //分销员门店id,没有不传
} }
let enterShopRes = await shop.getEnterShopId(query); let enterShopRes = await shop.getEnterShopId(query);
...@@ -112,9 +115,9 @@ export default { ...@@ -112,9 +115,9 @@ export default {
this.$store.dispatch("setShopName", { this.$store.dispatch("setShopName", {
shopName: ruleShop[0].shopName, shopName: ruleShop[0].shopName,
}); });
}
return; return;
} }
}
this.storeList.forEach((item, index) => { this.storeList.forEach((item, index) => {
if (item.shopName == offlineShopName) { if (item.shopName == offlineShopName) {
isStore = true; isStore = true;
......
<template> <template>
<div class="loadings"> <div class="loadings" v-if="shopLogo">
<div class="img flex"> <div class="img flex">
<image :src="shopLogo" alt="" mode="aspectFill"></image> <image :src="shopLogo" alt="" mode="aspectFill"></image>
<van-loading color="black" size="60px" /> <van-loading color="black" size="60px" />
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<script> <script>
import { DFSImg } from "@/utils/index"; import { DFSImg } from "@/utils/index";
const app = getApp();
export default { export default {
props: { props: {
toHide: { toHide: {
...@@ -21,7 +22,7 @@ export default { ...@@ -21,7 +22,7 @@ export default {
}, },
computed: { computed: {
shopLogo() { shopLogo() {
let logoUrl = this.mpApp.globalData.shopInfo.logoUrl; let logoUrl = app.globalData && app.globalData.shopInfo && app.globalData.shopInfo.logoUrl;
return logoUrl?DFSImg(logoUrl):""; return logoUrl?DFSImg(logoUrl):"";
}, },
}, },
......
...@@ -387,7 +387,9 @@ export default { ...@@ -387,7 +387,9 @@ export default {
}) })
}); });
} }
if(this.$options) {
Object.assign(this.$data, this.$options.data()); Object.assign(this.$data, this.$options.data());
}
if (options.from && options.from == "logout") { if (options.from && options.from == "logout") {
//来自用户登出 //来自用户登出
wx.removeStorage({ wx.removeStorage({
......
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