powerbank/pages/detail/immediately/index.vue

328 lines
6.5 KiB
Vue
Raw Normal View History

2024-05-11 10:57:53 +08:00
<template>
<view class="page">
2024-05-29 18:02:01 +08:00
<u-navbar title="申请提现" :border-bottom="false" :background="bgc" title-color='#000' title-size='36'
height='38'></u-navbar>
<view class="box">
<view class="scpic">
2024-05-11 10:57:53 +08:00
<view class="">
2024-05-29 18:02:01 +08:00
上传二维码:
2024-05-11 10:57:53 +08:00
</view>
2024-05-29 18:02:01 +08:00
<view class="tp" @click="picbtn" v-if="userImgs">
<image :src="userImgs" mode=""></image>
</view>
<view class="tp" @click="picbtn" v-else>
+
2024-05-11 10:57:53 +08:00
</view>
</view>
2024-05-29 18:02:01 +08:00
<view class="txje">
<view class="title">
提现金额
</view>
<view class="tx">
<view class="qian">
<text
style="font-weight: 500;font-size: 44rpx;color: #3D3D3D;vertical-align: bottom;margin-right:10rpx;"></text>
<input type="text" v-model="xutx" placeholder="请输入提现金额(请输入整数)" />
</view> <text class="qb" @click="btnqbtx">全部提现</text>
</view>
<view class="ketx">
<view class="">
可提现金额<text>{{txobj.balance}}</text>
</view>
<view class="mx" @click="btnmx">
提现明细
</view>
</view>
<view class="zje">
总金额<text>{{txobj.totalAmount}}</text>
</view>
<view class="sxf">
提现手续费<text>{{txobj.serviceRate}}%</text>
</view>
2024-05-11 10:57:53 +08:00
</view>
2024-05-29 18:02:01 +08:00
<view class="txsm">
<view class="title">
提现说明:
</view>
<view class="hong">
-提现时间每月提取可提现金额上月及之前费用),提现率{{txobj.serviceRate}}%
</view>
<view class="hui">
-提现额度单笔提现金额最低{{txobj.minAmount}}
</view>
<view class="hui">
-到账时间3个工作日
</view>
<view class="hui">
-每笔提现不能超过{{txobj.maxAmount}}请保存收款码上传不要上传截图收款码
</view>
2024-05-11 10:57:53 +08:00
</view>
2024-05-29 18:02:01 +08:00
<view class="btnanniu" @click="btnljtx">
立即提现
2024-05-11 10:57:53 +08:00
</view>
2024-05-29 18:02:01 +08:00
2024-05-11 10:57:53 +08:00
</view>
</view>
</template>
<script>
export default {
data() {
return {
2024-05-29 18:02:01 +08:00
userImgs: '',
ketx: 500,
zongtx: 600,
xutx: '',
txobj: {}
2024-05-11 10:57:53 +08:00
}
},
onLoad() {
2024-05-29 18:02:01 +08:00
this.getQiniuToken()
},
onShow() {
this.getguize()
2024-05-11 10:57:53 +08:00
},
methods: {
2024-05-29 18:02:01 +08:00
btnqbtx() {
this.xutx = this.txobj.balance
},
btnmx() {
2024-05-11 10:57:53 +08:00
uni.navigateTo({
2024-05-29 18:02:01 +08:00
url: '/pages/detail/index'
})
},
btnljtx() {
let data = {
picture:this.userImgs,
amount:this.xutx,
serviceRate:this.txobj.serviceRate,
type:1
}
this.$u.post('/agent/withdraw',data).then(res => {
if(res.code == 200){
uni.showToast({
title: '提现成功',
icon: 'none',
duration: 2000
})
this.xutx = ''
this.getguize()
}else if(res.code == 500){
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
},
getguize() {
this.$u.get('/agent/withdraw/rule').then(res => {
if (res.code == 200) {
this.txobj = res.data
}
2024-05-11 10:57:53 +08:00
})
},
2024-05-25 18:06:00 +08:00
getQiniuToken() {
2024-05-29 18:02:01 +08:00
this.$u.get("/common/qiniu/uploadInfo").then((res) => {
if (res.code == 200) {
this.token = res.token
}
})
2024-05-25 18:06:00 +08:00
},
2024-05-11 10:57:53 +08:00
picbtn() {
2024-05-29 18:02:01 +08:00
let _this = this
let math = 'static/' + _this.$u.guid(20)
uni.chooseMessageFile({
count: 1,
type: 'all',
success(res) {
let tempFilePaths = res.tempFiles
wx.uploadFile({
url: 'https://up-z2.qiniup.com',
name: 'file',
filePath: tempFilePaths[0].path,
formData: {
token: _this.token, //后端返回的token
key: 'smartmeter/img/' + math
},
success: function(res) {
let str = JSON.parse(res.data)
_this.userImgs = 'https://api.ccttiot.com/' + str.key
console.log(_this.userImgs);
}
})
}
})
2024-05-11 10:57:53 +08:00
},
}
}
</script>
<style lang="scss">
page {
// background-color: ;
background: linear-gradient(180deg, #25CE88 0%, rgba(255, 255, 255, 0) 100%);
border-radius: 0rpx 0rpx 0rpx 0rpx;
}
.page {
width: 750rpx;
position: fixed;
top: 0;
left: 0;
2024-05-29 18:02:01 +08:00
.box {
.btnanniu {
2024-05-11 10:57:53 +08:00
width: 680rpx;
height: 90rpx;
2024-05-29 18:02:01 +08:00
background: linear-gradient(270deg, #54DAA1 0%, #19CD82 100%);
2024-05-11 10:57:53 +08:00
border-radius: 54rpx 54rpx 54rpx 54rpx;
text-align: center;
line-height: 90rpx;
font-weight: 500;
font-size: 40rpx;
color: #FFFFFF;
margin: auto;
position: fixed;
bottom: 84rpx;
left: 50%;
transform: translateX(-50%);
}
2024-05-29 18:02:01 +08:00
.txsm {
2024-05-11 10:57:53 +08:00
margin-top: 36rpx;
padding-left: 58rpx;
padding-right: 58rpx;
box-sizing: border-box;
2024-05-29 18:02:01 +08:00
.title {
2024-05-11 10:57:53 +08:00
font-weight: 500;
font-size: 28rpx;
color: #808080;
}
2024-05-29 18:02:01 +08:00
.hong {
2024-05-11 10:57:53 +08:00
font-size: 24rpx;
color: #FF4444;
margin-top: 10rpx;
}
2024-05-29 18:02:01 +08:00
.hui {
2024-05-11 10:57:53 +08:00
font-size: 24rpx;
color: #808080;
margin-top: 16rpx;
}
}
2024-05-29 18:02:01 +08:00
2024-05-11 10:57:53 +08:00
margin-top: 32rpx;
width: 750rpx;
height: 1440rpx;
background: #F4F5F7;
border-radius: 0rpx 0rpx 0rpx 0rpx;
padding-top: 22rpx;
2024-05-29 18:02:01 +08:00
.txje {
2024-05-11 10:57:53 +08:00
width: 680rpx;
height: 352rpx;
background: #FFFFFF;
border-radius: 24rpx 24rpx 24rpx 24rpx;
margin: auto;
margin-top: 30rpx;
padding-top: 28rpx;
2024-05-29 18:02:01 +08:00
padding-right: 30rpx;
2024-05-11 10:57:53 +08:00
padding-left: 30rpx;
box-sizing: border-box;
2024-05-29 18:02:01 +08:00
.title {
2024-05-11 10:57:53 +08:00
font-weight: 500;
font-size: 28rpx;
color: #3D3D3D;
}
2024-05-29 18:02:01 +08:00
.zje {
2024-05-11 10:57:53 +08:00
margin-top: 16rpx;
font-size: 24rpx;
color: #3D3D3D;
2024-05-29 18:02:01 +08:00
text {
2024-05-11 10:57:53 +08:00
color: #FF8157;
}
}
2024-05-29 18:02:01 +08:00
.sxf {
2024-05-11 10:57:53 +08:00
margin-top: 16rpx;
font-size: 20rpx;
color: #3D3D3D;
2024-05-29 18:02:01 +08:00
text {
2024-05-11 10:57:53 +08:00
color: #FF4444;
}
}
2024-05-29 18:02:01 +08:00
.ketx {
2024-05-11 10:57:53 +08:00
display: flex;
justify-content: space-between;
margin-top: 38rpx;
font-size: 24rpx;
color: #3D3D3D;
2024-05-29 18:02:01 +08:00
text {
2024-05-11 10:57:53 +08:00
color: #FF4444;
}
2024-05-29 18:02:01 +08:00
.mx {
2024-05-11 10:57:53 +08:00
color: #808080;
}
}
2024-05-29 18:02:01 +08:00
.tx {
2024-05-11 10:57:53 +08:00
display: flex;
justify-content: space-between;
margin-top: 16rpx;
border-bottom: 1px solid #ccc;
2024-05-29 18:02:01 +08:00
padding-bottom: 8rpx;
.qb {
2024-05-11 10:57:53 +08:00
font-size: 24rpx;
color: #1DBE7B;
margin-top: 15rpx;
}
2024-05-29 18:02:01 +08:00
.qian {
2024-05-11 10:57:53 +08:00
display: flex;
2024-05-29 18:02:01 +08:00
input {
2024-05-11 10:57:53 +08:00
margin-top: 10rpx;
2024-05-29 18:02:01 +08:00
width: 440rpx;
2024-05-11 10:57:53 +08:00
}
}
}
}
2024-05-29 18:02:01 +08:00
.scpic {
2024-05-11 10:57:53 +08:00
width: 680rpx;
height: 300rpx;
background: #FFFFFF;
border-radius: 24rpx 24rpx 24rpx 24rpx;
margin: auto;
padding-top: 74rpx;
padding-left: 48rpx;
box-sizing: border-box;
display: flex;
2024-05-29 18:02:01 +08:00
.tp {
2024-05-11 10:57:53 +08:00
width: 166rpx;
height: 166rpx;
background-color: #eee;
margin-left: 28rpx;
color: #fff;
text-align: center;
2024-05-25 18:06:00 +08:00
line-height: 135rpx;
2024-05-11 10:57:53 +08:00
font-size: 180rpx;
}
}
}
}
</style>