123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366 |
- <!-- <template>
- <view class="wholesale" v-if="goodList.length > 0">
- <view class="title">
- <view class="left">
- <view class="img">
- <image src="../../../static/img/list1.png" mode=""></image>
- </view>
- <view class="title-t"> 批发专区 </view>
- <view class="about"> 限时抢购 </view>
- </view>
-
- <view class="right" @click="navto('/pages/product/wholesale')">
- <view class="jj-more-tit">
- 更多
- </view>
- <image src="../../../static/img/img39.png" class="jj-more"></image>
- </view>
- </view>
- <view class="date" v-if="goodList.length > 0">
- <view class="date-item"
- v-for="item in goodList.slice(0,3)"
- @click="navto('/pages/product/realyWhole?id=' + item.id + '&time=' + item.time_id)">
- <image :src="item.whole.image"></image>
- <view class="item-tit clamp">
- {{item.whole.title}}
- </view>
- <view class="item-price">
- ¥{{item.price}}
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- getWholeTimeArea,
- getWholeList
- } from '@/api/whole.js'
- export default {
- data() {
- return {
- list: [],
- goodList: []
- }
- },
- filters: {
- timet(val) {
- let str = ''
- if (val) {
- let date = new Date(val * 1000);
- let h = date.getHours() >= 10 ? date.getHours() : ('0' + date.getHours())
- let m = date.getMinutes() >= 10 ? date.getMinutes() : ('0' + date.getMinutes())
- str = h + ':' + m
- }
- return str
- }
- },
- mounted() {
- this.getTimeArea()
- },
- methods: {
- navto(url) {
- uni.navigateTo({
- url: url
- })
- },
-
- getTimeArea() {
- getWholeTimeArea().then(({
- data
- }) => {
- this.list = data.seckillTime
- this.list.forEach(item => {
- // this.
- getWholeList({},item.id).then(res => {
- console.log(res.data.data)
- this.goodList = this.goodList.concat(res.data.data)
- })
- })
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- $grey: #95A0B1;
- $text: #333333;
- $red: #FF4C4C;
- .wholesale {
- padding: 20rpx;
- background-color: #fff;
- margin: 20rpx 0;
- .title {
- display: flex;
- line-height: 40rpx;
- justify-content: space-between;
- .left {
- display: flex;
- align-items: center;
- }
- .title-t {
- color: $text;
- font-weight: bold;
- margin: 0 20rpx;
- font-size: 34rpx;
- }
- .about {
- font-size: 24rpx;
- color: $grey;
- }
- image {
- width: 40rpx;
- height: 40rpx;
- }
- .right {
- display: flex;
- width: 200rpx;
- font-size: 22rpx;
- // justify-content: sp;
- justify-content: flex-end;
- align-items: center;
- padding-right: 20rpx;
- color: #999;
- .jj-more {
- margin-left: 10rpx;
- width: 15rpx;
- height: 22rpx;
- }
- }
- }
- .date {
- padding: 30rpx 0;
- display: flex;
- justify-content: flex-start;
- .date-item {
- width: 220rpx;
- height: 270rpx;
- position: relative;
- margin-right: 20rpx;
- image {
- border-radius: 20rpx;
- // max-width: 32%;
- width: 220rpx;
- height: 222rpx;
- }
- .item-name {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- position: absolute;
- top: 36rpx;
- padding-left: 30rpx;
- }
- .item-time {
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- position: absolute;
- top: 80rpx;
- padding-left: 30rpx;
- }
- .item-price {
- padding-left: 10rpx;
- font-size: 28rpx;
- color: $red;
- font-weight: bold;
- }
- .item-tit {
- padding-left: 10rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- }
- // image {
- // border-radius: 20rpx;
- // // max-width: 32%;
- // width: 220rpx;
- // height: 300rpx;
- // }
- }
- }
- </style>
- -->
-
- <template>
- <view class="wholesale">
- <view class="title">
- <view class="img">
- <image src="../../../static/img/list1.png" mode=""></image>
- </view>
- <view class="title-t"> 批发专区 </view>
- <view class="about"> 限时抢购 </view>
- </view>
- <view class="date" v-if="list.length > 0">
- <view class="date-item"
- @click="navto('/pages/product/wholesale?bin=' + encodeURI(list[0].time) + '&stp=' + list[0].stop + '&status=' + list[0].status + '&state=' + list[0].state + '&wid=' + list[0].id)">
- <image src="../../../static/img/mom.png"></image>
- <view class="item-name">
- 上午场
- </view>
- <view class="item-time">
- {{list[0].time}}~{{list[0].stop | timet}}
- </view>
- </view>
- <view class="date-item"
- @click="navto('/pages/product/wholesale?bin=' + encodeURI(list[1].time) + '&stp=' + list[1].stop + '&status=' + list[1].status + '&state=' + list[1].state + '&wid=' + list[1].id)">
- <image src="../../../static/img/aft.png"></image>
- <view class="item-name">
- 下午场
- </view>
- <view class="item-time">
- {{list[1].time}}~{{list[1].stop | timet}}
- </view>
- </view>
- <view class="date-item"
- @click="navto('/pages/product/wholesale?bin=' + encodeURI(list[2].time) + '&stp=' + list[2].stop + '&status=' + list[2].status + '&state=' + list[2].state + '&wid=' + list[2].id)">
- <image src="../../../static/img/eve.png"></image>
- <view class="item-name">
- 晚上场
- </view>
- <view class="item-time">
- {{list[2].time}}~{{list[2].stop | timet}}
- </view>
- </view>
- </view>
- </view>
- </template>
-
- <script>
- import {
- getWholeTimeArea
- } from '@/api/whole.js'
- export default {
- data() {
- return {
- list: []
- }
- },
- filters: {
- timet(val) {
- let str = ''
- if (val) {
- let date = new Date(val * 1000);
- let h = date.getHours() >= 10 ? date.getHours() : ('0' + date.getHours())
- let m = date.getMinutes() >= 10 ? date.getMinutes() : ('0' + date.getMinutes())
- str = h + ':' + m
- }
- return str
- }
- },
- mounted() {
- this.getTimeArea()
- },
- methods: {
- navto(url) {
- uni.navigateTo({
- url: url
- })
- },
- getTimeArea() {
- getWholeTimeArea().then(({
- data
- }) => {
- this.list = data.seckillTime
- })
- }
- }
- }
- </script>
-
- <style lang="scss" scoped>
- $grey: #95A0B1;
- $text: #333333;
- $red: #FF4C4C;
-
- .wholesale {
- padding: 20rpx;
- background-color: #fff;
- margin: 20rpx 0;
-
- .title {
- display: flex;
- line-height: 40rpx;
-
- .title-t {
- color: $text;
- font-weight: bold;
- margin: 0 20rpx;
- font-size: 34rpx;
- }
-
- .about {
- font-size: 24rpx;
- color: $grey;
- }
-
- image {
- width: 40rpx;
- height: 40rpx;
- }
- }
-
- .date {
- padding: 30rpx 0;
- display: flex;
- justify-content: space-between;
-
- .date-item {
- width: 220rpx;
- height: 300rpx;
- position: relative;
-
- image {
- border-radius: 20rpx;
- // max-width: 32%;
- width: 220rpx;
- height: 300rpx;
- }
-
- .item-name {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- position: absolute;
- top: 36rpx;
- padding-left: 30rpx;
-
- }
-
- .item-time {
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- position: absolute;
- top: 80rpx;
- padding-left: 30rpx;
- }
- }
-
- // image {
- // border-radius: 20rpx;
- // // max-width: 32%;
- // width: 220rpx;
- // height: 300rpx;
- // }
- }
- }
- </style>
|