Browse Source

[首页优惠券列表,限时抢购列表][修改]:首页优惠券列表和限时抢购列表,上拉加载样式的修改

tags/2.2.4
meo 6 years ago
parent
commit
ac3020e6d9
11 changed files with 112 additions and 35 deletions
  1. BIN
      assets/img/loading.gif
  2. +1
    -1
      components/coupons/index.wxml
  3. +24
    -7
      components/coupons/index.wxss
  4. +23
    -12
      pages/index/coupons/index.js
  5. +2
    -1
      pages/index/coupons/index.wxml
  6. +13
    -0
      pages/index/coupons/index.wxss
  7. +0
    -3
      pages/order/index/index.js
  8. +1
    -1
      pages/order/index/index.wxss
  9. +32
    -7
      pages/rushToBuy/index.js
  10. +1
    -0
      pages/rushToBuy/index.wxml
  11. +15
    -3
      pages/rushToBuy/index.wxss

BIN
assets/img/loading.gif View File

Before After
Width: 16  |  Height: 16  |  Size: 1.7 KiB

+ 1
- 1
components/coupons/index.wxml View File

@@ -20,7 +20,7 @@
<view class="coupons-btn">
<!-- 优惠券价格 -->
<view class="coupons-info-price">
<view class="coupons-info-name subtitle sy">剩余: {{data.remainInventory}}</view>
<view class="coupons-info-name sy">剩余: {{data.remainInventory}}</view>
<!-- <text class="coupons-info-price-o"><text class='i'>¥</text>{{data.priceStr}}</text> -->
</view>
<i-button i-class="coupons-btn-gm" wx:if="{{data.salePriceStr==0}}" data-date='{{data}}'>领取</i-button>


+ 24
- 7
components/coupons/index.wxss View File

@@ -1,4 +1,5 @@
@import "../../app.wxss";

.coupons {
flex-direction: row;
display: flex;
@@ -6,6 +7,7 @@
position: relative;
height: 184rpx;
}

.coupons-border {
height: 1rpx;
/* width: 100%; */
@@ -15,12 +17,13 @@
position: absolute;
bottom: 0;
}

.coupons-img {
width: 248rpx;
height: 184rpx;
overflow: hidden;
border: 1px solid #f8f8f8;
border-radius: 10rpx;
border-radius: 10rpx;
}

.coupons-img image {
@@ -39,13 +42,16 @@
letter-spacing: 0;
line-height: 38rpx;
}

.coupons-info-price {
padding: 32rpx 0 0;
}
.i{

.i {
font-size: 24rpx;
font-style: normal;
}

.coupons-info-price-p {
display: inline-block;
font-size: 36rpx;
@@ -53,16 +59,18 @@
line-height: 50rpx;
font-weight: 600;
}
.tit{

.tit {
margin-top: 14rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 300rpx;
height: 40rpx;
font-weight:600;
font-weight: 600;
font-size: 30rpx;
}

.coupons-info-price-o {
display: block;
text-align: center;
@@ -101,12 +109,13 @@
padding: 0 !important;
font-family: PingFangSC-Semibold;
font-size: 28rpx;
color: #ffffff !important;
color: #fff !important;
letter-spacing: 0;
height: 50rpx !important;
width: 138rpx !important;
line-height: 50rpx !important;
}

.subtitle {
font-size: 24rpx;
color: #6f6f6f;
@@ -118,8 +127,9 @@
height: 40rpx;
margin-top: 8rpx;
}

.coupons-info-manjian {
color: #6f6f6f!important;
color: #6f6f6f !important;
font-weight: normal;
font-size: 20rpx;
line-height: 34rpx;
@@ -127,6 +137,7 @@
}

/**上拉加载更多**/

.userinfo {
display: flex;
flex-direction: column;
@@ -143,11 +154,17 @@
.userinfo-nickname {
color: #aaa;
}
.sy{

.sy {
display: block;
text-align: center;
width: 120rpx;
font-size: 24rpx;
color: #6f6f6f;
height: 40rpx;
margin-top: 8rpx;
}

.usermotto {
margin-top: 200px;
}


+ 23
- 12
pages/index/coupons/index.js View File

@@ -16,12 +16,13 @@ Component({
tabs: [],
list: [],
flag: "",
loading: true, //"上拉加载"的变量,默认false,隐藏
content:"",
return_list: [],
current: 0,
current_scroll: 0,
pageNum: 1, // 设置加载的第几次,默认是第一次
pageSize: 10, //返回数据的个数
searchLoading: false, //"上拉加载"的变量,默认false,隐藏
searchLoadingComplete: false, //“没有数据”的变量,默认false,隐藏
allow_load: true // 是否允许继续加载标识 默认 true 允许,false 加载完成
},
@@ -67,10 +68,10 @@ Component({

// 券list获取
if (that.data.allow_load) {
wx.showLoading({
title: "飞速加载中"
});
that.setData({
loading:true,
content:'小主,我在玩命加载中...'
})
// 根据 key == 0 区分全部或其它tab,决定是否传参数 business
if (key == 0) {
var param = {
@@ -92,11 +93,10 @@ Component({
data: param
}).then(res => {
console.log(res);
/**
* 加载完成
*/
if (pageNum >= res.data.pages) {
// wx.showToast({
// title: "加载完成喽",
// icon: "success"
// });
that.setData({
allow_load: false
});
@@ -113,10 +113,21 @@ Component({
});
});
setTimeout(function() {
wx.hideLoading();
}, 1000);
that.setData({
loading:false,
})
}, 1400);
} else {
console.info("allow_load==false 已禁止加载");
that.setData({
loading:true,
content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ"
})
setTimeout(function(){
that.setData({
loading:false,
})
},1400)
}
};

@@ -134,7 +145,7 @@ Component({
url: config.api.businessList,
data: {
pageNum: 1,
pageSize: 10,
pageSize: 15,
type: 1
}
}).then(res => {


+ 2
- 1
pages/index/coupons/index.wxml View File

@@ -2,5 +2,6 @@
<i-tabs current="{{current_scroll}}" scroll bindchange="handleChangeScroll">
<i-tab wx:for="{{tabs}}" wx:key="unique" key="{{item.id}}" title="{{item.title}}"></i-tab>
</i-tabs>
<c-coupons wx:for="{{list}}" paramAtoB="{{scrollHeight}}" wx:key="unique" data="{{item}}" />
<c-coupons wx:for="{{list}}" paramAtoB="{{loading}}" wx:key="unique" data="{{item}}" />
<view class="loading" wx:if="{{loading}}"><image src="./../../../assets/img/loading.gif" mode="widthFix"></image>{{content}}</view>
</view>

+ 13
- 0
pages/index/coupons/index.wxss View File

@@ -1,3 +1,16 @@
.index-coupons{
height:820rpx;
}
.loading{
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-size: 26rpx;
color: #999;
}
.loading image{
width: 40rpx;
height: 40rpx;
vertical-align: middle;
margin-right: 10rpx;
}

+ 0
- 3
pages/order/index/index.js View File

@@ -114,13 +114,10 @@ Page({
},
onReachBottom: function() {
var that = this;
console.log(that.data.page);
that.data.page++;
console.log(that.data.page);
that.setData({
page: that.data.page
});
console.info("after++ " + that.data.page);
that.getList(that.data.current_scroll, that.data.page);
}
});

+ 1
- 1
pages/order/index/index.wxss View File

@@ -31,7 +31,7 @@
.logo {
width: 248rpx;
height: 184rpx;
border-radius: 30rpx;
border-radius: 30rpx;
}
.logo image {


+ 32
- 7
pages/rushToBuy/index.js View File

@@ -13,7 +13,9 @@ Page({
allow_load: true,
day: "",
hour: "",
minute: ""
minute: "",
loading: true, //"上拉加载"的变量,默认false,隐藏
content:"",
},

/**
@@ -30,13 +32,17 @@ Page({
* 判断用户是否加载完成
*/
if (that.data.allow_load) {
wx.showLoading({
title: "加载中"
});
// wx.showLoading({
// title: "加载中"
// });
that.setData({
loading:true,
content:'小主,我在玩命加载中...'
})

setTimeout(function() {
wx.hideLoading();
}, 1200);
// setTimeout(function() {
// wx.hideLoading();
// }, 1200);
Http.get({
url: config.api.couponChannelList,
data: {
@@ -56,7 +62,17 @@ Page({
that.setData({
allow_load: false
});
setTimeout(function() {
that.setData({
loading:false,
})
}, 1400);
} else {
setTimeout(function() {
that.setData({
loading:false,
})
}, 1400);
/**
* 页面上显示的时间
*/
@@ -82,6 +98,15 @@ Page({
});
} else {
console.info("allow_load==false 已禁止加载");
that.setData({
loading:true,
content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ"
})
setTimeout(function(){
that.setData({
loading:false,
})
},1400)
}
};
if (app.globalData.token && app.globalData.token != null) {


+ 1
- 0
pages/rushToBuy/index.wxml View File

@@ -31,4 +31,5 @@
</view>
</view>
</view>
<view class="loading" wx:if="{{loading}}"><image src="./../../assets/img/loading.gif" mode="widthFix"></image>{{content}}</view>
</view>

+ 15
- 3
pages/rushToBuy/index.wxss View File

@@ -2,13 +2,24 @@
width: 100%;
height: 100%;
background: #fff;
}
.loading{
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-size: 26rpx;
color: #999;
}
.loading image{
width: 40rpx;
height: 40rpx;
vertical-align: middle;
margin-right: 10rpx;
}
.flashSaleItemWrap{
width: 100%;
height: 410rpx;
border-top: 1rpx solid #ededed;
border-bottom: 10rpx solid #ededed;
}
.flashSaleItem{
width: 90%;
@@ -32,6 +43,7 @@
.food{
width: 248rpx;
height: 184rpx;
border-radius: 30rpx;
}
.flashSaleItemTopR{
flex: 2;


Loading…
Cancel
Save