Commit 3524bea4 by 李嘉林

fix

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