From 7dcc8a7c60276b424541e1134a7fc859ee85e290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Thu, 24 Jun 2021 16:21:17 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=8E=A5=E6=8E=A5=E5=8F=A3]=20=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E6=8E=88=E6=9D=83=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=B9=B6=E6=9B=B4=E6=96=B0=20[=E5=AE=8C?= =?UTF-8?q?=E5=96=84]=20=E5=AE=8C=E5=96=84=E5=95=86=E5=93=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E8=B7=B3=E8=BD=AC=E5=88=B0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api.js | 1 + pages/goodsDetail/index.vue | 12 ++++++------ pages/login/index.vue | 18 ++++++++++++++---- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/common/api.js b/common/api.js index f3cd12e..34b0861 100644 --- a/common/api.js +++ b/common/api.js @@ -30,4 +30,5 @@ export const API_COLLECT_LIST = '/api/collect/list'; // 我的收藏列表 /* 用户相关 */ export const API_WXLOGIN = '/api/wxlogin'; // 用户登录 export const API_WECHAT_SETPHONE = '/api/wechat/setPhone'; // 用户授权手机号提交 +export const API_WECHAT_SETPROFILE = '/api/wechat/setProfile'; // 用户授权微信信息提交(返回用户信息) diff --git a/pages/goodsDetail/index.vue b/pages/goodsDetail/index.vue index 11ba4d1..2b9aca1 100644 --- a/pages/goodsDetail/index.vue +++ b/pages/goodsDetail/index.vue @@ -70,7 +70,7 @@ 分享 - + @@ -119,11 +119,11 @@ scale: 18 }) }, - // 立即抢购加入购物车 - addCart(){ - // this.$http(this.API.).then(res => { - - // }) + // 跳转到确认下单页面 + toAddOrder(){ + let goods_id = this.goods_detail.id; + let goods_specs_id = this.goods_detail.specs[0].id + this.$url('/pages/order/confirm-order?goods_id='+ goods_id +'&goods_specs_id='+ goods_specs_id); } }, onShareAppMessage(){ diff --git a/pages/login/index.vue b/pages/login/index.vue index bb5739b..4ef3799 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -15,7 +15,7 @@ 微信快捷登录 - 使用手机号登录 + @@ -53,6 +53,7 @@ // 进入查看协议 enterAgree(){ console.log("查看协议"); + this.$url('/pages/agreement/agreement'); }, // 勾选协议发生变化 checkboxChange(event){ @@ -88,9 +89,18 @@ let encryptedData = result.encryptedData; let iv = result.iv; let signature = result.signature; - let userInfo = result.userInfo; - // 获取成功,请求接口完毕后返回页面 - this.$toBack(); + let userInfo = uni.getStorageSync('userinfo') || {}; + + this.$http(this.API.API_WECHAT_SETPROFILE, { + encryptedData, + iv, + token: userInfo.token + }).then(res => { + console.log("更新用户信息", res); + this.$msg('更新成功', {icon: 'success'}); + uni.setStorageSync('userinfo', res.data); + this.$toBack(); + }) } } });