优化绑定功能按钮显示
This commit is contained in:
@@ -8,7 +8,7 @@ const api = {
|
||||
express: 'order/express',
|
||||
cancel: 'order/cancel',
|
||||
extractQrcode: 'order/extractQrcode',
|
||||
receipt: 'order/receipt',
|
||||
receipt: '/open/equipment/receipt',
|
||||
pay: 'order/pay'
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ const api = {
|
||||
list: '/shop/profit-log/page',
|
||||
}
|
||||
|
||||
// 商品评价列表
|
||||
// 收益列表
|
||||
export const list = (params, option) => {
|
||||
return http.get(api.list, {params}, option)
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ import Enum from '../enum'
|
||||
export default new Enum([
|
||||
{ key: 'NOT_DELIVERED', name: '未发货', value: 10 },
|
||||
{ key: 'DELIVERED', name: '已发货', value: 20 },
|
||||
{ key: 'ACCEPT', name: '已绑定', value: 20 }
|
||||
{ key: 'ACCEPT', name: '已绑定', value: 40 }
|
||||
])
|
||||
|
||||
@@ -7,5 +7,4 @@ import Enum from '../enum'
|
||||
export default new Enum([
|
||||
{ key: 'NOT_RECEIVED', name: '未收货', value: 10 },
|
||||
{ key: 'RECEIVED', name: '已收货', value: 20 },
|
||||
{ key: 'BINDED', name: '已绑定', value: 40 },
|
||||
])
|
||||
|
||||
12
package-lock.json
generated
12
package-lock.json
generated
@@ -5,6 +5,8 @@
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-ui": "^1.4.28",
|
||||
"async-validator": "^4.2.5",
|
||||
"dayjs": "^1.11.10",
|
||||
"luch-request": "^3.0.8"
|
||||
},
|
||||
@@ -18,6 +20,16 @@
|
||||
"resolved": "https://registry.npmjs.org/@dcloudio/types/-/types-2.6.12.tgz",
|
||||
"integrity": "sha512-mrCMwcINy1IFjU9VUqLeWBkj404yWs5paLDttBcA+eqUjanuUQbBcTVPqlrGgkyzLXDcV2oDDZRSNxNpXi4kMQ=="
|
||||
},
|
||||
"node_modules/@dcloudio/uni-ui": {
|
||||
"version": "1.4.28",
|
||||
"resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.4.28.tgz",
|
||||
"integrity": "sha512-e/lSbvR79KH9+d3D4ueNbvD6szigjO/5IyjBNmiTqaj0PTS324fBV3L6f3s1qpkYonM4rdOl000hVOcAg6Gh/A=="
|
||||
},
|
||||
"node_modules/async-validator": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz",
|
||||
"integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg=="
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/commander/-/commander-1.1.1.tgz",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-ui": "^1.4.28",
|
||||
"async-validator": "^4.2.5",
|
||||
"dayjs": "^1.11.10",
|
||||
"luch-request": "^3.0.8"
|
||||
},
|
||||
|
||||
16
pages.json
16
pages.json
@@ -69,7 +69,7 @@
|
||||
"path": "pages/merchant/merchant",
|
||||
"style": {
|
||||
"navigationBarTitleText": "附近站点推荐",
|
||||
"enablePullDownRefresh": false
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
|
||||
},
|
||||
@@ -369,11 +369,23 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/dealer/poster",
|
||||
"path": "pages/withdraw/withdraw",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/withdraw/log/log",
|
||||
"style": {
|
||||
"navigationBarTitleText": "提现记录",
|
||||
"enablePullDownRefresh": false,
|
||||
"disableScroll":false,
|
||||
"app-plus" : {
|
||||
"bounce" : "none" // 取消APP端iOS回弹,避免与下拉刷新冲突 (可统一配在 'globalStyle')
|
||||
},
|
||||
"mp-alipay":{"allowsBounceVertical":"NO"} // 取消支付宝和钉钉小程序的iOS回弹,避免与下拉刷新冲突 (可统一配在 'globalStyle')
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/dealer/order",
|
||||
"style": {
|
||||
|
||||
@@ -15,14 +15,12 @@
|
||||
<view class="item-top-right">
|
||||
<text class="state-text" v-if="item.payStatus == 10">待支付</text>
|
||||
<text class="state-text" v-else-if="item.orderStatus == 40">已完成</text>
|
||||
<view v-if="item.orderStatus == 30 && item.payStatus == 20">
|
||||
<text class="state-text" v-if="item.deliveryStatus == DeliveryStatusEnum.DELIVERED.value">待绑定</text>
|
||||
<text class="state-text" v-else-if="item.deliveryStatus == DeliveryStatusEnum.NOT_DELIVERED.value">待收货</text>
|
||||
<!-- <text class="state-text" v-else-if="item.receiptStatus == 21">进行中</text> -->
|
||||
<text class="state-text" v-else>已绑定</text>
|
||||
</view>
|
||||
|
||||
<text class="state-text" v-if="item.payStatus == 20 && item.receiptStatus == 21">进行中</text>
|
||||
<text class="state-text" v-if="item.orderStatus == 30 && item.payStatus == 20 && item.deliveryStatus == 20 && item.receiptStatus == 20">待绑定</text>
|
||||
<text class="state-text" v-else-if="item.orderStatus == 30 && item.payStatus == 20 && item.deliveryStatus == 20 && item.receiptStatus == 10">待收货</text>
|
||||
<!-- <text class="state-text" v-else-if="item.receiptStatus == 21">进行中</text> -->
|
||||
<text class="state-text" v-else-if="item.orderStatus == 30 && item.payStatus == 20 && item.deliveryStatus == 40 && item.receiptStatus == 20">已绑定</text>
|
||||
|
||||
<text class="state-text" v-else-if="item.payStatus == 20 && item.receiptStatus == 21">进行中</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品列表 -->
|
||||
@@ -100,13 +98,13 @@
|
||||
<view class="btn-item active" @click="onPay(item.orderId)">去支付</view>
|
||||
</block>
|
||||
<!-- 确认收货 -->
|
||||
<block v-if="item.payStatus == PayStatusEnum.SUCCESS.value && item.deliveryStatus == DeliveryStatusEnum.NOT_DELIVERED.value">
|
||||
<block v-if="item.payStatus == PayStatusEnum.SUCCESS.value && item.deliveryStatus == DeliveryStatusEnum.DELIVERED.value && item.receiptStatus == ReceiptStatusEnum.NOT_RECEIVED.value">
|
||||
<!-- <view class="btn-item active"
|
||||
v-if="(item.orderSourceData && JSON.parse(item.orderSourceData).length == 5) || item.equipmentGoods.equipmentCategory == '10'"
|
||||
@click="onBind(item)">绑定设备</view> -->
|
||||
<view class="btn-item active" @click="onReceipt(item.orderId)">确认收货</view>
|
||||
</block>
|
||||
<block v-if="item.orderStatus == 30 && item.payStatus == PayStatusEnum.SUCCESS.value && item.deliveryStatus == DeliveryStatusEnum.DELIVERED.value">
|
||||
<block v-if="item.orderStatus == 30 && item.payStatus == 20 && item.deliveryStatus == 20 && item.receiptStatus == 20">
|
||||
<view class="btn-item active" @click="onBind(item)">绑定设备</view>
|
||||
</block>
|
||||
<!-- 订单评价 -->
|
||||
|
||||
@@ -366,9 +366,9 @@
|
||||
if(!this.isLogin){
|
||||
return false;
|
||||
}
|
||||
this.$navTo('package/dealer/withdraw/apply')
|
||||
// this.$navTo('pages/dealer/withdraw/apply')
|
||||
this.$navTo('pages/withdraw/withdraw')
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
325
pages/withdraw/log/log.vue
Normal file
325
pages/withdraw/log/log.vue
Normal file
@@ -0,0 +1,325 @@
|
||||
<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> -->
|
||||
<mescroll-uni @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback" @emptyclick="emptyClick">
|
||||
<view class="order" v-for="(item,index) in datas" :key="index">
|
||||
<view class="fenqi">
|
||||
<block>
|
||||
<view class="item">
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">
|
||||
<text class="name">{{item.applyStatusDis}}</text>
|
||||
<text v-if="item.rejectReason" class="selling-point">拒绝理由:{{ item.rejectReason }}</text>
|
||||
<image v-if="item.image" :src="item.image" mode="widthFix" style="width: 100px;" @click="proView(item.image)"></image>
|
||||
<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>
|
||||
</mescroll-uni>
|
||||
|
||||
<!-- <u-empty mode="order" icon="http://cdn.uviewui.com/uview/empty/car.png" text="暂无提现记录" v-if="list.length == 0">
|
||||
</u-empty> -->
|
||||
<!-- <mescroll-empty v-if="dataList.length==0"></mescroll-empty> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
dateFormat
|
||||
} from '@/utils/util.js'
|
||||
import store from '@/store';
|
||||
import { ref } from 'vue';
|
||||
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins';
|
||||
import { withdrawPage } from '@/websoft/api/merchant.js'
|
||||
|
||||
export default {
|
||||
mixins: [MescrollMixin], // 使用mixin
|
||||
data() {
|
||||
return {
|
||||
upOption:{
|
||||
// page: {
|
||||
// size: 5 // 每页数据的数量
|
||||
// },
|
||||
noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
|
||||
empty:{
|
||||
tip: '~ 搜索无数据 ~', // 提示
|
||||
btnText: '去看看'
|
||||
}
|
||||
},
|
||||
datas: [], //列表数据
|
||||
// tabs: [{name:'全部',type:'xx'}, {name:'奶粉',type:'xx'}, {name:'面膜',type:'xx'}, {name:'图书',type:'xx'}],
|
||||
// tabIndex: 0 // tab下标
|
||||
}
|
||||
},
|
||||
// onLoad(option) {
|
||||
// const app = this
|
||||
// app.minDate = uni.$u.timeFormat(new Date().getTime() - 2592000000 * 2, 'yyyy-mm-dd');
|
||||
// },
|
||||
// onShow() {
|
||||
// },
|
||||
methods: {
|
||||
upCallback(page) {
|
||||
console.log(page)
|
||||
const app = this
|
||||
page.size = 5
|
||||
withdrawPage({page:page.num,limit:page.size}).then(res=>{
|
||||
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
||||
// this.mescroll.endSuccess(res.data.count);
|
||||
// app.mescroll.endBySize(page.size, res.data.count);
|
||||
|
||||
//设置列表数据
|
||||
if(page.num == 1) app.datas = []; //如果是第一页需手动制空列表
|
||||
app.datas=app.datas.concat(res.data.list); //追加新数据
|
||||
// app.mescroll.endBySize(res.data.list.length, res.data.count);
|
||||
|
||||
let totalPage = res.data.count / page.size + (res.data.count % page.size == 0 ? 0 : 1);
|
||||
let hasNext = (totalPage - page.num > 0);
|
||||
app.mescroll.endSuccess(res.data.count, true);
|
||||
}).catch(()=>{
|
||||
//联网失败, 结束加载
|
||||
this.mescroll.endErr();
|
||||
})
|
||||
},
|
||||
openCalendar() {
|
||||
this.show = true
|
||||
},
|
||||
closeShow(){
|
||||
this.show = false
|
||||
},
|
||||
proView(url){
|
||||
uni.previewImage({
|
||||
urls: [url]
|
||||
})
|
||||
},
|
||||
//点击空布局按钮的回调
|
||||
emptyClick(){
|
||||
uni.showToast({
|
||||
title:'点击了按钮,具体逻辑自行实现'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</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;
|
||||
|
||||
.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; //盒子中内容竖直排列
|
||||
}
|
||||
|
||||
.goods-name {
|
||||
text-align: left;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.comments{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
||||
.selling-point {
|
||||
margin-top: 0.2rem;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
.on-buy {
|
||||
background-color: #804002;
|
||||
}
|
||||
|
||||
.user-card {
|
||||
width: 700rpx;
|
||||
height: 260rpx;
|
||||
margin: 30rpx auto;
|
||||
border-radius: 24rpx;
|
||||
background: linear-gradient(to bottom, #9E1A91, #4D0868);
|
||||
|
||||
.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: linear-gradient(to bottom, #9E1A91, #4D0868);
|
||||
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>
|
||||
421
pages/withdraw/withdraw.vue
Normal file
421
pages/withdraw/withdraw.vue
Normal file
@@ -0,0 +1,421 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- <block v-if="applyVerifyStatus"> -->
|
||||
<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>
|
||||
<view class="amount">
|
||||
<u-input v-model="form.amount" maxlength="20" :disabled="isEdit" @input="onInput"
|
||||
:placeholder="`可提现金额¥${form.money ? form.money : 0}`" />
|
||||
<text class="all" @click="onAll(form.money)">全部提现</text>
|
||||
</view>
|
||||
</u-form-item>
|
||||
<!-- <u-form-item prop="serviceFee" borderBottom v-if="form.amount > 0">
|
||||
<span class="service-fee" v-if="form.amount <= form.money">本次提现手续费¥{{ (form.amount * 0.035).toFixed(2) }}, 实际到账¥{{ (form.amount - (form.amount * 0.035)).toFixed(2) }}</span>
|
||||
<span class="service-err" v-else>可提现金额不足</span>
|
||||
</u-form-item> -->
|
||||
</view>
|
||||
<u-gap height="10" bgColor="#f3f3f3"></u-gap>
|
||||
<view class="block">
|
||||
<u-form-item label="收款方式" borderBottom @click="showCardType">
|
||||
<view class="card-type">
|
||||
<span class="service-fee">{{ cardType }}</span>
|
||||
<u-icon name="arrow-right" size="18" color="#999999"></u-icon>
|
||||
</view>
|
||||
</u-form-item>
|
||||
<u-form-item label="支付宝姓名" prop="alipayName" borderBottom v-if="cardType == '支付宝'">
|
||||
<u-input v-model="form.alipayName" maxlength="20" :disabled="isEdit" placeholder="支付宝姓名" />
|
||||
</u-form-item>
|
||||
<u-form-item label="支付宝账号" prop="alipayAccount" borderBottom v-if="cardType == '支付宝'">
|
||||
<u-input v-model="form.alipayAccount" maxlength="20" :disabled="isEdit" placeholder="支付宝账号" />
|
||||
</u-form-item>
|
||||
<!-- <u-form-item label="银行开户名" prop="bankName" borderBottom v-if="cardType == '银行卡'">
|
||||
<u-input v-model="form.bankName" maxlength="20" :disabled="isEdit" placeholder="银行开户名" />
|
||||
</u-form-item>
|
||||
<u-form-item label="银行开户名" prop="bankAccount" borderBottom v-if="cardType == '银行卡'">
|
||||
<u-input v-model="form.bankAccount" maxlength="20" :disabled="isEdit" placeholder="银行卡开户名" />
|
||||
</u-form-item>
|
||||
<u-form-item label="银行卡号" prop="bankCard" borderBottom v-if="cardType == '银行卡'">
|
||||
<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">提现说明:手续费<text class="service-err">3.5%</text></view> -->
|
||||
<view class="desc">提交成功后可<text @click="gotoLog">点击这里</text>查看打款进度</view>
|
||||
<!-- <view class="photo">
|
||||
<image src="https://file.wsdns.cn/20230619/29a8c790211a46529fbbb66ee8d223d5.png"
|
||||
mode="widthFix"></image>
|
||||
</view> -->
|
||||
</view>
|
||||
</u-form>
|
||||
</view>
|
||||
<!-- <view class="agree-text" @click="onRadio">
|
||||
<label>
|
||||
<radio value="index" :checked="!disabled" />同意平台收集个人信息
|
||||
</label>
|
||||
<u-gap height="20"></u-gap>
|
||||
<view class="xieyi" @click.stop="gotoUserProtocal">《用户协议》</view>
|
||||
<u-gap height="20"></u-gap>
|
||||
<view class="xieyi" @click.stop="gotoUserPrivate">《隐私政策》</view>
|
||||
</view> -->
|
||||
<view class="btn-wrapper">
|
||||
<!-- <u-button :text="submitText" color="linear-gradient(to bottom, #9E1A91, #4D0868)" :disabled="isEdit || disabled"
|
||||
shape="circle" @click="handleSubmit()"></u-button> -->
|
||||
<u-button shape="circle" type="primary" @click="handleSubmit">申请提现</u-button>
|
||||
</view>
|
||||
<!-- </block> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addWithdraw } from '@/websoft/api/merchant.js'
|
||||
import { getUser } from '@/websoft/api/user.js'
|
||||
// import * as LoginApi from '@/api/login.js'
|
||||
const userId = uni.getStorageSync('userId')
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
amount: undefined,
|
||||
money: undefined,
|
||||
alipayName: '',
|
||||
alipayAccount: '',
|
||||
cardType: 20, // 打款方式 10微信 20支付宝 30银行卡
|
||||
},
|
||||
cardType: '支付宝',
|
||||
fileList1: [],
|
||||
disabled: true,
|
||||
// 临时图片 (用于上传)
|
||||
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: 'number',
|
||||
required: true,
|
||||
message: '请填写提现金额',
|
||||
trigger: ['blur', 'change'],
|
||||
// 自定义验证函数,见上说明
|
||||
validator: (rule, value, callback) => {
|
||||
if(value > this.form.money){
|
||||
callback(uni.$u.$error('可提现金额不足'));
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
submitText: '提交申请',
|
||||
// applyVerifyStatus: false
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
// await LoginApi.applyVerifyStatusMp().then(res => {
|
||||
// console.log('res: ',res);
|
||||
// console.log('res.data: ',res.data);
|
||||
// this.applyVerifyStatus = false
|
||||
// // #ifdef APP-PLUS || H5
|
||||
// if(res.data == 0){
|
||||
// this.applyVerifyStatus = true
|
||||
// }
|
||||
// // #endif
|
||||
// // #ifdef MP-WEIXIN
|
||||
// if(res.data == 0){
|
||||
// this.applyVerifyStatus = true
|
||||
// }
|
||||
// // #endif
|
||||
// })
|
||||
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]
|
||||
// }
|
||||
// })
|
||||
const { form } = this
|
||||
const app = this
|
||||
getUser().then(res => {
|
||||
if( res.code == 0 && res.data.username != 'www') {
|
||||
console.log("获取用户信息: ",res.data);
|
||||
app.form.money = res.data.balance
|
||||
app.isLogin = true
|
||||
}else{
|
||||
app.isLogin = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onRadio() {
|
||||
this.disabled = !this.disabled
|
||||
},
|
||||
showCardType() {
|
||||
const app = this
|
||||
if(this.isEdit == true){
|
||||
return false;
|
||||
}
|
||||
const itemList = ['支付宝','银行卡'];
|
||||
uni.showActionSheet({
|
||||
itemList,
|
||||
success: ({tapIndex}) => {
|
||||
app.cardType = itemList[tapIndex]
|
||||
}
|
||||
})
|
||||
},
|
||||
onInput(){
|
||||
const { form } = this
|
||||
this.disabled = false
|
||||
if(form.amount > form.money){
|
||||
this.disabled = true
|
||||
}
|
||||
},
|
||||
onAll(money){
|
||||
this.form.amount = money
|
||||
// this.disabled = false
|
||||
},
|
||||
// 新增图片
|
||||
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,cardType } = this
|
||||
if(app.form.amount > app.form.money){
|
||||
app.$error('可提现金额不足')
|
||||
return false
|
||||
}
|
||||
if(app.form.amount == 0){
|
||||
app.$error('提现金额不正确')
|
||||
return false
|
||||
}
|
||||
if(cardType === '支付宝'){
|
||||
app.form.cardType = 20
|
||||
} else if(cardType === '银行卡'){
|
||||
app.form.cardType = 30
|
||||
}
|
||||
// if (app.disabled) return
|
||||
// uni.showLoading({
|
||||
// mask: true,
|
||||
// title: "正在验证"
|
||||
// })
|
||||
|
||||
addWithdraw(app.form).then(result => {
|
||||
if(result.code == 0){
|
||||
app.$success('提现申请成功')
|
||||
app.getData()
|
||||
app.form.amount = undefined
|
||||
}
|
||||
else {
|
||||
app.$error(result.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
app.$error(err.message)
|
||||
}).finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
gotoLog(){
|
||||
uni.navigateTo({
|
||||
url:'log/log'
|
||||
})
|
||||
},
|
||||
gotoUserProtocal(){
|
||||
uni.navigateTo({
|
||||
url:'../pages/article/detail/detail?id=114'
|
||||
})
|
||||
},
|
||||
gotoUserPrivate(){
|
||||
uni.navigateTo({
|
||||
url:'../pages/article/detail/detail?id=115'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</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-top: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
text {
|
||||
color: #AB1581;
|
||||
}
|
||||
}
|
||||
|
||||
.card-type{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-wrapper {
|
||||
background: none;
|
||||
width: 360rpx;
|
||||
margin: 50rpx auto;
|
||||
display: flex;
|
||||
justify-content:center;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.service-fee{
|
||||
// line-height: 2rem;
|
||||
color: #AB1581;
|
||||
}
|
||||
.service-err{
|
||||
line-height: 2rem;
|
||||
color: #ff0000;
|
||||
}
|
||||
|
||||
.amount{
|
||||
width: 534rpx;
|
||||
position: relative;
|
||||
.all{
|
||||
position: absolute;
|
||||
top: 5rpx;
|
||||
right: 20rpx;
|
||||
font-size: 26rpx;
|
||||
color: #AB1581;
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
|
||||
.agree-text {
|
||||
margin-left: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
text-align: left;
|
||||
width: 750rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
/* .item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
} */
|
||||
|
||||
.xieyi {
|
||||
color: rgba(75, 13, 99, 1);
|
||||
// text-decoration:underline;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -9,8 +9,15 @@ export const listMerchant = (params) => http.get('/shop/merchant', {params})
|
||||
// 获取商户详情
|
||||
export const getMerchant = (merchantId) => http.get('/shop/merchant/page', {merchantId})
|
||||
|
||||
// 申请退款
|
||||
export const addWithdraw = (data) => http.post('/shop/merchant-withdraw/apply', data)
|
||||
|
||||
export const withdrawPage = (params) => http.get('/shop/merchant-withdraw/page/app', {params})
|
||||
|
||||
export default {
|
||||
pageMerchant,
|
||||
listMerchant,
|
||||
getMerchant
|
||||
getMerchant,
|
||||
addWithdraw,
|
||||
withdrawPage
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user