点击上传
请勿上传违法文件,且文件不超过15M
@@ -223,6 +156,7 @@ import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import crudQiNiu from "@/api/tools/qiniu";
import { tbShopInfo, tbShopInfoPut } from "@/api/user";
+import { geocode } from '@/api/shop'
export default {
computed: {
...mapGetters(["qiNiuUploadApi"])
@@ -272,7 +206,37 @@ export default {
amapOptions: {
center: [108.946465, 34.347984],
position: []
- }
+ },
+ weeks: [
+ {
+ value: '1',
+ label: '周一'
+ },
+ {
+ value: '2',
+ label: '周二'
+ },
+ {
+ value: '3',
+ label: '周三'
+ },
+ {
+ value: '4',
+ label: '周四'
+ },
+ {
+ value: '5',
+ label: '周五'
+ },
+ {
+ value: '6',
+ label: '周六'
+ },
+ {
+ value: '7',
+ label: '周天'
+ }
+ ]
};
},
mounted() {
@@ -284,10 +248,19 @@ export default {
this.amapOptions.center = [res[0].lng, res[0].lat];
},
// 确认地址选择
- selectLocationHandle(item) {
+ async selectLocationHandle(item) {
this.form.lng = item.lng;
this.form.lat = item.lat;
+ this.form.address = item.address
this.showLocation = false;
+
+ const position = `${item.lng},${item.lat}`;
+ const res = JSON.parse(await geocode({ location: position }))
+ console.log(res);
+
+ this.form.provinces = res.addressComponent.province
+ this.form.cities = res.addressComponent.city
+ this.form.districts = res.addressComponent.district
},
// 获取用户详情
async tbShopInfo() {
@@ -300,7 +273,7 @@ export default {
this.startTime = businessTime[0];
this.endTime = businessTime[1];
}
- } catch (error) {}
+ } catch (error) { }
},
// 保存
submitHandle() {
@@ -319,7 +292,7 @@ export default {
message: "提交成功",
type: "success"
});
- } catch (error) {}
+ } catch (error) { }
}
});
},
@@ -333,7 +306,7 @@ export default {
handleBeforeRemove(file, fileList) {
for (let i = 0; i < this.files.length; i++) {
if (this.files[i].uid === file.uid) {
- crudQiNiu.del([this.files[i].id]).then(res => {});
+ crudQiNiu.del([this.files[i].id]).then(res => { });
return true;
}
}