Files
vpUni/.svn/pristine/8f/8f7db4aef2c183062acc08e6edad35f15e896f31.svn-base
2026-03-09 16:39:03 +08:00

197 lines
5.0 KiB
Plaintext

<template>
<view style=" padding: 60rpx 40rpx 20rpx; ">
<view class="" style="font-size: 26rpx;">
提现金额
</view>
<view class="" style="margin-bottom: 20rpx;">
<up-input v-model="account" type="digit" :customStyle="{'padding':'12rpx 0','height':'100rpx'}"
fontSize='18' prefixIconStyle="font-size: 28px;color: #000;font-weight:bold" placeholder="请输入金额"
border="bottom" prefixIcon="rmb"></up-input>
</view>
<view class="" style="font-size: 26rpx; display: flex; align-items: center; ">
<view class="" style="color: #999; ">
当前剩余 {{ userData.integral }} 元
</view>
</view>
</view>
<view class="" style="margin: 40rpx 20rpx; ">
<u-button type="primary" @click="save" :custom-style="contactButtonStyle">立即提现</u-button>
</view>
<view class="" style="margin: 20rpx; padding: 20rpx 30rpx; background-color: #f6f6f6; border-radius: 20rpx; ">
<view class="" style="font-weight: bold; font-size: 30rpx;">
提示
</view>
<view class="" style="font-size: 28rpx;">
<view class="" style="text-indent: 1em; margin-top: 10rpx; ">
1.单笔最小提现1元
</view>
<view class="" style="text-indent: 1em; margin-top: 10rpx; ">
2.单笔最多可提现200元
</view>
<view class="" style="text-indent: 1em; margin-top: 10rpx; ">
3.每次最多一次申请提现
</view>
</view>
</view>
<view class="" style="margin: 20rpx; padding: 20rpx 30rpx; background-color: #f6f6f6; border-radius: 10rpx; ">
<view class="" style="font-weight: bold; font-size: 30rpx; text-align: center; ">
<img :src="Service.GetIconImg('/static/index/pay/light.png')" style="width: 65rpx; height: 65rpx;" alt="" />
</view>
<view class="" style="font-size: 30rpx; margin: 30rpx 0; text-align: center;">
您有一笔金额待确认收款
</view>
<view class="" style=" width: 100%; display: flex; align-items: center; justify-content: space-between; " >
<view class="" style="width: 48%;" >
<button style="font-size: 26rpx; padding: 6rpx 24rpx;">撤销提现</button>
</view>
<view class="" style="width: 48%;" >
<button style="font-size: 26rpx; padding: 6rpx 24rpx;" >确认收款</button>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { onShow, onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import { Service, vpMerchService } from '@/Service/vp/vpMerchService'
import { vpLoginService } from '@/Service/vp/vpLoginService'
import { vpUserService } from '@/Service/vp/vpUserService'
let name = ref('')
let account = ref<number>()
let userData = ref({
integral: 0,
merchId: ''
})
// 按钮样式
const contactButtonStyle = ref({
backgroundColor: '#FF6600',
borderColor: '#FF6600',
color: '#FFFFFF',
fontSize: '28rpx',
height: '90rpx',
borderRadius: '45rpx',
marginRight: '20rpx'
});
onLoad(() => {
getData()
});
onShow(() => {
});
const getData = () => {
vpMerchService.GetMerchAccInfo('', 1).then(res => {
if (res.code == 0) {
userData.value = res.data.merchAcc
} else {
Service.Msg(res.msg)
}
})
}
const save = () => {
if (account.value === 0 || !account.value) {
Service.Msg('请输入金额')
return
}
if (account.value < 1) {
Service.Msg('单笔最小提现1元')
return
}
if (account.value > 200) {
Service.Msg('单笔最多可提现200元')
return
}
Service.LoadIng('提现中')
uni.getProvider({
service: 'oauth',
success: function (res : any) {
uni.login({
onlyAuthorize: true,
provider: res.provider,
success: function (loginRes) {
vpLoginService.GetOpenIdByWeixin(loginRes.code, res.provider == 'weixin' ? 1 : 3).then(content => {
if (content.code == 0) {
vpUserService.WxWith(content.data, account.value, '').then(wxres => {
Service.LoadClose()
if (wxres.code == 0) {
if (wx.canIUse('requestMerchantTransfer')) {
wx.requestMerchantTransfer({
mchId: wxres.data.mchId,
appId: wxres.data.appId,
package: wxres.data.packInfo,
success: () => {
Service.Msg('提现成功!')
setTimeout(() => {
Service.GoPageBack()
}, 1000)
},
fail: (res) => {
console.log('fail:', res);
},
});
} else {
wx.showModal({
content: '你的微信版本过低,请更新至最新版本。',
showCancel: false,
});
}
} else {
Service.Msg(wxres.msg)
}
})
} else {
Service.Msg(content.msg)
}
})
}
})
}
});
}
</script>
<style lang="scss">
page {
background-color: #fff;
}
.action-buttons {
display: flex;
padding: 30rpx 30rpx;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #ffffff;
border-top: 1rpx solid #f0f0f0;
}
.button-withdrow{
font-size: 24rpx;
width: 100%;
}
</style>