Browse Source

2021-11-23

hwq 4 years ago
parent
commit
0c1be6687e
5 changed files with 47 additions and 66 deletions
  1. 0 2
      pages.json
  2. 13 36
      pages/address/addressManage.vue
  3. 32 27
      pages/merchant/merchant.vue
  4. 1 1
      pages/user/user.vue
  5. 1 0
      utils/rocessor.js

+ 0 - 2
pages.json

@@ -359,14 +359,12 @@
 		}, {
 		}, {
 			"path": "pages/product/list",
 			"path": "pages/product/list",
 			"style": {
 			"style": {
-				"enablePullDownRefresh": true,
 				"navigationBarTitleText": "商品列表"
 				"navigationBarTitleText": "商品列表"
 			}
 			}
 		},
 		},
 		{
 		{
 			"path": "pages/product/listSearch",
 			"path": "pages/product/listSearch",
 			"style": {
 			"style": {
-				"enablePullDownRefresh": true,
 				"navigationBarTitleText": "商品列表"
 				"navigationBarTitleText": "商品列表"
 			}
 			}
 		},
 		},

+ 13 - 36
pages/address/addressManage.vue

@@ -130,42 +130,18 @@ export default {
 			});
 			});
 			let obj = this;
 			let obj = this;
 			// #ifndef APP-PLUS
 			// #ifndef APP-PLUS
-			openMap().then(() => {
-				   uni.hideLoading();
-					uni.getLocation({
-						type: 'gcj02',
-						success(e) {
-							uni.chooseLocation({
-								latitude: e.latitude,
-								longitude: e.longitude,
-								success(e) {
-									obj.addressLocation = e;
-								},
-								fail(e) {
-									uni.showModal({
-										title:'地址选择错误',
-										content:JSON.parse(e)
-									})
-									console.log(e);
-								}
-							});
-						},fail(e) {
-							uni.showModal({
-								title:'定位错误',
-								content:JSON.parse(e)
-							})
-						}
-					});
-				})
-				.catch(e => {
-					console.log(e)
-					uni.hideLoading();
-					uni.showModal({
-						title: '提示',
-						content: '您未授权无法调用地图定位功能!',
-						showCancel: false
-					});
-				});
+			uni.chooseLocation({
+				type: 'gcj02',
+				success: function(res) {
+					obj.addressLocation.name = res.name;
+					console.log('位置名称:' + res.name);
+					console.log('详细地址:' + res.address);
+					console.log('纬度:' + res.latitude);
+					console.log('经度:' + res.longitude);
+					obj.addressLocation.latitude = res.latitude;
+					obj.addressLocation.longitude = res.longitude;
+				}
+			});
 			// #endif
 			// #endif
 			// #ifdef APP-PLUS
 			// #ifdef APP-PLUS
 			uni.hideLoading();
 			uni.hideLoading();
@@ -177,6 +153,7 @@ export default {
 						longitude: e.longitude,
 						longitude: e.longitude,
 						success(e) {
 						success(e) {
 							obj.addressLocation = e;
 							obj.addressLocation = e;
+							console.log(e,"123456")
 						},
 						},
 						fail(e) {
 						fail(e) {
 							uni.showModal({
 							uni.showModal({

+ 32 - 27
pages/merchant/merchant.vue

@@ -62,7 +62,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { my,verific } from '@/api/merchant.js';
+import { my, verific } from '@/api/merchant.js';
 import uniPopup from '@/components/uni-popup/uni-popup.vue';
 import uniPopup from '@/components/uni-popup/uni-popup.vue';
 export default {
 export default {
 	components: {
 	components: {
@@ -93,39 +93,44 @@ export default {
 			});
 			});
 		},
 		},
 		close() {
 		close() {
-			this.$refs.popuphx.close()
-			this.code = ''
+			this.$refs.popuphx.close();
+			this.code = '';
 		},
 		},
 		qhx() {
 		qhx() {
-			verific({verify_code:this.code,
-			is_confirm: 1,//1是核销,0是查看
-			}).then(e => {
-				this.$api.msg('核销成功')
-				this.close()
-			}).catch(e => {
-				console.log(e)
+			verific({
+				verify_code: this.code,
+				is_confirm: 1 //1是核销,0是查看
 			})
 			})
+				.then(e => {
+					this.$api.msg('核销成功');
+					this.close();
+				})
+				.catch(e => {
+					console.log(e);
+				});
 		},
 		},
 		//调取扫描二维码
 		//调取扫描二维码
 		sao() {
 		sao() {
 			let obj = this;
 			let obj = this;
-			this.$refs.popuphx.open();
-			// // #ifndef H5
-			// uni.scanCode({
-			// 	success(e) {
-			// 		obj.orderVerific(e.result);
-			// 	}
-			// });
-			// // #endif
-			// // #ifdef H5
-			// this.weichatObj.scanQRCode({
-			// 	needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
-			// 	scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
-			// 	success: function(res) {
-			// 		obj.orderVerific(res.resultStr); // 当needResult 为 1 时,扫码返回的结果
-			// 	}
-			// });
-			// // #endif
+			// #ifndef H5
+			uni.scanCode({
+				success(e) {
+					obj.code = e.result;
+					obj.$refs.popuphx.open();
+				}
+			});
+			// #endif
+			// #ifdef H5
+			let wx = require('jweixin-module');
+			wx.scanQRCode({
+				needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
+				scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
+				success: function(res) {
+					obj.code = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
+					obj.$refs.popuphx.open();
+				}
+			});
+			// #endif
 		}
 		}
 	}
 	}
 };
 };

+ 1 - 1
pages/user/user.vue

@@ -116,7 +116,7 @@
 		<uni-popup ref="popup" type="center">
 		<uni-popup ref="popup" type="center">
 			<view class="popup-box">
 			<view class="popup-box">
 				<view class="img">
 				<view class="img">
-					<view class="img-font">兑换充值卡</view>
+					<view class="img-font">兑换会员卡</view>
 					<view class="img-bg"><image src="../../static/img/img009.png" mode=""></image></view>
 					<view class="img-bg"><image src="../../static/img/img009.png" mode=""></image></view>
 				</view>
 				</view>
 				<view class="mian">
 				<view class="mian">

+ 1 - 0
utils/rocessor.js

@@ -57,6 +57,7 @@ export function timeComputed(time) {
 
 
 // 调用打开地图方法
 // 调用打开地图方法
 export function openMap(e) {
 export function openMap(e) {
+	let wx = require('jweixin-module');
 	const that = this
 	const that = this
 	return new Promise((resolve, reject) => {
 	return new Promise((resolve, reject) => {
 		wx.getSetting({
 		wx.getSetting({