Commit 91dd6dce83ef7d1f29f1cd1a9a07102bd935c5b6

Authored by wangfan
1 parent e8a7c605

fixbug year

... ... @@ -7,6 +7,7 @@
"pages/customer/detail_owner",
"pages/customer/detail_owner_part",
"pages/customer/detail_customer",
"pages/customer/detail_invitation",
"pages/customer/invite",
"pages/customer/list",
"pages/customer/remind",
... ...
... ... @@ -5,6 +5,10 @@ Component({
*/
properties: {
share:Object,
shareAct:{
type:String,
value:'',
},
},
/**
... ...
... ... @@ -5,7 +5,7 @@
</userinfo>
</block>
<block wx:else="">
<button class="button-none" open-type="share" data-id="{{share.id}}" catchtap="share">
<button class="button-none" open-type="share" data-id="{{share.id}}" data-act="{{shareAct}}" catchtap="share">
<slot></slot>
</button>
</block>
\ No newline at end of file
... ...
... ... @@ -71,7 +71,7 @@ Page({
})
},
formatDatail(detail){
detail.rdateStr=util.unixtoTime(detail.rdate,'MM月DD日 WW HH:II');
detail.rdateStr=util.unixtoTime(detail.ddate,'MM月DD日 WW HH:II');
detail.tableFirst=detail.tables[0].name;
if(detail.tables.length>1){
detail.tableSubInfo='等'+(detail.tables.length)+'个'
... ...
// pages/customer/detail_owner.js
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
detail:null,
invite_name:''
},
id:null,
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.id=options.id;
let invite_names=wx.getStorageSync('invite_names') ||{};
let invite_name=invite_names[options.id];
if(invite_name){
this.setData({
invite_name:invite_name
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getDetail();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return this.shareSetting();
},
getDetail(fouce=false){
App.Reserve.Detail({
openid: getApp().openid,
rid: this.id
},fouce).then(res => {
this.setData({
detail:this.formatDatail(res.data)
})
})
},
formatDatail(detail){
detail.rdateStr=util.unixtoTime(detail.ddate,'YYYY/MM/DD 星期WW HH:II');
detail.tableFirst=detail.tables[0].name;
if(detail.tables.length>1){
detail.tableSubInfo='等'+(detail.tables.length)+'个'
+(detail.tables[0].tid==2?'包间':'');
}
if(detail.sex!=3){
detail.rnameStr=detail.rname.substr(0,1)+(detail.sex==1?'先生':'女士')
}else{
detail.rnameStr=detail.rname
}
detail.eatStr='邀请您共进晚餐';
let hi=util.unixtoTime(detail.ddate,'HHII');
if(hi<'10:00'){
detail.eatStr='邀请您共进早餐';
}else if(hi<'15:00'){
detail.eatStr='邀请您共进午餐';
}
// if(!detail.cusman){
// detail.cusman='vking';
// detail.cusman_phone='15877556369';
// detail.cusman_account='wx:vking';
// }
detail.hasCanSuccess=false;
if(detail.customers.length>0){
let openid=getApp().openid;
detail.customers.forEach(item=>{
if(openid==item.openid){
detail.hasCanSuccess=true;
detail.remindtime=item.remind_date;
return true;
}
})
}
return detail;
},
showManager(){
if(this.data.detail.cusman_phone || this.data.detail.cusman_account){
this.selectComponent('#manager').show();
}
},
lookLocation:function(){
wx.openLocation({
latitude:Number(this.data.detail.seller.lat),
longitude:Number(this.data.detail.seller.long),
scale:17,
address:this.data.detail.seller.map_address,
success:function (res) {
console.log(res)
}
})
},
userinfo(){
if(!this.data.detail.hasCanSuccess){
let userInfo=util.cache('userInfo');
if(userInfo){
userInfo=JSON.stringify({
openid: getApp().openid,
avatar: userInfo.avatarUrl,
nickname: userInfo.nickName,
gender: userInfo.gender
})
}
App.Reserve.SetRelaSuccess({
rid:this.id,
openid:getApp().openid,
is_agree:1,
userinfo:userInfo
}).then(res=>{
App.Reserve.Detail({
openid: getApp().openid,
rid: this.id
},'clear')
wx.navigateTo({
//id={{detail.id}}&rdate={{detail.rdate}}
url:'remind?id='+this.id+'&rdate='+this.data.detail.rdate,
});
})
}else{
// wx.navigateTo({
// url:'invite?id='+this.id,
// });
}
},
reserveCancel(){
let userInfo = util.cache('userInfo');
if (userInfo) {
userInfo = JSON.stringify({
openid: getApp().openid,
avatar: userInfo.avatarUrl,
nickname: userInfo.nickName,
gender: userInfo.gender
})
}
App.Reserve.SetRelaSuccess({
rid: this.id,
openid: getApp().openid,
cancel: 'cancel',
is_agree: 0,
userinfo: userInfo
}).then(res => {
this.getDetail(true);
})
},
shareSetting(){
console.log('this.topicVal',this.topicVal)
if(this.topicVal && this.data.detail.openid==getApp().openid){
App.Reserve.SetTopicFromShare({
rid:this.id,
topic:this.topicVal
})
}
let nickname="";
try{
nickname=util.cache('userInfo').nickName;
}catch(e){}
return {
title: (nickname||'')+'给你发了一个邀请,点击查看',
path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid+'&invite_name='+nickname,
imageUrl:util.cgi('App.Reserve.MakePic&rid=')+this.id,
}
}
})
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText":"订座详情",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"manager": "/components/manager/manager",
"nav":"/components/nav/nav",
"card":"/components/seller-card/seller-card",
"formids":"/components/formids/formids",
"userinfo-share": "/components/userinfo/share"
}
}
\ No newline at end of file
... ...
<!--pages/customer/detail_owner.wxml-->
<view class="page flex-vc">
<view class="invit-logo">
<image src="http://qn.colorcun.com/custom/lite-yd/image/invit-logo.png"></image>
</view>
<view class="avatar">
<image src="{{detail.customers[0].headimgurl}}"></image>
</view>
<view class="invit flex-cc">
<view style="margin-right: 20rpx;">{{detail.rnameStr}}</view>
<view>{{detail.eatStr}}</view>
</view>
<view class="hr-one"></view>
<view class="seller flex-vc">
<view class="title">餐厅</view>
<view class="content name">{{detail.seller.sellername}}</view>
<view class="title">包间</view>
<view class="content">{{detail.tableFirst}}{{detail.tableSubInfo}}</view>
<view class="title">时间</view>
<view class="content">{{detail.rdateStr}}</view>
<view class="title">地址</view>
<view class="content flex-ll" bindtap="lookLocation">
<image src="http://qn.colorcun.com/custom/lite-yd/image/invit-addr.png" class="invit-addr"></image>
<view>{{detail.seller.real_address}}</view>
</view>
</view>
<view class="opt flex-cc">
<view class="but">餐厅详情</view>
<view class="but" bindtap="lookLocation">一键导航</view>
</view>
</view>
... ...
/* pages/customer/detail_customer.wxss */
.page{
color:#FFFFFF;
background: url("http://qn.colorcun.com/custom/lite-yd/image/invit-bg.png") #353334;
}
image{
width: 100%;
height: 100%;
}
.invit-logo{
width: 352rpx;
height: 164rpx;
margin-top: 156rpx;
}
.avatar{
width: 88rpx;
height: 88rpx;
border-radius: 50%;
margin-top: 50rpx;
margin-bottom: 22rpx;
overflow: hidden;
}
.invit{
font-size: 26rpx;
color:#FDFCFD;
}
.hr-one{
margin-top: 50rpx;
margin-bottom: 54rpx;
height: 2rpx;
background-color: #999999;
width: 90%;
}
.seller{
}
.seller .title{
font-size: 26rpx;
color:#999999;
margin-bottom: 30rpx;
}
.seller .content{
margin-bottom: 30rpx;
font-size: 30rpx;
line-height: 30rpx;
}
.seller .name{
font-size: 42rpx;
line-height: 42rpx;
}
.invit-addr{
width: 20rpx;
height: 20rpx;
margin-right: 18rpx;
}
.opt{
margin-bottom: 180rpx;
margin-top: 52rpx;
}
.opt .but{
width: 330rpx;
height: 70rpx;
border: 2rpx solid #ECD9B7;
border-radius: 6rpx;
line-height: 70rpx;
text-align: center;
font-size: 30rpx;
color:#ECD9B7;
margin-right: 20rpx;
}
.opt .but:last-child{
margin-right: 0;
}
... ...
... ... @@ -56,9 +56,9 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function (e) {
console.log('onShareAppMessage',arguments)
return this.shareSetting();
return this.shareSetting(e);
},
formatDatail(detail){
detail.rdateStr=util.unixtoTime(detail.ddate,'MM月DD日 WW HH:II');
... ... @@ -96,22 +96,29 @@ Page({
// url:'invite?id='+this.id,
// });
},
shareSetting(){
console.log('this.topicVal',this.topicVal)
if(this.topicVal && this.data.detail.openid==getApp().openid){
App.Reserve.SetTopicFromShare({
rid:this.id,
topic:this.topicVal
})
}
let nickname="";
try{
nickname=util.cache('userInfo').nickName;
}catch(e){}
return {
title: (nickname||'')+'给你发了一个邀请,点击查看',
path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid+'&invite_name='+nickname,
imageUrl:util.cgi('App.Reserve.MakePic&rid=')+this.id,
}
shareSetting(e){
console.log('shareSetting',e.target.dataset);
let hasInvitation=e.target.dataset.act=='invitation';
if (this.topicVal && this.data.detail.openid == getApp().openid) {
App.Reserve.SetTopicFromShare({
rid: this.id,
topic: this.topicVal
})
}
let nickname = "";
try {
nickname = util.cache('userInfo').nickName;
} catch (e) {
}
let obj={
title: (nickname || '') + '给你发了一个邀请,点击查看',
path: '/pages/customer/index?id=' + this.id + '&fromid=' + getApp().openid + '&invite_name=' + nickname,
imageUrl: util.cgi('App.Reserve.MakePic&rid=') + this.id,
}
if(hasInvitation){
obj.title=(nickname || '') + '给你发了一个邀请函,点击查看';
obj.path=obj.path+'&hasInvitation=1';
}
return obj;
}
})
\ No newline at end of file
... ...
... ... @@ -13,13 +13,24 @@
<view class="info">分享订座信息给朋友,及时获知朋友们的反馈</view>
</block>
</view>
<userinfo-share wx:if="{{!detail.hasOvered}}"
binduserinfo="userinfo"
bindshare="share"
share="{{detail}}"
class="share-but-view">
<view class="share-but Regular">邀请同行的朋友</view>
</userinfo-share>
<view class="flex-lr share-view">
<userinfo-share wx:if="{{!detail.hasOvered}}"
binduserinfo="userinfo"
bindshare="share"
share="{{detail}}"
share-act=""
class="share-but-view">
<view class="share-but Regular">邀请朋友</view>
</userinfo-share>
<userinfo-share wx:if="{{!detail.hasOvered}}"
binduserinfo="userinfo"
bindshare="share"
share="{{detail}}"
share-act="invitation"
class="share-but-view">
<view class="share-but Regular">发邀请函</view>
</userinfo-share>
</view>
<view style="height: 40rpx;"></view>
<card seller="{{detail.seller}}" detail="{{detail}}"></card>
<view class="detail-info Medium" style="margin-top: 56rpx;">
... ...
... ... @@ -23,18 +23,30 @@
color:#999999
}
.share-but-view{
display: block;
width: 49%;
border-right:2rpx solid #262628;
height:60rpx;
line-height: 60rpx;
}
.share-but-view:last-child{
border-width: 0;
}
.share-view{
margin-top: 58rpx;
margin-bottom: 20rpx;
display: block;
height:80rpx;
line-height: 80rpx;
font-size: 34rpx;
border:2rpx solid #262628;
color:#262628;
width: 100%;
}
.share-but{
color:#FEFEFE;
background: #262628;
width: 100%;
line-height: 80rpx;
font-size: 34rpx;
text-align: center;
}
.seller{
height: 84rpx;
}
... ...
... ... @@ -81,6 +81,9 @@ Page({
url = '/pages/customer/detail_owner';
} else {
url = '/pages/customer/detail_customer';
if(opt.hasInvitation==1){
url = '/pages/customer/detail_invitation';
}
if (res.data.openid == opt.openid) {
url = '/pages/customer/detail_owner';
}
... ...
... ... @@ -73,7 +73,7 @@
"id": 6,
"name": "pages/customer/index",
"pathName": "pages/customer/index",
"query": "id=1156",
"query": "id=1196&fromid=1111&hasInvitation=1",
"scene": "1044",
"shareInfo": {
"groupName": "测试模拟群1",
... ... @@ -91,7 +91,7 @@
"id": 8,
"name": "邀请进入 pages/customer/index",
"pathName": "pages/customer/index",
"query": "id=64&fromid=test",
"query": "id=1196&fromid=test",
"scene": "1001"
},
{
... ...