Commit b5785529b8b03985a72d84d17746d1379081b819

Authored by wangfan
1 parent 5c456e77

smsbatch

... ... @@ -22,7 +22,8 @@
"pages/book/setting/sms_buy",
"pages/book/smsbatch/index",
"pages/book/smsbatch/update",
"pages/book/smsbatch/detail"
"pages/book/smsbatch/detail",
"pages/book/smsbatch/list"
],
"subpackages": [
{
... ...
... ... @@ -82,7 +82,7 @@ Page({
let list=[];
if(res.data.length>0){
res.data.forEach(r=>{
r.addtimeStr=util.unixtoTime(r.addtime,'MM-DD HH:II')
r.addtimeStr=util.unixtoTime(r.addtime,'YYYY.MM.DD')
list.push(r)
this.list[r.id]=r;
})
... ...
... ... @@ -13,10 +13,12 @@
<view class="page" style="padding-top: 0">
<view class="title Medium flex-lr">
<view>短信记录</view>
<view class="flex-rr">
<view style="margin-right: 20rpx;color: #999999;">更多</view>
<view class="more"></view>
</view>
<formids url="./list?seller_id={{seller_id}}&hasScene={{hasScene}}">
<view class="flex-rr">
<view style="margin-right: 20rpx;color: #999999;">更多</view>
<view class="more"></view>
</view>
</formids>
</view>
<view class="flex-vc lists">
<block wx:if="{{list.length>0}}">
... ...
// pages/book/smsbatch/list.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
offset:0,
limit:10,
hasMore:true,
seller_id:0,
hasScene:0,
list:[],
/**
* 页面的初始数据
*/
data: {
list:[],
hasMore:true,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.seller_id=options.seller_id;
this.hasScene=options.hasScene;
this.SmsBatchList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.hasMore){
this.SmsBatchList(hasReachBottom);
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
SmsBatchList(hasReachBottom=false){
App.Reserve.SmsBatchList({
sid: this.seller_id,
offset: this.offset,
limit: this.limit,
}).then(res => {
let list = this.data.list;
let dl=res.data.length;
if (dl > 0) {
res.data.forEach(r => {
r.addtimeStr = util.unixtoTime(r.addtime, 'MM/DD HH:II')
list.push(r)
this.list[r.id] = r;
})
}
let obj={list:list};
if(dl<this.limit && hasReachBottom){
this.hasMore=false;
obj.hasMore=false;
}
this.setData(obj)
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"light",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"rows":"/components/book/smsbatch/rows"
}
}
\ No newline at end of file
... ...
<!--pages/book/smsbatch/list.wxml-->
<nav id="nav" hasHome backgroundColor="#199095" color="#fefefe">短信记录</nav>
<view class="page">
<view class="Medium title">短信记录</view>
<block wx:if="{{list.length>0}}">
<view class="rows" style="width: 100%" wx:for="{{list}}" wx:key="list.key" >
<rows item="{{item}}"></rows>
</view>
</block>
<view wx:else="">暂无短信记录</view>
<view wx:if="{{!hasMore}}">已经到底了</view>
</view>
... ...
/* pages/book/smsbatch/list.wxss */
.page{
width: 90%;
margin: 0 auto;
color: #353535;
padding-top: 28rpx;
font-size: 30rpx;
color: #353535;
}
.rows{
height: 140rpx;
line-height: 140rpx;
border-bottom: 2rpx solid #F1F0F4;
}
.rows:last-child{
border-bottom-width: 0;
}
.title{
height: 48rpx;
line-height: 48rpx;
}
... ...
... ... @@ -30,7 +30,7 @@
"list": []
},
"miniprogram": {
"current": 27,
"current": 28,
"list": [
{
"id": 0,
... ... @@ -240,6 +240,12 @@
"name": "pages/book/smsbatch/update",
"pathName": "pages/book/smsbatch/update",
"query": "seller_id=80"
},
{
"id": 28,
"name": "pages/book/smsbatch/list",
"pathName": "pages/book/smsbatch/list",
"query": "seller_id=80"
}
]
}
... ...