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();
+ })
}
}
});