Ver código fonte

fix: remove legacy withdraw confirm entry

root 14 horas atrás
pai
commit
5c1b6ab543

+ 2 - 63
packageUser/pages/user/cashDetail/cashDetail.js

@@ -5,7 +5,7 @@ function createEmptyTransferDetail () {
 }
 function formatTransferStateText (state) {
   if (state === 'WAIT_USER_CONFIRM') {
-    return '待确认,确认后到帐'
+    return '待确认'
   }
   return state || ''
 }
@@ -31,9 +31,7 @@ Page({
   data: {
     detail: createEmptyTransferDetail(),
     hasDetail: false,
-    loading: true,
-    confirmingTransfer: false,
-    confirmedTransfer: false
+    loading: true
   },
   onLoad: function (options) {
     rid = options.id || options.cash_id || options.balance_id || options.rid || options.order_id
@@ -54,9 +52,6 @@ Page({
         return
       }
       var data = normalizeTransferDetail(res.data)
-      if (that.data.confirmedTransfer) {
-        data.can_confirm_transfer = false
-      }
       that.setData({
         detail: data,
         hasDetail: true,
@@ -111,62 +106,6 @@ Page({
     }
     _request.$get(url, params, success, fail)
   },
-  confirmMerchantTransfer () {
-    var that = this
-    var detail = that.data.detail || {}
-    if (that.data.confirmingTransfer) {
-      return
-    }
-    if (!detail.can_confirm_transfer || !detail.package_info) {
-      wx.showToast({
-        title: '当前提现无需确认收款',
-        icon: 'none',
-        duration: 2000
-      })
-      return
-    }
-    if (!wx.canIUse || !wx.canIUse('requestMerchantTransfer')) {
-      wx.showToast({
-        title: '当前微信版本不支持确认收款,请升级微信',
-        icon: 'none',
-        duration: 2000
-      })
-      return
-    }
-    detail.can_confirm_transfer = false
-    that.setData({
-      detail: detail,
-      confirmingTransfer: true
-    })
-    wx.requestMerchantTransfer({
-      mchId: String(detail.mch_id || ''),
-      appId: String(detail.app_id || ''),
-      package: detail.package_info,
-      success: function () {
-        wx.showToast({
-          title: '确认收款已提交',
-          icon: 'none',
-          duration: 2000
-        })
-        that.setData({
-          confirmedTransfer: true
-        })
-        that.getRadish()
-      },
-      fail: function (res) {
-        detail.can_confirm_transfer = true
-        that.setData({
-          detail: detail,
-          confirmingTransfer: false
-        })
-        wx.showToast({
-          title: (res && res.errMsg) ? res.errMsg : '确认收款失败',
-          icon: 'none',
-          duration: 3000
-        })
-      }
-    })
-  },
   onShareAppMessage: function (val) {
     return _request.share({
       sc: 'xcx_user_radishdetail'

+ 0 - 1
packageUser/pages/user/cashDetail/cashDetail.wxml

@@ -35,7 +35,6 @@
       <view class="radishDetail-line__value">{{detail.transfer_state_text || detail.transfer_state}}</view>
       <view class="clean"></view>
     </view>
-    <view class="merchant-transfer-btn" wx:if="{{detail.can_confirm_transfer}}" bindtap="confirmMerchantTransfer">确认收款</view>
   </view>
   <view class="radishDetail-empty" wx:if="{{!loading && !hasDetail}}">暂无提现记录</view>
 </view>

+ 1 - 68
packageUser/pages/user/withdraw/withdraw.js

@@ -1,7 +1,7 @@
 var _request = require('../../../../utils/request.js')
 function formatWithdrawStateText (state) {
   if (state === 'WAIT_USER_CONFIRM') {
-    return '待确认,确认后到帐'
+    return '待确认'
   }
   return state || ''
 }
@@ -127,73 +127,6 @@ Page({
     }
     _request.$get(url, params, success)
   },
-  confirmMerchantTransfer (e) {
-    var that = this
-    var index = e.currentTarget.dataset.index
-    var item = that.data.cashList[index] || {}
-    if (item.confirming_transfer) {
-      return
-    }
-    if (!item.can_confirm_transfer || !item.package_info) {
-      wx.showToast({
-        title: '当前提现无需确认收款',
-        icon: 'none',
-        duration: 2000
-      })
-      return
-    }
-    if (!wx.canIUse || !wx.canIUse('requestMerchantTransfer')) {
-      wx.showToast({
-        title: '当前微信版本不支持确认收款,请升级微信',
-        icon: 'none',
-        duration: 2000
-      })
-      return
-    }
-    var cashList = that.data.cashList
-    cashList[index].can_confirm_transfer = false
-    cashList[index].confirming_transfer = true
-    that.setData({
-      cashList: cashList
-    })
-    wx.requestMerchantTransfer({
-      mchId: String(item.mch_id || ''),
-      appId: String(item.app_id || ''),
-      package: item.package_info,
-      success: function () {
-        wx.showToast({
-          title: '确认收款已提交',
-          icon: 'none',
-          duration: 2000
-        })
-        var confirmedTransferIds = that.data.confirmedTransferIds || {}
-        confirmedTransferIds[item.id] = true
-        getApp().globalData.withdrawChanged = true
-        that.setData({
-          page: 1,
-          cashList_more: true,
-          cashList_change: true,
-          confirmedTransferIds: confirmedTransferIds
-        })
-        that.getCashList()
-      },
-      fail: function (res) {
-        var cashList = that.data.cashList
-        if (cashList[index]) {
-          cashList[index].can_confirm_transfer = true
-          cashList[index].confirming_transfer = false
-          that.setData({
-            cashList: cashList
-          })
-        }
-        wx.showToast({
-          title: (res && res.errMsg) ? res.errMsg : '确认收款失败',
-          icon: 'none',
-          duration: 3000
-        })
-      }
-    })
-  },
   onShareAppMessage: function (val) {
     return _request.share({
       sc: 'xcx_user_withdraw'

+ 0 - 1
packageUser/pages/user/withdraw/withdraw.wxml

@@ -33,7 +33,6 @@
       <view class="price1" wx:if="{{!item.pay_state && (!item.audit_state || item.audit_state === 1)}}">{{item.state_cn}}</view>
       <view class="price2" wx:if="{{(!item.pay_state && item.audit_state === 2) || (item.pay_state === 2 && item.audit_state === 1)}}">{{item.state_cn}}</view>
       <view class="price3" wx:if="{{item.pay_state ===1 && item.audit_state === 1}}">{{item.state_cn}}</view>
-      <view class="confirm-transfer" wx:if="{{item.can_confirm_transfer}}" data-index="{{index}}" catchtap="confirmMerchantTransfer">确认收款</view>
       <view class="time"><format-time type="formatTime1" value="{{item.created_at}}" ></format-time></view>
       <view class="clean"></view>
     </view>