Authored by baoss

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

... ... @@ -72,10 +72,12 @@ export default {
this.scrollTimer && clearTimeout(this.scrollTimer);
this.scrollTimer = setTimeout(this.onScrollEnd.bind(this), 400);
if(!this.loading || !this.loading.noMore) {
if (this.scrollHeight - top < this.$el.offsetHeight * 2) {
this._onPullingUp();
}
}
},
onScrollEnd() {
this.$emit('scroll-end', {y: -this.$el.scrollTop});
... ...
... ... @@ -12,7 +12,7 @@
<script>
import { createNamespacedHelpers } from 'vuex';
const { mapState } = createNamespacedHelpers('home/channel');
const { mapState, mapActions } = createNamespacedHelpers('home/channel');
import Widget from './widget';
export default {
... ... @@ -36,12 +36,16 @@ export default {
},
...mapState(['showMsg'])
},
watch: {
'showMsg':function(sss) {
console.log(sss);
}
activated() {
this.getAllInboxCatInfo();
},
// watch: {
// 'showMsg':function(sss) {
// console.log(sss);
// }
// },
methods: {
...mapActions(['getAllInboxCatInfo']),
onClick(index) {
this.$emit('click', index);
}
... ...
... ... @@ -34,7 +34,8 @@ export default {
name,
params: {
owner: ownType.SELL,
status
status,
isRefetch: true
}
});
}
... ... @@ -43,7 +44,6 @@ export default {
</script>
<style lang="scss" scoped>
.orders {
display: flex;
height: 100px;
... ... @@ -73,7 +73,7 @@ export default {
.order-num {
font-size: 32px;
text-align: center;
@include num
@include num;
}
.order-text {
... ...
... ... @@ -86,6 +86,7 @@ export default {
goSearch: function(parameters, param) {
let query = parameters.query;
this.addLocalWord(query);
this.yasInput(param);
this.$router.push({
name: 'List',
... ... @@ -112,18 +113,19 @@ export default {
this.SEARCH_POS = 3;
}
},
addLocalWord: function() {
if (this.query) {
addLocalWord: function(query) {
if (this.query || query) {
let addQuery = query || this.query;
let localHistory = localStorage.getItem('@YohoUFOStore:searchHistory');
if (localHistory) {
let localArr = localHistory.split(',');
if (!localArr.includes(this.query)) {
localStorage.setItem('@YohoUFOStore:searchHistory', this.query + ',' + localHistory);
if (!localArr.includes(addQuery)) {
localStorage.setItem('@YohoUFOStore:searchHistory', addQuery + ',' + localHistory);
}
} else {
localStorage.setItem('@YohoUFOStore:searchHistory', this.query);
localStorage.setItem('@YohoUFOStore:searchHistory', addQuery);
}
}
},
... ...
<template>
<LayoutApp :show-back="true" title="确认订单" :back-action="backAction">
<div class="body">
<Scroll :options="scrollOption">
<AddressInfo :data="address" class="order-item" :show-tip="false"></AddressInfo>
<ProductInfo :data="productDetail" class="product-info order-item"></ProductInfo>
<Coupon class="order-item" v-if="couponList.length > 0" :data="orderDetail.recommendedCouponInfo"
... ... @@ -14,7 +13,6 @@
<div class="tip order-item" v-if="orderDetail.damagesDesc" v-html="replaceBr(orderDetail.damagesDesc)"></div>
<OrderInfo class="order-item" v-if="orderDetail.paymentWay" :pay-way="orderDetail.paymentWay"
:delivery-way="orderDetail.deliveryWay"></OrderInfo>
</Scroll>
</div>
<OrderFooter class="footer" :amount="orderDetail.amount" @click="onPayAction"></OrderFooter>
... ... @@ -32,7 +30,6 @@ import OrderFooter from './components/confirm/buyer-order-footer';
import Coupon from './components/confirm/buyer-coupon';
import Promotion from './components/confirm/buyer-promotion';
import { Types, UserType } from 'store/order/order-confirm';
import { Scroll } from 'cube-ui';
import { get } from 'lodash';
import { createNamespacedHelpers, mapState } from 'vuex';
... ... @@ -44,10 +41,7 @@ export default {
props: ['productId', 'storageId'],
data() {
return {
isActive: false,
scrollOption: {
bounce: false
}
isActive: false
};
},
components: {
... ... @@ -59,7 +53,6 @@ export default {
OrderFooter,
Coupon,
Promotion,
Scroll
},
activated() {
this.init();
... ... @@ -69,6 +62,7 @@ export default {
this.isActive = false;
},
beforeRouteLeave(to, from, next) {
this.isActive = false;
if (to.name !== 'address') {
this[Types.CLEAR_BUY_STATUS]();
}
... ...
... ... @@ -34,6 +34,7 @@ export default {
.good-image {
width: 180px;
height: 180px;
display: inline-block;
overflow: hidden;
img {
width: 100%;
... ...
... ... @@ -21,8 +21,8 @@ export default {
return {
iconfont: true,
icon_size: true,
iconcheck_default: !this.val,
iconcheck_full: this.val,
iconweixuanyuanquan: !this.val,
iconxuanzhongduigou: this.val,
icon_color: this.val
};
}
... ...
... ... @@ -40,6 +40,12 @@ export default {
if (val === "") {
clearInterval(this.timeoutId);
}
},
leftTime(val) {
if (!val) {
this.countDown = "";
clearInterval(this.timeoutId);
}
}
},
methods: {
... ... @@ -67,7 +73,6 @@ export default {
</script>
<style lang="scss" scoped>
.count-down-wrapper {
display: flex;
font-size: 32px;
... ... @@ -85,7 +90,7 @@ export default {
& > span {
padding: 0 9px;
@include num
@include num;
}
}
</style>
... ...
... ... @@ -9,8 +9,7 @@ const { mapActions, mapMutations } = createNamespacedHelpers('order/orderList');
export default {
data() {
return {
// 求购调价
changePrice: 0,
hasAction: false,
};
},
methods: {
... ... @@ -21,10 +20,10 @@ export default {
'computeChangePrice',
'confirmChangePrice',
]),
...mapMutations(['filterOrderList', 'resetData']),
...mapMutations(['filterOrderList', 'resetData', 'resetOrderListItem']),
async onAction({ action, order, isDetail = false } = {}) {
const { owner = ownType.SELL, status } = this.$route.params;
const { owner = ownType.SELL, type, status } = this.$route.params;
const {
orderCode,
realPrice = '',
... ... @@ -47,6 +46,11 @@ export default {
if (isOk) {
if (isDetail) {
this.filterOrderList({
orderCode,
owner,
status,
});
this.$router.back();
} else {
this.filterOrderList({
... ... @@ -91,6 +95,7 @@ export default {
if (isOk) {
if (isDetail) {
this.fetchOrderDetail(this.$route.params);
this.hasAction = true;
} else {
this.resetData(this.$route.params);
this.fetchData(this.$route.params);
... ... @@ -173,6 +178,7 @@ export default {
if (isOk) {
if (isDetail) {
this.hasAction = true;
this.fetchOrderDetail(this.$route.params);
} else {
this.resetData(this.$route.params);
... ... @@ -232,10 +238,12 @@ export default {
extra: JSON.stringify({
forward: {
name: isDetail ? 'buyOrderDetail' : 'OrderList',
params: isDetail ? {
params: isDetail
? {
owner: this.$route.params.owner,
code: bidData.orderCode,//改为新订单号
} : this.$route.params,
code: bidData.orderCode, //改为新订单号
}
: this.$route.params,
},
reportType: 'buy',
}),
... ...
... ... @@ -10,6 +10,11 @@ const { mapMutations: inSaleMapMutations } = createNamespacedHelpers(
);
export default {
data() {
return {
hasAction: false,
};
},
methods: {
...mapActions(['cancelTradeConfirmInfo', 'cancelTrade']),
...inSaleMapMutations(['filterInSaleOrderList']),
... ... @@ -44,6 +49,7 @@ export default {
});
if (isOk) {
this.hasAction = true;
if (isDetail) {
this.fetchOrderDetail(this.$route.params);
} else {
... ... @@ -74,6 +80,7 @@ export default {
case orderActionsMap.PAY_EARNESTMONEY.name: {
const pageBackName = isDetail ? 'sellOrderDetail' : 'InSaleOrderList';
this.hasAction = true;
this.$createOrderPayType({
orderCode,
price: parseFloat(`${earnestMoney}`).toFixed(2),
... ...
const STORE_PATH = 'order/orderDetail';
export default {
beforeRouteEnter(to, from, next) {
next(vm => {
vm.$store.commit(`${STORE_PATH}/setFrom`, from);
});
},
};
... ...
<template>
<div>
<layout-app :title="'\u200E'" class="buyer-order-detail-wrapper">
<layout-app
:title="'\u200E'"
class="buyer-order-detail-wrapper"
:backAction="onBack"
>
<div class="order-detail-wrapper">
<div class="content">
<!-- 状态信息 -->
... ... @@ -133,6 +137,7 @@ import OrderActions from "../components/order-actions";
import VideoPlayer from "../order-list/components/video-player";
import orderActionMixin from "../mixin/order-action";
import routeActionMinxin from "../mixin/route";
const STORE_PATH = "order/orderDetail";
... ... @@ -141,7 +146,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers(
);
export default {
mixins: [orderActionMixin],
mixins: [orderActionMixin, routeActionMinxin],
components: {
AddressInfo,
OrderItemInfo,
... ... @@ -167,8 +172,15 @@ export default {
asyncData({ store, router }) {
return store.dispatch(`${STORE_PATH}/fetchOrderDetail`, router.params);
},
beforeRouteLeave(to, from, next) {
if (this.from.name === "OrderPay" || this.hasAction) {
to.params.isRefetch = true;
}
this.hasAction = false;
next();
},
computed: {
...mapState(["orderDetail"]),
...mapState(["orderDetail", "from"]),
...mapGetters([
"lastExpressInfo",
"priceInfo",
... ... @@ -183,6 +195,43 @@ export default {
return;
}
this.$refs.videoPlayer.parentHandleclick();
},
onBack() {
if (this.from.name === "OrderPay") {
const { buttons = [] } = this.orderDetail;
let routeParam = {
name: "OrderList",
params: {
owner: "buy"
}
};
for (const btn of buttons) {
// 支付定金
if (btn.code === "pay_deposit") {
routeParam = {
name: "OrderList",
params: {
owner: "buy",
status: 7 // 求购列表
}
};
break;
}
// 立即支付
if (btn.code === "now_buy") {
routeParam = {
name: "OrderList",
params: {
owner: "buy",
status: 2 // 待付款
}
};
}
}
this.$router.replace(routeParam);
} else {
this.$router.back();
}
}
}
};
... ...
... ... @@ -8,7 +8,7 @@ const routers = [
// code: 订单编码
{
name: routeNames.BUY_ORDER_DETAIL,
path: '/xianyu/:owner/order/detail/:code',
path: '/xianyu/:owner/order/detail/:code/:type?',
component: () => import('./buyer-order-detail'),
},
... ... @@ -16,7 +16,7 @@ const routers = [
// code: 订单编码
{
name: routeNames.SELL_ORDER_DETAIL,
path: '/xianyu/:owner/trade/detail/:code',
path: '/xianyu/:owner/trade/detail/:code/:type?',
component: () => import('./seller-order-detail'),
},
];
... ...
<template>
<div>
<layout-app :title="'\u200E'" class="seller-order-detail-wrapper">
<layout-app
:title="'\u200E'"
class="seller-order-detail-wrapper"
:backAction="onBack"
>
<div class="order-detail-wrapper">
<div class="content">
<!-- 状态信息 -->
... ... @@ -111,6 +115,7 @@ import OrderActions from "../components/order-actions";
import orderActionMixin from "../mixin/order-action";
import orderInSaleActionMixin from "../mixin/order-in-sale-action";
import routeMixin from "../mixin/route";
import PlatformFeeInfo from "../components/platform-fee-info";
... ... @@ -121,7 +126,7 @@ const { mapActions, mapState, mapGetters } = createNamespacedHelpers(
);
export default {
mixins: [orderActionMixin, orderInSaleActionMixin],
mixins: [orderActionMixin, orderInSaleActionMixin, routeMixin],
components: {
AddressInfo,
OrderItemInfo,
... ... @@ -149,7 +154,7 @@ export default {
});
},
computed: {
...mapState(["orderDetail"]),
...mapState(["orderDetail", "from"]),
...mapGetters([
"lastExpressInfo",
"priceInfo",
... ... @@ -158,6 +163,13 @@ export default {
"actionList"
])
},
beforeRouteLeave(to, from, next) {
if (this.from.name === "OrderPay" || this.hasAction) {
to.params.isRefetch = true;
}
this.hasAction = false;
next();
},
methods: {
...mapActions(["fetchOrderDetail"]),
onPlatformFee() {
... ... @@ -187,6 +199,15 @@ export default {
];
}
).show();
},
onBack() {
if (this.from.name === "OrderPay") {
this.$router.replace({
name: "InSaleOrderList"
});
} else {
this.$router.back();
}
}
}
};
... ...
... ... @@ -60,13 +60,13 @@ export default {
);
},
toLinkParam: function() {
const { owner = ownType.SELL } = this.$route.params;
const { owner = ownType.SELL, status } = this.$route.params;
let linkParam = {
name:
owner === ownType.SELL
? detailRouteNames.SELL_ORDER_DETAIL
: detailRouteNames.BUY_ORDER_DETAIL,
params: { code: this.order.orderCode, owner }
params: { code: this.order.orderCode, owner, type: status }
};
if (this.isEntry) {
const { productId } = this.order.goodsInfo;
... ...
... ... @@ -12,8 +12,12 @@
<div class="item-info">
<div>
<div v-if="$route.params.owner === 'buy'" class="price-status">
<span class="price">¥{{specialBid ? goodsInfo.goodPrice : order.realPrice }}</span>
<span class="delivery-fee-tip" >{{specialBid ? '' : '(含运费)'}}</span>
<span class="price"
>¥{{ specialBid ? goodsInfo.goodPrice : order.realPrice }}</span
>
<span class="delivery-fee-tip">{{
specialBid ? "" : "(含运费)"
}}</span>
</div>
<div v-else class="price-status">
<span class="price">¥{{ goodsInfo.goodPrice }}</span>
... ... @@ -47,19 +51,23 @@ export default {
return this.$props.order.goodsInfo;
},
toLinkParam: function() {
const { owner = ownType.SELL } = this.$route.params;
const { owner = ownType.SELL, status } = this.$route.params;
return {
name:
owner === ownType.SELL
? detailRouteNames.SELL_ORDER_DETAIL
: detailRouteNames.BUY_ORDER_DETAIL,
params: { code: this.order.orderCode, owner }
params: { code: this.order.orderCode, owner, type: status }
};
},
specialBid: {
get() {
return this.order.bidType && (this.order.statuStr === '求购中' || this.order.statuStr === '待付定金')
return (
this.order.bidType &&
(this.order.statuStr === "求购中" ||
this.order.statuStr === "待付定金")
);
}
}
}
... ... @@ -111,7 +119,7 @@ export default {
color: #d0021b;
letter-spacing: 0;
font-weight: bold;
@include num
@include num;
}
.status {
... ...
<template>
<layout-app title="出售中" class="in-sale-list-wrapper">
<div class="content-wrapper">
<scroll
<LayoutScroll
@pulling-up="fetchData"
@pulling-down="onRefresh"
@scroll="scrollHandler"
:options="options"
:loading="loadingOptions"
:data="orderList"
class="order-list-scroll-wrap"
ref="scroll"
>
<ul class="list-wrapper">
<li v-for="(order, i) in orderList" :key="i">
... ... @@ -31,7 +34,7 @@
tip="这里什么都没有..."
v-show="isShowEmpty"
/>
</scroll>
</LayoutScroll>
</div>
</layout-app>
</template>
... ... @@ -51,6 +54,8 @@ import orderInSaleActionMixin from "../mixin/order-in-sale-action";
const IN_SALE_STORE_PATH = "order/inSaleOrderList";
const detailRouterNames = ["buyOrderDetail", "sellOrderDetail"];
const {
mapActions,
mapState,
... ... @@ -61,6 +66,11 @@ const {
export default {
// 订单操作
mixins: [orderInSaleActionMixin],
data() {
return {
scrollY: 0
};
},
components: {
Scroll,
OrderItem,
... ... @@ -71,6 +81,7 @@ export default {
computed: {
...mapState(["entryOrder", "notEntryOrder", "isShowEmpty"]),
...mapGetters(["orderList", "pullUpLoad"]),
options: function() {
return {
pullUpLoad: this.pullUpLoad,
... ... @@ -84,20 +95,36 @@ export default {
},
isFetchEntryOrder() {
return this.entryOrder.pullUpLoad;
},
loadingOptions() {
return {
hide: !this.viewOrderList || !this.viewOrderList.length,
noMore: !this.pullUpLoad
};
}
},
// 获取订单数据
asyncData({ store, router }) {
store.commit(`${IN_SALE_STORE_PATH}/resetData`);
return store.dispatch(
`${IN_SALE_STORE_PATH}/fetchEntryOrderList`,
router.params
);
beforeRouteEnter(to, from, next) {
next(vm => {
const { isRefetch = false } = to.params;
if (isRefetch || !from.name) {
vm.$store.commit(`${IN_SALE_STORE_PATH}/resetData`);
vm.$store.dispatch(`${IN_SALE_STORE_PATH}/fetchEntryOrderList`);
}
});
},
activated() {
if (this.scrollY) {
this.scrollY && this.$refs.scroll.scrollTo(this.scrollY);
}
},
methods: {
...mapActions(["fetchEntryOrderList", "fetchNotEntryOrderList"]),
...mapMutations(["resetData"]),
scrollHandler({ y }) {
this.scrollY = -y;
},
onRefresh() {
this.resetData(this.$route.params);
this.fetchData();
... ...
import {
getOrderStatus,
} from "constants/order-constants";
import { getOrderStatus } from 'constants/order-constants';
const routers = [
// 订单列表
... ... @@ -10,7 +8,7 @@ const routers = [
name: 'OrderList',
path: '/xianyu/:owner/order/list/:status?',
component: () => import('./order-list'),
props({params}) {
props({ params }) {
let { owner, status } = params;
status = getOrderStatus(owner, status);
... ... @@ -19,8 +17,9 @@ const routers = [
status,
};
},
meta: {
routerViewKey: 'OrderList',
beforeEnter: (to, from, next) => {
// ...
next();
},
},
... ...
... ... @@ -77,6 +77,11 @@ import { orderStatusKey, getOrderStatus } from "constants/order-constants";
const STORE_PATH = "order/orderList";
const detailRouterNames = ["buyOrderDetail", "sellOrderDetail"];
const listRouterNames = ["OrderList", "InSaleOrderList"];
const refetchBackList = ["OrderList"];
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
STORE_PATH
);
... ... @@ -95,7 +100,8 @@ export default {
},
data() {
return {
scrollY: 0
scrollY: 0,
isScrollFetch: true
};
},
props: {
... ... @@ -113,24 +119,51 @@ export default {
loadingOptions() {
return {
hide: !this.viewOrderList || !this.viewOrderList.length,
noMore: this.orderStatus.page >= this.orderStatus.pagetotal
noMore: this.orderStatus.page > this.orderStatus.pagetotal
};
}
},
activated() {
if (this.$yoho.direction === "back") {
this.scrollY && this.$refs.scroll.scrollTo(this.scrollY);
if (this.scrollY) {
this.isScrollFetch = false;
this.$refs.scroll.scrollTo(this.scrollY);
}
},
// 只有列表进入详情返回时不刷新列表
beforeRouteEnter(to, from, next) {
next(vm => {
let { owner, status, isRefetch = false } = to.params;
status = getOrderStatus(owner, status);
// if (detailRouterNames.includes(from.name)) {
// const { from: detailFrom } = vm.$store.state.order.orderDetail;
// if (listRouterNames.includes(detailFrom.name)) {
// isRefetch = false;
// }
// }
if (isRefetch || !from.name) {
vm.$store.commit(`${STORE_PATH}/resetData`, { owner, status });
vm.$store.dispatch(`${STORE_PATH}/fetchOrderList`, { owner, status });
}
});
},
// 获取订单数据
asyncData({ store, router }) {
let { owner, status } = router.params;
beforeRouteLeave(to, from, next) {
if (!detailRouterNames.includes(to.name)) {
this.scrollY = 0;
}
next();
},
beforeRouteUpdate(to, from, next) {
let { owner, status } = to.params;
status = getOrderStatus(owner, status);
store.commit(`${STORE_PATH}/resetData`, { owner, status });
return store.dispatch(`${STORE_PATH}/fetchOrderList`, { owner, status });
this.scrollY = 0;
this.$refs.scroll.scrollTo(this.scrollY);
this.resetData({ owner, status });
this.fetchOrderList({ owner, status });
next();
},
methods: {
...mapActions(["fetchOrderList", "confirmReceipt"]),
... ... @@ -139,10 +172,14 @@ export default {
this.scrollY = -y;
},
fetchData() {
if (this.isScrollFetch) {
this.fetchOrderList({
owner: this.owner,
status: this.status
});
} else {
this.isScrollFetch = true;
}
},
onRefresh() {
this.resetData({
... ...
... ... @@ -31,21 +31,12 @@ export default {
};
},
mounted() {
if (this.payParams) {
this.openPay();
}
this.setCount();
},
activated() {
if (this.extra) {
this.page = JSON.parse(this.extra || '{}');
}
this.check().catch((result) => {
if (result?.data?.statusDetail?.leftTime < 60) {
this.count = result?.data?.statusDetail?.leftTime;
}
});
this.init();
},
beforeRouteLeave(to, from, next) {
if (this.timer) {
... ... @@ -56,6 +47,19 @@ export default {
},
methods: {
...mapOrderAction(['fetchOrderStatus']),
init() {
this.check().catch((result) => {
if (result?.data?.statusDetail?.leftTime < 60) {
this.count = result?.data?.statusDetail?.leftTime;
}
if (this.payParams) {
this.openPay();
}
this.setCount();
});
},
openPay() {
if (this.$xianyu.isAliApp) {
this.$xianyu.setXianyuPay({
... ...
<template>
<LayoutApp :show-back="true" title="出售" :back-action="backAction">
<div class="body">
<!-- <Scroll :options="scrollOption">-->
<ProductInfo :data="productDetail" class="product-info"></ProductInfo>
<InputPrice @input="changePrice"
:num="num" :value="price"
... ... @@ -12,7 +11,6 @@
<OrderMargin class="order-item order-margin" :data="fee" :super-sell="superSell" :url="tipUrl"></OrderMargin>
<OrderFee class="order-item order-fee" :data="fee"></OrderFee>
<AddressInfo :data="address" class="order-item"></AddressInfo>
<!-- </Scroll>-->
</div>
<div class="footer">
<OrderAgree
... ... @@ -43,7 +41,6 @@ import OrderMargin from './components/confirm/order-margin';
import OrderFee from './components/confirm/order-fee';
import OrderAgree from './components/confirm/agree';
import { Types, UserType } from 'store/order/order-confirm';
import { Scroll } from 'cube-ui';
import { get } from 'lodash';
import { createNamespacedHelpers, mapState } from 'vuex';
... ... @@ -58,7 +55,6 @@ export default {
name: 'SellOrderConfirm',
props: ['productId', 'storageId'],
components: {
Scroll,
ProductInfo,
AddressInfo,
InputPrice,
... ... @@ -76,10 +72,6 @@ export default {
'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE&nodownload=1',
superSell: false,
addNumError: false,
scrollOption: {
bounce: false,
click: true
},
tipUrl:
'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE&nodownload=1'
};
... ... @@ -211,7 +203,6 @@ export default {
this.submit();
},
compute() {
return this.fetchOrderPrice({
address_id: this.address?.address_id,
num: this.num,
... ...
... ... @@ -8,7 +8,7 @@
:emulateMask="true"
:full="true">
<div class="buy-sheet">
<a class="header" @click.prevent="gotoNewPage">求购<i class="cubeic-question"></i></a>
<a class="header" @click.prevent="gotoNewPage">求购<i class="cubeic-question question"></i></a>
<div class="title">
<div class="title-thumbnail">
<square-img :src="imageUrl" :width="300" :height="300"/>
... ... @@ -187,6 +187,11 @@ export default {
text-align: right;
}
.question {
color: #ccc;
font-size: 28px;
}
.title-thumbnail {
width: 200px;
height: 200px;
... ...
... ... @@ -470,6 +470,8 @@ export default {
name: 'OrderList',
params: {
owner: this.selectSizeConfig.type,
status: 2, // 待付款
isRefetch: true
},
});
},
... ...
... ... @@ -55,11 +55,10 @@ export default function() {
Vue.set(state.channelList, 'page', productlist.page);
},
[Types.FETCH_NEWSACTIVE](state, { list }) {
state.showMsg = false;
list && list.map((item) => {
if (item.id === 6 && item.unReadCount > 0) {
if (item.unReadCount > 0) {
state.showMsg = true;
} else {
state.showMsg = false;
}
});
},
... ... @@ -89,10 +88,10 @@ export default function() {
}
},
async getAllInboxCatInfo({ commit }) {
const result = await this.$api.get('/api/ufo/home/getAllInboxCatInfo', {});
const result = await this.$api.get('/api/ufo/home/listInboxTypeInfo', {});
if (result.code === 200) {
commit(Types.FETCH_NEWSACTIVE, { list: result.data.list });
commit(Types.FETCH_NEWSACTIVE, { list: result.data || [] });
}
}
},
... ...
... ... @@ -95,6 +95,7 @@ export default function() {
title: '出售中',
num: state.sellerNum,
page: 'InSaleOrderList',
params: { isRefetch: true },
},
order: { name: 'order' },
resource1: { name: 'resource1', data: state.resource1 },
... ... @@ -109,14 +110,14 @@ export default function() {
title: '我的购买订单',
num: state.buyNum,
page: 'OrderList',
params: { owner: ownType.BUY, status: 1 },
params: { owner: ownType.BUY, status: 1, isRefetch: true },
},
buy: {
name: 'buy',
title: '我的求购',
num: state.askBuyNum,
page: 'OrderList',
params: { owner: ownType.BUY, status: 7 },
params: { owner: ownType.BUY, status: 7, isRefetch: true },
},
collect: {
name: 'collect',
... ...
... ... @@ -3,11 +3,15 @@ export default function() {
namespaced: true,
state: {
orderDetail: {},
from: {},
},
mutations: {
initData(state, data) {
state.orderDetail = data;
},
setFrom(state, from) {
state.from = from;
},
},
getters: {
userAddress: state => state.orderDetail.userAddress || {}, // 用户使用地址
... ... @@ -38,6 +42,7 @@ export default function() {
if (res.code === 200) {
commit('initData', res.data);
}
return res.data || {};
},
},
};
... ...
... ... @@ -55,29 +55,44 @@ export default function() {
orderState.pullUpLoad = false;
}
},
filterOrderList(state, {
orderCode,
owner = ownType.SELL,
status = 1
}) {
filterOrderList(state, { orderCode, owner = ownType.SELL, status = 1 }) {
let orderState = state.orderListByType[orderStatusKey(owner, status)];
orderState.orderList = orderState.orderList.filter(
order => order.orderCode !== orderCode,
);
orderState.isShowEmpty = orderState.orderList.length === 0;
},
resetOrderListItem(state, { owner, status = 1, order }) {
let orderState = state.orderListByType[orderStatusKey(owner, status)];
orderState.orderList = orderState.orderList.map(item => {
if (item.orderCode === order.orderCode) {
const {
buttons = [],
statusDetail: { statuStr = '' } = {},
} = order;
// 详情接口取消时leftTime任返回值
const isIncludeDeleteAction = !!buttons.find(btn => {
return btn.code === 'del_order';
});
let { leftTime } = item;
leftTime = isIncludeDeleteAction ? 0 : leftTime;
item = { ...item, buttons, statuStr, leftTime };
}
return item;
});
},
setOrderStatus(state, currentStatus) {
state.currentStatus = +currentStatus;
},
setRouteParamStatus(state, status = 1) {
state.routeParamStatus = +status;
},
resetPartialData(state, {
owner = ownType.SELL,
status = 1
}) {
resetPartialData(state, { owner = ownType.SELL, status = 1 }) {
Object.assign(state.orderListByType[orderStatusKey(owner, status)], {
page: 1,
orderList: [],
... ... @@ -85,10 +100,7 @@ export default function() {
pullUpLoad: true,
});
},
resetData(state, {
owner = ownType.SELL,
status = 1
}) {
resetData(state, { owner = ownType.SELL, status = 1 }) {
const orderListState = initialOrderState();
state.orderListByType[orderStatusKey(owner, status)] = orderListState;
... ... @@ -104,13 +116,10 @@ export default function() {
* }
* r
*/
async fetchOrderList({
commit,
state
}, {
owner = ownType.SELL,
status = 1
}) {
async fetchOrderList(
{ commit, state },
{ owner = ownType.SELL, status = 1 },
) {
const { page } = state.orderListByType[orderStatusKey(owner, status)];
const res = await this.$api.post('/api/order/list', {
... ... @@ -211,7 +220,7 @@ export default function() {
});
if (res.code === 200) {
return { errMsg: '', isOk: true, bidData: res.data};
return { errMsg: '', isOk: true, bidData: res.data };
} else {
return { errMsg: res.message, isOk: false };
}
... ...
... ... @@ -132,10 +132,10 @@ module.exports = {
api: 'ufo.user.getUserAliPayAccountInfo',
param: {}
},
'/api/ufo/home/getAllInboxCatInfo': {
// ufo: true,
'/api/ufo/home/listInboxTypeInfo': {
ufo: true,
auth: true,
api: 'app.inbox.getAllInboxCatInfo',
api: 'ufo.users.listInboxTypeInfo',
param: {}
},
};
... ...