fix: 个人订单

fix/0524_ch
向文可 2 years ago
parent 2655f6cefa
commit e8f3851e1f

@ -199,7 +199,6 @@
// //
const handleOrder = () => { const handleOrder = () => {
console.info(unref(currentSession));
router.push({ name: 'OrderManagement', query: { id: currentSession.value.fromId } }); router.push({ name: 'OrderManagement', query: { id: currentSession.value.fromId } });
}; };

@ -65,6 +65,7 @@
import OrderTrack from './track.vue'; import OrderTrack from './track.vue';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const router = useRouter(); const router = useRouter();
const route = useRoute();
const store = useStore(); const store = useStore();
const loading = ref(false); const loading = ref(false);
const code = computed(() => store.state.order.code); const code = computed(() => store.state.order.code);
@ -79,6 +80,7 @@
/* 查询订单 */ /* 查询订单 */
const state = reactive({ const state = reactive({
condition: { condition: {
userId: null,
orderNo: null, orderNo: null,
userPhone: null, userPhone: null,
orderSource: null, orderSource: null,
@ -89,9 +91,19 @@
}, },
}); });
watch( watch(
() => state.condition, () => route.params.id,
(value) => { (value) => {
state.condition.userId = value;
},
{ immediate: true, deep: true }
);
watch(
() => state.condition,
(value, old) => {
store.commit('order/setCondition', _.cloneDeep(value)); store.commit('order/setCondition', _.cloneDeep(value));
if (value.userId !== old.userId) {
handleSearch();
}
}, },
{ immediate: true, deep: true } { immediate: true, deep: true }
); );
@ -104,6 +116,7 @@
); );
const handleReset = () => { const handleReset = () => {
state.condition = { state.condition = {
userId: null,
orderNo: null, orderNo: null,
userPhone: null, userPhone: null,
orderSource: null, orderSource: null,

Loading…
Cancel
Save