chenxiaofeng 6 år sedan
förälder
incheckning
e2e5ffcc0b
5 ändrade filer med 62 tillägg och 50 borttagningar
  1. BIN
      .DS_Store
  2. BIN
      pages/index/.DS_Store
  3. 5 5
      pages/index/index.js
  4. 55 43
      pages/payment/Member/Member.js
  5. 2 2
      pages/payment/Member/Member.wxml

BIN
.DS_Store


BIN
pages/index/.DS_Store


+ 5 - 5
pages/index/index.js

@@ -133,7 +133,7 @@ Page({
133 133
         areaName: _areaname,  // 区名称
134 134
       })
135 135
 
136
-    } else if (_provincename == '' && _cityname == '' && _Selection == 1) {
136
+    } else if (_provincename == '' && _cityname == '' &&  _Selection == 1){
137 137
       that.setData({
138 138
         city: _city,
139 139
         provinceName: _provincename,  // 省名称
@@ -531,7 +531,7 @@ Page({
531 531
 
532 532
 
533 533
     wx.navigateTo({
534
-      url: '/pages/index_screen/index_screen?age=' + that.data.age + '&height=' + that.data.height + '&marry=' + that.data.marry + '&idmarry=' + that.data.idmarry + '&education=' + that.data.education + '&income=' + that.data.income + '&educationid=' + that.data.educationid + '&city=' + that.data.city + '&provinceName=' + that.data.provinceName + '&cityName=' + that.data.cityName + '&areaName=' + that.data.areaName + ''
534
+      url: '/pages/index_screen/index_screen?age=' + that.data.age + '&height=' + that.data.height + '&marry=' + that.data.marry + '&idmarry=' + that.data.idmarry + '&education=' + that.data.education + '&income=' + that.data.income + '&educationid=' + that.data.educationid +'&city=' + that.data.city +  '&provinceName=' + that.data.provinceName + '&cityName=' + that.data.cityName + '&areaName=' + that.data.areaName +  ''
535 535
     })
536 536
 
537 537
 
@@ -882,7 +882,7 @@ Page({
882 882
         break;
883 883
 
884 884
     }
885
-
885
+    
886 886
     console.log(that.data.city)
887 887
     console.log(that.data.provinceName)
888 888
     console.log(that.data.cityName)
@@ -896,7 +896,7 @@ Page({
896 896
       provincetext: '北京', //省 名字
897 897
       cityidx: 0,
898 898
       citytext: '',
899
-
899
+    
900 900
     })
901 901
 
902 902
     app.globalData.Selection = 0;    //  是否选中  
@@ -912,7 +912,7 @@ Page({
912 912
       cityidx: 0,
913 913
       citytext: '',
914 914
 
915
-      provinceName: '', // 省名字
915
+      provinceName:'', // 省名字
916 916
       city: 0,   // 市数据清空
917 917
       cityName: '',   // 市名字清空
918 918
       areaName: "",  //  区名字

+ 55 - 43
pages/payment/Member/Member.js

@@ -68,52 +68,64 @@ Page({
68 68
 
69 69
   sfzfmclick(e) {
70 70
 
71
-    var _Priceid = this.data.Priceid
72
-
73
-
74
-    let payment_url = 'pay/wxpay/index';
75
-    let payment_data = {
76
-      rid: this.data.Priceid,
77
-      total_price: this.data.Price,  //原价
78
-      discount_peice: this.data.Originalprice,  //优惠
79
-      
80
-    };
81
-    app.postRequest(payment_url, payment_data, function (res) {      //  年龄 ajax
82
-
83
-      console.log(res.data)
84
-      if (res.code == 201) {
85
-
86
-        wx.requestPayment({
87
-          timeStamp: res.data.timeStamp,
88
-          nonceStr: res.data.nonceStr,
89
-          package: res.data.package,
90
-          signType: res.data.signType,
91
-          paySign: res.data.paySign,
92
-
93
-          success(res) {
94
-
95
-            wx.showToast({
96
-              title: '支付成功',
97
-              icon: 'success',
98
-              duration: 2000
99
-            })
100
-
101
-           },
102
-          fail(res) {
103
-            var _fail = '支付失败'
104
-            getApp().Tips(_fail);
105
-           }
106
-        })
107
-          
108
-          return 
109 71
 
72
+  },
73
+  pay: function () {
74
+    let _that = this;
75
+    wx.login({
76
+      success: function (res) {
77
+        console.log(res.code)
78
+        if (res.code) {
79
+          // let p_url = 'public/wxlogin';
80
+          // let p_data = {
81
+          //   code: res.code,
82
+          // };
83
+          var _Priceid = _that.data.Priceid
84
+          let payment_url = 'pay/wxpay/index';
85
+          let payment_data = {
86
+            rid: _that.data.Priceid,
87
+            total_price: _that.data.Price,  //原价
88
+            discount_peice: _that.data.Originalprice,  //优惠
89
+            code: res.code
90
+          };
91
+          app.postRequest(payment_url, payment_data, function (res) { 
92
+
93
+            console.log(res.data)
94
+            if (res.code == 201) {
95
+
96
+              wx.requestPayment({
97
+                timeStamp: res.data.timeStamp,
98
+                nonceStr: res.data.nonceStr,
99
+                package: res.data.package,
100
+                signType: res.data.signType,
101
+                paySign: res.data.paySign,
102
+
103
+                success(res) {
104
+                  wx.showToast({
105
+                    title: '支付成功',
106
+                    icon: 'success',
107
+                    duration: 2000
108
+                  })
109
+                },
110
+                fail(res) {
111
+                    getApp().Tips('支付失败');
112
+                }
113
+              })
114
+              return
115
+            }
116
+              getApp().Tips('支付失败');
117
+          })
118
+
119
+          // app.postRequest(p_url, p_data, function (res) {
120
+          //   console.log(res);
121
+          //   if (res.code == 201) {
122
+
123
+
124
+          //   }
125
+          // })
126
+        }
110 127
       }
111
-
112
-      var _fail = '支付失败'
113
-      getApp().Tips(_fail);
114
-
115 128
     })
116
-
117 129
   }
118 130
 
119 131
 

+ 2 - 2
pages/payment/Member/Member.wxml

@@ -31,8 +31,8 @@
31 31
 
32 32
 
33 33
     <!-- <view></view> -->
34
-    
35
-      <view class='NextStep' bindtap='sfzfmclick'>立即开通</view>
34
+    <!-- sfzfmclick -->
35
+      <view class='NextStep' bindtap='pay'>立即开通</view>
36 36
 </view>
37 37
 
38 38