├── .gitignore
├── LICENSE
├── README.md
├── cloudfunctions
├── img
│ ├── index.js
│ └── package.json
├── login
│ ├── config.json
│ ├── index.js
│ └── package.json
├── love
│ ├── index.js
│ └── package.json
└── send
│ ├── index.js
│ └── package.json
├── miniprogram
├── app.js
├── app.json
├── app.wxss
├── images
│ ├── about.png
│ ├── add_images.png
│ ├── biaobai.png
│ ├── biaobai
│ │ ├── bg.png
│ │ └── send.png
│ ├── call.png
│ ├── delete.png
│ ├── down.png
│ ├── home.png
│ ├── home1.png
│ ├── logo.jpg
│ ├── lost.png
│ ├── mine.png
│ ├── mine1.png
│ ├── right.png
│ ├── send.png
│ ├── unlogin.png
│ ├── wechat.png
│ ├── work.png
│ ├── xianzhi.png
│ └── yijian.png
├── pages
│ ├── biaobai
│ │ ├── biaobai.js
│ │ ├── biaobai.json
│ │ ├── biaobai.wxml
│ │ └── biaobai.wxss
│ ├── index
│ │ ├── index.js
│ │ ├── index.json
│ │ ├── index.wxml
│ │ └── index.wxss
│ ├── lost
│ │ ├── lost.js
│ │ ├── lost.json
│ │ ├── lost.wxml
│ │ └── lost.wxss
│ ├── mine
│ │ ├── about
│ │ │ ├── about.js
│ │ │ ├── about.json
│ │ │ ├── about.wxml
│ │ │ └── about.wxss
│ │ ├── mine.js
│ │ ├── mine.json
│ │ ├── mine.wxml
│ │ └── mine.wxss
│ ├── send
│ │ ├── send.js
│ │ ├── send.json
│ │ ├── send.wxml
│ │ └── send.wxss
│ ├── temp
│ │ ├── temp.js
│ │ ├── temp.json
│ │ ├── temp.wxml
│ │ └── temp.wxss
│ ├── util
│ │ └── util.js
│ ├── work
│ │ ├── work.js
│ │ ├── work.json
│ │ ├── work.wxml
│ │ └── work.wxss
│ └── xianzhi
│ │ ├── xianzhi.js
│ │ ├── xianzhi.json
│ │ ├── xianzhi.wxml
│ │ └── xianzhi.wxss
└── sitemap.json
└── project.config.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # CakePHP 3
2 |
3 | /vendor/*
4 | /config/app.php
5 |
6 | /tmp/cache/models/*
7 | !/tmp/cache/models/empty
8 | /tmp/cache/persistent/*
9 | !/tmp/cache/persistent/empty
10 | /tmp/cache/views/*
11 | !/tmp/cache/views/empty
12 | /tmp/sessions/*
13 | !/tmp/sessions/empty
14 | /tmp/tests/*
15 | !/tmp/tests/empty
16 |
17 | /logs/*
18 | !/logs/empty
19 |
20 | # CakePHP 2
21 |
22 | /app/tmp/*
23 | /app/Config/core.php
24 | /app/Config/database.php
25 | /vendors/*
26 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Mozilla Public License Version 2.0
2 | ==================================
3 |
4 | 1. Definitions
5 | --------------
6 |
7 | 1.1. "Contributor"
8 | means each individual or legal entity that creates, contributes to
9 | the creation of, or owns Covered Software.
10 |
11 | 1.2. "Contributor Version"
12 | means the combination of the Contributions of others (if any) used
13 | by a Contributor and that particular Contributor's Contribution.
14 |
15 | 1.3. "Contribution"
16 | means Covered Software of a particular Contributor.
17 |
18 | 1.4. "Covered Software"
19 | means Source Code Form to which the initial Contributor has attached
20 | the notice in Exhibit A, the Executable Form of such Source Code
21 | Form, and Modifications of such Source Code Form, in each case
22 | including portions thereof.
23 |
24 | 1.5. "Incompatible With Secondary Licenses"
25 | means
26 |
27 | (a) that the initial Contributor has attached the notice described
28 | in Exhibit B to the Covered Software; or
29 |
30 | (b) that the Covered Software was made available under the terms of
31 | version 1.1 or earlier of the License, but not also under the
32 | terms of a Secondary License.
33 |
34 | 1.6. "Executable Form"
35 | means any form of the work other than Source Code Form.
36 |
37 | 1.7. "Larger Work"
38 | means a work that combines Covered Software with other material, in
39 | a separate file or files, that is not Covered Software.
40 |
41 | 1.8. "License"
42 | means this document.
43 |
44 | 1.9. "Licensable"
45 | means having the right to grant, to the maximum extent possible,
46 | whether at the time of the initial grant or subsequently, any and
47 | all of the rights conveyed by this License.
48 |
49 | 1.10. "Modifications"
50 | means any of the following:
51 |
52 | (a) any file in Source Code Form that results from an addition to,
53 | deletion from, or modification of the contents of Covered
54 | Software; or
55 |
56 | (b) any new file in Source Code Form that contains any Covered
57 | Software.
58 |
59 | 1.11. "Patent Claims" of a Contributor
60 | means any patent claim(s), including without limitation, method,
61 | process, and apparatus claims, in any patent Licensable by such
62 | Contributor that would be infringed, but for the grant of the
63 | License, by the making, using, selling, offering for sale, having
64 | made, import, or transfer of either its Contributions or its
65 | Contributor Version.
66 |
67 | 1.12. "Secondary License"
68 | means either the GNU General Public License, Version 2.0, the GNU
69 | Lesser General Public License, Version 2.1, the GNU Affero General
70 | Public License, Version 3.0, or any later versions of those
71 | licenses.
72 |
73 | 1.13. "Source Code Form"
74 | means the form of the work preferred for making modifications.
75 |
76 | 1.14. "You" (or "Your")
77 | means an individual or a legal entity exercising rights under this
78 | License. For legal entities, "You" includes any entity that
79 | controls, is controlled by, or is under common control with You. For
80 | purposes of this definition, "control" means (a) the power, direct
81 | or indirect, to cause the direction or management of such entity,
82 | whether by contract or otherwise, or (b) ownership of more than
83 | fifty percent (50%) of the outstanding shares or beneficial
84 | ownership of such entity.
85 |
86 | 2. License Grants and Conditions
87 | --------------------------------
88 |
89 | 2.1. Grants
90 |
91 | Each Contributor hereby grants You a world-wide, royalty-free,
92 | non-exclusive license:
93 |
94 | (a) under intellectual property rights (other than patent or trademark)
95 | Licensable by such Contributor to use, reproduce, make available,
96 | modify, display, perform, distribute, and otherwise exploit its
97 | Contributions, either on an unmodified basis, with Modifications, or
98 | as part of a Larger Work; and
99 |
100 | (b) under Patent Claims of such Contributor to make, use, sell, offer
101 | for sale, have made, import, and otherwise transfer either its
102 | Contributions or its Contributor Version.
103 |
104 | 2.2. Effective Date
105 |
106 | The licenses granted in Section 2.1 with respect to any Contribution
107 | become effective for each Contribution on the date the Contributor first
108 | distributes such Contribution.
109 |
110 | 2.3. Limitations on Grant Scope
111 |
112 | The licenses granted in this Section 2 are the only rights granted under
113 | this License. No additional rights or licenses will be implied from the
114 | distribution or licensing of Covered Software under this License.
115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a
116 | Contributor:
117 |
118 | (a) for any code that a Contributor has removed from Covered Software;
119 | or
120 |
121 | (b) for infringements caused by: (i) Your and any other third party's
122 | modifications of Covered Software, or (ii) the combination of its
123 | Contributions with other software (except as part of its Contributor
124 | Version); or
125 |
126 | (c) under Patent Claims infringed by Covered Software in the absence of
127 | its Contributions.
128 |
129 | This License does not grant any rights in the trademarks, service marks,
130 | or logos of any Contributor (except as may be necessary to comply with
131 | the notice requirements in Section 3.4).
132 |
133 | 2.4. Subsequent Licenses
134 |
135 | No Contributor makes additional grants as a result of Your choice to
136 | distribute the Covered Software under a subsequent version of this
137 | License (see Section 10.2) or under the terms of a Secondary License (if
138 | permitted under the terms of Section 3.3).
139 |
140 | 2.5. Representation
141 |
142 | Each Contributor represents that the Contributor believes its
143 | Contributions are its original creation(s) or it has sufficient rights
144 | to grant the rights to its Contributions conveyed by this License.
145 |
146 | 2.6. Fair Use
147 |
148 | This License is not intended to limit any rights You have under
149 | applicable copyright doctrines of fair use, fair dealing, or other
150 | equivalents.
151 |
152 | 2.7. Conditions
153 |
154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155 | in Section 2.1.
156 |
157 | 3. Responsibilities
158 | -------------------
159 |
160 | 3.1. Distribution of Source Form
161 |
162 | All distribution of Covered Software in Source Code Form, including any
163 | Modifications that You create or to which You contribute, must be under
164 | the terms of this License. You must inform recipients that the Source
165 | Code Form of the Covered Software is governed by the terms of this
166 | License, and how they can obtain a copy of this License. You may not
167 | attempt to alter or restrict the recipients' rights in the Source Code
168 | Form.
169 |
170 | 3.2. Distribution of Executable Form
171 |
172 | If You distribute Covered Software in Executable Form then:
173 |
174 | (a) such Covered Software must also be made available in Source Code
175 | Form, as described in Section 3.1, and You must inform recipients of
176 | the Executable Form how they can obtain a copy of such Source Code
177 | Form by reasonable means in a timely manner, at a charge no more
178 | than the cost of distribution to the recipient; and
179 |
180 | (b) You may distribute such Executable Form under the terms of this
181 | License, or sublicense it under different terms, provided that the
182 | license for the Executable Form does not attempt to limit or alter
183 | the recipients' rights in the Source Code Form under this License.
184 |
185 | 3.3. Distribution of a Larger Work
186 |
187 | You may create and distribute a Larger Work under terms of Your choice,
188 | provided that You also comply with the requirements of this License for
189 | the Covered Software. If the Larger Work is a combination of Covered
190 | Software with a work governed by one or more Secondary Licenses, and the
191 | Covered Software is not Incompatible With Secondary Licenses, this
192 | License permits You to additionally distribute such Covered Software
193 | under the terms of such Secondary License(s), so that the recipient of
194 | the Larger Work may, at their option, further distribute the Covered
195 | Software under the terms of either this License or such Secondary
196 | License(s).
197 |
198 | 3.4. Notices
199 |
200 | You may not remove or alter the substance of any license notices
201 | (including copyright notices, patent notices, disclaimers of warranty,
202 | or limitations of liability) contained within the Source Code Form of
203 | the Covered Software, except that You may alter any license notices to
204 | the extent required to remedy known factual inaccuracies.
205 |
206 | 3.5. Application of Additional Terms
207 |
208 | You may choose to offer, and to charge a fee for, warranty, support,
209 | indemnity or liability obligations to one or more recipients of Covered
210 | Software. However, You may do so only on Your own behalf, and not on
211 | behalf of any Contributor. You must make it absolutely clear that any
212 | such warranty, support, indemnity, or liability obligation is offered by
213 | You alone, and You hereby agree to indemnify every Contributor for any
214 | liability incurred by such Contributor as a result of warranty, support,
215 | indemnity or liability terms You offer. You may include additional
216 | disclaimers of warranty and limitations of liability specific to any
217 | jurisdiction.
218 |
219 | 4. Inability to Comply Due to Statute or Regulation
220 | ---------------------------------------------------
221 |
222 | If it is impossible for You to comply with any of the terms of this
223 | License with respect to some or all of the Covered Software due to
224 | statute, judicial order, or regulation then You must: (a) comply with
225 | the terms of this License to the maximum extent possible; and (b)
226 | describe the limitations and the code they affect. Such description must
227 | be placed in a text file included with all distributions of the Covered
228 | Software under this License. Except to the extent prohibited by statute
229 | or regulation, such description must be sufficiently detailed for a
230 | recipient of ordinary skill to be able to understand it.
231 |
232 | 5. Termination
233 | --------------
234 |
235 | 5.1. The rights granted under this License will terminate automatically
236 | if You fail to comply with any of its terms. However, if You become
237 | compliant, then the rights granted under this License from a particular
238 | Contributor are reinstated (a) provisionally, unless and until such
239 | Contributor explicitly and finally terminates Your grants, and (b) on an
240 | ongoing basis, if such Contributor fails to notify You of the
241 | non-compliance by some reasonable means prior to 60 days after You have
242 | come back into compliance. Moreover, Your grants from a particular
243 | Contributor are reinstated on an ongoing basis if such Contributor
244 | notifies You of the non-compliance by some reasonable means, this is the
245 | first time You have received notice of non-compliance with this License
246 | from such Contributor, and You become compliant prior to 30 days after
247 | Your receipt of the notice.
248 |
249 | 5.2. If You initiate litigation against any entity by asserting a patent
250 | infringement claim (excluding declaratory judgment actions,
251 | counter-claims, and cross-claims) alleging that a Contributor Version
252 | directly or indirectly infringes any patent, then the rights granted to
253 | You by any and all Contributors for the Covered Software under Section
254 | 2.1 of this License shall terminate.
255 |
256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257 | end user license agreements (excluding distributors and resellers) which
258 | have been validly granted by You or Your distributors under this License
259 | prior to termination shall survive termination.
260 |
261 | ************************************************************************
262 | * *
263 | * 6. Disclaimer of Warranty *
264 | * ------------------------- *
265 | * *
266 | * Covered Software is provided under this License on an "as is" *
267 | * basis, without warranty of any kind, either expressed, implied, or *
268 | * statutory, including, without limitation, warranties that the *
269 | * Covered Software is free of defects, merchantable, fit for a *
270 | * particular purpose or non-infringing. The entire risk as to the *
271 | * quality and performance of the Covered Software is with You. *
272 | * Should any Covered Software prove defective in any respect, You *
273 | * (not any Contributor) assume the cost of any necessary servicing, *
274 | * repair, or correction. This disclaimer of warranty constitutes an *
275 | * essential part of this License. No use of any Covered Software is *
276 | * authorized under this License except under this disclaimer. *
277 | * *
278 | ************************************************************************
279 |
280 | ************************************************************************
281 | * *
282 | * 7. Limitation of Liability *
283 | * -------------------------- *
284 | * *
285 | * Under no circumstances and under no legal theory, whether tort *
286 | * (including negligence), contract, or otherwise, shall any *
287 | * Contributor, or anyone who distributes Covered Software as *
288 | * permitted above, be liable to You for any direct, indirect, *
289 | * special, incidental, or consequential damages of any character *
290 | * including, without limitation, damages for lost profits, loss of *
291 | * goodwill, work stoppage, computer failure or malfunction, or any *
292 | * and all other commercial damages or losses, even if such party *
293 | * shall have been informed of the possibility of such damages. This *
294 | * limitation of liability shall not apply to liability for death or *
295 | * personal injury resulting from such party's negligence to the *
296 | * extent applicable law prohibits such limitation. Some *
297 | * jurisdictions do not allow the exclusion or limitation of *
298 | * incidental or consequential damages, so this exclusion and *
299 | * limitation may not apply to You. *
300 | * *
301 | ************************************************************************
302 |
303 | 8. Litigation
304 | -------------
305 |
306 | Any litigation relating to this License may be brought only in the
307 | courts of a jurisdiction where the defendant maintains its principal
308 | place of business and such litigation shall be governed by laws of that
309 | jurisdiction, without reference to its conflict-of-law provisions.
310 | Nothing in this Section shall prevent a party's ability to bring
311 | cross-claims or counter-claims.
312 |
313 | 9. Miscellaneous
314 | ----------------
315 |
316 | This License represents the complete agreement concerning the subject
317 | matter hereof. If any provision of this License is held to be
318 | unenforceable, such provision shall be reformed only to the extent
319 | necessary to make it enforceable. Any law or regulation which provides
320 | that the language of a contract shall be construed against the drafter
321 | shall not be used to construe this License against a Contributor.
322 |
323 | 10. Versions of the License
324 | ---------------------------
325 |
326 | 10.1. New Versions
327 |
328 | Mozilla Foundation is the license steward. Except as provided in Section
329 | 10.3, no one other than the license steward has the right to modify or
330 | publish new versions of this License. Each version will be given a
331 | distinguishing version number.
332 |
333 | 10.2. Effect of New Versions
334 |
335 | You may distribute the Covered Software under the terms of the version
336 | of the License under which You originally received the Covered Software,
337 | or under the terms of any subsequent version published by the license
338 | steward.
339 |
340 | 10.3. Modified Versions
341 |
342 | If you create software not governed by this License, and you want to
343 | create a new license for such software, you may create and use a
344 | modified version of this License if you rename the license and remove
345 | any references to the name of the license steward (except to note that
346 | such modified license differs from this License).
347 |
348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary
349 | Licenses
350 |
351 | If You choose to distribute Source Code Form that is Incompatible With
352 | Secondary Licenses under the terms of this version of the License, the
353 | notice described in Exhibit B of this License must be attached.
354 |
355 | Exhibit A - Source Code Form License Notice
356 | -------------------------------------------
357 |
358 | This Source Code Form is subject to the terms of the Mozilla Public
359 | License, v. 2.0. If a copy of the MPL was not distributed with this
360 | file, You can obtain one at http://mozilla.org/MPL/2.0/.
361 |
362 | If it is not possible or desirable to put the notice in a particular
363 | file, then You may include the notice in a location (such as a LICENSE
364 | file in a relevant directory) where a recipient would be likely to look
365 | for such a notice.
366 |
367 | You may add additional accurate notices of copyright ownership.
368 |
369 | Exhibit B - "Incompatible With Secondary Licenses" Notice
370 | ---------------------------------------------------------
371 |
372 | This Source Code Form is "Incompatible With Secondary Licenses", as
373 | defined by the Mozilla Public License, v. 2.0.
374 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 前言
2 | 一个集合表白墙、失物招领、兼职和闲置二手买卖的云开发微信小程序
3 | # 校园服务小程序
4 | 拥有 表白墙、失物招领、兼职、闲置物品等功能,无后台,云开发,只需要搭建云数据库即可
5 |
6 | ## 开发初衷
7 | 开发本小程序的初衷是适应主小程序(校园骑士综合服务)
8 |
9 |
10 | ## 基于云开发(参考文档)
11 | - [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)
12 |
13 | ## 部署教程
14 | 1. 将该项目导入微信开发者工具
15 | 2. 更改 miniprogram/app.js 里面的云环境id
16 | ``` bash
17 | wx.cloud.init({
18 | env:'xxx', //xxx为你的云环境id
19 | traceUser: true
20 | })
21 | ```
22 | 3. 创建对应的五个数据库集合(biaobai、found、lost、xianzhi、jianzhi)
23 | 4. 将 cloudfunctions 文件下的四个文件上传云函数部署(右键点击,选择第三个选项“上传并部署:云端安装环境”)
24 | # 截图
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/cloudfunctions/img/index.js:
--------------------------------------------------------------------------------
1 | // 云函数入口文件
2 | const cloud = require('wx-server-sdk')
3 |
4 | cloud.init()
5 |
6 | // 云函数入口函数
7 | exports.main = async (event, context) => {
8 | try {
9 | return await cloud.uploadFile({
10 | fileContent: new Buffer(event.fileContent, 'base64'),
11 | cloudPath: event.cloudPath // 使用随机文件名
12 | })
13 | } catch (e) {
14 | return e
15 | }
16 | }
--------------------------------------------------------------------------------
/cloudfunctions/img/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "img",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
--------------------------------------------------------------------------------
/cloudfunctions/login/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "openapi": []
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/cloudfunctions/login/index.js:
--------------------------------------------------------------------------------
1 | // 云函数模板
2 | // 部署:在 cloud-functions/login 文件夹右击选择 “上传并部署”
3 |
4 | const cloud = require('wx-server-sdk')
5 |
6 | // 初始化 cloud
7 | cloud.init({
8 | // API 调用都保持和云函数当前所在环境一致
9 | env: cloud.DYNAMIC_CURRENT_ENV
10 | })
11 |
12 | /**
13 | * 这个示例将经自动鉴权过的小程序用户 openid 返回给小程序端
14 | *
15 | * event 参数包含小程序端调用传入的 data
16 | *
17 | */
18 | exports.main = async(event, context) => {
19 | console.log(event)
20 | console.log(context)
21 |
22 | // 可执行其他自定义逻辑
23 | // console.log 的内容可以在云开发云函数调用日志查看
24 |
25 | // 获取 WX Context (微信调用上下文),包括 OPENID、APPID、及 UNIONID(需满足 UNIONID 获取条件)等信息
26 | const wxContext = cloud.getWXContext()
27 |
28 | return await {
29 | event,
30 | openid: wxContext.OPENID,
31 | appid: wxContext.APPID,
32 | unionid: wxContext.UNIONID,
33 | env: wxContext.ENV,
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/cloudfunctions/login/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "login",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/cloudfunctions/love/index.js:
--------------------------------------------------------------------------------
1 | // 云函数入口文件
2 | const cloud = require('wx-server-sdk')
3 | cloud.init()
4 | const db = cloud.database()
5 |
6 |
7 | // 云函数入口函数
8 | exports.main = async (event, context) => {
9 | console.log(event)
10 | const wxContext = cloud.getWXContext()
11 | try {
12 | return await db.collection("biaobai").add({
13 | data: {
14 | _openid: wxContext.OPENID,
15 | createTime: db.serverDate(),
16 | info: event.info,
17 | to: event.to,
18 | writer: event.writer,
19 | sendTime: event.sendTime,
20 | like: 0
21 | }
22 | })
23 | } catch (e) {
24 | console.log(e)
25 | }
26 | }
--------------------------------------------------------------------------------
/cloudfunctions/love/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "love",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/cloudfunctions/send/index.js:
--------------------------------------------------------------------------------
1 | // 云函数入口文件
2 | const cloud = require('wx-server-sdk')
3 | cloud.init()
4 | const db = cloud.database()
5 |
6 |
7 | // 云函数入口函数
8 | exports.main = async(event, context) => {
9 | const wxContext = cloud.getWXContext()
10 | try {
11 | return await db.collection(event.room).add({
12 | data: {
13 | _openid: wxContext.OPENID,
14 | fileIDs: event.fileIDs,
15 | createTime: db.serverDate(),
16 | sendTime: event.sendTime,
17 | pName: event.pName,
18 | pCall: event.pCall,
19 | pWechat: event.pWechat,
20 | name: event.name,
21 | price: event.price,
22 | info: event.info,
23 | images: event.imgbox,
24 | touxiang: event.touxiang,
25 | userName: event.userName
26 | }
27 | })
28 | } catch (e) {
29 | console.log(e)
30 | }
31 |
32 | }
--------------------------------------------------------------------------------
/cloudfunctions/send/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "send",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
--------------------------------------------------------------------------------
/miniprogram/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 |
4 | /**
5 | * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次)
6 | */
7 | onLaunch: function () {
8 | wx.cloud.init({
9 | env:'cloud1-9g14q73o8203f7c4',
10 | traceUser: true
11 | })
12 | },
13 |
14 | /**
15 | * 当小程序启动,或从后台进入前台显示,会触发 onShow
16 | */
17 | onShow: function (options) {
18 |
19 | },
20 |
21 | /**
22 | * 当小程序从前台进入后台,会触发 onHide
23 | */
24 | onHide: function () {
25 |
26 | },
27 |
28 | /**
29 | * 当小程序发生脚本错误,或者 api 调用失败时,会触发 onError 并带上错误信息
30 | */
31 | onError: function (msg) {
32 |
33 | }
34 | })
35 |
36 |
--------------------------------------------------------------------------------
/miniprogram/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/work/work",
5 | "pages/temp/temp",
6 | "pages/biaobai/biaobai",
7 | "pages/mine/mine",
8 | "pages/mine/about/about",
9 | "pages/lost/lost",
10 | "pages/xianzhi/xianzhi",
11 | "pages/send/send"
12 | ],
13 | "tabBar": {
14 | "color": "#7f8389",
15 | "selectedColor": "#00a8f3",
16 | "borderStyle": "black",
17 | "backgroundColor": "#f7f7fa",
18 | "list": [
19 | {
20 | "pagePath": "pages/index/index",
21 | "text": "首页",
22 | "iconPath": "images/home.png",
23 | "selectedIconPath": "images/home1.png"
24 | },
25 | {
26 | "pagePath": "pages/mine/mine",
27 | "text": "我的",
28 | "iconPath": "images/mine.png",
29 | "selectedIconPath": "images/mine1.png"
30 | }
31 | ]
32 | },
33 | "window": {
34 | "navigationBarBackgroundColor": "#00a8f3",
35 | "navigationBarTextStyle": "black"
36 | },
37 | "sitemapLocation": "sitemap.json"
38 | }
--------------------------------------------------------------------------------
/miniprogram/app.wxss:
--------------------------------------------------------------------------------
1 | page {
2 | background-color: #f7f7f7;
3 | }
--------------------------------------------------------------------------------
/miniprogram/images/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/about.png
--------------------------------------------------------------------------------
/miniprogram/images/add_images.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/add_images.png
--------------------------------------------------------------------------------
/miniprogram/images/biaobai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/biaobai.png
--------------------------------------------------------------------------------
/miniprogram/images/biaobai/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/biaobai/bg.png
--------------------------------------------------------------------------------
/miniprogram/images/biaobai/send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/biaobai/send.png
--------------------------------------------------------------------------------
/miniprogram/images/call.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/call.png
--------------------------------------------------------------------------------
/miniprogram/images/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/delete.png
--------------------------------------------------------------------------------
/miniprogram/images/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/down.png
--------------------------------------------------------------------------------
/miniprogram/images/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/home.png
--------------------------------------------------------------------------------
/miniprogram/images/home1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/home1.png
--------------------------------------------------------------------------------
/miniprogram/images/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/logo.jpg
--------------------------------------------------------------------------------
/miniprogram/images/lost.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/lost.png
--------------------------------------------------------------------------------
/miniprogram/images/mine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/mine.png
--------------------------------------------------------------------------------
/miniprogram/images/mine1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/mine1.png
--------------------------------------------------------------------------------
/miniprogram/images/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/right.png
--------------------------------------------------------------------------------
/miniprogram/images/send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/send.png
--------------------------------------------------------------------------------
/miniprogram/images/unlogin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/unlogin.png
--------------------------------------------------------------------------------
/miniprogram/images/wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/wechat.png
--------------------------------------------------------------------------------
/miniprogram/images/work.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/work.png
--------------------------------------------------------------------------------
/miniprogram/images/xianzhi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/xianzhi.png
--------------------------------------------------------------------------------
/miniprogram/images/yijian.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cxyax/schoolhelp/9e759072a09b19ec7df43e7868c7a04dfe1f7f90/miniprogram/images/yijian.png
--------------------------------------------------------------------------------
/miniprogram/pages/biaobai/biaobai.js:
--------------------------------------------------------------------------------
1 | const db = wx.cloud.database()
2 | var util = require('../util/util.js');
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | isSend: false
10 | },
11 |
12 | /**
13 | * 生命周期函数--监听页面加载
14 | */
15 | onLoad: function (options) {
16 | var that = this
17 | wx.getStorage({
18 | key: 'openid',
19 | success: function (res) {
20 | that.setData({
21 | openid: res.data
22 | })
23 | },
24 | })
25 | db.collection('biaobai')
26 | .orderBy('createTime', 'desc') //按发布时间排序
27 | .get({
28 | success(res) {
29 | console.log("请求成功", res.data[0].info)
30 | that.setData({
31 | dataList: res.data
32 | })
33 | console.log(that.data.dataList[0])
34 | },
35 | fail(res) {
36 | console.log("请求失败", res)
37 | }
38 | })
39 | },
40 | //获取输入内容
41 | getInput1(event) {
42 | console.log("输入的对象", event.detail.value)
43 | this.setData({
44 | to: event.detail.value
45 | })
46 | },
47 | getInput2(event) {
48 | console.log("输入的称呼", event.detail.value)
49 | this.setData({
50 | writer: event.detail.value
51 | })
52 | },
53 | getInput3(event) {
54 | console.log("输入的内容", event.detail.value)
55 | this.setData({
56 | info: event.detail.value
57 | })
58 | },
59 | //打开弹窗
60 | send: function () {
61 | var that = this
62 | wx.getStorage({
63 | key: 'login',
64 | success: function (res) {
65 | if (res.data) {
66 | that.setData({
67 | isSend: true
68 | })
69 | } else {
70 | wx.showToast({
71 | icon: "none",
72 | title: '你还未登录'
73 | })
74 | }
75 | },
76 | fail: function (res) {
77 | wx.showToast({
78 | icon: "none",
79 | title: '你还未登录'
80 | })
81 | }
82 | })
83 | },
84 | // 关闭弹窗
85 | close: function () {
86 | this.setData({
87 | isSend: false
88 | })
89 | },
90 | //上传数据
91 | publish: function () {
92 | let writer = this.data.writer
93 | let to = this.data.to
94 | let info = this.data.info
95 | var likeNumber = 1
96 | console.log(likeNumber)
97 | if (!to) {
98 | wx.showToast({
99 | icon: "none",
100 | title: '对象不能为空'
101 | })
102 | return
103 | }
104 | if (!writer) {
105 | wx.showToast({
106 | icon: "none",
107 | title: '称呼不能为空'
108 | })
109 | return
110 | }
111 | if (!info || info.length < 6) {
112 | wx.showToast({
113 | icon: "none",
114 | title: '内容要多于六个字'
115 | })
116 | return
117 | }
118 | wx.showLoading({
119 | title: '发布中...',
120 | })
121 | wx.cloud.callFunction({
122 | name: 'love',
123 | data: {
124 | info: this.data.info,
125 | to: this.data.to,
126 | writer: this.data.writer,
127 | sendTime: util.formatTime(new Date())
128 | },
129 | success: res => {
130 | wx.hideLoading()
131 | wx.showToast({
132 | title: '发布成功',
133 | })
134 | console.log('发布成功', res)
135 | this.setData({
136 | isSend: false
137 | })
138 | this.onLoad()
139 | this.setData({
140 | to: null,
141 | writer: null,
142 | info: null
143 | })
144 | },
145 | fail: err => {
146 | wx.hideLoading()
147 | wx.showToast({
148 | icon: 'none',
149 | title: '网络不给力....'
150 | })
151 | console.error('发布失败', err)
152 | }
153 | })
154 | // db.collection('biaobai').add({
155 | // data: {
156 | // createTime: new Date(),
157 | // info: this.data.info,
158 | // to: this.data.to,
159 | // writer: this.data.writer,
160 | // sendTime: util.formatTime(new Date())
161 | // },
162 | // success: res => {
163 | // wx.hideLoading()
164 | // wx.showToast({
165 | // title: '发布成功',
166 | // })
167 | // console.log('发布成功', res)
168 | // this.setData({
169 | // isSend: false
170 | // })
171 | // this.onLoad()
172 | // },
173 | // fail: err => {
174 | // wx.hideLoading()
175 | // wx.showToast({
176 | // icon: 'none',
177 | // title: '网络不给力....'
178 | // })
179 | // console.error('发布失败', err)
180 | // }
181 | // })
182 |
183 | },
184 | delete: function (e) {
185 | var info = e.currentTarget.dataset.t
186 | console.log(info)
187 | db.collection('biaobai').doc(info._id).remove({
188 | success: function (res) {
189 | console.log(res.data)
190 | wx.showToast({
191 | icon: 'success',
192 | title: '删除成功',
193 | })
194 | }
195 | })
196 | this.onLoad()
197 | },
198 | /**
199 | * 生命周期函数--监听页面初次渲染完成
200 | */
201 | onReady: function () {
202 |
203 | },
204 |
205 | /**
206 | * 生命周期函数--监听页面显示
207 | */
208 | onShow: function () {
209 |
210 | },
211 |
212 | /**
213 | * 生命周期函数--监听页面隐藏
214 | */
215 | onHide: function () {
216 |
217 | },
218 |
219 | /**
220 | * 生命周期函数--监听页面卸载
221 | */
222 | onUnload: function () {
223 |
224 | },
225 |
226 | /**
227 | * 页面相关事件处理函数--监听用户下拉动作
228 | */
229 | onPullDownRefresh: function () {
230 |
231 | },
232 |
233 | /**
234 | * 页面上拉触底事件的处理函数
235 | */
236 | onReachBottom: function () {
237 |
238 | },
239 |
240 | /**
241 | * 用户点击右上角分享
242 | */
243 | onShareAppMessage: function () {
244 |
245 | }
246 | })
--------------------------------------------------------------------------------
/miniprogram/pages/biaobai/biaobai.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "表白墙",
3 | "navigationBarTextStyle": "white",
4 | "navigationBarBackgroundColor": "#34A9D4",
5 | "enablePullDownRefresh": true
6 | }
--------------------------------------------------------------------------------
/miniprogram/pages/biaobai/biaobai.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | To:{{item.to}}
7 |
8 |
9 |
10 | {{item.info}}
11 |
12 |
13 | From:{{item.writer}}
14 |
15 |
16 | 删除
17 |
18 | {{item.sendTime}}
19 |
20 |
21 |
22 | {{item.sendTime}}
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | 我要表白
33 |
34 |
35 |
36 | 你的名字:
37 |
38 | 内容:
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/miniprogram/pages/biaobai/biaobai.wxss:
--------------------------------------------------------------------------------
1 | page {
2 | /* background-image: url('http://rose-ccc.gitee.io/imgbed/background/3.jpg'); */
3 | background-size: 100vw 100vh;
4 | width: 100vw;
5 | height: 100vh;
6 | background-attachment: fixed; /*设置背景图片静止 */
7 | }
8 |
9 | .all {
10 | display: flex;
11 | flex-direction: column;
12 | width: 90vw;
13 | margin: auto;
14 | }
15 |
16 | .box {
17 | border-radius: 20rpx;
18 | margin-top: 30rpx;
19 | background-color: rgba(255, 255, 255, 0.8);
20 | /* background-color: rgba(0, 168, 243, 0.2); */
21 | width: 84vw;
22 | padding: 3vw;
23 | box-shadow: 10rpx 10rpx 10rpx rgba(0, 0, 0, 0.2);
24 | }
25 |
26 | .biaobai_text{
27 | margin-left:10rpx;
28 | }
29 |
30 | .box:last-of-type{
31 | margin-bottom: 30rpx;
32 | }
33 |
34 | .info {
35 | text-align: justify;
36 | margin: 10rpx 20rpx;
37 | }
38 |
39 | .box_bottom {
40 | display: flex;
41 | flex-direction: row;
42 | justify-content: space-between;
43 | }
44 |
45 | .delete {
46 | color: red;
47 | margin: 0 20rpx;
48 | }
49 |
50 | .writer {
51 | text-align: right;
52 | margin-right: 10rpx;
53 | }
54 |
55 | .title {
56 | font-weight: bolder;
57 | margin-right: 10rpx;
58 | }
59 |
60 | .send {
61 | width: 300rpx;
62 | height: 100rpx;
63 | position: fixed;
64 | margin: auto;
65 | bottom: 80rpx;
66 | right: 0;
67 | left: 0;
68 | }
69 |
70 | .send:active {
71 | width: 262.5rpx;
72 | height: 87.5rpx;
73 | position: fixed;
74 | margin: auto;
75 | bottom: 86.25rpx;
76 | right: 0;
77 | left: 0;
78 | }
79 |
80 | .send_bg {
81 | width: 100vw;
82 | height: 100vh;
83 | background-color: rgba(0, 0, 0, 0.2);
84 | position: fixed;
85 | top: 0;
86 | left: 0;
87 | }
88 |
89 | .send_box {
90 | width: 70vw;
91 | height: 680rpx;
92 | background-color: white;
93 | border-radius: 20rpx;
94 | margin: auto;
95 | position: fixed;
96 | top: 0;
97 | bottom: 0;
98 | left: 0;
99 | right: 0;
100 | display: flex;
101 | flex-direction: column;
102 | justify-content: space-between;
103 | }
104 |
105 | .top {
106 | height: 100rpx;
107 | background-color: #00a8f3;
108 | font-weight: bolder;
109 | font-size: 40rpx;
110 | text-align: center;
111 | color: white;
112 | line-height: 100rpx;
113 | border-top-left-radius: 20rpx;
114 | border-top-right-radius: 20rpx;
115 | }
116 |
117 | .center input {
118 | width: 90%;
119 | border: 2rpx grey solid;
120 | border-radius: 5rpx;
121 | margin: auto;
122 | margin-top: 20rpx;
123 | padding: 5rpx;
124 | }
125 |
126 | textarea {
127 | width: 90%;
128 | border: 2rpx grey solid;
129 | border-radius: 5rpx;
130 | margin: auto;
131 | margin-top: 20rpx;
132 | padding: 5rpx;
133 | }
134 |
135 | .send_button {
136 | margin-top: 20rpx;
137 | display: flex;
138 | flex-direction: row;
139 | margin-bottom: 0;
140 | }
141 |
142 | button {
143 | border: none;
144 | }
145 |
146 | .send_button button {
147 | width: 50%;
148 | background-color: #38baf7;
149 | color: white;
150 | border-top-left-radius: 0;
151 | border-top-right-radius: 0;
152 | }
153 |
154 | .send_button button:active {
155 | width: 50%;
156 | background-color: #00a8f3;
157 | color: white;
158 | border-top-left-radius: 0;
159 | border-top-right-radius: 0;
160 | }
161 |
162 | .b1 {
163 | border-bottom-right-radius: 0;
164 | }
165 |
166 | .b1:active {
167 | border-bottom-right-radius: 0;
168 | }
169 |
170 | .b2 {
171 | border-bottom-left-radius: 0;
172 | }
173 |
174 | .b2 {
175 | border-bottom-left-radius: 0;
176 | }
177 |
--------------------------------------------------------------------------------
/miniprogram/pages/index/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 |
3 | /**
4 | * 页面的初始数据
5 | */
6 | data: {
7 |
8 | },
9 |
10 | /**
11 | * 生命周期函数--监听页面加载
12 | */
13 | onLoad: function(options) {
14 |
15 | },
16 | // bindGetUserInfo: function(e) {
17 | // console.log(e.detail.userInfo)
18 | // this.setData({
19 | // isShow: false
20 | // })
21 | // },
22 |
23 | biaobai: function() {
24 | wx.navigateTo({
25 | url: '../biaobai/biaobai',
26 | })
27 | },
28 | lost: function() {
29 | wx.navigateTo({
30 | url: '../lost/lost',
31 | })
32 | },
33 | work: function() {
34 | wx.navigateTo({
35 | url: '../work/work',
36 | })
37 | },
38 | xianzhi: function() {
39 | wx.navigateTo({
40 | url: '../xianzhi/xianzhi',
41 | })
42 | },
43 | /**
44 | * 生命周期函数--监听页面初次渲染完成
45 | */
46 | onReady: function() {
47 |
48 | },
49 |
50 | /**
51 | * 生命周期函数--监听页面显示
52 | */
53 | onShow: function() {
54 |
55 | },
56 |
57 | /**
58 | * 生命周期函数--监听页面隐藏
59 | */
60 | onHide: function() {
61 |
62 | },
63 |
64 | /**
65 | * 生命周期函数--监听页面卸载
66 | */
67 | onUnload: function() {
68 |
69 | },
70 |
71 | /**
72 | * 页面相关事件处理函数--监听用户下拉动作
73 | */
74 | onPullDownRefresh: function() {
75 |
76 | },
77 |
78 | /**
79 | * 页面上拉触底事件的处理函数
80 | */
81 | onReachBottom: function() {
82 |
83 | },
84 |
85 | /**
86 | * 用户点击右上角分享
87 | */
88 | onShareAppMessage: function() {
89 |
90 | }
91 | })
--------------------------------------------------------------------------------
/miniprogram/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "校园骑士拾物招领",
3 | "navigationBarTextStyle": "white",
4 | "enablePullDownRefresh": true
5 | }
--------------------------------------------------------------------------------
/miniprogram/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
13 | 表白墙
14 |
15 |
16 |
17 | 失物招领
18 |
19 |
20 |
21 |
22 |
23 | 兼职
24 |
25 |
26 |
27 | 闲置买卖
28 |
29 |
30 |
--------------------------------------------------------------------------------
/miniprogram/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | page{
2 | background-size: cover;
3 | width: 100vw;
4 | background-color: #f7f7f7;
5 | }
6 | image{
7 | width: 100%;
8 | height: 30vh
9 | }
10 | swiper{
11 | height: 30vh;
12 | /* box-shadow: 10rpx 10rpx 10rpx rgba(0, 0, 0, 0.2); */
13 | border-radius: 20rpx;
14 |
15 | }
16 | swiper-item{
17 | border-radius: 20rpx;
18 | }
19 |
20 | .all{
21 | width: 95vw;
22 | margin: auto;
23 | margin-top: 3vw;
24 | }
25 | .line{
26 | margin: auto;
27 | width: 95vw;
28 | justify-content: space-between;
29 | display: flex;
30 | flex-direction: row;
31 | }
32 | .box{
33 | display: flex;
34 | flex-direction: row;
35 | background-color: #82b3fc;
36 | border-radius: 15rpx;
37 | margin-top: 20rpx;
38 | width: 46vw;
39 | height: 20vw;
40 | justify-content: left;
41 | font-size: 35rpx;
42 | /* box-shadow: 10rpx 10rpx 10rpx rgba(0, 0, 0, 0.2); */
43 | }
44 | .box:active{
45 | display: flex;
46 | flex-direction: row;
47 | background-color: #418dff;
48 | border-radius: 15rpx;
49 | margin-top: 20rpx;
50 | width: 46vw;
51 | height: 20vw;
52 | justify-content: left;
53 | font-size: 35rpx;
54 | /* box-shadow: 10rpx 10rpx 10rpx rgba(0, 255, 186, 0.5); */
55 | }
56 | .box image{
57 | width: 15vw;
58 | height: 15vw;
59 | margin: 3vw 20rpx;
60 | }
61 | .box view{
62 | height: 20vw;
63 | line-height: 20vw;
64 | color: white;
65 | }
66 |
--------------------------------------------------------------------------------
/miniprogram/pages/lost/lost.js:
--------------------------------------------------------------------------------
1 | const db = wx.cloud.database()
2 | Page({
3 | data: {
4 | page: 0, //预设当前项的值
5 | isSend: false
6 | },
7 |
8 | onLoad: function(e) {
9 | var that = this
10 | wx.getStorage({
11 | key: 'openid',
12 | success: function(res) {
13 | that.setData({
14 | openid: res.data
15 | })
16 | },
17 | })
18 | this.getLost()
19 | this.getFound()
20 | },
21 | onShow: function() {
22 | this.setData({
23 | isSend: false
24 | })
25 | this.onLoad()
26 | },
27 | delete: function(e) {
28 | var info = e.currentTarget.dataset.t
29 | console.log(info)
30 | db.collection('lost').doc(info._id).remove({
31 | success: function(res) {
32 | console.log(res.data)
33 | wx.showToast({
34 | icon: 'success',
35 | title: '删除成功',
36 | })
37 | that.setData({
38 | contentlistn: res.data // 页面分配数据
39 | });
40 | }
41 | })
42 | this.onLoad()
43 | },
44 | delete1: function(e) {
45 | var info = e.currentTarget.dataset.t
46 | console.log(info)
47 | db.collection('found').doc(info._id).remove({
48 | success: function(res) {
49 | console.log(res.data)
50 | wx.showToast({
51 | icon: 'success',
52 | title: '删除成功',
53 | })
54 | }
55 | })
56 | this.onLoad()
57 | },
58 | //联系方式
59 | call: function(e) {
60 | var temp = e.currentTarget.dataset.call
61 | wx.setClipboardData({
62 | data: temp.pCall,
63 | success(res) {
64 | wx.showToast({
65 | title: '电话已经复制',
66 | })
67 | },
68 | fail(res) {
69 | wx.showToast({
70 | icon: 'none',
71 | title: '该用户没有输入手机号码!',
72 | })
73 | }
74 | })
75 | },
76 | wechat: function(e) {
77 | var temp = e.currentTarget.dataset.wechat
78 | wx.setClipboardData({
79 | data: temp.pWechat,
80 | success(res) {
81 | wx.showToast({
82 | title: '微信号已经复制',
83 | })
84 | },
85 | fail(res) {
86 | wx.showToast({
87 | icon: 'none',
88 | title: '该用户没有输入微信号',
89 | })
90 | }
91 | })
92 | },
93 | // 预览图片
94 | previewImg: function(e) {
95 | let imgData = e.currentTarget.dataset.img;
96 | wx.previewImage({
97 | //当前显示图片
98 | current: imgData[0],
99 | //所有图片
100 | urls: imgData[1]
101 | })
102 | },
103 | getLost: function() {
104 | var that = this
105 | db.collection('lost')
106 | .orderBy('createTime', 'desc') //按发布时间排序
107 | .get({
108 | success(res) {
109 | that.setData({
110 | dataList: res.data
111 | })
112 | },
113 | fail(res) {
114 | console.log("请求失败", res)
115 | }
116 | })
117 | },
118 | getFound: function() {
119 | var that = this
120 | db.collection('found')
121 | .orderBy('createTime', 'desc') //按发布视频排序
122 | .get({
123 | success(res) {
124 | that.setData({
125 | dataList1: res.data
126 | })
127 | },
128 | fail(res) {
129 | console.log("请求失败", res)
130 | }
131 | })
132 | },
133 | //打开分类按钮
134 | send: function() {
135 | var that = this
136 | wx.getStorage({
137 | key: 'login',
138 | success: function(res) {
139 | if (res.data) {
140 | that.setData({
141 | isSend: true
142 | })
143 | } else {
144 | wx.showToast({
145 | icon: "none",
146 | title: '你还未登录'
147 | })
148 | }
149 | },
150 | fail: function (res) {
151 | wx.showToast({
152 | icon: "none",
153 | title: '你还未登录'
154 | })
155 | }
156 | })
157 | },
158 | //退出分类按钮
159 | back: function() {
160 | this.setData({
161 | isSend: false,
162 | isCall: false
163 | })
164 | },
165 | //跳转至发送页面
166 | send_lost: function() {
167 | wx.navigateTo({
168 | url: '../send/send?name=lostlost',
169 | })
170 | },
171 | send_found: function() {
172 | wx.navigateTo({
173 | url: '../send/send?name=lostfound',
174 | })
175 | },
176 | // 滚动切换标签样式
177 | switchTab: function(e) {
178 | this.setData({
179 | page: e.detail.current
180 | });
181 | },
182 | // 点击标题切换当前页时改变样式
183 | swichNav: function(e) {
184 | var temp = e.target.dataset.page;
185 | if (this.data.page == temp) {} else {
186 | this.setData({
187 | page: temp
188 | })
189 | }
190 | }
191 | })
--------------------------------------------------------------------------------
/miniprogram/pages/lost/lost.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "失物招领",
3 | "navigationBarTextStyle": "white",
4 | "enablePullDownRefresh": true
5 | }
--------------------------------------------------------------------------------
/miniprogram/pages/lost/lost.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 失物墙
4 | 拾物墙
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | {{item.userName}}
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 物品:{{item.name}}
24 |
25 |
26 | {{item.info}}
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 删除
35 | {{item.sendTime}}
36 |
37 | {{item.sendTime}}
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | {{item.userName}}
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | 物品:{{item.name}}
59 |
60 |
61 | {{item.info}}
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | 删除
70 | {{item.sendTime}}
71 |
72 | {{item.sendTime}}
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/miniprogram/pages/lost/lost.wxss:
--------------------------------------------------------------------------------
1 | .tab-h {
2 | width: 100vw;
3 | display: flex;
4 | flex-direction: row;
5 | background-color: white;
6 | height: 5vh;
7 | line-height: 5vh;
8 | font-size: 3vh;
9 | font-weight: bolder;
10 | justify-content: space-around;
11 | position: fixed;
12 | top: 0;
13 | z-index: 1;
14 | }
15 |
16 | swiper {
17 | margin-top: 70rpx;
18 | height: 94vh;
19 | }
20 |
21 | .tab-item {
22 | width: 250rpx;
23 | text-align: center;
24 | margin: 0 36rpx;
25 | color: rgb(156, 156, 156);
26 | font-size: 30rpx;
27 | }
28 |
29 | .tab-item.active {
30 | width: 250rpx;
31 | color: rgb(65, 65, 65);
32 | /* border-bottom: 5rpx blue solid; */
33 | }
34 |
35 | .box {
36 | border-radius: 20rpx;
37 | padding: 3vw;
38 | background-color: white;
39 | width: 84vw;
40 | margin: auto;
41 | margin-top: 30rpx;
42 | margin-bottom: 30rpx;
43 | box-shadow: 10rpx 10rpx 10rpx rgba(0, 0, 0, 0.2);
44 | }
45 |
46 | .top {
47 | display: flex;
48 | flex-direction: row;
49 | height: 60rpx;
50 | justify-content: space-between;
51 | }
52 |
53 | .touxiang {
54 | border-radius: 50%;
55 | width: 60rpx;
56 | height: 60rpx;
57 | margin: 0 15rpx 0 0;
58 | }
59 |
60 | .call {
61 | width: 60rpx;
62 | height: 60rpx;
63 | }
64 |
65 | .title {
66 | font-size: 40rpx;
67 | font-weight: bolder;
68 | line-height: 60rpx;
69 | }
70 |
71 | .line {
72 | margin: 10rpx 0;
73 | position: relative;
74 | left: -3vw;
75 | width: 90vw;
76 | border: 1rpx #e6e3e3 solid;
77 | }
78 |
79 | .info {
80 | width: 100%;
81 | line-height: 40rpx;
82 | text-align: justify;
83 | }
84 |
85 | .box_bottom {
86 | margin: 10rpx 0 0 0;
87 | display: flex;
88 | flex-direction: row;
89 | justify-content: space-between;
90 | }
91 |
92 | .delete {
93 | color: red;
94 | }
95 |
96 | .time {
97 | text-align: right;
98 | margin-right: 10rpx;
99 | color: grey;
100 | font-size: 20rpx;
101 | }
102 |
103 | .img_box {
104 | white-space: nowrap;
105 | margin-top: 20rpx;
106 | }
107 |
108 | .img {
109 | width: 150rpx;
110 | height: 150rpx;
111 | margin-right: 20rpx;
112 | border-radius: 15rpx;
113 | border: 5rpx black solid;
114 | }
115 |
116 | .send {
117 | width: 300rpx;
118 | height: 100rpx;
119 | position: fixed;
120 | margin: auto;
121 | bottom: 80rpx;
122 | right: 0;
123 | left: 0;
124 | }
125 |
126 | .send:active {
127 | width: 262.5rpx;
128 | height: 87.5rpx;
129 | position: fixed;
130 | margin: auto;
131 | bottom: 86.25rpx;
132 | right: 0;
133 | left: 0;
134 | }
135 |
136 | .show_send {
137 | position: absolute;
138 | top: 0;
139 | z-index: 2;
140 | }
141 |
142 | .bg {
143 | position: absolute;
144 | height: 100vh;
145 | width: 100vw;
146 | background: rgba(0, 0, 0, 0.5);
147 | top: 0;
148 | }
149 |
150 | .show_button {
151 | height: 200rpx;
152 | position: fixed;
153 | margin: auto;
154 | display: flex;
155 | flex-direction: row;
156 | top: 0;
157 | bottom: 0;
158 | left: 0;
159 | right: 0;
160 | line-height: 200rpx;
161 | justify-content: space-around;
162 | }
163 |
164 | .show_button button {
165 | width: 350rpx;
166 | height: 150rpx;
167 | text-align: center;
168 | line-height: 150rpx;
169 | }
170 |
--------------------------------------------------------------------------------
/miniprogram/pages/mine/about/about.js:
--------------------------------------------------------------------------------
1 | // pages/mine/about/about.js
2 | const app = getApp()
3 |
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 |
11 | },
12 |
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: function (options) {
17 |
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面初次渲染完成
22 | */
23 | onReady: function () {
24 |
25 | },
26 |
27 | /**
28 | * 生命周期函数--监听页面显示
29 | */
30 | onShow: function () {
31 |
32 | },
33 |
34 | /**
35 | * 生命周期函数--监听页面隐藏
36 | */
37 | onHide: function () {
38 |
39 | },
40 |
41 | /**
42 | * 生命周期函数--监听页面卸载
43 | */
44 | onUnload: function () {
45 |
46 | },
47 |
48 | /**
49 | * 页面相关事件处理函数--监听用户下拉动作
50 | */
51 | onPullDownRefresh: function () {
52 |
53 | },
54 |
55 | /**
56 | * 页面上拉触底事件的处理函数
57 | */
58 | onReachBottom: function () {
59 |
60 | },
61 |
62 | /**
63 | * 用户点击右上角分享
64 | */
65 | onShareAppMessage: function () {
66 |
67 | },
68 | /**
69 | * 关于我们页面合作电话
70 | */
71 | makePhone(){
72 | wx.makePhoneCall({
73 | phoneNumber: "18754026672",
74 | })
75 | },
76 | dizhi(){
77 | wx.openLocation({
78 | latitude: 34.989420, //目的地位置
79 | longitude: 118.424433,
80 | scale: 18,
81 | name: '临沂职业学院新校区', //自定义
82 | address: '校园骑士总部' //自定义
83 | })
84 | }
85 | })
--------------------------------------------------------------------------------
/miniprogram/pages/mine/about/about.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "关于我们"
3 | }
--------------------------------------------------------------------------------
/miniprogram/pages/mine/about/about.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 校园服务,是一个综合表白墙,失物招领,兼职和闲置买卖的综合服务平台,由 自由仁科技 开发,感谢您的使用!
6 |
7 |
8 |
9 | 联系我们
10 |
11 | 合作电话: 187-5402-6672
12 | E-mail: freeroot@163.com
13 | 地址:山东省临沂市河东区临沂职业学院新校区
--------------------------------------------------------------------------------
/miniprogram/pages/mine/about/about.wxss:
--------------------------------------------------------------------------------
1 | .about_logo{
2 | margin:0px auto;
3 | background-color: #fff;
4 | }
5 | .about_logo image{
6 | width: 400rpx;
7 | height: 400rpx;
8 | display: block;
9 | margin:0px auto;
10 | }
11 |
12 | .about_data{
13 | background-color: #fff;
14 | border-top: 1rpx solid #ccc;
15 | }
16 | .about_data view{
17 | width: 95%;
18 | margin: 0px auto;
19 | padding: 20rpx;
20 | }
21 |
22 | .about_title{
23 | margin: 30rpx 10rpx;
24 | }
25 | .lianxi_list{
26 | height: 80rpx;
27 | line-height: 80rpx;
28 | background-color: #fff;
29 | padding-left: 20rpx;
30 | }
31 | .border-b{
32 | border-top: 1px solid #ccc;
33 | }
--------------------------------------------------------------------------------
/miniprogram/pages/mine/mine.js:
--------------------------------------------------------------------------------
1 | const app = getApp();
2 | const db = wx.cloud.database()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | canIUse: wx.canIUse('button.open-type.getUserInfo'),
10 | fabu: false,
11 | login: false,
12 | right: "../../images/right.png",
13 | down: "../../images/down.png",
14 | biaobai: 0,
15 | xianzhi: 0,
16 | lost: 0,
17 | found: 0
18 | },
19 | about(){
20 | wx.navigateTo({
21 | url: './about/about',
22 | })
23 | },
24 | previewImg: function (e) {
25 | wx.navigateTo({
26 | url: '../sendContact/sendContact',
27 | })
28 | // wx.showLoading({
29 | // title: '正在加载',
30 | // })
31 | // var img = ['cloud://cloud-nbiot.636c-cloud-nbiot-1259603003/13.png']
32 | // wx.previewImage({
33 | // //当前显示图片
34 | // current: 'cloud://cloud-nbiot.636c-cloud-nbiot-1259603003/13.png',
35 | // //所有图片
36 | // urls: img,
37 | // success(){
38 | // wx.hideLoading()
39 | // }
40 | // })
41 | },
42 | /**
43 | * 生命周期函数--监听页面加载
44 | */
45 | onLoad: function(options) {
46 | this.getOpenid()
47 | },
48 | bindGetUserInfo: function(e) {
49 | this.onLoad()
50 | },
51 | getOpenid: function() {
52 | wx.getSetting({
53 | success(res) {
54 | if (res.authSetting['scope.userInfo']) {
55 | wx.getUserInfo({
56 | success: function(res) {
57 | that.setData({
58 | login: true
59 | })
60 | wx.setStorage({
61 | key: 'login',
62 | data: true,
63 | })
64 | console.log("aa", res.userInfo)
65 | wx.setStorage({
66 | key: 'userInfo',
67 | data: res.userInfo,
68 | })
69 | }
70 | })
71 | } else {
72 | wx.setStorage({
73 | key: 'login',
74 | data: false,
75 | })
76 | }
77 | }
78 | })
79 | let that = this;
80 | wx.cloud.callFunction({
81 | name: 'login',
82 | complete: res => {
83 | console.log('云函数获取到的openid: ', res.result)
84 | var openid = res.result.openid;
85 | that.setData({
86 | openid: openid
87 | })
88 | wx.setStorage({
89 | key: 'openid',
90 | data: that.data.openid
91 | })
92 | }
93 | })
94 | },
95 | fabu: function() {
96 | var temp = this.data.fabu
97 | var a = !temp
98 | this.setData({
99 | fabu: a
100 | })
101 | this.getBiaobai()
102 | this.getXianzhi()
103 | this.getLost()
104 | },
105 | getBiaobai: function() {
106 | var that = this
107 | db.collection('biaobai').where({
108 | _openid: this.data.openid
109 | }).count({
110 | success: function(res) {
111 | that.setData({
112 | biaobai: res.total
113 | })
114 | }
115 | })
116 | },
117 | getXianzhi: function() {
118 | var that = this
119 | db.collection('xianzhi').where({
120 | _openid: this.data.openid
121 | }).count({
122 | success: function(res) {
123 | that.setData({
124 | xianzhi: res.total
125 | })
126 | }
127 | })
128 | },
129 | getLost: function() {
130 | var that = this
131 | db.collection('found').where({
132 | _openid: this.data.openid
133 | }).count({
134 | success: function(res) {
135 | that.setData({
136 | found: res.total
137 | })
138 | }
139 | })
140 | db.collection('lost').where({
141 | _openid: this.data.openid
142 | }).count({
143 | success: function(res) {
144 | that.setData({
145 | lost: res.total
146 | })
147 | }
148 | })
149 | },
150 |
151 | /**
152 | * 生命周期函数--监听页面初次渲染完成
153 | */
154 | onReady: function() {
155 |
156 | },
157 |
158 | /**
159 | * 生命周期函数--监听页面显示
160 | */
161 | onShow: function() {
162 | this.fabu();
163 | },
164 |
165 | /**
166 | * 生命周期函数--监听页面隐藏
167 | */
168 | onHide: function() {
169 |
170 | },
171 |
172 | /**
173 | * 生命周期函数--监听页面卸载
174 | */
175 | onUnload: function() {
176 |
177 | },
178 |
179 | /**
180 | * 页面相关事件处理函数--监听用户下拉动作
181 | */
182 | onPullDownRefresh: function() {
183 |
184 | },
185 |
186 | /**
187 | * 页面上拉触底事件的处理函数
188 | */
189 | onReachBottom: function() {
190 |
191 | },
192 |
193 | /**
194 | * 用户点击右上角分享
195 | */
196 | onShareAppMessage: function() {
197 |
198 | }
199 | })
--------------------------------------------------------------------------------
/miniprogram/pages/mine/mine.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "我的",
3 | "navigationBarTextStyle": "white",
4 | "enablePullDownRefresh": true
5 | }
--------------------------------------------------------------------------------
/miniprogram/pages/mine/mine.wxml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 表白墙
25 | 发布{{biaobai}}
26 |
27 |
28 |
29 |
30 |
31 |
32 | 闲置物品
33 | 发布{{xianzhi}}
34 |
35 |
36 |
37 |
38 |
39 |
40 | 失物招领
41 | 失{{lost}},拾{{found}}
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 我发布的
51 |
52 |
53 |
54 |
55 | 表白墙
56 | 发布{{biaobai}}
57 |
58 | 闲置物品
59 | 发布{{xianzhi}}
60 |
61 | 失物招领
62 | 发布失物{{lost}},拾物{{found}}
63 |
64 |
65 |
66 |
67 |
68 | 意见反馈
69 |
70 |
71 |
72 |
73 |
74 | 关于我们
75 |
76 |
77 |
78 |
79 | -- 我是有底线的 --
80 |
81 |
--------------------------------------------------------------------------------
/miniprogram/pages/mine/mine.wxss:
--------------------------------------------------------------------------------
1 | page {
2 | background-color: #f7f7f7;
3 | }
4 |
5 | .info {
6 | /* background-color: #00a8f3; */
7 | padding: 30rpx;
8 | display: flex;
9 | flex-direction: column;
10 | align-items: center;
11 | margin-bottom: 30rpx;
12 | }
13 | .info button{
14 | height: 70rpx;
15 | line-height: 70rpx;
16 | background-color: #00a8f3;
17 | border: none;
18 | color: #fff;
19 | }
20 | .name{
21 | height: 70rpx;
22 | line-height: 80rpx
23 | }
24 | .touxiang {
25 | margin: auto;
26 | overflow: hidden;
27 | /* margin-top: 20rpx; */
28 | margin-bottom: 20rpx;
29 | width: 160rpx;
30 | height: 160rpx;
31 | border-radius: 50%;
32 | /* box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.2); */
33 | }
34 | .touxiang image{
35 | width: 160rpx;
36 | height: 160rpx
37 | }
38 |
39 | /* 导航 */
40 | .navigation{
41 | width: 95%;
42 | margin:20rpx auto;
43 | height: 150rpx;
44 | background-color: #fff;
45 | border-radius: 15rpx;
46 | display: flex;
47 | flex-wrap: wrap;
48 | font-size: 28rpx;
49 | /* line-height: 150rpx; */
50 | }
51 | .navigation_list{
52 | flex: 1;
53 | height: 100rpx;
54 | padding: 10rpx;
55 | position: relative;
56 | margin-left: -10rpx;
57 | }
58 | .list_left{
59 | width: 60rpx;
60 | height: 60rpx;
61 | position: absolute;
62 | left: 20rpx;
63 | top: 40rpx;
64 | }
65 | .list_right{
66 | position: absolute;
67 | left: 85rpx;
68 | top: 35rpx;
69 | height: 100rpx;
70 |
71 | }
72 | .list_shuxian{
73 | height: 100rpx;
74 | border: 1px solid #ccc;
75 | margin: 20rpx;
76 | }
77 |
78 | /* 列表 */
79 | .liebiao {
80 | background-color: white;
81 | margin-top: 30rpx;
82 | }
83 |
84 | .box {
85 | display: flex;
86 | flex-direction: row;
87 | height: 80rpx;
88 | padding: 10rpx;
89 | border-bottom: 5rpx solid #e6e3e3;
90 | justify-content: space-between;
91 | }
92 |
93 | .box1 {
94 | /* background-color: #e0f5ff; */
95 | display: flex;
96 | flex-direction: row;
97 | text-indent: 60rpx;
98 | height: 50rpx;
99 | line-height: 50rpx;
100 | padding: 10rpx;
101 | justify-content: space-between;
102 | }
103 |
104 | .box1 text {
105 | margin: 0 60rpx;
106 | font-size: 25rpx;
107 | }
108 |
109 | .left {
110 | display: flex;
111 | flex-direction: row;
112 | }
113 |
114 | .mine_img {
115 | width: 80rpx;
116 | height: 80rpx;
117 | margin:10rpx 30rpx;
118 | }
119 | .icon{
120 | width: 50rpx;
121 | height: 50rpx;
122 | margin-top: 15rpx;
123 | }
124 |
125 | /* 导航栏 */
126 | .header {
127 | position: relative;
128 | height:300rpx;
129 | background: linear-gradient(to bottom, #56ccf2, #2f80ed);
130 | }
131 |
132 | .bg_ware {
133 | position: absolute;
134 | left: 0px;
135 | bottom: -2rpx;
136 | width: 100%;
137 | mix-blend-mode: screen;
138 | height: 120rpx;
139 | }
140 |
141 |
--------------------------------------------------------------------------------
/miniprogram/pages/send/send.js:
--------------------------------------------------------------------------------
1 | const app = getApp()
2 | var util = require('../util/util.js');
3 | const db = wx.cloud.database(); //初始化数据库
4 | Page({
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | imgbox: [], //选择图片
10 | fileIDs: [], //上传云存储后的返回值
11 | },
12 | onLoad: function(options) {
13 | this.setData({
14 | type: options.name
15 | })
16 | console.log(this.data.type)
17 | if (this.data.type == 'lostlost' || this.data.type == 'lostfound') {
18 | wx.setNavigationBarTitle({
19 | title: '失物招领'
20 | })
21 | } else {
22 | wx.setNavigationBarTitle({
23 | title: '闲置发布'
24 | })
25 | }
26 | var that = this
27 | wx.getStorage({
28 | key: 'userInfo',
29 | success: function(res) {
30 | that.setData({
31 | user: res.data
32 | })
33 | },
34 | })
35 | },
36 | //输入信息
37 | pName(event) {
38 | console.log("输入的对象", event.detail.value)
39 | this.setData({
40 | pName: event.detail.value
41 | })
42 | },
43 | pCall(event) {
44 | console.log("输入的对象", event.detail.value)
45 | this.setData({
46 | pCall: event.detail.value
47 | })
48 | },
49 | pWechat(event) {
50 | console.log("输入的对象", event.detail.value)
51 | this.setData({
52 | pWechat: event.detail.value
53 | })
54 | },
55 | name(event) {
56 | console.log("输入的对象", event.detail.value)
57 | this.setData({
58 | name: event.detail.value
59 | })
60 | },
61 | price(event) {
62 | console.log("输入的对象", event.detail.value)
63 | this.setData({
64 | price: event.detail.value
65 | })
66 | },
67 | info(event) {
68 | console.log("输入的对象", event.detail.value)
69 | this.setData({
70 | info: event.detail.value
71 | })
72 | },
73 | // 删除照片 &&
74 | imgDelete1: function(e) {
75 | let that = this;
76 | let index = e.currentTarget.dataset.deindex;
77 | let imgbox = this.data.imgbox;
78 | imgbox.splice(index, 1)
79 | that.setData({
80 | imgbox: imgbox
81 | });
82 | },
83 | // 选择图片 &&&
84 | addPic1: function(e) {
85 | var imgbox = this.data.imgbox;
86 | var that = this;
87 | var n = 5;
88 | if (5 > imgbox.length > 0) {
89 | n = 5 - imgbox.length;
90 | } else if (imgbox.length == 5) {
91 | n = 1;
92 | }
93 | wx.chooseImage({
94 | count: n, // 默认9,设置图片张数
95 | sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
96 | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
97 | success: function(res) {
98 | // console.log(res.tempFilePaths)
99 | // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
100 | var tempFilePaths = res.tempFilePaths
101 |
102 | if (imgbox.length == 0) {
103 | imgbox = tempFilePaths
104 | } else if (5 > imgbox.length) {
105 | imgbox = imgbox.concat(tempFilePaths);
106 | }
107 | that.setData({
108 | imgbox: imgbox
109 | });
110 | }
111 | })
112 | },
113 |
114 | //发布按钮
115 | fb: function(e) {
116 | if (this.data.type == 'lostlost') {
117 | var room = 'lost'
118 | } else if (this.data.type == 'lostfound') {
119 | var room = 'found'
120 | } else {
121 | var room = 'xianzhi'
122 | }
123 | console.log(room)
124 | if (!this.data.imgbox.length) {
125 | wx.showToast({
126 | icon: 'none',
127 | title: '图片类容为空'
128 | });
129 | } else {
130 | //上传图片到云存储
131 | wx.showLoading({
132 | title: '上传中',
133 | })
134 | let promiseArr = [];
135 | for (let i = 0; i < this.data.imgbox.length; i++) {
136 | promiseArr.push(new Promise((reslove, reject) => {
137 | let item = this.data.imgbox[i];
138 | let suffix = /\.\w+$/.exec(item)[0]; //正则表达式返回文件的扩展名
139 | // wx.cloud.uploadFile({
140 | // cloudPath: new Date().getTime() + suffix, // 上传至云端的路径
141 | // filePath: item, // 小程序临时文件路径
142 | // success: res => {
143 | // this.setData({
144 | // fileIDs: this.data.fileIDs.concat(res.fileID)
145 | // });
146 | // console.log(res.fileID) //输出上传后图片的返回地址
147 | // reslove();
148 | // wx.hideLoading();
149 | // wx.showToast({
150 | // title: "上传成功",
151 | // })
152 | // },
153 | // fail: res => {
154 | // wx.hideLoading();
155 | // wx.showToast({
156 | // icon: 'none',
157 | // title: "上传失败",
158 | // })
159 | // }
160 |
161 | // })
162 | var that = this
163 | const fileContent = wx.getFileSystemManager().readFileSync(item, 'base64');
164 | wx.cloud.callFunction({
165 | name: 'img',
166 | data: {
167 | fileContent: fileContent,
168 | cloudPath: new Date().getTime() + suffix
169 | },
170 | success: function(res) {
171 | that.setData({
172 | fileIDs: that.data.fileIDs.concat(res.result.fileID)
173 | });
174 | console.log(res.result.fileID) //输出上传后图片的返回地址
175 | reslove();
176 | // wx.hideLoading();
177 | wx.showToast({
178 | title: "上传成功",
179 | })
180 | },
181 | fail: function(res) {
182 | console.log(res)
183 | // wx.hideLoading();
184 | wx.showToast({
185 | icon: 'none',
186 | title: "上传失败",
187 | })
188 | }
189 | })
190 | }));
191 | }
192 | Promise.all(promiseArr).then(res => { //等数组都做完后做then方法
193 | wx.cloud.callFunction({
194 | name: 'send',
195 | data: {
196 | room,
197 | fileIDs: this.data.fileIDs,
198 | sendTime: util.formatTime(new Date()),
199 | pName: this.data.pName,
200 | pCall: this.data.pCall,
201 | pWechat: this.data.pWechat,
202 | name: this.data.name,
203 | price: this.data.price,
204 | info: this.data.info,
205 | images: this.data.imgbox,
206 | touxiang: this.data.user.avatarUrl,
207 | userName: this.data.user.nickName
208 | },
209 | success: res => {
210 | // wx.hideLoading()
211 | wx.showToast({
212 | title: '发布成功',
213 | })
214 | console.log('发布成功', res)
215 | wx.navigateBack({
216 | })
217 | },
218 | fail: err => {
219 | // wx.hideLoading()
220 | wx.showToast({
221 | icon: 'none',
222 | title: '网络不给力....'
223 | })
224 | console.error('发布失败', err)
225 | }
226 | })
227 | // wx.cloud.database().collection(data).add({
228 | // data: {
229 | // fileIDs: this.data.fileIDs,
230 | // createTime: new Date(),
231 | // sendTime: util.formatTime(new Date()),
232 | // pName: this.data.pName,
233 | // pCall: this.data.pCall,
234 | // pWechat: this.data.pWechat,
235 | // name: this.data.name,
236 | // price: this.data.price,
237 | // info: this.data.info,
238 | // images: this.data.imgbox,
239 | // touxiang: this.data.user.avatarUrl,
240 | // userName: this.data.user.nickName
241 | // },
242 | // success: res => {
243 | // wx.hideLoading()
244 | // wx.showToast({
245 | // title: '发布成功',
246 | // })
247 | // console.log('发布成功', res)
248 | // wx.navigateBack({
249 |
250 | // })
251 | // },
252 | // fail: err => {
253 | // wx.hideLoading()
254 | // wx.showToast({
255 | // icon: 'none',
256 | // title: '网络不给力....'
257 | // })
258 | // console.error('发布失败', err)
259 | // }
260 | // })
261 | })
262 |
263 | }
264 | },
265 |
266 | })
--------------------------------------------------------------------------------
/miniprogram/pages/send/send.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "闲置物品",
3 | "navigationBarTextStyle": "white"
4 | }
--------------------------------------------------------------------------------
/miniprogram/pages/send/send.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 个人信息
5 |
6 |
7 | 称呼
8 |
9 |
10 |
11 |
12 | 手机号
13 |
14 |
15 |
16 |
17 | 微信号
18 |
19 |
20 |
21 |
22 | 商品信息
23 |
24 |
25 | 商品名称
26 |
27 |
28 |
29 |
30 | 商品价格
31 |
32 |
33 |
34 |
35 | 商品图片
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | 商品介绍
53 |
54 |
55 |
56 |
57 |
58 |
59 | 我丢东西了(* ̄(エ) ̄)
60 | 看我捡到了个啥(′▽`〃)
61 |
62 |
63 | 物品名称
64 |
65 |
66 |
67 |
68 | 物品图片
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | 详细说明
86 |
87 |
88 |
89 | 详细说明
90 |
91 |
92 |
93 |
94 | 联系方式
95 |
96 |
97 | 手机号
98 |
99 |
100 |
101 |
102 | 微信号
103 |
104 |
105 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/miniprogram/pages/send/send.wxss:
--------------------------------------------------------------------------------
1 | .pages {
2 | width: 98%;
3 | margin: auto;
4 | overflow: hidden;
5 | }
6 |
7 | .all {
8 | width: 90vw;
9 | height: 92vh;
10 | margin: auto;
11 | overflow: hidden;
12 | }
13 |
14 | .box {
15 | width: 84vw;
16 | border-radius: 20rpx;
17 | background-color: white;
18 | margin-top: 30rpx;
19 | padding: 3vw;
20 | /* box-shadow: 10rpx 10rpx 10rpx rgba(0, 0, 0, 0.2); */
21 | }
22 |
23 | .box_top {
24 | font-size: 40rpx;
25 | text-align: center;
26 | }
27 |
28 | .line {
29 | width: 90vw;
30 | border: 1rpx #e6e3e3 solid;
31 | position: relative;
32 | left: -3vw;
33 | margin: 15rpx 0;
34 | }
35 |
36 | .box_center {
37 | display: flex;
38 | flex-direction: row;
39 | }
40 |
41 | .left {
42 | width: 25%;
43 | }
44 |
45 | input, textarea {
46 | width: 75%;
47 | }
48 |
49 | /* 图片 */
50 | .images_box {
51 | white-space: nowrap;
52 | height: 150rpx;
53 | width: 75%;
54 | overflow: hidden
55 | }
56 |
57 | .img-box {
58 | display: inline-block;
59 | border: 3rpx;
60 | border-style: dashed;
61 | border-color: rgba(0, 0, 0, 0.452);
62 | width: 100rpx;
63 | height: 100rpx;
64 | margin-right: 35rpx;
65 | margin-top: 20rpx;
66 | margin-bottom: 20rpx;
67 | position: relative;
68 | }
69 |
70 | /* 删除图片 */
71 |
72 | .img-delect {
73 | width: 30rpx;
74 | height: 30rpx;
75 | border-radius: 50%;
76 | position: absolute;
77 | right: -15rpx;
78 | top: -15rpx;
79 | background-color: red;
80 | }
81 |
82 | .img {
83 | width: 100%;
84 | height: 100%;
85 | }
86 |
87 | button {
88 | width: 100vw;
89 | height: 8vh;
90 | line-height: 8vh;
91 | border: none;
92 | border-radius: 0;
93 | background-color: #00a8f3;
94 | color: white;
95 | position: fixed;
96 | bottom: 0
97 | }
98 |
99 |
--------------------------------------------------------------------------------
/miniprogram/pages/temp/temp.js:
--------------------------------------------------------------------------------
1 | Page({
2 |
3 | /**
4 | * 页面的初始数据
5 | */
6 | data: {
7 |
8 | },
9 |
10 | /**
11 | * 生命周期函数--监听页面加载
12 | */
13 | onLoad: function(options) {
14 | this.setData({
15 | type:options.name
16 | })
17 | if (this.data.type == 'work') {
18 | wx.setNavigationBarTitle({ title: '兼职' })
19 | } else {
20 | wx.setNavigationBarTitle({ title: '闲置物品' })
21 | }
22 | var that = this
23 | wx.getStorage({
24 | key: 'info',
25 | success: function(res) {
26 | that.setData({
27 | item: res.data
28 | })
29 | }
30 | })
31 | },
32 | // 预览图片
33 | previewImg: function (e) {
34 | let imgData = e.currentTarget.dataset.img;
35 | wx.previewImage({
36 | //当前显示图片
37 | current: imgData,
38 | //所有图片
39 | urls: this.data.item.fileIDs
40 | })
41 | },
42 | /**
43 | * 生命周期函数--监听页面初次渲染完成
44 | */
45 | onReady: function() {
46 |
47 | },
48 |
49 | /**
50 | * 生命周期函数--监听页面显示
51 | */
52 | onShow: function() {
53 |
54 | },
55 |
56 | /**
57 | * 生命周期函数--监听页面隐藏
58 | */
59 | onHide: function() {
60 |
61 | },
62 |
63 | /**
64 | * 生命周期函数--监听页面卸载
65 | */
66 | onUnload: function() {
67 | wx.removeStorage({
68 | key: 'info',
69 | success: function(res) {},
70 | })
71 | },
72 |
73 | /**
74 | * 页面相关事件处理函数--监听用户下拉动作
75 | */
76 | onPullDownRefresh: function() {
77 |
78 | },
79 |
80 | /**
81 | * 页面上拉触底事件的处理函数
82 | */
83 | onReachBottom: function() {
84 |
85 | },
86 |
87 | /**
88 | * 用户点击右上角分享
89 | */
90 | onShareAppMessage: function() {
91 |
92 | }
93 | })
--------------------------------------------------------------------------------
/miniprogram/pages/temp/temp.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "兼职",
3 | "navigationBarTextStyle": "white"
4 | }
--------------------------------------------------------------------------------
/miniprogram/pages/temp/temp.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{item.gangwei}}
4 | {{item.didian}}
5 |
6 | {{item.gongsi}}
7 | {{item.daiyu}}
8 |
9 |
10 | 工作内容:
11 | \n{{item.neirong}}
12 |
13 | 工作时间:
14 | \n{{item.shijian}}
15 |
16 | 应聘要求:
17 | \n{{item.yaoqiu}}
18 |
19 | 发布者:{{item.writer}}
20 | 请联系:{{item.call}}
21 |
22 |
23 |
24 |
25 | {{item.name}}
26 | 卖家:{{item.pName}}
27 | 卖家微信:{{item.pWechat}}
28 |
29 | 卖家电话:{{item.pCall}}
30 | {{item.price}}
31 |
32 |
33 |
34 | {{item.info}}
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/miniprogram/pages/temp/temp.wxss:
--------------------------------------------------------------------------------
1 | page{
2 | background-color: #c5ebfc;
3 | padding: 20rpx;
4 | width: 90vw;
5 | margin: auto
6 | }
7 | .line{
8 | width: 100vw;
9 | border: 1rpx grey solid;
10 | position: relative;
11 | left: -5vw;
12 | margin: 15rpx 0;
13 | }
14 | .title{
15 | font-size: 50rpx;
16 | font-weight: bolder;
17 | margin-bottom: 10rpx;
18 | }
19 | .text{
20 | line-height: 60rpx;
21 | margin-bottom: 15rpx;
22 | }
23 | .box{
24 | display: flex;
25 | flex-direction: row;
26 | justify-content: space-between;
27 | }
28 | image{
29 | width: 600rpx;
30 | height: 400rpx;
31 | border: 5rpx black solid;
32 | border-radius: 20rpx;
33 | margin-bottom: 20rpx;
34 | }
--------------------------------------------------------------------------------
/miniprogram/pages/util/util.js:
--------------------------------------------------------------------------------
1 | const formatTime = date => {
2 | const year = date.getFullYear()
3 | const month = date.getMonth() + 1
4 | const day = date.getDate()
5 | const hour = date.getHours()
6 | const minute = date.getMinutes()
7 | const second = date.getSeconds()
8 |
9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
10 | }
11 |
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 |
17 | module.exports = {
18 | formatTime: formatTime
19 | }
20 |
--------------------------------------------------------------------------------
/miniprogram/pages/work/work.js:
--------------------------------------------------------------------------------
1 | const db = wx.cloud.database()
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function(options) {
15 | var that = this
16 | db.collection('jianzhi')
17 | .orderBy('createTime', 'desc') //按发布视频排序
18 | .get({
19 | success(res) {
20 | console.log("请求成功", res.data[0])
21 | that.setData({
22 | dataList: res.data
23 | })
24 | },
25 | fail(res) {
26 | console.log("请求失败", res)
27 | }
28 | })
29 | },
30 | go: function(event) {
31 | var info = event.currentTarget.dataset.id
32 | wx.setStorage({
33 | key: 'info',
34 | data: info,
35 | })
36 | wx.navigateTo({
37 | url: '../temp/temp?name=work',
38 | })
39 | },
40 | /**
41 | * 生命周期函数--监听页面初次渲染完成
42 | */
43 | onReady: function() {
44 |
45 | },
46 |
47 | /**
48 | * 生命周期函数--监听页面显示
49 | */
50 | onShow: function() {
51 |
52 | },
53 |
54 | /**
55 | * 生命周期函数--监听页面隐藏
56 | */
57 | onHide: function() {
58 |
59 | },
60 |
61 | /**
62 | * 生命周期函数--监听页面卸载
63 | */
64 | onUnload: function() {
65 |
66 | },
67 |
68 | /**
69 | * 页面相关事件处理函数--监听用户下拉动作
70 | */
71 | onPullDownRefresh: function() {
72 |
73 | },
74 |
75 | /**
76 | * 页面上拉触底事件的处理函数
77 | */
78 | onReachBottom: function() {
79 |
80 | },
81 |
82 | /**
83 | * 用户点击右上角分享
84 | */
85 | onShareAppMessage: function() {
86 |
87 | }
88 | })
--------------------------------------------------------------------------------
/miniprogram/pages/work/work.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "兼职",
3 | "navigationBarTextStyle": "white",
4 | "enablePullDownRefresh": true
5 | }
--------------------------------------------------------------------------------
/miniprogram/pages/work/work.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{item.gangwei}}
4 |
5 | 地点:{{item.didian}}
6 |
7 | 要求:{{item.yaoqiu}}
8 | {{item.daiyu}}
9 |
10 |
11 |
--------------------------------------------------------------------------------
/miniprogram/pages/work/work.wxss:
--------------------------------------------------------------------------------
1 | .line {
2 | width: 90vw;
3 | border: 1rpx grey solid;
4 | position: relative;
5 | margin: 10rpx 0;
6 | left: -5vw
7 | }
8 |
9 | .box {
10 | border-radius: 20rpx;
11 | background: white;
12 | margin: auto;
13 | margin-top: 20rpx;
14 | margin-bottom: 20rpx;
15 | padding: 20rpx 5vw;
16 | width: 80vw;
17 | line-height: 60rpx;
18 | box-shadow: 10rpx 10rpx 10rpx rgba(0, 0, 0, 0.2);
19 | }
20 |
21 | .title {
22 | font-weight: bolder;
23 | font-size: 40rpx;
24 | }
25 |
26 | .location {
27 | color: grey;
28 | }
29 |
30 | .price {
31 | color: red;
32 | text-align: right;
33 | font-weight: bolder;
34 | line-height: 25rpx
35 | }
36 |
--------------------------------------------------------------------------------
/miniprogram/pages/xianzhi/xianzhi.js:
--------------------------------------------------------------------------------
1 | const db = wx.cloud.database()
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | imgbox: []
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function(options) {
15 | var that = this
16 | wx.getStorage({
17 | key: 'openid',
18 | success: function(res) {
19 | that.setData({
20 | openid: res.data
21 | })
22 | },
23 | })
24 | db.collection('xianzhi')
25 | .orderBy('createTime', 'desc') //按发布视频排序
26 | .get({
27 | success(res) {
28 | console.log("请求成功", res.data[0])
29 | that.setData({
30 | dataList: res.data
31 | })
32 | },
33 | fail(res) {
34 | console.log("请求失败", res)
35 | }
36 | })
37 | },
38 | delete: function(e) {
39 | var info = e.currentTarget.dataset.t
40 | console.log(info)
41 | db.collection('xianzhi').doc(info._id).remove({
42 | success: function(res) {
43 | console.log(res.data)
44 | wx.showToast({
45 | icon: 'success',
46 | title: '删除成功',
47 | })
48 | }
49 | })
50 | this.onLoad()
51 | },
52 | send: function() {
53 | wx.getStorage({
54 | key: 'login',
55 | success: function (res) {
56 | if (res.data) {
57 | wx.navigateTo({
58 | url: '../send/send?name=xianzhi',
59 | })
60 | } else {
61 | wx.showToast({
62 | icon: "none",
63 | title: '你还未登录'
64 | })
65 | }
66 | },
67 | fail: function (res) {
68 | wx.showToast({
69 | icon: "none",
70 | title: '你还未登录'
71 | })
72 | }
73 | })
74 | },
75 | go: function(event) {
76 | var info = event.currentTarget.dataset.id
77 | wx.setStorage({
78 | key: 'info',
79 | data: info,
80 | })
81 | wx.navigateTo({
82 | url: '../temp/temp?name=xianzhi',
83 | })
84 | },
85 | /**
86 | * 生命周期函数--监听页面初次渲染完成
87 | */
88 | onReady: function() {
89 |
90 | },
91 |
92 | /**
93 | * 生命周期函数--监听页面显示
94 | */
95 | onShow: function() {
96 | this.onLoad()
97 | },
98 |
99 | /**
100 | * 生命周期函数--监听页面隐藏
101 | */
102 | onHide: function() {
103 |
104 | },
105 |
106 | /**
107 | * 生命周期函数--监听页面卸载
108 | */
109 | onUnload: function() {
110 |
111 | },
112 |
113 | /**
114 | * 页面相关事件处理函数--监听用户下拉动作
115 | */
116 | onPullDownRefresh: function() {
117 |
118 | },
119 |
120 | /**
121 | * 页面上拉触底事件的处理函数
122 | */
123 | onReachBottom: function() {
124 |
125 | },
126 |
127 | /**
128 | * 用户点击右上角分享
129 | */
130 | onShareAppMessage: function() {
131 |
132 | }
133 | })
--------------------------------------------------------------------------------
/miniprogram/pages/xianzhi/xianzhi.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "闲置买卖",
3 | "navigationBarTextStyle": "white",
4 | "enablePullDownRefresh": true
5 | }
--------------------------------------------------------------------------------
/miniprogram/pages/xianzhi/xianzhi.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{item.name}}
6 | {{item.price}}
7 |
8 |
9 |
10 | {{item.info}}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | 删除
19 | {{item.sendTime}}
20 |
21 | {{item.sendTime}}
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/miniprogram/pages/xianzhi/xianzhi.wxss:
--------------------------------------------------------------------------------
1 | page {
2 | padding: 30rpx 0;
3 | }
4 |
5 | .box {
6 | border-radius: 20rpx;
7 | padding: 3vw;
8 | background-color: white;
9 | width: 84vw;
10 | margin: auto;
11 | margin-bottom: 30rpx;
12 | box-shadow: 10rpx 10rpx 10rpx rgba(0, 0, 0, 0.2);
13 | }
14 |
15 | .top {
16 | display: flex;
17 | flex-direction: row;
18 | justify-content: space-between;
19 | height: 60rpx;
20 | }
21 |
22 | .title {
23 | font-size: 40rpx;
24 | font-weight: bolder;
25 | line-height: 60rpx;
26 | }
27 |
28 | .price {
29 | line-height: 60rpx;
30 | color: red;
31 | }
32 |
33 | .line {
34 | margin: 10rpx 0;
35 | position: relative;
36 | left: -3vw;
37 | width: 90vw;
38 | border: 1rpx grey solid;
39 | }
40 |
41 | .info {
42 | width: 100%;
43 | line-height: 40rpx;
44 | overflow: hidden;
45 | text-align: justify;
46 | word-break: break-all;
47 | display: -webkit-box;
48 | -webkit-line-clamp: 2;
49 | -webkit-box-orient: vertical;
50 | }
51 |
52 | .img_box {
53 | white-space: nowrap;
54 | margin: 20rpx 0;
55 | }
56 |
57 | .img {
58 | width: 150rpx;
59 | height: 150rpx;
60 | margin-right: 20rpx;
61 | border-radius: 15rpx;
62 | border: 5rpx black solid;
63 | }
64 |
65 | .box_bottom {
66 | margin: 10rpx 0 0 0;
67 | display: flex;
68 | flex-direction: row;
69 | justify-content: space-between;
70 | }
71 |
72 | .delete {
73 | color: red;
74 | }
75 |
76 | .time {
77 | text-align: right;
78 | margin-right: 10rpx;
79 | color: grey;
80 | font-size: 20rpx;
81 | }
82 |
83 | .send {
84 | width: 300rpx;
85 | height: 100rpx;
86 | position: fixed;
87 | margin: auto;
88 | bottom: 80rpx;
89 | right: 0;
90 | left: 0;
91 | }
92 |
93 | .send:active {
94 | width: 262.5rpx;
95 | height: 87.5rpx;
96 | position: fixed;
97 | margin: auto;
98 | bottom: 86.25rpx;
99 | right: 0;
100 | left: 0;
101 | }
102 |
--------------------------------------------------------------------------------
/miniprogram/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "miniprogramRoot": "miniprogram/",
3 | "cloudfunctionRoot": "cloudfunctions/",
4 | "setting": {
5 | "urlCheck": true,
6 | "es6": true,
7 | "enhance": true,
8 | "postcss": true,
9 | "preloadBackgroundData": false,
10 | "minified": true,
11 | "newFeature": true,
12 | "coverView": true,
13 | "nodeModules": false,
14 | "autoAudits": false,
15 | "showShadowRootInWxmlPanel": true,
16 | "scopeDataCheck": false,
17 | "uglifyFileName": false,
18 | "checkInvalidKey": true,
19 | "checkSiteMap": true,
20 | "uploadWithSourceMap": true,
21 | "compileHotReLoad": false,
22 | "useMultiFrameRuntime": true,
23 | "useApiHook": true,
24 | "useApiHostProcess": true,
25 | "babelSetting": {
26 | "ignore": [],
27 | "disablePlugins": [],
28 | "outputPath": ""
29 | },
30 | "enableEngineNative": false,
31 | "bundle": false,
32 | "useIsolateContext": true,
33 | "useCompilerModule": true,
34 | "userConfirmedUseCompilerModuleSwitch": false,
35 | "userConfirmedBundleSwitch": false,
36 | "packNpmManually": false,
37 | "packNpmRelationList": [],
38 | "minifyWXSS": true
39 | },
40 | "appid": "wx53faa0337f170fa6",
41 | "projectname": "%E6%8B%BE%E7%89%A9%E5%A2%99",
42 | "libVersion": "2.15.0",
43 | "simulatorType": "wechat",
44 | "simulatorPluginLibVersion": {},
45 | "cloudfunctionTemplateRoot": "cloudfunctionTemplate",
46 | "compileType": "miniprogram",
47 | "condition": {
48 | "search": {
49 | "list": []
50 | },
51 | "conversation": {
52 | "list": []
53 | },
54 | "plugin": {
55 | "list": []
56 | },
57 | "game": {
58 | "list": []
59 | },
60 | "gamePlugin": {
61 | "list": []
62 | },
63 | "miniprogram": {
64 | "list": [
65 | {
66 | "id": -1,
67 | "name": "db guide",
68 | "pathName": "pages/databaseGuide/databaseGuide",
69 | "query": ""
70 | },
71 | {
72 | "id": -1,
73 | "name": "pages/work/work",
74 | "pathName": "pages/work/work",
75 | "query": "",
76 | "scene": null
77 | },
78 | {
79 | "id": -1,
80 | "name": "pages/xianzhi/xianzhi",
81 | "pathName": "pages/xianzhi/xianzhi",
82 | "query": "",
83 | "scene": null
84 | },
85 | {
86 | "id": -1,
87 | "name": "pages/biaobai/biaobai",
88 | "pathName": "pages/biaobai/biaobai",
89 | "query": "",
90 | "scene": null
91 | },
92 | {
93 | "id": -1,
94 | "name": "pages/temp/temp",
95 | "pathName": "pages/temp/temp",
96 | "query": "",
97 | "scene": null
98 | },
99 | {
100 | "id": -1,
101 | "name": "pages/work/work",
102 | "pathName": "pages/work/work",
103 | "query": "",
104 | "scene": null
105 | },
106 | {
107 | "id": -1,
108 | "name": "pages/lost/lost",
109 | "pathName": "pages/lost/lost",
110 | "query": "",
111 | "scene": null
112 | },
113 | {
114 | "id": -1,
115 | "name": "pages/xianzhi/xianzhi",
116 | "pathName": "pages/xianzhi/xianzhi",
117 | "query": "",
118 | "scene": null
119 | },
120 | {
121 | "id": -1,
122 | "name": "pages/xianzhi_send/xianzhi_send",
123 | "pathName": "pages/xianzhi_send/xianzhi_send",
124 | "query": "",
125 | "scene": null
126 | },
127 | {
128 | "id": -1,
129 | "name": "pages/lost/lost",
130 | "pathName": "pages/lost/lost",
131 | "query": "",
132 | "scene": null
133 | },
134 | {
135 | "id": -1,
136 | "name": "pages/lost/lost",
137 | "pathName": "pages/lost/lost",
138 | "query": "",
139 | "scene": null
140 | },
141 | {
142 | "id": -1,
143 | "name": "pages/xianzhi_send/xianzhi_send",
144 | "pathName": "pages/xianzhi_send/xianzhi_send",
145 | "query": "",
146 | "scene": null
147 | },
148 | {
149 | "id": -1,
150 | "name": "pages/lost/lost",
151 | "pathName": "pages/lost/lost",
152 | "query": "",
153 | "scene": null
154 | },
155 | {
156 | "id": -1,
157 | "name": "pages/send/send",
158 | "pathName": "pages/send/send",
159 | "query": "",
160 | "scene": null
161 | },
162 | {
163 | "id": -1,
164 | "name": "pages/temp/temp",
165 | "pathName": "pages/temp/temp",
166 | "query": "",
167 | "scene": null
168 | },
169 | {
170 | "id": -1,
171 | "name": "pages/send/send",
172 | "pathName": "pages/send/send",
173 | "query": "",
174 | "scene": null
175 | },
176 | {
177 | "id": -1,
178 | "name": "pages/mine/mine",
179 | "pathName": "pages/mine/mine",
180 | "query": "",
181 | "scene": null
182 | },
183 | {
184 | "id": -1,
185 | "name": "pages/biaobai/biaobai",
186 | "pathName": "pages/biaobai/biaobai",
187 | "query": "",
188 | "scene": null
189 | },
190 | {
191 | "id": -1,
192 | "name": "pages/biaobai/biaobai",
193 | "pathName": "pages/biaobai/biaobai",
194 | "query": "",
195 | "scene": null
196 | },
197 | {
198 | "id": -1,
199 | "name": "pages/mine/mine",
200 | "pathName": "pages/mine/mine",
201 | "query": "",
202 | "scene": null
203 | },
204 | {
205 | "id": -1,
206 | "name": "pages/mine/mine",
207 | "pathName": "pages/mine/mine",
208 | "query": "",
209 | "scene": null
210 | },
211 | {
212 | "id": -1,
213 | "name": "pages/mine/mine",
214 | "pathName": "pages/mine/mine",
215 | "query": "",
216 | "scene": null
217 | },
218 | {
219 | "id": -1,
220 | "name": "pages/mine/mine",
221 | "pathName": "pages/mine/mine",
222 | "query": "",
223 | "scene": null
224 | }
225 | ]
226 | }
227 | }
228 | }
--------------------------------------------------------------------------------