From 39613118a5bae23c45498c4f5a939e83595f99f5 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 16 七月 2024 16:05:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
wechat_jiaxuan/pages/design/design.js | 83 ++++++++++++++++++++++++++++++++++-------
1 files changed, 68 insertions(+), 15 deletions(-)
diff --git a/wechat_jiaxuan/pages/design/design.js b/wechat_jiaxuan/pages/design/design.js
index 45c24b2..8b24073 100644
--- a/wechat_jiaxuan/pages/design/design.js
+++ b/wechat_jiaxuan/pages/design/design.js
@@ -1,4 +1,7 @@
-// pages/design/design.js
+import {
+ getDictData,
+ saveFreeCustomizationApply
+} from '../../api/index'
Page({
/**
@@ -7,26 +10,76 @@
data: {
name: '',
phone: '',
- city: ''
+ city: '',
+
+ showAreaList: false,
+ areaList: [],
+ 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 })
+ },
+ // 鍒囨崲鍩庡競
+ 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()
+ },
+ initData() {
+ 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