Commit c900419c by 张晓玮

Merge branch 'zhangxw_dev_3.0' into 'v3.0'

Zhangxw dev 3.0

See merge request !61
2 parents c43b0ccf 7628dfd7
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
} }
.mobile{ .mobile{
display: flex; display: flex;
align-items: center;
font-size: 30rpx; font-size: 30rpx;
color: #1B233D; color: #1B233D;
margin-top: 10rpx; margin-top: 10rpx;
......
...@@ -29,7 +29,7 @@ Page({ ...@@ -29,7 +29,7 @@ Page({
}, },
onRoute(options) { onRoute(options) {
let activityId = options.activityId let activityId = options.id
ActivityApi.getActivityOrderList({ ActivityApi.getActivityOrderList({
activityId activityId
}).then(res => { }).then(res => {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<image webp src="{{item.customerImageUrl ? item.customerImageUrl : IMGURL+'order_person_default.png'}}"></image> <image webp src="{{item.customerImageUrl ? item.customerImageUrl : IMGURL+'order_person_default.png'}}"></image>
<view class="name-mobile"> <view class="name-mobile">
<view class="name"> <view class="name">
{{item.customerNickName}} {{item.customerNickName || ""}}
<text class="order-statue {{item.orderStatus == 0 ? '' : 'green'}}">{{item.orderStatus == 0 ? '未下单' : '已下单'}}</text> <text class="order-statue {{item.orderStatus == 0 ? '' : 'green'}}">{{item.orderStatus == 0 ? '未下单' : '已下单'}}</text>
</view> </view>
<view class="mobile" wx:if="{{item.customerPhone}}">{{item.customerPhone}}</view> <view class="mobile" wx:if="{{item.customerPhone}}">{{item.customerPhone}}</view>
......
/* pages/tab/index/components/activityDiagnosis/activityDiagnosis.wxss */ /* pages/tab/index/components/activityDiagnosis/activityDiagnosis.wxss */
.content{ .content-box{
padding: 0 22rpx 50rpx 24rpx; padding: 0 22rpx 50rpx 24rpx;
.content-item{ .content-item{
width: 100%; width: 100%;
......
<!--pages/tab/index/components/activityDiagnosis/activityDiagnosis.wxml--> <!--pages/tab/index/components/activityDiagnosis/activityDiagnosis.wxml-->
<wxs src="../index.wxs" module="fn"></wxs> <wxs src="../index.wxs" module="fn"></wxs>
<view class="content"> <view class="content-box">
<block wx:for="{{activityList}}" wx:key="index"> <block wx:for="{{activityList}}" wx:key="index">
<view class="content-item"> <view class="content-item">
<view class="item-bg"> <view class="item-bg">
......
...@@ -52,9 +52,9 @@ Page({ ...@@ -52,9 +52,9 @@ Page({
this.getData() this.getData()
}, },
getData(onPullDown) { getData() {
this.getActivityList(1, onPullDown) this.getActivityList(1)
this.getActivityList(2, onPullDown) this.getActivityList(2)
}, },
// 计算文本宽度 // 计算文本宽度
...@@ -132,12 +132,14 @@ Page({ ...@@ -132,12 +132,14 @@ Page({
if (num == 1) { if (num == 1) {
this.setData({ this.setData({
activeList: onPullDown ? res.list : [...activeList, ...res.list], activeList: onPullDown ? res.list : [...activeList, ...res.list],
activeTotal: res.total activeTotal: res.total,
activeTrigger: false
}) })
} else { } else {
this.setData({ this.setData({
activityEndList: onPullDown ? res.list : [...activityEndList, ...res.list], activityEndList: onPullDown ? res.list : [...activityEndList, ...res.list],
total: res.total total: res.total,
activeTrigger: false
}) })
} }
}) })
...@@ -176,26 +178,37 @@ Page({ ...@@ -176,26 +178,37 @@ Page({
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () {
// 下拉刷新
activityRefresh(e) {
let {type} = e.currentTarget.dataset
this.setData({ this.setData({
activePageNum: 1, activePageNum: 1,
pageNum: 1 pageNum: 1
}) })
this.getData(true) this.getActivityList(type, true)
}, },
/** // 上拉触底加载
* 页面上拉触底事件的处理函数 scrollonReachBottom(e) {
*/ let {type} = e.currentTarget.dataset
onReachBottom: function () { let { activePageNum, pageNum , activeTotal, total, pageSize } = this.data
let { activePageNum, pageNum , activeTotal, total, tabIndex } = this.data // 判断当前页是否是末页
wx.$util.onReachBottom({ if (type == 1) {
pageNum: tabIndex == 0 ? activePageNum : pageNum, if (Math.floor(activeTotal / pageSize) == activePageNum - 1) return
total: tabIndex == 0 ? activeTotal: total this.setData({
}, () => { activePageNum: activePageNum + 1
this.getActivityList(tabIndex+1) })
}) this.getActivityList(type)
} else {
if (Math.floor(total / pageSize) == pageNum - 1) return
this.setData({
pageNum: pageNum + 1
})
this.getActivityList(type)
}
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
......
...@@ -4,6 +4,5 @@ ...@@ -4,6 +4,5 @@
"activity-diagnosis": "./components/activityDiagnosis/activityDiagnosis" "activity-diagnosis": "./components/activityDiagnosis/activityDiagnosis"
}, },
"navigationStyle": "custom", "navigationStyle": "custom",
"onReachBottomDistance": 100, "onReachBottomDistance": 100
"enablePullDownRefresh": true
} }
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
</block> </block>
</view> </view>
<!-- 活动中 --> <!-- 活动中 -->
<scroll-view scroll-y class="content" hidden="{{tabIndex != 0}}"> <scroll-view scroll-y class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" data-type="{{1}}" refresher-triggered="{{activeTrigger}}" hidden="{{tabIndex != 0}}">
<block> <block>
<active-box activeList="{{activeList}}" nothing="{{nothing}}" activeDateIndex="{{activeDateIndex}}" allTaskCount="{{allTaskCount}}"></active-box> <active-box activeList="{{activeList}}" nothing="{{nothing}}" activeDateIndex="{{activeDateIndex}}" allTaskCount="{{allTaskCount}}"></active-box>
</block> </block>
</scroll-view> </scroll-view>
<!-- 活动诊断 --> <!-- 活动诊断 -->
<scroll-view scroll-y class="content" hidden="{{tabIndex != 1}}"> <scroll-view scroll-y class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" data-type="{{2}}" refresher-triggered="{{activeTrigger}}" hidden="{{tabIndex != 1}}">
<block> <block>
<activity-diagnosis activityList="{{activityEndList}}" nothing="{{nothing}}"></activity-diagnosis> <activity-diagnosis activityList="{{activityEndList}}" nothing="{{nothing}}"></activity-diagnosis>
</block> </block>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!