Browse Source

fix 提现界面、上传界面

feature-1.0
da da 3 years ago
parent
commit
379bff350d
  1. 2
      main.js
  2. 67
      pages-userInfo/withdraw/withdraw.vue
  3. 20
      pages/index/upload/upload.vue

2
main.js

@ -10,7 +10,7 @@ const baseURL = 'https://service.bnyer.cn'
Vue.prototype.$baseURL = baseURL;
Vue.prototype.$uploadURL = "/file/upload"; // ”/file/uploadBatch“ /file/upload
Vue.prototype.$uploadURL = "/file/uploadBatch"; // ”/file/uploadBatch“ /file/upload
Vue.prototype.$uploadType = "file"; // files file
Vue.prototype.$noMultipleClicks = common.noMultipleClicks;

67
pages-userInfo/withdraw/withdraw.vue

@ -4,8 +4,8 @@
<view class="withdraw-input-box">
<view class="withdraw-title">提现金额</view>
<view class="input-box">
¥ <input type="text" placeholder="输入金额" placeholder-class="pch"
class="input-value" @blur="checkAmt()" value="" v-model="amt"/>
¥ <input type="text" placeholder="输入金额" placeholder-class="pch" class="input-value"
@blur="checkAmt()" value="" v-model="amt" />
</view>
<view class="withdraw-amount">
<span>当前余额为{{userInfo.amt}}</span>
@ -24,13 +24,16 @@
<view class="withdrawBox">
<view class="withdrawBox-title">
<view class="account-icon" v-if="item.type == '0'">
<uni-icons custom-prefix="iconfont" :type="payType[0].icon" size="20" :color="payType[0].color" ></uni-icons>
<uni-icons custom-prefix="iconfont" :type="payType[0].icon" size="20"
:color="payType[0].color"></uni-icons>
</view>
<view class="account-icon" v-if="item.type == '1'">
<uni-icons custom-prefix="iconfont" :type="payType[1].icon" size="20" :color="payType[1].color" ></uni-icons>
<uni-icons custom-prefix="iconfont" :type="payType[1].icon" size="20"
:color="payType[1].color"></uni-icons>
</view>
<view class="account-icon" v-if="item.type == '2'">
<uni-icons custom-prefix="iconfont" :type="payType[2].icon" size="20" :color="payType[2].color" ></uni-icons>
<uni-icons custom-prefix="iconfont" :type="payType[2].icon" size="20"
:color="payType[2].color"></uni-icons>
</view><!-- 0->微信 1->银行卡 2->支付宝 -->
<view class="account-title" v-if="item.type == '0'">
{{payType[0].title}} {{item.accountNo}}
@ -43,7 +46,8 @@
</view>
</view>
<view>
<radio :value="JSON.stringify(item)" color="#0b6375" :checked="item.isUse === '1'" class="radioStyle"/>
<radio :value="JSON.stringify(item)" color="#0b6375" :checked="item.isUse === '1'"
class="radioStyle" />
<!-- <uni-data-checkbox v-model="item" :localdata="range" @change="change"></uni-data-checkbox> -->
</view>
</view>
@ -60,8 +64,10 @@
<script>
import {
getWithdrawList,getCreatorAccount,
checkWithdraw,withdraw,
getWithdrawList,
getCreatorAccount,
checkWithdraw,
withdraw,
getCreatorInfo
} from '@/api/userInfo.js'
export default {
@ -76,8 +82,7 @@
accountRealNo: '', //
type: '',
current: 0,
payType: [
{
payType: [{
icon: 'icon-weixin',
title: '微信',
color: '#15ba11'
@ -95,7 +100,7 @@
],
}
},
created() {
onShow() {
const userInfo = uni.getStorageSync('userInfo')
if (!userInfo) {
console.log('havent userInfo')
@ -121,8 +126,23 @@
async getCreatorAccount() {
let that = this;
const res = await getCreatorAccount(that.userInfo.id)
console.log('res', res)
if (res.data.code === 200) {
if (!res.data.data.length) {
return uni.showModal({
title: '提示',
content: '当前暂无银行卡,请点确认绑定',
success: ({
confirm,
cancel
}) => {
confirm && uni.navigateTo({
url: '/pages-userInfo/creatorAccount/createAccount'
})
cancel && uni.navigateBack()
}
})
}
that.creatorAccountList.push(...res.data.data)
for (let param of res.data.data) {
if (param.isUse === '1') {
@ -307,17 +327,20 @@
}
}
.withdraw-input-box {
width: 590rpx;
padding: 40rpx;
background: $uni-bg-base-color;
border-radius: 10rpx;
}
.withdraw-title {
font-size: 28rpx;
font-weight: 400;
color: $uni-white;
}
.withdraw-amount {
font-size: 28rpx;
font-weight: 400;
@ -330,6 +353,7 @@
color: $uni-primary;
}
}
.withdraw-amount-tip {
font-size: 28rpx;
font-weight: 400;
@ -347,8 +371,10 @@
font-weight: bold;
color: $uni-white;
opacity: 1;
border-bottom: 2rpx solid $uni-secondary-color;;
border-bottom: 2rpx solid $uni-secondary-color;
;
}
.input-box .input-value {
flex: 1 auto;
margin-left: 10rpx;
@ -362,12 +388,14 @@
flex-wrap: wrap;
text-align: center;
}
.withdraw-account-list {
width: 590rpx;
padding: 40rpx;
background: $uni-bg-base-color;
border-radius: 10rpx;
}
.tl-title-margin {
margin: 20rpx 0;
}
@ -382,10 +410,14 @@
.tl-text {
width: 450rpx;
display: -webkit-box; /*弹性伸缩盒子模型显示*/
-webkit-box-orient: vertical; /*排列方式*/
-webkit-line-clamp: 1; /*显示文本行数(这里控制多少行隐藏)*/
overflow: hidden; /*溢出隐藏*/
display: -webkit-box;
/*弹性伸缩盒子模型显示*/
-webkit-box-orient: vertical;
/*排列方式*/
-webkit-line-clamp: 1;
/*显示文本行数(这里控制多少行隐藏)*/
overflow: hidden;
/*溢出隐藏*/
}
.withdrawBox {
@ -421,5 +453,4 @@
.withdraw-btn {
color: $uni-btn-text-color;
}
</style>

20
pages/index/upload/upload.vue

@ -205,11 +205,13 @@
},
//
selectHandler(e){
console.log(e,1111)
if (!e.tempFiles) {
return;
}
let that = this;
that.fileList = [...that.fileList, ...e.tempFilePaths];
console.log(that.fileList,333)
//
if(that.uploadedNum >= 50){
uni.showModal({
@ -251,17 +253,19 @@
title: "上传中"
});
const tempFilePaths = e;
console.log(tempFilePaths,111)
for (var i = 0; i < tempFilePaths.length; i++) {
//const tempFile = e.tempFiles[i];
const [error, res] = await uni.uploadFile({
url: `${that.$baseURL}${that.$uploadURL}`,
name: `${that.$uploadType}`,
// url: 'http://pc2zer.natappfree.cc/file/uploadBatch',
// name: 'files',
filePath: tempFilePaths[i],
name: `files`,
formData: {
fileType:that.typeCurrent + 1
},
header:{
"Content-Type": "multipart/form-data"
"Content-Type": "multipart/form-data",
},
filePath: tempFilePaths[i],
// success:(uploadFileRes) => {
// // uni.hideLoading();
// const back = JSON.parse(uploadFileRes.data);
@ -279,9 +283,9 @@
// uni.hideLoading();
// }
});
const back = JSON.parse(res.data);
if (back.code == 200) {
that.imgList.push(back.data);
const {data,code} = JSON.parse(res.data);
if (code == 200) {
that.imgList.push(data[0])
}
}

Loading…
Cancel
Save