From 0358677c06e86f05c992f406c9714a32b30a235d Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 18 七月 2024 18:42:21 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia

---
 wechat_jiaxuan/pages/design/design.js |   99 ++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 84 insertions(+), 15 deletions(-)

diff --git a/wechat_jiaxuan/pages/design/design.js b/wechat_jiaxuan/pages/design/design.js
index 45c24b2..0679de0 100644
--- a/wechat_jiaxuan/pages/design/design.js
+++ b/wechat_jiaxuan/pages/design/design.js
@@ -1,4 +1,8 @@
-// pages/design/design.js
+import {
+  getDictData,
+  getArea,
+  saveFreeCustomizationApply
+} from '../../api/index'
 Page({
 
   /**
@@ -7,26 +11,91 @@
   data: {
     name: '',
     phone: '',
-    city: ''
+    city: '',
+
+    showAreaList: false,
+    areaList: [],
+    cascaderValue: '',
+
+    DESIGN_BANNER: '',
+    WechatIMG558: '',
   },
   onLoad(options) {
-
+    this.initData()
   },
 
   onSubmit() {
-    console.log('dd', this.data.name);
-    console.log('dd', this.data.phone);
+    const {
+      name,
+      phone
+    } = this.data
+    if (!name) return wx.showToast({
+      title: '璇疯緭鍏ュ鍚�',
+      icon: 'none'
+    })
+    if (!phone) return wx.showToast({
+      title: '璇疯緭鍏ヨ仈绯荤數璇�',
+      icon: 'none'
+    })
+    saveFreeCustomizationApply({
+      name,
+      phone
+    }).then(res => {
+      wx.showToast({
+        title: '鎶ュ悕鎴愬姛'
+      })
+
+    })
   },
-  selAddress() {
-    console.log('鐐瑰嚮浜�');
-    wx.chooseLocation({
-      type: 'wgs84',
-      success: (res)=> {
-        this.setData({
-          city: res.name
-        })
-        console.log('res', res);
-      }
+  // 鏄剧ず鍒囨崲鍩庡競寮圭獥
+  chooseCity () {
+    this.setData({ showAreaList: !this.data.showAreaList })
+    console.log('chooseCity', chooseCity);
+  },
+  // 鍒囨崲鍩庡競
+  confirmChange(e) {
+    let {
+      values
+    } = e.detail
+    let region = []
+    for (let i in values) {
+      region.push(values[i].name)
+    }
+    this.setData({
+      region,
+      cityCode: values[1].code
+    })
+    this.getShopList()
+    this.chooseCity()
+  },
+  onFinish() {
+
+  },
+  onClose() {
+    this.setData({ showAreaList: false })
+  },
+  initData() {
+    getArea({
+      "level": "",
+      "pid": ""
+    }).then(res => {
+      this.setData({areaList: res.data})
+    })
+    getDictData({
+      code: 'WEIXIN_DEFAULT_IMGS',
+      label: 'DESIGN_BANNER'
+    }).then(res => {
+      this.setData({
+        DESIGN_BANNER: res.data.code
+      })
+    })
+    getDictData({
+      code: 'WEIXIN_DEFAULT_IMGS',
+      label: 'WechatIMG558'
+    }).then(res => {
+      this.setData({
+        WechatIMG558: res.data.code
+      })
     })
   },
   onReady() {

--
Gitblit v1.9.3