Commit d16732cc19a3bc7eaae58c1006b2f45a1d03ac6a

Authored by wangfan
1 parent f0ff6b44

v2 customer view

@@ -36,12 +36,15 @@ Component({ @@ -36,12 +36,15 @@ Component({
36 methods: { 36 methods: {
37 init(){ 37 init(){
38 if(this.data.detail && this.data.detail.rdate){ 38 if(this.data.detail && this.data.detail.rdate){
39 - let masterMan=(this.data.detail.rname||'')+' ('  
40 - +this.data.detail.phone  
41 - .replace(/([\d]{2}).*([\d]{4})/,function($0,$1,$2){  
42 - return $1+'*'+$2  
43 - })  
44 - +')'; 39 + let masterMan=(this.data.detail.rname||'');
  40 + if(this.data.detail.phone){
  41 + masterMan+=' ('+
  42 + this.data.detail.phone
  43 + .replace(/([\d]{2}).*([\d]{4})/,function($0,$1,$2){
  44 + return $1+'*'+$2
  45 + })
  46 + +')';
  47 + }
45 this.setData({ 48 this.setData({
46 rdateStr:util.unixtoTime(this.data.detail.rdate,'MM月DD日 HH:II'), 49 rdateStr:util.unixtoTime(this.data.detail.rdate,'MM月DD日 HH:II'),
47 tableSubInfo:(this.data.detail.tableFirst||'')+' '+(this.data.detail.tableSubInfo||''), 50 tableSubInfo:(this.data.detail.tableFirst||'')+' '+(this.data.detail.tableSubInfo||''),
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 {{masterMan}} 38 {{masterMan}}
39 </view> 39 </view>
40 </view> 40 </view>
41 - <view class="seller opt"> 41 + <view>
42 <slot></slot> 42 <slot></slot>
43 </view> 43 </view>
44 </view> 44 </view>
@@ -55,10 +55,10 @@ Page({ @@ -55,10 +55,10 @@ Page({
55 }, 55 },
56 56
57 /** 57 /**
58 - * 页面相关事件处理函数--监听用户下拉动作 58 + * 用户点击右上角分享
59 */ 59 */
60 - onPullDownRefresh: function () {  
61 - 60 + onShareAppMessage: function () {
  61 + return this.shareSetting();
62 }, 62 },
63 getDetail(fouce=false){ 63 getDetail(fouce=false){
64 App.Reserve.Detail({ 64 App.Reserve.Detail({
@@ -120,9 +120,9 @@ Page({ @@ -120,9 +120,9 @@ Page({
120 this.getDetail(true); 120 this.getDetail(true);
121 }) 121 })
122 }else{ 122 }else{
123 - wx.navigateTo({  
124 - url:'invite?id='+this.id,  
125 - }); 123 + // wx.navigateTo({
  124 + // url:'invite?id='+this.id,
  125 + // });
126 } 126 }
127 }, 127 },
128 reserveCancel(){ 128 reserveCancel(){
@@ -133,5 +133,22 @@ Page({ @@ -133,5 +133,22 @@ Page({
133 }).then(res=>{ 133 }).then(res=>{
134 this.getDetail(true); 134 this.getDetail(true);
135 }) 135 })
  136 + },
  137 + shareSetting(){
  138 + console.log('this.topicVal',this.topicVal)
  139 + if(this.topicVal && this.data.detail.openid==getApp().openid){
  140 + App.Reserve.SetTopicFromShare({
  141 + rid:this.id,
  142 + topic:this.topicVal
  143 + })
  144 + }
  145 + let nickname="";
  146 + try{
  147 + nickname=util.cache('userInfo').nickName;
  148 + }catch(e){}
  149 + return {
  150 + title: nickname+'给你发了一个邀请,点击查看',
  151 + path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid+'&invite_name='+nickname,
  152 + }
136 } 153 }
137 }) 154 })
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 "manager": "/components/manager/manager", 7 "manager": "/components/manager/manager",
8 "nav":"/components/nav/nav", 8 "nav":"/components/nav/nav",
9 "card":"/components/seller-card/seller-card", 9 "card":"/components/seller-card/seller-card",
10 - "formids":"/components/formids/formids" 10 + "formids":"/components/formids/formids",
  11 + "userinfo-share": "/components/userinfo/share"
11 } 12 }
12 } 13 }
@@ -16,9 +16,12 @@ @@ -16,9 +16,12 @@
16 <formids url="./remind?id={{detail.id}}&rdate={{detail.rdate}}"> 16 <formids url="./remind?id={{detail.id}}&rdate={{detail.rdate}}">
17 <view class="opt-button">提醒</view> 17 <view class="opt-button">提醒</view>
18 </formids> 18 </formids>
19 - <userinfo binduserinfo="userinfo"> 19 + <userinfo-share
  20 + binduserinfo="userinfo"
  21 + bindshare="share"
  22 + share="{{detail}}">
20 <view class="opt-button">分享日程</view> 23 <view class="opt-button">分享日程</view>
21 - </userinfo> 24 + </userinfo-share>
22 </block> 25 </block>
23 </view> 26 </view>
24 </card> 27 </card>
@@ -130,7 +130,11 @@ @@ -130,7 +130,11 @@
130 font-size: 30rpx; 130 font-size: 30rpx;
131 margin-top: 26rpx; 131 margin-top: 26rpx;
132 } 132 }
133 - 133 +.opt{
  134 + padding: 0 36rpx 36rpx;
  135 + height: 50rpx;
  136 + line-height: 50rpx;
  137 +}
134 .opt .opt-button{ 138 .opt .opt-button{
135 width: 120rpx; 139 width: 120rpx;
136 height: 40rpx; 140 height: 40rpx;