作者 吴孟雨

commit

要显示太多修改。

为保证性能只显示 11 of 11+ 个文件。

  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="Encoding" addBOMForNewFiles="with NO BOM" />
  4 +</project>
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="JavaScriptSettings">  
4 - <option name="languageLevel" value="ES6" />  
5 - </component> 1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="JavaScriptSettings">
  4 + <option name="languageLevel" value="ES6" />
  5 + </component>
6 </project> 6 </project>
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="ProjectModuleManager">  
4 - <modules>  
5 - <module fileurl="file://$PROJECT_DIR$/.idea/火柴西路.iml" filepath="$PROJECT_DIR$/.idea/火柴西路.iml" />  
6 - </modules>  
7 - </component> 1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="ProjectModuleManager">
  4 + <modules>
  5 + <module fileurl="file://$PROJECT_DIR$/.idea/火柴西路.iml" filepath="$PROJECT_DIR$/.idea/火柴西路.iml" />
  6 + </modules>
  7 + </component>
8 </project> 8 </project>
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<project version="4">  
3 - <component name="VcsDirectoryMappings">  
4 - <mapping directory="$PROJECT_DIR$" vcs="Git" />  
5 - </component> 1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="VcsDirectoryMappings">
  4 + <mapping directory="$PROJECT_DIR$" vcs="Git" />
  5 + </component>
6 </project> 6 </project>
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<module type="WEB_MODULE" version="4">  
3 - <component name="NewModuleRootManager">  
4 - <content url="file://$MODULE_DIR$">  
5 - <excludeFolder url="file://$MODULE_DIR$/.tmp" />  
6 - <excludeFolder url="file://$MODULE_DIR$/temp" />  
7 - <excludeFolder url="file://$MODULE_DIR$/tmp" />  
8 - </content>  
9 - <orderEntry type="inheritedJdk" />  
10 - <orderEntry type="sourceFolder" forTests="false" />  
11 - </component> 1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<module type="WEB_MODULE" version="4">
  3 + <component name="NewModuleRootManager">
  4 + <content url="file://$MODULE_DIR$">
  5 + <excludeFolder url="file://$MODULE_DIR$/.tmp" />
  6 + <excludeFolder url="file://$MODULE_DIR$/temp" />
  7 + <excludeFolder url="file://$MODULE_DIR$/tmp" />
  8 + </content>
  9 + <orderEntry type="inheritedJdk" />
  10 + <orderEntry type="sourceFolder" forTests="false" />
  11 + </component>
12 </module> 12 </module>
1 -// pages/activity/activity.js  
2 -const app = getApp();  
3 -Page({  
4 -  
5 - /**  
6 - * 页面的初始数据  
7 - */  
8 - data: {  
9 - images: [],  
10 - images_params:[],  
11 - type_picker_list:[],  
12 - start_date:app.nowDate(),  
13 - start_time:'',  
14 - title:'',  
15 - content:'',  
16 - min_num:'',  
17 - max_num:'',  
18 - date:'',  
19 - time:'',  
20 - address:'',  
21 - address_position:'',  
22 - over_time:'',  
23 - is_showRelease_modal:false,  
24 - },  
25 - //查看我的发布  
26 - goMyRelease() {  
27 - wx.redirectTo({url:'/pages/activity/detail/detail?id=' + this.data.id})  
28 - },  
29 - //完成按钮  
30 - goBack() {  
31 - // wx.redirectTo({url:'/pages/spell-list/spell-list?current=' + 1})  
32 - },  
33 - disableScroll() {  
34 - },  
35 - handleBackground() {  
36 - this.setData({is_showRelease_modal:false,})  
37 - },  
38 - close() {  
39 - wx.redirectTo({url:'/pages/activity/detail/detail?id=' + this.data.id})  
40 - },  
41 - //输入标题  
42 - inputTitle(e) {  
43 - this.setData({title:e.detail.value})  
44 - },  
45 - //输入内容  
46 - inputContent(e) {  
47 - this.setData({content:e.detail.value})  
48 - },  
49 - //输入最低人数  
50 - inputMinNum(e) {  
51 - this.setData({min_num:e.detail.value})  
52 - },  
53 - //输入最高人数  
54 - inputMaxNum(e) {  
55 - this.setData({max_num:e.detail.value});  
56 - },  
57 - //输入最高人数失去焦点时  
58 - maxNumBlur() {  
59 - if(+this.data.min_num > +this.data.max_num) {  
60 - wx.showToast({title:'最高人数要大于最低人数',icon:'none'});  
61 - this.setData({max_num:''});  
62 - }  
63 - },  
64 - //输入地点  
65 - inputAddress(e) {  
66 - this.setData({address:e.detail.value})  
67 - },  
68 - //获取地址  
69 - choosePosition() {  
70 - //选择当前地址,经纬度  
71 - const self = this;  
72 - wx.chooseLocation({  
73 - success(res) {  
74 - // console.log(res);  
75 - self.setData({address_position: res.address !== ''?res.address:res.name,latng:res.latitude + ',' + res.longitude})  
76 - },  
77 - })  
78 - //打开地图导航  
79 - // wx.getLocation({ //获取当前经纬度  
80 - // type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息  
81 - // success: function (res) {  
82 - // console.log('获取当前经纬度', res);  
83 - // wx.openLocation({//​使用微信内置地图查看位置。  
84 - // latitude: res.latitude,//要去的纬度-地址  
85 - // longitude: res.longitude,//要去的经度-地址  
86 - // name: "",  
87 - // address: ""  
88 - // })  
89 - // }  
90 - // })  
91 - },  
92 - //输入截止时间  
93 - inputOverTime(e) {  
94 - this.setData({over_time:e.detail.value});  
95 - if(this.data.over_time.indexOf('.') !== -1) {  
96 - wx.showToast({title:'截止时间为整数',icon:'none'});  
97 - this.setData({over_time:''});  
98 - }  
99 - // else {  
100 - // let newTime = new Date().getTime();//当前时间戳  
101 - // let end_time = app.preTime(this.data.date + ' ' +this.data.time, this.data.over_time);//截止时间  
102 - // let endTime = new Date(end_time).getTime(); //截止时间戳  
103 - // // console.log('newTime', 'endTime', 'end_time', endTime - newTime >=0,newTime, endTime, end_time,this.data.date + ' ' +this.data.time);  
104 - // console.log('开始时间和截止时间',this.data.date + ' ' +this.data.time,end_time);  
105 - // if (endTime - newTime <= 0) { //不可发布目前时间到截止小时內的订单  
106 - // wx.showToast({title:'截止时间无效',icon:'none'});  
107 - // this.setData({over_time:''})  
108 - // }  
109 - // }  
110 - // console.log(this.data.over_time.indexOf('.') !== -1);  
111 - },  
112 - //获取分类  
113 - getType() {  
114 - let url = '/portal/Send/select';  
115 - const list = [];  
116 - app.post(url, {}, {}).then((res) => {  
117 - // console.log('获取分类', res);  
118 - res.data.active.forEach((item) => {  
119 - list.push(item.name)  
120 - });  
121 - this.setData({type_picker_list: list,type_list: res.data.active})  
122 - })  
123 - },  
124 - //确定发布  
125 - confirmRelease(e) {  
126 - // console.log('e', e,e.detail.formId,'最高人数',this.data.max_num);  
127 - if(this.data.title === '') {  
128 - wx.showToast({title:'请填写标题',icon:'none'})  
129 - }else if(this.data.content === '') {  
130 - wx.showToast({title:'请填写描述',icon:'none'})  
131 - }else if(this.data.images_params.length === 0) {  
132 - wx.showToast({title:'请上传图片',icon:'none'})  
133 - }else if (this.data.min_num === '') {  
134 - wx.showToast({title:'请填写最低人数',icon:'none'})  
135 - }else if (this.data.max_num === '') {  
136 - wx.showToast({title:'请填写最高人数',icon:'none'})  
137 - }else if(this.data.current_type === undefined) {  
138 - wx.showToast({title:'请选择类别',icon:'none'})  
139 - }else if(this.data.date === '') {  
140 - wx.showToast({title:'请选择日期',icon:'none'})  
141 - }else if(this.data.time === '') {  
142 - wx.showToast({title:'请选择时间',icon:'none'})  
143 - }else if(this.data.address === '') {  
144 - wx.showToast({title:'请填写地点',icon:'none'})  
145 - }else if(this.data.address_position === '') {  
146 - wx.showToast({title:'请定位地址',icon:'none'})  
147 - }else if(this.data.over_time === '') {  
148 - wx.showToast({title:'请填写截止时间',icon:'none'})  
149 - }else {  
150 - this.data.type_list.forEach((item,index) => {  
151 - if(this.data.current_type === index) {  
152 - // console.log('index', index, item.id);  
153 - this.setData({type_id:item.id})  
154 - }  
155 - });  
156 - const images_params = this.data.images_params.join(',');  
157 - // console.log('发布-images_params', images_params);  
158 - let url = '/portal/Send/sendActivity';  
159 - let header = {  
160 - "XX-token": wx.getStorageSync('token')  
161 - };  
162 - let params = {  
163 - token: wx.getStorageSync('token'),  
164 - title: this.data.title,  
165 - content:this.data.content,  
166 - pic: images_params,  
167 - min:this.data.min_num,  
168 - max:this.data.max_num,  
169 - select_id: this.data.type_id,//类别  
170 - time: this.data.date + ' ' + this.data.time,  
171 - addr: this.data.address,  
172 - address: this.data.address_position,  
173 - latng: this.data.latng,  
174 - over_time:this.data.over_time,// 报名截止时间  
175 - formId: e.detail.formId,  
176 - };  
177 - app.post(url, params, {}).then((res) => {  
178 - console.log('确定发布', res);  
179 - if(+res.code === 1 && res.message == '发布成功') {  
180 - this.setData({is_showRelease_modal:true,id:+res.data.activeId})  
181 - }else {  
182 - if(res.message !== '截止时间不可小于当前时间') {  
183 - wx.showToast({title:res.message,icon:'none'})  
184 - }  
185 - }  
186 - // res.list.forEach((item) => {  
187 - // list.push(item.name)  
188 - // });  
189 - // console.log('list', list);  
190 - // this.setData({picker_list: list, student_list: res.list})  
191 - })  
192 - }  
193 - },  
194 - //上传图片  
195 - choose(e) { //这里是选取图片的方法  
196 - let that = this;  
197 - wx.chooseImage({  
198 - count: 6, //最多可以选择的图片总数  
199 - sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有  
200 - sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有  
201 - success: function(res) {  
202 - // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片  
203 - let tempFilePaths = res.tempFilePaths;  
204 - //启动上传等待中...  
205 - wx.showToast({  
206 - title: '正在上传...',  
207 - icon: 'loading',  
208 - mask: true,  
209 - duration: 10000  
210 - })  
211 - // console.log('tempFilePaths', tempFilePaths);  
212 - let token = wx.getStorageSync('token');  
213 - let uploadImgCount = 0;  
214 - for (let i = 0, h = tempFilePaths.length; i < h; i++) {  
215 - wx.uploadFile({  
216 - url: 'http://wmatchrd.com/portal/Index/upload',  
217 - filePath: tempFilePaths[i],  
218 - name: 'file',  
219 - formData: {  
220 - 'imgIndex': i  
221 - },  
222 - header: {  
223 - 'content-type': 'application/x-www-form-urlencoded',  
224 - 'XX-Token': token,  
225 - 'XX-Device-Type': 'wxapp',  
226 - },  
227 - success: function(res) {  
228 - uploadImgCount++;  
229 - let data = JSON.parse(res.data);  
230 - console.log('data',data);  
231 - if (+data.code == 1) {  
232 - wx.hideToast();  
233 - //服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" }  
234 - let images = that.data.images;  
235 - let images_params = that.data.images_params;  
236 - images.push(data.data.preview_url);  
237 - images_params.push(data.data.filepath);  
238 - that.setData({  
239 - images: images,  
240 - images_params:images_params,  
241 - });  
242 - console.log('images---images_params',images,images_params)  
243 - //如果是最后一张,则隐藏等待中  
244 - // if (uploadImgCount == tempFilePaths.length) {  
245 - // wx.hideToast();  
246 - // }  
247 - } else {  
248 - wx.hideToast();  
249 - wx.showModal({  
250 - title: '提示',  
251 - content: data.msg,  
252 - showCancel: false  
253 - })  
254 - }  
255 -  
256 - },  
257 - fail: function(res) {  
258 - wx.hideToast();  
259 - wx.showModal({  
260 - title: '错误提示',  
261 - content: '上传图片失败',  
262 - showCancel: false,  
263 - success: function(res) {}  
264 - })  
265 - }  
266 - });  
267 - }  
268 - }  
269 - });  
270 - },  
271 - // 删除图片  
272 - deleteImg(e) {  
273 - var imgs = this.data.images;  
274 - var images_params = this.data.images_params;  
275 - var index = e.currentTarget.dataset.index;  
276 - imgs.splice(index, 1);  
277 - images_params.splice(index, 1);  
278 - this.setData({  
279 - images: imgs,  
280 - images_params:images_params,  
281 - });  
282 - },  
283 -  
284 - // 预览图片  
285 - previewImg: function (e) {  
286 - //获取当前图片的下标  
287 - var index = e.currentTarget.dataset.index;  
288 - //所有图片  
289 - var imgs = this.data.images;  
290 - wx.previewImage({  
291 - //当前显示图片  
292 - current: imgs[index],  
293 - //所有图片  
294 - urls: imgs  
295 - })  
296 - },  
297 - //选择分类  
298 - bindTypeChange(e) {  
299 - this.setData({current_type: +e.detail.value})  
300 - },  
301 - //选择时间  
302 - bindTimeChange(e) {  
303 - this.setData({time:e.detail.value,hour:e.detail.value.split(':')[0],minute: e.detail.value.split(':')[1]})  
304 - // console.log(e.detail.value.split(':'),e.detail.value.split(':')[0],e.detail.value.split(':')[1]);  
305 - },  
306 - //选择日期  
307 - bindDateChange(e) {  
308 - this.setData({is_choose_date:true,date:e.detail.value,month:e.detail.value.split('-')[1],day: e.detail.value.split('-')[2]})  
309 - // console.log(e.detail.value.split('-'),e.detail.value.split('-')[1],e.detail.value.split('-')[2]);  
310 - if(this.data.is_choose_date && (this.data.date === this.data.start_date[0])) { //如果是当天,开始时间要控制在当前时间以后  
311 - this.setData({start_time:app.nowTime()})  
312 - }else {  
313 - this.setData({start_time:'00:00'})  
314 - }  
315 - },  
316 - /**  
317 - * 生命周期函数--监听页面加载  
318 - */  
319 - onLoad: function (options) {  
320 - this.getType();  
321 - },  
322 -  
323 - /**  
324 - * 生命周期函数--监听页面初次渲染完成  
325 - */  
326 - onReady: function () {  
327 -  
328 - },  
329 -  
330 - /**  
331 - * 生命周期函数--监听页面显示  
332 - */  
333 - onShow: function () {  
334 -  
335 - },  
336 -  
337 - /**  
338 - * 生命周期函数--监听页面隐藏  
339 - */  
340 - onHide: function () {  
341 -  
342 - },  
343 -  
344 - /**  
345 - * 页面相关事件处理函数--监听用户下拉动作  
346 - */  
347 - onPullDownRefresh: function () {  
348 -  
349 - },  
350 -  
351 - /**  
352 - * 页面上拉触底事件的处理函数  
353 - */  
354 - onReachBottom: function () {  
355 -  
356 - },  
357 -  
358 - /**  
359 - * 用户点击右上角分享  
360 - */  
361 - onShareAppMessage: function (res) {  
362 - let self = this;  
363 - if(res.from === 'button') {  
364 - return {  
365 - title: self.data.title, // 默认是小程序的名称(可以写slogan等)  
366 - path: '/pages/activity/detail/detail?id=' + self.data.id, // 默认是当前页面,必须是以‘/’开头的完整路径  
367 - imageUrl: self.data.images[0], //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4  
368 - success: function (res) {  
369 - if (res.errMsg == 'shareAppMessage:ok') {  
370 - console.log('转发成功之后');  
371 - wx.redirectTo({url:'/pages/activity/detail/detail?id=' + self.data.id})  
372 - }  
373 - },  
374 - fail: function () {  
375 - // 转发失败之后的回调  
376 - if (res.errMsg == 'shareAppMessage:fail cancel') {  
377 - // 用户取消转发  
378 - } else if (res.errMsg == 'shareAppMessage:fail') {  
379 - // 转发失败,其中 detail message 为详细失败信息  
380 - }  
381 - },  
382 - complete: function () {  
383 - // 转发结束之后的回调(转发成不成功都会执行)  
384 - console.log('转发结束之后');  
385 - wx.redirectTo({url:'/pages/activity/detail/detail?id=' + self.data.id})  
386 - }  
387 - }  
388 - }  
389 - // 设置菜单中的转发按钮触发转发事件时的转发内容  
390 - // var shareObj = {  
391 - // title: '火柴西路', // 默认是小程序的名称(可以写slogan等)  
392 - // path: '/pages/activity/detail/detail?id=' + this.data.id, // 默认是当前页面,必须是以‘/’开头的完整路径  
393 - // imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4  
394 - // success: function (res) {  
395 - // if (res.errMsg == 'shareAppMessage:ok') {  
396 - // }  
397 - // },  
398 - // fail: function () {  
399 - // // 转发失败之后的回调  
400 - // if (res.errMsg == 'shareAppMessage:fail cancel') {  
401 - // // 用户取消转发  
402 - // } else if (res.errMsg == 'shareAppMessage:fail') {  
403 - // // 转发失败,其中 detail message 为详细失败信息  
404 - // }  
405 - // },  
406 - // complete: function () {  
407 - // // 转发结束之后的回调(转发成不成功都会执行)  
408 - // }  
409 - // }  
410 - }, 1 +// pages/activity/activity.js
  2 +const app = getApp();
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + images: [],
  10 + images_params:[],
  11 + type_picker_list:[],
  12 + start_date:app.nowDate(),
  13 + start_time:'',
  14 + title:'',
  15 + content:'',
  16 + min_num:'',
  17 + max_num:'',
  18 + date:'',
  19 + time:'',
  20 + address:'',
  21 + address_position:'',
  22 + over_time:'',
  23 + is_showRelease_modal:false,
  24 + },
  25 + //查看我的发布
  26 + goMyRelease() {
  27 + wx.redirectTo({url:'/pages/activity/detail/detail?id=' + this.data.id})
  28 + },
  29 + //完成按钮
  30 + goBack() {
  31 + // wx.redirectTo({url:'/pages/spell-list/spell-list?current=' + 1})
  32 + },
  33 + disableScroll() {
  34 + },
  35 + handleBackground() {
  36 + this.setData({is_showRelease_modal:false,})
  37 + },
  38 + close() {
  39 + wx.redirectTo({url:'/pages/activity/detail/detail?id=' + this.data.id})
  40 + },
  41 + //输入标题
  42 + inputTitle(e) {
  43 + this.setData({title:e.detail.value})
  44 + },
  45 + //输入内容
  46 + inputContent(e) {
  47 + this.setData({content:e.detail.value})
  48 + },
  49 + //输入最低人数
  50 + inputMinNum(e) {
  51 + this.setData({min_num:e.detail.value})
  52 + },
  53 + //输入最高人数
  54 + inputMaxNum(e) {
  55 + this.setData({max_num:e.detail.value});
  56 + },
  57 + //输入最高人数失去焦点时
  58 + maxNumBlur() {
  59 + if(+this.data.min_num > +this.data.max_num) {
  60 + wx.showToast({title:'最高人数要大于最低人数',icon:'none'});
  61 + this.setData({max_num:''});
  62 + }
  63 + },
  64 + //输入地点
  65 + inputAddress(e) {
  66 + this.setData({address:e.detail.value})
  67 + },
  68 + //获取地址
  69 + choosePosition() {
  70 + //选择当前地址,经纬度
  71 + const self = this;
  72 + wx.chooseLocation({
  73 + success(res) {
  74 + // console.log(res);
  75 + self.setData({address_position: res.address !== ''?res.address:res.name,latng:res.latitude + ',' + res.longitude})
  76 + },
  77 + })
  78 + //打开地图导航
  79 + // wx.getLocation({ //获取当前经纬度
  80 + // type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
  81 + // success: function (res) {
  82 + // console.log('获取当前经纬度', res);
  83 + // wx.openLocation({//​使用微信内置地图查看位置。
  84 + // latitude: res.latitude,//要去的纬度-地址
  85 + // longitude: res.longitude,//要去的经度-地址
  86 + // name: "",
  87 + // address: ""
  88 + // })
  89 + // }
  90 + // })
  91 + },
  92 + //输入截止时间
  93 + inputOverTime(e) {
  94 + this.setData({over_time:e.detail.value});
  95 + if(this.data.over_time.indexOf('.') !== -1) {
  96 + wx.showToast({title:'截止时间为整数',icon:'none'});
  97 + this.setData({over_time:''});
  98 + }
  99 + // else {
  100 + // let newTime = new Date().getTime();//当前时间戳
  101 + // let end_time = app.preTime(this.data.date + ' ' +this.data.time, this.data.over_time);//截止时间
  102 + // let endTime = new Date(end_time).getTime(); //截止时间戳
  103 + // // console.log('newTime', 'endTime', 'end_time', endTime - newTime >=0,newTime, endTime, end_time,this.data.date + ' ' +this.data.time);
  104 + // console.log('开始时间和截止时间',this.data.date + ' ' +this.data.time,end_time);
  105 + // if (endTime - newTime <= 0) { //不可发布目前时间到截止小时內的订单
  106 + // wx.showToast({title:'截止时间无效',icon:'none'});
  107 + // this.setData({over_time:''})
  108 + // }
  109 + // }
  110 + // console.log(this.data.over_time.indexOf('.') !== -1);
  111 + },
  112 + //获取分类
  113 + getType() {
  114 + let url = '/portal/Send/select';
  115 + const list = [];
  116 + app.post(url, {}, {}).then((res) => {
  117 + // console.log('获取分类', res);
  118 + res.data.active.forEach((item) => {
  119 + list.push(item.name)
  120 + });
  121 + this.setData({type_picker_list: list,type_list: res.data.active})
  122 + })
  123 + },
  124 + //确定发布
  125 + confirmRelease(e) {
  126 + // console.log('e', e,e.detail.formId,'最高人数',this.data.max_num);
  127 + if(this.data.title === '') {
  128 + wx.showToast({title:'请填写标题',icon:'none'})
  129 + }else if(this.data.content === '') {
  130 + wx.showToast({title:'请填写描述',icon:'none'})
  131 + }else if(this.data.images_params.length === 0) {
  132 + wx.showToast({title:'请上传图片',icon:'none'})
  133 + }else if (this.data.min_num === '') {
  134 + wx.showToast({title:'请填写最低人数',icon:'none'})
  135 + }else if (this.data.max_num === '') {
  136 + wx.showToast({title:'请填写最高人数',icon:'none'})
  137 + }else if(this.data.current_type === undefined) {
  138 + wx.showToast({title:'请选择类别',icon:'none'})
  139 + }else if(this.data.date === '') {
  140 + wx.showToast({title:'请选择日期',icon:'none'})
  141 + }else if(this.data.time === '') {
  142 + wx.showToast({title:'请选择时间',icon:'none'})
  143 + }else if(this.data.address === '') {
  144 + wx.showToast({title:'请填写地点',icon:'none'})
  145 + }else if(this.data.address_position === '') {
  146 + wx.showToast({title:'请定位地址',icon:'none'})
  147 + }else if(this.data.over_time === '') {
  148 + wx.showToast({title:'请填写截止时间',icon:'none'})
  149 + }else {
  150 + this.data.type_list.forEach((item,index) => {
  151 + if(this.data.current_type === index) {
  152 + // console.log('index', index, item.id);
  153 + this.setData({type_id:item.id})
  154 + }
  155 + });
  156 + const images_params = this.data.images_params.join(',');
  157 + // console.log('发布-images_params', images_params);
  158 + let url = '/portal/Send/sendActivity';
  159 + let header = {
  160 + "XX-token": wx.getStorageSync('token')
  161 + };
  162 + let params = {
  163 + token: wx.getStorageSync('token'),
  164 + title: this.data.title,
  165 + content:this.data.content,
  166 + pic: images_params,
  167 + min:this.data.min_num,
  168 + max:this.data.max_num,
  169 + select_id: this.data.type_id,//类别
  170 + time: this.data.date + ' ' + this.data.time,
  171 + addr: this.data.address,
  172 + address: this.data.address_position,
  173 + latng: this.data.latng,
  174 + over_time:this.data.over_time,// 报名截止时间
  175 + formId: e.detail.formId,
  176 + };
  177 + app.post(url, params, {}).then((res) => {
  178 + console.log('确定发布', res);
  179 + if(+res.code === 1 && res.message == '发布成功') {
  180 + this.setData({is_showRelease_modal:true,id:+res.data.activeId})
  181 + }else {
  182 + if(res.message !== '截止时间不可小于当前时间') {
  183 + wx.showToast({title:res.message,icon:'none'})
  184 + }
  185 + }
  186 + // res.list.forEach((item) => {
  187 + // list.push(item.name)
  188 + // });
  189 + // console.log('list', list);
  190 + // this.setData({picker_list: list, student_list: res.list})
  191 + })
  192 + }
  193 + },
  194 + //上传图片
  195 + choose(e) { //这里是选取图片的方法
  196 + let that = this;
  197 + wx.chooseImage({
  198 + count: 6, //最多可以选择的图片总数
  199 + sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
  200 + sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  201 + success: function(res) {
  202 + // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
  203 + let tempFilePaths = res.tempFilePaths;
  204 + //启动上传等待中...
  205 + wx.showToast({
  206 + title: '正在上传...',
  207 + icon: 'loading',
  208 + mask: true,
  209 + duration: 10000
  210 + })
  211 + // console.log('tempFilePaths', tempFilePaths);
  212 + let token = wx.getStorageSync('token');
  213 + let uploadImgCount = 0;
  214 + for (let i = 0, h = tempFilePaths.length; i < h; i++) {
  215 + wx.uploadFile({
  216 + url: 'http://wmatchrd.com/portal/Index/upload',
  217 + filePath: tempFilePaths[i],
  218 + name: 'file',
  219 + formData: {
  220 + 'imgIndex': i
  221 + },
  222 + header: {
  223 + 'content-type': 'application/x-www-form-urlencoded',
  224 + 'XX-Token': token,
  225 + 'XX-Device-Type': 'wxapp',
  226 + },
  227 + success: function(res) {
  228 + uploadImgCount++;
  229 + let data = JSON.parse(res.data);
  230 + console.log('data',data);
  231 + if (+data.code == 1) {
  232 + wx.hideToast();
  233 + //服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" }
  234 + let images = that.data.images;
  235 + let images_params = that.data.images_params;
  236 + images.push(data.data.preview_url);
  237 + images_params.push(data.data.filepath);
  238 + that.setData({
  239 + images: images,
  240 + images_params:images_params,
  241 + });
  242 + console.log('images---images_params',images,images_params)
  243 + //如果是最后一张,则隐藏等待中
  244 + // if (uploadImgCount == tempFilePaths.length) {
  245 + // wx.hideToast();
  246 + // }
  247 + } else {
  248 + wx.hideToast();
  249 + wx.showModal({
  250 + title: '提示',
  251 + content: data.msg,
  252 + showCancel: false
  253 + })
  254 + }
  255 +
  256 + },
  257 + fail: function(res) {
  258 + wx.hideToast();
  259 + wx.showModal({
  260 + title: '错误提示',
  261 + content: '上传图片失败',
  262 + showCancel: false,
  263 + success: function(res) {}
  264 + })
  265 + }
  266 + });
  267 + }
  268 + }
  269 + });
  270 + },
  271 + // 删除图片
  272 + deleteImg(e) {
  273 + var imgs = this.data.images;
  274 + var images_params = this.data.images_params;
  275 + var index = e.currentTarget.dataset.index;
  276 + imgs.splice(index, 1);
  277 + images_params.splice(index, 1);
  278 + this.setData({
  279 + images: imgs,
  280 + images_params:images_params,
  281 + });
  282 + },
  283 +
  284 + // 预览图片
  285 + previewImg: function (e) {
  286 + //获取当前图片的下标
  287 + var index = e.currentTarget.dataset.index;
  288 + //所有图片
  289 + var imgs = this.data.images;
  290 + wx.previewImage({
  291 + //当前显示图片
  292 + current: imgs[index],
  293 + //所有图片
  294 + urls: imgs
  295 + })
  296 + },
  297 + //选择分类
  298 + bindTypeChange(e) {
  299 + this.setData({current_type: +e.detail.value})
  300 + },
  301 + //选择时间
  302 + bindTimeChange(e) {
  303 + this.setData({time:e.detail.value,hour:e.detail.value.split(':')[0],minute: e.detail.value.split(':')[1]})
  304 + // console.log(e.detail.value.split(':'),e.detail.value.split(':')[0],e.detail.value.split(':')[1]);
  305 + },
  306 + //选择日期
  307 + bindDateChange(e) {
  308 + this.setData({is_choose_date:true,date:e.detail.value,month:e.detail.value.split('-')[1],day: e.detail.value.split('-')[2]})
  309 + // console.log(e.detail.value.split('-'),e.detail.value.split('-')[1],e.detail.value.split('-')[2]);
  310 + if(this.data.is_choose_date && (this.data.date === this.data.start_date[0])) { //如果是当天,开始时间要控制在当前时间以后
  311 + this.setData({start_time:app.nowTime()})
  312 + }else {
  313 + this.setData({start_time:'00:00'})
  314 + }
  315 + },
  316 + /**
  317 + * 生命周期函数--监听页面加载
  318 + */
  319 + onLoad: function (options) {
  320 + this.getType();
  321 + },
  322 +
  323 + /**
  324 + * 生命周期函数--监听页面初次渲染完成
  325 + */
  326 + onReady: function () {
  327 +
  328 + },
  329 +
  330 + /**
  331 + * 生命周期函数--监听页面显示
  332 + */
  333 + onShow: function () {
  334 +
  335 + },
  336 +
  337 + /**
  338 + * 生命周期函数--监听页面隐藏
  339 + */
  340 + onHide: function () {
  341 +
  342 + },
  343 +
  344 + /**
  345 + * 页面相关事件处理函数--监听用户下拉动作
  346 + */
  347 + onPullDownRefresh: function () {
  348 +
  349 + },
  350 +
  351 + /**
  352 + * 页面上拉触底事件的处理函数
  353 + */
  354 + onReachBottom: function () {
  355 +
  356 + },
  357 +
  358 + /**
  359 + * 用户点击右上角分享
  360 + */
  361 + onShareAppMessage: function (res) {
  362 + let self = this;
  363 + if(res.from === 'button') {
  364 + return {
  365 + title: self.data.title, // 默认是小程序的名称(可以写slogan等)
  366 + path: '/pages/activity/detail/detail?id=' + self.data.id, // 默认是当前页面,必须是以‘/’开头的完整路径
  367 + imageUrl: self.data.images[0], //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
  368 + success: function (res) {
  369 + if (res.errMsg == 'shareAppMessage:ok') {
  370 + console.log('转发成功之后');
  371 + wx.redirectTo({url:'/pages/activity/detail/detail?id=' + self.data.id})
  372 + }
  373 + },
  374 + fail: function () {
  375 + // 转发失败之后的回调
  376 + if (res.errMsg == 'shareAppMessage:fail cancel') {
  377 + // 用户取消转发
  378 + } else if (res.errMsg == 'shareAppMessage:fail') {
  379 + // 转发失败,其中 detail message 为详细失败信息
  380 + }
  381 + },
  382 + complete: function () {
  383 + // 转发结束之后的回调(转发成不成功都会执行)
  384 + console.log('转发结束之后');
  385 + wx.redirectTo({url:'/pages/activity/detail/detail?id=' + self.data.id})
  386 + }
  387 + }
  388 + }
  389 + // 设置菜单中的转发按钮触发转发事件时的转发内容
  390 + // var shareObj = {
  391 + // title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
  392 + // path: '/pages/activity/detail/detail?id=' + this.data.id, // 默认是当前页面,必须是以‘/’开头的完整路径
  393 + // imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
  394 + // success: function (res) {
  395 + // if (res.errMsg == 'shareAppMessage:ok') {
  396 + // }
  397 + // },
  398 + // fail: function () {
  399 + // // 转发失败之后的回调
  400 + // if (res.errMsg == 'shareAppMessage:fail cancel') {
  401 + // // 用户取消转发
  402 + // } else if (res.errMsg == 'shareAppMessage:fail') {
  403 + // // 转发失败,其中 detail message 为详细失败信息
  404 + // }
  405 + // },
  406 + // complete: function () {
  407 + // // 转发结束之后的回调(转发成不成功都会执行)
  408 + // }
  409 + // }
  410 + },
411 }) 411 })
1 -/* pages/activity/activity.wxss */  
2 -.input-box {  
3 - border-top: 22rpx solid #eee;  
4 - padding: 40rpx 20rpx;  
5 - -webkit-box-sizing: border-box;  
6 - -moz-box-sizing: border-box;  
7 - box-sizing: border-box;  
8 -}  
9 -.input-box input {  
10 - font-size: 24rpx;  
11 - color: #666666;  
12 - border-bottom: 1rpx solid #f2f2f2;  
13 -  
14 -}  
15 -.input-box textarea {  
16 - font-size: 24rpx;  
17 - color: #666666;  
18 - margin-top: 20rpx;  
19 - height: 200rpx;  
20 -}  
21 -.placeholder {  
22 - font-size: 24rpx;  
23 - color:#C7C7C7;  
24 -}  
25 -.upload_box {  
26 - display: flex;  
27 - flex-wrap: wrap;  
28 - align-items: center;  
29 - padding: 0 32rpx;  
30 -}  
31 -  
32 -.upload_img {  
33 - width: 184rpx;  
34 - height: 184rpx;  
35 - background: rgba(250, 250, 250, 1);  
36 - display: flex;  
37 - flex-direction: column;  
38 - align-items: center;  
39 - justify-content: center;  
40 - position: relative;  
41 - margin-right: 20rpx;  
42 - margin-bottom: 20rpx;  
43 -}  
44 -.upload_img text {  
45 - color:#999;  
46 - font-size: 20rpx;  
47 -}  
48 -.upload_img:nth-child(5), .upload_img:nth-child(10){  
49 - margin-right: 0;  
50 -}  
51 -.upload_img image {  
52 - width: 100%;  
53 - height: 100%;  
54 -}  
55 -  
56 -.icon_box {  
57 - display: block;  
58 - align-items: center;  
59 - justify-content: center;  
60 - border-radius: 50%;  
61 - width: 2rpx;  
62 - height: 2rpx;  
63 - background-color: #fff;  
64 - position: absolute;  
65 - left: -12rpx;  
66 - top: -12rpx;  
67 -}  
68 -.icon-jia {  
69 - font-size: 60rpx;  
70 - color:#999;  
71 -}  
72 -.icon-shanchu1 {  
73 - display: block;  
74 - font-size: 44rpx;  
75 - color: rgba(0,0,0,0.4);  
76 -}  
77 -.set-box {  
78 - display: flex;  
79 - flex-direction: column;  
80 - justify-content: flex-start;  
81 - padding: 20rpx;  
82 - margin-bottom:200rpx;  
83 -}  
84 -.min-num {  
85 - width: 50%;  
86 - display: flex;  
87 - align-items: center;  
88 - font-size: 24rpx;  
89 - color: #333333;  
90 - position: relative;  
91 - margin-bottom: 20rpx;  
92 -}  
93 -.min-num .title {  
94 - margin-right: 16rpx;  
95 -}  
96 -.time-title, .type-title, .address-title {  
97 - margin-right:16rpx;  
98 - width:96rpx;  
99 - text-align:right;  
100 -}  
101 -.limit-title {  
102 - width:96rpx;  
103 - text-align:right;  
104 -}  
105 -.min-num .input {  
106 - width: 160rpx;  
107 - height: 38rpx;  
108 - line-height: 38rpx;  
109 - border:1rpx solid #eee;  
110 - text-align: center;  
111 - padding: 0 4rpx;  
112 - min-height: 38rpx;  
113 -}  
114 -.min-num .min-icon {  
115 - font-size: 24rpx;  
116 - position: absolute;  
117 - right:86rpx;  
118 - top:50%;  
119 - transform: translate(0,-50%);  
120 -}  
121 -.num-box {  
122 - width:100%;  
123 -}  
124 -.icon-min {  
125 - position: absolute;  
126 - left:248rpx;  
127 - right:0;  
128 -}  
129 -.num-box .tips {  
130 - font-size: 18rpx;  
131 - color: #999999;  
132 - margin-left: 10rpx;  
133 -}  
134 -.time-box, .address-box {  
135 - display: flex;  
136 - align-items: center;  
137 - font-size: 24rpx;  
138 - color: #333333;  
139 - margin-bottom: 20rpx;  
140 -}  
141 -.time-box .select {  
142 - display: flex;  
143 - align-items: center;  
144 -}  
145 -.time-box .select .picker {  
146 - width: 80rpx;  
147 - height: 38rpx;  
148 - line-height: 38rpx;  
149 - border: 1rpx solid #eee;  
150 - position: relative;  
151 - padding-left: 10rpx;  
152 -}  
153 -.time-box .select .picker .min-icon {  
154 - font-size: 24rpx;  
155 - position: absolute;  
156 - right:10rpx;  
157 - top:50%;  
158 - transform: translate(0,-50%);  
159 -}  
160 -.margin {  
161 - margin: 0 10rpx;  
162 -}  
163 -.address-box .input {  
164 - width: 507rpx;  
165 - height: 38rpx;  
166 - min-height: 38rpx;  
167 - border:1rpx solid #eee;  
168 - padding: 0 10rpx;  
169 - overflow : hidden;  
170 - display: -webkit-box;  
171 - -webkit-line-clamp: 1;  
172 - -webkit-box-orient: vertical;  
173 -}  
174 -.icon-location {  
175 - color: #C7C7C7;  
176 - margin-left: 10rpx;  
177 -}  
178 -.time-limit {  
179 - display: flex;  
180 - align-items: center;  
181 - font-size: 24rpx;  
182 - color: #333333;  
183 -}  
184 -  
185 -.time-limit input {  
186 - padding: 0 10rpx;  
187 - text-align: center;  
188 - width: 60rpx;  
189 - height: 38rpx;  
190 - line-height: 38rpx;  
191 - min-height: 38rpx;  
192 - border:1rpx solid #eee;  
193 - margin: 0 14rpx;  
194 -}  
195 -.complete {  
196 - width: 100%;  
197 - height: 90rpx;  
198 - line-height: 90rpx;  
199 - display: flex;  
200 - align-items: center;  
201 - justify-content: center;  
202 - background-color: #323232;  
203 - color:#E1C8AF;  
204 - font-size: 30rpx;  
205 - position: fixed;  
206 - left:0;  
207 - bottom:0;  
208 - margin: 0;  
209 - padding: 0;  
210 - border-radius: 0;  
211 -}  
212 -.complete::after {  
213 - border:0;  
214 -}  
215 -.modal {  
216 - width: 73%;  
217 - /* height: 1100rpx; */  
218 - background: #ffffff;  
219 - display: flex;  
220 - align-items: center;  
221 - flex-direction: column;  
222 - z-index:999;  
223 - position: fixed;  
224 - top: 48%;  
225 - left: 50%;  
226 - transform: translate(-50%,-50%);  
227 - padding: 46rpx 0rpx;  
228 - -webkit-box-sizing: border-box;  
229 - -moz-box-sizing: border-box;  
230 - box-sizing: border-box;  
231 - border-radius: 40rpx;  
232 -}  
233 -.modal image {  
234 - width: 110rpx;  
235 - height: 110rpx;  
236 - border-radius: 50%;  
237 - margin-bottom: 34rpx;  
238 -}  
239 -.modal .title {  
240 - color: #333333;  
241 - font-size: 36rpx;  
242 - margin-bottom: 46rpx;  
243 -}  
244 -.modal .tips {  
245 - color: #333333;  
246 - font-size: 24rpx;  
247 - margin-bottom: 26rpx;  
248 -}  
249 -.modal .view-btn {  
250 - height: 66rpx;  
251 - width: 364rpx;  
252 - border:1rpx solid #323232;  
253 - border-radius: 6rpx;  
254 - color:#323232;  
255 - text-align: center;  
256 - line-height: 66rpx;  
257 - font-size: 30rpx;  
258 -}  
259 -.modal .complete-btn {  
260 - width: 364rpx;  
261 - height: 66rpx;  
262 - background-color: #323232;  
263 - border-radius: 6rpx;  
264 - color:#E2C8B1;  
265 - font-size: 30rpx;  
266 - text-align: center;  
267 - line-height: 66rpx;  
268 - margin-top: 26rpx;  
269 -}  
270 -/*弹框样式*/  
271 -.modal_box {  
272 - width: 100%;  
273 - height: 100%;  
274 - position: fixed;  
275 - top: 0;  
276 - left: 0;  
277 - z-index: 10;  
278 - background: rgba(0,0,0,0.3);  
279 -}  
280 -.close-icon {  
281 - width: 100%;  
282 - display: flex;  
283 - align-items: flex-end;  
284 -}  
285 -.icon-x {  
286 - font-size: 40rpx;  
287 - color: #666666;  
288 - position: absolute;  
289 - right:20rpx;  
290 - top:20rpx; 1 +/* pages/activity/activity.wxss */
  2 +.input-box {
  3 + border-top: 22rpx solid #eee;
  4 + padding: 40rpx 20rpx;
  5 + -webkit-box-sizing: border-box;
  6 + -moz-box-sizing: border-box;
  7 + box-sizing: border-box;
  8 +}
  9 +.input-box input {
  10 + font-size: 24rpx;
  11 + color: #666666;
  12 + border-bottom: 1rpx solid #f2f2f2;
  13 +
  14 +}
  15 +.input-box textarea {
  16 + font-size: 24rpx;
  17 + color: #666666;
  18 + margin-top: 20rpx;
  19 + height: 200rpx;
  20 +}
  21 +.placeholder {
  22 + font-size: 24rpx;
  23 + color:#C7C7C7;
  24 +}
  25 +.upload_box {
  26 + display: flex;
  27 + flex-wrap: wrap;
  28 + align-items: center;
  29 + padding: 0 32rpx;
  30 +}
  31 +
  32 +.upload_img {
  33 + width: 184rpx;
  34 + height: 184rpx;
  35 + background: rgba(250, 250, 250, 1);
  36 + display: flex;
  37 + flex-direction: column;
  38 + align-items: center;
  39 + justify-content: center;
  40 + position: relative;
  41 + margin-right: 20rpx;
  42 + margin-bottom: 20rpx;
  43 +}
  44 +.upload_img text {
  45 + color:#999;
  46 + font-size: 20rpx;
  47 +}
  48 +.upload_img:nth-child(5), .upload_img:nth-child(10){
  49 + margin-right: 0;
  50 +}
  51 +.upload_img image {
  52 + width: 100%;
  53 + height: 100%;
  54 +}
  55 +
  56 +.icon_box {
  57 + display: block;
  58 + align-items: center;
  59 + justify-content: center;
  60 + border-radius: 50%;
  61 + width: 2rpx;
  62 + height: 2rpx;
  63 + background-color: #fff;
  64 + position: absolute;
  65 + left: -12rpx;
  66 + top: -12rpx;
  67 +}
  68 +.icon-jia {
  69 + font-size: 60rpx;
  70 + color:#999;
  71 +}
  72 +.icon-shanchu1 {
  73 + display: block;
  74 + font-size: 44rpx;
  75 + color: rgba(0,0,0,0.4);
  76 +}
  77 +.set-box {
  78 + display: flex;
  79 + flex-direction: column;
  80 + justify-content: flex-start;
  81 + padding: 20rpx;
  82 + margin-bottom:200rpx;
  83 +}
  84 +.min-num {
  85 + width: 50%;
  86 + display: flex;
  87 + align-items: center;
  88 + font-size: 24rpx;
  89 + color: #333333;
  90 + position: relative;
  91 + margin-bottom: 20rpx;
  92 +}
  93 +.min-num .title {
  94 + margin-right: 16rpx;
  95 +}
  96 +.time-title, .type-title, .address-title {
  97 + margin-right:16rpx;
  98 + width:96rpx;
  99 + text-align:right;
  100 +}
  101 +.limit-title {
  102 + width:96rpx;
  103 + text-align:right;
  104 +}
  105 +.min-num .input {
  106 + width: 160rpx;
  107 + height: 38rpx;
  108 + line-height: 38rpx;
  109 + border:1rpx solid #eee;
  110 + text-align: center;
  111 + padding: 0 4rpx;
  112 + min-height: 38rpx;
  113 +}
  114 +.min-num .min-icon {
  115 + font-size: 24rpx;
  116 + position: absolute;
  117 + right:86rpx;
  118 + top:50%;
  119 + transform: translate(0,-50%);
  120 +}
  121 +.num-box {
  122 + width:100%;
  123 +}
  124 +.icon-min {
  125 + position: absolute;
  126 + left:248rpx;
  127 + right:0;
  128 +}
  129 +.num-box .tips {
  130 + font-size: 18rpx;
  131 + color: #999999;
  132 + margin-left: 10rpx;
  133 +}
  134 +.time-box, .address-box {
  135 + display: flex;
  136 + align-items: center;
  137 + font-size: 24rpx;
  138 + color: #333333;
  139 + margin-bottom: 20rpx;
  140 +}
  141 +.time-box .select {
  142 + display: flex;
  143 + align-items: center;
  144 +}
  145 +.time-box .select .picker {
  146 + width: 80rpx;
  147 + height: 38rpx;
  148 + line-height: 38rpx;
  149 + border: 1rpx solid #eee;
  150 + position: relative;
  151 + padding-left: 10rpx;
  152 +}
  153 +.time-box .select .picker .min-icon {
  154 + font-size: 24rpx;
  155 + position: absolute;
  156 + right:10rpx;
  157 + top:50%;
  158 + transform: translate(0,-50%);
  159 +}
  160 +.margin {
  161 + margin: 0 10rpx;
  162 +}
  163 +.address-box .input {
  164 + width: 507rpx;
  165 + height: 38rpx;
  166 + min-height: 38rpx;
  167 + border:1rpx solid #eee;
  168 + padding: 0 10rpx;
  169 + overflow : hidden;
  170 + display: -webkit-box;
  171 + -webkit-line-clamp: 1;
  172 + -webkit-box-orient: vertical;
  173 +}
  174 +.icon-location {
  175 + color: #C7C7C7;
  176 + margin-left: 10rpx;
  177 +}
  178 +.time-limit {
  179 + display: flex;
  180 + align-items: center;
  181 + font-size: 24rpx;
  182 + color: #333333;
  183 +}
  184 +
  185 +.time-limit input {
  186 + padding: 0 10rpx;
  187 + text-align: center;
  188 + width: 60rpx;
  189 + height: 38rpx;
  190 + line-height: 38rpx;
  191 + min-height: 38rpx;
  192 + border:1rpx solid #eee;
  193 + margin: 0 14rpx;
  194 +}
  195 +.complete {
  196 + width: 100%;
  197 + height: 90rpx;
  198 + line-height: 90rpx;
  199 + display: flex;
  200 + align-items: center;
  201 + justify-content: center;
  202 + background-color: #323232;
  203 + color:#E1C8AF;
  204 + font-size: 30rpx;
  205 + position: fixed;
  206 + left:0;
  207 + bottom:0;
  208 + margin: 0;
  209 + padding: 0;
  210 + border-radius: 0;
  211 +}
  212 +.complete::after {
  213 + border:0;
  214 +}
  215 +.modal {
  216 + width: 73%;
  217 + /* height: 1100rpx; */
  218 + background: #ffffff;
  219 + display: flex;
  220 + align-items: center;
  221 + flex-direction: column;
  222 + z-index:999;
  223 + position: fixed;
  224 + top: 48%;
  225 + left: 50%;
  226 + transform: translate(-50%,-50%);
  227 + padding: 46rpx 0rpx;
  228 + -webkit-box-sizing: border-box;
  229 + -moz-box-sizing: border-box;
  230 + box-sizing: border-box;
  231 + border-radius: 40rpx;
  232 +}
  233 +.modal image {
  234 + width: 110rpx;
  235 + height: 110rpx;
  236 + border-radius: 50%;
  237 + margin-bottom: 34rpx;
  238 +}
  239 +.modal .title {
  240 + color: #333333;
  241 + font-size: 36rpx;
  242 + margin-bottom: 46rpx;
  243 +}
  244 +.modal .tips {
  245 + color: #333333;
  246 + font-size: 24rpx;
  247 + margin-bottom: 26rpx;
  248 +}
  249 +.modal .view-btn {
  250 + height: 66rpx;
  251 + width: 364rpx;
  252 + border:1rpx solid #323232;
  253 + border-radius: 6rpx;
  254 + color:#323232;
  255 + text-align: center;
  256 + line-height: 66rpx;
  257 + font-size: 30rpx;
  258 +}
  259 +.modal .complete-btn {
  260 + width: 364rpx;
  261 + height: 66rpx;
  262 + background-color: #323232;
  263 + border-radius: 6rpx;
  264 + color:#E2C8B1;
  265 + font-size: 30rpx;
  266 + text-align: center;
  267 + line-height: 66rpx;
  268 + margin-top: 26rpx;
  269 +}
  270 +/*弹框样式*/
  271 +.modal_box {
  272 + width: 100%;
  273 + height: 100%;
  274 + position: fixed;
  275 + top: 0;
  276 + left: 0;
  277 + z-index: 10;
  278 + background: rgba(0,0,0,0.3);
  279 +}
  280 +.close-icon {
  281 + width: 100%;
  282 + display: flex;
  283 + align-items: flex-end;
  284 +}
  285 +.icon-x {
  286 + font-size: 40rpx;
  287 + color: #666666;
  288 + position: absolute;
  289 + right:20rpx;
  290 + top:20rpx;
291 } 291 }
1 -// pages/activity/detail/detail.js  
2 -const app = getApp();  
3 -var t = null;  
4 -  
5 -Page({  
6 -  
7 - /**  
8 - * 页面的初始数据  
9 - */  
10 - data: {  
11 - current_swiper: 0,  
12 - slide: [],  
13 - peopleList: [],  
14 - num: 1,  
15 - actEndTimeList: [],  
16 - is_zan: false,  
17 - display:false,  
18 - content:'',  
19 - is_ask:false,  
20 - is_reply:false,  
21 - placeholder:'输入您的留言',  
22 - is_showRelease_modal:false,  
23 - is_join:false,  
24 - img_heights: [], //图片宽度  
25 - img_width: 750, //默认  
26 - show_canvas: false,  
27 - can_save:false,  
28 - },  
29 - //获取图片真实宽度  
30 - imageLoad: function (e) {  
31 - var img_width = e.detail.width,  
32 - img_height = e.detail.height,  
33 - //宽高比  
34 - ratio = img_width / img_height;  
35 - // console.log(img_width, img_height);  
36 - //计算的高度值  
37 - var viewHeight = 750 / ratio;  
38 - var img_height = viewHeight;  
39 - var img_heights = this.data.img_heights;  
40 - //把每一张图片的对应的高度记录到数组里  
41 - img_heights[e.target.dataset.id] = img_height;  
42 - this.setData({  
43 - img_heights: img_heights  
44 - })  
45 - },  
46 - //查看我的订单  
47 - goMyOrder() {  
48 - this.setData({is_showRelease_modal:false,});  
49 - wx.navigateTo({url:'/pages/order/order-detail/order-detail?id=' + this.data.order_id})  
50 - },  
51 - //完成按钮  
52 - goBack() {  
53 - wx.redirectTo({url:'/pages/index/index'})  
54 - },  
55 - disableScroll() {  
56 - },  
57 - handleBackground() {  
58 - this.setData({is_showRelease_modal:false,})  
59 - },  
60 - // 问一问  
61 - ask(e) {  
62 - // console.log('前问一问-display', this.data.display);  
63 - this.setData({  
64 - display: !this.data.display,  
65 - is_ask:true,is_reply:false,  
66 - content:'' ,  
67 - placeholder:'输入您的留言',  
68 - });  
69 - // console.log('后问一问-display', this.data.display);  
70 - // wx.navigateTo({  
71 - // url: '/pages/comment/comment?activity_id=' + this.data.detail_id  
72 - // + '&common_id=' + 0  
73 - // })  
74 - // console.log('问',e.detail.value);  
75 - // this.setData({focus:true})  
76 - },  
77 - //输入评论内容  
78 - inputComment(e) {  
79 - this.setData({ content: e.detail.value });  
80 - },  
81 - //发送评论/回复  
82 - clickComment(e) {  
83 - // console.log('评论', e);  
84 - this.setData({ display: false });  
85 - if(this.data.content === '' ) {  
86 - wx.showToast({title:'请输入内容',icon:'none'})  
87 - }else {  
88 - let url = '/portal/Active/common';  
89 - let params = {  
90 - token:wx.getStorageSync('token'),  
91 - activeId:this.data.detail_id,  
92 - commonId: this.data.is_ask?0:this.data.commet_id,  
93 - content:this.data.content,  
94 - formId:e.detail.formId,  
95 - };  
96 - app.post(url,params,{}).then((res)=>{  
97 - // console.log('提交评论',res);  
98 - if(+res.code === 1) {  
99 - wx.showToast({title:this.data.is_ask?'留言成功':'回复成功',icon:'none',});  
100 - this.getDetail();  
101 - }  
102 - })  
103 - }  
104 - },  
105 - //评论input失去焦点  
106 - blur() {  
107 - this.setData({ display: false });  
108 - },  
109 - //点击键盘上的完成  
110 - confirm() {  
111 - this.setData({ display: false });  
112 - this.clickComment();  
113 - },  
114 - //回复  
115 - reply(e) {  
116 - // console.log('回复', e);  
117 - const id = e.currentTarget.dataset.id;  
118 - this.setData({  
119 - display: !this.data.display,  
120 - is_ask:false,is_reply:true,  
121 - commet_id:id,content:'' ,  
122 - placeholder:'输入您的回复',  
123 - });  
124 - // wx.navigateTo({  
125 - // url: '/pages/comment/comment?is_reply=' + true  
126 - // + '&activity_id=' + this.data.detail_id + '&common_id=' + id  
127 - // })  
128 - },  
129 - //收藏/取消收藏  
130 - collect() {  
131 - // console.log('收藏');  
132 - let self = this;  
133 - let url = '/portal/Active/collection';  
134 - let url_del = '/portal/Active/delCollection';  
135 - let header = {  
136 - "XX-Token": wx.getStorageSync('token')  
137 - };  
138 - let params = {  
139 - token: wx.getStorageSync('token'),  
140 - activeId: self.data.detail_id,  
141 - };  
142 - if (self.data.is_collect) {  
143 - app.post(url_del, params, header).then((res) => {  
144 - // console.log('取消收藏', res);  
145 - if (+res.code === 1) {  
146 - wx.showToast({title: res.message, icon: 'none'});  
147 - self.setData({  
148 - is_collect: 0  
149 - });  
150 - }  
151 - })  
152 - } else {  
153 - app.post(url, params, header).then((res) => {  
154 - // console.log('收藏', res);  
155 - if (+res.code === 1) {  
156 - wx.showToast({title: res.message, icon: 'none'});  
157 - self.setData({  
158 - is_collect: 1  
159 - });  
160 - }  
161 - })  
162 - }  
163 -  
164 - },  
165 - //点赞  
166 - clickZan(e) {  
167 - let self = this;  
168 - const id = e.currentTarget.dataset.id;  
169 - const index = e.currentTarget.dataset.index;  
170 - let url = '/portal/Active/perfect';  
171 - let header = {  
172 - "XX-Token": wx.getStorageSync('token')  
173 - };  
174 - let params = {  
175 - token: wx.getStorageSync('token'),  
176 - commonId: id,  
177 - };  
178 - app.post(url, params, {}).then((res) => {  
179 - // console.log('点赞', res);  
180 - if (+res.code === 1) { //  
181 - wx.showToast({title: res.message, icon: 'none'});  
182 - self.setData({  
183 - [`commentList[${index}].is_prefect`]: true,  
184 - [`commentList[${index}].prefect`]: res.message == '该评论已赞'?+self.data.commentList[index].prefect:+self.data.commentList[index].prefect + 1,  
185 - });  
186 - // console.log('paise_user', paise_user);  
187 - }  
188 - })  
189 - },  
190 - swiperChange(e) {  
191 - // console.log(e);  
192 - this.setData({current_swiper: e.detail.current})  
193 - },  
194 - onPageScroll(e) {  
195 - // console.log('页面滚动', e);  
196 - if (e.scrollTop > 140) {  
197 - this.setData({hidden_top: true})  
198 - } else if (e.scrollTop <= 140) {  
199 - this.setData({hidden_top: false})  
200 - }  
201 - },  
202 - // 增加数量  
203 - addCount(e) {  
204 - // let k = e.currentTarget.dataset.idx;  
205 - // let t = e.currentTarget.dataset.children_idx;  
206 - // let cartslist = this.data.cartslist;  
207 - // let num = cartslist[k].children[t].num;  
208 - // let product_id = cartslist[k].children[t].product_id;  
209 - let num = this.data.num;  
210 - num++;  
211 - this.setData({  
212 - num: num  
213 - });  
214 - },  
215 - // 减少数量  
216 - minusCount(e) {  
217 - let num = this.data.num;  
218 - if (num <= 1) {  
219 - return false;  
220 - }  
221 - num--;  
222 - this.setData({  
223 - num: num  
224 - });  
225 - },  
226 - //获取详情  
227 - getDetail() {  
228 - const self = this;  
229 - // console.log('city', self.data.city);  
230 - let url = '/portal/Active/activeDetail';  
231 - let params = {  
232 - activeId: self.data.detail_id,  
233 - token: wx.getStorageSync('token'),  
234 - };  
235 - let header = {  
236 - "token": wx.getStorageSync('token')  
237 - };  
238 - app.post(url, params, {}).then((res) => {  
239 - // console.log('获取详情', res, app.initTime(res.data.active.surplus));  
240 - if (+res.code === 1) {  
241 - self.setData({  
242 - detail: res.data.active,  
243 - 'detail.time': app.initTime(res.data.active.surplus),  
244 - end_time: res.data.active.time,  
245 - over_hours: res.data.active.over_time,//几小时截止  
246 - join_people: res.data.son,  
247 - commentList: res.data.common,  
248 - is_collect: res.data.is_collect,  
249 - count: res.data.count, // 留言板  
250 - is_send:res.data.is_send,//能否参加1:不能2:能  
251 - });  
252 - self.getCode();//获取二维码(此二维码不能进入活动详情,已改为小程序码)  
253 - // (0全部,2待拼成,3人数不足未拼成,4已拼成,5已取消,6已完成,7已评价,8已拼成(活动未结束),9删除  
254 - const status = res.data.active.status;  
255 - if (status === 2 || status === 6 || status === 7 || status === 8) {  
256 - // console.log('调用倒计时');  
257 - self.countDown();  
258 - } else {  
259 - // console.log('不调用倒计时');  
260 - let countDownArr = [];  
261 - let obj = null;  
262 - obj = {  
263 - day: '00',  
264 - hou: '00',  
265 - min: '00',  
266 - sec: '00'  
267 - };  
268 - countDownArr.push(obj);  
269 - this.setData({  
270 - 'detail.time': countDownArr,  
271 - });  
272 - }  
273 - }  
274 - // wx.hideLoading()  
275 - })  
276 -  
277 - },  
278 - timeFormat(param) { //小于10的格式化函数  
279 - return param < 10 ? '0' + param : param;  
280 - },  
281 - time() {  
282 - const self = this;  
283 - self.data.detail.surplus--;  
284 - //定時器,每秒重新計算  
285 - // setTimeout(function () {  
286 - // self.time();  
287 - // },1000)  
288 - },  
289 - countDown() { //倒计时函数  
290 - t = setTimeout(this.countDown, 1000);  
291 - let countDownArr = [];  
292 - let obj = null;  
293 - if (this.data.detail.surplus > 0) { //未结束  
294 - this.time();  
295 - // console.log('surplus', this.data.detail.surplus);  
296 - // t = setTimeout(this.countDown, 1000);  
297 - const time = app.initTime(this.data.detail.surplus);  
298 - // console.log('time', time);  
299 - obj = {  
300 - day: time[0].day,  
301 - hou: time[0].hou,  
302 - min: time[0].min,  
303 - sec: time[0].sec  
304 - };  
305 - t;  
306 - } else {  
307 - obj = {  
308 - day: '00',  
309 - hou: '00',  
310 - min: '00',  
311 - sec: '00'  
312 - };  
313 - clearTimeout(t);  
314 - this.end();  
315 - }  
316 - countDownArr.push(obj);  
317 - // 渲染,然后每隔一秒执行一次倒计时函数  
318 - this.setData({  
319 - // countDownList: countDownArr,  
320 - 'detail.time': countDownArr,  
321 - });  
322 - // console.log('time',this.data.detail.time);  
323 - },  
324 - //倒计时结束  
325 - end() {  
326 - const self = this;  
327 - let url = '/portal/Active/activity';  
328 - let params = {  
329 - activeId: self.data.detail_id,  
330 - };  
331 - let header = {  
332 - "token": wx.getStorageSync('token')  
333 - };  
334 - app.post(url, params, {}).then((res) => {  
335 - // console.log('倒计时结束', res);  
336 - if (+res.code === 1) {  
337 - // wx.showToast({title:'拼活动结束',icon:'success'})  
338 - }  
339 - })  
340 - },  
341 - //导航  
342 - getNavigate() {  
343 - const self = this;  
344 - const arr = self.data.detail.latng.split(',');  
345 - // console.log('arr', arr, arr[0], arr[1]);  
346 - wx.openLocation({//​使用微信内置地图查看位置。  
347 - latitude: +arr[1],//要去的纬度-地址  
348 - longitude: +arr[0],//要去的经度-地址  
349 - // lat:39.086437,  
350 - // lng:117.122583,  
351 - name: self.data.detail.address,  
352 - address: self.data.detail.address  
353 - })  
354 - },  
355 - //确认拼活动  
356 - confirmJoin(e) {  
357 - const self = this;  
358 - // console.log('已参与人数',self.data.join_people.length);  
359 - // if(+self.data.is_send === 2){ //可参与  
360 - // if(self.data.join_people.length + self.data.num > self.data.detail.max) {  
361 - // wx.showToast({title:'参加人数已超过剩余名额',icon:'none'})  
362 - // }else if(self.data.join_people.length + self.data.num == self.data.detail.max){  
363 - // wx.showToast({title:'名额已满',icon:'none'})  
364 - // } else {  
365 -  
366 - let url = '/portal/Active/join';  
367 - let params = {  
368 - token: wx.getStorageSync('token'),  
369 - number: self.data.num,  
370 - activeId: self.data.detail_id,  
371 - formId: e.detail.formId,  
372 - };  
373 - let header = {  
374 - "token": wx.getStorageSync('token')  
375 - };  
376 - app.post(url, params, {}).then((res) => {  
377 - // console.log('确认拼活动', res);  
378 - if (+res.code === 1) {  
379 - // wx.showToast({title: '拼活动成功', icon: 'success'});  
380 - self.setData({is_showRelease_modal:true,order_id:+res.data.orderId,is_join:true});  
381 - self.getDetail();  
382 - }else if(+res.code === 0) { //参与失败按钮还是确认拼活动  
383 - self.setData({is_join:false});  
384 - }  
385 - })  
386 - // }  
387 - // }  
388 - },  
389 - //获取活动二维码  
390 - getCode() {  
391 - const self = this;  
392 - let url = '/portal/Index/qrCode';  
393 - let params = {  
394 - id: self.data.detail_id,  
395 - token:wx.getStorageSync('token'),  
396 - type:2,//1拼活动,2拼餐  
397 - };  
398 - app.post(url, params, {}).then((res) => {  
399 - // console.log('获取活动二维码', res);  
400 - if (+res.code === 1) {  
401 - self.setData({qr_code:res.data},() => {  
402 - // console.log('二维码',self.data.qr_code);  
403 - wx.getImageInfo({  
404 - src: 'http://' + self.data.qr_code,  
405 - success(res) {  
406 - // console.log('二维码本地路径',res);  
407 - self.setData({local_qr_code:res.path});  
408 - self.getLocalImage();  
409 - },  
410 - fail() {  
411 - console.log('失败');  
412 - }  
413 - })  
414 - });  
415 - }  
416 - })  
417 - },  
418 - //点击分享  
419 - share() {  
420 - this.setData({show_canvas: true}, () => {  
421 - this.drawCard();  
422 - })  
423 - },  
424 - hideCanvasMask() {  
425 - // this.setData({show_canvas: true});  
426 - },  
427 - //关闭分享卡片  
428 - closeCanvas() {  
429 - this.setData({show_canvas: false});  
430 - // wx.navigateBack({delta:1})  
431 - },  
432 - //保存图片到手机相册  
433 - saveToPhone() {  
434 - this.getPower();  
435 - },  
436 - //详情图链接转成本地路径  
437 - getLocalImage() {  
438 - const self = this;  
439 - wx.getImageInfo({  
440 - src: self.data.detail.banner[0],  
441 - success(res) {  
442 - // console.log('详情图本地路径',res);  
443 - self.setData({local_img:res.path});  
444 - self.drawCard();  
445 - // console.log(res.width)  
446 - // console.log(res.height)  
447 - }  
448 - })  
449 - },  
450 - // 画圆角 ctx、x起点、y起点、w宽度、y高度、r圆角半径、fillColor填充颜色、strokeColor边框颜色  
451 - roundRect(ctx, x, y, w, h, r, fillColor, strokeColor) {  
452 - const self = this;  
453 - // 开始绘制  
454 - ctx.beginPath()  
455 -  
456 - // 绘制左上角圆弧 Math.PI = 180度  
457 - // 圆心x起点、圆心y起点、半径、以3点钟方向顺时针旋转后确认的起始弧度、以3点钟方向顺时针旋转后确认的终止弧度  
458 - ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5)  
459 -  
460 - // 绘制border-top  
461 - // 移动起点位置 x终点、y终点  
462 - ctx.moveTo(x + r, y)  
463 - // 画一条线 x终点、y终点  
464 - ctx.lineTo(x + w - r, y)  
465 - // self.data.ctx.lineTo(x + w, y + r)  
466 -  
467 - // 绘制右上角圆弧  
468 - ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2)  
469 -  
470 - // 绘制border-right  
471 - ctx.lineTo(x + w, y + h - r)  
472 - // self.data.ctx.lineTo(x + w - r, y + h)  
473 -  
474 - // 绘制右下角圆弧  
475 - ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5)  
476 -  
477 - // 绘制border-bottom  
478 - ctx.lineTo(x + r, y + h)  
479 - // self.data.ctx.lineTo(x, y + h - r)  
480 -  
481 - // 绘制左下角圆弧  
482 - ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI)  
483 -  
484 - // 绘制border-left  
485 - ctx.lineTo(x, y + r)  
486 - // self.data.ctx.lineTo(x + r, y)  
487 -  
488 - if (fillColor) {  
489 - // 因为边缘描边存在锯齿,最好指定使用 transparent 填充  
490 - ctx.setFillStyle(fillColor)  
491 - // 对绘画区域填充  
492 - ctx.fill()  
493 - }  
494 -  
495 - if (strokeColor) {  
496 - // 因为边缘描边存在锯齿,最好指定使用 transparent 填充  
497 - ctx.setStrokeStyle(strokeColor)  
498 - // 画出当前路径的边框  
499 - ctx.stroke()  
500 - }  
501 - // 关闭一个路径  
502 - // self.data.ctx.closePath()  
503 -  
504 - // 剪切,剪切之后的绘画绘制剪切区域内进行,需要save与restore  
505 - ctx.clip()  
506 - },  
507 - drawCard() {  
508 - // console.log('开始画');  
509 - const self = this;  
510 - //先创建一个画布  
511 - const ctx = wx.createCanvasContext("canvas");  
512 - self.setData({ctx:ctx});  
513 - // self.roundRect(ctx,0,0,300,302,10,'transparent','transparent');//画圆角  
514 - // self.roundRect(ctx,0,0,350,402,10,'#000','#000');//画圆角  
515 - // ctx.arc(150, 75, 50, 0, 2 * Math.PI);//剪切  
516 - // ctx.setFillStyle('#ffffff');  
517 - // ctx.fill();  
518 - // ctx.clip();  
519 - //填充背景色  
520 - ctx.fillStyle = '#fff';  
521 - ctx.fillRect(0, 0, 280, 400);  
522 - // console.log(self.data.local_img);  
523 - // console.log(self.data.qr_code);  
524 - //将图片转化为画布  
525 - ctx.drawImage(self.data.local_img, 0, 0, 280, 280);//详情图  
526 - // console.log(111);  
527 - // ctx.drawImage(self.data.local_qr_code, 220, 209, 60, 60);//二维码  
528 - ctx.drawImage('../../../images/qr_code.jpg', 180, 320, 60, 60);//小程序码  
529 - //标题  
530 - ctx.setFontSize(12);  
531 - ctx.setFillStyle('#000');  
532 - ctx.textAlign = "left";  
533 - // console.log(111);  
534 - ctx.fillText(self.data.detail.title, 16, 306.5);  
535 - ctx.fillText(self.data.detail.title, 15.5, 307);  
536 - ctx.restore();  
537 - //地点  
538 - ctx.setFontSize(9);  
539 - ctx.setFillStyle('#000000');  
540 - ctx.fillText('地点:', 16, 325);  
541 - const text = self.data.detail.name;  
542 - var chr = text.split("");//这个方法是将一个字符串分割成字符串数组  
543 - var temp = "";  
544 - var row = [];  
545 - ctx.setFontSize(9);  
546 - ctx.setFillStyle('#000000');  
547 - for (var a = 0; a < chr.length; a++) {  
548 - if (ctx.measureText(temp).width < 100) {  
549 - temp += chr[a];  
550 - }  
551 - else {  
552 - a--; //这里添加了a-- 是为了防止字符丢失,效果图中有对比  
553 - row.push(temp);  
554 - temp = "";  
555 - }  
556 - }  
557 - row.push(temp);  
558 -  
559 - //如果数组长度大于1 则截取前1个  
560 - if (row.length > 1) {  
561 - var rowCut = row.slice(0, 1);  
562 - var rowPart = rowCut[0];  
563 - var test = "";  
564 - var empty = [];  
565 - for (var a = 0; a < rowPart.length; a++) {  
566 - if (ctx.measureText(test).width < 100) {  
567 - test += rowPart[a];  
568 - }  
569 - else {  
570 - break;  
571 - }  
572 - }  
573 - empty.push(test);  
574 - var group = empty[0] + "...";//这里只显示一行,超出的用...表示  
575 - rowCut.splice(0, 1, group);  
576 - row = rowCut;  
577 - }  
578 - for (var b = 0; b < row.length; b++) {  
579 - ctx.fillText(row[b], 40, 325 + b * 16, 150);  
580 - }  
581 - ctx.restore();  
582 - //时间  
583 - ctx.setFontSize(9);  
584 - ctx.setFillStyle('#333333');  
585 - ctx.fillText('时间:', 16, 340);  
586 - ctx.fillText(self.data.end_time, 40, 340);  
587 - ctx.restore();  
588 - // ctx.drawImage("../../../../images/home-banner.png", 0, 0, 250, 150)  
589 - //成功执行,draw方法中进行回调  
590 - ctx.draw(true, function () {  
591 - // wx.hideLoading();  
592 - console.log("draw callback success");  
593 - self.setData({can_save: true,show_canvas: true});  
594 - // console.log(self.data.can_save);  
595 - })  
596 - },  
597 - //获取保存到相册的权限  
598 - getPower() {  
599 - const that = this;  
600 - //保存临时图片  
601 - wx.getSetting({  
602 - success(res) {  
603 - if (!res.authSetting['scope.writePhotosAlbum']) {  
604 - wx.authorize({  
605 - scope: 'scope.writePhotosAlbum',  
606 - success() { //这里是用户同意授权后的回调  
607 - that.savePic();  
608 - },  
609 - fail() { //这里是用户拒绝授权后的回调  
610 - wx.showModal({  
611 - title: '提示',  
612 - content: '若不打开授权,则无法将图片保存在相册中!',  
613 - showCancel: true,  
614 - cancelText: '暂不授权',  
615 - cancelColor: '#000000',  
616 - confirmText: '去授权',  
617 - confirmColor: '#3CC51F',  
618 - success: function (res) {  
619 - if (res.confirm) {  
620 - wx.openSetting({  
621 - //调起客户端小程序设置界面,返回用户设置的操作结果。  
622 - success: function (ret) {  
623 - if (ret.authSetting["scope.writePhotosAlbum"] == true) {  
624 - wx.showToast({  
625 - title: '授权成功',  
626 - icon: 'none',  
627 - duration: 1000  
628 - });  
629 - //再次授权,保存到相册  
630 - that.savePic();  
631 - } else {  
632 - wx.showToast({  
633 - title: '授权失败',  
634 - icon: 'none',  
635 - duration: 1000  
636 - })  
637 - }  
638 - }  
639 - })  
640 - } else {  
641 - wx.showToast({  
642 - title: '授权失败',  
643 - icon: 'none',  
644 - duration: 1000  
645 - })  
646 - // console.log('用户点击取消')  
647 - }  
648 - }  
649 - })  
650 - }  
651 - })  
652 - } else { //用户已经授权过了  
653 - console.log('用户已经授权过了')  
654 - that.savePic();  
655 - }  
656 - }  
657 - });  
658 -  
659 - },  
660 - savePic() {  
661 - // console.log('是否能保存',this.data.can_save);  
662 - if(this.data.can_save) {  
663 - wx.canvasToTempFilePath({  
664 - x: 0,  
665 - y: 0,  
666 - width: 280,  
667 - height: 400,  
668 - destWidth: 840,//是width的3倍  
669 - destHeight: 1280,//是高的3.2倍  
670 - canvasId: 'canvas',  
671 - fileType: 'jpg',  
672 - quality:1,  
673 - success: function (res) {  
674 - // console.log("get tempfilepath(success) is:", res.tempFilePath);  
675 - //将图片保存在系统相册中(应先获取权限,)  
676 - wx.saveImageToPhotosAlbum({  
677 - filePath: res.tempFilePath,  
678 - success(res) {  
679 - wx.showToast({title:'保存成功',icon:'none'});  
680 - console.log("save photo is success")  
681 - },  
682 - fail: function () {  
683 - wx.showToast({title:'保存失败',icon:'none'});  
684 - console.log("save photo is fail")  
685 - }  
686 - })  
687 - },  
688 - fail: function () {  
689 - console.log('get tempfilepath is fail')  
690 - }  
691 - })  
692 - }else {  
693 - wx.showLoading({title:'加载中',icon:'loading',duration:1000})  
694 - }  
695 -  
696 - },  
697 - /**  
698 - * 生命周期函数--监听页面加载  
699 - */  
700 - onLoad: function (options) {  
701 - // console.log('详情options', options);  
702 - this.setData({detail_id: +options.id ? +options.id : ''});  
703 - },  
704 -  
705 - /**  
706 - * 生命周期函数--监听页面初次渲染完成  
707 - */  
708 - onReady: function () {  
709 -  
710 - },  
711 -  
712 - /**  
713 - * 生命周期函数--监听页面显示  
714 - */  
715 - onShow: function () {  
716 - this.getDetail();  
717 - },  
718 -  
719 - /**  
720 - * 生命周期函数--监听页面隐藏  
721 - */  
722 - onHide: function () {  
723 -  
724 - },  
725 -  
726 - /**  
727 - * 生命周期函数--监听页面卸载  
728 - */  
729 - onUnload: function () {  
730 - clearTimeout(t)  
731 - },  
732 -  
733 - /**  
734 - * 页面相关事件处理函数--监听用户下拉动作  
735 - */  
736 - onPullDownRefresh: function () {  
737 -  
738 - },  
739 -  
740 - /**  
741 - * 页面上拉触底事件的处理函数  
742 - */  
743 - onReachBottom: function () {  
744 -  
745 - },  
746 -  
747 - /**  
748 - * 用户点击右上角分享  
749 - */  
750 - onShareAppMessage: function (res) {  
751 - // console.log('转发res',res);  
752 - let self = this;  
753 - if(res.from === 'button') {  
754 - return {  
755 - title: self.data.detail.title, // 默认是小程序的名称(可以写slogan等)  
756 - path: '/pages/activity/detail/detail?id=' + self.data.detail_id, // 默认是当前页面,必须是以‘/’开头的完整路径  
757 - imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4  
758 - success: function (res) {  
759 - if (res.errMsg == 'shareAppMessage:ok') {  
760 - console.log('转发成功之后');  
761 - }  
762 - },  
763 - fail: function () {  
764 - // 转发失败之后的回调  
765 - if (res.errMsg == 'shareAppMessage:fail cancel') {  
766 - // 用户取消转发  
767 - } else if (res.errMsg == 'shareAppMessage:fail') {  
768 - // 转发失败,其中 detail message 为详细失败信息  
769 - }  
770 - },  
771 - complete: function () {  
772 - // 转发结束之后的回调(转发成不成功都会执行)  
773 - console.log('转发结束之后');  
774 - }  
775 - }  
776 - }else {  
777 - return {  
778 - title: self.data.detail.title, // 默认是小程序的名称(可以写slogan等)  
779 - path: '/pages/activity/detail/detail?id=' + self.data.detail_id, // 默认是当前页面,必须是以‘/’开头的完整路径  
780 - imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4  
781 - success: function (res) {  
782 - if (res.errMsg == 'shareAppMessage:ok') {  
783 - console.log('转发成功之后');  
784 - }  
785 - },  
786 - fail: function () {  
787 - // 转发失败之后的回调  
788 - if (res.errMsg == 'shareAppMessage:fail cancel') {  
789 - // 用户取消转发  
790 - } else if (res.errMsg == 'shareAppMessage:fail') {  
791 - // 转发失败,其中 detail message 为详细失败信息  
792 - }  
793 - },  
794 - complete: function () {  
795 - // 转发结束之后的回调(转发成不成功都会执行)  
796 - console.log('转发结束之后');  
797 - }  
798 - }  
799 - }  
800 - }, 1 +// pages/activity/detail/detail.js
  2 +const app = getApp();
  3 +var t = null;
  4 +
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + current_swiper: 0,
  12 + slide: [],
  13 + peopleList: [],
  14 + num: 1,
  15 + actEndTimeList: [],
  16 + is_zan: false,
  17 + display:false,
  18 + content:'',
  19 + is_ask:false,
  20 + is_reply:false,
  21 + placeholder:'输入您的留言',
  22 + is_showRelease_modal:false,
  23 + is_join:false,
  24 + img_heights: [], //图片宽度
  25 + img_width: 750, //默认
  26 + show_canvas: false,
  27 + can_save:false,
  28 + },
  29 + //获取图片真实宽度
  30 + imageLoad: function (e) {
  31 + var img_width = e.detail.width,
  32 + img_height = e.detail.height,
  33 + //宽高比
  34 + ratio = img_width / img_height;
  35 + // console.log(img_width, img_height);
  36 + //计算的高度值
  37 + var viewHeight = 750 / ratio;
  38 + var img_height = viewHeight;
  39 + var img_heights = this.data.img_heights;
  40 + //把每一张图片的对应的高度记录到数组里
  41 + img_heights[e.target.dataset.id] = img_height;
  42 + this.setData({
  43 + img_heights: img_heights
  44 + })
  45 + },
  46 + //查看我的订单
  47 + goMyOrder() {
  48 + this.setData({is_showRelease_modal:false,});
  49 + wx.navigateTo({url:'/pages/order/order-detail/order-detail?id=' + this.data.order_id})
  50 + },
  51 + //完成按钮
  52 + goBack() {
  53 + wx.redirectTo({url:'/pages/index/index'})
  54 + },
  55 + disableScroll() {
  56 + },
  57 + handleBackground() {
  58 + this.setData({is_showRelease_modal:false,})
  59 + },
  60 + // 问一问
  61 + ask(e) {
  62 + // console.log('前问一问-display', this.data.display);
  63 + this.setData({
  64 + display: !this.data.display,
  65 + is_ask:true,is_reply:false,
  66 + content:'' ,
  67 + placeholder:'输入您的留言',
  68 + });
  69 + // console.log('后问一问-display', this.data.display);
  70 + // wx.navigateTo({
  71 + // url: '/pages/comment/comment?activity_id=' + this.data.detail_id
  72 + // + '&common_id=' + 0
  73 + // })
  74 + // console.log('问',e.detail.value);
  75 + // this.setData({focus:true})
  76 + },
  77 + //输入评论内容
  78 + inputComment(e) {
  79 + this.setData({ content: e.detail.value });
  80 + },
  81 + //发送评论/回复
  82 + clickComment(e) {
  83 + // console.log('评论', e);
  84 + this.setData({ display: false });
  85 + if(this.data.content === '' ) {
  86 + wx.showToast({title:'请输入内容',icon:'none'})
  87 + }else {
  88 + let url = '/portal/Active/common';
  89 + let params = {
  90 + token:wx.getStorageSync('token'),
  91 + activeId:this.data.detail_id,
  92 + commonId: this.data.is_ask?0:this.data.commet_id,
  93 + content:this.data.content,
  94 + formId:e.detail.formId,
  95 + };
  96 + app.post(url,params,{}).then((res)=>{
  97 + // console.log('提交评论',res);
  98 + if(+res.code === 1) {
  99 + wx.showToast({title:this.data.is_ask?'留言成功':'回复成功',icon:'none',});
  100 + this.getDetail();
  101 + }
  102 + })
  103 + }
  104 + },
  105 + //评论input失去焦点
  106 + blur() {
  107 + this.setData({ display: false });
  108 + },
  109 + //点击键盘上的完成
  110 + confirm() {
  111 + this.setData({ display: false });
  112 + this.clickComment();
  113 + },
  114 + //回复
  115 + reply(e) {
  116 + // console.log('回复', e);
  117 + const id = e.currentTarget.dataset.id;
  118 + this.setData({
  119 + display: !this.data.display,
  120 + is_ask:false,is_reply:true,
  121 + commet_id:id,content:'' ,
  122 + placeholder:'输入您的回复',
  123 + });
  124 + // wx.navigateTo({
  125 + // url: '/pages/comment/comment?is_reply=' + true
  126 + // + '&activity_id=' + this.data.detail_id + '&common_id=' + id
  127 + // })
  128 + },
  129 + //收藏/取消收藏
  130 + collect() {
  131 + // console.log('收藏');
  132 + let self = this;
  133 + let url = '/portal/Active/collection';
  134 + let url_del = '/portal/Active/delCollection';
  135 + let header = {
  136 + "XX-Token": wx.getStorageSync('token')
  137 + };
  138 + let params = {
  139 + token: wx.getStorageSync('token'),
  140 + activeId: self.data.detail_id,
  141 + };
  142 + if (self.data.is_collect) {
  143 + app.post(url_del, params, header).then((res) => {
  144 + // console.log('取消收藏', res);
  145 + if (+res.code === 1) {
  146 + wx.showToast({title: res.message, icon: 'none'});
  147 + self.setData({
  148 + is_collect: 0
  149 + });
  150 + }
  151 + })
  152 + } else {
  153 + app.post(url, params, header).then((res) => {
  154 + // console.log('收藏', res);
  155 + if (+res.code === 1) {
  156 + wx.showToast({title: res.message, icon: 'none'});
  157 + self.setData({
  158 + is_collect: 1
  159 + });
  160 + }
  161 + })
  162 + }
  163 +
  164 + },
  165 + //点赞
  166 + clickZan(e) {
  167 + let self = this;
  168 + const id = e.currentTarget.dataset.id;
  169 + const index = e.currentTarget.dataset.index;
  170 + let url = '/portal/Active/perfect';
  171 + let header = {
  172 + "XX-Token": wx.getStorageSync('token')
  173 + };
  174 + let params = {
  175 + token: wx.getStorageSync('token'),
  176 + commonId: id,
  177 + };
  178 + app.post(url, params, {}).then((res) => {
  179 + // console.log('点赞', res);
  180 + if (+res.code === 1) { //
  181 + wx.showToast({title: res.message, icon: 'none'});
  182 + self.setData({
  183 + [`commentList[${index}].is_prefect`]: true,
  184 + [`commentList[${index}].prefect`]: res.message == '该评论已赞'?+self.data.commentList[index].prefect:+self.data.commentList[index].prefect + 1,
  185 + });
  186 + // console.log('paise_user', paise_user);
  187 + }
  188 + })
  189 + },
  190 + swiperChange(e) {
  191 + // console.log(e);
  192 + this.setData({current_swiper: e.detail.current})
  193 + },
  194 + onPageScroll(e) {
  195 + // console.log('页面滚动', e);
  196 + if (e.scrollTop > 140) {
  197 + this.setData({hidden_top: true})
  198 + } else if (e.scrollTop <= 140) {
  199 + this.setData({hidden_top: false})
  200 + }
  201 + },
  202 + // 增加数量
  203 + addCount(e) {
  204 + // let k = e.currentTarget.dataset.idx;
  205 + // let t = e.currentTarget.dataset.children_idx;
  206 + // let cartslist = this.data.cartslist;
  207 + // let num = cartslist[k].children[t].num;
  208 + // let product_id = cartslist[k].children[t].product_id;
  209 + let num = this.data.num;
  210 + num++;
  211 + this.setData({
  212 + num: num
  213 + });
  214 + },
  215 + // 减少数量
  216 + minusCount(e) {
  217 + let num = this.data.num;
  218 + if (num <= 1) {
  219 + return false;
  220 + }
  221 + num--;
  222 + this.setData({
  223 + num: num
  224 + });
  225 + },
  226 + //获取详情
  227 + getDetail() {
  228 + const self = this;
  229 + // console.log('city', self.data.city);
  230 + let url = '/portal/Active/activeDetail';
  231 + let params = {
  232 + activeId: self.data.detail_id,
  233 + token: wx.getStorageSync('token'),
  234 + };
  235 + let header = {
  236 + "token": wx.getStorageSync('token')
  237 + };
  238 + app.post(url, params, {}).then((res) => {
  239 + // console.log('获取详情', res, app.initTime(res.data.active.surplus));
  240 + if (+res.code === 1) {
  241 + self.setData({
  242 + detail: res.data.active,
  243 + 'detail.time': app.initTime(res.data.active.surplus),
  244 + end_time: res.data.active.time,
  245 + over_hours: res.data.active.over_time,//几小时截止
  246 + join_people: res.data.son,
  247 + commentList: res.data.common,
  248 + is_collect: res.data.is_collect,
  249 + count: res.data.count, // 留言板
  250 + is_send:res.data.is_send,//能否参加1:不能2:能
  251 + });
  252 + self.getCode();//获取二维码(此二维码不能进入活动详情,已改为小程序码)
  253 + // (0全部,2待拼成,3人数不足未拼成,4已拼成,5已取消,6已完成,7已评价,8已拼成(活动未结束),9删除
  254 + const status = res.data.active.status;
  255 + if (status === 2 || status === 6 || status === 7 || status === 8) {
  256 + // console.log('调用倒计时');
  257 + self.countDown();
  258 + } else {
  259 + // console.log('不调用倒计时');
  260 + let countDownArr = [];
  261 + let obj = null;
  262 + obj = {
  263 + day: '00',
  264 + hou: '00',
  265 + min: '00',
  266 + sec: '00'
  267 + };
  268 + countDownArr.push(obj);
  269 + this.setData({
  270 + 'detail.time': countDownArr,
  271 + });
  272 + }
  273 + }
  274 + // wx.hideLoading()
  275 + })
  276 +
  277 + },
  278 + timeFormat(param) { //小于10的格式化函数
  279 + return param < 10 ? '0' + param : param;
  280 + },
  281 + time() {
  282 + const self = this;
  283 + self.data.detail.surplus--;
  284 + //定時器,每秒重新計算
  285 + // setTimeout(function () {
  286 + // self.time();
  287 + // },1000)
  288 + },
  289 + countDown() { //倒计时函数
  290 + t = setTimeout(this.countDown, 1000);
  291 + let countDownArr = [];
  292 + let obj = null;
  293 + if (this.data.detail.surplus > 0) { //未结束
  294 + this.time();
  295 + // console.log('surplus', this.data.detail.surplus);
  296 + // t = setTimeout(this.countDown, 1000);
  297 + const time = app.initTime(this.data.detail.surplus);
  298 + // console.log('time', time);
  299 + obj = {
  300 + day: time[0].day,
  301 + hou: time[0].hou,
  302 + min: time[0].min,
  303 + sec: time[0].sec
  304 + };
  305 + t;
  306 + } else {
  307 + obj = {
  308 + day: '00',
  309 + hou: '00',
  310 + min: '00',
  311 + sec: '00'
  312 + };
  313 + clearTimeout(t);
  314 + this.end();
  315 + }
  316 + countDownArr.push(obj);
  317 + // 渲染,然后每隔一秒执行一次倒计时函数
  318 + this.setData({
  319 + // countDownList: countDownArr,
  320 + 'detail.time': countDownArr,
  321 + });
  322 + // console.log('time',this.data.detail.time);
  323 + },
  324 + //倒计时结束
  325 + end() {
  326 + const self = this;
  327 + let url = '/portal/Active/activity';
  328 + let params = {
  329 + activeId: self.data.detail_id,
  330 + };
  331 + let header = {
  332 + "token": wx.getStorageSync('token')
  333 + };
  334 + app.post(url, params, {}).then((res) => {
  335 + // console.log('倒计时结束', res);
  336 + if (+res.code === 1) {
  337 + // wx.showToast({title:'拼活动结束',icon:'success'})
  338 + }
  339 + })
  340 + },
  341 + //导航
  342 + getNavigate() {
  343 + const self = this;
  344 + const arr = self.data.detail.latng.split(',');
  345 + // console.log('arr', arr, arr[0], arr[1]);
  346 + wx.openLocation({//​使用微信内置地图查看位置。
  347 + latitude: +arr[1],//要去的纬度-地址
  348 + longitude: +arr[0],//要去的经度-地址
  349 + // lat:39.086437,
  350 + // lng:117.122583,
  351 + name: self.data.detail.address,
  352 + address: self.data.detail.address
  353 + })
  354 + },
  355 + //确认拼活动
  356 + confirmJoin(e) {
  357 + const self = this;
  358 + // console.log('已参与人数',self.data.join_people.length);
  359 + // if(+self.data.is_send === 2){ //可参与
  360 + // if(self.data.join_people.length + self.data.num > self.data.detail.max) {
  361 + // wx.showToast({title:'参加人数已超过剩余名额',icon:'none'})
  362 + // }else if(self.data.join_people.length + self.data.num == self.data.detail.max){
  363 + // wx.showToast({title:'名额已满',icon:'none'})
  364 + // } else {
  365 +
  366 + let url = '/portal/Active/join';
  367 + let params = {
  368 + token: wx.getStorageSync('token'),
  369 + number: self.data.num,
  370 + activeId: self.data.detail_id,
  371 + formId: e.detail.formId,
  372 + };
  373 + let header = {
  374 + "token": wx.getStorageSync('token')
  375 + };
  376 + app.post(url, params, {}).then((res) => {
  377 + // console.log('确认拼活动', res);
  378 + if (+res.code === 1) {
  379 + // wx.showToast({title: '拼活动成功', icon: 'success'});
  380 + self.setData({is_showRelease_modal:true,order_id:+res.data.orderId,is_join:true});
  381 + self.getDetail();
  382 + }else if(+res.code === 0) { //参与失败按钮还是确认拼活动
  383 + self.setData({is_join:false});
  384 + }
  385 + })
  386 + // }
  387 + // }
  388 + },
  389 + //获取活动二维码
  390 + getCode() {
  391 + const self = this;
  392 + let url = '/portal/Index/qrCode';
  393 + let params = {
  394 + id: self.data.detail_id,
  395 + token:wx.getStorageSync('token'),
  396 + type:2,//1拼活动,2拼餐
  397 + };
  398 + app.post(url, params, {}).then((res) => {
  399 + // console.log('获取活动二维码', res);
  400 + if (+res.code === 1) {
  401 + self.setData({qr_code:res.data},() => {
  402 + // console.log('二维码',self.data.qr_code);
  403 + wx.getImageInfo({
  404 + src: 'http://' + self.data.qr_code,
  405 + success(res) {
  406 + // console.log('二维码本地路径',res);
  407 + self.setData({local_qr_code:res.path});
  408 + self.getLocalImage();
  409 + },
  410 + fail() {
  411 + console.log('失败');
  412 + }
  413 + })
  414 + });
  415 + }
  416 + })
  417 + },
  418 + //点击分享
  419 + share() {
  420 + this.setData({show_canvas: true}, () => {
  421 + this.drawCard();
  422 + })
  423 + },
  424 + hideCanvasMask() {
  425 + // this.setData({show_canvas: true});
  426 + },
  427 + //关闭分享卡片
  428 + closeCanvas() {
  429 + this.setData({show_canvas: false});
  430 + // wx.navigateBack({delta:1})
  431 + },
  432 + //保存图片到手机相册
  433 + saveToPhone() {
  434 + this.getPower();
  435 + },
  436 + //详情图链接转成本地路径
  437 + getLocalImage() {
  438 + const self = this;
  439 + wx.getImageInfo({
  440 + src: self.data.detail.banner[0],
  441 + success(res) {
  442 + // console.log('详情图本地路径',res);
  443 + self.setData({local_img:res.path});
  444 + self.drawCard();
  445 + // console.log(res.width)
  446 + // console.log(res.height)
  447 + }
  448 + })
  449 + },
  450 + // 画圆角 ctx、x起点、y起点、w宽度、y高度、r圆角半径、fillColor填充颜色、strokeColor边框颜色
  451 + roundRect(ctx, x, y, w, h, r, fillColor, strokeColor) {
  452 + const self = this;
  453 + // 开始绘制
  454 + ctx.beginPath()
  455 +
  456 + // 绘制左上角圆弧 Math.PI = 180度
  457 + // 圆心x起点、圆心y起点、半径、以3点钟方向顺时针旋转后确认的起始弧度、以3点钟方向顺时针旋转后确认的终止弧度
  458 + ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5)
  459 +
  460 + // 绘制border-top
  461 + // 移动起点位置 x终点、y终点
  462 + ctx.moveTo(x + r, y)
  463 + // 画一条线 x终点、y终点
  464 + ctx.lineTo(x + w - r, y)
  465 + // self.data.ctx.lineTo(x + w, y + r)
  466 +
  467 + // 绘制右上角圆弧
  468 + ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2)
  469 +
  470 + // 绘制border-right
  471 + ctx.lineTo(x + w, y + h - r)
  472 + // self.data.ctx.lineTo(x + w - r, y + h)
  473 +
  474 + // 绘制右下角圆弧
  475 + ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5)
  476 +
  477 + // 绘制border-bottom
  478 + ctx.lineTo(x + r, y + h)
  479 + // self.data.ctx.lineTo(x, y + h - r)
  480 +
  481 + // 绘制左下角圆弧
  482 + ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI)
  483 +
  484 + // 绘制border-left
  485 + ctx.lineTo(x, y + r)
  486 + // self.data.ctx.lineTo(x + r, y)
  487 +
  488 + if (fillColor) {
  489 + // 因为边缘描边存在锯齿,最好指定使用 transparent 填充
  490 + ctx.setFillStyle(fillColor)
  491 + // 对绘画区域填充
  492 + ctx.fill()
  493 + }
  494 +
  495 + if (strokeColor) {
  496 + // 因为边缘描边存在锯齿,最好指定使用 transparent 填充
  497 + ctx.setStrokeStyle(strokeColor)
  498 + // 画出当前路径的边框
  499 + ctx.stroke()
  500 + }
  501 + // 关闭一个路径
  502 + // self.data.ctx.closePath()
  503 +
  504 + // 剪切,剪切之后的绘画绘制剪切区域内进行,需要save与restore
  505 + ctx.clip()
  506 + },
  507 + drawCard() {
  508 + // console.log('开始画');
  509 + const self = this;
  510 + //先创建一个画布
  511 + const ctx = wx.createCanvasContext("canvas");
  512 + self.setData({ctx:ctx});
  513 + // self.roundRect(ctx,0,0,300,302,10,'transparent','transparent');//画圆角
  514 + // self.roundRect(ctx,0,0,350,402,10,'#000','#000');//画圆角
  515 + // ctx.arc(150, 75, 50, 0, 2 * Math.PI);//剪切
  516 + // ctx.setFillStyle('#ffffff');
  517 + // ctx.fill();
  518 + // ctx.clip();
  519 + //填充背景色
  520 + ctx.fillStyle = '#fff';
  521 + ctx.fillRect(0, 0, 280, 400);
  522 + // console.log(self.data.local_img);
  523 + // console.log(self.data.qr_code);
  524 + //将图片转化为画布
  525 + ctx.drawImage(self.data.local_img, 0, 0, 280, 280);//详情图
  526 + // console.log(111);
  527 + // ctx.drawImage(self.data.local_qr_code, 220, 209, 60, 60);//二维码
  528 + ctx.drawImage('../../../images/qr_code.jpg', 180, 320, 60, 60);//小程序码
  529 + //标题
  530 + ctx.setFontSize(12);
  531 + ctx.setFillStyle('#000');
  532 + ctx.textAlign = "left";
  533 + // console.log(111);
  534 + ctx.fillText(self.data.detail.title, 16, 306.5);
  535 + ctx.fillText(self.data.detail.title, 15.5, 307);
  536 + ctx.restore();
  537 + //地点
  538 + ctx.setFontSize(9);
  539 + ctx.setFillStyle('#000000');
  540 + ctx.fillText('地点:', 16, 325);
  541 + const text = self.data.detail.name;
  542 + var chr = text.split("");//这个方法是将一个字符串分割成字符串数组
  543 + var temp = "";
  544 + var row = [];
  545 + ctx.setFontSize(9);
  546 + ctx.setFillStyle('#000000');
  547 + for (var a = 0; a < chr.length; a++) {
  548 + if (ctx.measureText(temp).width < 100) {
  549 + temp += chr[a];
  550 + }
  551 + else {
  552 + a--; //这里添加了a-- 是为了防止字符丢失,效果图中有对比
  553 + row.push(temp);
  554 + temp = "";
  555 + }
  556 + }
  557 + row.push(temp);
  558 +
  559 + //如果数组长度大于1 则截取前1个
  560 + if (row.length > 1) {
  561 + var rowCut = row.slice(0, 1);
  562 + var rowPart = rowCut[0];
  563 + var test = "";
  564 + var empty = [];
  565 + for (var a = 0; a < rowPart.length; a++) {
  566 + if (ctx.measureText(test).width < 100) {
  567 + test += rowPart[a];
  568 + }
  569 + else {
  570 + break;
  571 + }
  572 + }
  573 + empty.push(test);
  574 + var group = empty[0] + "...";//这里只显示一行,超出的用...表示
  575 + rowCut.splice(0, 1, group);
  576 + row = rowCut;
  577 + }
  578 + for (var b = 0; b < row.length; b++) {
  579 + ctx.fillText(row[b], 40, 325 + b * 16, 150);
  580 + }
  581 + ctx.restore();
  582 + //时间
  583 + ctx.setFontSize(9);
  584 + ctx.setFillStyle('#333333');
  585 + ctx.fillText('时间:', 16, 340);
  586 + ctx.fillText(self.data.end_time, 40, 340);
  587 + ctx.restore();
  588 + // ctx.drawImage("../../../../images/home-banner.png", 0, 0, 250, 150)
  589 + //成功执行,draw方法中进行回调
  590 + ctx.draw(true, function () {
  591 + // wx.hideLoading();
  592 + console.log("draw callback success");
  593 + self.setData({can_save: true,show_canvas: true});
  594 + // console.log(self.data.can_save);
  595 + })
  596 + },
  597 + //获取保存到相册的权限
  598 + getPower() {
  599 + const that = this;
  600 + //保存临时图片
  601 + wx.getSetting({
  602 + success(res) {
  603 + if (!res.authSetting['scope.writePhotosAlbum']) {
  604 + wx.authorize({
  605 + scope: 'scope.writePhotosAlbum',
  606 + success() { //这里是用户同意授权后的回调
  607 + that.savePic();
  608 + },
  609 + fail() { //这里是用户拒绝授权后的回调
  610 + wx.showModal({
  611 + title: '提示',
  612 + content: '若不打开授权,则无法将图片保存在相册中!',
  613 + showCancel: true,
  614 + cancelText: '暂不授权',
  615 + cancelColor: '#000000',
  616 + confirmText: '去授权',
  617 + confirmColor: '#3CC51F',
  618 + success: function (res) {
  619 + if (res.confirm) {
  620 + wx.openSetting({
  621 + //调起客户端小程序设置界面,返回用户设置的操作结果。
  622 + success: function (ret) {
  623 + if (ret.authSetting["scope.writePhotosAlbum"] == true) {
  624 + wx.showToast({
  625 + title: '授权成功',
  626 + icon: 'none',
  627 + duration: 1000
  628 + });
  629 + //再次授权,保存到相册
  630 + that.savePic();
  631 + } else {
  632 + wx.showToast({
  633 + title: '授权失败',
  634 + icon: 'none',
  635 + duration: 1000
  636 + })
  637 + }
  638 + }
  639 + })
  640 + } else {
  641 + wx.showToast({
  642 + title: '授权失败',
  643 + icon: 'none',
  644 + duration: 1000
  645 + })
  646 + // console.log('用户点击取消')
  647 + }
  648 + }
  649 + })
  650 + }
  651 + })
  652 + } else { //用户已经授权过了
  653 + console.log('用户已经授权过了')
  654 + that.savePic();
  655 + }
  656 + }
  657 + });
  658 +
  659 + },
  660 + savePic() {
  661 + // console.log('是否能保存',this.data.can_save);
  662 + if(this.data.can_save) {
  663 + wx.canvasToTempFilePath({
  664 + x: 0,
  665 + y: 0,
  666 + width: 280,
  667 + height: 400,
  668 + destWidth: 840,//是width的3倍
  669 + destHeight: 1280,//是高的3.2倍
  670 + canvasId: 'canvas',
  671 + fileType: 'jpg',
  672 + quality:1,
  673 + success: function (res) {
  674 + // console.log("get tempfilepath(success) is:", res.tempFilePath);
  675 + //将图片保存在系统相册中(应先获取权限,)
  676 + wx.saveImageToPhotosAlbum({
  677 + filePath: res.tempFilePath,
  678 + success(res) {
  679 + wx.showToast({title:'保存成功',icon:'none'});
  680 + console.log("save photo is success")
  681 + },
  682 + fail: function () {
  683 + wx.showToast({title:'保存失败',icon:'none'});
  684 + console.log("save photo is fail")
  685 + }
  686 + })
  687 + },
  688 + fail: function () {
  689 + console.log('get tempfilepath is fail')
  690 + }
  691 + })
  692 + }else {
  693 + wx.showLoading({title:'加载中',icon:'loading',duration:1000})
  694 + }
  695 +
  696 + },
  697 + /**
  698 + * 生命周期函数--监听页面加载
  699 + */
  700 + onLoad: function (options) {
  701 + // console.log('详情options', options);
  702 + this.setData({detail_id: +options.id ? +options.id : ''});
  703 + },
  704 +
  705 + /**
  706 + * 生命周期函数--监听页面初次渲染完成
  707 + */
  708 + onReady: function () {
  709 +
  710 + },
  711 +
  712 + /**
  713 + * 生命周期函数--监听页面显示
  714 + */
  715 + onShow: function () {
  716 + this.getDetail();
  717 + },
  718 +
  719 + /**
  720 + * 生命周期函数--监听页面隐藏
  721 + */
  722 + onHide: function () {
  723 +
  724 + },
  725 +
  726 + /**
  727 + * 生命周期函数--监听页面卸载
  728 + */
  729 + onUnload: function () {
  730 + clearTimeout(t)
  731 + },
  732 +
  733 + /**
  734 + * 页面相关事件处理函数--监听用户下拉动作
  735 + */
  736 + onPullDownRefresh: function () {
  737 +
  738 + },
  739 +
  740 + /**
  741 + * 页面上拉触底事件的处理函数
  742 + */
  743 + onReachBottom: function () {
  744 +
  745 + },
  746 +
  747 + /**
  748 + * 用户点击右上角分享
  749 + */
  750 + onShareAppMessage: function (res) {
  751 + // console.log('转发res',res);
  752 + let self = this;
  753 + if(res.from === 'button') {
  754 + return {
  755 + title: self.data.detail.title, // 默认是小程序的名称(可以写slogan等)
  756 + path: '/pages/activity/detail/detail?id=' + self.data.detail_id, // 默认是当前页面,必须是以‘/’开头的完整路径
  757 + imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
  758 + success: function (res) {
  759 + if (res.errMsg == 'shareAppMessage:ok') {
  760 + console.log('转发成功之后');
  761 + }
  762 + },
  763 + fail: function () {
  764 + // 转发失败之后的回调
  765 + if (res.errMsg == 'shareAppMessage:fail cancel') {
  766 + // 用户取消转发
  767 + } else if (res.errMsg == 'shareAppMessage:fail') {
  768 + // 转发失败,其中 detail message 为详细失败信息
  769 + }
  770 + },
  771 + complete: function () {
  772 + // 转发结束之后的回调(转发成不成功都会执行)
  773 + console.log('转发结束之后');
  774 + }
  775 + }
  776 + }else {
  777 + return {
  778 + title: self.data.detail.title, // 默认是小程序的名称(可以写slogan等)
  779 + path: '/pages/activity/detail/detail?id=' + self.data.detail_id, // 默认是当前页面,必须是以‘/’开头的完整路径
  780 + imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
  781 + success: function (res) {
  782 + if (res.errMsg == 'shareAppMessage:ok') {
  783 + console.log('转发成功之后');
  784 + }
  785 + },
  786 + fail: function () {
  787 + // 转发失败之后的回调
  788 + if (res.errMsg == 'shareAppMessage:fail cancel') {
  789 + // 用户取消转发
  790 + } else if (res.errMsg == 'shareAppMessage:fail') {
  791 + // 转发失败,其中 detail message 为详细失败信息
  792 + }
  793 + },
  794 + complete: function () {
  795 + // 转发结束之后的回调(转发成不成功都会执行)
  796 + console.log('转发结束之后');
  797 + }
  798 + }
  799 + }
  800 + },
801 }) 801 })
1 -<!--pages/activity/detail/detail.wxml-->  
2 -<view class="content">  
3 - <!--swiper-->  
4 - <view class="head">  
5 - <view class="position {{hidden_top?'hidden-active':'visible-active'}}">  
6 - <view class="left">  
7 - <!--<image src="../../../images/avatar@2x.png" class="user-avatar"></image>-->  
8 - <image src="{{detail.userPic}}" class="user-avatar"></image>  
9 - <block wx:if="{{detail.userType ===1}}"><!--userType 1注册用户,2后台用户(金v)-->  
10 - <image src="{{detail.sex === 1?'../../../images/man.png':'../../../images/women.png'}}"  
11 - class="sex-icon"></image>  
12 - </block>  
13 - <block wx:if="{{detail.userType ===2}}">  
14 - <text class="iconfont icon-vip sex-icon"></text>  
15 - </block>  
16 - <text>{{detail.userName}}</text>  
17 - </view>  
18 - <view class="right">  
19 - <view class="collect" bindtap="collect">  
20 - <view class="iconfont icon-shoucang" wx:if="{{!is_collect}}"></view>  
21 - <view class="iconfont icon-shoucang2" wx:if="{{is_collect}}"></view>  
22 - <text>收藏</text>  
23 - </view>  
24 - <!--&lt;!&ndash;未收藏&ndash;&gt;-->  
25 - <!--<view class='collect_box' catchtap='sethits_yes' data-index='{{index}}' wx:if='{{items.is_hits==0}}'>-->  
26 - <!--<text class='iconfont icon-shoucang1 '></text>-->  
27 - <!--<text class="collect_word">收藏</text>-->  
28 - <!--</view>-->  
29 - <!--&lt;!&ndash;已收藏&ndash;&gt;-->  
30 - <!--<view class='collect_box active' catchtap='sethits_no' data-index='{{index}}' wx:else>-->  
31 - <!--<text class='iconfont icon-shoucang0 star2'></text>-->  
32 - <!--<text class="collect_word">收藏</text>-->  
33 - <!--</view>-->  
34 - <view class="share" bindtap="share">  
35 - <view class="iconfont icon-fenxiang2"></view>  
36 - <text>分享</text>  
37 - </view>  
38 - <!--<button class="share" open-type="share">-->  
39 - <!--<view class="iconfont icon-fenxiang2"></view>-->  
40 - <!--<text>分享</text>-->  
41 - <!--</button>-->  
42 - </view>  
43 - </view>  
44 - <view class='wrap_note canvas-mask' wx:if="{{show_canvas}}" bindtap='hideCanvasMask'>  
45 - <view class="shadow">  
46 - <canvas class='canvas-poster' canvas-id='canvas'></canvas>  
47 - <view class="button-box">  
48 - <text bindtap="saveToPhone" class="save-to-phone">保存图片</text>  
49 - <button class="share-btn" open-type="share">分享给好友</button>  
50 - </view>  
51 - </view>  
52 - <view class="close-btn" bindtap="closeCanvas"><text class="iconfont icon-guanbi"></text></view>  
53 - </view>  
54 - <swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange"  
55 - autoplay="{{true}}" interval="3000" duration="1000"  
56 - style="height:{{img_heights[current_swiper]}}rpx;">  
57 - <block wx:for="{{detail.banner}}" wx:key="index">  
58 - <navigator url="{{item}}" hover-class="navigator-hover">  
59 - <swiper-item>  
60 - <image src="{{item}}" data-id='{{index}}' class="slide-image" mode="widthFix"  
61 - bindload="imageLoad"/>  
62 - <!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>-->  
63 - </swiper-item>  
64 - </navigator>  
65 - </block>  
66 - </swiper>  
67 - <view class="dots">  
68 - <block wx:for="{{detail.banner}}" wx:key="index" wx:for-index="idx">  
69 - <view class="dot{{idx == current_swiper ? ' active' : ''}}"></view>  
70 - </block>  
71 - </view>  
72 - </view>  
73 -  
74 - <!--地点-->  
75 - <view class="area-box">  
76 - <view class="title-box">  
77 - <view class="title">{{detail.title}}</view>  
78 - <view class="over-time">  
79 - <text class='' wx:if="{{detail.time[0].day !== '00'}}">{{detail.time[0].day}}天{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>  
80 - <text class='' wx:else="">{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>  
81 - <text class="text">后结束</text>  
82 - </view>  
83 - <!--<view>-->  
84 - <!--<text class=''>{{detail.time[0].hou}}</text>-->  
85 - <!--<text>:</text>-->  
86 - <!--<text class=''>{{detail.time[0].min}}</text>-->  
87 - <!--<text>:</text>-->  
88 - <!--<text class=' '>{{detail.time[0].sec}}</text>-->  
89 - <!--</view>-->  
90 - </view>  
91 - <view class="area-content">  
92 - <text>{{detail.content}}</text>  
93 - </view>  
94 - </view>  
95 -  
96 - <!--详细时间-->  
97 - <view class="detail-box">  
98 - <text>类别:{{detail.selectName}}</text>  
99 - <text>时间:{{end_time}}</text>  
100 - <text>地点:{{detail.name}}</text>  
101 - <view class="position" bindtap="getNavigate">  
102 - <text class="address">地址:{{detail.address}}</text>  
103 - <text class="iconfont icon-location"></text>  
104 - </view>  
105 - </view>  
106 -  
107 - <!--已加入人员-->  
108 - <view class="join-num">已加入人员</view>  
109 - <view class="people-list" wx:if="{{join_people.length>0}}">  
110 - <view class="people" wx:for="{{join_people}}" wx:key="index">  
111 - <view class="bg">  
112 - <image src="{{item.pic}}" class="people-img"></image>  
113 - <block wx:if="{{item.userType ===1}}"><!--userType 1注册用户,2后台用户(金v)-->  
114 - <image src="{{item.sex === 1?'../../../images/man.png':'../../../images/women.png'}}"  
115 - class="sex-icon"></image>  
116 - </block>  
117 - <block wx:if="{{item.userType ===2}}">  
118 - <text class="iconfont icon-vip sex-icon"></text>  
119 - </block>  
120 - </view>  
121 - <view class="people-num">  
122 - <view class="name">{{item.name}}</view>  
123 - <view class="num">{{item.number}}人</view>  
124 - </view>  
125 - </view>  
126 - </view>  
127 -  
128 - <!--留言板 问一问-->  
129 - <view class="comment-box">  
130 - <view class="title-box">  
131 - <text class="comment-num">留言板 ({{count}})</text>  
132 - <view class="ask-btn" bindtap="ask">  
133 - <text class="iconfont icon-bianji"></text>  
134 - <text>问一问</text>  
135 - </view>  
136 - </view>  
137 -  
138 - <!--评论框-->  
139 - <view wx:if="{{display}}" class="comment {{display?'t-active':''}}">  
140 - <form bindsubmit="clickComment" bindreset="formReset" report-submit="true">  
141 - <view class="common-box">  
142 - <input  
143 - auto-focus="{{display}}"  
144 - focus="{{display}}"  
145 - value="{{content}}"  
146 - cursor-spacing="50"  
147 - maxlength="300"  
148 - bindblur="blur"  
149 - bindinput="inputComment"  
150 - bindconfirm="confirm"  
151 - show-confirm-bar="{{false}}"  
152 - placeholder="{{placeholder}}"/>  
153 - <button class="send-box" form-type="submit">  
154 - <text class="send">发送</text>  
155 - </button>  
156 - </view>  
157 - </form>  
158 - </view>  
159 -  
160 - <!--评论-->  
161 - <view class="comment-list-box">  
162 - <view class="comment-item" wx:for="{{commentList}}" wx:key="index" wx:for-item="comment">  
163 - <view class="top-content">  
164 - <view class="top-left">  
165 - <!--<image src="../../../images/avatar@2x.png" class="release-img"></image>-->  
166 - <image src="{{comment.userPic}}" class="release-img"></image>  
167 - <block wx:if="{{comment.userType ===1}}"><!--userType 1注册用户,2后台用户(金v)-->  
168 - <image src="{{comment.sex === 1?'../../../images/man.png':'../../../images/women.png'}}"  
169 - class="sex-icon"></image>  
170 - </block>  
171 - <block wx:if="{{comment.userType ===2}}">  
172 - <text class="iconfont icon-vip sex-icon"></text>  
173 - </block>  
174 - <text>{{comment.userName}} {{comment.create_time}}</text>  
175 - </view>  
176 - <view class="top-right" bindtap="clickZan" data-id="{{comment.id}}" data-index="{{index}}">  
177 - <text>{{comment.prefect}}</text>  
178 - <text class="iconfont icon-zan" wx:if="{{!comment.is_prefect}}"></text>  
179 - <text class="iconfont icon-z-likeFill" wx:if="{{comment.is_prefect}}"></text>  
180 - </view>  
181 - </view>  
182 - <view class="comment-detail">  
183 - <view class="user-release">  
184 - <view class="release-comment">{{comment.content}}</view>  
185 - <text class="reply-btn" bindtap="reply" data-id="{{comment.id}}">回复</text>  
186 - </view>  
187 - <view class="user-reply" wx:if="{{comment.son.length>0}}">  
188 - <view class='triangle'></view>  
189 - <block wx:for="{{comment.son}}" wx:key="index">  
190 - <!--<view class="comment">-->  
191 - <!--<text class="reply-name">蚂蚁: </text>-->  
192 - <!--<text>{{item.content}}第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>-->  
193 - <!--</view>-->  
194 - <view class="reply">  
195 - <text class="reply-name">{{detail.userName}}</text>  
196 - <text>回复</text>  
197 - <text class="reply-name">{{comment.userName}}:</text>  
198 - <text>{{item.content}}</text>  
199 - </view>  
200 - </block>  
201 - </view>  
202 - </view>  
203 - </view>  
204 - </view>  
205 - </view>  
206 -  
207 - <!--底部btn-->  
208 - <view class="bottom-btn" wx:if="{{!display}}">  
209 - <view class="add-btn">  
210 - <view class="input_box">  
211 - <view class="iconfont icon-jian {{num==1?'disable':''}}" bindtap='minusCount'></view>  
212 - <view class='item_cart_num'>{{num}}</view>  
213 - <view class='iconfont icon-jia1' bindtap='addCount'></view>  
214 - </view>  
215 - </view>  
216 - <form bindsubmit="confirmJoin" bindreset="formReset" report-submit="true">  
217 - <!-- // (0全部,2待拼成,3人数不足未拼成,4已拼成,5已取消,6已完成,7已评价,8已拼成(活动未结束),9删除-->  
218 - <!--is_send = 1 不可参与-->  
219 - <button class="confirm-join-btn {{(is_send === 2 && detail.status === 8) || (is_send === 2 && detail.status === 2)?'black':''}}" form-type="submit">  
220 - <text wx:if="{{is_send === 1 && detail.status === 2}}">待拼成</text>  
221 - <text wx:if="{{is_send === 1 && detail.status === 8}}">待完成</text>  
222 - <text wx:if="{{is_send === 2 && detail.status === 8 }}">确认拼活动</text>  
223 - <text wx:if="{{is_send === 2 && detail.status === 2 }}">确认拼活动</text>  
224 - <text wx:if="{{detail.status === 3}}">未拼成</text>  
225 - <text wx:if="{{detail.status === 4}}">待完成</text>  
226 - <text wx:if="{{detail.status === 5}}">已取消</text>  
227 - <text wx:if="{{detail.status === 6 || detail.status === 7}}">已完成</text>  
228 - <!--<text wx:if="{{detail.status === 8}}">已拼成</text>-->  
229 - <text wx:if="{{detail.status === 9}}">已删除</text>  
230 - <text wx:if="{{detail.status === 11}}">已过期</text>  
231 - </button>  
232 - </form>  
233 - </view>  
234 -  
235 - <!--参与成功弹框-->  
236 - <view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll">  
237 - <image class="sorry-img" src="../../../images/success@2x.png"></image>  
238 - <view class="title">恭喜您拼活动成功</view>  
239 - <view class="view-btn" catchtap="goMyOrder">查看我的订单</view>  
240 - <view class="complete-btn" catchtap="goBack">再逛逛</view>  
241 - </view>  
242 - <view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground"  
243 - catchtouchmove="disableScroll"></view>  
244 -</view> 1 +<!--pages/activity/detail/detail.wxml-->
  2 +<view class="content">
  3 + <!--swiper-->
  4 + <view class="head">
  5 + <view class="position {{hidden_top?'hidden-active':'visible-active'}}">
  6 + <view class="left">
  7 + <!--<image src="../../../images/avatar@2x.png" class="user-avatar"></image>-->
  8 + <image src="{{detail.userPic}}" class="user-avatar"></image>
  9 + <block wx:if="{{detail.userType ===1}}"><!--userType 1注册用户,2后台用户(金v)-->
  10 + <image src="{{detail.sex === 1?'../../../images/man.png':'../../../images/women.png'}}"
  11 + class="sex-icon"></image>
  12 + </block>
  13 + <block wx:if="{{detail.userType ===2}}">
  14 + <text class="iconfont icon-vip sex-icon"></text>
  15 + </block>
  16 + <text>{{detail.userName}}</text>
  17 + </view>
  18 + <view class="right">
  19 + <view class="collect" bindtap="collect">
  20 + <view class="iconfont icon-shoucang" wx:if="{{!is_collect}}"></view>
  21 + <view class="iconfont icon-shoucang2" wx:if="{{is_collect}}"></view>
  22 + <text>收藏</text>
  23 + </view>
  24 + <!--&lt;!&ndash;未收藏&ndash;&gt;-->
  25 + <!--<view class='collect_box' catchtap='sethits_yes' data-index='{{index}}' wx:if='{{items.is_hits==0}}'>-->
  26 + <!--<text class='iconfont icon-shoucang1 '></text>-->
  27 + <!--<text class="collect_word">收藏</text>-->
  28 + <!--</view>-->
  29 + <!--&lt;!&ndash;已收藏&ndash;&gt;-->
  30 + <!--<view class='collect_box active' catchtap='sethits_no' data-index='{{index}}' wx:else>-->
  31 + <!--<text class='iconfont icon-shoucang0 star2'></text>-->
  32 + <!--<text class="collect_word">收藏</text>-->
  33 + <!--</view>-->
  34 + <view class="share" bindtap="share">
  35 + <view class="iconfont icon-fenxiang2"></view>
  36 + <text>分享</text>
  37 + </view>
  38 + <!--<button class="share" open-type="share">-->
  39 + <!--<view class="iconfont icon-fenxiang2"></view>-->
  40 + <!--<text>分享</text>-->
  41 + <!--</button>-->
  42 + </view>
  43 + </view>
  44 + <view class='wrap_note canvas-mask' wx:if="{{show_canvas}}" bindtap='hideCanvasMask'>
  45 + <view class="shadow">
  46 + <canvas class='canvas-poster' canvas-id='canvas'></canvas>
  47 + <view class="button-box">
  48 + <text bindtap="saveToPhone" class="save-to-phone">保存图片</text>
  49 + <button class="share-btn" open-type="share">分享给好友</button>
  50 + </view>
  51 + </view>
  52 + <view class="close-btn" bindtap="closeCanvas"><text class="iconfont icon-guanbi"></text></view>
  53 + </view>
  54 + <swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange"
  55 + autoplay="{{true}}" interval="3000" duration="1000"
  56 + style="height:{{img_heights[current_swiper]}}rpx;">
  57 + <block wx:for="{{detail.banner}}" wx:key="index">
  58 + <navigator url="{{item}}" hover-class="navigator-hover">
  59 + <swiper-item>
  60 + <image src="{{item}}" data-id='{{index}}' class="slide-image" mode="widthFix"
  61 + bindload="imageLoad"/>
  62 + <!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>-->
  63 + </swiper-item>
  64 + </navigator>
  65 + </block>
  66 + </swiper>
  67 + <view class="dots">
  68 + <block wx:for="{{detail.banner}}" wx:key="index" wx:for-index="idx">
  69 + <view class="dot{{idx == current_swiper ? ' active' : ''}}"></view>
  70 + </block>
  71 + </view>
  72 + </view>
  73 +
  74 + <!--地点-->
  75 + <view class="area-box">
  76 + <view class="title-box">
  77 + <view class="title">{{detail.title}}</view>
  78 + <view class="over-time">
  79 + <text class='' wx:if="{{detail.time[0].day !== '00'}}">{{detail.time[0].day}}天{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
  80 + <text class='' wx:else="">{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
  81 + <text class="text">后结束</text>
  82 + </view>
  83 + <!--<view>-->
  84 + <!--<text class=''>{{detail.time[0].hou}}</text>-->
  85 + <!--<text>:</text>-->
  86 + <!--<text class=''>{{detail.time[0].min}}</text>-->
  87 + <!--<text>:</text>-->
  88 + <!--<text class=' '>{{detail.time[0].sec}}</text>-->
  89 + <!--</view>-->
  90 + </view>
  91 + <view class="area-content">
  92 + <text>{{detail.content}}</text>
  93 + </view>
  94 + </view>
  95 +
  96 + <!--详细时间-->
  97 + <view class="detail-box">
  98 + <text>类别:{{detail.selectName}}</text>
  99 + <text>时间:{{end_time}}</text>
  100 + <text>地点:{{detail.name}}</text>
  101 + <view class="position" bindtap="getNavigate">
  102 + <text class="address">地址:{{detail.address}}</text>
  103 + <text class="iconfont icon-location"></text>
  104 + </view>
  105 + </view>
  106 +
  107 + <!--已加入人员-->
  108 + <view class="join-num">已加入人员</view>
  109 + <view class="people-list" wx:if="{{join_people.length>0}}">
  110 + <view class="people" wx:for="{{join_people}}" wx:key="index">
  111 + <view class="bg">
  112 + <image src="{{item.pic}}" class="people-img"></image>
  113 + <block wx:if="{{item.userType ===1}}"><!--userType 1注册用户,2后台用户(金v)-->
  114 + <image src="{{item.sex === 1?'../../../images/man.png':'../../../images/women.png'}}"
  115 + class="sex-icon"></image>
  116 + </block>
  117 + <block wx:if="{{item.userType ===2}}">
  118 + <text class="iconfont icon-vip sex-icon"></text>
  119 + </block>
  120 + </view>
  121 + <view class="people-num">
  122 + <view class="name">{{item.name}}</view>
  123 + <view class="num">{{item.number}}人</view>
  124 + </view>
  125 + </view>
  126 + </view>
  127 +
  128 + <!--留言板 问一问-->
  129 + <view class="comment-box">
  130 + <view class="title-box">
  131 + <text class="comment-num">留言板 ({{count}})</text>
  132 + <view class="ask-btn" bindtap="ask">
  133 + <text class="iconfont icon-bianji"></text>
  134 + <text>问一问</text>
  135 + </view>
  136 + </view>
  137 +
  138 + <!--评论框-->
  139 + <view wx:if="{{display}}" class="comment {{display?'t-active':''}}">
  140 + <form bindsubmit="clickComment" bindreset="formReset" report-submit="true">
  141 + <view class="common-box">
  142 + <input
  143 + auto-focus="{{display}}"
  144 + focus="{{display}}"
  145 + value="{{content}}"
  146 + cursor-spacing="50"
  147 + maxlength="300"
  148 + bindblur="blur"
  149 + bindinput="inputComment"
  150 + bindconfirm="confirm"
  151 + show-confirm-bar="{{false}}"
  152 + placeholder="{{placeholder}}"/>
  153 + <button class="send-box" form-type="submit">
  154 + <text class="send">发送</text>
  155 + </button>
  156 + </view>
  157 + </form>
  158 + </view>
  159 +
  160 + <!--评论-->
  161 + <view class="comment-list-box">
  162 + <view class="comment-item" wx:for="{{commentList}}" wx:key="index" wx:for-item="comment">
  163 + <view class="top-content">
  164 + <view class="top-left">
  165 + <!--<image src="../../../images/avatar@2x.png" class="release-img"></image>-->
  166 + <image src="{{comment.userPic}}" class="release-img"></image>
  167 + <block wx:if="{{comment.userType ===1}}"><!--userType 1注册用户,2后台用户(金v)-->
  168 + <image src="{{comment.sex === 1?'../../../images/man.png':'../../../images/women.png'}}"
  169 + class="sex-icon"></image>
  170 + </block>
  171 + <block wx:if="{{comment.userType ===2}}">
  172 + <text class="iconfont icon-vip sex-icon"></text>
  173 + </block>
  174 + <text>{{comment.userName}} {{comment.create_time}}</text>
  175 + </view>
  176 + <view class="top-right" bindtap="clickZan" data-id="{{comment.id}}" data-index="{{index}}">
  177 + <text>{{comment.prefect}}</text>
  178 + <text class="iconfont icon-zan" wx:if="{{!comment.is_prefect}}"></text>
  179 + <text class="iconfont icon-z-likeFill" wx:if="{{comment.is_prefect}}"></text>
  180 + </view>
  181 + </view>
  182 + <view class="comment-detail">
  183 + <view class="user-release">
  184 + <view class="release-comment">{{comment.content}}</view>
  185 + <text class="reply-btn" bindtap="reply" data-id="{{comment.id}}">回复</text>
  186 + </view>
  187 + <view class="user-reply" wx:if="{{comment.son.length>0}}">
  188 + <view class='triangle'></view>
  189 + <block wx:for="{{comment.son}}" wx:key="index">
  190 + <!--<view class="comment">-->
  191 + <!--<text class="reply-name">蚂蚁: </text>-->
  192 + <!--<text>{{item.content}}第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>-->
  193 + <!--</view>-->
  194 + <view class="reply">
  195 + <text class="reply-name">{{detail.userName}}</text>
  196 + <text>回复</text>
  197 + <text class="reply-name">{{comment.userName}}:</text>
  198 + <text>{{item.content}}</text>
  199 + </view>
  200 + </block>
  201 + </view>
  202 + </view>
  203 + </view>
  204 + </view>
  205 + </view>
  206 +
  207 + <!--底部btn-->
  208 + <view class="bottom-btn" wx:if="{{!display}}">
  209 + <view class="add-btn">
  210 + <view class="input_box">
  211 + <view class="iconfont icon-jian {{num==1?'disable':''}}" bindtap='minusCount'></view>
  212 + <view class='item_cart_num'>{{num}}</view>
  213 + <view class='iconfont icon-jia1' bindtap='addCount'></view>
  214 + </view>
  215 + </view>
  216 + <form bindsubmit="confirmJoin" bindreset="formReset" report-submit="true">
  217 + <!-- // (0全部,2待拼成,3人数不足未拼成,4已拼成,5已取消,6已完成,7已评价,8已拼成(活动未结束),9删除-->
  218 + <!--is_send = 1 不可参与-->
  219 + <button class="confirm-join-btn {{(is_send === 2 && detail.status === 8) || (is_send === 2 && detail.status === 2)?'black':''}}" form-type="submit">
  220 + <text wx:if="{{is_send === 1 && detail.status === 2}}">待拼成</text>
  221 + <text wx:if="{{is_send === 1 && detail.status === 8}}">待完成</text>
  222 + <text wx:if="{{is_send === 2 && detail.status === 8 }}">确认拼活动</text>
  223 + <text wx:if="{{is_send === 2 && detail.status === 2 }}">确认拼活动</text>
  224 + <text wx:if="{{detail.status === 3}}">未拼成</text>
  225 + <text wx:if="{{detail.status === 4}}">待完成</text>
  226 + <text wx:if="{{detail.status === 5}}">已取消</text>
  227 + <text wx:if="{{detail.status === 6 || detail.status === 7}}">已完成</text>
  228 + <!--<text wx:if="{{detail.status === 8}}">已拼成</text>-->
  229 + <text wx:if="{{detail.status === 9}}">已删除</text>
  230 + <text wx:if="{{detail.status === 11}}">已过期</text>
  231 + </button>
  232 + </form>
  233 + </view>
  234 +
  235 + <!--参与成功弹框-->
  236 + <view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll">
  237 + <image class="sorry-img" src="../../../images/success@2x.png"></image>
  238 + <view class="title">恭喜您拼活动成功</view>
  239 + <view class="view-btn" catchtap="goMyOrder">查看我的订单</view>
  240 + <view class="complete-btn" catchtap="goBack">再逛逛</view>
  241 + </view>
  242 + <view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground"
  243 + catchtouchmove="disableScroll"></view>
  244 +</view>
1 -/* pages/activity/detail/detail.wxss */  
2 -.head {  
3 - position: relative;  
4 -}  
5 -.head .position {  
6 - width: 100%;  
7 - display: flex;  
8 - align-items: center;  
9 - justify-content: space-between;  
10 - position: fixed;  
11 - top: 0;  
12 - left: 0;  
13 - z-index: 10;  
14 - padding: 20rpx;  
15 - -webkit-box-sizing: border-box;  
16 - -moz-box-sizing: border-box;  
17 - box-sizing: border-box;  
18 -}  
19 -.head .position .left {  
20 - display: flex;  
21 - align-items: center;  
22 - position: relative;  
23 -}  
24 -.head .position .left .user-avatar{  
25 - width: 50rpx;  
26 - height: 50rpx;  
27 - border-radius: 50%;  
28 - margin-right: 10rpx;  
29 -}  
30 -.head .position .left .sex-icon{  
31 - position: absolute;  
32 - top:-3rpx;  
33 - left:36rpx;  
34 - width: 20rpx;  
35 - height: 20rpx;  
36 -}  
37 -.head .position .left .icon-vip{  
38 - color:#E1C8AF;  
39 - font-size:21rpx;  
40 -}  
41 -.head .position .left text {  
42 - font-size: 24rpx;  
43 - color:#ffffff;  
44 -}  
45 -.head .position .left .icon-location {  
46 - font-size: 44rpx;  
47 - color: #ffffff;  
48 - margin-right: 14rpx;  
49 -}  
50 -.head .position .left .icon-arrow-down {  
51 - font-size: 36rpx;  
52 - color: #ffffff;  
53 - margin-left: 18rpx;  
54 -}  
55 -/* .position text {  
56 - color: #ffffff;  
57 - font-size: 28rpx;  
58 -} */  
59 -.head .position .right {  
60 - /*width: 478rpx;*/  
61 - height: 52rpx;  
62 - /*background-color: rgba(255,255,255,0.35);*/  
63 - display: flex;  
64 - align-items: center;  
65 - justify-content: space-between;  
66 - /*border-radius: 10rpx;*/  
67 - padding: 0 20rpx;  
68 - -webkit-box-sizing: border-box;  
69 - -moz-box-sizing: border-box;  
70 - box-sizing: border-box;  
71 -}  
72 -.head .position .right text {  
73 - font-size: 22rpx;  
74 - color:#ffffff;  
75 -}  
76 -.head .position .right .collect, .head .position .right .share {  
77 - display: flex;  
78 - flex-direction: column;  
79 - align-items: center;  
80 - justify-content: space-between;  
81 - line-height: 34rpx;  
82 - /*height: 34rpx;*/  
83 -}  
84 -.share {  
85 - border-radius: 0;  
86 - margin: 0;  
87 - padding: 0;  
88 - background: transparent;  
89 -}  
90 -.share::after {  
91 - border:0;  
92 -}  
93 -.head .position .right .collect {  
94 - margin-right: 42rpx;  
95 -}  
96 -.icon-shoucang {  
97 - font-size: 30rpx;  
98 - color: #ffffff;  
99 -}  
100 -.icon-shoucang2 {  
101 - color:#DA4F2A;  
102 - font-size: 30rpx;  
103 -}  
104 -.icon-z-likeFill {  
105 - color:#DC4E48;  
106 - /*font-size: ;*/  
107 -}  
108 -.icon-fenxiang2 {  
109 - font-size: 30rpx;  
110 - color: #ffffff;  
111 -}  
112 -  
113 -swiper {  
114 - width: 100%;  
115 - height: 376rpx;  
116 - /*margin-top: 20rpx;*/  
117 -}  
118 -.slide-image {  
119 - width: 100%;  
120 - height: 100%;  
121 -}  
122 -/*用来包裹所有的小圆点 */  
123 -  
124 -.dots {  
125 - /* width: 156rpx; */  
126 - height: 36rpx;  
127 - display: flex;  
128 - align-items: center;  
129 - position: absolute;  
130 - left: 50%;  
131 - bottom: 20rpx;  
132 - transform: translate(-50%);  
133 - z-index: 10;  
134 -}  
135 -  
136 -/*未选中时的小圆点样式 */  
137 -  
138 -.dot {  
139 - width: 10rpx;  
140 - height: 10rpx;  
141 - border-radius: 50%;  
142 - margin-right: 10rpx;  
143 - background-color: #ffffff;  
144 - opacity: 0.6;  
145 -}  
146 -  
147 -/*选中以后的小圆点样式 */  
148 -  
149 -.active {  
150 - opacity: 1;  
151 - background-color: #DB4E2A;  
152 -}  
153 -.area-box {  
154 - padding: 20rpx;  
155 - -webkit-box-sizing: border-box;  
156 - -moz-box-sizing: border-box;  
157 - box-sizing: border-box;  
158 - display: flex;  
159 - flex-direction: column;  
160 - border-bottom: 20rpx solid #f2f2f2;  
161 -}  
162 -.area-box .title-box {  
163 - display: flex;  
164 - align-items: center;  
165 - justify-content: space-between;  
166 - margin-bottom: 26rpx;  
167 -}  
168 -.area-box .title-box .title {  
169 - width:55%;  
170 - color: #333333;  
171 - font-size: 28rpx;  
172 -}  
173 -.area-box .title-box .over-time {  
174 - width: 40%;  
175 - text-align: right;  
176 - display: flex;  
177 - align-items: center;  
178 - justify-content: flex-end;  
179 -}  
180 -.area-box .title-box .over-time text {  
181 - text-align: right;  
182 - color:#DA4F2A;  
183 - font-size: 24rpx;  
184 - margin-right: 18rpx;  
185 -}  
186 -.area-box .title-box .over-time .text {  
187 - color: #999999;  
188 - font-size: 20rpx;  
189 -}  
190 -.area-content {  
191 - color: #666666;  
192 - font-size: 24rpx;  
193 -}  
194 -.detail-box {  
195 - padding: 20rpx;  
196 - -webkit-box-sizing: border-box;  
197 - -moz-box-sizing: border-box;  
198 - box-sizing: border-box;  
199 - display: flex;  
200 - flex-direction: column;  
201 - align-items: flex-start;  
202 - border-bottom: 20rpx solid #f2f2f2;  
203 - font-size: 24rpx;  
204 - color: #666666;  
205 -}  
206 -.detail-box text {  
207 - margin-bottom: 18rpx;  
208 -}  
209 -.detail-box .position {  
210 - display: flex;  
211 - align-items: center;  
212 -}  
213 -.detail-box .position .address {  
214 - margin-right: 12rpx;  
215 -}  
216 -.detail-box .position .icon-location {  
217 - font-size: 30rpx;  
218 - color: #666666;  
219 -}  
220 -.join-num {  
221 - font-size: 24rpx;  
222 - color: #333333;  
223 - font-weight: bold;  
224 - padding: 40rpx 20rpx 0 20rpx;  
225 -}  
226 -.people-list {  
227 - padding: 32rpx 50rpx;  
228 - -webkit-box-sizing: border-box;  
229 - -moz-box-sizing: border-box;  
230 - box-sizing: border-box;  
231 - display: flex;  
232 - align-items: center;  
233 - justify-content: flex-start;  
234 - overflow-x: scroll;  
235 - /* display: -webkit-box; */  
236 - -webkit-overflow-scrolling: touch;  
237 - border-bottom: 20rpx solid #f2f2f2;  
238 -}  
239 -.people {  
240 - display: flex;  
241 - flex-direction: column;  
242 - align-items: center;  
243 - justify-content: center;  
244 - margin-right: 30rpx;  
245 -}  
246 -.people:nth-last-child(1){  
247 - margin-right: 0;  
248 - /* padding-right: 36rpx; */  
249 -}  
250 -.people-img {  
251 - width: 40rpx;  
252 - height: 40rpx;  
253 - border-radius: 50%;  
254 -}  
255 -.bg {  
256 - width: 40rpx;  
257 - height: 40rpx;  
258 - border-radius: 50%;  
259 - background-color: #FD8779;  
260 - margin-bottom: 10rpx;  
261 - position: relative;  
262 -}  
263 -.bg .sex-icon {  
264 - position: absolute;  
265 - top:-6rpx;  
266 - left:28rpx;  
267 - width: 20rpx;  
268 - height: 20rpx;  
269 -}  
270 -.people-num {  
271 - display: flex;  
272 - align-items: center;  
273 -}  
274 -.people-num .name {  
275 - max-width:100rpx;  
276 - margin-right:10rpx;  
277 - text-align: center;  
278 - /* margin-right: 10rpx; */  
279 - color: #333333;  
280 - font-size: 22rpx;  
281 - /* display: flex; */  
282 - /* align-items: center; */  
283 - overflow : hidden;  
284 - display: -webkit-box;  
285 - -webkit-line-clamp: 1;  
286 - -webkit-box-orient: vertical;  
287 -}  
288 -.people-num .num {  
289 - /* width:40%; */  
290 - color: #333333;  
291 - font-size: 22rpx;  
292 -}  
293 -.comment-box {  
294 - padding: 20rpx;  
295 - -webkit-box-sizing: border-box;  
296 - -moz-box-sizing: border-box;  
297 - box-sizing: border-box;  
298 - padding-bottom: 100rpx;  
299 -}  
300 -.comment-box .title-box {  
301 - display: flex;  
302 - align-items: center;  
303 - justify-content: space-between;  
304 - font-size: 24rpx;  
305 - color: #333333;  
306 -}  
307 -.comment-num {  
308 - font-weight: bold;  
309 -}  
310 -.ask-btn {  
311 - display: flex;  
312 - align-items: center;  
313 - font-size: 22rpx;  
314 - color:#DC4E48;  
315 -}  
316 -.icon-bianji {  
317 - font-size: 30rpx;  
318 - color:#DC4E48;  
319 - margin-right: 10rpx;  
320 -}  
321 -.comment-list-box {  
322 - padding: 20rpx;  
323 - -webkit-box-sizing: border-box;  
324 - -moz-box-sizing: border-box;  
325 - box-sizing: border-box;  
326 -}  
327 -.comment-item {  
328 - display: flex;  
329 - flex-direction: column;  
330 -}  
331 -.top-content {  
332 - display: flex;  
333 - align-items: center;  
334 - justify-content: space-between;  
335 -  
336 -}  
337 -.top-left {  
338 - display: flex;  
339 - align-items: center;  
340 - position: relative;  
341 -}  
342 -.top-left .sex-icon {  
343 - position: absolute;  
344 - top:-6rpx;  
345 - left:28rpx;  
346 - width: 20rpx;  
347 - height: 20rpx;  
348 -}  
349 -.top-left .icon-vip, .bg .icon-vip{  
350 - color:#E1C8AF;  
351 - font-size:21rpx;  
352 -}  
353 -.top-left .release-img{  
354 - width: 40rpx;  
355 - height: 40rpx;  
356 - border-radius: 50%;  
357 - margin-right: 10rpx;  
358 -}  
359 -.top-left text {  
360 - color: #666666;  
361 - font-size: 22rpx;  
362 -}  
363 -.top-right {  
364 - color: #999999;  
365 - font-size: 22rpx;  
366 -}  
367 -.icon-zan {  
368 - color: #999999;  
369 -}  
370 -.comment-detail {  
371 - padding: 10rpx 0rpx 20rpx 50rpx;  
372 -}  
373 -.user-release {  
374 - display: flex;  
375 - align-items: center;  
376 - justify-content: space-between;  
377 -}  
378 -.release-comment {  
379 - color: #666666;  
380 - font-size: 24rpx;  
381 -}  
382 -.reply-btn {  
383 - font-size: 22rpx;  
384 - color: #333333;  
385 - width: 138rpx;  
386 - margin-left: 30rpx;  
387 - text-align: right;  
388 -}  
389 -.user-reply {  
390 - padding: 20rpx 14rpx;  
391 - background-color: #F4F4F4;  
392 - font-size: 24rpx;  
393 - color: #666666;  
394 - display: flex;  
395 - flex-direction: column;  
396 - margin-top: 40rpx;  
397 - position: relative;  
398 - border-radius:6rpx;  
399 -}  
400 -.user-reply .comment {  
401 - margin-bottom: 24rpx;  
402 -}  
403 -.reply-name {  
404 - font-size: 24rpx;  
405 - color: #333333;  
406 - font-weight: bold;  
407 -}  
408 -@keyframes hidden-active {  
409 - 0% { opacity: 1; }  
410 - 100% { opacity: 0; }  
411 -}  
412 -@keyframes visible-active {  
413 - 0% { opacity: 0; }  
414 - 100% { opacity: 1; }  
415 -}  
416 -.hidden-active {  
417 - animation: hidden-active 0.5s both;  
418 -}  
419 -.visible-active {  
420 - animation: visible-active 0.5s both;  
421 -}  
422 -.triangle {  
423 - width: 0;  
424 - height: 0;  
425 - border-bottom: 18rpx solid #F4F4F4;  
426 - border-left: 18rpx solid transparent;  
427 - border-right: 18rpx solid transparent;  
428 - position: absolute;  
429 - top: -14rpx;  
430 - left: 20rpx;  
431 -}  
432 -.bottom-btn {  
433 - display: flex;  
434 - align-items: center;  
435 - justify-content: space-between;  
436 - border-top: 1rpx solid #f2f2f2;  
437 - position: fixed;  
438 - bottom:0;  
439 - left:0;  
440 - background-color: #fff;  
441 - width: 100%;  
442 -}  
443 -.confirm-join-btn {  
444 - display: flex;  
445 - align-items: center;  
446 - justify-content: center;  
447 - width: 206rpx;  
448 - height: 98rpx;  
449 - background-color: #CCCCCC;  
450 - color: #ffffff;  
451 - font-size: 30rpx;  
452 - border-radius: 0;  
453 - margin: 0;  
454 - padding: 0;  
455 -}  
456 -.confirm-join-btn::after {  
457 - border:0;  
458 -}  
459 -.black {  
460 - color:#E1C8AF;  
461 - background-color: #323232;  
462 -}  
463 -.input_box {  
464 - display: flex;  
465 - align-items: center;  
466 - height: 50rpx;  
467 - font-size: 30rpx;  
468 - padding: 10rpx;  
469 - color: #3f4040;  
470 -}  
471 -  
472 -.input_box .iconfont {  
473 - font-size: 38rpx;  
474 - color: #999999;  
475 - padding:5rpx 10rpx;  
476 -}  
477 -  
478 -.input_box .disable{  
479 - color: #CCCCCC;  
480 -}  
481 -  
482 -.item_cart_num {  
483 - width: 40rpx;  
484 - height: 40rpx;  
485 - border-radius: 3rpx;  
486 - background-color: #F2F2F2;  
487 - text-align: center;  
488 - line-height: 40rpx;  
489 -}  
490 -  
491 -.comment {  
492 - position: fixed;  
493 - bottom:0;  
494 - left:0;  
495 - z-index:20;  
496 -}  
497 -.comment form {  
498 - width: 100%;  
499 -}  
500 -.comment .common-box {  
501 - width:100%;  
502 - display: flex;  
503 - align-items: center;  
504 - justify-content: space-between;  
505 -}  
506 -.comment input {  
507 - border-radius: 50rpx;  
508 - width: 83.5%;  
509 - height: 60rpx;  
510 - /*height: 400rpx;*/  
511 - display: flex;  
512 - align-items: center;  
513 - text-align: left;  
514 - background-color: #f2f2f2;  
515 - font-size: 26rpx;  
516 - padding-left: 32rpx;  
517 - color: #666;  
518 -}  
519 -.t-active {  
520 - border-radius: 4rpx;  
521 - width: 100%;  
522 - /*height: 300rpx;*/  
523 - /*background-color: #f2f2f2;*/  
524 - font-size: 26rpx;  
525 - padding: 20rpx 32rpx;  
526 - display: flex;  
527 - justify-content: right;  
528 - align-items: right;  
529 - -webkit-box-sizing: border-box;  
530 - -moz-box-sizing: border-box;  
531 - box-sizing: border-box;  
532 -}  
533 -  
534 -.send-box .send {  
535 - width: 100rpx;  
536 - height: 60rpx;  
537 - line-height: 60rpx;  
538 - color:#E1C8AF;  
539 - font-size: 30rpx;  
540 - background-color: #323232;  
541 - border-right: 4rpx;  
542 - border-radius: 8rpx;  
543 - text-align: center;  
544 -}  
545 -.send-box {  
546 - width: 100rpx;  
547 - height: 60rpx;  
548 - display: flex;  
549 - justify-content: flex-end;  
550 - margin-left: 10rpx;  
551 - margin-right:0;  
552 - padding: 0;  
553 -}  
554 -.send-box::after {  
555 - border:0;  
556 -}  
557 -.modal {  
558 - width: 73%;  
559 - /* height: 1100rpx; */  
560 - background: #ffffff;  
561 - display: flex;  
562 - align-items: center;  
563 - flex-direction: column;  
564 - z-index:999;  
565 - position: fixed;  
566 - top: 48%;  
567 - left: 50%;  
568 - transform: translate(-50%,-50%);  
569 - padding: 46rpx 0rpx;  
570 - -webkit-box-sizing: border-box;  
571 - -moz-box-sizing: border-box;  
572 - box-sizing: border-box;  
573 - border-radius: 40rpx;  
574 -}  
575 -.modal image {  
576 - width: 110rpx;  
577 - height: 110rpx;  
578 - border-radius: 50%;  
579 - margin-bottom: 34rpx;  
580 -}  
581 -.modal .title {  
582 - color: #333333;  
583 - font-size: 36rpx;  
584 - margin-bottom: 46rpx;  
585 -}  
586 -.modal .tips {  
587 - color: #333333;  
588 - font-size: 24rpx;  
589 - margin-bottom: 26rpx;  
590 -}  
591 -.modal .view-btn {  
592 - height: 66rpx;  
593 - width: 364rpx;  
594 - border:1rpx solid #323232;  
595 - border-radius: 6rpx;  
596 - color:#323232;  
597 - text-align: center;  
598 - line-height: 66rpx;  
599 - font-size: 30rpx;  
600 -}  
601 -.modal .complete-btn {  
602 - width: 364rpx;  
603 - height: 66rpx;  
604 - background-color: #323232;  
605 - border-radius: 6rpx;  
606 - color:#E2C8B1;  
607 - font-size: 30rpx;  
608 - text-align: center;  
609 - line-height: 66rpx;  
610 - margin-top: 26rpx;  
611 -}  
612 -/*弹框样式*/  
613 -.modal_box {  
614 - width: 100%;  
615 - height: 100%;  
616 - position: fixed;  
617 - top: 0;  
618 - left: 0;  
619 - z-index: 10;  
620 - background: rgba(0,0,0,0.3);  
621 -}  
622 -.wrap_note {  
623 - width: 100%;  
624 - height: 100%;  
625 - position: fixed;  
626 - z-index: 20;  
627 - background-color: rgba(0, 0, 0, 0.3);  
628 - display: -webkit-box;  
629 - display: -ms-flexbox;  
630 - display: flex;  
631 - -webkit-box-align: center;  
632 - -ms-flex-align: center;  
633 - align-items: center;  
634 - -webkit-box-pack: center;  
635 - -ms-flex-pack: center;  
636 - justify-content: center;  
637 - top: 0;  
638 -}  
639 -.canvas-mask {  
640 - display: flex;  
641 - flex-direction: column;  
642 -}  
643 -.shadow {  
644 - /* background:#fff; */  
645 - box-shadow: 1rpx 1rpx 40rpx rgba(101, 101, 101, 0.1);  
646 -}  
647 -.canvas-poster {  
648 - /* position: fixed; */  
649 - width: 260px;  
650 - height: 400px;  
651 - /* top: 100%; */  
652 - /* left: 100%; */  
653 - /* overflow: hidden; */  
654 -}  
655 -.button-box {  
656 - width: 100%;  
657 - display: flex;  
658 - align-items: center;  
659 - justify-content: space-between;  
660 - height: 76rpx;  
661 - /* border-top: 1rpx solid #E8E8E8; */  
662 -}  
663 -.save-to-phone, .share-btn{  
664 - width: 50%;  
665 - line-height: 76rpx;  
666 - color:#fff;  
667 - font-size: 24rpx;  
668 - text-align: center;  
669 - padding:0;  
670 - background:#323232;  
671 - border-radius: 0;  
672 -}  
673 -.share-btn::after {  
674 - border:0;  
675 -}  
676 -.save-to-phone {  
677 - border-right: 1rpx solid #E8E8E8;  
678 - border-bottom-left-radius: 20rpx;  
679 -}  
680 -.share-btn {  
681 - border-bottom-right-radius: 20rpx;  
682 -}  
683 -.close-btn {  
684 - color: #999999;  
685 - font-size: 60rpx;  
686 - border-radius: 50%;  
687 - /* background-color: #fff; */  
688 - margin-top: 34rpx;  
689 -}  
690 -.close-btn .icon-guanbi {  
691 - font-size: 50rpx;  
692 - color: #fff; 1 +/* pages/activity/detail/detail.wxss */
  2 +.head {
  3 + position: relative;
  4 +}
  5 +.head .position {
  6 + width: 100%;
  7 + display: flex;
  8 + align-items: center;
  9 + justify-content: space-between;
  10 + position: fixed;
  11 + top: 0;
  12 + left: 0;
  13 + z-index: 10;
  14 + padding: 20rpx;
  15 + -webkit-box-sizing: border-box;
  16 + -moz-box-sizing: border-box;
  17 + box-sizing: border-box;
  18 +}
  19 +.head .position .left {
  20 + display: flex;
  21 + align-items: center;
  22 + position: relative;
  23 +}
  24 +.head .position .left .user-avatar{
  25 + width: 50rpx;
  26 + height: 50rpx;
  27 + border-radius: 50%;
  28 + margin-right: 10rpx;
  29 +}
  30 +.head .position .left .sex-icon{
  31 + position: absolute;
  32 + top:-3rpx;
  33 + left:36rpx;
  34 + width: 20rpx;
  35 + height: 20rpx;
  36 +}
  37 +.head .position .left .icon-vip{
  38 + color:#E1C8AF;
  39 + font-size:21rpx;
  40 +}
  41 +.head .position .left text {
  42 + font-size: 24rpx;
  43 + color:#ffffff;
  44 +}
  45 +.head .position .left .icon-location {
  46 + font-size: 44rpx;
  47 + color: #ffffff;
  48 + margin-right: 14rpx;
  49 +}
  50 +.head .position .left .icon-arrow-down {
  51 + font-size: 36rpx;
  52 + color: #ffffff;
  53 + margin-left: 18rpx;
  54 +}
  55 +/* .position text {
  56 + color: #ffffff;
  57 + font-size: 28rpx;
  58 +} */
  59 +.head .position .right {
  60 + /*width: 478rpx;*/
  61 + height: 52rpx;
  62 + /*background-color: rgba(255,255,255,0.35);*/
  63 + display: flex;
  64 + align-items: center;
  65 + justify-content: space-between;
  66 + /*border-radius: 10rpx;*/
  67 + padding: 0 20rpx;
  68 + -webkit-box-sizing: border-box;
  69 + -moz-box-sizing: border-box;
  70 + box-sizing: border-box;
  71 +}
  72 +.head .position .right text {
  73 + font-size: 22rpx;
  74 + color:#ffffff;
  75 +}
  76 +.head .position .right .collect, .head .position .right .share {
  77 + display: flex;
  78 + flex-direction: column;
  79 + align-items: center;
  80 + justify-content: space-between;
  81 + line-height: 34rpx;
  82 + /*height: 34rpx;*/
  83 +}
  84 +.share {
  85 + border-radius: 0;
  86 + margin: 0;
  87 + padding: 0;
  88 + background: transparent;
  89 +}
  90 +.share::after {
  91 + border:0;
  92 +}
  93 +.head .position .right .collect {
  94 + margin-right: 42rpx;
  95 +}
  96 +.icon-shoucang {
  97 + font-size: 30rpx;
  98 + color: #ffffff;
  99 +}
  100 +.icon-shoucang2 {
  101 + color:#DA4F2A;
  102 + font-size: 30rpx;
  103 +}
  104 +.icon-z-likeFill {
  105 + color:#DC4E48;
  106 + /*font-size: ;*/
  107 +}
  108 +.icon-fenxiang2 {
  109 + font-size: 30rpx;
  110 + color: #ffffff;
  111 +}
  112 +
  113 +swiper {
  114 + width: 100%;
  115 + height: 376rpx;
  116 + /*margin-top: 20rpx;*/
  117 +}
  118 +.slide-image {
  119 + width: 100%;
  120 + height: 100%;
  121 +}
  122 +/*用来包裹所有的小圆点 */
  123 +
  124 +.dots {
  125 + /* width: 156rpx; */
  126 + height: 36rpx;
  127 + display: flex;
  128 + align-items: center;
  129 + position: absolute;
  130 + left: 50%;
  131 + bottom: 20rpx;
  132 + transform: translate(-50%);
  133 + z-index: 10;
  134 +}
  135 +
  136 +/*未选中时的小圆点样式 */
  137 +
  138 +.dot {
  139 + width: 10rpx;
  140 + height: 10rpx;
  141 + border-radius: 50%;
  142 + margin-right: 10rpx;
  143 + background-color: #ffffff;
  144 + opacity: 0.6;
  145 +}
  146 +
  147 +/*选中以后的小圆点样式 */
  148 +
  149 +.active {
  150 + opacity: 1;
  151 + background-color: #DB4E2A;
  152 +}
  153 +.area-box {
  154 + padding: 20rpx;
  155 + -webkit-box-sizing: border-box;
  156 + -moz-box-sizing: border-box;
  157 + box-sizing: border-box;
  158 + display: flex;
  159 + flex-direction: column;
  160 + border-bottom: 20rpx solid #f2f2f2;
  161 +}
  162 +.area-box .title-box {
  163 + display: flex;
  164 + align-items: center;
  165 + justify-content: space-between;
  166 + margin-bottom: 26rpx;
  167 +}
  168 +.area-box .title-box .title {
  169 + width:55%;
  170 + color: #333333;
  171 + font-size: 28rpx;
  172 +}
  173 +.area-box .title-box .over-time {
  174 + width: 40%;
  175 + text-align: right;
  176 + display: flex;
  177 + align-items: center;
  178 + justify-content: flex-end;
  179 +}
  180 +.area-box .title-box .over-time text {
  181 + text-align: right;
  182 + color:#DA4F2A;
  183 + font-size: 24rpx;
  184 + margin-right: 18rpx;
  185 +}
  186 +.area-box .title-box .over-time .text {
  187 + color: #999999;
  188 + font-size: 20rpx;
  189 +}
  190 +.area-content {
  191 + color: #666666;
  192 + font-size: 24rpx;
  193 +}
  194 +.detail-box {
  195 + padding: 20rpx;
  196 + -webkit-box-sizing: border-box;
  197 + -moz-box-sizing: border-box;
  198 + box-sizing: border-box;
  199 + display: flex;
  200 + flex-direction: column;
  201 + align-items: flex-start;
  202 + border-bottom: 20rpx solid #f2f2f2;
  203 + font-size: 24rpx;
  204 + color: #666666;
  205 +}
  206 +.detail-box text {
  207 + margin-bottom: 18rpx;
  208 +}
  209 +.detail-box .position {
  210 + display: flex;
  211 + align-items: center;
  212 +}
  213 +.detail-box .position .address {
  214 + margin-right: 12rpx;
  215 +}
  216 +.detail-box .position .icon-location {
  217 + font-size: 30rpx;
  218 + color: #666666;
  219 +}
  220 +.join-num {
  221 + font-size: 24rpx;
  222 + color: #333333;
  223 + font-weight: bold;
  224 + padding: 40rpx 20rpx 0 20rpx;
  225 +}
  226 +.people-list {
  227 + padding: 32rpx 50rpx;
  228 + -webkit-box-sizing: border-box;
  229 + -moz-box-sizing: border-box;
  230 + box-sizing: border-box;
  231 + display: flex;
  232 + align-items: center;
  233 + justify-content: flex-start;
  234 + overflow-x: scroll;
  235 + /* display: -webkit-box; */
  236 + -webkit-overflow-scrolling: touch;
  237 + border-bottom: 20rpx solid #f2f2f2;
  238 +}
  239 +.people {
  240 + display: flex;
  241 + flex-direction: column;
  242 + align-items: center;
  243 + justify-content: center;
  244 + margin-right: 30rpx;
  245 +}
  246 +.people:nth-last-child(1){
  247 + margin-right: 0;
  248 + /* padding-right: 36rpx; */
  249 +}
  250 +.people-img {
  251 + width: 40rpx;
  252 + height: 40rpx;
  253 + border-radius: 50%;
  254 +}
  255 +.bg {
  256 + width: 40rpx;
  257 + height: 40rpx;
  258 + border-radius: 50%;
  259 + background-color: #FD8779;
  260 + margin-bottom: 10rpx;
  261 + position: relative;
  262 +}
  263 +.bg .sex-icon {
  264 + position: absolute;
  265 + top:-6rpx;
  266 + left:28rpx;
  267 + width: 20rpx;
  268 + height: 20rpx;
  269 +}
  270 +.people-num {
  271 + display: flex;
  272 + align-items: center;
  273 +}
  274 +.people-num .name {
  275 + max-width:100rpx;
  276 + margin-right:10rpx;
  277 + text-align: center;
  278 + /* margin-right: 10rpx; */
  279 + color: #333333;
  280 + font-size: 22rpx;
  281 + /* display: flex; */
  282 + /* align-items: center; */
  283 + overflow : hidden;
  284 + display: -webkit-box;
  285 + -webkit-line-clamp: 1;
  286 + -webkit-box-orient: vertical;
  287 +}
  288 +.people-num .num {
  289 + /* width:40%; */
  290 + color: #333333;
  291 + font-size: 22rpx;
  292 +}
  293 +.comment-box {
  294 + padding: 20rpx;
  295 + -webkit-box-sizing: border-box;
  296 + -moz-box-sizing: border-box;
  297 + box-sizing: border-box;
  298 + padding-bottom: 100rpx;
  299 +}
  300 +.comment-box .title-box {
  301 + display: flex;
  302 + align-items: center;
  303 + justify-content: space-between;
  304 + font-size: 24rpx;
  305 + color: #333333;
  306 +}
  307 +.comment-num {
  308 + font-weight: bold;
  309 +}
  310 +.ask-btn {
  311 + display: flex;
  312 + align-items: center;
  313 + font-size: 22rpx;
  314 + color:#DC4E48;
  315 +}
  316 +.icon-bianji {
  317 + font-size: 30rpx;
  318 + color:#DC4E48;
  319 + margin-right: 10rpx;
  320 +}
  321 +.comment-list-box {
  322 + padding: 20rpx;
  323 + -webkit-box-sizing: border-box;
  324 + -moz-box-sizing: border-box;
  325 + box-sizing: border-box;
  326 +}
  327 +.comment-item {
  328 + display: flex;
  329 + flex-direction: column;
  330 +}
  331 +.top-content {
  332 + display: flex;
  333 + align-items: center;
  334 + justify-content: space-between;
  335 +
  336 +}
  337 +.top-left {
  338 + display: flex;
  339 + align-items: center;
  340 + position: relative;
  341 +}
  342 +.top-left .sex-icon {
  343 + position: absolute;
  344 + top:-6rpx;
  345 + left:28rpx;
  346 + width: 20rpx;
  347 + height: 20rpx;
  348 +}
  349 +.top-left .icon-vip, .bg .icon-vip{
  350 + color:#E1C8AF;
  351 + font-size:21rpx;
  352 +}
  353 +.top-left .release-img{
  354 + width: 40rpx;
  355 + height: 40rpx;
  356 + border-radius: 50%;
  357 + margin-right: 10rpx;
  358 +}
  359 +.top-left text {
  360 + color: #666666;
  361 + font-size: 22rpx;
  362 +}
  363 +.top-right {
  364 + color: #999999;
  365 + font-size: 22rpx;
  366 +}
  367 +.icon-zan {
  368 + color: #999999;
  369 +}
  370 +.comment-detail {
  371 + padding: 10rpx 0rpx 20rpx 50rpx;
  372 +}
  373 +.user-release {
  374 + display: flex;
  375 + align-items: center;
  376 + justify-content: space-between;
  377 +}
  378 +.release-comment {
  379 + color: #666666;
  380 + font-size: 24rpx;
  381 +}
  382 +.reply-btn {
  383 + font-size: 22rpx;
  384 + color: #333333;
  385 + width: 138rpx;
  386 + margin-left: 30rpx;
  387 + text-align: right;
  388 +}
  389 +.user-reply {
  390 + padding: 20rpx 14rpx;
  391 + background-color: #F4F4F4;
  392 + font-size: 24rpx;
  393 + color: #666666;
  394 + display: flex;
  395 + flex-direction: column;
  396 + margin-top: 40rpx;
  397 + position: relative;
  398 + border-radius:6rpx;
  399 +}
  400 +.user-reply .comment {
  401 + margin-bottom: 24rpx;
  402 +}
  403 +.reply-name {
  404 + font-size: 24rpx;
  405 + color: #333333;
  406 + font-weight: bold;
  407 +}
  408 +@keyframes hidden-active {
  409 + 0% { opacity: 1; }
  410 + 100% { opacity: 0; }
  411 +}
  412 +@keyframes visible-active {
  413 + 0% { opacity: 0; }
  414 + 100% { opacity: 1; }
  415 +}
  416 +.hidden-active {
  417 + animation: hidden-active 0.5s both;
  418 +}
  419 +.visible-active {
  420 + animation: visible-active 0.5s both;
  421 +}
  422 +.triangle {
  423 + width: 0;
  424 + height: 0;
  425 + border-bottom: 18rpx solid #F4F4F4;
  426 + border-left: 18rpx solid transparent;
  427 + border-right: 18rpx solid transparent;
  428 + position: absolute;
  429 + top: -14rpx;
  430 + left: 20rpx;
  431 +}
  432 +.bottom-btn {
  433 + display: flex;
  434 + align-items: center;
  435 + justify-content: space-between;
  436 + border-top: 1rpx solid #f2f2f2;
  437 + position: fixed;
  438 + bottom:0;
  439 + left:0;
  440 + background-color: #fff;
  441 + width: 100%;
  442 +}
  443 +.confirm-join-btn {
  444 + display: flex;
  445 + align-items: center;
  446 + justify-content: center;
  447 + width: 206rpx;
  448 + height: 98rpx;
  449 + background-color: #CCCCCC;
  450 + color: #ffffff;
  451 + font-size: 30rpx;
  452 + border-radius: 0;
  453 + margin: 0;
  454 + padding: 0;
  455 +}
  456 +.confirm-join-btn::after {
  457 + border:0;
  458 +}
  459 +.black {
  460 + color:#E1C8AF;
  461 + background-color: #323232;
  462 +}
  463 +.input_box {
  464 + display: flex;
  465 + align-items: center;
  466 + height: 50rpx;
  467 + font-size: 30rpx;
  468 + padding: 10rpx;
  469 + color: #3f4040;
  470 +}
  471 +
  472 +.input_box .iconfont {
  473 + font-size: 38rpx;
  474 + color: #999999;
  475 + padding:5rpx 10rpx;
  476 +}
  477 +
  478 +.input_box .disable{
  479 + color: #CCCCCC;
  480 +}
  481 +
  482 +.item_cart_num {
  483 + width: 40rpx;
  484 + height: 40rpx;
  485 + border-radius: 3rpx;
  486 + background-color: #F2F2F2;
  487 + text-align: center;
  488 + line-height: 40rpx;
  489 +}
  490 +
  491 +.comment {
  492 + position: fixed;
  493 + bottom:0;
  494 + left:0;
  495 + z-index:20;
  496 +}
  497 +.comment form {
  498 + width: 100%;
  499 +}
  500 +.comment .common-box {
  501 + width:100%;
  502 + display: flex;
  503 + align-items: center;
  504 + justify-content: space-between;
  505 +}
  506 +.comment input {
  507 + border-radius: 50rpx;
  508 + width: 83.5%;
  509 + height: 60rpx;
  510 + /*height: 400rpx;*/
  511 + display: flex;
  512 + align-items: center;
  513 + text-align: left;
  514 + background-color: #f2f2f2;
  515 + font-size: 26rpx;
  516 + padding-left: 32rpx;
  517 + color: #666;
  518 +}
  519 +.t-active {
  520 + border-radius: 4rpx;
  521 + width: 100%;
  522 + /*height: 300rpx;*/
  523 + /*background-color: #f2f2f2;*/
  524 + font-size: 26rpx;
  525 + padding: 20rpx 32rpx;
  526 + display: flex;
  527 + justify-content: right;
  528 + align-items: right;
  529 + -webkit-box-sizing: border-box;
  530 + -moz-box-sizing: border-box;
  531 + box-sizing: border-box;
  532 +}
  533 +
  534 +.send-box .send {
  535 + width: 100rpx;
  536 + height: 60rpx;
  537 + line-height: 60rpx;
  538 + color:#E1C8AF;
  539 + font-size: 30rpx;
  540 + background-color: #323232;
  541 + border-right: 4rpx;
  542 + border-radius: 8rpx;
  543 + text-align: center;
  544 +}
  545 +.send-box {
  546 + width: 100rpx;
  547 + height: 60rpx;
  548 + display: flex;
  549 + justify-content: flex-end;
  550 + margin-left: 10rpx;
  551 + margin-right:0;
  552 + padding: 0;
  553 +}
  554 +.send-box::after {
  555 + border:0;
  556 +}
  557 +.modal {
  558 + width: 73%;
  559 + /* height: 1100rpx; */
  560 + background: #ffffff;
  561 + display: flex;
  562 + align-items: center;
  563 + flex-direction: column;
  564 + z-index:999;
  565 + position: fixed;
  566 + top: 48%;
  567 + left: 50%;
  568 + transform: translate(-50%,-50%);
  569 + padding: 46rpx 0rpx;
  570 + -webkit-box-sizing: border-box;
  571 + -moz-box-sizing: border-box;
  572 + box-sizing: border-box;
  573 + border-radius: 40rpx;
  574 +}
  575 +.modal image {
  576 + width: 110rpx;
  577 + height: 110rpx;
  578 + border-radius: 50%;
  579 + margin-bottom: 34rpx;
  580 +}
  581 +.modal .title {
  582 + color: #333333;
  583 + font-size: 36rpx;
  584 + margin-bottom: 46rpx;
  585 +}
  586 +.modal .tips {
  587 + color: #333333;
  588 + font-size: 24rpx;
  589 + margin-bottom: 26rpx;
  590 +}
  591 +.modal .view-btn {
  592 + height: 66rpx;
  593 + width: 364rpx;
  594 + border:1rpx solid #323232;
  595 + border-radius: 6rpx;
  596 + color:#323232;
  597 + text-align: center;
  598 + line-height: 66rpx;
  599 + font-size: 30rpx;
  600 +}
  601 +.modal .complete-btn {
  602 + width: 364rpx;
  603 + height: 66rpx;
  604 + background-color: #323232;
  605 + border-radius: 6rpx;
  606 + color:#E2C8B1;
  607 + font-size: 30rpx;
  608 + text-align: center;
  609 + line-height: 66rpx;
  610 + margin-top: 26rpx;
  611 +}
  612 +/*弹框样式*/
  613 +.modal_box {
  614 + width: 100%;
  615 + height: 100%;
  616 + position: fixed;
  617 + top: 0;
  618 + left: 0;
  619 + z-index: 10;
  620 + background: rgba(0,0,0,0.3);
  621 +}
  622 +.wrap_note {
  623 + width: 100%;
  624 + height: 100%;
  625 + position: fixed;
  626 + z-index: 20;
  627 + background-color: rgba(0, 0, 0, 0.3);
  628 + display: -webkit-box;
  629 + display: -ms-flexbox;
  630 + display: flex;
  631 + -webkit-box-align: center;
  632 + -ms-flex-align: center;
  633 + align-items: center;
  634 + -webkit-box-pack: center;
  635 + -ms-flex-pack: center;
  636 + justify-content: center;
  637 + top: 0;
  638 +}
  639 +.canvas-mask {
  640 + display: flex;
  641 + flex-direction: column;
  642 +}
  643 +.shadow {
  644 + /* background:#fff; */
  645 + box-shadow: 1rpx 1rpx 40rpx rgba(101, 101, 101, 0.1);
  646 +}
  647 +.canvas-poster {
  648 + /* position: fixed; */
  649 + width: 260px;
  650 + height: 400px;
  651 + /* top: 100%; */
  652 + /* left: 100%; */
  653 + /* overflow: hidden; */
  654 +}
  655 +.button-box {
  656 + width: 100%;
  657 + display: flex;
  658 + align-items: center;
  659 + justify-content: space-between;
  660 + height: 76rpx;
  661 + /* border-top: 1rpx solid #E8E8E8; */
  662 +}
  663 +.save-to-phone, .share-btn{
  664 + width: 50%;
  665 + line-height: 76rpx;
  666 + color:#fff;
  667 + font-size: 24rpx;
  668 + text-align: center;
  669 + padding:0;
  670 + background:#323232;
  671 + border-radius: 0;
  672 +}
  673 +.share-btn::after {
  674 + border:0;
  675 +}
  676 +.save-to-phone {
  677 + border-right: 1rpx solid #E8E8E8;
  678 + border-bottom-left-radius: 20rpx;
  679 +}
  680 +.share-btn {
  681 + border-bottom-right-radius: 20rpx;
  682 +}
  683 +.close-btn {
  684 + color: #999999;
  685 + font-size: 60rpx;
  686 + border-radius: 50%;
  687 + /* background-color: #fff; */
  688 + margin-top: 34rpx;
  689 +}
  690 +.close-btn .icon-guanbi {
  691 + font-size: 50rpx;
  692 + color: #fff;
693 } 693 }
1 -{  
2 - "navigationBarTitleText": "评论" 1 +{
  2 + "navigationBarTitleText": "评论"
3 } 3 }