Showing
4 changed files
with
64 additions
and
10 deletions
| @@ -162,4 +162,35 @@ Page({ | @@ -162,4 +162,35 @@ Page({ | ||
| 162 | console.log(this.data.form) | 162 | console.log(this.data.form) |
| 163 | this.getbooklist(); | 163 | this.getbooklist(); |
| 164 | }, | 164 | }, |
| 165 | + exportFile(){ | ||
| 166 | + App.Reserve.ExportReserve().then(res=>{ | ||
| 167 | + let url=res.data; | ||
| 168 | + wx.downloadFile({ | ||
| 169 | + url: url, | ||
| 170 | + success: function(res) { | ||
| 171 | + const filePath = res.tempFilePath; | ||
| 172 | + console.log('filePath',filePath); | ||
| 173 | + wx.saveFile({ | ||
| 174 | + tempFilePath: filePath, | ||
| 175 | + success (res) { | ||
| 176 | + const savedFilePath = res.savedFilePath; | ||
| 177 | + console.log('savedFilePath',savedFilePath); | ||
| 178 | + wx.openDocument({ | ||
| 179 | + filePath: savedFilePath, | ||
| 180 | + fileType:'xls', | ||
| 181 | + success: function(res) { | ||
| 182 | + console.log('打开文档成功') | ||
| 183 | + }, | ||
| 184 | + fail(e){ | ||
| 185 | + console.log('打开文档失败',e) | ||
| 186 | + }, | ||
| 187 | + }) | ||
| 188 | + } | ||
| 189 | + }) | ||
| 190 | + | ||
| 191 | + } | ||
| 192 | + }) | ||
| 193 | + }); | ||
| 194 | + | ||
| 195 | + }, | ||
| 165 | }) | 196 | }) |
| @@ -2,9 +2,15 @@ | @@ -2,9 +2,15 @@ | ||
| 2 | <view class="page"> | 2 | <view class="page"> |
| 3 | <block wx:if="{{isloading==true}}"> | 3 | <block wx:if="{{isloading==true}}"> |
| 4 | <view class="book-page bg_white"> | 4 | <view class="book-page bg_white"> |
| 5 | - <view class="book-search flex-ll"> | ||
| 6 | - <image src="../image/search.png" class="search-icon"></image> | ||
| 7 | - <input placeholder="桌位·预定人姓名·手机号" placeholder-class="font30r gray-font smooth" class="font30r black-font smooth search-input" value="{{keywords}}" bindinput="searchinput" confirm-type="search" bindconfirm="searchbook"/> | 5 | + <view class="book-search flex-lr"> |
| 6 | + <view class="flex-ll book-search-left"> | ||
| 7 | + <image src="../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"/> | ||
| 9 | + </view> | ||
| 10 | + <view bindtap="exportFile" class="exportFile flex-vc"> | ||
| 11 | + <image src="../image/export.png" class="search-icon"></image> | ||
| 12 | + <view>导出</view> | ||
| 13 | + </view> | ||
| 8 | </view> | 14 | </view> |
| 9 | <view class="search-easy flex-lr"> | 15 | <view class="search-easy flex-lr"> |
| 10 | <formids class="block flex-vc" bindtap="calendarShow"> | 16 | <formids class="block flex-vc" bindtap="calendarShow"> |
| @@ -34,7 +40,7 @@ | @@ -34,7 +40,7 @@ | ||
| 34 | <nothingBook height="{{listHeight}}"></nothingBook> | 40 | <nothingBook height="{{listHeight}}"></nothingBook> |
| 35 | </block> | 41 | </block> |
| 36 | <block wx:else> | 42 | <block wx:else> |
| 37 | - <view class="book-list-cut flex-ll font26r black-font"> | 43 | + <view class="book-list-cut flex-lr font26r black-font"> |
| 38 | <text>已定 {{bookList.length}}</text> | 44 | <text>已定 {{bookList.length}}</text> |
| 39 | </view> | 45 | </view> |
| 40 | <view bindcsroll="onPullDownRefresh" class="bg_white"> | 46 | <view bindcsroll="onPullDownRefresh" class="bg_white"> |
| @@ -10,12 +10,17 @@ page{ | @@ -10,12 +10,17 @@ page{ | ||
| 10 | padding-top:20rpx; | 10 | padding-top:20rpx; |
| 11 | } | 11 | } |
| 12 | .book-search{ | 12 | .book-search{ |
| 13 | - width:590rpx; | 13 | + width:675rpx; |
| 14 | height:80rpx; | 14 | height:80rpx; |
| 15 | - border-radius:40rpx; | ||
| 16 | - box-shadow: 0 0 8px #ccc; | ||
| 17 | - margin:0 auto; | ||
| 18 | - margin-bottom:10rpx; | 15 | + margin:0 auto; |
| 16 | +} | ||
| 17 | +.book-search-left{ | ||
| 18 | + width:590rpx; | ||
| 19 | + height:80rpx; | ||
| 20 | + border-radius:40rpx; | ||
| 21 | + box-shadow: 0 0 8px #ccc; | ||
| 22 | + margin:0 auto; | ||
| 23 | + margin-bottom:10rpx; | ||
| 19 | } | 24 | } |
| 20 | .search-icon{ | 25 | .search-icon{ |
| 21 | width:40rpx; | 26 | width:40rpx; |
| @@ -124,4 +129,13 @@ page{ | @@ -124,4 +129,13 @@ page{ | ||
| 124 | .calendar-board { | 129 | .calendar-board { |
| 125 | background-color: #dddcff; | 130 | background-color: #dddcff; |
| 126 | color: white; | 131 | color: white; |
| 132 | +} | ||
| 133 | +.exportFile{ | ||
| 134 | + font-size: 26rpx; | ||
| 135 | + color:#353535; | ||
| 136 | +} | ||
| 137 | +.exportFile image{ | ||
| 138 | + width: 32rpx; | ||
| 139 | + height: 32rpx; | ||
| 140 | + margin: 0 auto 8rpx; | ||
| 127 | } | 141 | } |
| @@ -77,6 +77,9 @@ export default { | @@ -77,6 +77,9 @@ export default { | ||
| 77 | //商户端账号表增加订座儿openid | 77 | //商户端账号表增加订座儿openid |
| 78 | 'App.Reserve.UpdateSellerUser':{ | 78 | 'App.Reserve.UpdateSellerUser':{ |
| 79 | cachetime:86400, | 79 | cachetime:86400, |
| 80 | - } | 80 | + }, |
| 81 | + | ||
| 82 | + //导出 | ||
| 83 | + 'App.Reserve.ExportReserve':null, | ||
| 81 | 84 | ||
| 82 | } | 85 | } |
-
Please register or login to post a comment