浏览代码

拼团券新增下拉加载及无数据处理

tags/富茂链客4.1.0
刘晖 6 年前
父节点
当前提交
2ac2b5b24b
共有 4 个文件被更改,包括 71 次插入2 次删除
  1. +3
    -1
      pages/spellGroup/spellGroup.js
  2. +12
    -1
      pages/spellGroup/spellGroup.wxml
  3. +52
    -0
      pages/spellGroup/spellGroup.wxss
  4. +4
    -0
      utils/imgurl.js

+ 3
- 1
pages/spellGroup/spellGroup.js 查看文件

@@ -9,6 +9,7 @@ Page({
data: { data: {
bannerUrl: imgurl.banner.url, bannerUrl: imgurl.banner.url,
loadingUrl: imgurl.loading.url, loadingUrl: imgurl.loading.url,
nodata: imgurl.nodata.url,
spellList: true, spellList: true,
myspellList: false, myspellList: false,
list: [], list: [],
@@ -20,7 +21,8 @@ Page({
allow_load: true, // 是否允许继续加载标识 默认 true 允许,false 加载完成 allow_load: true, // 是否允许继续加载标识 默认 true 允许,false 加载完成
myorder: false, myorder: false,
actUrl: imgurl.act.url, actUrl: imgurl.act.url,
loadingUrl: imgurl.loading.url,
loading:true,
content:'数据正在加载中',
flag: 'spellList', flag: 'spellList',
}, },
onLoad: function () { onLoad: function () {


+ 12
- 1
pages/spellGroup/spellGroup.wxml 查看文件

@@ -1,9 +1,17 @@
<view class='content-box'>
<view class='content-box' style='{{"padding-bottom:"+(lists.length>0?"200rpx":"0")}}'>
<view class='top' wx:if='{{flag=="spellList"}}'> <view class='top' wx:if='{{flag=="spellList"}}'>
<view class="banner" wx:if="{{list.length>0}}" hover-class="none" hover-stop-propagation="false"> <view class="banner" wx:if="{{list.length>0}}" hover-class="none" hover-stop-propagation="false">
<c-banner wx:key="unique" list="{{list}}" /> <c-banner wx:key="unique" list="{{list}}" />
</view> </view>
</view> </view>
<view class='no-data01' wx:if='{{flag=="spellList"&&lists.length==0}}'>
<image src='{{nodata}}'></image>
<view class='no-data-text'>暂无数据</view>
</view>
<view class='no-data' wx:if='{{flag=="myspellList"&&lists.length==0}}'>
<image src='{{nodata}}'></image>
<view class='no-data-text'>暂无数据</view>
</view>
<view class='content' style='{{"margin-top:"+(flag=="spellList"?"320rpx":0)}}'> <view class='content' style='{{"margin-top:"+(flag=="spellList"?"320rpx":0)}}'>
<view class='sepll-list' wx:if='{{flag=="spellList"}}' wx:for="{{lists}}" wx:key="{{index}}" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'> <view class='sepll-list' wx:if='{{flag=="spellList"}}' wx:for="{{lists}}" wx:key="{{index}}" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'>
<view class='spell-left'> <view class='spell-left'>
@@ -67,4 +75,7 @@
<view class='bottom-left' bindtap="getSpellList" style="background:{{flag=='spellList'?'#FF7250':'#F3453A'}}">拼团商品</view> <view class='bottom-left' bindtap="getSpellList" style="background:{{flag=='spellList'?'#FF7250':'#F3453A'}}">拼团商品</view>
<view class='bottom-right' bindtap="getmyList" style="background:{{flag!='spellList'?'#FF7250':'#F3453A'}}">我的拼团</view> <view class='bottom-right' bindtap="getmyList" style="background:{{flag!='spellList'?'#FF7250':'#F3453A'}}">我的拼团</view>
</view> </view>
<view class="loading" wx:if="{{loading}}">
{{content}}
</view>
</view> </view>

+ 52
- 0
pages/spellGroup/spellGroup.wxss 查看文件

@@ -11,6 +11,20 @@ page {
height: auto; height: auto;
padding-bottom: 200rpx; padding-bottom: 200rpx;
} }
.loading {
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-size: 26rpx;
color: #fff;
}

.loading image {
width: 60rpx;
height: 60rpx;
vertical-align: middle;
margin-right: 10rpx;
}
.banner{ .banner{
margin-bottom: 20rpx; margin-bottom: 20rpx;
background: none; background: none;
@@ -240,4 +254,42 @@ image{
font-weight:500; font-weight:500;
color:rgba(255,50,50,1); color:rgba(255,50,50,1);
line-height:64rpx; line-height:64rpx;
}
.no-data01{
width: 690rpx;
padding-top: 174rpx;
height: calc(100vh - 460rpx);
background: #fff;
margin: 0 auto;
border-radius:15rpx;
box-sizing: border-box;
margin-top: 320rpx;
}
.no-data{
width: 690rpx;
padding-top: 174rpx;
height: calc(100vh - 140rpx);
background: #fff;
margin: 0 auto;
border-radius:15rpx;
box-sizing: border-box;
}
.no-data01 image{
width: 261rpx;
height: 272rpx;
display: block;
margin: 0 auto;
}
.no-data image{
width: 261rpx;
height: 272rpx;
display: block;
margin: 0 auto;
}
.no-data-text{
text-align: center;
font-size:34rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(0,0,0,1);
} }

+ 4
- 0
utils/imgurl.js 查看文件

@@ -388,4 +388,8 @@ module.exports = {
'url': baseUrl + 'home.png', 'url': baseUrl + 'home.png',
'name': '返回首页图标' 'name': '返回首页图标'
}, },
'nodata': {
'url': baseUrl + 'nodata.png',
'name': '拼团暂无数据'
},
} }

正在加载...
取消
保存