Authored by Tao

delete news tips

... ... @@ -65,20 +65,11 @@ export default {
};
},
activated() {
let params = this.$route.query;
let params = {...this.$route.query};
if (this.yoho.direction === 'forword') {
Object.assign(this.$data, this.$options.data());
}
if (Object.keys(params).length && params.listType) {
this.listType = params.listType;
delete params.listType;
}
if (Object.keys(params).length && params.type) {
this.type = params.type;
} else {
params.type = 6;
}
!params.order && (params.order = 'sale_desc');
this.fetchData(params);
},
... ... @@ -124,9 +115,11 @@ export default {
},
submit() {
let routeParams = this.$route.query;
this.copyFilterParams = {...this.filterParams};
let params = {
sort: this.filterParams.sort.join(','),
sort: this.filterParams.sort.join(',') || routeParams.sort,
brand: this.filterParams.brand.join(','), // 品牌id
gender: this.filterParams.gender.join(','), // 性别
size: this.filterParams.size.join(','), // 尺码id
... ... @@ -139,6 +132,7 @@ export default {
});
params.isReset = true;
this.$parent.fetchList(params);
this.$parent.$refs.scroll.scrollTo(0, 0, 300)
this.hide();
},
... ...
... ... @@ -18,7 +18,7 @@
<div class="search-img" @click="goSearch()"></div>
</div>
</div>
<Scroll class="product-list" v-show="!productList.isEmpty"
<Scroll ref="scroll" class="product-list" v-show="!productList.isEmpty"
:options="scrollOptions"
:data="productList.list"
@pulling-up="onPullingUp">
... ... @@ -57,11 +57,9 @@ export default {
pullUpLoad: true
},
fixed: false,
selectedType: 2,
selectedType: 2, // tab类型高亮
priceDesc: true,
arrowImage: '',
listType: 1,
type: 6,
title: '',
productList: {
showErrorPage: false,
... ... @@ -98,7 +96,7 @@ export default {
Object.assign(this.$data, this.$options.data());
}
this.changeArrow();
let params = this.$route.query;
let params = {...this.$route.query};
if (params.title) {
this.title = params.title;
... ... @@ -106,13 +104,6 @@ export default {
} else {
this.title = '商品列表';
}
if (Object.keys(params).length && params.listType) {
this.listType = params.listType;
delete params.listType;
}
if (Object.keys(params).length && params.type) {
this.type = params.type;
}
!params.order && (params.order = 'sale_desc');
this.fetchList({...params, isReset: true});
},
... ... @@ -183,38 +174,34 @@ export default {
}
},
// 点击tab type, 0: 推荐, 1: 价格, 2: 人气, 3: 新品
pressType(type) {
if (type === this.selectedType && type !== 1) {
// 点击tab flag, 0: 推荐, 1: 价格, 2: 人气, 3: 新品
pressType(flag) {
if (flag === this.selectedType && flag !== 1) {
return;
}
let filterParams = this.$refs.filtrate.getParams();
let {sort} = this.searchParams;
let params = {
type: this.type,
sort: filterParams.sort.join(','),
sort: filterParams.sort.join(',') || sort,
brand: filterParams.brand.join(','), // 品牌id
gender: filterParams.gender.join(','), // 性别
size: filterParams.size.join(','), // 尺码id
};
if (this.listType === 4) {
delete params.type;
}
this.selectedType = type;
if (type === 1) {
this.selectedType = flag;
if (flag === 1) {
this.priceDesc = !this.priceDesc;
params.order = this.priceDesc ? 'p_desc' : 'p_asc';
} else if (type === 2) {
} else if (flag === 2) {
this.priceDesc = true;
params.order = 'sale_desc';
} else if (type === 3) {
} else if (flag === 3) {
this.priceDesc = true;
params.order = 'st_desc';
}
params.listType = this.listType;
params.isReset = true;
this.fetchList(params);
this.$refs.scroll.scrollTo(0, 0, 300)
this.changeArrow();
},
goSearch() {
... ...
... ... @@ -200,18 +200,33 @@ export default {
if (!this.changePrice) {
return;
}
const { isOk, errMsg = '' } = await this.confirmChangePrice({
const { isOk, errMsg = '', bidData} = await this.confirmChangePrice({
price: this.changePrice,
orderCode,
});
if (isOk) {
if (isDetail) {
this.fetchOrderDetail(this.$route.params);
} else {
this.resetData();
this.fetchData(this.$route.params);
}
// 重新支付保证金
let forwardType = isDetail ? 'buyOrderDetail' : 'OrderList'
console.log('---------->', forwardType)
this.$createOrderPayType({
orderCode: bidData.orderCode,
price: parseFloat(bidData.depositAmount),
desc: '支付定金',
extra: JSON.stringify({
forward: {
name: forwardType,
params: this.$route.params,
},
}),
}).show();
// if (isDetail) {
// this.fetchOrderDetail(this.$route.params);
// } else {
// this.resetData();
// this.fetchData(this.$route.params);
// }
} else {
if (errMsg) {
this.$createToast({
... ...
... ... @@ -185,7 +185,7 @@ export default {
// footer高度120px
padding: 0 40px;
-webkit-box-orient: vertical;
height: calc(100vh - 210px);
height: calc(100vh - 120px);
overflow-x: hidden;
overflow-y: auto;
font-size: 24px;
... ...
... ... @@ -36,25 +36,29 @@ export default {
components: {
Scroll
},
props: {
status: {
type: Number
},
owner: {
type: String
}
},
computed: {
...mapState(["currentStatus", "routeParamStatus"]),
...mapState(["routeParamStatus"]),
statusList: function() {
const { owner } = this.$route.params;
return owner === ownType.BUY
return this.owner === ownType.BUY
? buyerOrderStatusList
: sellerOrderStatusList;
},
status() {
return this.currentStatus || this.routeParamStatus;
}
},
methods: {
...mapMutations(["setOrderStatus", "resetPartialData"]),
...mapActions(["fetchOrderList"]),
onHandleClick(status) {
this.setOrderStatus(status);
this.$emit("change", status);
this.resetPartialData();
const { owner } = this.$route.params;
const { owner } = this;
this.fetchOrderList({ owner, status });
}
}
... ...
<template>
<layout-app :title="$route.params.owner === 'sell' ? '我的出售' : '我的订单'">
<status-nav />
<status-nav @change="change" :owner="owner" :status="currentStatus" />
<div class="content-wrapper">
<scroll
@pulling-up="fetchData"
... ... @@ -87,29 +87,39 @@ export default {
CountDown,
VideoPlayer
},
data() {
const { status = 1, owner } = this.$route.params;
return {
currentStatus: +status,
owner
};
},
computed: {
...mapState(["orderList", "pullUpLoad", "isShowEmpty"]),
options: function() {
return {
pullUpLoad: this.pullUpLoad,
pullDownRefresh: true
pullDownRefresh: this.isShowEmpty
? false
: {
txt: "更新成功"
}
};
}
},
// 获取订单数据
asyncData({ store, router }) {
const { status } = router.params;
store.commit(`${STORE_PATH}/resetData`);
store.commit(`${STORE_PATH}/setRouteParamStatus`, status);
return store.dispatch(`${STORE_PATH}/fetchOrderList`, router.params);
activated() {
this.resetData();
this.fetchData();
},
methods: {
...mapActions(["fetchOrderList", "confirmReceipt"]),
...mapMutations(["resetData"]),
change(status) {
this.currentStatus = status;
},
fetchData() {
this.fetchOrderList(this.$route.params);
const { owner, currentStatus: status } = this;
this.fetchOrderList({ owner, status });
},
onRefresh() {
this.resetData();
... ...
... ... @@ -5,10 +5,6 @@ const initailData = () => ({
orderList: [], // 订单列表
// scroll 组件参数,是否触发上拉事件
pullUpLoad: true,
// 当前查询订单状态
currentStatus: null,
routeParamStatus: null,
isShowEmpty: false,
});
... ... @@ -37,12 +33,6 @@ export default function() {
);
state.isShowEmpty = state.orderList.length === 0;
},
setOrderStatus(state, currentStatus) {
state.currentStatus = +currentStatus;
},
setRouteParamStatus(state, status = 1) {
state.routeParamStatus = +status;
},
resetPartialData(state) {
state.page = 1;
state.orderList = [];
... ... @@ -51,14 +41,10 @@ export default function() {
},
resetData(state) {
const s = initailData();
const keyList = Object.keys(s);
const keyBlackList = ['currentStatus', 'routeParamStatus'];
for (const key of keyList) {
if (!keyBlackList.includes(key)) {
state[key] = s[key];
}
}
Object.keys(s).forEach(key => {
state[key] = s[key];
});
},
},
actions: {
... ... @@ -74,14 +60,14 @@ export default function() {
async fetchOrderList(
{
commit,
state: { page, currentStatus, routeParamStatus },
state: { page },
},
param = {},
) {
const { owner } = param;
const { owner, status } = param;
const res = await this.$api.get('/api/order/list', {
tabType: owner,
type: currentStatus || routeParamStatus || 1,
type: status || 1, // 1表示我的订单全部
page,
});
... ... @@ -181,7 +167,7 @@ export default function() {
});
if (res.code === 200) {
return { errMsg: '', isOk: true };
return { errMsg: '', isOk: true , bidData: res.data};
} else {
return { errMsg: res.message, isOk: false };
}
... ...
{
"name": "xianyu-ufo-app-web",
"version": "0.0.2-beta-25",
"version": "0.0.2-beta-26",
"private": true,
"description": "Xianyu Project With Express",
"repository": {
... ...