You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
yanzong_qianduan/pages/member/index.vue

604 lines
14 KiB

<template>
<view class="member">
<u-navbar :title="title" :border-bottom="false" backIconColor="#fff" title-color="#fff" :background="background"></u-navbar>
<view class="member-hd" v-if="showTtype == 1 || showTtype == 2">
<view class="title">商业类型</view>
<view class="tab">
<view class="item" :class="tabIndex1 == 0?'item-on':''" @click="tabItem1(0)">企业商户</view>
<view class="item" :class="tabIndex1 == 1?'item-on':''" @click="tabItem1(1)">个体工商户</view>
</view>
</view>
<view class="member-bd" v-if="showTtype == 1 || showTtype == 2">
<view class="a">
<view class="item">
<view class="l">店铺名称</view>
<view class="r">
<input v-model="shop_name" type="text" placeholder="填写店铺名称或公司名称" />
</view>
</view>
<view class="item">
<view class="l">主营品类</view>
<input type="text" disabled style="text-align: right;" placeholder="可多选" />
</view>
<view class="items">
<view class="li" v-for="(a,i) in list" :key="i" :class="a.isClick?'li-on':''" @click="tabItem(i)">{{a.name}}</view>
</view>
</view>
<view class="a">
<view class="item">
<view class="l">联系人</view>
<view class="r">
<input v-model="real_name" type="text" placeholder="填写联系人" />
</view>
</view>
<view class="item">
<view class="l">联系人电话</view>
<view class="r">
<input v-model="mobile" type="number" placeholder="填写联系人电话" />
</view>
</view>
<view class="item">
<view class="l">服务城市</view>
<picker style="flex: 1;" mode="multiSelector" @change="multiChange" @columnchange="columnChange" value="{{multiIndex}}" :range="multiArray" range-key="name">
<view class="pbox" :style="{'color': cityInfo.province?'#303030':'gray' }">
{{cityInfo.province?cityInfo.province+cityInfo.city+cityInfo.area:'请选择服务城市'}}
</view>
</picker>
<image src="https://www.amiami.com.cn/static/caigou/icon-arrow.png"></image>
</view>
</view>
</view>
<view class="member-bd" style="margin-top: 200rpx;" v-if="showTtype == 3 || showTtype == 4">
<view class="b">
<image src="https://www.amiami.com.cn/static/caigou/success.png"></image>
<view class="title">{{info.apply_status == 10?'待审核':'当前已认证'}}</view>
</view>
</view>
<view class="member-fd" v-if="showTtype <= 3">
<view class="btn" v-if="showTtype == 1" @click="toSubmit()">立即提交合作意向</view>
<view class="btn" v-if="showTtype == 2" @click="toSubmit1()">编辑并提交</view>
<view class="btn" v-if="showTtype == 3" @click="toSubmit2()">立即修改</view>
</view>
</view>
</template>
<script>
import * as AddressApi from '@/api/address'
import * as newFunApi from '@/api/newFun'
import Config from '@/core/config'
import * as CaptchaApi from "@/api/captcha";
export default{
data() {
return {
title: "",
showTtype: 5,
tabIndex1: 0,
background: {
background: 'url(https://www.amiami.com.cn/static/news1/bg@2x1.png) center top no-repeat',
backgroundSize: '100% auto',
},
list: [{
name: "大小家电",
isClick: false,
index: 0
},{
name: "家具家居",
isClick: false,
index: 1
},{
name: "家装建材",
isClick: false,
index: 2
},{
name: "3C数码",
isClick: false,
index: 3
},{
name: "日用百货",
isClick: false,
index: 4
},{
name: "生鲜超市",
isClick: false,
index: 5
},{
name: "母婴用品",
isClick: false,
index: 6
},{
name: "美妆护肤",
isClick: false,
index: 7
},{
name: "社区团购",
isClick: false,
index: 8
},{
name: "餐饮酒店",
isClick: false,
index: 9
},{
name: "文体户外",
isClick: false,
index: 10
},{
name: "物业房产",
isClick: false,
index: 11
},{
name: "菜鸟驿站",
isClick: false,
index: 12
},{
name: "其它",
isClick: false,
index: 13
}],
cityInfo: {
province: '',
city: '',
area: ''
},
multiIndex: [0, 0],
multiArray: [],
multiData: [],
province_id: "",
city_id: "",
info: {},
form: {
name: '',
phone: '',
region: [],
detail: ''
},
isClick: true
}
},
onLoad() {
this.getProvinceAll();
this.getInfo();
},
methods: {
toSubmit2() {
this.showTtype = 2
},
async getInfo() {
const that = this;
const { status, data, message } = await newFunApi.getApplyInfo({});
if(status == 200){
this.info = data.info;
if(!data.info){
this.showTtype = 1
this.title="申请服务商"
}else if(data.info && data.info.apply_status == 20){
this.showTtype = 4
this.title= "我的服务商"
}else if(data.info && data.info.apply_status == 10){
this.showTtype = 3
this.real_name = data.info.real_name
this.mobile = data.info.mobile
this.tabIndex1 = (data.info.shop_type == 10?1:0)
this.shop_name = data.info.shop_name
this.business = data.info.business
if(data.info && data.info.business){
let business = data.info.business.split(",");
business.map(a=>{
that.list.map(b=>{
if(a == b.name){
b.isClick = true
}
})
})
}
this.title="编辑服务商"
this.cityInfo.province = data.info.city.split("-")[0]
this.cityInfo.city = data.info.city.split("-")[1]
this.form.region = [{
label: this.cityInfo.province
}, {
label: this.cityInfo.city
}]
}else if(data.info && data.info.apply_status == 30){
this.showTtype = 2
this.title="编辑服务商"
}
}
},
async toSubmit() {
if(!this.shop_name){
uni.showToast({
icon: "none",
title: "店铺名称不能为空!"
})
return ;
}
if(!this.business){
uni.showToast({
icon: "none",
title: "请选择主营类目!"
})
return ;
}
if(!this.real_name){
uni.showToast({
icon: "none",
title: "联系人不能为空!"
})
return ;
}
if(!/^1[3456789]\d{9}$/.test(this.mobile)){
uni.showToast({
icon: "none",
title: "联系人电话不能为空!"
})
return ;
}
if(!this.cityInfo.province){
uni.showToast({
icon: "none",
title: "服务城市不能为空!"
})
return ;
}
if(this.isClick == false){
return ;
}
this.isClick = false;
const that = this;
console.log({
real_name: this.real_name,
mobile: this.mobile,
shop_type: this.tabIndex1 == 0?10: 20,
shop_name: this.shop_name,
business: this.business,
city: this.cityInfo.province+"-"+this.cityInfo.city,
})
const { status, data, message } = await newFunApi.applyProviders({
real_name: this.real_name,
mobile: this.mobile,
shop_type: this.tabIndex1 == 0?10: 20,
shop_name: this.shop_name,
business: this.business,
city: this.cityInfo.province+"-"+this.cityInfo.city,
})
if(status == 200) {
uni.showToast({
title: "提交成功"
})
this.isClick = true;
setTimeout(()=>{
that.getInfo();
},1000)
}else{
uni.showToast({
icon: "none",
title: message
})
this.isClick = true;
}
},
async toSubmit1() {
if(!this.shop_name){
uni.showToast({
icon: "none",
title: "店铺名称不能为空!"
})
return ;
}
if(!this.business){
uni.showToast({
icon: "none",
title: "请选择主营类目!"
})
return ;
}
if(!this.real_name){
uni.showToast({
icon: "none",
title: "联系人不能为空!"
})
return ;
}
if(!/^1[3456789]\d{9}$/.test(this.mobile)){
uni.showToast({
icon: "none",
title: "联系人电话不能为空!"
})
return ;
}
if(!this.cityInfo.province){
uni.showToast({
icon: "none",
title: "服务城市不能为空!"
})
return ;
}
if(this.isClick == false){
return ;
}
this.isClick = false;
const that = this;
const { status, data, message } = await newFunApi.editApplyProviders({
real_name: this.real_name,
mobile: this.mobile,
shop_type: this.tabIndex1 == 0?10: 20,
shop_name: this.shop_name,
business: this.business,
city: this.cityInfo.province+"-"+this.cityInfo.city,
})
if(status == 200) {
uni.showToast({
title: "提交成功"
})
this.isClick = true;
setTimeout(()=>{
that.getInfo();
},1000)
}else{
uni.showToast({
icon: "none",
title: message
})
this.isClick = true;
}
},
async getProvinceAll() {
let {
status,
message,
data
} = await AddressApi.province();
if (status == 200) {
this.multiData = data.list;
var multiIndex = this.multiIndex;
this.multiArray = [
this.multiData,
this.multiData[0].children,
// this.multiData[0].children[0].children
]
}
},
// 获取多列的索引
multiChange: function(e) {
this.multiIndex = e.detail.value;
let a_name = this.multiArray[0][e.detail.value[0]].name;
let a_id = this.multiArray[0][e.detail.value[0]].id;
let b_name = this.multiArray[1][e.detail.value[1]].name;
let b_id = this.multiArray[1][e.detail.value[1]].id;
// let c_name = this.multiArray[2][e.detail.value[2]].name;
// let c_id = this.multiArray[2][e.detail.value[2]].id;
this.cityInfo.province = a_name;
this.cityInfo.city = b_name;
// this.cityInfo.area = c_name;
this.form.region = [{
value: a_id,
label: a_name
}, {
value: b_id,
label: b_name
},
// {
// value: c_id,
// label: c_name
// }
];
},
// 选择列
columnChange: function(e) {
var _this = this;
var columnIndex = e.detail.column;
var columnValue = e.detail.value;
_this.multiIndex[columnIndex] = columnValue;
this.multiArray = [
_this.multiData,
_this.multiData[_this.multiIndex[0]].children,
// _this.multiData[_this.multiIndex[0]].children[_this.multiIndex[1]].children
]
},
tabItem(i){
this.list[i].isClick = !this.list[i].isClick;
let arr = [];
this.list.map(a=>{
if(a.isClick){
arr.push(a.name)
}
})
this.business = arr.join(",")
},
tabItem1(i){
this.tabIndex1 = i
},
async getList() {
uni.showLoading({
title:"加载中"
})
const {status, data} = await newFunApi.inviteGetList({});
if(status == 200){
uni.hideLoading();
this.list = data.list.data;
this.total = data.list.total
}
},
}
}
</script>
<style lang="scss" scoped>
.member{
background: #f5f5f5 url(https://www.amiami.com.cn/static/news1/bg@2x1.png) center top no-repeat;
background-size: 100% auto;
padding-bottom: 160rpx;
min-height: 100vh;
&-hd{
width: 702rpx;
height: 202rpx;
background: #FFFFFF;
border-radius: 10rpx;
margin: 0 auto;
padding: 20rpx 30rpx 0;
box-sizing: border-box;
margin-top: 200rpx;
.title{
font-weight: 400;
font-size: 34rpx;
color: #333333;
}
.tab{
display: flex;
justify-content: space-between;
margin-top: 20rpx;
.item{
width: 306rpx;
line-height: 80rpx;
background: #FFFFFF;
border-radius: 10rpx;
border: 1px solid #CCCCCC;
text-align: center;
font-size: 30rpx;
color: #666666;
&-on{
border-color: #F34A40;
color: #F34A40;
}
}
}
}
&-bd{
padding: 0 25rpx;
overflow: hidden;
.b{
padding: 120rpx 30rpx;
background-color: #fff;
background: #FFFFFF;
border-radius: 10rpx;
margin-top: 20rpx;
.title{
font-size: 36rpx;
color: #222222;
text-align: center;
margin-top: 30rpx;
}
image{
width: 189rpx;
height: 166rpx;
display: block;
margin: 0 auto;
margin-top: 80rpx;
}
}
.a{
padding: 0 30rpx;
background-color: #fff;
background: #FFFFFF;
border-radius: 10rpx;
margin-top: 20rpx;
.item{
padding: 25rpx 0;
display: flex;
align-items: center;
border-top: 1px solid #E9E9E9;
&:first-child{
border-top-color: #fff;
}
.l{
font-size: 28rpx;
color: #222222;
height: 50rpx;
line-height: 50rpx;
width: 200rpx;
}
input{
flex: 1;
font-size: 28rpx;
color: #222222;
height: 50rpx;
line-height: 50rpx;
}
.code{
font-weight: 400;
font-size: 28rpx;
color: #F34A40;
}
image{
width: 11rpx;
height: 20rpx;
margin: 0;
}
}
.items{
overflow: hidden;
width: 110%;
.li{
min-width: 152rpx;
line-height: 70rpx;
background: #fff;
border-radius: 10rpx;
text-align: center;
margin-bottom: 20rpx;
margin-right: 11rpx;
float: left;
font-size: 28rpx;
color: #333333;
border: 1px solid #E2E2E2;
&-on{
color: #F34A40;
border: 1px solid #F34A40;
}
}
}
.tips{
width: 662rpx;
min-height: 246rpx;
background: #FFF6F5;
border-radius: 10rpx;
padding: 20rpx;
box-sizing: border-box;
margin: 10rpx auto;
line-height: 50rpx;
}
.rule{
display: flex;
align-items: center;
font-size: 24rpx;
color: #333333;
padding: 20rpx 0;
image{
width: 30rpx;
height: 30rpx;
margin: 0;
margin-right: 10rpx;
}
text{
color: #F34A40;
}
}
}
}
&-fd{
height: 140rpx;
width: 100%;
position: fixed;
left: 0;
bottom: 0;
z-index: 22;
background-color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
.btn{
width: 662rpx;
height: 90rpx;
line-height: 90rpx;
background: #F34A40;
border-radius: 90rpx;
text-align: center;
font-size: 32rpx;
color: #FFFFFF;
&-on{
background-color: #ccc;
}
}
}
}
</style>