Browse Source

地图选点暂存

xiaohaizhao 1 year ago
parent
commit
e663eceb79
4 changed files with 101 additions and 5 deletions
  1. 3 4
      components/my_form.vue
  2. 2 0
      pages.json
  3. 71 0
      select/place/index.vue
  4. 25 1
      store/insert/store.vue

+ 3 - 4
components/my_form.vue

@@ -192,8 +192,8 @@
                         </u-radio-group>
                     </view>
                 </view>
-                <!-- 日期 -->
-                <view class="region" @change="selectRegion($event, index)" v-else-if="item.type == 'route'"
+                <!-- 路由选择器 -->
+                <view class="region" v-else-if="item.type == 'route'"
                     :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }"
                     @click="item.disabled ? '' : toRoute(item, index)">
                     <view class="box" :class="item.unBorBot ? '' : 'borBot'">
@@ -212,7 +212,6 @@
                         </view>
                     </view>
                 </view>
-
             </block>
         </block>
     </view>
@@ -220,6 +219,7 @@
 
 <script>
 import { formattedFiles, viewImage } from "../utils/settleFiles.js"
+
 export default {
     name: "my_form",
     props: {
@@ -250,7 +250,6 @@ export default {
             unShowAll: false,
         }
     },
-
     watch: {
         form: {
             handler: function (newVal) {

+ 2 - 0
pages.json

@@ -121,6 +121,8 @@
 		"root": "select",
 		"pages": [{
 			"path": "store/store"
+		}, {
+			"path": "place/index"
 		}]
 	}],
 	"preloadRule": {

+ 71 - 0
select/place/index.vue

@@ -0,0 +1,71 @@
+<template>
+    <view>
+        <map id="Mymap" class="Mymap" :longitude="my.longitude" :latitude="my.latitude" scale="16" :markers="markers"
+            bindregionchange="" bindtap="" bindupdated="" />
+        <view class="search-box">
+            <My_search />
+        </view>
+        <My_listbox boxBackground="#fff">
+
+
+        </My_listbox>
+    </view>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            my: {
+                longitude: "",
+                latitude: ""
+            },
+            markers: []
+        }
+    },
+    onLoad() {
+        this.getLocation(true).then(my => {
+            this.my = my;
+            console.log(my)
+        })
+        uni.setNavigationBarTitle({
+            title: '地图选点'
+        });
+        setTimeout(() => {
+            this.$Http.basic({
+                id: "10030901",
+                content: {
+                    postStr: {
+                        "yingjiType": 1,
+                        "sourceType": 0,
+                        "keyWord": "楚楚吊顶",
+                        "level": 6,
+                        "mapBound": "113.75989136166874,29.393072654041134,128.27534863832096,32.031873462231246",
+                        "queryType": "4",
+                        "start": 0,
+                        "count": 10,
+                        "queryTerminal": 10000
+                    }
+                }
+            }).then(res => {
+                console.log("搜索地点", res)
+            })
+        }, 500)
+
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.Mymap {
+    width: 100vw;
+    height: 300px;
+}
+
+.search-box {
+    width: 100vw;
+    padding: 10px;
+    box-sizing: border-box;
+    background: #fff;
+}
+</style>

+ 25 - 1
store/insert/store.vue

@@ -78,13 +78,20 @@ export default {
                 name: "分销",
             }]
         }, {
-            key: "Class",
+            key: "markettype",
             type: "customClass",
             label: "门店卖场类型",
             isMust: false,//是否必填
             isMultipleChoice: false,//是否多选
             value: '',// 多选[] 单选 ""
             list: await this.getCustomClass('storetype')
+        }, {
+            key: "selectMap",
+            type: "route",
+            path: "/select/place/index",
+            label: "门店地址",
+            isMust: true,//是否必填
+            value: {},
         }];
     },
     methods: {
@@ -156,6 +163,23 @@ export default {
             })
         },
     },
+    onShow() {
+        /*    let a11 = {
+               address: "浙江省嘉兴市南湖区望湖路585号",
+               city: "嘉兴市",
+               county: "南湖区",
+               district: "南湖区",
+               latitude: 30.74803,
+               longitude: 120.786539,
+               name: "翡翠花园",
+               province: "浙江省"
+           }
+           if (location) {
+               location.county = location.district;
+               this.location = location;
+               this.$refs.form.setValue(this.form.findIndex(v => v.label == '门店地址'), location.name || this.getCity(location))
+           } */
+    }
 }
 </script>