-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c256394
commit 6522e57
Showing
37 changed files
with
4,952 additions
and
30 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
.svn/pristine/0d/0ddbb6e43c56a6647ce24ae2af084c6fb1b51bd9.svn-base
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<template> | ||
<div> | ||
<!-- <back-arrow title="用户登录"/> --> | ||
<div> | ||
<div class="adArrow"> | ||
<van-nav-bar @click-left="handleBack" title="用户登录" left-text="" left-arrow> | ||
</van-nav-bar> | ||
</div> | ||
<div class="backArrowDown"></div> | ||
</div> | ||
<login-form :isLoding="isLoding" @on-success-login-valid="handleSubmit"></login-form> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import BackArrow from '_c/back-arrow' | ||
import common_mix from '@/views/mixins/common'; | ||
import { mapActions } from "vuex"; | ||
import LoginForm from "_c/login-form"; | ||
export default { | ||
name: "loginView", | ||
mixins:[common_mix], | ||
components: { | ||
LoginForm,BackArrow | ||
}, | ||
data() { | ||
return { | ||
isLoding :false, | ||
}; | ||
}, | ||
methods: { | ||
...mapActions(["handleLogin", "getUserInfo"]), | ||
handleBack(){ | ||
this.HandleRedirect('home') | ||
}, | ||
handleSubmit({ username, password }) { | ||
this.isLoding=true; | ||
this.handleLogin({ username, password }) | ||
.then(res => { | ||
this.isLoding=false; | ||
this.showSuccessNotify("登陆成功"); | ||
this.$router.push({ | ||
name: this.$config.homeName | ||
}); | ||
}) | ||
.catch(err => { | ||
this.isLoding=false; | ||
this.showErrorNotify(err); | ||
}); | ||
} | ||
}, | ||
mounted() {} | ||
}; | ||
</script> |
171 changes: 171 additions & 0 deletions
171
.svn/pristine/0d/0dfed3a62e3041a2a162da3a3b1dd3cfecefcc1b.svn-base
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
<template> | ||
<div> | ||
<!-- origin-price="10.00" num="2" --> | ||
<van-card v-bind:class="{'addGray': isDone }" v-for="goods in dataSource" :key="goods.id1" | ||
:price="getGoodsPrice(goods)" | ||
:tag="ProductTag" | ||
:desc="goods.goodsDesc" | ||
:title="goods.goodsName" | ||
:thumb="getBaseImgUrl(goods.goodsImg)" | ||
@click="handleGoodsDetail(goods)" | ||
> | ||
<div slot="tags" v-if="isFlash || isFlashAfter" class="card__tags"> | ||
<van-tag v-if="isFlashAfter" plain type="danger"> <count-down :time="startTime.replace(/\-/g, '/')" :callback="TimeUpCallback" ></count-down ></van-tag> | ||
<van-tag v-if="isFlash" plain type="danger" > <count-down :time="endTime.replace(/\-/g, '/')" :callback="TimeOutCallback" ></count-down > </van-tag> | ||
</div> | ||
<div slot="footer" class="card__footer" v-if="isFlash"> | ||
<van-button round type="danger" size="mini" v-show="!isDone"> 马上抢 </van-button> | ||
<!-- <van-button round size="mini" > 购买二 </van-button> --> | ||
</div> | ||
</van-card> | ||
<!-- <van-pagination | ||
v-model="pageConfig.pageNumber" | ||
:total-items="pageConfig.totalItems" | ||
:show-page-size="pageConfig.pageSize" | ||
force-ellipses | ||
|
||
/> --> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import CountDown from '_c/countdown' | ||
import * as type from '@/Enums' | ||
export default { | ||
name:'goods-item', | ||
components:{ | ||
CountDown | ||
}, | ||
props:{ | ||
dataSource:{}, | ||
dataFrom:{ | ||
type:String, | ||
default:type.dataFrom_goodsList | ||
}//rusnNow,rushAfter,goodsList,category | ||
}, | ||
data(){ | ||
return { | ||
isDone:false, | ||
startTime:'', | ||
endTime:'', | ||
isFlash:false, | ||
isFlashAfter:false, | ||
ProductTag:'', | ||
pageConfig:{ | ||
pageNumber:1, | ||
pageSize:10, | ||
totalItems:0, | ||
}, | ||
imageURL:'@/assets/nullProduct.png' | ||
} | ||
}, | ||
filters:{ | ||
|
||
}, | ||
methods:{ | ||
TimeUpCallback(){ | ||
this.$emit('TimeUpCallback') | ||
}, | ||
TimeOutCallback(){ | ||
this.isDone=true | ||
}, | ||
getBaseImgUrl(imgUrl){ | ||
let url =JSON.parse(imgUrl) | ||
let urlArray=Array.from(url) | ||
return this.$config.baseImgUrl+urlArray[0] | ||
}, | ||
getGoodsPrice(goodsItem){ | ||
if(goodsItem!=null) | ||
{ //debugger | ||
if(this.dataFrom!=type.dataFrom_category) | ||
{ | ||
this.startTime =goodsItem.rushStart | ||
this.endTime =goodsItem.rushEnd | ||
} | ||
|
||
if(this.dataFrom!=type.dataFrom_rusnNow && this.dataFrom!=type.dataFrom_rushAfter) | ||
{ | ||
let goodsSpec =JSON.parse(goodsItem.goodsSpec) | ||
return goodsSpec[0].price | ||
} | ||
else | ||
{ | ||
return goodsItem.rushPrice | ||
} | ||
|
||
} | ||
//console.warn("goodsItem"+JSON.stringify(goodsItem)); | ||
|
||
}, | ||
handleGoodsDetail(goods){ | ||
|
||
let goodsId =goods.id1; | ||
if(goodsId==null || goodsId=="") | ||
{ | ||
goodsId =goods.goodsId | ||
} | ||
// debugger | ||
if(this.dataFrom!=type.dataFrom_rushAfter ) | ||
{ | ||
if((this.dataFrom==type.dataFrom_rusnNow && this.isDone)) | ||
{ | ||
return | ||
} | ||
this.$router.push({ | ||
path:'/goodsdetail', | ||
query:{ | ||
id:goodsId, | ||
type:this.dataFrom | ||
} | ||
}) | ||
} | ||
|
||
} | ||
}, | ||
updated(){ | ||
// console.log("商品列表数据updated-good-item:"+JSON.stringify(this.dataSource)); | ||
}, | ||
mounted(){ | ||
if(this.dataFrom==type.dataFrom_rusnNow) | ||
{ | ||
this.ProductTag='抢购' | ||
} | ||
this.$nextTick(()=>{ | ||
this.isFlash=(this.dataFrom==type.dataFrom_rusnNow) | ||
this.isFlashAfter=(this.dataFrom==type.dataFrom_rushAfter) | ||
}) | ||
} | ||
} | ||
</script> | ||
|
||
|
||
<style lang="less" scope> | ||
.addGray{ | ||
-webkit-filter: grayscale(100%); | ||
filter:progid:DXImageTransform.Microsoft.BasicImage(graysale=1); | ||
} | ||
// .van-card__title { | ||
// color: #505050; | ||
// font-size: 14px; | ||
// text-align: justify; | ||
// font-weight: 800; | ||
// } | ||
// .van-card__price { | ||
// color: #ef4f4f; | ||
// font-size: 15px; | ||
// font-weight: 600; | ||
// } | ||
.van-card { | ||
text-align: left; | ||
} | ||
.card__footer { | ||
padding-top: 10px; | ||
} | ||
.card__tags { | ||
.van-tag { | ||
margin-right: 5px; | ||
//background: #ccc | ||
} | ||
} | ||
</style> | ||
|
Oops, something went wrong.