@@ -10,7 +10,8 @@ | |||
"pages/myModule/components/myRelease/myRelease", | |||
"pages/myModule/components/myAttention/myAttention", | |||
"pages/outLink/outLink", | |||
"pages/login/login" | |||
"pages/login/login", | |||
"pages/msgModule/wechat2/wechat2" | |||
], | |||
"usingComponents": { | |||
"tabBar": "/components/tabbar/tabbar", |
@@ -17,15 +17,48 @@ Page({ | |||
text: "我关注的", | |||
value: "my1" | |||
}, | |||
{ | |||
text: "工商类", | |||
value: "工商类" | |||
}, | |||
{ | |||
text: "财税类", | |||
value: "财税类" | |||
}, | |||
{ | |||
text: "资质类", | |||
value: "资质类" | |||
}, | |||
], | |||
currentTab: "all", | |||
// 更多tab | |||
moreTabOption: [], | |||
moreTabOption: [ | |||
{ | |||
text: "公司转让", | |||
value: "公司转让" | |||
}, | |||
{ | |||
text: "知识产权", | |||
value: "知识产权" | |||
}, | |||
{ | |||
text: "银行服务", | |||
value: "银行服务" | |||
}, | |||
{ | |||
text: "法律服务", | |||
value: "法律服务" | |||
}, | |||
{ | |||
text: "其他", | |||
value: "其他" | |||
}, | |||
], | |||
moreTab: "gengduo", | |||
moreTitle: "更多", | |||
// list数据加载 | |||
// list块加载 | |||
listLoading: false, | |||
listLoading: true, | |||
// item行加载 | |||
itemLoading: false, | |||
// 数据是否加载完成 | |||
@@ -38,11 +71,7 @@ Page({ | |||
onRefresh: true, | |||
}, | |||
onLoad() { | |||
this.setData({ | |||
listLoading: true, | |||
}) | |||
// 获取分类 | |||
this.getAllType(); | |||
this.getListData(); | |||
}, | |||
toggleMore() { | |||
this.selectComponent('#item').toggle(); |
@@ -1,7 +1,8 @@ | |||
// pages/release/release.js | |||
// 获取应用实例 | |||
const app = getApp() | |||
const $request = require('../../utils/request.js'); | |||
const $util = require('../../utils/util.js'); | |||
Page({ | |||
data: { | |||
currentIndex: 2, | |||
@@ -9,6 +10,12 @@ Page({ | |||
customerId: "", | |||
// 前往关注公众号 | |||
topShow: true, | |||
msgData: [], | |||
page: 1, | |||
size: 10, | |||
total: 0, | |||
// 是否加载数据,true加载,false不加载 | |||
onRefresh: true, | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
@@ -22,10 +29,61 @@ Page({ | |||
}) | |||
}, | |||
getMsgData() { | |||
setTimeout(() => { | |||
let { page, size } = this.data; | |||
$request.get('/businessCommunicationDemand/getChatRecordTable.action', { page, size }).then(res => { | |||
console.log(res); | |||
let tempListData = this.data.msgData; | |||
if (res.status == 0) { | |||
let datas = res.data; | |||
console.log(datas, 'datas') | |||
// 先push数据 | |||
tempListData.push(...datas.chatRecordTable); | |||
tempListData.forEach(el => { | |||
el.createdOn = $util.formatTime(new Date(el.createdOn), true); | |||
if (typeof el.type == 'string') { | |||
el.type = el.type.split(','); | |||
} | |||
}) | |||
// 设置总数 | |||
this.setData({ | |||
msgData: tempListData, | |||
total: datas.total, | |||
}) | |||
// 如果数据大于了返回的总数 | |||
if (tempListData.length >= this.data.total) { | |||
// 停止累加数据 | |||
this.setData({ | |||
onRefresh: false, | |||
itemLoading: false, | |||
}) | |||
} else { | |||
this.setData({ | |||
onRefresh: true, | |||
itemLoading: false, | |||
page: page + 1 | |||
}) | |||
} | |||
console.log('-------------消息 beg-------------------') | |||
console.log(this.data.msgData); | |||
console.log('-------------消息 end-------------------') | |||
} | |||
this.setData({ | |||
pageLoading: false, | |||
}) | |||
}).catch(error => { | |||
console.log(error, 'error appletLogin') | |||
}) | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
if (this.data.onRefresh) { | |||
this.setData({ | |||
pageLoading: false | |||
itemLoading: true | |||
}) | |||
}, 500); | |||
this.getListData(); | |||
} | |||
}, | |||
}) |
@@ -3,16 +3,18 @@ | |||
<view class="list-loading text-center" wx:if="{{ pageLoading }}"> | |||
<van-loading size="24px">加载中...</van-loading> | |||
</view> | |||
<view wx:else> | |||
<view wx:else class="body-view"> | |||
<view class="top-view" wx:if="{{ topShow }}"> | |||
<image class="msg-top-img fl" src="/images/home/msg-top-icon.png" /> | |||
<view class="msg-text fl">关注公众号可随时接收离线消息~</view> | |||
<van-button color="#5e73e5" round class="msg-btn-go fl" size="small">前往关注</van-button> | |||
<image class="msg-colse-img fl" src="/images/home/close.png" bind:tap="closeTopShow"/> | |||
<image class="msg-colse-img fl" src="/images/home/close.png" bind:tap="closeTopShow" /> | |||
</view> | |||
<view class="msg-box-view"> | |||
<view class="msg-box-view {{ topShow ? 'topShow' : '' }} not-msg-data" wx:if="{{ msgData.length < 1 }}"> | |||
<image class="not-msg-data-img " src="/images/home/not-msg-data.png"/> | |||
<view class="not-data-msg-info">暂无消息记录</view> | |||
</view> | |||
<view wx:else class="msg-box-view {{ topShow ? 'topShow' : '' }}"></view> | |||
</view> | |||
<tabBar currentIndex="{{currentIndex}}"></tabBar> | |||
</view> |
@@ -1,5 +1,7 @@ | |||
/* pages/msgPage/msgPage.wxss */ | |||
.msg-page { | |||
min-height: calc(100vh - 150rpx); | |||
} | |||
.top-view { | |||
background: #fff; | |||
box-sizing: border-box; | |||
@@ -8,6 +10,7 @@ | |||
line-height: 88rpx; | |||
box-shadow: -1px 3px 12px 4px rgba(186, 186, 186, 0.1); | |||
border-radius: 20rpx; | |||
margin-bottom: 20rpx; | |||
} | |||
.top-view .msg-top-img { | |||
width: 87rpx; | |||
@@ -32,4 +35,30 @@ | |||
height: 30rpx; | |||
margin-left: 10rpx; | |||
margin-top: 29rpx; | |||
} | |||
.msg-box-view { | |||
background: #fff; | |||
box-sizing: border-box; | |||
border-radius: 20rpx; | |||
min-height: calc(100vh - 150rpx); | |||
} | |||
.msg-box-view.topShow{ | |||
min-height: calc(100vh - 258rpx); | |||
} | |||
.msg-box-view.not-msg-data{ | |||
text-align: center; | |||
box-sizing: border-box; | |||
padding-top: 140rpx; | |||
} | |||
.msg-box-view.not-msg-data .not-msg-data-img{ | |||
width: 302rpx; | |||
height: 224rpx; | |||
} | |||
.msg-box-view.not-msg-data .not-data-msg-info{ | |||
font-size: 24rpx; | |||
color: #b3bfcb; | |||
margin-top: 20rpx; | |||
} |
@@ -0,0 +1,66 @@ | |||
// pages/msgModule/wechat2/wechat2.js | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
} | |||
}) |
@@ -0,0 +1,3 @@ | |||
{ | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,2 @@ | |||
<!--pages/msgModule/wechat2/wechat2.wxml--> | |||
<text>pages/msgModule/wechat2/wechat2.wxml</text> |
@@ -0,0 +1 @@ | |||
/* pages/msgModule/wechat2/wechat2.wxss */ |
@@ -23,8 +23,6 @@ Page({ | |||
// 我发布的需求---- | |||
// item行加载 | |||
itemLoading: false, | |||
// 数据是否加载完成 | |||
isFinished: false, | |||
listData: [], | |||
page: 1, | |||
size: 10, | |||
@@ -68,7 +66,6 @@ Page({ | |||
this.setData({ | |||
listData: [], | |||
onRefresh: true, | |||
isFinished: false, | |||
listLoading: true, | |||
page: 1, | |||
}) | |||
@@ -272,13 +269,11 @@ Page({ | |||
this.setData({ | |||
onRefresh: false, | |||
itemLoading: false, | |||
isFinished: true, | |||
}) | |||
} else { | |||
this.setData({ | |||
onRefresh: true, | |||
itemLoading: false, | |||
isFinished: false, | |||
page: page + 1 | |||
}) | |||
} |