stanley-king 4 лет назад
Родитель
Сommit
2bf718a490

+ 6 - 2
app.js

@@ -5,7 +5,7 @@ App({
     onLaunch: function() {
         let self = this;
         // 登录
-        new WxAuthor(self)
+        this.mWxAuthor = new WxAuthor(self)
         const dirs = ['addAddress','address','myhome','confirmOrder','confirmVOrder',
         'order_tabs','orderPaySn','person','postageDetail','postageManage','shopCart'];
 
@@ -30,7 +30,8 @@ App({
         channel: '欧耶商城',
         record: null,
         card_type: '',
-        authPages: null
+        authPages: null,
+        mWxAuthor:null
     },
 
     setFromSource(fromSource) {
@@ -102,4 +103,7 @@ App({
         if(!data.length) return {}
         return data.filter(val => val.card_type === key)[0] || {}
     },
+    relogin() {
+        this.mWxAuthor.init();
+    }
 })

+ 2 - 3
app.json

@@ -18,15 +18,14 @@
 		"pages/search/search",
 		"pages/confirmOrder/confirmOrder",
 		"pages/confirmVOrder/confirmVOrder",
-		"pages/order_tabs/orderTabs",
+		"pages/vorderList/orderTabs",
 		"pages/addAddress/addAddress",
 		"pages/orderPaySn/orderPaySn",
 		"pages/fcode/fcode",
 		"pages/login/login",
 		"pages/shareBonus/shareBonus",
 		"pages/handOutBonus/handOutBonus",
-		"pages/auth/auth",
-		"pages/authmobile/authmobile"
+		"pages/auth/auth"
 	],
 	"window": {
 		"backgroundTextStyle": "dark",

+ 43 - 2
config.js

@@ -51,7 +51,9 @@ function getReq(app,data, callback, method)
     header,
     success(res) 
     {
+      console.log(res) 
       if(res.data.code == 10014) {
+        wx.removeStorage('session_id');
         wx.navigateTo({
           url: '/pages/auth/auth',
         })
@@ -138,8 +140,47 @@ function buyVGoods(app,goods_id,goods_num, other, successCallback, failCallback)
   })
 }
 
+function payOrder(app, pay_sn) {
+  let params = {
+    act: 'member_order',
+    op: 'pay',
+    pay_sn: pay_sn,
+    payment: 'minipay'
+  }
+  getReq(app, params, function (res) {
+    if (res.code == 200) {
+      let param = res.datas.param.data;
+      wx.requestPayment({
+        timeStamp: param.timeStamp, //时间戳,自1970年以来的秒数
+        nonceStr: param.nonceStr,   //随机串
+        package: param.package,
+        signType: param.signType,   //微信签名方式:
+        paySign: param.paySign,     //微信签名
+        success: function (res) {
+          wx.redirectTo({
+            url: "/pages/order_tabs/orderTabs?state_type=state_pay"
+          })
+          console.log("成功:", res);
+          console.log('支付成功')
+        },
+        fail: function (res) {
+          setTimeout(() => {
+            wx.showToast({
+              icon: 'none',
+              title: res.errMsg,
+              duration: 2000
+            })
+          }, 200);
+          console.log("失败:", res);
+        }
+      });
+    }
+  })
+}
+
 module.exports = {
-  getReq,
+  getReq: getReq,
   host: api,
-  buyVGoods:buyVGoods
+  buyVGoods: buyVGoods,
+  payOrder: payOrder
 }

+ 8 - 12
pages/components/auth/auth.js

@@ -26,9 +26,9 @@ Component({
    */
   methods: {
     userPhoneHandler: function(e) { 
-      console.log(e.detail.errMsg) 
-      console.log(e.detail.iv) 
-      console.log(e.detail.encryptedData) 
+      // 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
       this.wxauthen(this.userInfoE)
@@ -45,13 +45,9 @@ Component({
     },
     wxauthen: function (eInfo) {
       let userInfo = eInfo.detail.userInfo;
-      if (app.globalData.userId.unionid) {
-        userInfo = Object.assign({}, app.globalData.userId, app.globalData.userInfo);
-      }
-      else {
-        let { encryptedData, iv, signature } = e.detail
-        userInfo = Object.assign({}, { encryptedData }, { signature }, { iv }, userInfo)
-      }
+      let { encryptedData, iv, signature } = eInfo.detail
+      userInfo = Object.assign({}, { encryptedData }, { signature }, { iv }, userInfo)
+      
       let phoneInfo = { iv: this.phone_iv, encryptedData: this.phone_encryptedData }
       let params = {
         user_info: userInfo,
@@ -68,16 +64,16 @@ Component({
             self.setData({showAuthName:false,showAuthPhone:true})
           }
           else {
-            // self.setData({showAuthName:true,showAuthPhone:false})
             self.triggerEvent('getAuth', {
               userInfo
             })
           }
         }
         else {
+          app.relogin();
           wx.showToast({
             icon: 'none',
-            title: '登陆失败',
+            title: '登陆遇到一点麻烦,请重试~~~',
             duration: 2000
           })
         }

+ 1 - 1
pages/index/index.js

@@ -147,7 +147,7 @@ Page({
     if (this.data.isSendProp) {
       return;
     }
-
+    
     let surplus_special_num = this.data.surplus_special.length;
     if (surplus_special_num > 0) {
       wx.showLoading({

+ 2 - 0
pages/myhome/myhome.js

@@ -56,7 +56,9 @@ Page({
           firstLoad: false
       });
       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)

+ 21 - 23
pages/myhome/myhome.wxml

@@ -14,12 +14,10 @@
   <view class="order_list">
     <view class='order_title flex_1px_d' bindtap='skip_all_order'>
       <text>我的订单</text>
-      <text class='look_all_order arrow_right' decode="{{true}}">查看全部订单&nbsp;</text>
     </view>
-
     <view class='order_info'>
       <view>
-        <navigator url="/pages/order_tabs/orderTabs?state_type=state_new" hover-class="none" class="pos_rel">
+        <navigator url="/pages/vorderList/orderTabs?state_type=state_new" hover-class="none" class="pos_rel">
           <image style='width:35rpx;height: 35rpx;' src='../../image/person/payments_due_icon.png'></image>
           <view class="mt8">
             <text>待付款</text>
@@ -28,49 +26,43 @@
         </navigator>
       </view>
       <view>
-        <navigator url="/pages/order_tabs/orderTabs?state_type=state_pay" hover-class="none" class="pos_rel">
+        <navigator url="/pages/vorderList/orderTabs?state_type=state_pay" hover-class="none" class="pos_rel">
           <image style='width:35rpx;height: 35rpx;' src='../../image/person/shipping_term_icon.png'></image>
           <view class="mt8">
-            <text>待发货</text>
+            <text>充值中</text>
           </view>
           <view class="sub_count" wx:if="{{pre_send_count}}">{{pre_send_count}}</view>
         </navigator>
       </view>
       <view>
-        <navigator url="/pages/order_tabs/orderTabs?state_type=state_send" hover-class="none" class="pos_rel">
-          <image style='width:35rpx;height: 35rpx;' src='../../image/person/goods_receipt_icon.png'></image>
-          <view class="mt8">
-            <text>待收货</text>
-          </view>
-          <view class="sub_count" wx:if="{{pre_receive_count}}">{{pre_receive_count}}</view>
-        </navigator>
-      </view>
-      <view>
-        <navigator url="/pages/order_tabs/orderTabs?state_type=state_success" hover-class="none" class="pos_rel">
+        <navigator url="/pages/vorderList/orderTabs?state_type=state_success" hover-class="none" class="pos_rel">
           <image style='width:35rpx;height: 35rpx;' src='../../image/person/evaluated_icon.png'></image>
           <view class="mt8">
-            <text>已收货</text>
+            <text>已完成</text>
           </view>
           <view class="sub_count" wx:if="{{evaluate_count}}">{{evaluate_count}}</view>
         </navigator>
       </view>
-      <view bindtap='refund'>
-        <image style='width:35rpx;height: 35rpx;' src='../../image/person/refund_terms_icon.png'></image>
-        <view class="mt8">
-          <text>退款/售后</text>
-        </view>
-      </view>
     </view>
   </view>
 
   <view class="card">
     <view class="card-title" bindtap="handleMore" data-cardtype="sinopec">
       <image src="/image/myhome/icon-postage.png" class="icon icon-postage"></image>
-      <text class="text">我的油卡</text>
+      <text class="text">我的中石油油卡</text>
       <image src="/image/myhome/arrow-right.png" class="more"></image>
     </view>
     <view class="card-body">
       <view wx:if="{{petrochina.card_type==='petrochina'}}" class="card-item bg-orange">{{petrochina.card_no}}</view>
+    </view>
+  </view>
+  <view class="card">
+    <view class="card-title" bindtap="handleMore" data-cardtype="sinopec">
+      <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>
+    </view>
+    <view class="card-body">
       <view wx:if="{{sinopec.card_type==='sinopec'}}" class="card-item bg-orange">{{sinopec.card_no}}</view>
     </view>
   </view>
@@ -85,4 +77,10 @@
       <view wx:if="{{phone.card_type==='phone'}}" class="card-item bg-blue">{{phone.card_no}}</view>
     </view>
   </view>
+  <view class="card">
+    <view class="card-title" bindtap="handleMore" >
+      <text class="text">我的好友列表</text>
+      <image src="/image/myhome/arrow-right.png" class="more"></image>
+    </view>
+  </view>
 </view>

+ 0 - 340
pages/order_tabs/orderTabs.js

@@ -1,340 +0,0 @@
-// pages/order_tabs/orderTabs.js
-const getReq = require('../../config.js').getReq
-import recordSource from '../../utils/recordSource'
-let app = getApp()
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    hasmore: false,
-    orders: [],
-    addTimes: [],
-    curpage: 1,
-    tabs: [
-      {
-        name: "全部",
-        type: ""
-      },
-      {
-        name: "待付款",
-        type: 'state_new'
-      },
-      {
-        name: "待发货",
-        type: 'state_pay'
-      },
-      {
-        name: "待收货",
-        type: 'state_send'
-      },
-      {
-        name: "已收货",
-        type: 'state_success'
-      }
-    ],
-    selectedIndex: 0,
-    state_type: '',
-    tabs_title: '',
-    loading: false,
-    fromSource: '',
-    firstLoad: true
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    let state_type = options.state_type || this.data.state_type;
-    switch (state_type) {
-      case '': {
-        this.setData({
-          selectedIndex: 0,
-          state_type,
-          tabs_title: '全部'
-        })
-        break;
-      }
-      case 'state_new': {
-        this.setData({
-          selectedIndex: 1,
-          state_type,
-          tabs_title: '待付款'
-        })
-        break;
-      }
-      case 'state_pay': {
-        this.setData({
-          selectedIndex: 2,
-          state_type,
-          tabs_title: '待发货'
-        })
-        break;
-      }
-      case 'state_send': {
-        this.setData({
-          selectedIndex: 3,
-          state_type,
-          tabs_title: '待收货'
-        })
-        break;
-      }
-      case 'state_success': {
-        this.setData({
-          selectedIndex: 4,
-          state_type,
-          tabs_title: '已收货'
-        })
-        break;
-      }
-    }
-    this.req_datas(state_type);
-  },
-
-  req_datas(type) {
-    let fromSource = recordSource(app, `act=member_order&op=list&page=15&curpage=${this.data.curpage}&state_type=${type}&client_type=mini`)
-    this.setData({
-      loading: true,
-      fromSource: app.globalData.fromSource
-    });
-    wx.showLoading({
-      title: '加载中',
-    });
-    if (type != this.data.state_type) {
-      this.setData({
-        hasmore: false,
-        orders: [],
-        addTimes: [],
-        curpage: 1,
-        state_type: type
-      });
-    }
-    let self = this;
-    getReq(app,{
-      act: 'member_vorder',
-      op: 'list',
-      page: 15,
-      curpage: this.data.curpage,
-      state_type: type,
-      from: fromSource
-    }, function (res) {
-      let vorders = res.datas.vorders;
-      let addTimes = [];
-      let hasmore = false;
-      let curpage = self.data.curpage
-      for (let item of vorders) {
-        addTimes.push(self.timeFormat(item.vorder_info.add_time));
-      }
-      if (res.datas.mobile_page.hasmore) {
-        hasmore = true;
-        curpage = self.data.curpage + 1;
-      }
-      else {
-        hasmore = false;
-      }
-      self.setData({
-        hasmore,
-        curpage,
-        orders: self.data.orders.concat(vorders),
-        addTimes: self.data.addTimes.concat(addTimes),
-        loading: false,
-        firstLoad: false
-      });
-
-      wx.hideLoading();
-    })
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-    if(!this.data.firstLoad) {
-      app.setFromSource(this.data.fromSource)
-    }
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-    if (this.data.hasmore) {
-      this.req_datas(this.data.state_type);
-    }
-  },
-
-  timeFormat(time) {
-    let date = new Date(time * 1000);
-    let year = date.getFullYear();
-    let month = date.getMonth() + 1;
-    let day = date.getDate();
-    return `${year}-${month}-${day}`;
-  },
-
-  selectTab(e) {
-    let index = e.target.dataset.index;
-    let type = e.target.dataset.type;
-    if (type == this.data.state_type) {
-      return;
-    }
-    else {
-      switch (type) {
-        case '': {
-          this.setData({
-            selectedIndex: index,
-            tabs_title: '全部'
-          })
-          break;
-        }
-        case 'state_new': {
-          this.setData({
-            selectedIndex: index,
-            tabs_title: '待付款'
-          })
-          break;
-        }
-        case 'state_pay': {
-          this.setData({
-            selectedIndex: index,
-            tabs_title: '待发货'
-          })
-          break;
-        }
-        case 'state_send': {
-          this.setData({
-            selectedIndex: index,
-            tabs_title: '待收货'
-          })
-          break;
-        }
-        case 'state_success': {
-          this.setData({
-            selectedIndex: index,
-            tabs_title: '已收货'
-          })
-          break;
-        }
-      }
-      this.req_datas(type);
-    }
-  },
-  change_order_state(action, order_id, index) {
-    let self = this;
-    getReq(app,{
-      act: 'member_vorder',
-      op: 'change_state',
-      act_type: action,
-      order_id: order_id
-    }, function (res) {
-      if (res.code != 200) {
-        wx.showToast({
-          title: res.message,
-          icon: 'none'
-        })
-      }
-      else {
-        let orders = self.data.orders;
-        let addTimes = self.data.addTimes;
-        orders.splice(index, 1);
-        addTimes.splice(index, 1);
-        self.setData({
-          orders,
-          addTimes
-        })
-      }
-    })
-  },
-  order_action(e) {
-    const action = e.target.dataset.action;
-    const order_id = e.target.dataset.orderid;
-    const order_sn = e.target.dataset.sordersn;
-    const pay_sn = e.target.dataset.paysn;
-    const index = e.target.dataset.index;
-    let self = this;
-    switch (action) {
-      case "if_delete": {
-        wx.showModal({
-          title: "提示",
-          content: "您确定要删除该订单吗?",
-          success: function (res) {
-            if (res.confirm) {
-              self.change_order_state(action, order_id, index);
-            }
-            else if (res.cancel) {
-              return;
-            }
-          }
-        })
-        break;
-      }
-      case "if_deliver": {
-        let url = encodeURIComponent("https://passport.lrlz.com/mobile/index.php?act=member_order&op=search_deliver&order_id=");
-        app.navigateto(`/pages/webView/webView?url=${url}${order_id}`)
-        break;
-      }
-      case "if_cancel": {
-        wx.showModal({
-          title: "提示",
-          content: "您确定要取消该订单吗?",
-          success: function (res) {
-            if (res.confirm) {
-              self.change_order_state(action, order_id, index);
-            }
-            else if (res.cancel) {
-              return;
-            }
-          }
-        })
-        break;
-      }
-      case "if_receive": {
-        wx.showModal({
-          title: "提示",
-          content: "您确定收货吗?",
-          success: function (res) {
-            if (res.confirm) {
-              self.change_order_state(action, order_id, index);
-            }
-            else if (res.cancel) {
-              return;
-            }
-          }
-        })
-        break;
-      }
-      case "if_payment": {
-        app.navigateto(`/pages/orderPaySn/orderPaySn?pay_sn=${pay_sn}`)
-      }
-
-    }
-  }
-})

+ 0 - 6
pages/order_tabs/orderTabs.json

@@ -1,6 +0,0 @@
-{
-  "navigationBarTitleText": "我的订单",
-  "usingComponents": {
-    
-  }
-}

+ 0 - 51
pages/order_tabs/orderTabs.wxml

@@ -1,51 +0,0 @@
-<view class='tabs vux-1px-b'>
-  <block wx:key="{{index}}" wx:for="{{tabs}}">
-    <view class='tabs_item {{selectedIndex == index?"selected":""}}' data-type="{{item.type}}" data-index="{{index}}" bindtap='selectTab'>{{item.name}}</view>
-  </block>
-</view>
-<view style='height:88rpx;'></view>
-<view class="order_list" wx:if="{{orders.length > 0}}">
-  <block wx:key="{{index}}" wx:for-index="idx" wx:for="{{orders}}">
-    <view class='order_item'>
-      <view class='order_time'>
-          <text class='add_time'>{{addTimes[idx]}}</text>
-          <text class='state_desc'>{{item.vorder_info.state_desc}}</text>
-      </view>
-      <block wx:key="{{index}}" wx:for-item="goods_list"  wx:for="{{item.vorder_goods}}">
-        <view class='order_content align_center'>
-        <view class='order_image'>
-          <image style='width:140rpx;height: 140rpx;' src='{{goods_list.goods_image}}'></image>
-        </view>
-        <view class='order_info'>
-          <view>
-            <text class='goods_name'>{{goods_list.goods_name}}</text>
-          </view>
-          <view>
-            <text class='goods_spec'>{{goods_list.goods_spec}}</text>
-          </view>
-        </view>
-        <view class='order_price'>
-          <view>¥{{goods_list.goods_price}}</view>
-          <view>x{{goods_list.goods_num}}</view>
-        </view>
-      </view>
-      </block>
-      <view class='order_total'>
-        <text>共{{item.order_goods.length}}件 合计:<text class='order_amount mr6'>¥{{item.vorder_info.pay_cash}}</text> 
-        <block wx:if="{{item.order_info.shipping_fee}}">(含运费¥{{item.vorder_info.shipping_fee}})</block>
-        <block wx:else>(免运费)</block>
-      </text>
-      </view>
-      <view class='order_handle'>
-        <block wx:key="{{index}}" wx:for="{{item.actions}}" wx:for-item="action">
-          <text wx:if="{{(action.action != 'if_evaluation') && (action.action != 'if_refund_cancel')}}" data-action="{{action.action}}" data-orderid="{{item.order_info.order_id}}" data-ordersn="{{item.order_info.order_sn}}" data-index="{{idx}}" data-paysn="{{item.order_info.pay_sn}}" bindtap='order_action'>{{action.title}}</text>  
-        </block> 
-      </view>
-    </view>
-  </block>    
-</view>
-<view class='empty_order' wx:if="{{orders.length <= 0 && loading == false}}">
-  <image class="empty_order_icon" src="../../image/empty_order.png"></image>
-  <view class="emoty_order_title">您还没有相关的订单</view>
-  <view class="emoty_order_subtitle">可以去看看有哪些想买的</view>
-</view>

+ 0 - 134
pages/order_tabs/orderTabs.wxss

@@ -1,134 +0,0 @@
-.order_item {
-  font-size: 24rpx;
-  margin-top: 15rpx;
-  background: #fff;
-}
-
-.order_time {
-  position: relative;
-  display: flex;
-  padding: 10rpx 15rpx;
-}
-
-.order_time::after {
-  content: "";
-  position: absolute;
-  bottom: 0;
-  right: 0;
-  width: 100%;
-  height: 2rpx;
-  background: #d9d9d9;
-  -webkit-transform: scaleY(0.5);
-  transform: scaleY(0.5);
-}
-
-.order_time text {
-  flex: 1;
-}
-
-.order_time text.state_desc, .order_price, .order_total, .order_handle {
-  text-align: right;
-}
-
-.order_content {
-  display: flex;
-  position: relative;
-  padding: 5rpx 15rpx;
-}
-
-.order_content::after {
-  content: "";
-  position: absolute;
-  bottom: 0;
-  right: 0;
-  width: 100%;
-  height: 2rpx;
-  background: #d9d9d9;
-  -webkit-transform: scaleY(0.5);
-  transform: scaleY(0.5);
-}
-
-.order_info {
-  width: 500rpx;
-  padding-left: 15rpx;
-}
-
-.order_handle {
-  margin-top: 8rpx;
-}
-
-.order_total {
-  padding-right: 15rpx;
-  padding-top: 15rpx;
-  padding-bottom: 15rpx;
-}
-
-.order_handle text {
-  display: inline-block;
-  color: grey;
-  border: 1rpx solid grey;
-  border-radius: 5rpx;
-  padding: 10rpx 16rpx;
-  
-  margin: 15rpx;
-  font-size: 22rpx;
-}
-.goods_spec {
-  font-size:20rpx;
-  color:grey;
-  margin-top:20rpx;
-  display:inline-block;
-}
-.order_amount {
-  color: #333;
-}
-
-.tabs {
-  display: flex;
-  position: fixed;
-  top: 0;
-  left: 0;
-  width: 100%;
-  height: 88rpx;
-  line-height: 88rpx;
-  background: #ffffff;
-  font-size: 28rpx;
-  text-align: center;
-  z-index: 10;
-}
-
-.tabs view {
-  flex: 1;
-}
-
-.selected {
-  color: #333;
-  border-bottom: 3px solid #2b2b2b; 
-}
-
-.empty_order {
-  text-align: center;
-  font-size: 30rpx;
-}
-
-.empty_order text {
-  display: block;
-  height: 300rpx;
-  line-height: 300rpx;
-}
-.empty_order_icon {
-  width: 523rpx;
-  height: 300rpx;
-  margin: 120rpx auto 50rpx;
-}
-.emoty_order_title {
-  font-size: 36rpx;
-  font-weight: bold;
-  color: #333;
-  text-align: center;
-}
-.emoty_order_subtitle {
-  font-size: 24rpx;
-  color: #666;
-  text-align: center;
-}

+ 8 - 4
pages/postageDetail/postageDetail.js

@@ -81,14 +81,18 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    const { card_no = '', card_type = '', topcard_id = '' } = options
+    
     let title = '添加卡号'
-    if(options.card_no){
+    let isEdit = false
+    if (card_no) {
       title = '修改卡号'
-      this.setData({isEdit:true})
+      isEdit = true
     }
     wx.setNavigationBarTitle({ title })
-    const { card_no = '', card_type = '', topcard_id = '' } = options
-    this.setData({ card_no, card_type, topcard_id })
+    console.log('postageDetail onLoad =' + card_type)
+    console.log(card_type)
+    this.setData({ card_no, card_type, topcard_id,isEdit })
   },
 
   /**

+ 21 - 9
pages/postageDetail/postageDetail.wxml

@@ -2,30 +2,42 @@
   <view class="form-control">
       <view class="title">选择卡类别</view>
       <radio-group bindchange="radioChange" name="card_type">
-        <label class="radiobox">
+        <label class="radiobox" wx:if="{{card_type==='petrochina'}}" >
           <image src="/image/postage/petrochina.png" class="radiobox-image"></image>
           <text class="radiobox-text">中国石油</text>
           <radio value="petrochina" checked="{{card_type === 'petrochina'}}" disabled="{{card_type && card_type !== 'petrochina'}}" class="radiobox-radio" /> 
         </label>
-        <label class="radiobox">
+        <label class="radiobox" wx:if="{{card_type==='sinopec'}}">
           <image src="/image/postage/sinopec.png" class="radiobox-image"></image>
           <text class="radiobox-text">中国石化</text>
           <radio value="sinopec" checked="{{card_type === 'sinopec'}}" disabled="{{card_type && card_type !== 'sinopec'}}"  class="radiobox-radio" />
         </label>
-        <label class="radiobox">
+        <label class="radiobox" wx:if="{{card_type==='phone'}}">
           <image src="/image/postage/phone.png" class="radiobox-image"></image>
           <text class="radiobox-text">手机号</text>
           <radio value="phone" checked="{{card_type === 'phone'}}" disabled="{{card_type && card_type !== 'phone'}}" class="radiobox-radio" /> 
         </label>
       </radio-group>
   </view>
-  <view class="form-control form-control-flex">
-    <label class="form-label">卡号:</label>
-    <input class="input-control" type="number" name="card_no" value="{{card_no}}"/>
+  <view wx:if="{{card_type==='phone'}}">
+    <view class="form-control form-control-flex">
+      <label class="form-label">手机号码:</label>
+      <input class="input-control" type="number" name="card_no" value="{{card_no}}"/>
+    </view>
+    <view class="form-control form-control-flex">
+      <label class="form-label">确认号码:</label>
+      <input class="input-control" type="number" name="confirm_card_no"  value="{{confirm_card_no}}"/>
+    </view>
   </view>
-  <view class="form-control form-control-flex">
-    <label class="form-label">确认卡号:</label>
-    <input class="input-control" type="number" name="confirm_card_no"  value="{{confirm_card_no}}"/>
+  <view wx:if="{{card_type!=='phone'}}">
+    <view class="form-control form-control-flex">
+      <label class="form-label">卡    号:</label>
+      <input class="input-control" type="number" name="card_no" value="{{card_no}}"/>
+    </view>
+    <view class="form-control form-control-flex">
+      <label class="form-label">确认卡号:</label>
+      <input class="input-control" type="number" name="confirm_card_no"  value="{{confirm_card_no}}"/>
+    </view>
   </view>
   <button class="add_postage_btn" formType="submit" type="primary">确认</button>
   <view class="tips">为了您的财产安全,请确认卡号正确无误!</view>

+ 1 - 0
pages/postageManage/postageManage.js

@@ -20,6 +20,7 @@ Page({
     const { card_type } = options
     // wx.setNavigationBarTitle({ title })
     app.setCardType(card_type)
+    console.log(card_type)
     this.setData({ card_type })
     this.getDatas()
     let len = getCurrentPages().length

+ 1 - 2
pages/postageManage/postageManage.wxml

@@ -6,7 +6,6 @@
       <image wx:if="{{item.card_type === 'sinopec'}}" src="/image/postage/sinopec.png"></image>
       <image wx:if="{{item.card_type === 'phone'}}" src="/image/postage/phone.png"></image>
       <text>{{item.card_no}}</text>
-      <!-- <text class="ml8">{{item.card_no}}</text> -->
     </view>
     <!-- <view class="address_line mt8">
       <text class="col333 mr16">[{{item.car_desc}}]</text>
@@ -17,7 +16,7 @@
       <image wx:if="{{item.can_edit === 1}}" src="../../image/person/evaluated_icon.png" class="modify_address"></image>
     </view>
   </view>
-  <navigator url="/pages/postageDetail/postageDetail">
+  <navigator url="/pages/postageDetail/postageDetail?card_type={{card_type}}">
     <view class="add_address_btn">添加卡号</view>
   </navigator>
 </view>

+ 2 - 0
utils/WxAuthor.js

@@ -93,6 +93,8 @@ export default class WxAuthor {
 
   getUrl() {
     let len = getCurrentPages().length
+    if(len < 1) return ''
+     
     let currentPage = getCurrentPages()[len - 1]
     let params = ''
     if (currentPage.options) {