diff --git a/.gitignore b/.gitignore index 14ea590c816e52f41801770b5ef0be21624f726e..e0da83d2daad21c4aa0b1ac0b57e679318e78d2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +<<<<<<< HEAD # Windows [Dd]esktop.ini Thumbs.db @@ -12,3 +13,134 @@ $RECYCLE.BIN/ # Node.js node_modules/ +======= +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ +>>>>>>> a9420a8c3f14b3d74230f95a212f52534afee704 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ef8eac58ab84bc2dd557498f0d7d2221c369e00e --- /dev/null +++ b/README.md @@ -0,0 +1,146 @@ +# ChongYouSign + +**当代大学校园出行必备导航** + **——小程序《重邮指路牌》** + +一. 产品定位 + +(1) 产品定义 + +《重邮指路牌》是一个旨在为全体校园师生以及校外游客精确的地图导航并附有街景图的校园导航小程序。并且采用自制手绘彩色地图,对每一条小路都清晰明了地展现出来,方便新生快速地对整个校园有个整体的方向感。其次针对校园老生,最常去的快递点,由于时常更换,小程序实时更新地点,方便老生快速找到。以及针对店铺店主,方便店主展示其店内装修效果和最新店铺信息。最后针对游客和校外人员,能快速让其了解校园情况,轻松便捷地逛重邮。吸引更多游客从而增加校园人气。 + +关键词:校园导航 街景图 实时更新 店铺展示 游客吸引 + +(2)产品方案 + +​ 1)针对新生和校外游客人员,本产品采用了分地点类别分页面展示相应地点并且点击图片即可查看街景图以及导航功能,采用了人性化的街景图片以及位置描述信息,解决了市面上导航软件最后一步的痛点。并且增加搜索框和手绘地图让用户快速查找所需要的地点的方案。 + +​ 2)针对老生,本产品采用了将上传地点权限交给该校全体师生,审核权限交给管理员的方案,使地点可以实时更新位置信息以及街景图。 + +​ 3)针对店铺超市,本产品采用了把上传权限交给店主,审核权限交给管理员的方案,起到让其宣传自家商店以及最新信息的效果,管理员再对其进行推荐排序,让全校师生能享受更好的服务。 + + + + + +![https://img04.sogoucdn.com/app/a/100520146/edf101dd71c6e0437f44ddd80017d333](https://img04.sogoucdn.com/app/a/100520146/edf101dd71c6e0437f44ddd80017d333) + + + +二、 需求分析 + +1.用户需求 + +1)对于新入学的校园新生,对校园一无所知,最迫切的需求就是找到寝室,食堂,教学楼等地点。 + +2)对于校园老生,最迫切的需求是能够及时的找到校园更新的地点,诸如快递点,一卡通中心,学生管理中心等地点,如果发现了新的校园地点,需要及时上传地点让更多的人了解。 + +3)对于校外人员及游客,只能通过不断的问路才能找到校园地点,也无从知晓有哪些著名景点以及在何处。 + +4)对于店铺超市,由于宣传手段有限,没有一个好的平台向目标用户发布最新的店铺宣传信息,需要一个能及时向目标用户发送宣传信息的平台。 + +![https://img04.sogoucdn.com/app/a/100520146/517895a9eb189c1fea8ac38394584b13](https://img04.sogoucdn.com/app/a/100520146/517895a9eb189c1fea8ac38394584b13) + +2.系统功能需求: + +(1) 上传实时更新 + +(2) 地点分类展示 + +(3) 管理员审核,控制上传地点是否通过 + +(4) 位置推荐排序和删除替换功能 + +(5) 留言过滤 + +(6) 校园手绘地图 + +![https://img04.sogoucdn.com/app/a/100520146/a5e25b4e9e7b50db99281af34b9d3eb9](https://img04.sogoucdn.com/app/a/100520146/a5e25b4e9e7b50db99281af34b9d3eb9) + +(1)位置信息上传 + +主要上传字段有 上传的类型(必选),由用户选择制定好的几种类型,地点名称(必选),关于此位置的几张图片(必选),最后一个地点描述(必选),简单能大致说明该地点的位置方向。为了防止有用户恶意上传,需要逻辑处理。用户需要选择类型,填写完地点名称之后,才可以选择上传图片,最后只有当定位成功之后,以及所有必选字段填写完之后才可以上传。 + +针对上传图片功能,预览处理,预览图片可放大,以及限制用户上传图片的数量。用户上传成功后会预览出上传的几张图片,并且点击之后可放大。当用户上传3张图片以后,图片上传图标隐藏,当小于三张时,且又显示出来。 + +考虑服务器性能,我们对图片压缩,并且图片预览时的图片的地址是临时地址,最后点击上传时,才上传所有字段信息。 + +![https://img02.sogoucdn.com/app/a/100520146/2d3deffa22c608ef043dc00534f7b6ef](https://img02.sogoucdn.com/app/a/100520146/2d3deffa22c608ef043dc00534f7b6ef) + +![https://img02.sogoucdn.com/app/a/100520146/4ff03f7cb1e68c85b00d3de2877dca01](https://img02.sogoucdn.com/app/a/100520146/4ff03f7cb1e68c85b00d3de2877dca01) + +![https://img04.sogoucdn.com/app/a/100520146/26f6680a5131b74defe3d69c7fec89f6](https://img04.sogoucdn.com/app/a/100520146/26f6680a5131b74defe3d69c7fec89f6) + +(2)地点分类分页展示 + +从前端获取从封面加载数据库中的已审核过的数据并展示在页面上,点击图片即可进入该地点的位置详细信息以及进入导航界面。并通过制作一个动画向右滑动或点击菜单按钮获取地点的分类信息,点击某一个地点类即可进入该类所有地点,并且将管理员按钮放在右滑界面,从封面获得的openid判断是否为管理员,并由判断结果决定是否显示管理员按钮,首页当中分为图片展示界面和搜索框和上传图片界面,下方导航栏分为导航和手绘地图,点击图标会变成彩色的图标,进入手绘地图页面点击图片就会预览超清大图,实现了放大功能。导航界面使用了官方的小程序路线规划插件,使得定位更加精准,功能更加多样化。 + +![https://img02.sogoucdn.com/app/a/100520146/cad9b0f0ab7831dc5eb697fef8ce6723](https://img02.sogoucdn.com/app/a/100520146/cad9b0f0ab7831dc5eb697fef8ce6723) + +(3)管理员审核功能 +从数据库中获取未审核的地点信息,即status_l为零的地点信息,管理员查看后点击通过则通过update操作将该地点的status_l修改为1,即更改为用户可见信息,如果审核不通过为了不占用云存储资源:我们先通过当前名字得到当前记录的id,通过id找到其对应的图片json还然后通过循环它,删除其在云存储中的图片,图片删完之后,在将最初获得的json数据中对应的也删除该记录,从而前端会已经被审核的位置,通过remove()重数据库中删除东西。 + +![https://img04.sogoucdn.com/app/a/100520146/779e4cc5f58e92f32629b284b3b6291a](https://img04.sogoucdn.com/app/a/100520146/779e4cc5f58e92f32629b284b3b6291a) + +(4)位置删除替换功能 +从数据库中获取已经审核通过的地点信息,即status_l为1的位置,管理员查看后点击top则通过update操作将该地点的status_top修改为1,即为用户可在top页面见该条记录,如果该位置已经被被弃用管理员只需要点击替换,为了不占用云存储资源我们先通过当前名字得到当前记录的id,通过id找到其对应的图片json还然后通过循环它,删除其在云存储中的图片,图片删完之后,在将最初获得的json数据中对应的也删除该记录,从而前端会已经被审核的位置,通过remove()重数据库中删除东西。 + +![https://img04.sogoucdn.com/app/a/100520146/779e4cc5f58e92f32629b284b3b6291a](https://img04.sogoucdn.com/app/a/100520146/779e4cc5f58e92f32629b284b3b6291a) + +举例:参观清华的非功能需求就是根据系统的实际要求,提出了关键的三个内容:一是性能,给出具体的量化指标;二是安全性,诸如身份证敏感信息等;三是可靠性,包括停电和断网问题、游客快速进入的问题等。 + +(1) 留言过滤 + +针对每一个位置地点我们加入了留言功能,并且进行了机器过滤,过滤色情,恐怖,政治,辱骂,灌水类等信息,增加与用户的互动性。 + + + +3. 系统非功能需求 + +小程序便捷性,安全性,以及实用性。方便用户,一进小程序能直接了当找到想要去的地点,并且能精确地导航或指引至重点。小程序不获取用户任何隐私信息,包括不获取用户微信名称,微信头像,地点等信息。 + + + + + +4. 交互设计 + +《重邮指路牌》整体配色以绿色为主,浅色背景色为辅,因为绿色象征生命、安全、快速,正是在校大学生青春的表现,与我校身处南山深处,被绿色植被覆盖相匹配,也是我校校徽的主要配色。整体设计原则从产品观、用户体验、小程序规则要求和小程序开发的基础框架出发,我们的小程序大部分面向在校大学生,因此页面设计的会青春洋溢一点,从用户体验方面,优化了数据加载的动画,使其更加自然和谐,不会感到僵硬和卡顿。从实用性出发,我们的小程序方便了全校师生,节约了出行时间,更是加入了人性化的街景图以及导航功能。 + + + +![https://img03.sogoucdn.com/app/a/100520146/8e43c6ccbb05d581fc0e23134125a2aa](https://img03.sogoucdn.com/app/a/100520146/8e43c6ccbb05d581fc0e23134125a2aa) + +6.技术方案: + +![](https://img03.sogoucdn.com/app/a/100520146/78b75a43ac7bcc13805a8b988df23c9b) + +技术选型/开发环境/框架/第三方组件:采用云开发,将数据都保存在云数据库中,前端后台均采用微信官方原生架构,使用微信开发者工具开发,采用了腾讯地图路线规划插件。 + +技术难点: + +(1) 模糊搜索框算法设计:只需要搜索关键字即可弹出对应地点。 + +使用两种方法,第一种是使用文字相似度匹配算法,当搜索值与数据库中值相似性达到一定程度就返回相应数据。当第一种出现异常时,使用了二种JavaScript的数组中的indexof方法通过传入键盘键入的值作为参数,若是搜索到值,判断length是否大于0就能获取到数据库中地点对应的name,再通过name获取到每个地点对应的唯一的id就可直接跳转到该地点的导航界面。 + +(2) 突破云数据库20条查询限制:限制普通用户,使用本小程主要是进行查询,和小程序向他们展示数据,云开发时每次都能在数据库中检索前20条信息,实际运用时数据库中的记录远大于20条,我们使用了循环查询解决大于20记录的查询。为减少数据库的访问量,同时提高用户的体验感,我们在每次用户进入小程序是,就对数据库进行了查询,将满足要求的所有数据放入到一个数组中,每个页面按照每个地点的type值进行分类存入各自数组,给予了不同的全局变量。这样用户在进入到每个页面时可以直接通过全局变量得到该页的所有数据。使用全局变量的另一个好处是减少了setdata的使用。 + +(3) 动画函数复用性极低:而我们有多个页面需要用到不同的动画函数,因此我们将动画封装成一个函数放到app.js里面,将参数设置为(引用作用域,函数名称,位移量,透明度),以后可以将其制作成插件供开发者使用,这样在各个页面都能直接调用动画函数,还能将其改为不同的动画效果,减少了代码的冗杂性,增加了代码的复用性。 + +(4)微信小程序官方组件wx.previewImage预览放大图片安卓手机会有黑屏bug:需要将url格式改成https开头,并将图片压缩到2m以内,而其他格式无法满足要求,因此只有改为gif格式。 + +7. 运营和维护方案: + +(1)在新生年级群里推广并介绍给辅导员让他大力宣传。 + +(2)抓住新媒体资源,比如在校园相应公众号、微博、今日头条、抖音等等对外推广,不仅让新生更了解校园,更是一个增加校园人气的机会。 + +(3)搜索优化,将小程序推销给店铺超市店主,通过推荐排序将最佳店铺排为top1。 + +(4)用户留存就使用用户可实时上传更新方案,让小程序永不过时,每一年都将有庞大的用户基数。 + +(5)维护通过管理员审核上传地点是否为正确位置以及非敏感图片地点,使小程序更纯净。 + +(6)导航插件可能将超出个人范畴,于是我们可以让学校申请资质使用或者另做一个导航系统。 + +