742 lines
16 KiB
Vue
742 lines
16 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="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="uicon" style="background:#2A96FE; ">
|
|
<text>起</text>
|
|
</view> -->
|
|
<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>
|
|
<!-- <image src="../../static/dingwei.png" mode=""></image> -->
|
|
</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.contactNumber" placeholder="请输入商品电话">
|
|
</view>
|
|
</view>
|
|
|
|
<!-- <view class="list-box">
|
|
<view class="l-left">地址</view>
|
|
<view class="l-right">
|
|
<input type="text" v-model="shoplist.address" placeholder="请输入地址">
|
|
</view>
|
|
</view> -->
|
|
<view class="list-box">
|
|
<view class="l-left">营业时间</view>
|
|
<view class="l-right">
|
|
<input type="text" v-model="shoplist.workTime" placeholder="请输入地址">
|
|
</view>
|
|
</view>
|
|
|
|
<view class="thui">店铺描述</view>
|
|
|
|
<view class="">
|
|
<u--textarea v-model="shoplist.remark" placeholder="请输入店铺描述" border="none"></u--textarea>
|
|
</view>
|
|
<view class="thui">店铺图片</view>
|
|
<view class="imgs">
|
|
<u-upload
|
|
:fileList="fileList4"
|
|
@afterRead="afterRead"
|
|
@delete="deletePic"
|
|
name="4"
|
|
multiple
|
|
:maxCount="5"
|
|
></u-upload>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="dlanniu" @click="getgoods()" >
|
|
<text>确认修改</text>
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<u-picker @change="getxz" @confirm="getyes()" @cancel="getyes()" :show="show" :columns="fenlist" keyName="categoryName"></u-picker>
|
|
<!-- 底部 -->
|
|
|
|
|
|
</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,
|
|
goodsId:'',
|
|
one:false,
|
|
two:false,
|
|
three:false,
|
|
show:false,
|
|
guige:false,
|
|
msg:'3',
|
|
tapnum:0,
|
|
value5:'',
|
|
tian:{
|
|
skuName:'',//规格名称
|
|
price:''//规格价格
|
|
},
|
|
fileList4:[],
|
|
fileList6:[],
|
|
taplist:[
|
|
{Text:'已发布'},
|
|
{Text:'待上架'},
|
|
],
|
|
fenlist:[],
|
|
ftitle:null,
|
|
shopImages:[],
|
|
shoplist:{
|
|
partnerLogo:"",//logo
|
|
shopImages:[],
|
|
partnerName:"",//名称
|
|
contactNumber:"",//电话
|
|
address:"山东济南槐荫和谐妇科",//地址
|
|
latitude:"39.984120",//维度
|
|
longitude:"116.307484",//精度
|
|
remark:"店铺描述",
|
|
workTime:"24小时",
|
|
},
|
|
province:'',
|
|
city:'',
|
|
area:'',
|
|
four:'',
|
|
|
|
|
|
}
|
|
},
|
|
onLoad() {
|
|
|
|
// this.getindex()
|
|
this.getshop()
|
|
},
|
|
onShow() {
|
|
|
|
},
|
|
|
|
methods: {
|
|
async getshop(){
|
|
// 回显
|
|
let data ={
|
|
partnerId: uni.getStorageSync('partnerId')
|
|
}
|
|
let res = await request({
|
|
url:'/partnerOwn/partner/getPartnerInfo',
|
|
method: 'post',
|
|
params: data
|
|
})
|
|
this.shoplist = res.data
|
|
// 省市区
|
|
var address = res.data.address;
|
|
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
|
|
}
|
|
)
|
|
console.log(this.fileList6);
|
|
if(res.data.shopImageList){
|
|
res.data.shopImageList.forEach(it=>{
|
|
if(it){
|
|
this.fileList4.push(
|
|
{
|
|
url: this.baseUrl + it
|
|
})
|
|
}
|
|
|
|
})
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// async getindex(){
|
|
|
|
// let resx = await request({
|
|
// url:'/partnerOwn/partner/goodsDetail?goodsId='+this.releasebox.id,
|
|
// method: 'get',
|
|
// })
|
|
// console.log(resx);
|
|
|
|
|
|
// // 获取分类信息
|
|
// let res = await request({
|
|
// url:'/system/shopInspectionCategory/list',
|
|
// method: 'get',
|
|
// })
|
|
// let arr = res.rows
|
|
// this.fenlist.push(arr)
|
|
// console.log('获取分类信息',this.fenlist);
|
|
// },
|
|
// 提交修改
|
|
async getgoods(){
|
|
|
|
if(this.shoplist.partnerName == "" ||this.shoplist.contactNumber == "" ||this.shoplist.remark == "" ||this.shoplist.workTime == "" ){
|
|
uni.showToast({
|
|
title:"以上均为必填项!!!",
|
|
icon:"none"
|
|
})
|
|
return
|
|
}
|
|
console.log(this.shopImages)
|
|
this.shoplist.address = this.province + this.city + this.area + this.four
|
|
this.shoplist.shopImages = this.shopImages.join(",")
|
|
let res = await request({
|
|
url:'/partnerOwn/partner/editPartnerInfo',
|
|
method: 'post',
|
|
data : this.shoplist
|
|
})
|
|
console.log(res);
|
|
if(res.code == 200){
|
|
uni.showToast({
|
|
title:"修改成功"
|
|
})
|
|
}
|
|
setTimeout(() => {
|
|
uni.navigateBack()
|
|
}, 2000);
|
|
},
|
|
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.four = 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);
|
|
|
|
}
|
|
});
|
|
|
|
},
|
|
|
|
// 以下均为图片方法----------------------
|
|
// 删除图片
|
|
deletePic(event) {
|
|
this[`fileList${event.name}`].splice(event.index, 1)
|
|
},
|
|
// 新增图片
|
|
async afterRead(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.uploadFilePromise(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++
|
|
}
|
|
},
|
|
uploadFilePromise(url) {
|
|
let that = this
|
|
console.log(that.fileList4)
|
|
console.log(url);
|
|
upload({
|
|
url:'/common/upload',
|
|
filePath: url,
|
|
}).then((res)=>{
|
|
this.shopImages.push(res.fileName)
|
|
})
|
|
},
|
|
// 第二遍
|
|
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) {
|
|
console.log(url);
|
|
upload({
|
|
url:'/common/upload',
|
|
filePath: url,
|
|
}).then((res)=>{
|
|
console.log('封面图',res.fileName);
|
|
this.shoplist.partnerLogo = res.fileName
|
|
})
|
|
|
|
},
|
|
|
|
}
|
|
}
|
|
</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);
|
|
}
|
|
.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>
|