Authored by htoooth

add coupon

# 有货App优惠券列表
包括:
* 有货优惠券列表
* UFO优惠券列表
\ No newline at end of file
... ...
import Ufo from './ufo';
import Yoho from './yoho';
export default [...Ufo, ...Yoho];
... ...
export default [{
path: '/coupon/ufo',
name: 'ufolist',
component: () => import(/* webpackChunkName: "coupon" */ './list')
}];
... ...
<template>
<LayoutApp>
<div class="order-page">
<div class="title">出售中</div>
<div class="product">
<p class="name">{{orderProduct}}</p>
<p>{{orderDetail}}</p>
</div>
</div>
</LayoutApp>
</template>
<script>
import {createNamespacedHelpers} from 'vuex';
const {mapState, mapActions} = createNamespacedHelpers('ufo/order');
export default {
name: 'UfoCouponListPage',
computed: {
...mapState(['orderProduct', 'orderDetail'])
},
asyncData({store, router}) {
return store.dispatch('ufo/order/fetchProduct', {orderId: router.params.orderId});
},
created() {
},
mounted() {
this.fetchOrderDetail({orderId: this.$route.params.orderId});
},
methods: {
...mapActions(['fetchOrderDetail'])
}
};
</script>
<style lang="scss" scoped>
.title {
text-align: center;
font-size: 70px;
line-height: 200px;
}
</style>
... ...
export default [{
path: '/coupon/yoho',
name: 'yoholist',
component: () => import(/* webpackChunkName: "coupon" */ './list')
}];
... ...
<template>
<LayoutApp>
<div class="order-page">
<div class="title">出售中</div>
<div class="product">
<p class="name">{{orderProduct}}</p>
<p>{{orderDetail}}</p>
</div>
</div>
</LayoutApp>
</template>
<script>
import {createNamespacedHelpers} from 'vuex';
const {mapState, mapActions} = createNamespacedHelpers('ufo/order');
export default {
name: 'YohoCouponListPage',
computed: {
...mapState(['orderProduct', 'orderDetail'])
},
asyncData({store, router}) {
return store.dispatch('ufo/order/fetchProduct', {orderId: router.params.orderId});
},
created() {
},
mounted() {
this.fetchOrderDetail({orderId: this.$route.params.orderId});
},
methods: {
...mapActions(['fetchOrderDetail'])
}
};
</script>
<style lang="scss" scoped>
.title {
text-align: center;
font-size: 70px;
line-height: 200px;
}
</style>
... ...
import Vue from 'vue';
import Components from './components';
import Ufo from './ufo';
import Coupon from './coupon';
Components.forEach(component => Vue.component(component.name, component));
export default [...Ufo];
export default [...Ufo, ...Coupon];
... ...
... ... @@ -40,7 +40,7 @@ exports.devServer = (app, cb) => {
};
clientConfig.entry.app = ['./build/client-hot.js', clientConfig.entry.app];
clientConfig.output.publicPath = 'http://m.yohoblk.com:6005/';
clientConfig.output.publicPath = 'http://localhost:6005/';
clientConfig.output.filename = '[name].js';
clientConfig.plugins.push(
new webpack.HotModuleReplacementPlugin(),
... ...
... ... @@ -6,5 +6,13 @@ module.exports = [
{
route: /ufo\/order/,
cache: true,
},
{
route: /coupon\/ufo/,
cache: true
},
{
route: /coupon\/yoho/,
cache: true
}
];
... ...
... ... @@ -75,7 +75,7 @@ exports.createApp = async(app) => {
// listener
app.listen(config.port, function() {
logger.info(`worker is started at ${config.port}`);
logger.info(`worker is started at http://localhost:${config.port}`);
});
} catch (err) {
logger.error(err);
... ...