收益微信打款
This commit is contained in:
parent
e0c18c0c61
commit
bb6bd5b1e1
@ -265,12 +265,40 @@
|
||||
</div>
|
||||
<!--<img class="handleDelete" @click="showTrueBindWeChat = false" src="https://images.ufutx.com/202105/25/5f7678d9f8fc84f3694893a71169263a.png" alt="" />-->
|
||||
</van-popup>
|
||||
<!-- 微信提现确认弹窗 -->
|
||||
<van-popup v-model="showWxPayConfirm" :close-on-click-overlay="false" :lock-scroll="true" :duration="0.5">
|
||||
<div class="m_acc" style="padding: 30px 20px 25px;">
|
||||
<div class="text-center font16 color3" style="line-height:24px;">
|
||||
即将进入微信转账功能<br>
|
||||
取消后当前提现金额将进行冻结,24小时后才可提现
|
||||
</div>
|
||||
<div class="f-fcc" style="margin-top:25px;">
|
||||
<div class="font14 color9" style="width:100px;height:36px;line-height:36px;border-radius:18px;margin-right:10px;border:1px solid #eee;text-align: center;" @click="cancelWxWithdraw">取消</div>
|
||||
<div class="font14 colorff" style="width:100px;height:36px;line-height:36px;border-radius:18px;background:linear-gradient(92deg, #6263ff 0%, #707ffa 100%);text-align: center;" @click="confirmWxWithdraw">确认</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
|
||||
<!-- 取消微信支付 → 冻结提示 -->
|
||||
<van-popup v-model="showWxPayCancelTip" :close-on-click-overlay="false" :lock-scroll="true" :duration="0.5">
|
||||
<div class="m_acc" style="padding: 30px 20px 25px;">
|
||||
<div class="text-center font16 color3" style="line-height:24px;">
|
||||
你已取消微信转账<br>
|
||||
提现金额已进入冻结状态<br>
|
||||
可在提现记录中重新提现
|
||||
</div>
|
||||
<div class="f-fcc" style="margin-top:25px;">
|
||||
<div class="font14 colorff" style="width:120px;height:36px;line-height:36px;border-radius:18px;background:linear-gradient(92deg, #6263ff 0%, #707ffa 100%);text-align: center;" @click="showWxPayCancelTip = false">知道了</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { $toastClear, $toastLoading, $toastSuccess, $toastText } from '@/config/toast'
|
||||
import service from '@/utils/request'
|
||||
import wx from 'weixin-js-sdk'
|
||||
|
||||
export default {
|
||||
computed: {},
|
||||
@ -300,7 +328,9 @@ export default {
|
||||
showBindAccount: false, // 选择提现方式
|
||||
selectAccount: '',
|
||||
weChatBindCode: '', // 微信二维码
|
||||
showTrueBindWeChat: false // 绑定二维码成功弹窗
|
||||
showTrueBindWeChat: false, // 绑定二维码成功弹窗
|
||||
showWxPayConfirm: false, // 唤起微信支付前的确认弹窗
|
||||
showWxPayCancelTip: false // 取消支付后的提示弹窗
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -358,10 +388,10 @@ export default {
|
||||
$toastText('请先绑定提现账户')
|
||||
return
|
||||
}
|
||||
if (parseFloat(vm.value) < 1) {
|
||||
$toastText('提现金额不能小于1元')
|
||||
return
|
||||
}
|
||||
// if (parseFloat(vm.value) < 1) {
|
||||
// $toastText('提现金额不能小于1元')
|
||||
// return
|
||||
// }
|
||||
if (parseFloat(vm.value) > parseFloat(vm.detail.balance_value)) {
|
||||
$toastText('提现金额不能超过可提现')
|
||||
return
|
||||
@ -383,30 +413,46 @@ export default {
|
||||
amount: vm.amount
|
||||
}
|
||||
if (vm.throttle) {
|
||||
$toastLoading('提现中...')
|
||||
vm.throttle = false
|
||||
vm.withdrawalShow = false
|
||||
let url = ''
|
||||
if (vm.way === 'weixin' && localStorage.getItem('merchant_id') === '596') {
|
||||
url = '/s/h5/communities/UserWithdrawal/v2'
|
||||
// vm.showWxPayConfirm = true
|
||||
// vm.wxPayPrepareData = { url, data } // 暂存参数
|
||||
// vm.withdrawalShow = false
|
||||
// return // 停止,不继续请求接口
|
||||
} else {
|
||||
url = '/s/h5/communities/UserWithdrawal'
|
||||
}
|
||||
vm.throttle = false
|
||||
$toastLoading('提现中...')
|
||||
console.log(url, '')
|
||||
service
|
||||
.post(`/s/h5/communities/UserWithdrawal`, data)
|
||||
.post(`${url}`, data)
|
||||
.then(data => {
|
||||
console.log(data, 'data---')
|
||||
if (localStorage.getItem('merchant_id') === '596') {
|
||||
alert(JSON.stringify(data))
|
||||
}
|
||||
|
||||
vm.value = ''
|
||||
if (data.status === 1) {
|
||||
setTimeout(() => {
|
||||
vm.throttle = true
|
||||
vm.showPrompt = false
|
||||
vm.showWithdrawalHint = true
|
||||
vm.getData()
|
||||
$toastClear()
|
||||
}, 500)
|
||||
if (vm.way === 'weixin' && localStorage.getItem('merchant_id') === '596') {
|
||||
// 直接唤起支付
|
||||
vm.openWxTransfer(data)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
vm.throttle = true
|
||||
vm.showPrompt = false
|
||||
vm.showWithdrawalHint = true
|
||||
vm.getData()
|
||||
$toastClear()
|
||||
}, 500)
|
||||
}
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
vm.throttle = true
|
||||
vm.showPrompt = false
|
||||
alert(data)
|
||||
// vm.errorMessage = data
|
||||
// vm.showErrorMessage = true
|
||||
// vm.showWithdrawalHint = true
|
||||
@ -425,6 +471,111 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
// 直接打开微信转账
|
||||
openWxTransfer(data) {
|
||||
const vm = this
|
||||
|
||||
// 微信环境判断
|
||||
if (!/micromessenger/i.test(navigator.userAgent)) {
|
||||
$toastText('请在微信内操作')
|
||||
return
|
||||
}
|
||||
|
||||
wx.ready(function() {
|
||||
wx.checkJsApi({
|
||||
jsApiList: ['requestMerchantTransfer'],
|
||||
success: function(res) {
|
||||
if (res.checkResult['requestMerchantTransfer']) {
|
||||
WeixinJSBridge.invoke('requestMerchantTransfer', {
|
||||
mchId: data.mch_id,
|
||||
appId: data.app_id,
|
||||
package: data.package_info
|
||||
}, function(resp) {
|
||||
if (resp.err_msg === 'requestMerchantTransfer:ok') {
|
||||
$toastSuccess('提现成功')
|
||||
vm.getData()
|
||||
} else if (resp.err_msg === 'requestMerchantTransfer:cancel') {
|
||||
$toastText('已取消,金额已冻结,可在记录中重新提现')
|
||||
vm.showWxPayCancelTip = true
|
||||
} else {
|
||||
$toastText('转账失败')
|
||||
}
|
||||
setTimeout(() => {
|
||||
$toastClear()
|
||||
})
|
||||
})
|
||||
} else {
|
||||
alert('你的微信版本过低,请更新至最新版本。')
|
||||
vm.throttle = true
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 确认微信提现(真正发请求)
|
||||
confirmWxWithdraw() {
|
||||
const vm = this
|
||||
vm.showWxPayConfirm = false
|
||||
|
||||
const { url, data } = vm.wxPayPrepareData
|
||||
$toastLoading('提现中...')
|
||||
vm.throttle = false
|
||||
|
||||
service.post(url, data).then(data => {
|
||||
vm.value = ''
|
||||
if (data.status === 1) {
|
||||
wx.ready(function() {
|
||||
wx.checkJsApi({
|
||||
jsApiList: ['requestMerchantTransfer'],
|
||||
success: function(res) {
|
||||
if (res.checkResult['requestMerchantTransfer']) {
|
||||
WeixinJSBridge.invoke('requestMerchantTransfer', {
|
||||
mchId: data.mch_id,
|
||||
appId: data.app_id,
|
||||
package: data.package_info
|
||||
}, function(res) {
|
||||
if (res.err_msg === 'requestMerchantTransfer:ok') {
|
||||
$toastText('唤起支付')
|
||||
setTimeout(() => {
|
||||
$toastClear()
|
||||
vm.showWithdrawalHint = true
|
||||
vm.getData()
|
||||
}, 1000)
|
||||
} else if (res.err_msg === 'requestMerchantTransfer:cancel') {
|
||||
// 取消支付 → 弹出冻结提示
|
||||
vm.showWxPayCancelTip = true
|
||||
vm.getData()
|
||||
} else if (res.err_msg === 'requestMerchantTransfer:fail') {
|
||||
$toastText('网络异常,请重试')
|
||||
}
|
||||
vm.throttle = true
|
||||
})
|
||||
} else {
|
||||
alert('你的微信版本过低,请更新至最新版本。')
|
||||
vm.throttle = true
|
||||
vm.getData()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
vm.throttle = true
|
||||
$toastClear()
|
||||
}, 500)
|
||||
}
|
||||
}).catch(error => {
|
||||
$toastClear()
|
||||
vm.throttle = true
|
||||
})
|
||||
},
|
||||
|
||||
// 取消微信提现
|
||||
cancelWxWithdraw() {
|
||||
this.showWxPayConfirm = false
|
||||
this.throttle = true
|
||||
},
|
||||
binding() {
|
||||
const vm = this
|
||||
const data = {
|
||||
@ -490,7 +641,7 @@ export default {
|
||||
window.location.replace(
|
||||
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx36c72a00f1b2be64&redirect_uri=` +
|
||||
encodeURIComponent(
|
||||
`https://love.ufutx.com/api/official/user/bind/wechat/account?merchant_id=${this.$route.query.merchant_id}&account_id=${this.$route.query.account_id}&jump_url=my`
|
||||
`https://love.ufutx.cn/api/official/user/bind/wechat/account?merchant_id=${this.$route.query.merchant_id}&account_id=${this.$route.query.account_id}&jump_url=my`
|
||||
) +
|
||||
`&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect`
|
||||
)
|
||||
@ -498,7 +649,7 @@ export default {
|
||||
},
|
||||
created() {},
|
||||
mounted() {
|
||||
console.log('data---')
|
||||
console.log('data---123')
|
||||
const ScrollTop = document.getElementById('app')
|
||||
ScrollTop.scrollTop = 0
|
||||
this.getData()
|
||||
@ -511,6 +662,17 @@ export default {
|
||||
// }
|
||||
// this.aurhorization()
|
||||
}
|
||||
// wx.ready(function() {
|
||||
// wx.checkJsApi({
|
||||
// jsApiList: ['chooseWXPay'],
|
||||
// success: function(res) {
|
||||
// console.log(res, 'd===0e')
|
||||
// if (res.checkResult['requestMerchantTransfer']) {
|
||||
// console.log('chengg')
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// this.showTrueBindWeChat = true
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,12 @@
|
||||
<img class="record-icon" src="https://image.fulllinkai.com/202109/24/4d97a2d419c435d6a375fee38a807ab0.png" alt="" />
|
||||
<div class="record-data">
|
||||
<div class="font16 color3 alignment_left" style="margin-bottom: 4px;">
|
||||
{{item.way ==='weixin'? '微信' : '支付宝'}}-{{ item.status == 'freezing' ? '处理中' : item.status == 'canceled' ? '提现失败': '提现成功' }}
|
||||
{{item.way ==='weixin'? '微信' : '支付宝'}}-<span
|
||||
v-if="item.status == 'wait_user_confirm'"
|
||||
class="retry-btn"
|
||||
@click.stop="retryWxPay(item)"
|
||||
>重新提现</span>
|
||||
<span v-else>{{ item.status == 'freezing' ? '处理中' : item.status == 'canceled' ? '提现失败' : '提现成功' }}</span>
|
||||
<img class="prompt-icon" src="https://image.fulllinkai.com/202109/24/c7374b0e93097fe327fb2391db286c7d.png" alt="" v-if="item.status == 'freezing'" @click.stop="prompt(index)" />
|
||||
<img class="prompt-icon" src="https://image.fulllinkai.com/202109/24/c7374b0e93097fe327fb2391db286c7d.png" alt="" v-else-if="item.status == 'canceled'" @click.stop="prompt(index)" />
|
||||
</div>
|
||||
@ -22,7 +27,12 @@
|
||||
<div class='error-prompt-box colorff font13' :class="item.status == 'freezing'? 'error-prompt-box-v1': ''" v-if='item.is_show'>{{item.status == 'freezing' ? '处理中,将在24小时内到账': '账号不正确'}}</div>
|
||||
<div class='error-mask' v-if='errorMask' @click.stop='showPrompt'></div>
|
||||
</div>
|
||||
<div class="font18 color3">-{{ item.real_value }}</div>
|
||||
<div class="font18 color3">
|
||||
<span v-if="item.status == 'wait_user_confirm'" style="font-size:16px;">冻结中(</span>
|
||||
<span v-if="item.status == 'wait_user_confirm'">{{ item.value }}</span>
|
||||
<span v-if="item.status == 'wait_user_confirm'" style="font-size:16px;">)</span>
|
||||
<span v-else>-{{ item.real_value }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
@ -36,9 +46,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { $toastClear, $toastLoading } from '@/config/toast'
|
||||
import { $toastClear, $toastLoading, $toastText, $toastSuccess } from '@/config/toast'
|
||||
import service from '@/utils/request'
|
||||
import { formatDate } from '@/plugins/timeConversion'
|
||||
import wx from 'weixin-js-sdk'
|
||||
|
||||
export default {
|
||||
computed: {},
|
||||
@ -115,6 +126,45 @@ export default {
|
||||
this.errorMask = false
|
||||
this.list[this.index].is_show = false
|
||||
this.index = 0
|
||||
},
|
||||
// 直接重新发起微信支付(数据从list获取)
|
||||
retryWxPay(item) {
|
||||
const vm = this
|
||||
|
||||
// 必须微信环境
|
||||
if (!/micromessenger/i.test(navigator.userAgent)) {
|
||||
$toastText('请在微信内操作')
|
||||
return
|
||||
}
|
||||
|
||||
// 直接调用微信支付
|
||||
wx.ready(function() {
|
||||
wx.checkJsApi({
|
||||
jsApiList: ['requestMerchantTransfer'],
|
||||
success: function(res) {
|
||||
if (res.checkResult['requestMerchantTransfer']) {
|
||||
WeixinJSBridge.invoke('requestMerchantTransfer', {
|
||||
mchId: item.mch_id, // 从list直接取
|
||||
appId: item.app_id, // 从list直接取
|
||||
package: item.package_info // 从list直接取
|
||||
}, function(resp) {
|
||||
if (resp.err_msg === 'requestMerchantTransfer:ok') {
|
||||
$toastSuccess('提现成功')
|
||||
vm.getList() // 刷新列表
|
||||
} else if (resp.err_msg === 'requestMerchantTransfer:cancel') {
|
||||
$toastText('已取消,金额保持冻结')
|
||||
vm.getList()
|
||||
} else {
|
||||
$toastText('支付失败')
|
||||
}
|
||||
setTimeout(() => {
|
||||
$toastClear()
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
@ -210,5 +260,12 @@ export default {
|
||||
background-color: #f5f5f5;
|
||||
margin: 11px 0;
|
||||
}
|
||||
.retry-btn {
|
||||
color: #4356f3;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user