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

6
pages-userInfo/withdraw/withdrawDetail.vue

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

163
pages/index/upload/upload.vue

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

Loading…
Cancel
Save