Skip to content

Commit

Permalink
fix history bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
clouds-app committed May 17, 2019
1 parent 8362704 commit 2d51b7f
Show file tree
Hide file tree
Showing 55 changed files with 5,836 additions and 529 deletions.
826 changes: 826 additions & 0 deletions .svn/pristine/02/0257e977cb96de0a8423befff1cdcd2f6c223065.svn-base

Large diffs are not rendered by default.

196 changes: 196 additions & 0 deletions .svn/pristine/0d/0d33d2d1d364cab940f177aed666f22263df2609.svn-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
import Home from '@/views/Home.vue'

export default [

{
path: '/',
name: 'main',
component: Home,
meta:{
title:'首页'
},
},
{
path: '/home',
name: 'home',
component: Home,
meta:{
title:'首页'
},

},
{
path: '/addetail',
name: 'addetail',
meta: { title: '公告详细' },
component: () => import(/* webpackChunkName: "UserCenter" */ '@/views/AdDetail.vue'),
},
{
path: '/usercenter',
name: 'usercenter',
meta:{
isLogin: true,
title:'用户中心'
},
component: () => import(/* webpackChunkName: "UserCenter" */ '@/views/UserCenter.vue')
},
{
path: '/login',
name: 'login',
meta:{
isLogin: false,
title:'登陆'
},
component: () => import(/* webpackChunkName: "Login" */ '@/views/Login.vue')
},
{
path: '/binding',
name: 'binding',
meta:{
isLogin: false,
title:'用户绑定'
},
component: () => import(/* webpackChunkName: "Login" */ '@/views/user/Binding.vue')
},
{
path: '/register',
name: 'register',
meta:{
isLogin: false,
title:'注册'
},
component: () => import(/* webpackChunkName: "Register" */ '@/views/Register.vue')
},
{
path: '/shopingCart',
name: 'shopingCart',
meta:{
isLogin: true,
title:'购物车'
},
component: () => import(/* webpackChunkName: "ShopingCart" */ '@/views/ShopingCart/ShopingCart.vue')
},
{
path: '/about',
name: 'about',
meta:{
title:'关于我们'
},
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '@/views/About.vue')
},
{
path: '/category',
name: 'category',
meta:{
title:'分类'
},
component: () => import(/* webpackChunkName: "Category" */ '@/views/Category/Category.vue')
},
{
path: '/flashsale',
name: 'flashsale',
meta:{
title:'抢购'
},
component: () => import(/* webpackChunkName: "FlashSale" */ '@/views/FlashSale/FlashSale.vue')
},
{
path: '/goodslist',
name: 'goodslist',
meta:{
title:'商品列表'
// keepAlive: true, //此组件需要被缓存 //默认为FALSE 其他可用不用设置
},
component: () => import(/* webpackChunkName: "AddressList" */ '@/views/GoodsList/GoodsList.vue')
},
{
path: '/goodsdetail',
name: 'goodsdetail',
meta:{
title:'商品详细',
footer:true, //默认为FALSE 其他可用不用设置
isLogin: false
},
component: () => import(/* webpackChunkName: "GoodsDetail" */ '@/views/GoodsDetail.vue')
},
{
path: '/addresslist',
name: 'addresslist',
meta:{
isLogin: true,
title:'地址列表',
},
component: () => import(/* webpackChunkName: "AddressList" */ '@/views/AddressList/AddressList.vue')
},{
path: '/addressedit',
name: 'addressedit',
meta:{
isLogin: true,
title:'地址编辑',
},
component: () => import(/* webpackChunkName: "AddressList" */ '@/views/AddressList/AddressEdit.vue')
},{
path: '/OrderList',
name: 'orderList',
meta:{
isLogin: true,
title:'订单列表',
},
component: () => import(/* webpackChunkName: "AddressList" */ '@/views/Order/OrderList.vue')
},{
path: '/changePassword',
name: 'changePassword',
meta:{
isLogin: true,
title:'修改密码',
},
component: () => import(/* webpackChunkName: "AddressList" */ '@/views/user/changePassword.vue')
},
{
path: '/payment',
name: 'payment',
meta:{
isLogin: true,
title:'付款',
},
component: () => import(/* webpackChunkName: "payment" */ '@/views/Order/payment.vue')
},{
path: '/paySuccess',
name: 'paySuccess',
meta:{
isLogin: false,
footer:true,
title:'付款成功',
},
component: () => import(/* webpackChunkName: "payment" */ '@/views/Pay/PaySuccess.vue')
},{
path: '/payFail',
name: 'payFail',
meta:{
isLogin: false,
footer:true,
title:'付款失败',
},
component: () => import(/* webpackChunkName: "payment" */ '@/views/Pay/PayFail.vue')
},{
path: '/orderDetail',
name: 'orderDetail',
meta:{
isLogin:true,
footer:false,
title:'订单详情',
},
component: () => import(/* webpackChunkName: "payment" */ '@/views/Order/orderDetail.vue')
},
{
path: '*',
name: 'err404',
meta:{
title:'404',
},
component: () => import(/* webpackChunkName: "err404" */ '@/views/Err404.vue')
}
]
156 changes: 156 additions & 0 deletions .svn/pristine/0f/0fb8166729ab7ad5405d5247ac553bb73098c230.svn-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<template>
<div>
<back-arrow title="限时抢购"/>
<van-tabs>
<van-tab :title="flashSaleTitle">
<van-pull-refresh
v-model="list[0].refreshing"
@refresh="onRefresh(0)"
>
<van-list
v-model="list[0].loading"
:finished="list[0].finished"
:finished-text="finishedText"
@load="onLoad(0)"
>
<goods-item :dataSource="RushListNow" :dataFrom="dataFrom"></goods-item>
</van-list>
</van-pull-refresh>
</van-tab>

<van-tab :title="timeToSaleTitle">
<van-pull-refresh
v-model="list[1].refreshing"
@refresh="onRefresh(1)"
>
<van-list
v-model="list[1].loading"
:finished="list[1].finished"
:error.sync="list[1].error"
:error-text="errorText"
@load="onLoad(1)"
>
<!-- <van-cell
v-for="item in list[1].items"
:key="item.goodsId"
:title="item.goodsName"
/> -->
<goods-item :dataSource="RushListAfter" :dataFrom="dataFromAfter" @TimeUpCallback="TimeUpCallback">
</goods-item>
</van-list>
</van-pull-refresh>
</van-tab>
</van-tabs>
</div>
</template>

<script>
import GoodsItem from "_c/goods-item";
import BackArrow from '_c/back-arrow'
import * as type from '@/Enums'
export default {
name:'flash-sale',
components:{
BackArrow,GoodsItem
},
data() {
return {
dataFromAfter:type.dataFrom_rushAfter,
dataFrom:type.dataFrom_rusnNow,
RushListNow:[],
RushListAfter:[],
flashSaleTitle:"正在抢购",
timeToSaleTitle:"即将抢购",
errorInfo: '错误提示',
finishedText: '-------没有更多了-------',
errorText: '请求失败,点击重新加载',
list: [{
items: [],
refreshing: false,
loading: false,
error: false,
finished: false
}, {
items: [],
refreshing: false,
loading: false,
error: false,
finished: false
}]
};
},
created(){
this.getRushListNowData()
this.getRushListAfterData()
},
methods: {
//子组件调用父组件事件
TimeUpCallback(){
this.getRushListAfterData()
this.getRushListNowData()
},
onLoad(index) {
const list = this.list[index];
setTimeout(() => {
//正在抢购数据
if(index==0)
{
this.RushListNow.map((goodsItem)=>{
list.items.push(goodsItem)
});
list.loading = false;
if (list.items.length >= this.RushListNow.length) {
list.finished = true;
}
}
//即将抢购数据
if(index ==1)
{
this.RushListAfter.map((goodsItem)=>{
list.items.push(goodsItem)
});
list.loading = false;
if (list.items.length >= this.RushListAfter.length) {
list.finished = true;
}
}

}, 500);
},
onRefresh(index) {
const list = this.list[index];
setTimeout(() => {
list.items = [];
list.error = false;
list.finished = false;
list.refreshing = false;
window.scrollTo(0, 10);
}, 1000);
},
//获取正在抢购商品列表
getRushListNowData(){
let _self=this;
this.$store.dispatch('getRushListNow').then(res=>{
// debugger
_self.RushListNow =res
}).catch(err=>{

console.error(err)
});
},
//获取即将抢购商品列表
getRushListAfterData(){
let _self=this;
this.$store.dispatch('getRushListAfter').then(res=>{
_self.RushListAfter =res
}).catch(err=>{

console.error(err)
});
}
},

};

</script>

Loading

0 comments on commit 2d51b7f

Please sign in to comment.