Commit 1d4081ff90a7384ed6cc7be2044b22067df1ef40

Authored by wangfan
1 parent a2bd203f

seller-Invitation

... ... @@ -21,13 +21,13 @@ Component({
detail:function(e){
var obj=this.data.vitem;
wx.navigateTo({
url:util.http_build_query(obj,'b_detail')
url:util.http_build_query({id:obj.id},'b_detail')
})
},
invitation:function(e){
var obj=this.data.vitem;
wx.navigateTo({
url:util.http_build_query(obj,'b_invitation')
url:util.http_build_query({id:obj.id},'b_invitation')
})
},
changeitem:function () {
... ...
... ... @@ -47,7 +47,7 @@ Page({
//title: (nickname||'')+'给你发送了一个订座信息,点击查看详情',
title: '点击查看详情,发邀请函',
path: path+'&hasInvitation=1&hasSellerShare=1',
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg',
imageUrl:'http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E5%AE%9A%E5%AE%89%E6%8E%92-%E5%95%86%E5%8A%A1.jpg',
success: function (res) {
console.log(res,666666)
},
... ...
... ... @@ -13,67 +13,48 @@ Page({
current: 0,
tpls: TP.tpls(),
seller:{
name:'一键订示例餐厅',
room:'天香阁',
name:'',
room:'',
date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'),
addr:'粤江西路啤酒文化创意艺术区B09',
addr:'',
hasOwner:true,
},
options:{},
},
detail:{},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
options.tplid=options.tplid||1;
let param={
options:options,
}
if(options.rid){
if(true){
param.tpls=[TP.tpls(options.tplid)]
}
this.setData(param)
this.initData(options);
},
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,
image:res.data.image_url,
hasOwner:true,
}
})
App.Reserve.Detail({rid:options.id,openid:''}).then(res=>{
this.detail=res.data;
let tables=[];
res.data.tables.forEach(t=>{
tables.push(t.name);
})
}else{
App.Invitation.GetSellerList({
openid:getApp().openid
}).then(res=>{
if(res.data.length>0){
let defi=0;
for(let i=0;i<res.data.length;i++){
if(res.data[i].is_default==1){
defi=i;
break;
}
}
let sel=res.data[defi];
this.setData({
seller:{
name:sel.name,
room:'',
date:util.unixtoTime(new Date()/1000,this.data.tpls[this.data.current].timeStr),
addr:sel.address,
hasOwner:true,
}
})
this.setData({
seller:{
name:res.data.seller.sellername,
room:tables.join('、'),
date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr),
addr:res.data.seller.real_address||res.data.seller.map_address,
image:res.data.image_url,
hasOwner:true,
}
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
... ... @@ -141,14 +122,8 @@ Page({
...this.data.options,
fromid:getApp().openid,
hasSellerShare:1,
hasInvitation:1,
},'/pages/manager-invitation/display')
if(!this.data.options.rid){
return {
title: '一键订,客户经理专用的拓客工具',
path: '/pages/manager-invitation/index',
imageUrl:this.data.tpls[this.data.current].shareFirstImage,
}
}
return {
title: '点击查看详情,发邀请函',
path: path,
... ... @@ -169,13 +144,21 @@ Page({
[`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
})
},
goEditor(){
let param={
...this.data.options,
tplid:this.data.tpls[this.data.current].id,
sendmsg(){
if (!this.detail.phone) {
util.toast('未填写手机号码', 'none')
return;
} else if (!/^1\d{10}$/.test(this.detail.phone)) {
util.toast('手机号码错误', 'none')
return;
}
wx.navigateTo({
url:util.http_build_query(param,'./editor')
})
url: '/pages/book/b_sms?id=' + this.detail.id
});
},
gotoDetail(){
wx.redirectTo({
url: '/pages/book/b_detail?id=' + this.detail.id
});
}
})
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
"formids":"/components/formids/formids",
"userinfo-share": "/components/userinfo/share"
}
}
\ No newline at end of file
... ...
... ... @@ -15,17 +15,28 @@
</swiper-item>
</block>
</swiper>
<view wx:if="{{!options.rid}}"
class="flex-vc"
<view class="flex-vc"
style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;">
<view class="tabs flex-ll">
<block wx:for="{{tpls}}" wx:key="tpls.key">
<formids class="back" bindclick="gotoDetail" >
<view style="min-width: 100rpx;" class="flex-ll">
<image class="back-image"
src="http://qn.colorcun.com/custom/lite-yd/image/back-light.png"></image>
</view>
</formids>
<block wx:if="{{false}}" wx:for="{{tpls}}" wx:key="tpls.key">
<view class="item {{index==current?'active':''}}" bindtap="switchTabs" data-current="{{index}}">{{item.name}}</view>
</block>
</view>
</view>
<nav wx:else="" backgroundColor="rgba(0,0,0,0)" style="position: fixed;"></nav>
<view class="bottom flex-lr">
<formids bindclick="sendmsg" class="sendmsg">
发短信
</formids>
<userinfo-share binduserinfo="share" class="share Semibold">
通知客户
</userinfo-share>
</view>
<!--//商务-->
<template name="tpl-1">
<view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}">
... ...
... ... @@ -23,4 +23,33 @@
image{
width: 100%;
height: 100%;
}
.back{
margin-left: 40rpx;
}
.back-image{
height: 32rpx;
width: 18rpx;
}
.bottom{
position: fixed;
bottom: 0;
height: 98rpx;
line-height: 98rpx;
border-top: 2rpx solid #ECD9B7;
background-color: #ECD9B7;
width: 100%;
}
.bottom .sendmsg{
background-color: #262628;
width: 30%;
min-width: 30%;
color: #ECD9B7;
font-size: 30rpx;
}
.bottom .share{
text-align: center;
width: 70%;
font-size: 36rpx;
color: #794F28;
}
\ No newline at end of file
... ...