Commit ed7de32dcda18ec90bc726c26da6c7220357f96d

Authored by wangfan
1 parent 3fcd83c5

manager-invitation

... ... @@ -20,6 +20,7 @@ Page({
time:'',
image:'',
},
defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg',
tpl:{},
},
... ... @@ -158,7 +159,7 @@ Page({
},
submit(){
if(!this.checkHasSubmit()){
return util.toast('请完善信息',none)
return util.toast('请等待图片上传完成','none')
}
let opt=this.data.options
let param={
... ... @@ -182,4 +183,38 @@ Page({
})
})
},
chooseImage(){
wx.chooseImage({
count:1,
sizeType:'compressed',
sourceType:'album',
success:res=>{
const tempFilePaths = res.tempFilePaths[0]
this.setData({
defImage:tempFilePaths,
})
wx.uploadFile({
url:util.cgi('App.Examples_Upload.UploadQn'),
filePath:tempFilePaths,
name:'file',
success:upres=>{
try{
upres=JSON.parse(upres.data)
console.log('upres',upres)
if(upres.ret==200){
util.toast('图片上传完成','none')
this.setData({
[`form.image`]:upres.data,
})
}else{
util.toast(upres.msg||'上传出错','none')
}
}catch (e){
util.toast('上传出错','none')
}
}
})
},
})
},
})
\ No newline at end of file
... ...
... ... @@ -37,8 +37,8 @@
</view>
</view>
<view class="upload block flex-vc" wx:if="{{tpl.hasImage}}">
<view class="image">
<image src="http://qn.colorcun.com/manager-invitation/wx/upload2.jpg" mode="aspectFill"></image>
<view class="image" bindtap="chooseImage">
<image src="{{form.image||defImage}}" mode="aspectFill"></image>
</view>
<view class="text">(此处照片为邀请函展示照片)</view>
</view>
... ...
... ... @@ -37,7 +37,16 @@ Page({
},
initData(options){
if(options.rid){
App.Invitation.Detail({id:options.rid}).then(res=>{
this.setData({
seller:{
name:res.data.seller_name,
room:res.data.room_name,
date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr),
addr:res.data.seller_address
}
})
})
}else{
App.Invitation.GetSellerList({
openid:getApp().openid
... ...
... ... @@ -10,7 +10,7 @@
<block wx:for="{{tpls}}" wx:key="tpls.key">
<swiper-item>
<view class="pages bg-{{item.id}} flex-vc" style="height:{{height}}px;">
<template is="tpl-{{item.id}}" data="{{...seller}}"></template>
<template is="tpl-{{item.id}}" data="{{...seller,options}}"></template>
</view>
</swiper-item>
</block>
... ... @@ -30,7 +30,7 @@
<view class="flex-vc shangwu">
<view class="invit-logo">
<image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png"></image>
<view class="quick-editor" wx:if="{{options.rid}}">修改内容</view>
<view class="quick-editor" wx:if="{{options.rid}}" bindtap="goEditor">修改内容</view>
</view>
<view class="seller flex-vc">
<view class="title">餐厅</view>
... ... @@ -58,7 +58,7 @@
<view class="flex-vc wenxin">
<view class="invit-logo">
<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>
<view class="quick-editor" wx:if="{{options.rid}}">修改内容</view>
<view class="quick-editor" wx:if="{{options.rid}}" bindtap="goEditor">修改内容</view>
</view>
<view class="wenxin-mask">
<view class="wenxin-mask-bg"></view>
... ...
... ... @@ -189,6 +189,7 @@ image{
animation-name: butAnimation;
animation-duration: 0.7s;
animation-iteration-count:9999;
position: relative;
}
@keyframes butAnimation
{
... ...
... ... @@ -361,14 +361,14 @@
"id": 43,
"name": "pages/manager-invitation/review",
"pathName": "pages/manager-invitation/review",
"query": "rid=4&tplid=1",
"query": "rid=5&tplid=2",
"scene": null
},
{
"id": 44,
"name": "pages/manager-invitation/editor",
"pathName": "pages/manager-invitation/editor",
"query": "tplid=1",
"query": "tplid=2",
"scene": null
}
]
... ...
... ... @@ -200,4 +200,10 @@ export default {
'App.Invitation.SetInvitationInfo':{
silence: false,
},
//邀请函详情
'App.Invitation.Detail':null,
//上传图片,只能上传单个图片文件
'App.Examples_Upload.UploadQn':null,
}
\ No newline at end of file
... ...