216 changed files with 11668 additions and 13914 deletions
File diff suppressed because it is too large
Load Diff
@ -1,69 +1,62 @@
|
||||
<template> |
||||
<div |
||||
class="home" |
||||
:style="{ top: top + 'px' }" |
||||
style="position:fixed;" |
||||
id="right-nav" |
||||
@touchmove="touchmove($event)" |
||||
> |
||||
<div class="homeCon bg-color-red1" :class="homeActive === true ? 'on' : ''"> |
||||
<div |
||||
@click="$yrouter.switchTab('/pages/home/index')" |
||||
class="iconfont icon-shouye-xianxing " |
||||
style="color: green;" |
||||
></div> |
||||
<div |
||||
@click="$yrouter.switchTab('/pages/shop/ShoppingCart/index')" |
||||
class="iconfont icon-caigou-xianxing" |
||||
style="color: green;" |
||||
></div> |
||||
<!--<div @click="$yrouter.push('/pages/user/User/index'" class="iconfont icon-yonghu1"></div>--> |
||||
</div> |
||||
</div> |
||||
<div class="home" :style="{ top: top + 'px' }" style="position:fixed;" id="right-nav" @touchmove="touchmove($event)"> |
||||
<div class="homeCon bg-color-red1" :class="homeActive === true ? 'on' : ''"> |
||||
<div @click="homeGo()" class="iconfont icon-shouye-xianxing " style="color: green;"></div> |
||||
<div @click="shoppingCartGo()" class="iconfont icon-caigou-xianxing" style="color: green;"></div> |
||||
<!--<div @click="userGo()" class="iconfont icon-yonghu1"></div>--> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import { mapGetters } from "vuex"; |
||||
import { mapGetters } from 'vuex'; |
||||
export default { |
||||
name: "Home", |
||||
props: {}, |
||||
data: function() { |
||||
return { |
||||
top: "", |
||||
homeActive: true |
||||
}; |
||||
}, |
||||
computed: mapGetters(["homeActive"]), |
||||
methods: { |
||||
touchmove(event) { |
||||
// event.preventDefault(); |
||||
// let top = |
||||
// event.touches[0].pageY - |
||||
// (document.documentElement.scrollTop || document.body.scrollTop) - |
||||
// this.$el.clientHeight; |
||||
name: 'Home', |
||||
props: {}, |
||||
data: function() { |
||||
return { |
||||
top: '', |
||||
homeActive: true |
||||
}; |
||||
}, |
||||
computed: mapGetters(['homeActive']), |
||||
methods: { |
||||
userGo() { |
||||
this.$yrouter.push('/pages/user/User/index'); |
||||
}, |
||||
homeGo() { |
||||
this.$yrouter.switchTab('/pages/home/index'); |
||||
}, |
||||
shoppingCartGo() { |
||||
this.$yrouter.switchTab('/pages/shop/ShoppingCart/index'); |
||||
}, |
||||
touchmove(event) { |
||||
// event.preventDefault(); |
||||
// let top = |
||||
// event.touches[0].pageY - |
||||
// (document.documentElement.scrollTop || document.body.scrollTop) - |
||||
// this.$el.clientHeight; |
||||
|
||||
// if (top > 390) top = 390; |
||||
// else if (top < 55) top = 55; |
||||
this.top = 55; |
||||
}, |
||||
open: function() { |
||||
this.homeActive |
||||
? this.$store.commit("CLOSE_HOME") |
||||
: this.$store.commit("OPEN_HOME"); |
||||
} |
||||
} |
||||
// if (top > 390) top = 390; |
||||
// else if (top < 55) top = 55; |
||||
this.top = 55; |
||||
}, |
||||
open: function() { |
||||
this.homeActive ? this.$store.commit('CLOSE_HOME') : this.$store.commit('OPEN_HOME'); |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
<style scoped> |
||||
.mystyl { |
||||
display: inline-block; |
||||
width: 0.64rem; |
||||
height: 0.64rem; |
||||
margin-top: 0.12rem; |
||||
box-sizing: border-box; |
||||
border: 1px solid #e1e1e1; |
||||
border-radius: 50%; |
||||
background-size: 1.24rem auto; |
||||
background-repeat: no-repeat; |
||||
background-color: rgba(255, 255, 255, 0.9); |
||||
display: inline-block; |
||||
width: 0.64rem; |
||||
height: 0.64rem; |
||||
margin-top: 0.12rem; |
||||
box-sizing: border-box; |
||||
border: 1px solid #e1e1e1; |
||||
border-radius: 50%; |
||||
background-size: 1.24rem auto; |
||||
background-repeat: no-repeat; |
||||
background-color: rgba(255, 255, 255, 0.9); |
||||
} |
||||
</style> |
||||
|
@ -1,41 +1,37 @@
|
||||
<template> |
||||
<div class="promotionGood" v-if="benefit.length > 0"> |
||||
<div |
||||
@click="$yrouter.push({ path: '/pages/shop/GoodsCon/index',query:{id:item.id} })" |
||||
class="item acea-row row-between-wrapper" |
||||
v-for="(item, promotionGoodIndex) in benefit" |
||||
:key="promotionGoodIndex" |
||||
> |
||||
<div class="pictrue"> |
||||
<img :src="item.image" class="image" /> |
||||
</div> |
||||
<div class="text"> |
||||
<div class="name line1">{{ item.storeName }}</div> |
||||
<div class="sp-money acea-row"> |
||||
<div class="moneyCon"> |
||||
促销价: ¥ |
||||
<span class="num">{{ item.price }}</span> |
||||
</div> |
||||
</div> |
||||
<div class="acea-row row-between-wrapper"> |
||||
<div class="money">日常价:¥{{ item.otPrice }}</div> |
||||
<div>仅剩:{{ item.stock }}{{ item.unitName }}</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="promotionGood" v-if="benefit.length > 0"> |
||||
<div class="item acea-row row-between-wrapper" v-for="(item, promotionGoodIndex) in benefit" :key="promotionGoodIndex" @click="routerGo(item)"> |
||||
<div class="pictrue"><img :src="item.image" class="image" /></div> |
||||
<div class="text"> |
||||
<div class="name line1">{{ item.storeName }}</div> |
||||
<div class="sp-money acea-row"> |
||||
<div class="moneyCon"> |
||||
促销价: ¥ |
||||
<span class="num">{{ item.price }}</span> |
||||
</div> |
||||
</div> |
||||
<div class="acea-row row-between-wrapper"> |
||||
<div class="money">日常价:¥{{ item.otPrice }}</div> |
||||
<div>仅剩:{{ item.stock }}{{ item.unitName }}</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
export default { |
||||
name: "PromotionGood", |
||||
props: { |
||||
benefit: { |
||||
type: Array, |
||||
default: () => [] |
||||
} |
||||
}, |
||||
data: function() { |
||||
return {}; |
||||
} |
||||
name: 'PromotionGood', |
||||
props: ['benefit'], |
||||
data: function() { |
||||
return {}; |
||||
}, |
||||
methods: { |
||||
routerGo(item) { |
||||
this.$yrouter.push({ path: '/pages/shop/GoodsCon/index', query: { id: item.id } }); |
||||
} |
||||
}, |
||||
mounted() { |
||||
console.log(this, 999); |
||||
} |
||||
}; |
||||
</script> |
||||
|
@ -1,69 +1,70 @@
|
||||
<template> |
||||
<div class="recommend" ref="container"> |
||||
<div class="title acea-row row-center-wrapper"> |
||||
<span class="iconfont icon-zhuangshixian"></span> |
||||
<span class="name">为你推荐</span> |
||||
<span class="iconfont icon-zhuangshixian lefticon"></span> |
||||
</div> |
||||
<div class="recommendList acea-row row-between-wrapper"> |
||||
<div |
||||
@click="$yrouter.push({ path: '/pages/shop/GoodsCon/index',query:{id:item.id} })" |
||||
class="item" |
||||
v-for="(item, recommendIndex) in hostProduct" |
||||
:key="recommendIndex" |
||||
> |
||||
<div class="pictrue"> |
||||
<img :src="item.image" class="image" /> |
||||
</div> |
||||
<div class="name line1">{{ item.storeName }}</div> |
||||
<div class="money font-color-red"> |
||||
¥ |
||||
<span class="num">{{ item.price }}</span> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<Loading :loaded="loadend" :loading="loading"></Loading> |
||||
</div> |
||||
<div class="recommend" ref="container"> |
||||
<div class="title acea-row row-center-wrapper"> |
||||
<span class="iconfont icon-zhuangshixian"></span> |
||||
<span class="name">为你推荐</span> |
||||
<span class="iconfont icon-zhuangshixian lefticon"></span> |
||||
</div> |
||||
<div class="recommendList acea-row row-between-wrapper"> |
||||
<div |
||||
@click="routerGo(item)" |
||||
class="item" |
||||
v-for="(item, recommendIndex) in hostProduct" |
||||
:key="recommendIndex" |
||||
> |
||||
<div class="pictrue"><img :src="item.image" class="image" /></div> |
||||
<div class="name line1">{{ item.storeName }}</div> |
||||
<div class="money font-color-red"> |
||||
¥ |
||||
<span class="num">{{ item.price }}</span> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<Loading :loaded="loadend" :loading="loading"></Loading> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import { getHostProducts } from "@/api/store"; |
||||
import Loading from "@/components/Loading"; |
||||
import { getHostProducts } from '@/api/store'; |
||||
import Loading from '@/components/Loading'; |
||||
export default { |
||||
name: "Recommend", |
||||
props: {}, |
||||
components: { |
||||
Loading |
||||
}, |
||||
data: function() { |
||||
return { |
||||
hostProduct: [], |
||||
page: 1, |
||||
limit: 20, |
||||
loadTitle: "", |
||||
loading: false, |
||||
loadend: false |
||||
}; |
||||
}, |
||||
mounted: function() { |
||||
this.hostProducts(); |
||||
}, |
||||
methods: { |
||||
hostProducts: function() { |
||||
let that = this; |
||||
if (that.loading) return; //阻止下次请求(false可以进行请求); |
||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求); |
||||
that.loading = true; |
||||
getHostProducts(that.page, that.limit).then(res => { |
||||
that.loading = false; |
||||
//apply();js将一个数组插入另一个数组; |
||||
that.hostProduct.push.apply(that.hostProduct, res.data); |
||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成; |
||||
that.page = that.page + 1; |
||||
}); |
||||
} |
||||
}, |
||||
onReachBottom() { |
||||
!this.loading && this.hostProducts(); |
||||
} |
||||
name: 'Recommend', |
||||
props: {}, |
||||
components: { |
||||
Loading |
||||
}, |
||||
data: function() { |
||||
return { |
||||
hostProduct: [], |
||||
page: 1, |
||||
limit: 20, |
||||
loadTitle: '', |
||||
loading: false, |
||||
loadend: false |
||||
}; |
||||
}, |
||||
mounted: function() { |
||||
this.hostProducts(); |
||||
}, |
||||
methods: { |
||||
routerGo(item) { |
||||
this.$yrouter.push({ path: '/pages/shop/GoodsCon/index', query: { id: item.id } }); |
||||
}, |
||||
hostProducts: function() { |
||||
let that = this; |
||||
if (that.loading) return; //阻止下次请求(false可以进行请求); |
||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求); |
||||
that.loading = true; |
||||
getHostProducts(that.page, that.limit).then(res => { |
||||
that.loading = false; |
||||
//apply();js将一个数组插入另一个数组; |
||||
that.hostProduct.push.apply(that.hostProduct, res.data); |
||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成; |
||||
that.page = that.page + 1; |
||||
}); |
||||
} |
||||
}, |
||||
onReachBottom() { |
||||
!this.loading && this.hostProducts(); |
||||
} |
||||
}; |
||||
</script> |
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue