Compare commits

...

3 Commits

  1. 2
      pages-userInfo/withdraw/withdraw.vue
  2. 6
      pages-userInfo/withdraw/withdrawDetail.vue
  3. 163
      pages/index/upload/upload.vue

2
pages-userInfo/withdraw/withdraw.vue

@ -11,7 +11,7 @@
<span>当前余额为{{userInfo.amt}}</span> <span>当前余额为{{userInfo.amt}}</span>
<span class="all-withdraw" v-if="userInfo.amt > 0" @click="allWithdraw">全部提现</span> <span class="all-withdraw" v-if="userInfo.amt > 0" @click="allWithdraw">全部提现</span>
</view> </view>
<view class="withdraw-amount-tip">小贴士提现金额不少于1元 </view> <view class="withdraw-amount-tip">小贴士提现金额不少于1元,手续费为6% </view>
</view> </view>
<view class="error-message" v-if="checkFlag == true">输入金额超过或少于可提现余额</view> <view class="error-message" v-if="checkFlag == true">输入金额超过或少于可提现余额</view>

6
pages-userInfo/withdraw/withdrawDetail.vue

@ -12,9 +12,13 @@
<text>{{withdrawDetailInfo.accountNo || ''}}</text> <text>{{withdrawDetailInfo.accountNo || ''}}</text>
</view> </view>
<view class="box"> <view class="box">
<text class="title">提现金额:</text> <text class="title">提现金额:</text>
<MoneyView :character="'¥'" :size="26" :value="withdrawDetailInfo.amt || 0" :color="'#0b6375'"/> <MoneyView :character="'¥'" :size="26" :value="withdrawDetailInfo.amt || 0" :color="'#0b6375'"/>
</view> </view>
<view class="box">
<text class="title">手续费:</text>
<MoneyView :character="'¥'" :size="26" :value="withdrawDetailInfo.fee || 0" :color="'#ff0000'"/>
</view>
<view class="box"> <view class="box">
<text class="title">渠道:</text> <text class="title">渠道:</text>
<text>{{ setChannel(withdrawDetailInfo.channel) || ''}}</text> <text>{{ setChannel(withdrawDetailInfo.channel) || ''}}</text>

163
pages/index/upload/upload.vue

@ -4,28 +4,23 @@
</uni-section> </uni-section>
<view class="section-content"> <view class="section-content">
<view class="type-choice-comp"> <view class="type-choice-comp">
<view class="type-item uni-secondary-color" v-for="(val, i) in typeList" <view class="type-item uni-secondary-color" v-for="(val, i) in typeList" :index="i" :key="i"
:index="i" :key="i"
:class="typeCurrent === i ? 'type-active' : ''" :class="typeCurrent === i ? 'type-active' : ''"
@click="$noMultipleClicks(onClickType,{currentIndex: i})"> @click="$noMultipleClicks(onClickType,{currentIndex: i})">
<view class="type-text">{{val}}</view> <view class="type-text">{{val}}</view>
</view> </view>
</view> </view>
<uni-file-picker limit="9" title="最多选择9张图片" <uni-file-picker ref="filePicker" limit="9" title="最多选择9张图片" :file-extname="fileExtname" mode="grid"
:file-extname="fileExtname" mode="grid" file-mediatype="image" @success="successHandler" @fail="failHandler" @delete="deleteHandler"
file-mediatype="image" :autoUpload="false" @select="selectHandler" :disabled="checkUpload">
@success="successHandler"
@fail="failHandler"
@delete="deleteHandler"
:autoUpload="false"
@select="selectHandler"
:disabled="checkUpload">
</uni-file-picker> </uni-file-picker>
<view class="uploadNum">今日还可上传次数<span class="uploadText"> {{ getUploadNum }} </span>已上传次数<span class="uploadText"> {{ uploadedNum }} </span></view> <view class="uploadNum">今日还可上传次数<span class="uploadText"> {{ getUploadNum }} </span>已上传次数<span
class="uploadText"> {{ uploadedNum }} </span></view>
</view> </view>
<uni-section title="是否原创" subTitle="非原创则视为网络图片" type="circle"> <uni-section title="是否原创" subTitle="非原创则视为网络图片" type="circle">
<view class="original-item-list"> <view class="original-item-list">
<uni-data-checkbox multiple v-model="original" :localdata="originalList" :selectedColor="primaryColor" :selectedTextColor="primaryColor"></uni-data-checkbox> <uni-data-checkbox multiple v-model="original" :localdata="originalList" :selectedColor="primaryColor"
:selectedTextColor="primaryColor"></uni-data-checkbox>
</view> </view>
</uni-section> </uni-section>
<view class="sign-box"> <view class="sign-box">
@ -39,20 +34,26 @@
<view class="section-content"> <view class="section-content">
<view class="segmented-control"> <view class="segmented-control">
<uni-data-checkbox mode="tag" multiple v-model="signListSelected" :localdata="signList" @change="selectedSign" max="3" class="check-box"></uni-data-checkbox> <uni-data-checkbox mode="tag" multiple v-model="signListSelected" :localdata="signList"
@change="selectedSign" max="3" class="check-box"></uni-data-checkbox>
</view> </view>
</view> </view>
<button class="upLoadBtn" size="default" :loading="loadingFlag" @click="$noMultipleClicks(commit)" :disabled="checkUpload" >点击上传</button> <button class="upLoadBtn" size="default" :loading="loadingFlag" @click="$noMultipleClicks(commit)"
:disabled="checkUpload">点击上传</button>
</view> </view>
</template> </template>
<script> <script>
import { import {
getSignList,listType,insertTiktokImg,queryUploadNum getSignList,
listType,
insertTiktokImg,
queryUploadNum
} from '@/api/index.js' } from '@/api/index.js'
import { import {
deleteFile,uploadBatch deleteFile,
uploadBatch
} from '@/api/common.js' } from '@/api/common.js'
export default { export default {
data() { data() {
@ -62,21 +63,22 @@
typeCurrent: 0, typeCurrent: 0,
typeId: 1, typeId: 1,
fileExtname: "png,jpg,jpeg", fileExtname: "png,jpg,jpeg",
signList:[], signList: [],
signObject:{}, signObject: {},
typeList:[], typeList: [],
typeIdList:[], typeIdList: [],
loadingFlag: false, loadingFlag: false,
fileList: [], fileList: [],
imgList:[], imgList: [],
signListSelected:[], signListSelected: [],
userInfo:{}, userInfo: {},
uploadedNum: 0, uploadedNum: 0,
noClick:true, // noClick: true, //
original: [], original: [],
originalList: [ originalList: [{
{text: "原创", value: 1} text: "原创",
] value: 1
}]
} }
}, },
created() { created() {
@ -101,13 +103,13 @@
this.getTypeList(); this.getTypeList();
this.queryUploadNum(); this.queryUploadNum();
}, },
computed:{ computed: {
// //
getUploadNum(){ getUploadNum() {
return 50 - this.uploadedNum return 50 - this.uploadedNum
}, },
// //
checkUpload(){ checkUpload() {
return this.uploadedNum >= 50; return this.uploadedNum >= 50;
} }
@ -115,20 +117,20 @@
methods: { methods: {
// //
linkTo(){ linkTo() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/upload/customSign' url: '/pages/index/upload/customSign'
}); });
}, },
// //
async getSignList(){ async getSignList() {
let that = this; let that = this;
const res = await getSignList({}) const res = await getSignList({})
if (res.data.code === 200) { if (res.data.code === 200) {
for (let s of res.data.data) { for (let s of res.data.data) {
let signObject = {} let signObject = {}
signObject.text = "#" +s.name signObject.text = "#" + s.name
signObject.value = s.id signObject.value = s.id
that.signList.push(signObject) that.signList.push(signObject)
} }
@ -142,17 +144,17 @@
}, },
// //
async getTypeList(){ async getTypeList() {
let that = this; let that = this;
const res = await listType({}) const res = await listType({})
if(res.data.code === 200){ if (res.data.code === 200) {
for (let s of res.data.data) { for (let s of res.data.data) {
that.typeList.push(s.typeName); that.typeList.push(s.typeName);
that.typeIdList.push(s.id); that.typeIdList.push(s.id);
} }
//console.log('',that.typeList) //console.log('',that.typeList)
//console.log('id',that.typeIdList) //console.log('id',that.typeIdList)
}else{ } else {
uni.showModal({ uni.showModal({
content: '分类列表加载失败!', content: '分类列表加载失败!',
showCancel: false showCancel: false
@ -161,16 +163,16 @@
}, },
// //
async queryUploadNum(){ async queryUploadNum() {
let that = this; let that = this;
const checkParam = { const checkParam = {
creatorId: that.userInfo.id creatorId: that.userInfo.id
} }
const res = await queryUploadNum(checkParam); const res = await queryUploadNum(checkParam);
// console.log(res) // console.log(res)
if(res.data.code === 200){ if (res.data.code === 200) {
that.uploadedNum = res.data.data; that.uploadedNum = res.data.data;
}else{ } else {
uni.showModal({ uni.showModal({
content: '获取艺术家上传次数失败!', content: '获取艺术家上传次数失败!',
showCancel: false showCancel: false
@ -178,7 +180,7 @@
} }
}, },
// //
onClickType(e2){ onClickType(e2) {
let that = this; let that = this;
that.flag = false; that.flag = false;
that.typeCurrent = e2.currentIndex; that.typeCurrent = e2.currentIndex;
@ -194,26 +196,35 @@
}, },
// //
selectedSign(e){ selectedSign(e) {
let that = this; let that = this;
that.signListSelected = e.detail.value; that.signListSelected = e.detail.value;
//console.log('that.signListSelected'+that.signListSelected); //console.log('that.signListSelected'+that.signListSelected);
}, },
// //
successHandler(e){ successHandler(e) {
// console.log(''+e) // console.log(''+e)
}, },
// //
selectHandler(e){ selectHandler(e) {
console.log(e,1111) const maxSize = 5 * 1024 * 1024
if (!e.tempFiles) { if (!e.tempFiles) {
return; return;
} }
let current_file = e.tempFiles[0]
if(current_file.size > maxSize){
uni.showModal({
content: "当前文件大小超过5mb,请重新选择小雨5mb的文件进行上传!",
showCancel: false
});
const index = this.$refs.filePicker.files.indexOf(current_file);
this.$refs.filePicker.files.splice(index, 1);
return
}
let that = this; let that = this;
that.fileList = [...that.fileList, ...e.tempFilePaths]; that.fileList = [...that.fileList, ...e.tempFilePaths];
console.log(that.fileList,333)
// //
if(that.uploadedNum >= 50){ if (that.uploadedNum >= 50) {
uni.showModal({ uni.showModal({
content: "当日已达上传图片上限,请明日再来!", content: "当日已达上传图片上限,请明日再来!",
showCancel: false showCancel: false
@ -223,11 +234,11 @@
// that.uploadHandler(e.tempFilePaths) // that.uploadHandler(e.tempFilePaths)
}, },
// //
failHandler(e){ failHandler(e) {
// console.log(''+e) // console.log(''+e)
}, },
// //
deleteHandler(e){ deleteHandler(e) {
// console.log('',e.tempFile.url) // console.log('',e.tempFile.url)
// //
let that = this; let that = this;
@ -247,13 +258,12 @@
that.uploadHandler(that.fileList); that.uploadHandler(that.fileList);
}, },
// //
uploadHandler: async function(e){ uploadHandler: async function(e) {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "上传中" title: "上传中"
}); });
const tempFilePaths = e; const tempFilePaths = e;
console.log(tempFilePaths,111)
for (var i = 0; i < tempFilePaths.length; i++) { for (var i = 0; i < tempFilePaths.length; i++) {
//const tempFile = e.tempFiles[i]; //const tempFile = e.tempFiles[i];
const [error, res] = await uni.uploadFile({ const [error, res] = await uni.uploadFile({
@ -261,9 +271,9 @@
filePath: tempFilePaths[i], filePath: tempFilePaths[i],
name: `files`, name: `files`,
formData: { formData: {
fileType:that.typeCurrent + 1 fileType: that.typeCurrent + 1
}, },
header:{ header: {
"Content-Type": "multipart/form-data", "Content-Type": "multipart/form-data",
}, },
// success:(uploadFileRes) => { // success:(uploadFileRes) => {
@ -283,7 +293,10 @@
// uni.hideLoading(); // uni.hideLoading();
// } // }
}); });
const {data,code} = JSON.parse(res.data); const {
data,
code
} = JSON.parse(res.data);
if (code == 200) { if (code == 200) {
that.imgList.push(data[0]) that.imgList.push(data[0])
} }
@ -293,10 +306,10 @@
}, },
// //
saveImg(){ saveImg() {
let that = this; let that = this;
// //
if(that.imgList.length === 0){ if (that.imgList.length === 0) {
uni.showModal({ uni.showModal({
content: "请选择图片上传!", content: "请选择图片上传!",
showCancel: false, showCancel: false,
@ -304,12 +317,12 @@
return; return;
} }
// //
if(that.uploadedNum >= 50){ if (that.uploadedNum >= 50) {
uni.showModal({ uni.showModal({
content: "当日已达上传图片上限,请明日再来!", content: "当日已达上传图片上限,请明日再来!",
showCancel: false showCancel: false
}); });
}else{ } else {
const param = { const param = {
creatorId: that.userInfo.id, creatorId: that.userInfo.id,
imgUrl: that.imgList, imgUrl: that.imgList,
@ -318,15 +331,15 @@
typeId: that.typeId, typeId: that.typeId,
isOriginal: that.original?.length > 0 ? 1 : 0 isOriginal: that.original?.length > 0 ? 1 : 0
} }
insertTiktokImg(param).then(res =>{ insertTiktokImg(param).then(res => {
// console.log('res',res) // console.log('res',res)
if(res.data.code === 200){ if (res.data.code === 200) {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: '上传成功!', title: '上传成功!',
duration: 2000, duration: 2000,
success:function(){ success: function() {
setTimeout(function () { setTimeout(function() {
// //
that.imgList = [] that.imgList = []
that.signListSelected = [] that.signListSelected = []
@ -337,7 +350,7 @@
}, 2000); }, 2000);
} }
}); });
}else { } else {
uni.hideLoading(); uni.hideLoading();
uni.showModal({ uni.showModal({
content: "艺术家图片上传失败!", content: "艺术家图片上传失败!",
@ -393,27 +406,27 @@
} }
.sign-box{ .sign-box {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
width:750rpx; width: 750rpx;
.sign-item{ .sign-item {
z-index: 0; z-index: 0;
width: 300rpx; width: 300rpx;
} }
.sign-item-box{ .sign-item-box {
margin-right: 50rpx; margin-right: 50rpx;
margin-top: 15rpx; margin-top: 15rpx;
z-index: 0; z-index: 0;
.sign-item-tag{ .sign-item-tag {
color: #fff; color: #fff;
} }
.custom-sign{ .custom-sign {
z-index: 0; z-index: 0;
} }
} }
@ -441,9 +454,7 @@
border-radius: 20rpx; border-radius: 20rpx;
flex-shrink: 0; flex-shrink: 0;
.type-text { .type-text {}
}
} }
@ -468,17 +479,18 @@
::v-deep .file-picker__box-content { ::v-deep .file-picker__box-content {
border-color: $uni-secondary-color !important; border-color: $uni-secondary-color !important;
} }
::v-deep .icon-add { ::v-deep .icon-add {
background-color: $uni-secondary-color !important; background-color: $uni-secondary-color !important;
} }
.uploadNum{ .uploadNum {
color: $uni-white; color: $uni-white;
font-size: 24rpx; font-size: 24rpx;
margin-top: 20rpx; margin-top: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.uploadText{ .uploadText {
color: $uni-primary; color: $uni-primary;
font-weight: 600; font-weight: 600;
} }
@ -510,7 +522,7 @@
} }
.upLoadBtn{ .upLoadBtn {
width: 654rpx; width: 654rpx;
height: 100rpx; height: 100rpx;
line-height: 100rpx; line-height: 100rpx;
@ -523,5 +535,4 @@
} }
} }
</style> </style>

Loading…
Cancel
Save