shish 4 лет назад
Родитель
Сommit
c3d7d7e3e0

+ 4 - 0
hdApp/src/api/shop/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const getRegion = data => {
+	return https.get('/shop/region', data)
+}
+
 //添加云喇叭
 export const addCloudLb = data => {
 	return https.get('/shop-ext/add-lb', data)

+ 18 - 7
hdApp/src/components/app-delivery.vue

@@ -124,7 +124,7 @@
     </view>
 
     <!-- 省市联动 -->
-    <simple-address ref="simpleAddress" :region="orderShop.region" :pickerValueDefault="cityPickerValueDefault" @onConfirm="getCityConfirm" ></simple-address>
+    <simple-address ref="simpleAddress" :region="regionTree" :pickerValueDefault="cityPickerValueDefault" @onConfirm="getCityConfirm" ></simple-address>
 
     <!-- 选择详细地址 -->
     <app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
@@ -140,6 +140,7 @@ import SimpleAddress from "@/components/plugin/simple-address";
 import AppAreaSel from "@/components/app-area-sel";
 import AppBindInfo from "@/components/app-bind-info";
 import {getShop} from "@/api/common"
+import {getRegion} from "@/api/shop"
 export default {
   name: "app-delivery-module",
   components: {
@@ -176,19 +177,29 @@ export default {
         latitude: 0,
         longitude: 0
       },
-      // 省市联动
+      regionTree:[],
       cityPickerValueDefault: [0, 0]
     };
   },
   mounted() {
-    getShop().then(res=>{
+    let that = this
+    getRegion().then(res=>{
       if(res.code == 1){
-        if(res.data.info){
-          this.form.province = res.data.info.province
-          this.form.city = res.data.info.city
-        }
+        that.regionTree = res.data.region
+
+        getShop().then(res=>{
+          if(res.code == 1){
+            if(res.data.info){
+              that.form.province = res.data.info.province
+              that.form.city = res.data.info.city
+            }
+          }
+        })
+
+
       }
     })
+
   },
   methods: {
     selTimeFn(e) {

+ 2 - 6
mallApp/src/components/app-delivery.vue

@@ -198,12 +198,8 @@ export default {
   },
   mounted() {
     if (!this.$util.isEmpty(this.orderShop)) {
-      this.form.province = this.orderShop.shop.province
-        ? this.orderShop.shop.province
-        : "";
-      this.form.city = this.orderShop.shop.city
-        ? this.orderShop.shop.city
-        : "";
+      this.form.province = this.orderShop.shop.province ? this.orderShop.shop.province : ""
+      this.form.city = this.orderShop.shop.city ? this.orderShop.shop.city : ""
     }
   },
   methods: {