增加:配送商 - 缴费记录查看及分配

This commit is contained in:
wuhui_zzw 2024-06-18 16:59:10 +08:00
parent 9eaa2f6e89
commit fd48655e03
4 changed files with 348 additions and 36 deletions

View File

@ -58,10 +58,18 @@ export function deliveryPaymentList(data) {
export function deliveryCreateOrder(data) { export function deliveryCreateOrder(data) {
return request.post(`agent/delivery/create_order`, data); return request.post(`agent/delivery/create_order`, data);
} }
// 配送商 - 缴费记录
export function deliveryPaymentRecord(data) {
return request.get(`agent/delivery/payment_record`, data);
}
// 配送商 - 获取相关商户列表 // 配送商 - 获取相关商户列表
export function deliveryMerList(data) { export function deliveryMerList(data) {
return request.get(`agent/delivery/mer_list`, data); return request.get(`agent/delivery/mer_list`, data);
} }
// 配送商 - 分配缴费记录
export function deliveryAllocationOrder(data) {
return request.post(`agent/delivery/allocation_order`, data);
}

View File

@ -3,7 +3,7 @@
<view class="main-content"> <view class="main-content">
<!--顶部内容--> <!--顶部内容-->
<view class="search"> <view class="search">
<input class="search-text" v-model="search_text" placeholder="商户名称/联系电话" /> <input class="search-text" v-model="search_text" placeholder="商户名称/联系电话" placeholder-style="color: #ffffff!important;" />
</view> </view>
<!--信息列表--> <!--信息列表-->
<view class="list-content" v-if="Object.values(list).length > 0"> <view class="list-content" v-if="Object.values(list).length > 0">
@ -15,10 +15,9 @@
<view class="phone" v-if="item.mer_phone">联系电话{{ item.mer_phone || '' }}</view> <view class="phone" v-if="item.mer_phone">联系电话{{ item.mer_phone || '' }}</view>
</view> </view>
</view> </view>
<!--<view class="buttons"> <view class="buttons">
<view class="btn-item">去支付</view> <view class="btn-item" v-if="agent_delivery_id > 0" @click="allocation(item.mer_id)">选中</view>
<view class="btn-item">查看详情</view> </view>
</view>-->
</view> </view>
</view> </view>
<emptyPage v-else title="暂无信息~"></emptyPage> <emptyPage v-else title="暂无信息~"></emptyPage>
@ -33,7 +32,7 @@
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import emptyPage from '@/components/emptyPage.vue'; import emptyPage from '@/components/emptyPage.vue';
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
import {deliveryMerList} from "../../../api/agent"; import {deliveryMerList, deliveryAllocationOrder} from "@/api/agent";
export default { export default {
components: { components: {
@ -54,11 +53,25 @@ export default {
page: 1, page: 1,
agent_id: 0, agent_id: 0,
search_text: '', search_text: '',
//
agent_delivery_id: '',
}
},
watch: {
search_text: {
handler() {
this.page = 1;
this.list = [];
this.getList();
},
immediate: true
} }
}, },
onLoad(options) { onLoad(options) {
let _this = this; let _this = this;
_this.agent_id = options.agent_id || 0; _this.agent_id = options.agent_id || 0;
_this.agent_delivery_id = options.agent_delivery_id || 0;
// agent_id <= 0 // agent_id <= 0
if(Number(_this.agent_id) <= 0){ if(Number(_this.agent_id) <= 0){
_this.$util.Tips({ _this.$util.Tips({
@ -96,7 +109,7 @@ export default {
init () { init () {
this.getList(); this.getList();
}, },
// //
getList() { getList() {
let _this = this; let _this = this;
let params = { let params = {
@ -116,6 +129,44 @@ export default {
this.$util.Tips({title: err}); this.$util.Tips({title: err});
}); });
}, },
// -
allocation(mer_id){
let _this = this;
let config = {
content: '是否确认分配给当前商户,确认后订单赠送的相关额度会赠送给当前商户!',
confirmText: '选中',//
showCancel: true, //
cancelText: '取消', //
};
//
_this.$util.tips(config, function () {
let params = {
mer_id: mer_id,
agent_id: _this.agent_id,
agent_delivery_id: _this.agent_delivery_id
};
deliveryAllocationOrder(params).then(res => {
if(Number(res.status) === 200){
_this.$util.tips({ content: '分配成功!'}, function () {
uni.navigateTo({
url: '/pages/agent/delivery/payment_record?agent_id=' + _this.agent_id
})
});
}else{
_this.$util.Tips({title: res.message});
}
}).catch(err => {
_this.$util.Tips({title: err});
});
});
},
} }
} }
</script> </script>
@ -139,6 +190,9 @@ export default {
line-height: 60rpx; line-height: 60rpx;
color: #ffffff; color: #ffffff;
} }
.search-text::placeholder{
color: #ffffff!important;
}
} }
.list-content{ .list-content{

View File

@ -1,16 +1,64 @@
<template> <template>
<view> <view>
<!--v-if="Object.values(list).length > 0"-->
<view class="main-content"> <view class="main-content">
<!--顶部选项卡-->
<view class="tabs">
资金缴费记录 <view :class="['tab',{'tab-active':(tab_active === 'all')}]" @click="changeTab('all')">全部</view>
<view :class="['tab',{'tab-active':(tab_active === '0')}]" @click="changeTab('0')">待付款</view>
<view :class="['tab',{'tab-active':(tab_active === '1')}]" @click="changeTab('1')">待分配</view>
<view :class="['tab',{'tab-active':(tab_active === '2')}]" @click="changeTab('2')">已完成</view>
</view>
<!--记录列表-->
<view class="list-content" v-if="Object.values(list).length > 0">
<view class="list-box" v-for="(item,index) in list" :key="index">
<!--顶部信息-->
<view class="top-info">
<view class="order-no">{{ item.store_order.order_sn || '' }}</view>
<view v-if="Number(item.status) === 0" class="status-text">待付款</view>
<view v-if="Number(item.status) === 1" class="status-text">待分配</view>
<view v-if="Number(item.status) === 2" class="status-text">已完成</view>
</view>
<!--中间信息-->
<view class="center-info">
<view class="info-box">
<view class="box-label">购买品牌额度</view>
<view class="box-content">+{{ item.title_quota || '0.00' }}</view>
</view>
<view class="info-box">
<view class="box-label">其他品牌额度</view>
<view class="box-content">+{{ item.other_quota || '0.00' }}</view>
</view>
<view class="info-box">
<view class="box-label">绑定商户名称</view>
<view class="box-content">{{ item.mer_id > 0 ? item.mer.mer_name : '未绑定' }}</view>
</view>
</view>
<!--底部信息-->
<view class="bottom-info">
<view class="left">
<view class="left-title">缴费金额</view>
<view class="price">¥{{ item.price || '0.00' }}</view>
</view>
<view class="right">
<view class="pay-btn" v-if="Number(item.status) === 0" @click="goPay(item.store_order)">去支付</view>
<view class="pay-btn" v-else-if="Number(item.status) === 1" @click="goAllocation(item.id)">去分配</view>
</view>
</view>
</view>
</view>
<emptyPage v-else title="暂无信息~"></emptyPage>
</view> </view>
<!--<emptyPage v-else title="暂无信息~"></emptyPage>-->
<!-- 授权登录 --> <!-- 授权登录 -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize> <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize>
<!-- 支付弹框 -->
<payment
:payMode='pay_list'
:pay_close="pay_close"
@onChangeFun='onChangeFun'
:order_id="pay_order_id"
:totalPrice='totalPrice'
:returnUrl="'/pages/agent/invite/record'">
</payment>
</view> </view>
</template> </template>
@ -18,11 +66,15 @@
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import emptyPage from '@/components/emptyPage.vue'; import emptyPage from '@/components/emptyPage.vue';
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
import {deliveryPaymentRecord} from "../../../api/agent";
import payment from '@/components/payment';
import {getUserInfo} from "@/api/user";
export default { export default {
components: { components: {
authorize, authorize,
emptyPage emptyPage,
payment
}, },
computed: { computed: {
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor']) ...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor'])
@ -37,7 +89,36 @@ export default {
list: [], list: [],
page: 1, page: 1,
agent_id: 0, agent_id: 0,
//
tab_active: 'all',
//
pay_list: [
{
name: "微信支付",
icon: "icon-weixinzhifu",
value: 'wechat',
title: '微信快捷支付',
payStatus: 1
},
{
name: "支付宝支付",
icon: "icon-zhifubao",
value: 'alipay',
title: '支付宝支付',
payStatus: this.$store.getters.globalData.alipay_open
},
{
name: "余额支付",
icon: "icon-yuezhifu",
value: 'balance',
title: '可用余额:',
number: 0,
payStatus: this.$store.getters.globalData.yue_pay_status
}
],
pay_close: false,
pay_order_id: '',
totalPrice: 0,
} }
}, },
onLoad(options) { onLoad(options) {
@ -79,30 +160,61 @@ export default {
// //
init () { init () {
this.getList(); this.getList();
getUserInfo().then(res => {
this.pay_list[2].number = res.data.now_money;
});
},
//
changeTab(type){
this.page = 1;
this.list = [];
this.tab_active = type;
this.getList();
}, },
// //
getList() { getList() {
let _this = this; let _this = this;
let params = {
console.log("列表信息获取"); page: _this.page,
// let params = { agent_id: _this.agent_id,
// page: _this.page, status: _this.tab_active === 'all' ? '' : Number(_this.tab_active),
// pid: _this.agent_id };
// }; deliveryPaymentRecord(params).then(res => {
// myAgentList(params).then(res => { let list = res.data.list || {};
// let list = res.data.list || {}; _this.total = res.data.count || 0;
// _this.total = res.data.count || 0; if (Object.values(list).length > 0) {
// if (Object.values(list).length > 0) { _this.list = _this.$util.SplitArray(list, _this.list);
// _this.list = _this.$util.SplitArray(list, _this.list); _this.$set(_this, 'list', _this.list);
// _this.$set(_this, 'list', _this.list); _this.page++;
// _this.page++; }
// } }).catch(err => {
// }).catch(err => { this.$util.Tips({title: err});
// this.$util.Tips({title: err}); });
// });
}, },
// -
goPay(orderInfo) {
this.$set(this, 'pay_close', true);
this.order_id = orderInfo.group_order_id;
this.pay_order_id = orderInfo.group_order_id.toString()
this.$set(this, 'totalPrice', orderInfo.pay_price);
},
// -
onChangeFun(e) {
let opt = e;
let action = opt.action || null;
let value = opt.value != undefined ? opt.value : null;
(action && this[action]) && this[action](value);
},
// -
payClose() {
this.pay_close = false;
},
//
goAllocation(id){
uni.navigateTo({
url: '/pages/agent/delivery/mer_list?agent_id=' + this.agent_id + '&agent_delivery_id=' + id
})
}
@ -114,11 +226,149 @@ export default {
.main-content { .main-content {
width: 100vw; width: 100vw;
min-height: 100vh!important; min-height: 100vh!important;
background: #f6f6f6; background: #f6f6f6;// #f6f6f6
.tabs{
width: 100%;
background-color: #ffffff;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-around;
align-items: center;
.tab{
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
}
.tab-active{
position: relative;
color: #d60000;
}
.tab-active::after{
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 6rpx;
background-color: #d60000;
}
}
.list-content{
width: 100%;
padding: 0 20rpx 100rpx 20rpx;
.list-box{
width: 100%;
margin-top: 30rpx;
background-color: #ffffff;
border-radius: 20rpx;
.top-info{
width: 100%;
height: 80rpx;
padding: 0 20rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
.order-no{
color: #060606;
}
.status-text{
position: relative;
color: #060606;
height: 60rpx;
line-height: 60rpx;
}
.status-text:after{
content: "";
position: absolute;
left: -20rpx;
bottom: calc((60rpx - 10rpx) / 2);
width: 10rpx;
height: 10rpx;
border-radius: 50%;
background-color: #d60000;
}
}
.center-info{
width: 100%;
padding: 20rpx;
border-top: 2rpx solid #f7f7f7;
border-bottom: 2rpx solid #f7f7f7;
.info-box{
width: 100%;
height: 60rpx;
display: inline-flex;
flex-direction: row;
justify-content: flex-start;
flex-wrap: nowrap;
align-items: center;
.box-label{
color: #757b95;
width: 200rpx;
height: 60rpx;
line-height: 60rpx;
}
.box-content{
width: calc(100% - 200rpx);
height: 60rpx;
line-height: 60rpx;
color: #060606;
display: inline-flex;
flex-direction: row;
justify-content: flex-start;
flex-wrap: nowrap;
align-items: center;
}
}
}
.bottom-info{
width: 100%;
padding: 0 20rpx;
height: 80rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
.left{
display: inline-flex;
flex-direction: row;
align-items: center;
flex-wrap: nowrap;
justify-content: flex-start;
.left-title{
color: #070707;
font-size: 26rpx;
}
.price{
color: #d60104;
font-size: 30rpx;
}
}
.right{
.pay-btn{
background-color: #d60000;
color: #ffffff;
height: 50rpx;
line-height: 50rpx;
border-radius: 15rpx;
font-size: 26rpx;
padding:0 20rpx;
}
}
}
}
}
} }
</style> </style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB