stanley-king 4 years ago
parent
commit
622f496aa9

+ 3 - 2
app.json

@@ -11,6 +11,7 @@
     "pages/comments/comments",
     "pages/search/search",
     "pages/confirmOrder/confirmOrder",
+    "pages/confirmVOrder/confirmVOrder",
     "pages/order_tabs/orderTabs",
     "pages/address/address",
     "pages/addAddress/addAddress",
@@ -18,7 +19,7 @@
     "pages/fcode/fcode",
     "pages/login/login",
     "pages/shareBonus/shareBonus",
-    "pages/handOutBonus/handOutBonus"    
+    "pages/handOutBonus/handOutBonus"
   ],
   "window": {
     "backgroundTextStyle": "dark",
@@ -41,7 +42,7 @@
       {
         "iconPath": "./image/tabbar/phone.png",
         "selectedIconPath": "./image/tabbar/phoned.png",
-        "pagePath": "pages/shopCart/shopCart",
+        "pagePath": "pages/confirmVOrder/confirmVOrder",
         "text": "话费"
       },
       {

+ 1 - 1
config.js

@@ -1,5 +1,5 @@
 // let api = "https://passport.lrlz.com/mobile/index.php";
-// let api = "http://121.89.223.81/mobile/index.php";
+// let api = "http://www.xyzshops.cn/mobile/index.php";
 let api = "http://192.168.1.200/mobile/index.php";
 
 function getReq(data, callback, method) 

+ 17 - 4
pages/components/auth/auth.js

@@ -14,16 +14,26 @@ Component({
    * 组件的初始数据
    */
   data: {
-
+    phone_iv: '',
+    phone_encryptedData: ''
   },
 
   /**
    * 组件的方法列表
    */
   methods: {
-    userInfoHandler(e) {
+    getPhoneNumber: function(e) { 
+      console.log(e.detail.errMsg) 
+      console.log(e.detail.iv) 
+      console.log(e.detail.encryptedData) 
+      this.phone_encryptedData = e.detail.encryptedData
+      this.phone_iv = e.detail.iv
+    },
+    userInfoHandler(e) 
+    {
       let self = this
-      if (e.detail.errMsg == "getUserInfo:ok") {
+      if (e.detail.errMsg == "getUserInfo:ok") 
+      {
         app.globalData.userInfo = e.detail.userInfo;
         app.globalData.userInfo.nickname = e.detail.userInfo.nickName;
         let userInfo = app.globalData.userInfo;
@@ -34,12 +44,15 @@ Component({
           let { encryptedData, iv, signature } = e.detail
           userInfo = Object.assign({}, { encryptedData }, { signature }, { iv }, userInfo)
         }
+        let phoneInfo = {iv: self.phone_iv,encryptedData: self.phone_encryptedData}
         let params = {
           user_info: userInfo,
+          phone_info: phoneInfo,
           act: "login",
           op: "wxauthen"
         }
-        getReq(params, function (res) {
+        getReq(params, function (res) 
+        {
           if (res.code == 200) {
             self.triggerEvent('getAuth', {
               userInfo

+ 1 - 0
pages/components/auth/auth.wxml

@@ -3,6 +3,7 @@
   <view class="auth_text">
     <view>您暂未获取微信授权,将无法领取红包、加入购物车、下单等功能。点击“授权登录”后,您将使用全部功能。</view>
   </view>
+  <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">授权手机号码</button>
   <button style='margin-top:160rpx;width:82%;height: 92rpx;background: #2b2b2b;color: #fff;' open-type="getUserInfo"
     bindgetuserinfo="userInfoHandler">授权登录</button>
 </view>

+ 1 - 9
pages/confirmOrder/confirmOrder.wxml

@@ -80,15 +80,7 @@
       </view>
     </block>
   </view>
-
-
-
-
-
-
-
-
-  <!-- <view class="packet_price-tips bacfff" wx:if="{{datas.payinfo.gap_desc}}">{{datas.payinfo.gap_desc}}~</view> -->
+    <!-- <view class="packet_price-tips bacfff" wx:if="{{datas.payinfo.gap_desc}}">{{datas.payinfo.gap_desc}}~</view> -->
   <view class="order_entry mt20">
     <view class="expenses_info">
       <view class="col666">商品总价</view>

+ 4 - 5
pages/orderPaySn/orderPaySn.js

@@ -101,11 +101,11 @@ Page({
       if (res.code == 200) {
         let param = res.datas.param.data;
         wx.requestPayment({
-          timeStamp: param.timeStamp,         //时间戳,自1970年以来的秒数
-          nonceStr: param.nonceStr, //随机串
+          timeStamp: param.timeStamp, //时间戳,自1970年以来的秒数
+          nonceStr: param.nonceStr,   //随机串
           package: param.package,
-          signType: param.signType,         //微信签名方式:
-          paySign: param.paySign, //微信签名
+          signType: param.signType,   //微信签名方式:
+          paySign: param.paySign,     //微信签名
           success: function (res) {
             wx.redirectTo({
               url: "/pages/order_tabs/orderTabs?state_type=state_pay"
@@ -147,7 +147,6 @@ Page({
           defaultAddress
         })
       }
-
     }
   },
 

+ 1 - 1
project.config.json

@@ -24,7 +24,7 @@
 			"outputPath": ""
 		},
 		"useIsolateContext": true,
-		"useCompilerModule": false,
+		"useCompilerModule": true,
 		"userConfirmedUseCompilerModuleSwitch": false
 	},
 	"compileType": "miniprogram",