lhl 3 anos atrás
pai
commit
23a6a8bb76

+ 7 - 0
manifest.json

@@ -160,6 +160,13 @@
             "treeShaking" : {
                 "enable" : true
             }
+        },
+        "sdkConfigs" : {
+            "maps" : {
+                "qqmap" : {
+                    "key" : "VYZBZ-P2TRG-RMIQ3-ITAIN-2DKBK-CKFQQ"
+                }
+            }
         }
     }
 }

+ 2 - 12
pages.json

@@ -562,18 +562,8 @@
 		{
 			"path": "pages/shoping/list",
 			"style": {
-				"navigationBarTitleText": "店铺信息",
-				"app-plus": {
-					"titleNView": {
-						"searchInput": {
-							"backgroundColor": "rgba(231, 231, 231,.7)",
-							"borderRadius": "16px",
-							"placeholder": "请输入关键字",
-							"placeholderColor": "#606266",
-							"align": "left"
-						}
-					}
-				}
+				"navigationBarTitleText": "店铺列表"
+				
 			}
 		},
 		{

+ 12 - 8
pages/address/addressManage.vue

@@ -10,10 +10,10 @@
 		</view>
 		<view class="row b-b">
 			<text class="tit">地址</text>
-			<picker mode="multiSelector" :range="arrDate" @change="cityChange">
+			<!-- <picker mode="multiSelector" :range="arrDate" @change="cityChange">
 				<view>{{ addressDetail || '请选择地址(点击选择地址)' }}</view>
-			</picker>
-			<!-- <pickerAddress class="input"  @change="onCityClick">{{ addressDetail || '请选择地址(点击选择地址)' }}</pickerAddress> -->
+			</picker> -->
+			<pickerAddress class="input"  @change="onCityClick">{{ addressDetail || '请选择地址(点击选择地址)' }}</pickerAddress>
 		</view>
 		<view class="row b-b" @click="clickMap">
 			<text class="tit">定位</text>
@@ -171,7 +171,7 @@ export default {
 			address.province = data[0];
 			address.city = data[1];
 			address.district = data[2];
-			this.addressDetail = data.join('');
+			this.addressDetail = data.join(',');
 		},
 		
 		// 选择地址
@@ -219,7 +219,8 @@ export default {
 				return;
 			}
 			//this.$api.prePage()获取上一页实例,可直接调用上页所有数据和方法,在App.vue定义
-			addressEdit({
+			addressEdit({
+				type: 1,
 				real_name: data.name,
 				phone: data.mobile,
 				address: {
@@ -227,11 +228,14 @@ export default {
 					city: data.address.city,
 					district: data.address.district
 				},
-				detail: obj.addressLocation.name + ',' + data.area,
+				// detail: obj.addressLocation.name + ',' + data.area,
+				detail: '台州市椒江区政府(青年路北)' + ',' + data.area,
 				is_default: data.default,
 				id: data.id || '',
-				longitude: obj.addressLocation.longitude,
-				latitude: obj.addressLocation.latitude
+				// longitude: obj.addressLocation.longitude,121.430479
+				// latitude: obj.addressLocation.latitude,28.644847
+				longitude: '121.44297',
+				latitude: '28.67307'
 			}).then(function(e) {
 				uni.showToast({
 					title: '提交成功',

+ 45 - 42
pages/index/index.vue

@@ -9,7 +9,7 @@
 			<!-- 搜素栏 -->
 			<view class="search flex">
 				<image src="../../static/icon/address.png" class="address"></image>
-				<view class="shop-name clamp" @click.stop="nav('/pages/shoping/list')">{{store_name}}</view>
+				<view class="shop-name clamp" @click.stop="nav('/pages/shoping/list')">{{storeInfo.name}}</view>
 				<view class="input-box flex" @click.stop="clickSearch">
 					<view class=" input-content flex">
 						<view class="iconfont iconsearch"></view>
@@ -32,7 +32,7 @@
 					<text>全部分类</text>
 				</view>
 			</navigator>
-			<navigator url="/pages/address/shopList">
+			<navigator url="/pages/shoping/list">
 				<view class="cate-item">
 					<image src="/static/icon/in1.png"></image>
 					<text>附近门店</text>
@@ -134,10 +134,11 @@
 
 <script>
 import seckill from './seckill';
+import { openMap } from '@/utils/rocessor.js';
 import { loadIndexs,store_list } from '@/api/index.js';
 import { interceptor } from '@/utils/loginUtils';
 import { userinfo } from '@/api/user.js';
-import { mapState } from 'vuex';
+import { mapState, mapMutations } from 'vuex';
 import { getProducts } from '@/api/product.js';
 // #ifdef H5
 import { weixindata } from '@/utils/wxAuthorized';
@@ -158,7 +159,6 @@ export default {
 			swiperLength: 0,
 			longitude:121.436289,//经度
 			latitude:28.651485,//纬度
-			store_name:'',//门店姓名
 			carouselList: [], //轮播列表
 			goodsList: [], //积分商品列表
 			bastList: [], //消费券商品列表
@@ -172,7 +172,7 @@ export default {
 		};
 	},
 	computed: {
-		...mapState(['loginInterceptor']),
+		...mapState(['loginInterceptor','storeInfo']),
 		...mapState('user', ['hasLogin', 'userInfo'])
 	},
 	onLoad(option) {
@@ -190,6 +190,7 @@ export default {
 				data: option.spread
 			});
 		}
+		this.getaddress();
 	},
 	onShow() {
 		// 判断是否强制登录
@@ -201,39 +202,6 @@ export default {
 					console.log(e);
 				});
 		}
-		// // #ifdef H5
-		// weixindata().then(wxOjb => {
-		// 	console.log(wxOjb,'123456798')
-		// 	wxOjb.getLocation({
-		// 		type: 'wgs84',
-		// 			success: function(res) {
-		// 				console.log('获取经纬度', res);
-		// 				obj.longitude = res.longitude;
-		// 				obj.latitude = res.latitude;
-		// 				 uni.setStorageSync('longitude', obj.longitude4);
-		// 				 uni.setStorageSync('latitude', obj.latitude4);
-		// 				obj.marker = [
-		// 					{
-		// 						longitude: res.longitude,
-		// 						latitude: res.latitude,
-		// 						iconPath: '/static/img/img19.png',
-		// 						width: '45',
-		// 						height: '45'
-		// 					}
-		// 				];
-		// 				obj.loadData();
-		// 			},
-		// 			fail(e) {
-		// 				console.log('失败', e);
-		// 				// window.location.reload();
-		// 				obj.tishi()
-		// 			}
-		// 		});
-		// }).catch(err => {
-		// 	obj.tishi()
-		// 	console.log(err)
-		// })
-		// // #endif 
 		this.loadData();
 	},
 	// #ifndef MP
@@ -263,6 +231,28 @@ export default {
 	},
 	// #endif
 	methods: {
+		...mapMutations(['setLat', 'setLon','setStoreInfo']),
+		//获取定位信息
+		getaddress() {
+			console.log('dizhi+++++++++++')
+			let obj = this;
+			uni.getLocation({
+				type:'gcj02',
+				success: res => {
+					console.log(res)
+					console.log('66666666666666666666')
+					obj.setLat(res.latitude);
+					obj.setLon(res.longitude);
+					obj.getStore(res.latitude, res.longitude);
+				},
+				fail: err => {
+					console.log(err,'shi+++++++++++++++')
+					openMap().then(e => {
+						this.getaddress();
+					});
+				}
+			});
+		},
 		// 點擊搜索框
 		clickSearch() {
 			uni.navigateTo({
@@ -273,13 +263,25 @@ export default {
 		onImageError(key, index) {
 			this[key][index].image = '/static/error/errorImage.jpg';
 		},
+		getStore(latitude,longitude) {
+			let obj = this
+			store_list({
+				latitude:latitude,
+				longitude:longitude,
+				page: 1,
+				limit: 1,
+			}).then(({data})=> {
+				console.log(data,'storeInfo++++')
+				obj.setStoreInfo(data.list[0])
+			})
+		},
 		// 请求载入数据
 		async loadData() {
 			const obj = this;
-			store_list({latitude:obj.latitude,longitude:obj.longitude}).then(({data}) =>{
-				console.log(data)
-				obj.store_name = data.list[0].detailed_address
-			})
+			// store_list({latitude:obj.latitude,longitude:obj.longitude}).then(({data}) =>{
+			// 	console.log(data)
+			// 	obj.store_name = data.list[0].detailed_address
+			// })
 			loadIndexs({}).then(({ data }) => {
 				let goods = data.info;
 				this.carouselList = data.banner;
@@ -375,6 +377,7 @@ page {
 			height: 38rpx;
 		}
 		.shop-name {
+			height: 38rpx;
 			position: relative;
 			z-index: 100;
 			width: 206rpx;

+ 29 - 8
pages/shoping/list.vue

@@ -3,11 +3,11 @@
 		<view class="varHeight"></view>
 		<view class="jg" style="height: 20rpx;"></view>
 		<block :key="ind" v-for="(lss, ind) in list">
-			<view class="goodsList-item" v-if="lss.show" @click="navProduct(lss)">
+			<view class="goodsList-item" v-if="lss.show" @click="chooseStore(lss)">
 				<view class="info-top flex">
-					<image :src="lss.logo" lazy-load mode="scaleToFill"></image>
+					<image :src="lss.image" lazy-load mode="scaleToFill"></image>
 					<view class="store-name clamp2">
-						{{lss.title}}
+						{{lss.name}}
 					</view>
 				</view>
 				<view class="tag">
@@ -15,7 +15,7 @@
 				</view>
 				<view class="goodsList-content">
 					<view class="info-tit">地区:<text class="info-val">{{lss.address}}</text></view>
-					<view class="info-tit">电话:<text class="info-val">{{lss.tel }}</text></view>
+					<view class="info-tit">电话:<text class="info-val">{{lss.phone }}</text></view>
 					<view class="info-tit">地址:<text class="info-val">{{lss.detailed_address}}</text></view>
 				</view>
 			</view>
@@ -23,7 +23,8 @@
 		<view class="jg" style="height: 20rpx;"></view>
 	</view>
 </template>
-<script>
+<script>
+import { mapState, mapMutations } from 'vuex';
 import { store_list } from '@/api/index.js';
 export default {
 	data() {
@@ -32,7 +33,8 @@ export default {
 			list: [],
 			keyword: '' ,//查询中的内容
 			longitude:121.436289,//经度
-			latitude:28.651485,//纬度
+			latitude:28.651485,//纬度
+			type: 0,//3->开通会员选择门店
 		};
 	},
 	watch: {
@@ -42,7 +44,10 @@ export default {
 			this.search();
 		}
 	},
-	onLoad() {
+	onLoad(opt) {
+		if(opt.type) {
+			this.type = opt.type
+		}
 		this.getShoping();
 	},
 	// #ifndef MP
@@ -55,7 +60,8 @@ export default {
 		this.keyword = e.text;
 	},
 	// #endif
-	methods: {
+	methods: {
+		...mapMutations(['setLat', 'setLon','setStoreInfo']),
 		// 查询店铺信息
 		search(title) {
 			let obj = this;
@@ -90,6 +96,21 @@ export default {
 				.catch(e => {
 					console.log(e);
 				});
+		},
+		//选择门店
+		chooseStore(item) {
+			if(this.type == 3) {
+				this.$api.prePage().storeInfo = item
+				uni.navigateBack({
+					
+				})
+			}else {
+				this.setStoreInfo(item)
+				uni.navigateBack({
+					
+				})
+			}
+			
 		}
 	}
 };

+ 1 - 1
pages/user/user.vue

@@ -129,7 +129,7 @@
 					<uni-list-item title="邀请海报" @click="navTo('/pages/shareQrCode/index')" thumb="/static/user/haibao.png"></uni-list-item>
 					<uni-list-item title="我的收藏" @click="navTo('/pages/favorites/favorites')" thumb="/static/user/collect.png"></uni-list-item>
 					<uni-list-item title="收货地址" @click="navTo('/pages/address/address')" thumb="/static/user/address.png"></uni-list-item>
-					<uni-list-item title="商家入口" @click="navTo('/pages/merchant/merchant')" thumb="/static/user/shopping.png"></uni-list-item>
+					<uni-list-item title="商家入口" @click="navTo('/pages/merchant/merchant')" thumb="/static/user/shopping.png" v-if="userInfo.service == 1"></uni-list-item>
 				</uni-list>
 			</view>
 		</view>

+ 20 - 4
pages/wallet/openMember.vue

@@ -63,6 +63,9 @@
 					</view>
 				</view>
 			</view>
+		</view>
+		<view class="" @click="chooseStore">
+			选择门店: {{storeInfo.name|| '请选择门店'}}
 		</view>
 		<view class="box-buttom">
 			<view class="price-left">
@@ -148,7 +151,10 @@ export default {
 		}
 	},
 	data() {
-		return {
+		return {
+			storeInfo: {
+				name: ''
+			},
 			checkedZdLoding: false, //自动拼团是否加载中
 			checkedAutoZd: 1, //开启关闭自动拼团
 			timeEnd: true, //判断会员是否超时
@@ -189,7 +195,10 @@ export default {
 			choose: 0,
 			level_id: '',
 			checkedAuto: false, //是否开启自动领红包
-			checkedLoding: false //请求自动加载设置保存中
+			checkedLoding: false ,//请求自动加载设置保存中
+			store: {
+				name: ''
+			}
 		};
 	},
 	methods: {
@@ -298,6 +307,12 @@ export default {
 				.catch(e => {
 					console.log(e);
 				});
+		},
+		// 选择门店
+		chooseStore() {
+			uni.navigateTo({
+				url: '/pages/shoping/list?type=3'
+			})
 		},
 		pay() {
 			let obj = this;
@@ -313,7 +328,8 @@ export default {
 					title: '支付中',
 					mask: true
 				});
-				let data = {
+				let data = {
+					store_id: obj.storeInfo.id,
 					pay_type: this.payName,
 					level_id: obj.level_id,
 					// #ifdef H5
@@ -664,7 +680,7 @@ export default {
 		margin-top: 40rpx;
 		justify-content: center;
 		align-items: center;
-		padding: 0 47rpx 160rpx 25rpx;
+		padding: 0 47rpx 50rpx 25rpx;
 		.current {
 			border: 1rpx solid #fed591 !important;
 			background: #fff8ec !important;

+ 13 - 1
store/index.js

@@ -18,7 +18,10 @@ const store = new Vuex.Store({
 		// #endif
 		// #ifndef APP-PLUS
 		isShowIllegality:true,//允许显示隐藏信息
-		// #endif
+		// #endif
+		latitude: '',
+		longitude: '',
+		storeInfo: {}
 	},
 	mutations: {
 		//保存微信信息
@@ -32,6 +35,15 @@ const store = new Vuex.Store({
 		// 修改显示隐藏ios审核不允许显示的功能
 		changeState(state, provider){
 			state.isShowIllegality = provider;
+		},
+		setLat(state, provider) {
+			state.latitude = provider
+		},
+		setLon(state, provider) {
+			state.longitude = provider
+		},
+		setStoreInfo(state,provider) {
+			state.storeInfo = provider
 		}
 	},
 	modules:{

+ 41 - 53
utils/rocessor.js

@@ -55,57 +55,45 @@ export function timeComputed(time) {
 	}
 }
 
-export function openMap(e) {
-	console.log(22)
-	var that = this
-	return new Promise((resolve, reject) => {
-		uni.getSetting({
-			success(res) {
-				//这里判断是否有地位权限
-				if (!res.authSetting['scope.userLocation']) {
-					uni.hideLoading();
-					uni.showModal({
-						title: '提示',
-						content: '请求获取位置权限',
-						success: function(res) {
-							if (res.confirm == false) {
-								// 授权失败
-								reject()
-								return false;
-							}
-							uni.openSetting({
-								success(res) {
-									//如果再次拒绝则返回页面并提示
-									if (!res.authSetting['scope.userLocation']) {
-										uni.showModal({
-											title: '此功能需获取位置信息,请重新授权',
-											content: '',
-											// showCancel: false,
-											// cancelText: '',
-											// confirmText: '',
-											success: res => {
-											},
-											// fail: () => {},
-											// complete: () => {}
-										});
-										// wx.showToast({
-										// 	title: '此功能需获取位置信息,请重新设置',
-										// 	duration: 3000,
-										// 	icon: 'none'
-										// })
-									} else {
-										//允许授权,调用地图
-										resolve()
-									}
-								}
-							})
-						}
-					})
-				} else {
-					//如果有定位权限,调用地图
-					resolve()
-				}
-			}
-		})
-	})
+// 调用打开地图方法
+export function openMap(e) {
+	const that = this
+	return new Promise((resolve, reject) => {
+		wx.getSetting({
+			success(res) {
+				//这里判断是否有地位权限
+				if (!res.authSetting['scope.userLocation']) {
+					wx.showModal({
+						title: '提示',
+						content: '请求获取位置权限',
+						success: function(res) {
+							if (res.confirm == false) {
+								// 授权失败
+								reject()
+								return false;
+							}
+							wx.openSetting({
+								success(res) {
+									//如果再次拒绝则返回页面并提示
+									if (!res.authSetting['scope.userLocation']) {
+										wx.showToast({
+											title: '此功能需获取位置信息,请重新设置',
+											duration: 3000,
+											icon: 'none'
+										})
+									} else {
+										//允许授权,调用地图
+										resolve()
+									}
+								}
+							})
+						}
+					})
+				} else {
+					//如果有定位权限,调用地图
+					resolve()
+				}
+			}
+		})
+	})
 }