第一次提交

This commit is contained in:
gxwebsoft
2023-08-04 13:14:48 +08:00
commit 1b923e5cff
1030 changed files with 128016 additions and 0 deletions

358
sub_pages/withdraw/log/log.vue Executable file
View File

@@ -0,0 +1,358 @@
<template>
<view class="wallet">
<!-- <view class="select-date" @click="openCalendar">
<u-icon class="icon" size="22" name="calendar"></u-icon>
<text v-if="createTimeStart && createTimeEnd">{{ createTimeStart }} ~ {{ createTimeEnd }}</text>
</view> -->
<view class="order" v-for="(item,index) in list" :key="index">
<view class="fenqi">
<block>
<view class="item">
<view class="goods-info">
<view class="goods-name">
<text class="name" v-if="item.applyStatus == 10">待审核</text>
<text class="name" v-if="item.applyStatus == 20">审核通过</text>
<text class="name" v-if="item.applyStatus == 30">已驳回</text>
<text class="name" v-if="item.applyStatus == 40">已打款</text>
<text class="selling-point">{{ item.createTime }}</text>
</view>
<view class="goods-price">
<!-- <text class="add-price"
v-if="item.scene == 10 || item.scene == 40">+{{ item.money }}</text>
<text class="sub-price" v-if="item.scene == 20">-{{ item.money }}</text>
<block v-if="item.scene == 30">
<text class="add-price" v-if="item.money > 0">+{{ item.money }}</text>
<text class="sub-price" v-else>-{{ Math.abs(item.money) }}</text>
</block> -->
<text class="num">{{ item.money }}</text>
</view>
</view>
</view>
</block>
</view>
</view>
<u-empty mode="order" icon="http://cdn.uviewui.com/uview/empty/car.png" text="暂无提现记录" v-if="list.length == 0">
</u-empty>
<u-calendar :show="show" mode="range" :minDate="minDate" @confirm="changeDate"
@close="closeShow"></u-calendar>
</view>
</template>
<script>
import {
dateFormat
} from '@/utils/util.js'
import store from '@/store';
import * as LogApi from '@/api/merchant-withdraw.js'
const userId = uni.getStorageSync('userId')
export default {
data() {
return {
list: [],
record: {},
userInfo: {},
deliveryTime: dateFormat('YYYY-mm-dd', new Date()),
createTimeStart: null,
createTimeEnd: null,
// 正在加载中
isLoading: true,
// 当前选择的设备ID
show: false,
minDate: '',
isLogin: false,
merchant: {
// 总收益
totalMoney: 0.00,
// 当前可提现金额
money: 0.00,
// 今日收益
todayMoney: 0.00,
// 本月收益
monthMoney: 0.00
}
}
},
onLoad(option) {
const app = this
app.minDate = uni.$u.timeFormat(new Date().getTime() - 2592000000 * 2, 'yyyy-mm-dd');
},
onShow() {
// 查询报餐信息
this.getLog()
},
methods: {
// 获取购物车数据
getLog() {
const app = this
const {
deliveryTime,
createTimeStart,
createTimeEnd
} = this
const userId = uni.getStorageSync('userId')
LogApi.pageMerchantWithdraw({
userId,
createTimeStart: createTimeStart ? createTimeStart + ' 00:00:00' : '',
createTimeEnd: createTimeEnd ? createTimeEnd + ' 23:59:59' : '',
limit: 50,
page: 1
}).then(res => {
app.list = res.data.list
})
},
getUserInfo() {
const app = this
uni.getSystemInfo({
success(data) {
if (data) {
app.statusBarHeight = data.statusBarHeight + 50
}
}
})
getUser().then(res => {
if (res.code == 0 && res.data.username != 'www') {
app.userInfo = res.data
app.isLogin = true
} else {
app.isLogin = false
}
})
},
getMerchant(){
const app = this
MerchantApi.listMerchant({
userId
}).then(res => {
console.log("res: ",res);
if(res.data.length > 0){
app.merchant = res.data[0]
}
})
},
changeDate(date) {
console.log("date: ", date[0]);
console.log("date.lenght: ", date.length);
// this.deliveryTime = date.result
this.createTimeStart = date[0]
this.createTimeEnd = date[date.length - 1]
this.getLog()
this.show = false
},
change(e) {
console.log(e);
},
openCalendar() {
this.show = true
},
closeShow(){
this.show = false
}
}
}
</script>
<style lang="scss" scoped>
.wallet {
background-color: #f3f3f3;
padding-top: 42rpx;
}
.order {
background-color: #ffffff;
border-radius: 12rpx;
width: 700rpx;
margin: 20rpx auto;
padding: 10rpx 0;
.title {
font-weight: bold;
font-size: 30rpx;
padding: 20rpx;
display: flex;
justify-content: space-between;
}
.xieyi {
padding: 20rpx;
font-size: 26rpx;
}
}
.fenqi {
padding: 10rpx 30rpx;
font-size: 26rpx;
.item {
display: flex;
padding: 10rpx 0;
.image {
width: 160rpx;
height: 120rpx;
}
.goods-info {
width: 700rpx;
margin-left: 10rpx;
display: flex;
justify-content: space-between;
.goods-name {
text-align: left;
display: flex;
flex-direction: column;
.name {
font-weight: 500;
max-width: 300rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden; //溢出内容隐藏
text-overflow: ellipsis; //文本溢出部分用省略号表示
display: -webkit-box; //特别显示模式
-webkit-line-clamp: 2; //行数
line-clamp: 2;
-webkit-box-orient: vertical; //盒子中内容竖直排列
}
.selling-point {
max-width: 400rpx;
color: #999999;
text-overflow: -o-ellipsis-lastline;
overflow: hidden; //溢出内容隐藏
text-overflow: ellipsis; //文本溢出部分用省略号表示
display: -webkit-box; //特别显示模式
-webkit-line-clamp: 1; //行数
line-clamp: 1;
-webkit-box-orient: vertical; //盒子中内容竖直排列
}
}
.goods-price {
display: flex;
flex-direction: column;
.add-price {
color: #27b900;
}
.sub-price {
color: #ff0000;
}
.num {
text-align: right;
color: #ff0000;
}
}
}
}
}
.select-date {
text-align: center;
font-size: 28rpx;
padding: 12rpx 0;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
.icon {
margin-right: 10rpx;
}
}
.on-buy {
background-color: #804002;
}
.user-card {
width: 700rpx;
height: 260rpx;
margin: 30rpx auto;
border-radius: 24rpx;
background: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%221%22%20x1%3D%220%22%20x2%3D%221%22%20y1%3D%220%22%20y2%3D%220%22%20gradientTransform%3D%22matrix(6.123233995736766e-17%2C%201%2C%20-0.024693877551020406%2C%206.123233995736766e-17%2C%200.5%2C%200)%22%3E%3Cstop%20stop-color%3D%22%230a060d%22%20stop-opacity%3D%221%22%20offset%3D%220%22%3E%3C%2Fstop%3E%3Cstop%20stop-color%3D%22%23660061%22%20stop-opacity%3D%221%22%20offset%3D%220.95%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22url(%231)%22%3E%3C%2Frect%3E%3C%2Fsvg%3E');
.user-info {
padding: 40rpx;
position: relative;
.avatar {
display: flex;
align-items: center;
color: #ffffff;
.avatar-img {
border: 4rpx solid #ffffff;
}
.user {
margin-left: 15rpx;
.nickname {
font-size: 34rpx;
}
.desc {
font-size: 26rpx;
color: #b2b2b2;
}
}
image {
border: 4rpx solid #ffffff;
}
}
.buy-log {
position: absolute;
z-index: 999;
text-align: center;
top: 50rpx;
right: 40rpx;
font-size: 24rpx;
padding: 5rpx 20rpx;
border-radius: 12rpx 0 12rpx 0;
background-color: #f3f3f3;
}
}
}
// 我的收益
.my-profit {
background: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%221%22%20x1%3D%220%22%20x2%3D%221%22%20y1%3D%220%22%20y2%3D%220%22%20gradientTransform%3D%22matrix(6.123233995736766e-17%2C%201%2C%20-0.024693877551020406%2C%206.123233995736766e-17%2C%200.5%2C%200)%22%3E%3Cstop%20stop-color%3D%22%230a060d%22%20stop-opacity%3D%221%22%20offset%3D%220%22%3E%3C%2Fstop%3E%3Cstop%20stop-color%3D%22%23660061%22%20stop-opacity%3D%221%22%20offset%3D%220.95%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22url(%231)%22%3E%3C%2Frect%3E%3C%2Fsvg%3E');
display: flex;
align-items: center;
justify-content: space-around;
color: #ffffff;
margin: 0 auto;
padding: 22rpx 0;
width: 700rpx;
height: 140rpx;
box-shadow: 0 1rpx 5rpx 0px #eaebec;
border-radius: 24rpx;
.item {
text-align: center;
.profit {
font-size: 38rpx;
font-weight: 500;
color: #ffffff;
}
.desc {
font-size: 24rpx;
color: #d8d9dc;
}
}
}
</style>

View File

@@ -0,0 +1,291 @@
<template>
<view class="container">
<view class="form">
<u--form :model="form" ref="uForm" :rules="rules" label-width="170rpx">
<u-gap height="10" bgColor="#f3f3f3"></u-gap>
<view class="block">
<u-form-item label="提现金额" prop="amount" borderBottom>
<u-input v-model="form.amount" maxlength="20" :disabled="isEdit"
:placeholder="`可提现金额¥${form.money ? form.money : 0}`" />
</u-form-item>
<u-form-item label="服务费" prop="serviceFee" borderBottom v-if="form.amount > 0">
<span class="service-fee">本次提现服务费{{ form.amount * 0.04 }}, 实际到账{{form.amount - (form.amount * 0.04)}}</span>
</u-form-item>
</view>
<u-gap height="10" bgColor="#f3f3f3"></u-gap>
<view class="block">
<u-form-item label="打款方式" prop="payType" borderBottom @click="showPayType">
<span class="service-fee">{{ payType }}</span>
</u-form-item>
<u-form-item label="支付宝姓名" prop="alipayName" borderBottom v-if="payType == '支付宝'">
<u-input v-model="form.alipayName" maxlength="20" :disabled="isEdit" placeholder="支付宝姓名" />
</u-form-item>
<u-form-item label="支付宝账号" prop="alipayAccount" borderBottom v-if="payType == '支付宝'">
<u-input v-model="form.alipayAccount" maxlength="20" :disabled="isEdit" placeholder="支付宝账号" />
</u-form-item>
<u-form-item label="银行开户名" prop="bankName" borderBottom v-if="payType == '银行卡'">
<u-input v-model="form.bankName" maxlength="20" :disabled="isEdit" placeholder="银行开户名" />
</u-form-item>
<u-form-item label="银行开户名" prop="bankAccount" borderBottom v-if="payType == '银行卡'">
<u-input v-model="form.bankAccount" maxlength="20" :disabled="isEdit" placeholder="银行卡开户名" />
</u-form-item>
<u-form-item label="银行卡号" prop="bankCard" borderBottom v-if="payType == '银行卡'">
<u-input v-model="form.bankCard" maxlength="20" :disabled="isEdit" placeholder="银行卡号" />
</u-form-item>
</view>
<u-gap height="10" bgColor="#f3f3f3"></u-gap>
<view class="block">
<view class="desc-title">提现说明</view>
<view class="desc">提交成功后可<text @click="$push('sub_pages/withdraw/log/log')">点击这里</text>查看打款进度</view>
<!-- <view class="photo">
<image src="https://file.wsdns.cn/20230619/29a8c790211a46529fbbb66ee8d223d5.png"
mode="widthFix"></image>
</view> -->
</view>
</u--form>
</view>
<view class="btn-wrapper">
<u-button :text="submitText" color="linear-gradient(to bottom, #010002, #681752)" :disabled="isEdit"
shape="circle" @click="handleSubmit()"></u-button>
</view>
</view>
</template>
<script>
import * as MerchantApi from '@/api/merchant.js'
const userId = uni.getStorageSync('userId')
export default {
data() {
return {
form: {
amount: undefined,
alipayName: '',
alipayAccount: '',
payType: 20, // 打款方式 10微信 20支付宝 30银行卡
},
payType: '支付宝',
fileList1: [],
disabled: false,
// 临时图片 (用于上传)
tempFile: null,
isEdit: false,
rules: {
'alipayName': {
type: 'string',
required: true,
message: '请填写支付宝姓名',
trigger: ['blur', 'change']
},
'alipayAccount': {
type: 'string',
required: true,
message: '请填写支付宝账号',
trigger: ['blur', 'change']
},
'amount': {
type: 'string',
required: true,
message: '请填写提现金额',
trigger: ['blur', 'change']
}
},
submitText: '提交申请'
}
},
onLoad() {
this.getData()
},
onReady() {
//如果需要兼容微信小程序并且校验规则中含有方法等只能通过setRules方法设置规则。
this.$refs.uForm.setRules(this.rules)
},
methods: {
getData() {
const app = this
MerchantApi.listMerchant({
userId
}).then(res => {
if (res.data) {
app.form = res.data[0]
}
})
},
showPayType() {
const app = this
if(this.isEdit == true){
return false;
}
const itemList = ['支付宝','银行卡'];
uni.showActionSheet({
itemList,
success: ({tapIndex}) => {
app.payType = itemList[tapIndex]
}
})
},
// 新增图片
async afterRead(event) {
console.log("event: ", event);
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result.url,
thumb: result.thumbUrl
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
UploadApi.uploadFile({
filePath: url,
fileType: 'image',
name: 'file',
header: {
Authorization: uni.getStorageSync('AccessToken')
},
}).then(result => {
setTimeout(() => {
resolve(result.data)
}, 1000)
}).catch(err => {
console.log("err: ", err);
})
})
},
// 删除图片
deletePic(event) {
if (this.isEdit == true) {
return false;
}
this[`fileList${event.name}`].splice(event.index, 1)
},
// 确认修改
async handleSubmit() {
const app = this
const { form,payType } = this
if(form.amount > form.money){
app.$error('可提现金额不足')
return false
}
if(form.amount == 0){
app.$error('提现金额不正确')
return false
}
if(payType == '支付宝'){
app.form.payType = 20
}
if(payType == '银行卡'){
app.form.payType = 30
}
if (app.disabled === true) return
uni.showLoading({
mask: true,
title: "正在验证"
})
app.$refs.uForm.validate().then(res => {
MerchantApi.addWithdraw(app.form).then(result => {
app.$success('提交成功')
this.getData()
}).catch(err => {
app.$error(err.message)
}).finally(() => {
uni.hideLoading()
})
}).catch(errors => {
uni.$u.toast('校验失败')
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f3f3f3;
}
.container {
.form {
background-color: #ffffff;
}
.block {
margin: auto;
width: 700rpx;
font-size: 28rpx;
.upload {
width: 360rpx;
margin: 0 auto;
padding: 20rpx 0;
justify-content: center;
.id-card-upload {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
margin: 10rpx auto;
color: #cccccc;
border: 5rpx dashed #d9d9d9;
border-radius: 20rpx;
width: 360rpx;
height: 220rpx;
.photograph {
width: 60rpx;
}
}
}
.desc-title {
line-height: 3rem;
}
.desc {
color: #999999;
padding-bottom: 20rpx;
text {
color: #7f006f;
}
}
}
}
.btn-wrapper {
background: none;
width: 360rpx;
margin: 50rpx auto;
// display: flex;
// align-items: center;
padding: 0 20rpx;
}
.service-fee{
line-height: 2rem;
color: #7f006f;
}
.pay-type{
line-height: 2rem;
}
</style>