Showing
7 changed files
with
60 additions
and
9 deletions
| @@ -20,6 +20,7 @@ Page({ | @@ -20,6 +20,7 @@ Page({ | ||
| 20 | time:'', | 20 | time:'', |
| 21 | image:'', | 21 | image:'', |
| 22 | }, | 22 | }, |
| 23 | + defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg', | ||
| 23 | tpl:{}, | 24 | tpl:{}, |
| 24 | }, | 25 | }, |
| 25 | 26 | ||
| @@ -158,7 +159,7 @@ Page({ | @@ -158,7 +159,7 @@ Page({ | ||
| 158 | }, | 159 | }, |
| 159 | submit(){ | 160 | submit(){ |
| 160 | if(!this.checkHasSubmit()){ | 161 | if(!this.checkHasSubmit()){ |
| 161 | - return util.toast('请完善信息',none) | 162 | + return util.toast('请等待图片上传完成','none') |
| 162 | } | 163 | } |
| 163 | let opt=this.data.options | 164 | let opt=this.data.options |
| 164 | let param={ | 165 | let param={ |
| @@ -182,4 +183,38 @@ Page({ | @@ -182,4 +183,38 @@ Page({ | ||
| 182 | }) | 183 | }) |
| 183 | }) | 184 | }) |
| 184 | }, | 185 | }, |
| 186 | + chooseImage(){ | ||
| 187 | + wx.chooseImage({ | ||
| 188 | + count:1, | ||
| 189 | + sizeType:'compressed', | ||
| 190 | + sourceType:'album', | ||
| 191 | + success:res=>{ | ||
| 192 | + const tempFilePaths = res.tempFilePaths[0] | ||
| 193 | + this.setData({ | ||
| 194 | + defImage:tempFilePaths, | ||
| 195 | + }) | ||
| 196 | + wx.uploadFile({ | ||
| 197 | + url:util.cgi('App.Examples_Upload.UploadQn'), | ||
| 198 | + filePath:tempFilePaths, | ||
| 199 | + name:'file', | ||
| 200 | + success:upres=>{ | ||
| 201 | + try{ | ||
| 202 | + upres=JSON.parse(upres.data) | ||
| 203 | + console.log('upres',upres) | ||
| 204 | + if(upres.ret==200){ | ||
| 205 | + util.toast('图片上传完成','none') | ||
| 206 | + this.setData({ | ||
| 207 | + [`form.image`]:upres.data, | ||
| 208 | + }) | ||
| 209 | + }else{ | ||
| 210 | + util.toast(upres.msg||'上传出错','none') | ||
| 211 | + } | ||
| 212 | + }catch (e){ | ||
| 213 | + util.toast('上传出错','none') | ||
| 214 | + } | ||
| 215 | + } | ||
| 216 | + }) | ||
| 217 | + }, | ||
| 218 | + }) | ||
| 219 | + }, | ||
| 185 | }) | 220 | }) |
| @@ -37,8 +37,8 @@ | @@ -37,8 +37,8 @@ | ||
| 37 | </view> | 37 | </view> |
| 38 | </view> | 38 | </view> |
| 39 | <view class="upload block flex-vc" wx:if="{{tpl.hasImage}}"> | 39 | <view class="upload block flex-vc" wx:if="{{tpl.hasImage}}"> |
| 40 | - <view class="image"> | ||
| 41 | - <image src="http://qn.colorcun.com/manager-invitation/wx/upload2.jpg" mode="aspectFill"></image> | 40 | + <view class="image" bindtap="chooseImage"> |
| 41 | + <image src="{{form.image||defImage}}" mode="aspectFill"></image> | ||
| 42 | </view> | 42 | </view> |
| 43 | <view class="text">(此处照片为邀请函展示照片)</view> | 43 | <view class="text">(此处照片为邀请函展示照片)</view> |
| 44 | </view> | 44 | </view> |
| @@ -37,7 +37,16 @@ Page({ | @@ -37,7 +37,16 @@ Page({ | ||
| 37 | }, | 37 | }, |
| 38 | initData(options){ | 38 | initData(options){ |
| 39 | if(options.rid){ | 39 | if(options.rid){ |
| 40 | - | 40 | + App.Invitation.Detail({id:options.rid}).then(res=>{ |
| 41 | + this.setData({ | ||
| 42 | + seller:{ | ||
| 43 | + name:res.data.seller_name, | ||
| 44 | + room:res.data.room_name, | ||
| 45 | + date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr), | ||
| 46 | + addr:res.data.seller_address | ||
| 47 | + } | ||
| 48 | + }) | ||
| 49 | + }) | ||
| 41 | }else{ | 50 | }else{ |
| 42 | App.Invitation.GetSellerList({ | 51 | App.Invitation.GetSellerList({ |
| 43 | openid:getApp().openid | 52 | openid:getApp().openid |
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | <block wx:for="{{tpls}}" wx:key="tpls.key"> | 10 | <block wx:for="{{tpls}}" wx:key="tpls.key"> |
| 11 | <swiper-item> | 11 | <swiper-item> |
| 12 | <view class="pages bg-{{item.id}} flex-vc" style="height:{{height}}px;"> | 12 | <view class="pages bg-{{item.id}} flex-vc" style="height:{{height}}px;"> |
| 13 | - <template is="tpl-{{item.id}}" data="{{...seller}}"></template> | 13 | + <template is="tpl-{{item.id}}" data="{{...seller,options}}"></template> |
| 14 | </view> | 14 | </view> |
| 15 | </swiper-item> | 15 | </swiper-item> |
| 16 | </block> | 16 | </block> |
| @@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
| 30 | <view class="flex-vc shangwu"> | 30 | <view class="flex-vc shangwu"> |
| 31 | <view class="invit-logo"> | 31 | <view class="invit-logo"> |
| 32 | <image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png"></image> | 32 | <image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png"></image> |
| 33 | - <view class="quick-editor" wx:if="{{options.rid}}">修改内容</view> | 33 | + <view class="quick-editor" wx:if="{{options.rid}}" bindtap="goEditor">修改内容</view> |
| 34 | </view> | 34 | </view> |
| 35 | <view class="seller flex-vc"> | 35 | <view class="seller flex-vc"> |
| 36 | <view class="title">餐厅</view> | 36 | <view class="title">餐厅</view> |
| @@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
| 58 | <view class="flex-vc wenxin"> | 58 | <view class="flex-vc wenxin"> |
| 59 | <view class="invit-logo"> | 59 | <view class="invit-logo"> |
| 60 | <image src="http://qn.colorcun.com/manager-invitation/wx/%E6%B8%A9%E9%A6%A8-%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png"></image> | 60 | <image src="http://qn.colorcun.com/manager-invitation/wx/%E6%B8%A9%E9%A6%A8-%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png"></image> |
| 61 | - <view class="quick-editor" wx:if="{{options.rid}}">修改内容</view> | 61 | + <view class="quick-editor" wx:if="{{options.rid}}" bindtap="goEditor">修改内容</view> |
| 62 | </view> | 62 | </view> |
| 63 | <view class="wenxin-mask"> | 63 | <view class="wenxin-mask"> |
| 64 | <view class="wenxin-mask-bg"></view> | 64 | <view class="wenxin-mask-bg"></view> |
| @@ -189,6 +189,7 @@ image{ | @@ -189,6 +189,7 @@ image{ | ||
| 189 | animation-name: butAnimation; | 189 | animation-name: butAnimation; |
| 190 | animation-duration: 0.7s; | 190 | animation-duration: 0.7s; |
| 191 | animation-iteration-count:9999; | 191 | animation-iteration-count:9999; |
| 192 | + position: relative; | ||
| 192 | } | 193 | } |
| 193 | @keyframes butAnimation | 194 | @keyframes butAnimation |
| 194 | { | 195 | { |
| @@ -361,14 +361,14 @@ | @@ -361,14 +361,14 @@ | ||
| 361 | "id": 43, | 361 | "id": 43, |
| 362 | "name": "pages/manager-invitation/review", | 362 | "name": "pages/manager-invitation/review", |
| 363 | "pathName": "pages/manager-invitation/review", | 363 | "pathName": "pages/manager-invitation/review", |
| 364 | - "query": "rid=4&tplid=1", | 364 | + "query": "rid=5&tplid=2", |
| 365 | "scene": null | 365 | "scene": null |
| 366 | }, | 366 | }, |
| 367 | { | 367 | { |
| 368 | "id": 44, | 368 | "id": 44, |
| 369 | "name": "pages/manager-invitation/editor", | 369 | "name": "pages/manager-invitation/editor", |
| 370 | "pathName": "pages/manager-invitation/editor", | 370 | "pathName": "pages/manager-invitation/editor", |
| 371 | - "query": "tplid=1", | 371 | + "query": "tplid=2", |
| 372 | "scene": null | 372 | "scene": null |
| 373 | } | 373 | } |
| 374 | ] | 374 | ] |
| @@ -200,4 +200,10 @@ export default { | @@ -200,4 +200,10 @@ export default { | ||
| 200 | 'App.Invitation.SetInvitationInfo':{ | 200 | 'App.Invitation.SetInvitationInfo':{ |
| 201 | silence: false, | 201 | silence: false, |
| 202 | }, | 202 | }, |
| 203 | + | ||
| 204 | + //邀请函详情 | ||
| 205 | + 'App.Invitation.Detail':null, | ||
| 206 | + | ||
| 207 | + //上传图片,只能上传单个图片文件 | ||
| 208 | + 'App.Examples_Upload.UploadQn':null, | ||
| 203 | } | 209 | } |
-
Please register or login to post a comment