Authored by lea guo

Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop

... ... @@ -27,9 +27,7 @@
:data-item="JSON.stringify(item)"
:data-add="0"
@click="toEditorPage"
>
编辑
</div>
>编辑</div>
</div>
<p class="address">{{ item.area }}{{ item.address }}</p>
</div>
... ... @@ -47,7 +45,10 @@
import Layout from "../../../components/layout/layout-app";
import { get } from "lodash";
import { Scroll, Loading } from "cube-ui";
import { SET_USER_ADDRESS_INFO } from "store/address/address/types";
import {
SET_USER_ADDRESS_INFO,
STORE_UPDATE_ADDRESS_INFO
} from "store/address/address/types";
import { createNamespacedHelpers } from "vuex";
const { mapState, mapMutations, mapActions } = createNamespacedHelpers(
... ... @@ -74,7 +75,7 @@ export default {
...mapState(["addressList"])
},
methods: {
...mapMutations({ SET_USER_ADDRESS_INFO }),
...mapMutations(["SET_USER_ADDRESS_INFO", "STORE_UPDATE_ADDRESS_INFO"]),
...mapActions(["fetchUserAddressList"]),
toOrderPage(item) {
this.SET_USER_ADDRESS_INFO(item);
... ... @@ -101,10 +102,10 @@ export default {
}
}
this.STORE_UPDATE_ADDRESS_INFO(item);
this.$router.push({
name: "addressEdit",
params: {
item: item,
update: !isAdd
}
});
... ...
... ... @@ -136,7 +136,7 @@ export default {
}
},
computed: {
...mapState(["addressTags"]),
...mapState(["addressTags", "updateAddressInfo"]),
submitClass() {
return [
"sure-btn",
... ... @@ -301,7 +301,7 @@ export default {
},
activated() {
let { update, title, item, code } = this.$route.params;
let { update, item, code } = this.$route.params;
// 订单编辑 不查标签
if (!code) {
this.fetchAddressTags();
... ... @@ -309,17 +309,20 @@ export default {
this.isUpdate = update;
this.title = update ? "编辑地址" : "添加地址";
let addressInfo = this.updateAddressInfo;
if (update) {
item = JSON.parse(item || "{}");
this.updateMobileNum = item.mobile;
this.model.consignee = item.consignee;
this.model.address_id = item.address_id;
this.model.mobile = item.mobile;
this.model.area_code = item.area_code || item.areaCode;
this.model.area = item.area;
this.model.address = item.address;
this.model.tag_code = item.tag_code;
this.model.is_default = item.is_default === "Y" ? true : false;
addressInfo = JSON.parse(addressInfo || "{}");
this.updateMobileNum = addressInfo.mobile;
this.model.consignee = addressInfo.consignee;
this.model.address_id = addressInfo.address_id;
this.model.mobile = addressInfo.mobile;
this.model.area_code = addressInfo.area_code || addressInfo.areaCode;
this.model.area = addressInfo.area;
this.model.address = addressInfo.address;
this.model.tag_code = addressInfo.tag_code;
this.model.is_default = addressInfo.is_default === "Y" ? true : false;
} else {
this.model = {};
}
... ...
... ... @@ -8,7 +8,8 @@ export default function () {
addressList: [],
addressTags: [],
provincesList: [],
addressInfo: {}
addressInfo: {},
updateAddressInfo: {}
},
actions,
mutations,
... ...
... ... @@ -23,5 +23,8 @@ export default {
this.state.order.orderConfirm.address = addressInfo;
this.state.order.buyerAskOrder.addressInfo = addressInfo;
this.state.order.sellerAskOrder.addressInfo = addressInfo;
},
[Types.STORE_UPDATE_ADDRESS_INFO](state, addressInfo) {
state.updateAddressInfo = addressInfo || {};
}
};
... ...
... ... @@ -9,3 +9,4 @@ export const DELETE_USER_ADDRESSINFO_SUCCESS = 'DELETE_USER_ADDRESSINFO_SUCCESS'
export const SET_DEFAULT_ADDRESS = 'SET_DEFAULT_ADDRESS';
export const SET_USER_ADDRESS_INFO = 'SET_USER_ADDRESS_INFO';
export const STORE_UPDATE_ADDRESS_INFO = 'STORE_UPDATE_ADDRESS_INFO';
... ...