添加:地区选择器

添加:核销页面(空白页面)
添加:代理人员邀请下级 - 开发中
This commit is contained in:
wuhui_zzw 2024-02-01 08:57:40 +08:00
parent 6ffd4ea646
commit 3808ba29cc
10 changed files with 597 additions and 22 deletions

View File

@ -15,8 +15,10 @@ export function inviteSupplierJoinQrCode(data) {
export function getSingleAgentInfo(id) {
return request.get(`agent/single_agent_info/${id}`);
}
// 获取单条代理人员信息
export function getAgentConfig() {
return request.get(`agent/get_config`);
}

View File

@ -0,0 +1,196 @@
<template>
<view>
<uni-popup ref="selectAreaPopup" type="bottom" @change="selectAreaStatusChange">
<view class="select-area-popup">
<picker-view :indicator-style="`height: 100rpx;`" :value="value" @change="changeArea" class="picker-view">
<picker-view-column v-if="is_show_province">
<view class="item" v-for="(item,index) in province_list" :key="index">{{ item.name }}</view>
</picker-view-column>
<picker-view-column v-if="is_show_city">
<view class="item" v-for="(item,index) in city_list" :key="index">{{ item.name }}</view>
</picker-view-column>
<picker-view-column v-if="is_show_area">
<view class="item" v-for="(item,index) in area_list" :key="index">{{ item.name }}</view>
</picker-view-column>
<picker-view-column v-if="is_show_street">
<view class="item" v-for="(item,index) in street_list" :key="index">{{ item.name }}</view>
</picker-view-column>
</picker-view>
</view>
</uni-popup>
</view>
</template>
<script>
import {getCityV2} from "@/api/api";
export default {
props: {
//
isShow: {
type: Boolean,
default: false
},
//
is_show_province:{
type: Boolean,
default: true
},
//
is_show_city:{
type: Boolean,
default: true
},
// /
is_show_area:{
type: Boolean,
default: true
},
// /
is_show_street:{
type: Boolean,
default: true
}
},
components: {},
data() {
return {
value: [],
province_index: 0,
city_index: '',
area_index: '',
street_index: '',
province_list: [],
city_list: [],
area_list: [],
street_list: [],
selected_info: {},
};
},
watch: {
isShow: {
handler(newValue) {
// console.log('',newValue)
if(newValue) this.$refs.selectAreaPopup.open('bottom');
else this.$refs.selectAreaPopup.close();
},
deep: true
},
province_index: {
handler(newValue) {
let areaInfo = this.province_list[this.province_index] || {};
this.city_index = 0;
this.changeSelectContent(areaInfo, 'province');
},
deep: true
},
city_index: {
handler(newValue) {
let areaInfo = this.province_list[this.province_index] || {};
this.area_index = 0;
this.changeSelectContent(areaInfo, 'city');
},
deep: true
},
area_index: {
handler(newValue) {
let areaInfo = this.province_list[this.province_index] || {};
this.street_index = 0;
this.changeSelectContent(areaInfo, 'area');
},
deep: true
},
street_index: {
handler(newValue) {
let areaInfo = this.province_list[this.province_index] || {};
this.changeSelectContent(areaInfo, 'street');
},
deep: true
},
},
mounted() {
this.$nextTick(function() {
this.getAreaList(0);
})
},
methods: {
//
selectAreaStatusChange(e){
let status = e.show || false;
if(!status) this.$emit("close");
},
//
getAreaList(pid){
let _this = this;
getCityV2(pid).then(res => {
if (Number(res.status) === 200) {
let data = res.data || {};
let singleInfo = data[0] ?? {};
switch (Number(singleInfo.level)) {
case 1:
_this.province_list = data;
_this.changeSelectContent(singleInfo, 'province');
break;
case 2:
_this.city_list = data;
_this.changeSelectContent(singleInfo, 'city');
break;
case 3:
_this.area_list = data;
_this.changeSelectContent(singleInfo, 'area');
break;
case 4:
_this.street_list = data;
_this.changeSelectContent(singleInfo, 'street');
break;
}
_this.$forceUpdate();
}
}).catch(err => {
console.log('地区获取失败', err)
});
},
// -
changeArea(e){
let indexArr = e.detail.value || e.target.value;
this.province_index = indexArr[0] || 0;
this.city_index = indexArr[1] || 0;
this.area_index = indexArr[2] || 0;
this.street_index = indexArr[3] || 0;
},
//
changeSelectContent(areaInfo, type){
if(type != 'street') this.getAreaList(areaInfo.id);
this.$emit('changeArea',{
type: type,
value: areaInfo
});
},
}
}
</script>
<style scoped lang="scss">
.select-area-popup{
min-height: 80vh!important;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
background: #FFFFFF;
.picker-view {
width: 100vw!important;
height: 80vh!important;
margin-top: 20rpx;
}
.item {
height: 100rpx!important;
line-height: 100rpx!important;
text-align: center;
}
}
</style>

View File

@ -574,6 +574,12 @@
"style": {
"navigationBarTitleText": "积分变更记录"
}
},
{
"path": "write_off/index",
"style": {
"navigationBarTitleText": "优惠券核销"
}
}
]
},

View File

@ -1,11 +1,69 @@
<template>
<view class="main-content">
<!--标题-->
<view class="title">{{ page_title }}</view>
<!--表单-->
<view class="form-content">
<view class="line">
<view class="line-content">
<view class="title">邀请人</view>
<view class="right">
<view class="user-content" v-if="invite_agent_info.uid > 0">
<image class="image-img-image" :src="invite_agent_info.user.avatar" mode="widthFix"></image>
<view class="user-info">
<view class="nickname">{{ invite_agent_info.user.nickname}}</view>
<view class="uid">UID{{ invite_agent_info.user.uid}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="line">
<view class="line-content">
<view class="title">联系人姓名</view>
<input type="text" v-model="apply_info.contact_name" maxlength="15" placeholder="请输入联系人姓名" />
</view>
</view>
<view class="line">
<view class="line-content">
<view class="title">联系人电话</view>
<input type="text" v-model="apply_info.contact_phone" maxlength="20" placeholder="请输入联系人电话" />
</view>
</view>
<!-- 地区选择2=省公司,3=省合伙人(外勤),4=省合伙人(内勤),5=区县运营商,6=区县合伙人,7=餐厅显示 -->
<!-- 区县 5=区县运营商,6=区县合伙人,7=餐厅显示 -->
<!-- /街道 7=餐厅显示 -->
<block v-if="['2','3','4','5','6','7'].includes(String(agent_type))">
<view class="line">
<view class="line-content">
<view class="title">地区选择</view>
<input type="text" placeholder="点击选择地区信息" readonly disabled @click="areaPopupChange" />
</view>
</view>
</block>
<!-- 仅餐厅 显示详细地址定位 商户名称商户分类商户类型营业执照及行业相关资质证明图片 -->
<block v-if="agent_type == 7">
邀请下级入驻
</block>
<!--提交按钮-->
<view class="group-btn">
<view class="add-btn">提交</view>
</view>
</view>
<!-- 地区选择器 -->
<areaSelect
:isShow="area_status"
:is_show_province="['2','3','4','5','6','7'].includes(String(agent_type))"
:is_show_city="['5','6','7'].includes(String(agent_type))"
:is_show_area="['5','6','7'].includes(String(agent_type))"
:is_show_street="['7'].includes(String(agent_type))"
@close="areaPopupChange(false)"
@changeArea="areaChange"
></areaSelect>
<!--授权登录-->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize>
</view>
@ -14,22 +72,40 @@
<script>
import {mapGetters} from "vuex";
import authorize from '@/components/Authorize';
import areaSelect from '@/components/areaSelect';
import {getSingleAgentInfo,getAgentConfig} from "@/api/agent";
export default {
name: 'business',
components: {
authorize,
areaSelect
},
computed: {
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor'])
},
data() {
return {
page_title: '修改申请信息',
config: {},
//
isAuto: false, //
isShowAuth: false,//
//
qrCode: '',
//
invite_agent_info: {},
agent_type: 0,// 2=,3=(),4=(),5=,6=,7=,8=
agent_id: 0,// id
apply_info_id: 0,// id
apply_info:{
pid: 0,
},
//
area_status: false,
}
},
onLoad(options) {
@ -38,8 +114,14 @@ export default {
console.log('转换前参数:',options.scene)
let scene = _this.$util.getUrlParams(decodeURIComponent(options.scene));
console.log("接收参数",scene)
_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){
_this.$util.Tips({
title: '非法访问,无邀请人!',
},{tab:1,url:'/pages/user/index'});
}
//
if (!this.isLogin) {
@ -65,11 +147,80 @@ export default {
},
//
init () {
this.getInviteAgentInfo()
this.generatePageTitle();
this.getConfig();
},
//
getInviteAgentInfo(){
let _this = this;
getSingleAgentInfo(_this.agent_id).then(res => {
if (res.status == 200) {
let data = res.data || {};
if(Number(data.id) <= 0){
_this.$util.Tips({
title: '非法访问,无有效邀请人!'
},{tab:1,url:'/pages/user/index'});
return false;
}else{
_this.invite_agent_info = data || {};
}
}
}).catch(err => {
this.$util.Tips({title: err});
});
},
//
generatePageTitle(){
let _this = this;
let title = '修改申请信息';
//
if(Number(_this.apply_info_id) <= 0){
title = '申请成为';
switch (Number(_this.agent_type)) {
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;
}
}
//
uni.setNavigationBarTitle({
title: title
});
_this.page_title = title;
},
//
getConfig(){
let _this = this;
getAgentConfig().then(res => {
if (res.status == 200) {
_this.config = res.data || {};
}
}).catch(err => {
this.$util.Tips({title: err});
});
},
// - /
areaPopupChange(status = true){
this.area_status = status;
},
// -
areaChange(data){
console.log("地区改变", data)
}
@ -84,5 +235,152 @@ export default {
</script>
<style scoped lang="scss">
.main-content{
width: 100vw!important;
min-height: 100vh!important;
background: orange;
padding: 0 20rpx 100rpx 20rpx;
.title{
height: 100rpx;
line-height: 100rpx;
font-size: 32rpx;
width: 100%;
text-align: center;
font-weight: bold;
}
.form-content{
background: #FFFFFF;
border-radius: 20rpx!important;
padding: 20rpx!important;
.line{
width: 100%;
.line-content{
width: 100%;
display: inline-flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
flex-wrap: nowrap;
.title{
font-size: 28rpx;
width: 150rpx;
text-align: right;
}
input{
width: calc(100% - 165rpx) !important;
}
.right{
width: calc(100% - 165rpx) !important;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
.right-btn{
color: #fff;
background-color: #409eff;
border-color: #409eff;
width: 150rpx;
text-align: center;
height: 50rpx;
line-height: 50rpx;
border-radius: 10rpx;
}
.box-value{
width: calc(100% - var(--box-width-));
.image-size-set{
width: 210rpx;
height: 210rpx;
border: 2rpx solid #dddddd;
border-radius: 8rpx;
display: inline-flex;
flex-direction: row;
justify-content: center;
flex-wrap: nowrap;
align-items: center;
image{
max-width: 100% !important;
max-height: 100% !important;
}
}
.upload-btn-box{
font-size: 24rpx;
color: #999999;
display: inline-flex;
flex-direction: column!important;
justify-content: center;
flex-wrap: nowrap;
align-items: center;
.upload-btn-icon{
width: 45rpx !important;
}
}
}
}
}
.user-content{
width: 100%;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
.image-img-image{
width: 80rpx!important;
height: 80rpx!important;
border-radius: 50% !important;
margin-right: 15rpx!important;
}
.user-info{
width: calc(100% - 100rpx);
.nickname{
height: 40rpx;
line-height: 40rpx;
font-size: 28rpx;
font-weight: bold;
}
.uid{
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
}
}
}
}
.group-btn{
margin-top: 80rpx!important;
width: 100%;
display: inline-flex;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
flex-direction: row;
.add-btn{
height: 80rpx;
line-height: 80rpx;
width: 100%;
text-align: center;
font-size: 30rpx;
color: #fff;
background-color: #409eff;
border-color: #409eff;
border-radius: 15rpx;
}
}
}
}
.picker-box{
width: 100% !important;
text-align: left!important;
height: 43rpx;
}
</style>

View File

@ -3,7 +3,7 @@
<!--申请表单-->
<view class="form-content">
<!--背景图片-->
<image mode="widthFix" class="bg-img" src="@/static/images/supplier/supplier_apply_bg.png" />
<image mode="widthFix" class="bg-img" src="@/static/images/supplier/supplier_apply_bg.jpg" />
<!--表单内容-->
<view class='form-main'>
<!--申请记录查看按钮-->
@ -188,7 +188,7 @@ export default {
onLoad(options) {
let _this = this;
if(options.scene){
// console.log('',options.scene)
console.log('转换前参数:',options.scene)
let scene = _this.$util.getUrlParams(decodeURIComponent(options.scene));
// console.log("",scene)
this.apply_info.invite_agent_id = scene.agent_id || 0;
@ -309,9 +309,6 @@ export default {
this.$util.Tips({title: err});
});
}
}
}
</script>
@ -441,8 +438,10 @@ export default {
}
}
}
.list-item{
padding: 20rpx 0;
}
.list-item:not(:last-child){
padding-bottom: 35rpx;
border-bottom: 1px solid #eee;
}
.submit-btn{

View File

@ -18,17 +18,17 @@
<block v-if="item.status == 0">
<view v-if="item.coupon.send_type == 5" class='money vip-coupon'>
<view class="line1 coupon_value"><text class='num'>{{item.coupon_price}}</text></view>
<view class="pic-num">{{ item.use_min_price }}元可用</view>
<!--<view class="pic-num">{{ item.use_min_price }}元可用</view>-->
</view>
<view v-else class='money' :style="{ 'background-image': `url(${domain}/static/diy/couponBg${keyColor}.png)` }">
<view class="line1 coupon_value"><text class='num'>{{item.coupon_price}}</text></view>
<view class="pic-num">{{ item.use_min_price }}元可用</view>
<!--<view class="pic-num">{{ item.use_min_price }}元可用</view>-->
</view>
</block>
<view v-else class='money moneyGray'>
<view><text class='num'>{{item.coupon_price}}</text></view>
<view class="pic-num">{{ item.use_min_price }}元可用</view>
<!--<view class="pic-num">{{ item.use_min_price }}元可用</view>-->
</view>
<view class='text'>
<view class='condition line1'>
@ -111,7 +111,7 @@
if(value){
var newDate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(value)
return newDate[0]
}
}
}
},
onLoad(options) {

View File

@ -0,0 +1,74 @@
<template>
<view class="main-content">
<view class="main-box">
主要内容
</view>
<!--授权登录-->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize>
</view>
</template>
<script>
import {mapGetters} from "vuex";
import authorize from '@/components/Authorize';
export default {
components: {
authorize
},
data() {
return {
//
isAuto: false, //
isShowAuth: false,//
}
},
computed: {
...mapGetters(['isLogin', 'userInfo', 'viewColor'])
},
onLoad() {},
//
onReachBottom() {},
methods: {
//
onLoadFun() {
if(this.isLogin){
this.isShowAuth = false;
this.init();
}
},
//
authClose(e) {
this.isShowAuth = e
},
//
init () {
},
}
}
</script>
<style lang="scss" scoped>
.main-content {
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB