|
@@ -110,35 +110,35 @@
|
|
|
index:'',
|
|
|
areaName:'区域',
|
|
|
loading:false,
|
|
|
+ ext:'',
|
|
|
+ authorizShow:false,
|
|
|
+ wxOpenData:'',
|
|
|
+ userInfo: '',
|
|
|
}
|
|
|
},
|
|
|
|
|
|
onLoad() {
|
|
|
var that = this;
|
|
|
uni.removeStorageSync('selectCity');
|
|
|
- uni.authorize({
|
|
|
- scope: 'scope.userLocation',
|
|
|
- success() {
|
|
|
- uni.getLocation({
|
|
|
- type: 'gcj02',
|
|
|
- success: function(res) {
|
|
|
- console.log(res)
|
|
|
- that.location.lat = res.latitude
|
|
|
- that.location.lng = res.longitude
|
|
|
- that.getAdress();
|
|
|
- //that.getqueryShopList() //获取全部门店列表
|
|
|
-
|
|
|
- },
|
|
|
- fail(err) {
|
|
|
- console.log("定位失败")
|
|
|
- that.getqueryShopList();
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- that.getqueryShopList();
|
|
|
-
|
|
|
- }})
|
|
|
+ this.userInfo = uni.getStorageSync("userInfo");
|
|
|
+ this.ext=this.$common.getExtStoreId();
|
|
|
+ if(this.userInfo){
|
|
|
+ this.themeColor = uni.getStorageSync("themeColor");
|
|
|
+ this.wxOpenData=this.$store.state.wxOpenData;
|
|
|
+ this.init()
|
|
|
+ }else{
|
|
|
+ this.$common.automaticlogin().then(val => {
|
|
|
+ this.themeColor = uni.getStorageSync("themeColor");
|
|
|
+ this.userInfo=this.$store.state.userInfo;
|
|
|
+ this.wxOpenData=this.$store.state.wxOpenData;
|
|
|
+ this.init()
|
|
|
+ if(!this.userInfo){
|
|
|
+ uni.hideLoading();
|
|
|
+ this.authorizShow=true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// that.getqueryShopList();
|
|
|
|
|
@@ -157,6 +157,32 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ init(){
|
|
|
+ var that = this;
|
|
|
+ uni.authorize({
|
|
|
+ scope: 'scope.userLocation',
|
|
|
+ success() {
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'gcj02',
|
|
|
+ success: function(res) {
|
|
|
+ console.log(res)
|
|
|
+ that.location.lat = res.latitude
|
|
|
+ that.location.lng = res.longitude
|
|
|
+ that.getAdress();
|
|
|
+ //that.getqueryShopList() //获取全部门店列表
|
|
|
+
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ console.log("定位失败")
|
|
|
+ that.getqueryShopList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ that.getqueryShopList();
|
|
|
+
|
|
|
+ }})
|
|
|
+ },
|
|
|
quCilck(){
|
|
|
this.$refs.popup.open("right")
|
|
|
this.popupShow=true;
|