Showing
3 changed files
with
31 additions
and
28 deletions
| @@ -53,6 +53,18 @@ App({ | @@ -53,6 +53,18 @@ App({ | ||
| 53 | console.log('onUpdateFailed',res) | 53 | console.log('onUpdateFailed',res) |
| 54 | }) | 54 | }) |
| 55 | } | 55 | } |
| 56 | + try{ | ||
| 57 | + let sms_code= await this.getClipboardData(); | ||
| 58 | + wx.setClipboardData({ | ||
| 59 | + data:"?" | ||
| 60 | + }) | ||
| 61 | + console.log('SMS.code',sms_code); | ||
| 62 | + wx.reLaunch({ | ||
| 63 | + url:'/pages/customer/index?sms_code='+sms_code | ||
| 64 | + }); | ||
| 65 | + }catch (e){ | ||
| 66 | + console.log('SMS.code.catch',e); | ||
| 67 | + } | ||
| 56 | }, | 68 | }, |
| 57 | getSystemInfo(){ | 69 | getSystemInfo(){ |
| 58 | this._getSystemInfo().then((res)=>{ | 70 | this._getSystemInfo().then((res)=>{ |
| @@ -127,4 +139,21 @@ App({ | @@ -127,4 +139,21 @@ App({ | ||
| 127 | } | 139 | } |
| 128 | return openid; | 140 | return openid; |
| 129 | }, | 141 | }, |
| 142 | + getClipboardData(){ | ||
| 143 | + return new Promise((success,fail)=>{ | ||
| 144 | + wx.getClipboardData({ | ||
| 145 | + success:(res)=>{ | ||
| 146 | + let match=res.data.match(/¥(.*)¥/); | ||
| 147 | + if(match && res.data.indexOf('订个座儿')>0){ | ||
| 148 | + success(match[1]) | ||
| 149 | + }else{ | ||
| 150 | + fail() | ||
| 151 | + } | ||
| 152 | + }, | ||
| 153 | + fail:()=>{ | ||
| 154 | + fail() | ||
| 155 | + } | ||
| 156 | + }) | ||
| 157 | + }) | ||
| 158 | + } | ||
| 130 | }) | 159 | }) |
| @@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
| 29 | </view> | 29 | </view> |
| 30 | <view class="flex-lr" style="margin-top: 43rpx;"> | 30 | <view class="flex-lr" style="margin-top: 43rpx;"> |
| 31 | <view>用餐人数</view> | 31 | <view>用餐人数</view> |
| 32 | - <view class="detail-info-right">{{detail.pnum}}人</view> | 32 | + <view class="detail-info-right">{{detail.pnum_str}}人</view> |
| 33 | </view> | 33 | </view> |
| 34 | <view class="flex-lr" wx:if="{{detail.cusman}}" | 34 | <view class="flex-lr" wx:if="{{detail.cusman}}" |
| 35 | style="margin-top: 43rpx;" | 35 | style="margin-top: 43rpx;" |
| @@ -30,16 +30,7 @@ Page({ | @@ -30,16 +30,7 @@ Page({ | ||
| 30 | this.selectComponent("#network").refresh(); | 30 | this.selectComponent("#network").refresh(); |
| 31 | return; | 31 | return; |
| 32 | } | 32 | } |
| 33 | - opt.sms_code=''; | ||
| 34 | - try{ | ||
| 35 | - opt.sms_code= await this.getClipboardData(); | ||
| 36 | - wx.setClipboardData({ | ||
| 37 | - data:"?" | ||
| 38 | - }) | ||
| 39 | - console.log('SMS.code',opt.sms_code); | ||
| 40 | - }catch (e){ | ||
| 41 | - console.log('SMS.code.catch',e); | ||
| 42 | - } | 33 | + |
| 43 | let url = '/pages/customer/list'; | 34 | let url = '/pages/customer/list'; |
| 44 | if (opt.id > 0 || opt.sms_code) { | 35 | if (opt.id > 0 || opt.sms_code) { |
| 45 | if(opt.invite_name){ | 36 | if(opt.invite_name){ |
| @@ -147,21 +138,4 @@ Page({ | @@ -147,21 +138,4 @@ Page({ | ||
| 147 | let openid = getApp().openid; | 138 | let openid = getApp().openid; |
| 148 | return openid; | 139 | return openid; |
| 149 | }, | 140 | }, |
| 150 | - getClipboardData(){ | ||
| 151 | - return new Promise((success,fail)=>{ | ||
| 152 | - wx.getClipboardData({ | ||
| 153 | - success:(res)=>{ | ||
| 154 | - let match=res.data.match(/¥(.*)¥/); | ||
| 155 | - if(match && res.data.indexOf('订个座儿')>0){ | ||
| 156 | - success(match[1]) | ||
| 157 | - }else{ | ||
| 158 | - fail() | ||
| 159 | - } | ||
| 160 | - }, | ||
| 161 | - fail:()=>{ | ||
| 162 | - fail() | ||
| 163 | - } | ||
| 164 | - }) | ||
| 165 | - }) | ||
| 166 | - } | ||
| 167 | }) | 141 | }) |
-
Please register or login to post a comment