|
@@ -28,8 +28,27 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
onSave(content) {
|
|
onSave(content) {
|
|
|
- console.log(content);
|
|
|
|
|
- this.$http.post('/userAddress/save');
|
|
|
|
|
|
|
+ this.$toast.loading({
|
|
|
|
|
+ message: '加载中...',
|
|
|
|
|
+ forbidClick: true
|
|
|
|
|
+ });
|
|
|
|
|
+ let form = {
|
|
|
|
|
+ userId: this.$store.state.userInfo.id,
|
|
|
|
|
+ provinceName: content.province,
|
|
|
|
|
+ cityName: content.city,
|
|
|
|
|
+ districtName: content.county,
|
|
|
|
|
+ districtId: content.areaCode,
|
|
|
|
|
+ def: content.isDefault,
|
|
|
|
|
+ name: content.name,
|
|
|
|
|
+ phone: content.tel,
|
|
|
|
|
+ address: content.addressDetail
|
|
|
|
|
+ };
|
|
|
|
|
+ this.$http.post('/userAddress/save', form, { body: 'json' }).then(() => {
|
|
|
|
|
+ this.$toast.success('保存成功');
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
|
+ }, 1500);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
onDelete() {},
|
|
onDelete() {},
|
|
|
onChangeDetail(val) {
|
|
onChangeDetail(val) {
|