diff --git a/App.vue b/App.vue index 5ab066a1..773637be 100644 --- a/App.vue +++ b/App.vue @@ -17,7 +17,7 @@ export default { onLaunch: function (options) { console.log("onLaunch", options); this.setVisitChannels(options.scene); - + this.handleGetUserInfo(); let _this = this; uni.getSystemInfo({ success: (res) => { @@ -28,7 +28,7 @@ export default { _this.globalData.hh = hh; }, }); - this.globalData.initReady = this.login().then(() => {}); + this.globalData.initReady = this.login().then(() => { }); // this.globalData.recommendCode = "1"; // this.globalData.recommendId = "2"; @@ -50,8 +50,8 @@ export default { } }); }, - onShow: function () {}, - onHide: function () {}, + onShow: function () { }, + onHide: function () { }, onUnload: function () { this.globalData.recommendCode = null; this.globalData.recommendId = null; @@ -61,6 +61,24 @@ export default { setArea: "setHomeServer", setVisitChannels: "setVisitChannels", }), + handleGetUserInfo() { + wx.request({ + url: "https://qifu-api.baidubce.com/ip/local/geo/v1/district", + success(response) { + const data = response.data; + // 处理数据 + let obj = { + ...data.data, + ip: data.ip, + }; + console.log("obj", obj); + uni.setStorageSync("userInfo", obj); + }, + fail(error) { + // 处理错误 + }, + }); + }, login() { let _this = this; return new Promise((resolve, reject) => { @@ -136,14 +154,14 @@ export default { _this.user.InviteCode = _data.Data.InviteCode || ""; _this.user.MEMBERSHIP_POINT = _data.Data.MEMBERSHIP_POINT || ""; _this.user.NICK_NAME = _data.Data.NICK_NAME || ""; - + _this.user.MEMBERSHIP_MOBILEPHONE = _data.Data.MEMBERSHIP_MOBILEPHONE || ""; // _this.setUser(user); _this.$store.commit("setUser", user); console.log("_this.globalData"); - + } else { // _this.setUser({}); _this.$store.commit("setUser", user); diff --git a/pages/index/index.vue b/pages/index/index.vue index 80af0867..4af9aa93 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -617,7 +617,9 @@ export default { // this.handleAes() - this.$utils.addUserBehaviorNew(); + this.$utils.addUserBehaviorNew({ + behaviorRecordDesc: "进入了首页" + }); }, async onShow() { let currentService = uni.getStorageSync("currentService"); diff --git a/pages/myAddress/newAdd/index.vue b/pages/myAddress/newAdd/index.vue index 87cce696..469e2961 100644 --- a/pages/myAddress/newAdd/index.vue +++ b/pages/myAddress/newAdd/index.vue @@ -4,32 +4,15 @@
收货人
- +
- - - + + + {{ item.name }} @@ -37,42 +20,23 @@
手机号
- +
收货地址 - + {{ saveMsg.address || "请选择收货地址" }} - + -
+
街道地址
- + {{ streetList[streetIndex] && streetList[streetIndex].region_name ? streetList[streetIndex].region_name @@ -85,25 +49,15 @@
详细地址
- +
标签
- {{ u.name }} + {{ u.name }}
@@ -111,13 +65,7 @@

设为默认地址

每次购物时会优先选定该地址,方便您轻松购物

- +