Commit e5ec35879ad9d666ce494d88128dcba277f94fbc

Authored by wangfan
1 parent 6c15f370

smsbatch

... ... @@ -25,7 +25,7 @@
</sendsms>
</view>
</block>
<block wx:else="">
<block wx:elif="{{item.status!=0}}">
<formids url="/pages/book/smsbatch/detail?id={{item.id}}&seller_id={{item.sid}}">
<view class="opt-but">查看详情</view>
</formids>
... ...
... ... @@ -7,7 +7,7 @@
.sms-status0:before{
content: '审核中';
color:#09BB07;
color:#353535;
}
.sms-status1:before{
content: '已通过';
... ...
... ... @@ -3,7 +3,9 @@ import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
offset:0,
limit:10,
hasMore:true,
/**
* 页面的初始数据
*/
... ... @@ -11,6 +13,7 @@ Page({
hasScene:0,
seller_id:'',
list:[],
hasMore:true,
},
/**
... ... @@ -73,23 +76,35 @@ Page({
onUnload: function () {
},
SmsBatchList(){
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.hasMore){
this.SmsBatchList(true);
}
},
SmsBatchList(hasReachBottom=false){
App.Reserve.SmsBatchList({
sid:this.seller_id,
offset:0,
limit:1,
}).then(res=>{
let list=[];
if(res.data.length>0){
res.data.forEach(r=>{
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,'YYYY.MM.DD')
list.push(r)
this.list[r.id]=r;
this.list[r.id] = r;
})
}
this.setData({
list:list,
})
let obj={list:list};
if(dl<this.limit && hasReachBottom){
this.hasMore=false;
obj.hasMore=false;
}
this.setData(obj)
})
},
sendMsg(e){
... ...
... ... @@ -3,31 +3,27 @@
<view class="header flex-vc">
<view class="info">
<view>流失客户召回,新老客户回馈</view>
<view>沉默客户激活</view>
<view style="margin-top: 10rpx;">沉默客户激活</view>
</view>
<formids url="./update?seller_id={{seller_id}}&hasScene={{hasScene}}">
<view class="button-create Semibold">立即创建</view>
</formids>
</view>
<view class="page history">
<view class="page" style="padding-top: 0">
<view class="title Medium flex-lr">
<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">
<view class="page">
<view class="title Medium flex-lr">
<view>短信记录</view>
<formids url="./list?seller_id={{seller_id}}&hasScene={{hasScene}}">
<view style="color: #999999;font-size: 30rpx;">历史记录</view>
</formids>
</view>
<view class="flex-vc">
<block wx:if="{{list.length>0}}">
<view style="width: 100%" wx:for="{{list}}" wx:key="list.key" >
<view class="list-rows" wx:for="{{list}}" wx:key="list.key" style="width: 100%;">
<rows item="{{item}}"></rows>
</view>
</block>
<view wx:else="">暂无</view>
</view>
<view wx:else="">暂无短信记录</view>
<view wx:if="{{!hasMore}}">已经到底了</view>
</view>
</view>
<view class="page">
... ...
/* pages/book/smsbatch/index.wxss */
page{
background-color: #F5F5F5;
}
.page{
width: 90%;
margin: 0 auto;
... ... @@ -35,6 +32,19 @@ page{
margin-top: 20rpx;
height: 340rpx;
}
.history .title{
height: 40rpx;
line-height: 40rpx;
}
.history .lists{
height: 300rpx;
}
.list-rows{
height: 140rpx;
line-height: 140rpx;
border-bottom: 2rpx solid #F1F0F4;
}
.list-rows:last-child{
border-bottom-width: 0;
}
\ No newline at end of file
... ...
... ... @@ -8,7 +8,7 @@ Page({
hasMore:true,
seller_id:0,
hasScene:0,
list:[],
list:{},
/**
* 页面的初始数据
*/
... ... @@ -66,7 +66,7 @@ Page({
*/
onReachBottom: function () {
if(this.hasMore){
this.SmsBatchList(hasReachBottom);
this.SmsBatchList(true);
}
},
... ...