| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <template>
- <view class="content">
- <!-- #ifdef APP-PLUS -->
- <view class="status_bar"></view>
- <!-- #endif -->
- <view class="body-title">
- <view class="goback-box" @click="toBack">
- <image class="goback" src="../../static/icon/fanhui.png" mode=""></image>
- </view>
- <view class="header">爆品专区</view>
- </view>
- <view class="top-bg flex">
- <image src="../../static/img/bd-mbg.png" mode=""></image>
- </view>
- <view class="bastgood-box">
- <view class="bg-bg">
- </view>
- <view v-for="(item, index) in list" :key="item.id" class="guess-item">
- <image :src="item.image"></image>
- <view class="guess-box">
- <view class="title clamp2">{{item.store_name}}</view>
- <view class="info">
- <view class="price-box flex">
- <image src="../../static/icon/xfq.png" mode="widthFix"></image>
- <view class="jiang">赠送积分{{item.give_integral*1}}个</view>
- </view>
- <view class="price">¥{{ item.price }}
- <view class="yuanprice">¥{{item.ot_price*1}}</view>
- </view>
- </view>
- <view class="btn" @click.stop="navTo('/pages/product/product?id=' + item.id + '&is_xf=0&is_bk=1')">
- 立即购买</view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </view>
- </view>
- </template>
- <script>
- import {
- getProducts
- } from '@/api/product.js'
- export default {
- data() {
- return {
- page: 1,
- limit: 10,
- list: [],
- loadingType: 'more'
- }
- },
- onLoad() {
- this.getProducts()
- },
- onShow() {
- },
- onReachBottom() {
- this.getProducts()
- },
- onReady() {
- },
- methods: {
- navTo(url) {
- uni.navigateTo({
- url
- })
- },
- toBack() {
- uni.switchTab({
- url: '/pages/index/index'
- })
- },
- getProducts() {
- let obj = this
- if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
- return
- }
- obj.loadingType = 'loading'
- getProducts({
- sid: 2,
- page: obj.page,
- limit: obj.limit
- }).then(res => {
- console.log(res)
- obj.list = obj.list.concat(res.data)
- obj.page++
- if (obj.limit == res.data.length) {
- obj.loadingType = 'more'
- } else {
- obj.loadingType = 'noMore'
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background: #fff;
- height: auto;
- min-height: 100%;
- }
- .status_bar {
- height: var(--status-bar-height);
- width: 100%;
- background: #ff6100;
- }
- .body-title {
- height: 80rpx;
- text-align: center;
- font-size: 35rpx;
- background-color: #ff6100;
- position: relative;
- .header {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #fffeff;
- height: 80rpx;
- font-size: 36rpx;
- font-weight: 700;
- z-index: 9;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .goback-box {
- position: absolute;
- left: 18rpx;
- top: 0;
- height: 80rpx;
- display: flex;
- align-items: center;
- }
- .goback {
- z-index: 100;
- width: 34rpx;
- height: 34rpx;
- }
- }
- .top-bg {
- background: #ff6100;
- justify-content: center;
- align-items: center;
- padding: 30rpx 0;
- image {
- width: 700rpx;
- height: 350rpx;
- border-radius: 20rpx;
- }
- }
- .bastgood-box {
- background-color: #ffffff;
- position: relative;
- .bg-bg {
- position: absolute;
- height: 380rpx;
- width: 750rpx;
- top: 0;
- left: 0;
- background: linear-gradient(180deg, #ff6100, #fff);
- }
- .guess-item {
- display: flex;
- width: 710rpx;
- background: #ffffff;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
- border-radius: 10rpx;
- padding: 15rpx;
- margin: 0rpx auto 20rpx;
- position: relative;
- image {
- width: 236rpx;
- height: 236rpx;
- border-radius: 10rpx;
- }
- .guess-box {
- padding: 12rpx 0 15rpx 24rpx;
- width: 436rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .title {
- font-size: 32rpx;
- padding-left: 4rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- width: 368rpx;
- line-height: 36rpx;
- }
- .price-box {
- // margin-top: 76rpx;
- justify-content: flex-start;
- image {
- width: 28rpx;
- }
- .jiang {
- padding-left: 4rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #b59467;
- }
- }
- .price {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ff1135;
- display: flex;
- align-items: center;
- .yuanprice {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- text-decoration: line-through;
- color: #999999;
- padding-left: 6rpx;
- }
- }
- .btn {
- width: 138rpx;
- height: 52rpx;
- background: #ff4c4c;
- border-radius: 26rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- line-height: 52rpx;
- text-align: center;
- position: absolute;
- bottom: 25rpx;
- right: 25rpx;
- }
- }
- }
- }
- </style>
|