Authored by lea guo

订单列表

... ... @@ -7,7 +7,10 @@
<p class="status-desc">{{ statusDetail.detailDesc }}</p>
</div>
<!-- 物流信息 -->
<router-link :to="{ name: 'orderLogisticsInfo', params: $route.params }">
<router-link
v-if="lastExpressInfo"
:to="{ name: 'orderLogisticsInfo', params: $route.params }"
>
<div class="logistics-info item-wrapper">
<div class="content">
<i class="logistics-icon"></i>
... ... @@ -56,9 +59,7 @@
</div>
<!-- 操作 -->
<div v-if="actionList.length" class="actions">
<Button v-for="actionInfo in actionList" :key="actionInfo.code">{{
actionInfo.text
}}</Button>
<order-actions class="detail-actions" :order="orderDetail" />
</div>
</div>
</template>
... ... @@ -68,6 +69,7 @@ import { createNamespacedHelpers } from "vuex";
import AddressInfo from "./components/address-info";
import OrderItemInfo from "./components/order-detail-item";
import { Button } from "cube-ui";
import OrderActions from "../components/order-actions";
const { mapActions, mapState, mapGetters } = createNamespacedHelpers(
"order/orderDetail"
... ... @@ -76,7 +78,8 @@ export default {
components: {
AddressInfo,
OrderItemInfo,
Button
Button,
OrderActions
},
asyncData({ store, router }) {
// store.dispatch("order/orderDetail/fetchOrderDetail", router.params);
... ... @@ -115,6 +118,8 @@ export default {
}
.status-info {
margin-bottom: 40px;
.status {
font-size: 68px;
color: #000;
... ... @@ -131,7 +136,6 @@ export default {
}
.logistics-info {
margin-top: 40px;
display: flex;
align-items: center;
justify-content: space-between;
... ... @@ -212,24 +216,8 @@ export default {
padding: 20px;
z-index: 10;
button {
font-size: 24px;
padding: 24px 64px 22px 64px;
color: #999;
letter-spacing: 0;
border-radius: 0;
background: #fff;
border: 1px solid #ccc;
line-height: 1.3;
width: 224px;
margin-right: 20px;
}
& :last-child {
background: #002b47;
color: #fff;
border: 1px solid #002b47;
margin-right: 0;
.detail-actions {
margin-top: 0;
}
}
}
... ...
... ... @@ -48,16 +48,11 @@ export default {
}
},
methods: {
...mapMutations(["setOrderStatus"]),
...mapMutations(["setOrderStatus", "resetOrderData"]),
...mapActions(["fetchOrderList"]),
onHandleClick(status) {
this.setOrderStatus(status);
// const { owner } = this.$route.params;
// this.$router.push({ name: "OrderList", params: { owner, status } });
}
},
watch: {
currentStatus(status) {
this.resetOrderData();
const { owner } = this.$route.params;
this.fetchOrderList({ owner, status });
}
... ...
... ... @@ -27,7 +27,9 @@ import StatusNav from "./components/status-nav";
import Modal from "../components/confirm/modal";
import OrderActions from "../components/order-actions";
const { mapActions, mapState } = createNamespacedHelpers("order/orderList");
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
"order/orderList"
);
export default {
components: {
... ... @@ -54,10 +56,15 @@ export default {
},
mounted() {
const { params } = this.$route;
const { status } = params;
if (status) {
this.setOrderStatus(status);
}
this.fetchOrderList(params);
},
methods: {
...mapActions(["fetchOrderList"]),
...mapMutations(["setOrderStatus"]),
fetchMore() {
this.fetchOrderList(this.$route.params);
}
... ...
... ... @@ -12,7 +12,7 @@ export default function() {
getters: {
userAddress: state => state.orderDetail.userAddress || {}, // 用户使用地址
statusDetail: state => state.orderDetail.statusDetail || {}, // 订单状态
lastExpressInfo: state => state.orderDetail.lastExpressInfo || {}, // 物流信息
lastExpressInfo: state => state.orderDetail.lastExpressInfo || null, // 物流信息
goodsInfo: state => state.orderDetail.goodsInfo || {}, // 商品信息
priceInfo: state => state.orderDetail.priceInfo || {}, // 价格信息
actionList: state => state.orderDetail.buttons || {}, // 允许操作
... ...
... ... @@ -36,11 +36,13 @@ export default function() {
);
},
setOrderStatus(state, currentStatus) {
state.currentStatus = +currentStatus;
},
resetOrderData(state) {
state.page = 1;
state.orderList = [];
state.pagetotal = 0;
state.pullUpLoad = true;
state.currentStatus = +currentStatus;
},
},
actions: {
... ...
... ... @@ -12,25 +12,22 @@ function resolve(dir) {
return path.join(__dirname, '..', dir);
}
const webpackConfig = {
mode: isProd ? 'production' : 'development',
output: {
filename: 'static/js/[name].[chunkhash].js',
path: distDir,
chunkFilename: 'static/js/[name].[chunkhash].js',
publicPath: isProd ? '//cdn.yoho.cn/xianyu-ufo-app-web/' : '/'
publicPath: isProd ? '//cdn.yoho.cn/xianyu-ufo-app-web/' : '/',
},
devtool: isProd ? 'source-map' : 'cheap-module-eval-source-map',
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
vue$: 'vue/dist/vue.runtime.esm.js',
'lottie-web': 'lottie-web/build/player/lottie_light.min.js'
'lottie-web': 'lottie-web/build/player/lottie_light.min.js',
},
modules: [
path.join(__dirname, '../apps'),
'node_modules'
]
modules: [path.join(__dirname, '../apps'), 'node_modules'],
},
module: {
rules: [
... ... @@ -40,20 +37,20 @@ const webpackConfig = {
loader: 'vue-loader',
options: {
extractCSS: isProd,
}
},
},
},
{
resourceQuery: /blockType=client/,
use: 'babel-loader',
exclude: /node_modules/
exclude: /node_modules/,
},
{
test: /\.js$/,
use: 'babel-loader',
include: [resolve('apps'), /cube-ui/]
include: [resolve('apps'), /cube-ui/],
},
]
],
},
plugins: [
new webpack.HashedModuleIdsPlugin(),
... ... @@ -61,9 +58,7 @@ const webpackConfig = {
new PostCompilePlugin(),
new TransformModulesPlugin(),
new VueLoaderPlugin(),
]
],
};
module.exports = webpackConfig;
... ...
... ... @@ -82,7 +82,7 @@ module.exports = {
api: 'ufo.notEntrySeller.computeChangePrice',
params: {
price: { type: Number },
skup: { type: Number }
skup: { type: Number },
},
},
... ... @@ -94,9 +94,9 @@ module.exports = {
ufo: true,
api: 'ufo.notEntrySeller.changePrice',
params: {
address_id: {type: Number},
address_id: { type: Number },
price: { type: Number },
skup: { type: Number }
skup: { type: Number },
},
},
... ... @@ -212,6 +212,20 @@ module.exports = {
},
},
// 非入住商家订单类表
'/api/ufo/seller/notEntryPrdList': {
auth: true,
ufo: true,
api: 'ufo.seller.notEntryPrdList',
},
// 入住商家类表
'/api/ufo/seller/entryPrdList': {
auth: true,
ufo: true,
api: 'ufo.seller.entryPrdList',
},
// 订单数量
'/api/order/confirm/count': {
ufo: true,
... ...
... ... @@ -25,10 +25,6 @@ export const buyerOrderStatus = {
// 卖家订单状态, 接口对应查询参数: type
export const sellerOrderStatusList = [
{
value: 1,
text: '出售中',
},
{
value: 2,
text: '待发货',
},
... ... @@ -120,6 +116,7 @@ export const orderActionsMap = {
text: '管理库存',
},
// Todo
NOW_BUY: {
code: 'now_buy',
name: 'NOW_BUY',
... ... @@ -130,4 +127,5 @@ export const orderActionsMap = {
name: 'CONFIRM_DELIVERY',
text: '确认收货',
},
PAY_DEPOSIT: { code: 'pay_deposit', name: 'PAY_DEPOSIT', text: '支付定金' },
};
... ...