添加:代理人员申请信息修改- 开发中

This commit is contained in:
wuhui_zzw 2024-02-01 18:40:43 +08:00
parent ca8c0525cb
commit d459df42ee
6 changed files with 312 additions and 46 deletions

View File

@ -12,9 +12,14 @@ export function inviteSupplierJoinQrCode(data) {
export function submitAgentApplyInfo(data) {
return request.post('agent/agent_apply',data);
}
// 代理加入 - 生成订单
// 入驻申请记录
export function agentApplyRecord(data) {
return request.post(`agent/apply_record`, data);
}
// 单条申请信息
export function agentApplyInfo(data) {
return request.get(`agent/apply_info`, data);
}
// 获取单条代理人员信息
export function getSingleAgentInfo(id) {
return request.get(`agent/single_agent_info/${id}`);

View File

@ -8,7 +8,7 @@ export function supplierApplyJoin(data) {
export function supplierApplyRecord(data) {
return request.post(`supplier/apply_record`, data);
}
// 入驻申请记录
// 单条申请信息
export function supplierApplyInfo(data) {
return request.get(`supplier/apply_info`, data);
}

View File

@ -6,13 +6,13 @@ let VUE_APP_WS_URL = `ws://${location.hostname}?type=user`
let openPlantGrass = '-openPlantGrass-'
// 网络接口修改此字符 小程序域名要求https
let httpApi = 'https://bt.test.cdlfjy.com/' // 开发
// let httpApi = 'https://mp.scwmbh.cn/' // 生产
// let httpApi = 'https://bt.test.cdlfjy.com/' // 开发
let httpApi = 'https://mp.scwmbh.cn/' // 生产
// 聊天接口修改此字符 小程序聊天要求wss 例如:
let wsApi = 'wss://bt.test.cdlfjy.com'
// let wsApi = 'wss://mp.scwmbh.cn'
// let wsApi = 'wss://bt.test.cdlfjy.com'
let wsApi = 'wss://mp.scwmbh.cn'
module.exports = {

View File

@ -1335,11 +1335,13 @@
"style": {
"navigationBarTitleText": "邀请下级"
}
},
{
"path": "invite/record",
"style": {
"navigationBarTitleText": "申请记录"
}
}
]
},
{
@ -1358,10 +1360,6 @@
"navigationBarTitleText": "申请记录"
}
}
]
}

View File

@ -1,7 +1,12 @@
<template>
<view class="main-content">
<!--标题-->
<view class="title">{{ page_title }}</view>
<view class="title">
{{ page_title }}
<view class="record-btn" @click="applyRecord">
申请记录 <text class="iconfont icon-xiangyou"></text>
</view>
</view>
<!--表单-->
<view class="form-content">
<view class="line">
@ -91,7 +96,7 @@
</view>
</block>
<!--选择支付方式-->
<view class="pay-type" v-if="Number(pay_money) > 0">
<view class="pay-type" v-if="Number(pay_money) > 0 && Number(apply_info_id) <= 0">
<view class="box-title">支付方式</view>
<view class="box-content">
<radio-group name="pay_type" @change="changePayType">
@ -121,9 +126,10 @@
</view>
<!--提交按钮-->
<view class="group-btn">
<view class="add-btn" @click="submitInfo">
<view v-if="Number(apply_info_id) <= 0" class="add-btn" @click="submitInfo">
{{ Number(pay_money) > 0 ? '去支付 ¥' + pay_money : '提交资料' }}
</view>
<view v-else class="add-btn" @click="submitInfo">提交编辑</view>
</view>
</view>
<!-- 地区选择器 -->
@ -146,7 +152,7 @@
import {mapGetters} from "vuex";
import authorize from '@/components/Authorize';
import areaSelect from '@/components/areaSelect';
import {getSingleAgentInfo,getAgentConfig,submitAgentApplyInfo} from "@/api/agent";
import {getSingleAgentInfo,getAgentConfig,submitAgentApplyInfo,agentApplyInfo} from "@/api/agent";
import { merClassifly,getStoreTypeApi } from '@/api/store.js';
import {getUserInfo} from "@/api/user";
@ -246,8 +252,10 @@ export default {
_this.agent_id = scene.aid || 0;
_this.agent_type = scene.lv || 0;
}
// agent_id <= 0 || agent_type <= 1
if(Number(_this.agent_id) <= 0 && Number(_this.agent_type) <= 1){
// ID
this.apply_info_id = options.apply_id || 0;
// agent_id <= 0
if(Number(_this.agent_id) <= 0 && Number(this.apply_info_id) <= 0){
_this.$util.Tips({
title: '非法访问,无邀请人!',
},{tab:1,url:'/pages/user/index'});
@ -276,6 +284,7 @@ export default {
},
//
init () {
if(Number(this.apply_info_id) > 0) this.getApplyInfo();
this.getInviteAgentInfo()
this.generatePageTitle();
this.getConfig();
@ -465,8 +474,11 @@ export default {
let status = res.data.status,
orderId = res.data.result.order_id,
callback_key = res.data.result.pay_key,
jsConfig = res.data.result.config,
goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message;
jsConfig = res.data.result.config;
// let goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message;
let goPages = '/pages/agent/invite/record';
switch (status) {
case 'ORDER_EXIST':
case 'EXTEND_ORDER':
@ -530,8 +542,9 @@ export default {
provider: 'wxpay',
orderInfo: jsConfig,
success: (e) => {
let url = '/pages/order_pay_status/index?order_id=' + orderId +
'&msg=支付成功';
// let url = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=';
let url = '/pages/agent/invite/record';
return _this.$util.Tips({
title: '支付成功',
icon: 'success'
@ -541,7 +554,8 @@ export default {
});
},
fail: (e) => {
let url = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=取消支付';
// let url = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=';
let url = '/pages/agent/invite/record';
return _this.$util.Tips({
title: '取消支付',
}, {
@ -550,7 +564,8 @@ export default {
});
},
complete: () => {
let url = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=取消支付';
// let url = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=';
let url = '/pages/agent/invite/record';
return _this.$util.Tips({
title: '',
}, {
@ -585,8 +600,8 @@ export default {
});
},
fail: function(e) {
let pages = '/pages/order_pay_status/index?order_id=' +
orderId + '&msg=取消支付'
// let pages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg='
let pages = '/pages/agent/invite/record';
return _this.$util.Tips({
title: '取消支付'
}, {
@ -609,7 +624,8 @@ export default {
// #ifdef H5
case 'h5':
let host = window.location.protocol + "//" + window.location.host;
let url = `${host}/pages/order_pay_status/index?order_id=${orderId}&msg=${res.message}`
// let url = `${host}/pages/order_pay_status/index?order_id=${orderId}&msg=${res.message}`
let url = '/pages/agent/invite/record';
let eUrl = encodeURIComponent(url)
let jsurl = jsConfig.mweb_url || jsConfig.h5_url
let locations = `${jsurl}&redirect_url=${eUrl}`
@ -633,8 +649,8 @@ export default {
});
},
fail: (e) => {
let pages = '/pages/order_pay_status/index?order_id=' +
orderId + '&msg=支付失败'
// let pages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg='
let pages = '/pages/agent/invite/record';
return _this.$util.Tips({
title: '支付失败'
}, {
@ -644,8 +660,8 @@ export default {
},
complete: () => {
uni.hideLoading();
let pages = '/pages/order_pay_status/index?order_id=' +
orderId + '&msg=取消支付'
// let pages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg='
let pages = '/pages/agent/invite/record';
return _this.$util.Tips({
title: ''
}, {
@ -657,8 +673,8 @@ export default {
break;
// #endif
default:
let pages = '/pages/order_pay_status/index?order_id=' +
orderId + '&msg=取消支付'
// let pages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg='
let pages = '/pages/agent/invite/record';
return _this.$util.Tips({
title: '取消支付'
}, {
@ -669,13 +685,10 @@ export default {
}else{
_this.$util.Tips({
title: '操作成功!',
}
// ,{
// tab: 5,
// url: '/pages/supplier/apply/record'
// }
);
},{
tab: 5,
url: '/pages/agent/invite/record'
});
}
}
}).catch(err => {
@ -686,8 +699,27 @@ export default {
changePayType(e){
this.pay_info.pay_type = e.detail.value || e.target.value;
},
//
applyRecord(){
uni.navigateTo({
url: `/pages/agent/invite/record`
})
},
//
getApplyInfo(){
let _this = this;
agentApplyInfo({ apply_id: _this.apply_info_id }).then(res => {
if (res.status == 200) {
let data = res.data || {};
_this.apply_info = data || {};
_this.agent_type = data.agent_type;
_this.agent_id = data.pid
_this.getInviteAgentInfo()
}
}).catch(err => {
this.$util.Tips({title: err});
});
}
}
}
</script>
@ -706,6 +738,24 @@ export default {
width: 100%;
text-align: center;
font-weight: bold;
.record-btn{
position: absolute;
display: flex;
align-items: center;
top: 30rpx;
right: 0;
color: #fff;
font-size: 22rpx;
background-color: rgba(0, 0, 0, 0.3);
padding: 8rpx 18rpx;
border-radius: 20px 0px 0px 20px;
height: 45rpx;
line-height: 45rpx;
.icon-xiangyou{
font-size: 22rpx!important;
margin-left: 10rpx;
}
}
}
.form-content{
background: #FFFFFF;

View File

@ -0,0 +1,213 @@
<template>
<view>
<view class="application-record" v-if="Object.values(list).length > 0">
<view class="card-list" v-for="(item,index) in list" :key="index">
<view class="card-top">
<view class="title">
{{item.contact_name}}({{agentType(item.agent_type)}})
</view>
<view class="time">提交时间{{item.create_time}}</view>
<view v-if="item.reason && item.status == 2" class="reason">原因{{item.reason}}</view>
</view>
<view class="line"></view>
<view class="card-bottom">
<view class="card-status">
<image class="status-icon" v-if="item.status === 0" src="@/static/images/pending.png" mode=""></image>
<image class="status-icon" v-else-if="item.status === 1" src="@/static/images/passed.png" mode=""></image>
<image class="status-icon" v-else-if="item.status === 2" src="@/static/images/not-pass.png" mode=""></image>
<text class="status-text">{{statusText(item.status)}}</text>
</view>
<view class="status-btn" v-if="item.status == 2" @click="jump(item)">修改</view>
</view>
</view>
</view>
<emptyPage v-else title="暂无记录~"></emptyPage>
<!-- 授权登录 -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize>
</view>
</template>
<script>
import {mapGetters} from "vuex";
import emptyPage from '@/components/emptyPage.vue';
import {agentApplyRecord} from "@/api/agent";
import authorize from '@/components/Authorize';
export default {
components: {
authorize,
emptyPage
},
data() {
return {
list: [],
page: 1,
//
isAuto: false, //
isShowAuth: false,//
}
},
computed: {
...mapGetters(['isLogin', 'userInfo', 'viewColor'])
},
onLoad() {
let _this = this;
//
if (!this.isLogin) {
//
this.isAuto = true;
this.isShowAuth = true
}else{
//
this.init();
}
},
//
onReachBottom() {
this.getRecordList();
},
methods: {
//
onLoadFun() {
if(this.isLogin){
this.isShowAuth = false;
this.init();
}
},
//
authClose(e) {
this.isShowAuth = e
},
//
init () {
this.getRecordList();
},
//
getRecordList() {
let _this = this;
agentApplyRecord({page: _this.page}).then(res => {
let list = res.data.list || {};
if (Object.values(list).length > 0) {
_this.list = _this.$util.SplitArray(list, _this.list);
_this.$set(_this, 'list', _this.list);
_this.page++;
}
}).catch(err => {
this.$util.Tips({
title: err
});
});
},
//
statusText(number) {
let statusData = {
0: "审核中",
1: "已通过",
2: "已驳回"
};
return statusData[number]
},
//
agentType(number) {
let title = '';
switch (Number(number)) {
case 2: title = '省公司';break;
case 3: title = '外勤';break;
case 4: title = '内勤';break;
case 5: title = '运营商';break;
case 6: title = '合伙人';break;
case 7: title = '餐厅';break;
case 8: title = '配送商';break;
}
return title;
},
//
jump(item) {
uni.navigateTo({
url: `/pages/agent/invite/index?apply_id=${item.id}`
})
},
}
}
</script>
<style lang="scss" scoped>
.application-record {
display: flex;
flex-direction: column;
align-items: center;
background-color: #F5F5F5;
padding: 20rpx 30rpx;
.card-list {
width: 100%;
background-color: #fff;
padding: 20rpx 24rpx;
margin: 10rpx 20rpx;
border-radius: 12rpx;
.card-top {
min-height: 140rpx;
.title {
font-size: 28rpx;
font-weight: bold;
color: #333333;
}
.time {
color: #999999;
font-size: 24rpx;
padding: 5rpx 0;
}
.reason {
color: #E93323;
font-weight: bold;
font-size: 24rpx;
}
}
.line {
height: 2rpx;
margin: 20rpx 0 20rpx 0;
background-color: #EEEEEE;
}
.card-bottom {
display: flex;
justify-content: space-between;
align-items: center;
color: #333;
.card-status {
display: flex;
align-items: center;
.status-icon {
width: 30rpx;
height: 30rpx;
margin: 10rpx;
}
.status-text {
font-size: 28rpx;
font-weight: 500;
}
}
.status-btn {
font-size: 26rpx;
color: #555;
border: 1px solid #999999;
padding: 8rpx 32rpx;
border-radius: 40rpx;
}
}
}
}
.no-shop {
width: 100%;
background-color: #fff;
height: 100vh;
.pictrue {
display: flex;
flex-direction: column;
align-items: center;
color: $uni-nothing-text;
image {
width: 414rpx;
height: 380rpx;
}
}
}
</style>