Commit 5c456e77b492f7bd6df1462a3f10e860eafc561b

Authored by wangfan
1 parent 49d1320d

smsbatch

// components/actionSheet/index.js
import util from '../../utils/util';
Component({
/**
* 组件的属性列表
*/
properties: {
items: Array,
},
/**
* 组件的初始数据
*/
data: {
actionSheetHidden: true,
},
/**
* 组件的方法列表
*/
methods: {
show(){
this.setData({
actionSheetHidden: false,
})
},
hide(){
this.setData({
actionSheetHidden: true,
})
},
bindItemTap(e){
this.triggerEvent('click',{...util.attr(e)});
this.hide();
},
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/actionSheet/index.wxml-->
<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange">
<view class="tip"><slot></slot></view>
<block wx:for="{{items}}" wx:key="items.key">
<action-sheet-item class="item" bindtap="bindItemTap" data-value="{{item}}" data-index="{{index}}">{{item}}</action-sheet-item>
</block>
<action-sheet-cancel class="cancel" bindtap="bindItemTap">取消</action-sheet-cancel>
</action-sheet>
... ...
/* components/actionSheet/index.wxss */
.tip{
color: #999999;
font-size: 36rpx;
text-align: center;
padding: 20rpx 0;
}
\ No newline at end of file
... ...
// components/book/smsbatch/rows.js
Component({
/**
* 组件的属性列表
*/
properties: {
item:Object,
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
... ...
{
"component": true,
"usingComponents": {
"service":"/components/book/smsbatch/service"
}
}
\ No newline at end of file
... ...
<!--components/book/smsbatch/rows.wxml-->
<view class="row flex-lr Medium">
<view>{{item.addtimeStr}}</view>
<view>{{item.send_total}}人</view>
<view class="sms-status{{item.status}}"></view>
<block wx:if="{{item.status==-1}}">
<view>
<service>
<view class="opt-but">联系客服</view>
</service>
</view>
</block>
<block wx:elif="{{item.status==1}}">
<view>
<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}}">
<view class="opt-but">立即发放</view>
</sendsms>
</view>
</block>
<block wx:else="">
<formids url="/pages/book/smsbatch/detail?id={{item.id}}&seller_id={{item.sid}}">
<view class="opt-but">查看详情</view>
</formids>
</block>
</view>
... ...
/* components/book/smsbatch/rows.wxss */
@import "/app.wxss";
.row{
width: 100%;
font-size: 34rpx;
}
.sms-status0:before{
content: '审核中';
color:#09BB07;
}
.sms-status1:before{
content: '已通过';
color:#353535;
}
.sms-status2:before{
content: '已发放';
color:#353535;
}
.sms-status-1:before{
content: '未通过';
color:#D0021B;
}
.opt-but{
height: 54rpx;
line-height: 54rpx;
border: 2rpx solid #199095;
border-radius: 10rpx;
padding: 0 10rpx;
color: #199095;
}
\ No newline at end of file
... ...
// components/book/smsbatch/service.js
Component({
/**
* 组件的属性列表
*/
properties: {},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
showAs(){
this.selectComponent('#as').show()
},
click(e){
console.log(e);
if(e.detail.value){
wx.makePhoneCall({
phoneNumber:e.detail.value
})
}
}
}
})
... ...
{
"component": true,
"usingComponents": {
"as":"/components/actionSheet/index"
}
}
\ No newline at end of file
... ...
<!--components/book/smsbatch/service.wxml-->
<view bindtap="showAs">
<slot></slot>
</view>
<as items="{{['029-88220780']}}" id="as" bindclick="click">
<view>工作时间:周一至周五9:00-19:00</view>
</as>
... ...
/* components/book/smsbatch/service.wxss */
\ No newline at end of file
... ...
... ... @@ -16,6 +16,14 @@
</view>
</view>
</formids>
<formids url="/pages/book/smsbatch/index">
<view class="row flex-lr">
<view>短信营销</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/customer/index?islove=customer">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>切换到顾客模式</view>
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"navigationBarTextStyle":"light",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
"formids":"/components/formids/formids",
"rows":"/components/book/smsbatch/rows"
}
}
\ No newline at end of file
... ...
<!--pages/book/smsbatch/index.wxml-->
<nav id="nav" hasHome>短信营销</nav>
<view class="page">
pages/book/smsbatch/index.wxml
<formids url="./update?seller_id={{seller_id}}&hasScene={{hasScene}}">立即创建</formids>
<view>
<view class="flex-lr" wx:for="{{list}}" wx:key="list.key">
<view>发送{{item.send_total}}人</view>
<view>{{item.addtimeStr}}</view>
<view>
<userinfo wx:if="{{hasScene==1}}" binduserinfo="sendMsg" data-id="{{item.id}}">发送</userinfo>
<button wx:else="" bindtap="sendMsg" data-id="{{item.id}}">发送</button>
<nav id="nav" hasHome backgroundColor="#199095" color="#fefefe">短信营销</nav>
<view class="header flex-vc">
<view class="info">
<view>流失客户召回,新老客户回馈</view>
<view>沉默客户激活</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>
<view class="flex-rr">
<view style="margin-right: 20rpx;color: #999999;">更多</view>
<view class="more"></view>
</view>
</view>
<view class="flex-vc lists">
<block wx:if="{{list.length>0}}">
<view style="width: 100%" wx:for="{{list}}" wx:key="list.key" >
<rows item="{{item}}"></rows>
</view>
</block>
<view wx:else="">暂无</view>
</view>
</view>
</view>
<view class="page">
</view>
... ...
/* pages/book/smsbatch/index.wxss */
page{
background-color: #F5F5F5;
}
.page{
width: 90%;
margin: 0 auto;
... ... @@ -7,3 +10,31 @@
font-size: 30rpx;
color: #353535;
}
.header{
height: 380rpx;
background-color: #199095;
margin-top: -2rpx;
color:#FEFEFE;
font-size: 34rpx;
}
.header .info view{
text-align: center;
}
.button-create{
height: 80rpx;
line-height: 80rpx;
width: 240rpx;
margin-top: 52rpx;
border-radius: 10rpx;
background-color: #fefefe;
color: #199095;
}
.history{
width: 100%;
background-color: #fefefe;
margin-top: 20rpx;
height: 340rpx;
}
.history .lists{
height: 300rpx;
}
\ No newline at end of file
... ...
... ... @@ -443,7 +443,10 @@ module.exports = {
val:function(e){
return e.detail.value;
},
attr:function(e,key){
attr:function(e,key=''){
if(!key){
return e.currentTarget.dataset
}
return e.currentTarget.dataset[key];
},
extend:function(destination, source) {
... ...