From 7a0b33a5f2e0ba589bf35a1b8d896700a21f94a4 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 30 四月 2026 16:00:55 +0800
Subject: [PATCH] 支付宝支付dddadd
---
small-program/App.vue | 55 ++++++++++++-------------------------------------------
1 files changed, 12 insertions(+), 43 deletions(-)
diff --git a/small-program/App.vue b/small-program/App.vue
index b135e6e..874394e 100644
--- a/small-program/App.vue
+++ b/small-program/App.vue
@@ -1,6 +1,5 @@
<script>
import { mapState } from 'vuex'
- // var QQMapWX = require('@/utils/qqmap-wx-jssdk.js')
var amapFile = require('@/utils/amap-wx.130.js')
export default {
computed: {
@@ -15,7 +14,6 @@
let { code } = loginRes;
let res = await that.$u.api.wxLogin({ code })
if (res && res.code === 200) {
- console.log(res, '==================鐧诲綍鎴愬姛');
// 鍒ゆ柇鏈夋棤openid
if (res.data.openid) {
await that.$store.commit('setOpenid', res.data.openid)
@@ -27,7 +25,6 @@
// 鍒ゆ柇鏈夋棤鐢ㄦ埛淇℃伅
if (res.data.member) {
await that.$store.commit('setUserInfo', res.data.member)
- await that.$store.commit('setOpenid', res.data.member.openId)
}
// 璁剧疆瀹氫綅
await that.checkLocationAuth()
@@ -39,7 +36,7 @@
let res = await that.$u.api.getMemberInfo({})
if (res.code === 200) {
await that.$store.commit('setUserInfo', res.data)
- await that.$store.commit('setOpenid', res.data.openId)
+ await that.$store.commit('setOpenid', res.data.openid)
}
// 璁剧疆瀹氫綅
await that.checkLocationAuth()
@@ -61,23 +58,24 @@
isHighAccuracy: true,
success: function (addr) {
const locParam = { latitude: addr.latitude, longitude: addr.longitude };
- uni.setStorageSync('address', locParam);
- var address = null
- var myAmapFun = new amapFile.AMapWX({ key: 'e4d46c87adf151dca20060317592b1b6' });
+ var myAmapFun = new amapFile.AMapWX({ key: that.$gaodeMapKey});
myAmapFun.getRegeo({
location: addr.longitude + ',' + addr.latitude,
success: async function(data) {
- console.log(data, '==================鑾峰彇鍦板潃');
let info = data[0];
+ console.log(info, '==================鑾峰彇鍦板潃');
locParam.province = info.province;
- locParam.city = info.regeocodeData.addressComponent.city;
- var ta = info.name || '鍦板潃鑾峰彇澶辫触';
+ locParam.adcode = info.regeocodeData.addressComponent.adcode;
+ var ta = info.desc || '鍦板潃鑾峰彇澶辫触';
locParam.address = ta
- const resCity = await that.$u.api.getCityByName({ cityName: locParam.city })
- if (resCity.code === 200) {
+ const resCity = await that.$u.api.getCityByName({ code: locParam.adcode })
+ if (resCity.code === 200 && resCity.data) {
locParam.cityId = resCity.data.id
- }
- that.$store.commit('setPosition', locParam)
+ that.$store.commit('setPosition', locParam)
+ } else {
+ that.$store.commit('setPosition', locParam)
+ that.$store.commit('clearCityId')
+ }
that.$isResolve()
},
fail: function(err) {
@@ -86,35 +84,6 @@
that.$isResolve()
}
});
-
- // const qqmapsdk = new QQMapWX({
- // key: 'WE3BZ-HN6WS-ONDOH-62QCV-MNL6F-5NFNE'
- // });
- // qqmapsdk.reverseGeocoder({
- // locParam,
- // success: async function(res) {
- // console.log(res, '==================鑾峰彇鍦板潃');
- // let info = res.result;
- // locParam.province = info.address_component.province;
- // locParam.city = info.address_component.city;
- // locParam.area = info.address_component.district;
- // locParam.street = info.address_component.street;
- // var ta = info.address || '鍦板潃鑾峰彇澶辫触' ;
- // if(info.formatted_addresses && info.formatted_addresses.recommend){
- // ta =info.formatted_addresses.recommend
- // }
- // locParam.address =ta
- // const resCity = await that.$u.api.getCityByName({ cityName: locParam.city })
- // if (resCity.code === 200) {
- // locParam.cityId = resCity.data.id
- // }
- // that.$store.commit('setPosition',locParam)
- // that.$isResolve()
- // },
- // fail: (err) => {
- // that.$isResolve()
- // }
- // });
}
});
},
--
Gitblit v1.9.3