detection-user/pages/ruzhu/ruzhu.vue
2024-09-01 18:16:43 +08:00

834 lines
19 KiB
Vue

<!-- 商家入驻-->
<template>
<view class="content">
<view style="width: 100%; height: 44px;"></view>
<view class="top-heder">
<view class="t-left" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
</view>
<view class="t-title">
<text>商家入驻</text>
</view>
<view class="t-you"></view>
</view>
<view class="xmbt" style="color: #E6A23C;" v-if="shoplist.status == 1">
<text>待审核</text>
</view>
<view class="xmbt" style="color: #67C23A;" v-if="shoplist.status == 2">
<text>已通过</text>
</view>
<view class="xmbt" style="color: #F56C6C;" v-if="shoplist.status == 3">
<text>未通过</text>
</view>
<view class="xmbt" style="color: #F56C6C;" v-if="shoplist.status == 3">
{{shoplist.rejectReason || ""}}
</view>
<view class="mub">
<view class="top-ail">
<!-- partnerLogo:"",//logo -->
<!-- <u-upload
:fileList="fileList6"
@afterRead="afterRead1"
@delete="deletePic1"
name="6"
multiple
:maxCount="1"
width="355px"
height="126px"
>
<image src="../../static/detection/dplogo.png" style="width: 344px;height: 126px;"></image>
</u-upload> -->
<view class="top">
<view class="top-box" >
<view class="tb-left">
<view class="">
<view class="text1" v-show="four == ''">请选择地址</view>
<view class="text1" v-show="four != ''">{{province}}{{city}}{{area}}</view>
<view class="hong1" v-show="four == ''">*必填,请填写详细地址</view>
<view class="hong2" v-show="four != ''">
<input type="text" :placeholder="four">
</view>
</view>
</view>
<view class="tb-right" @click="getmap()">
<uni-icons type="location-filled" color=" #0D2E8D" size="26"></uni-icons>
</view>
</view>
</view>
<!-- 名称 -->
<view class="box-list">
<view class="list-box">
<view class="l-left">商铺名称</view>
<view class="l-right">
<input type="text" v-model="shoplist.partnerName" placeholder="请输入商铺名称">
</view>
</view>
<view class="list-box">
<view class="l-left">商铺电话</view>
<view class="l-right">
<input type="text" v-model="shoplist.phone" placeholder="请输入商铺电话">
</view>
</view>
<view class="thui">店铺图片</view>
<view class="imgs" >
<u-upload
:fileList="fileList1"
@afterRead="afterRead1"
@delete="deletePic1"
name="1"
multiple
:maxCount="1"
></u-upload>
</view>
<view class="thui">营业执照</view>
<view class="imgs">
<u-upload
:fileList="fileList2"
@afterRead="afterRead2"
@delete="deletePic2"
name="2"
multiple
:maxCount="1"
></u-upload>
</view>
<view class="thui">身份证正面</view>
<view class="imgs">
<u-upload
:fileList="fileList3"
@afterRead="afterRead3"
@delete="deletePic3"
name="3"
multiple
:maxCount="1"
></u-upload>
</view>
<view class="thui">身份证反面</view>
<view class="imgs">
<u-upload
:fileList="fileList4"
@afterRead="afterRead4"
@delete="deletePic4"
name="4"
multiple
:maxCount="1"
></u-upload>
</view>
</view>
<view class="dlanniu" v-if="shoplist.status == 0 || shoplist.status == 3" @click="getgoods()" >
<text>确认提交</text>
</view>
</view>
</view>
<!-- 底部 -->
</view>
</template>
<script>
import config from '@/config';
import request from '../../utils/request';
import upload from '@/utils/upload.js'
export default {
data() {
return {
baseUrl:this.$baseUrl,
imagesUrl: 'http://www.nuoyunr.com/lananRsc/',
goodsId:'',
one:false,
two:false,
three:false,
show:false,
guige:false,
msg:'3',
tapnum:0,
value5:'',
tian:{
skuName:'',//规格名称
price:''//规格价格
},
fileList1:[],
fileList2:[],
fileList3:[],
fileList4:[],
fileList6:[],
taplist:[
{Text:'已发布'},
{Text:'待上架'},
],
fenlist:[],
ftitle:null,
shopImages:[],
shoplist:{
type:'jc',
partnerName:'',
phone:'',
businessLicense:'',//营业执照
shopImage:'',//店铺图片
position:'',//位置
idCardFront:'',//身份证正面
idCardBack:'',//身份证反面
status:0,
},
province:'',
city:'',
area:'',
four:'',
}
},
onLoad() {
this.getshop()
},
onShow() {
},
methods: {
async getshop(){
// 回显
let res = await request({
url:'/appInspection/partner/enterDetail',
method: 'get',
})
if(!res.data){
return
}
if(res.data){
this.shoplist = res.data
}
console.log(this.shoplist);
this.fileList1.push(
{
url:res.data.shopImage
}
)
this.fileList2.push(
{
url:res.data.businessLicense
}
)
this.fileList3.push(
{
url:res.data.idCardFront
}
)
this.fileList4.push(
{
url:res.data.idCardBack
}
)
// 省市区
var address = res.data.position;
var reg = /.+?(省|市|自治区|自治州|县|区)/g;
let addressList=address.match(reg).toString().split(",");
if(addressList[0] == '重庆市' || addressList[0] == '北京市' || addressList[0] == '天津市' || addressList[0] == '上海市'){
this.province = addressList[0];
this.city = '市辖区';
this.area = addressList[1];
this.four = address.replace(this.province,'').replace(this.city,'').replace(this.area,'');
}else{
this.province = addressList[0];
this.city = addressList[1];
this.area = addressList[2];
this.four = address.replace(this.province,'').replace(this.city,'').replace(this.area,'');
};
this.fileList6.push(
{
url: this.baseUrl + res.data.partnerLogo
}
)
if(res.data.shopImageList){
res.data.shopImageList.forEach(it=>{
if(it){
this.fileList4.push(
{
url: this.baseUrl + it
})
}
})
}
},
// 提交修改
async getgoods(){
let res = await request({
url:'/appInspection/partner/enter',
method: 'post',
data : this.shoplist
})
console.log(res);
if(res.code == 200){
uni.showToast({
title:"操作成功"
})
this.getshop()
}
},
getxz(e){
this.releasebox.goodsCategoryId = e.value[0].id
console.log( e.value[0].categoryName)
this.ftitle = e.value[0].categoryName
},
// 添加规格
guigeadd(){
let obj = {
skuname:this.tian.skuname,
price:this.tian.price
}
this.releasebox.skuList.push(obj)
console.log(this.releasebox.skuList);
},
// 删除
getdeletesku(index){
this.releasebox.skuList.splice(index,1)
},
getone(){
this.one =! this.one
if(this.one == false){
this.releasebox.isListing = 0
}
if(this.one == true){
this.releasebox.isListing = 1
}
},
gettwo(){
this.two =! this.two
if(this.two == false){
this.releasebox.isSpecial = 0
}
if(this.two == true){
this.releasebox.isSpecial = 1
}
},
getthree(){
this.three =! this.three
if(this.three == false){
this.releasebox.isAttend = 0
}
if(this.three == true){
this.releasebox.isAttend = 1
}
},
gettapindex(index){
this.tapnum = index
},
getback(){
uni.navigateBack()
},
getyes(){
this.show = false
},
open() {
// this.guige = true
console.log('open');
},
close() {
this.guige = false
// console.log('close');
},
// 以下为地图方法
getmap(){
let that =this
uni.chooseLocation({
success: function (res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
console.log(res)
that.shoplist.latitude = res.latitude
that.shoplist.longitude = res.longitude
that.shoplist.position = res.address
// that.adds = res.address;
// let point = new plus.maps.Point(res.longitude,res.latitude);
var address = res.address;
var reg = /.+?(省|市|自治区|自治州|县|区)/g;
let addressList=address.match(reg).toString().split(",");
if(addressList[0] == '重庆市' || addressList[0] == '北京市' || addressList[0] == '天津市' || addressList[0] == '上海市'){
that.province = addressList[0];
that.city = '市辖区';
that.area = addressList[1];
that.four = address.replace(that.province,'').replace(that.city,'').replace(that.area,'');
}else{
that.province = addressList[0];
that.city = addressList[1];
that.area = addressList[2];
that.four = address.replace(that.province,'').replace(that.city,'').replace(that.area,'');
};
console.log('zdz',that.four);
}
});
},
// 以下均为图片方法----------------------
// 删除图片
deletePic1(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
// 新增图片
async afterRead1(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,
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise1(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
}))
fileListLen++
}
},
uploadFilePromise1(url) {
let that = this
console.log(url);
upload({
url:'/common/uploadImg',
filePath: url,
}).then((res)=>{
this.shoplist.shopImage = res.data.url
})
},
// 第二遍
deletePic2(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
// 新增图片
async afterRead2(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,
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise2(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
}))
fileListLen++
}
},
uploadFilePromise2(url) {
console.log(url);
upload({
url:'/common/uploadImg',
filePath: url,
}).then((res)=>{
console.log('营业执照',res.data.url);
this.shoplist.businessLicense = res.data.url
})
},
// 第三遍
deletePic3(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
// 新增图片
async afterRead3(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,
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise3(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
}))
fileListLen++
}
},
uploadFilePromise3(url) {
console.log(url);
upload({
url:'/common/uploadImg',
filePath: url,
}).then((res)=>{
console.log('身份证正面',res.fileName);
this.shoplist.idCardFront = res.data.url
})
},
// 第四遍
deletePic4(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
// 新增图片
async afterRead4(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,
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise4(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
}))
fileListLen++
}
},
uploadFilePromise4(url) {
console.log(url);
upload({
url:'/common/uploadImg',
filePath: url,
}).then((res)=>{
console.log('身份证反面',res.fileName);
this.shoplist.idCardBack = res.data.url
})
},
}
}
</script>
<style scoped lang="scss">
.content {
box-sizing: border-box;
width: 100%;
height: calc(100vh);
background: white;
}
.top-heder{
width: 100%;
height: 46px;
background: white;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 5px 15px;
}
.t-title{
font-size: 17px;
font-weight: bold;
color: #333333;
}
.t-left{
width: 10%;
}
.t-you{
height: 100%;
width: 20%;
}
.t-input{
width: 80%;
height: 36px;
background: #F0F0F0;
border-radius: 50px;
box-sizing: border-box;
padding: 0 15px;
display: flex;
align-items: center;
}
.top-ail{
width: 100%;
box-sizing: border-box;
padding: 15px;
background-color: #F4F4F4;
// height: calc(100vh);
}
.xmbt{
width: 100%;
background-color: #F4F4F4;
text-align: center;
box-sizing: border-box;
padding-top: 20px;
}
.mub{
background-color: #F4F4F4;
height: calc(100vh);
}
.dix{
display: flex;
align-items: center;
}
.upimg{
width: 100%;
height: 126px;
border-radius: 8px;
box-sizing: border-box;
background-color: white;
image{
width: 100%;
height: 100%;
}
}
.box-list{
width: 100%;
border-radius: 8px;
box-sizing: border-box;
padding: 10px;
background-color: white;
margin: 10px auto;
}
.list-box{
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 15px 5px;
border-bottom: 1px solid #EEEEEE;
}
.l-left{
font-size: 16px;
font-weight: 400;
color: #333333;
}
.l-right{
font-size: 16px;
font-weight: 400;
color: #999999;
text-align: right;
}
.xiaolan{
// width: 109px;
// height: 30px;
background: #E2EAFF;
border-radius: 50px;
display: flex;
align-content: center;
justify-self: center;
box-sizing: border-box;
padding: 5px;
font-size: 14px;
font-weight: 400;
color: #0D2E8D;
}
.xiaohui{
// width: 141px;
// height: 30px;
box-sizing: border-box;
padding: 0px 10px;
background: #F7F7F7;
border-radius: 50px ;
display: flex;
align-items: center;
justify-content: center;
margin: 10px ;
}
.hui-right{
border-left:1px solid #DDDDDD;
padding: 5px;
margin-left: 5px;
}
.wrap-box{
width: 100%;
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
}
.bottom-di{
width: 100%;
height: 56px;
background: #FFFFFF;
border-radius: 8px;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 0px 20px;
margin-bottom: 10px;
}
.thui{
font-size: 16px;
font-weight: 400;
color: #666666;
margin-top: 10px;
margin-left: 8px;
}
.imgs{
box-sizing: border-box;
margin-top: 20px;
}
.p-box{
border-radius: 10px;
overflow: hidden;
box-sizing: border-box;
padding: 20px;
width: 100%;
background-color: white;
}
.p-top{
width: 100%;
text-align: center;
font-size: 17px;
font-weight: bold;
color: #000000;
margin-bottom: 20px;
}
.on-input{
width: 100%;
display: flex;
align-items: center;
box-sizing: border-box;
}
.ipt-kuang{
width: 70%;
height: 30px;
background: #FFFFFF;
border-radius: 8px 8px 8px 8px;
opacity: 1;
border: 1px solid #DDDDDD;
display: flex;
align-items: center;
margin: 10px auto;
box-sizing: border-box;
padding: 0px 10px;
}
.t-left{
width: 20%;
font-size: 14px;
font-weight: 400;
color: #000000;
}
.dlanniu{
width: 80%;
height: 45px;
background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%);
border-radius: 50px;
display: flex;
align-items: center;
justify-content: center;
margin: 20px auto;
color: white;
}
.da{
font-size: 16px;
}
//
.top{
box-sizing: border-box;
padding: 0px 15px;
width: 100%;
border-radius: 10px;
margin: 10px auto;
background-color: white;
}
.top-box{
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 20px 0px;
}
.tb-left{
height: 100%;
width: 80%;
display: flex;
align-items: center;
}
.uicon{
width: 18px;
height: 18px;
border-radius: 4px;
color: white;
background: orangered;
display: flex;
justify-content: center;
align-items: center;
font-size: 12px;
font-weight: bold;
margin-right: 6px;
}
.tb-right{
width: 20px;
height: 26px;
image{
width: 100%;
height: 100%;
}
}
.text1{
font-size: 16px;
font-weight: bold;
color: #363636;
}
.hong1{
margin-top: 5px;
font-size: 12px;
font-weight: 400;
color: #FF5453;
}
.hong2{
margin-top: 5px;
font-size: 12px;
font-weight: 400;
}
.tinput{
width: 100%;
display: flex;
background: white;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 16px;
margin-top: 14px;
}
</style>