Showing
12 changed files
with
338 additions
and
3 deletions
| @@ -8,7 +8,8 @@ | @@ -8,7 +8,8 @@ | ||
| 8 | "pages/customer/index", | 8 | "pages/customer/index", |
| 9 | "pages/customer/detail_owner", | 9 | "pages/customer/detail_owner", |
| 10 | "pages/customer/detail_customer", | 10 | "pages/customer/detail_customer", |
| 11 | - "pages/customer/list" | 11 | + "pages/customer/list", |
| 12 | + "pages/customer/invite" | ||
| 12 | ], | 13 | ], |
| 13 | "window": { | 14 | "window": { |
| 14 | "backgroundTextStyle": "light", | 15 | "backgroundTextStyle": "light", |
pages/customer/invite.js
0 → 100644
| 1 | +// pages/customer/invite.js | ||
| 2 | +import util from '../../utils/util'; | ||
| 3 | +import App from '../../utils/api'; | ||
| 4 | +const {regeneratorRuntime} = global | ||
| 5 | +Page({ | ||
| 6 | + | ||
| 7 | + /** | ||
| 8 | + * 页面的初始数据 | ||
| 9 | + */ | ||
| 10 | + data: { | ||
| 11 | + detail:null, | ||
| 12 | + }, | ||
| 13 | + id:null, | ||
| 14 | + topicVal:'', | ||
| 15 | + /** | ||
| 16 | + * 生命周期函数--监听页面加载 | ||
| 17 | + */ | ||
| 18 | + onLoad: function (options) { | ||
| 19 | + this.id=options.id; | ||
| 20 | + }, | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 24 | + */ | ||
| 25 | + onReady: function () { | ||
| 26 | + | ||
| 27 | + }, | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 生命周期函数--监听页面显示 | ||
| 31 | + */ | ||
| 32 | + onShow: function () { | ||
| 33 | + App.Reserve.Detail({ | ||
| 34 | + openid: getApp().openid, | ||
| 35 | + rid: this.id | ||
| 36 | + }).then(res => { | ||
| 37 | + this.setData({ | ||
| 38 | + detail:this.formatDatail(res.data) | ||
| 39 | + }) | ||
| 40 | + }) | ||
| 41 | + }, | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 生命周期函数--监听页面隐藏 | ||
| 45 | + */ | ||
| 46 | + onHide: function () { | ||
| 47 | + | ||
| 48 | + }, | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 生命周期函数--监听页面卸载 | ||
| 52 | + */ | ||
| 53 | + onUnload: function () { | ||
| 54 | + | ||
| 55 | + }, | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 59 | + */ | ||
| 60 | + onPullDownRefresh: function () { | ||
| 61 | + | ||
| 62 | + }, | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * 页面上拉触底事件的处理函数 | ||
| 66 | + */ | ||
| 67 | + onReachBottom: function () { | ||
| 68 | + | ||
| 69 | + }, | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 用户点击右上角分享 | ||
| 73 | + */ | ||
| 74 | + onShareAppMessage: function () { | ||
| 75 | + return { | ||
| 76 | + title: this.topicVal, | ||
| 77 | + path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid, | ||
| 78 | + } | ||
| 79 | + }, | ||
| 80 | + formatDatail(detail){ | ||
| 81 | + detail.rdateStr=util.unixtoTime(detail.rdate,'MM月DD日 WW HH:II'); | ||
| 82 | + detail.tableFirst=detail.tables[0].name; | ||
| 83 | + if(detail.tables.length>1){ | ||
| 84 | + detail.tableSubInfo='等'+(detail.tables.length)+'个' | ||
| 85 | + +(detail.tables[0].tid==2?'包间':''); | ||
| 86 | + } | ||
| 87 | + if(!detail.cusman){ | ||
| 88 | + detail.cusman='vking'; | ||
| 89 | + detail.cusman_phone='15877556369'; | ||
| 90 | + detail.cusman_account='wx:vking'; | ||
| 91 | + } | ||
| 92 | + return detail; | ||
| 93 | + }, | ||
| 94 | + topic(e){ | ||
| 95 | + let val=util.val(e); | ||
| 96 | + this.topicVal=val.trim(); | ||
| 97 | + }, | ||
| 98 | + userinfo(){ | ||
| 99 | + console.log('this.topicVal',this.topicVal) | ||
| 100 | + if (!this.topicVal) { | ||
| 101 | + wx.showToast({ | ||
| 102 | + title: '请填写邀请主题', | ||
| 103 | + icon: "none" | ||
| 104 | + }) | ||
| 105 | + return; | ||
| 106 | + } | ||
| 107 | + if(this.data.detail.openid!=getApp().openid){ | ||
| 108 | + wx.showToast({ | ||
| 109 | + title: '只有发起人才能设置', | ||
| 110 | + icon: "none" | ||
| 111 | + }) | ||
| 112 | + return; | ||
| 113 | + } | ||
| 114 | + App.Reserve.SetTopicFromShare({ | ||
| 115 | + rid:this.id, | ||
| 116 | + topic:this.topicVal | ||
| 117 | + }) | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | +}) |
pages/customer/invite.json
0 → 100644
pages/customer/invite.wxml
0 → 100644
| 1 | +<!--pages/customer/invite.wxml--> | ||
| 2 | +<view class="page"> | ||
| 3 | + <view class="card"> | ||
| 4 | + <view class="top flex-vc"> | ||
| 5 | + <input bindinput="topic" bindconfirm="topic" value="{{detail.topic}}" | ||
| 6 | + class="topic" | ||
| 7 | + placeholder="点这里,填写你想说的话" class-placeholder="topic-placeholder"/> | ||
| 8 | + </view> | ||
| 9 | + <view class="bottom"> | ||
| 10 | + <view class="rdateStr Medium">{{detail.rdateStr}}</view> | ||
| 11 | + <view class="seller flex-lr" bindtap="lookLocation"> | ||
| 12 | + <view class="seller-info"> | ||
| 13 | + <view class="name Medium">{{detail.seller.sellername}}</view> | ||
| 14 | + <view class="addr">{{detail.seller.map_address}}</view> | ||
| 15 | + </view> | ||
| 16 | + </view> | ||
| 17 | + </view> | ||
| 18 | + </view> | ||
| 19 | + <button class="share-but Regular" open-type="share">发送邀请</button> | ||
| 20 | +</view> |
pages/customer/invite.wxss
0 → 100644
| 1 | +/* pages/customer/invite.wxss */ | ||
| 2 | +.page{ | ||
| 3 | + width: 94%; | ||
| 4 | + margin: 0 3%; | ||
| 5 | + color:#353535; | ||
| 6 | +} | ||
| 7 | +.seller{ | ||
| 8 | + height: 84rpx; | ||
| 9 | + margin-top: 28rpx; | ||
| 10 | +} | ||
| 11 | +.seller .avatar{ | ||
| 12 | + min-width: 60rpx; | ||
| 13 | + width: 60rpx; | ||
| 14 | + height: 60rpx; | ||
| 15 | + background: #ccc; | ||
| 16 | +} | ||
| 17 | +.seller image{ | ||
| 18 | + width:100%; | ||
| 19 | + height: 100%; | ||
| 20 | +} | ||
| 21 | +.seller .seller-info{ | ||
| 22 | + width: 60rpx; | ||
| 23 | + height: 84rpx; | ||
| 24 | + width:100%; | ||
| 25 | +} | ||
| 26 | +.seller .addr-icon{ | ||
| 27 | + min-width: 32rpx; | ||
| 28 | + width: 32rpx; | ||
| 29 | + height: 34rpx; | ||
| 30 | +} | ||
| 31 | +.seller .name{ | ||
| 32 | + font-size: 30rpx; | ||
| 33 | +} | ||
| 34 | +.seller .addr{ | ||
| 35 | + font-size: 26rpx; | ||
| 36 | + color:#999999; | ||
| 37 | + margin-top: 8rpx; | ||
| 38 | +} | ||
| 39 | +.hr{ | ||
| 40 | + border-top: 2rpx solid #F1F0F4; | ||
| 41 | +} | ||
| 42 | +.share-but{ | ||
| 43 | + margin-top: 128rpx; | ||
| 44 | + color:#FEFEFE; | ||
| 45 | + background: #262628; | ||
| 46 | + width: 100%; | ||
| 47 | + line-height: 80rpx; | ||
| 48 | + font-size: 34rpx; | ||
| 49 | + text-align: center; | ||
| 50 | +} | ||
| 51 | +.line-text{ | ||
| 52 | + border-top: 2rpx solid #F1F0F4; | ||
| 53 | + position: relative; | ||
| 54 | + text-align: center; | ||
| 55 | + width:50%; | ||
| 56 | + margin: 0 auto; | ||
| 57 | + font-size: 26rpx; | ||
| 58 | +} | ||
| 59 | +.line-text .text{ | ||
| 60 | + position: absolute; | ||
| 61 | + top:-16rpx; | ||
| 62 | + width:100%; | ||
| 63 | +} | ||
| 64 | +.line-text .text view{ | ||
| 65 | + width:100rpx; | ||
| 66 | + margin: 0 auto; | ||
| 67 | + background-color: #fff; | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | + | ||
| 71 | +.card{ | ||
| 72 | + margin-top: 62rpx; | ||
| 73 | + border-radius: 10rpx; | ||
| 74 | + box-shadow: 2rpx 2rpx 14rpx 6rpx rgba(231,228,228,.5); | ||
| 75 | +} | ||
| 76 | +.card .top{ | ||
| 77 | + min-height: 160rpx; | ||
| 78 | +} | ||
| 79 | +.card .bottom{ | ||
| 80 | + background-color: #EAECEE; | ||
| 81 | + border-radius: 10rpx; | ||
| 82 | + box-shadow: 2rpx 2rpx 14rpx 6rpx rgba(231,228,228,.5); | ||
| 83 | + padding: 36rpx 46rpx 50rpx; | ||
| 84 | +} | ||
| 85 | +.card .bottom .rdateStr{ | ||
| 86 | + font-size: 30rpx; | ||
| 87 | +} | ||
| 88 | + | ||
| 89 | +.topic-placeholder,.topic{ | ||
| 90 | + height: 60rpx; | ||
| 91 | + font-size: 44rpx; | ||
| 92 | + font-weight: bold; | ||
| 93 | + width:94%; | ||
| 94 | +} | ||
| 95 | +.topic-placeholder{ | ||
| 96 | + color:#999999 | ||
| 97 | +} |
pages/customer/list.js
0 → 100644
| 1 | +// pages/customer/list.js | ||
| 2 | +Page({ | ||
| 3 | + | ||
| 4 | + /** | ||
| 5 | + * 页面的初始数据 | ||
| 6 | + */ | ||
| 7 | + data: { | ||
| 8 | + | ||
| 9 | + }, | ||
| 10 | + | ||
| 11 | + /** | ||
| 12 | + * 生命周期函数--监听页面加载 | ||
| 13 | + */ | ||
| 14 | + onLoad: function (options) { | ||
| 15 | + | ||
| 16 | + }, | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 20 | + */ | ||
| 21 | + onReady: function () { | ||
| 22 | + | ||
| 23 | + }, | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 生命周期函数--监听页面显示 | ||
| 27 | + */ | ||
| 28 | + onShow: function () { | ||
| 29 | + | ||
| 30 | + }, | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 生命周期函数--监听页面隐藏 | ||
| 34 | + */ | ||
| 35 | + onHide: function () { | ||
| 36 | + | ||
| 37 | + }, | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 生命周期函数--监听页面卸载 | ||
| 41 | + */ | ||
| 42 | + onUnload: function () { | ||
| 43 | + | ||
| 44 | + }, | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 48 | + */ | ||
| 49 | + onPullDownRefresh: function () { | ||
| 50 | + | ||
| 51 | + }, | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * 页面上拉触底事件的处理函数 | ||
| 55 | + */ | ||
| 56 | + onReachBottom: function () { | ||
| 57 | + | ||
| 58 | + }, | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 用户点击右上角分享 | ||
| 62 | + */ | ||
| 63 | + onShareAppMessage: function () { | ||
| 64 | + | ||
| 65 | + } | ||
| 66 | +}) |
pages/customer/list.json
0 → 100644
| 1 | +{} |
pages/customer/list.wxml
0 → 100644
pages/customer/list.wxss
0 → 100644
| 1 | +/* pages/customer/list.wxss */ |
| @@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
| 30 | "list": [] | 30 | "list": [] |
| 31 | }, | 31 | }, |
| 32 | "miniprogram": { | 32 | "miniprogram": { |
| 33 | - "current": 6, | 33 | + "current": 8, |
| 34 | "list": [ | 34 | "list": [ |
| 35 | { | 35 | { |
| 36 | "id": 0, | 36 | "id": 0, |
| @@ -73,6 +73,18 @@ | @@ -73,6 +73,18 @@ | ||
| 73 | "name": "pages/customer/index", | 73 | "name": "pages/customer/index", |
| 74 | "pathName": "pages/customer/index", | 74 | "pathName": "pages/customer/index", |
| 75 | "query": "id=64" | 75 | "query": "id=64" |
| 76 | + }, | ||
| 77 | + { | ||
| 78 | + "id": -1, | ||
| 79 | + "name": "邀请设置页 pages/customer/invite", | ||
| 80 | + "pathName": "pages/customer/invite", | ||
| 81 | + "query": "id=64" | ||
| 82 | + }, | ||
| 83 | + { | ||
| 84 | + "id": -1, | ||
| 85 | + "name": "邀请进入 pages/customer/index", | ||
| 86 | + "pathName": "pages/customer/index", | ||
| 87 | + "query": "id=64&fromid=test" | ||
| 76 | } | 88 | } |
| 77 | ] | 89 | ] |
| 78 | } | 90 | } |
-
Please register or login to post a comment