Authored by 郭成尧

address-ok

... ... @@ -79,7 +79,8 @@ $addressForm.on('submit', function() {
tip.show('手机号不能为空');
return false;
}
if (!$(this).find('[name="area_code"]').val() || !$(this).find('[name="area"]').val()) {
if (!$(this).find('[name="area_code"]').val() || !$(this).find('[name="area"]').val() ||
$(this).find('[name="area_code"]').val().length < 6) {
tip.show('省市区不能为空');
return false;
}
... ...
... ... @@ -161,6 +161,10 @@
<script>
require('../../../scss/home/_address.css');
let areaForm = $('.edit-address');
let areaCode = areaForm.find('input[name=area_code]');
let area = areaForm.find('input[name=area]');
module.exports = {
data() {
return {
... ... @@ -249,6 +253,14 @@
$.get('/home/getaddress.json', {
id: id
}, resultData => {
if (resultData.length < 1) {
areaCode.val(id);
area.val(this.province.title + ' '
+ this.city.title + ' '
+ this.area.title + ' '
+ this.street.title);
this.show = false;
}
/* 数据绑定 */
switch((id + '').length) {
... ... @@ -274,6 +286,11 @@
/* 关闭地址选择组件 */
closeAddBox() {
areaCode.val(this.street.id || this.area.id || this.city.id || this.province.id);
area.val(this.province.title + ' '
+ this.city.title + ' '
+ this.area.title + ' '
+ this.street.title);
this.show = false;
},
... ...