Commit 7eac5b19c0ef507115d13b74d9b5cdb4922f0d7b

Authored by wangfan
1 parent a5944268

v2 发起人页面及组件

@@ -211,4 +211,18 @@ image{ @@ -211,4 +211,18 @@ image{
211 211
212 .Medium{ 212 .Medium{
213 font-weight: 400; 213 font-weight: 400;
  214 +}
  215 +.button-none {
  216 + display: inline-block;
  217 + padding-left: 0;
  218 + padding-right: 0;
  219 + box-sizing: border-box;
  220 + font-size: inherit;
  221 + text-align: center;
  222 + text-decoration: none;
  223 + line-height: inherit;
  224 + -webkit-tap-highlight-color: transparent;
  225 + color: inherit;
  226 + width:100%;
  227 + border-radius: 0;
214 } 228 }
  1 +// components/seller-card/seller-card.js
  2 +import util from '../../utils/util';
  3 +Component({
  4 + /**
  5 + * 组件的属性列表
  6 + */
  7 + properties: {
  8 + seller:Object,
  9 + detail:{
  10 + type:Object,
  11 + value:{},
  12 + observer:function(){
  13 + console.log('observer',arguments);
  14 + this.init();
  15 + }
  16 + },
  17 + },
  18 +
  19 + /**
  20 + * 组件的初始数据
  21 + */
  22 + data: {
  23 + rdateStr:"",
  24 + tableSubInfo:"",
  25 + },
  26 + attached(){
  27 +
  28 + },
  29 + detached(){
  30 +
  31 + },
  32 + /**
  33 + * 组件的方法列表
  34 + */
  35 + methods: {
  36 + init(){
  37 + if(this.data.detail && this.data.detail.rdate){
  38 + this.setData({
  39 + rdateStr:util.unixtoTime(this.data.detail.rdate,'MM月DD日 HH:II'),
  40 + tableSubInfo:this.data.detail.tableFirst+' '+this.data.detail.tableSubInfo,
  41 + })
  42 + }
  43 + }
  44 + }
  45 +})
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
  1 +<!--components/seller-card/seller-card.wxml-->
  2 +<view class="card">
  3 + <view class="seller flex-lr">
  4 + <view class="flex-ll">
  5 + <view class="avatar">
  6 + <image src="{{seller.seller_image}}"></image>
  7 + </view>
  8 + <view class="name Medium">{{seller.sellername}}</view>
  9 + </view>
  10 + <view class="more">
  11 + <image src="/pages/image/click.png"></image>
  12 + </view>
  13 + </view>
  14 + <view class="context flex-lr">
  15 + <view class="left info Medium">
  16 + <view class="label">时间</view>
  17 + <view class="value">{{rdateStr}}</view>
  18 + </view>
  19 + <view class="line"></view>
  20 + <view class="right info Medium">
  21 + <view class="label">包间</view>
  22 + <view class="value">{{tableSubInfo}}</view>
  23 + </view>
  24 + </view>
  25 + <view class="seller address flex-ll">
  26 + <view class="gps-icon">
  27 + <image src="/pages/image/gps-icon.png"></image>
  28 + </view>
  29 + <view>
  30 + {{seller.map_address}}
  31 + </view>
  32 + </view>
  33 + <view class="opt"></view>
  34 +</view>
  1 +/* components/seller-card/seller-card.wxss */
  2 +@import "../../app.wxss";
  3 +.card{
  4 + border-radius: 10rpx;
  5 + box-shadow: 2rpx 2rpx 14rpx 6rpx rgba(231,228,228,.5);
  6 +}
  7 +.seller{
  8 + padding: 36rpx;
  9 + height: 50rpx;
  10 + line-height: 50rpx;
  11 +}
  12 +.seller .avatar{
  13 + width: 60rpx;
  14 + height: 60rpx;
  15 + min-width: 60rpx;
  16 + border-radius: 50%;
  17 +}
  18 +.seller .more{
  19 + width: 14rpx;
  20 + height: 26rpx;
  21 + min-width: 14rpx;
  22 +
  23 +}
  24 +.seller image{
  25 + width: 100%;
  26 + height: 100%;
  27 + display: inherit;
  28 +}
  29 +.seller .name{
  30 + font-size: 36rpx;
  31 + margin-left: 20rpx;
  32 + color:#AD7644;
  33 +}
  34 +
  35 +.context{
  36 + background-color: #E6EBEE;
  37 + width: 100%;
  38 + padding: 30rpx 0;
  39 + height: 160rpx;
  40 +}
  41 +.context .left,.context .right{
  42 + width: 49%;
  43 + min-width: 49%;
  44 +}
  45 +.context .line{
  46 + width: 2rpx;
  47 + background-color: #D8D6D6;
  48 + height: 160rpx;
  49 + color: #353535;
  50 +}
  51 +.info {
  52 + text-indent: 40rpx;
  53 +}
  54 +.info .label{
  55 + font-size: 26rpx;
  56 + height: 36rpx;
  57 + line-height: 36rpx;
  58 +}
  59 +.info .value{
  60 + font-size: 36rpx;
  61 + height: 50rpx;
  62 + line-height: 50rpx;
  63 + margin-top: 6rpx;
  64 + font-weight: bold;
  65 +}
  66 +.address{
  67 + font-size: 30rpx;
  68 + color: #999999;
  69 + line-height: 70rpx;
  70 + height: 70rpx;
  71 +}
  72 +.gps-icon{
  73 + width: 28rpx;
  74 + height: 34rpx;
  75 + min-width: 28rpx;
  76 + margin-right: 20rpx;
  77 +}
  1 +// components/userinfo/share.js
  2 +Component({
  3 + /**
  4 + * 组件的属性列表
  5 + */
  6 + properties: {
  7 + share:Object,
  8 + },
  9 +
  10 + /**
  11 + * 组件的初始数据
  12 + */
  13 + data: {
  14 + hasShare:false,
  15 + },
  16 + attached(){
  17 + this.init();
  18 + },
  19 + ready () {
  20 +
  21 + },
  22 + detached(){
  23 +
  24 + },
  25 +
  26 + /**
  27 + * 组件的方法列表
  28 + */
  29 + methods: {
  30 + init(){
  31 + wx.getStorage({
  32 + key:'userInfo',
  33 + success:()=>{
  34 + this.setData({
  35 + hasShare:true
  36 + })
  37 + }
  38 + })
  39 + },
  40 + userinfo(e){
  41 + console.log('userinfo-share',e);
  42 + this.triggerEvent("userinfo",e.detail);
  43 + }
  44 + },
  45 +
  46 +})
  1 +{
  2 + "component": true,
  3 + "usingComponents": {
  4 + "userinfo": "/components/userinfo/userinfo"
  5 + }
  6 +}
  1 +<!--components/userinfo/share.wxml-->
  2 +<block wx:if="{{!hasShare}}">
  3 + <userinfo binduserinfo="userinfo" class="share-but-view">
  4 + <slot></slot>
  5 + </userinfo>
  6 +</block>
  7 +<block wx:else="">
  8 + <button class="button-none" open-type="share" data-id="{{share.id}}">
  9 + <slot></slot>
  10 + </button>
  11 +</block>
  1 +/* components/userinfo/share.wxss */
  2 +@import "../../app.wxss";
@@ -10,4 +10,5 @@ @@ -10,4 +10,5 @@
10 -webkit-tap-highlight-color: transparent; 10 -webkit-tap-highlight-color: transparent;
11 color: inherit; 11 color: inherit;
12 width:100%; 12 width:100%;
  13 + border-radius: 0;
13 } 14 }
@@ -57,7 +57,8 @@ Page({ @@ -57,7 +57,8 @@ Page({
57 * 用户点击右上角分享 57 * 用户点击右上角分享
58 */ 58 */
59 onShareAppMessage: function () { 59 onShareAppMessage: function () {
60 - 60 + console.log('onShareAppMessage',arguments)
  61 + return this.shareSetting();
61 }, 62 },
62 formatDatail(detail){ 63 formatDatail(detail){
63 detail.rdateStr=util.unixtoTime(detail.rdate,'MM月DD日 WW HH:II'); 64 detail.rdateStr=util.unixtoTime(detail.rdate,'MM月DD日 WW HH:II');
@@ -87,9 +88,27 @@ Page({ @@ -87,9 +88,27 @@ Page({
87 } 88 }
88 }) 89 })
89 }, 90 },
90 - userinfo(){  
91 - wx.navigateTo({  
92 - url:'invite?id='+this.id,  
93 - }); 91 + userinfo(e){
  92 + console.log('userinfo',e)
  93 + // wx.navigateTo({
  94 + // url:'invite?id='+this.id,
  95 + // });
  96 + },
  97 + shareSetting(){
  98 + console.log('this.topicVal',this.topicVal)
  99 + if(this.topicVal && this.data.detail.openid==getApp().openid){
  100 + App.Reserve.SetTopicFromShare({
  101 + rid:this.id,
  102 + topic:this.topicVal
  103 + })
  104 + }
  105 + let nickname="";
  106 + try{
  107 + nickname=util.cache('userInfo').nickName;
  108 + }catch(e){}
  109 + return {
  110 + title: nickname+'给你发了一个邀请,点击查看',
  111 + path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid+'&invite_name='+nickname,
  112 + }
94 } 113 }
95 }) 114 })
@@ -3,8 +3,9 @@ @@ -3,8 +3,9 @@
3 "navigationBarTextStyle": "black", 3 "navigationBarTextStyle": "black",
4 "navigationBarTitleText":"订座详情", 4 "navigationBarTitleText":"订座详情",
5 "usingComponents": { 5 "usingComponents": {
6 - "userinfo": "/components/userinfo/userinfo", 6 + "userinfo-share": "/components/userinfo/share",
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 } 10 }
10 } 11 }
@@ -3,66 +3,50 @@ @@ -3,66 +3,50 @@
3 <view class="page"> 3 <view class="page">
4 <view class="flex-vc success"> 4 <view class="flex-vc success">
5 <view class="icon"> 5 <view class="icon">
6 - <image src="http://qn.colorcun.com/custom/lite-yd/image/success-ok.png"></image> 6 + <icon type="success" size="47" color="#C8B16D"/>
7 </view> 7 </view>
8 <view class="title Medium">订座成功</view> 8 <view class="title Medium">订座成功</view>
9 - <view class="info">你可以将订座信息发送给朋友,邀请朋友参加并及时获知朋友们的反馈</view> 9 + <view class="info">分享订座信息给朋友,及时获知朋友们的反馈</view>
10 </view> 10 </view>
11 - <userinfo binduserinfo="userinfo" class="share-but-view">  
12 - <view class="share-but Regular">去邀请</view>  
13 - </userinfo>  
14 - <view class="seller flex-lr" bindtap="lookLocation">  
15 - <view class="avatar">  
16 - <image src="{{detail.seller.seller_image}}" mode="aspectFill"></image>  
17 - </view>  
18 - <view class="seller-info">  
19 - <view class="name Medium">{{detail.seller.sellername}}</view>  
20 - <view class="addr">{{detail.seller.map_address}}</view>  
21 - </view>  
22 - <view class="addr-icon">  
23 - <image src="../image/gps-icon.png"></image>  
24 - </view>  
25 - </view>  
26 - <view class="hr" style="margin-top: 52rpx;margin-bottom: 48rpx;"></view>  
27 - <view class="detail-info Medium"> 11 + <userinfo-share
  12 + binduserinfo="userinfo"
  13 + bindshare="share"
  14 + share="{{detail}}"
  15 + class="share-but-view">
  16 + <view class="share-but Regular">邀请同行的朋友</view>
  17 + </userinfo-share>
  18 + <card seller="{{detail.seller}}" detail="{{detail}}"></card>
  19 + <view class="detail-info Medium" style="margin-top: 56rpx;">
28 <view class="flex-lr"> 20 <view class="flex-lr">
29 - <view>用餐时间</view>  
30 - <view class="detail-info-right">{{detail.rdateStr}}</view>  
31 - </view>  
32 - <view class="flex-lr" style="margin-top: 43rpx;">  
33 - <view>预定座位</view>  
34 - <view class="detail-info-right">{{detail.tableFirst}}  
35 - <text class="tableSubInfo">{{detail.tableSubInfo}}</text>  
36 - </view> 21 + <view>预订人</view>
  22 + <view class="detail-info-right">{{detail.rname}}</view>
37 </view> 23 </view>
38 <view class="flex-lr" style="margin-top: 43rpx;"> 24 <view class="flex-lr" style="margin-top: 43rpx;">
39 <view>用餐人数</view> 25 <view>用餐人数</view>
40 <view class="detail-info-right">{{detail.pnum}}人</view> 26 <view class="detail-info-right">{{detail.pnum}}人</view>
41 </view> 27 </view>
42 - <view class="flex-lr" wx:if="{{detail.cusman}}" style="margin-top: 43rpx;"> 28 + <view class="flex-lr" wx:if="{{detail.cusman}}"
  29 + style="margin-top: 43rpx;"
  30 + bindtap="{{(detail.cusman_phone || detail.cusman_account)?'showManager':''}}">
43 <view>客户经理</view> 31 <view>客户经理</view>
44 - <view class="detail-info-right">{{detail.cusman||''}}</view> 32 + <view class="detail-info-right"
  33 + style="{{(detail.cusman_phone || detail.cusman_account)?'text-decoration: underline;':''}}"
  34 + >{{detail.cusman||''}}</view>
45 </view> 35 </view>
46 - <view class="flex-lr" wx:if="{{detail.cusman_phone || detail.cusman_account}}" style="margin-top: 24rpx;">  
47 - <view></view>  
48 - <view class="detail-info-right" style="text-decoration: underline"  
49 - bindtap="showManager">联系客户经理</view> 36 + <view class="flex-lr" style="margin-top: 43rpx;">
  37 + <view>备注信息</view>
  38 + <view class="detail-info-right">{{detail.cusdem}}</view>
50 </view> 39 </view>
51 </view> 40 </view>
52 - <view class="hr" style="margin-top: 56rpx;margin-bottom: 50rpx;"></view>  
53 - <view class="detail-info Medium" style="line-height: 48rpx; margin-bottom: 80rpx;"> 41 + <view class="hr" style="margin-top: 52rpx;margin-bottom: 48rpx;"></view>
  42 + <view class="detail-info Medium">
54 <view class="flex-lr"> 43 <view class="flex-lr">
55 - <view>预 定 人</view>  
56 - <view class="detail-info-right">{{detail.rname}}</view> 44 + <view>退订政策</view>
57 </view> 45 </view>
58 - <view class="flex-lr" wx:if="{{detail.phone}}">  
59 - <view>手机号码</view>  
60 - <view class="detail-info-right">{{detail.phone}}</view>  
61 - </view>  
62 - <view class="flex-lr" wx:if="{{detail.cusdem}}">  
63 - <view>备注信息</view>  
64 - <view class="detail-info-right">{{detail.cusdem}}</view> 46 + <view class="flex-lr" style="margin-top: 43rpx;">
  47 + <view>免费退订,已提前点菜,交押金,无法退订</view>
65 </view> 48 </view>
66 </view> 49 </view>
  50 + <view style="height: 50rpx;"></view>
67 </view> 51 </view>
68 <manager manager="{{detail}}" id="manager"></manager> 52 <manager manager="{{detail}}" id="manager"></manager>
@@ -9,13 +9,13 @@ @@ -9,13 +9,13 @@
9 height: 100%; 9 height: 100%;
10 } 10 }
11 .success .icon{ 11 .success .icon{
12 - width: 120rpx;  
13 - height: 120rpx;  
14 - margin-top: 10rpx; 12 + width: 94rpx;
  13 + height: 94rpx;
  14 + margin-top: 44rpx;
15 } 15 }
16 .success .title{ 16 .success .title{
17 font-size: 36rpx; 17 font-size: 36rpx;
18 - margin-top: 32rpx; 18 + margin-top: 38rpx;
19 margin-bottom: 26rpx; 19 margin-bottom: 26rpx;
20 } 20 }
21 .success .info{ 21 .success .info{
@@ -23,8 +23,8 @@ @@ -23,8 +23,8 @@
23 color:#999999 23 color:#999999
24 } 24 }
25 .share-but-view{ 25 .share-but-view{
26 - margin-top: 76rpx;  
27 - margin-bottom: 96rpx; 26 + margin-top: 58rpx;
  27 + margin-bottom: 20rpx;
28 display: block; 28 display: block;
29 } 29 }
30 .share-but{ 30 .share-but{
@@ -73,7 +73,7 @@ @@ -73,7 +73,7 @@
73 "id": 6, 73 "id": 6,
74 "name": "pages/customer/index", 74 "name": "pages/customer/index",
75 "pathName": "pages/customer/index", 75 "pathName": "pages/customer/index",
76 - "query": "id=", 76 + "query": "id=17",
77 "scene": "1044", 77 "scene": "1044",
78 "shareInfo": { 78 "shareInfo": {
79 "groupName": "测试模拟群1", 79 "groupName": "测试模拟群1",