123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <template>
- <view :class="['qn-page-' + theme]" style="height: 100vh">
- <view class="good-list">
- <view class="good" v-for="item in list" @click="goPage('/pagesT/unit/itemdetail?id=' + item.id + '&isyhk=1')">
- <image :src="item.image" mode="" class="good-image"></image>
- <view class="good-name ">
- <view class="clamp2">
- {{item.name}}
- </view>
- </view>
- <view class="good-price">
- <view class="price">
- {{item.price}}
- </view>
- <!-- <view class="xl">
- 销量:{{item.sold}}
- </view> -->
- </view>
- </view>
- </view>
- <u-loadmore :status="loadingType" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- page: 1,
- pageSize: 10,
- loaded: false,
- loadingType: 'loadmore',
- list: []
- }
- },
- onLoad(opt) {
- },
- onShow() {
- this.getList()
- },
- onReachBottom() {
- this.getList()
- },
- onReady() {
- },
- methods: {
- getList(type) {
- let that = this
- if (type == 'tab' && that.loaded) {
- return
- }
- if (that.loadingType == 'loading' || that.loadingType == 'nomore') {
- return
- }
- that.loadingType = 'loading'
- that.$u.api.getYhkList({
- page: that.page,
- pageSize: that.pageSize,
- }).then(({
- data
- }) => {
- that.list = that.list.concat(data)
- that.page++
- if (data.length == that.pageSize) {
- that.loadingType = 'loadmore'
- } else {
- that.loadingType = 'nomore'
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .good-list {
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- padding: 20rpx 28rpx;
- .good {
- width: 336rpx;
- height: 482rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 6rpx 0px rgba(0, 0, 0, 0.1);
- border-radius: 14rpx;
- margin-bottom: 20rpx;
- position: relative;
- .good-image {
- width: 336rpx;
- height: 336rpx;
- background-color: #999999;
- border-radius: 14rpx 14rpx 0 0;
- }
- .good-name {
- font-size: 28rpx;
- font-weight: bold;
- color: #333333;
- padding: 0 20rpx;
- }
- .good-price {
- display: flex;
- width: 336rpx;
- justify-content: space-between;
- font-size: 28rpx;
- font-weight: bold;
- color: #FF1A1A;
- position: absolute;
- bottom: 20rpx;
- padding: 0 20rpx;
- .xl{
- font-size: 20rpx;
- font-weight: bold;
- color: #999999;
- }
- }
- }
- }
- </style>
|