123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <template>
- <view class="main">
- <view class="list-box-h">
- <view v-for="(item, index) in dataList" :key="index" class="guess-item" @click="navToDetailPage(item)">
- <image :src="item.image"></image>
- <view class="guess-box">
- <view class="title clamp2">{{ item.store_name }}</view>
- <view class="price-box flex">
- <view class="yuanprice">{{ item.ot_price }}</view>
- <image src="../../static/img/jiantou.png" mode=""></image>
- <view class="jiang">直降{{ (item.ot_price - item.price).toFixed(2) }}元</view>
- </view>
- <view class="price">¥{{ item.price }}</view>
- <view class="btn">立即购买</view>
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </view>
- </template>
- <script>
- import { getProducts } from '@/api/product.js';
- export default {
- data() {
- return {
- list: [],
- page: 1,
- limit: 10,
- loadingType: 'more',
- cid: 0,
- vip:0
- }
- },
- onLoad(opt) {
- this.cid = opt.cid||''
- this.tit = decodeURI(opt.tit)
- uni.setNavigationBarTitle({
- title: this.tit
- })
- this.vip = +opt.vip||0
- this.getArticleList()
- },
- methods: {
- navto(url) {
- uni.navigateTo({
- url: url
- })
- },
- getArticleList() {
- let obj = this
- if(obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
- return
- }
- obj.loadingType = 'loading'
- getProducts({
- page: obj.page,
- limit: obj.limit,
- can_up_level:this.vip//设置是否vip商品
- },obj.cid).then(({data}) => {
- obj.list = obj.list.concat(data)
- obj.page++
- if(data.length == obj.limit) {
- obj.loadingType = 'more'
- }else {
- obj.loadingType = 'noMore'
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- background-color: #fff;
- min-height: 100%;
- }
- .main {
- margin-top: 40rpx;
- padding: 0 40rpx;
- .main-t-t {
- // width: 100;
- display: flex;
- justify-content: center;
- .main-t-t-i {
- width: 376rpx;
- height: 34rpx;
- margin: auto;
- }
- }
- .main-top {
- align-items: center;
-
- .main-left {
- display: flex;
- justify-content: flex-start;
- align-items: center;
-
- .shu {
- width: 8rpx;
- height: 38rpx;
- background: #05ab81;
- border-radius: 4rpx;
- }
-
- .main-title {
- margin-left: 10rpx;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #202739;
- }
-
- .main-tip {
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #95a0b1;
- margin-left: 14rpx;
- }
- }
- }
- }
- </style>
|