123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413 |
- <template>
- <!-- <view class="lyy-bg4">
- <view class="lyy-f-a">
- <view class="lyy-f-b lyy-flex">
- <view class="lyy-f-c item" @click="goProduct(items)" v-for="(items, ind) in goodsList" :key="ind">
- <view class="content">
- <view><image :src="items.image" class="lyy-f-image" /></view>
- <view class="lyy-f-word1 lyy-f-jl ellipsis">{{ items.title }}</view>
- <view class="lyy-flex2">
- <view class="lyy-flex3">
- <view class="lyy-f-word2 lyy-f-jl">¥{{ items.price * 1 }}</view>
- </view>
- <view class="lyy-a-tu2 lyy-flex2">
- <view class="lyy-a-tu3"><image src="../../../static/img/img11.png" class="lyy-a-tu5" /></view>
- <view class="lyy-a-tu4">{{ items.people }}人拼</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </view> -->
- <view class="czpt">
- <view class="good-wrapper">
- <view class="spgood" @click="goProduct(items)" v-for="(items, ind) in goodsList" :key="ind">
- <view class="left-wrapper"><image :src="items.product.image" mode="scaleToFill"></image></view>
- <view class="right-wrapper">
- <view class="right-title clamp">{{ items.product.store_name }}</view>
- <view class="ex-addr">
- <image src="../../../static/img/shop.png" mode="" class="name-img"></image>
- {{items.merchant.mer_name}}
- <image src="../../../static/img/point.png" mode="" class="point-img"></image>
- 200m
- </view>
- <view class="pepple-num"><image src="../../../static/icon/hot.png" mode="scaleToFill"></image>{{ items.buying_num }}人团</view>
- <view class="right-bottom">
- <view class="sp-price">
- <view class="now-price">¥{{ items.price * 1 }}</view>
- <view class="old-price">¥{{ items.product.price * 1 }}</view>
- </view>
- <view class="sp-btn">马上拼团</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import { getCombinationList } from '@/api/product.js';
- export default {
- components: {
- uniLoadMore
- },
- data() {
- return {
- goodsList: [],
- loadingType: 'more', //加载更多状态
- limit: 20, //每次加载数据条数
- page: 1 //当前页数
- };
- },
- onLoad(options) {
- this.loadData();
- },
- //下拉刷新
- onPullDownRefresh() {
- this.loadData('refresh');
- },
- //监听页面是否滚动到底部加载更多
- onReachBottom() {
- this.loadData();
- },
- methods: {
- //加载商品 ,带下拉刷新和上滑加载
- async loadData(type = 'add', loading) {
- let obj = this;
- let data = {
- page: obj.page,
- limit: obj.limit
- };
- //没有更多直接返回
- if (type === 'add') {
- if (obj.loadingType === 'nomore') {
- return;
- }
- obj.loadingType = 'loading';
- } else {
- obj.loadingType = 'more';
- }
- // 加载商品信息
- getCombinationList(data)
- .then(e => {
- console.log(e,'++++++++++++e+++++++')
- if (type === 'refresh') {
- // 清空数组
- obj.goodsList = [];
- }
- obj.goodsList = obj.goodsList.concat(e.data.list);
- //判断是否还有下一页,有是more 没有是nomore
- if (obj.limit == e.data.list.length) {
- obj.page++;
- obj.loadingType = 'more';
- } else {
- obj.loadingType = 'nomore';
- }
- if (type === 'refresh') {
- if (loading == 1) {
- uni.hideLoading();
- } else {
- uni.stopPullDownRefresh();
- }
- }
- })
- .catch();
- },
- goProduct(e) {
- uni.navigateTo({
- url: '/pages/product/groupBooking/productGroup?id=' + e.product_group_id
- });
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- height: 100%;
- }
- // 拼团列表
- .lyy-f-a {
- margin: 0px 15px;
- .lyy-flex {
- /* 内部模块1*/
- display: flex;
- justify-content: space-between;
- }
- .lyy-f-b {
- flex-wrap: wrap;
- .lyy-f-c {
- flex: 0 0 50%;
- /* width: 50%; */
- margin: 10px 0px 0px 0px;
- }
- .item:nth-child(2n + 1) .content {
- margin: 0px 7.5px 0px 0px;
- border-radius: 10px;
- }
- }
- .lyy-f-b .content {
- background-color: white;
- .lyy-f-image {
- width: 100%;
- height: 340rpx;
- border-radius: 10rpx 10rpx 0rpx 0rpx;
- }
- .ellipsis {
- width: 165px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .lyy-f-jl {
- padding: 5px 7px;
- }
- .lyy-f-word1 {
- font-size: 12px;
- color: rgba(50, 50, 50, 1);
- line-height: 20px;
- width: 300rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- .item:nth-child(2n) .content {
- margin: 0px 0 0px 7.5px;
- border-radius: 10px;
- }
- .lyy-f-word3 {
- font-size: 12px;
- text-decoration: line-through;
- color: rgba(139, 139, 139, 1);
- }
- .lyy-f-word5 {
- font-size: 20rpx;
- color: rgba(153, 153, 153, 1);
- margin: 20rpx 0px 0px 0px;
- }
- .lyy-f-word4 {
- height: 26px;
- background: #6fb22f;
- color: white;
- text-align: center;
- }
- .lyy-f-d {
- height: 24rpx;
- border: 1px solid rgba(252, 91, 98, 1);
- border-radius: 3px;
- font-size: 20rpx;
- text-align: center;
- width: 50rpx;
- color: rgba(252, 91, 98, 1);
- margin: 23rpx 0rpx 0rpx 0rpx;
- line-height: 24rpx;
- }
- .lyy-flex2 {
- display: flex;
- padding-right: 10rpx;
- align-items: center;
- .lyy-flex3 {
- flex: 1;
- .lyy-f-word2 {
- font-size: 14px;
- color: rgba(241, 13, 59, 1);
- }
- }
- &.lyy-a-tu2 {
- height: 34rpx;
- background: rgba(255, 255, 255, 1);
- border: 1px solid #fc5b62;
- border-radius: 2px;
- margin: 10rpx 0rpx;
- .lyy-a-tu3 {
- height: 30rpx;
- background-color: #fc5b62;
- padding: 0px 6px;
- text-align: center;
- .lyy-a-tu5 {
- width: 20rpx;
- height: 20rpx;
- margin-top: 6rpx;
- display: block;
- }
- }
- .lyy-a-tu4 {
- margin-left: 4rpx;
- font-size: 24rpx;
- line-height: 30rpx;
- color: #fc5b62;
- padding: 0px 10rpx;
- text-align: center;
- }
- }
- }
- }
- .good-wrapper {
- width: 710rpx;
- background-color: #f7f5f5;
- margin: 20rpx auto 0;
- .spgood {
- width: 710rpx;
- height: 280rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 20px 0px rgba(50, 50, 52, 0.06);
- border-radius: 8rpx;
- padding: 40rpx 20rpx;
- display: flex;
- margin-bottom: 21rpx;
- .left-wrapper {
- width: 190rpx;
- height: 200rpx;
- border-radius: 10rpx;
- image {
- width: 190rpx;
- height: 200rpx;
- border-radius: 10rpx;
- }
- }
- .right-wrapper {
- padding-left: 22rpx;
- width: 100%;
- height: 200rpx;
- // background-color: red;
- .right-title {
- padding-top: 8rpx;
- width: 400rpx;
- // height: 29rpx;
- font-size: 30rpx;
- font-weight: bold;
- color: #333333;
-
- }
- .right-addr {
- margin-top: 18rpx;
- display: flex;
- .shop-img {
- width: 26rpx;
- height: 23rpx;
- margin: 0 4rpx 0 0;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .shop-name {
- // height: 22rpx;
- font-size: 22rpx;
- font-weight: 500;
- color: #dcb876;
- }
- .point-img {
- width: 16rpx;
- height: 23rpx;
- margin: 0 4rpx 0 14rpx;
- image {
- width: 100%;
- height: 21rpx;
- }
- }
- .point-disc {
- font-size: 24rpx;
- font-weight: 500;
- padding-top: 3rpx;
- color: #dcb876;
- }
- }
- .ex-addr {
- margin-top: 16rpx;
- // padding-left: 22rpx;
- height: 24rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #dcb876;
- image {
- height: 22rpx;
- }
- .name-img {
- // vertical-align: ;
- width: 26rpx;
- margin: 0 4rpx -3rpx 0;
- }
- .point-img {
- width: 16rpx;
- margin: 0 4rpx -3rpx 14rpx;
- }
- }
- .pepple-num {
- // width: 99rpx;
- display: inline-block;
- padding-right: 15rpx;
- height: 36rpx;
- // color: #ff3366;
- // background: #FC7A0C;
- background-color: #fee4ce;
- // opacity: 0.2;
- border-radius: 18rpx;
- font-size: 20rpx;
- font-weight: 500;
- color: #ff3366;
- line-height: 36rpx;
- padding-left: 12rpx;
- margin-top: 33rpx;
- image {
- width: 17rpx;
- height: 20rpx;
- margin-right: 10rpx;
- // padding-right: rpx;
- }
- }
- .right-bottom {
- margin-top: 2rpx;
- // justify-items: flex-end;
- display: flex;
- justify-content: space-between;
- .sp-price {
- height: 60rpx;
- display: flex;
- vertical-align: bottom;
- line-height: 60rpx;
- .now-price {
- font-size: 30rpx;
- font-weight: bold;
- color: #901b21;
- margin-right: 16rpx;
- }
- .old-price {
- font-size: 22rpx;
- font-weight: 500;
- text-decoration: line-through;
- color: #aaaaaa;
- }
- }
- .sp-btn {
- width: 160rpx;
- height: 60rpx;
- border-radius: 30rpx;
- font-size: 26rpx;
- text-align: center;
- line-height: 60rpx;
- font-weight: 400;
- color: #ffffff;
- background-color: #901b21;
- }
- }
- }
- }
- }
- </style>
|