Bläddra i källkod

支付接口 添加loading

xiaohuangmao 4 år sedan
förälder
incheckning
11c3d57e6c

+ 7 - 4
config.js

@@ -1,7 +1,7 @@
 // let api = "https://passport.lrlz.com/mobile/index.php";
 // let api = "http://www.xyzshops.cn/mobile/index.php";
-let api = "http://192.168.1.200/mobile/index.php";
-// let api = "https://www.xyzshops.cn/mobile/index.php";
+// let api = "http://192.168.1.200/mobile/index.php";
+let api = "https://www.xyzshops.cn/mobile/index.php";
 
 function getReq(app,data, callback, method)
 {
@@ -49,7 +49,6 @@ function getReq(app,data, callback, method)
     header,
     success(res) 
     {
-      console.log(res) 
       if (res.data.code == 10014) { //ErrUnLogin = 10014;
         wx.removeStorage('session_id');
         wx.navigateTo({
@@ -95,7 +94,10 @@ function buyVGoods(app,goods_id,goods_num, other, successCallback, failCallback)
     ...other
   }
   console.table(params)
-
+  wx.showLoading({
+    title: '加载中',
+    mask: true
+  });
   params = Object.assign({}, params);
   getReq(app,params, function (res) {
     wx.hideLoading()
@@ -109,6 +111,7 @@ function buyVGoods(app,goods_id,goods_num, other, successCallback, failCallback)
         signType: param.signType, //微信签名方式:
         paySign: param.paySign,   //微信签名
         success: function (res) {
+          wx.hideLoading()
           successCallback && successCallback(res)
         },
         fail: function (res) {

+ 0 - 1
pages/index/index.js

@@ -72,7 +72,6 @@ Page({
       from: fromSource
     }, function (res) {
       if (res.code == 200) {
-        console.log(res)
         let prop_special = res.datas.special_list;
         let sent_down_special = prop_special.splice(0, 8);
         self.setData({

+ 8 - 4
pages/myhome/myhome.js

@@ -18,8 +18,11 @@ Page({
 
   handleMore(e) {
     const { cardtype } = e.currentTarget.dataset
-    // app.navigateto(`/pages/postageManage/postageManage?card_type=${cardtype}`)
-    app.navigateto('/pages/invitees/invitees')
+    if(cardtype === 'invitees'){
+      app.navigateto('/pages/invitees/invitees')
+      return
+    }
+    app.navigateto(`/pages/postageManage/postageManage?card_type=${cardtype}`)
   },
 
   /**
@@ -47,7 +50,9 @@ Page({
     this.setData({
       userInfo: app.globalData.userInfo
     })
-
+    this.getData()
+  },
+  getData(){
     getReq(app,{
         act: 'member_info',
         op: 'index',
@@ -59,7 +64,6 @@ Page({
       if (res.code == 200) {
         console.log(res.datas)
         if(res.datas) {
-
           const { cards, sub_titles } = res.datas
           const phone = app.getValueByKey('phone', cards)
           const petrochina = app.getValueByKey('petrochina', cards)

+ 2 - 2
pages/myhome/myhome.wxml

@@ -47,7 +47,7 @@
   </view>
 
   <view class="card">
-    <view class="card-title" bindtap="handleMore" data-cardtype="sinopec">
+    <view class="card-title" bindtap="handleMore" data-cardtype="petrochina">
       <image src="/image/myhome/icon-postage.png" class="icon icon-postage"></image>
       <text class="text">我的中石油油卡</text>
       <image src="/image/myhome/arrow-right.png" class="more"></image>
@@ -78,7 +78,7 @@
     </view>
   </view>
   <view class="card">
-    <view class="card-title" bindtap="handleMore" >
+    <view class="card-title" bindtap="handleMore" data-cardtype="invitees">
       <text class="text">我的好友列表</text>
       <image src="/image/myhome/arrow-right.png" class="more"></image>
     </view>

+ 8 - 0
pages/phoneCharges/phoneCharges.wxss

@@ -116,6 +116,14 @@
   line-height: 1.8;
 }
 
+.rechargeNow-tips view{
+  margin-bottom: 20rpx
+}
+
+.rechargeNow-tips view:last-child{
+  margin-bottom: 0
+}
+
 /* 充值挡位 */
 .rechargeGear-title{
   height: 84rpx;

+ 0 - 1
pages/postage/postage.js

@@ -101,7 +101,6 @@ Page({
 
   // 立即充值
   handlerRecharge(){
-    console.table(this.data)
     const { goods_id, card_no, card_type } = this.data
     if(!card_no){
       app.showToast('卡号不能为空')

+ 8 - 0
pages/postage/postage.wxss

@@ -116,6 +116,14 @@
   line-height: 1.8;
 }
 
+.rechargeNow-tips view{
+  margin-bottom: 20rpx
+}
+
+.rechargeNow-tips view:last-child{
+  margin-bottom: 0
+}
+
 /* 充值挡位 */
 .rechargeGear-title{
   height: 84rpx;