Commit 5c456e77b492f7bd6df1462a3f10e860eafc561b

Authored by wangfan
1 parent 49d1320d

smsbatch

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