Browse Source
- (2020/04/12) [+] 首页榜单进去提示登陆,页面空白:,还有这种总数操作也会就跳转到授权页面,应该是又问题的这快 - (2020/04/12) [+] 全部商品,右边有错误截图如下 - (2020/04/12) [+] 秒杀列表数据不显示;公众号15点的就有数据,但是小程序没有 - (2020/04/12) [+] 7、砍价可以改下,看下最新H5代码,首次进来不自动砍价,自己点击才砍价一次,而且里面详情是乱的 - (2020/04/12) [+] 为啥我也没退出,就取截个图,再进来,点击商品详情,又让登陆,登陆失效怎么这么快,mpvue小程序就没这个问题,这个问题非常严重,一会让让跳转到授权页面登陆!! - (2020/04/12) [+] 1、商品购买选择规格,这个开始进去点可以,点到后面花色的规格点不动了 - (2020/04/12) [+] 2、拼团客服隐藏掉,下面按钮太那个了,把商品详情那个收藏功能放进来,他们收藏功能都是一样的 - (2020/04/12) [+] 商品详情海报一直海报生成中 - (2020/04/12) [+] 砍价弹窗修改 - (2020/04/11) [+] 1、购买选择规格属性点不了 - (2020/04/11) [+] 12、拼团详情客服功能隐藏去掉,其他地方有客服功能的都去掉 - (2020/04/11) [+] 11、分类点击 会分类Tab页分类一级比一级低 - (2020/04/11) [+] 10、我的推广,里面样式有问题,点击海报里面空白 - (2020/04/11) [+] 9、小程序订单核销没上 你那边先根据路径判断隐藏下 - (2020/04/11) [+] 8、订单点击评价没反应 - (2020/04/11) [+] 6、个人中心我的余额点进去点击账单记录一直正在加载中,点击下全部就出来了,应该你没带默认参数 - (2020/04/11) [+] 5、添加地址选择地区无效 - (2020/04/11) [+] 4、待收货 列表查看物流点击没反应,详情查看物流可以点 - (2020/04/11) [+] 3、下单点击积分抵扣没反应 - (2020/04/11) [+] 2、购物车列表点击管理 点击收藏功能去掉master
14 changed files with 393 additions and 297 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,238 +1,263 @@ |
|||||||
<template> |
<template> |
||||||
<view class="flash-sale" ref="container"> |
<view class="flash-sale" ref="container"> |
||||||
<view class="header" v-if="headerImg"> |
<view class="header" v-if="headerImg"> |
||||||
<image :src="headerImg" /> |
<image :src="headerImg" /> |
||||||
</view> |
</view> |
||||||
<scroll-view scroll-y="false" scroll-x="true"> |
<scroll-view scroll-y="false" scroll-x="true"> |
||||||
<view class="timeScroll"> |
<view class="timeScroll"> |
||||||
<view class="" v-for="(item, index) in timeList" :key="index"> |
<view class v-for="(item, index) in timeList" :key="index"> |
||||||
<view :class="{'timeItem':true,'active':active==index}" @click="changeTime(index)"> |
<view :class="{'timeItem':true,'active':active==index}" @click="setTime(index)"> |
||||||
<view class="time">{{ item.time }}</view> |
<view class="time">{{ item.time }}</view> |
||||||
<view class="state">{{ item.state }}</view> |
<view class="state">{{ item.state }}</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</scroll-view> |
</scroll-view> |
||||||
<view class="" v-for="(item, index) in timeList" :key="index"> |
<view class v-for="(item, index) in timeList" :key="index"> |
||||||
<view v-if="active == index"> |
<view v-if="active == index"> |
||||||
<view class="countDown font-color-red acea-row row-center-wrapper"> |
<view class="countDown font-color-red acea-row row-center-wrapper"> |
||||||
<view v-if="item.status === 0" class="activity">活动已结束</view> |
<view v-if="item.status === 0" class="activity">活动已结束</view> |
||||||
<count-down :is-day="false" :tip-text="'距结束仅剩 '" :day-text="''" :hour-text="' : '" :minute-text="' : '" |
<count-down |
||||||
:second-text="''" :datatime="datatime" v-if="item.status === 1"></count-down> |
:is-day="false" |
||||||
<view v-if="item.status === 2" class="activity">活动即将开始</view> |
:tip-text="'距结束仅剩 '" |
||||||
</view> |
:day-text="''" |
||||||
<view class="list"> |
:hour-text="' : '" |
||||||
<view class="item acea-row row-between-wrapper" v-for="(itemSeckill, indexSeckill) in seckillList" :key="indexSeckill"> |
:minute-text="' : '" |
||||||
<view class="pictrue"> |
:second-text="''" |
||||||
<image :src="itemSeckill.image" /> |
:datatime="datatime" |
||||||
</view> |
v-if="item.status === 1" |
||||||
<view class="text acea-row row-column-around"> |
></count-down> |
||||||
<view class="line1" v-text="itemSeckill.title"></view> |
<view v-if="item.status === 2" class="activity">活动即将开始</view> |
||||||
<view class="money"> |
</view> |
||||||
限时价 |
<view class="list"> |
||||||
<text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text> |
<view |
||||||
</view> |
class="item acea-row row-between-wrapper" |
||||||
<view class="progress cart-color"> |
v-for="(itemSeckill, indexSeckill) in seckillList" |
||||||
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view> |
:key="indexSeckill" |
||||||
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view> |
> |
||||||
</view> |
<view class="pictrue"> |
||||||
</view> |
<image :src="itemSeckill.image" /> |
||||||
<view class="grab bg-color-red" v-if="item.status === 1 && itemSeckill.stock > 0" @click="goDetail(itemSeckill.id)">马上抢</view> |
</view> |
||||||
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view> |
<view class="text acea-row row-column-around"> |
||||||
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view> |
<view class="line1" v-text="itemSeckill.title"></view> |
||||||
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view> |
<view class="money"> |
||||||
</view> |
限时价 |
||||||
</view> |
<text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text> |
||||||
<view class="noCommodity" style="background-color: #fff;" v-if="seckillList.length === 0 && page > 1"> |
</view> |
||||||
<view class="noPictrue"> |
<view class="progress cart-color"> |
||||||
<image src="@/static/images/noGood.png" class="image" /> |
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view> |
||||||
</view> |
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
<view |
||||||
<!-- |
class="grab bg-color-red" |
||||||
|
v-if="item.status === 1 && itemSeckill.stock > 0" |
||||||
|
@click="goDetail(itemSeckill.id)" |
||||||
|
>马上抢</view> |
||||||
|
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view> |
||||||
|
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view> |
||||||
|
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<view |
||||||
|
class="noCommodity" |
||||||
|
style="background-color: #fff;" |
||||||
|
v-if="seckillList.length === 0 && page > 1" |
||||||
|
> |
||||||
|
<view class="noPictrue"> |
||||||
|
<image src="@/static/images/noGood.png" class="image" /> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<!-- |
||||||
<vant-tabs :active="active" @change="setTime" :sticky="sticky" animated line-height="2" :ellipsis="false"> |
<vant-tabs :active="active" @change="setTime" :sticky="sticky" animated line-height="2" :ellipsis="false"> |
||||||
<vant-tab :ellipsis="false" :title="[title[index]]"> |
<vant-tab :ellipsis="false" :title="[title[index]]"> |
||||||
|
|
||||||
</vant-tab> |
</vant-tab> |
||||||
</vant-tabs> --> |
</vant-tabs>--> |
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
<script> |
<script> |
||||||
import { |
import { getSeckillConfig, getSeckillList } from "@/api/activity"; |
||||||
getSeckillConfig, |
import CountDown from "@/components/CountDown"; |
||||||
getSeckillList |
// import { Tab, Tabs } from "vant-weapp"; |
||||||
} from '@/api/activity'; |
import Loading from "@/components/Loading"; |
||||||
import CountDown from '@/components/CountDown'; |
|
||||||
// import { Tab, Tabs } from "vant-weapp"; |
|
||||||
import Loading from '@/components/Loading'; |
|
||||||
|
|
||||||
export default { |
export default { |
||||||
name: 'GoodsSeckill', |
name: "GoodsSeckill", |
||||||
components: { |
components: { |
||||||
CountDown |
CountDown |
||||||
}, |
}, |
||||||
props: {}, |
props: {}, |
||||||
data: function() { |
data: function() { |
||||||
return { |
return { |
||||||
headerImg: '', |
headerImg: "", |
||||||
timeList: [], |
timeList: [], |
||||||
sticky: false, |
sticky: false, |
||||||
loading: false, |
loading: false, |
||||||
datatime: 0, |
datatime: 0, |
||||||
active: 0, |
active: 0, |
||||||
seckillList: [], |
seckillList: [], |
||||||
status: false, //砍价列表是否获取完成 false 未完成 true 完成 |
status: false, //砍价列表是否获取完成 false 未完成 true 完成 |
||||||
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成 |
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成 |
||||||
page: 1, //页码 |
page: 1, //页码 |
||||||
limit: 5, //数量 |
limit: 5, //数量 |
||||||
title: [], |
title: [] |
||||||
}; |
}; |
||||||
}, |
}, |
||||||
mounted: function() { |
mounted: function() { |
||||||
this.mountedStart(); |
this.mountedStart(); |
||||||
}, |
}, |
||||||
onReachBottom() { |
onReachBottom() { |
||||||
!this.loadingList && this.getSeckillList(); |
!this.loadingList && this.getSeckillList(); |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
changeTime: function(index) { |
changeTime: function(index) { |
||||||
this.active = index |
console.log(index); |
||||||
}, |
this.active = index; |
||||||
mountedStart: function() { |
this.getSeckillList(); |
||||||
var that = this; |
}, |
||||||
uni.showLoading(); |
mountedStart: function() { |
||||||
getSeckillConfig().then(res => { |
var that = this; |
||||||
that.$set(that, 'headerImg', res.data.lovely); |
uni.showLoading(); |
||||||
that.$set(that, 'timeList', res.data.seckillTime); |
getSeckillConfig().then(res => { |
||||||
that.$set(that, 'active', res.data.seckillTimeIndex); |
that.$set(that, "headerImg", res.data.lovely); |
||||||
|
that.$set(that, "timeList", res.data.seckillTime); |
||||||
|
that.$set(that, "active", res.data.seckillTimeIndex); |
||||||
|
|
||||||
let title = []; |
let title = []; |
||||||
title = res.data.seckillTime.map((item, index) => { |
title = res.data.seckillTime.map((item, index) => { |
||||||
return { |
return { |
||||||
name: 'div', |
name: "div", |
||||||
attrs: { |
attrs: { |
||||||
class: 'timeItem' |
class: "timeItem" |
||||||
}, |
}, |
||||||
children: [{ |
children: [ |
||||||
name: 'div', |
{ |
||||||
attrs: { |
name: "div", |
||||||
class: 'time' |
attrs: { |
||||||
}, |
class: "time" |
||||||
children: [{ |
}, |
||||||
type: 'text', |
children: [ |
||||||
text: item.time |
{ |
||||||
}] |
type: "text", |
||||||
}, |
text: item.time |
||||||
{ |
} |
||||||
name: 'div', |
] |
||||||
attrs: { |
}, |
||||||
class: 'state' |
{ |
||||||
}, |
name: "div", |
||||||
children: [{ |
attrs: { |
||||||
type: 'text', |
class: "state" |
||||||
text: item.state |
}, |
||||||
}] |
children: [ |
||||||
} |
{ |
||||||
] |
type: "text", |
||||||
}; |
text: item.state |
||||||
}); |
} |
||||||
that.$set(that, 'title', title); |
] |
||||||
that.datatime = that.timeList[that.active].stop; |
} |
||||||
that.getSeckillList(); |
] |
||||||
that.$nextTick(function() { |
}; |
||||||
that.sticky = true; |
}); |
||||||
uni.hideLoading(); |
that.$set(that, "title", title); |
||||||
}); |
that.datatime = that.timeList[that.active].stop; |
||||||
}); |
that.getSeckillList(); |
||||||
}, |
that.$nextTick(function() { |
||||||
setTime: function(event) { |
that.sticky = true; |
||||||
var that = this; |
uni.hideLoading(); |
||||||
that.active = event.mp.detail.index; |
}); |
||||||
that.datatime = that.timeList[that.active].stop; |
}); |
||||||
that.getSeckillList(); |
}, |
||||||
}, |
setTime: function(index) { |
||||||
getSeckillList: function() { |
var that = this; |
||||||
var that = this; |
that.page = 1; |
||||||
if (that.loadingList) return; |
that.loadingList = false; |
||||||
if (that.status) return; |
that.status = false; |
||||||
var time = that.timeList[that.active].id; |
that.active = index; |
||||||
getSeckillList(time, { |
that.datatime = that.timeList[that.active].stop; |
||||||
page: that.page, |
that.getSeckillList(); |
||||||
limit: that.limit |
}, |
||||||
}).then(res => { |
getSeckillList: function() { |
||||||
that.status = res.data.length < that.limit; |
var that = this; |
||||||
that.seckillList.push.apply(that.seckillList, res.data); |
if (that.loadingList) return; |
||||||
that.page++; |
if (that.status) return; |
||||||
uni.hideLoading(); |
var time = that.timeList[that.active].id; |
||||||
}); |
getSeckillList(time, { |
||||||
}, |
page: that.page, |
||||||
goDetail: function(id) { |
limit: that.limit |
||||||
var that = this; |
}).then(res => { |
||||||
var time = that.timeList[that.active].stop; |
that.status = res.data.length < that.limit; |
||||||
this.$yrouter.push({ |
that.seckillList.push.apply(that.seckillList, res.data); |
||||||
path: '/pages/activity/SeckillDetails/index', |
that.page++; |
||||||
query: { |
uni.hideLoading(); |
||||||
id, |
}); |
||||||
time |
}, |
||||||
} |
goDetail: function(id) { |
||||||
}); |
var that = this; |
||||||
} |
var time = that.timeList[that.active].stop; |
||||||
} |
this.$yrouter.push({ |
||||||
}; |
path: "/pages/activity/SeckillDetails/index", |
||||||
|
query: { |
||||||
|
id, |
||||||
|
time |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
}; |
||||||
</script> |
</script> |
||||||
<style scoped lang="less"> |
<style scoped lang="less"> |
||||||
.timeScroll { |
.timeScroll { |
||||||
display: flex; |
display: flex; |
||||||
align-items: center; |
align-items: center; |
||||||
flex-direction: row; |
flex-direction: row; |
||||||
} |
} |
||||||
|
|
||||||
.timeItem { |
.timeItem { |
||||||
font-size: 0.22 * 100rpx; |
font-size: 0.22 * 100rpx; |
||||||
color: #282828; |
color: #282828; |
||||||
width: 150rpx; |
width: 150rpx; |
||||||
text-align: center; |
text-align: center; |
||||||
padding: 0.11 * 100rpx 0; |
padding: 0.11 * 100rpx 0; |
||||||
background-color: none; |
background-color: none; |
||||||
|
|
||||||
&.active { |
&.active { |
||||||
|
.time { |
||||||
|
color: #00c17b; |
||||||
|
} |
||||||
|
|
||||||
.time { |
.state { |
||||||
color: #00c17b |
background-color: #00c17b; |
||||||
} |
color: #fff; |
||||||
|
opacity: 1; |
||||||
|
border-radius: 30rpx; |
||||||
|
padding: 0 0.2 * 100rpx; |
||||||
|
font-weight: 800; |
||||||
|
height: 0.37 * 100rpx; |
||||||
|
line-height: 0.37 * 100rpx; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
.state { |
.timeItem .time { |
||||||
background-color: #00c17b; |
font-size: 0.32 * 100rpx; |
||||||
color: #fff; |
font-weight: bold; |
||||||
opacity: 1; |
height: 0.37 * 100rpx; |
||||||
border-radius: 30rpx; |
line-height: 0.37 * 100rpx; |
||||||
padding: 0 .2*100rpx; |
} |
||||||
font-weight: 800; |
|
||||||
height: .3*100rpx; |
|
||||||
line-height: .3*100rpx; |
|
||||||
} |
|
||||||
|
|
||||||
} |
.timeItem .state { |
||||||
} |
height: 0.37 * 100rpx; |
||||||
|
line-height: 0.37 * 100rpx; |
||||||
|
} |
||||||
|
|
||||||
.timeItem .time { |
.activity { |
||||||
font-size: 0.32 * 100rpx; |
color: #333; |
||||||
font-weight: bold; |
} |
||||||
height: 0.37 * 100rpx; |
|
||||||
line-height: 0.37 * 100rpx; |
|
||||||
} |
|
||||||
|
|
||||||
.timeItem .state { |
.flash-sale .list .item .grab { |
||||||
height: 0.37 * 100rpx; |
background-color: #999; |
||||||
line-height: 0.37 * 100rpx; |
} |
||||||
} |
|
||||||
|
|
||||||
.activity { |
|
||||||
color: #333; |
|
||||||
} |
|
||||||
|
|
||||||
.flash-sale .list .item .grab { |
|
||||||
background-color: #999; |
|
||||||
} |
|
||||||
</style> |
</style> |
||||||
|
Loading…
Reference in new issue