Merge pull request '邓洁 : 发布店铺转让接口' (#76) from dj into master
Reviewed-on: http://git.feashow.cn/odjbin/city-store-transfer/pulls/76
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="detail" ref="viewref">
|
<view class="detail" ref="viewref">
|
||||||
<view class="swiper">
|
<view class="swiper">
|
||||||
<u-swiper :list="shopInfo.pics" keyName="pics" height="500rpx" radius="0"></u-swiper>
|
<u-swiper :list="shopInfo.pics" height="500rpx" radius="0"></u-swiper>
|
||||||
</view>
|
</view>
|
||||||
<view class="sub-detail u-flex">
|
<view class="sub-detail u-flex">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
@@ -100,7 +100,17 @@
|
|||||||
this.$api.getShopDetail(type, id).then(res => {
|
this.$api.getShopDetail(type, id).then(res => {
|
||||||
const data = res.data.data
|
const data = res.data.data
|
||||||
if (res.data.code == 1) {
|
if (res.data.code == 1) {
|
||||||
data.pics = [this.$api.imgUrl + data.pics]
|
console.log('data.pics', data.pics);
|
||||||
|
var arr = [];
|
||||||
|
var arr1 = [];
|
||||||
|
let obj = {}
|
||||||
|
arr = data.pics.split(",")
|
||||||
|
arr.map(item => {
|
||||||
|
obj = this.$api.imgUrl + item
|
||||||
|
arr1.push(obj)
|
||||||
|
})
|
||||||
|
data.pics = arr1
|
||||||
|
console.log('arr', arr1);
|
||||||
this.shopInfo = data
|
this.shopInfo = data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -162,6 +162,7 @@
|
|||||||
watch: {
|
watch: {
|
||||||
scale(newVal, oldVal) {
|
scale(newVal, oldVal) {
|
||||||
console.log('thisscale', newVal, Math.round(newVal));
|
console.log('thisscale', newVal, Math.round(newVal));
|
||||||
|
this.showShop = false
|
||||||
let ra = ''
|
let ra = ''
|
||||||
this.scaleM.forEach(item => {
|
this.scaleM.forEach(item => {
|
||||||
if (item.scale == Math.round(newVal)) {
|
if (item.scale == Math.round(newVal)) {
|
||||||
@@ -268,10 +269,12 @@
|
|||||||
this.getDetail(1, markerId)
|
this.getDetail(1, markerId)
|
||||||
this.marker.forEach(item => {
|
this.marker.forEach(item => {
|
||||||
if (markerId === item.id) {
|
if (markerId === item.id) {
|
||||||
|
console.log('变红');
|
||||||
item.iconPath = "../../../static/map/sp_icon_hdw.png"
|
item.iconPath = "../../../static/map/sp_icon_hdw.png"
|
||||||
item.width = '58rpx'
|
item.width = '58rpx'
|
||||||
item.height = '72rpx'
|
item.height = '72rpx'
|
||||||
} else {
|
} else {
|
||||||
|
console.log('变绿');
|
||||||
item.iconPath = "../../../static/map/sp_icon_dw.png"
|
item.iconPath = "../../../static/map/sp_icon_dw.png"
|
||||||
item.width = '58rpx'
|
item.width = '58rpx'
|
||||||
item.height = '72rpx'
|
item.height = '72rpx'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view class="upload">
|
<view class="upload">
|
||||||
<view style="padding-left: 20rpx;margin-top: 20rpx;">
|
<view style="padding-left: 20rpx;margin-top: 20rpx;">
|
||||||
<u-upload :fileList="fileList1" :auto-upload="false" @afterRead="afterRead" @delete="deletePic" name="1"
|
<u-upload :fileList="fileList1" :auto-upload="false" @afterRead="afterRead" @delete="deletePic" name="1"
|
||||||
multiple :maxCount="5" :on-preview="preview"></u-upload>
|
multiple :maxCount="5"></u-upload>
|
||||||
</view>
|
</view>
|
||||||
<!-- <u-upload max-count="5" upload-icon="photo"></u-upload> -->
|
<!-- <u-upload max-count="5" upload-icon="photo"></u-upload> -->
|
||||||
<text class="count">发布房源图片({{imageLength}}/5})</text>
|
<text class="count">发布房源图片({{imageLength}}/5})</text>
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
label-width="auto">
|
label-width="auto">
|
||||||
<text @click="show1 = true" class="checkedtext" v-if="form.region.length>0">{{form.region}}</text>
|
<text @click="show1 = true" class="checkedtext" v-if="form.region.length>0">{{form.region}}</text>
|
||||||
<text @click="show1 = true" class="checktext" v-else>请选择所属区域</text>
|
<text @click="show1 = true" class="checktext" v-else>请选择所属区域</text>
|
||||||
|
|
||||||
<view class="arrow-icon">
|
<view class="arrow-icon">
|
||||||
<u-icon name="arrow-right" size="30px" @click="show1 = true"></u-icon>
|
<u-icon name="arrow-right" size="30px" @click="show1 = true"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
@@ -26,7 +25,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="地址" label-position="top" border-bottom="true" prop="address" label-width="auto">
|
<u-form-item label="地址" label-position="top" border-bottom="true" prop="address" label-width="auto">
|
||||||
<u-input v-model="form.address" placeholder="请输入店铺地址" placeholder-class="input-class" border="none"
|
<u-input v-model="form.address" placeholder="请输入店铺地址" placeholder-class="input-class" border="none"
|
||||||
@change="changeAddress"></u-input>
|
@focus="changeAddressFocus" @blur="changeAddress"></u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
|
<u-form-item label="行业" label-position="top" border-bottom="true" class="picker" label-width="auto"
|
||||||
prop="business">
|
prop="business">
|
||||||
@@ -39,8 +38,8 @@
|
|||||||
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm"></u-picker>
|
:columns="[Classcolumns]" v-model="form.business" @confirm="tradeConfirm"></u-picker>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercial">
|
<u-form-item label="业态" label-position="top" border-bottom="true" label-width="auto" prop="commercial">
|
||||||
<text @click="show3 = true" class="checkedtext" v-if="form.commercial.length>0">{{form.commercial}}</text>
|
<text @click="chooseCommercial" class="checkedtext" v-if="form.commercial.length>0">{{form.commercial}}</text>
|
||||||
<text @click="show3 = true" class="checktext" v-else>请选择店铺业态</text>
|
<text @click="chooseCommercial" class="checktext" v-else>请选择店铺业态</text>
|
||||||
<view class="arrow-icon">
|
<view class="arrow-icon">
|
||||||
<u-icon name="arrow-right" size="30px" @click="show3 = true"></u-icon>
|
<u-icon name="arrow-right" size="30px" @click="show3 = true"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
@@ -77,9 +76,9 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
imageLength: '0',
|
imageLength: 0,
|
||||||
fileList1: [],
|
fileList1: [],
|
||||||
regionColumns: [JSON.parse(uni.getStorageSync('regionList'))] || [],
|
regionColumns: [],
|
||||||
|
|
||||||
form: {
|
form: {
|
||||||
title: '',
|
title: '',
|
||||||
@@ -197,9 +196,7 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
for (let i = 0; i < lists.length; i++) {
|
for (let i = 0; i < lists.length; i++) {
|
||||||
console.log('lists[i].url', lists[i].url);
|
|
||||||
const result = await this.uploadFilePromise(lists[i].url)
|
const result = await this.uploadFilePromise(lists[i].url)
|
||||||
console.log('result', result);
|
|
||||||
let item = this[`fileList${event.name}`][fileListLen]
|
let item = this[`fileList${event.name}`][fileListLen]
|
||||||
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
||||||
status: 'success',
|
status: 'success',
|
||||||
@@ -233,40 +230,90 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
const temp = []
|
|
||||||
if (this.fileList1.length > 0) {
|
|
||||||
this.fileList1.map(item => {
|
|
||||||
const url = item.url
|
|
||||||
temp.push(url.replace(this.imgUrl + '/', ''))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
console.log('images---', temp.join(','));
|
|
||||||
this.$refs.uForm.validate().then(res => {
|
this.$refs.uForm.validate().then(res => {
|
||||||
console.log("提交表单信息:" + JSON.stringify(this.form))
|
const temp = []
|
||||||
uni.$u.toast('发布成功')
|
if (this.fileList1.length > 0) {
|
||||||
this.$api.publishTransfer(this.form).then(res => {
|
this.fileList1.map(item => {
|
||||||
console.log(res);
|
const url = item.url
|
||||||
|
temp.push(url.replace(this.imgUrl + '/', ''))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log('images---', temp.join(','));
|
||||||
|
if (this.form.latitude && this.form.longitude) {
|
||||||
|
console.log('经纬度都存在');
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('请输入准确地址')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
...this.form,
|
||||||
|
images: temp.join(',')
|
||||||
|
}
|
||||||
|
console.log('提交表单信息', data);
|
||||||
|
// console.log("提交表单信息:" + JSON.stringify(this.form))
|
||||||
|
this.$api.publishTransfer(data).then(res => {
|
||||||
|
console.log('发布店铺转让', res);
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
uni.$u.toast('发布成功')
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.data.msg)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
console.log("失败信息:" + JSON.stringify(errors))
|
console.log("失败信息:" + JSON.stringify(errors))
|
||||||
// uni.$u.toast('校验失败')
|
// uni.$u.toast('校验失败')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
chooseCommercial() {
|
||||||
|
if (!this.form.business) {
|
||||||
|
uni.$u.toast('请先选择行业')
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
this.show3 = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeAddressFocus() {
|
||||||
|
if (!this.form.region) {
|
||||||
|
uni.$u.toast('请先选择区域')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
changeAddress(e) {
|
changeAddress(e) {
|
||||||
// console.log('changeAddress', e);
|
// console.log('changeAddress', e);
|
||||||
this.getAddressList(e)
|
this.getAddressList(e)
|
||||||
},
|
},
|
||||||
getAddressList(value) {
|
getRegionList() {
|
||||||
var that = this
|
var that = this
|
||||||
uni.request({
|
uni.request({
|
||||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + value + '&key=' +
|
url: 'https://apis.map.qq.com/ws/district/v1/getchildren?id=' + uni.getStorageSync('city_code') + '&key=' +
|
||||||
that.$api.key,
|
that.$api.key,
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log('diz', res.data.result.location);
|
that.regionColumns = [res.data.result[0].map(item => item.fullname)]
|
||||||
// console.log('lat', res.data.result.location.lat);
|
},
|
||||||
that.form.latitude = res.data.result.location.lat
|
fail(err) {
|
||||||
// console.log('lng', res.data.result.location.lng);
|
console.log('请求区域失败:', err);
|
||||||
that.form.longitude = res.data.result.location.lng
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getAddressList(value) {
|
||||||
|
if (!this.form.region) {
|
||||||
|
uni.$u.toast('请先选择区域')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
var that = this
|
||||||
|
uni.request({
|
||||||
|
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + that.form.region + value + '&key=' +
|
||||||
|
that.$api.key,
|
||||||
|
success(res) {
|
||||||
|
console.log('地址转经纬度', res.data);
|
||||||
|
if (res.data.message == "query ok") {
|
||||||
|
// console.log('lat', res.data.result.location.lat);
|
||||||
|
that.form.latitude = res.data.result.location.lat
|
||||||
|
// console.log('lng', res.data.result.location.lng);
|
||||||
|
that.form.longitude = res.data.result.location.lng
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('请输入准确地址')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.log('请求区域失败:', err);
|
console.log('请求区域失败:', err);
|
||||||
@@ -295,9 +342,9 @@
|
|||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
this.$refs.uForm.setRules(this.rules)
|
this.$refs.uForm.setRules(this.rules)
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
this.getRegionList()
|
||||||
this.$api.getClassList().then(res => {
|
this.$api.getClassList().then(res => {
|
||||||
// console.log(res.data.data.length);
|
// console.log(res.data.data.length);
|
||||||
this.Classcolumns = res.data.data.map((item) => {
|
this.Classcolumns = res.data.data.map((item) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user