Commit 72a68b2761db8b9a7df929aaad68bff5a4e52d1e

Authored by wangfan
1 parent fd7eb281

smsbatch

... ... @@ -20,7 +20,8 @@
"pages/book/setting/index",
"pages/book/setting/sms",
"pages/book/setting/sms_buy",
"pages/book/smsbatch/index"
"pages/book/smsbatch/index",
"pages/book/smsbatch/update"
],
"subpackages": [
{
... ...
// pages/book/smsbatch/index.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
/**
* 页面的初始数据
*/
data: {
hasScene:0,
seller_id:'',
},
},
/**
* 生命周期函数--监听页面加载
*/
hasScene:0,
seller_id:'',
onLoad: function (options) {
//转化场景值到 options
if(options.scene){//扫码进入
let query=decodeURIComponent(options.scene);
query.split('&').forEach(q=>{
let _q=q.split('=');
options[_q[0]]=_q[1];
})
this.hasScene=1
}
if(!options.seller_id){
let enter_params=util.cache('enter_params');
options.seller_id=enter_params.seller_id;
}
this.seller_id=options.seller_id;
this.setData({
hasScene:this.hasScene,
seller_id:this.seller_id,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.SmsBatchList();
},
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
},
SmsBatchList(){
App.Reserve.SmsBatchList({
sid:this.seller_id,
offset:0,
limit:1,
})
},
})
\ No newline at end of file
... ...
... ... @@ -4,7 +4,8 @@
"navigationBarTextStyle":"black",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav"
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
... ... @@ -2,5 +2,6 @@
<nav id="nav" hasHome>短信营销</nav>
<view class="page">
pages/book/smsbatch/index.wxml
<formids url="./update?seller_id={{seller_id}}&hasScene={{hasScene}}">立即创建</formids>
<userinfo>发送</userinfo>
</view>
... ...
// pages/book/smsbatch/update.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
form:{},
total:0,
},
reservePhonesMap:[],
reservePhones:[],
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
App.Reserve.GetReservePhones({sid:options.seller_id}).then(res=>{
//this.reservePhones=res.data;
if(res.data.length>0){
let reservePhonesMap=[];
let reservePhones=[];
res.data.forEach(m=>{
if(/1[3-9]{1}[\d]{9}/.test(m.phone)){
reservePhonesMap.push(m);
reservePhones.push(m.phone);
}
})
this.setData({
total:reservePhones.length
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
formValue(e){
let key=util.attr(e,'key');
let form=this.data.form;
form[key]=util.val(e);
this.setData({
form:form,
})
},
submit(){
let param={
}
App.Reserve.SmsBatchUpdate(param);
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/book/smsbatch/update.wxml-->
<nav id="nav" hasHome>短信营销</nav>
<view class="page">
<view>会员({{total}})人</view>
<textarea bindinput="formValue" data-key="send_msg" placeholder="短信内容"></textarea>
<input placeholder="姓名" bindinput="formValue" data-key="name"/>
<input placeholder="电话" bindinput="formValue" data-key="phone" type="number"/>
<button bindtap="submit">提交</button>
</view>
... ...
/* pages/book/smsbatch/update.wxss */
.page{
width: 90%;
margin: 0 auto;
color: #353535;
padding-top: 28rpx;
font-size: 30rpx;
color: #353535;
}
\ No newline at end of file
... ...
... ... @@ -30,7 +30,7 @@
"list": []
},
"miniprogram": {
"current": 26,
"current": 27,
"list": [
{
"id": 0,
... ... @@ -234,6 +234,12 @@
"name": "pages/book/smsbatch/index",
"pathName": "pages/book/smsbatch/index",
"query": "seller_id=80"
},
{
"id": -1,
"name": "pages/book/smsbatch/update",
"pathName": "pages/book/smsbatch/update",
"query": "seller_id=80"
}
]
}
... ...
export default {
//示例,JS接口名,和服务端接口名称保持一致
'App.TestManagement.Test':{
silence:true, //静默,不带loading; 默认 true 不带loading
cachetime:0, //缓存 0无,-1永久,86400秒; 默认 0 不缓存
timeout:2000, //接口超时时间,默认2s
host:'' //默认空使用04服务器,测试填写 'https://xt05.colorcun.com/?s='
},
//预定信息详情
'App.Reserve.Detail':{
cachetime:60,
},
//建立预定关系
'App.Reserve.SetRelaOpenid':{
cachetime:-1,
},
//增加顾客信息
'App.Reserve.AddUser':{
cachetime:-1,
},
//邀请详情页面----设置分享信息
'App.Reserve.SetTopicFromShare':null,
//列表----我的日程
'App.Reserve.GetListFromScheAndRes':{
cachetime:30,
},
//订座详情页面----我愿意
'App.Reserve.SetRelaSuccess':null,
//定个座儿 获取商户信息
'App.Reserve.SellerInfo':{
cachetime:300,
},
//设置客户经理
'App.Reserve.SetReserveCusman':null,
//发送短信
'App.SendSMS.Message':{
silence:false,
},
//手机号搜索
'App.Reserve.GetReserveUser':null,
//预定列表
'App.Reserve.GetReserveList':{
silence:false,
},
//商家列表
'App.Reserve.SellerList':null,
//桌位列表
'App.Tables.GetTableListsBySellerId':{
cachetime:60,
},
// 修改当前预定状态 0:待确认,1:已定座,2:确认到店,3:用餐完成
'App.Reserve.SetReserveStatus':{
silence:false,
},
//修改当前桌子是否启用 0:未启用,1:启用
'App.Reserve.SetSwitchStatus':{
silence:false,
},
//进行商户判断
'App.Reserve.SellerForOpenid':null,
//商户端账号表增加订座儿openid
'App.Reserve.UpdateSellerUser':{
cachetime:60,
},
//导出
'App.Reserve.ExportReserve':{
silence:false,
},
//查询短信剩余及套餐
'App.Reserve.SmsInfo':{
alias:'App.SendSMS.SmsInfo',
cachetime:60,
},
//生成支付签名接口
'App.Reserve.SmsBuy':{
alias:'App.Pay.WxPaySub',
},
/**提前点餐**/
//菜品列表
'App.Cookbook.GetCookbookByClass':null,
//菜品规格
'App.Cookbook.GetCookbookSelBySpecsId':null,
//添加到购物车
'App.Orders.AddCart':null,
//减菜
'App.Orders.ReduceOrder':null,
//清空购物车
'App.Orders.ClearCookById':null,
//购物车
'App.Orders.GetOrderById':null,
//示例,JS接口名,和服务端接口名称保持一致
'App.TestManagement.Test': {
silence: true, //静默,不带loading; 默认 true 不带loading
cachetime: 0, //缓存 0无,-1永久,86400秒; 默认 0 不缓存
timeout: 2000, //接口超时时间,默认2s
host: '' //默认空使用04服务器,测试填写 'https://xt05.colorcun.com/?s='
},
//预定信息详情
'App.Reserve.Detail': {
cachetime: 60,
},
//建立预定关系
'App.Reserve.SetRelaOpenid': {
cachetime: -1,
},
//增加顾客信息
'App.Reserve.AddUser': {
cachetime: -1,
},
//邀请详情页面----设置分享信息
'App.Reserve.SetTopicFromShare': null,
//列表----我的日程
'App.Reserve.GetListFromScheAndRes': {
cachetime: 30,
},
//订座详情页面----我愿意
'App.Reserve.SetRelaSuccess': null,
//定个座儿 获取商户信息
'App.Reserve.SellerInfo': {
cachetime: 300,
},
//设置客户经理
'App.Reserve.SetReserveCusman': null,
//发送短信
'App.SendSMS.Message': {
silence: false,
},
//手机号搜索
'App.Reserve.GetReserveUser': null,
//预定列表
'App.Reserve.GetReserveList': {
silence: false,
},
//商家列表
'App.Reserve.SellerList': null,
//桌位列表
'App.Tables.GetTableListsBySellerId': {
cachetime: 60,
},
// 修改当前预定状态 0:待确认,1:已定座,2:确认到店,3:用餐完成
'App.Reserve.SetReserveStatus': {
silence: false,
},
//修改当前桌子是否启用 0:未启用,1:启用
'App.Reserve.SetSwitchStatus': {
silence: false,
},
//进行商户判断
'App.Reserve.SellerForOpenid': null,
//商户端账号表增加订座儿openid
'App.Reserve.UpdateSellerUser': {
cachetime: 60,
},
//导出
'App.Reserve.ExportReserve': {
silence: false,
},
//查询短信剩余及套餐
'App.Reserve.SmsInfo': {
alias: 'App.SendSMS.SmsInfo',
cachetime: 60,
},
//生成支付签名接口
'App.Reserve.SmsBuy': {
alias: 'App.Pay.WxPaySub',
},
/**短信营销**/
//App.Reserve.SmsBatchUpdate 新增或编辑短信
'App.Reserve.SmsBatchUpdate': null,
//App.Reserve.SmsBatchList 营销短信列表
'App.Reserve.SmsBatchList': null,
//App.Reserve.SmsBatchInfo 营销短信详细
'App.Reserve.SmsBatchInfo': null,
//App.Reserve.GetReservePhones 获取可发短信的客户列表
'App.Reserve.GetReservePhones': null,
//App.Reserve.SmsBatchSend 短信发送
'App.Reserve.SmsBatchSend': null,
/**提前点餐**/
//菜品列表
'App.Cookbook.GetCookbookByClass': null,
//菜品规格
'App.Cookbook.GetCookbookSelBySpecsId': null,
//添加到购物车
'App.Orders.AddCart': null,
//减菜
'App.Orders.ReduceOrder': null,
//清空购物车
'App.Orders.ClearCookById': null,
//购物车
'App.Orders.GetOrderById': null,
}
\ No newline at end of file
... ...