Commit d4723b7e46b921d2eac7479e4f5c980dfd395739

Authored by wangfan
1 parent 8f45cf87

smsbatch

... ... @@ -2,6 +2,7 @@
"component": true,
"usingComponents": {
"service":"/components/book/smsbatch/service",
"formids":"/components/formids/formids"
"formids":"/components/formids/formids",
"sendsms":"/components/book/smsbatch/sendsms"
}
}
\ No newline at end of file
... ...
... ... @@ -20,7 +20,7 @@
<userinfo wx:if="{{hasScene==1}}" binduserinfo="sendMsg" data-id="{{item.id}}">
<view class="opt-but">立即发放</view>
</userinfo>
<sendsms wx:else="" bindtap="sendMsg" data-id="{{item.id}}">
<sendsms wx:else="" item="{{item}}">
<view class="opt-but">立即发放</view>
</sendsms>
</view>
... ...
// components/book/smsbatch/sendsms.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Component({
/**
* 组件的属性列表
*/
properties: {
item:Object,
},
/**
* 组件的初始数据
*/
data: {
showGopay:true,
},
/**
* 组件的方法列表
*/
methods: {
hideGopay(){
this.setData({
showGopay:false,
})
},
goPay(){
this.hideGopay();
wx.navigate({
url:'/pages/book/setting/sms_buy?scene='+encodeURI('seller_id='+this.data.item.sid)
})
},
async sendMsg(e){
let sign_name='一键订';
let item=this.data.item;
let ss=await App.Reserve.SmsInfo({seller_id:item.sid},true);
let id=item.id;
let reduce_num=item.send_total;
let sl=(item.send_msg+sign_name).length
if(sl>70){
reduce_num=parseInt(sl/67)*reduce_num;
}
if(reduce_num>ss.data.last_num){
this.setData({
reduce_num:reduce_num,
last_num:ss.data.last_num,
showGopay:true,
})
return;
}
return;
let param={
id:id,
sid:this.seller_id,
sender:this.note_name,
reduce_num:reduce_num,
sign_name:sign_name,
}
if(e.detail.nickName){
param.sender=e.detail.nickName
}
App.Reserve.SmsBatchSend(param).then(res=>{
if(res.ret!=200){
return util.toast(res.msg,'none');
}
});
},
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/book/smsbatch/sendsms.wxml-->
<view bindtap="sendMsg">
<slot></slot>
</view>
<view hidden="{{!showGopay}}" class="mask" bindtap="hideGopay">
<view class="flex-vc showGopay" catchtap="none">
<view class="info Medium">
<view>本次群发{{reduce_num}}条,当前短信剩余{{last_num}}条</view>
<view>请立即充值</view>
</view>
<view class="opt-but" catchtap="goPay">立即充值</view>
</view>
</view>
\ No newline at end of file
... ...
/* components/book/smsbatch/sendsms.wxss */
@import "/app.wxss";
.mask{
position: fixed;
bottom: 0;
top:0;
left: 0;
right:0;
background-color: rgba(13,13,13,0.5);
z-index: 9999;
}
.showGopay{
position: fixed;
bottom: 0;
background-color: #fefefe;
z-index: 9999;
width: 100%;
}
.showGopay .info{
width: 65%;
line-height: 48rpx;
margin-top: 68rpx;
margin-bottom: 84rpx;
}
.showGopay .opt-but{
margin-bottom: 68rpx;
height: 80rpx;
line-height: 80rpx;
width: 200rpx;
text-align: center;
background-color: #199095;
border-radius: 10rpx;
color:#FFFFFF;
}
\ No newline at end of file
... ...
... ... @@ -15,7 +15,7 @@ Page({
list:[],
hasMore:true,
height:350,
hiddenQuestion:false,
hiddenQuestion:true,
},
/**
... ... @@ -114,29 +114,6 @@ Page({
this.setData(obj)
})
},
sendMsg(e){
let id=util.attr(e,'id');
let reduce_num=this.list[id].reduce_num;
let sl=(this.list[id].send_msg+'【一键订】').length
if(sl>70){
reduce_num=parseInt(sl/67)*reduce_num;
}
let param={
id:id,
sid:this.seller_id,
sender:this.note_name,
reduce_num:reduce_num,
sign_name:'一键订',
}
if(this.hasScene==1){
param.sender=e.detail.nickName
}
App.Reserve.SmsBatchSend(param).then(res=>{
if(res.ret!=200){
return util.toast(res.msg,'none');
}
});
},
showQuestion(){
this.setData({
hiddenQuestion:false,
... ...