|
@@ -14,6 +14,10 @@
|
|
|
<view class="dw icon" @click="wz(1)"></view>
|
|
|
</view>
|
|
|
<view class="form_group hr">
|
|
|
+ <view class="lable">地图坐标</view>
|
|
|
+ <input type="number" placeholder="请在地图上选择坐标" @click="wz(2)" v-model="zb" :disabled="true" />
|
|
|
+ </view>
|
|
|
+ <view class="form_group hr">
|
|
|
<view class="lable">老板名称</view>
|
|
|
<input type="text" placeholder="请输入老板名称" v-model="item.bossName" />
|
|
|
</view>
|
|
@@ -21,10 +25,6 @@
|
|
|
<view class="lable">老板电话</view>
|
|
|
<input type="number" placeholder="请输入老板电话" v-model="item.bossPhone" />
|
|
|
</view>
|
|
|
- <view class="form_group hr">
|
|
|
- <view class="lable">地图坐标</view>
|
|
|
- <input type="number" placeholder="请在地图上选择坐标" @click="wz(2)" v-model="zb" :disabled="true" />
|
|
|
- </view>
|
|
|
<view class="form_group"><view class="lable">商铺展示</view></view>
|
|
|
<view class="pl5">
|
|
|
<u-upload
|
|
@@ -34,7 +34,7 @@
|
|
|
:size-type="upload.size"
|
|
|
:max-count="upload.count"
|
|
|
:name="upload.name"
|
|
|
- :file-list="fileList"
|
|
|
+ :file-list="item.showPictures"
|
|
|
:deletable="item.auditFlag != 1"
|
|
|
:show-progress="item.auditFlag != 1"
|
|
|
:custom-btn="item.auditFlag == 1"
|
|
@@ -43,10 +43,8 @@
|
|
|
height="140"
|
|
|
></u-upload>
|
|
|
</view>
|
|
|
- <view class="form_group hr">
|
|
|
- <view class="lable">商铺简介</view>
|
|
|
- <textarea placeholder="请输入商铺简介" v-model="item.briefContent" />
|
|
|
- </view>
|
|
|
+ <view class="form_group"><view class="lable">商铺简介</view></view>
|
|
|
+ <textarea placeholder="请输入商铺简介(200字以内)" v-model="item.briefContent" maxlength="200" />
|
|
|
</view>
|
|
|
<button class="btn" @click="up()" v-if="!item.auditFlag">申请开通</button>
|
|
|
<button class="btn" @click="up()" v-if="item.auditFlag == 0">更新资料</button>
|
|
@@ -71,8 +69,7 @@ export default {
|
|
|
action: this.$http.urls.uploadImg,
|
|
|
size_type: 'compressed ',
|
|
|
count: 5
|
|
|
- },
|
|
|
- fileList: []
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
onLoad(e) {
|
|
@@ -87,7 +84,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.item.shopType = this.subsection[this.current].value;
|
|
|
- this.fileList = JSON.parse(this.item.showPictures);
|
|
|
if (this.item.auditFlag == 0) {
|
|
|
this.num = 1;
|
|
|
}
|
|
@@ -102,56 +98,42 @@ export default {
|
|
|
},
|
|
|
//定位
|
|
|
wz(index) {
|
|
|
- uni.getLocation({
|
|
|
- type: 'gcj02', //返回可以用于uni.openLocation的经纬度
|
|
|
- success: res => {
|
|
|
- uni.chooseLocation({
|
|
|
- success: r => {
|
|
|
- console.log('asd:' + JSON.stringify(r));
|
|
|
- if (index == 1) {
|
|
|
- this.item.addres = r.address;
|
|
|
- this.zb = '纬度:' + r.latitude + ' 经度:' + r.longitude;
|
|
|
- this.item.lat = r.latitude;
|
|
|
- this.item.lng = r.longitude;
|
|
|
- }
|
|
|
- if (index == 2) {
|
|
|
- this.zb = '纬度:' + r.latitude + ' 经度:' + r.longitude;
|
|
|
- this.item.lat = r.latitude;
|
|
|
- this.item.lng = r.longitude;
|
|
|
- }
|
|
|
- this.$forceUpdate();
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- fail: res => {
|
|
|
- console.log('zx:' + JSON.stringify(res));
|
|
|
+ uni.chooseLocation({
|
|
|
+ success: r => {
|
|
|
+ if (index == 1) {
|
|
|
+ this.item.addres = r.address;
|
|
|
+ }
|
|
|
+ this.zb = '纬度:' + r.latitude + ' 经度:' + r.longitude;
|
|
|
+ this.item.lat = r.latitude;
|
|
|
+ this.item.lng = r.longitude;
|
|
|
+ this.$forceUpdate();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
up() {
|
|
|
+ this.item.showPictures = [];
|
|
|
+ let files = this.$refs.uUpload.lists.filter(val => {
|
|
|
+ return val.progress == 100;
|
|
|
+ });
|
|
|
+ files.forEach(item => {
|
|
|
+ if (item.response) {
|
|
|
+ this.item.showPictures.push({ url: item.response.fileName }); //获取上传成功的网络地址
|
|
|
+ } else {
|
|
|
+ this.item.showPictures.push({ url: item.url }); //原来的地址
|
|
|
+ }
|
|
|
+ });
|
|
|
let rule = [
|
|
|
{ name: 'name', checkType: 'notnull', errorMsg: '请输入商铺名称' },
|
|
|
{ name: 'addres', checkType: 'notnull', errorMsg: '请输入商铺地址' },
|
|
|
{ name: 'bossName', checkType: 'notnull', errorMsg: '请输入老板名称' },
|
|
|
{ name: 'bossPhone', checkType: 'notnull', errorMsg: '请输入老板电话' },
|
|
|
- { name: 'lat', checkType: 'notnull', errorMsg: '请在地图上选择坐标' }
|
|
|
+ { name: 'lat', checkType: 'notnull', errorMsg: '请在地图上选择坐标' },
|
|
|
+ { name: 'showPictures', checkType: 'notnull', errorMsg: '请上传至少1张展示图' }
|
|
|
];
|
|
|
if (!this.$verify.check(this.item, rule)) {
|
|
|
uni.showModal({ content: this.$verify.error, showCancel: false });
|
|
|
return;
|
|
|
}
|
|
|
- this.item.showPictures = [];
|
|
|
- let files = this.$refs.uUpload.lists.filter(val => {
|
|
|
- return val.progress == 100;
|
|
|
- });
|
|
|
- files.forEach(item => {
|
|
|
- //response获取上传成功的网络地址
|
|
|
- if (item.response) {
|
|
|
- this.item.showPictures.push({ url: item.response.fileName });
|
|
|
- } else {
|
|
|
- this.item.showPictures.push({ url: item.url });
|
|
|
- }
|
|
|
- });
|
|
|
this.item.shopType = this.subsection[this.current].value;
|
|
|
this.item.memberId = this.$getUser().memberId;
|
|
|
this.item.showPictures = JSON.stringify(this.item.showPictures);
|
|
@@ -186,6 +168,7 @@ export default {
|
|
|
background-color: white;
|
|
|
border-radius: 5px;
|
|
|
margin-top: 10px;
|
|
|
+ padding-bottom: 10px;
|
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
|
.dw {
|
|
|
top: 11px;
|
|
@@ -194,6 +177,15 @@ export default {
|
|
|
position: absolute;
|
|
|
}
|
|
|
}
|
|
|
+ textarea {
|
|
|
+ margin-left: 17px;
|
|
|
+ font-size: 14px;
|
|
|
+ padding: 10px;
|
|
|
+ width: 85%;
|
|
|
+ height: 85px;
|
|
|
+ border: 1px solid #f1f1f1;
|
|
|
+ border-radius: 5px;
|
|
|
+ }
|
|
|
.btn {
|
|
|
margin-top: 25px;
|
|
|
}
|