Commit 7e2ff8a0f03ee8eff7771da5fdfe4c34c4b01b83

Authored by wangfan
1 parent 41f30b2f

most_pnum

@@ -18,7 +18,10 @@ @@ -18,7 +18,10 @@
18 "pages/me/list", 18 "pages/me/list",
19 "pages/book/b_addnew", 19 "pages/book/b_addnew",
20 "pages/book/b_sms", 20 "pages/book/b_sms",
21 - "pages/book/b_setting" 21 + "pages/book/b_setting",
  22 + "pages/book/setting/index",
  23 + "pages/book/setting/sms",
  24 + "pages/book/setting/sms_buy"
22 ], 25 ],
23 "window": { 26 "window": {
24 "navigationStyle": "custom", 27 "navigationStyle": "custom",
@@ -226,7 +226,14 @@ image{ @@ -226,7 +226,14 @@ image{
226 width:100%; 226 width:100%;
227 border-radius: 0; 227 border-radius: 0;
228 background-color: transparent; 228 background-color: transparent;
  229 + overflow: visible;
229 } 230 }
230 .navigator-hover{ 231 .navigator-hover{
231 background:none; 232 background:none;
  233 +}
  234 +.more{
  235 + width: 12rpx;
  236 + height: 22rpx;
  237 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/click.png");
  238 + background-size: 100%;
232 } 239 }
1 <view style="height:{{height}}px;" class="nothing-page flex-vc bg-white"> 1 <view style="height:{{height}}px;" class="nothing-page flex-vc bg-white">
2 - <image class="nothing-booklist" src="/pages/image/nothing-booklist.png"></image> 2 + <image class="nothing-booklist" src="http://qn.colorcun.com/custom/lite-yd/image/nothing-booklist.png"></image>
3 <view class="black-font font34r smooth nothing-content">暂无内容</view> 3 <view class="black-font font34r smooth nothing-content">暂无内容</view>
4 </view> 4 </view>
@@ -7,15 +7,15 @@ Component({ @@ -7,15 +7,15 @@ Component({
7 data:{ 7 data:{
8 list:[ 8 list:[
9 { 9 {
10 - imgurl:'/pages/image/notice-wx.png', 10 + imgurl:'http://qn.colorcun.com/custom/lite-yd/image/notice-wx.png',
11 title:'微信' 11 title:'微信'
12 }, 12 },
13 { 13 {
14 - imgurl:'/pages/image/notice-msg.png', 14 + imgurl:'http://qn.colorcun.com/custom/lite-yd/image/notice-msg.png',
15 title:'短信' 15 title:'短信'
16 }, 16 },
17 { 17 {
18 - imgurl:'/pages/image/notice-call.png', 18 + imgurl:'http://qn.colorcun.com/custom/lite-yd/image/notice-call.png',
19 title:'电话' 19 title:'电话'
20 } 20 }
21 ], 21 ],
1 <view class="selected-time flex-cc"> 1 <view class="selected-time flex-cc">
2 <view class="flex-vc padding-topbottom padding-left25" bindtap="reducePnum"> 2 <view class="flex-vc padding-topbottom padding-left25" bindtap="reducePnum">
3 - <image src="/pages/image/reduce-act.png" class="select-act"></image> 3 + <image src="http://qn.colorcun.com/custom/lite-yd/image/reduce-act.png" class="select-act"></image>
4 </view> 4 </view>
5 <input value="{{pnum}}" class="select-input flex-cc green-font font34r" bindunput="editpnum"/> 5 <input value="{{pnum}}" class="select-input flex-cc green-font font34r" bindunput="editpnum"/>
6 <view class="flex-vc padding-topbottom padding-right25" bindtap="addPnum"> 6 <view class="flex-vc padding-topbottom padding-right25" bindtap="addPnum">
7 - <image src="/pages/image/add-act.png" class="select-act"></image> 7 + <image src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" class="select-act"></image>
8 </view> 8 </view>
9 </view> 9 </view>
@@ -17,7 +17,7 @@ Component({ @@ -17,7 +17,7 @@ Component({
17 attached(){ 17 attached(){
18 let pages=getCurrentPages(); 18 let pages=getCurrentPages();
19 let p=pages[pages.length-1]; 19 let p=pages[pages.length-1];
20 - let pi=['/pages/book/b_addnew','/pages/book/b_index','/pages/book/b_setting']; 20 + let pi=['/pages/book/b_addnew','/pages/book/b_index','/pages/book/b_setting','/pages/book/setting/index'];
21 for(let x in pi){ 21 for(let x in pi){
22 console.log('tabBar',pi[x],p); 22 console.log('tabBar',pi[x],p);
23 if(pi[x].indexOf(p.route)>-1){ 23 if(pi[x].indexOf(p.route)>-1){
@@ -14,8 +14,14 @@ @@ -14,8 +14,14 @@
14 </formids> 14 </formids>
15 <formids class="item flex-vc" bindtap="redirectTo" data-url="/pages/book/b_setting"> 15 <formids class="item flex-vc" bindtap="redirectTo" data-url="/pages/book/b_setting">
16 <view class="flex-vc {{pi==2?'checked':''}}"> 16 <view class="flex-vc {{pi==2?'checked':''}}">
17 - <view class="icon setting"></view> 17 + <view class="icon board"></view>
18 <view class="text">桌位</view> 18 <view class="text">桌位</view>
19 </view> 19 </view>
20 </formids> 20 </formids>
  21 + <formids class="item flex-vc" bindtap="redirectTo" data-url="/pages/book/setting/index">
  22 + <view class="flex-vc {{pi==3?'checked':''}}">
  23 + <view class="icon setting"></view>
  24 + <view class="text">设置</view>
  25 + </view>
  26 + </formids>
21 </view> 27 </view>
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 color: #353535; 15 color: #353535;
16 } 16 }
17 .tabBar .item{ 17 .tabBar .item{
18 - width: 33%; 18 + width: 25%;
19 } 19 }
20 .tabBar .icon{ 20 .tabBar .icon{
21 width: 40rpx; 21 width: 40rpx;
@@ -32,13 +32,18 @@ @@ -32,13 +32,18 @@
32 .tabBar .book{ 32 .tabBar .book{
33 background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-book.png"); 33 background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-book.png");
34 } 34 }
35 -.tabBar .book .reserve{ 35 +.tabBar .checked .book {
36 background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-book-checked.png"); 36 background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-book-checked.png");
37 } 37 }
38 .tabBar .setting{ 38 .tabBar .setting{
39 background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-setting.png"); 39 background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-setting.png");
40 } 40 }
41 -.tabBar .setting .reserve{ 41 +.tabBar .checked .setting {
42 background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-setting-checked.png"); 42 background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-setting-checked.png");
43 } 43 }
44 - 44 +.tabBar .board{
  45 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-boards.png");
  46 +}
  47 +.tabBar .checked .board {
  48 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-boards-checked.png");
  49 +}
@@ -5,7 +5,8 @@ @@ -5,7 +5,8 @@
5 <view class="flex-lr part"> 5 <view class="flex-lr part">
6 <view class="opt flex-ll"> 6 <view class="opt flex-ll">
7 <view class="back flex-vc" bindtap="back" wx:if="{{disBack}}"> 7 <view class="back flex-vc" bindtap="back" wx:if="{{disBack}}">
8 - <image class="back-image" src="http://qn.colorcun.com/custom/lite-yd/image/back.png"></image> 8 + <image class="back-image" src="http://qn.colorcun.com/custom/lite-yd/image/back.png" wx:if="{{backgroundColor=='#ffffff'}}"></image>
  9 + <image class="back-image" src="http://qn.colorcun.com/custom/lite-yd/image/back-light.png" wx:else=""></image>
9 </view> 10 </view>
10 <view class="home flex-vc" bindtap="home" wx:if="{{disHome}}"> 11 <view class="home flex-vc" bindtap="home" wx:if="{{disHome}}">
11 <image class="home-image" src="http://qn.colorcun.com/custom/lite-yd/image/home.svg"></image> 12 <image class="home-image" src="http://qn.colorcun.com/custom/lite-yd/image/home.svg"></image>
@@ -21,4 +22,4 @@ @@ -21,4 +22,4 @@
21 22
22 </view> 23 </view>
23 </view> 24 </view>
24 -</view> 25 +</view>
@@ -10,7 +10,6 @@ @@ -10,7 +10,6 @@
10 font-weight: bold; 10 font-weight: bold;
11 } 11 }
12 .nav .part{ 12 .nav .part{
13 - background-color: #ffffff;  
14 line-height: 68rpx; 13 line-height: 68rpx;
15 height: 68rpx; 14 height: 68rpx;
16 text-align: center; 15 text-align: center;
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <view class="single-date gray-deep-font flex-vc"> 11 <view class="single-date gray-deep-font flex-vc">
12 <view class="font30r">更多</view> 12 <view class="font30r">更多</view>
13 <view class="date-num flex-vc"> 13 <view class="date-num flex-vc">
14 - <image src="../image/more-dot.png" class="more-dot"></image> 14 + <image src="http://qn.colorcun.com/custom/lite-yd/image/more-dot.png" class="more-dot"></image>
15 </view> 15 </view>
16 </view> 16 </view>
17 </view> 17 </view>
@@ -128,7 +128,7 @@ @@ -128,7 +128,7 @@
128 <view>可订桌位<text wx:if="{{tables.length>0}}"> ({{tablesLength}})</text></view> 128 <view>可订桌位<text wx:if="{{tables.length>0}}"> ({{tablesLength}})</text></view>
129 <view class="flex-rr advice-more" bindtap="selectdesk" wx:if="{{tablesLength>1}}"> 129 <view class="flex-rr advice-more" bindtap="selectdesk" wx:if="{{tablesLength>1}}">
130 <view style="padding-right:20rpx;" class="gray-deep-font font26r">更多</view> 130 <view style="padding-right:20rpx;" class="gray-deep-font font26r">更多</view>
131 - <image src="../image/click.png" class="icon12-22"></image> 131 + <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="icon12-22"></image>
132 </view> 132 </view>
133 </view> 133 </view>
134 <view class="advice-desk-detail flex-rr" wx:if="{{tables.length>0}}"> 134 <view class="advice-desk-detail flex-rr" wx:if="{{tables.length>0}}">
@@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
156 <block wx:if="{{reminder}}"> 156 <block wx:if="{{reminder}}">
157 <view class="flex-rr" style="height:100rpx;"> 157 <view class="flex-rr" style="height:100rpx;">
158 <view style="color:#E14553;" class="font28r">{{reminder}}</view> 158 <view style="color:#E14553;" class="font28r">{{reminder}}</view>
159 - <image src="../image/name-have.png" class="phone-reminder"></image> 159 + <image src="http://qn.colorcun.com/custom/lite-yd/image/name-have.png" class="phone-reminder"></image>
160 </view> 160 </view>
161 </block> 161 </block>
162 <block wx:if="{{searchlist}}"> 162 <block wx:if="{{searchlist}}">
@@ -179,6 +179,9 @@ @@ -179,6 +179,9 @@
179 </block> 179 </block>
180 </view> 180 </view>
181 </view> 181 </view>
  182 + <view class="book-info-single" bindtap="selectedValue" data-key="time" data-value="{{form.time}}" data-display="block">
  183 + <view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;">{{timePickerArray[form.time][timePickerIndex[form.time]]}}</view>
  184 + </view>
182 185
183 <view class="book-info-single"> 186 <view class="book-info-single">
184 <input placeholder="顾客的要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}" 187 <input placeholder="顾客的要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}"
@@ -188,9 +191,6 @@ @@ -188,9 +191,6 @@
188 bindblur="inputFocus" 191 bindblur="inputFocus"
189 data-key="cusdem"/> 192 data-key="cusdem"/>
190 </view> 193 </view>
191 - <view class="book-info-single" bindtap="selectedValue" data-key="time" data-value="{{form.time}}" data-display="block">  
192 - <view>到店时间 {{timePickerArray[form.time][timePickerIndex[form.time]]}}</view>  
193 - </view>  
194 </view> 194 </view>
195 <view class="page-full submit"> 195 <view class="page-full submit">
196 <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">确定</view> 196 <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">确定</view>
@@ -177,7 +177,7 @@ Page({ @@ -177,7 +177,7 @@ Page({
177 console.log('savedFilePath',savedFilePath); 177 console.log('savedFilePath',savedFilePath);
178 wx.openDocument({ 178 wx.openDocument({
179 filePath: savedFilePath, 179 filePath: savedFilePath,
180 - fileType:'xls', 180 + fileType:'pdf',
181 success: function(res) { 181 success: function(res) {
182 console.log('打开文档成功') 182 console.log('打开文档成功')
183 }, 183 },
@@ -4,11 +4,11 @@ @@ -4,11 +4,11 @@
4 <view class="book-page bg_white"> 4 <view class="book-page bg_white">
5 <view class="book-search flex-lr"> 5 <view class="book-search flex-lr">
6 <view class="flex-ll book-search-left"> 6 <view class="flex-ll book-search-left">
7 - <image src="../image/search.png" class="search-icon"></image> 7 + <image src="http://qn.colorcun.com/custom/lite-yd/image/search.png" class="search-icon"></image>
8 <input placeholder="桌位·预定人姓名·手机号" placeholder-class="font30r gray-font smooth" class="font30r black-font smooth search-input" value="{{keywords}}" bindinput="searchinput" confirm-type="search" bindconfirm="searchbook"/> 8 <input placeholder="桌位·预定人姓名·手机号" placeholder-class="font30r gray-font smooth" class="font30r black-font smooth search-input" value="{{keywords}}" bindinput="searchinput" confirm-type="search" bindconfirm="searchbook"/>
9 </view> 9 </view>
10 <view bindtap="exportFile" class="exportFile flex-vc"> 10 <view bindtap="exportFile" class="exportFile flex-vc">
11 - <image src="../image/export.png" class="search-icon"></image> 11 + <image src="http://qn.colorcun.com/custom/lite-yd/image/export.png" class="search-icon"></image>
12 <view>导出</view> 12 <view>导出</view>
13 </view> 13 </view>
14 </view> 14 </view>
@@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
48 <view class="book-list-thead flex-lr font34r black-font"> 48 <view class="book-list-thead flex-lr font34r black-font">
49 <view>桌号</view> 49 <view>桌号</view>
50 <view class="flex-cc">预定人</view> 50 <view class="flex-cc">预定人</view>
51 - <view class="flex-cc" bindtap="timeorder">时间<image src="../image/direction.png" class="icon22-26" background-size="cover"></image></view> 51 + <view class="flex-cc" bindtap="timeorder">时间<image src="http://qn.colorcun.com/custom/lite-yd/image/direction.png" class="icon22-26" background-size="cover"></image></view>
52 <view class="flex-rr">操作</view> 52 <view class="flex-rr">操作</view>
53 </view> 53 </view>
54 <view class="book-list" style="padding-bottom:118rpx;"> 54 <view class="book-list" style="padding-bottom:118rpx;">
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 </block> 35 </block>
36 <view class="flex-rr advice-more" bindtap="selectdesk"> 36 <view class="flex-rr advice-more" bindtap="selectdesk">
37 <view style="padding-right:30rpx;" class="gray-deep-font font26r">更多</view> 37 <view style="padding-right:30rpx;" class="gray-deep-font font26r">更多</view>
38 - <image src="../image/click.png" class="icon12-22"></image> 38 + <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="icon12-22"></image>
39 </view> 39 </view>
40 </view> 40 </view>
41 </view> 41 </view>
@@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
57 <block wx:if="{{reminder}}"> 57 <block wx:if="{{reminder}}">
58 <view class="flex-rr" style="height:100rpx;"> 58 <view class="flex-rr" style="height:100rpx;">
59 <view style="color:#E14553;" class="font28r">{{reminder}}</view> 59 <view style="color:#E14553;" class="font28r">{{reminder}}</view>
60 - <image src="../image/name-have.png" class="phone-reminder"></image> 60 + <image src="http://qn.colorcun.com/custom/lite-yd/image/name-have.png" class="phone-reminder"></image>
61 </view> 61 </view>
62 </block> 62 </block>
63 </view> 63 </view>
  1 +// pages/book/setting/index.js
  2 +import util from '../../../utils/util';
  3 +import App from '../../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 +
  12 + },
  13 +
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + enter_params:{},
  18 + onLoad: function (options) {
  19 + this.enter_params=util.cache('enter_params');
  20 + App.Reserve.SellerInfo(this.enter_params).then(res=>{
  21 + this.setData({
  22 + seller:res.data.seller,
  23 + user:res.data.seller_user
  24 + })
  25 + })
  26 + },
  27 +
  28 + /**
  29 + * 生命周期函数--监听页面初次渲染完成
  30 + */
  31 + onReady: function () {
  32 +
  33 + },
  34 +
  35 + /**
  36 + * 生命周期函数--监听页面显示
  37 + */
  38 + onShow: function () {
  39 + App.Reserve.SmsInfo({seller_id:this.enter_params.seller_id}).then(res=>{
  40 + if(res.ret==404){
  41 + res.data={
  42 + last_num:100,
  43 + meals:[
  44 + {id:1,total:550,price_ave:0.09,price_old:50,price:50,discount:0},
  45 + {id:2,total:1200,price_ave:0.083,price_old:100,price:100,discount:0},
  46 + {id:3,total:3650,price_ave:0.082,price_old:328,price:300,discount:9.1},
  47 + ],
  48 + };
  49 + }
  50 + this.setData({
  51 + sms:res.data,
  52 + })
  53 + })
  54 + },
  55 +
  56 + /**
  57 + * 生命周期函数--监听页面隐藏
  58 + */
  59 + onHide: function () {
  60 +
  61 + },
  62 +})
  1 +{
  2 + "backgroundTextStyle":"light",
  3 + "navigationBarBackgroundColor": "#fff",
  4 + "navigationBarTextStyle":"light",
  5 + "usingComponents": {
  6 + "nav":"/components/nav/nav",
  7 + "tabBar":"/components/book/tabBar/tabBar",
  8 + "formids":"/components/formids/formids"
  9 + }
  10 +}
  1 +<!--pages/book/setting/index.wxml-->
  2 +<nav id="nav" backgroundColor="#199095" color="#fefefe">订座</nav>
  3 +<view class="header">
  4 + <view class="info">
  5 + <view class="nick">{{user.nickname}}</view>
  6 + <view class="seller Medium">{{seller.sellername}} | 客户经理</view>
  7 + </view>
  8 +</view>
  9 +<view class="page">
  10 + <formids url="/pages/book/setting/sms">
  11 + <view class="row flex-lr">
  12 + <view>短信管理</view>
  13 + <view class="flex-rr">
  14 + <view class="right lastNum">剩余{{sms.last_num||0}}条</view>
  15 + <view class="more"></view>
  16 + </view>
  17 + </view>
  18 + </formids>
  19 +</view>
  20 +<tabBar></tabBar>
  1 +/* pages/book/setting/index.wxss */
  2 +/*
  3 +http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png
  4 +http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
  5 +*/
  6 +.header{
  7 + height: 302rpx;
  8 + background-color: #199095;
  9 + margin-top: -2rpx;
  10 +}
  11 +.header .info{
  12 + color:#FEFEFE;
  13 + width: 90%;
  14 + padding-top: 86rpx;
  15 + margin: 0 auto;
  16 +}
  17 +.header .info .nick{
  18 + font-size: 44rpx;
  19 + font-weight: bold;
  20 + margin-bottom: 28rpx;
  21 +}
  22 +.header .info .seller{
  23 + font-size: 34rpx;
  24 +}
  25 +.page{
  26 + width: 90%;
  27 + margin: 0 auto;
  28 + color: #353535;
  29 + padding-top: 28rpx;
  30 +}
  31 +.row{
  32 + font-size: 34rpx;
  33 + height: 80rpx;
  34 + border-bottom: 2rpx solid #F1F0F4;
  35 +}
  36 +.row .right{
  37 + font-size: 30rpx;
  38 + color:#999999;
  39 +}
  40 +.row .more{
  41 + margin-left: 20rpx;
  42 +}
  1 +// pages/book/setting/sms.js
  2 +import util from '../../../utils/util';
  3 +import App from '../../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + seller_id:'',
  12 + },
  13 +
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad: function (options) {
  18 + if(!options.seller_id){
  19 + let enter_params=util.cache('enter_params');
  20 + options.seller_id=enter_params.seller_id;
  21 + }
  22 + App.Reserve.SmsInfo({seller_id:options.seller_id}).then(res=>{
  23 + if(res.ret==404){
  24 + res.data={
  25 + last_num:100,
  26 + meals:[
  27 + {id:1,total:550,price_ave:0.09,price_old:50,price:50,discount:0},
  28 + {id:2,total:1200,price_ave:0.083,price_old:100,price:100,discount:0},
  29 + {id:3,total:3650,price_ave:0.082,price_old:328,price:300,discount:9.1},
  30 + ],
  31 + };
  32 + }
  33 + this.setData({
  34 + seller_id:options.seller_id,
  35 + sms:res.data,
  36 + })
  37 + })
  38 + },
  39 +
  40 + /**
  41 + * 生命周期函数--监听页面初次渲染完成
  42 + */
  43 + onReady: function () {
  44 +
  45 + },
  46 +
  47 + /**
  48 + * 生命周期函数--监听页面显示
  49 + */
  50 + onShow: function () {
  51 +
  52 + },
  53 +
  54 + /**
  55 + * 生命周期函数--监听页面隐藏
  56 + */
  57 + onHide: function () {
  58 +
  59 + },
  60 +})
  1 +{
  2 + "backgroundTextStyle":"light",
  3 + "navigationBarBackgroundColor": "#fff",
  4 + "navigationBarTextStyle":"light",
  5 + "usingComponents": {
  6 + "nav":"/components/nav/nav",
  7 + "formids":"/components/formids/formids"
  8 + }
  9 +}
  1 +<!--pages/book/setting/sms.wxml-->
  2 +<nav id="nav" backgroundColor="#199095" color="#fefefe">短信管理</nav>
  3 +<view class="header">
  4 + <view class="info flex-vc">
  5 + <view class="nick">短信余量</view>
  6 + <view class="last flex-lr">
  7 + <view class="lastNum">{{sms.last_num||0}}</view>
  8 + <view class="lastNum-txt">条</view>
  9 + </view>
  10 + <formids class="button" url="/pages/book/setting/sms_buy?seller_id={{seller_id}}" open-type="redirect">
  11 + <view class="txt Medium">立即充值</view>
  12 + <view class="icon-cz">特惠</view>
  13 + </formids>
  14 + </view>
  15 +</view>
  16 +<view class="page">
  17 + <view class="line">
  18 + <view>常见问题说明</view>
  19 + </view>
  20 + <view class="action">
  21 + <view class="tip Medium">1.短信计费</view>
  22 + <view class="item">短信计费统一根据三大运营商标注计算;</view>
  23 + <view class="item">当短信内容字符数≤70,短信按照一条计费;</view>
  24 + <view class="item">当短信内容字符数>70个字符时,按照每70个字符 为一条短信;</view>
  25 + </view>
  26 + <view class="action">
  27 + <view class="tip Medium">2.短信统计</view>
  28 + <view class="item">短信统计只统计计费短信,与订单数量无关,一个订 单可能会发送多条短信,则计费时按照多条短信计费;</view>
  29 + </view>
  30 + <view class="action">
  31 + <view class="tip Medium">3.充值说明</view>
  32 + <view class="item">短信统一在订座商户小程序上进行充值,充值记录和 详情使用情况统一在小程序上查看;</view>
  33 + </view>
  34 +</view>
  35 +
  1 +/* pages/book/setting/sms.wxss */
  2 +/*
  3 +http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png
  4 +http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
  5 +*/
  6 +.header{
  7 + height: 402rpx;
  8 + background-color: #199095;
  9 + margin-top: -2rpx;
  10 +}
  11 +.header .info{
  12 + color:#FEFEFE;
  13 + width: 90%;
  14 + padding-top: 86rpx;
  15 + margin: 0 auto;
  16 +}
  17 +.header .info .nick{
  18 + font-size: 34rpx;
  19 + margin-bottom: 10rpx;
  20 +}
  21 +.header .info .last{
  22 + height: 66rpx;
  23 + line-height: 66rpx;
  24 +}
  25 +.header .info .last .lastNum{
  26 + font-size: 48rpx;
  27 + font-weight: bold;
  28 + margin-right: 10rpx;
  29 +}
  30 +.header .info .last .lastNum-txt{
  31 + font-size: 30rpx;
  32 +}
  33 +.header .info .button{
  34 + margin-top: 76rpx;
  35 + position: relative;
  36 + background-color: #FEFEFE;
  37 + height: 80rpx;
  38 + width: 240rpx;
  39 + line-height: 75rpx;
  40 + border-radius: 10rpx;
  41 + color:#199095;
  42 + text-align: center;
  43 +}
  44 +.header .info .button .icon-cz{
  45 + width: 74rpx;
  46 + height: 40rpx;
  47 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png");
  48 + background-size: 100%;
  49 + position: absolute;
  50 + top:-10rpx;
  51 + right:-6rpx;
  52 + font-size: 24rpx;
  53 + color: #FEFEFE;
  54 + line-height: 35rpx;
  55 + text-align: center;
  56 +}
  57 +.page{
  58 + width: 90%;
  59 + margin: 0 auto;
  60 + color: #353535;
  61 + padding-top: 28rpx;
  62 + font-size: 28rpx;
  63 + color: #353535;
  64 +}
  65 +.action{
  66 + padding-bottom: 30rpx;
  67 + border-bottom: 2rpx solid #F1F0F4;
  68 + margin-bottom: 30rpx;
  69 +}
  70 +.action .tip{
  71 + margin-bottom: 22rpx;
  72 +}
  73 +.action .item:before{
  74 + content: '·';
  75 + padding: 10rpx;
  76 +}
  77 +.action:last-child{
  78 + border-bottom-width: 0;
  79 +}
  80 +.line{
  81 + height: 40rpx;
  82 + width: 80%;
  83 + margin: 42rpx auto 0;
  84 + border-top: 2rpx solid #E0E0E0;
  85 + position: relative;
  86 +}
  87 +.line view{
  88 + background-color: #FEFEFE;
  89 + width: 248rpx;
  90 + margin: -22rpx auto 0;
  91 + text-align: center;
  92 +}
  1 +// pages/book/setting/sms_buy.js
  2 +import util from '../../../utils/util';
  3 +import App from '../../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + form:{},
  12 + },
  13 +
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad: function (options) {
  18 + if(!options.seller_id){
  19 + let enter_params=util.cache('enter_params');
  20 + options.seller_id=enter_params.seller_id;
  21 + }
  22 + App.Reserve.SmsInfo({seller_id:options.seller_id}).then(res=>{
  23 + if(res.ret==404){
  24 + res.data={
  25 + last_num:100,
  26 + meals:[
  27 + {id:1,total:550,price_ave:0.09,price_old:50,price:50,discount:0},
  28 + {id:2,total:1200,price_ave:0.083,price_old:100,price:100,discount:0},
  29 + {id:3,total:3650,price_ave:0.082,price_old:328,price:300,discount:9.1},
  30 + ],
  31 + };
  32 + }
  33 + this.setData({
  34 + seller_id:options.seller_id,
  35 + sms:res.data,
  36 + })
  37 + })
  38 + },
  39 +
  40 + /**
  41 + * 生命周期函数--监听页面初次渲染完成
  42 + */
  43 + onReady: function () {
  44 +
  45 + },
  46 +
  47 + /**
  48 + * 生命周期函数--监听页面显示
  49 + */
  50 + onShow: function () {
  51 +
  52 + },
  53 +
  54 + /**
  55 + * 生命周期函数--监听页面隐藏
  56 + */
  57 + onHide: function () {
  58 +
  59 + },
  60 + chooseMeal(e){
  61 + this.setData({
  62 + form:{
  63 + meal_id:util.attr(e,'id'),
  64 + price:util.attr(e,'price'),
  65 + seller_id:this.data.seller_id
  66 + }
  67 + })
  68 + },
  69 + buy(){
  70 + if(!this.data.form.meal_id) return;
  71 + App.Reserve.SmsBuy(this.data.form).then(res=>{
  72 + let pay=res.data;
  73 + wx.requestPayment({
  74 + 'timeStamp': pay.timeStamp,
  75 + 'nonceStr': pay.nonceStr,
  76 + 'package': pay.package,
  77 + 'signType': 'MD5',
  78 + 'paySign': pay.paySign,
  79 + 'success':function(res){
  80 + if(res){
  81 + App.Reserve.SmsInfo({seller_id:this.data.seller_id},'clear');
  82 + wx.showToast({
  83 + title: '支付成功',
  84 + icon: 'loading',
  85 + duration: 1000,
  86 + mask:true,
  87 + success:function () {
  88 + setTimeout(()=>{
  89 + wx.navigateBack();
  90 + },1500)
  91 + }
  92 + })
  93 + }
  94 + },
  95 + 'fail':function(res){
  96 + wx.showToast({
  97 + title: '已取消支付',
  98 + icon: 'loading',
  99 + duration: 1000,
  100 + mask:true,
  101 + })
  102 + }
  103 + })
  104 + });
  105 + },
  106 +})
  1 +{
  2 + "backgroundTextStyle":"light",
  3 + "navigationBarBackgroundColor": "#fff",
  4 + "navigationBarTextStyle":"black",
  5 + "usingComponents": {
  6 + "nav":"/components/nav/nav",
  7 + "formids":"/components/formids/formids"
  8 + }
  9 +}
  1 +<!--pages/book/setting/sms_buy.wxml-->
  2 +<nav id="nav">短信充值</nav>
  3 +<view class="page">
  4 + <view class="title Medium">短信套餐</view>
  5 + <view class="subtitle">购买套餐,使用更划算</view>
  6 + <block wx:for="{{sms.meals}}" wx:key="sms.meals.key">
  7 + <view class="block {{form.id==item.id?'checked':''}} flex-vc"
  8 + data-id="{{item.id}}" data-price="{{item.price}}"
  9 + bindtap="chooseMeal">
  10 + <view class="flex-lr info">
  11 + <view class="left">
  12 + <view class="count Medium">{{item.total}}条</view>
  13 + <view class="price-pre">约{{item.price_ave}}元/条</view>
  14 + </view>
  15 + <view class="right">
  16 + <view class="price Medium">¥{{item.price}}</view>
  17 + <view class="price-old" wx:if="{{item.price_old && item.price_old>item.price}}">¥{{item.price_old}}</view>
  18 + </view>
  19 + </view>
  20 + <view class="icon-zk Medium" wx:if="{{item.discount>0 && item.discount<10}}">{{item.discount}}折</view>
  21 + </view>
  22 + </block>
  23 +</view>
  24 +<view class="button-view flex-vc {{form.price>0?'active':''}}">
  25 + <view class="page flex-lr" style="padding-top: 0;">
  26 + <view class="tip" wx:if="{{form.price>0}}">{{form.price}}元</view>
  27 + <view class="tip" wx:else="">短信剩余{{sms.lasr_num}}条,不充值将无法给顾客发送预定通知</view>
  28 + <view class="button Medium" bindtap="buy">购买</view>
  29 + </view>
  30 +</view>
  1 +/* pages/book/setting/sms_buy.wxss */
  2 +.page{
  3 + width: 90%;
  4 + margin: 0 auto;
  5 + color: #353535;
  6 + padding-top: 28rpx;
  7 + font-size: 30rpx;
  8 + color: #353535;
  9 +}
  10 +.title{
  11 + font-size: 40rpx;
  12 + height: 56rpx;
  13 + line-height: 56rpx;
  14 + margin-bottom: 20rpx;
  15 +}
  16 +.subtitle{
  17 + font-size: 30rpx;
  18 + margin-bottom: 30rpx;
  19 +}
  20 +.block{
  21 + border: 2rpx solid #999999;
  22 + border-radius: 10rpx;
  23 + height: 172rpx;
  24 + position: relative;
  25 + margin-bottom: 38rpx;
  26 +}
  27 +.block .icon-zk{
  28 + width: 104rpx;
  29 + height: 54rpx;
  30 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png");
  31 + background-size: 100%;
  32 + position: absolute;
  33 + top:-10rpx;
  34 + right:-6rpx;
  35 + font-size: 34rpx;
  36 + color: #FEFEFE;
  37 + line-height: 48rpx;
  38 + text-align: center;
  39 +}
  40 +.block .info{
  41 + width: 90%;
  42 +}
  43 +.block .count{
  44 + font-size: 40rpx;
  45 + height: 56rpx;
  46 + line-height: 56rpx;
  47 + margin-bottom: 10rpx;
  48 +}
  49 +.block .price-pre{
  50 + font-size: 34rpx;
  51 + height: 48rpx;
  52 + line-height: 48rpx;
  53 +}
  54 +.block .price{
  55 + font-size: 40rpx;
  56 + height: 56rpx;
  57 + line-height: 56rpx;
  58 + font-weight: bold;
  59 +}
  60 +.block .price-old{
  61 + font-size: 34rpx;
  62 + height: 48rpx;
  63 + line-height: 48rpx;
  64 + color: #999999;
  65 + text-decoration: line-through;
  66 + margin-top: -10rpx;
  67 + position: absolute;
  68 +}
  69 +.block .info .right{
  70 + position: relative;
  71 + width: 100rpx;
  72 +}
  73 +.block.checked{
  74 + border: 2rpx solid #199095;
  75 + background-color: #199095;
  76 + color:#FEFEFE;
  77 +}
  78 +.block.checked .price-old{
  79 + color:#efefef;
  80 +}
  81 +
  82 +.button-view{
  83 + position: fixed;
  84 + bottom: 0;
  85 + height: 144rpx;
  86 + border-top: 2rpx solid #F1F0F4;
  87 + line-height: 144rpx;
  88 + width: 100%;
  89 +}
  90 +.button-view .button{
  91 + width: 190rpx;
  92 + min-width: 190rpx;
  93 + height: 80rpx;
  94 + line-height: 80rpx;
  95 + background-color: #75BCBF;
  96 + color:#FEFEFE;
  97 + font-size: 34rpx;
  98 + border-radius: 10rpx;
  99 + text-align: center;
  100 +}
  101 +.button-view .tip{
  102 + width: 100%;
  103 + height: 84rpx;
  104 + line-height: 42rpx;
  105 +}
  106 +.button-view.active .button{
  107 + background-color: #199095;
  108 +}
  109 +.button-view.active .tip{
  110 + font-size: 40rpx;
  111 + line-height: 84rpx;
  112 + font-weight: bold;
  113 +}
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 "list": [] 30 "list": []
31 }, 31 },
32 "miniprogram": { 32 "miniprogram": {
33 - "current": 21, 33 + "current": 24,
34 "list": [ 34 "list": [
35 { 35 {
36 "id": 0, 36 "id": 0,
@@ -201,6 +201,27 @@ @@ -201,6 +201,27 @@
201 "pathName": "pages/book/b_index", 201 "pathName": "pages/book/b_index",
202 "query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=1859", 202 "query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=1859",
203 "scene": "1001" 203 "scene": "1001"
  204 + },
  205 + {
  206 + "id": -1,
  207 + "name": "预定本-设置",
  208 + "pathName": "pages/book/setting/index",
  209 + "query": "",
  210 + "scene": "1001"
  211 + },
  212 + {
  213 + "id": -1,
  214 + "name": "预定本-设置-短信管理",
  215 + "pathName": "pages/book/setting/sms",
  216 + "query": "",
  217 + "scene": "1001"
  218 + },
  219 + {
  220 + "id": -1,
  221 + "name": "预定本-设置-短信充值",
  222 + "pathName": "pages/book/setting/sms_buy",
  223 + "query": "",
  224 + "scene": "1001"
204 } 225 }
205 ] 226 ]
206 } 227 }
@@ -82,4 +82,12 @@ export default { @@ -82,4 +82,12 @@ export default {
82 //导出 82 //导出
83 'App.Reserve.ExportReserve':null, 83 'App.Reserve.ExportReserve':null,
84 84
  85 + //查询短信剩余及套餐
  86 + 'App.Reserve.SmsInfo':{
  87 + cachetime:300,
  88 + },
  89 +
  90 + //生成支付签名接口
  91 + 'App.Reserve.SmsBuy':null,
  92 +
85 } 93 }