作者 吴孟雨

暂存

正在显示 50 个修改的文件 包含 2335 行增加869 行删除
@@ -213,7 +213,7 @@ App({ @@ -213,7 +213,7 @@ App({
213 let Y = over.getFullYear() + '.' + (month > 9 ? month : ('0' + month)) + '.' + (day > 9 ? day : ('0' + day)); 213 let Y = over.getFullYear() + '.' + (month > 9 ? month : ('0' + month)) + '.' + (day > 9 ? day : ('0' + day));
214 let H = (hours > 9 ? hours - hour_num : ('0' + hours - hour_num)) + ':' + (minutes > 9 ? minutes : ('0' + minutes)); 214 let H = (hours > 9 ? hours - hour_num : ('0' + hours - hour_num)) + ':' + (minutes > 9 ? minutes : ('0' + minutes));
215 let time = []; 215 let time = [];
216 - console.log('Y,H,month', Y, H,month); 216 + // console.log('Y,H,month', Y, H,month);
217 time.push(Y,H); 217 time.push(Y,H);
218 let new_time = time.join(' '); 218 let new_time = time.join(' ');
219 return new_time; 219 return new_time;
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 "pages/my/about/about", 21 "pages/my/about/about",
22 "pages/meal/meal", 22 "pages/meal/meal",
23 "pages/order/complain/complain", 23 "pages/order/complain/complain",
24 - "pages/order/order-detail/order-detail" 24 + "pages/order/order-detail/order-detail",
  25 + "pages/comment/comment"
25 ], 26 ],
26 "window": { 27 "window": {
27 "backgroundTextStyle": "light", 28 "backgroundTextStyle": "light",
1 1
2 @font-face {font-family: "iconfont"; 2 @font-face {font-family: "iconfont";
3 - src: url('//at.alicdn.com/t/font_961048_fflo66h0q25.eot?t=1545961536104'); /* IE9*/  
4 - src: url('//at.alicdn.com/t/font_961048_fflo66h0q25.eot?t=1545961536104#iefix') format('embedded-opentype'), /* IE6-IE8 */  
5 - url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAuIAAsAAAAAESAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8dkpiY21hcAAAAYAAAADIAAACdh2V7qRnbHlmAAACSAAABs4AAAlI17F4rWhlYWQAAAkYAAAALwAAADYTtoZ9aGhlYQAACUgAAAAcAAAAJAfeA5BobXR4AAAJZAAAAA8AAAA8PAAAAGxvY2EAAAl0AAAAIAAAACAO9hFkbWF4cAAACZQAAAAfAAAAIAEeAGluYW1lAAAJtAAAAUUAAAJtPlT+fXBvc3QAAAr8AAAAjAAAAMAjIgQ0eJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMbwoYG7438AQw9zA0AAUZgTJAQDlnQxVeJzlks0NgkAQhd8KKP6hCRyMMdgAlGBPHLjbgI3QASeroIYXu8A3jAdjtAJn820ys5udyXsLIAEQiUrEQLgjwKJXNUz1CKupHuOm/IC9KinBHQueWfPClld2HB7NOALTSc6S1efJ1wh60dYRJ5RvC0ixxFpdZ+q/wVZdF5jrfmYzh/mP9/4pNtPev7LMtHeknVxwpCKYO9ITLBxzm6UjjcGzY26zcqwDa0cOgBfHfgxbR66AV0f+gJ1jv4eDY7M9GgfJE4JwRiV4nJ1WXWzb9hH/3/9PkaJEi5IokZIsS6Ykk45lybU+SDvy52zFTpq0XZzFXm0k1eak+UDXZVuKLk0TA2mKAcvy0Kd6SIoB3VYEaNH1C0j6MHRrumV92bo+dMGAYh8PRTtg87Yk2EPE7Eg5XfvYEcTxTvfn4Xd3vzuKUIIXy9GXSJAkCAE9Z9Ssql5RYzyUoR6pWRU1HonxLNj+JCBJAaqidP6GIiZJcFxSuroUybkBm56Ae8oNyRFy57fsJEuTITJCpskOjJ3jBdOyDdPOQHUC7DKYIRBimlCGPCoZ0Cxb0Pg4Kp6XZSDGu3AQiAvDQ9RR6PXinPZSBEB4Qx0vNFcAVpoohde18XxzhdKV5sgAXN38FeUW295t287XB2x7wbbhYseGWH9+Ve9PqIeSabrc7Lz4WasXvimKzWXqmXAN3JcXbGfrXeU2uGF225gveHVcomPER0gfmCIIlMBSr3PNudb7DiyiAiO9d8+t0T0EK6+IsAZn4En6ZWcZXiDM873IitiJEXIfxsE6KJZhCqY9AXUsU46PY6XyClQakAGBoYENM9kENADP1iwsrRbjBV+k6havCDnDbaHtWXl6K13iq8LQ4ORSUOwCsyefp2v7EwBXulOB6flAVZwddOpR/AG0aHLnYbq1XhmnotD+iyZKkmgGw7JkuloRjDRkiyN4sCf+QLfd2FJZepo5D8MGfGXK+XNxlCai8MNogj0yNzsNsGdem0ovO0dBikrhILwRlMFV3Urducm+z0Kkm5RIlTRIkxCfjryIYDJ6XMf0IpiQjlakGglBHy8Db0yCZYNVyYIaE4BXJ8G0NdXQ3JqbRk4GzbZqLN9+ZQviQxqcc74TTwN0x+n98V4YhjHnZ0H5A0Xlj9IAnJZNeVGW2xc5KXB2W7HOiSqoi84ncLXmV/zVvTUhiDHofcUGrUBWbb/qhkrH3aADI38P0iN+TflDKIhxMIwpOztEiXtgW6rG+eOdOKM1QaguYTBsLXb8zjX2GhvCWTORCh3Se1xXkNS5IRBcvmNCSHrMz3a5LgMll2/5fLcuezIciKeDz64H0/HA+nognnL1FOqs7J646eNuXnnzZvtKMBUT19fF2Kd+7+x6Zy5/xM6yFmLQSIEMI44MDeFkWcgxO0QzSCTDLLugcF75sCaCFWaCaYTRX1E1NUxJwQrpM1/q55NyIbZ1r1Z75Mh0cIva+Lf9g4vn7WPHQAHlWxc+/rjVKn/37OPlFq3B4Nx4OjbWTMnyGMx9+2slvfXogJZ4YnRsbPQJ552TzkeQPAkN59jGxiGQDg9Vq0OHnRvuOLgcWWe/YY+SQVIhUzgVK4hYtTSkf553ZYjigPAe5EjesGxLtT3ZcNFmoC+u13VeQPaggcwwI/haROA9y+hYPKZlbVr0H7mZdKnIbacAzOezd60MvLx0yYj6oOk3zPRcv08tq/XudzO1sMKcfbDi/ITOAMhCyh+GWfo7SkW/LnUB6r8HiAWSvi4KTaB/5Rjnnxv91a+rB8rFqsRwdlg1uaMMN2rbuvwcHblXoJRKSjM9MwcfOEvZPSEf8KHdvfAiUOdAs6hIvF/e2wOX0Nyd3xXEePJiGl4Ar6dvszU2TxTShx2dcHvq7QF3XpBWhmmYE0guAfN0adXZJiaPe8NdGMjDMmiq9ulOVil5/jqnqpNnTomqePrM5ABw15vLHOQbTx49cqoRUdjlc+ey9KHt2x+invxqdnh4CmBqeHiSUjbH3ntucNE8sHbC7z+xdvD+B59775mlp+6d2X/i4YMn9/Vuzz/9CmPOu/MtSlvz8y2Alr8XYLpc6YQgm7PyJ/YWy5MUbgZvVjrYMm4fNbXisrUzOiGGHrw7ydxNiV5tHCwUDjaOnmdQTi38MybnZOVfC6kSZeeFHb/oyaZ/vitRoXB4f31V11fr+78B1GZ5sO65xwJ24fjsqvHY+xJe7z9mrM4ev+DkWz9WIPbT1dyDY4dOUbqzVNpJ6alD4/vcvX3nefYhWyBFb4uRvhCYOlIS15imW1j0eAQBRyxEmb+71NSqu9aMHHgufOrITZ2PsUu++Wz78Z46peUeejY9G/GxEgOfWMu2U0O40grZgERv9dcoHXQm0MVKzn/oeDLZfjtJDeRQV4F+lA8DpQl/sB1KJOiHCS1bgJFyO6UPBzmwzCQ93f4lOiYSzsvcIMcNbtb7fzl8sQz+D+Tt0S8IGbZ1kLq1XuPwC0pkkkWsHtMj7ndw87PR97mvBv6L0HN8DKFWrJrBvpfIAmQTtzc6Txa+vVGdxVGtsrD3/KMzFYpGQ/AWSjb1uZP4nMKDn33B0aPpKN5Yvv8CFd+6dAAAeJxjYGRgYABitu5rs+L5bb4ycLMwgMAN74UOCPp/AwsDcwOQy8HABBIFAB1vCcoAeJxjYGRgYG7438AQw8IAAkCSkQEV8AMARxUCeHicY2FgYGAhEwMAB7wAPQAAAAAAACwApAC4AMYBPgG2AfgCUALiA0wDogQEBFgEpHicY2BkYGDgZ4hlYGUAASYg5gJCBob/YD4DABNnAYgAeJxlj01OwzAQhV/6B6QSqqhgh+QFYgEo/RGrblhUavdddN+mTpsqiSPHrdQDcB6OwAk4AtyAO/BIJ5s2lsffvHljTwDc4Acejt8t95E9XDI7cg0XuBeuU38QbpBfhJto41W4Rf1N2MczpsJtdGF5g9e4YvaEd2EPHXwI13CNT+E69S/hBvlbuIk7/Aq30PHqwj7mXle4jUcv9sdWL5xeqeVBxaHJIpM5v4KZXu+Sha3S6pxrW8QmU4OgX0lTnWlb3VPs10PnIhVZk6oJqzpJjMqt2erQBRvn8lGvF4kehCblWGP+tsYCjnEFhSUOjDFCGGSIyujoO1Vm9K+xQ8Jee1Y9zed0WxTU/3OFAQL0z1xTurLSeTpPgT1fG1J1dCtuy56UNJFezUkSskJe1rZUQuoBNmVXjhF6XNGJPyhnSP8ACVpuyAAAAHicbY1rDoIwEIQ7PEt94AG8gj/wRhUQlpjdBG0gnN6t+tPJZpL9kpkxifnKmf+qkSBFhhwFSlhUcNhhjwOOqHEy6US+uve8kufh6vw8y3LpZGH7IWrp5rm46TORfY6e2zE09iGtf5Fw+SPnjnhYetLbRtqCaEBiw6pcYxJabct0rInGebTGmDflGC5c') format('woff'),  
6 - url('//at.alicdn.com/t/font_961048_fflo66h0q25.ttf?t=1545961536104') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/  
7 - url('//at.alicdn.com/t/font_961048_fflo66h0q25.svg?t=1545961536104#iconfont') format('svg'); /* iOS 4.1- */ 3 + src: url('//at.alicdn.com/t/font_961048_kzif4jn6os.eot?t=1546407359461'); /* IE9*/
  4 + src: url('//at.alicdn.com/t/font_961048_kzif4jn6os.eot?t=1546407359461#iefix') format('embedded-opentype'), /* IE6-IE8 */
  5 + url('data:application/x-font-woff;charset=utf-8;base64,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') format('woff'),
  6 + url('//at.alicdn.com/t/font_961048_kzif4jn6os.ttf?t=1546407359461') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
  7 + url('//at.alicdn.com/t/font_961048_kzif4jn6os.svg?t=1546407359461#iconfont') format('svg'); /* iOS 4.1- */
8 } 8 }
9 9
10 .iconfont { 10 .iconfont {
@@ -15,12 +15,22 @@ @@ -15,12 +15,22 @@
15 -moz-osx-font-smoothing: grayscale; 15 -moz-osx-font-smoothing: grayscale;
16 } 16 }
17 17
  18 +.icon-shoucang1:before { content: "\e60a"; }
  19 +
  20 +.icon-zan1:before { content: "\e64f"; }
  21 +
  22 +.icon-z-likeFill:before { content: "\e6c1"; }
  23 +
18 .icon-jia:before { content: "\e6a9"; } 24 .icon-jia:before { content: "\e6a9"; }
19 25
  26 +.icon-shoucang2:before { content: "\e63b"; }
  27 +
20 .icon-fenxiang2:before { content: "\e61e"; } 28 .icon-fenxiang2:before { content: "\e61e"; }
21 29
22 .icon-arrow-down:before { content: "\e63d"; } 30 .icon-arrow-down:before { content: "\e63d"; }
23 31
  32 +.icon-shoucang3:before { content: "\e645"; }
  33 +
24 .icon-xiangxia:before { content: "\e614"; } 34 .icon-xiangxia:before { content: "\e614"; }
25 35
26 .icon-zan:before { content: "\e870"; } 36 .icon-zan:before { content: "\e870"; }
@@ -9,7 +9,31 @@ Page({ @@ -9,7 +9,31 @@ Page({
9 images: [], 9 images: [],
10 images_params:[], 10 images_params:[],
11 type_picker_list:[], 11 type_picker_list:[],
12 - start_time:app.nowDate() 12 + start_time:app.nowDate(),
  13 + title:'',
  14 + content:'',
  15 + min_num:'',
  16 + max_num:'',
  17 + date:'',
  18 + time:'',
  19 + address:'',
  20 + address_position:'',
  21 + over_time:'',
  22 + is_showRelease_modal:false,
  23 + },
  24 + //查看我的发布
  25 + goMyRelease() {
  26 + wx.redirectTo({url:'/pages/activity/detail/detail?id=' + this.data.id})
  27 + },
  28 + //完成按钮
  29 + goBack() {
  30 + wx.redirectTo({url:'/pages/spell-list/spell-list?current=' + 1})
  31 + },
  32 + disableScroll() {
  33 + },
  34 + handleBackground() {
  35 + console.log('dianji');
  36 + this.setData({is_showRelease_modal:false,})
13 }, 37 },
14 //输入标题 38 //输入标题
15 inputTitle(e) { 39 inputTitle(e) {
@@ -25,7 +49,11 @@ Page({ @@ -25,7 +49,11 @@ Page({
25 }, 49 },
26 //输入最高人数 50 //输入最高人数
27 inputMaxNum(e) { 51 inputMaxNum(e) {
28 - this.setData({max_num:e.detail.value}) 52 + this.setData({max_num:e.detail.value});
  53 + if(this.data.min_num>this.data.max_num) {
  54 + wx.showToast({title:'最低人数不能高于最高人数',icon:'none'});
  55 + this.setData({max_num:''});
  56 + }
29 }, 57 },
30 //输入地点 58 //输入地点
31 inputAddress(e) { 59 inputAddress(e) {
@@ -74,42 +102,70 @@ Page({ @@ -74,42 +102,70 @@ Page({
74 //确定发布 102 //确定发布
75 confirmRelease(e) { 103 confirmRelease(e) {
76 console.log('e', e,e.detail.formId); 104 console.log('e', e,e.detail.formId);
77 - this.data.type_list.forEach((item,index) => {  
78 - if(this.data.current_type === index) {  
79 - // console.log('index', index, item.id);  
80 - this.setData({type_id:item.id})  
81 - }  
82 - });  
83 - const images_params = this.data.images_params.join(',');  
84 - console.log('发布-images_params', images_params);  
85 - let url = '/portal/Send/sendActivity';  
86 - let header = {  
87 - "XX-token": wx.getStorageSync('token')  
88 - };  
89 - let params = {  
90 - token: wx.getStorageSync('token'),  
91 - title: this.data.title,  
92 - content:this.data.content,  
93 - pic: images_params,  
94 - min:this.data.min_num,  
95 - max:this.data.max_num,  
96 - select_id: this.data.type_id,//类别  
97 - time: this.data.date + ' ' + this.data.time,  
98 - addr: this.data.address,  
99 - address: this.data.address_position,  
100 - latng: this.data.latng,  
101 - over_time:this.data.over_time,// 报名截止时间  
102 - formId: e.detail.formId,  
103 - };  
104 - var list = [];  
105 - app.post(url, params, {}).then((res) => {  
106 - console.log('确定发布', res);  
107 - // res.list.forEach((item) => {  
108 - // list.push(item.name)  
109 - // });  
110 - // console.log('list', list);  
111 - // this.setData({picker_list: list, student_list: res.list})  
112 - }) 105 + if(this.data.title === '') {
  106 + wx.showToast({title:'请填写标题',icon:'none'})
  107 + }else if(this.data.content === '') {
  108 + wx.showToast({title:'请填写描述',icon:'none'})
  109 + }else if(this.data.images_params.length === 0) {
  110 + wx.showToast({title:'请上传图片',icon:'none'})
  111 + }else if (this.data.min_num === '') {
  112 + wx.showToast({title:'请填写最低人数',icon:'none'})
  113 + }else if (this.data.max_num === '') {
  114 + wx.showToast({title:'请填写最高人数',icon:'none'})
  115 + }else if(this.data.current_type === undefined) {
  116 + wx.showToast({title:'请选择类别',icon:'none'})
  117 + }else if(this.data.date === '') {
  118 + wx.showToast({title:'请选择日期',icon:'none'})
  119 + }else if(this.data.time === '') {
  120 + wx.showToast({title:'请选择时间',icon:'none'})
  121 + }else if(this.data.address === '') {
  122 + wx.showToast({title:'请填写地点',icon:'none'})
  123 + }else if(this.data.address_position === '') {
  124 + wx.showToast({title:'请定位地址',icon:'none'})
  125 + }else if(this.data.over_time === '') {
  126 + wx.showToast({title:'请填写截止时间',icon:'none'})
  127 + }else {
  128 + this.data.type_list.forEach((item,index) => {
  129 + if(this.data.current_type === index) {
  130 + // console.log('index', index, item.id);
  131 + this.setData({type_id:item.id})
  132 + }
  133 + });
  134 + const images_params = this.data.images_params.join(',');
  135 + console.log('发布-images_params', images_params);
  136 + let url = '/portal/Send/sendActivity';
  137 + let header = {
  138 + "XX-token": wx.getStorageSync('token')
  139 + };
  140 + let params = {
  141 + token: wx.getStorageSync('token'),
  142 + title: this.data.title,
  143 + content:this.data.content,
  144 + pic: images_params,
  145 + min:this.data.min_num,
  146 + max:this.data.max_num,
  147 + select_id: this.data.type_id,//类别
  148 + time: this.data.date + ' ' + this.data.time,
  149 + addr: this.data.address,
  150 + address: this.data.address_position,
  151 + latng: this.data.latng,
  152 + over_time:this.data.over_time,// 报名截止时间
  153 + // formId: e.detail.formId,
  154 + };
  155 + app.post(url, params, {}).then((res) => {
  156 + console.log('确定发布', res);
  157 + if(+res.code === 1 && res.message == '发布成功') {
  158 + this.setData({is_showRelease_modal:true,id:+res.data.id})
  159 + }else {
  160 + wx.showToast({title:res.message,icon:'none'})
  161 + }
  162 + // res.list.forEach((item) => {
  163 + // list.push(item.name)
  164 + // });
  165 + // console.log('list', list);
  166 + // this.setData({picker_list: list, student_list: res.list})
  167 + })
  168 + }
113 }, 169 },
114 //上传图片 170 //上传图片
115 choose(e) { //这里是选取图片的方法 171 choose(e) { //这里是选取图片的方法
1 <!--pages/activity/activity.wxml--> 1 <!--pages/activity/activity.wxml-->
2 -<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true">  
3 - <view class="content">  
4 - <view class="input-box">  
5 - <input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/>  
6 - <textarea maxlength="-1" type="text" placeholder="发布描述..." bindinput="inputContent"  
7 - placeholder-class="placeholder"></textarea>  
8 - </view> 2 +<!--<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true">-->
  3 +<view class="content">
  4 + <view class="input-box">
  5 + <input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/>
  6 + <textarea maxlength="-1" type="text" placeholder="发布描述..." bindinput="inputContent"
  7 + placeholder-class="placeholder"></textarea>
  8 + </view>
9 9
10 - <view class='upload_box'>  
11 - <block wx:for="{{images}}" wx:for-item="image" wx:key="index">  
12 - <view class='upload_img'>  
13 - <view class='icon_box' catchtap="deleteImg" data-index="{{index}}">  
14 - <view class='iconfont icon-shanchu1'></view>  
15 - </view>  
16 - <image src='{{image}}' data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image> 10 + <view class='upload_box'>
  11 + <block wx:for="{{images}}" wx:for-item="image" wx:key="index">
  12 + <view class='upload_img'>
  13 + <view class='icon_box' catchtap="deleteImg" data-index="{{index}}">
  14 + <view class='iconfont icon-shanchu1'></view>
17 </view> 15 </view>
18 - </block>  
19 - <view class='upload_img' bindtap="choose">  
20 - <view class='iconfont icon-jia'></view>  
21 - <text>添加照片</text> 16 + <image src='{{image}}' data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image>
22 </view> 17 </view>
  18 + </block>
  19 + <view class='upload_img' bindtap="choose">
  20 + <view class='iconfont icon-jia'></view>
  21 + <text>添加照片</text>
23 </view> 22 </view>
  23 + </view>
24 24
25 - <view class="set-box">  
26 - <view class="min-num">  
27 - <text class="title">最低人数</text>  
28 - <input type="number" bindinput="inputMinNum" class="input"/>  
29 - <text class="iconfont icon-xiangxia min-icon"></text>  
30 - </view>  
31 - <view class="min-num">  
32 - <text class="title">最高人数</text>  
33 - <input type="number" bindinput="inputMaxNum" class="input"/>  
34 - <text class="iconfont icon-xiangxia min-icon"></text>  
35 - </view>  
36 - <view class="min-num">  
37 - <text class="title type-title">类别</text>  
38 - <picker bindchange="bindTypeChange" value="{{current_type}}" range="{{type_picker_list}}" class="picker">  
39 - <view class="input">  
40 - <text class="variety-text">{{type_picker_list[current_type]}}</text>  
41 - <!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>-->  
42 - <!-- <view class="iconfont icon-arrow-down"></view> --> 25 + <view class="set-box">
  26 + <view class="min-num">
  27 + <text class="title">最低人数</text>
  28 + <input type="number" bindinput="inputMinNum" class="input"/>
  29 + <text class="iconfont icon-xiangxia min-icon"></text>
  30 + </view>
  31 + <view class="min-num">
  32 + <text class="title">最高人数</text>
  33 + <input type="number" bindinput="inputMaxNum" class="input"/>
  34 + <text class="iconfont icon-xiangxia min-icon"></text>
  35 + </view>
  36 + <view class="min-num">
  37 + <text class="title type-title">类别</text>
  38 + <picker bindchange="bindTypeChange" value="{{current_type}}" range="{{type_picker_list}}" class="picker">
  39 + <view class="input">
  40 + <text class="variety-text">{{type_picker_list[current_type]}}</text>
  41 + <!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>-->
  42 + <!-- <view class="iconfont icon-arrow-down"></view> -->
  43 + </view>
  44 + </picker>
  45 + <text class="iconfont icon-xiangxia min-icon"></text>
  46 + </view>
  47 + <view class="time-box">
  48 + <text class="time-title">时间</text>
  49 + <picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_time}}" end='2060-01-01'>
  50 + <view class='select'>
  51 + <view class="picker">{{month}}
  52 + <text class="iconfont icon-xiangxia min-icon"></text>
43 </view> 53 </view>
44 - </picker>  
45 - <text class="iconfont icon-xiangxia min-icon"></text>  
46 - </view>  
47 - <view class="time-box">  
48 - <text class="time-title">时间</text>  
49 - <picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_time}}" end='2060-01-01'>  
50 - <view class='select'>  
51 - <view class="picker">{{month}}  
52 - <text class="iconfont icon-xiangxia min-icon"></text>  
53 - </view>  
54 - <text class="margin">月</text>  
55 - <view class="picker">{{day}}  
56 - <text class="iconfont icon-xiangxia min-icon"></text>  
57 - </view>  
58 - <text class="margin">日</text>  
59 - <!--<view class='select_right' style='color:rgba(51,51,51,1)'>{{date}}</view>--> 54 + <text class="margin">月</text>
  55 + <view class="picker">{{day}}
  56 + <text class="iconfont icon-xiangxia min-icon"></text>
60 </view> 57 </view>
61 - </picker>  
62 - <picker mode="time"  
63 - value="{{time}}"  
64 - start="09:01"  
65 - end="21:01"  
66 - bindchange="bindTimeChange">  
67 - <view class='select'>  
68 - <view class="picker">{{hour}}  
69 - <text class="iconfont icon-xiangxia min-icon"></text>  
70 - </view>  
71 - <text class="margin">时</text>  
72 - <view class="picker">{{minute}}  
73 - <text class="iconfont icon-xiangxia min-icon"></text>  
74 - </view>  
75 - <text class="margin">分</text> 58 + <text class="margin">日</text>
  59 + <!--<view class='select_right' style='color:rgba(51,51,51,1)'>{{date}}</view>-->
  60 + </view>
  61 + </picker>
  62 + <picker mode="time"
  63 + value="{{time}}"
  64 + start="09:01"
  65 + end="21:01"
  66 + bindchange="bindTimeChange">
  67 + <view class='select'>
  68 + <view class="picker">{{hour}}
  69 + <text class="iconfont icon-xiangxia min-icon"></text>
76 </view> 70 </view>
77 - </picker>  
78 - </view>  
79 - <view class="address-box">  
80 - <text class="address-title">地点</text>  
81 - <input type="text" bindinput="inputAddress" class="input"/>  
82 - </view>  
83 - <view class="address-box" bindtap="choosePosition">  
84 - <text class="address-title">地址</text>  
85 - <text class="input">{{address_position}}</text>  
86 - <!--<input type="text" bindinput="inputPosition" value="" class="input"/>-->  
87 - <text class="iconfont icon-location"></text>  
88 - </view>  
89 - <view class="time-limit">  
90 - <text>时限 活动开始前</text>  
91 - <input type="number" bindinput="inputOverTime" value=""/>  
92 - <text>小时 停止拼单</text>  
93 - </view> 71 + <text class="margin">时</text>
  72 + <view class="picker">{{minute}}
  73 + <text class="iconfont icon-xiangxia min-icon"></text>
  74 + </view>
  75 + <text class="margin">分</text>
  76 + </view>
  77 + </picker>
  78 + </view>
  79 + <view class="address-box">
  80 + <text class="address-title">地点</text>
  81 + <input type="text" bindinput="inputAddress" class="input"/>
  82 + </view>
  83 + <view class="address-box" bindtap="choosePosition">
  84 + <text class="address-title">地址</text>
  85 + <text class="input">{{address_position}}</text>
  86 + <!--<input type="text" bindinput="inputPosition" value="" class="input"/>-->
  87 + <text class="iconfont icon-location"></text>
94 </view> 88 </view>
  89 + <view class="time-limit">
  90 + <text>时限 活动开始前</text>
  91 + <input type="number" bindinput="inputOverTime" value=""/>
  92 + <text>小时 停止拼单</text>
  93 + </view>
  94 + </view>
95 95
96 - <button class="complete" form-type="submit">  
97 - <view class="btn">确定发布</view>  
98 - </button> 96 + <!--<button class="complete" form-type="submit">-->
  97 + <view class="complete" bindtap="confirmRelease">
  98 + <view class="btn">确定发布</view>
99 </view> 99 </view>
100 -</form> 100 + <!--</button>-->
  101 +</view>
  102 +<!--发布成功弹框-->
  103 +<view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll">
  104 + <image class="sorry-img" src="../../images/success@2x.png"></image>
  105 + <view class="title">恭喜您发布成功</view>
  106 + <view class="view-btn" catchtap="goMyRelease">查看我的发布</view>
  107 + <view class="complete-btn" catchtap="goBack">完成</view>
  108 +</view>
  109 +<view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  110 +<!--</form>-->
@@ -190,4 +190,69 @@ @@ -190,4 +190,69 @@
190 } 190 }
191 .complete::after { 191 .complete::after {
192 border:0; 192 border:0;
  193 +}
  194 +.modal {
  195 + width: 73%;
  196 + /* height: 1100rpx; */
  197 + background: #ffffff;
  198 + display: flex;
  199 + align-items: center;
  200 + flex-direction: column;
  201 + z-index:999;
  202 + position: fixed;
  203 + top: 48%;
  204 + left: 50%;
  205 + transform: translate(-50%,-50%);
  206 + padding: 46rpx 0rpx;
  207 + -webkit-box-sizing: border-box;
  208 + -moz-box-sizing: border-box;
  209 + box-sizing: border-box;
  210 + border-radius: 40rpx;
  211 +}
  212 +.modal image {
  213 + width: 110rpx;
  214 + height: 110rpx;
  215 + border-radius: 50%;
  216 + margin-bottom: 34rpx;
  217 +}
  218 +.modal .title {
  219 + color: #333333;
  220 + font-size: 36rpx;
  221 + margin-bottom: 46rpx;
  222 +}
  223 +.modal .tips {
  224 + color: #333333;
  225 + font-size: 24rpx;
  226 + margin-bottom: 26rpx;
  227 +}
  228 +.modal .view-btn {
  229 + height: 66rpx;
  230 + width: 364rpx;
  231 + border:1rpx solid #323232;
  232 + border-radius: 6rpx;
  233 + color:#323232;
  234 + text-align: center;
  235 + line-height: 66rpx;
  236 + font-size: 30rpx;
  237 +}
  238 +.modal .complete-btn {
  239 + width: 364rpx;
  240 + height: 66rpx;
  241 + background-color: #323232;
  242 + border-radius: 6rpx;
  243 + color:#E2C8B1;
  244 + font-size: 30rpx;
  245 + text-align: center;
  246 + line-height: 66rpx;
  247 + margin-top: 26rpx;
  248 +}
  249 +/*弹框样式*/
  250 +.modal_box {
  251 + width: 100%;
  252 + height: 100%;
  253 + position: fixed;
  254 + top: 0;
  255 + left: 0;
  256 + z-index: 10;
  257 + background: rgba(0,0,0,0.3);
193 } 258 }
@@ -9,33 +9,95 @@ Page({ @@ -9,33 +9,95 @@ Page({
9 */ 9 */
10 data: { 10 data: {
11 current_swiper:0, 11 current_swiper:0,
12 - slide: [{image: 'http://pk86rwhci.bkt.clouddn.com/banner.png'}, {image: 'http://pk86rwhci.bkt.clouddn.com/banner.png'}],  
13 - peopleList: [  
14 - {img:'../../../images/avatar@2x.png',name:'张丹'},  
15 - {img:'../../../images/avatar@2x.png',name:'Jony'},  
16 - {img:'../../../images/avatar@2x.png',name:'Beautiful life'},  
17 - {img:'../../../images/avatar@2x.png',name:'Beautiful life'},  
18 - {img:'../../../images/avatar@2x.png',name:'Beautiful life'},  
19 - {img:'../../../images/avatar@2x.png',name:'Beautiful life'},  
20 - {img:'../../../images/avatar@2x.png',name:'Beautiful life'},  
21 - {img:'../../../images/avatar@2x.png',name:'Beautiful life'},  
22 - {img:'../../../images/avatar@2x.png',name:'Beautiful life'},  
23 - {img:'../../../images/avatar@2x.png',name:'Beautiful life'},  
24 - {img:'../../../images/avatar@2x.png',name:'Beautiful life'},  
25 - {img:'../../../images/avatar@2x.png',name:'Beautiful life'},  
26 - ], 12 + slide: [],
  13 + peopleList: [],
27 num:1, 14 num:1,
28 actEndTimeList: [], 15 actEndTimeList: [],
  16 + is_zan:false,
  17 +
  18 + },
  19 + // 问一问
  20 + ask(e) {
  21 + wx.navigateTo({url:'/pages/comment/comment?activity_id=' + this.data.detail_id
  22 + + '&common_id=' + 0
  23 + })
  24 + // console.log('问',e.detail.value);
  25 + // this.setData({focus:true})
  26 + },
  27 + //回复
  28 + reply(e) {
  29 + const id = e.currentTarget.dataset.id;
  30 + wx.navigateTo({url:'/pages/comment/comment?is_reply=' + true
  31 + + '&activity_id=' + this.data.detail_id + '&common_id=' + id
  32 + })
29 }, 33 },
  34 + //收藏/取消收藏
30 collect() { 35 collect() {
31 console.log('收藏'); 36 console.log('收藏');
  37 + let self = this;
  38 + let url = '/portal/Active/collection';
  39 + let url_del = '/portal/Active/delCollection';
  40 + let header = {
  41 + "XX-Token": wx.getStorageSync('token')
  42 + };
  43 + let params = {
  44 + token: wx.getStorageSync('token'),
  45 + activeId: self.data.detail_id,
  46 + };
  47 + if(self.data.is_collect) {
  48 + app.post(url_del, params, header).then((res) => {
  49 + console.log('取消收藏',res);
  50 + if(+res.code === 1) {
  51 + wx.showToast({title:res.message,icon:'none'});
  52 + self.setData({
  53 + is_collect: 0
  54 + });
  55 + }
  56 + })
  57 + }else {
  58 + app.post(url, params, header).then((res) => {
  59 + console.log('收藏',res);
  60 + if(+res.code === 1) {
  61 + wx.showToast({title:res.message,icon:'none'});
  62 + self.setData({
  63 + is_collect: 1
  64 + });
  65 + }
  66 + })
  67 + }
  68 +
  69 + },
  70 + //点赞
  71 + clickZan(e) {
  72 + let self = this;
  73 + const id = e.currentTarget.dataset.id;
  74 + const index = e.currentTarget.dataset.index;
  75 + let url = '/portal/Active/perfect';
  76 + let header = {
  77 + "XX-Token": wx.getStorageSync('token')
  78 + };
  79 + let params = {
  80 + token: wx.getStorageSync('token'),
  81 + commonId: id,
  82 + };
  83 + app.post(url, params, {}).then((res) => {
  84 + console.log('点赞', res);
  85 + if (+res.code === 1) { //
  86 + wx.showToast({title:res.message,icon:'none'});
  87 + self.setData({
  88 + [`commentList[${index}].is_prefect`]: true,
  89 + [`commentList[${index}].prefect`]: +self.data.commentList[index].prefect +1,
  90 + });
  91 + // console.log('paise_user', paise_user);
  92 + }
  93 + })
32 }, 94 },
33 swiperChange(e) { 95 swiperChange(e) {
34 // console.log(e); 96 // console.log(e);
35 this.setData({current_swiper: e.detail.current}) 97 this.setData({current_swiper: e.detail.current})
36 }, 98 },
37 onPageScroll(e) { 99 onPageScroll(e) {
38 - console.log('页面滚动', e); 100 + // console.log('页面滚动', e);
39 if(e.scrollTop > 140) { 101 if(e.scrollTop > 140) {
40 this.setData({hidden_top:true}) 102 this.setData({hidden_top:true})
41 }else if(e.scrollTop <=140){ 103 }else if(e.scrollTop <=140){
@@ -73,6 +135,7 @@ Page({ @@ -73,6 +135,7 @@ Page({
73 let url = '/portal/Active/activeDetail'; 135 let url = '/portal/Active/activeDetail';
74 let params = { 136 let params = {
75 activeId: self.data.detail_id, 137 activeId: self.data.detail_id,
  138 + token:wx.getStorageSync('token'),
76 }; 139 };
77 let header = { 140 let header = {
78 "token": wx.getStorageSync('token') 141 "token": wx.getStorageSync('token')
@@ -84,10 +147,14 @@ Page({ @@ -84,10 +147,14 @@ Page({
84 detail: res.data.active, 147 detail: res.data.active,
85 end_time: res.data.active.time, 148 end_time: res.data.active.time,
86 over_hours:res.data.active.over_time,//几小时截止 149 over_hours:res.data.active.over_time,//几小时截止
  150 + join_people: res.data.son,
  151 + commentList:res.data.common,
  152 + is_collect:res.data.is_collect,
  153 + count:res.data.count,
87 }); 154 });
88 self.countDown(); 155 self.countDown();
89 } 156 }
90 - wx.hideLoading() 157 + // wx.hideLoading()
91 }) 158 })
92 159
93 }, 160 },
@@ -135,7 +202,22 @@ Page({ @@ -135,7 +202,22 @@ Page({
135 // countDownList: countDownArr, 202 // countDownList: countDownArr,
136 'detail.time': countDownArr, 203 'detail.time': countDownArr,
137 }); 204 });
138 - console.log('time',this.data.detail.time); 205 + // console.log('time',this.data.detail.time);
  206 + },
  207 +
  208 + //导航
  209 + getNavigate() {
  210 + const self = this;
  211 + const arr = self.data.detail.latng.split();
  212 + console.log('arr', arr[0], arr[1]);
  213 + wx.openLocation({//​使用微信内置地图查看位置。
  214 + latitude: +arr[0],//要去的纬度-地址
  215 + longitude: +arr[1],//要去的经度-地址
  216 + // lat:39.086437,
  217 + // lng:117.122583,
  218 + name: "",
  219 + address: self.data.detail.address
  220 + })
139 }, 221 },
140 /** 222 /**
141 * 生命周期函数--监听页面加载 223 * 生命周期函数--监听页面加载
@@ -143,7 +225,6 @@ Page({ @@ -143,7 +225,6 @@ Page({
143 onLoad: function (options) { 225 onLoad: function (options) {
144 console.log('详情options', options); 226 console.log('详情options', options);
145 this.setData({detail_id:+options.id?+options.id:''}); 227 this.setData({detail_id:+options.id?+options.id:''});
146 - this.getDetail();  
147 }, 228 },
148 229
149 /** 230 /**
@@ -157,7 +238,7 @@ Page({ @@ -157,7 +238,7 @@ Page({
157 * 生命周期函数--监听页面显示 238 * 生命周期函数--监听页面显示
158 */ 239 */
159 onShow: function () { 240 onShow: function () {
160 - 241 + this.getDetail();
161 }, 242 },
162 243
163 /** 244 /**
@@ -191,7 +272,27 @@ Page({ @@ -191,7 +272,27 @@ Page({
191 /** 272 /**
192 * 用户点击右上角分享 273 * 用户点击右上角分享
193 */ 274 */
194 - onShareAppMessage: function () {  
195 -  
196 - } 275 + onShareAppMessage: function() {
  276 + let self = this;
  277 + // 设置菜单中的转发按钮触发转发事件时的转发内容
  278 + var shareObj = {
  279 + title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
  280 + path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
  281 + imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
  282 + success: function(res) {
  283 + if (res.errMsg == 'shareAppMessage:ok') {}
  284 + },
  285 + fail: function() {
  286 + // 转发失败之后的回调
  287 + if (res.errMsg == 'shareAppMessage:fail cancel') {
  288 + // 用户取消转发
  289 + } else if (res.errMsg == 'shareAppMessage:fail') {
  290 + // 转发失败,其中 detail message 为详细失败信息
  291 + }
  292 + },
  293 + complete: function() {
  294 + // 转发结束之后的回调(转发成不成功都会执行)
  295 + }
  296 + }
  297 + },
197 }) 298 })
@@ -10,13 +10,24 @@ @@ -10,13 +10,24 @@
10 </view> 10 </view>
11 <view class="right"> 11 <view class="right">
12 <view class="collect" bindtap="collect"> 12 <view class="collect" bindtap="collect">
13 - <view class="iconfont icon-shoucang"></view> 13 + <view class="iconfont icon-shoucang" wx:if="{{!is_collect}}"></view>
  14 + <view class="iconfont icon-shoucang2" wx:if="{{is_collect}}"></view>
14 <text>收藏</text> 15 <text>收藏</text>
15 </view> 16 </view>
16 - <view class="share" bindtap="share"> 17 + <!--&lt;!&ndash;未收藏&ndash;&gt;-->
  18 + <!--<view class='collect_box' catchtap='sethits_yes' data-index='{{index}}' wx:if='{{items.is_hits==0}}'>-->
  19 + <!--<text class='iconfont icon-shoucang1 '></text>-->
  20 + <!--<text class="collect_word">收藏</text>-->
  21 + <!--</view>-->
  22 + <!--&lt;!&ndash;已收藏&ndash;&gt;-->
  23 + <!--<view class='collect_box active' catchtap='sethits_no' data-index='{{index}}' wx:else>-->
  24 + <!--<text class='iconfont icon-shoucang0 star2'></text>-->
  25 + <!--<text class="collect_word">收藏</text>-->
  26 + <!--</view>-->
  27 + <button class="share" open-type="share">
17 <view class="iconfont icon-fenxiang2"></view> 28 <view class="iconfont icon-fenxiang2"></view>
18 <text>分享</text> 29 <text>分享</text>
19 - </view> 30 + </button>
20 </view> 31 </view>
21 </view> 32 </view>
22 <swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange" 33 <swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange"
@@ -25,6 +36,7 @@ @@ -25,6 +36,7 @@
25 <navigator url="{{item}}" hover-class="navigator-hover"> 36 <navigator url="{{item}}" hover-class="navigator-hover">
26 <swiper-item> 37 <swiper-item>
27 <image src="{{item}}" class="slide-image"/> 38 <image src="{{item}}" class="slide-image"/>
  39 + <!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>-->
28 </swiper-item> 40 </swiper-item>
29 </navigator> 41 </navigator>
30 </block> 42 </block>
@@ -39,41 +51,39 @@ @@ -39,41 +51,39 @@
39 <!--地点--> 51 <!--地点-->
40 <view class="area-box"> 52 <view class="area-box">
41 <view class="title-box"> 53 <view class="title-box">
42 - <view class="title">{{detail.address}}</view> 54 + <view class="title">{{detail.title}}</view>
43 <view class="over-time"> 55 <view class="over-time">
44 <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text> 56 <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
45 后停止拼餐</view> 57 后停止拼餐</view>
46 <!--<view>--> 58 <!--<view>-->
47 - <!--<text class=''>{{detail.time[0].hou}}</text>-->  
48 - <!--<text>:</text>-->  
49 - <!--<text class=''>{{detail.time[0].min}}</text>-->  
50 - <!--<text>:</text>-->  
51 - <!--<text class=' '>{{detail.time[0].sec}}</text>--> 59 + <!--<text class=''>{{detail.time[0].hou}}</text>-->
  60 + <!--<text>:</text>-->
  61 + <!--<text class=''>{{detail.time[0].min}}</text>-->
  62 + <!--<text>:</text>-->
  63 + <!--<text class=' '>{{detail.time[0].sec}}</text>-->
52 <!--</view>--> 64 <!--</view>-->
53 </view> 65 </view>
54 <view class="area-content"> 66 <view class="area-content">
55 - <text>云峰山风景区坐落于密云水库北不老屯镇,燕落村北三公里,处于  
56 - 密云区东西两大风景区之间,东靠密云古北口 ──司马台长城──  
57 - 雾灵山风景区。</text> 67 + <text>{{detail.content}}</text>
58 </view> 68 </view>
59 </view> 69 </view>
60 70
61 <!--详细时间--> 71 <!--详细时间-->
62 <view class="detail-box"> 72 <view class="detail-box">
63 - <text>时间:2018.04.08 17:30</text>  
64 - <text>餐厅:Opera Bombana</text>  
65 - <view class="position">  
66 - <text class="address">地址:侨福芳草地B2 OPERA BOMBANA</text> 73 + <text>时间:{{end_time}}</text>
  74 + <text>餐厅:{{detail.addr}}</text>
  75 + <view class="position" bindtap="getNavigate">
  76 + <text class="address">地址:{{detail.address}}</text>
67 <text class="iconfont icon-location"></text> 77 <text class="iconfont icon-location"></text>
68 </view> 78 </view>
69 - <text>菜系:意大利菜</text> 79 + <text>类别:{{detail.selectName}}</text>
70 </view> 80 </view>
71 81
72 <!--已加入人员--> 82 <!--已加入人员-->
73 <view class="join-num">已加入人员</view> 83 <view class="join-num">已加入人员</view>
74 - <view class="people-list" wx:if="{{peopleList.length>0}}">  
75 - <view class="people" wx:for="{{peopleList}}" wx:key="index" bindtap="goPetDetail" data-id="{{item.id}}">  
76 - <view class="bg"><image src="{{item.img}}" class="people-img"></image></view> 84 + <view class="people-list" wx:if="{{join_people.length>0}}">
  85 + <view class="people" wx:for="{{join_people}}" wx:key="index">
  86 + <view class="bg"><image src="{{item.pic}}" class="people-img"></image></view>
77 <view class="name">{{item.name}}</view> 87 <view class="name">{{item.name}}</view>
78 </view> 88 </view>
79 </view> 89 </view>
@@ -81,8 +91,8 @@ @@ -81,8 +91,8 @@
81 <!--留言板 问一问--> 91 <!--留言板 问一问-->
82 <view class="comment-box"> 92 <view class="comment-box">
83 <view class="title-box"> 93 <view class="title-box">
84 - <text class="comment-num">留言板 (28)</text>  
85 - <view class="ask-btn"> 94 + <text class="comment-num">留言板 ({{count}})</text>
  95 + <view class="ask-btn" bindtap="ask">
86 <text class="iconfont icon-bianji"></text> 96 <text class="iconfont icon-bianji"></text>
87 <text>问一问</text> 97 <text>问一问</text>
88 </view> 98 </view>
@@ -90,34 +100,38 @@ @@ -90,34 +100,38 @@
90 100
91 <!--评论--> 101 <!--评论-->
92 <view class="comment-list-box"> 102 <view class="comment-list-box">
93 - <view class="comment-item"> 103 + <view class="comment-item" wx:for="{{commentList}}" wx:key="index" wx:for-item="comment">
94 <view class="top-content"> 104 <view class="top-content">
95 <view class="top-left"> 105 <view class="top-left">
96 - <image src="../../../images/avatar@2x.png" class="release-img"></image>  
97 - <text>旦巴 2018-08-09</text> 106 + <!--<image src="../../../images/avatar@2x.png" class="release-img"></image>-->
  107 + <image src="{{comment.userPic}}" class="release-img"></image>
  108 + <text>{{comment.userName}} {{comment.create_time}}</text>
98 </view> 109 </view>
99 - <view class="top-right">  
100 - <text>20</text>  
101 - <text class="iconfont icon-zan"></text> 110 + <view class="top-right" bindtap="clickZan" data-id="{{comment.id}}" data-index="{{index}}">
  111 + <text>{{comment.prefect}}</text>
  112 + <text class="iconfont icon-zan" wx:if="{{!comment.is_prefect}}"></text>
  113 + <text class="iconfont icon-z-likeFill" wx:if="{{comment.is_prefect}}"></text>
102 </view> 114 </view>
103 </view> 115 </view>
104 <view class="comment-detail"> 116 <view class="comment-detail">
105 <view class="user-release"> 117 <view class="user-release">
106 - <view class="release-comment">第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无 聊,但是没想到拼友和餐厅都非常好!绝对不会有无聊的时候。 整个旅途非常开心!</view>  
107 - <text class="reply-btn">回复</text> 118 + <view class="release-comment">{{comment.content}}</view>
  119 + <text class="reply-btn" bindtap="reply" data-id="{{comment.id}}">回复</text>
108 </view> 120 </view>
109 - <view class="user-reply"> 121 + <view class="user-reply" wx:if="{{comment.son.length>0}}">
110 <view class='triangle'></view> 122 <view class='triangle'></view>
111 - <view class="comment">  
112 - <text class="reply-name">蚂蚁: </text>  
113 - <text>第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>  
114 - </view>  
115 - <view class="reply">  
116 - <text class="reply-name">旦巴</text>  
117 - <text>回复</text>  
118 - <text class="reply-name">蚂蚁:</text>  
119 - <text>第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>  
120 - </view> 123 + <block wx:for="{{comment.son}}" wx:key="index">
  124 + <!--<view class="comment">-->
  125 + <!--<text class="reply-name">蚂蚁: </text>-->
  126 + <!--<text>{{item.content}}第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>-->
  127 + <!--</view>-->
  128 + <view class="reply">
  129 + <text class="reply-name">{{detail.userName}}</text>
  130 + <text>回复</text>
  131 + <text class="reply-name">{{comment.userName}}:</text>
  132 + <text>{{item.content}}</text>
  133 + </view>
  134 + </block>
121 </view> 135 </view>
122 </view> 136 </view>
123 </view> 137 </view>
@@ -66,6 +66,17 @@ @@ -66,6 +66,17 @@
66 flex-direction: column; 66 flex-direction: column;
67 align-items: center; 67 align-items: center;
68 justify-content: space-between; 68 justify-content: space-between;
  69 + line-height: 34rpx;
  70 + /*height: 34rpx;*/
  71 +}
  72 +.share {
  73 + border-radius: 0;
  74 + margin: 0;
  75 + padding: 0;
  76 + background: transparent;
  77 +}
  78 +.share::after {
  79 + border:0;
69 } 80 }
70 .head .position .right .collect { 81 .head .position .right .collect {
71 margin-right: 42rpx; 82 margin-right: 42rpx;
@@ -74,6 +85,14 @@ @@ -74,6 +85,14 @@
74 font-size: 30rpx; 85 font-size: 30rpx;
75 color: #ffffff; 86 color: #ffffff;
76 } 87 }
  88 +.icon-shoucang2 {
  89 + color:#DA4F2A;
  90 + font-size: 30rpx;
  91 +}
  92 +.icon-z-likeFill {
  93 + color:#DC4E48;
  94 + /*font-size: ;*/
  95 +}
77 .icon-fenxiang2 { 96 .icon-fenxiang2 {
78 font-size: 30rpx; 97 font-size: 30rpx;
79 color: #ffffff; 98 color: #ffffff;
@@ -139,10 +158,12 @@ swiper { @@ -139,10 +158,12 @@ swiper {
139 font-size: 28rpx; 158 font-size: 28rpx;
140 } 159 }
141 .area-box .title-box .over-time { 160 .area-box .title-box .over-time {
  161 + width: 34%;
142 color: #999999; 162 color: #999999;
143 font-size: 22rpx; 163 font-size: 22rpx;
144 } 164 }
145 .area-box .title-box .over-time text { 165 .area-box .title-box .over-time text {
  166 + text-align: right;
146 color:#DA4F2A; 167 color:#DA4F2A;
147 font-size: 24rpx; 168 font-size: 24rpx;
148 margin-right: 18rpx; 169 margin-right: 18rpx;
@@ -309,6 +330,7 @@ swiper { @@ -309,6 +330,7 @@ swiper {
309 color: #333333; 330 color: #333333;
310 width: 138rpx; 331 width: 138rpx;
311 margin-left: 30rpx; 332 margin-left: 30rpx;
  333 + text-align: right;
312 } 334 }
313 .user-reply { 335 .user-reply {
314 padding: 20rpx 14rpx; 336 padding: 20rpx 14rpx;
  1 +// pages/my/suggest/suggest.js
  2 +const app = getApp();
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + placeholder: '请输入您的评论',
  10 + content:'',
  11 + },
  12 + //
  13 + input(e) {
  14 + this.setData({content:e.detail.value})
  15 + },
  16 + //提交
  17 + submit(e) {
  18 + console.log('e', e,e.detail.formId);
  19 + if(this.data.content === '' ) {
  20 + wx.showToast({title:'请输入内容',icon:'none'})
  21 + }else {
  22 + let url = '/portal/Active/common';
  23 + let params = {
  24 + token:wx.getStorageSync('token'),
  25 + activeId:this.data.activity_id,
  26 + commonId: this.data.common_id,
  27 + content:this.data.content,
  28 + formId:e.detail.formId,
  29 + };
  30 + app.post(url,params,{}).then((res)=>{
  31 + console.log('提交评论',res);
  32 + if(+res.code === 1) {
  33 + wx.showToast({title:res.message,icon:'none',
  34 + success:function () {
  35 + setTimeout(function () {
  36 + wx.navigateBack({delta:1})
  37 + },500)
  38 + }
  39 + })
  40 + }
  41 + })
  42 + }
  43 + }
  44 + ,
  45 + /**
  46 + * 生命周期函数--监听页面加载
  47 + */
  48 + onLoad: function (options) {
  49 + this.setData({
  50 + is_reply: options.is_reply ? options.is_reply : '',
  51 + activity_id: options.activity_id?options.activity_id:'',
  52 + common_id:options.common_id?options.common_id:'',
  53 + })
  54 + }
  55 + ,
  56 +
  57 + /**
  58 + * 生命周期函数--监听页面初次渲染完成
  59 + */
  60 + onReady: function () {
  61 +
  62 + }
  63 + ,
  64 +
  65 + /**
  66 + * 生命周期函数--监听页面显示
  67 + */
  68 + onShow: function () {
  69 + if (this.data.is_reply == 'true') {
  70 + wx.setNavigationBarTitle({title: '回复'});
  71 + this.setData({placeholder: '请输入您的回复'})
  72 + }
  73 + }
  74 + ,
  75 +
  76 + /**
  77 + * 生命周期函数--监听页面隐藏
  78 + */
  79 + onHide: function () {
  80 +
  81 + }
  82 + ,
  83 +
  84 + /**
  85 + * 生命周期函数--监听页面卸载
  86 + */
  87 + onUnload: function () {
  88 +
  89 + }
  90 + ,
  91 +
  92 + /**
  93 + * 页面相关事件处理函数--监听用户下拉动作
  94 + */
  95 + onPullDownRefresh: function () {
  96 +
  97 + }
  98 + ,
  99 +
  100 + /**
  101 + * 页面上拉触底事件的处理函数
  102 + */
  103 + onReachBottom: function () {
  104 +
  105 + }
  106 + ,
  107 +
  108 + /**
  109 + * 用户点击右上角分享
  110 + */
  111 + onShareAppMessage: function () {
  112 +
  113 + }
  114 +})
  1 +{
  2 + "navigationBarTitleText": "评论"
  3 +}
  1 +<!--pages/my/suggest/suggest.wxml-->
  2 +<form bindsubmit="submit" bindreset="formReset" report-submit="true">
  3 + <view class="content">
  4 + <!--<view class="title">意见反馈</view>-->
  5 + <view class="input">
  6 + <textarea name="" id="" cols="30" rows="10"
  7 + placeholder="{{placeholder}}" maxlength="200"
  8 + placeholder-class="placeholder" bindinput="input"
  9 + ></textarea>
  10 + <view class="num">
  11 + <view class="iconfont icon-bianji"></view>
  12 + <text>限200字以内</text>
  13 + </view>
  14 + </view>
  15 + <!--<view class="btn-box" bindtap="submit">-->
  16 + <!--<view class="btn">提交</view>-->
  17 + <!--</view>-->
  18 + <button class="btn-box" form-type="submit">
  19 + <view class="btn">提交</view>
  20 + </button>
  21 + </view>
  22 +</form>
  1 +/* pages/my/suggest/suggest.wxss */
  2 +page {
  3 + width: 100%;
  4 + height: 100%;
  5 + background-color: #f2f2f2;
  6 +}
  7 +.content {
  8 + width: 100%;
  9 + height: 100%;
  10 + position: relative;
  11 +}
  12 +.title {
  13 + border-bottom: 1rpx solid #ebebeb;
  14 + padding: 28rpx 32rpx 28rpx 32rpx;
  15 + color:#292525;
  16 + font-size: 30rpx;
  17 + font-weight: bold;
  18 +}
  19 +.input {
  20 + display: flex;
  21 + flex-direction: column;
  22 + align-items: center;
  23 + justify-content: space-between;
  24 + padding: 68rpx 32rpx 32rpx 32rpx;
  25 + -webkit-box-sizing: border-box;
  26 + -moz-box-sizing: border-box;
  27 + box-sizing: border-box;
  28 + position: relative;
  29 +}
  30 +textarea {
  31 + width:80%;
  32 + border-radius: 16rpx;
  33 + background-color: #ffffff;
  34 + height: 360rpx;
  35 + color: #666666;
  36 + font-size: 28rpx;
  37 + padding: 30rpx;
  38 +}
  39 +.placeholder {
  40 + color: #999999;
  41 + font-size: 28rpx;
  42 +}
  43 +.btn-box {
  44 + width: 100%;
  45 + padding: 0 32rpx;
  46 + -webkit-box-sizing: border-box;
  47 + -moz-box-sizing: border-box;
  48 + box-sizing: border-box;
  49 + margin-top: 102rpx;
  50 +}
  51 +.btn {
  52 + height: 98rpx;
  53 + color: #E1C8AF;
  54 + font-size: 30rpx;
  55 + background-color: #323232;
  56 + border-radius: 16rpx;
  57 + display: flex;
  58 + align-items: center;
  59 + justify-content: center;
  60 +}
  61 +.num {
  62 + position: absolute;
  63 + right:100rpx;
  64 + bottom:50rpx;
  65 + font-size: 24rpx;
  66 + color: #999999;
  67 + display: flex;
  68 + align-items: center;
  69 +}
  70 +.icon-bianji {
  71 + color: #999999;
  72 + font-size: 46rpx;
  73 + margin-right: 20rpx;
  74 +}
1 // pages/index/answer-question/answer-question.js 1 // pages/index/answer-question/answer-question.js
  2 +const app = getApp();
2 Page({ 3 Page({
3 4
4 /** 5 /**
5 * 页面的初始数据 6 * 页面的初始数据
6 */ 7 */
7 - data: {}, 8 + data: {
  9 + current_que: 0,
  10 + current_answer: 0,
  11 + choose: false,
  12 + },
  13 + clickQuestion(e) {
  14 + // console.log('e', e);
  15 + const current_que = +e.currentTarget.dataset.pindex;
  16 + const que_list = this.data.questionList;
  17 + // const choose = +e.currentTarget.dataset.choose;
  18 + que_list[current_que].choose = true;
  19 + this.setData({current_que: current_que, que_list: que_list});
  20 + console.log('父级点击事件que_list', que_list, current_que);
  21 + // return false
  22 + // this.radioChange(e)
  23 + },
8 //选择答案 24 //选择答案
9 chooseAnswer(e) { 25 chooseAnswer(e) {
10 - const current = +e.currentTarget.dataset.index;  
11 - console.log(current);  
12 - this.setData({current:current}) 26 + const current = +e.currentTarget.dataset.sindex;
  27 + const pindex = +e.currentTarget.dataset.pindex;
  28 + const score = +e.currentTarget.dataset.score;
  29 + console.log('label事件分数', score);
  30 + this.setData({current_ans: current,});
  31 +
  32 + // [`questionList[${this.data.current_que}].content[${current}].checked`]:!this.data.choose
  33 + },
  34 + radioChange(e) {
  35 + const current_index = e.detail.value;
  36 + const pindex = +e.currentTarget.dataset.pindex;//父级index
  37 + let que_arr = [];
  38 + this.data.questionList.forEach((item) => {
  39 + que_arr.push({...item, choose: false});
  40 + });
  41 + let answer = que_arr[pindex].content;
  42 + answer[current_index]['checked'] = true;
  43 + answer.forEach((item) => {
  44 + if (item.answer !== answer[current_index].answer) {
  45 + item.checked = false;
  46 + }
  47 + });
  48 + // if (this.data.current_answer === +e.detail.value) {
  49 + // answer[current_index]['checked'] = true;
  50 + // answer.forEach((item) => {
  51 + // if(item.answer !== answer[current_index].answer) {
  52 + // item.checked = false;
  53 + // }
  54 + // })
  55 + // }else {
  56 + // console.log('下一题answer', answer,current_index);
  57 + // answer[current_index]['checked'] = true;
  58 + // answer.forEach((item) => {
  59 + // if(item.answer !== answer[current_index].answer) {
  60 + // item.checked = false;
  61 + // }
  62 + // })
  63 + // }
  64 + this.setData({current_answer: +e.detail.value, [`questionList[${pindex}].content`]: answer});
  65 + console.log('questionList', this.data.questionList);
  66 + },
  67 + //题目列表
  68 + answerList() {
  69 + const self = this;
  70 + let url = '/portal/Send/index';
  71 + let params = {
  72 + token: wx.getStorageSync('token'),
  73 + };
  74 + let header = {
  75 + "token": wx.getStorageSync('token')
  76 + };
  77 + app.post(url, params, {}).then((res) => {
  78 + console.log('题目', res);
  79 + if (+res.code === 1) {
  80 + res.data.list.forEach(((item) => {
  81 + item.choose = false;
  82 + item.content.forEach((item) => {
  83 + item.checked = false
  84 + })
  85 + }));
  86 + self.setData({
  87 + questionList: res.data.list,
  88 + });
  89 + console.log(self.data.questionList);
  90 + }
  91 + })
  92 + },
  93 + //提交
  94 + submit() {
  95 + this.data.questionList.forEach((item) => {
  96 + if (item.choose === false) {
  97 + wx.showToast({title: '请答完所有的题', icon: 'none'});
  98 + } else {
  99 + this.setData({is_all_answer: true})
  100 + }
  101 + });
  102 + if (this.data.is_all_answer) {
  103 + let total_score = 0;
  104 + this.data.questionList.forEach((item) => {
  105 + item.content.forEach((i, index) => {
  106 + if (i.checked) {
  107 + const score = +i.score;
  108 + total_score += score;
  109 + }
  110 + })
  111 + });
  112 + console.log('total_score', total_score);
  113 + this.setData({score: total_score});
  114 + let url = '/portal/Send/answer';
  115 + let params = {
  116 + token: wx.getStorageSync('token'),
  117 + score: this.data.score,
  118 + };
  119 + app.post(url, params, {}).then((res) => {
  120 + console.log('提交答案', res);
  121 + if (+res.code === 1) {
  122 + // self.setData({
  123 + // questionList: res.data.list,
  124 + // });
  125 + // console.log(self.data.questionList);
  126 + }
  127 + });
  128 + console.log('111')
  129 + }
  130 +
13 }, 131 },
14 /** 132 /**
15 * 生命周期函数--监听页面加载 133 * 生命周期函数--监听页面加载
@@ -29,7 +147,7 @@ Page({ @@ -29,7 +147,7 @@ Page({
29 * 生命周期函数--监听页面显示 147 * 生命周期函数--监听页面显示
30 */ 148 */
31 onShow: function () { 149 onShow: function () {
32 - 150 + this.answerList();
33 }, 151 },
34 152
35 /** 153 /**
@@ -8,25 +8,45 @@ @@ -8,25 +8,45 @@
8 </view> 8 </view>
9 <view class="questions-box"> 9 <view class="questions-box">
10 <view class="question-list"> 10 <view class="question-list">
11 - <view class="question-item">  
12 - <view class="question">1. 周末更乐意选择哪种休闲方式?</view>  
13 - <view class="section" bindtap="chooseAnswer" data-index="0">  
14 - <text class="{{current===0?'active':''}}">A. 宅家补觉,看书看片</text>  
15 - <image src="../../../images/choose@2x.png" wx:if="{{current===0}}" class="img"></image>  
16 - </view>  
17 - <view class="section" bindtap="chooseAnswer" data-index="1">  
18 - <text class="{{current===1?'active':''}}">B. 户外郊游或运动</text>  
19 - <image src="../../../images/choose@2x.png" wx:if="{{current===1}}" class="img"></image>  
20 - </view>  
21 - <view class="section" bindtap="chooseAnswer" data-index="2">  
22 - <text class="{{current===2?'active':''}}">C. 朋友小聚,聚餐嗨皮</text>  
23 - <image src="../../../images/choose@2x.png" wx:if="{{current===2}}" class="img"></image> 11 + <view class="question-item" wx:for="{{questionList}}" wx:key="index" wx:for-index="idx" data-pindex="{{idx}}" bindtap="clickQuestion" data-choose="{{item.choose}}">
  12 + <view class="question">{{idx+1}}. {{item.title}}</view>
  13 + <!--<view wx:for="{{item.content}}" wx:key="index" bindtap="chooseAnswer" data-score="{{item.score}}" data-sindex="{{index}}">-->
  14 + <!--<view class="section">-->
  15 + <!--<text class="{{current_que===idx&&current_ans===index?'active':''}}">{{index+1 === 1?'A':index+1 === 2?'B':index+1 === 3?'C':'D'}}. {{item.answer}}</text>-->
  16 + <!--<image src="../../../images/choose@2x.png" wx:if="{{current_que===idx&&current_ans===index}}" class="img"></image>-->
  17 + <radio-group class="section" bindchange="radioChange" data-pindex="{{idx}}">
  18 + <label class="radio" wx:for="{{item.content}}" wx:key="index" bindtap="chooseAnswer" data-score="{{item.score}}" data-sindex="{{index}}" data-pindex="{{idx}}">
  19 + <text class="{{item.checked?'active':''}}">{{index+1 === 1?'A':index+1 === 2?'B':index+1 === 3?'C':'D'}}. {{item.answer}}{{item.checked}}</text>
  20 + <radio value="{{index}}" checked="{{item.checked}}" color='#fff'/>
  21 + </label>
  22 + </radio-group>
  23 + <!--<checkbox-group class="section" bindchange="radioChange">-->
  24 + <!--<label class="radio" wx:for="{{item.content}}" wx:key="index" bindtap="chooseAnswer"-->
  25 + <!--data-score="{{item.score}}" data-sindex="{{index}}">-->
  26 + <!--<text class="{{item.checked?'active':''}}">{{index+1 === 1?'A':index+1 === 2?'B':index+1 ===-->
  27 + <!--3?'C':'D'}}. {{item.answer}}{{item.checked}}-->
  28 + <!--</text>-->
  29 + <!--<checkbox value="{{index}}" checked="{{item.checked}}" color='#fff'/>-->
  30 + <!--</label>-->
  31 + <!--</checkbox-group>-->
24 32
25 - </view>  
26 - <view class="section" bindtap="chooseAnswer" data-index="3">  
27 - <text class="{{current===3?'active':''}}">D. 看展看演出/上课进修自我提升/参加活动认识新朋友</text>  
28 - <image src="../../../images/choose@2x.png" wx:if="{{current===3}}" class="img"></image>  
29 - </view> 33 +
  34 + <!--</view>-->
  35 + <!--</view>-->
  36 +
  37 + <!--<view class="section" bindtap="chooseAnswer" data-index="1">-->
  38 + <!--<text class="{{current===1?'active':''}}">B. 户外郊游或运动</text>-->
  39 + <!--<image src="../../../images/choose@2x.png" wx:if="{{current===1}}" class="img"></image>-->
  40 + <!--</view>-->
  41 + <!--<view class="section" bindtap="chooseAnswer" data-index="2">-->
  42 + <!--<text class="{{current===2?'active':''}}">C. 朋友小聚,聚餐嗨皮</text>-->
  43 + <!--<image src="../../../images/choose@2x.png" wx:if="{{current===2}}" class="img"></image>-->
  44 +
  45 + <!--</view>-->
  46 + <!--<view class="section" bindtap="chooseAnswer" data-index="3">-->
  47 + <!--<text class="{{current===3?'active':''}}">D. 看展看演出/上课进修自我提升/参加活动认识新朋友</text>-->
  48 + <!--<image src="../../../images/choose@2x.png" wx:if="{{current===3}}" class="img"></image>-->
  49 + <!--</view>-->
30 </view> 50 </view>
31 <!--<view class="question-item">--> 51 <!--<view class="question-item">-->
32 <!--<view class="question">1. 周末更乐意选择哪种休闲方式?</view>--> 52 <!--<view class="question">1. 周末更乐意选择哪种休闲方式?</view>-->
@@ -50,4 +70,8 @@ @@ -50,4 +70,8 @@
50 <!--</view>--> 70 <!--</view>-->
51 </view> 71 </view>
52 </view> 72 </view>
  73 +
  74 + <view class="btn" bindtap="submit">
  75 + <text>提交</text>
  76 + </view>
53 </view> 77 </view>
@@ -39,7 +39,8 @@ @@ -39,7 +39,8 @@
39 } 39 }
40 .question-item .section { 40 .question-item .section {
41 display: flex; 41 display: flex;
42 - align-items: center; 42 + /*align-items: center;*/
  43 + flex-direction: column;
43 justify-content: flex-start; 44 justify-content: flex-start;
44 } 45 }
45 .question-item .section text { 46 .question-item .section text {
@@ -54,4 +55,53 @@ @@ -54,4 +55,53 @@
54 } 55 }
55 .question-item .section .active { 56 .question-item .section .active {
56 color:#E2C8B1; 57 color:#E2C8B1;
  58 +}
  59 +.btn {
  60 + width: 364rpx;
  61 + background-color: #323232;
  62 + color:#E2C8B1;
  63 + font-size: 30rpx;
  64 + border-radius: 6rpx;
  65 + text-align: center;
  66 +}
  67 +.btn text {
  68 + height: 66rpx;
  69 + line-height: 66rpx;
  70 +}
  71 +.checkbox {
  72 + display: flex;
  73 + /*align-items: center;*/
  74 + justify-content: space-between;
  75 + margin-bottom: 21rpx;
  76 +}
  77 +radio .wx-radio-input {
  78 + border: none;
  79 + color: #ffffff;
  80 +}
  81 +radio .wx-radio-input.wx-radio-input-checked{
  82 + border: none;
  83 + background: #ffffff;
  84 +}
  85 +/*选中后的对勾样式*/
  86 +radio .wx-radio-input.wx-radio-input-checked::before{
  87 + color: #E3CAB3;
  88 + background: #ffffff;
  89 + border: none;
  90 +
  91 +}
  92 +
  93 +checkbox .wx-checkbox-input {
  94 + border: none;
  95 + color: #ffffff;
  96 +}
  97 +checkbox .wx-checkbox-input.wx-checkbox-input-checked{
  98 + border: none;
  99 + background: #ffffff;
  100 +}
  101 +/*选中后的对勾样式*/
  102 +checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{
  103 + color: #E3CAB3;
  104 + background: #ffffff;
  105 + border: none;
  106 +
57 } 107 }
@@ -20,18 +20,20 @@ Page({ @@ -20,18 +20,20 @@ Page({
20 {pic: '../../images/wutaiju@2x.png', name: '舞台剧'}, 20 {pic: '../../images/wutaiju@2x.png', name: '舞台剧'},
21 ], 21 ],
22 meal_banner: [ 22 meal_banner: [
23 - {pic: 'http://pk86rwhci.bkt.clouddn.com/banner.png',address:'Opera Bombana',time:'2018.4.28'},  
24 - {pic: 'http://pk86rwhci.bkt.clouddn.com/b1@2x%20%281%29.png',address:'Opera Bombana',time:'2018.4.28'},  
25 - {pic: 'http://pk86rwhci.bkt.clouddn.com/b1@2x%20%281%29.png',address:'Opera Bombana',time:'2018.4.28'},  
26 - {pic: 'http://pk86rwhci.bkt.clouddn.com/banner.png',address:'Opera Bombana',time:'2018.4.28'}], 23 + {pic: 'http://pk86rwhci.bkt.clouddn.com/banner.png', address: 'Opera Bombana', time: '2018.4.28'},
  24 + {pic: 'http://pk86rwhci.bkt.clouddn.com/b1@2x%20%281%29.png', address: 'Opera Bombana', time: '2018.4.28'},
  25 + {pic: 'http://pk86rwhci.bkt.clouddn.com/b1@2x%20%281%29.png', address: 'Opera Bombana', time: '2018.4.28'},
  26 + {pic: 'http://pk86rwhci.bkt.clouddn.com/banner.png', address: 'Opera Bombana', time: '2018.4.28'}],
27 currentBannerIndex: 0, 27 currentBannerIndex: 0,
28 tabcurrent: {tab: 0, bubble: ''}, 28 tabcurrent: {tab: 0, bubble: ''},
29 noticeList: [], 29 noticeList: [],
30 is_showAnswer: false, 30 is_showAnswer: false,
31 is_showUserInfo: false, 31 is_showUserInfo: false,
32 - is_answer: true,  
33 - current_swiper:0,  
34 - page_number:1, 32 + is_showRelease:false,
  33 + is_write:2,//1:已填写,2:未填写
  34 + is_answer: false,
  35 + current_swiper: 0,
  36 + page_number: 1,
35 37
36 38
37 motto: 'Hello World', 39 motto: 'Hello World',
@@ -45,24 +47,28 @@ Page({ @@ -45,24 +47,28 @@ Page({
45 }, 47 },
46 //发布拼活动 48 //发布拼活动
47 releaseActivity() { 49 releaseActivity() {
  50 + this.setData({is_showRelease:false,});
48 wx.navigateTo({ 51 wx.navigateTo({
49 url: '/pages/activity/activity', 52 url: '/pages/activity/activity',
50 - }) 53 + });
51 }, 54 },
52 //发布拼餐 55 //发布拼餐
53 releaseMeal() { 56 releaseMeal() {
  57 + this.setData({is_showRelease:false,});
54 wx.navigateTo({ 58 wx.navigateTo({
55 url: '/pages/meal/meal', 59 url: '/pages/meal/meal',
56 }) 60 })
57 }, 61 },
58 //完善个人信息 62 //完善个人信息
59 goUserInfo() { 63 goUserInfo() {
  64 + this.setData({is_showUserInfo: false});
60 wx.navigateTo({ 65 wx.navigateTo({
61 url: '/pages/my/edit-info/edit-info', 66 url: '/pages/my/edit-info/edit-info',
62 }) 67 })
63 }, 68 },
64 //去答题 69 //去答题
65 goAnswer() { 70 goAnswer() {
  71 + this.setData({is_showAnswer: false});
66 wx.navigateTo({ 72 wx.navigateTo({
67 url: '/pages/index/answer-question/answer-question', 73 url: '/pages/index/answer-question/answer-question',
68 }) 74 })
@@ -71,12 +77,13 @@ Page({ @@ -71,12 +77,13 @@ Page({
71 }, 77 },
72 handleBackground() { 78 handleBackground() {
73 console.log('dianji'); 79 console.log('dianji');
74 - this.setData({is_showAnswer: false, is_showUserInfo: false,}) 80 + this.setData({is_showAnswer: false, is_showUserInfo: false,is_showRelease:false,})
75 }, 81 },
76 //进入分类详情 82 //进入分类详情
77 - goTypeDetail() { 83 + goTypeDetail(e) {
  84 + const id = +e.currentTarget.dataset.id;
78 wx.navigateTo({ 85 wx.navigateTo({
79 - url: '/pages/index/type-detail/type-detail', 86 + url: '/pages/index/type-detail/type-detail?id=' + id,
80 }) 87 })
81 }, 88 },
82 //进入号外公告详情 89 //进入号外公告详情
@@ -94,7 +101,7 @@ Page({ @@ -94,7 +101,7 @@ Page({
94 }, 101 },
95 //进入拼餐详情 102 //进入拼餐详情
96 goMealDetail(e) { 103 goMealDetail(e) {
97 - console.log('拼餐详情e',e); 104 + console.log('拼餐详情e', e);
98 const id = e.currentTarget.dataset.id; 105 const id = e.currentTarget.dataset.id;
99 wx.navigateTo({ 106 wx.navigateTo({
100 url: '/pages/meal/detail/detail?id=' + id, 107 url: '/pages/meal/detail/detail?id=' + id,
@@ -102,7 +109,7 @@ Page({ @@ -102,7 +109,7 @@ Page({
102 }, 109 },
103 //进入拼活动详情 110 //进入拼活动详情
104 goActivityDetail(e) { 111 goActivityDetail(e) {
105 - console.log('活动详情e',e); 112 + console.log('活动详情e', e);
106 const id = e.detail.activity_id; 113 const id = e.detail.activity_id;
107 wx.navigateTo({ 114 wx.navigateTo({
108 url: '/pages/activity/detail/detail?id=' + id, 115 url: '/pages/activity/detail/detail?id=' + id,
@@ -186,14 +193,21 @@ Page({ @@ -186,14 +193,21 @@ Page({
186 release(e) { 193 release(e) {
187 console.log('发布'); 194 console.log('发布');
188 const self = this; 195 const self = this;
189 - if (!self.data.is_answer) { 196 + if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2 ){ //没填写个人信息并且不可以发布 =>去填写
190 self.setData({ 197 self.setData({
191 - is_showAnswer: true 198 + is_showUserInfo: true //弹出 去填写个人信息弹框
192 }); 199 });
193 - } else { 200 +
  201 + } else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
  202 + self.setData({
  203 + is_showAnswer: true //弹出 去答题弹框
  204 + });
  205 + }else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1){ //已填写且可以发布 =>去发布
194 self.setData({ 206 self.setData({
195 - is_showUserInfo: true 207 + is_showRelease: true //弹出 去答题弹框
196 }); 208 });
  209 + }else {
  210 + wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'})
197 } 211 }
198 }, 212 },
199 //订单-导航 213 //订单-导航
@@ -237,21 +251,21 @@ Page({ @@ -237,21 +251,21 @@ Page({
237 type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息 251 type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
238 success: function (res) { 252 success: function (res) {
239 console.log('获取当前经纬度', res); 253 console.log('获取当前经纬度', res);
240 - self.setData({lat: res.latitude,lng:res.longitude}); 254 + self.setData({lat: res.latitude, lng: res.longitude});
241 // app.loginCallback(); 255 // app.loginCallback();
242 // app.loginCallback = res => { 256 // app.loginCallback = res => {
243 // console.log('show-callback-res', res); 257 // console.log('show-callback-res', res);
244 - app.getLogin().then(function (res) {  
245 - console.log('res', res);  
246 - self.getIndex(res.token)//获取首页  
247 - }); 258 + app.getLogin().then(function (res) {
  259 + console.log('res', res);
  260 + self.getIndex(res.token)//获取首页
  261 + });
248 // }; 262 // };
249 } 263 }
250 }) 264 })
251 }, 265 },
252 //获取首页内容 266 //获取首页内容
253 getIndex(res) { 267 getIndex(res) {
254 - console.log('token', res,wx.getStorageSync('token')); 268 + console.log('token', res, wx.getStorageSync('token'));
255 const self = this; 269 const self = this;
256 let url = '/portal/Index/index'; 270 let url = '/portal/Index/index';
257 let params = { 271 let params = {
@@ -265,20 +279,45 @@ Page({ @@ -265,20 +279,45 @@ Page({
265 }; 279 };
266 app.post(url, params, {}).then((res) => { 280 app.post(url, params, {}).then((res) => {
267 console.log('获取首页', res); 281 console.log('获取首页', res);
268 - if(+res.code === 1) { 282 + if (+res.code === 1) {
269 self.setData({ 283 self.setData({
270 slide: res.data.banner, 284 slide: res.data.banner,
271 - cate:res.data.cate,  
272 - china_city: res.data.city,  
273 - noticeList:res.data.extra,  
274 - meal_banner:res.data.meal,  
275 - items:res.data.active, 285 + cate: res.data.cate,
  286 + china_city: res.data.city.city,
  287 + noticeList: res.data.extra,
  288 + meal_banner: res.data.meal,
  289 + items: res.data.active,
  290 + is_canSend:res.data.is_canSend,
276 }); 291 });
  292 + wx.setStorageSync('is_canSend',res.data.is_canSend);//1:可以发布2:不可以发布
  293 + wx.setStorageSync('is_answer',res.data.is_answer);//1:已答题2:未答题
  294 + // is_answer
277 self._doRefreshMasonry(res.data.active); 295 self._doRefreshMasonry(res.data.active);
278 // console.log(this.data.this_week_test_info); 296 // console.log(this.data.this_week_test_info);
279 } 297 }
280 }) 298 })
281 }, 299 },
  300 + //是否填写个人信息
  301 + getIsWrite() {
  302 + const self = this;
  303 + let url = '/portal/Send/isWrite';
  304 + let params = {
  305 + token: wx.getStorageSync('token'),
  306 + };
  307 + let header = {
  308 + "token": wx.getStorageSync('token')
  309 + };
  310 + app.post(url, params, {}).then((res) => {
  311 + console.log('是否填写个人信息', res);
  312 + if (+res.code === 1) {
  313 + self.setData({
  314 + is_write:res.data.is_write,//1:已填写2:未填写
  315 + });
  316 + wx.setStorageSync('is_write',res.data.is_write);//1:已填写2:未填写
  317 + // console.log(this.data.this_week_test_info);
  318 + }
  319 + })
  320 + },
282 onShow() { 321 onShow() {
283 this.getLat();//获取经纬度 322 this.getLat();//获取经纬度
284 // wx.chooseLocation({ 323 // wx.chooseLocation({
@@ -295,13 +334,14 @@ Page({ @@ -295,13 +334,14 @@ Page({
295 // }) 334 // })
296 console.log('index-show'); 335 console.log('index-show');
297 console.log(app.globalData.userInfo); 336 console.log(app.globalData.userInfo);
  337 + this.getIsWrite();
298 }, 338 },
299 onPageScroll(e) { 339 onPageScroll(e) {
300 // console.log('页面滚动', e); 340 // console.log('页面滚动', e);
301 - if(e.scrollTop > 140) {  
302 - this.setData({hidden_top:true})  
303 - }else if(e.scrollTop <=140){  
304 - this.setData({hidden_top:false}) 341 + if (e.scrollTop > 140) {
  342 + this.setData({hidden_top: true})
  343 + } else if (e.scrollTop <= 140) {
  344 + this.setData({hidden_top: false})
305 } 345 }
306 }, 346 },
307 }); 347 });
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> 5 <view class="position {{hidden_top?'hidden-active':'visible-active'}}">
6 <view class="left"> 6 <view class="left">
7 <view class="iconfont icon-location"></view> 7 <view class="iconfont icon-location"></view>
8 - <text>天津</text> 8 + <text>{{china_city}}</text>
9 <view class="iconfont icon-arrow-down"></view> 9 <view class="iconfont icon-arrow-down"></view>
10 </view> 10 </view>
11 <view class="right" bindtap="search"> 11 <view class="right" bindtap="search">
@@ -19,7 +19,6 @@ @@ -19,7 +19,6 @@
19 <navigator url="{{item.link}}" hover-class="navigator-hover"> 19 <navigator url="{{item.link}}" hover-class="navigator-hover">
20 <swiper-item> 20 <swiper-item>
21 <!--<image src="{{item.pic}}" class="slide-image"/>--> 21 <!--<image src="{{item.pic}}" class="slide-image"/>-->
22 - <!--写死的图-->  
23 <image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"/> 22 <image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"/>
24 </swiper-item> 23 </swiper-item>
25 </navigator> 24 </navigator>
@@ -35,7 +34,7 @@ @@ -35,7 +34,7 @@
35 <!--分类导航--> 34 <!--分类导航-->
36 <view class="padding-box"> 35 <view class="padding-box">
37 <view class="navigator-box"> 36 <view class="navigator-box">
38 - <view class="img-box" wx:for="{{cate}}" wx:key="index" bindtap="goTypeDetail" data-index="{{index}}"> 37 + <view class="img-box" wx:for="{{cate}}" wx:key="index" bindtap="goTypeDetail" data-id="{{item.id}}">
39 <!--<image src="{{item.pic}}"></image>--> 38 <!--<image src="{{item.pic}}"></image>-->
40 <!--<view class="text">{{item.name}}</view>--> 39 <!--<view class="text">{{item.name}}</view>-->
41 <image src="{{item.pic}}"></image> 40 <image src="{{item.pic}}"></image>
@@ -150,7 +149,9 @@ @@ -150,7 +149,9 @@
150 <view class="title">请先完善个人信息</view> 149 <view class="title">请先完善个人信息</view>
151 <view class="answer-btn" bindtap="goUserInfo">完成</view> 150 <view class="answer-btn" bindtap="goUserInfo">完成</view>
152 </view> 151 </view>
153 - <view class="release-btn-box" wx:if="{{is_showUserInfo}}"> 152 + <view class="modal_box" wx:if="{{is_showUserInfo}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  153 + <!--发布-->
  154 + <view class="release-btn-box" wx:if="{{is_showRelease}}">
154 <view class="left-btn" bindtap="releaseMeal"> 155 <view class="left-btn" bindtap="releaseMeal">
155 <image src="../../images/pincan@2x.png"></image> 156 <image src="../../images/pincan@2x.png"></image>
156 <view class="text">发布拼餐</view> 157 <view class="text">发布拼餐</view>
@@ -160,5 +161,5 @@ @@ -160,5 +161,5 @@
160 <view class="text">发布拼活动</view> 161 <view class="text">发布拼活动</view>
161 </view> 162 </view>
162 </view> 163 </view>
163 - <view class="modal_box" wx:if="{{is_showUserInfo}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view> 164 + <view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
164 </view> 165 </view>
@@ -21,10 +21,19 @@ Page({ @@ -21,10 +21,19 @@ Page({
21 page_number:1, 21 page_number:1,
22 hasMore:true, 22 hasMore:true,
23 }, 23 },
24 - goPostDetail() {  
25 - wx.navigateTo({  
26 - url: '/pages/activity/detail/detail',  
27 - }) 24 + goPostDetail(e) {
  25 + const id = +e.currentTarget.dataset.id;
  26 + const type = +e.currentTarget.dataset.type;
  27 + console.log('type', type);
  28 + if(type === 1) { //1是活动,2是拼餐
  29 + wx.navigateTo({
  30 + url: '/pages/activity/detail/detail?id=' + id,
  31 + })
  32 + }else {
  33 + wx.navigateTo({
  34 + url: '/pages/meal/detail/detail?id=' + id,
  35 + })
  36 + }
28 }, 37 },
29 //搜索 38 //搜索
30 search() { 39 search() {
@@ -134,7 +143,8 @@ Page({ @@ -134,7 +143,8 @@ Page({
134 * 生命周期函数--监听页面加载 143 * 生命周期函数--监听页面加载
135 */ 144 */
136 onLoad: function (options) { 145 onLoad: function (options) {
137 - 146 + console.log('options', options);
  147 + this.setData({select_id:+options.id?+options.id:''})
138 }, 148 },
139 149
140 /** 150 /**
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 <view class='content_box'> 78 <view class='content_box'>
79 <view class="no-data" wx:if="{{list.length === 0}}">暂无活动</view> 79 <view class="no-data" wx:if="{{list.length === 0}}">暂无活动</view>
80 <view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}" 80 <view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}"
81 - bindtap='goPostDetail' data-index="{{index}}"> 81 + bindtap='goPostDetail' data-id="{{item.id}}" data-type="{{item.type}}">
82 <!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>--> 82 <!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>-->
83 <image src="{{item.pic}}"></image> 83 <image src="{{item.pic}}"></image>
84 <view class="title"> 84 <view class="title">
1 // pages/activity/detail/detail.js 1 // pages/activity/detail/detail.js
  2 +const app = getApp();
  3 +var t = null;
  4 +
2 Page({ 5 Page({
3 6
4 /** 7 /**
@@ -22,16 +25,91 @@ Page({ @@ -22,16 +25,91 @@ Page({
22 {img:'../../../images/avatar@2x.png',name:'Beautiful life'}, 25 {img:'../../../images/avatar@2x.png',name:'Beautiful life'},
23 ], 26 ],
24 num:1, 27 num:1,
  28 + actEndTimeList: [],
  29 + is_zan:false,
  30 + },
  31 + // 问一问
  32 + ask(e) {
  33 + wx.navigateTo({url:'/pages/comment/comment?activity_id=' + this.data.detail_id
  34 + + '&common_id=' + 0
  35 + })
  36 + // console.log('问',e.detail.value);
  37 + // this.setData({focus:true})
25 }, 38 },
  39 + //回复
  40 + reply(e) {
  41 + const id = e.currentTarget.dataset.id;
  42 + wx.navigateTo({url:'/pages/comment/comment?is_reply=' + true
  43 + + '&activity_id=' + this.data.detail_id + '&common_id=' + id
  44 + })
  45 + },
  46 + //收藏/取消收藏
26 collect() { 47 collect() {
27 console.log('收藏'); 48 console.log('收藏');
  49 + let self = this;
  50 + let url = '/portal/Active/collection';
  51 + let url_del = '/portal/Active/delCollection';
  52 + let header = {
  53 + "XX-Token": wx.getStorageSync('token')
  54 + };
  55 + let params = {
  56 + token: wx.getStorageSync('token'),
  57 + activeId: self.data.detail_id,
  58 + };
  59 + if(self.data.is_collect) {
  60 + app.post(url_del, params, header).then((res) => {
  61 + console.log('取消收藏',res);
  62 + if(+res.code === 1) {
  63 + wx.showToast({title:res.message,icon:'none'});
  64 + self.setData({
  65 + is_collect: 0
  66 + });
  67 + }
  68 + })
  69 + }else {
  70 + app.post(url, params, header).then((res) => {
  71 + console.log('收藏',res);
  72 + if(+res.code === 1) {
  73 + wx.showToast({title:res.message,icon:'none'});
  74 + self.setData({
  75 + is_collect: 1
  76 + });
  77 + }
  78 + })
  79 + }
  80 +
  81 + },
  82 + //点赞
  83 + clickZan(e) {
  84 + let self = this;
  85 + const id = e.currentTarget.dataset.id;
  86 + const index = e.currentTarget.dataset.index;
  87 + let url = '/portal/Active/perfect';
  88 + let header = {
  89 + "XX-Token": wx.getStorageSync('token')
  90 + };
  91 + let params = {
  92 + token: wx.getStorageSync('token'),
  93 + commonId: id,
  94 + };
  95 + app.post(url, params, {}).then((res) => {
  96 + console.log('点赞', res);
  97 + if (+res.code === 1) { //
  98 + wx.showToast({title:res.message,icon:'none'});
  99 + self.setData({
  100 + [`commentList[${index}].is_prefect`]: true,
  101 + [`commentList[${index}].prefect`]: +self.data.commentList[index].prefect +1,
  102 + });
  103 + // console.log('paise_user', paise_user);
  104 + }
  105 + })
28 }, 106 },
29 swiperChange(e) { 107 swiperChange(e) {
30 // console.log(e); 108 // console.log(e);
31 this.setData({current_swiper: e.detail.current}) 109 this.setData({current_swiper: e.detail.current})
32 }, 110 },
33 onPageScroll(e) { 111 onPageScroll(e) {
34 - console.log('页面滚动', e); 112 + // console.log('页面滚动', e);
35 if(e.scrollTop > 140) { 113 if(e.scrollTop > 140) {
36 this.setData({hidden_top:true}) 114 this.setData({hidden_top:true})
37 }else if(e.scrollTop <=140){ 115 }else if(e.scrollTop <=140){
@@ -62,13 +140,153 @@ Page({ @@ -62,13 +140,153 @@ Page({
62 num: num 140 num: num
63 }); 141 });
64 }, 142 },
  143 + //获取详情
  144 + getDetail() {
  145 + const self = this;
  146 + console.log('city',self.data.city);
  147 + let url = '/portal/Active/mealDetail';
  148 + let params = {
  149 + token:wx.getStorageSync('token'),
  150 + activeId: self.data.detail_id,
  151 + };
  152 + let header = {
  153 + "token": wx.getStorageSync('token')
  154 + };
  155 + app.post(url, params, {}).then((res) => {
  156 + console.log('获取详情', res);
  157 + if (+res.code === 1) {
  158 + self.setData({
  159 + detail: res.data.active,
  160 + end_time: res.data.active.time,
  161 + over_hours:res.data.active.over_time,//几小时截止
  162 + join_people: res.data.son,
  163 + commentList:res.data.common,
  164 + is_collect:res.data.is_collect,
  165 + count:res.data.count,
  166 + });
  167 + self.countDown();
  168 + }
  169 + wx.hideLoading()
  170 + })
  171 +
  172 + },
  173 + //确认拼餐
  174 + confirmJoin() {
  175 + const self = this;
  176 + let url = '/portal/Active/join';
  177 + let params = {
  178 + token: wx.getStorageSync('token'),
  179 + number: self.data.num,
  180 + activeId: self.data.detail_id,
  181 + };
  182 + let header = {
  183 + "token": wx.getStorageSync('token')
  184 + };
  185 + app.post(url, params, {}).then((res) => {
  186 + console.log('确认拼餐', res);
  187 + if (+res.code === 1) {
  188 + wx.showToast({title:'拼餐成功',icon:'success'})
  189 + // self.setData({
  190 + // detail: res.data.active,
  191 + // end_time: res.data.active.time,
  192 + // over_hours:res.data.active.over_time,//几小时截止
  193 + // join_people: res.data.son,
  194 + // commenList:res.data.common
  195 + // });
  196 + // self.countDown();
  197 + }
  198 + })
  199 + },
  200 + timeFormat(param) { //小于10的格式化函数
  201 + return param < 10 ? '0' + param : param;
  202 + },
  203 +
  204 + countDown() { //倒计时函数
  205 + // 获取当前时间,同时得到活动结束时间数组
  206 + t = setTimeout(this.countDown, 1000);
  207 + let newTime = new Date().getTime();//当前时间戳
  208 + let end_time = app.nextTime(this.data.end_time, this.data.over_hours);//截止时间
  209 + let endTime = new Date(end_time).getTime(); //截止时间戳
  210 + let countDownArr = [];
  211 + // 对结束时间进行处理渲染到页面
  212 + let obj = null;
  213 + // 如果活动未结束,对时间进行处理
  214 + if (endTime - newTime > 0) {
  215 + let time = (endTime - newTime) / 1000;
  216 + // 获取天、时、分、秒
  217 + let day = parseInt(time / (60 * 60 * 24));
  218 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  219 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  220 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  221 + obj = {
  222 + day: this.timeFormat(day),
  223 + hou: this.timeFormat(hou),
  224 + min: this.timeFormat(min),
  225 + sec: this.timeFormat(sec)
  226 + };
  227 + t;
  228 +
  229 + } else { //活动已结束,全部设置为'00'
  230 + obj = {
  231 + day: '00',
  232 + hou: '00',
  233 + min: '00',
  234 + sec: '00'
  235 + };
  236 + clearTimeout(t)
  237 + }
  238 + countDownArr.push(obj);
  239 + // 渲染,然后每隔一秒执行一次倒计时函数
  240 + this.setData({
  241 + // countDownList: countDownArr,
  242 + 'detail.time': countDownArr,
  243 + });
  244 + // console.log('time',this.data.detail.time);
  245 + },
  246 + //导航
  247 + getNavigate() {
  248 + const self = this;
  249 + const arr = self.data.detail.latng.split();
  250 + console.log('arr', arr[0], arr[1]);
  251 + wx.openLocation({//​使用微信内置地图查看位置。
  252 + latitude: +arr[0],//要去的纬度-地址
  253 + longitude: +arr[1],//要去的经度-地址
  254 + // lat:39.086437,
  255 + // lng:117.122583,
  256 + name: "",
  257 + address: self.data.detail.address
  258 + })
  259 + },
65 /** 260 /**
66 * 生命周期函数--监听页面加载 261 * 生命周期函数--监听页面加载
67 */ 262 */
68 onLoad: function (options) { 263 onLoad: function (options) {
69 - 264 + console.log('详情options', options);
  265 + this.setData({detail_id:+options.id?+options.id:''});
  266 + },
  267 + onShareAppMessage: function() {
  268 + let self = this;
  269 + // 设置菜单中的转发按钮触发转发事件时的转发内容
  270 + var shareObj = {
  271 + title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
  272 + path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
  273 + imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
  274 + success: function(res) {
  275 + if (res.errMsg == 'shareAppMessage:ok') {}
  276 + },
  277 + fail: function() {
  278 + // 转发失败之后的回调
  279 + if (res.errMsg == 'shareAppMessage:fail cancel') {
  280 + // 用户取消转发
  281 + } else if (res.errMsg == 'shareAppMessage:fail') {
  282 + // 转发失败,其中 detail message 为详细失败信息
  283 + }
  284 + },
  285 + complete: function() {
  286 + // 转发结束之后的回调(转发成不成功都会执行)
  287 + }
  288 + }
70 }, 289 },
71 -  
72 /** 290 /**
73 * 生命周期函数--监听页面初次渲染完成 291 * 生命周期函数--监听页面初次渲染完成
74 */ 292 */
@@ -80,7 +298,7 @@ Page({ @@ -80,7 +298,7 @@ Page({
80 * 生命周期函数--监听页面显示 298 * 生命周期函数--监听页面显示
81 */ 299 */
82 onShow: function () { 300 onShow: function () {
83 - 301 + this.getDetail();
84 }, 302 },
85 303
86 /** 304 /**
@@ -94,7 +312,7 @@ Page({ @@ -94,7 +312,7 @@ Page({
94 * 生命周期函数--监听页面卸载 312 * 生命周期函数--监听页面卸载
95 */ 313 */
96 onUnload: function () { 314 onUnload: function () {
97 - 315 + clearTimeout(t)
98 }, 316 },
99 317
100 /** 318 /**
@@ -110,11 +328,4 @@ Page({ @@ -110,11 +328,4 @@ Page({
110 onReachBottom: function () { 328 onReachBottom: function () {
111 329
112 }, 330 },
113 -  
114 - /**  
115 - * 用户点击右上角分享  
116 - */  
117 - onShareAppMessage: function () {  
118 -  
119 - }  
120 }) 331 })
@@ -4,32 +4,45 @@ @@ -4,32 +4,45 @@
4 <view class="head"> 4 <view class="head">
5 <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> 5 <view class="position {{hidden_top?'hidden-active':'visible-active'}}">
6 <view class="left"> 6 <view class="left">
7 - <image src="../../../images/avatar@2x.png" class="user-avatar"></image>  
8 - <text>旦巴</text> 7 + <!--<image src="../../../images/avatar@2x.png" class="user-avatar"></image>-->
  8 + <image src="{{detail.userPic}}" class="user-avatar"></image>
  9 + <text>{{detail.userName}}</text>
9 </view> 10 </view>
10 <view class="right"> 11 <view class="right">
11 <view class="collect" bindtap="collect"> 12 <view class="collect" bindtap="collect">
12 - <view class="iconfont icon-shoucang"></view> 13 + <view class="iconfont icon-shoucang" wx:if="{{!is_collect}}"></view>
  14 + <view class="iconfont icon-shoucang2" wx:if="{{is_collect}}"></view>
13 <text>收藏</text> 15 <text>收藏</text>
14 </view> 16 </view>
15 - <view class="share" bindtap="share"> 17 + <!--&lt;!&ndash;未收藏&ndash;&gt;-->
  18 + <!--<view class='collect_box' catchtap='sethits_yes' data-index='{{index}}' wx:if='{{items.is_hits==0}}'>-->
  19 + <!--<text class='iconfont icon-shoucang1 '></text>-->
  20 + <!--<text class="collect_word">收藏</text>-->
  21 + <!--</view>-->
  22 + <!--&lt;!&ndash;已收藏&ndash;&gt;-->
  23 + <!--<view class='collect_box active' catchtap='sethits_no' data-index='{{index}}' wx:else>-->
  24 + <!--<text class='iconfont icon-shoucang0 star2'></text>-->
  25 + <!--<text class="collect_word">收藏</text>-->
  26 + <!--</view>-->
  27 + <button class="share" open-type="share">
16 <view class="iconfont icon-fenxiang2"></view> 28 <view class="iconfont icon-fenxiang2"></view>
17 <text>分享</text> 29 <text>分享</text>
18 - </view> 30 + </button>
19 </view> 31 </view>
20 </view> 32 </view>
21 <swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange" 33 <swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange"
22 autoplay="{{true}}" interval="3000" duration="1000"> 34 autoplay="{{true}}" interval="3000" duration="1000">
23 - <block wx:for="{{slide}}" wx:key="index">  
24 - <navigator url="{{item.url}}" hover-class="navigator-hover"> 35 + <block wx:for="{{detail.banner}}" wx:key="index">
  36 + <navigator url="{{item}}" hover-class="navigator-hover">
25 <swiper-item> 37 <swiper-item>
26 - <image src="{{item.image}}" class="slide-image"/> 38 + <image src="{{item}}" class="slide-image"/>
  39 + <!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>-->
27 </swiper-item> 40 </swiper-item>
28 </navigator> 41 </navigator>
29 </block> 42 </block>
30 </swiper> 43 </swiper>
31 <view class="dots"> 44 <view class="dots">
32 - <block wx:for="{{slide}}" wx:key="index" wx:for-index="idx"> 45 + <block wx:for="{{detail.banner}}" wx:key="index" wx:for-index="idx">
33 <view class="dot{{idx == current_swiper ? ' active' : ''}}"></view> 46 <view class="dot{{idx == current_swiper ? ' active' : ''}}"></view>
34 </block> 47 </block>
35 </view> 48 </view>
@@ -38,32 +51,44 @@ @@ -38,32 +51,44 @@
38 <!--地点--> 51 <!--地点-->
39 <view class="area-box"> 52 <view class="area-box">
40 <view class="title-box"> 53 <view class="title-box">
41 - <view class="title">北京密云云峰山</view>  
42 - <view class="over-time"><text>23:54:26</text> 后停止拼餐</view> 54 + <view class="title">{{detail.title}}</view>
  55 + <view class="over-time">
  56 + <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
  57 + 后停止拼餐</view>
  58 + <!--<view>-->
  59 + <!--<text class=''>{{detail.time[0].hou}}</text>-->
  60 + <!--<text>:</text>-->
  61 + <!--<text class=''>{{detail.time[0].min}}</text>-->
  62 + <!--<text>:</text>-->
  63 + <!--<text class=' '>{{detail.time[0].sec}}</text>-->
  64 + <!--</view>-->
43 </view> 65 </view>
44 <view class="area-content"> 66 <view class="area-content">
45 - <text>云峰山风景区坐落于密云水库北不老屯镇,燕落村北三公里,处于  
46 - 密云区东西两大风景区之间,东靠密云古北口 ──司马台长城──  
47 - 雾灵山风景区。</text> 67 + <text>{{detail.content}}</text>
  68 + <!--云峰山风景区坐落于密云水库北不老屯镇,燕落村北三公里,处于-->
  69 + <!--密云区东西两大风景区之间,东靠密云古北口 ──司马台长城──-->
  70 + <!--雾灵山风景区。-->
48 </view> 71 </view>
49 </view> 72 </view>
50 73
51 <!--详细时间--> 74 <!--详细时间-->
52 <view class="detail-box"> 75 <view class="detail-box">
53 - <text>时间:2018.04.08 17:30</text>  
54 - <text>餐厅:Opera Bombana</text>  
55 - <view class="position">  
56 - <text class="address">地址:侨福芳草地B2 OPERA BOMBANA</text> 76 + <text>时间:{{end_time}}</text>
  77 + <text>餐厅:{{detail.addr}}</text><!--餐厅-->
  78 + <view class="position" bindtap="getNavigate">
  79 + <text class="address">地址:{{detail.address}}</text><!--地址:-->
  80 + <!--侨福芳草地B2 OPERA BOMBANA-->
57 <text class="iconfont icon-location"></text> 81 <text class="iconfont icon-location"></text>
58 </view> 82 </view>
59 - <text>菜系:意大利菜</text> 83 + <text>菜系:{{detail.selectName}}</text>
  84 + <!--意大利菜-->
60 </view> 85 </view>
61 86
62 <!--已加入人员--> 87 <!--已加入人员-->
63 <view class="join-num">已加入人员</view> 88 <view class="join-num">已加入人员</view>
64 - <view class="people-list" wx:if="{{peopleList.length>0}}">  
65 - <view class="people" wx:for="{{peopleList}}" wx:key="index" bindtap="goPetDetail" data-id="{{item.id}}">  
66 - <view class="bg"><image src="{{item.img}}" class="people-img"></image></view> 89 + <view class="people-list" wx:if="{{join_people.length>0}}">
  90 + <view class="people" wx:for="{{join_people}}" wx:key="index">
  91 + <view class="bg"><image src="{{item.pic}}" class="people-img"></image></view>
67 <view class="name">{{item.name}}</view> 92 <view class="name">{{item.name}}</view>
68 </view> 93 </view>
69 </view> 94 </view>
@@ -71,43 +96,48 @@ @@ -71,43 +96,48 @@
71 <!--留言板 问一问--> 96 <!--留言板 问一问-->
72 <view class="comment-box"> 97 <view class="comment-box">
73 <view class="title-box"> 98 <view class="title-box">
74 - <text class="comment-num">留言板 (28)</text>  
75 - <view class="ask-btn"> 99 + <text class="comment-num">留言板 ({{count}})</text>
  100 + <view class="ask-btn" bindtap="ask">
76 <text class="iconfont icon-bianji"></text> 101 <text class="iconfont icon-bianji"></text>
77 <text>问一问</text> 102 <text>问一问</text>
  103 + <!--<input type="text" class="ask-input" bindinput="ask" focus="{{focus}}"/>-->
78 </view> 104 </view>
79 </view> 105 </view>
80 106
81 <!--评论--> 107 <!--评论-->
82 <view class="comment-list-box"> 108 <view class="comment-list-box">
83 - <view class="comment-item"> 109 + <view class="comment-item" wx:for="{{commentList}}" wx:key="index" wx:for-item="comment">
84 <view class="top-content"> 110 <view class="top-content">
85 <view class="top-left"> 111 <view class="top-left">
86 - <image src="../../../images/avatar@2x.png" class="release-img"></image>  
87 - <text>旦巴 2018-08-09</text> 112 + <!--<image src="../../../images/avatar@2x.png" class="release-img"></image>-->
  113 + <image src="{{comment.userPic}}" class="release-img"></image>
  114 + <text>{{comment.userName}} {{comment.create_time}}</text>
88 </view> 115 </view>
89 - <view class="top-right">  
90 - <text>20</text>  
91 - <text class="iconfont icon-zan"></text> 116 + <view class="top-right" bindtap="clickZan" data-id="{{comment.id}}" data-index="{{index}}">
  117 + <text>{{comment.prefect}}</text>
  118 + <text class="iconfont icon-zan" wx:if="{{!comment.is_prefect}}"></text>
  119 + <text class="iconfont icon-z-likeFill" wx:if="{{comment.is_prefect}}"></text>
92 </view> 120 </view>
93 </view> 121 </view>
94 <view class="comment-detail"> 122 <view class="comment-detail">
95 <view class="user-release"> 123 <view class="user-release">
96 - <view class="release-comment">第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无 聊,但是没想到拼友和餐厅都非常好!绝对不会有无聊的时候。 整个旅途非常开心!</view>  
97 - <text class="reply-btn">回复</text> 124 + <view class="release-comment">{{comment.content}}</view>
  125 + <text class="reply-btn" bindtap="reply" data-id="{{comment.id}}">回复</text>
98 </view> 126 </view>
99 - <view class="user-reply"> 127 + <view class="user-reply" wx:if="{{comment.son.length>0}}">
100 <view class='triangle'></view> 128 <view class='triangle'></view>
101 - <view class="comment">  
102 - <text class="reply-name">蚂蚁: </text>  
103 - <text>第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>  
104 - </view>  
105 - <view class="reply">  
106 - <text class="reply-name">旦巴</text>  
107 - <text>回复</text>  
108 - <text class="reply-name">蚂蚁:</text>  
109 - <text>第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>  
110 - </view> 129 + <block wx:for="{{comment.son}}" wx:key="index">
  130 + <!--<view class="comment">-->
  131 + <!--<text class="reply-name">蚂蚁: </text>-->
  132 + <!--<text>{{item.content}}第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>-->
  133 + <!--</view>-->
  134 + <view class="reply">
  135 + <text class="reply-name">{{detail.userName}}</text>
  136 + <text>回复</text>
  137 + <text class="reply-name">{{comment.userName}}:</text>
  138 + <text>{{item.content}}</text>
  139 + </view>
  140 + </block>
111 </view> 141 </view>
112 </view> 142 </view>
113 </view> 143 </view>
@@ -123,7 +153,7 @@ @@ -123,7 +153,7 @@
123 <view class='iconfont icon-jia1' bindtap='addCount'></view> 153 <view class='iconfont icon-jia1' bindtap='addCount'></view>
124 </view> 154 </view>
125 </view> 155 </view>
126 - <view class="confirm-join-btn"> 156 + <view class="confirm-join-btn" bindtap="confirmJoin">
127 <text>确认拼餐</text> 157 <text>确认拼餐</text>
128 </view> 158 </view>
129 </view> 159 </view>
@@ -66,6 +66,17 @@ @@ -66,6 +66,17 @@
66 flex-direction: column; 66 flex-direction: column;
67 align-items: center; 67 align-items: center;
68 justify-content: space-between; 68 justify-content: space-between;
  69 + line-height: 34rpx;
  70 + /*height: 34rpx;*/
  71 +}
  72 +.share {
  73 + border-radius: 0;
  74 + margin: 0;
  75 + padding: 0;
  76 + background: transparent;
  77 +}
  78 +.share::after {
  79 + border:0;
69 } 80 }
70 .head .position .right .collect { 81 .head .position .right .collect {
71 margin-right: 42rpx; 82 margin-right: 42rpx;
@@ -74,10 +85,18 @@ @@ -74,10 +85,18 @@
74 font-size: 30rpx; 85 font-size: 30rpx;
75 color: #ffffff; 86 color: #ffffff;
76 } 87 }
  88 +.icon-shoucang2 {
  89 + color:#DA4F2A;
  90 + font-size: 30rpx;
  91 +}
77 .icon-fenxiang2 { 92 .icon-fenxiang2 {
78 font-size: 30rpx; 93 font-size: 30rpx;
79 color: #ffffff; 94 color: #ffffff;
80 } 95 }
  96 +.icon-z-likeFill {
  97 + color:#DC4E48;
  98 + /*font-size: ;*/
  99 +}
81 100
82 swiper { 101 swiper {
83 width: 100%; 102 width: 100%;
@@ -139,6 +158,7 @@ swiper { @@ -139,6 +158,7 @@ swiper {
139 font-size: 28rpx; 158 font-size: 28rpx;
140 } 159 }
141 .area-box .title-box .over-time { 160 .area-box .title-box .over-time {
  161 + width:34%;
142 color: #999999; 162 color: #999999;
143 font-size: 22rpx; 163 font-size: 22rpx;
144 } 164 }
@@ -309,6 +329,7 @@ swiper { @@ -309,6 +329,7 @@ swiper {
309 color: #333333; 329 color: #333333;
310 width: 138rpx; 330 width: 138rpx;
311 margin-left: 30rpx; 331 margin-left: 30rpx;
  332 + text-align: right;
312 } 333 }
313 .user-reply { 334 .user-reply {
314 padding: 20rpx 14rpx; 335 padding: 20rpx 14rpx;
@@ -400,4 +421,9 @@ swiper { @@ -400,4 +421,9 @@ swiper {
400 background-color: #F2F2F2; 421 background-color: #F2F2F2;
401 text-align: center; 422 text-align: center;
402 line-height: 40rpx; 423 line-height: 40rpx;
  424 +}
  425 +.ask-input {
  426 + position: absolute;
  427 + top: -4000rpx;
  428 + left: -4000rpx;
403 } 429 }
1 // pages/activity/activity.js 1 // pages/activity/activity.js
  2 +const app = getApp();
2 Page({ 3 Page({
3 4
4 /** 5 /**
@@ -6,7 +7,147 @@ Page({ @@ -6,7 +7,147 @@ Page({
6 */ 7 */
7 data: { 8 data: {
8 images: [], 9 images: [],
9 - typeList: ['川菜', '粤菜', '湖北菜'], 10 + images_params:[],
  11 + type_picker_list:[],
  12 + start_time:app.nowDate(),
  13 + title:'',
  14 + content:'',
  15 + min_num:'',
  16 + date:'',
  17 + time:'',
  18 + address:'',
  19 + address_position:'',
  20 + over_time:'',
  21 + is_showRelease_modal:false,
  22 + },
  23 + //查看我的订单
  24 + goMyRelease() {
  25 + wx.redirectTo({url:'/pages/order/order-detail/order-detail?id=' + this.data.order_id})
  26 + },
  27 + //完成按钮
  28 + goBack() {
  29 + wx.redirectTo({url:'/pages/spell-list/spell-list?current=' + 0})
  30 + },
  31 + //输入标题
  32 + inputTitle(e) {
  33 + this.setData({title:e.detail.value})
  34 + },
  35 + //输入内容
  36 + inputContent(e) {
  37 + this.setData({content:e.detail.value})
  38 + },
  39 + //输入最低人数
  40 + inputMinNum(e) {
  41 + this.setData({min_num:e.detail.value})
  42 + },
  43 + //输入最高人数
  44 + inputMaxNum(e) {
  45 + this.setData({max_num:e.detail.value})
  46 + },
  47 + //输入地点
  48 + inputAddress(e) {
  49 + this.setData({address:e.detail.value})
  50 + },
  51 + //获取地址
  52 + choosePosition() {
  53 + //选择当前地址,经纬度
  54 + const self = this;
  55 + wx.chooseLocation({
  56 + success(res) {
  57 + console.log(res);
  58 + self.setData({address_position: res.address,latng:res.latitude + ',' + res.longitude})
  59 + },
  60 + })
  61 + //打开地图导航
  62 + // wx.getLocation({ //获取当前经纬度
  63 + // type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
  64 + // success: function (res) {
  65 + // console.log('获取当前经纬度', res);
  66 + // wx.openLocation({//​使用微信内置地图查看位置。
  67 + // latitude: res.latitude,//要去的纬度-地址
  68 + // longitude: res.longitude,//要去的经度-地址
  69 + // name: "",
  70 + // address: ""
  71 + // })
  72 + // }
  73 + // })
  74 + },
  75 + //输入截止时间
  76 + inputOverTime(e) {
  77 + this.setData({over_time:e.detail.value})
  78 + },
  79 + //获取分类
  80 + getType() {
  81 + let url = '/portal/Send/select';
  82 + const list = [];
  83 + app.post(url, {}, {}).then((res) => {
  84 + console.log('获取分类', res);
  85 + res.data.meals.forEach((item) => {
  86 + list.push(item.name)
  87 + });
  88 + this.setData({type_picker_list: list,type_list: res.data.meals})
  89 + })
  90 + },
  91 + //确定发布
  92 + confirmRelease(e) {
  93 + if(this.data.title === '') {
  94 + wx.showToast({title:'请填写标题',icon:'none'})
  95 + }else if(this.data.content === '') {
  96 + wx.showToast({title:'请填写描述',icon:'none'})
  97 + }else if(this.data.images_params.length === 0) {
  98 + wx.showToast({title:'请上传图片',icon:'none'})
  99 + }else if (this.data.min_num === '') {
  100 + wx.showToast({title:'请填写最低人数',icon:'none'})
  101 + }else if(this.data.current_type === undefined) {
  102 + wx.showToast({title:'请选择类别',icon:'none'})
  103 + }else if(this.data.date === '') {
  104 + wx.showToast({title:'请选择日期',icon:'none'})
  105 + }else if(this.data.time === '') {
  106 + wx.showToast({title:'请选择时间',icon:'none'})
  107 + }else if(this.data.address === '') {
  108 + wx.showToast({title:'请填写地点',icon:'none'})
  109 + }else if(this.data.address_position === '') {
  110 + wx.showToast({title:'请定位地址',icon:'none'})
  111 + }else if(this.data.over_time === '') {
  112 + wx.showToast({title:'请填写截止时间',icon:'none'})
  113 + }else {
  114 + console.log('e', e,e.detail.formId);
  115 + this.data.type_list.forEach((item,index) => {
  116 + if(this.data.current_type === index) {
  117 + // console.log('index', index, item.id);
  118 + this.setData({type_id:item.id})
  119 + }
  120 + });
  121 + const images_params = this.data.images_params.join(',');
  122 + console.log('发布-images_params', images_params);
  123 + let url = '/portal/Send/sendMeals';
  124 + let header = {
  125 + "XX-token": wx.getStorageSync('token')
  126 + };
  127 + let params = {
  128 + token: wx.getStorageSync('token'),
  129 + title: this.data.title,
  130 + content:this.data.content,
  131 + pic: images_params,
  132 + number:this.data.min_num,
  133 + select_id: this.data.type_id,//类别
  134 + time: this.data.date + ' ' + this.data.time,
  135 + name: this.data.address,
  136 + address: this.data.address_position,
  137 + latng: this.data.latng,
  138 + over_time:this.data.over_time,// 报名截止时间
  139 + // formId: e.detail.formId,
  140 + };
  141 + var list = [];
  142 + app.post(url, params, {}).then((res) => {
  143 + console.log('确定发布', res);
  144 + if(+res.code === 1 && res.message == '发布成功') {
  145 + this.setData({is_showRelease_modal:true,order_id:+res.data.id})
  146 + }else {
  147 + wx.showToast({title:res.message,icon:'none'})
  148 + }
  149 + })
  150 + }
10 }, 151 },
11 //上传图片 152 //上传图片
12 choose(e) { //这里是选取图片的方法 153 choose(e) { //这里是选取图片的方法
@@ -15,7 +156,7 @@ Page({ @@ -15,7 +156,7 @@ Page({
15 count: 6, //最多可以选择的图片总数 156 count: 6, //最多可以选择的图片总数
16 sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 157 sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
17 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 158 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
18 - success: function (res) { 159 + success: function(res) {
19 // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 160 // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
20 let tempFilePaths = res.tempFilePaths; 161 let tempFilePaths = res.tempFilePaths;
21 //启动上传等待中... 162 //启动上传等待中...
@@ -30,7 +171,7 @@ Page({ @@ -30,7 +171,7 @@ Page({
30 let uploadImgCount = 0; 171 let uploadImgCount = 0;
31 for (let i = 0, h = tempFilePaths.length; i < h; i++) { 172 for (let i = 0, h = tempFilePaths.length; i < h; i++) {
32 wx.uploadFile({ 173 wx.uploadFile({
33 - url: 'https://www.magipocket.com/api/home/home/upload', 174 + url: 'http://wmatchrd.com/portal/Index/upload',
34 filePath: tempFilePaths[i], 175 filePath: tempFilePaths[i],
35 name: 'file', 176 name: 'file',
36 formData: { 177 formData: {
@@ -41,23 +182,26 @@ Page({ @@ -41,23 +182,26 @@ Page({
41 'XX-Token': token, 182 'XX-Token': token,
42 'XX-Device-Type': 'wxapp', 183 'XX-Device-Type': 'wxapp',
43 }, 184 },
44 - success: function (res) { 185 + success: function(res) {
45 uploadImgCount++; 186 uploadImgCount++;
46 let data = JSON.parse(res.data); 187 let data = JSON.parse(res.data);
47 - // console.log('data',data);  
48 - if (data.code == 20000) { 188 + console.log('data',data);
  189 + if (+data.code == 1) {
  190 + wx.hideToast();
49 //服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" } 191 //服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" }
50 let images = that.data.images; 192 let images = that.data.images;
51 -  
52 - images.push(data.msg); 193 + let images_params = that.data.images_params;
  194 + images.push(data.data.preview_url);
  195 + images_params.push(data.data.filepath);
53 that.setData({ 196 that.setData({
54 - images: images 197 + images: images,
  198 + images_params:images_params,
55 }); 199 });
56 - // console.log(images) 200 + console.log('images---images_params',images,images_params)
57 //如果是最后一张,则隐藏等待中 201 //如果是最后一张,则隐藏等待中
58 - if (uploadImgCount == tempFilePaths.length) {  
59 - wx.hideToast();  
60 - } 202 + // if (uploadImgCount == tempFilePaths.length) {
  203 + // wx.hideToast();
  204 + // }
61 } else { 205 } else {
62 wx.hideToast(); 206 wx.hideToast();
63 wx.showModal({ 207 wx.showModal({
@@ -68,14 +212,13 @@ Page({ @@ -68,14 +212,13 @@ Page({
68 } 212 }
69 213
70 }, 214 },
71 - fail: function (res) { 215 + fail: function(res) {
72 wx.hideToast(); 216 wx.hideToast();
73 wx.showModal({ 217 wx.showModal({
74 title: '错误提示', 218 title: '错误提示',
75 content: '上传图片失败', 219 content: '上传图片失败',
76 showCancel: false, 220 showCancel: false,
77 - success: function (res) {  
78 - } 221 + success: function(res) {}
79 }) 222 })
80 } 223 }
81 }); 224 });
@@ -86,10 +229,13 @@ Page({ @@ -86,10 +229,13 @@ Page({
86 // 删除图片 229 // 删除图片
87 deleteImg(e) { 230 deleteImg(e) {
88 var imgs = this.data.images; 231 var imgs = this.data.images;
  232 + var images_params = this.data.images_params;
89 var index = e.currentTarget.dataset.index; 233 var index = e.currentTarget.dataset.index;
90 imgs.splice(index, 1); 234 imgs.splice(index, 1);
  235 + images_params.splice(index, 1);
91 this.setData({ 236 this.setData({
92 - images: imgs 237 + images: imgs,
  238 + images_params:images_params,
93 }); 239 });
94 }, 240 },
95 241
@@ -108,17 +254,17 @@ Page({ @@ -108,17 +254,17 @@ Page({
108 }, 254 },
109 //选择分类 255 //选择分类
110 bindTypeChange(e) { 256 bindTypeChange(e) {
111 - this.setData({current_sex: e.detail.value}) 257 + this.setData({current_type: +e.detail.value})
112 }, 258 },
113 //选择时间 259 //选择时间
114 bindTimeChange(e) { 260 bindTimeChange(e) {
115 - this.setData({time: e.detail.value, hour: e.detail.value.split(':')[0], minute: e.detail.value.split(':')[1]})  
116 - console.log(e.detail.value.split(':'), e.detail.value.split(':')[0], e.detail.value.split(':')[1]); 261 + this.setData({time:e.detail.value,hour:e.detail.value.split(':')[0],minute: e.detail.value.split(':')[1]})
  262 + console.log(e.detail.value.split(':'),e.detail.value.split(':')[0],e.detail.value.split(':')[1]);
117 }, 263 },
118 //选择日期 264 //选择日期
119 bindDateChange(e) { 265 bindDateChange(e) {
120 - this.setData({date: e.detail.value, month: e.detail.value.split('-')[1], day: e.detail.value.split('-')[2]})  
121 - console.log(e.detail.value.split('-'), e.detail.value.split('-')[1], e.detail.value.split('-')[2]); 266 + this.setData({date:e.detail.value,month:e.detail.value.split('-')[1],day: e.detail.value.split('-')[2]})
  267 + console.log(e.detail.value.split('-'),e.detail.value.split('-')[1],e.detail.value.split('-')[2]);
122 }, 268 },
123 /** 269 /**
124 * 生命周期函数--监听页面加载 270 * 生命周期函数--监听页面加载
@@ -138,7 +284,7 @@ Page({ @@ -138,7 +284,7 @@ Page({
138 * 生命周期函数--监听页面显示 284 * 生命周期函数--监听页面显示
139 */ 285 */
140 onShow: function () { 286 onShow: function () {
141 - 287 + this.getType();
142 }, 288 },
143 289
144 /** 290 /**
1 <!--pages/activity/activity.wxml--> 1 <!--pages/activity/activity.wxml-->
  2 +<!--<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true">-->
2 <view class="content"> 3 <view class="content">
3 <view class="input-box"> 4 <view class="input-box">
4 <input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/> 5 <input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/>
5 - <textarea maxlength="-1" type="text" placeholder="发布描述..." bindinput="inputTitle" placeholder-class="placeholder"></textarea> 6 + <textarea maxlength="-1" type="text" placeholder="发布描述..." bindinput="inputContent"
  7 + placeholder-class="placeholder"></textarea>
6 </view> 8 </view>
7 9
8 <view class='upload_box'> 10 <view class='upload_box'>
@@ -28,15 +30,15 @@ @@ -28,15 +30,15 @@
28 <text class="tips">注:最低拼单人数</text> 30 <text class="tips">注:最低拼单人数</text>
29 </view> 31 </view>
30 <!--<view class="min-num">--> 32 <!--<view class="min-num">-->
31 - <!--<text class="title">最高人数</text>-->  
32 - <!--<input type="number" bindinput="inputMaxNum" class="input"/>-->  
33 - <!--<text class="iconfont icon-xiangxia min-icon"></text>--> 33 + <!--<text class="title">最高人数</text>-->
  34 + <!--<input type="number" bindinput="inputMaxNum" class="input"/>-->
  35 + <!--<text class="iconfont icon-xiangxia min-icon"></text>-->
34 <!--</view>--> 36 <!--</view>-->
35 <view class="min-num"> 37 <view class="min-num">
36 - <text class="title type-title">菜系</text>  
37 - <picker bindchange="bindTypeChange" value="{{current_sex}}" range="{{typeList}}" class="picker"> 38 + <text class="title type-title">类别</text>
  39 + <picker bindchange="bindTypeChange" value="{{current_sex}}" range="{{type_picker_list}}" class="picker">
38 <view class="input"> 40 <view class="input">
39 - <text class="variety-text">{{typeList[current_sex]}}</text> 41 + <text class="variety-text">{{type_picker_list[current_type]}}</text>
40 <!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>--> 42 <!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>-->
41 <!-- <view class="iconfont icon-arrow-down"></view> --> 43 <!-- <view class="iconfont icon-arrow-down"></view> -->
42 </view> 44 </view>
@@ -79,19 +81,30 @@ @@ -79,19 +81,30 @@
79 <text class="address-title">餐厅</text> 81 <text class="address-title">餐厅</text>
80 <input type="text" bindinput="inputAddress" class="input"/> 82 <input type="text" bindinput="inputAddress" class="input"/>
81 </view> 83 </view>
82 - <view class="address-box"> 84 + <view class="address-box" bindtap="choosePosition">
83 <text class="address-title">地址</text> 85 <text class="address-title">地址</text>
84 - <input type="text" bindinput="inputPosition" value="" class="input"/> 86 + <!--<input type="text" bindtap="choosePosition" value="" class="input"/>-->
  87 + <text class="input">{{address_position}}</text>
85 <text class="iconfont icon-location"></text> 88 <text class="iconfont icon-location"></text>
86 </view> 89 </view>
87 <view class="time-limit"> 90 <view class="time-limit">
88 <text class="limit-title">时限 开餐前</text> 91 <text class="limit-title">时限 开餐前</text>
89 - <input type="number" bindinput="inputPosition" value=""/> 92 + <input type="number" bindinput="inputOverTime" value=""/>
90 <text>小时 停止拼餐</text> 93 <text>小时 停止拼餐</text>
91 </view> 94 </view>
92 </view> 95 </view>
93 96
94 - <view class="complete"> 97 + <view class="complete" bindtap="confirmRelease">
95 <view class="btn">确定发布</view> 98 <view class="btn">确定发布</view>
96 </view> 99 </view>
97 </view> 100 </view>
  101 +<!--发布成功弹框-->
  102 +<view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll">
  103 + <image class="sorry-img" src="../../images/success@2x.png"></image>
  104 + <view class="title">恭喜您拼餐成功</view>
  105 + <view class="view-btn" catchtap="goMyRelease">查看我的订单</view>
  106 + <view class="complete-btn" catchtap="goBack">完成</view>
  107 +</view>
  108 +<view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground"
  109 + catchtouchmove="disableScroll"></view>
  110 +<!--</form>-->
@@ -20,4 +20,10 @@ @@ -20,4 +20,10 @@
20 .time-limit .limit-title { 20 .time-limit .limit-title {
21 width:173rpx; 21 width:173rpx;
22 text-align: right; 22 text-align: right;
  23 +}
  24 +.variety-text {
  25 + overflow : hidden;
  26 + display: -webkit-box;
  27 + -webkit-line-clamp: 1;
  28 + -webkit-box-orient: vertical;
23 } 29 }
1 // pages/my/edit-info/edit-info.js 1 // pages/my/edit-info/edit-info.js
  2 +const app = getApp();
  3 +
2 Page({ 4 Page({
3 5
4 /** 6 /**
@@ -9,7 +11,12 @@ Page({ @@ -9,7 +11,12 @@ Page({
9 maxlength: 50, 11 maxlength: 50,
10 minlength: 0, 12 minlength: 0,
11 currentnum: 0, 13 currentnum: 0,
  14 + country:'',
  15 + city:'',
  16 + phone_number:'',
  17 + introduce:'',
12 }, 18 },
  19 + //选择性别
13 sexPickerChange(e) { 20 sexPickerChange(e) {
14 console.log('picker发送选择改变,携带值为', e.detail.value) 21 console.log('picker发送选择改变,携带值为', e.detail.value)
15 this.setData({ 22 this.setData({
@@ -17,6 +24,13 @@ Page({ @@ -17,6 +24,13 @@ Page({
17 is_sex_change: true 24 is_sex_change: true
18 }) 25 })
19 }, 26 },
  27 + //输入手机号
  28 + inputPhone(e) {
  29 + this.setData({
  30 + phone_number: e.detail.value,
  31 + })
  32 + },
  33 + //自动获取手机号
20 getPhoneNumber(e) { 34 getPhoneNumber(e) {
21 console.log(e.detail.errMsg) 35 console.log(e.detail.errMsg)
22 console.log(e.detail.iv) 36 console.log(e.detail.iv)
@@ -49,10 +63,46 @@ Page({ @@ -49,10 +63,46 @@ Page({
49 } else { 63 } else {
50 this.setData({ 64 this.setData({
51 currentnum: len, 65 currentnum: len,
52 - content: textcontent, 66 + introduce: textcontent,
53 }) 67 })
54 } 68 }
55 }, 69 },
  70 + //保存
  71 + submit() {
  72 + if(this.data.current_sex === undefined) {
  73 + wx.showToast({title:'请选择性别',icon:'none'})
  74 + }else if(this.data.country === '') {
  75 + wx.showToast({title:'请填写国家',icon:'none'})
  76 + }else if(this.data.city === '') {
  77 + wx.showToast({title:'请填写城市',icon:'none'})
  78 + }else if (this.data.phone_number === '') {
  79 + wx.showToast({title:'请填写手机号',icon:'none'})
  80 + }else if(this.data.introduce === '') {
  81 + wx.showToast({title:'请填写简介',icon:'none'})
  82 + }else {
  83 + let url = '/portal/Member/detail';
  84 + let params = {
  85 + token: wx.getStorageSync('token'),
  86 + sex: this.data.sexList[this.data.current_sex] === '男'?1:2,
  87 + country:this.data.country,
  88 + city:this.data.city,
  89 + tel:this.data.phone_number,
  90 + introduce:this.data.introduce
  91 + };
  92 + app.post(url, params, {}).then((res) => {
  93 + console.log('保存', res);
  94 + if (+res.code === 1) {
  95 + wx.showToast({title:res.message,icon:'none',
  96 + success:function () {
  97 + setTimeout(function () {
  98 + wx.navigateBack({delta:1})
  99 + },500)
  100 + }
  101 + })
  102 + }
  103 + });
  104 + }
  105 + },
56 /** 106 /**
57 * 生命周期函数--监听页面加载 107 * 生命周期函数--监听页面加载
58 */ 108 */
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <view class="flex-box"> 27 <view class="flex-box">
28 <view class="title">手机号:</view> 28 <view class="title">手机号:</view>
29 <view class="phone-box"> 29 <view class="phone-box">
30 - <input type="text" bindinput="inputCountry"/> 30 + <input type="text" bindinput="inputCountry" bindinput="inputPhone"/>
31 <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="phone-btn">自动填写</button> 31 <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="phone-btn">自动填写</button>
32 </view> 32 </view>
33 </view> 33 </view>
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 <view class='word_num'>{{currentnum}}/{{maxlength}}</view> 38 <view class='word_num'>{{currentnum}}/{{maxlength}}</view>
39 </view> 39 </view>
40 </view> 40 </view>
41 - <view class="complete"> 41 + <view class="complete" bindtap="submit">
42 <view class="btn">完成</view> 42 <view class="btn">完成</view>
43 </view> 43 </view>
44 </view> 44 </view>
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 font-size: 26rpx; 28 font-size: 26rpx;
29 color: #666666; 29 color: #666666;
30 } 30 }
31 -.text input { 31 +.text input, .phone-box input {
32 font-size: 26rpx; 32 font-size: 26rpx;
33 color: #666666; 33 color: #666666;
34 } 34 }
1 // pages/my/my-collect/my-collect.js 1 // pages/my/my-collect/my-collect.js
  2 +const app = getApp();
2 Page({ 3 Page({
3 4
4 /** 5 /**
5 * 页面的初始数据 6 * 页面的初始数据
6 */ 7 */
7 data: { 8 data: {
8 - postList:  
9 - [  
10 - {title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:1,},  
11 - {title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:2,},  
12 - {title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:3,},  
13 - {title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:4,},  
14 - ], 9 + collectList: [],
  10 + page_number:1,
  11 + hasMore:true,
15 }, 12 },
16 - goPostDetail() {  
17 - wx.navigateTo({  
18 - url: '/pages/activity/detail/detail',  
19 - }) 13 + goPostDetail(e) {
  14 + const id = +e.currentTarget.dataset.activity_id;
  15 + const type = +e.currentTarget.dataset.type;
  16 + console.log('type', type);
  17 + if(type === 1) { //1是活动,2是拼餐
  18 + wx.navigateTo({
  19 + url: '/pages/activity/detail/detail?id=' + id,
  20 + })
  21 + }else {
  22 + wx.navigateTo({
  23 + url: '/pages/meal/detail/detail?id=' + id,
  24 + })
  25 + }
  26 + },
  27 + //获取收藏列表
  28 + getCollectList() {
  29 + let url = '/portal/Member/collection';
  30 + let params = {
  31 + token: wx.getStorageSync('token'),
  32 + };
  33 + app.post(url, params, {}).then((res) => {
  34 + console.log('获取收藏列表', res);
  35 + if (+res.code === 1) {
  36 + this.setData({
  37 + collectList: this.data.collectList.concat(res.data),
  38 + });
  39 + // console.log(self.data.questionList);
  40 + }
  41 + });
20 }, 42 },
21 /** 43 /**
22 * 生命周期函数--监听页面加载 44 * 生命周期函数--监听页面加载
@@ -36,7 +58,8 @@ Page({ @@ -36,7 +58,8 @@ Page({
36 * 生命周期函数--监听页面显示 58 * 生命周期函数--监听页面显示
37 */ 59 */
38 onShow: function () { 60 onShow: function () {
39 - 61 + this.setData({collectList: [],page_number:1,has_more: true});
  62 + this.getCollectList()
40 }, 63 },
41 64
42 /** 65 /**
@@ -64,7 +87,22 @@ Page({ @@ -64,7 +87,22 @@ Page({
64 * 页面上拉触底事件的处理函数 87 * 页面上拉触底事件的处理函数
65 */ 88 */
66 onReachBottom: function () { 89 onReachBottom: function () {
67 - 90 + const self = this;
  91 + if (self.data.has_more) {
  92 + wx.showToast({
  93 + title: '加载中~',
  94 + icon: 'loading',
  95 + duration: 200,
  96 + });
  97 + self.data.page_number++;
  98 + self.getCollectList();
  99 + } else {
  100 + wx.showToast({
  101 + title: '没有更多数据了~',
  102 + icon: 'none'
  103 + });
  104 + }
  105 + console.log('上拉加载');
68 }, 106 },
69 107
70 /** 108 /**
1 <!--pages/my/my-collect/my-collect.wxml--> 1 <!--pages/my/my-collect/my-collect.wxml-->
2 <!--文章内容--> 2 <!--文章内容-->
3 -<view class='content_box post_box' wx:if="{{postList.length > 0}}">  
4 - <view class='content_item' wx:for="{{postList}}" wx:key="index" bindtap='goPostDetail' data-index="{{index}}">  
5 - <image src="../../../images/lishi@2x.png" class="thumb"></image> 3 +<view class='content_box post_box' wx:if="{{collectList.length > 0}}">
  4 + <view class='content_item' wx:for="{{collectList}}" wx:key="index" bindtap='goPostDetail' data-type="{{item.type}}" data-activity_id="{{item.id}}">
  5 + <!--<image src="../../../images/lishi@2x.png" class="thumb"></image>-->
  6 + <image src="{{item.pic}}" class="thumb"></image>
6 <view class="lish-right"> 7 <view class="lish-right">
7 <view class="title">{{item.title}}</view> 8 <view class="title">{{item.title}}</view>
8 <view class="time">{{item.time}}</view> 9 <view class="time">{{item.time}}</view>
9 <view class="name-box"> 10 <view class="name-box">
10 - <image src="../../../images/avatar@2x.png" class="avatar"></image>  
11 - <text>{{item.name}}</text> 11 + <!--<image src="../../../images/avatar@2x.png" class="avatar"></image>-->
  12 + <image src="{{item.userPic}}" class="avatar"></image>
  13 + <text>{{item.userName}} {{item.address}}</text>
12 </view> 14 </view>
13 </view> 15 </view>
14 </view> 16 </view>
15 </view> 17 </view>
  18 +<view class="no-data" wx:if="{{collectList.length === 0}}">暂无收藏内容</view>
@@ -45,4 +45,13 @@ @@ -45,4 +45,13 @@
45 width: 40rpx; 45 width: 40rpx;
46 height: 40rpx; 46 height: 40rpx;
47 margin-right: 16rpx; 47 margin-right: 16rpx;
  48 +}
  49 +.no-data {
  50 + width: 100%;
  51 + display: flex;
  52 + align-items: center;
  53 + justify-content: center;
  54 + margin-top: 200rpx;
  55 + font-size: 28rpx;
  56 + color: #cccccc;
48 } 57 }
1 // pages/my/my-wallet/detail/detail.js 1 // pages/my/my-wallet/detail/detail.js
  2 +const app = getApp();
2 Page({ 3 Page({
3 4
4 /** 5 /**
@@ -15,6 +16,23 @@ Page({ @@ -15,6 +16,23 @@ Page({
15 console.log('获取屏幕', wx.getSystemInfoSync()); 16 console.log('获取屏幕', wx.getSystemInfoSync());
16 this.setData({screenHeight:wx.getSystemInfoSync().windowHeight}) 17 this.setData({screenHeight:wx.getSystemInfoSync().windowHeight})
17 }, 18 },
  19 + //获取我的钱包详情
  20 + getMyWallet() {
  21 + let url = '/portal/Member/moneyDetail';
  22 + let params = {
  23 + token: wx.getStorageSync('token'),
  24 + activeId:this.data.id,
  25 + };
  26 + app.post(url, params, {}).then((res) => {
  27 + console.log('获取我的钱包详情', res);
  28 + if (+res.code === 1) {
  29 + this.setData({
  30 + // collectList: this.data.collectList.concat(res.data),
  31 + });
  32 + // console.log(self.data.questionList);
  33 + }
  34 + });
  35 + },
18 /** 36 /**
19 * 生命周期函数--监听页面加载 37 * 生命周期函数--监听页面加载
20 */ 38 */
@@ -34,6 +52,7 @@ Page({ @@ -34,6 +52,7 @@ Page({
34 */ 52 */
35 onShow: function () { 53 onShow: function () {
36 this.getScreenHeight(); 54 this.getScreenHeight();
  55 + this.getMyWallet();
37 }, 56 },
38 57
39 /** 58 /**
1 // pages/my/my-wallet/my-wallet.js 1 // pages/my/my-wallet/my-wallet.js
  2 +const app = getApp();
2 Page({ 3 Page({
3 4
4 /** 5 /**
@@ -14,6 +15,22 @@ Page({ @@ -14,6 +15,22 @@ Page({
14 goDetail() { 15 goDetail() {
15 wx.navigateTo({url:'/pages/my/my-wallet/detail/detail'}) 16 wx.navigateTo({url:'/pages/my/my-wallet/detail/detail'})
16 }, 17 },
  18 + //获取我的钱包
  19 + getMyWallet() {
  20 + let url = '/portal/Member/money';
  21 + let params = {
  22 + token: wx.getStorageSync('token'),
  23 + };
  24 + app.post(url, params, {}).then((res) => {
  25 + console.log('获取我的钱包', res);
  26 + if (+res.code === 1) {
  27 + this.setData({
  28 + // collectList: this.data.collectList.concat(res.data),
  29 + });
  30 + // console.log(self.data.questionList);
  31 + }
  32 + });
  33 + },
17 /** 34 /**
18 * 生命周期函数--监听页面加载 35 * 生命周期函数--监听页面加载
19 */ 36 */
@@ -32,7 +49,7 @@ Page({ @@ -32,7 +49,7 @@ Page({
32 * 生命周期函数--监听页面显示 49 * 生命周期函数--监听页面显示
33 */ 50 */
34 onShow: function () { 51 onShow: function () {
35 - 52 + this.getMyWallet()
36 }, 53 },
37 54
38 /** 55 /**
@@ -12,27 +12,52 @@ Page({ @@ -12,27 +12,52 @@ Page({
12 is_answer: false, 12 is_answer: false,
13 is_class:1, 13 is_class:1,
14 isLogin: null, 14 isLogin: null,
  15 + is_write:2,//1:已填写,2:未填写
  16 + },
  17 + //是否填写个人信息
  18 + getIsWrite() {
  19 + const self = this;
  20 + let url = '/portal/Send/isWrite';
  21 + let params = {
  22 + token: wx.getStorageSync('token'),
  23 + };
  24 + let header = {
  25 + "token": wx.getStorageSync('token')
  26 + };
  27 + app.post(url, params, {}).then((res) => {
  28 + console.log('是否填写个人信息', res);
  29 + if (+res.code === 1) {
  30 + self.setData({
  31 + is_write:res.data.is_write,//1:已填写2:未填写
  32 + });
  33 + // console.log(this.data.this_week_test_info);
  34 + }
  35 + })
15 }, 36 },
16 //发布拼活动 37 //发布拼活动
17 releaseActivity() { 38 releaseActivity() {
  39 + this.setData({is_showRelease:false,});
18 wx.navigateTo({ 40 wx.navigateTo({
19 url: '/pages/activity/activity', 41 url: '/pages/activity/activity',
20 - }) 42 + });
21 }, 43 },
22 //发布拼餐 44 //发布拼餐
23 releaseMeal() { 45 releaseMeal() {
  46 + this.setData({is_showRelease:false,});
24 wx.navigateTo({ 47 wx.navigateTo({
25 url: '/pages/meal/meal', 48 url: '/pages/meal/meal',
26 }) 49 })
27 }, 50 },
28 - // //完善个人信息  
29 - // goUserInfo() {  
30 - // wx.navigateTo({  
31 - // url: '/pages/my/edit-info/edit-info',  
32 - // })  
33 - // }, 51 + //完善个人信息
  52 + goUserInfo() {
  53 + this.setData({is_showUserInfo: false});
  54 + wx.navigateTo({
  55 + url: '/pages/my/edit-info/edit-info',
  56 + })
  57 + },
34 //去答题 58 //去答题
35 goAnswer() { 59 goAnswer() {
  60 + this.setData({is_showAnswer: false});
36 wx.navigateTo({ 61 wx.navigateTo({
37 url: '/pages/index/answer-question/answer-question', 62 url: '/pages/index/answer-question/answer-question',
38 }) 63 })
@@ -68,7 +93,7 @@ Page({ @@ -68,7 +93,7 @@ Page({
68 }); 93 });
69 }, 94 },
70 //编辑个人信息 95 //编辑个人信息
71 - goUserInfo() { 96 + EditUserInfo() {
72 wx.navigateTo({ 97 wx.navigateTo({
73 url: '/pages/my/edit-info/edit-info', 98 url: '/pages/my/edit-info/edit-info',
74 }) 99 })
@@ -100,7 +125,7 @@ Page({ @@ -100,7 +125,7 @@ Page({
100 disableScroll() {}, 125 disableScroll() {},
101 handleBackground() { 126 handleBackground() {
102 console.log('dianji'); 127 console.log('dianji');
103 - this.setData({is_showAnswer: false,is_showUserInfo:false,}) 128 + this.setData({is_showAnswer: false, is_showUserInfo: false,is_showRelease:false,})
104 }, 129 },
105 //首页-导航 130 //首页-导航
106 service(e) { 131 service(e) {
@@ -142,13 +167,18 @@ Page({ @@ -142,13 +167,18 @@ Page({
142 release(e) { 167 release(e) {
143 console.log('发布'); 168 console.log('发布');
144 const self = this; 169 const self = this;
145 - if(!self.data.is_answer) { 170 + if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2 ){ //没填写个人信息并且不可以发布 =>去填写
  171 + self.setData({
  172 + is_showUserInfo: true //弹出 去填写个人信息弹框
  173 + });
  174 +
  175 + } else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
146 self.setData({ 176 self.setData({
147 - is_showAnswer: true 177 + is_showAnswer: true //弹出 去答题弹框
148 }); 178 });
149 - }else { 179 + }else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1){ //已填写且可以发布 =>去发布
150 self.setData({ 180 self.setData({
151 - is_showUserInfo: true 181 + is_showRelease: true //弹出 去答题弹框
152 }); 182 });
153 } 183 }
154 }, 184 },
@@ -196,17 +226,19 @@ Page({ @@ -196,17 +226,19 @@ Page({
196 //获取首页内容 226 //获取首页内容
197 getIndex(res) { 227 getIndex(res) {
198 let url = '/portal/Member/index'; 228 let url = '/portal/Member/index';
199 - // let params = {  
200 - // lat: res.latitude,  
201 - // lng: res.longitude,  
202 - // }; 229 + let params = {
  230 + // lat: res.latitude,
  231 + // lng: res.longitude,
  232 + token: wx.getStorageSync('token'),
  233 + };
203 let header = { 234 let header = {
204 "XX-token": wx.getStorageSync('token') 235 "XX-token": wx.getStorageSync('token')
205 }; 236 };
206 - app.post(url, {}, header).then((res) => { 237 + app.post(url, params, {}).then((res) => {
207 console.log('获取首页', res); 238 console.log('获取首页', res);
208 - // this.setData({  
209 - // }) 239 + this.setData({
  240 + user:res.data.member
  241 + })
210 // console.log(this.data.this_week_test_info); 242 // console.log(this.data.this_week_test_info);
211 }) 243 })
212 }, 244 },
@@ -230,6 +262,8 @@ Page({ @@ -230,6 +262,8 @@ Page({
230 onShow: function () { 262 onShow: function () {
231 this.setData({isLogin: app.globalData.isLogin}); 263 this.setData({isLogin: app.globalData.isLogin});
232 this.getIndex(); 264 this.getIndex();
  265 + this.getIsWrite();
  266 +
233 }, 267 },
234 268
235 /** 269 /**
1 <!--pages/my/my.wxml--> 1 <!--pages/my/my.wxml-->
2 <view class="head-box"> 2 <view class="head-box">
3 - <view wx:if="{{isLogin}}" bindtap="goUserInfo"> 3 + <view wx:if="{{isLogin}}" bindtap="EditUserInfo">
4 <view class="head"></view> 4 <view class="head"></view>
5 - <image src="../../images/user-img@2x.png" class="user-img"></image> 5 + <!--<image src="../../images/user-img@2x.png" class="user-img"></image>-->
  6 + <image src="{{user.pic}}" class="user-img"></image>
6 <view class="left"> 7 <view class="left">
7 <view class="class-box"> 8 <view class="class-box">
8 - <image src="../../images/jin@2x.png" wx:if="{{is_class === 1}}"></image>  
9 - <image src="../../images/yin@2x.png" wx:if="{{is_class === 2}}"></image>  
10 - <image src="../../images/tong@2x.png" wx:if="{{is_class === 3}}"></image>  
11 - <text wx:if="{{is_class === 1}}">金火柴</text>  
12 - <text wx:if="{{is_class === 2}}">银火柴</text>  
13 - <text wx:if="{{is_class === 3}}">铜火柴</text> 9 + <image src="../../images/jin@2x.png" wx:if="{{user.level === 1}}"></image>
  10 + <image src="../../images/yin@2x.png" wx:if="{{user.level === 2}}"></image>
  11 + <image src="../../images/tong@2x.png" wx:if="{{user.level === 3}}"></image>
  12 + <text wx:if="{{user.level === 1}}">金火柴</text>
  13 + <text wx:if="{{user.level === 2}}">银火柴</text>
  14 + <text wx:if="{{user.level === 3}}">铜火柴</text>
14 </view> 15 </view>
15 </view> 16 </view>
16 <view class="right"> 17 <view class="right">
17 - <view class="name">旦巴小公举</view> 18 + <view class="name">{{user.name}}</view>
18 <view class="area"> 19 <view class="area">
19 <view class="iconfont icon-dingweiweizhizuobiaoxianxing"></view> 20 <view class="iconfont icon-dingweiweizhizuobiaoxianxing"></view>
20 - <text>北京</text> 21 + <text>{{user.city || '定位'}}</text>
21 </view> 22 </view>
22 - <view class="qian">确认过眼神,遇见对的人</view> 23 + <view class="qian">{{user.introduce || '个人简介'}}</view>
23 </view> 24 </view>
24 </view> 25 </view>
25 <view wx:if="{{!isLogin}}" class="login-box"> 26 <view wx:if="{{!isLogin}}" class="login-box">
@@ -104,7 +105,9 @@ @@ -104,7 +105,9 @@
104 <view class="title">请先完善个人信息</view> 105 <view class="title">请先完善个人信息</view>
105 <view class="answer-btn" bindtap="goUserInfo">完成</view> 106 <view class="answer-btn" bindtap="goUserInfo">完成</view>
106 </view> 107 </view>
107 -<view class="release-btn-box" wx:if="{{is_showUserInfo}}"> 108 +<view class="modal_box" wx:if="{{is_showUserInfo}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  109 +<!--发布-->
  110 +<view class="release-btn-box" wx:if="{{is_showRelease}}">
108 <view class="left-btn" bindtap="releaseMeal"> 111 <view class="left-btn" bindtap="releaseMeal">
109 <image src="../../images/pincan@2x.png"></image> 112 <image src="../../images/pincan@2x.png"></image>
110 <view class="text">发布拼餐</view> 113 <view class="text">发布拼餐</view>
@@ -114,4 +117,4 @@ @@ -114,4 +117,4 @@
114 <view class="text">发布拼活动</view> 117 <view class="text">发布拼活动</view>
115 </view> 118 </view>
116 </view> 119 </view>
117 -<view class="modal_box" wx:if="{{is_showUserInfo}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>  
  120 +<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
1 // pages/my/suggest/suggest.js 1 // pages/my/suggest/suggest.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 - }, 2 +const app = getApp();
31 3
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 () { 4 +Page({
64 5
65 - } 6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + content: '',
  11 + },
  12 + input(e) {
  13 + this.setData({content: e.detail.value})
  14 + },
  15 + //提交
  16 + submit() {
  17 + if(this.data.content ==='') {
  18 + wx.showToast({title:'请输入反馈意见',icon:'none'})
  19 + }else {
  20 + let url = '/portal/Member/opinion';
  21 + let params = {
  22 + token: wx.getStorageSync('token'),
  23 + content:this.data.content,
  24 + };
  25 + app.post(url, params, {}).then((res) => {
  26 + console.log('提交', res);
  27 + if (+res.code === 1) {
  28 + wx.showToast({title:res.message,icon:'none',
  29 + success:function () {
  30 + setTimeout(function () {
  31 + wx.navigateBack({delta:1})
  32 + },500)
  33 + }
  34 + })
  35 + }
  36 + });
  37 + }
  38 + },
  39 + /**
  40 + * 生命周期函数--监听页面加载
  41 + */
  42 + onLoad: function (options) {
  43 + },
  44 +
  45 + /**
  46 + * 生命周期函数--监听页面初次渲染完成
  47 + */
  48 + onReady: function () {
  49 +
  50 + },
  51 +
  52 + /**
  53 + * 生命周期函数--监听页面显示
  54 + */
  55 + onShow: function () {
  56 +
  57 + },
  58 +
  59 + /**
  60 + * 生命周期函数--监听页面隐藏
  61 + */
  62 + onHide: function () {
  63 +
  64 + },
  65 +
  66 + /**
  67 + * 生命周期函数--监听页面卸载
  68 + */
  69 + onUnload: function () {
  70 +
  71 + },
  72 +
  73 + /**
  74 + * 页面相关事件处理函数--监听用户下拉动作
  75 + */
  76 + onPullDownRefresh: function () {
  77 +
  78 + },
  79 +
  80 + /**
  81 + * 页面上拉触底事件的处理函数
  82 + */
  83 + onReachBottom: function () {
  84 +
  85 + },
  86 + /**
  87 + * 用户点击右上角分享
  88 + */
  89 + onShareAppMessage: function () {
  90 +
  91 + }
66 }) 92 })
1 // pages/order/complain/complain.js 1 // pages/order/complain/complain.js
  2 +const app = getApp();
  3 +
2 Page({ 4 Page({
3 5
4 /** 6 /**
5 * 页面的初始数据 7 * 页面的初始数据
6 */ 8 */
7 data: { 9 data: {
  10 + content:'',
8 images:[], 11 images:[],
9 images_params:[] 12 images_params:[]
10 }, 13 },
  14 + //输入投诉内容
  15 + inputContent(e) {
  16 + this.setData({content:e.detail.value})
  17 + },
  18 + //投诉
  19 + submit() {
  20 + const self = this;
  21 + if(self.data.content === '') {
  22 + wx.showToast({title:'请填写投诉内容',icon:'none'})
  23 + }else {
  24 + let images_params = '';
  25 + if(self.data.images_params.length === 0) {
  26 + images_params = '';
  27 + }else {
  28 + images_params = self.data.images_params.join(',')
  29 + }
  30 + let url = '/portal/Order/complaint';
  31 + let params = {
  32 + token: wx.getStorageSync('token'),
  33 + orderId: self.data.order_id,
  34 + content:'',
  35 + pic:images_params,
  36 + };
  37 + app.post(url, params, {}).then((res) => {
  38 + console.log('投诉', res);
  39 + if (+res.code === 1) {
  40 + wx.showToast({title:'投诉成功',icon:'none',
  41 + success:function () {
  42 + setTimeout(function () {
  43 + wx.navigateBack({delta:1})
  44 + },500)
  45 + }
  46 + });
  47 + }else {
  48 + wx.showToast({title:res.message,icon:'none'});
  49 + }
  50 + })
  51 + }
  52 + },
11 //上传图片 53 //上传图片
12 choose(e) { //这里是选取图片的方法 54 choose(e) { //这里是选取图片的方法
13 let that = this; 55 let that = this;
@@ -55,7 +97,7 @@ Page({ @@ -55,7 +97,7 @@ Page({
55 images: images, 97 images: images,
56 images_params:images_params, 98 images_params:images_params,
57 }); 99 });
58 - console.log('images---images_params',images,images_params) 100 + console.log('images---images_params',images,images_params);
59 //如果是最后一张,则隐藏等待中 101 //如果是最后一张,则隐藏等待中
60 // if (uploadImgCount == tempFilePaths.length) { 102 // if (uploadImgCount == tempFilePaths.length) {
61 // wx.hideToast(); 103 // wx.hideToast();
@@ -112,7 +154,8 @@ Page({ @@ -112,7 +154,8 @@ Page({
112 * 生命周期函数--监听页面加载 154 * 生命周期函数--监听页面加载
113 */ 155 */
114 onLoad: function (options) { 156 onLoad: function (options) {
115 - 157 + console.log('options', options,JSON.parse(options.order_detail));
  158 + this.setData({order_id:+options.id?+options.id:'',order_detail:JSON.parse(options.order_detail)})
116 }, 159 },
117 160
118 /** 161 /**
1 <!--pages/order/complain/complain.wxml--> 1 <!--pages/order/complain/complain.wxml-->
2 <view class="content"> 2 <view class="content">
3 <view class="state-box"> 3 <view class="state-box">
  4 +
4 <view class="line"></view> 5 <view class="line"></view>
  6 + <!--(0全部,2待处理,4已拼成,5已取消,6已完成)-->
5 <view class="state1"> 7 <view class="state1">
6 - <view class="circle"></view> 8 + <view class="circle change"></view>
7 <text>已拍下</text> 9 <text>已拍下</text>
8 </view> 10 </view>
9 <view class="state2"> 11 <view class="state2">
10 - <view class="circle"></view>  
11 - <text>已拼成</text> 12 + <view class="circle {{order_detail.status === 4 ||order_detail.status === 5 ?'change':''}}"></view>
  13 + <text wx:if="{{order_detail.status === 5}}">已取消</text>
  14 + <text wx:if="{{order_detail.status === 4}}">已拼成</text>
  15 + <text wx:if="{{order_detail.status === 2}}" class="{{order_detail.status === 2?'change-text':''}}">待拼成</text>
12 </view> 16 </view>
13 <view class="state3"> 17 <view class="state3">
14 - <view class="circle"></view>  
15 - <text>已完成</text> 18 + <view class="circle {{order_detail.status === 6?'change':''}}"></view>
  19 + <text wx:if="{{order_detail.status === 6}}">已完成</text>
  20 + <text wx:if="{{order_detail.status === 4 || order_detail.status === 2 ||order_detail.status === 5}}" class="{{order_detail.status === 4 || order_detail.status === 2 ||order_detail.status === 5?'change-text':''}}">待完成</text>
16 </view> 21 </view>
17 </view> 22 </view>
18 23
19 <view class="order-info"> 24 <view class="order-info">
20 - <text class="address text">今日美术展览馆 2018.04.08</text> 25 + <text class="address text">{{order_detail.addr}} {{order_detail.time}}</text>
21 <view class="top"> 26 <view class="top">
22 <view class="text">拼单发起者: </view> 27 <view class="text">拼单发起者: </view>
23 - <image src="../../../images/avatar@2x.png"></image>  
24 - <view class="name text">旦巴</view> 28 + <!--<image src="../../../images/avatar@2x.png"></image>-->
  29 + <image src="{{order_detail.userPic}}"></image>
  30 + <view class="name text">{{order_detail.userName}}</view>
25 </view> 31 </view>
26 - <text class="text">订单编号:324352346254698762345430</text>  
27 - <text class="text">交易时间:2018.04.08 15:20:55</text>  
28 - <text class="text">联系方式:153565895845</text> 32 + <text class="text">订单编号:{{order_detail.order_sn}}</text>
  33 + <text class="text">交易时间:{{order_detail.create_time}}</text>
  34 + <text class="text">联系方式:{{order_detail.userTel || '暂无手机号'}}</text>
29 35
30 - <textarea maxlength="-1" name="" id="" cols="30" rows="10" placeholder="请填写您要投诉的内容" placeholder-class="placeholder"></textarea> 36 + <textarea maxlength="-1" placeholder="请填写您要投诉的内容" placeholder-class="placeholder"
  37 + bindinput="inputContent"
  38 + ></textarea>
31 </view> 39 </view>
32 40
33 41
@@ -46,7 +54,7 @@ @@ -46,7 +54,7 @@
46 </view> 54 </view>
47 </view> 55 </view>
48 56
49 - <view class="bottom"> 57 + <view class="bottom" bindtap="submit">
50 <text class="confirm-btn">提交投诉</text> 58 <text class="confirm-btn">提交投诉</text>
51 </view> 59 </view>
52 </view> 60 </view>
1 // pages/order/order-detail/order-detail.js 1 // pages/order/order-detail/order-detail.js
  2 +const app = getApp();
  3 +
2 Page({ 4 Page({
3 5
4 /** 6 /**
5 * 页面的初始数据 7 * 页面的初始数据
6 */ 8 */
7 data: {}, 9 data: {},
  10 + //去投诉
8 goComplain() { 11 goComplain() {
9 console.log('tousu'); 12 console.log('tousu');
10 - wx.navigateTo({url:'/pages/order/complain/complain'}) 13 + const order_detail = JSON.stringify(this.data.detail);
  14 + wx.navigateTo({url: '/pages/order/complain/complain?id=' + this.data.order_id
  15 + + '&order_detail=' + order_detail
  16 + })
  17 + },
  18 + //订单详情
  19 + getOrderDetail() {
  20 + const self = this;
  21 + let url = '/portal/Order/detail';
  22 + let params = {
  23 + token: wx.getStorageSync('token'),
  24 + orderId: self.data.order_id,
  25 + };
  26 + app.post(url, params, {}).then((res) => {
  27 + console.log('订单详情', res);
  28 + if (+res.code === 1) {
  29 + self.setData({
  30 + detail: res.data,
  31 + });
  32 + // console.log(this.data.this_week_test_info);
  33 + }
  34 + })
  35 + },
  36 + //取消订单
  37 + cancel() {
  38 + const self = this;
  39 + let url = '/portal/Order/cancel';
  40 + let params = {
  41 + token: wx.getStorageSync('token'),
  42 + orderId: self.data.order_id,
  43 + };
  44 + app.post(url, params, {}).then((res) => {
  45 + console.log('取消订单', res);
  46 + if (+res.code === 1) {
  47 + wx.showToast({title:'订单已取消',icon:'none'});
  48 + // self.setData({
  49 + // detail: res.data,
  50 + // });
  51 + // console.log(this.data.this_week_test_info);
  52 + }else {
  53 + wx.showToast({title:res.message,icon:'none'});
  54 + }
  55 + })
  56 + },
  57 + //完成订单
  58 + confirm() {
  59 + const self = this;
  60 + let url = '/portal/Order/sure';
  61 + let params = {
  62 + token: wx.getStorageSync('token'),
  63 + orderId: self.data.order_id,
  64 + };
  65 + app.post(url, params, {}).then((res) => {
  66 + console.log('完成订单', res);
  67 + if (+res.code === 1) {
  68 + wx.showToast({title:'订单已完成',icon:'none'});
  69 + // self.setData({
  70 + // detail: res.data,
  71 + // });
  72 + // console.log(this.data.this_week_test_info);
  73 + }else {
  74 + wx.showToast({title:res.message,icon:'none'});
  75 + }
  76 + })
11 }, 77 },
12 /** 78 /**
13 * 生命周期函数--监听页面加载 79 * 生命周期函数--监听页面加载
14 */ 80 */
15 onLoad: function (options) { 81 onLoad: function (options) {
16 - 82 + console.log('options', options);
  83 + this.setData({order_id:+options.id?+options.id:''})
17 }, 84 },
18 85
19 /** 86 /**
@@ -27,7 +94,7 @@ Page({ @@ -27,7 +94,7 @@ Page({
27 * 生命周期函数--监听页面显示 94 * 生命周期函数--监听页面显示
28 */ 95 */
29 onShow: function () { 96 onShow: function () {
30 - 97 + this.getOrderDetail();
31 }, 98 },
32 99
33 /** 100 /**
@@ -5,37 +5,43 @@ @@ -5,37 +5,43 @@
5 <view class="state-box"> 5 <view class="state-box">
6 6
7 <view class="line"></view> 7 <view class="line"></view>
  8 + <!--(0全部,2待处理,4已拼成,5已取消,6已完成)-->
8 <view class="state1"> 9 <view class="state1">
9 - <view class="circle"></view> 10 + <view class="circle change"></view>
10 <text>已拍下</text> 11 <text>已拍下</text>
11 </view> 12 </view>
12 <view class="state2"> 13 <view class="state2">
13 - <view class="circle"></view>  
14 - <text>已拼成</text> 14 + <view class="circle {{detail.status === 4 ||detail.status === 5 ?'change':''}}"></view>
  15 + <text wx:if="{{detail.status === 5}}">已取消</text>
  16 + <text wx:if="{{detail.status === 4}}">已拼成</text>
  17 + <text wx:if="{{detail.status === 2}}" class="{{detail.status === 2?'change-text':''}}">待拼成</text>
15 </view> 18 </view>
16 <view class="state3"> 19 <view class="state3">
17 - <view class="circle"></view>  
18 - <text>已完成</text> 20 + <view class="circle {{detail.status === 6?'change':''}}"></view>
  21 + <text wx:if="{{detail.status === 6}}">已完成</text>
  22 + <text wx:if="{{detail.status === 4 || detail.status === 2 ||detail.status === 5}}" class="{{detail.status === 4 || detail.status === 2 ||detail.status === 5?'change-text':''}}">待完成</text>
19 </view> 23 </view>
20 </view> 24 </view>
21 25
22 <view class="order-info"> 26 <view class="order-info">
23 <view class="top"> 27 <view class="top">
24 - <image src="../../../images/avatar@2x.png"></image>  
25 - <text class="name">旦巴</text> 28 + <!--<image src="../../../images/avatar@2x.png"></image>-->
  29 + <image src="{{detail.userPic}}"></image>
  30 + <text class="name">{{detail.userName}}</text>
26 </view> 31 </view>
27 - <text class="address">今日美术展览馆</text>  
28 - <text class="time">2018.04.08</text> 32 + <text class="address">{{detail.title}}</text>
  33 + <text class="time">{{detail.time}}</text>
29 </view> 34 </view>
30 35
31 36
32 <view class="order-detail"> 37 <view class="order-detail">
33 - <text>订单编号:324352346254698762345430</text>  
34 - <text>交易时间:2018.04.08 15:20:55</text> 38 + <text>订单编号:{{detail.order_sn}}</text>
  39 + <text>交易时间:{{detail.create_time}}</text>
35 </view> 40 </view>
36 41
37 <view class="bottom"> 42 <view class="bottom">
38 - <text class="cancel-btn">取消订单</text>  
39 - <text class="confirm-btn">完成</text> 43 + <text class="cancel-btn" wx:if="{{detail.status === 4 || detail.status === 2}}" bindtap="cancel">取消订单</text>
  44 + <text class="cancel-btn" wx:if="{{detail.status === 2}}">待拼成</text>
  45 + <text class="confirm-btn" wx:if="{{detail.status === 4}}" bindtap="confirm">完成</text>
40 </view> 46 </view>
41 </view> 47 </view>
@@ -22,13 +22,19 @@ @@ -22,13 +22,19 @@
22 width: 46rpx; 22 width: 46rpx;
23 height: 46rpx; 23 height: 46rpx;
24 border-radius: 50%; 24 border-radius: 50%;
25 - background-color: #E1C8AF;  
26 margin-bottom: 10rpx; 25 margin-bottom: 10rpx;
27 -}  
28 -.state3 .circle {  
29 background-color: #DEDEDE; 26 background-color: #DEDEDE;
30 } 27 }
31 -.state3 text { 28 +/*.state3 .circle {*/
  29 + /*background-color: #E1C8AF;*/
  30 +/*}*/
  31 +.state-box .change {
  32 + background-color: #E1C8AF;
  33 +}
  34 +/*.state3 text {*/
  35 + /*color: #999999;*/
  36 +/*}*/
  37 +.state-box .change-text {
32 color: #999999; 38 color: #999999;
33 } 39 }
34 .state-box .line { 40 .state-box .line {
1 // pages/order/order.js 1 // pages/order/order.js
  2 +const app = getApp();
2 Page({ 3 Page({
3 4
4 /** 5 /**
5 * 页面的初始数据 6 * 页面的初始数据
6 */ 7 */
7 data: { 8 data: {
8 - current:0,  
9 - orderList:  
10 - [  
11 - {title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:1,},  
12 - {title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:2,},  
13 - {title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:3,},  
14 - {title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多',state:4,},  
15 - ],  
16 - tabcurrent: {tab: 3,bubble: ''}, 9 + current: 0,
  10 + orderList: [],
  11 + tabcurrent: {tab: 3, bubble: ''},
17 is_showAnswer: false, 12 is_showAnswer: false,
18 - is_showUserInfo:false, 13 + is_showUserInfo: false,
19 is_answer: true, 14 is_answer: true,
  15 + is_write: 0,//1:已填写,2:未填写
  16 + },
  17 + //是否填写个人信息
  18 + getIsWrite() {
  19 + const self = this;
  20 + let url = '/portal/Send/isWrite';
  21 + let params = {
  22 + token: wx.getStorageSync('token'),
  23 + };
  24 + let header = {
  25 + "token": wx.getStorageSync('token')
  26 + };
  27 + app.post(url, params, {}).then((res) => {
  28 + console.log('是否填写个人信息', res);
  29 + if (+res.code === 1) {
  30 + self.setData({
  31 + is_write: res.data.is_write,//1:已填写2:未填写
  32 + });
  33 + // console.log(this.data.this_week_test_info);
  34 + }
  35 + })
20 }, 36 },
21 //发布拼活动 37 //发布拼活动
22 releaseActivity() { 38 releaseActivity() {
  39 + this.setData({is_showRelease: false,});
23 wx.navigateTo({ 40 wx.navigateTo({
24 url: '/pages/activity/activity', 41 url: '/pages/activity/activity',
25 - }) 42 + });
26 }, 43 },
27 //发布拼餐 44 //发布拼餐
28 releaseMeal() { 45 releaseMeal() {
  46 + this.setData({is_showRelease: false,});
29 wx.navigateTo({ 47 wx.navigateTo({
30 url: '/pages/meal/meal', 48 url: '/pages/meal/meal',
31 }) 49 })
32 }, 50 },
33 //完善个人信息 51 //完善个人信息
34 goUserInfo() { 52 goUserInfo() {
  53 + this.setData({is_showUserInfo: false});
35 wx.navigateTo({ 54 wx.navigateTo({
36 url: '/pages/my/edit-info/edit-info', 55 url: '/pages/my/edit-info/edit-info',
37 }) 56 })
38 }, 57 },
39 //去答题 58 //去答题
40 goAnswer() { 59 goAnswer() {
  60 + this.setData({is_showAnswer: false});
41 wx.navigateTo({ 61 wx.navigateTo({
42 url: '/pages/index/answer-question/answer-question', 62 url: '/pages/index/answer-question/answer-question',
43 }) 63 })
44 }, 64 },
45 - goPostDetail() { 65 + goPostDetail(e) {
  66 + const id = e.currentTarget.dataset.id;
46 wx.navigateTo({ 67 wx.navigateTo({
47 - url: '/pages/order/order-detail/order-detail', 68 + url: '/pages/order/order-detail/order-detail?id=' + id,
48 }) 69 })
49 }, 70 },
50 //tab点击事件 71 //tab点击事件
51 chargeTab(e) { 72 chargeTab(e) {
52 this.setData({ 73 this.setData({
53 - current: e.currentTarget.dataset.current  
54 - }) 74 + current: +e.currentTarget.dataset.current,
  75 + orderList:[],
  76 + has_more:true,
  77 + page_number:1,
  78 + });
  79 + this.getOrderList();
  80 + },
  81 + disableScroll() {
55 }, 82 },
56 - disableScroll() {},  
57 handleBackground() { 83 handleBackground() {
58 console.log('dianji'); 84 console.log('dianji');
59 - this.setData({is_showAnswer: false,is_showUserInfo:false,}) 85 + this.setData({is_showAnswer: false, is_showUserInfo: false, is_showRelease: false,})
60 }, 86 },
61 //首页-导航 87 //首页-导航
62 service(e) { 88 service(e) {
@@ -98,13 +124,18 @@ Page({ @@ -98,13 +124,18 @@ Page({
98 release(e) { 124 release(e) {
99 console.log('发布'); 125 console.log('发布');
100 const self = this; 126 const self = this;
101 - if(!self.data.is_answer) { 127 + if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2) { //没填写个人信息并且不可以发布 =>去填写
102 self.setData({ 128 self.setData({
103 - is_showAnswer: true 129 + is_showUserInfo: true //弹出 去填写个人信息弹框
104 }); 130 });
105 - }else { 131 +
  132 + } else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
  133 + self.setData({
  134 + is_showAnswer: true //弹出 去答题弹框
  135 + });
  136 + } else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
106 self.setData({ 137 self.setData({
107 - is_showUserInfo: true 138 + is_showRelease: true //弹出 去答题弹框
108 }); 139 });
109 } 140 }
110 }, 141 },
@@ -149,6 +180,29 @@ Page({ @@ -149,6 +180,29 @@ Page({
149 }) 180 })
150 } 181 }
151 }, 182 },
  183 + // portal/Order/index
  184 + //获取订单列表
  185 + getOrderList() {
  186 + const self = this;
  187 + let url = '/portal/Order/index';
  188 + let params = {
  189 + token: wx.getStorageSync('token'),
  190 + status: +self.data.current,
  191 + };
  192 + let header = {
  193 + "token": wx.getStorageSync('token')
  194 + };
  195 + app.post(url, params, {}).then((res) => {
  196 + console.log('获取订单列表', res);
  197 + if (+res.code === 1) {
  198 + self.setData({
  199 + orderList: res.data,
  200 + // cate: res.data.cate,
  201 + });
  202 + }
  203 + wx.hideLoading()
  204 + })
  205 + },
152 /** 206 /**
153 * 生命周期函数--监听页面加载 207 * 生命周期函数--监听页面加载
154 */ 208 */
@@ -167,6 +221,8 @@ Page({ @@ -167,6 +221,8 @@ Page({
167 * 生命周期函数--监听页面显示 221 * 生命周期函数--监听页面显示
168 */ 222 */
169 onShow: function () { 223 onShow: function () {
  224 + this.getIsWrite();
  225 + this.getOrderList();
170 226
171 }, 227 },
172 228
1 <!--pages/order/order.wxml--> 1 <!--pages/order/order.wxml-->
2 <view class='tab_box'> 2 <view class='tab_box'>
  3 + <!--(0全部,2待处理,4已拼成,5已取消,6已完成)-->
3 <view class="tab_item {{current==0?'active':''}}" data-current='0' bindtap='chargeTab'>全部</view> 4 <view class="tab_item {{current==0?'active':''}}" data-current='0' bindtap='chargeTab'>全部</view>
4 - <view class="tab_item {{current==1?'active':''}}" data-current='1' bindtap='chargeTab'>待处理</view>  
5 - <view class="tab_item {{current==2?'active':''}}" data-current='2' bindtap='chargeTab'>已拼成</view>  
6 - <view class="tab_item {{current==3?'active':''}}" data-current='3' bindtap='chargeTab'>已完成</view>  
7 - <view class="tab_item {{current==4?'active':''}}" data-current='4' bindtap='chargeTab'>已取消</view> 5 + <view class="tab_item {{current==2?'active':''}}" data-current='2' bindtap='chargeTab'>待处理</view>
  6 + <view class="tab_item {{current==4?'active':''}}" data-current='4' bindtap='chargeTab'>已拼成</view>
  7 + <view class="tab_item {{current==6?'active':''}}" data-current='6' bindtap='chargeTab'>已完成</view>
  8 + <view class="tab_item {{current==5?'active':''}}" data-current='5' bindtap='chargeTab'>已取消</view>
8 </view> 9 </view>
9 10
10 <!--订单列表--> 11 <!--订单列表-->
  12 +<view class="no-data" wx:if="{{orderList.length === 0}}">暂无订单</view>
11 <view class='content_box post_box' wx:if="{{orderList.length > 0}}"> 13 <view class='content_box post_box' wx:if="{{orderList.length > 0}}">
12 - <view class='content_item' wx:for="{{orderList}}" wx:key="index" bindtap='goPostDetail' data-index="{{index}}">  
13 - <image src="../../images/lishi@2x.png" class="thumb"></image> 14 + <view class='content_item' wx:for="{{orderList}}" wx:key="index"
  15 + bindtap='goPostDetail' data-index="{{index}}" data-id="{{item.id}}">
  16 + <!--<image src="../../images/lishi@2x.png" class="thumb"></image>-->
  17 + <image src="{{item.pic}}" class="thumb"></image>
14 <view class="lish-right"> 18 <view class="lish-right">
15 <view class="title-box"> 19 <view class="title-box">
16 <view class="title">{{item.title}}</view> 20 <view class="title">{{item.title}}</view>
@@ -22,8 +26,9 @@ @@ -22,8 +26,9 @@
22 <view class="time">{{item.time}}</view> 26 <view class="time">{{item.time}}</view>
23 <view class="name-box"> 27 <view class="name-box">
24 <view class="name-left"> 28 <view class="name-left">
25 - <image src="../../images/avatar@2x.png" class="avatar"></image>  
26 - <text>{{item.name}}</text> 29 + <!--<image src="../../images/avatar@2x.png" class="avatar"></image>-->
  30 + <image src="{{item.userPic}}" class="avatar"></image>
  31 + <text>{{item.userName}} 在{{item.addr}}</text>
27 </view> 32 </view>
28 <view class="btn"> 33 <view class="btn">
29 <text wx:if="{{item.state === 4 || item.state === 3}}">删除</text> 34 <text wx:if="{{item.state === 4 || item.state === 3}}">删除</text>
@@ -66,7 +71,9 @@ @@ -66,7 +71,9 @@
66 <view class="title">请先完善个人信息</view> 71 <view class="title">请先完善个人信息</view>
67 <view class="answer-btn" bindtap="goUserInfo">完成</view> 72 <view class="answer-btn" bindtap="goUserInfo">完成</view>
68 </view> 73 </view>
69 -<view class="release-btn-box" wx:if="{{is_showUserInfo}}"> 74 +<view class="modal_box" wx:if="{{is_showUserInfo}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  75 +<!--发布-->
  76 +<view class="release-btn-box" wx:if="{{is_showRelease}}">
70 <view class="left-btn" bindtap="releaseMeal"> 77 <view class="left-btn" bindtap="releaseMeal">
71 <image src="../../images/pincan@2x.png"></image> 78 <image src="../../images/pincan@2x.png"></image>
72 <view class="text">发布拼餐</view> 79 <view class="text">发布拼餐</view>
@@ -76,4 +83,4 @@ @@ -76,4 +83,4 @@
76 <view class="text">发布拼活动</view> 83 <view class="text">发布拼活动</view>
77 </view> 84 </view>
78 </view> 85 </view>
79 -<view class="modal_box" wx:if="{{is_showUserInfo}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view> 86 +<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 top:0; 15 top:0;
16 left:0; 16 left:0;
17 right:0; 17 right:0;
  18 + background: #ffffff;
18 } 19 }
19 .tab_item { 20 .tab_item {
20 display: inline-block; 21 display: inline-block;
@@ -48,6 +49,7 @@ @@ -48,6 +49,7 @@
48 } 49 }
49 .post_box { 50 .post_box {
50 margin-top: 92rpx; 51 margin-top: 92rpx;
  52 + padding-bottom:130rpx;
51 } 53 }
52 .content_item { 54 .content_item {
53 display: flex; 55 display: flex;
@@ -110,4 +112,14 @@ @@ -110,4 +112,14 @@
110 width: 40rpx; 112 width: 40rpx;
111 height: 40rpx; 113 height: 40rpx;
112 margin-right: 16rpx; 114 margin-right: 16rpx;
  115 + border-radius: 50%;
  116 +}
  117 +.no-data {
  118 + width: 100%;
  119 + display: flex;
  120 + align-items: center;
  121 + justify-content: center;
  122 + font-size: 30rpx;
  123 + color: #cccccc;
  124 + margin-top: 200rpx;
113 } 125 }
@@ -15,14 +15,21 @@ Page({ @@ -15,14 +15,21 @@ Page({
15 hasMore: true, 15 hasMore: true,
16 pageNumber: 0, 16 pageNumber: 0,
17 avatar: [], 17 avatar: [],
  18 + is_write:2,//1:已填写,2:未填写
18 }, 19 },
19 - //初始化postList  
20 - initPostList() {  
21 - this.setData({  
22 - pageNumber: 0,  
23 - hasMore: true,  
24 - });  
25 - this.data.postList = [] 20 + goPostDetail(e) {
  21 + const id = +e.currentTarget.dataset.id;
  22 + const type = +e.currentTarget.dataset.type;
  23 + console.log('type', type);
  24 + if(type === 1) { //1是活动,2是拼餐
  25 + wx.navigateTo({
  26 + url: '/pages/activity/detail/detail?id=' + id,
  27 + })
  28 + }else {
  29 + wx.navigateTo({
  30 + url: '/pages/meal/detail/detail?id=' + id,
  31 + })
  32 + }
26 }, 33 },
27 inputFocus() { 34 inputFocus() {
28 this.setData({postList:[]}) 35 this.setData({postList:[]})
@@ -32,273 +39,163 @@ Page({ @@ -32,273 +39,163 @@ Page({
32 this.setData({searchValue: e.detail.value}) 39 this.setData({searchValue: e.detail.value})
33 }, 40 },
34 //点击搜索(搜索结果) 41 //点击搜索(搜索结果)
  42 + // startSearch() {
  43 + // let self = this;
  44 + // if(!self.data.hasMore) return;
  45 + // self.setData({hasMore: false});
  46 + // let url = '/home/home/search';
  47 + // let params = {
  48 + // keyword: self.data.searchValue,
  49 + // page: self.data.pageNumber,
  50 + // };
  51 + // let header = {
  52 + // "XX-Token": wx.getStorageSync('token')
  53 + // };
  54 + // if(self.data.searchValue === '') {
  55 + // wx.showToast({title:'搜索内容不能为空~',icon: 'none'})
  56 + // }else {
  57 + // self.getSearchHistory();
  58 + // app.post(url, params, header).then((res) => {
  59 + // // console.log('搜索结果', res);
  60 + // if(+res.page < res.page_size) {
  61 + // self.data.hasMore = true;
  62 + // }
  63 + // const list = res.data.map((item, index) => {
  64 + // return {...item, showlabel_box: false, more: item.more !== '' ? JSON.parse(item.more) : ''}
  65 + // });
  66 + // self.setData({
  67 + // postList: self.data.postList.concat(list)
  68 + // });
  69 + // // console.log('搜索结果', self.data.postList);
  70 + // })
  71 + // }
  72 + // },
  73 + //点击量
  74 + // hit(current) {
  75 + // let url = '/home/home/hits';
  76 + // let params = {
  77 + // id: this.data.postList[current].id,
  78 + // };
  79 + // let header = { "XX-Token": wx.getStorageSync('token') };
  80 + // app.post(url, params, header).then((res) => {
  81 + // // console.log('点击量',res);
  82 + // if(res.message == "操作成功") {
  83 + // const post_hits = this.data.postList[current].post_hits +1
  84 + // this.setData({
  85 + // [`postList[${current}].post_hits`]: post_hits
  86 + // });
  87 + // }
  88 + // })
  89 + // },
  90 + //清空输入框
  91 + clearInput() {
  92 + this.setData({searchValue: ''})
  93 + },
  94 + //搜索结果
35 startSearch() { 95 startSearch() {
36 let self = this; 96 let self = this;
37 - if(!self.data.hasMore) return;  
38 - self.setData({hasMore: false});  
39 - let url = '/home/home/search';  
40 - let params = {  
41 - keyword: self.data.searchValue,  
42 - page: self.data.pageNumber,  
43 - }; 97 + let url = '/portal/Active/findRes';
44 let header = { 98 let header = {
45 "XX-Token": wx.getStorageSync('token') 99 "XX-Token": wx.getStorageSync('token')
46 }; 100 };
47 - if(self.data.searchValue === '') {  
48 - wx.showToast({title:'搜索内容不能为空~',icon: 'none'})  
49 - }else {  
50 - self.getSearchHistory();  
51 - app.post(url, params, header).then((res) => {  
52 - // console.log('搜索结果', res);  
53 - if(+res.page < res.page_size) {  
54 - self.data.hasMore = true;  
55 - }  
56 - const list = res.data.map((item, index) => {  
57 - return {...item, showlabel_box: false, more: item.more !== '' ? JSON.parse(item.more) : ''}  
58 - });  
59 - self.setData({  
60 - postList: self.data.postList.concat(list)  
61 - });  
62 - // console.log('搜索结果', self.data.postList);  
63 - })  
64 - }  
65 - },  
66 - //点击量  
67 - hit(current) {  
68 - let url = '/home/home/hits';  
69 let params = { 101 let params = {
70 - id: this.data.postList[current].id, 102 + token: wx.getStorageSync('token'),
  103 + keyword:self.data.searchValue,
71 }; 104 };
72 - let header = { "XX-Token": wx.getStorageSync('token') };  
73 app.post(url, params, header).then((res) => { 105 app.post(url, params, header).then((res) => {
74 - // console.log('点击量',res);  
75 - if(res.message == "操作成功") {  
76 - const post_hits = this.data.postList[current].post_hits +1  
77 - this.setData({  
78 - [`postList[${current}].post_hits`]: post_hits  
79 - }); 106 + console.log('搜索历史列表', res);
  107 + wx.hideLoading();
  108 + if(+res.code === 1) {
  109 + if(res.data.list.length === 0) {
  110 + wx.showToast({title:'暂无更多内容',icon:'none'})
  111 + }else {
  112 + self.setData({
  113 + postList: res.data.list
  114 + });
  115 + }
80 } 116 }
  117 +
81 }) 118 })
82 }, 119 },
83 - //清空输入框  
84 - clearInput() {  
85 - this.setData({searchValue: ''})  
86 - },  
87 - //搜索历史列表  
88 - getSearchHistory() {  
89 - let self = this;  
90 - let url = '/home/home/search_history';  
91 - let header = {  
92 - "XX-Token": wx.getStorageSync('token')  
93 - };  
94 - app.post(url, {}, header).then((res) => {  
95 - // console.log('搜索历史列表', res);  
96 - self.setData({  
97 - searchHistory: res  
98 - });  
99 - }) 120 + //点击热门搜索
  121 + clickHot(e) {
  122 + const current = e.currentTarget.dataset.index;
  123 + this.setData({
  124 + searchValue: this.data.hot[current].title,
  125 + });
  126 + wx.showLoading({title: '加载中',});
  127 + this.startSearch();
  128 + this.getSearchHistory()
100 }, 129 },
101 //点击搜索历史 130 //点击搜索历史
102 clickHistory(e) { 131 clickHistory(e) {
103 const current = e.currentTarget.dataset.index; 132 const current = e.currentTarget.dataset.index;
104 - const list = [{title:'温哥华+翡翠岛+路易斯湖五日游',time:'2018.4.28',name:'旦巴 在多伦多'}]//假数据  
105 this.setData({ 133 this.setData({
106 - searchValue: this.data.searchHistory[current].keyword,  
107 - postList:list, 134 + searchValue: this.data.history[current].title,
108 }); 135 });
109 - this.startSearch() 136 + wx.showLoading({title: '加载中',});
  137 + this.startSearch();
  138 + this.getSearchHistory()
110 }, 139 },
111 //清空历史搜索 140 //清空历史搜索
112 clearHistory() { 141 clearHistory() {
113 let self = this; 142 let self = this;
114 - let url = '/home/home/clear_search';  
115 - let header = {  
116 - "XX-Token": wx.getStorageSync('token') 143 + let url = '/portal/Active/delHistory';
  144 + let params = {
  145 + token: wx.getStorageSync('token'),
117 }; 146 };
118 - app.post(url, {}, header).then((res) => {  
119 - // console.log('清空搜索历史列表', res); 147 + app.post(url, params, {}).then((res) => {
  148 + console.log('清空搜索历史列表', res);
  149 + wx.showLoading({title: '加载中',});
  150 + if(+res.code === 1) {
  151 + wx.showToast({title:res.message,icon:'none'})
  152 + }
120 self.getSearchHistory() 153 self.getSearchHistory()
121 }) 154 })
122 }, 155 },
123 - //个人信息弹框  
124 - showModal(e) {  
125 - let that = this;  
126 - const current = e.currentTarget.dataset.index;  
127 - if(that.data.currentModal === current) {  
128 - that.data.postList[current].showlabel_box = !that.data.postList[current].showlabel_box;  
129 - }else {  
130 - that.data.postList[current].showlabel_box = !that.data.postList[current].showlabel_box;  
131 - that.data.postList[that.data.currentModal].showlabel_box = false;  
132 - }  
133 - that.setData({  
134 - postList: that.data.postList,  
135 - currentModal: current  
136 - });  
137 - },  
138 - //复制微信号  
139 - clickCopy(e) {  
140 - const current = e.currentTarget.dataset.index;  
141 - wx.setClipboardData({  
142 - data: this.data.postList[current].wxn,  
143 - success:function (res) {  
144 - // console.log('复制微信号',res);  
145 - }  
146 - });  
147 - this.setData({  
148 - [`postList[${this.data.currentModal}].showlabel_box`]: false  
149 - });  
150 - },  
151 - //进入主页  
152 - enterHomePage(e) {  
153 - let self = this;  
154 - const current = e.currentTarget.dataset.index;  
155 156
156 - wx.navigateTo({  
157 - url: '/pages/service/myindex/myindex?user_id=' + self.data.postList[current].user_id  
158 - });  
159 - self.setData({  
160 - [`postList[${self.data.currentModal}].showlabel_box`]: false  
161 - });  
162 - },  
163 - //举报  
164 - report(e) {  
165 - let self = this;  
166 - const current = e.currentTarget.dataset.index;  
167 - const to_user_id = self.data.postList[current].user_id;  
168 - const post_id = self.data.postList[current].id;  
169 - wx.navigateTo({url:'/pages/report/report?to_user_id=' + to_user_id + '&post_id=' + post_id});  
170 - self.setData({  
171 - [`postList[${self.data.currentModal}].showlabel_box`]: false  
172 - });  
173 - },  
174 - //查看文章详情  
175 - goPostDetail(e) {  
176 - const current = e.currentTarget.dataset.index;  
177 - const list = this.data.postList.map((item,index) => {  
178 - return {...item, showlabel_box: false}  
179 - });//进入详情时关闭所有弹框  
180 - this.setData({  
181 - postList: list,  
182 - currentPost: current  
183 - });  
184 - this.hit(current);  
185 - wx.navigateTo({  
186 - url: '../../rentingDetail/rentingDetail?post_id=' + this.data.postList[current].id,  
187 - }) 157 + // //查看文章详情
  158 + // goPostDetail(e) {
  159 + // const current = e.currentTarget.dataset.index;
  160 + // const list = this.data.postList.map((item,index) => {
  161 + // return {...item, showlabel_box: false}
  162 + // });//进入详情时关闭所有弹框
  163 + // this.setData({
  164 + // postList: list,
  165 + // currentPost: current
  166 + // });
  167 + // this.hit(current);
  168 + // wx.navigateTo({
  169 + // url: '../../rentingDetail/rentingDetail?post_id=' + this.data.postList[current].id,
  170 + // })
188 171
189 - },  
190 - //收藏、取消收藏  
191 - delArticles(e) {  
192 - let self = this;  
193 - const current = e.currentTarget.dataset.index;  
194 - let url = '/home/home/collect';  
195 - let url_del = '/home/home/collect_del';  
196 - let header = {  
197 - "XX-Token": wx.getStorageSync('token')  
198 - };  
199 - let params = {  
200 - id: self.data.postList[current].id,  
201 - };  
202 - if(self.data.postList[current].is_hits) {  
203 - app.post(url_del, params, header).then((res) => {  
204 - // console.log('取消收藏', res);  
205 - if(res.message == "操作成功") {  
206 - self.setData({  
207 - [`postList[${current}].is_hits`]: 0  
208 - });  
209 - }  
210 - })  
211 - }else {  
212 - app.post(url, params, header).then((res) => {  
213 - // console.log('收藏', res);  
214 - if(res.message == "操作成功") {  
215 - self.setData({  
216 - [`postList[${current}].is_hits`]: 1  
217 - });  
218 - }  
219 - })  
220 - }  
221 - },  
222 - //点赞/取消赞  
223 - clickZan(e) {  
224 - let self = this;  
225 - let current = e.currentTarget.dataset.index;  
226 - let postList = self.data.postList;  
227 - let url = '/home/home/like';  
228 - let url_del = '/home/home/like_del';  
229 - let header = {  
230 - "XX-Token": wx.getStorageSync('token')  
231 - }; 172 + // },
  173 + //获取热门搜索和搜索历史
  174 + getSearchHistory() {
  175 + const self = this;
  176 + let url = '/portal/Active/find';
232 let params = { 177 let params = {
233 - id: self.data.postList[current].id, 178 + // activeId: self.data.detail_id,
  179 + token: wx.getStorageSync('token'),
234 }; 180 };
235 - if(postList[current].is_paise) {  
236 - app.post(url_del, params, header).then((res) => {  
237 - // console.log('取消赞', res);  
238 - if(res.message == "操作成功") {//局部刷新赞数和头像  
239 - const post_like = postList[current].post_like - 1;  
240 - self.setData({  
241 - [`postList[${current}].is_paise`]: 0,  
242 - [`postList[${current}].post_like`]: post_like,  
243 - });  
244 - const paise_user = [];  
245 - postList[current].paise_user.map((item) => {  
246 - if(item !== res.data) {  
247 - paise_user.push(item)  
248 - }  
249 - });  
250 - self.setData({  
251 - [`postList[${current}].paise_user`]: paise_user,  
252 - })  
253 - }  
254 - })  
255 - }else {  
256 - app.post(url, params, header).then((res) => {  
257 - // console.log('点赞', res);  
258 - if(res.message == "操作成功") {//局部刷新赞数和头像  
259 - const post_like = postList[current].post_like + 1;  
260 - self.setData({  
261 - [`postList[${current}].is_paise`]: 1,  
262 - [`postList[${current}].post_like`]: post_like,  
263 - });  
264 - if(postList[current].paise_user !== undefined) {  
265 - const paise_user = postList[current].paise_user;  
266 - self.setData({  
267 - [`postList[${current}].paise_user`]: paise_user.concat(res.data),  
268 - })  
269 - }else {  
270 - const paise_user = [];  
271 - paise_user.push(res.data);  
272 - self.setData({  
273 - [`postList[${current}].paise_user`]: paise_user,  
274 - })  
275 - }  
276 - }  
277 - })  
278 - }  
279 - },  
280 - //去评论  
281 - goComment() {  
282 - wx.navigateTo({  
283 - url: '/pages/service/comment/comment?post_id=' +  
284 - this.data.postList[this.data.currentPost].id +  
285 - '&is_post_list=' + true  
286 - })  
287 - },  
288 - //获取用户id  
289 - personInfo() {  
290 - let url = '/home/me/index';  
291 - let header = {  
292 - "XX-Token": wx.getStorageSync('token')  
293 - };  
294 - let params = {}  
295 - app.post(url, params, header).then((res) => {  
296 - console.log(res)  
297 - this.setData({  
298 - userId: res.id,  
299 - });  
300 - console.log(this.data.userId) 181 + // let header = {
  182 + // "token": wx.getStorageSync('token')
  183 + // };
  184 + app.post(url, params, {}).then((res) => {
  185 + console.log('获取热门搜索和搜索历史', res);
  186 + if (+res.code === 1) {
  187 + wx.hideLoading();
  188 + self.setData({
  189 + hot: res.data.hot,
  190 + history:res.data.history
  191 + // end_time: res.data.active.time,
  192 + // over_hours:res.data.active.over_time,//几小时截止
  193 + });
  194 + // self.countDown();
  195 + }
  196 + // wx.hideLoading()
301 }) 197 })
  198 +
302 }, 199 },
303 onLoad: function (options) { 200 onLoad: function (options) {
304 const self = this; 201 const self = this;
@@ -307,54 +204,8 @@ Page({ @@ -307,54 +204,8 @@ Page({
307 order: +options.order, 204 order: +options.order,
308 select_id: +options.select_id, 205 select_id: +options.select_id,
309 }); 206 });
310 - self.personInfo();  
311 self.getSearchHistory(); 207 self.getSearchHistory();
312 }, 208 },
313 - refreshPostCollect() {  
314 - const postList = this.data.postList;  
315 - const currentPost = this.data.currentPost;  
316 - // console.log('刷新前长度', postList[currentPost].is_hits);  
317 - if(this.data.is_collect) {  
318 - this.setData({  
319 - [`postList[${currentPost}].is_hits`]: 1,  
320 - })  
321 - }else {  
322 - this.setData({  
323 - [`postList[${currentPost}].is_hits`]: 0,  
324 - })  
325 - }  
326 - // console.log('刷新后长度', postList[currentPost].is_hits);  
327 - },  
328 - refreshPostComment() {  
329 - const postList = this.data.postList;  
330 - const currentPost = this.data.currentPost;  
331 - // console.log('刷新前长度', postList[currentPost].comments.length);  
332 - if(this.data.is_comment) {  
333 - this.setData({[`postList[${currentPost}].comments[0].length`]: this.data.length})  
334 - }  
335 - // console.log('刷新后长度', postList[currentPost].comments[0].length);  
336 - },  
337 - refreshPostLike() {  
338 - const postList = this.data.postList;  
339 - const currentPost = this.data.currentPost;  
340 - if(this.data.is_paise) {  
341 - const post_like = postList[currentPost].post_like +1;  
342 - this.setData({  
343 - [`postList[${currentPost}].is_paise`]: 1,  
344 - [`postList[${currentPost}].post_like`]: post_like,  
345 - [`postList[${currentPost}].paise_user`]: this.data.paise_user,  
346 - })  
347 - // console.log('点赞', postList[currentPost].post_like);  
348 - }else {  
349 - const post_like = postList[currentPost].post_like -1;  
350 - this.setData({  
351 - [`postList[${currentPost}].is_paise`]: 0,  
352 - [`postList[${currentPost}].post_like`]: post_like,  
353 - [`postList[${currentPost}].paise_user`]: this.data.paise_user,  
354 - })  
355 - // console.log('取消赞', postList[currentPost].post_like);  
356 - }  
357 - },  
358 /** 209 /**
359 * 生命周期函数--监听页面初次渲染完成 210 * 生命周期函数--监听页面初次渲染完成
360 */ 211 */
@@ -366,7 +217,7 @@ Page({ @@ -366,7 +217,7 @@ Page({
366 * 生命周期函数--监听页面显示 217 * 生命周期函数--监听页面显示
367 */ 218 */
368 onShow: function () { 219 onShow: function () {
369 - 220 + wx.showLoading({title: '加载中',});
370 }, 221 },
371 222
372 /** 223 /**
@@ -14,9 +14,9 @@ @@ -14,9 +14,9 @@
14 <view class="title">热门搜索</view> 14 <view class="title">热门搜索</view>
15 </view> 15 </view>
16 16
17 - <view class="history_list {{searchHistory.length === 0?'text-center':''}}">  
18 - <text wx:if="{{searchHistory.length === 0}}">暂无搜索历史~</text>  
19 - <view wx:elseif wx:for="{{searchHistory}}" wx:key="index" bindtap="clickHistory" data-index="{{index}}">{{item.keyword}}</view> 17 + <view class="history_list {{hot.length === 0?'text-center':''}}">
  18 + <text wx:if="{{hot.length === 0}}">暂无热门搜索~</text>
  19 + <view wx:elseif wx:for="{{hot}}" wx:key="index" bindtap="clickHot" data-index="{{index}}">{{item.title}}</view>
20 </view> 20 </view>
21 </view> 21 </view>
22 22
@@ -29,22 +29,26 @@ @@ -29,22 +29,26 @@
29 </view> 29 </view>
30 </view> 30 </view>
31 31
32 - <view class="history_list {{searchHistory.length === 0?'text-center':''}}">  
33 - <text wx:if="{{searchHistory.length === 0}}">暂无搜索历史~</text>  
34 - <view wx:elseif wx:for="{{searchHistory}}" wx:key="index" bindtap="clickHistory" data-index="{{index}}">{{item.keyword}}</view> 32 + <view class="history_list {{history.length === 0?'text-center':''}}">
  33 + <text wx:if="{{history.length === 0}}">暂无搜索历史~</text>
  34 + <view wx:elseif wx:for="{{history}}" wx:key="index" bindtap="clickHistory" data-index="{{index}}">{{item.title}}</view>
35 </view> 35 </view>
36 </view> 36 </view>
37 37
38 <!--文章内容--> 38 <!--文章内容-->
39 <view class='content_box post_box' wx:if="{{postList.length > 0}}"> 39 <view class='content_box post_box' wx:if="{{postList.length > 0}}">
40 - <view class='content_item' wx:for="{{postList}}" wx:key="index" bindtap='goPostDetail' data-index="{{index}}">  
41 - <image src="../../images/lishi@2x.png" class="thumb"></image> 40 + <!--<view class="no-data" wx:if="{{postList.length === 0}}">暂无内容</view>-->
  41 + <view class='content_item' wx:for="{{postList}}" wx:key="index" bindtap='goPostDetail'
  42 + data-id="{{item.id}}" data-type="{{item.type}}">
  43 + <!--<image src="../../images/lishi@2x.png" class="thumb"></image>-->
  44 + <image src="{{item.pic}}" class="thumb"></image>
42 <view class="lish-right"> 45 <view class="lish-right">
43 - <view class="title">{{item.title}}</view> 46 + <view class="title">{{item.address}}</view>
44 <view class="time">{{item.time}}</view> 47 <view class="time">{{item.time}}</view>
45 <view class="name-box"> 48 <view class="name-box">
46 - <image src="../../images/avatar@2x.png" class="avatar"></image>  
47 - <text>{{item.name}}</text> 49 + <!--<image src="../../images/avatar@2x.png" class="avatar"></image>-->
  50 + <image src="{{item.userPic}}" class="avatar"></image>
  51 + <text>{{item.userName}}</text>
48 </view> 52 </view>
49 </view> 53 </view>
50 </view> 54 </view>
@@ -41,37 +41,64 @@ Page({ @@ -41,37 +41,64 @@ Page({
41 is_showAnswer: false, 41 is_showAnswer: false,
42 is_showUserInfo:false, 42 is_showUserInfo:false,
43 is_answer: false, 43 is_answer: false,
  44 + is_write:2,//1:已填写,2:未填写
44 }, 45 },
45 - goActivityDetail() { 46 + //是否填写个人信息
  47 + getIsWrite() {
  48 + const self = this;
  49 + let url = '/portal/Send/isWrite';
  50 + let params = {
  51 + token: wx.getStorageSync('token'),
  52 + };
  53 + let header = {
  54 + "token": wx.getStorageSync('token')
  55 + };
  56 + app.post(url, params, {}).then((res) => {
  57 + console.log('是否填写个人信息', res);
  58 + if (+res.code === 1) {
  59 + self.setData({
  60 + is_write:res.data.is_write,//1:已填写2:未填写
  61 + });
  62 + // console.log(this.data.this_week_test_info);
  63 + }
  64 + })
  65 + },
  66 + goActivityDetail(e) {
  67 + const id = +e.currentTarget.dataset.id;
46 wx.navigateTo({ 68 wx.navigateTo({
47 - url: '/pages/activity/detail/detail', 69 + url: '/pages/activity/detail/detail?id=' + id,
48 }) 70 })
49 }, 71 },
50 - goMealDetail() { 72 + goMealDetail(e) {
  73 + const id = +e.currentTarget.dataset.id;
51 wx.navigateTo({ 74 wx.navigateTo({
52 - url: '/pages/meal/detail/detail', 75 + url: '/pages/meal/detail/detail?id=' + id,
53 }) 76 })
54 }, 77 },
55 //发布拼活动 78 //发布拼活动
56 releaseActivity() { 79 releaseActivity() {
  80 + this.setData({is_showRelease:false,});
57 wx.navigateTo({ 81 wx.navigateTo({
58 url: '/pages/activity/activity', 82 url: '/pages/activity/activity',
59 - }) 83 + });
60 }, 84 },
61 //发布拼餐 85 //发布拼餐
62 releaseMeal() { 86 releaseMeal() {
  87 + this.setData({is_showRelease:false,});
63 wx.navigateTo({ 88 wx.navigateTo({
64 url: '/pages/meal/meal', 89 url: '/pages/meal/meal',
65 }) 90 })
66 }, 91 },
67 //完善个人信息 92 //完善个人信息
68 goUserInfo() { 93 goUserInfo() {
  94 + this.setData({is_showUserInfo: false});
69 wx.navigateTo({ 95 wx.navigateTo({
70 url: '/pages/my/edit-info/edit-info', 96 url: '/pages/my/edit-info/edit-info',
71 }) 97 })
72 }, 98 },
73 //去答题 99 //去答题
74 goAnswer() { 100 goAnswer() {
  101 + this.setData({is_showAnswer: false});
75 wx.navigateTo({ 102 wx.navigateTo({
76 url: '/pages/index/answer-question/answer-question', 103 url: '/pages/index/answer-question/answer-question',
77 }) 104 })
@@ -79,7 +106,7 @@ Page({ @@ -79,7 +106,7 @@ Page({
79 disableScroll() {}, 106 disableScroll() {},
80 handleBackground() { 107 handleBackground() {
81 console.log('dianji'); 108 console.log('dianji');
82 - this.setData({is_showAnswer: false,is_showUserInfo:false,}) 109 + this.setData({is_showAnswer: false, is_showUserInfo: false,is_showRelease:false,})
83 }, 110 },
84 //搜索 111 //搜索
85 search() { 112 search() {
@@ -230,13 +257,18 @@ Page({ @@ -230,13 +257,18 @@ Page({
230 release(e) { 257 release(e) {
231 console.log('发布'); 258 console.log('发布');
232 const self = this; 259 const self = this;
233 - if(!self.data.is_answer) { 260 + if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2 ){ //没填写个人信息并且不可以发布 =>去填写
234 self.setData({ 261 self.setData({
235 - is_showAnswer: true 262 + is_showUserInfo: true //弹出 去填写个人信息弹框
236 }); 263 });
237 - }else { 264 +
  265 + } else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
  266 + self.setData({
  267 + is_showAnswer: true //弹出 去答题弹框
  268 + });
  269 + }else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1){ //已填写且可以发布 =>去发布
238 self.setData({ 270 self.setData({
239 - is_showUserInfo: true 271 + is_showRelease: true //弹出 去答题弹框
240 }); 272 });
241 } 273 }
242 }, 274 },
@@ -355,7 +387,8 @@ Page({ @@ -355,7 +387,8 @@ Page({
355 * 生命周期函数--监听页面加载 387 * 生命周期函数--监听页面加载
356 */ 388 */
357 onLoad: function (options) { 389 onLoad: function (options) {
358 - 390 + console.log('options', options);
  391 + this.setData({current:+options.current?+options.current:0})
359 }, 392 },
360 393
361 /** 394 /**
@@ -371,6 +404,7 @@ Page({ @@ -371,6 +404,7 @@ Page({
371 onShow: function () { 404 onShow: function () {
372 const self = this; 405 const self = this;
373 self.getLocation(); 406 self.getLocation();
  407 + self.getIsWrite();
374 }, 408 },
375 409
376 /** 410 /**
@@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
16 </view> 16 </view>
17 17
18 <view class='tab_box'> 18 <view class='tab_box'>
19 - <view class="tab_item {{current==0?'active':''}}" data-current='0' bindtap='chargeTab'>拼餐</view>  
20 - <view class="tab_item {{current==1?'active':''}}" data-current='1' bindtap='chargeTab'>拼活动</view> 19 + <view class="tab_item {{current==0?'active':''}}" data-current='{{0}}' bindtap='chargeTab'>拼餐</view>
  20 + <view class="tab_item {{current==1?'active':''}}" data-current='{{1}}' bindtap='chargeTab'>拼活动</view>
21 </view> 21 </view>
22 22
23 <view class="sort-select-box"> 23 <view class="sort-select-box">
@@ -85,31 +85,35 @@ @@ -85,31 +85,35 @@
85 <view class='content_box' wx:if='{{current==0}}'> 85 <view class='content_box' wx:if='{{current==0}}'>
86 <view class="no-data" wx:if="{{list.length === 0}}">暂无拼餐活动</view> 86 <view class="no-data" wx:if="{{list.length === 0}}">暂无拼餐活动</view>
87 <view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}" 87 <view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}"
88 - bindtap='goMealDetail' data-index="{{index}}">  
89 - <image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image> 88 + bindtap='goMealDetail' data-index="{{index}}" data-id="{{item.id}}">
  89 + <!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>-->
  90 + <image src="{{item.pic}}"></image>
90 <view class="title"> 91 <view class="title">
91 - <text class="area">{{item.area}}</text>  
92 - <text class="num">还差{{item.num}}人</text> 92 + <text class="area">{{item.address}}</text>
  93 + <text class="num">还差{{item.people}}人</text>
93 </view> 94 </view>
94 <view class="user"> 95 <view class="user">
95 - <image src="../../images/avatar@2x.png" class="avatar"></image>  
96 - <text>{{item.name}}</text> 96 + <!--<image src="../../images/avatar@2x.png" class="avatar"></image>-->
  97 + <image src="{{item.userPic}}" class="avatar"></image>
  98 + <text>{{item.userName}}</text>
97 </view> 99 </view>
98 </view> 100 </view>
99 </view> 101 </view>
100 <!--拼活动--> 102 <!--拼活动-->
101 <view class="content_box" wx:if='{{current==1}}'> 103 <view class="content_box" wx:if='{{current==1}}'>
102 - <view class="no-data" wx:if="{{list.length === 0}}">暂无拼活动</view> 104 + <view class="no-data" wx:if="{{list.length === 0}}">暂无拼活动</view>
103 <view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}" 105 <view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}"
104 - bindtap='goActivityDetail' data-index="{{index}}">  
105 - <image src="http://pk86rwhci.bkt.clouddn.com/b1@2x%20%281%29.png"></image> 106 + bindtap='goActivityDetail' data-index="{{index}}" data-id="{{item.id}}">
  107 + <!--<image src="http://pk86rwhci.bkt.clouddn.com/b1@2x%20%281%29.png"></image>-->
  108 + <image src="{{item.pic}}"></image>
106 <view class="title"> 109 <view class="title">
107 - <text class="area">{{item.area}}</text>  
108 - <text class="num">还差{{item.num}}人</text> 110 + <text class="area">{{item.address}}</text>
  111 + <text class="num">还差{{item.people}}人</text>
109 </view> 112 </view>
110 <view class="user"> 113 <view class="user">
111 - <image src="../../images/avatar@2x.png" class="avatar"></image>  
112 - <text>{{item.name}}</text> 114 + <!--<image src="../../images/avatar@2x.png" class="avatar"></image>-->
  115 + <image src="{{item.userPic}}" class="avatar"></image>
  116 + <text>{{item.userName}}</text>
113 </view> 117 </view>
114 </view> 118 </view>
115 </view> 119 </view>
@@ -133,7 +137,9 @@ @@ -133,7 +137,9 @@
133 <view class="title">请先完善个人信息</view> 137 <view class="title">请先完善个人信息</view>
134 <view class="answer-btn" bindtap="goUserInfo">完成</view> 138 <view class="answer-btn" bindtap="goUserInfo">完成</view>
135 </view> 139 </view>
136 -<view class="release-btn-box" wx:if="{{is_showUserInfo}}"> 140 +<view class="modal_box" wx:if="{{is_showUserInfo}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  141 +<!--发布-->
  142 +<view class="release-btn-box" wx:if="{{is_showRelease}}">
137 <view class="left-btn" bindtap="releaseMeal"> 143 <view class="left-btn" bindtap="releaseMeal">
138 <image src="../../images/pincan@2x.png"></image> 144 <image src="../../images/pincan@2x.png"></image>
139 <view class="text">发布拼餐</view> 145 <view class="text">发布拼餐</view>
@@ -143,4 +149,4 @@ @@ -143,4 +149,4 @@
143 <view class="text">发布拼活动</view> 149 <view class="text">发布拼活动</view>
144 </view> 150 </view>
145 </view> 151 </view>
146 -<view class="modal_box" wx:if="{{is_showUserInfo}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>  
  152 +<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>