| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- var _request = require('../../../../utils/request.js')
- var rid
- Page({
- data: {
- detail: {}
- },
- onLoad: function (options) {
- rid = options.id
- this.getRadish()
- },
- getRadish () {
- var that = this
- var url = 'v1/user/cash/balance/' + rid
- var params = {
- }
- var success = function (res) {
- var data = res.data
- that.setData({
- detail: data
- })
- }
- _request.$get(url, params, success)
- },
- confirmMerchantTransfer () {
- var that = this
- var detail = that.data.detail || {}
- 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
- }
- 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.getRadish()
- },
- fail: function (res) {
- wx.showToast({
- title: (res && res.errMsg) ? res.errMsg : '确认收款失败',
- icon: 'none',
- duration: 3000
- })
- }
- })
- },
- onShareAppMessage: function (val) {
- return _request.share({
- sc: 'xcx_user_radishdetail'
- })
- }
- })
|