diff --git a/littleApp_child/packageA/pages/editAddress/editAddress.js b/littleApp_child/packageA/pages/editAddress/editAddress.js new file mode 100644 index 0000000..955e010 --- /dev/null +++ b/littleApp_child/packageA/pages/editAddress/editAddress.js @@ -0,0 +1,90 @@ +// packageA/pages/editAddress/editAddress.js +import { AreaPicker } from "../../../utils/areaSelector/selector.js" +import api from "../../../utils/apiFile.js"; +var networkUtil = require('../../../utils/network_util.js') +Page(Object.assign({}, AreaPicker,{ + data: { + currentAddress: {}, + babyAddress: '' + }, + onLoad: function (options) { + if (options.id) { + this.setData({ + id: options.id + }) + } + }, + onAreaCommit(locationList, e) {//当用户更换地区 + console.log('选择地址后', locationList) + var self = this; + self.addrInfo = { + province: locationList[0] || {}, + city: locationList[1] || {}, + area: locationList[2] || {}, + street: locationList[3] || {}, + } + var address = {} + address.details = '' + for (var i in locationList){ + address.details += locationList[i].name + } + address.addEntry = locationList + self.setData({ + isShow: 0, + currentAddress: address + }); + }, + bindKeyInput: function (e) { + console.log(e.detail.value) + this.data.babyAddress = e.detail.value + this.setData({ + babyAddress: this.data.babyAddress + }) + }, + onShow: function () {}, + submitData: function () { + if(!this.data.currentAddress.addEntry) { + wx.showToast({ + title: '请选择户籍地址', + icon: 'none', + duration: 2000 + }) + return; + } + if(!this.data.babyAddress) { + wx.showToast({ + title: '请输入街道门牌', + icon: 'none', + duration: 2000 + }) + return; + } + let data = {}; + data.id = this.data.id; + if (this.data.currentAddress.addEntry) { + data.babyProvinceId = this.data.currentAddress.addEntry[0].id; + data.babyCityId = this.data.currentAddress.addEntry[1].id; + data.babyAreaId = this.data.currentAddress.addEntry[2].id; + data.babyStreetId = this.data.currentAddress.addEntry[3].id; + } + data.babyAddress = this.data.babyAddress; + networkUtil._get(api.editAddress,data, function(res) { + if(0 == res.data.errorcode){ + wx.showModal({ + title: '提示', + content: '修改成功!', + showCancel: false, + success (res) { + if (res.confirm) { + wx.reLaunch({url: '/pages/home/home'}) + } else if (res.cancel) { + console.log('用户点击取消') + } + } + }) + } + }, function(res) { + networkUtil.showErrorToast(res.errormsg) + }) + } +})) diff --git a/littleApp_child/packageA/pages/editAddress/editAddress.json b/littleApp_child/packageA/pages/editAddress/editAddress.json new file mode 100644 index 0000000..cb46ce1 --- /dev/null +++ b/littleApp_child/packageA/pages/editAddress/editAddress.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "补填户籍地址", + "navigationBarBackgroundColor": "#48C17B", + "navigationBarTextStyle": "white", + "backgroundColor": "#d8dbd4", + "pageOrientation": "auto", + "usingComponents": {} +} diff --git a/littleApp_child/packageA/pages/editAddress/editAddress.wxml b/littleApp_child/packageA/pages/editAddress/editAddress.wxml new file mode 100644 index 0000000..fac7032 --- /dev/null +++ b/littleApp_child/packageA/pages/editAddress/editAddress.wxml @@ -0,0 +1,31 @@ + + + + + + + *户籍地址 + + + 请选择省市区(县) + {{currentAddress.details}} + + + + + *街道门牌 + + + + + + + + + + + + + diff --git a/littleApp_child/packageA/pages/editAddress/editAddress.wxss b/littleApp_child/packageA/pages/editAddress/editAddress.wxss new file mode 100644 index 0000000..9a633a0 --- /dev/null +++ b/littleApp_child/packageA/pages/editAddress/editAddress.wxss @@ -0,0 +1,119 @@ +/* packageA/pages/editAddress/editAddress.wxss */ +/* pages/quickArchives /quickArchives .wxss */ +@import "../../../utils/areaSelector/selector.wxss"; +.page-back{ + height: 100vh; + width: 100%; + background: white; +} +.Warning{ + font-size: 14px; + padding-left: 10px; + color: #fff; + background-color: #ffc862; +} +.weui-cells{ + padding-right:15px; +} +.weui-cell{ + padding: 10px 0 10px 10px; +} +.page-tt{ + font-size: 18px; +} +.weui-cells{ + margin-top:0; +} +.weui-cell__ft{ + font-size: 14px; + color: #333; +} +.weui-label{ + display: block; + width: 120px!important; +} +.line-tt{ + padding-left: 5px; + color: #505050; + font-size: 14px; +} +.select-placeholder{ + color: #c0c0c0; + font-size: 14px; +} +.query-cell{ + background-color: #fff; + margin: 5px 0px 10px 0px; +} +.query_button { + margin-top:10px; + font: medium; + font-size: 16px; + color: #fff; + width: 30%; + height: 38px; + line-height: 38px; + border-radius: 9rpx; + background-color: #48C17B; + display: inline-block; + text-align: center; + margin-top: 3px; + align-items: center; + margin-left:3%; +} +.we_button { + margin-top:20px; + font: medium; + font-size: 16px; + color: white; + width: 60%; + margin-left:20%; + height: 38px; + line-height: 38px; + border-radius: 19px; + background-color: #48C17B; + display: inline-block; + text-align: center; + /* position: fixed; */ + position: fixed; + bottom: 20px; +} +.picker-view{ + font-size: 14px; +} +.radio-group{ + font-size: 14px; +} +.radio{ + width: 90px; + display: inline-block; +} +radio{ + transform:scale(0.8); +} +.pickerBox{ + position: fixed; + bottom: 0; + width: 100%; + z-index: 10; + background: #fff; +} +.pickerButBox{ + height: 38px; + line-height: 38px; + border-bottom: 1px solid #e7e7e7; + width: 100%; + background-color: #fff; +} +.pickerButText{ + font-size: 16px; + margin: 0 10px +} +.pickerButCencle{ + float: left; + color: #333; +} +.pickerButSub{ + float: right; + color: #48C17B; +}