Browse Source

fix 提现界面、上传界面

feature-1.0
da da 3 years ago
parent
commit
379bff350d
  1. 2
      main.js
  2. 133
      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;

133
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 {
@ -70,14 +76,13 @@
amt: '',
userInfo: {},
checkFlag: false,
noClick:true, //
creatorAccountList:[],
noClick: true, //
creatorAccountList: [],
accountNo: '',
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,11 +126,26 @@
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'){
if (param.isUse === '1') {
that.accountNo = param.accountNo;
that.accountRealNo = param.accountRealNo;
that.type = param.type;
@ -148,13 +168,13 @@
},
//1
checkAmt:function(){
checkAmt: function() {
let that = this;
if(parseFloat(that.amt) > parseFloat(that.userInfo.amt)){
if (parseFloat(that.amt) > parseFloat(that.userInfo.amt)) {
that.checkFlag = true;
}else if(parseFloat(that.amt) < parseFloat(1)){
} else if (parseFloat(that.amt) < parseFloat(1)) {
that.checkFlag = true;
}else{
} else {
that.checkFlag = false;
}
},
@ -164,44 +184,44 @@
that.amt = that.userInfo.amt;
},
//
async withdraw(){
async withdraw() {
let that = this;
console.log('点击了提现,金额为',that.type)
if(that.amt == null || that.amt == ''){
console.log('点击了提现,金额为', that.type)
if (that.amt == null || that.amt == '') {
uni.showModal({
content: '请输入提现金额!',
showCancel: false
});
}
if(that.checkFlag == true){
if (that.checkFlag == true) {
//console.log('that.checkFlag',that.checkFlag)
uni.showModal({
content: '输入金额超过或少于可提现余额!',
showCancel: false
});
}else{
} else {
//
const param = {
creatorId: that.userInfo.id,
amt: that.amt
}
const checkRes = await checkWithdraw(param);
if(checkRes.data.code === 200){
if (checkRes.data.code === 200) {
//true
if(checkRes.data.data === true){
if (checkRes.data.data === true) {
const withdrawParam = {
creatorId: that.userInfo.id,
amt: that.amt,
accountNo: that.accountRealNo,
channel: that.type
}
console.log('withdrawParam',withdrawParam)
console.log('withdrawParam', withdrawParam)
const withdrawRes = await withdraw(withdrawParam);
if(withdrawRes.data.code === 200){
if (withdrawRes.data.code === 200) {
//
const creatorInfo = await getCreatorInfo(that.userInfo.id);
console.log('creatorInfo',creatorInfo)
if(creatorInfo.data.code === 200){
console.log('creatorInfo', creatorInfo)
if (creatorInfo.data.code === 200) {
uni.setStorage({
key: 'userInfo',
data: creatorInfo.data.data,
@ -218,7 +238,7 @@
});
}
})
}else{
} else {
uni.showModal({
content: '获取艺术家信息失败!',
showCancel: false
@ -226,20 +246,20 @@
}
}else{
} else {
uni.showModal({
content: '发起提现申请失败!',
showCancel: false
});
}
}else{
} else {
//
uni.showModal({
content: '输入金额超过或少于可提现余额!',
showCancel: false
});
}
}else{
} else {
uni.showModal({
content: '检查艺术家是否可提现失败!',
showCancel: false
@ -307,18 +327,21 @@
}
}
.withdraw-input-box{
.withdraw-input-box {
width: 590rpx;
padding: 40rpx;
background: $uni-bg-base-color;
border-radius: 10rpx;
}
.withdraw-title{
.withdraw-title {
font-size: 28rpx;
font-weight: 400;
color: $uni-white;
}
.withdraw-amount{
.withdraw-amount {
font-size: 28rpx;
font-weight: 400;
color: $uni-secondary-color;
@ -330,7 +353,8 @@
color: $uni-primary;
}
}
.withdraw-amount-tip{
.withdraw-amount-tip {
font-size: 28rpx;
font-weight: 400;
color: $uni-white;
@ -347,32 +371,36 @@
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;
height: 80rpx;
}
.tl-flex-row{
.tl-flex-row {
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
text-align: center;
}
.withdraw-account-list{
.withdraw-account-list {
width: 590rpx;
padding: 40rpx;
background: $uni-bg-base-color;
border-radius: 10rpx;
}
.tl-title-margin{
.tl-title-margin {
margin: 20rpx 0;
}
.error-message{
.error-message {
font-size: 26rpx;
font-weight: 400;
color: #E04646;
@ -380,15 +408,19 @@
}
.tl-text{
.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{
.withdrawBox {
display: flex;
justify-content: space-between;
align-items: center;
@ -414,12 +446,11 @@
}
}
.tl-footer{
.tl-footer {
margin-top: 120rpx;
}
.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