| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <template>
- <view class="content">
- <empty v-if="loaded && list.length === 0"></empty>
- <view class="good-wrap">
-
- <view class="good" v-for="item in list" @click="gotoDetail(item)">
- <image :src="item.image" mode="" class="goo-img"></image>
- <view class="good-tit clamp">
- {{item.store_name}}
- </view>
- <view class="good-price flex">
- <view class="new-price">
- ¥{{item.price}}
- </view>
- <!-- <view class="old-price">
- ¥{{item.}}
- </view> -->
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- <view class="sq" @click="navto('/pages/category/apply')">
- <image src="../../static/user/u3.png" mode="" class="sq-logo"></image>
- <view class="sq-tit">
- 申请
- </view>
- </view>
- </view>
- </template>
- <script>
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import empty from '@/components/empty';
-
- import { getProducts } from '@/api/product.js'
- export default {
- components: {
- empty,
- uniLoadMore
- },
- data() {
- return {
- page: 1,
- limit: 10,
- list: [],
- loadingType: 'more',
- loaded: false
- }
- },
- onLoad() {
- this.getProductList()
- },
- onReachBottom() {
- this.getProductList()
- },
- methods: {
- navto(url) {
- uni.navigateTo({
- url: url
- })
- },
- gotoDetail(item) {
- uni.navigateTo({
- url: '/pages/product/product?id=' + item.id
- })
- },
- getProductList() {
- let obj = this
- if(obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
- return
- }
- obj.loadingType = 'loading'
- getProducts({
- page: obj.page,
- limit: obj.limit,
- is_gold: 0,
- is_integral: 0
- }).then(({data}) => {
- obj.list = obj.list.concat(data)
- obj.page++
- if(data.length == obj.limit) {
- obj.loadingType = 'more'
- }else {
- obj.loadingType = 'noMore'
- }
- this.loaded = true
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .good-wrap {
- display: flex;
- // padding: 0 0 20rpx 20rpx;
- padding-left: 20rpx;
- padding-top: 20rpx;
- flex-wrap: wrap;
- }
-
- .good {
- width: 345rpx;
- height: 480rpx;
- margin-right: 20rpx;
- margin-bottom: 20rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
- border-radius: 10rpx;
- position: relative;
- .xrlb {
- position: absolute;
- display: inline-block;
- padding: 5rpx 10rpx;
- background-color: #FF4C4C;
- color: #fff;
- text-align: center;
- border-radius: 0 10rpx 10rpx 0;
- // width: 100rpx;
- top: 0;
- left: 0;
- }
- .goo-img {
- width: 345rpx;
- height: 345rpx;
- border-radius: 10rpx 10rpx 0 0;
- // background-color: #bfa;
- }
-
- .good-tit {
- padding: 15rpx 20rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- line-height: 35rpx;
- }
-
- .good-price {
- padding-left: 20rpx;
- justify-content: flex-start;
-
- .new-price {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FF4C4C;
- }
-
- .old-price {
- padding-left: 8rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: bold;
- text-decoration: line-through;
- color: #999999;
-
- }
- }
- }
- .sq {
- position: fixed;
- bottom: 300rpx;
- right: 20rpx;
- background-color: #fff;
- border-radius: 50%;
- box-shadow: 0px 0 10rpx #999;
- width: 100rpx;
- height: 100rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- .sq-logo {
- width: 40rpx;
- height: 40rpx;
- }
- .sq-tit {
- padding-top: 10rpx;
- font-size: 22rpx;
- }
- }
- </style>
|