收益微信打款

This commit is contained in:
lanzhihui 2026-04-24 18:31:38 +08:00
parent e0c18c0c61
commit bb6bd5b1e1
2 changed files with 240 additions and 21 deletions

View File

@ -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
}
}

View File

@ -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>