From a1f9e23f6dd83e4c22e1e1ffe63f6ecf969b38b1 Mon Sep 17 00:00:00 2001 From: dong_bo0602 <358256383@qq.com> Date: Tue, 7 Jun 2022 15:43:05 +0800 Subject: [PATCH] 0607 --- .eslintrc.js | 31 + app.js | 48 + app.json | 84 + app.wxss | 4364 +++++++++++++++++++++++ images/home-on.png | Bin 0 -> 675 bytes images/home.png | Bin 0 -> 692 bytes images/law-on.png | Bin 0 -> 1961 bytes images/law.png | Bin 0 -> 2037 bytes images/my-on.png | Bin 0 -> 868 bytes images/my.png | Bin 0 -> 882 bytes images/neighbor-on.png | Bin 0 -> 848 bytes images/neighbor.png | Bin 0 -> 878 bytes pages/card/cardDetail.js | 162 + pages/card/cardDetail.json | 4 + pages/card/cardDetail.wxml | 66 + pages/card/cardDetail.wxss | 121 + pages/card/cardList.js | 71 + pages/card/cardList.json | 4 + pages/card/cardList.wxml | 6 + pages/card/cardList.wxss | 24 + pages/center/case/caseHandle.js | 402 +++ pages/center/case/caseHandle.json | 4 + pages/center/case/caseHandle.wxml | 173 + pages/center/case/caseHandle.wxss | 302 ++ pages/center/case/caseList.js | 163 + pages/center/case/caseList.json | 4 + pages/center/case/caseList.wxml | 30 + pages/center/case/caseList.wxss | 108 + pages/center/case/caseLog.js | 85 + pages/center/case/caseLog.json | 3 + pages/center/case/caseLog.wxml | 36 + pages/center/case/caseLog.wxss | 48 + pages/center/center.js | 387 ++ pages/center/center.json | 4 + pages/center/center.wxml | 107 + pages/center/center.wxss | 232 ++ pages/center/contact.js | 93 + pages/center/contact.json | 4 + pages/center/contact.wxml | 13 + pages/center/contact.wxss | 47 + pages/center/contact/contactDetail.js | 136 + pages/center/contact/contactDetail.json | 4 + pages/center/contact/contactDetail.wxml | 48 + pages/center/contact/contactDetail.wxss | 158 + pages/checkIn/checkIn.js | 96 + pages/checkIn/checkIn.json | 4 + pages/checkIn/checkIn.wxml | 21 + pages/checkIn/checkIn.wxss | 71 + pages/checkIn/checkInDetail.js | 235 ++ pages/checkIn/checkInDetail.json | 4 + pages/checkIn/checkInDetail.wxml | 92 + pages/checkIn/checkInDetail.wxss | 75 + pages/community/changeCommunity.js | 265 ++ pages/community/changeCommunity.json | 4 + pages/community/changeCommunity.wxml | 37 + pages/community/changeCommunity.wxss | 112 + pages/community/join/joinDetail.js | 204 ++ pages/community/join/joinDetail.json | 4 + pages/community/join/joinDetail.wxml | 48 + pages/community/join/joinDetail.wxss | 61 + pages/community/join/select.js | 156 + pages/community/join/select.json | 4 + pages/community/join/select.wxml | 29 + pages/community/join/select.wxss | 58 + pages/community/joinCommunity.js | 120 + pages/community/joinCommunity.json | 4 + pages/community/joinCommunity.wxml | 22 + pages/community/joinCommunity.wxss | 69 + pages/community/selectCommunity.js | 191 + pages/community/selectCommunity.json | 4 + pages/community/selectCommunity.wxml | 27 + pages/community/selectCommunity.wxss | 77 + pages/index/index.js | 345 ++ pages/index/index.json | 4 + pages/index/index.wxml | 125 + pages/index/index.wxss | 273 ++ pages/law/law.js | 66 + pages/law/law.json | 4 + pages/law/law.wxml | 1 + pages/law/law.wxss | 1 + pages/neighbor/circle/circleDetail.js | 327 ++ pages/neighbor/circle/circleDetail.json | 4 + pages/neighbor/circle/circleDetail.wxml | 62 + pages/neighbor/circle/circleDetail.wxss | 123 + pages/neighbor/circle/circleList.js | 98 + pages/neighbor/circle/circleList.json | 4 + pages/neighbor/circle/circleList.wxml | 28 + pages/neighbor/circle/circleList.wxss | 72 + pages/neighbor/circle/new.js | 244 ++ pages/neighbor/circle/new.json | 4 + pages/neighbor/circle/new.wxml | 84 + pages/neighbor/circle/new.wxss | 137 + pages/neighbor/help/helpDetail.js | 249 ++ pages/neighbor/help/helpDetail.json | 4 + pages/neighbor/help/helpDetail.wxml | 61 + pages/neighbor/help/helpDetail.wxss | 122 + pages/neighbor/help/helpList.js | 131 + pages/neighbor/help/helpList.json | 4 + pages/neighbor/help/helpList.wxml | 23 + pages/neighbor/help/helpList.wxss | 79 + pages/neighbor/help/new.js | 274 ++ pages/neighbor/help/new.json | 4 + pages/neighbor/help/new.wxml | 84 + pages/neighbor/help/new.wxss | 137 + pages/neighbor/neighbor.js | 245 ++ pages/neighbor/neighbor.json | 4 + pages/neighbor/neighbor.wxml | 77 + pages/neighbor/neighbor.wxss | 151 + pages/news/newsDetail.js | 295 ++ pages/news/newsDetail.json | 4 + pages/news/newsDetail.wxml | 45 + pages/news/newsDetail.wxss | 111 + pages/news/newsList.js | 159 + pages/news/newsList.json | 4 + pages/news/newsList.wxml | 54 + pages/news/newsList.wxss | 107 + pages/report/report.js | 634 ++++ pages/report/report.json | 4 + pages/report/report.wxml | 140 + pages/report/report.wxss | 166 + pages/serve/newsList.js | 158 + pages/serve/newsList.json | 4 + pages/serve/newsList.wxml | 51 + pages/serve/newsList.wxss | 102 + pages/serve/orgDetail.js | 77 + pages/serve/orgDetail.json | 3 + pages/serve/orgDetail.wxml | 330 ++ pages/serve/orgDetail.wxss | 145 + pages/serve/orgList.js | 89 + pages/serve/orgList.json | 4 + pages/serve/orgList.wxml | 9 + pages/serve/orgList.wxss | 37 + pages/serve/serve.js | 163 + pages/serve/serve.json | 4 + pages/serve/serve.wxml | 47 + pages/serve/serve.wxss | 216 ++ pages/serve/settle.js | 515 +++ pages/serve/settle.json | 4 + pages/serve/settle.wxml | 142 + pages/serve/settle.wxss | 120 + pages/talk/myTalk.js | 71 + pages/talk/myTalk.json | 4 + pages/talk/myTalk.wxml | 95 + pages/talk/myTalk.wxss | 98 + pages/talk/newTalk.js | 228 ++ pages/talk/newTalk.json | 4 + pages/talk/newTalk.wxml | 26 + pages/talk/newTalk.wxss | 76 + pages/talk/talk.js | 135 + pages/talk/talk.json | 4 + pages/talk/talk.wxml | 53 + pages/talk/talk.wxss | 101 + pages/talk/talkDetail.js | 331 ++ pages/talk/talkDetail.json | 4 + pages/talk/talkDetail.wxml | 66 + pages/talk/talkDetail.wxss | 137 + project.config.json | 52 + project.private.config.json | 6 + sitemap.json | 7 + utils/WSCoordinate.js | 147 + utils/api.js | 86 + utils/bmap-wx.min.js | 1 + utils/md5.js | 205 ++ utils/restAjax.js | 239 ++ utils/util.js | 67 + 165 files changed, 19511 insertions(+) create mode 100644 .eslintrc.js create mode 100644 app.js create mode 100644 app.json create mode 100644 app.wxss create mode 100644 images/home-on.png create mode 100644 images/home.png create mode 100644 images/law-on.png create mode 100644 images/law.png create mode 100644 images/my-on.png create mode 100644 images/my.png create mode 100644 images/neighbor-on.png create mode 100644 images/neighbor.png create mode 100644 pages/card/cardDetail.js create mode 100644 pages/card/cardDetail.json create mode 100644 pages/card/cardDetail.wxml create mode 100644 pages/card/cardDetail.wxss create mode 100644 pages/card/cardList.js create mode 100644 pages/card/cardList.json create mode 100644 pages/card/cardList.wxml create mode 100644 pages/card/cardList.wxss create mode 100644 pages/center/case/caseHandle.js create mode 100644 pages/center/case/caseHandle.json create mode 100644 pages/center/case/caseHandle.wxml create mode 100644 pages/center/case/caseHandle.wxss create mode 100644 pages/center/case/caseList.js create mode 100644 pages/center/case/caseList.json create mode 100644 pages/center/case/caseList.wxml create mode 100644 pages/center/case/caseList.wxss create mode 100644 pages/center/case/caseLog.js create mode 100644 pages/center/case/caseLog.json create mode 100644 pages/center/case/caseLog.wxml create mode 100644 pages/center/case/caseLog.wxss create mode 100644 pages/center/center.js create mode 100644 pages/center/center.json create mode 100644 pages/center/center.wxml create mode 100644 pages/center/center.wxss create mode 100644 pages/center/contact.js create mode 100644 pages/center/contact.json create mode 100644 pages/center/contact.wxml create mode 100644 pages/center/contact.wxss create mode 100644 pages/center/contact/contactDetail.js create mode 100644 pages/center/contact/contactDetail.json create mode 100644 pages/center/contact/contactDetail.wxml create mode 100644 pages/center/contact/contactDetail.wxss create mode 100644 pages/checkIn/checkIn.js create mode 100644 pages/checkIn/checkIn.json create mode 100644 pages/checkIn/checkIn.wxml create mode 100644 pages/checkIn/checkIn.wxss create mode 100644 pages/checkIn/checkInDetail.js create mode 100644 pages/checkIn/checkInDetail.json create mode 100644 pages/checkIn/checkInDetail.wxml create mode 100644 pages/checkIn/checkInDetail.wxss create mode 100644 pages/community/changeCommunity.js create mode 100644 pages/community/changeCommunity.json create mode 100644 pages/community/changeCommunity.wxml create mode 100644 pages/community/changeCommunity.wxss create mode 100644 pages/community/join/joinDetail.js create mode 100644 pages/community/join/joinDetail.json create mode 100644 pages/community/join/joinDetail.wxml create mode 100644 pages/community/join/joinDetail.wxss create mode 100644 pages/community/join/select.js create mode 100644 pages/community/join/select.json create mode 100644 pages/community/join/select.wxml create mode 100644 pages/community/join/select.wxss create mode 100644 pages/community/joinCommunity.js create mode 100644 pages/community/joinCommunity.json create mode 100644 pages/community/joinCommunity.wxml create mode 100644 pages/community/joinCommunity.wxss create mode 100644 pages/community/selectCommunity.js create mode 100644 pages/community/selectCommunity.json create mode 100644 pages/community/selectCommunity.wxml create mode 100644 pages/community/selectCommunity.wxss create mode 100644 pages/index/index.js create mode 100644 pages/index/index.json create mode 100644 pages/index/index.wxml create mode 100644 pages/index/index.wxss create mode 100644 pages/law/law.js create mode 100644 pages/law/law.json create mode 100644 pages/law/law.wxml create mode 100644 pages/law/law.wxss create mode 100644 pages/neighbor/circle/circleDetail.js create mode 100644 pages/neighbor/circle/circleDetail.json create mode 100644 pages/neighbor/circle/circleDetail.wxml create mode 100644 pages/neighbor/circle/circleDetail.wxss create mode 100644 pages/neighbor/circle/circleList.js create mode 100644 pages/neighbor/circle/circleList.json create mode 100644 pages/neighbor/circle/circleList.wxml create mode 100644 pages/neighbor/circle/circleList.wxss create mode 100644 pages/neighbor/circle/new.js create mode 100644 pages/neighbor/circle/new.json create mode 100644 pages/neighbor/circle/new.wxml create mode 100644 pages/neighbor/circle/new.wxss create mode 100644 pages/neighbor/help/helpDetail.js create mode 100644 pages/neighbor/help/helpDetail.json create mode 100644 pages/neighbor/help/helpDetail.wxml create mode 100644 pages/neighbor/help/helpDetail.wxss create mode 100644 pages/neighbor/help/helpList.js create mode 100644 pages/neighbor/help/helpList.json create mode 100644 pages/neighbor/help/helpList.wxml create mode 100644 pages/neighbor/help/helpList.wxss create mode 100644 pages/neighbor/help/new.js create mode 100644 pages/neighbor/help/new.json create mode 100644 pages/neighbor/help/new.wxml create mode 100644 pages/neighbor/help/new.wxss create mode 100644 pages/neighbor/neighbor.js create mode 100644 pages/neighbor/neighbor.json create mode 100644 pages/neighbor/neighbor.wxml create mode 100644 pages/neighbor/neighbor.wxss create mode 100644 pages/news/newsDetail.js create mode 100644 pages/news/newsDetail.json create mode 100644 pages/news/newsDetail.wxml create mode 100644 pages/news/newsDetail.wxss create mode 100644 pages/news/newsList.js create mode 100644 pages/news/newsList.json create mode 100644 pages/news/newsList.wxml create mode 100644 pages/news/newsList.wxss create mode 100644 pages/report/report.js create mode 100644 pages/report/report.json create mode 100644 pages/report/report.wxml create mode 100644 pages/report/report.wxss create mode 100644 pages/serve/newsList.js create mode 100644 pages/serve/newsList.json create mode 100644 pages/serve/newsList.wxml create mode 100644 pages/serve/newsList.wxss create mode 100644 pages/serve/orgDetail.js create mode 100644 pages/serve/orgDetail.json create mode 100644 pages/serve/orgDetail.wxml create mode 100644 pages/serve/orgDetail.wxss create mode 100644 pages/serve/orgList.js create mode 100644 pages/serve/orgList.json create mode 100644 pages/serve/orgList.wxml create mode 100644 pages/serve/orgList.wxss create mode 100644 pages/serve/serve.js create mode 100644 pages/serve/serve.json create mode 100644 pages/serve/serve.wxml create mode 100644 pages/serve/serve.wxss create mode 100644 pages/serve/settle.js create mode 100644 pages/serve/settle.json create mode 100644 pages/serve/settle.wxml create mode 100644 pages/serve/settle.wxss create mode 100644 pages/talk/myTalk.js create mode 100644 pages/talk/myTalk.json create mode 100644 pages/talk/myTalk.wxml create mode 100644 pages/talk/myTalk.wxss create mode 100644 pages/talk/newTalk.js create mode 100644 pages/talk/newTalk.json create mode 100644 pages/talk/newTalk.wxml create mode 100644 pages/talk/newTalk.wxss create mode 100644 pages/talk/talk.js create mode 100644 pages/talk/talk.json create mode 100644 pages/talk/talk.wxml create mode 100644 pages/talk/talk.wxss create mode 100644 pages/talk/talkDetail.js create mode 100644 pages/talk/talkDetail.json create mode 100644 pages/talk/talkDetail.wxml create mode 100644 pages/talk/talkDetail.wxss create mode 100644 project.config.json create mode 100644 project.private.config.json create mode 100644 sitemap.json create mode 100644 utils/WSCoordinate.js create mode 100644 utils/api.js create mode 100644 utils/bmap-wx.min.js create mode 100644 utils/md5.js create mode 100644 utils/restAjax.js create mode 100644 utils/util.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..115cc02 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,31 @@ +/* + * Eslint config file + * Documentation: https://eslint.org/docs/user-guide/configuring/ + * Install the Eslint extension before using this feature. + */ +module.exports = { + env: { + es6: true, + browser: true, + node: true, + }, + ecmaFeatures: { + modules: true, + }, + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + }, + globals: { + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true, + }, + // extends: 'eslint:recommended', + rules: {}, +} diff --git a/app.js b/app.js new file mode 100644 index 0000000..c2bd613 --- /dev/null +++ b/app.js @@ -0,0 +1,48 @@ +// app.js +var restAjax = require('utils/restAjax.js'); +App({ + restAjax: restAjax, + apis: restAjax.apis, + baseUrls: restAjax.baseUrl, + onLaunch() { + this.globalData.windowHeight = wx.getSystemInfoSync().windowHeight + //设置状态栏 + wx.getSystemInfo({ + success: e => { + this.globalData.StatusBar = e.statusBarHeight; + let capsule = wx.getMenuButtonBoundingClientRect(); + if (capsule) { + this.globalData.Custom = capsule; + this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight; + } else { + this.globalData.CustomBar = e.statusBarHeight + 50; + } + } + }) + + }, + + // 获取用户信息 + getUserInfo: function () { + var self = this + app.restAjax.get(app.restAjax.path('{loginUrl}app/user/get-app-user', [app.personIntroUrl]), {}, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + app.globalData.userInfo = data + }, function (code, data) { + app.dialog.msg(data.msg); + }); + }, + + globalData: { + userIcon: '', + userInfo: {}, + currentCommunity: { + communityId: '', + communityName: '切换社区' + }, + token: 'cVJWWXQ1UWpQWTQ1TDZMbEVtTmxiMlJVNkdvTzUwSTNHYzZaK3VTZmF0R1JwQUNiMkkraDdjZnR5eXgxdEpPdXY0ZG9GdzduN1FzZkNHVXpSV1hhdmJ3a3UyNWxSN2pOWDIxWW5sNEhJTG1EaUFLUmIydEdHYWxROVdvK2sxQnZuWlpRQUJhNm53TUxjb01Gd3BvOUQxWG9HV1hWUGJ2SGF4NmcraVdhM1JIZlBtaUt5T2grREIweXB5V2RUQW5FR3BUcklxM0c4TjBMNGxlUk9uZ0hMVE11TzQyMzZ5OHRNV0N0REdhbTNQb3hOK2I0TmxTalRsVmVZVnJXZTYrKw==' + } +}) \ No newline at end of file diff --git a/app.json b/app.json new file mode 100644 index 0000000..fe16258 --- /dev/null +++ b/app.json @@ -0,0 +1,84 @@ +{ + "pages":[ + "pages/index/index", + "pages/center/contact/contactDetail", + "pages/center/case/caseList", + "pages/center/case/caseLog", + "pages/center/case/caseHandle", + "pages/center/contact", + "pages/card/cardDetail", + "pages/card/cardList", + "pages/center/center", + "pages/neighbor/neighbor", + "pages/neighbor/circle/new", + "pages/neighbor/help/new", + "pages/neighbor/circle/circleList", + "pages/neighbor/circle/circleDetail", + "pages/neighbor/help/helpList", + "pages/neighbor/help/helpDetail", + "pages/law/law", + "pages/news/newsDetail", + "pages/news/newsList", + "pages/serve/orgDetail", + "pages/serve/serve", + "pages/serve/orgList", + "pages/serve/settle", + "pages/serve/newsList", + "pages/report/report", + "pages/talk/talkDetail", + "pages/talk/myTalk", + "pages/talk/talk", + "pages/talk/newTalk", + "pages/community/join/joinDetail", + "pages/community/join/select", + "pages/community/joinCommunity", + "pages/community/selectCommunity", + "pages/community/changeCommunity", + "pages/checkIn/checkInDetail", + "pages/checkIn/checkIn" + ], + "window":{ + "backgroundTextStyle":"light", + "navigationBarBackgroundColor": "#FF4949", + "navigationBarTitleText": "Weixin", + "navigationBarTextStyle":"white" + }, + "tabBar": { + "color": "#000000", + "selectedColor": "#f55054", + "borderStyle": "black", + "list": [ + { + "text": "首页", + "pagePath": "pages/index/index", + "iconPath": "images/home.png", + "selectedIconPath": "images/home-on.png" + }, + { + "text": "AI法律", + "pagePath": "pages/law/law", + "iconPath": "images/law.png", + "selectedIconPath": "images/law-on.png" + }, + { + "text": "邻里", + "pagePath": "pages/neighbor/neighbor", + "iconPath": "images/neighbor.png", + "selectedIconPath": "images/neighbor-on.png" + }, + { + "text": "我的", + "pagePath": "pages/center/center", + "iconPath": "images/my.png", + "selectedIconPath": "images/my-on.png" + } + ] +}, + "style": "v2", + "sitemapLocation": "sitemap.json", + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + } + } +} diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..06cbfbf --- /dev/null +++ b/app.wxss @@ -0,0 +1,4364 @@ +/* + ColorUi for MP-weixin v2.1.4 | by 文晓港 2019年4月25日19:15:42 + 仅供学习交流,如作它用所承受的法律责任一概与作者无关 + 使用ColorUi开发扩展与插件时,请注明基于ColorUi开发 + + (QQ交流群:240787041) +*/ + +/* ================== + 初始化 + ==================== */ + page { + /* Color 可以自定义相关配色 */ + /* var属性兼容性 --> https://www.caniuse.com/#feat=css-variables */ + /* 标准色 */ + --red: #e54d42; + --orange: #f37b1d; + --yellow: #fbbd08; + --olive: #8dc63f; + --green: #39b54a; + --cyan: #1cbbb4; + --blue: #0054bd; + --purple: #6739b6; + --mauve: #9c26b0; + --pink: #e03997; + --brown: #a5673f; + --grey: #8799a3; + --black: #333333; + --darkGray: #666666; + --gray: #aaaaaa; + --ghostWhite: #F4F4F4; + --white: #ffffff; + --depBlack: #000000; + /* 浅色 */ + --redLight: #fadbd9; + --orangeLight: #fde6d2; + --yellowLight: #E6B980; + --oliveLight: #e8f4d9; + --greenLight: #d7f0db; + --cyanLight: #d2f1f0; + --blueLight: #cce6ff; + --purpleLight: #e1d7f0; + --mauveLight: #ebd4ef; + --pinkLight: #f9d7ea; + --brownLight: #ede1d9; + --greyLight: #e7ebed; + /* 渐变色 */ + --gradualRed: linear-gradient(45deg, #f43f3b, #ec008c); + --gradualOrange: linear-gradient(45deg, #ff9700, #ed1c24); + --gradualGreen: linear-gradient(45deg, #39b54a, #8dc63f); + --gradualPurple: linear-gradient(45deg, #9000ff, #5e00ff); + --gradualPink: linear-gradient(45deg, #ec008c, #6739b6); + --gradualBlue: linear-gradient(45deg, #0081ff, #1cbbb4); + --gradualWhite: linear-gradient(45deg, #ffffff, #f8f8f8); + --gradualGray: linear-gradient(85deg, #FAF9F9, #F5F2F2); + --gradualYellow: linear-gradient(85deg, #F4DBB8, #E6B980); + /* 阴影透明色 */ + --ShadowSize: 6rpx 6rpx 8rpx; + --redShadow: rgba(204, 69, 59, 0.2); + --orangeShadow: rgba(217, 109, 26, 0.2); + --yellowShadow: rgba(224, 170, 7, 0.2); + --oliveShadow: rgba(124, 173, 55, 0.2); + --greenShadow: rgba(48, 156, 63, 0.2); + --cyanShadow: rgba(28, 187, 180, 0.2); + --blueShadow: rgba(0, 102, 204, 0.2); + --purpleShadow: rgba(88, 48, 156, 0.2); + --mauveShadow: rgba(133, 33, 150, 0.2); + --pinkShadow: rgba(199, 50, 134, 0.2); + --brownShadow: rgba(140, 88, 53, 0.2); + --greyShadow: rgba(114, 130, 138, 0.2); + --grayShadow: rgba(114, 130, 138, 0.2); + --blackShadow: rgba(26, 26, 26, 0.2); + + background-color: var(--ghostWhite); + font-size: 28rpx; + color: var(--black); + font-family: Helvetica Neue, Helvetica, sans-serif; +} + +view, +scroll-view, +swiper, +button, +input, +textarea, +label, +navigator, +image { + box-sizing: border-box; +} + +.round { + border-radius: 5000rpx; +} + +.radius { + border-radius: 6rpx; +} + +/* ================== + 图片 + ==================== */ + +image { + max-width: 100%; + display: inline-block; + position: relative; + z-index: 0; +} + +image.loading::before { + content: ""; + background-color: #f5f5f5; + display: block; + position: absolute; + width: 100%; + height: 100%; + z-index: -2; +} + +image.loading::after { + content: "\e7f1"; + font-family: "cuIcon"; + position: absolute; + top: 0; + left: 0; + width: 32rpx; + height: 32rpx; + line-height: 32rpx; + right: 0; + bottom: 0; + z-index: -1; + font-size: 32rpx; + margin: auto; + color: #ccc; + -webkit-animation: cuIcon-spin 2s infinite linear; + animation: cuIcon-spin 2s infinite linear; + display: block; +} + +.response { + width: 100%; +} + +/* ================== + 开关 + ==================== */ + +switch, +checkbox, +radio { + position: relative; +} + +switch::after, +switch::before { + font-family: "cuIcon"; + content: "\e645"; + position: absolute; + color: var(--white) !important; + top: 0%; + left: 0rpx; + font-size: 26rpx; + line-height: 26px; + width: 50%; + text-align: center; + pointer-events: none; + transform: scale(0, 0); + transition: all 0.3s ease-in-out 0s; + z-index: 9; + bottom: 0; + height: 26px; + margin: auto; +} + +switch::before { + content: "\e646"; + right: 0; + transform: scale(1, 1); + left: auto; +} + +switch[checked]::after, +switch.checked::after { + transform: scale(1, 1); +} + +switch[checked]::before, +switch.checked::before { + transform: scale(0, 0); +} + +switch[checked]::before { + transform: scale(0, 0); +} + +radio::before, +checkbox::before { + font-family: "cuIcon"; + content: "\e645"; + position: absolute; + color: var(--white) !important; + top: 50%; + margin-top: -8px; + right: 5px; + font-size: 32rpx; + line-height: 16px; + pointer-events: none; + transform: scale(1, 1); + transition: all 0.3s ease-in-out 0s; + z-index: 9; +} + +radio .wx-radio-input, +checkbox .wx-checkbox-input { + margin: 0; + width: 20px; + height: 20px; +} + +checkbox.round .wx-checkbox-input { + border-radius: 100rpx; +} + +switch .wx-switch-input { + border: none; + padding: 0 24px; + width: 48px; + height: 26px; + margin: 0; + border-radius: 100rpx; +} + +switch .wx-switch-input:not([class*="bg-"]) { + background: var(--grey) !important; +} + +switch .wx-switch-input::after { + margin: auto; + width: 26px; + height: 26px; + border-radius: 100rpx; + left: 0rpx; + top: 0rpx; + bottom: 0rpx; + position: absolute; + transform: scale(0.9, 0.9); + transition: all 0.1s ease-in-out 0s; +} + +switch .wx-switch-input.wx-switch-input-checked::after { + margin: auto; + left: 22px; + box-shadow: none; + transform: scale(0.9, 0.9); +} + +radio-group { + display: inline-block; +} + + + +switch.radius .wx-switch-input::after, +switch.radius .wx-switch-input, +switch.radius .wx-switch-input::before { + border-radius: 10rpx; +} + +switch .wx-switch-input::before, +radio.radio::before, +checkbox .wx-checkbox-input::before, +radio .wx-radio-input::before, +radio.radio::before { + display: none; +} + +radio.radio[checked]::after { + content: ""; + background-color: transparent; + display: block; + position: absolute; + width: 8px; + height: 8px; + z-index: 999; + top: 0rpx; + left: 0rpx; + right: 0; + bottom: 0; + margin: auto; + border-radius: 200rpx; + border: 8px solid var(--white) !important; +} + +.switch-sex::after { + content: "\e71c"; +} + +.switch-sex::before { + content: "\e71a"; +} + +.switch-sex .wx-switch-input { + background: var(--red) !important; + border-color: var(--red) !important; +} + +.switch-sex[checked] .wx-switch-input { + background: var(--blue) !important; + border-color: var(--blue) !important; +} + +switch.red[checked] .wx-switch-input, +checkbox.red[checked] .wx-checkbox-input, +radio.red[checked] .wx-radio-input { + border-color: var(--red) !important; +} + +switch.orange[checked] .wx-switch-input, +checkbox.orange[checked] .wx-checkbox-input, +radio.orange[checked] .wx-radio-input { + border-color: var(--orange) !important; +} + +switch.yellow[checked] .wx-switch-input, +checkbox.yellow[checked] .wx-checkbox-input, +radio.yellow[checked] .wx-radio-input { + border-color: var(--yellow) !important; +} + +switch.olive[checked] .wx-switch-input, +checkbox.olive[checked] .wx-checkbox-input, +radio.olive[checked] .wx-radio-input { + border-color: var(--olive) !important; +} + +switch.green[checked] .wx-switch-input, +checkbox.green[checked] .wx-checkbox-input, +checkbox[checked] .wx-checkbox-input, +radio.green[checked] .wx-radio-input { + border-color: var(--green) !important; +} + +switch.cyan[checked] .wx-switch-input, +checkbox.cyan[checked] .wx-checkbox-input, +radio.cyan[checked] .wx-radio-input { + border-color: var(--cyan) !important; +} + +switch.blue[checked] .wx-switch-input, +checkbox.blue[checked] .wx-checkbox-input, +radio.blue[checked] .wx-radio-input { + border-color: var(--blue) !important; +} + +switch.purple[checked] .wx-switch-input, +checkbox.purple[checked] .wx-checkbox-input, +radio.purple[checked] .wx-radio-input { + border-color: var(--purple) !important; +} + +switch.mauve[checked] .wx-switch-input, +checkbox.mauve[checked] .wx-checkbox-input, +radio.mauve[checked] .wx-radio-input { + border-color: var(--mauve) !important; +} + +switch.pink[checked] .wx-switch-input, +checkbox.pink[checked] .wx-checkbox-input, +radio.pink[checked] .wx-radio-input { + border-color: var(--pink) !important; +} + +switch.brown[checked] .wx-switch-input, +checkbox.brown[checked] .wx-checkbox-input, +radio.brown[checked] .wx-radio-input { + border-color: var(--brown) !important; +} + +switch.grey[checked] .wx-switch-input, +checkbox.grey[checked] .wx-checkbox-input, +radio.grey[checked] .wx-radio-input { + border-color: var(--grey) !important; +} + +switch.gray[checked] .wx-switch-input, +checkbox.gray[checked] .wx-checkbox-input, +radio.gray[checked] .wx-radio-input { + border-color: var(--grey) !important; +} + +switch.black[checked] .wx-switch-input, +checkbox.black[checked] .wx-checkbox-input, +radio.black[checked] .wx-radio-input { + border-color: var(--black) !important; +} + +switch.white[checked] .wx-switch-input, +checkbox.white[checked] .wx-checkbox-input, +radio.white[checked] .wx-radio-input { + border-color: var(--white) !important; +} + +switch.red[checked] .wx-switch-input.wx-switch-input-checked, +checkbox.red[checked] .wx-checkbox-input, +radio.red[checked] .wx-radio-input { + background-color: var(--red) !important; + color: var(--white) !important; +} + +switch.orange[checked] .wx-switch-input, +checkbox.orange[checked] .wx-checkbox-input, +radio.orange[checked] .wx-radio-input { + background-color: var(--orange) !important; + color: var(--white) !important; +} + +switch.yellow[checked] .wx-switch-input, +checkbox.yellow[checked] .wx-checkbox-input, +radio.yellow[checked] .wx-radio-input { + background-color: var(--yellow) !important; + color: var(--black) !important; +} + +switch.olive[checked] .wx-switch-input, +checkbox.olive[checked] .wx-checkbox-input, +radio.olive[checked] .wx-radio-input { + background-color: var(--olive) !important; + color: var(--white) !important; +} + +switch.green[checked] .wx-switch-input, +switch[checked] .wx-switch-input, +checkbox.green[checked] .wx-checkbox-input, +checkbox[checked] .wx-checkbox-input, +radio.green[checked] .wx-radio-input, +radio[checked] .wx-radio-input { + background-color: var(--green) !important; + color: var(--white) !important; +} + +switch.cyan[checked] .wx-switch-input, +checkbox.cyan[checked] .wx-checkbox-input, +radio.cyan[checked] .wx-radio-input { + background-color: var(--cyan) !important; + color: var(--white) !important; +} + +switch.blue[checked] .wx-switch-input, +checkbox.blue[checked] .wx-checkbox-input, +radio.blue[checked] .wx-radio-input { + background-color: var(--blue) !important; + color: var(--white) !important; +} + +switch.purple[checked] .wx-switch-input, +checkbox.purple[checked] .wx-checkbox-input, +radio.purple[checked] .wx-radio-input { + background-color: var(--purple) !important; + color: var(--white) !important; +} + +switch.mauve[checked] .wx-switch-input, +checkbox.mauve[checked] .wx-checkbox-input, +radio.mauve[checked] .wx-radio-input { + background-color: var(--mauve) !important; + color: var(--white) !important; +} + +switch.pink[checked] .wx-switch-input, +checkbox.pink[checked] .wx-checkbox-input, +radio.pink[checked] .wx-radio-input { + background-color: var(--pink) !important; + color: var(--white) !important; +} + +switch.brown[checked] .wx-switch-input, +checkbox.brown[checked] .wx-checkbox-input, +radio.brown[checked] .wx-radio-input { + background-color: var(--brown) !important; + color: var(--white) !important; +} + +switch.grey[checked] .wx-switch-input, +checkbox.grey[checked] .wx-checkbox-input, +radio.grey[checked] .wx-radio-input { + background-color: var(--grey) !important; + color: var(--white) !important; +} + +switch.gray[checked] .wx-switch-input, +checkbox.gray[checked] .wx-checkbox-input, +radio.gray[checked] .wx-radio-input { + background-color: #f0f0f0 !important; + color: var(--black) !important; +} + +switch.black[checked] .wx-switch-input, +checkbox.black[checked] .wx-checkbox-input, +radio.black[checked] .wx-radio-input { + background-color: var(--black) !important; + color: var(--white) !important; +} + +switch.white[checked] .wx-switch-input, +checkbox.white[checked] .wx-checkbox-input, +radio.white[checked] .wx-radio-input { + background-color: var(--white) !important; + color: var(--black) !important; +} + +/* ================== + 边框 + ==================== */ + +/* -- 实线 -- */ + +.solid, +.solid-top, +.solid-right, +.solid-bottom, +.solid-left, +.solids, +.solids-top, +.solids-right, +.solids-bottom, +.solids-left, +.dashed, +.dashed-top, +.dashed-right, +.dashed-bottom, +.dashed-left { + position: relative; +} + +.solid::after, +.solid-top::after, +.solid-right::after, +.solid-bottom::after, +.solid-left::after, +.solids::after, +.solids-top::after, +.solids-right::after, +.solids-bottom::after, +.solids-left::after, +.dashed::after, +.dashed-top::after, +.dashed-right::after, +.dashed-bottom::after, +.dashed-left::after { + content: " "; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + border-radius: inherit; + transform: scale(0.5); + transform-origin: 0 0; + pointer-events: none; + box-sizing: border-box; +} + +.solid::after { + border: 1rpx solid rgba(0, 0, 0, 0.1); +} + +.solid-top::after { + border-top: 1rpx solid rgba(0, 0, 0, 0.1); +} + +.solid-right::after { + border-right: 1rpx solid rgba(0, 0, 0, 0.1); +} + +.solid-bottom::after { + border-bottom: 1rpx solid rgba(0, 0, 0, 0.1); +} + +.solid-left::after { + border-left: 1rpx solid rgba(0, 0, 0, 0.1); +} + +.solids::after { + border: 8rpx solid #eee; +} + +.solids-top::after { + border-top: 8rpx solid #eee; +} + +.solids-right::after { + border-right: 8rpx solid #eee; +} + +.solids-bottom::after { + border-bottom: 8rpx solid #eee; +} + +.solids-left::after { + border-left: 8rpx solid #eee; +} + +/* -- 虚线 -- */ + +.dashed::after { + border: 1rpx dashed #ddd; +} + +.dashed-top::after { + border-top: 1rpx dashed #ddd; +} + +.dashed-right::after { + border-right: 1rpx dashed #ddd; +} + +.dashed-bottom::after { + border-bottom: 1rpx dashed #ddd; +} + +.dashed-left::after { + border-left: 1rpx dashed #ddd; +} + +/* -- 阴影 -- */ + +.shadow[class*='white'] { + --ShadowSize: 0 1rpx 6rpx; +} + +.shadow-lg { + --ShadowSize: 0rpx 40rpx 100rpx 0rpx; +} + +.shadow-warp { + position: relative; + box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1); +} + +.shadow-warp:before, +.shadow-warp:after { + position: absolute; + content: ""; + top: 20rpx; + bottom: 30rpx; + left: 20rpx; + width: 50%; + box-shadow: 0 30rpx 20rpx rgba(0, 0, 0, 0.2); + transform: rotate(-3deg); + z-index: -1; +} + +.shadow-warp:after { + right: 20rpx; + left: auto; + transform: rotate(3deg); +} + +.shadow-blur { + position: relative; +} + +.shadow-blur::before { + content: ""; + display: block; + background: inherit; + filter: blur(10rpx); + position: absolute; + width: 100%; + height: 100%; + top: 10rpx; + left: 10rpx; + z-index: -1; + opacity: 0.4; + transform-origin: 0 0; + border-radius: inherit; + transform: scale(1, 1); +} + +/* ================== + 按钮 + ==================== */ + +.cu-btn { + position: relative; + border: 0rpx; + display: inline-flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + padding: 20rpx 30rpx; + font-size: 28rpx; + height: 90rpx; + line-height: 1; + text-align: center; + text-decoration: none; + overflow: visible; + margin-left: initial; + transform: translate(0rpx, 0rpx); + margin-right: initial; +} + +.cu-btn::after { + display: none; + background-color: #f5f5f5; +} + +.cu-btn:active { + background-color: #f5f5f5; + color: black; +} + +.cu-btn:focus { + background-color: #f5f5f5; + color: black; +} + +.cu-btn:not([class*="bg-"]) { + background-color: #f0f0f0; +} + +.cu-btn[class*="line"] { + background-color: transparent; +} + +.cu-btn[class*="line"]::after { + content: " "; + display: block; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + border: 1rpx solid currentColor; + transform: scale(0.5); + transform-origin: 0 0; + box-sizing: border-box; + border-radius: 12rpx; + z-index: 1; + pointer-events: none; +} + +.cu-btn.foot { + position: fixed; + width: 100%; + bottom: 0; + z-index: 1024; + box-shadow: 0 -1rpx 6rpx rgba(0, 0, 0, 0.1); +} + +.foot { + position: fixed; + width: 100%; + bottom: 0; + z-index: 10; +} + +.cu-btn.round[class*="line"]::after { + border-radius: 1000rpx; +} + +.cu-btn.radius[class*="line"]::after { + border-radius: 10rpx +} + +.cu-btn[class*="lines"]::after { + border: 6rpx solid currentColor; +} + +.cu-btn[class*="bg-"]::after { + display: none; +} + +.cu-btn.sm { + padding: 0 20rpx; + font-size: 20rpx; + height: 48rpx; +} + +.cu-btn.lg { + padding: 0 40rpx; + font-size: 32rpx; + height: 80rpx; +} + +.cu-btn.icon.sm { + width: 48rpx; + height: 48rpx; +} + +.cu-btn.icon { + width: 64rpx; + height: 64rpx; + border-radius: 500rpx; + padding: 0; +} + +button.icon.lg { + width: 80rpx; + height: 80rpx; +} +.image-32 { + width: 64rpx; + height: 64rpx; + } + + .image-64 { + width: 128rpx; + height: 128rpx; + } +.cu-btn.shadow-blur::before { + top: 4rpx; + left: 4rpx; + filter: blur(6rpx); + opacity: 0.6; +} + +.cu-btn.button-hover { + transform: translate(1rpx, 1rpx); +} + +.block { + display: block; +} + +.cu-btn.block { + display: flex; +} + +.cu-btn[disabled] { + opacity: 0.6; + color: var(--white); +} + +/* ================== + 徽章 + ==================== */ + +.cu-tag { + vertical-align: middle; + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + padding: 0rpx 16rpx; + height: 48rpx; + font-family: Helvetica Neue, Helvetica, sans-serif; + white-space: nowrap; +} + +.cu-tag:not([class*="bg"]):not([class*="line"]) { + background-color: var(--ghostWhite); +} + +.cu-tag[class*="line-"]::after { + content: " "; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + border: 1rpx solid currentColor; + transform: scale(0.5); + transform-origin: 0 0; + box-sizing: border-box; + border-radius: inherit; + z-index: 1; + pointer-events: none; +} + +.cu-tag.radius[class*="line"]::after { + border-radius: 12rpx; +} + +.cu-tag.round[class*="line"]::after { + border-radius: 1000rpx; +} + +.cu-tag[class*="line-"]::after { + border-radius: 0; +} + +.cu-tag+.cu-tag { + margin-left: 10rpx; +} + +.cu-tag.sm { + font-size: 20rpx; + padding: 0rpx 12rpx; + height: 32rpx; +} + +.cu-tag.lg { + font-size: 24rpx; + padding: 0rpx 12rpx; + height: 20px; +} + +.cu-capsule { + display: inline-flex; + vertical-align: middle; +} + +.cu-capsule+.cu-capsule { + /* margin-left: 10rpx; */ + margin-left: 0rpx; +} + +.cu-capsule .cu-tag { + margin: 0; +} + +.cu-capsule .cu-tag[class*="line-"]:last-child::after { + border-left: 0rpx solid transparent; +} + +.cu-capsule .cu-tag[class*="line-"]:first-child::after { + border-right: 0rpx solid transparent; +} + +.cu-capsule.radius .cu-tag:first-child { + border-top-left-radius: 6rpx; + border-bottom-left-radius: 6rpx; +} + +.cu-capsule.radius .cu-tag:last-child::after, +.cu-capsule.radius .cu-tag[class*="line-"] { + border-top-right-radius: 12rpx; + border-bottom-right-radius: 12rpx; +} + +.cu-capsule.round .cu-tag:first-child { + border-top-left-radius: 200rpx; + border-bottom-left-radius: 200rpx; + text-indent: 4rpx; +} + +.cu-capsule.round .cu-tag:last-child::after, +.cu-capsule.round .cu-tag:last-child { + border-top-right-radius: 200rpx; + border-bottom-right-radius: 200rpx; + text-indent: -4rpx; +} + +.cu-tag.badge { + border-radius: 200rpx; + position: absolute; + top: -10rpx; + right: -10rpx; + font-size: 20rpx; + padding: 0rpx 10rpx; + height: 28rpx; + color: var(--white); +} + +.cu-tag.badge:not([class*="bg-"]) { + background-color: #dd514c; +} + +.cu-tag.badgegray { + border-radius: 200rpx; + position: absolute; + top: -10rpx; + right: -10rpx; + font-size: 20rpx; + padding: 0rpx 10rpx; + height: 28rpx; + color: var(--white); +} + +.cu-tag.badgegray:not([class*="bg-"]) { + background-color: #555; +} + +.cu-tag:empty:not([class*="cuIcon-"]) { + padding: 0rpx; + width: 16rpx; + height: 16rpx; + top: -4rpx; + right: -4rpx; +} + +.cu-tag[class*="cuIcon-"] { + width: 32rpx; + height: 32rpx; + top: -4rpx; + right: -4rpx; +} + +/* ================== + 头像 + ==================== */ + +.cu-avatar { + font-variant: small-caps; + margin: 0; + padding: 0; + display: inline-flex; + text-align: center; + justify-content: center; + align-items: center; + background-color: #ccc; + color: var(--white); + white-space: nowrap; + position: relative; + width: 64rpx; + height: 64rpx; + background-size: cover; + background-position: center; + vertical-align: middle; + font-size: 1.5em; +} + +.cu-avatar.sm { + width: 48rpx; + height: 48rpx; + font-size: 1em; +} + +.cu-avatar.lg { + width: 96rpx; + height: 96rpx; + font-size: 2em; +} + +.cu-avatar.xl { + width: 128rpx; + height: 128rpx; + font-size: 2.5em; +} + +.cu-avatar .avatar-text { + font-size: 0.4em; +} + +.cu-avatar-group { + direction: rtl; + unicode-bidi: bidi-override; + padding: 0 10rpx 0 40rpx; + display: inline-block; +} + +.cu-avatar-group .cu-avatar { + margin-left: -30rpx; + border: 4rpx solid var(--ghostWhite); + vertical-align: middle; +} + +.cu-avatar-group .cu-avatar.sm { + margin-left: -20rpx; + border: 1rpx solid var(--ghostWhite); +} + +/* ================== + 进度条 + ==================== */ + +.cu-progress { + overflow: hidden; + height: 28rpx; + background-color: #ebeef5; + display: inline-flex; + align-items: center; + width: 100%; +} + +.cu-progress+view, +.cu-progress+text { + line-height: 1; +} + +.cu-progress.xs { + height: 10rpx; +} + +.cu-progress.sm { + height: 20rpx; +} + +.cu-progress view { + width: 0; + height: 100%; + align-items: center; + display: flex; + justify-items: flex-end; + justify-content: space-around; + font-size: 20rpx; + color: var(--white); + transition: width 0.6s ease; +} + +.cu-progress text { + align-items: center; + display: flex; + font-size: 20rpx; + color: var(--black); + text-indent: 10rpx; +} + +.cu-progress.text-progress { + padding-right: 60rpx; +} + +.cu-progress.striped view { + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-size: 72rpx 72rpx; +} + +.cu-progress.active view { + animation: progress-stripes 2s linear infinite; +} + +@keyframes progress-stripes { + from { + background-position: 72rpx 0; + } + + to { + background-position: 0 0; + } +} + +/* ================== + 加载 + ==================== */ + +.cu-load { + display: block; + line-height: 3em; + text-align: center; +} + +.cu-load::before { + font-family: "cuIcon"; + display: inline-block; + margin-right: 6rpx; +} + +.cu-load.loading::before { + content: "\e67a"; + animation: cuIcon-spin 2s infinite linear; +} + +.cu-load.loading::after { + content: "加载中..."; +} + +.cu-load.over::before { + content: "\e64a"; +} + +.cu-load.over::after { + content: "没有更多了"; +} + +.cu-load.erro::before { + content: "\e658"; +} + +.cu-load.erro::after { + content: "加载失败"; +} + +.cu-load.load-icon::before { + font-size: 32rpx; +} + +.cu-load.load-icon::after { + display: none; +} + +.cu-load.load-icon.over { + display: none; +} + +.cu-load.load-modal { + position: fixed; + top: 0; + right: 0; + bottom: 140rpx; + left: 0; + margin: auto; + width: 260rpx; + height: 260rpx; + background-color: var(--white); + border-radius: 10rpx; + box-shadow: 0 0 0rpx 2000rpx rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + flex-direction: column; + justify-content: center; + font-size: 28rpx; + z-index: 9999; + line-height: 2.4em; +} + +.cu-load.load-modal [class*="cuIcon-"] { + font-size: 60rpx; +} + +.cu-load.load-modal image { + width: 70rpx; + height: 70rpx; +} + +.cu-load.load-modal::after { + content: ""; + position: absolute; + background-color: var(--white); + border-radius: 50%; + width: 200rpx; + height: 200rpx; + font-size: 10px; + border-top: 6rpx solid rgba(0, 0, 0, 0.05); + border-right: 6rpx solid rgba(0, 0, 0, 0.05); + border-bottom: 6rpx solid rgba(0, 0, 0, 0.05); + border-left: 6rpx solid var(--orange); + animation: cuIcon-spin 1s infinite linear; + z-index: -1; +} + +.load-progress { + pointer-events: none; + top: 0; + position: fixed; + width: 100%; + left: 0; + z-index: 2000; +} + +.load-progress.hide { + display: none; +} + +.load-progress .load-progress-bar { + position: relative; + width: 100%; + height: 4rpx; + overflow: hidden; + transition: all 200ms ease 0s; +} + +.load-progress .load-progress-spinner { + position: absolute; + top: 10rpx; + right: 10rpx; + z-index: 2000; + display: block; +} + +.load-progress .load-progress-spinner::after { + content: ""; + display: block; + width: 24rpx; + height: 24rpx; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border: solid 4rpx transparent; + border-top-color: inherit; + border-left-color: inherit; + border-radius: 50%; + -webkit-animation: load-progress-spinner 0.4s linear infinite; + animation: load-progress-spinner 0.4s linear infinite; +} + +@-webkit-keyframes load-progress-spinner { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes load-progress-spinner { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +/* ================== + 列表 + ==================== */ +.grayscale { + filter: grayscale(1); +} + +.cu-list+.cu-list { + margin-top: 30rpx +} + +.cu-list>.cu-item { + transition: all .6s ease-in-out 0s; + transform: translateX(0rpx) +} + +.cu-list>.cu-item.move-cur { + transform: translateX(-260rpx) +} + +.cu-list>.cu-item .move { + position: absolute; + right: 0; + display: flex; + width: 260rpx; + height: 100%; + transform: translateX(100%) +} + +.cu-list>.cu-item .move view { + display: flex; + flex: 1; + justify-content: center; + align-items: center +} + +.cu-list.menu-avatar { + overflow: hidden; +} + +.cu-list.menu-avatar>.cu-item { + position: relative; + display: flex; + padding-right: 10rpx; + height: 160rpx; + background-color: var(--white); + justify-content: flex-end; + align-items: center +} + +.cu-list.menu-avatar>.cu-item>.cu-avatar { + position: absolute; + left: 30rpx +} + +.cu-list.menu-avatar>.cu-item .flex .text-cut { + max-width: 510rpx +} + +.cu-list.menu-avatar>.cu-item .content { + position: absolute; + left: 165rpx; + width: calc(100% - 96rpx - 60rpx - 120rpx - 20rpx); + line-height: 1.6em; +} + +.cu-list.menu-avatar>.cu-item .content.flex-sub { + width: calc(100% - 96rpx - 60rpx - 20rpx); +} + +.cu-list.menu-avatar>.cu-item .content>view:first-child { + font-size: 30rpx; + display: flex; + align-items: center +} + +.cu-list.menu-avatar>.cu-item .content .cu-tag.sm { + display: inline-block; + margin-left: 10rpx; + height: 28rpx; + font-size: 16rpx; + line-height: 32rpx +} + +.cu-list.menu-avatar>.cu-item .action { + width: 120rpx; + text-align: center +} + +.cu-list.menu-avatar>.cu-item .action view+view { + margin-top: 10rpx +} + +.cu-list.menu-avatar.comment>.cu-item .content { + position: relative; + left: 0; + width: auto; + flex: 1; +} + +.cu-list.menu-avatar.comment>.cu-item { + padding: 30rpx 30rpx 30rpx 120rpx; + height: auto +} + +.cu-list.menu-avatar.comment .cu-avatar { + align-self: flex-start +} + +.cu-list.menu>.cu-item { + position: relative; + display: flex; + padding: 0 30rpx; + min-height: 100rpx; + background-color: var(--white); + justify-content: space-between; + align-items: center +} + +.cu-list.menu>.cu-item:last-child:after { + border: none +} + +.border-line { + border: 1rpx solid #ddd; + border-radius: 10rpx; +} + +.cu-list.menu>.cu-item:after { + position: absolute; + top: 0; + left: 0; + box-sizing: border-box; + width: 200%; + height: 200%; + border-bottom: 1rpx solid #ddd; + border-radius: inherit; + content: " "; + transform: scale(.5); + transform-origin: 0 0; + pointer-events: none +} + +.cu-list.menu>.cu-item.grayscale { + background-color: #f5f5f5 +} + +.cu-list.menu>.cu-item.cur { + background-color: #fcf7e9 +} + +.cu-list.menu>.cu-item.arrow { + padding-right: 90rpx +} + +.cu-list.menu>.cu-item.arrow:before { + position: absolute; + top: 0; + right: 30rpx; + bottom: 0; + display: block; + margin: auto; + width: 30rpx; + height: 30rpx; + color: var(--grey); + content: "\e6a3"; + text-align: center; + font-size: 34rpx; + font-family: "cuIcon"; + line-height: 30rpx +} + +.cu-list.menu>.cu-item button.content { + padding: 0; + background-color: transparent; + justify-content: flex-start +} + +.cu-list.menu>.cu-item button.content:after { + display: none +} + +.cu-list.menu>.cu-item .cu-avatar-group .cu-avatar { + border-color: var(--white) +} + +.cu-list.menu>.cu-item .content>view:first-child { + display: flex; + align-items: center +} + +.cu-list.menu>.cu-item .content>text[class*=cuIcon] { + display: inline-block; + margin-right: 10rpx; + width: 1.6em; + text-align: center +} + +.cu-list.menu>.cu-item .content>image { + display: inline-block; + margin-right: 10rpx; + width: 1.6em; + height: 1.6em; + vertical-align: middle +} + +.cu-list.menu>.cu-item .content { + font-size: 30rpx; + line-height: 1.6em; + flex: 1 +} + +.cu-list.menu>.cu-item .content .cu-tag.sm { + display: inline-block; + margin-left: 10rpx; + height: 28rpx; + font-size: 16rpx; + line-height: 32rpx +} + +.cu-list.menu>.cu-item .action .cu-tag:empty { + right: 10rpx +} + +.cu-list.menu { + display: block; + overflow: hidden +} + +.cu-list.menu.sm-border>.cu-item:after { + left: 30rpx; + width: calc(200% - 120rpx) +} + +.cu-list.grid>.cu-item { + position: relative; + display: flex; + padding: 20rpx 0 30rpx; + transition-duration: 0s; + flex-direction: column +} + +.cu-list.grid>.cu-item:after { + position: absolute; + top: 0; + left: 0; + box-sizing: border-box; + width: 200%; + height: 200%; + border-right: 1px solid rgba(0, 0, 0, .1); + border-bottom: 1px solid rgba(0, 0, 0, .1); + border-radius: inherit; + content: " "; + transform: scale(.5); + transform-origin: 0 0; + pointer-events: none +} + +.cu-list.grid>.cu-item text { + display: block; + margin-top: 10rpx; + color: #888; + font-size: 26rpx; + line-height: 40rpx +} + +.cu-list.grid>.cu-item [class*=cuIcon] { + position: relative; + display: block; + margin-top: 20rpx; + width: 100%; + font-size: 48rpx +} + +.cu-list.grid>.cu-item .cu-tag { + right: auto; + left: 50%; + margin-left: 20rpx +} + +.cu-list.grid { + background-color: var(--white); + text-align: center +} + +.cu-list.grid.no-border>.cu-item { + padding-top: 10rpx; + padding-bottom: 20rpx +} + +.cu-list.grid.no-border>.cu-item:after { + border: none +} + +.cu-list.grid.no-border { + padding: 0rpx 20rpx +} + +.cu-list.grid.col-3>.cu-item:nth-child(3n):after, +.cu-list.grid.col-4>.cu-item:nth-child(4n):after, +.cu-list.grid.col-5>.cu-item:nth-child(5n):after { + border-right-width: 0 +} + +.cu-list.card-menu { + overflow: hidden; + margin-right: 30rpx; + margin-left: 30rpx; + border-radius: 20rpx +} + + +/* ================== + 操作条 + ==================== */ + +.cu-bar { + display: flex; + position: relative; + align-items: center; + min-height: 60rpx; + justify-content: space-between; +} + +.cu-bar .action { + display: flex; + align-items: center; + height: 100%; + justify-content: center; + max-width: 100%; +} + +.cu-bar .action.border-title { + position: relative; + top: -10rpx; +} + +.cu-bar .action.border-title text[class*="bg-"]:last-child { + position: absolute; + bottom: -0.5rem; + min-width: 2rem; + height: 6rpx; + left: 0; +} + +.cu-bar .action.sub-title { + position: relative; + top: -0.2rem; +} + +.cu-bar .action.sub-title text { + position: relative; + z-index: 1; +} + +.cu-bar .action.sub-title text[class*="bg-"]:last-child { + position: absolute; + display: inline-block; + bottom: -0.2rem; + border-radius: 6rpx; + width: 100%; + height: 0.6rem; + left: 0.6rem; + opacity: 0.3; + z-index: 0; +} + +.cu-bar .action.sub-title text[class*="text-"]:last-child { + position: absolute; + display: inline-block; + bottom: -0.7rem; + left: 0.5rem; + opacity: 0.2; + z-index: 0; + text-align: right; + font-weight: 900; + font-size: 36rpx; +} + +.cu-bar.justify-center .action.border-title text:last-child, +.cu-bar.justify-center .action.sub-title text:last-child { + left: 0; + right: 0; + margin: auto; + text-align: center; +} + +.cu-bar .action:first-child { + margin-left: 20rpx; + font-size: 30rpx; +} + +.cu-bar .action text.text-cut { + text-align: left; + width: 100%; +} + +.cu-bar .cu-avatar:first-child { + margin-left: 20rpx; +} + +.cu-bar .action:first-child>text[class*="cuIcon-"] { + margin-left: -0.3em; + margin-right: 0.3em; +} + +.cu-bar .action:last-child { + margin-right: 30rpx; +} + +.cu-bar .action>text[class*="cuIcon-"], +.cu-bar .action>view[class*="cuIcon-"] { + font-size: 36rpx; +} + +.cu-bar .action>text[class*="cuIcon-"]+text[class*="cuIcon-"] { + margin-left: 0.5em; +} + +.cu-bar .content { + position: absolute; + text-align: center; + width: calc(100% - 340rpx); + left: 0; + right: 0; + bottom: 0; + top: 0; + margin: auto; + height: 60rpx; + font-size: 32rpx; + line-height: 60rpx; + cursor: none; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} + +.cu-bar.ios .content { + bottom: 7px; + height: 30px; + font-size: 32rpx; + line-height: 30px; +} + +.cu-bar.btn-group { + justify-content: space-around; +} + +.cu-bar.btn-group button { + padding: 20rpx 32rpx; +} + +.cu-bar.btn-group button { + flex: 1; + margin: 0 20rpx; + max-width: 50%; +} + +.cu-bar .search-form { + background-color: #f5f5f5; + line-height: 64rpx; + height: 64rpx; + font-size: 24rpx; + color: var(--black); + flex: 1; + display: flex; + align-items: center; + margin: 0 30rpx; +} + +.cu-bar .search-form+.action { + margin-right: 30rpx; +} + +.cu-bar .search-form input { + flex: 1; + padding-right: 30rpx; + height: 64rpx; + line-height: 64rpx; + font-size: 26rpx; + background-color: transparent; +} + +.cu-bar .search-form [class*="cuIcon-"] { + margin: 0 0.5em 0 0.8em; +} + +.cu-bar .search-form [class*="cuIcon-"]::before { + top: 0rpx; +} + +.cu-bar.fixed, +.nav.fixed { + position: fixed; + width: 100%; + top: 0; + z-index: 1024; + box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.1); +} + +.cu-bar.foot { + position: fixed; + width: 100%; + bottom: 0; + z-index: 1024; + box-shadow: 0 -1rpx 6rpx rgba(0, 0, 0, 0.1); +} + +.cu-bar.tabbar { + padding: 0; + height: calc(100rpx + env(safe-area-inset-bottom) / 2); + padding-bottom: calc(env(safe-area-inset-bottom) / 2); +} + +.cu-tabbar-height { + min-height: 100rpx; + height: calc(100rpx + env(safe-area-inset-bottom) / 2); +} + +.cu-bar.tabbar.shadow { + box-shadow: 0 -1rpx 6rpx rgba(0, 0, 0, 0.1); +} + +.cu-bar.tabbar .action { + font-size: 22rpx; + position: relative; + flex: 1; + text-align: center; + padding: 0; + display: block; + height: auto; + line-height: 1; + margin: 0; + overflow: initial; +} + +.cu-bar.tabbar.shop .action { + width: 140rpx; + flex: initial; +} + +.cu-bar.tabbar .action.add-action { + position: relative; + z-index: 2; + padding-top: 50rpx; + background-color: inherit; +} + +.cu-bar.tabbar .action.add-action [class*="cuIcon-"] { + position: absolute; + width: 70rpx; + z-index: 2; + height: 70rpx; + border-radius: 50%; + line-height: 70rpx; + font-size: 50rpx; + top: -35rpx; + left: 0; + right: 0; + margin: auto; + padding: 0; +} + +.cu-bar.tabbar .action.add-action::after { + content: ""; + position: absolute; + width: 100rpx; + height: 100rpx; + top: -50rpx; + left: 0; + right: 0; + margin: auto; + box-shadow: 0 -3rpx 8rpx rgba(0, 0, 0, 0.08); + border-radius: 50rpx; + background-color: inherit; + z-index: 0; +} + +.cu-bar.tabbar .action.add-action::before { + content: ""; + position: absolute; + width: 100rpx; + height: 30rpx; + bottom: 30rpx; + left: 0; + right: 0; + margin: auto; + background-color: inherit; + z-index: 1; +} + +.cu-bar.tabbar .btn-group { + flex: 1; + display: flex; + justify-content: space-around; + align-items: center; + padding: 0 10rpx; +} + +.cu-bar.tabbar button.action::after { + border: 0; +} + +.cu-bar.tabbar .action [class*="cuIcon-"] { + width: 100rpx; + position: relative; + display: block; + height: auto; + margin: 0 auto 10rpx; + text-align: center; + font-size: 40rpx; +} + +.cu-bar.tabbar .action .cuIcon-cu-image { + margin: 0 auto; +} + +.cu-bar.tabbar .action .cuIcon-cu-image image { + width: 50rpx; + height: 50rpx; + display: inline-block; +} + +.cu-bar.tabbar .submit { + align-items: center; + display: flex; + justify-content: center; + text-align: center; + position: relative; + flex: 2; + align-self: stretch; +} + +.cu-bar.tabbar .submit:last-child { + flex: 2.6; +} + +.cu-bar.tabbar .submit+.submit { + flex: 2; +} + +.cu-bar.tabbar.border .action::before { + content: " "; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + transform: scale(0.5); + transform-origin: 0 0; + border-right: 1rpx solid rgba(0, 0, 0, 0.1); + z-index: 3; +} + +.cu-bar.tabbar.border .action:last-child:before { + display: none; +} + +.cu-bar.input { + padding-right: 20rpx; + background-color: var(--white); +} + +.cu-bar.input input { + overflow: initial; + line-height: 64rpx; + height: 64rpx; + min-height: 64rpx; + flex: 1; + font-size: 30rpx; + margin: 0 20rpx; +} + +.cu-bar.input .action { + margin-left: 20rpx; +} + +.cu-bar.input .action [class*="cuIcon-"] { + font-size: 48rpx; +} + +.cu-bar.input input+.action { + margin-right: 20rpx; + margin-left: 0rpx; +} + +.cu-bar.input .action:first-child [class*="cuIcon-"] { + margin-left: 0rpx; +} + +.cu-custom { + display: block; + position: relative; +} + +.cu-custom .cu-bar .content { + width: calc(100% - 440rpx); +} + + +.cu-custom .cu-bar .content image { + height: 60rpx; + width: 240rpx; +} + +.cu-custom .cu-bar { + min-height: 0px; + padding-right: 220rpx; + box-shadow: 0rpx 0rpx 0rpx; + z-index: 9999; +} + +.cu-custom .cu-bar .border-custom { + position: relative; + background: rgba(0, 0, 0, 0.15); + border-radius: 1000rpx; + height: 30px; +} + +.cu-custom .cu-bar .border-custom::after { + content: " "; + width: 200%; + height: 200%; + position: absolute; + top: 0; + left: 0; + border-radius: inherit; + transform: scale(0.5); + transform-origin: 0 0; + pointer-events: none; + box-sizing: border-box; + border: 1rpx solid var(--white); + opacity: 0.5; +} + +.cu-custom .cu-bar .border-custom::before { + content: " "; + width: 1rpx; + height: 110%; + position: absolute; + top: 22.5%; + left: 0; + right: 0; + margin: auto; + transform: scale(0.5); + transform-origin: 0 0; + pointer-events: none; + box-sizing: border-box; + opacity: 0.6; + background-color: var(--white); +} + +.cu-custom .cu-bar .border-custom text { + display: block; + flex: 1; + margin: auto !important; + text-align: center; + font-size: 34rpx; +} + +/* ================== + 导航栏 + ==================== */ + +.nav { + white-space: nowrap; +} + +::-webkit-scrollbar { + display: none; +} + +.nav .cu-item { + height: 90rpx; + display: inline-block; + line-height: 90rpx; + margin: 0 10rpx; + padding: 0 20rpx; +} + +.nav .cu-item.cur { + border-bottom: 4rpx solid; +} + +/* ================== + 时间轴 + ==================== */ + +.cu-timeline { + display: block; + background-color: var(--white); +} + +.cu-timeline .cu-time { + width: 120rpx; + text-align: center; + padding: 20rpx 0; + font-size: 26rpx; + color: #888; + display: block; +} + +.cu-timeline>.cu-item { + padding: 30rpx 30rpx 30rpx 120rpx; + position: relative; + display: block; + z-index: 0; +} + +.cu-timeline>.cu-item:not([class*="text-"]) { + color: #ccc; +} + +.cu-timeline>.cu-item::after { + content: ""; + display: block; + position: absolute; + width: 1rpx; + background-color: #ddd; + left: 60rpx; + height: 100%; + top: 0; + z-index: 8; +} + +.cu-timeline>.cu-item::before { + font-family: "cuIcon"; + display: block; + position: absolute; + top: 36rpx; + z-index: 9; + background-color: var(--white); + width: 50rpx; + height: 50rpx; + text-align: center; + border: none; + line-height: 50rpx; + left: 36rpx; +} + +.cu-timeline>.cu-item:not([class*="cuIcon-"])::before { + content: "\e763"; +} + +.cu-timeline>.cu-item[class*="cuIcon-"]::before { + background-color: var(--white); + width: 50rpx; + height: 50rpx; + text-align: center; + border: none; + line-height: 50rpx; + left: 36rpx; +} + +.cu-timeline>.cu-item>.content { + padding: 30rpx; + border-radius: 6rpx; + display: block; + line-height: 1.6; +} + +.cu-timeline>.cu-item>.content:not([class*="bg-"]) { + background-color: var(--ghostWhite); + color: var(--black); +} + +.cu-timeline>.cu-item>.content+.content { + margin-top: 20rpx; +} + +/* ================== + 聊天 + ==================== */ + +.cu-chat { + display: flex; + flex-direction: column; +} + +.cu-chat .cu-item { + display: flex; + padding: 30rpx 30rpx 70rpx; + position: relative; +} + +.cu-chat .cu-item>.cu-avatar { + width: 80rpx; + height: 80rpx; +} + +.cu-chat .cu-item>.main { + max-width: calc(100% - 260rpx); + margin: 0 40rpx; + display: flex; + align-items: center; +} + +.cu-chat .cu-item>image { + height: 320rpx; +} + +.cu-chat .cu-item>.main .content { + padding: 20rpx; + border-radius: 6rpx; + display: inline-flex; + max-width: 100%; + align-items: center; + font-size: 30rpx; + position: relative; + min-height: 80rpx; + line-height: 40rpx; + text-align: left; +} + +.cu-chat .cu-item>.main .content:not([class*="bg-"]) { + background-color: var(--white); + color: var(--black); +} + +.cu-chat .cu-item .date { + position: absolute; + font-size: 24rpx; + color: var(--grey); + width: calc(100% - 320rpx); + bottom: 20rpx; + left: 160rpx; +} + +.cu-chat .cu-item .action { + padding: 0 30rpx; + display: flex; + align-items: center; +} + +.cu-chat .cu-item>.main .content::after { + content: ""; + top: 27rpx; + transform: rotate(45deg); + position: absolute; + z-index: 100; + display: inline-block; + overflow: hidden; + width: 24rpx; + height: 24rpx; + left: -12rpx; + right: initial; + background-color: inherit; +} + +.cu-chat .cu-item.self>.main .content::after { + left: auto; + right: -12rpx; +} + +.cu-chat .cu-item>.main .content::before { + content: ""; + top: 30rpx; + transform: rotate(45deg); + position: absolute; + z-index: -1; + display: inline-block; + overflow: hidden; + width: 24rpx; + height: 24rpx; + left: -12rpx; + right: initial; + background-color: inherit; + filter: blur(5rpx); + opacity: 0.3; +} + +.cu-chat .cu-item>.main .content:not([class*="bg-"])::before { + background-color: var(--black); + opacity: 0.1; +} + +.cu-chat .cu-item.self>.main .content::before { + left: auto; + right: -12rpx; +} + +.cu-chat .cu-item.self { + justify-content: flex-end; + text-align: right; +} + +.cu-chat .cu-info { + display: inline-block; + margin: 20rpx auto; + font-size: 24rpx; + padding: 8rpx 12rpx; + background-color: rgba(0, 0, 0, 0.2); + border-radius: 6rpx; + color: var(--white); + max-width: 400rpx; + line-height: 1.4; +} + +/* ================== + 卡片 + ==================== */ + +.cu-card { + display: block; + overflow: hidden; +} + +.cu-card>.cu-item { + display: block; + background-color: var(--white); + overflow: hidden; + border-radius: 10rpx; + margin: 10rpx; +} + +.cu-card>.cu-item.shadow-blur { + overflow: initial; +} + +.cu-card.no-card>.cu-item { + margin: 0rpx; + border-radius: 0rpx; +} + +.cu-card .grid.grid-square { + margin-bottom: -20rpx; +} + +.cu-card.case .image { + position: relative; +} + +.cu-card.case .image image { + width: 100%; +} + +.cu-card.case .image .cu-tag { + position: absolute; + left: 0; + top: 0; +} + +.cu-card.case .image .cu-bar { + position: absolute; + bottom: 0; + width: 100%; + background-color: transparent; + padding: 0rpx 30rpx; +} + +.cu-card.case.no-card .image { + margin: 30rpx 30rpx 0; + overflow: hidden; + border-radius: 10rpx; +} + +.cu-card.dynamic { + display: block; +} + +.cu-card.dynamic>.cu-item { + display: block; + background-color: var(--white); + overflow: hidden; +} + +.cu-card.dynamic>.cu-item>.text-content { + padding: 0 30rpx 0; + max-height: 6.4em; + overflow: hidden; + font-size: 30rpx; + margin-bottom: 20rpx; +} + +.cu-card.dynamic>.cu-item .square-img { + width: 100%; + height: 200rpx; + border-radius: 6rpx; +} + +.cu-card.dynamic>.cu-item .only-img { + width: 100%; + height: 320rpx; + border-radius: 6rpx; +} + +.cu-card.article { + display: block; +} + +.cu-card.article>.cu-item { + padding-bottom: 30rpx; +} + +.cu-card.article>.cu-item .title { + font-size: 30rpx; + font-weight: 900; + color: var(--black); + line-height: 100rpx; + padding: 0 30rpx; +} + +.cu-card.article>.cu-item .content { + display: flex; + padding: 0 30rpx; +} + +.cu-card.article>.cu-item .content>image { + width: 240rpx; + height: 8.4em; + margin-right: 20rpx; + border-radius: 6rpx; +} + +.cu-card.article>.cu-item .content .desc { + flex: 1; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.cu-card.article>.cu-item .content .text-content { + font-size: 28rpx; + color: #888; + height: 4.8em; + overflow: hidden; +} + +/* ================== + 表单 + ==================== */ + +.cu-form-group { + background-color: var(--white); + display: flex; + align-items: center; + min-height: 80rpx; + justify-content: space-between; +} + +.cu-form-group+.cu-form-group { + border-top: 1rpx solid #eee; +} + +.cu-form-group .title { + text-align: justify; + padding-right: 20rpx; + font-size: 32rpx; + position: relative; + line-height: 80rpx; +} + +.cu-form-group .title-right { + text-align: right; + padding-right: 20rpx; + font-size: 30rpx; + position: relative; + height: 60rpx; + line-height: 60rpx; +} + +.cu-form-group .title-left { + text-align: left; + padding-right: 20rpx; + font-size: 30rpx; + position: relative; + height: 60rpx; + line-height: 60rpx; +} + +.cu-form-group input { + flex: 1; + font-size: 30rpx; + color: #555; + padding-right: 20rpx; +} + +.cu-form-group .content { + flex: 1; + text-align: right; + font-size: 30rpx; + color: #000000; + padding-right: 20rpx; +} + +.cu-form-group .content-red { + flex: 1; + text-align: right; + font-size: 30rpx; + color: #FF0000; + padding-right: 20rpx; +} + +.cu-form-group .content-left { + flex: 1; + text-align: left; + font-size: 30rpx; + color: #000000; + padding-right: 20rpx; +} + +.cu-form-group>text[class*="cuIcon-"] { + font-size: 36rpx; + padding: 0; + box-sizing: border-box; +} + +.cu-form-group textarea { + margin: 0 0 30rpx; + height: 6em; + width: 100%; + line-height: 1.2em; + flex: 1; + font-size: 28rpx; + padding: 10rpx; +} + +.cu-form-group.align-start .title { + height: 1em; + margin-top: 32rpx; + line-height: 1em; +} + +.cu-form-group picker { + flex: 1; + padding-right: 40rpx; + overflow: hidden; + position: relative; +} + +.cu-form-group picker .picker { + line-height: 60rpx; + font-size: 32rpx; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + width: 100%; + text-align: right; +} + +.cu-form-group picker .picker-left { + line-height: 60rpx; + font-size: 28rpx; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + width: 100%; + text-align: left; +} + +.cu-form-group picker::after { + font-family: "cuIcon"; + display: block; + content: "\e6a3"; + position: absolute; + font-size: 34rpx; + color: var(--grey); + line-height: 60rpx; + width: 60rpx; + text-align: center; + top: 0; + bottom: 0; + right: -20rpx; + margin: auto; +} + +.cu-form-group textarea[disabled], +.cu-form-group textarea[disabled] .placeholder { + color: transparent; +} + +/* ================== + 模态窗口 + ==================== */ + +.cu-modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1110; + opacity: 0; + outline: 0; + text-align: center; + -ms-transform: scale(1.185); + transform: scale(1.185); + backface-visibility: hidden; + perspective: 2000rpx; + background: rgba(0, 0, 0, 0.6); + transition: all 0.3s ease-in-out 0s; + pointer-events: none; +} + +.cu-modal::before { + content: "\200B"; + display: inline-block; + height: 100%; + vertical-align: middle; +} + +.cu-modal.show { + opacity: 1; + transition-duration: 0.3s; + -ms-transform: scale(1); + transform: scale(1); + overflow-x: hidden; + overflow-y: auto; + pointer-events: auto; +} + +.cu-dialog { + position: relative; + display: inline-block; + vertical-align: middle; + margin-left: auto; + margin-right: auto; + width: 680rpx; + max-width: 100%; + background-color: #f8f8f8; + border-radius: 10rpx; + overflow: hidden; +} + +.cu-modal.bottom-modal::before { + vertical-align: bottom; +} + +.cu-modal.bottom-modal .cu-dialog { + width: 100%; + border-radius: 0; +} + +.cu-modal.bottom-modal { + margin-bottom: -1000rpx; +} + +.cu-modal.bottom-modal.show { + margin-bottom: 0; +} + +.cu-modal.drawer-modal { + transform: scale(1); + display: flex; +} + +.cu-modal.drawer-modal .cu-dialog { + height: 100%; + min-width: 200rpx; + border-radius: 0; + margin: initial; + transition-duration: 0.3s; +} + +.cu-modal.drawer-modal.justify-start .cu-dialog { + transform: translateX(-100%); +} + +.cu-modal.drawer-modal.justify-end .cu-dialog { + transform: translateX(100%); +} + +.cu-modal.drawer-modal.show .cu-dialog { + transform: translateX(0%); +} + +.cu-modal .cu-dialog>.cu-bar:first-child .action { + min-width: 100rpx; + margin-right: 0; + min-height: 100rpx; +} + +/* ================== + 轮播 + ==================== */ +swiper .a-swiper-dot { + display: inline-block; + width: 16rpx; + height: 16rpx; + background: rgba(0, 0, 0, .3); + border-radius: 50%; + vertical-align: middle; +} + +swiper[class*="-dot"] .wx-swiper-dots { + display: flex; + align-items: center; + width: 100%; + justify-content: center; +} + +swiper.square-dot .wx-swiper-dot { + background-color: var(--white); + opacity: 0.4; + width: 10rpx; + height: 10rpx; + border-radius: 20rpx; + margin: 0 8rpx !important; +} + +swiper.square-dot .wx-swiper-dot.wx-swiper-dot-active { + opacity: 1; + width: 30rpx; +} + +swiper.round-dot .wx-swiper-dot { + width: 10rpx; + height: 10rpx; + position: relative; + margin: 4rpx 8rpx !important; +} + +swiper.round-dot .wx-swiper-dot.wx-swiper-dot-active::after { + content: ""; + position: absolute; + width: 10rpx; + height: 10rpx; + top: 0rpx; + left: 0rpx; + right: 0; + bottom: 0; + margin: auto; + background-color: var(--white); + border-radius: 20rpx; +} + +swiper.round-dot .wx-swiper-dot.wx-swiper-dot-active { + width: 18rpx; + height: 18rpx; +} + +.screen-swiper { + min-height: 375rpx; +} + +.screen-swiper-lg { + min-height: 245rpx; +} + +.screen-swiper.xl { + height: 600rpx; +} + +.screen-swiper image, +.screen-swiper video, +.swiper-item image, +.swiper-item video { + width: 100%; + display: block; + height: 100%; + margin: 0; + pointer-events: none; +} + +.card-swiper { + height: 420rpx !important; +} + +.card-swiper swiper-item { + width: 610rpx !important; + left: 70rpx; + box-sizing: border-box; + padding: 40rpx 0rpx 70rpx; + overflow: initial; +} + +.card-swiper swiper-item .swiper-item { + width: 100%; + display: block; + height: 100%; + border-radius: 10rpx; + transform: scale(0.9); + transition: all 0.2s ease-in 0s; + overflow: hidden; +} + +.card-swiper swiper-item.cur .swiper-item { + transform: none; + transition: all 0.2s ease-in 0s; +} + + +.tower-swiper { + height: 420rpx; + position: relative; + max-width: 750rpx; + overflow: hidden; +} + +.tower-swiper .tower-item { + position: absolute; + width: 300rpx; + height: 380rpx; + top: 0; + bottom: 0; + left: 50%; + margin: auto; + transition: all 0.2s ease-in 0s; + opacity: 1; +} + +.tower-swiper .tower-item.none { + opacity: 0; +} + +.tower-swiper .tower-item .swiper-item { + width: 100%; + height: 100%; + border-radius: 6rpx; + overflow: hidden; +} + +/* ================== + 步骤条 + ==================== */ + +.cu-steps { + display: flex; +} + +scroll-view.cu-steps { + display: block; + white-space: nowrap; +} + +scroll-view.cu-steps .cu-item { + display: inline-block; +} + +.cu-steps .cu-item { + flex: 1; + text-align: center; + position: relative; + min-width: 100rpx; +} + +.cu-steps .cu-item:not([class*="text-"]) { + color: var(--grey); +} + +.cu-steps .cu-item [class*="cuIcon-"], +.cu-steps .cu-item .num { + display: block; + font-size: 40rpx; + line-height: 80rpx; +} + +.cu-steps .cu-item::before, +.cu-steps .cu-item::after, +.cu-steps.steps-arrow .cu-item::before, +.cu-steps.steps-arrow .cu-item::after { + content: ""; + display: block; + position: absolute; + height: 0px; + width: calc(100% - 80rpx); + border-bottom: 1px solid #ccc; + left: calc(0px - (100% - 80rpx) / 2); + top: 40rpx; + z-index: 0; +} + +.cu-steps.steps-arrow .cu-item::before, +.cu-steps.steps-arrow .cu-item::after { + content: "\e6a3"; + font-family: "cuIcon"; + height: 30rpx; + border-bottom-width: 0px; + line-height: 30rpx; + top: 0; + bottom: 0; + margin: auto; + color: #ccc; +} + +.cu-steps.steps-bottom .cu-item::before, +.cu-steps.steps-bottom .cu-item::after { + bottom: 40rpx; + top: initial; +} + +.cu-steps .cu-item::after { + border-bottom: 1px solid currentColor; + width: 0px; + transition: all 0.3s ease-in-out 0s; +} + +.cu-steps .cu-item[class*="text-"]::after { + width: calc(100% - 80rpx); + color: currentColor; +} + +.cu-steps .cu-item:first-child::before, +.cu-steps .cu-item:first-child::after { + display: none; +} + +.cu-steps .cu-item .num { + width: 40rpx; + height: 40rpx; + border-radius: 50%; + line-height: 40rpx; + margin: 20rpx auto; + font-size: 24rpx; + border: 1px solid currentColor; + position: relative; + overflow: hidden; +} + +.cu-steps .cu-item[class*="text-"] .num { + background-color: currentColor; +} + +.cu-steps .cu-item .num::before, +.cu-steps .cu-item .num::after { + content: attr(data-index); + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin: auto; + transition: all 0.3s ease-in-out 0s; + transform: translateY(0rpx); +} + +.cu-steps .cu-item[class*="text-"] .num::before { + transform: translateY(-40rpx); + color: var(--white); +} + +.cu-steps .cu-item .num::after { + transform: translateY(40rpx); + color: var(--white); + transition: all 0.3s ease-in-out 0s; +} + +.cu-steps .cu-item[class*="text-"] .num::after { + content: "\e645"; + font-family: "cuIcon"; + color: var(--white); + transform: translateY(0rpx); +} + +.cu-steps .cu-item[class*="text-"] .num.err::after { + content: "\e646"; +} + +/* ================== + 布局 + ==================== */ + +/* -- flex弹性布局 -- */ + +.flex { + display: flex; +} + +.basis-xs { + flex-basis: 20%; +} + +.basis-sm { + flex-basis: 40%; +} + +.basis-df { + flex-basis: 50%; +} + +.basis-lg { + flex-basis: 60%; +} + +.basis-xl { + flex-basis: 80%; +} + +.flex-sub { + flex: 1; +} + +.flex-twice { + flex: 2; +} + +.flex-treble { + flex: 3; +} + +.flex-direction { + flex-direction: column; +} + +.flex-wrap { + flex-wrap: wrap; +} + +.flex-nowrap { + flex-wrap: nowrap; +} + +.align-start { + align-items: flex-start; +} + +.align-end { + align-items: flex-end; +} + +.align-center { + align-items: center; +} + +.align-stretch { + align-items: stretch; +} + +.self-start { + align-self: flex-start; +} + +.self-center { + align-self: flex-center; +} + +.selfcenter { + align-self: center; +} + +.self-end { + align-self: flex-end; +} + +.self-stretch { + align-self: stretch; +} + +.align-stretch { + align-items: stretch; +} + +.justify-start { + justify-content: flex-start; +} + +.justify-end { + justify-content: flex-end; +} + +.justify-center { + justify-content: center; +} + +.justify-between { + justify-content: space-between; +} + +.justify-around { + justify-content: space-around; +} + +/* grid布局 */ + +.grid { + display: flex; + flex-wrap: wrap; +} + +.grid.grid-square { + overflow: hidden; +} + +.grid.grid-square .cu-tag { + position: absolute; + right: 0; + top: 0; + border-bottom-left-radius: 6rpx; + padding: 6rpx 12rpx; + height: auto; + background-color: rgba(0, 0, 0, 0.5); +} + +.grid.grid-square>view>text[class*="cuIcon-"] { + font-size: 52rpx; + position: absolute; + color: var(--grey); + margin: auto; + top: 0; + bottom: 0; + left: 0; + right: 0; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} + +.grid.grid-square>view { + margin-right: 20rpx; + margin-bottom: 20rpx; + border-radius: 6rpx; + position: relative; + overflow: hidden; +} + +.grid.grid-square>view.bg-img image { + width: 100%; + height: 100%; + position: absolute; +} + +.grid.col-1.grid-square>view { + padding-bottom: 100%; + height: 0; + margin-right: 0; +} + +.grid.col-2.grid-square>view { + padding-bottom: calc((100% - 20rpx)/2); + height: 0; + width: calc((100% - 20rpx)/2); +} + +.grid.col-3.grid-square>view { + padding-bottom: calc((100% - 40rpx)/3); + height: 0; + width: calc((100% - 40rpx)/3); +} + +.grid.col-4.grid-square>view { + padding-bottom: calc((100% - 60rpx)/4); + height: 0; + width: calc((100% - 60rpx)/4); +} + +.grid.col-5.grid-square>view { + padding-bottom: calc((100% - 80rpx)/5); + height: 0; + width: calc((100% - 80rpx)/5); +} + +.grid.col-2.grid-square>view:nth-child(2n), +.grid.col-3.grid-square>view:nth-child(3n), +.grid.col-4.grid-square>view:nth-child(4n), +.grid.col-5.grid-square>view:nth-child(5n) { + margin-right: 0; +} + +.grid.col-1>view { + width: 100%; +} + +.grid.col-2>view { + width: 50%; +} + +.grid.col-3>view { + width: 33.33%; +} + +.grid.col-4>view { + width: 25%; +} + +.grid.col-5>view { + width: 20%; +} + +/* -- 内外边距 -- */ + +.margin-0 { + margin: 0; +} + +.margin-xs { + margin: 10rpx; +} + +.margin-sm { + margin: 20rpx; +} + +.margin { + margin: 30rpx; +} + +.margin-lg { + margin: 40rpx; +} + +.margin-xl { + margin: 50rpx; +} + +.margin-top-ls { + margin-top: 2rpx; +} + +.margin-top-xs { + margin-top: 10rpx; +} + +.margin-top-sm { + margin-top: 20rpx; +} + +.margin-top { + margin-top: 30rpx; +} + +.margin-top-lg { + margin-top: 40rpx; +} + +.margin-top-xl { + margin-top: 50rpx; +} + +.margin-right-xs { + margin-right: 10rpx; +} + +.margin-right-sm { + margin-right: 20rpx; +} + +.margin-right { + margin-right: 30rpx; +} + +.margin-right-lg { + margin-right: 40rpx; +} + +.margin-right-xl { + margin-right: 50rpx; +} + +.margin-bottom-xs { + margin-bottom: 10rpx; +} + +.margin-bottom-sm { + margin-bottom: 20rpx; +} + +.margin-bottom { + margin-bottom: 30rpx; +} + +.margin-bottom-lg { + margin-bottom: 40rpx; +} + +.margin-bottom-xl { + margin-bottom: 50rpx; +} + +.margin-bottom-xxl { + margin-bottom: 80rpx +} + +.margin-bottom-xxxl { + margin-bottom: 130rpx +} + +.margin-left-xs { + margin-left: 10rpx; +} + +.margin-left-sm { + margin-left: 20rpx; +} + +.margin-left { + margin-left: 30rpx; +} + +.margin-left-lg { + margin-left: 40rpx; +} + +.margin-left-xl { + margin-left: 50rpx; +} + +.margin-lr-xs { + margin-left: 10rpx; + margin-right: 10rpx; +} + +.margin-lr-sm { + margin-left: 20rpx; + margin-right: 20rpx; +} + +.margin-lr { + margin-left: 30rpx; + margin-right: 30rpx; +} + +.margin-lr-lg { + margin-left: 40rpx; + margin-right: 40rpx; +} + +.margin-lr-xl { + margin-left: 50rpx; + margin-right: 50rpx; +} + +.margin-tb-xs { + margin-top: 10rpx; + margin-bottom: 10rpx; +} + +.margin-tb-sm { + margin-top: 20rpx; + margin-bottom: 20rpx; +} + +.margin-tb { + margin-top: 30rpx; + margin-bottom: 30rpx; +} + +.margin-tb-lg { + margin-top: 40rpx; + margin-bottom: 40rpx; +} + +.margin-tb-xl { + margin-top: 50rpx; + margin-bottom: 50rpx; +} + +.padding-0 { + padding: 0; +} + +.padding-xs { + padding: 10rpx; +} + +.padding-sm { + padding: 20rpx; +} + +.padding { + padding: 30rpx; +} + +.padding-lg { + padding: 40rpx; +} + +.padding-xl { + padding: 50rpx; +} + +.padding-top-xs { + padding-top: 10rpx; +} + +.padding-top-sm { + padding-top: 20rpx; +} + +.padding-top { + padding-top: 30rpx; +} + +.padding-top-lg { + padding-top: 40rpx; +} + +.padding-top-xl { + padding-top: 50rpx; +} + +.padding-right-xs { + padding-right: 10rpx; +} + +.padding-right-sm { + padding-right: 20rpx; +} + +.padding-right { + padding-right: 30rpx; +} + +.padding-right-lg { + padding-right: 40rpx; +} + +.padding-right-xl { + padding-right: 50rpx; +} + +.padding-bottom-xs { + padding-bottom: 10rpx; +} + +.padding-bottom-sm { + padding-bottom: 20rpx; +} + +.padding-bottom { + padding-bottom: 30rpx; +} + +.padding-bottom-lg { + padding-bottom: 40rpx; +} + +.padding-bottom-xl { + padding-bottom: 50rpx; +} + +.padding-bottom-xxl { + padding-bottom: 80rpx; +} + +.padding-left-xs { + padding-left: 10rpx; +} + +.padding-left-sm { + padding-left: 20rpx; +} + +.padding-left { + padding-left: 30rpx; +} + +.padding-left-lg { + padding-left: 40rpx; +} + +.padding-left-xl { + padding-left: 50rpx; +} + +.padding-lr-xs { + padding-left: 10rpx; + padding-right: 10rpx; +} + +.padding-lr-sm { + padding-left: 20rpx; + padding-right: 20rpx; +} + +.padding-lr { + padding-left: 30rpx; + padding-right: 30rpx; +} + +.padding-lr-lg { + padding-left: 40rpx; + padding-right: 40rpx; +} + +.padding-lr-xl { + padding-left: 50rpx; + padding-right: 50rpx; +} + +.padding-tb-xs { + padding-top: 10rpx; + padding-bottom: 10rpx; +} + +.padding-tb-sm { + padding-top: 20rpx; + padding-bottom: 20rpx; +} + +.padding-tb { + padding-top: 30rpx; + padding-bottom: 30rpx; +} + +.padding-tb-lg { + padding-top: 40rpx; + padding-bottom: 40rpx; +} + +.padding-tb-xl { + padding-top: 50rpx; + padding-bottom: 50rpx; +} + +/* -- 浮动 -- */ + +.cf::after, +.cf::before { + content: " "; + display: table; +} + +.cf::after { + clear: both; +} + +.fl { + float: left; +} + +.fr { + float: right; +} + +/* ================== + 背景 + ==================== */ + +.line-red::after, +.lines-red::after { + border-color: var(--red); +} + +.line-orange::after, +.lines-orange::after { + border-color: var(--orange); +} + +.line-yellow::after, +.lines-yellow::after { + border-color: var(--yellow); +} + +.line-olive::after, +.lines-olive::after { + border-color: var(--olive); +} + +.line-green::after, +.lines-green::after { + border-color: var(--green); +} + +.line-cyan::after, +.lines-cyan::after { + border-color: var(--cyan); +} + +.line-blue::after, +.lines-blue::after { + border-color: var(--blue); +} + +.line-purple::after, +.lines-purple::after { + border-color: var(--purple); +} + +.line-mauve::after, +.lines-mauve::after { + border-color: var(--mauve); +} + +.line-pink::after, +.lines-pink::after { + border-color: var(--pink); +} + +.line-brown::after, +.lines-brown::after { + border-color: var(--brown); +} + +.line-grey::after, +.lines-grey::after { + border-color: var(--grey); +} + +.line-gray::after, +.lines-gray::after { + border-color: var(--gray); +} + +.line-black::after, +.lines-black::after { + border-color: var(--black); +} + +.line-white::after, +.lines-white::after { + border-color: var(--white); +} + +.bg-red { + background-color: var(--red); + color: var(--white); +} + +.bg-orange { + background-color: var(--orange); + color: var(--white); +} + +.bg-yellow { + background-color: var(--yellow); + color: var(--black); +} + +.bg-yellow-light { + color: var(--yellowLight); +} + +.bg-yellow-light-1 { + background-color: var(--yellowLight); + color: var(--white); +} + +.bg-olive { + background-color: var(--olive); + color: var(--white); +} + +.bg-green { + background-color: var(--green); + color: var(--white); +} + +.bg-cyan { + background-color: var(--cyan); + color: var(--white); +} + +.bg-blue { + background-color: var(--yellowLight); + color: var(--white); +} + +.bg-purple { + background-color: var(--purple); + color: var(--white); +} + +.bg-mauve { + background-color: var(--mauve); + color: var(--white); +} + +.bg-pink { + background-color: var(--pink); + color: var(--white); +} + +.bg-brown { + background-color: var(--brown); + color: var(--white); +} + +.bg-grey { + background-color: var(--grey); + color: var(--white); +} + +.text-color { + color: var(--white); +} + +.bg-gray { + background-color: #f0f0f0; + color: var(--black); +} + +.bg-trgray { + background-color: #f8f8f8; + color: var(--black); +} + +.bg-black { + background-color: var(--black); + color: var(--white); +} + +.bg-black-tr { + color: var(--white); + background: rgba(0, 0, 0, 0.4); +} + +.bg-white { + background-color: var(--white); + color: var(--darkGray); +} + +.bg-shadeTop { + background-image: linear-gradient(rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.01)); + color: var(--white); +} + +.bg-shadeBottom { + background-image: linear-gradient(rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 1)); + color: var(--white); +} + +.bg-red.light { + color: var(--red); + background-color: var(--redLight); +} + +.bg-orange.light { + color: var(--orange); + background-color: var(--orangeLight); +} + +.bg-yellow.light { + color: var(--yellow); + background-color: var(--yellowLight); +} + +.bg-olive.light { + color: var(--olive); + background-color: var(--oliveLight); +} + +.bg-green.light { + color: var(--green); + background-color: var(--greenLight); +} + +.bg-cyan.light { + color: var(--cyan); + background-color: var(--cyanLight); +} + +.bg-blue.light { + color: var(--blue); + background-color: var(--blueLight); +} + +.bg-purple.light { + color: var(--purple); + background-color: var(--purpleLight); +} + +.bg-mauve.light { + color: var(--mauve); + background-color: var(--mauveLight); +} + +.bg-pink.light { + color: var(--pink); + background-color: var(--pinkLight); +} + +.bg-brown.light { + color: var(--brown); + background-color: var(--brownLight); +} + +.bg-grey.light { + color: var(--grey); + background-color: var(--greyLight); +} + +.bg-gradual-red { + background-image: var(--gradualRed); + color: var(--white); +} + +.bg-gradual-orange { + background-image: var(--gradualOrange); + color: var(--white); +} + +.bg-gradual-green { + background-image: var(--gradualGreen); + color: var(--white); +} + +.bg-gradual-purple { + background-image: var(--gradualPurple); + color: var(--white); +} + +.bg-gradual-pink { + background-image: var(--gradualPink); + color: var(--white); +} + +.bg-yellow-yellow { + background-image: var(--gradualYellow); + color: var(--white) +} + +.bg-gradual-blue { + background-image: var(--gradualBlue); + color: var(--white); +} + +.bg-gradual-gray { + background-image: var(--gradualGray); + color: var(--white); +} + +.shadow[class*="-red"] { + box-shadow: var(--ShadowSize) var(--redShadow); +} + +.shadow[class*="-orange"] { + box-shadow: var(--ShadowSize) var(--orangeShadow); +} + +.shadow[class*="-yellow"] { + box-shadow: var(--ShadowSize) var(--yellowShadow); +} + +.shadow[class*="-olive"] { + box-shadow: var(--ShadowSize) var(--oliveShadow); +} + +.shadow[class*="-green"] { + box-shadow: var(--ShadowSize) var(--greenShadow); +} + +.shadow[class*="-cyan"] { + box-shadow: var(--ShadowSize) var(--cyanShadow); +} + +.shadow[class*="-blue"] { + box-shadow: var(--ShadowSize) var(--blueShadow); +} + +.shadow[class*="-purple"] { + box-shadow: var(--ShadowSize) var(--purpleShadow); +} + +.shadow[class*="-mauve"] { + box-shadow: var(--ShadowSize) var(--mauveShadow); +} + +.shadow[class*="-pink"] { + box-shadow: var(--ShadowSize) var(--pinkShadow); +} + +.shadow[class*="-brown"] { + box-shadow: var(--ShadowSize) var(--brownShadow); +} + +.shadow[class*="-grey"] { + box-shadow: var(--ShadowSize) var(--greyShadow); +} + +.shadow[class*="-gray"] { + box-shadow: var(--ShadowSize) var(--grayShadow); +} + +.shadow[class*="-black"] { + box-shadow: var(--ShadowSize) var(--blackShadow); +} + +.shadow[class*="-white"] { + box-shadow: var(--ShadowSize) var(--blackShadow); +} + +.text-shadow[class*="-red"] { + text-shadow: var(--ShadowSize) var(--redShadow); +} + +.text-shadow[class*="-orange"] { + text-shadow: var(--ShadowSize) var(--orangeShadow); +} + +.text-shadow[class*="-yellow"] { + text-shadow: var(--ShadowSize) var(--yellowShadow); +} + +.text-shadow[class*="-olive"] { + text-shadow: var(--ShadowSize) var(--oliveShadow); +} + +.text-shadow[class*="-green"] { + text-shadow: var(--ShadowSize) var(--greenShadow); +} + +.text-shadow[class*="-cyan"] { + text-shadow: var(--ShadowSize) var(--cyanShadow); +} + +.text-shadow[class*="-blue"] { + text-shadow: var(--ShadowSize) var(--blueShadow); +} + +.text-shadow[class*="-purple"] { + text-shadow: var(--ShadowSize) var(--purpleShadow); +} + +.text-shadow[class*="-mauve"] { + text-shadow: var(--ShadowSize) var(--mauveShadow); +} + +.text-shadow[class*="-pink"] { + text-shadow: var(--ShadowSize) var(--pinkShadow); +} + +.text-shadow[class*="-brown"] { + text-shadow: var(--ShadowSize) var(--brownShadow); +} + +.text-shadow[class*="-grey"] { + text-shadow: var(--ShadowSize) var(--greyShadow); +} + +.text-shadow[class*="-gray"] { + text-shadow: var(--ShadowSize) var(--grayShadow); +} + +.text-shadow[class*="-black"] { + text-shadow: var(--ShadowSize) var(--blackShadow); +} + +.bg-img { + background-size: cover; + background-position: center; + background-repeat: no-repeat; +} + +.bg-mask { + background-color: var(--black); + position: relative; +} + +.bg-mask::after { + content: ""; + border-radius: inherit; + width: 100%; + height: 100%; + display: block; + background-color: rgba(0, 0, 0, 0.4); + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; +} + +.bg-mask view, +.bg-mask cover-view { + z-index: 5; + position: relative; +} + +.bg-video { + position: relative; +} + +.bg-video video { + display: block; + height: 100%; + width: 100%; + -o-object-fit: cover; + object-fit: cover; + position: absolute; + top: 0; + z-index: 0; + pointer-events: none; +} + +/* ================== + 文本 + ==================== */ + +.text-xs { + font-size: 20rpx; +} + +.text-sm { + font-size: 24rpx; +} + +.text-df { + font-size: 28rpx; +} + +.text-lg { + font-size: 32rpx; +} + +.text-xl { + font-size: 36rpx; +} + +.text-xxl { + font-size: 44rpx; +} + +.text-sl { + font-size: 80rpx; +} + +.text-xsl { + font-size: 120rpx; +} + +.text-Abc { + text-transform: Capitalize; +} + +.text-ABC { + text-transform: Uppercase; +} + +.text-abc { + text-transform: Lowercase; +} + +.text-price::before { + content: "¥"; + font-size: 80%; + margin-right: 4rpx; +} + +.text-cut { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} + +.text-cut-width { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + width: 370rpx; +} + +.text-bold { + font-weight: bold; +} + +.text-center { + text-align: center; +} + +.text-content { + line-height: 1.6; +} + +.text-left { + text-align: left; +} + +.text-right { + text-align: right; +} + +.text-red, +.line-red, +.lines-red { + color: var(--red); +} + +.text-orange, +.line-orange, +.lines-orange { + color: var(--orange); +} + +.text-yellow, +.line-yellow, +.lines-yellow { + color: var(--yellow); +} + +.text-olive, +.line-olive, +.lines-olive { + color: var(--olive); +} + +.text-green, +.line-green, +.lines-green { + color: var(--green); +} + +.text-cyan, +.line-cyan, +.lines-cyan { + color: var(--cyan); +} + +.text-blue, +.line-blue, +.lines-blue { + color: var(--blue); +} + +.text-purple, +.line-purple, +.lines-purple { + color: var(--purple); +} + +.text-mauve, +.line-mauve, +.lines-mauve { + color: var(--mauve); +} + +.text-pink, +.line-pink, +.lines-pink { + color: var(--pink); +} + +.text-brown, +.line-brown, +.lines-brown { + color: var(--brown); +} + +.text-grey, +.line-grey, +.lines-grey { + color: var(--grey); +} + +.text-gray, +.line-gray, +.lines-gray { + color: var(--gray); +} + +.text-gray2 { + color: #333333; +} + +.text-black, +.line-black, +.lines-black { + color: var(--black); +} + +.line-depblack, +.lines-depblack, +l .text-depblack { + color: var(--depBlack) +} + +.text-white, +.line-white, +.lines-white { + color: var(--white); +} + +/* 自定义 */ +.play-box { + display: flex; + margin-left: 20rpx; + flex-direction: column; + width: 80%; + background-color: white; + border-radius: 15rpx; + align-items: center; + justify-content: center; + padding: 10rpx 0rpx; +} + +.play-box-arrow-flex { + width: 100%; + height: 100%; + display: flex; + position: absolute; + justify-content: center; + align-items: center; +} + +.play-box-arrow-pos { + top: 40rpx; + left: 40rpx; + position: absolute; + width: 100%; + height: 100%; +} + +.shadow-box { + width: 100%; + border-radius: 10rpx; + border: 1rpx solid #f9f9f9; +} + +.border-blue-radius { + border-radius: 20rpx; + border: 1rpx solid #0054bd; + color: #0054bd; +} + +.border-blue-radius:active { + border-radius: 20rpx; + border: 1rpx solid #9b9c9c; + color: #000000; +} + +/* box-shadow: 10px 10px 5px #cacaca; 阴影 */ +.play-box image { + width: 60rpx; + height: 60rpx; +} + +.play-box image:active { + background-color: rgb(204, 202, 202); + border-radius: 50%; +} + +.text-left input { + text-align: right; +} + +.text-length-hint-right { + width: 100%; + text-align: right; + padding-right: 20rpx; + font-size: 32rpx; + margin-top: 10rpx; +} + +.line-gray-sm { + background-color: var(--gray); + height: 10rpx; +} + +.line-gray-ssm { + background-color: rgb(243, 243, 243); + height: 2rpx; + width: 95%; + align-self: center; +} + +.line-gray-xs { + background-color: var(--gray); + height: 20rpx; +} + +.line-gray-lg { + background-color: var(--gray); + height: 30rpx; +} + +.line-gray-xl { + background-color: var(--gray); + height: 40rpx; +} + +.hint-title { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + height: 90rpx; + font-size: 32rpx; + color: black; +} + +.hint-title image { + width: 48rpx; + height: 48rpx; +} + +.hint-title text { + position: relative; + top: 1px; + left: -30rpx +} + +/* pages/mine/shop/mineshop.wxss */ +.cardTitle { + color: #fff; + padding: 20rpx 40rpx; + font-size: 80rpx; + font-weight: 300; + background-color: #ffffff; + position: relative; + text-align: center; + text-shadow: 0px 0px 6rpx rgba(0, 0, 0, 0.3); + border: 1px dashed gray; +} + +.border-bottom-sm { + border-bottom-color: #eeeeee; + border-bottom-width: 1rpx; + border-bottom-style: solid; +} + +.card-title-sm { + color: #fff; + margin: 10rpx; + padding: 0rpx 20rpx; + font-size: 60rpx; + font-weight: 300; + background-color: #ffffff; + position: relative; + text-align: center; + border: 1px dashed gray; +} + +.cardTitle::before { + position: absolute; + width: 60rpx; + height: 6rpx; + border-radius: 20rpx; + display: block; + transform: skew(10deg, 0deg); +} + +.cardTitle::after { + position: absolute; + width: 140rpx; + border-radius: 6rpx; + height: 24rpx; + display: block; + bottom: 76rpx; + left: 90rpx; + opacity: 0.1; +} + +@font-face { + font-family: 'iconfont'; + src: url('data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAAL0AA0AAAAABuAAAAKeAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4GVgCCQhEICoFIgUsLCgABNgIkAxAEIAWFCAc7G/EFyI7CtuUTYyoihNONcXgQEVRrZM/uPqJC9R9w0UQSwQIK9+ACqNiRAwSbikMy4vzv/ctzs6kgViBK4/2V3m7glqriKpOmpCuok+pM3Exrgwaysdw21XlCXbQtisOAogDTae0fEzfw24P9u77x786VNuXwyeFSiMvjICscjo1CwPvVkXr4sLDtwZ6b0IxekIQsCwUJUcQRNaS96QAchtfHf5FRT1KTWceSTTktSP/lghbRRDVhgwNchgBkZPQhMJ1IoI+pIVAUwS+X/wqWuL6AgKglAJFAuJ+HoJ43qgoJFFCPwHywCkABQMzvbGi83DBxfd/dKasq55m43zjwNvpPRXXJ6ut9d6P/0ermpr0rb93/ZnJpVf9JXfisafAKE91rytdv4eEfTJyfNueJmqipKfDaOeU29Orq7Twm1WjvFnrp7ayKsR51Tkn9eqdWhr2Fet0UeZpk8UsLg0KCNkPLBMKpx9qLE/bq7Gff8/Xv787eyuRLAAJBx5fpxfXWyX/1TcWgdquqJvJaVgHqJRAM199QAPmcAACUAigorEMo5iOQ0KgRFYBOtyBAj2AEQr0VCCR1diKQ1dstQFHvtAA1mjwDgVr1voJAo6kxFwSadMVRWZQGTIFAhnaZZNJqI5m1M4AFHSNr9Fona7U7Jhut8lzeZDh2wcw8Okwj7tgtfDRpF0o1U1MRcjgzGt/m4voS5dXjkWUg3g4sw4gZKDTSgTha1PToRrgKo6MnDfuIECoczqr0EaHhpeCibBVG1+cmekZikThO4EOgo6bkI7fGJxgFBTUfGjpqMkwzLhSu8na9URzJuXCIif+nIiNShXrfB2zBcRqJwoQRGodDNVNTAlPWhWJx02hTLYlGqikIKVJ7o54zXmOGRIRsMAAA') format('woff2'), + url('data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAS0AA0AAAAABuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAEmAAAABoAAAAcjuL8y0dERUYAAAR4AAAAHgAAAB4AKQAKT1MvMgAAAaAAAABCAAAAVjyGSApjbWFwAAAB9AAAAD4AAAFCAA/pw2dhc3AAAARwAAAACAAAAAj//wADZ2x5ZgAAAkAAAAC3AAAAyKXtiRxoZWFkAAABMAAAADAAAAA2HF0Zv2hoZWEAAAFgAAAAHQAAACQHgwOFaG10eAAAAeQAAAAPAAAAEAwAAFpsb2NhAAACNAAAAAoAAAAKAGQAAG1heHAAAAGAAAAAHwAAACABDwBQbmFtZQAAAvgAAAFJAAACiCnmEVVwb3N0AAAERAAAACkAAAA7epyHrHjaY2BkYGAAYsUHE+Lj+W2+MnCzMIDAnflZD+F01P9JzEuZ84BcDgYmkCgATbQMO3jaY2BkYGBu+N/AEMPCAALMSxkYGVABCwBTNQMRAAAAeNpjYGRgYGBhcGEA0QwMTEDMBYQMDP/BfAYAD3EBYAB42mNgZGFgnMDAysDA1Ml0hoGBoR9CM75mMGLkAIoysDIzYAUBaa4pDA7PJJ5JMDf8b2CIYW5gaAAKM4LkAN59DAsAAHjaY2GAABYIjgIAANoAZwB42mNgYGBmgGAZBkYGELAB8hjBfBYGBSDNAoRA/jOJ//8hpORrqEoGRjYGGJOBkQlIMDGgAkaGYQ8AVqkHuAAAAAAAAAAAAAAAZAAAeNodirENwjAURP2xFGjASA75EhK2FJBT+VsC4jRACkpKOlr3DMMODJIdsgE9BQMYHHTFPd07Buz2ffAnv7MzYzAFBYs8K40DWawgz9alqfe+luMZ/KmxQJB6W2jg+2HZbYfjmDcnSJhnfBMjjIIiIvX2E9LYTE4fbJyjK/AY/cWSx79xOhntUFcKXiEYi0eB2McO5ZKMroVCaPu5UpQSQlFZY5KHttBC+SOWUsSu14IO5gdbfykbAHjafZA9TgMxEIWf8wckEkIgqF1RANr8lCkTKfQIpaNINt6QaNdeeZ1IOQEtFQeg5RgcgBsg0XIKXpZJkyJr7ejzm5nnsQGc4xsK/98l7oQVjvEoXMERMuEq9RfhGvlduI4WPoUb1H+Em7hVA+EWLtQbHVTthLub0m3LCmcYCFdwiifhKvWVcI38KlzHFT6EG9S/hJsY41e4hWtlqQzhYTBBYJxBY4oN4wIxHCySMgbWoTn0ZhLMTE83ehE7mzgbKO9XYpcDHmg554Ap7T23Zr5KJ/5gy4HUmG4eBUu2KY0uInQoG18snNXdqHOw/Z7ttrTYv2uBNcfsUQ1s1Pw92zPSSGwMr5CSNfIyt6QSU49oa6zxu2cp1vNeCIlOvMv0iMeaNHU6925p4sDi5/KMHH20uZI996gcPmNZCHm/3U7EIIpdhj+T2HEZAAAAeNpjYGKAAC4wyciADljAokyMTAKJxSWpRZnF2cW6hrrJ+QWVADoqBkcAAAAAAAAB//8AAgABAAAADAAAABYAAAACAAEAAwADAAEABAAAAAIAAAAAeNpjYGBgZACCq0vUOUD0nflZD2E0AER/BzYAAA==') format('woff'), + url('iconfont.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + font-display: swap; +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 12rpx; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-star-red:before { + content: "\e618"; + color: #f55054; +} + +.container{ + padding: 20rpx; +} +.join-btn{ + background-color: #f55054; + color: #fff; + font-size: 32rpx; + height: 50rpx; + line-height: 50rpx; + padding: 0 15rpx; + border-radius: 25rpx; + margin-top: 25rpx; +} +.border-btn{ + border: 1px solid #f55054; + color: #f55054; + font-size: 32rpx; + height: 50rpx; + line-height: 50rpx; + padding: 0 15rpx; + border-radius: 25rpx; + margin-top: 25rpx; +} +.cut-text{ + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} \ No newline at end of file diff --git a/images/home-on.png b/images/home-on.png new file mode 100644 index 0000000000000000000000000000000000000000..98670f22f2151329c8dda39128526aa43aadb3ce GIT binary patch literal 675 zcmV;U0$lxxP)Px%T}ebiRA@u(S-)!(K@|SJO)nyXjUW~_u}WjDAh~@6uMjTU1T3@*2o@?@sGx-y zh>bRCp$Ha9Ww@Qa2!j7X5WyyhAlhhWBZTae3yI$9-ObMK%tFXs{oeO;xgB&h9>_GJwfEA|coe*JpH=xtgM-fE}AkY3Icm+{(jot1?pGLeI&^T^`TmW!v zgvhT@z0Nd!>C1#S11fS8z}-T^$VDc}l|r+Yp~?nSAK>gOBTIMo+am*B#(;j6*izEHvrr#3S4n+nZ|UAU|0=kt91Yq z69%d$iU4|?`Gn2QlU!Z>G7fXB0iBsSg)DpPQItDWmR(}6_jJ_aNCPVJ5Wr=3#sC}S z5|d%==~Kx-iOMnPk?v^NI4Md}FDG~gJR_wl9y z?~ytJ?(qgx!@RM{!nlIwH7fCn_D z|M5A0N2Vf^P%U(^;7LpwnCDE>&pV6O3yv}jb?!6<>P&kW*KcH>>@lFq$Xx&c002ov JPDHLkV1fasB*p*$ literal 0 HcmV?d00001 diff --git a/images/home.png b/images/home.png new file mode 100644 index 0000000000000000000000000000000000000000..fcf1860dc6cad143cc362ebc7561932ed648eba5 GIT binary patch literal 692 zcmV;l0!#ggP)Px%Zb?KzRA@u(Sv_kMQ4~FQmT5&quo1+&bXkWg$i28 zhMjp2w9yobU=b@*SO|juAV|O_h#=Z%XJfIvD;rGMjk}vWGw%gLX6tj$Js&eW!#u(+ z|Isejk6;FjG53h5Eh2vaEHm?i5Mg;Y(ChV%#&NtrL>IOQUUtsi%ChXUPa|Fp6h(2K zh!y}Gn z6duiQ~B4>2%i0@Rl-Qtvw?m@5?NxfF0f!PqcGt14U8XA)-fG;+nWO%-q&+ zY-^z3?;mKjTJHdy)DU{ad>IS|r@Gzlw^^Js4H#oi1Nh)kR28ag%=~=X;8X*~m;wM- z+30(Qh?bHhnV-b_p8;#_J`wo@;D~P_HTixK(Oi-wKSz1S3>afB0eD?=QP6P_xjgzV zwP|4Z`U~KG(CwbcMPxor)1@KZrU7g1s)!u-v?C~uh^(b)y8gyH+JFSz>Y1FG*R?kW zJO`_$YZ_2T6$scg5GYtR?VfKS)Dv6HTdRSMVRhe1pfN`MFx}e*lz|3?)oLK9G9`Iq zKp9jpSkpkTXqCiG1InO+!I}nwMXMxk8c+rm3^u8Ox4sW8f~f~qnEAxmXO%q9uS8Ll z1K1yMu@CAW&beNeWy6op<7Z^n+Bp$X9W3}zQia1g_ae)(uN$-59&l7yvXe87ft^fy a(yqVv;sQXji&ba<0000Px+V@X6oRA@uZT5D_^)fN7}-C`pM52?J>R-zO{14s}cq#>bk9>CGnG~_fYm1%T$PjhVS?>VMU z49&z5F$2Vyy8!&Kjr*Sf>;N#0AlQX{`({`!AB+i~xmzwoi0j@8k)J25_5ehttHc1W zf}EkXe@uvx+C6h3#BoMIZc1HIbKv`RVqOC*91h)PE$mNF*~tjNe?$~o=u9`F%i<&cO;5M9SN5tO`eOtNDqC#oD{orB8+(s zz;H<7{{UE~Gr#oq9)qr~)eu<)k<}nqCM`69{|U7A9|`u!R`NJP%vC>Dn~KK|zpYDzX)iZNdV z@H~KHI!)RT|2BXr0F&6ie+MTg=TD?EJbWzn@88&lgbx7p(AwQu)Dvq&$iTqas8q&4 zo|;9{HW+%g*a<*)i)#U#8|f?3OW&Uq$GHyV4*+}sk$dU;o72>|C=t@%e=-V%F#s2& zNsvnnc_lrsdax5?d;tCRJnzxk)6?W^ON1DshbJYWFAaDuG30IZybW~{J_X<}jd^J8 zqW|2my4n-rx=%vn>RetZ9q8S(_P)8$5Z&W-T6Y zvifxZ4>tVv0IgMNFtLRaA;#Pb;GV>2`2{>jYcFes7uUTUBF{AZZfUKXri=wdi0gg} zA`hei%O!?<1Iw2$0~Jb z11k{(B>+p()SOF<$eHy0--Tg|F{+TOQhvzD$LM+2r>Uj-X~>#2OK|w%rJQwwWc3va z7jt4_dngHE=N*yXf*ho^s)Ho98WE0j2gsi$j?OE99HQrqhmz3W--|-wg_dXUBM1gr zD(RLzmDPwaW*2}9Qz2v@^bK13P{ikO8pszQ(zw+>h#GOa!%S@yV|3T3bHo3GMeYM+ zWTc2ad$d(Bx1FA=_hwofR~CqTM+inM&!)J{M$UArL{-2Awea$r<(-ruV(|W1ZEqwA;fZ!RZLxQPT;4*)D1BdbiI2_1aoqa-ibFX?Cg}V6Y2|8jTWoFOYBRUlM0}9i zgDA69(#=(FCdMoU(0W#QQ|A|M+t#E@=267FFw?e|S<77OL1=TPSe)X-#J{pCsNNI~ zn=@9?+E=p5(+;Oep%P=XpQ*awCl*Pr&6O#TWdy+#egDl)iWOsYnf%=Ua-Lc!)j5uy zLT?9oMeLUo(K}7G(Q?>fWp3U2-?*{jI9otApD{%4r0=($f8s)>@{3lnjX4iw4@7zZ zdlr;&m z>j6(cp~tG^v|13H5~o9+AYW|PR75nQOJCm!C=_)4Usoq4-Sxs^@gk0o=ek74UNvIV z*TzvCNAE*vlcf*j`7trSNoyNBRx!h}bL)6Sv@50FN!M#XHDa1ilC{tbuKi>|N3KLH vm|JR>O_Ug2g_eSRgq|0EAuWryOMvkaM4GWr)OPdd00000NkvXXu0mjf3{0BD literal 0 HcmV?d00001 diff --git a/images/law.png b/images/law.png new file mode 100644 index 0000000000000000000000000000000000000000..fe8f863de55f007f64be72e2481aa8c46278bef2 GIT binary patch literal 2037 zcmVPx+uSrBfRA@uRS`Ca`RTVzx&9o#1q#G55s0k_tQ4^>FRSHtA7_g12rdCWe{zauz z@40WZkOINl zp)s>ZN(XE0Z2<6<5$68@fI}im5Clg~o;*1dMNvB?eBoxL2w|=LGyv?*$o7A|Yyp6W zf*_btO8q?}MsD-Mg=jPy8@>0_xfv~VJTBq@z{B4A8333G!|>k)VK0CwR0wPB+W}xd z0Gw3@Spe`oVF2JLB1+agQber6goxw#vLFcV1Aq&PAeI5+NfCsZXT0}!hhg}y48HTG zg$QAcc?BX$CcHimi2{8NcRHQ5^?H3aE9Tfj?AWp6?B&asOD0^KHFz2J-uty-7#_@u zJ+=_Wn7xQNIUw*eh`35-{;8>{^JZsfuK|EHh$!E0$x1Y>JtCg3lzKX?ea~(zA*{9E z0)USX2zr=^Ru3aHH8r*3^y$;9gCKY_Ghc&zMh5C2*#RXj7h8xrc_e_7ec`%``y~@tAC(nfZ|S{(*YE zo;pkV@vXHyBHn>&wK`d=)t*hmX_!r>p<%6k4*>iuZ@``~h}i6OI=@Y`<~!%6nR(-o zm`9m;QfvK0UQU@a!a4U=0JxW#&l@-Bd~n2L-uq^yQaRA+bPn~ONaHwOS*cX+9wq`a zp9+Ftty1b}5qwf*gtb;SO8Wrdq9THhz&MVGhXLS8W|r;xWg~3Y5z&D-jz1Cv!Iu&7 zl=ps{*80bJI4&tf9LE<_DwTcA{H8nsO7hu6L~{o_=iL3w{7(6snIG3$Uz{iANFkha zXEC#6!u5H;OY*syi1u_vco{SQvp)_IE&1aP;zf?-yn1{w9A*{6o045JuNj{IXTCG)46iHELK{Li|M8pNvutMet zYwd>s;JYO~P#)N45%HD7PLtN!?*qUG3!N;jwQ|t;6#$%*hjAG`%zTN~`Y(g9t+i4i zmrD73L&STOQXkF3Wo~Hf+O_MPcDpSilvXFmLGEfI`oj^*jJ&_%QPZt@SSkVLRvKH2UjA-|nse?|T@m`X`f@3>fr#!OhX*?6u4iT$7SDTQW}~$pxDS|~p01oYabkaOJKZD8 z%%9X+rz#7KdO)<+ehvV3B#eFv07ty{N2F>50P7L)>N1r=#C=MscMpqUjM;;TpX%>t z<}YcjzgPq>5#omc@PR(Cf%Qf?7RzMR73Ez8uP%QgqBjhCAm`kz%$%%`r2H*#ZFTvXHA*tLF|Yvl(NqLPWXyoNtKuSi9ZckhknNjN2k1 zI-Sl7>-GA{EDzIfD@S+lz04`SY_WA#(yFxVc@=Gm*_x_?V z4CNNOkmj7bl9}g(Vdhm`(5DeGR7%Mfd0?~F9+E0{qVvN<^u0oeB|s!2b^*ZV-v7th zrY=RW(P&)QZnt04Znq!Wx^=7ky2C_RbaBMYw`r}vx>St3{W4izi-->-0B$0p6HnGh={hO0V&GHS}U~#xmE9P`-w;<;Zob25OEw& z20^fQKqT3=HWBflQcAYrr8Vc=rOcc>D?D1QR@c{RwFPy_GDyr9W=7p*O5iTZW)K9; zYPH(jym@o0C_+&bt(cgYSTtvN@7IK3`1_*bjKWz^p)$tYfrwHUtd4X-JSCaJ%mx@e;vlmIk%meKi}Wa z%-_~pOX1}?ZK*CpcJAEyqGijL$=10iOzPVtM3gZ;H;h`XR?fU#r TRp4q800000NkvXXu0mjfFgfj4 literal 0 HcmV?d00001 diff --git a/images/my-on.png b/images/my-on.png new file mode 100644 index 0000000000000000000000000000000000000000..99cb0c39a86d700dbfe6072a08f925b78c93ca09 GIT binary patch literal 868 zcmV-q1DpJbP)Px&9!W$&RA@u(nLlV$K@i5jxguC-VH&|UVxeH;KZq#tU+(S21TC}_v526Jf~An8 zw$LhI1O-bG42fj+3_?&0L`)+n2&S+Rf)EP@F~yDSD%!Fv;0VK)W7}tC&WE6n( zZbNi0q@&uHSOB?n-@#@MAjb3qC~G?zs*eG18^Fy_L)y6P0g~i3h65f$O{H>-%H>x+dAtE!GRb2jC$dP^9`G@r-mQFvRe<=L zIgu-5?S!u{6+rYUD7&woKnmc_!N61B4k>l#hIqnj4I>f%TGA zPi?0m(%bNA(aDz~vJ9em0JFsWJhbDjahU>SWlEFhKY*rNF|_~o1Y~GvCstS8leq^( z+ac1O{sg)kJ_91(K(qp2rT*Fd4p>50*Cb6%eF>e8dIFLp`v9B-(GY;X(84Woa}b#V z@Pe#;r^)FJP<^d<8NgvpfdK6SL>~A)BQ^wx@!uCOD9?x8x&UI#9*8^&-X?gt^bk1^ zqKm}*p`E%dKx!U%3}CNEi996l0bFPYu?FA|G+%2_TZpv)rP4!)T*{-Z0X3cw^ZCZO zCIA^2IE6}OHXw1HA;ZLczgDmrz!-Ng9?a8CK&{UJ4ifX%rt?6iC#(Qhst}QDWbJq} zz~9mR8s{7_A8!Tt2w=CW6PqWlzx=JQ0Wsz$fGwNnNmcn5F{fS|0se*sT%(*OX1AGa u07#NP5RGKG!&J3YA$B|0F|u~f#ry^yPai-wTjHqz0000Px&EJ;K`RA@u(m_29|K@`W|yK5}8&_=LTEEH_~0!4{msZ5B4mLe7rl$$pTmO_%+ zVs|DW7(u~O1cR~BAOyvL;x&STUT+vDEH|MzBg zX5JzM{AjI@F!ON$7zTi?`L)p}1rec*pOw*Cfs|6?0AQ}YYuVcVUkN~(ren2Q?OI6T z1z>alt+iz4)V89oc2NPcEIW;ebFQLX?4to_tq(BsOBXRdw$T8TQmBnE9q+=96%{`9RRNS3Uc*}0q_C<4!H{PwT}Vt0RXo9 z3Uc*}0q_j~ybflr;-fsoN~tOVz7x?V8*uB>s8XuRDYQgHJ3<3g`4BG>(c#bl696!2 z6EuL$BoR&7#Ic@2dAIe;1ZG~Ly+U@q4BuQpne4M6G5jaLajEIR4B6AV%H3CI~kbN;T zk4PyWxr#3ZV4U;*_(q8qvx$h8g%GcN#Fqvrl6t(@Y68HF%W5+S(CZl(6fE!BPUU?= z@oLeSf6lK(M4T5wJn^mgYQLZWp+vdF`48Yytr)id_6ST*Pj73rT4RW4dgaXku%+v} zxHpAg27s^mRopK#^HRNDpKUZ6pL|Ehc?7a7+XDb6YPH%ZGY|PD?)F2(g?79B5CEP^ zDc`unv<5J1Ju_cK#DgvgTy4#ZV??}dyGN`E;IT=$Y93^7wb=~>&|2?e=DQ`13Bf=R z@w^b?UB7^R0gQM6xW~-9L#Zee2NB-_z`1@9e*pY#;tTLW5d8q|F!O~n6^rP5pNP)( ztYFp^zO`T>Svd zd__uW8mZp^>!kWCwJ|%l5aL)5fY$mwGw+ODy+H9hFMm5zNNfFrnKuMV5If9IB3jYf z0a#B{2mt1YXtW0)P1B)zy*?4@gc)lH%=~Y)T2o1qESMa>0DoLGKr2&)mjD0&07*qo IM6N<$f*4POv;Y7A literal 0 HcmV?d00001 diff --git a/images/neighbor-on.png b/images/neighbor-on.png new file mode 100644 index 0000000000000000000000000000000000000000..0a5b25491d2e93f9392285d8090d80a6dee777fb GIT binary patch literal 848 zcmV-W1F!svP)Px&3Q0skRA@u(nLTI}K@`XT@8TUCf{0cYf*>e|C z`y1Y*ZI52D)ucJ>@lP0%8kuaNIA zH0p~6QtBCi(H@1V$s)Q#o_DcbAns|Hnz#khdbkhN!;$JoC`oV@0b~K}1+b%Tp`Rf7 z4(1$yLrEOisG;Y`WM+`fzN4Xp}tf zMGR4a2|LaW5S4}YsR2bUEEES;>LmbIV3!gQ^YGe<9sDiIK@fdLf_h@5z6u&d zx{<=(loVKQVytA2dPqdn*=6^u2RIU_rF!X{!`wShS%V+m%b3?zi&QfUt| z83S`728<=3Hlesw+7-eK#e}g4v4XJn`?@PhPEM}H!z*J zfUyh|Mhd`v^8ICYoRc8B1mJX%u+-Uh0qC#yk1^WvX53u`+Du%W?|q;+yJpko|BjHk zsK0D;yT!g*{A#tjtUm?dI)H-MkqrZ)dtjad&i~z`Vo@unCPx&C`m*?RA@u(nLlV0K@`Tnw|53a5TliaAP9%1eZTqM z&b-?tY_cD1G9F|CDWwiE^ZB9y6VXZ-h6|qOHPf`E0tG>E$#I+jz>cB;#d?;aDDphd zTU@U%6-Y|?1i)B9VG>!lgb-IufwAfiRrbw>t3MRjW6P>0Se5z!WA-UDEJORk>) zz5^HnaIljay>RF$5#0{M@O|qYp|5~asdSN_N&!u+lGdQ9swBL zC`>SwcX4kQD0kb0A#QORt_np0%oolQs{T_2I1JIM)Fj@2BFd+C+3$ z|J86^_w)LgwjaELAV?ie9LIS9U~3!L6=s&q{9nN?Y|yH{*D_&k3n-;7F!O_qb-#&d zdTnh@R;$%twz<0zZ~aM9DRq;Xucj2ABO;mB2Hg;9n!_4MO8F7Mk(L54qbRC*p7++Y zXr6IaK#fLYe;9^eVnNFQri2h#?U$$S%-mK$@!QQ=W}a*|o72AUM}1M5g@gGG4N%U9&6&0dY*8r&KE)5(SIMm}E*mN!T2cR95K$h(c!~g&Q07*qoM6N<$ Ef`CkohX4Qo literal 0 HcmV?d00001 diff --git a/pages/card/cardDetail.js b/pages/card/cardDetail.js new file mode 100644 index 0000000..ce2ef7e --- /dev/null +++ b/pages/card/cardDetail.js @@ -0,0 +1,162 @@ +// pages/card/cardDetail.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + cardType: '', + realName: '张三', + intro: '简介简介简介简介简介简介简介简介简介', + phone: '0471-3360077', + address: '呼和浩特市新城区', + qrCode: '', + photo: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + cardType: options.type + }) + }, + // 上传照片 + choosePhoto: function () { + var self = this + wx.chooseImage({ + count: 1, + sourceType: ['album', 'camera'], + success: function (res) { + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + var path = res.tempFiles[0].path; + app.restAjax.file(app.restAjax.path(app.apis.uploadImg, [app.baseUrls.serviceUrl]), path, 'image', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + var id = JSON.parse(data).data + self.setData({ + photo: id + }) + wx.hideToast() + } + }, function (code, data) { + console.log(data) + }) + } + }) + }, + // 上传二维码 + chooseQrCode: function () { + var self = this + wx.chooseImage({ + count: 1, + sourceType: ['album', 'camera'], + success: function (res) { + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + var path = res.tempFiles[0].path; + app.restAjax.file(app.restAjax.path(app.apis.uploadImg, [app.baseUrls.serviceUrl]), path, 'image', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + var id = JSON.parse(data).data + self.setData({ + qrCode: id + }) + wx.hideToast() + } + }, function (code, data) { + console.log(data) + }) + } + }) + }, + // 提交创建 + submitCreate: function () { + var self = this + var info = { + address: self.data.address, + job: self.data.intro, + realName: self.data.realName, + photo: self.data.photo, + qrCode: self.data.qrCode, + templateId: self.data.cardType + } + app.restAjax.post(app.restAjax.path(app.apis.submitCreateCard, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '创建成功!', + }) + } + }, function (code, data) { + console.log(data) + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/card/cardDetail.json b/pages/card/cardDetail.json new file mode 100644 index 0000000..466789a --- /dev/null +++ b/pages/card/cardDetail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "创建名片" +} \ No newline at end of file diff --git a/pages/card/cardDetail.wxml b/pages/card/cardDetail.wxml new file mode 100644 index 0000000..d963bfd --- /dev/null +++ b/pages/card/cardDetail.wxml @@ -0,0 +1,66 @@ + + + + + + + {{realName}} + {{intro}} ... + + + {{phone}} + + + + {{address}} + + + + + + + + 编辑名片 + + 姓名: + + + + + + 简介: + + + + + + 电话: + + + + + + 位置: + + + + + + 照片: + + + + + + + + 二维码: + + + + + + + + + + 创建名片 + \ No newline at end of file diff --git a/pages/card/cardDetail.wxss b/pages/card/cardDetail.wxss new file mode 100644 index 0000000..e6f1103 --- /dev/null +++ b/pages/card/cardDetail.wxss @@ -0,0 +1,121 @@ +.container{ + margin-bottom: 120rpx; +} +.card{ + width: 100%; + height: 0; + position: relative; + padding-bottom: 56%; + background-color: #fff; +} +.photo{ + position: absolute; + left: 20rpx; + top: 0; + bottom: 0; +} +.photo image{ + height: 100%; +} +.name{ + position: absolute; + top: 40rpx; + left: 340rpx; + font-size: 36rpx; + font-weight: bold; +} +.desc{ + position: absolute; + left: 340rpx; + top: 125rpx; + display: -webkit-box; + overflow: hidden; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + font-size: 30rpx; +} +.phone{ + position: absolute; + left: 340rpx; + bottom: 60rpx; + font-size: 28rpx; + line-height: 30rpx; + color: #a8a8a8; +} +.phone image{ + width: 30rpx; + height: 30rpx; + vertical-align: middle; + margin-top: -8rpx; +} +.position{ + bottom: 20rpx; +} +.qr-code{ + position: absolute; + bottom: 30rpx; + right: 24rpx; + width: 60rpx; + height: 60rpx; +} +.qr-code image{ + width: 100%; + height: 100%; +} +.edite-card{ + margin-top: 20rpx; + background-color: #fff; + padding: 20rpx; +} +.title{ + font-size: 32rpx; + margin-bottom: 15rpx; +} +.card-row{ + display: flex; + justify-content: space-between; + border-top: 1px solid #DDD; + padding: 15rpx 0; +} +.row-name{ + font-size: 32rpx; + width: 30%; +} +.row-content{ + width: 70%; + text-align: right; +} +.row-content input{ + font-size: 32rpx; + width: 100%; +} +.add-photo{ + width: 100rpx; + height: 100rpx; + font-size: 60rpx; + border: 1px solid #a1a1a1; + border-radius: 10rpx; + font-weight: normal; + text-align: center; + line-height: 100rpx; + display: inline-block; +} +.create-card{ + position: fixed; + left: 0; + right: 0; + bottom: 0; + padding: 20rpx; + background-color: #fff; +} +.create-btn{ + line-height: 60rpx; + text-align: center; + font-size: 32rpx; + background-color: #FF4949; + color: #fff; + border-radius: 40rpx; +} +.photo-img, .qrCode-img{ + width: 200rpx; +} \ No newline at end of file diff --git a/pages/card/cardList.js b/pages/card/cardList.js new file mode 100644 index 0000000..9453238 --- /dev/null +++ b/pages/card/cardList.js @@ -0,0 +1,71 @@ +// pages/card/cardList.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + checkDetail: function (e) { + var type = e.currentTarget.dataset.type + wx.navigateTo({ + url: './cardDetail?type=' + type, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/card/cardList.json b/pages/card/cardList.json new file mode 100644 index 0000000..de98b79 --- /dev/null +++ b/pages/card/cardList.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "名片" +} \ No newline at end of file diff --git a/pages/card/cardList.wxml b/pages/card/cardList.wxml new file mode 100644 index 0000000..63fb2a7 --- /dev/null +++ b/pages/card/cardList.wxml @@ -0,0 +1,6 @@ + + + + 名片模板 + + \ No newline at end of file diff --git a/pages/card/cardList.wxss b/pages/card/cardList.wxss new file mode 100644 index 0000000..69fbb35 --- /dev/null +++ b/pages/card/cardList.wxss @@ -0,0 +1,24 @@ +.card-box{ + margin-bottom: 20rpx; + background-color: #fff; +} +.card-box image{ + width: 100%; +} +.card-name{ + padding: 15rpx; + font-size: 32rpx; +} + + + + + + + + + + + + + diff --git a/pages/center/case/caseHandle.js b/pages/center/case/caseHandle.js new file mode 100644 index 0000000..cac8f6c --- /dev/null +++ b/pages/center/case/caseHandle.js @@ -0,0 +1,402 @@ +// pages/caseHandle/caseHandle.js +const app = getApp() +var util = require('../../../utils/WSCoordinate.js') +Page({ + + /** + * 页面的初始数据 + */ + data: { + reportId: '', + baseUrl: app.baseUrls.serviceUrl, + imgUrl: app.baseUrls.baseImgUrl, + sourceUrl: app.baseUrls.sourceUrl, + handleSummary: '', + handleImg: [], + markers: [], + caseDetail: {}, + content: '', + videoId: '', + handleDetail: {} + }, + getDetail: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.myCaseDetail, [app.baseUrls.requestUrl, self.data.reportId]), {}, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (data.reportPhotos) { + data.reportPhotos = data.reportPhotos.split(',') + } else { + data.reportPhotos = [] + } + + if (data.handleStatus == '1') { + self.getHandleList() + } + var marker = [ + { + iconPath: self.data.sourceUrl + "marker_red.png", + id: 1, + latitude: data.reportLat, + longitude: data.reportLng, + width: '30', + height: '30' + } + ] + self.setData({ + caseDetail: data, + markers: marker + }) + }, function (code, data) { + console.log(data) + }) + }, + // 播放录音 + playRecord: function () { + var innerAudioContext = wx.createInnerAudioContext() + innerAudioContext.src = this.data.caseUrl + this.data.imgUrl + this.data.caseDetail.reportAudio + innerAudioContext.play() + }, + // 提交申请 + handleCase: function () { + var self = this + var photo + for (let i = 0; i < self.data.handleImg.length; i++) { + if (i == 0) { + photo = self.data.handleImg[i] + } else { + photo += ',' + self.data.handleImg[i] + } + } + var info = { + handleSummary: self.data.handleSummary, + taskId: self.data.reportId, + handlePhotos: photo + } + app.restAjax.post(app.restAjax.path(app.apis.handleCase, [app.baseUrls.caseUrl]), info, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + console.log(data) + }, function (code, data) { + console.log(data) + }) + }, + // 上传图片 + uploadImage: function () { + var self = this + wx.chooseImage({ + count: 9 - self.data.handleImg.length, + sourceType: ['album', 'camera'], + success: function (res) { + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + for (let i = 0; i < res.tempFiles.length; i++) { + var path = res.tempFiles[i].path; + app.restAjax.file(app.restAjax.path(app.apis.uploadImg, [app.baseUrls.caseUrl]), path, 'image', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + console.log(data) + var id = JSON.parse(data).data + var arr = self.data.handleImg + arr.push(id) + self.setData({ + handleImg: arr + }) + wx.hideToast() + } + }, function (code, data) { + console.log(data) + }) + } + } + }) + }, + // 删除附件 + deleteSource: function (e) { + var self = this + var cur = e.currentTarget.dataset.cur + self.data.handleImg.splice(cur, 1) + self.setData({ + handleImg: self.data.handleImg + }) + }, + // 预览图片 + previewImg: function (e) { + var self = this + var url = e.currentTarget.dataset.src + wx.previewImage({ + current: url, + urls: self.data.caseDetail.reportPhotos, + }) + }, + // 受理 + acceptance: function () { + var self = this + var info = self.data.caseDetail + var photo = '' + for (let i = 0; i < info.reportPhotos.length; i++) { + if (i < info.reportPhotos.length - 1) { + photo += info.reportPhotos[i] + ',' + } else { + photo += info.reportPhotos[i] + } + } + info.reportPhotos = photo + info.isAccept = '1' + app.restAjax.put(app.restAjax.path(app.apis.updateCaseStatus, [app.baseUrls.requestUrl, self.data.reportId]), info, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '受理成功', + icon: 'success' + }) + self.getDetail() + } + }, function (code, data) { + console.log(data) + }) + }, + // 不予受理 + notAcceptance: function () { + var self = this + wx.showModal({ + cancelColor: 'cancelColor', + // title: '', + content: '确认不予受理该事件?', + success: function (res) { + if (res.confirm) { + var info = self.data.caseDetail + + var photo = '' + for (let i = 0; i < info.reportPhotos.length; i++) { + if (i < info.reportPhotos.length - 1) { + photo += info.reportPhotos[i] + ',' + } else { + photo += info.reportPhotos[i] + } + } + info.reportPhotos = photo + console.log(info) + info.isAccept = '-1' + app.restAjax.put(app.restAjax.path(app.apis.updateCaseStatus, [app.baseUrls.requestUrl, self.data.reportId]), info, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '不予受理成功', + icon: 'success' + }) + self.getDetail() + } + }, function (code, data) { + console.log(data) + }) + } + } + }) + }, + // 上传视频 + uploadVideo: function () { + var self = this + wx.chooseVideo({ + sourceType: ['album','camera'], + maxDuration: 60, + camera: 'back', + success: function (res) { + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + var path = res.tempFilePath + app.restAjax.file(app.restAjax.path(app.apis.uploadVideo, [app.baseUrls.caseUrl]), path, 'video', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + var id = JSON.parse(data).data + self.setData({ + videoId: id + }) + wx.hideToast() + } + }, function (code, data) { + console.log(data) + }) + } + }) + }, + // 删除视频 + deleteVideo: function () { + this.setData({ + videoId: '' + }) + }, + // 处理完成 + handleComplete: function () { + var self = this + if (self.data.content) { + var photo = '' + for (let i = 0; i < self.data.handleImg.length; i++) { + if (i < self.data.handleImg.length - 1) { + photo += self.data.handleImg[i] + ',' + } else { + photo += self.data.handleImg[i] + } + } + var info = { + content: self.data.content, + photo: photo, + reportId: self.data.reportId, + video: self.data.videoId + } + app.restAjax.post(app.restAjax.path(app.apis.handleCase, [app.baseUrls.requestUrl]), info, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '处理成功!', + icon: 'success' + }) + setTimeout(function () { + wx.navigateBack({ + delta: 1 + }) + }, 1500) + } + }, function (code, data) { + console.log(data) + }) + } else { + wx.showToast({ + title: '请输入事件处理说明', + icon: 'error' + }) + } + }, + // 获取列表 + getHandleList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getHandleList, [app.baseUrls.requestUrl]), { + reportId: self.data.reportId + }, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (data[0].photo) { + data[0].photo = data[0].photo.split(',') + } + self.setData({ + handleDetail: data[0] + }) + }, function (code, data) { + console.log(data) + }) + }, + // 事件转派 + caseRedundancies: function () { + var self = this + wx.showModal({ + cancelColor: 'cancelColor', + content: '确认转派该事件?', + success: function (res) { + if (res.confirm) { + app.restAjax.put(app.restAjax.path(app.apis.caseRedundancies, [app.baseUrls.requestUrl, self.data.reportId]), {}, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '转派成功!', + icon: 'success' + }) + setTimeout(function () { + wx.navigateBack({ + delta: 1 + }) + }, 1500) + } + }, function (code, data) { + console.log(data) + }) + } + } + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + reportId: options.reportId + }) + this.getDetail() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/center/case/caseHandle.json b/pages/center/case/caseHandle.json new file mode 100644 index 0000000..2c6c251 --- /dev/null +++ b/pages/center/case/caseHandle.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "事件详情" +} \ No newline at end of file diff --git a/pages/center/case/caseHandle.wxml b/pages/center/case/caseHandle.wxml new file mode 100644 index 0000000..a1335b8 --- /dev/null +++ b/pages/center/case/caseHandle.wxml @@ -0,0 +1,173 @@ + + + 基本信息 + + + + * + 事件类型 + + + {{caseDetail.caseTypeName1}} + + + + + * + 事件类型 + + + {{caseDetail.caseTypeName2}} + + + + + * + 事发地区 + + + {{caseDetail.reportAreaName}} + + + + + * + 事发位置 + + + {{caseDetail.reportLng}},{{caseDetail.reportLat}} + + + + + + + + + 详细信息 + + + + * + 事件说明 + + + + + + + + 事件图片 + + + + + + + + + + + 视频 + + + + + + + + + 录音 + + 播放录音 + + + + + + + 事件处理 + + + + * + 事件处理说明 + + + + + + + + 事件处理图片 + + + + + + + + + + + + + + 事件处理视频 + + + + + + + + + + + + + 处理完成 + 转派 + 受理 + 不予受理 + + + + + 事件处理 + + + + * + 事件处理说明 + + + + + + + + 事件处理图片 + + + + + + + + + + 事件处理视频 + + + + + + + + \ No newline at end of file diff --git a/pages/center/case/caseHandle.wxss b/pages/center/case/caseHandle.wxss new file mode 100644 index 0000000..48f5d42 --- /dev/null +++ b/pages/center/case/caseHandle.wxss @@ -0,0 +1,302 @@ +page{ + background-color: #fafafa; +} +.report{ + width: 710rpx; + margin: 20rpx auto; + background-color: #fff; + padding: 20rpx 30rpx; + box-sizing: border-box; + border-radius: 10rpx; + box-shadow: 0px 2px 8px 0px rgba(35, 24, 21, 0.1); +} +.title{ + font-size: 36rpx; + color: #333; + margin-bottom: 20rpx; +} +.title text{ + color: red; +} +.row{ + background-color: #f2f1f6; + padding: 15rpx; + display: flex; + justify-content: space-between; + border-radius: 10rpx; + font-size: 32rpx; + margin-bottom: 15rpx; + flex-wrap: wrap; +} +.row:last-child{ + margin-bottom: 0; +} +.row-name{ + width: 200rpx; + height: 40rpx; + border-right: 1px solid #9b9a9f; + flex-shrink: 0; +} +.row-name text{ + color: red; +} +.row-main{ + width: 410rpx; + text-align: right; + flex-shrink: 0; + word-break: break-all; +} +.submit{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + background: #fff; + padding: 20rpx; + display: flex; + justify-content: space-between; +} +.submit-btn{ + flex-shrink: 0; + width: 32%; + background-color: #118aff; + color: #fff; + text-align: center; + height: 80rpx; + border-radius: 10rpx; + line-height: 80rpx; + font-size: 36rpx; +} +.btn2{ + background-color: #56b6de; +} +.btn3{ + background-color: #d70715; +} +.file{ + width: 710rpx; + margin: 0 auto 20rpx; + background-color: #fff; + padding: 20rpx 30rpx; + box-sizing: border-box; + border-radius: 10rpx; + box-shadow: 0px 2px 8px 0px rgba(35, 24, 21, 0.1); +} +.file-box{ + background-color: #f2f1f6; + padding: 15rpx; + border-radius: 10rpx; + margin-bottom: 20rpx; +} +.file-box:last-child{ + margin-bottom: 0; +} +.file-title{ + font-size: 30rpx; +} +.file-title text{ + color: red; +} +.file-content{ + margin-top: 10rpx; + font-size: 0; +} +.img-box1{ + display: inline-block; + width: 32%; + margin-right: 2%; + margin-bottom: 10rpx; + height: 155rpx; + vertical-align: top; + overflow: hidden; + text-align: center; +} +.img-box1 image{ + height: 100%; +} +.file-content image:nth-child(3n){ + margin-right: 0; +} +.file-content textarea{ + width: 100%; + height: 150rpx; + font-size: 30rpx; +} +.upload-btn{ + width: 100rpx; + height: 100rpx; + text-align: center; + line-height: 100rpx; + display: inline-block; + font-size: 60rpx; + border-radius: 10rpx; + border: 2px solid #333; + vertical-align: top; +} +.voice-box{ + display: flex; + justify-content: space-between; + padding: 0; +} +.voice-box image{ + width: 35rpx; + vertical-align: middle; + margin-top: -7rpx; +} +.voice-title{ + font-size: 30rpx; + line-height: 80rpx; + margin-left: 15rpx; +} +.record-btn{ + background-color: #118aff; + color: #fff; + line-height: 80rpx; + border-radius: 10rpx; + padding: 0 15rpx; +} +.delay{ + width: 710rpx; + margin: 0 auto 20rpx; + background-color: #fff; + padding: 20rpx 30rpx; + box-sizing: border-box; + border-radius: 10rpx; + box-shadow: 0px 2px 8px 0px rgba(35, 24, 21, 0.1); +} +.delay-box{ + padding: 20rpx; + background-color: #f2f1f6; +} +.delay-content{ + padding: 20rpx; + background-color: #fff; + border-radius: 10rpx; + margin-bottom: 20rpx; +} +.delay-content:last-child{ + margin-bottom: 0; +} +.delay-top{ + padding-bottom: 15rpx; + border-bottom: 1px dashed #EEE; +} +.delay-reason{ + display: flex; + justify-content: space-between; + font-size: 32rpx; + color: #333; +} +.reason{ + width: 65%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + line-height: 60rpx; +} +.delay-status{ + padding: 10rpx 15rpx; + border-radius: 30rpx; +} +.status1{ + background-color: #fce8e1; + color: #ec0400; +} +.status2{ + background-color: #e9f2ff; + color: #0fa6ff; +} +.delay-text{ + font-size: 30rpx; + color: #333; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.delay-bottom{ + font-size: 30rpx; + color: #0e89ff; + margin-top: 10rpx; +} +.delay-bottom image{ + width: 40rpx; + vertical-align: middle; + margin-top: -7rpx; +} +.handle{ + width: 710rpx; + margin: 0 auto 130rpx; + background-color: #fff; + padding: 20rpx 30rpx; + box-sizing: border-box; + border-radius: 10rpx; + box-shadow: 0px 2px 8px 0px rgba(35, 24, 21, 0.1); +} +.handle-box{ + background-color: #f2f1f6; + margin-bottom: 20rpx; + border-radius: 10rpx; + padding: 15rpx; +} +.handle-box textarea{ + width: 100%; + height: 150rpx; +} +.handle-img .upload-btn{ + width: 100rpx; + height: 100rpx; + flex-shrink: 0; + vertical-align: top; +} +.img-box{ + width: 32%; + display: inline-block; + margin-right: 2%; + height: 100rpx; + position: relative; + text-align: center; +} +.delete{ + width: 35rpx !important; + height: 35rpx !important; + position: absolute; + top: -18rpx; + right: -18rpx; +} +.img-box:nth-child(3n){ + margin-right: 0; +} +.img-box image{ + width: 100%; + height: 100rpx; +} +.map{ + width: 100%; + margin-top: 10rpx; +} +.map map{ + width: 100%; +} +.handle-btn{ + display: flex; + justify-content: space-between; +} +.handle-btn-box{ + width: 49%; + text-align: center; + line-height: 60rpx; + margin-right: 2%; + background-color: #f55054; + color: #fff; + border-radius: 10rpx; + flex-shrink: 0; +} +.handle-btn-box:last-child{ + margin-right: 0; +} +.video-box{ + position: relative; +} +.video-box video{ + width: 100%; +} \ No newline at end of file diff --git a/pages/center/case/caseList.js b/pages/center/case/caseList.js new file mode 100644 index 0000000..f9080a8 --- /dev/null +++ b/pages/center/case/caseList.js @@ -0,0 +1,163 @@ +// pages/caseList/caseList.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + sourceUrl: app.baseUrls.sourceUrl, + page: { + page: 1, + rows: 10, + isAccpet: '', + handleStatus: '', + areaCode: wx.getStorageSync('areaCode') + }, + baseUrl: app.baseUrls.caseUrl, + imgUrl: app.baseUrls.baseImgUrl, + caseList: [] + }, + getList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.myCaseList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (data.rows.length > 0) { + var arr = self.data.caseList + for (let i = 0; i < data.rows.length; i++) { + if (data.rows[i].reportPhotos) { + data.rows[i].reportPhotos = data.rows[i].reportPhotos.split(',')[0] + } + // if (data.rows[i].isAccept == '0') { + // data.rows[i].isAccept = '未受理' + // } else if (data.rows[i].isAccept == '1') { + // data.rows[i].isAccept = '已受理' + // } else { + // data.rows[i].isAccept = '不予受理' + // } + arr.push(data.rows[i]) + } + + self.setData({ + caseList: arr + }) + } else { + wx.showToast({ + title: '暂无更多', + icon: 'none' + }) + self.setData({ + ['page.page']: self.data.page.page - 1 + }) + } + + console.log(data) + }, function (code, data) { + console.log(data) + }) + }, + goDetail: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: './caseHandle?reportId=' + id, + }) + }, + checkLog: function (e) { + var id = e.currentTarget.dataset.log + wx.navigateTo({ + url: './caseLog?businessId=' + id, + }) + }, + doEvaluate: function (e) { + wx.navigateTo({ + url: '../evaluate/evaluate?reportId=' + e.currentTarget.dataset.id, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + if (options.isAccept == '0' || options.isAccept == '1') { + this.setData({ + ['page.isAccept']: options.isAccept + }) + if (options.isAccept == '0') { + wx.setNavigationBarTitle({ + title: '待受理', + }) + } else { + wx.setNavigationBarTitle({ + title: '已受理', + }) + } + } + if (options.handleStatus) { + this.setData({ + ['page.handleStatus']: '2' + }) + wx.setNavigationBarTitle({ + title: '已完结', + }) + } + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.setData({ + caseList: [] + }) + this.getList() + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + var self = this + this.setData({ + ['page.page']: self.data.page.page + 1 + }) + this.getList() + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/center/case/caseList.json b/pages/center/case/caseList.json new file mode 100644 index 0000000..c26d331 --- /dev/null +++ b/pages/center/case/caseList.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的上报" +} \ No newline at end of file diff --git a/pages/center/case/caseList.wxml b/pages/center/case/caseList.wxml new file mode 100644 index 0000000..a5e4d15 --- /dev/null +++ b/pages/center/case/caseList.wxml @@ -0,0 +1,30 @@ + + + + + + + + + + + {{item.caseTypeName1}} + {{item.caseStatus}} + + 编码:{{item.reportCode}} + 上报时间:{{item.gmtCreate}} + 处理结果:{{item.reportResultText}} + + + + + + {{item.reportAreaName}} + + + + + + \ No newline at end of file diff --git a/pages/center/case/caseList.wxss b/pages/center/case/caseList.wxss new file mode 100644 index 0000000..67e496f --- /dev/null +++ b/pages/center/case/caseList.wxss @@ -0,0 +1,108 @@ +page{ + background-color: #fafafa; +} +.list{ + padding: 20rpx; +} +.case-box{ + padding: 20rpx 30rpx; + box-shadow: 0px 2px 8px 0px rgba(35, 24, 21, 0.1); + border-radius: 12rpx; + background-color: #fff; + margin-bottom: 20rpx; +} +.top{ + padding-bottom: 20rpx; + border-bottom: 1px dashed #DDD; + display: flex; + justify-content: space-between; +} +.case-img{ + width: 120rpx; + height: 120rpx; + overflow: hidden; + text-align: center; +} +.case-img image{ + height: 100%; + border-radius: 10rpx; +} +.case-info{ + display: inline-flex; + width: 510rpx; +} +.case-text-box{ + width: 100%; +} +.case-title{ + display: flex; + justify-content: space-between; +} +.case-title-text{ + font-size: 34rpx; + color: #333; + font-weight: bold; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.case-text{ + font-size: 28rpx; + color: #333; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.case-status{ + width: 160rpx; +} +.status{ + text-align: center; + background-color: #e7f3ff; + padding: 8rpx 15rpx; + font-size: 32rpx; + color: #f55054; + border-radius: 30rpx; + margin-bottom: 10rpx; +} +.status2{ + background-color: #fff7ec; + color: #bb5912; + margin-bottom: 0; +} +.bottom{ + line-height: 45rpx; + color: #f55054; + margin-top: 10rpx; +} +.bottom image{ + width: 45rpx; + height: 38rpx; + vertical-align: middle; + margin-top: -5rpx; +} +.btn-box{ + padding-top: 15rpx; + border-top: 1px dashed #ddd; + font-size: 0; +} +.btn{ + width: 32%; + margin-right: 2%; + text-align: center; + line-height: 60rpx; + border-radius: 10rpx; + color: #fff; + font-size: 32rpx; + display: inline-block; +} +.btn1{ + background-color: #f55054; +} +.btn2{ + background-color: #56b6de; +} +.btn3{ + background-color: #d70715; + margin-right: 0; +} \ No newline at end of file diff --git a/pages/center/case/caseLog.js b/pages/center/case/caseLog.js new file mode 100644 index 0000000..d6f3d71 --- /dev/null +++ b/pages/center/case/caseLog.js @@ -0,0 +1,85 @@ +// pages/caseLog/caseLog.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + businessId: '', + logList: [] + }, + getLog: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getLog, [app.baseUrls.requestUrl, self.data.businessId]), {}, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + console.log(data) + self.setData({ + logList: data + }) + }, function (code, data) { + console.log(data) + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + businessId: options.businessId + }) + this.getLog() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/center/case/caseLog.json b/pages/center/case/caseLog.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/center/case/caseLog.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/center/case/caseLog.wxml b/pages/center/case/caseLog.wxml new file mode 100644 index 0000000..069ed2e --- /dev/null +++ b/pages/center/case/caseLog.wxml @@ -0,0 +1,36 @@ + + + {{item.nodeStateTime}} + + + 节点名称: + {{item.nodeName}} + + + 开始时间: + {{item.nodeStateTime}} + + + 结束时间: + {{item.nodeEndTime}} + + + 耗时: + {{item.nodeTimeConsuming}} + + + 处理人: + {{item.nodeUserName }} + + + 处理状态: + 已完成 + 进行中 + + + 说明: + {{item.nodeSummary}} + + + + \ No newline at end of file diff --git a/pages/center/case/caseLog.wxss b/pages/center/case/caseLog.wxss new file mode 100644 index 0000000..e5b241a --- /dev/null +++ b/pages/center/case/caseLog.wxss @@ -0,0 +1,48 @@ +page{ + background-color: #fafafa; +} +.log{ + padding: 20rpx 30rpx; +} +.log-box{ + padding: 0 0 20rpx 35rpx; + border-left: 5px solid #dfefff; + position: relative; +} +.log-box::before{ + content: ''; + display: block; + width: 40rpx; + height: 40rpx; + border: 5px solid #dfefff; + background-color: #3096fa; + border-radius: 50%; + box-sizing: border-box; + position: absolute; + top: 0; + left: -25rpx; +} +.log-time{ + font-size: 36rpx; + color: #333; +} +.log-info{ + background-color: #fff; + border-radius: 20rpx; + padding: 15rpx; + margin-top: 10rpx; + border: 1px solid #EEE; +} +.log-row{ + line-height: 60rpx; + border-bottom: 1px solid #EEE; + display: flex; + font-size: 30rpx; +} +.row-name{ + width: 25%; + text-align: right; +} +.red{ + color: red; +} \ No newline at end of file diff --git a/pages/center/center.js b/pages/center/center.js new file mode 100644 index 0000000..600d701 --- /dev/null +++ b/pages/center/center.js @@ -0,0 +1,387 @@ +// pages/center/center.js +const app = getApp() +const md5 = require('../../utils/md5.js') +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + userIcon: '', + userName: '', + curCommunityName: '', + gridList: [], + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + userNameText: '', + userPassword: '', + showAuthentication:false, + isLoading: false + }, + // 获取头像 + checkPermission() { + var _self = this + try { + var names = wx.getStorageSync('name') + var icon = wx.getStorageSync('userIcon') + + if (names) { + this.setData({ + name: names, + userIcon: icon + }) + } else { + wx.showModal({ + title: '提示', + content: '小程序需要您微信头像以及昵称用于展示,请授权.', + showCancel: false, + success(res) { + if (res.confirm) { + _self.getUserProfile(3) + } + } + }) + } + } catch (error) { + wx.showToast({ + title: '获取信息失败', + icon: 'error' + }) + } + }, + getUserProfile(e) { + let _self = this + wx.getUserProfile({ + desc: '获取微信头像以及昵称用于展示', + success: (res) => { + wx.setStorage({ + data: res.userInfo.nickName, + key: 'name', + }) + wx.setStorage({ + data: res.userInfo.avatarUrl, + key: 'userIcon', + }) + _self.setData({ + name: res.userInfo.nickName, + userIcon: res.userInfo.avatarUrl + }) + app.globalData.userIcon = res.userInfo.avatarUrl + app.globalData.userInfo = res.userInfo + // _self.selectComponent('#head').refreshCart() + }, + fail(err) { + //判断是否绑定手机号 + wx.showToast({ + title: '获取个人信息失败', + icon: 'error', + }) + } + }) + }, + // 获取邻里统计-求助 + getHelpCount: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getHelpCount, [app.baseUrls.requestUrl]), { + problemTypeId: 'b99f796f-b3a0-4d52-b10e-6e387ebbcc1b', + areaCode: wx.getStorageSync('areaCode') + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + helpCount: data.data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取邻里统计-交友 + getFriendCount: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getHelpCount, [app.baseUrls.requestUrl]), { + problemTypeId: '99cf4a4e-22a2-49b2-9274-4519cd47cefd' + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + friendCount: data.data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取邻里统计-其他 + getOtherCount: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getHelpCount, [app.baseUrls.requestUrl]), { + problemTypeId: '02a11dc0-9656-4504-8c11-030a28914ff3' + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + otherCount: data.data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 网格员认证 + checkGrid: function () { + this.setData({ + showAuthentication: true + }) + wx.hideTabBar({ + animation: false, + }) + }, + // 获取网格员列表 + getGridList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getGridListPage, [app.baseUrls.requestUrl]), { + page: 1, + rows: 3, + areaCode: wx.getStorageSync('areaCode') + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + self.setData({ + gridList: data.rows + }) + } + }, function (code, data) { + console.log(data) + }) + }, + // 提交网格员认证 + doAuthentication: function () { + var self = this + if (!self.data.isLoading) { + var info = { + userName: self.data.userNameText, + passWord: md5.hexMD5(md5.hexMD5(md5.hexMD5(self.data.userPassword))) + } + self.setData({ + isLoading: true + }) + app.restAjax.get(app.restAjax.path(app.apis.checkGrid, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + wx.hideLoading() + if (data.data == true) { + wx.showToast({ + title: '认证成功!', + icon: 'success' + }) + self.setData({ + showAuthentication: false, + userNameText: '', + userPassword: '', + isLoading: false + }) + wx.showTabBar({ + animation: false, + }) + self.getGridList() + } else { + wx.showToast({ + title: '认证失败!', + icon: 'error' + }) + self.setData({ + isLoading: false + }) + } + }, function (code, data) { + console.log(data) + wx.showToast({ + title: data.msg, + icon: 'error' + }) + self.setData({ + isLoading: false + }) + }) + } + }, + // 关闭认证 + closeAuthentication: function () { + this.setData({ + showAuthentication: false, + userNameText: '', + userPassword: '' + }) + wx.showTabBar({ + animation: false, + }) + }, + // 快速反馈-更多 + checkGridMore: function () { + wx.navigateTo({ + url: './contact', + }) + }, + checkMoreCase: function () { + wx.navigateTo({ + url: './case/caseList', + }) + }, + checkCaseStatus: function (e) { + var status = e.currentTarget.dataset.status + var search = '' + if (status == '2') { + search = '?handleStatus=2' + } else { + search = '?isAccept=' + status + } + wx.navigateTo({ + url: './case/caseList' + search, + }) + }, + // 联系网格员 + contactGrid: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: './contact/contactDetail?gridMiniId=' + id, + }) + }, + // 获取头像 + checkPermission() { + var _self = this + try { + var names = wx.getStorageSync('name') + var icon = wx.getStorageSync('userIcon') + + if (names) { + this.setData({ + name: names, + userIcon: icon + }) + } else { + wx.showModal({ + title: '提示', + content: '小程序需要您微信头像以及昵称用于展示,请授权.', + showCancel: false, + success(res) { + if (res.confirm) { + _self.getUserProfile(3) + } + } + }) + } + } catch (error) { + wx.showToast({ + title: '获取信息失败', + icon: 'error' + }) + } + }, + getUserProfile(e) { + let _self = this + wx.getUserProfile({ + desc: '获取微信头像以及昵称用于展示', + success: (res) => { + wx.setStorage({ + data: res.userInfo.nickName, + key: 'name', + }) + wx.setStorage({ + data: res.userInfo.avatarUrl, + key: 'userIcon', + }) + _self.setData({ + userName: res.userInfo.nickName, + userIcon: res.userInfo.avatarUrl + }) + app.globalData.userIcon = res.userInfo.avatarUrl + app.globalData.userInfo = res.userInfo + // _self.selectComponent('#head').refreshCart() + }, + fail(err) { + //判断是否绑定手机号 + wx.showToast({ + title: '获取个人信息失败', + icon: 'error', + }) + } + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getHelpCount() + this.getFriendCount() + this.getOtherCount() + if (!wx.getStorageSync('userIcon')) { + this.checkPermission() + } + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getGridList() + this.setData({ + userIcon: wx.getStorageSync('userIcon'), + userName: wx.getStorageSync('name'), + curCommunityName: wx.getStorageSync('curCommunityName') + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/center/center.json b/pages/center/center.json new file mode 100644 index 0000000..7f39eb5 --- /dev/null +++ b/pages/center/center.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的" +} \ No newline at end of file diff --git a/pages/center/center.wxml b/pages/center/center.wxml new file mode 100644 index 0000000..908fbac --- /dev/null +++ b/pages/center/center.wxml @@ -0,0 +1,107 @@ + + + + 网格员认证>> + + + + + + 上报案件 + 查看更多 + + + + + 待受理 + + + + 已受理 + + + + 已完结 + + + + + + + 快速反馈 + 查看更多 + + + + + + {{item.userUserName}} + 网格员 + 立即联系 + + + + + + 邻里互助 + + + + 交友 + {{friendCount}} + + + 求助 + {{helpCount}} + + + 其他 + {{otherCount}} + + + + + + + + + + + + 立即认证 + + + \ No newline at end of file diff --git a/pages/center/center.wxss b/pages/center/center.wxss new file mode 100644 index 0000000..e29846b --- /dev/null +++ b/pages/center/center.wxss @@ -0,0 +1,232 @@ +.center-top{ + padding: 20rpx 20rpx 120rpx 40rpx; + background-color: #FF4949; + border-bottom-left-radius: 120rpx; + border-bottom-right-radius: 120rpx; +} +.user-info{ + display: flex; +} +.user-info image{ + width: 120rpx; + height: 120rpx; + border-radius: 50%; + margin-right: 20rpx; +} +.name{ + font-size: 34rpx; + color: #fff; + margin: 10rpx 0; +} +.user-community{ + border-radius: 34rpx; + background-color: rgba(0, 0, 0, 0.22); + color: #fff; + font-size: 28rpx; + line-height: 50rpx; + text-align: center; + padding: 0 20rpx; +} +.integral{ + display: flex; + margin-top: 40rpx; +} +.integral-box{ + flex: 1; + text-align: center; +} +.integral-count{ + font-size: 40rpx; + color: #fff; +} +.integral-name{ + font-size: 28rpx; + color: #fff; +} + +.case, .contact, .help{ + width: 710rpx; + margin: -100rpx auto 0; + padding: 20rpx; + box-sizing: border-box; + background-color: #fff; + position: relative; + border-radius: 14rpx; +} +.case{ + padding: 25rpx 20rpx; +} +.case-title{ + display: flex; + justify-content: space-between; + margin-bottom: 20rpx; + padding: 0 20rpx; +} +.help-title{ + padding: 0; +} +.title{ + font-weight: bold; + font-size: 30rpx; +} +.more{ + font-size: 28rpx; + color: #A6A6A6; +} +.case-count, .contact-people{ + display: flex; +} +.case-count-box{ + flex: 1; + text-align: center; +} +.case-count-box image{ + width: 80rpx; + height: 80rpx; +} +.case-count-name{ + font-size: 30rpx; + color: #010101; +} +.contact{ + margin-top: 20rpx; + background-color: transparent; + padding: 0; +} +.contact-container{ + white-space: nowrap; + overflow-x: auto; +} +.contact-box{ + background-color: #fff; + padding: 20rpx; + border-radius: 14rpx; + display: inline-block; + width: 32%; + margin-right: 3%; + text-align: center; +} +.contact-box:last-child{ + margin-right: 0; +} +.contact-box image{ + width: 100rpx; + height: 100rpx; + border-radius: 50%; +} +.contact-name{ + font-size: 32rpx; + color: #101010; + margin-top: 15rpx; +} +.contact-type{ + font-size: 28rpx; + color: #A6A6A6; +} +.contact-btn{ + background-color: #FF4949; + color: #fff; + font-size: 28rpx; + border-radius: 25rpx; + padding: 0 10rpx; + width: 140rpx; + height: 50rpx; + line-height: 50rpx; + /* margin-top: 25rpx; */ + margin: 25rpx auto 0; +} +.help{ + margin-top: 20rpx; +} +.help-type{ + display: flex; + justify-content: space-between; + height: 60rpx; + line-height: 60rpx; +} +.type-name{ + font-size: 30rpx; + color: #101010; +} +.type-count{ + font-size: 30rpx; + color: #9B9B9B; +} +.card{ + margin-top: 20rpx; +} +.user-btn{ + display: flex; + justify-content: space-between; + width: 730rpx; +} +.btn{ + height: 60rpx; + line-height: 60rpx; + padding: 0 15rpx 0 30rpx; + color: #fff; + border-radius: 40rpx; + margin-top: 30rpx; + border-radius: 30rpx 0px 0px 30rpx; + background-color: rgb(219, 42, 42); +} +.authentication{ + position: fixed; + top: 0; + bottom: 0; + right: 0; + left: 0; + background-color: rgba(0,0,0,0.6); +} +.authentication-container{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 710rpx; + font-size: 0; +} +.authentication-container image{ + width: 100%; +} +.authentication-box{ + padding: 60rpx 40rpx; + background-color: #fff; +} +.authentication-box input{ + width: 100%; + height: 80rpx; + margin-bottom: 20rpx; + font-size: 32rpx; + border-radius: 40rpx; + background-color: #F3F3F3; + padding: 0 30rpx; + box-sizing: border-box; +} +.authentication-btn{ + width: 100%; + text-align: center; + line-height: 80rpx; + background-color: #f55054; + color: #fff; + font-size: 32rpx; + border-radius: 40rpx; +} +.authentication-img{ + position: relative; +} +.close{ + position: absolute; + width: 50rpx !important; + height: 50rpx; + top: -25rpx; + right: -15rpx; +} +.no-padding{ + padding: 0; +} +.more image{ + height: 24rpx; + vertical-align: top; + margin-top: 8rpx; +} \ No newline at end of file diff --git a/pages/center/contact.js b/pages/center/contact.js new file mode 100644 index 0000000..f332cd2 --- /dev/null +++ b/pages/center/contact.js @@ -0,0 +1,93 @@ +// pages/center/contact.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + sourceUrl: app.baseUrls.sourceUrl, + gridList: [] + }, + getGridList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getGridList, [app.baseUrls.requestUrl]), { + areaCode: wx.getStorageSync('areaCode') + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + gridList: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 联系网格员 + contactGrid: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: './contact/contactDetail?gridMiniId=' + id, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.getGridList() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/center/contact.json b/pages/center/contact.json new file mode 100644 index 0000000..4366052 --- /dev/null +++ b/pages/center/contact.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "快速反馈" +} \ No newline at end of file diff --git a/pages/center/contact.wxml b/pages/center/contact.wxml new file mode 100644 index 0000000..4967dd4 --- /dev/null +++ b/pages/center/contact.wxml @@ -0,0 +1,13 @@ + + + + + + + {{item.userUserName}} + 网格员 + + + 立即联系 + + \ No newline at end of file diff --git a/pages/center/contact.wxss b/pages/center/contact.wxss new file mode 100644 index 0000000..25f0c1d --- /dev/null +++ b/pages/center/contact.wxss @@ -0,0 +1,47 @@ +.contact{ + padding: 0 20rpx; + background-color: #fff; +} +.contact-box{ + padding: 20rpx 0; + border-bottom: 1px solid #DDD; + display: flex; + justify-content: space-between; +} +.contact-box:last-child{ + border-bottom: none; +} +.contact-info{ + display: flex; +} +.contact-info image{ + width: 120rpx; + height: 120rpx; + margin-right: 10rpx; + border-radius: 50%; +} +.name{ + font-size: 34rpx; + margin: 15rpx 0 10rpx; +} +.type{ + font-size: 28rpx; + color: #A6A6A6; +} +.contact-btn{ + font-size: 32rpx; + color: #fff; + background-color: #FF4949; + border-radius: 40rpx; + padding: 0 15rpx; + height: 50rpx; + line-height: 50rpx; + margin-top: 25rpx; +} + + + + + + + diff --git a/pages/center/contact/contactDetail.js b/pages/center/contact/contactDetail.js new file mode 100644 index 0000000..1c05805 --- /dev/null +++ b/pages/center/contact/contactDetail.js @@ -0,0 +1,136 @@ +// pages/center/contact/contactDetail.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + sourceUrl: app.baseUrls.sourceUrl, + gridMiniId: '', + gridDetail: {}, + showCode: false + }, + getGridDetail: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getGirdDetail, [app.baseUrls.requestUrl, self.data.gridMiniId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + gridDetail: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 显示名片码 + showCardCode: function () { + this.setData({ + showCode: true + }) + }, + // 隐藏 + hideCardCode: function () { + this.setData({ + showCode: false + }) + }, + // 复制文本 + copyText: function (e) { + var self = this + var text = e.currentTarget.dataset.text + if (text) { + wx.setClipboardData({ + data: text, + success: function () {} + }) + } else { + wx.showToast({ + title: '暂无微信信息', + icon: 'none' + }) + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + gridMiniId: options.gridMiniId + }) + this.getGridDetail() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage(res) { + var self = this + wx.showShareMenu({ + withShareTicket: true, + success: function (res) { + console.log(res) + } + }) + + if (res.from == 'button') { + var postId = self.buildId() + self.shareRecord(postId) + + var param = '/center/contact/contactDetail?gridMiniId=' + self.data.gridMiniId; + return { + title: '名片分享', + path: param, + // imageUrl: self.data.shareImgUrl + } + // return返回 title 转发标题 path 路径 imageUrl 自定义图片,可以本地路径 代码包文件路径 支持png jpg 显示长宽比5:4 + } + } +}) \ No newline at end of file diff --git a/pages/center/contact/contactDetail.json b/pages/center/contact/contactDetail.json new file mode 100644 index 0000000..be4e6c0 --- /dev/null +++ b/pages/center/contact/contactDetail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "立即联系" +} \ No newline at end of file diff --git a/pages/center/contact/contactDetail.wxml b/pages/center/contact/contactDetail.wxml new file mode 100644 index 0000000..c659a0d --- /dev/null +++ b/pages/center/contact/contactDetail.wxml @@ -0,0 +1,48 @@ + + + + + + + {{gridDetail.userUserName}} + + + + {{gridDetail.phone}} + + + + {{gridDetail.address}} + + + + + + + + 复制微信 + + + + 名片码 + + + + + + + + + {{gridDetail.userUserName}} + + + \ No newline at end of file diff --git a/pages/center/contact/contactDetail.wxss b/pages/center/contact/contactDetail.wxss new file mode 100644 index 0000000..4ef23f0 --- /dev/null +++ b/pages/center/contact/contactDetail.wxss @@ -0,0 +1,158 @@ +.container{ + margin-bottom: 120rpx; +} +.top-bg{ + position: absolute; + top: 0; + left: 0; + right: 0; + padding: 20rpx 20rpx 150rpx; + border-bottom-left-radius: 80rpx; + border-bottom-right-radius: 80rpx; + background-color: #FF4949; + z-index: -10; +} +.card{ + width: 100%; + height: 0; + position: relative; + padding-bottom: 56%; + background-color: #fff; + border-top-left-radius: 10rpx; + border-top-right-radius: 10rpx; +} +.photo{ + position: absolute; + left: 20rpx; + top: 0; + bottom: 0; + width: 300rpx; +} +.photo image{ + height: 100%; + max-width: 100%; +} +.name{ + position: absolute; + top: 40rpx; + left: 340rpx; + font-size: 36rpx; + font-weight: bold; +} +.desc{ + position: absolute; + left: 340rpx; + top: 125rpx; + display: -webkit-box; + overflow: hidden; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + font-size: 30rpx; +} +.phone{ + position: absolute; + left: 340rpx; + bottom: 120rpx; + font-size: 28rpx; + line-height: 30rpx; + color: #a8a8a8; +} +.phone image{ + width: 30rpx; + height: 30rpx; + vertical-align: middle; + margin-top: -8rpx; +} +.position{ + bottom: 80rpx; +} +.qr-code{ + position: absolute; + bottom: 30rpx; + right: 24rpx; + width: 60rpx; + height: 60rpx; +} +.qr-code image{ + width: 100%; + height: 100%; +} +.card-btn{ + display: flex; + padding: 20rpx 0; + background-color: #fbfbfb; +} +.card-btn-box{ + flex: 1; + text-align: center; + width: auto !important; + padding: 0 !important; + background-color: transparent !important; +} +.card-btn-box image{ + height: 40rpx; + margin-bottom: 10rpx; +} +.btn-name{ + font-size: 28rpx; + color: #958A8A; +} +.intro{ + margin-top: 20rpx; + padding: 40rpx 0; + background-color: #fff; + border-radius: 10rpx; +} +.intro-title{ + padding-left: 20rpx; + border-left: 4px solid #FF4949; + font-size: 36rpx; + font-weight: bold; + color: #101010; + margin-bottom: 20rpx; + box-sizing: border-box; +} +.intro-content{ + padding: 0 20rpx; + font-size: 30rpx; + line-height: 50rpx; +} +.card-code{ + position: fixed; + top: 0; + bottom: 0; + right: 0; + left: 0; + background-color: #FF4949; +} +.card-code-container{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 600rpx; + text-align: center; + background-color: #fff; + border-radius: 20rpx; + padding-bottom: 80rpx; +} +.code-photo{ + border: 8rpx solid #FFF; + width: 200rpx; + height: 200rpx; + margin-top: -104rpx; + border-radius: 50%; +} +.code-name{ + font-size: 40rpx; + color: #4A4A4A; + margin: 20rpx 0 60rpx; +} +.code-img{ + width: 360rpx; +} + + + + + diff --git a/pages/checkIn/checkIn.js b/pages/checkIn/checkIn.js new file mode 100644 index 0000000..8228823 --- /dev/null +++ b/pages/checkIn/checkIn.js @@ -0,0 +1,96 @@ +// pages/checkIn/checkIn.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + userIcon: '', + name: '', + isChecked: false + }, + getIsCheckedIn: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.isCheckedIn, [app.baseUrls.requestUrl, wx.getStorageSync('curCommunityId')]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (data == 'yes') { + self.setData({ + isChecked: true + }) + } + }, function (code, data) { + console.log(data) + }) + }, + doCheckIn: function () { + wx.navigateTo({ + url: './checkInDetail', + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + userIcon: wx.getStorageSync('userIcon'), + name: wx.getStorageSync('name') + }) + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getIsCheckedIn() + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/checkIn/checkIn.json b/pages/checkIn/checkIn.json new file mode 100644 index 0000000..d39af52 --- /dev/null +++ b/pages/checkIn/checkIn.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "党员报到" +} \ No newline at end of file diff --git a/pages/checkIn/checkIn.wxml b/pages/checkIn/checkIn.wxml new file mode 100644 index 0000000..49c2e4c --- /dev/null +++ b/pages/checkIn/checkIn.wxml @@ -0,0 +1,21 @@ + + + + + + + + + + + 立即报到 + + + + + 我已承办社区事务(0) + \ No newline at end of file diff --git a/pages/checkIn/checkIn.wxss b/pages/checkIn/checkIn.wxss new file mode 100644 index 0000000..722cce5 --- /dev/null +++ b/pages/checkIn/checkIn.wxss @@ -0,0 +1,71 @@ +.top-img image{ + width: 100%; +} +.person-info{ + margin-top: -126rpx; + padding: 0 20rpx; + position: relative; +} +.person-info-box{ + background-color: #fff; + border-radius: 10rpx; + padding: 20rpx; + box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.05); + display: flex; + justify-content: space-between; +} +.person-info-box image{ + width: 120rpx; + height: 120rpx; + border-radius: 50%; +} +.user-info{ + display: inline-block; + vertical-align: top; + margin-left: 20rpx; +} +.user-name{ + font-size: 36rpx; + font-weight: bold; + line-height: 70rpx; +} +.check-status{ + margin-top: 0; + font-size: 30rpx; + height: 40rpx; + line-height: 40rpx; +} +.not-check{ + background-color: #EEE; + color: #ccc; +} +.affair{ + width: 710rpx; + margin: 20rpx auto 0; + background-color: #fff; + padding: 20rpx; + box-sizing: border-box; +} +.affair text{ + color: red; +} +.affair-title{ + font-size: 32rpx; + border-left: 5px solid #FF4949; + padding-left: 20rpx; + color: #101010; +} +.checkin-btn{ + width: 160rpx; + height: 60rpx; + line-height: 60rpx; + border-radius: 30rpx; + background-color: rgba(255, 73, 73, 100); + color: rgba(255, 255, 255, 100); + font-size: 28rpx; + text-align: center; + margin-top: 30rpx; +} + + + diff --git a/pages/checkIn/checkInDetail.js b/pages/checkIn/checkInDetail.js new file mode 100644 index 0000000..e74198d --- /dev/null +++ b/pages/checkIn/checkInDetail.js @@ -0,0 +1,235 @@ +// pages/checkIn/checkInDetail.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + array: [], + index: 0, + sexSelected: '', + communityArray: [], + communityIndex: 0, + communitySelected: '', + neighbourArray: ['请选择所在小区'], + neighbourIndex: 0, + date: '请选择出生日期', + partyDate: '请选择入党时间', + floorNum: '', + roomNum: '', + affair: '', + realName: '', + workUnit: '', + isLoading: false + }, + // 选择性别 + bindPickerChange: function(e) { + var self = this + this.setData({ + index: e.detail.value, + sexSelected: self.data.sexAll[e.detail.value - 1].dataId + }) + }, + // 选择出生日期 + bindDateChange: function(e) { + this.setData({ + date: e.detail.value + }) + }, + // 选择入党时间 + bindPartyDateChange: function(e) { + this.setData({ + partyDate: e.detail.value + }) + }, + // 选择社区 + bindCommunityPickerChange: function (e) { + var self = this + this.setData({ + communityIndex: e.detail.value, + communitySelected: self.data.communityAll[e.detail.value - 1].communityId + }) + }, + // 选择小区 + bindNeighbourPickerChange: function (e) { + this.setData({ + neighbourIndex: e.detail.value + }) + }, + // 提交报到 + submitCheckIn: function () { + var self = this + if (!self.data.isLoading) { + var info = { + userName: self.data.realName, + sexId: self.data.sexSelected, + sexName: self.data.sexAll[self.data.index - 1].dataName, + birthday: self.data.date, + joinTime: self.data.partyDate, + workUnit: self.data.workUnit, + workUnitValue: '非ID', + community: self.data.communitySelected, + residential: self.data.communityAll[self.data.neighbourIndex - 1].residential, + residentialValue: self.data.communityAll[self.data.neighbourIndex - 1].residentialValue, + building: self.data.floorNum, + buildingValue: '非ID', + houseNumber: self.data.roomNum, + houseNumberValue: '非ID', + ability: self.data.affair, + // areaId: wx.getStorageSync('areaId'), + areaCode: wx.getStorageSync('areaCode') + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.submitCheckIn, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + wx.showToast({ + title: '报到成功', + icon: 'success' + }) + setTimeout(function () { + self.setData({ + isLoading: false + }) + wx.navigateBack({ + delta: 1 + }) + }, 1500) + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + // 获取性别 + getSex: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getDictionary, [app.baseUrls.serviceUrl, '4ef46940-76ab-4758-b5f0-0cbc93ffc660']), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + console.log(data) + var arr = ['请选择性别'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].dataName) + } + self.setData({ + array: arr, + sexAll: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取我的社区 + getMyCommunity: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.mycommunity, [app.baseUrls.requestUrl]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = ['请选择所在社区'] + var arr1 = self.data.neighbourArray + for (let i = 0; i < data.length; i++) { + arr.push(data[i].communityName) + if (data[i].residentialValue == 'ID') { + self.getResidential(data[i].residential) + } else { + arr1.push(data[i].residential) + } + } + self.setData({ + communityArray: arr, + communityAll: data + }) + }, function (code, data) { + console.log(data) + }) + }, + getResidential: function (id) { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getResidential, [app.baseUrls.communityUrl, id]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = self.data.neighbourArray + arr.push(data.residentialName) + self.setData({ + neighbourArray: arr + }) + }, function (code, data) { + console.log(data) + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getSex() + this.getMyCommunity() + this.setData({ + curCommunityName: wx.getStorageSync('curCommunityName') ? wx.getStorageSync('curCommunityName'): '切换社区', + curCommunityId: wx.getStorageSync('curCommunityId') ? wx.getStorageSync('curCommunityId') : '' + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/checkIn/checkInDetail.json b/pages/checkIn/checkInDetail.json new file mode 100644 index 0000000..d39af52 --- /dev/null +++ b/pages/checkIn/checkInDetail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "党员报到" +} \ No newline at end of file diff --git a/pages/checkIn/checkInDetail.wxml b/pages/checkIn/checkInDetail.wxml new file mode 100644 index 0000000..34225b0 --- /dev/null +++ b/pages/checkIn/checkInDetail.wxml @@ -0,0 +1,92 @@ + + 温馨提示:绑定房屋需要您在首页加入并选择您所在的社区。 + + + 当前社区 +{{curCommunityName}} + + + + 姓名 + + + + + + 性别 + + + + {{array[index]}} + + + + + + 出生日期 + + + + {{date}} + + + + + + 入党时间 + + + + {{partyDate}} + + + + + + 工作单位 + + + + + + 所在居住社区 + + + + {{communityArray[communityIndex]}} + + + + + + 所在小区 + + + + {{neighbourArray[neighbourIndex]}} + + + + + + 所在楼栋 + + + + + + 单元/门牌号 + + + + + + 适合承办事务 + + + + + + + 立即报到 + \ No newline at end of file diff --git a/pages/checkIn/checkInDetail.wxss b/pages/checkIn/checkInDetail.wxss new file mode 100644 index 0000000..0cfec2c --- /dev/null +++ b/pages/checkIn/checkInDetail.wxss @@ -0,0 +1,75 @@ +.tips{ + color: #101010; + font-size: 28rpx; + padding: 20rpx; +} +.detail{ + padding: 0 20rpx; + background-color: #fff; +} +.row{ + display: flex; + justify-content: space-between; + border-bottom: 1px solid #DDD; +} +.row-name{ + font-size: 32rpx; + line-height: 80rpx; + width: 30%; + color: rgba(36, 40, 46, 0.5); +} +.row-content{ + width: 70%; + height: 80rpx; + text-align: right; +} +.row-content input{ + width: 100%; + height: 100%; + padding: 0 10rpx; + box-sizing: border-box; + color: #24282E; +} +.input-color{ + color: #24282E; +} +.row-content picker{ + line-height: 80rpx; + color: #24282E; +} +.submit-join{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 20rpx; + background-color: #fff; +} +.join-btn{ + margin-top: 0; + height: 80rpx; + text-align: center; + border-radius: 40rpx; + line-height: 80rpx; + font-size: 36rpx; + background-color: #FF4949; +} +.community{ + background-color: #fff; + padding: 0 20rpx; + color: rgba(36, 40, 46, 0.50); + font-size: 30rpx; + line-height: 80rpx; +} +.community-name{ + font-size: 32rpx; + border-bottom: 1px solid #DDD; +} + + + + + + + + diff --git a/pages/community/changeCommunity.js b/pages/community/changeCommunity.js new file mode 100644 index 0000000..f87afbd --- /dev/null +++ b/pages/community/changeCommunity.js @@ -0,0 +1,265 @@ +// pages/community/changeCommunity.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + areaList: [], + areaIndex: 0, + areaAll: [], + areaSelected: '', + areaName: '', + communityList: [], + myCommunityList: [], + page: { + rows: 10, + page: 1, + areaCode: '' + }, + }, + // 获取地区列表 + getAreaList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getArea, [app.baseUrls.serviceUrl, '110889']), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = self.data.areaList + for (let i = 0; i < data.length; i++) { + arr.push(data[i].areaName) + } + self.setData({ + areaList: arr, + areaAll: data, + areaSelected: data[0].areaCode, + areaName: data[0].areaName, + ['page.areaCode']: data[0].areaCode + }) + self.getCommunity() + }, function (code, data) { + console.log(data) + }) + }, + getCommunity: function () { + var self = this + var info = self.data.page + if (self.data.keywords) { + info['keywords'] = self.data.keywords + } + app.restAjax.get(app.restAjax.path(app.apis.getCommunityListPage, [app.baseUrls.communityUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (self.data.page.page == 1) { + self.setData({ + communityList: data.rows + }) + } else { + if (data.rows.length > 0) { + var arr = self.data.communityList + for (let i = 0; i < data.rows.length; i++) { + arr.push(data.rows[i]) + } + self.setData({ + communityList: arr + }) + } else { + self.setData({ + ['page.page']: self.data.page.page - 1 + }) + } + + } + if (data.rows.length < 10) { + self.setData({ + haveMore: false + }) + } + }, function (code, data) { + console.log(data) + }) + }, + // 选择区域 + bindAreaPickerChange: function (e) { + var self = this + this.setData({ + areaIndex: e.detail.value, + areaSelected: self.data.areaAll[e.detail.value].areaCode, + ['page.areaCode']: self.data.areaAll[e.detail.value].areaCode, + ['page.page']: 1, + haveMore: true + }) + this.getCommunity() + }, + // 获取我所在的社区列表 + getMyCommunity: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.mycommunity, [app.baseUrls.requestUrl]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + myCommunityList: data + }) + }, function (code, data) { + console.log(data) + }) + }, + otherCommunity: function () { + wx.navigateTo({ + url: './selectCommunity', + }) + }, + selectCommunity: function (e) { + var info = { + communityId: e.currentTarget.dataset.item.communityId, + communityName: e.currentTarget.dataset.item.communityName + } + app.globalData.currentCommunity = info + wx.setStorage({ + data: e.currentTarget.dataset.item.communityName, + key: 'curCommunityName' + }) + wx.setStorage({ + data: e.currentTarget.dataset.item.communityId, + key: 'curCommunityId' + }) + wx.setStorage({ + data: e.currentTarget.dataset.item.locationCode, + key: 'areaCode' + }) + wx.setStorage({ + data: parseInt(e.currentTarget.dataset.item.areaLevel), + key: 'areaLevel' + }) + // wx.setStorage({ + // data: e.currentTarget.dataset.item.areaId, + // key: 'areaId' + // }) + wx.reLaunch({ + url: '../index/index', + }) + }, + selectMyCommunity: function (e) { + var info = { + communityId: e.currentTarget.dataset.item.communityId, + communityName: e.currentTarget.dataset.item.communityName + } + app.globalData.currentCommunity = info + wx.setStorage({ + data: e.currentTarget.dataset.item.communityName, + key: 'curCommunityName' + }) + wx.setStorage({ + data: e.currentTarget.dataset.item.communityId, + key: 'curCommunityId' + }) + wx.setStorage({ + data: e.currentTarget.dataset.item.areaCode, + key: 'areaCode' + }) + wx.setStorage({ + data: '4', + key: 'areaLevel' + }) + // wx.setStorage({ + // data: e.currentTarget.dataset.item.areaId, + // key: 'areaId' + // }) + wx.reLaunch({ + url: '../index/index', + }) + }, + loadMore: function () { + var self = this + this.setData({ + ['page.page']: self.data.page.page + 1 + }) + this.getCommunity() + }, + enterCurrentArea: function () { + var self = this + wx.setStorage({ + data: self.data.areaAll[self.data.areaIndex].areaName, + key: 'curCommunityName' + }) + wx.setStorage({ + data: self.data.areaAll[self.data.areaIndex].areaId, + key: 'curCommunityId' + }) + wx.setStorage({ + data: self.data.page.areaCode, + key: 'areaCode' + }) + wx.setStorage({ + data: parseInt(self.data.areaAll[self.data.areaIndex].areaLevel), + key: 'areaLevel' + }) + wx.reLaunch({ + url: '../index/index', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getAreaList() + this.getMyCommunity() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/community/changeCommunity.json b/pages/community/changeCommunity.json new file mode 100644 index 0000000..5112ba2 --- /dev/null +++ b/pages/community/changeCommunity.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "切换社区" +} \ No newline at end of file diff --git a/pages/community/changeCommunity.wxml b/pages/community/changeCommunity.wxml new file mode 100644 index 0000000..38c0081 --- /dev/null +++ b/pages/community/changeCommunity.wxml @@ -0,0 +1,37 @@ + + + + + + {{areaList[areaIndex]}} + + + + + + 选择社区 + + + + {{areaList[areaIndex]}} + + 进入 + + + + {{item.communityName}} + + 进入 + + 加载更多 + + + + 我的社区 + + + {{item.communityName}} + + 进入 + + \ No newline at end of file diff --git a/pages/community/changeCommunity.wxss b/pages/community/changeCommunity.wxss new file mode 100644 index 0000000..5aef468 --- /dev/null +++ b/pages/community/changeCommunity.wxss @@ -0,0 +1,112 @@ +page{ + background-color: #fff; +} +.select{ + font-size: 32rpx; + color: rgba(36, 40, 46, 0.50); + line-height: 80rpx; +} +.community-box{ + padding: 20rpx 0; + height: 90rpx; + line-height: 50rpx; + border-bottom: 1px solid #F9FAFC; + display: flex; + justify-content: space-between; + font-size: 30rpx; +} +.other-community{ + margin-top: 20rpx; + height: 80rpx; + line-height: 80rpx; + text-align: center; + font-size: 32rpx; + border: 1px solid red; + border-radius: 10rpx; + color: red; +} +.area{ + line-height: 100rpx; + padding: 0 40rpx; + border-bottom-left-radius: 40rpx; + border-bottom-right-radius: 40rpx; + border-bottom: 1px solid #F9FAFC; + box-shadow: 0px 4rpx 20rpx 0px rgba(0, 0, 0, 0.05); +} +.area picker{ + font-size: 32rpx; +} +.area picker image{ + width: 32rpx; + margin: -6rpx 10rpx 0 0; + vertical-align: middle; +} +.picker{ + display: inline-flex; + justify-content: space-between; + width: 92%; +} +.picker image{ + margin-top: 30rpx !important; +} +.community-name image{ + width: 50rpx; + height: 50rpx; + vertical-align: top; +} +.community-status{ + height: 50rpx; + line-height: 50rpx; + padding: 0 30rpx; + border: 1px solid #FF4949; + color: #FF4949; + border-radius: 40rpx; +} +.community{ + padding: 0 20rpx; + min-height: 600rpx; +} +.current-area{ + padding: 20rpx 0; + border-bottom: 1px solid #F9FAFC; + display: flex; + justify-content: space-between; +} +.area-text image{ + width: 50rpx; + height: 50rpx; + margin-right: 20rpx; +} +.area-text{ + height: 50rpx; + line-height: 50rpx; + display: flex; + font-size: 32rpx; + color: #000; +} +.area-join{ + height: 50rpx; + line-height: 50rpx; + padding: 0 30rpx; + border: 1px solid #FF4949; + color: #FFF; + background-color: #FF4949; + border-radius: 40rpx; +} +.community-name{ + padding-left: 70rpx; + color: #7E7F82; +} +.load-more{ + font-size: 32rpx; + text-align: center; + line-height: 80rpx; +} +.my-community{ + padding: 0 20rpx; + border-top: 2px solid #F9FAFC; +} +.my-community .community-name{ + padding-left: 0; + color: #000; +} \ No newline at end of file diff --git a/pages/community/join/joinDetail.js b/pages/community/join/joinDetail.js new file mode 100644 index 0000000..f216e28 --- /dev/null +++ b/pages/community/join/joinDetail.js @@ -0,0 +1,204 @@ +// pages/community/join/joinDetail.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + array: ['商业住宅小区','个人自建房'], + index: 0, + xqArray: [], + xqAll: [], + xqIndex: 0, + xqSelected: '', + communityName: '', + communityId: '', + locationCode: '', + houseName: '', + roomNum: '', + floorNum: '', + isLoading: false + }, + // 建筑类型 + bindPickerChange: function(e) { + this.setData({ + index: e.detail.value + }) + }, + // 小区 + bindPickerChange1: function(e) { + var self = this + var result + if (e.detail.value == 0) { + result = '' + } else { + result = self.data.xqAll[e.detail.value - 1].residentialId + } + this.setData({ + xqIndex: e.detail.value, + xqSelected: result + }) + + }, + submitJoin: function () { + var self = this + if (!self.data.isLoading) { + if (self.data.xqIndex == 0 && !self.data.houseName) { + wx.showToast({ + title: '请选择小区', + icon: 'error' + }) + return + } + if (!self.data.floorNum) { + wx.showToast({ + title: '请输入楼栋', + icon: 'error' + }) + return + } + if (!self.data.roomNum) { + wx.showToast({ + title: '请输入门牌号', + icon: 'error' + }) + return + } + var residential, residentialValue + if (self.data.xqSelected) { + residential = self.data.xqSelected + residentialValue = 'ID' + } else { + residential = self.data.houseName + residentialValue = '非ID' + } + var info = { + communityId: self.data.communityId, + areaId:self.data.communityId, + areaCode: self.data.locationCode, + communityName: self.data.communityName, + buildingType: self.data.array[self.data.index], + residential: residential, + residentialValue: residentialValue, + building: self.data.floorNum, + houseNumber: self.data.roomNum, + buildingValue: '非ID', + houseNumberValue: '非ID', + locationCode: self.data.locationCode + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.joinCommunity, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + wx.showToast({ + title: '加入成功', + icon: 'success' + }) + setTimeout(function () { + self.setData({ + isLoading: false + }) + wx.navigateBack({ + delta: 2 + }) + }, 1500) + }, function (code, data) { + console.log(data) + wx.showToast({ + title: data.msg, + icon: 'error' + }) + self.setData({ + isLoading: false + }) + }) + } + }, + getHouseList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getHouse, [app.baseUrls.communityUrl]), { + areaCode: self.data.locationCode + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = ['请选择小区'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].residentialName) + } + self.setData({ + xqArray: arr, + xqAll: data + }) + }, function (code, data) { + console.log(data) + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + communityName: options.communityName, + communityId: options.communityId, + locationCode: options.locationCode + }) + this.getHouseList() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/community/join/joinDetail.json b/pages/community/join/joinDetail.json new file mode 100644 index 0000000..dc8e80a --- /dev/null +++ b/pages/community/join/joinDetail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "加入社区/村委会" +} \ No newline at end of file diff --git a/pages/community/join/joinDetail.wxml b/pages/community/join/joinDetail.wxml new file mode 100644 index 0000000..8199b91 --- /dev/null +++ b/pages/community/join/joinDetail.wxml @@ -0,0 +1,48 @@ +居民信息 + + + 当前社区居委会 + {{communityName}} + + + 建筑物类型 + + + + {{array[index]}} + + + + + + 小区 + + + + {{xqArray[xqIndex]}} + + + + + + + 楼栋 + + + + + + 门牌号 + + + + + + + 加入 + \ No newline at end of file diff --git a/pages/community/join/joinDetail.wxss b/pages/community/join/joinDetail.wxss new file mode 100644 index 0000000..d96c770 --- /dev/null +++ b/pages/community/join/joinDetail.wxss @@ -0,0 +1,61 @@ +.page-title{ + font-size: 32rpx; + line-height: 80rpx; + padding: 0 20rpx; +} +.join-info{ + padding: 0 20rpx; + background-color: #fff; +} +.join-row{ + display: flex; + justify-content: space-between; + border-bottom: 1px solid #DDD; +} +.row-name, .row-content{ + font-size: 32rpx; + line-height: 80rpx; + height: 80rpx; +} +.row-content{ + color: #aaa; + width: 65%; + text-align: right; +} +.row-name{ + width: 35%; +} +.text-row .row-name{ + width: 15%; +} +.text-row .row-content{ + width: 85%; +} +.row-content input{ + width: 100%; + height: 100%; + padding: 0 10rpx; + box-sizing: border-box; +} +.submit-join{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 20rpx; + background-color: #fff; +} +.join-btn{ + margin-top: 0; + height: 80rpx; + text-align: center; + border-radius: 40rpx; + line-height: 80rpx; + font-size: 36rpx; +} + + + + + + diff --git a/pages/community/join/select.js b/pages/community/join/select.js new file mode 100644 index 0000000..ded4bdc --- /dev/null +++ b/pages/community/join/select.js @@ -0,0 +1,156 @@ +// pages/community/join/select.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + areaList: ['请选择地区'], + areaIndex: 0, + areaAll: [], + areaSelected: '', + officeList: ['请选择办事处'], + officeIndex: 0, + officeAll: [], + officeSelected: '', + committeeList: [] + }, + joinCommunity: function (e) { + var item = e.currentTarget.dataset.item + wx.navigateTo({ + url: './joinDetail?communityId=' + item.communityId + '&communityName=' + item.communityName + '&locationCode=' + item.locationCode, + }) + }, + // 获取地区列表 + getAreaList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getArea, [app.baseUrls.serviceUrl, '110889']), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = self.data.areaList + for (let i = 0; i < data.length; i++) { + arr.push(data[i].areaName) + } + self.setData({ + areaList: arr, + areaAll: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 选择区域 + bindAreaPickerChange: function (e) { + var self = this + this.setData({ + areaIndex: e.detail.value, + areaSelected: self.data.areaAll[e.detail.value - 1].areaId + }) + this.getOfficeList() + }, + // 获取办事处 + getOfficeList: function (e) { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getArea, [app.baseUrls.serviceUrl, self.data.areaSelected]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = self.data.officeList + for (let i = 0; i < data.length; i++) { + arr.push(data[i].areaName) + } + self.setData({ + officeList: arr, + officeAll: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 选择办事处 + bindOfficePickerChange: function (e) { + var self = this + this.setData({ + officeIndex: e.detail.value, + officeSelected: self.data.officeAll[e.detail.value - 1].areaId + }) + this.getCommunityList() + }, + // 获取居委会列表 + getCommunityList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getCommunityList, [app.baseUrls.communityUrl]), { + parentCode: self.data.officeSelected + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + committeeList: data + }) + }, function (code, data) { + console.log(data) + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getAreaList() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/community/join/select.json b/pages/community/join/select.json new file mode 100644 index 0000000..8d9575a --- /dev/null +++ b/pages/community/join/select.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "加入社区居委会/村委会" +} \ No newline at end of file diff --git a/pages/community/join/select.wxml b/pages/community/join/select.wxml new file mode 100644 index 0000000..de4ee67 --- /dev/null +++ b/pages/community/join/select.wxml @@ -0,0 +1,29 @@ + + + 选择区域 + + + + {{areaList[areaIndex]}} + + + + + + 选择办事处 + + + + {{officeList[officeIndex]}} + + + + + + + 请选择社区居委会/村委会 + + {{item.communityName}} + 加入 + + \ No newline at end of file diff --git a/pages/community/join/select.wxss b/pages/community/join/select.wxss new file mode 100644 index 0000000..6322390 --- /dev/null +++ b/pages/community/join/select.wxss @@ -0,0 +1,58 @@ +.select{ + padding: 0 20rpx; + background-color: #fff; +} +.select-box{ + display: flex; + justify-content: space-between; + border-bottom: 1px solid #DDD; +} +.select-box:last-child{ + border-bottom: none; +} +.select-lv{ + width: 30%; + font-size: 32rpx; + line-height: 80rpx; +} +picker{ + height: 80rpx; + line-height: 80rpx; +} +.select-join{ + margin-top: 20rpx; + background-color: #fff; + padding: 0 20rpx; +} +.join-title{ + font-size: 32rpx; + color: red; + line-height: 80rpx; + border-bottom: 1px solid #DDD; +} +.join-box{ + display: flex; + justify-content: space-between; + border-bottom: 1px solid #DDD; +} +.join-name{ + line-height: 80rpx; + font-size: 32rpx; + max-width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.border-btn{ + width: 140rpx; + margin-top: 15rpx; + text-align: center; +} + + + + + + + + diff --git a/pages/community/joinCommunity.js b/pages/community/joinCommunity.js new file mode 100644 index 0000000..af5cf1d --- /dev/null +++ b/pages/community/joinCommunity.js @@ -0,0 +1,120 @@ +// pages/community/joinCommunity.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + communityList: [], + sourceUrl: app.baseUrls.sourceUrl, + }, + getMyCommunity: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.mycommunity, [app.baseUrls.requestUrl]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + communityList: data + }) + }, function (code, data) { + console.log(data) + }) + }, + quitCommunity: function (e) { + var id = e.currentTarget.dataset.id + var community = e.currentTarget.dataset.community + var self = this + wx.showModal({ + cancelColor: '#000000', + title: '确认退出该社区?', + success: function (res) { + if (res.confirm) { + app.restAjax.delete(app.restAjax.path(app.apis.quitCommunity, [app.baseUrls.requestUrl, id]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var areaId = wx.getStorageSync('curCommunityId') + if (community == areaId) { + // wx.removeStorageSync('areaId') + wx.removeStorageSync('areaCode') + wx.removeStorageSync('curCommunityId') + wx.removeStorageSync('curCommunityName') + wx.removeStorageSync('areaLevel') + } + wx.showToast({ + title: '退出成功', + }) + self.getMyCommunity() + }, function (code, data) { + console.log(data) + }) + } + } + }) + }, + selectCommunity: function () { + wx.navigateTo({ + url: './join/select', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getMyCommunity() + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/community/joinCommunity.json b/pages/community/joinCommunity.json new file mode 100644 index 0000000..01be219 --- /dev/null +++ b/pages/community/joinCommunity.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "所在社区" +} \ No newline at end of file diff --git a/pages/community/joinCommunity.wxml b/pages/community/joinCommunity.wxml new file mode 100644 index 0000000..2151a1f --- /dev/null +++ b/pages/community/joinCommunity.wxml @@ -0,0 +1,22 @@ + + 社区机构入驻 + 单位/店铺入驻 + + + + 所在社区 + 所在单位 + + + + {{item.communityName}} + 退出 + + + + + + + 选择加入社区居委会 / 村委会 + + diff --git a/pages/community/joinCommunity.wxss b/pages/community/joinCommunity.wxss new file mode 100644 index 0000000..c7cd8e9 --- /dev/null +++ b/pages/community/joinCommunity.wxss @@ -0,0 +1,69 @@ +.join{ + padding: 20rpx; + background-color: #fff; + display: flex; + justify-content: space-between; +} +.join-btn-box{ + width: 45%; + height: 80rpx; + align-items: center; + justify-content: center; + border: 1px solid red; + color: red; + font-size: 30rpx; + display: flex; + border-radius: 10rpx; +} +.joined{ + margin-top: 20rpx; + padding: 0 20rpx 20rpx; + background-color: #fff; +} +.joined-tab{ + border-bottom: 1px solid #DDD; + display: flex; +} +.joined-tab-box{ + display: flex; + flex: 1; + height: 80rpx; + align-items: center; + justify-content: center; + font-size: 32rpx; +} +.joined-tab-box.active{ + color: red; +} +.joined-box{ + border-bottom: 1px solid #DDD; + height: 80rpx; + display: flex; + justify-content: space-between; +} +.joined-name{ + line-height: 80rpx; + font-size: 32rpx; +} +.quit{ + margin-top: 15rpx; +} +.select-btn{ + margin-top: 20rpx; + border-radius: 10rpx; + height: 80rpx; + display: flex; + align-items: center; + justify-content: center; +} +.no-data{ + padding: 50rpx 0; + text-align: center; +} +.no-data image{ + width: 300rpx; +} + + + + diff --git a/pages/community/selectCommunity.js b/pages/community/selectCommunity.js new file mode 100644 index 0000000..bed332b --- /dev/null +++ b/pages/community/selectCommunity.js @@ -0,0 +1,191 @@ +// pages/community/selectCommunity.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + areaList: [], + areaAll: [], + index: 0, + areaSelected: '', + page: { + rows: 10, + page: 1, + areaCode: '' + }, + keywords: '', + communityList: [], + haveMore: true + }, + enterCommunity: function (e) { + var info = { + communityId: e.currentTarget.dataset.communityId, + communityName: e.currentTarget.dataset.communityName + } + app.globalData.currentCommunity = info + wx.setStorage({ + data: e.currentTarget.dataset.communityName, + key: 'curCommunityName' + }) + wx.setStorage({ + data: e.currentTarget.dataset.communityId, + key: 'curCommunityId' + }) + wx.setStorage({ + data: e.currentTarget.dataset.location, + key: 'locationCode' + }) + wx.reLaunch({ + url: '../index/index', + }) + }, + getArea: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getArea, [app.baseUrls.serviceUrl, '110889']), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = [] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].areaName) + } + self.setData({ + areaList: arr, + areaAll: data, + areaSelected: data[0].areaCode, + ['page.areaCode']: data[0].areaCode + }) + self.getCommunity() + }, function (code, data) { + console.log(data) + }) + }, + bindPickerChange: function (e) { + var self = this + this.setData({ + index: e.detail.value, + areaSelected: self.data.areaAll[e.detail.value].areaCode, + ['page.areaCode']: self.data.areaAll[e.detail.value].areaCode, + ['page.page']: 1, + haveMore: true + }) + this.getCommunity() + }, + getCommunity: function () { + var self = this + var info = self.data.page + if (self.data.keywords) { + info['keywords'] = self.data.keywords + } + app.restAjax.get(app.restAjax.path(app.apis.getCommunityListPage, [app.baseUrls.communityUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (self.data.page.page == 1) { + self.setData({ + communityList: data.rows + }) + } else { + if (data.rows.length > 0) { + var arr = self.data.communityList + for (let i = 0; i < data.rows.length; i++) { + arr.push(data.rows[i]) + } + self.setData({ + communityList: arr + }) + } else { + self.setData({ + ['page.page']: self.data.page.page - 1 + }) + } + + } + if (data.rows.length < 10) { + self.setData({ + haveMore: false + }) + } + }, function (code, data) { + console.log(data) + }) + }, + loadMore: function () { + var self = this + this.setData({ + ['page.page']: self.data.page.page + 1 + }) + this.getCommunity() + }, + selectCommunity: function (e) { + var info = { + communityId: e.currentTarget.dataset.item.communityId, + communityName: e.currentTarget.dataset.item.communityName + } + app.globalData.currentCommunity = info + wx.reLaunch({ + url: '../index/index', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getArea() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/community/selectCommunity.json b/pages/community/selectCommunity.json new file mode 100644 index 0000000..ae53dec --- /dev/null +++ b/pages/community/selectCommunity.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "选择您的社区" +} \ No newline at end of file diff --git a/pages/community/selectCommunity.wxml b/pages/community/selectCommunity.wxml new file mode 100644 index 0000000..6ad986d --- /dev/null +++ b/pages/community/selectCommunity.wxml @@ -0,0 +1,27 @@ + + + + + + {{areaList[index]}} + + + + + + + + + + + + + + + {{item.communityName}} + + 进入社区 + + + 加载更多 + \ No newline at end of file diff --git a/pages/community/selectCommunity.wxss b/pages/community/selectCommunity.wxss new file mode 100644 index 0000000..6a33358 --- /dev/null +++ b/pages/community/selectCommunity.wxss @@ -0,0 +1,77 @@ +page{ + background-color: #fff; +} +.search{ + position: fixed; + top: 0; + left: 0; + right: 0; + padding: 20rpx; + display: flex; + justify-content: space-between; + background-color: #fff; + z-index: 100; +} +.area{ + width: 20%; + font-size: 30rpx; + line-height: 60rpx; +} +.search-box{ + width: 78%; + position: relative; + border-radius: 40rpx; + overflow: hidden; +} +.search-box input{ + width: 100%; + height: 60rpx; + background-color: #EEE; + padding: 0 60rpx 0 10rpx; + box-sizing: border-box; +} +.search-icon-box{ + position: absolute; + top: 0; + right: 0; + width: 60rpx; + height: 60rpx; +} +.search-icon-box image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + width: 35rpx; + height: 35rpx; +} +.list{ + margin-top: 80rpx; +} +.community-box, .community-name{ + display: flex; + justify-content: space-between; +} +.community-box{ + padding: 20rpx 0; + border-top: 1px solid #DDD; +} +.community-name image{ + width: 100rpx; + height: 100rpx; + margin-right: 20rpx; +} +.community-name-text { + line-height: 100rpx; + font-size: 32rpx; +} +.load-more{ + font-size: 32rpx; + text-align: center; + line-height: 80rpx; +} + + + + + diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..e44a302 --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1,345 @@ +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + page: { + page: 1, + rows: 5, + newsTypeId: '52baf515-304c-46f2-911a-355d889346f2', + showArea: '6dcbb862-4b48-4dca-aee1-d78fd76adc05' + }, + noticeList: [], + serviceUrl: app.baseUrls.serviceUrl, + // serviceUrl: app.baseUrls.requestUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + cardInfo: {}, + curCommunity: wx.getStorageSync('curCommunityName'), + sourceUrl: app.baseUrls.sourceUrl + }, + // 切换社区 + changeCommunity: function () { + wx.navigateTo({ + url: '../community/changeCommunity', + }) + }, + // 加入社区 + joinCommunity: function () { + wx.navigateTo({ + url: '../community/joinCommunity', + }) + }, + // 党员报到 + doCheckIn: function () { + if (wx.getStorageSync('curCommunityId')) { + if (wx.getStorageSync('areaLevel') < 4) { + wx.showToast({ + title: '请选择至社区级', + icon: 'error' + }) + } else { + wx.navigateTo({ + url: '../checkIn/checkIn', + }) + } + } else { + wx.showToast({ + title: '请先选择社区', + icon: 'none' + }) + } + }, + // 微事我言 + goTalk: function () { + if (wx.getStorageSync('curCommunityId')) { + if (wx.getStorageSync('areaLevel') < 4) { + wx.showToast({ + title: '请选择至社区级', + icon: 'error' + }) + } else { + wx.navigateTo({ + url: '../talk/talk', + }) + } + } else { + wx.showToast({ + title: '请先选择社区', + icon: 'none' + }) + } + }, + // 事件上报 + goReport: function () { + if (wx.getStorageSync('curCommunityId')) { + if (wx.getStorageSync('areaLevel') < 4) { + wx.showToast({ + title: '请选择至社区级', + icon: 'error' + }) + } else { + wx.navigateTo({ + url: '../report/report', + }) + } + } else { + wx.showToast({ + title: '请先加入并选择社区', + icon: 'none' + }) + } + }, + // 生活服务 + goServe: function () { + if (wx.getStorageSync('curCommunityId')) { + if (wx.getStorageSync('areaLevel') < 4) { + wx.showToast({ + title: '请选择至社区级', + icon: 'error' + }) + } else { + wx.navigateTo({ + url: '../serve/serve', + }) + } + } else { + wx.showToast({ + title: '请先加入并选择社区', + icon: 'none' + }) + } + }, + // 更多新闻 + checkMoreNews: function () { + wx.navigateTo({ + url: '../news/newsList', + }) + }, + // 获取通知公告 + getNotice: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getNewsList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + noticeList: data.rows + }) + }, function (code, data) { + console.log(data) + }) + }, + // 查看通知公告详情 + checkNewsDetail: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: '../news/newsDetail?newsId=' + id, + }) + }, + + // 登录 + doLogin: function () { + var self = this + wx.login({ + success: function (res) { + app.restAjax.post(app.restAjax.path(app.apis.doLogin, [app.baseUrls.serviceUrl]), { + jsCode: res.code + }, {}, function (code, data) { + console.log(data) + }, function (code, data) { + console.log(data) + }) + } + }) + }, + // 获取字典 + getDictionary: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getDictionary, [app.baseUrls.serviceUrl, '5879c4fc-d357-44a1-9126-394af36ffe63']), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + console.log(data) + }, function (code, data) { + console.log(data) + }) + }, + // 扫码获取名片 + getCard: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getCardDetail, [app.baseUrls.requestUrl, self.data.cardId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + cardInfo: data + }) + wx.setStorage({ + data: data.areaCode, + key: 'areaCode' + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取默认名片 + getDefaultCard: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getDefaultCard, [app.baseUrls.requestUrl]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + cardInfo: data + }) + // wx.setStorage({ + // data: data.areaCode, + // key: 'areaCode' + // }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取头像 + checkPermission() { + var _self = this + try { + var names = wx.getStorageSync('name') + var icon = wx.getStorageSync('userIcon') + + if (names) { + this.setData({ + name: names, + userIcon: icon + }) + } else { + wx.showModal({ + title: '提示', + content: '小程序需要您微信头像以及昵称用于展示,请授权.', + showCancel: false, + success(res) { + if (res.confirm) { + _self.getUserProfile(3) + } + } + }) + } + } catch (error) { + wx.showToast({ + title: '获取信息失败', + icon: 'error' + }) + } + }, + getUserProfile(e) { + let _self = this + wx.getUserProfile({ + desc: '获取微信头像以及昵称用于展示', + success: (res) => { + wx.setStorage({ + data: res.userInfo.nickName, + key: 'name', + }) + wx.setStorage({ + data: res.userInfo.avatarUrl, + key: 'userIcon', + }) + _self.setData({ + name: res.userInfo.nickName, + userIcon: res.userInfo.avatarUrl + }) + app.globalData.userIcon = res.userInfo.avatarUrl + app.globalData.userInfo = res.userInfo + // _self.selectComponent('#head').refreshCart() + }, + fail(err) { + //判断是否绑定手机号 + wx.showToast({ + title: '获取个人信息失败', + icon: 'error', + }) + } + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + // this.doLogin() + this.getNotice() + this.checkPermission() + wx.setStorage({ + data: '1', + key: 'gridMiniId' + }) + if (options.id) { + this.setData({ + cardId: options.id + }) + this.getCard() + } else { + this.getDefaultCard() + } + // this.getDictionary() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.setData({ + curCommunityName: wx.getStorageSync('curCommunityName') ? wx.getStorageSync('curCommunityName'): '切换社区', + curCommunityId: wx.getStorageSync('curCommunityId') ? wx.getStorageSync('curCommunityId') : '', + curCommunity: wx.getStorageSync('curCommunityName') + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..a0ebf06 --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "首页" +} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml new file mode 100644 index 0000000..b9544c2 --- /dev/null +++ b/pages/index/index.wxml @@ -0,0 +1,125 @@ + + + + {{curCommunityName}} + + + + 加入 + + + + + + + + + + {{cardInfo.realName}} + + + {{cardInfo.phone}} + + + + {{cardInfo.address}} + + + + + + + + + + + + {{curCommunity}} + + + + + + + + + + + + + + + + + 党员报到 + + + + 微事我言 + + + + 事件上报 + + + + 生活服务 + + + + + + 通知公告 + 查看更多 + + + + + + + {{item.title}} + {{item.summary}} + + {{item.source}} + {{item.gmtCreate}} + + + + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss new file mode 100644 index 0000000..b81776d --- /dev/null +++ b/pages/index/index.wxss @@ -0,0 +1,273 @@ +/* page{ + background-color: #fff; +} */ +.community{ + display: flex; + justify-content: space-between; + padding: 20rpx 20rpx 150rpx; + border-bottom-left-radius: 80rpx; + border-bottom-right-radius: 80rpx; + background-color: #FF4949; + font-size: 32rpx; + color: #fff; +} +.change-community{ + font-size: 40rpx; +} +.change-community image{ + width: 28rpx; + height: 28rpx; + vertical-align: middle; + margin-top: -10rpx; +} +.join-community image{ + width: 28rpx; + height: 28rpx; +} +.card-container{ + padding: 20rpx; + position: relative; + margin-top: -140rpx; +} +.card{ + width: 100%; + height: 0; + padding-bottom: 56%; + margin-bottom: 20rpx; + box-sizing: border-box; + border-radius: 10rpx; + overflow: hidden; + position: relative; + background-color: #fff; +} +.mid { + display: flex; + width: 100%; + position: relative; +} +.mid-box { + flex-shrink: 0; + width: 32% !important; + margin-right: 2% !important; + display: flex; + flex-direction: column; + align-items: left; + justify-content: left; + border: 2rpx solid #EAC390; + border-radius: 10rpx; + background-color: white; + font-weight: normal; + padding: 10rpx; +} +.mid-box:last-child{ + margin-right: 0; +} +.mid-box text{ + text-align: center; + line-height: 16px; + height: 16px; + font-size: 15px; + color: #CCC; +} +.mid-box image { + width: 48rpx; + height: 48rpx; +} +.mid-box-text{ + font-size: 28rpx; + text-align: left; +} +.good { + display: flex; + justify-content: space-between; + padding-left: 20rpx; + width: 100%; + padding-top: 20rpx; + padding-bottom: 20rpx; +} +.good-click { + display: flex; +} +.good-avatar { + font-size: 0; +} +.good-avatar, .good-click { + line-height: 45rpx; + color: #333; +} +.view-count { + margin-right: 30rpx; + padding-right: 30rpx; + border-right: 1px solid #808080; + color: #808080; + display: flex; + flex-direction: row; + font-size: 36rpx; +} +.view-count-no { + padding-right: 30rpx; + color: #808080; + display: flex; + flex-direction: row; + align-items: center; + font-size: 36rpx; +} +.view-count image, .view-count-no image { + width: 32rpx; + height: 32rpx; +} +.tab{ + display: flex; + justify-content: space-between; + background-color: #fff; + padding: 30rpx 0; +} +.tab-box{ + flex: 1; + text-align: center; +} +.tab-box image{ + width: 80rpx; + height: 80rpx; +} +.tab-text{ + font-size: 30rpx; + padding: 0 10rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.notice{ + margin-top: 15rpx; + padding: 20rpx; + background-color: #fff; +} +.notice-title{ + font-size: 36rpx; + font-weight: bold; + margin-bottom: 20rpx; + display: flex; + justify-content: space-between; +} +.notice-box{ + padding: 20rpx 0; + border-bottom: 1px solid #F9FAFC; + display: flex; + justify-content: space-between; +} +.notice-box:last-child{ + border-bottom: none; +} +.title-text{ + padding-left: 20rpx; + line-height: 50rpx; + position: relative; +} +.title-text:after{ + content: ''; + display: block; + width: 5px; + height: 39rpx; + background-color: #f55054; + position: absolute; + top: 7rpx; + left: 0; +} +.notice-title-text{ + font-size: 34rpx; +} +.notice-more{ + font-size: 28rpx; + color: #BBB; + font-weight: normal; + line-height: 50rpx; +} +.notice-time{ + font-size: 28rpx; + color: rgba(16, 16, 16, 0.7); + line-height: 45rpx; + margin: 6rpx 0; +} +.notice-img{ + width: 200rpx; + height: 140rpx; + text-align: center; +} +.notice-img image{ + height: 100%; +} +.notice-info{ + width: 490rpx; +} +.card-area{ + position: absolute; +} +.photo{ + top: 0; + bottom: 0; + left: 10px; + width: 300rpx; +} +.photo image{ + height: 100%; + max-width: 100%; +} +.name{ + top: 40rpx; + left: 340rpx; + font-size: 36rpx; + font-weight: bold; +} +.phone{ + left: 340rpx; + bottom: 160rpx; + font-size: 28rpx; + line-height: 30rpx; + color: #a8a8a8; +} +.phone image{ + width: 30rpx; + height: 30rpx; + vertical-align: middle; + margin-top: -8rpx; +} +.position{ + bottom: 120rpx; +} +.qr-code{ + position: absolute; + bottom: 30rpx; + right: 24rpx; + width: 60rpx; + height: 60rpx; +} +.qr-code image{ + width: 100%; + height: 100%; +} +.notice-from{ + display: flex; + justify-content: space-between; + font-size: 28rpx; +} +.notice-more image{ + height: 24rpx; + vertical-align: top; + margin-top: 14rpx; +} +.card-img{ + position: absolute; + width: 100%; + height: 100%; +} +.card-img image{ + width: 100%; + height: 100%; +} +.white-name{ + font-size: 34rpx; + color: #fff; + top: 26rpx; + left: 10rpx; + font-weight: normal; +} \ No newline at end of file diff --git a/pages/law/law.js b/pages/law/law.js new file mode 100644 index 0000000..9f53b9e --- /dev/null +++ b/pages/law/law.js @@ -0,0 +1,66 @@ +// pages/law/law.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/law/law.json b/pages/law/law.json new file mode 100644 index 0000000..19dc043 --- /dev/null +++ b/pages/law/law.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "AI法律" +} \ No newline at end of file diff --git a/pages/law/law.wxml b/pages/law/law.wxml new file mode 100644 index 0000000..ca75ee5 --- /dev/null +++ b/pages/law/law.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/law/law.wxss b/pages/law/law.wxss new file mode 100644 index 0000000..c7faf94 --- /dev/null +++ b/pages/law/law.wxss @@ -0,0 +1 @@ +/* pages/law/law.wxss */ \ No newline at end of file diff --git a/pages/neighbor/circle/circleDetail.js b/pages/neighbor/circle/circleDetail.js new file mode 100644 index 0000000..62aa79a --- /dev/null +++ b/pages/neighbor/circle/circleDetail.js @@ -0,0 +1,327 @@ +// pages/neighbor/circle/circleDetail.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + neighborCircleId: '', + circleDetail: {}, + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + userIcon: '', + userName: '', + reply: '', + goodCount: 0, + isClickedGood: 'no', + isGetFocus: false, + placeholder: '写评论', + replyTo: '', + replyUserName: '', + isLoading: false + }, + getCircleDetai: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getCircleDetail, [app.baseUrls.requestUrl, self.data.neighborCircleId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (data.photo) { + data.photo = data.photo.split(',') + } + self.setData({ + circleDetail: data + }) + }, function (code, data) { + console.log(data) + }) + }, + doReplyCircle: function () { + var self = this + if (!self.data.isLoading) { + var info = { + content: self.data.reply, + headPortrait: self.data.userIcon, + neighborCircleId: self.data.neighborCircleId, + userName: self.data.userName + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.submitCircleReply, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + self.setData({ + isLoading: false + }) + wx.showToast({ + title: '回复成功!', + icon: 'success' + }) + self.getReplyList() + self.setData({ + reply: '', + replyTo: '', + replyUserName: '', + placeholder: '讨论一下' + }) + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + getReplyList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getCircleReplyList, [app.baseUrls.requestUrl]), { + neighborCircleId: self.data.neighborCircleId + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + replyList: data + }) + }, function (code, data) { + console.log(data) + }) + }, + clickGood: function () { + var self = this + var info = { + headPortrait: self.data.userIcon, + userName: self.data.userName, + neighborCircleId: self.data.neighborCircleId + } + app.restAjax.post(app.restAjax.path(app.apis.circleClickGood, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + self.getGoodCount() + self.getIsClicked() + } + + console.log(data) + }, function (code, data) { + console.log(data) + }) + }, + getGoodCount: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getCircleGoodCount, [app.baseUrls.requestUrl]), { + neighborCircleId: self.data.neighborCircleId + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + goodCount: data.data + }) + console.log(data) + }, function (code, data) { + console.log(data) + }) + }, + getIsClicked: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.circleIsClicked, [app.baseUrls.requestUrl, self.data.neighborCircleId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + isClickedGood: data + }) + console.log(data) + }, function (code, data) { + console.log(data) + }) + }, + toggleGood: function () { + if (this.data.isClickedGood == 'yes') { + this.cancelGood() + } else { + this.clickGood() + } + }, + cancelGood: function () { + var self = this + app.restAjax.delete(app.restAjax.path(app.apis.cancelGood, [app.baseUrls.requestUrl, self.data.neighborCircleId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + self.getIsClicked() + self.getGoodCount() + } + console.log(data) + }, function (code, data) { + console.log(data) + }) + }, + // 输入评论 + getFocus: function (e) { + var user = e.currentTarget.dataset.user + var replyTo = e.currentTarget.dataset.id + var name = e.currentTarget.dataset.name + console.log(replyTo) + this.setData({ + isGetFocus: true, + placeholder: '回复' + user + ':', + replyTo: replyTo, + replyUserName: name + }) + }, + // 输入框失去焦点判断文字 + inputBlur: function () { + if (!this.data.reply) { + this.setData({ + placeholder: '讨论一下', + isGetFocus: false + }) + } + }, + // 确认回复 + doReply: function () { + if (!this.data.replyTo) { + this.doReplyCircle() + } else { + this.doReplyReply() + } + }, + // 回复 + doReplyReply: function () { + var self = this + if (!self.data.isLoading) { + var info = { + content: self.data.reply, + headPortrait: self.data.userIcon, + userName: self.data.userName, + neighborCircleId: self.data.neighborCircleId, + replyCommentId: self.data.replyTo, + replyNeighborCircleCommentId: self.data.replyTo, + replyUserName: self.data.replyUserName + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.submitCircleReply, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + self.setData({ + isLoading: false + }) + wx.showToast({ + title: '评论成功!', + icon: 'success' + }) + self.getReplyList() + self.setData({ + reply: '', + replyTo: '', + replyUserName: '', + placeholder: '讨论一下' + }) + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + viewImg: function (e) { + var id = this.data.serviceUrl + this.data.baseImgUrl + e.currentTarget.dataset.id + var arr = [] + for (let i = 0; i < this.data.circleDetail.photo.length; i++) { + var video = this.data.serviceUrl + this.data.baseImgUrl + this.data.circleDetail.photo[i] + arr.push(video) + } + wx.previewImage({ + current: id, + urls: arr, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + neighborCircleId: options.neighborCircleId, + userIcon: wx.getStorageSync('userIcon'), + userName: wx.getStorageSync('name') + }) + this.getCircleDetai() + this.getReplyList() + this.getGoodCount() + this.getIsClicked() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/neighbor/circle/circleDetail.json b/pages/neighbor/circle/circleDetail.json new file mode 100644 index 0000000..8df7556 --- /dev/null +++ b/pages/neighbor/circle/circleDetail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "邻里圈" +} \ No newline at end of file diff --git a/pages/neighbor/circle/circleDetail.wxml b/pages/neighbor/circle/circleDetail.wxml new file mode 100644 index 0000000..bb1cebc --- /dev/null +++ b/pages/neighbor/circle/circleDetail.wxml @@ -0,0 +1,62 @@ + + + + + + + {{goodCount}} + + + + {{circleDetail.content}} + + {{circleDetail.problemTypeName}} + + + + + + + + + + + + + 回复 + + + + + + + {{item.content}} + + + + {{child.userName}} 回复 {{child.replyUserName}} : {{child.content}} + + + + + + + \ No newline at end of file diff --git a/pages/neighbor/circle/circleDetail.wxss b/pages/neighbor/circle/circleDetail.wxss new file mode 100644 index 0000000..fada20b --- /dev/null +++ b/pages/neighbor/circle/circleDetail.wxss @@ -0,0 +1,123 @@ +.help-detail{ + padding: 20rpx; + background-color: #fff; +} +.talk-user, .user-info{ + display: flex; + justify-content: space-between; + margin-bottom: 10rpx; +} +.user-info image{ + width: 80rpx; + height: 80rpx; + margin-right: 20rpx; + border-radius: 50%; +} +.good image{ + width: 40rpx; + height: 40rpx; + margin-top: -8rpx; + vertical-align: middle; + margin-right: 10rpx; +} +.name{ + font-size: 32rpx; + line-height: 50rpx; +} +.time{ + font-size: 24rpx; + color: #888; +} +.good text{ + line-height: 80rpx; +} +.talk-content{ + font-size: 32rpx; + line-height: 40rpx; + margin-bottom: 20rpx; +} +.help-type{ + margin: 10rpx 0; +} +.help-type, .help-date{ + font-size: 28rpx; + color: #BBB; +} +.explain{ + padding: 20rpx; + background-color: #fff; + margin-top: 20rpx; +} +.explain-title{ + font-size: 32rpx; + font-weight: bold; + margin-bottom: 10rpx; +} +.explain-detail{ + min-height: 300rpx; + font-size: 30rpx; + line-height: 60rpx; +} +.answer{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 35rpx 20rpx; + background-color: #fff; + border-top: 1px solid #DDD; +} +.answer input{ + width: 100%; + height: 70rpx; + padding: 0 20rpx; + box-sizing: border-box; + background-color: #F0F0F0; + border-radius: 40rpx; + font-size: 32rpx; +} +.reply{ + margin-bottom: 140rpx; + background-color: #fff; + padding: 20rpx; + margin-top: 20rpx; +} +.reply-title{ + font-size: 32rpx; + font-weight: bold; +} +.reply-box{ + padding: 20rpx 0; + border-bottom: 1px solid #DDD; +} +.reply-box:last-child{ + border-bottom: none; +} +.photo-box{ + display: inline-block; + width: 32%; + height: 150rpx; + margin-right: 2%; + margin-bottom: 15rpx; + text-align: center; +} +.photo-box:nth-child(3n){ + margin-right: 0; +} +.photo-box image{ + height: 100%; +} +.reply-row{ + line-height: 60rpx; + background-color: #F7F7F7; + padding: 0 10rpx; + word-break: break-all; +} +.reply-row text{ + font-weight: bold; +} + + + + + diff --git a/pages/neighbor/circle/circleList.js b/pages/neighbor/circle/circleList.js new file mode 100644 index 0000000..46ed402 --- /dev/null +++ b/pages/neighbor/circle/circleList.js @@ -0,0 +1,98 @@ +// pages/neighbor/circle/circleList.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + circleList: [], + page: { + page: 1, + rows: 10 + }, + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + }, + checkDetail: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: './circleDetail?neighborCircleId=' + id, + }) + }, + getCircleList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getCircleList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + for (let i = 0; i < data.rows.length; i++) { + if (data.rows[i].photo) { + data.rows[i].photo = data.rows[i].photo.split(',') + } + } + self.setData({ + circleList: data.rows + }) + }, function (code, data) { + console.log(data) + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getCircleList() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/neighbor/circle/circleList.json b/pages/neighbor/circle/circleList.json new file mode 100644 index 0000000..8df7556 --- /dev/null +++ b/pages/neighbor/circle/circleList.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "邻里圈" +} \ No newline at end of file diff --git a/pages/neighbor/circle/circleList.wxml b/pages/neighbor/circle/circleList.wxml new file mode 100644 index 0000000..779bfa4 --- /dev/null +++ b/pages/neighbor/circle/circleList.wxml @@ -0,0 +1,28 @@ + + + + + + + {{item.content}} + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/neighbor/circle/circleList.wxss b/pages/neighbor/circle/circleList.wxss new file mode 100644 index 0000000..637d6a1 --- /dev/null +++ b/pages/neighbor/circle/circleList.wxss @@ -0,0 +1,72 @@ +page{ + background-color: #fff; +} +.talk-user, .user-info{ + display: flex; + justify-content: space-between; + margin-bottom: 10rpx; +} +.user-info image{ + width: 80rpx; + height: 80rpx; + margin-right: 20rpx; +} +.good image{ + width: 40rpx; + height: 40rpx; + margin-top: -8rpx; + vertical-align: middle; +} +.name{ + font-size: 32rpx; + line-height: 50rpx; +} +.time{ + font-size: 24rpx; + color: #888; +} +.good text{ + line-height: 80rpx; +} +.talk-content{ + font-size: 30rpx; + line-height: 40rpx; + margin-bottom: 20rpx; +} +.talk-box{ + border-bottom: 1px solid #F9FAFC; + padding: 20rpx 0; +} +.talk-box:last-child{ + border-bottom: none; +} +.talk-count{ + margin-top: 10rpx; + display: flex; + justify-content: space-between; + font-size: 28rpx; + color: #BBB; +} +.photo-box{ + display: inline-block; + width: 32%; + height: 150rpx; + margin-right: 2%; + margin-bottom: 15rpx; + text-align: center; +} +.photo-box:nth-child(3n){ + margin-right: 0; +} +.photo-box image{ + height: 100%; +} + + + + + + + + + diff --git a/pages/neighbor/circle/new.js b/pages/neighbor/circle/new.js new file mode 100644 index 0000000..5e69b1a --- /dev/null +++ b/pages/neighbor/circle/new.js @@ -0,0 +1,244 @@ +// pages/neighbor/help/new.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + helpType: [], + index: 0, + helpTypeAll: [], + helpSelected: '', + content: '', + contentSupplement: '', + userIcon: wx.getStorageSync('userIcon'), + userName: wx.getStorageSync('name'), + imageList: [], + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + videoId: '', + communityId: '', + areaCode: '', + isLoading: false + }, + bindPickerChange: function(e) { + var self = this + this.setData({ + index: e.detail.value, + helpSelected: self.data.helpTypeAll[e.detail.value - 1].dataId + }) + }, + // 发布互助 + submitHelp: function () { + var self = this + if (!self.data.isLoading) { + var photo = '' + if (self.data.imageList.length > 0) { + for (let i = 0; i < self.data.imageList.length; i++) { + if (i != self.data.imageList.length - 1) { + photo += self.data.imageList[i] + ',' + } else { + photo += self.data.imageList[i] + } + } + } + var info = { + content: self.data.content, + contentSupplement: self.data.contentSupplement, + photo: photo, + video: self.data.videoId, + videoCover: '', + headPortrait: self.data.userIcon, + nickName : self.data.userName, + communityId: self.data.communityId, + areaCode: self.data.areaCode + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.submitNeighborCircle, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '发布成功!', + icon: 'success' + }) + setTimeout(function () { + self.setData({ + isLoading: false + }) + wx.navigateBack({ + delta: 1 + }) + }, 1500) + } + console.log(code) + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + // 上传图片 + uploadImage: function () { + var self = this + if (!self.data.isLoading) { + wx.chooseImage({ + count: 9 - self.data.imageList.length, + sourceType: ['album', 'camera'], + success: function (res) { + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + for (let i = 0; i < res.tempFiles.length; i++) { + var path = res.tempFiles[i].path; + app.restAjax.file(app.restAjax.path(app.apis.uploadImg, [app.baseUrls.serviceUrl]), path, 'image', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + var id = JSON.parse(data).data + var arr = self.data.imageList + arr.push(id) + self.setData({ + imageList: arr + }) + if (i == res.tempFiles.length - 1) { + self.setData({ + isLoading: false + }) + } + wx.hideToast() + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + } + }) + } + }, + // 上传视频 + uploadVideo: function () { + var self = this + if (!self.data.isLoading) { + self.setData({ + isLoading: true + }) + wx.chooseVideo({ + sourceType: ['album','camera'], + success: function (res) { + app.restAjax.file(app.restAjax.path(app.apis.uploadVideo, [app.baseUrls.serviceUrl]), res.tempFilePath, 'video', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + self.setData({ + isLoading: false + }) + var id = JSON.parse(data).data + self.setData({ + videoId: id + }) + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }) + } + }, + // 删除图片 + deleteImg: function (e) { + var self = this + var idx = e.currentTarget.dataset.cur + var arr = this.data.imageList + arr.splice(idx, 1) + this.setData({ + imageList: arr + }) + }, + // 删除视频 + deleteVideo: function () { + this.setData({ + videoId: '' + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + communityId: options.communityId, + areaCode: options.areaCode, + userIcon: wx.getStorageSync('userIcon'), + userName: wx.getStorageSync('name') + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/neighbor/circle/new.json b/pages/neighbor/circle/new.json new file mode 100644 index 0000000..8df7556 --- /dev/null +++ b/pages/neighbor/circle/new.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "邻里圈" +} \ No newline at end of file diff --git a/pages/neighbor/circle/new.wxml b/pages/neighbor/circle/new.wxml new file mode 100644 index 0000000..ad05649 --- /dev/null +++ b/pages/neighbor/circle/new.wxml @@ -0,0 +1,84 @@ + + + 邻里圈 + + + + + + + + + + + 添加照片 + + + + + + + + + + + + + 添加视频 + + + + + + + + + + 发布 + + + diff --git a/pages/neighbor/circle/new.wxss b/pages/neighbor/circle/new.wxss new file mode 100644 index 0000000..4a556e0 --- /dev/null +++ b/pages/neighbor/circle/new.wxss @@ -0,0 +1,137 @@ +.new-help{ + padding: 20rpx; + background-color: #fff; + margin-bottom: 100rpx; +} +.new-title{ + font-size: 32rpx; + font-weight: bold; + margin-bottom: 20rpx; +} +.new-textarea{ + margin-bottom: 20rpx; +} +.new-textarea input{ + width: 100%; + height: 60rpx; + border-bottom: 1px solid #DDD; + font-size: 32rpx; +} +.new-textarea textarea{ + width: 100%; + height: 400rpx; + font-size: 32rpx; + border-bottom: 1px solid #DDD; +} +.new-textarea picker{ + font-size: 32rpx; + line-height: 60rpx; + border-bottom: 1px solid #DDD; +} +.submit{ + width: 710rpx; + margin: 20rpx auto; +} +.submit-btn{ + margin-top: 0; + height: 80rpx; + line-height: 80rpx; + text-align: center; + border-radius: 16rpx; + background-color: rgba(36, 40, 46, 0.80); +} +.upload-title{ + font-size: 32rpx; + font-weight: bold; + line-height: 80rpx; +} +.add{ + display: inline-flex; + align-items: center; + justify-content: center; + flex-direction: column; + width: 150rpx; + height: 150rpx; + padding: 10rpx; + box-sizing: border-box; + background-color: rgba(0, 0, 0, 0.05); + color: rgba(36, 40, 46, 0.50); + margin-bottom: 20rpx; + vertical-align: top; + border: 1px solid rgba(187, 187, 187, 0.10); + font-size: 30rpx; +} +.add-icon{ + font-size: 40rpx; +} +.image{ + width: 32%; + height: 150rpx; + margin-right: 2%; + background-color: #fff; + position: relative; + margin-bottom: 20rpx; + text-align: center; + display: inline-block; + vertical-align: top; +} +.image:nth-child(3n){ + margin-right: 0; +} +.image image{ + height: 100%; +} +.add.video{ + width: 100%; + height: auto; + position: relative; + background-color: #000; +} +.add:nth-child(3n){ + margin-right: 0; +} +.add image{ + height: 100%; +} +.delete{ + width: 30rpx; + height: 30rpx !important; + position: absolute; + top: -15rpx; + right: -15rpx; +} + +.help-row{ + margin: 20rpx 0; + display: flex; + justify-content: space-between; + background-color: #fff; + padding: 0 20rpx; + height: 80rpx; + line-height: 80rpx; + font-size: 32rpx; + color: rgba(36, 40, 46, 0.50); +} +.help-row picker{ + color: #24282E; +} +.help-desc{ + background-color: #fff; + padding: 20rpx; +} +.desc-title{ + font-size: 32rpx; + color: rgba(36, 40, 46, 0.50); + margin-bottom: 15rpx; +} +.help-desc textarea{ + width: 100%; + height: 300rpx; + font-size: 30rpx; +} +.upload-file{ + margin-top: 20rpx; +} + + + diff --git a/pages/neighbor/help/helpDetail.js b/pages/neighbor/help/helpDetail.js new file mode 100644 index 0000000..78fed8e --- /dev/null +++ b/pages/neighbor/help/helpDetail.js @@ -0,0 +1,249 @@ +// pages/neighbor/help/helpDetail.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + sourceUrl: app.baseUrls.sourceUrl, + token: app.globalData.token, + neighborId: '', + helpDetail: {}, + reply: '', + userIcon: '', + userName: '', + replyList: [], + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + isGetFocus: false, + placeholder: '写评论', + replyTo: '', + replyUserName: '', + childNeighborId: '', + isLoading: false + }, + getHelpDetail: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getHelpDetail, [app.baseUrls.requestUrl, self.data.neighborId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (data.photo) { + data.photo = data.photo.split(',') + } + self.setData({ + helpDetail: data + }) + }, function (code, data) { + console.log(data) + }) + }, + doReplyHelp: function () { + var self = this + if (!self.data.isLoading) { + var info = { + content: self.data.reply, + headPortrait: self.data.userIcon, + neighborId: self.data.neighborId, + userName: self.data.userName + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.doReplyHelp, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + self.setData({ + isLoading: false + }) + wx.showToast({ + title: '回复成功!', + icon: 'success' + }) + self.getRelyList() + self.setData({ + reply: '' + }) + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + getRelyList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getReplyList, [app.baseUrls.requestUrl]), { + neighborId: self.data.neighborId + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + replyList: data + }) + console.log(data) + }, function (code, data) { + console.log(data) + }) + }, + viewImg: function (e) { + var id = this.data.serviceUrl + this.data.baseImgUrl + e.currentTarget.dataset.id + var arr = [] + for (let i = 0; i < this.data.helpDetail.photo.length; i++) { + var video = this.data.serviceUrl + this.data.baseImgUrl + this.data.helpDetail.photo[i] + arr.push(video) + } + wx.previewImage({ + current: id, + urls: arr, + }) + }, + // 输入评论 + getFocus: function (e) { + var user = e.currentTarget.dataset.user + var replyTo = e.currentTarget.dataset.id + var name = e.currentTarget.dataset.name + var neighborId = e.currentTarget.dataset.neighbor + console.log(neighborId) + this.setData({ + isGetFocus: true, + placeholder: '回复' + user + ':', + replyTo: replyTo, + replyUserName: name, + childNeighborId: neighborId + }) + }, + // 输入框失去焦点判断文字 + inputBlur: function () { + if (!this.data.reply) { + this.setData({ + placeholder: '讨论一下', + isGetFocus: false + }) + } + }, + // 确认回复 + doReply: function () { + if (!this.data.replyTo) { + this.doReplyHelp() + } else { + this.doReplyReply() + } + }, + // 回复 + doReplyReply: function () { + var self = this + if (!self.data.isLoading) { + var info = { + content: self.data.reply, + headPortrait: self.data.userIcon, + userName: self.data.userName, + // commentId: self.data.replyTo, + replyCommentId: self.data.replyTo, + replyUserName: self.data.replyUserName, + neighborId: self.data.childNeighborId, + replyNeighborCommentId: self.data.replyTo, + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.doReplyHelp, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + self.setData({ + isLoading: false + }) + wx.showToast({ + title: '评论成功!', + icon: 'success' + }) + self.getRelyList() + self.setData({ + reply: '', + replyTo: '', + replyUserName: '', + placeholder: '讨论一下' + }) + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + neighborId: options.neighborId, + userIcon: wx.getStorageSync('userIcon'), + userName: wx.getStorageSync('name') + }) + this.getHelpDetail() + this.getRelyList() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/neighbor/help/helpDetail.json b/pages/neighbor/help/helpDetail.json new file mode 100644 index 0000000..3e0e214 --- /dev/null +++ b/pages/neighbor/help/helpDetail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "邻里互助" +} \ No newline at end of file diff --git a/pages/neighbor/help/helpDetail.wxml b/pages/neighbor/help/helpDetail.wxml new file mode 100644 index 0000000..e2dbeb7 --- /dev/null +++ b/pages/neighbor/help/helpDetail.wxml @@ -0,0 +1,61 @@ + + + + + + + {{helpDetail.content}} + + {{helpDetail.problemTypeName}} + + + + + + + + + + + + + 回复 + + + + + + + {{item.content}} + + + + {{child.userName}} 回复 {{child.replyUserName}} : {{child.content}} + + + + + + + \ No newline at end of file diff --git a/pages/neighbor/help/helpDetail.wxss b/pages/neighbor/help/helpDetail.wxss new file mode 100644 index 0000000..1903b7a --- /dev/null +++ b/pages/neighbor/help/helpDetail.wxss @@ -0,0 +1,122 @@ +.help-detail{ + padding: 20rpx; + background-color: #fff; +} +.talk-user, .user-info{ + display: flex; + justify-content: space-between; + margin-bottom: 10rpx; +} +.user-info image{ + width: 80rpx; + height: 80rpx; + margin-right: 20rpx; + border-radius: 50%; +} +.good image{ + width: 40rpx; + height: 40rpx; + margin-top: -8rpx; + vertical-align: middle; +} +.name{ + font-size: 32rpx; + line-height: 50rpx; +} +.time{ + font-size: 24rpx; + color: #888; +} +.good text{ + line-height: 80rpx; +} +.talk-content{ + font-size: 32rpx; + line-height: 40rpx; + margin-bottom: 20rpx; +} +.help-type{ + margin: 10rpx 0; +} +.help-type, .help-date{ + font-size: 28rpx; + color: #BBB; +} +.explain{ + padding: 20rpx; + background-color: #fff; + margin-top: 20rpx; +} +.explain-title{ + font-size: 32rpx; + font-weight: bold; + margin-bottom: 10rpx; +} +.explain-detail{ + min-height: 300rpx; + font-size: 30rpx; + line-height: 60rpx; +} +.answer{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 35rpx 20rpx; + background-color: #fff; + border-top: 1px solid #DDD; +} +.answer input{ + width: 100%; + height: 70rpx; + padding: 0 20rpx; + box-sizing: border-box; + background-color: #F0F0F0; + border-radius: 40rpx; + font-size: 32rpx; +} +.reply{ + margin-bottom: 140rpx; + background-color: #fff; + padding: 20rpx; + margin-top: 10rpx; +} +.reply-title{ + font-size: 32rpx; + font-weight: bold; +} +.reply-box{ + padding: 20rpx 0; + border-bottom: 1px solid #DDD; +} +.reply-box:last-child{ + border-bottom: none; +} +.photo-box{ + display: inline-block; + width: 32%; + height: 150rpx; + margin-right: 2%; + margin-bottom: 15rpx; + text-align: center; +} +.photo-box:nth-child(3n){ + margin-right: 0; +} +.photo-box image{ + height: 100%; +} +.reply-row{ + line-height: 60rpx; + background-color: #F7F7F7; + padding: 0 10rpx; + word-break: break-all; +} +.reply-row text{ + font-weight: bold; +} + + + + + diff --git a/pages/neighbor/help/helpList.js b/pages/neighbor/help/helpList.js new file mode 100644 index 0000000..d739b4b --- /dev/null +++ b/pages/neighbor/help/helpList.js @@ -0,0 +1,131 @@ +// pages/neighbor/help/helpList.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + helpList: [], + page: { + page: 1, + rows: 10 + }, + haveMore: true, + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + }, + getHelpList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getHelpList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + for (let i = 0; i < data.rows.length; i++) { + if (data.rows[i].photo) { + data.rows[i].photo = data.rows[i].photo.split(',') + } + } + if (self.data.page.page == 1) { + self.setData({ + helpList: data.rows + }) + } else { + if (data.rows.length > 0) { + var arr = self.data.helpList + for (let i = 0; i < data.rows.length; i++) { + arr.push(data.rows[i]) + } + self.setData({ + helpList: arr + }) + } else { + wx.showToast({ + title: '暂无更多', + icon: 'none' + }) + self.setData({ + ['page.page']: self.data.page.page - 1 + }) + } + } + if (data.rows.length < 10) { + self.setData({ + haveMore: false + }) + } + }, function (code, data) { + console.log(data) + }) + }, + checkHelpDetail: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: './helpDetail?neighborId=' + id, + }) + }, + loadMore: function () { + var self = this + this.setData({ + ['page.page']: self.data.page.page + 1 + }) + this.getHelpList() + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getHelpList() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/neighbor/help/helpList.json b/pages/neighbor/help/helpList.json new file mode 100644 index 0000000..3e0e214 --- /dev/null +++ b/pages/neighbor/help/helpList.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "邻里互助" +} \ No newline at end of file diff --git a/pages/neighbor/help/helpList.wxml b/pages/neighbor/help/helpList.wxml new file mode 100644 index 0000000..7a8c180 --- /dev/null +++ b/pages/neighbor/help/helpList.wxml @@ -0,0 +1,23 @@ + + + + + + {{item.nickName}} + {{item.gmtCreate}} + + + + {{item.content}} + + + + + + + + + + + +加载更多 diff --git a/pages/neighbor/help/helpList.wxss b/pages/neighbor/help/helpList.wxss new file mode 100644 index 0000000..0dcb400 --- /dev/null +++ b/pages/neighbor/help/helpList.wxss @@ -0,0 +1,79 @@ +page{ + background-color: #fff; +} +.help-container{ + padding: 0 20rpx; +} +.help-box{ + padding: 20rpx 0; + border-bottom: 1px solid #F9FAFC; +} +.help-user{ + display: flex; +} +.help-user image{ + width: 100rpx; + height: 100rpx; + border-radius: 50%; + margin-right: 20rpx; +} +.user-name{ + font-size: 30rpx; + font-weight: bold; + margin: 10rpx 0; +} +.user-time{ + font-size: 28rpx; + color: #999; +} +.help-content{ + margin-top: 20rpx; + font-size: 32rpx; + color: #101010; +} +.new{ + position: fixed; + bottom: 40rpx; + right: 40rpx; + font-size: 80rpx; + width: 120rpx; + height: 120rpx; + text-align: center; + line-height: 120rpx; + color: #fff; + border-radius: 50%; + background-color: #FF4949; +} +.help-photo{ + margin-top: 20rpx; +} +.help-photo-box{ + display: inline-block; + width: 32%; + height: 150rpx; + margin-right: 2%; + margin-bottom: 20rpx; + text-align: center; +} +.help-photo-box:nth-child(3n){ + margin-right: 0; +} +.help-photo-box image{ + height: 100%; +} +.help-video{ + margin-top: 20rpx; +} +.help-video, .help-video video{ + width: 100%; +} +.help-more{ + font-size: 32rpx; + line-height: 70rpx; +} + +.load-more{ + text-align: center; + font-size: 32rpx; + line-height: 80rpx; +} \ No newline at end of file diff --git a/pages/neighbor/help/new.js b/pages/neighbor/help/new.js new file mode 100644 index 0000000..e62932b --- /dev/null +++ b/pages/neighbor/help/new.js @@ -0,0 +1,274 @@ +// pages/neighbor/help/new.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + helpType: [], + index: 0, + helpTypeAll: [], + helpSelected: '', + content: '', + contentSupplement: '', + userIcon: wx.getStorageSync('userIcon'), + userName: wx.getStorageSync('name'), + imageList: [], + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + videoId: '', + communityId: '', + areaCode: '', + isLoading: false + }, + bindPickerChange: function(e) { + var self = this + this.setData({ + index: e.detail.value, + helpSelected: self.data.helpTypeAll[e.detail.value - 1].dataId + }) + }, + // 获取互助类型 + getHelpType: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getDictionary, [app.baseUrls.serviceUrl, '4fcf52f9-2e05-4cca-8966-83f0232f22e8']), { + areaCode: self.data.locationCode + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = ['请选择互助类型'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].dataName) + } + self.setData({ + helpType: arr, + helpTypeAll: data + }) + console.log(data) + }, function (code, data) { + console.log(data) + }) + }, + // 发布互助 + submitHelp: function () { + var self = this + if (!self.data.isLoading) { + var photo = '' + if (self.data.imageList.length > 0) { + for (let i = 0; i < self.data.imageList.length; i++) { + if (i != self.data.imageList.length - 1) { + photo += self.data.imageList[i] + ',' + } else { + photo += self.data.imageList[i] + } + } + } + var info = { + content: self.data.content, + contentSupplement: self.data.contentSupplement, + photo: photo, + problemTypeId: self.data.helpSelected, + problemTypeName: self.data.helpTypeAll[self.data.index - 1].dataName, + video: self.data.videoId, + videoCover: '', + headPortrait: self.data.userIcon, + nickName : self.data.userName, + communityId: self.data.communityId, + areaCode: self.data.areaCode + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.submitHelp, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + + wx.showToast({ + title: '发布成功!', + icon: 'success' + }) + setTimeout(function () { + self.setData({ + isLoading: false + }) + wx.navigateBack({ + delta: 1 + }) + }, 1500) + } + console.log(code) + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + // 上传图片 + uploadImage: function () { + var self = this + if (!self.data.isLoading) { + self.setData({ + isLoading: true + }) + wx.chooseImage({ + count: 9 - self.data.imageList.length, + sourceType: ['album', 'camera'], + success: function (res) { + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + for (let i = 0; i < res.tempFiles.length; i++) { + var path = res.tempFiles[i].path; + app.restAjax.file(app.restAjax.path(app.apis.uploadImg, [app.baseUrls.serviceUrl]), path, 'image', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + var id = JSON.parse(data).data + var arr = self.data.imageList + arr.push(id) + self.setData({ + imageList: arr + }) + if (i == res.tempFiles.length - 1) { + self.setData({ + isLoading: false + }) + } + wx.hideToast() + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + } + }) + } + }, + // 上传视频 + uploadVideo: function () { + var self = this + if (!self.data.isLoading) { + self.setData({ + isLoading: true + }) + wx.chooseVideo({ + sourceType: ['album','camera'], + success: function (res) { + app.restAjax.file(app.restAjax.path(app.apis.uploadVideo, [app.baseUrls.serviceUrl]), res.tempFilePath, 'video', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + self.setData({ + isLoading: false + }) + var id = JSON.parse(data).data + self.setData({ + videoId: id + }) + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }) + } + }, + // 删除图片 + deleteImg: function (e) { + var self = this + var idx = e.currentTarget.dataset.cur + var arr = this.data.imageList + arr.splice(idx, 1) + this.setData({ + imageList: arr + }) + }, + // 删除视频 + deleteVideo: function () { + this.setData({ + videoId: '' + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.getHelpType() + this.setData({ + communityId: options.communityId, + areaCode: options.areaCode, + userIcon: wx.getStorageSync('userIcon'), + userName: wx.getStorageSync('name') + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/neighbor/help/new.json b/pages/neighbor/help/new.json new file mode 100644 index 0000000..3e0e214 --- /dev/null +++ b/pages/neighbor/help/new.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "邻里互助" +} \ No newline at end of file diff --git a/pages/neighbor/help/new.wxml b/pages/neighbor/help/new.wxml new file mode 100644 index 0000000..e176bfd --- /dev/null +++ b/pages/neighbor/help/new.wxml @@ -0,0 +1,84 @@ + + 发布类型 + + + + {{helpType[index]}} + + + + + + 问题描述 + + + + + + + + + + + 添加照片 + + + + + + + + + + + + + 添加视频 + + + + + + + + + + 发布 + + + diff --git a/pages/neighbor/help/new.wxss b/pages/neighbor/help/new.wxss new file mode 100644 index 0000000..4a556e0 --- /dev/null +++ b/pages/neighbor/help/new.wxss @@ -0,0 +1,137 @@ +.new-help{ + padding: 20rpx; + background-color: #fff; + margin-bottom: 100rpx; +} +.new-title{ + font-size: 32rpx; + font-weight: bold; + margin-bottom: 20rpx; +} +.new-textarea{ + margin-bottom: 20rpx; +} +.new-textarea input{ + width: 100%; + height: 60rpx; + border-bottom: 1px solid #DDD; + font-size: 32rpx; +} +.new-textarea textarea{ + width: 100%; + height: 400rpx; + font-size: 32rpx; + border-bottom: 1px solid #DDD; +} +.new-textarea picker{ + font-size: 32rpx; + line-height: 60rpx; + border-bottom: 1px solid #DDD; +} +.submit{ + width: 710rpx; + margin: 20rpx auto; +} +.submit-btn{ + margin-top: 0; + height: 80rpx; + line-height: 80rpx; + text-align: center; + border-radius: 16rpx; + background-color: rgba(36, 40, 46, 0.80); +} +.upload-title{ + font-size: 32rpx; + font-weight: bold; + line-height: 80rpx; +} +.add{ + display: inline-flex; + align-items: center; + justify-content: center; + flex-direction: column; + width: 150rpx; + height: 150rpx; + padding: 10rpx; + box-sizing: border-box; + background-color: rgba(0, 0, 0, 0.05); + color: rgba(36, 40, 46, 0.50); + margin-bottom: 20rpx; + vertical-align: top; + border: 1px solid rgba(187, 187, 187, 0.10); + font-size: 30rpx; +} +.add-icon{ + font-size: 40rpx; +} +.image{ + width: 32%; + height: 150rpx; + margin-right: 2%; + background-color: #fff; + position: relative; + margin-bottom: 20rpx; + text-align: center; + display: inline-block; + vertical-align: top; +} +.image:nth-child(3n){ + margin-right: 0; +} +.image image{ + height: 100%; +} +.add.video{ + width: 100%; + height: auto; + position: relative; + background-color: #000; +} +.add:nth-child(3n){ + margin-right: 0; +} +.add image{ + height: 100%; +} +.delete{ + width: 30rpx; + height: 30rpx !important; + position: absolute; + top: -15rpx; + right: -15rpx; +} + +.help-row{ + margin: 20rpx 0; + display: flex; + justify-content: space-between; + background-color: #fff; + padding: 0 20rpx; + height: 80rpx; + line-height: 80rpx; + font-size: 32rpx; + color: rgba(36, 40, 46, 0.50); +} +.help-row picker{ + color: #24282E; +} +.help-desc{ + background-color: #fff; + padding: 20rpx; +} +.desc-title{ + font-size: 32rpx; + color: rgba(36, 40, 46, 0.50); + margin-bottom: 15rpx; +} +.help-desc textarea{ + width: 100%; + height: 300rpx; + font-size: 30rpx; +} +.upload-file{ + margin-top: 20rpx; +} + + + diff --git a/pages/neighbor/neighbor.js b/pages/neighbor/neighbor.js new file mode 100644 index 0000000..1f0bff1 --- /dev/null +++ b/pages/neighbor/neighbor.js @@ -0,0 +1,245 @@ +// pages/neighbor/neighbor.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + array: [], + index: 0, + communityList: [], + communitySelected: '', + areaCode: '', + page: { + page: 1, + rows: 5, + communityId: '' + }, + helpList: [], + circleList: [], + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + tab: '1' + }, + // 邻里互助查看更多 + checkHelpMore: function () { + if (this.data.tab == '1') { + wx.navigateTo({ + url: './help/helpList', + }) + } else { + wx.navigateTo({ + url: './circle/circleList', + }) + } + }, + // 邻里互助查看详情 + checkHelpDetail: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: './help/helpDetail?neighborId=' + id, + }) + }, + // 切换社区 + bindPickerChange: function(e) { + var self = this + this.setData({ + index: e.detail.value, + communitySelected: self.data.communityList[e.detail.value].communityId, + ['page.communityId']: self.data.communityList[e.detail.value].communityId, + areaCode: self.data.communityList[e.detail.value].areaCode, + }) + if (this.data.tab == '1') { + self.getHelpList() + } else { + self.getCircleList() + } + }, + // 发布新的邻里互助 + newHelp: function () { + var self = this + wx.navigateTo({ + url: './help/new?communityId=' + self.data.communitySelected + '&areaCode=' + self.data.areaCode, + }) + }, + // 发布新的邻里圈 + newCircle: function () { + var self = this + wx.navigateTo({ + url: './circle/new?communityId=' + self.data.communitySelected + '&areaCode=' + self.data.areaCode, + }) + }, + // 获取邻里互助列表 + getHelpList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getHelpList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + for (let i = 0; i < data.rows.length; i++) { + if (data.rows[i].photo) { + data.rows[i].photo = data.rows[i].photo.split(',') + } + } + self.setData({ + helpList: data.rows + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取邻里圈列表 + getCircleList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getCircleList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + for (let i = 0; i < data.rows.length; i++) { + if (data.rows[i].photo) { + data.rows[i].photo = data.rows[i].photo.split(',') + } + } + self.setData({ + helpList: data.rows + }) + }, function (code, data) { + console.log(data) + }) + }, + // 查看邻里圈详情 + checkCircleDetail: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: './circle/circleDetail?neighborCircleId=' + id, + }) + }, + // 获取我所在的社区列表 + getMyCommunity: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.mycommunity, [app.baseUrls.requestUrl]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (data.length > 0) { + var arr = [] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].communityName) + } + self.setData({ + communityList: data, + array: arr, + communitySelected: data[0].communityId, + ['page.communityId']: data[0].communityId, + areaCode: data[0].areaCode + }) + if (self.data.tab == '1') { + self.getHelpList() + } else { + self.getCircleList() + } + } else { + wx.showToast({ + title: '请先在首页加入您的社区', + icon: 'none' + }) + setTimeout(function () { + wx.switchTab({ + url: '../index/index', + }) + }, 1500) + } + + }, function (code, data) { + console.log(data) + }) + }, + // 发布新内容 + newContent: function () { + if (this.data.tab == '1') { + this.newHelp() + } else { + this.newCircle() + } + }, + // 切换tab + changeTab: function (e) { + var tab = e.currentTarget.dataset.tab + if (tab != this.data.tab) { + if (tab == '1') { + this.setData({ + tab: tab, + ['page.page']: 1 + }) + this.getHelpList() + } else { + this.setData({ + tab: tab, + ['page.page']: 1 + }) + this.getCircleList() + } + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getMyCommunity() + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/neighbor/neighbor.json b/pages/neighbor/neighbor.json new file mode 100644 index 0000000..4ff7e9c --- /dev/null +++ b/pages/neighbor/neighbor.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "邻里" +} \ No newline at end of file diff --git a/pages/neighbor/neighbor.wxml b/pages/neighbor/neighbor.wxml new file mode 100644 index 0000000..4de74e4 --- /dev/null +++ b/pages/neighbor/neighbor.wxml @@ -0,0 +1,77 @@ + + + + + + + + {{array[index]}} + + + + #邻里互助 + #助人为乐 + #求助 + + 和睦的邻里关系,对于能够为邻的人是一种幸福,同时也是社会和谐的基础。 + + + + + 邻里互助 + 邻里圈 + + + + + + + {{item.nickName}} {{item.problemTypeName}} + {{item.gmtCreate}} + + + + {{item.content}} + + + + + + + + + + + + + + + {{item.nickName}} + {{item.gmtCreate}} + + + + {{item.content}} + + + + + + + + + + + + + + + 查看更多 + + + + + + + + diff --git a/pages/neighbor/neighbor.wxss b/pages/neighbor/neighbor.wxss new file mode 100644 index 0000000..a4c5da1 --- /dev/null +++ b/pages/neighbor/neighbor.wxss @@ -0,0 +1,151 @@ +.neighbor-top{ + position: relative; +} +.top-bg, .top-bg image{ + width: 100%; +} +.neighbor-info{ + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0,0,0,0.6); + padding: 20rpx; + color: #fff; +} +.neighbor-info picker{ + font-size: 40rpx; + margin-bottom: 30rpx; +} +.neighbor-info .warm-tip{ + font-size: 30rpx; +} +.topic{ + margin-bottom: 20rpx; +} +.topic-box{ + display: inline-block; + font-size: 30rpx; + line-height: 45rpx; + height: 45rpx; + padding: 0 15rpx; + background-color: rgba(255,255,255,0.35); + border-radius: 24rpx; + margin-right: 20rpx; +} +.neighbor-container{ + margin-top: -100rpx; + padding: 20rpx 20rpx 0; + background-color: #fff; + position: relative; + border-top-left-radius: 30rpx; + border-top-right-radius: 30rpx; +} +.tab-box{ + display: inline-block; + margin-right: 30rpx; + font-size: 32rpx; + color: #797979; + line-height: 60rpx; +} +.tab-box.active{ + color: #000; + font-weight: bold; + border-bottom: 2px solid #FF4949; +} +.help-box{ + padding: 20rpx 0; + border-bottom: 1px solid #F9FAFC; +} +.help-user{ + display: flex; +} +.help-user image{ + width: 100rpx; + height: 100rpx; + border-radius: 50%; + margin-right: 20rpx; +} +.user-name{ + font-size: 30rpx; + font-weight: bold; + margin: 10rpx 0; +} +.user-name text{ + background-color: #FF4949; + color: #fff; + padding: 5rpx 15rpx; + border-radius: 24rpx; + font-weight: normal; + font-size: 26rpx; +} +.user-time{ + font-size: 28rpx; + color: #999; +} +.help-content{ + margin-top: 20rpx; + font-size: 32rpx; + color: #101010; +} +.new{ + position: fixed; + bottom: 40rpx; + right: 40rpx; + font-size: 0; + width: 120rpx; + height: 120rpx; + display: flex; + justify-content: center; + align-items: center; + /* text-align: center; */ + /* line-height: 120rpx; */ + color: #fff; + border-radius: 50%; + background-color: #FF4949; +} +.new image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + height: 60rpx; +} +.help-photo{ + margin-top: 20rpx; +} +.help-photo-box{ + display: inline-block; + width: 32%; + height: 150rpx; + margin-right: 2%; + margin-bottom: 20rpx; + text-align: center; +} +.help-photo-box:nth-child(3n){ + margin-right: 0; +} +.help-photo-box image{ + height: 100%; +} +.help-video{ + margin-top: 20rpx; +} +.help-video, .help-video video{ + width: 100%; +} +.help-more{ + font-size: 32rpx; + line-height: 70rpx; +} +.no-data{ + padding: 50rpx 0; + text-align: center; +} +.no-data image{ + width: 300rpx; +} +.neighbor-tab{ + margin-bottom: 30rpx; +} diff --git a/pages/news/newsDetail.js b/pages/news/newsDetail.js new file mode 100644 index 0000000..bea301c --- /dev/null +++ b/pages/news/newsDetail.js @@ -0,0 +1,295 @@ +// pages/news/newsDetail.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + newsId: '', + newsDetail: {}, + reply: '', + userIcon: '', + userName: '', + replyList: [], + isCollect: 'no', + isGetFocus: false, + placeholder: '写评论', + replyTo: '', + replyUserName: '', + isLoading: false + }, + // 获取新闻详情 + getNewsDetail: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getNewsDetail, [app.baseUrls.requestUrl, self.data.newsId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + newsDetail: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 发布评论 + doReplyNews: function () { + var self = this + if (!self.data.isLoading) { + if (!self.data.reply) { + wx.showToast({ + title: '评论不能为空', + icon: 'error' + }) + return + } + var info = { + content: self.data.reply, + headPortrait: self.data.userIcon, + userName: self.data.userName, + newsId: self.data.newsId + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.submitNewsReply, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + self.getReplyList() + self.setData({ + reply: '', + isLoading: false + }) + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + // 获取评论列表 + getReplyList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getNewsReplyList, [app.baseUrls.requestUrl]), { + newsId: self.data.newsId + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + replyList: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取我是否收藏此新闻 + getIsCollect: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.isCollectNews, [app.baseUrls.requestUrl, self.data.newsId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + isCollect: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 收藏/取消收藏 + toggleCollect: function () { + if (this.data.isCollect == 'no') { + this.collectNews() + } else { + this.cancelCollect() + } + }, + // 收藏 + collectNews: function () { + var self = this + app.restAjax.post(app.restAjax.path(app.apis.doCollectNews, [app.baseUrls.requestUrl]), { + newsId: self.data.newsId + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '收藏成功!', + icon: 'success' + }) + self.getIsCollect() + } + }, function (code, data) { + console.log(data) + }) + }, + // 取消收藏 + cancelCollect: function () { + var self = this + app.restAjax.delete(app.restAjax.path(app.apis.cancelCollectNews, [app.baseUrls.requestUrl, self.data.newsId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '已取消收藏!', + icon: 'success' + }) + self.getIsCollect() + } + }, function (code, data) { + console.log(data) + }) + }, + // 输入评论 + getFocus: function (e) { + var user = e.currentTarget.dataset.user + var replyTo = e.currentTarget.dataset.id + var name = e.currentTarget.dataset.name + this.setData({ + isGetFocus: true, + placeholder: '回复' + user + ':', + replyTo: replyTo, + replyUserName: name + }) + }, + // 输入框失去焦点判断文字 + inputBlur: function () { + if (!this.data.reply) { + this.setData({ + placeholder: '讨论一下', + isGetFocus: false + }) + } + }, + // 确认回复 + doReply: function () { + if (!this.data.replyTo) { + this.doReplyNews() + } else { + this.doReplyReply() + } + }, + // 回复 + doReplyReply: function () { + var self = this + if (!self.data.isLoading) { + var info = { + content: self.data.reply, + headPortrait: self.data.userIcon, + userName: self.data.userName, + // trifleMyselfId: self.data.trifleMyselfId, + newsId: self.data.newsId, + commentId: self.data.replyTo, + replyCommentId: self.data.replyTo, + replyNewsCommentId: self.data.replyTo, + replyUserName: self.data.replyUserName + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.submitNewsReply, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '评论成功!', + icon: 'success' + }) + self.getReplyList() + self.setData({ + reply: '', + replyTo: '', + replyUserName: '', + placeholder: '讨论一下', + isLoading: false + }) + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + newsId: options.newsId, + userIcon: wx.getStorageSync('userIcon'), + userName: wx.getStorageSync('name') + }) + this.getNewsDetail() + this.getReplyList() + this.getIsCollect() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/news/newsDetail.json b/pages/news/newsDetail.json new file mode 100644 index 0000000..7a847d9 --- /dev/null +++ b/pages/news/newsDetail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "新闻" +} \ No newline at end of file diff --git a/pages/news/newsDetail.wxml b/pages/news/newsDetail.wxml new file mode 100644 index 0000000..59d9805 --- /dev/null +++ b/pages/news/newsDetail.wxml @@ -0,0 +1,45 @@ + + + {{newsDetail.title}} + + 来源:{{newsDetail.source}} + {{newsDetail.sendTime}} + + + + + + + 评论区 + + + + + + + {{item.content}} + + + + {{child.userName}} 回复 {{child.replyUserName}} : {{child.content}} + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/news/newsDetail.wxss b/pages/news/newsDetail.wxss new file mode 100644 index 0000000..33f64f2 --- /dev/null +++ b/pages/news/newsDetail.wxss @@ -0,0 +1,111 @@ +page{ + background-color: #fff; +} +.news-title{ + padding-bottom: 20rpx; + border-bottom: 1px solid #FAFAFC; + margin-bottom: 20rpx; +} +.title{ + font-size: 36rpx; + font-weight: bold; + margin-bottom: 10rpx; +} +.from-date{ + display: flex; + justify-content: space-between; + font-size: 28rpx; + color: #bbb; +} +.news-content{ + min-height: 600rpx; + font-size: 30rpx; + line-height: 60rpx; + border-bottom: 1px solid #FAFAFC 100%; +} +.comment{ + margin: 20rpx 0 130rpx; +} +.comment-title{ + font-size: 32rpx; + font-weight: bold; +} +.talk-user, .user-info{ + display: flex; + justify-content: space-between; + margin-bottom: 10rpx; +} +.user-info image{ + width: 80rpx; + height: 80rpx; + margin-right: 20rpx; +} +.good image{ + width: 40rpx; + height: 40rpx; + margin-top: -8rpx; + vertical-align: middle; +} +.name{ + font-size: 32rpx; + line-height: 50rpx; +} +.time{ + font-size: 24rpx; + color: #888; +} +.good text{ + line-height: 80rpx; +} +.comment-box{ + margin-top: 20rpx; + border-bottom: 1px solid #FAFAFC 100%; + padding-bottom: 20rpx; +} +.talk-content{ + font-size: 30rpx; + line-height: 40rpx; +} +.talk-time{ + margin-top: 10rpx; + font-size: 28rpx; + color: #BBB; +} +.do-reply{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 35rpx 20rpx; + background-color: #fff; + z-index: 100; + display: flex; + border-top: 1px solid #FAFAFC 100%; +} +.do-reply input{ + width: 80%; + height: 60rpx; + border-radius: 40rpx; + background-color: #F0F0F0; + padding: 0 20rpx; + box-sizing: border-box; +} +.collect{ + width: 20%; + text-align: center; + height: 60rpx; +} +.collect image{ + height: 100%; +} +.reply-row{ + line-height: 60rpx; + background-color: #F7F7F7; + padding: 0 10rpx; + word-break: break-all; +} +.reply-row text{ + font-weight: bold; +} + + diff --git a/pages/news/newsList.js b/pages/news/newsList.js new file mode 100644 index 0000000..a5fc6a6 --- /dev/null +++ b/pages/news/newsList.js @@ -0,0 +1,159 @@ +// pages/news/newsList.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + newsType: [], + curType: '', + page: { + page: 1, + rows: 10, + newsTypeId: '', + }, + newsList: [], + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + }, + // 获取新闻类型 + getNewsType: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getNewsType, [app.baseUrls.requestUrl]), { + showArea: '6dcbb862-4b48-4dca-aee1-d78fd76adc05' + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + newsType: data, + ['page.newsTypeId']: data[0].newsTypeId, + curType: data[0].newsTypeId + }) + self.getNewsList() + }, function (code, data) { + console.log(data) + }) + }, + // 切换新闻类型 + changeType: function (e) { + var id = e.currentTarget.dataset.id + this.setData({ + curType: id, + ['page.newsTypeId']: id, + ['page.page']: 1 + }) + this.getNewsList() + }, + // 获取新闻列表 + getNewsList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getNewsList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + for (let i = 0; i < data.rows.length; i++) { + if (data.rows[i].photo) { + data.rows[i].photo = data.rows[i].photo.split(',') + } + } + if (self.data.page.page == 1) { + self.setData({ + newsList: data.rows + }) + } else { + if (data.rows.length > 0) { + var arr = self.data.newsList + for (let i = 0; i < data.rows.length; i++) { + arr.push(data.rows[i]) + } + self.setData({ + newsList: arr + }) + } else { + wx.showToast({ + title: '暂无更多', + icon: 'none' + }) + self.setData({ + ['page.page']: self.data.page.page - 1 + }) + } + } + + }, function (code, data) { + console.log(data) + }) + }, + // 查看详情 + checkDetail: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: './newsDetail?newsId=' + id, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getNewsType() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + var self = this + this.setData({ + ['page.page']: self.data.page.page + 1 + }) + this.getNewsList() + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/news/newsList.json b/pages/news/newsList.json new file mode 100644 index 0000000..3028f40 --- /dev/null +++ b/pages/news/newsList.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "服务公告" +} \ No newline at end of file diff --git a/pages/news/newsList.wxml b/pages/news/newsList.wxml new file mode 100644 index 0000000..bfa9e50 --- /dev/null +++ b/pages/news/newsList.wxml @@ -0,0 +1,54 @@ + + {{item.typeName}} + + + + + + {{item.title}} + + + + + {{item.sendTime}} + + + + + + + {{item.title}} + {{item.sendTime}} + + + + + {{item.title}} + {{item.sendTime}} + + + + + + + + {{item.title}} + + + + + + + {{item.sendTime}} + + + + {{item.title}} + + {{item.sendTime}} + + + + + + \ No newline at end of file diff --git a/pages/news/newsList.wxss b/pages/news/newsList.wxss new file mode 100644 index 0000000..72aac3a --- /dev/null +++ b/pages/news/newsList.wxss @@ -0,0 +1,107 @@ +page{ + background-color: #fff; +} +.news-type{ + position: fixed; + top: 0; + left: 0; + right: 0; + background-color: #fff; + z-index: 100; + display: flex; + flex-wrap: nowrap; + overflow-x: auto; + border-bottom: 1px solid #DDD; +} +.type-box{ + width: 25%; + line-height: 80rpx; + font-size: 32rpx; + text-align: center; + flex-shrink: 0; +} +.type-box.active{ + color: #f55054; +} +.news-list{ + margin-top: 80rpx; + padding: 20rpx; +} +.news-box{ + display: flex; + justify-content: space-between; + padding: 20rpx 0; + border-bottom: 1px solid #DDD; +} +.news-img{ + width: 30%; + height: 150rpx; + overflow: hidden; + text-align: center; +} +.news-img image{ + height: 100%; + border-radius: 10rpx; +} +.news-info{ + width: 68%; +} +.news-title{ + font-size: 32rpx; + font-weight: bold; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} +.news-date{ + font-size: 30rpx; + color: #bbb; + margin-top: 15rpx; +} +.style3, .style4{ + flex-direction: column; +} +.style3 .news-info, .style3 .news-img, .style4 .news-info{ + width: 100%; +} +.style3 .news-img{ + height: auto; + margin-top: 10rpx; +} +.style3 .news-img image, .style5 .news-info{ + width: 100%; +} +.style5{ + flex-direction: column; +} +.news-img-container .img-box{ + width: 32%; + margin-right: 2%; + height: 150rpx; + border-radius: 10rpx; + display: inline-block; + text-align: center; +} +.img-box image{ + height: 100%; +} +.news-img-container .img-box:last-child{ + margin-right: 0; +} +.news-img-container{ + margin-top: 10rpx; +} +.no-data{ + margin-top: 150rpx; + text-align: center; +} +.no-data image{ + width: 300rpx; +} + + + + + + diff --git a/pages/report/report.js b/pages/report/report.js new file mode 100644 index 0000000..dba9c52 --- /dev/null +++ b/pages/report/report.js @@ -0,0 +1,634 @@ +// pages/caseReport/caseReport.js +const app = getApp() +var bmap = require('../../utils/bmap-wx.min.js'); +var util = require('../../utils/WSCoordinate.js') +var wxMarkerData = []; + +Page({ + + /** + * 页面的初始数据 + */ + data: { + sourceUrl: app.baseUrls.sourceUrl, + // 事件类型 + typeAll: [], + typeArray: [], + typeIdx: 0, + typeSelected: '', + typeSelectedCode: '', + typeSelectedName: '', + // 事件类型二级 + type2All: [], + type2Array: ['请选择上级类型'], + type2Idx: 0, + type2Selected: '', + type2SelectedName: '', + // 区县 + areaAll: [], + areaArray: [], + areaIdx: 0, + areaSelected: '', + areaSelectedName: '', + // 乡镇 + villageAll: [], + villageArray: [], + villageIdx: 0, + villageSelected: '', + villageSelectedName: '', + // 委员会 + committeeAll: [], + committeeArray: [], + committeeIdx: 0, + committeeSelected: '', + committeeSelectedName: '', + recodePath: '', + recorderManager: wx.getRecorderManager(), + baseImgUrl: app.baseUrls.baseImgUrl, + caseUrl: app.baseUrls.caseUrl, + imageList: [], + videoId: '', + audioId: '', + latitude: '', + longitude: '', + reportAddress: '', + reportContent: '', + reportInfo: { + bGId: "", + casePartsObjId: "123", + casePartsObjName: "123", + caseTypeCode1: "", + caseTypeCode2: "", + caseTypeName1: "", + caseTypeName2: "", + reportAddress: "", + reportAreaCod: "", + reportAreaName: "例如北京市 / xx区 / xx街道 / xx", + reportAudio: "", + reportContent: "", + reportLat: "", + reportLng: "", + reportPhotos: "", + reportVideo: "" + }, + isLoading: false + }, + // 获取区县 + getArea: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getArea, [app.baseUrls.caseUrl, '110889']), {}, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + var arr = ['请选择区县'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].areaName) + } + self.setData({ + areaAll: data, + areaArray: arr + }) + // self.getVillage() + }, function (code, data) { + console.log(data) + }) + }, + // 获取乡镇 + getVillage: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getChildArea, [app.baseUrls.caseUrl, self.data.areaSelected]), {}, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + var arr = ['请选择乡镇'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].areaName) + } + self.setData({ + villageAll: data, + villageArray: arr + }) + // self.getCommittee() + }, function (code, data) { + console.log(data) + }) + }, + // 获取委员会 + getCommittee: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getChildArea, [app.baseUrls.caseUrl, self.data.villageSelected]), {}, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + var arr = ['请选择委员会'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].areaName) + } + self.setData({ + committeeAll: data, + committeeArray: arr + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取事件类型 + getCaseType: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.caseType, [app.baseUrls.caseUrl]), {}, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + var arr = ['请选择事件类型'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].name) + } + self.setData({ + typeAll: data, + typeArray: arr + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取事件类型子级 + getCaseTypeChild: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.caseTypeChild + '/' + self.data.typeSelected, [app.baseUrls.caseUrl]), {}, { + headers: { + token: app.globalData.token + } + }, function (code, data) { + var arr = ['请选择事件类型'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].typeName) + } + self.setData({ + type2All: data, + type2Array: arr + }) + }, function (code, data) { + console.log(data) + }) + }, + // 选择事件类型 + bindPickerChange: function (e) { + var self = this + if (e.detail.value != 0) { + this.setData({ + typeIdx: e.detail.value, + typeSelected: self.data.typeAll[e.detail.value - 1].id, + typeSelectedCode: self.data.typeAll[e.detail.value - 1].code, + typeSelectedName: self.data.typeAll[e.detail.value - 1].name + }) + self.getCaseTypeChild() + } else { + this.setData({ + typeIdx: 0, + typeSelected: '', + type2Array: [] + }) + } + }, + // 选择事件类型子级 + bindCaseTypeChange: function (e) { + var self = this + if (e.detail.value != 0) { + this.setData({ + type2Idx: e.detail.value, + type2Selected: self.data.type2All[e.detail.value - 1].typeCode, + type2SelectedName: self.data.type2All[e.detail.value - 1].typeName + }) + } else { + this.setData({ + type2Idx: 0, + type2Selected: '' + }) + } + }, + // 选择区县 + bindAreaPickerChange: function (e) { + var self = this + if (e.detail.value != 0) { + this.setData({ + areaIdx: e.detail.value, + areaSelected: self.data.areaAll[e.detail.value - 1].areaCode, + areaSelectedName: self.data.areaAll[e.detail.value - 1].areaName + }) + this.getVillage() + } else { + this.setData({ + areaIdx: 0, + areaSelected: '', + villageArray: [], + committeeArray: [] + }) + } + }, + // 选择乡镇 + bindVillagePickerChange: function (e) { + var self = this + if (e.detail.value != 0) { + this.setData({ + villageIdx: e.detail.value, + villageSelected: self.data.villageAll[e.detail.value - 1].areaId, + villageSelectedName: self.data.villageAll[e.detail.value - 1].areaName + }) + this.getCommittee() + } else { + this.setData({ + villageIdx: 0, + villageSelected: '', + committeeArray: [] + }) + } + }, + // 选择委员会 + bindCommitteePickerChange: function (e) { + var self = this + if (e.detail.value != 0) { + this.setData({ + committeeIdx: e.detail.value, + committeeSelected: self.data.committeeAll[e.detail.value - 1].areaId, + committeeSelectedName: self.data.committeeAll[e.detail.value - 1].areaName + }) + } else { + this.setData({ + committeeIdx: 0, + committeeSelected: '' + }) + } + }, + // 录音 + recordVoice: function (e) { + this.setData({ + startTouch: e.touches[0] + }) + var options = { + format: 'mp3' + } + this.data.recorderManager.start(options) + wx.showToast({ + title: "正在录音", + icon: "none", + duration: 60000//先定义个60秒,后面可以手动调用wx.hideToast()隐藏 + }); + }, + // 录音结束 + recordEnd: function () { + var self = this + this.data.recorderManager.stop() + this.data.recorderManager.onStop(function (res) { + var path = res.tempFilePath + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + app.restAjax.file(app.restAjax.path(app.apis.uploadAudio, [app.baseUrls.caseUrl]), path, 'audio', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + var id = JSON.parse(data).data + self.setData({ + audioId: id + }) + wx.hideToast() + }, function (code, data) { + console.log(data) + }) + }) + var self = this + wx.hideToast() + }, + // 播放录音 + playRecord: function () { + var innerAudioContext = wx.createInnerAudioContext() + innerAudioContext.src = this.data.caseUrl + this.data.baseImgUrl + this.data.audioId + innerAudioContext.play() + }, + // 登录 + doLogin: function () { + var self = this; + wx.login({ + success(res) { + app.restAjax.post(app.restAjax.path(app.apis.login, [app.baseUrls.loginUrl]), { + jsCode: res.code + }, null, function (code, data) { + console.log(data) + }, function (code, data) { + app.dialog.msg(data.msg); + }); + } + }) + }, + // 上传图片 + uploadImage: function () { + var self = this + if (!self.data.isLoading) { + self.setData({ + isLoading: true + }) + wx.chooseImage({ + count: 9 - self.data.imageList.length, + sourceType: ['album', 'camera'], + success: function (res) { + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + for (let i = 0; i < res.tempFiles.length; i++) { + var path = res.tempFiles[i].path; + app.restAjax.file(app.restAjax.path(app.apis.uploadImg, [app.baseUrls.caseUrl]), path, 'image', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + self.setData({ + isLoading: false + }) + var id = JSON.parse(data).data + var arr = self.data.imageList + arr.push(id) + self.setData({ + imageList: arr + }) + wx.hideToast() + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + } + }) + } + }, + // 上传视频 + uploadVideo: function () { + var self = this + if (!self.data.isLoading) { + self.setData({ + isLoading: true + }) + wx.chooseVideo({ + sourceType: ['album','camera'], + maxDuration: 60, + camera: 'back', + success: function (res) { + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + var path = res.tempFilePath + app.restAjax.file(app.restAjax.path(app.apis.uploadVideo, [app.baseUrls.caseUrl]), path, 'video', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + var id = JSON.parse(data).data + self.setData({ + videoId: id, + isLoading: false + }) + wx.hideToast() + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }) + } + }, + // 选择坐标 + chooseLocation: function () { + var self = this + wx.chooseLocation({ + success: function (res) { + console.log(res) + var result = util.transformFromGCJToWGS(res.latitude, res.longitude); + console.log(result) + self.setData({ + longitude: result.longitude, + latitude: result.latitude + }) + } + }) + }, + editInfo: function (e) { + var type = e.currentTarget.dataset.type + if (type == 'location') { + this.setData({ + reportAddress: e.detail.value + }) + } else { + this.setData({ + reportContent: e.detail.value + }) + } + }, + // 提交上报 + submitReport: function () { + var self = this + if (!self.data.isLoading) { + if (!this.data.typeSelected) { + wx.showToast({ + title: '请选择事件类型', + icon: 'error' + }) + return + } + if (!this.data.type2Selected) { + wx.showToast({ + title: '请选择事件类型', + icon: 'error' + }) + return + } + // if (!this.data.areaSelected) { + // wx.showToast({ + // title: '请选择区县', + // icon: 'error' + // }) + // return + // } + if (!this.data.reportAddress) { + wx.showToast({ + title: '请输入事发位置', + icon: 'error' + }) + return + } + if (!this.data.longitude && !this.data.latitude) { + wx.showToast({ + title: '请选择事发坐标', + icon: 'error' + }) + return + } + if (!this.data.reportContent) { + wx.showToast({ + title: '请输入事件说明', + icon: 'error' + }) + return + } + var areaName = '内蒙古自治区 / 乌兰察布市 / ' + wx.getStorageSync('curCommunityName') + // if (self.data.villageIdx != 0) { + // areaName += ' / ' + self.data.villageSelectedName + // } + // if (self.data.committeeIdx != 0) { + // areaName += ' / ' + self.data.committeeSelectedName + // } + var photo + for (let i = 0; i < self.data.imageList.length; i++) { + if (i == 0) { + photo = self.data.imageList[i] + } else { + photo += ',' + self.data.imageList[i] + } + } + var area = wx.getStorageSync('areaCode') + // if (self.data.committeeAll.length > 0 && self.data.committeeIdx != 0) { + // area = self.data.committeeSelected + // } else if (self.data.villageAll.length > 0 && self.data.villageIdx != 0) { + // area = self.data.villageSelected + // } else { + // area = self.data.areaSelected + // } + var info = { + bGId: "", + casePartsObjId: "", + casePartsObjName: "", + caseTypeCode1: self.data.typeSelectedCode, + caseTypeCode2: self.data.type2Selected, + caseTypeName1: self.data.typeSelectedName, + caseTypeName2: self.data.type2SelectedName, + reportAddress: self.data.reportAddress, + reportAreaCode: area, + isSelf: '0', + reportAreaName: areaName, + reportAudio: self.data.audioId, + reportContent: self.data.reportContent, + reportLat: self.data.latitude, + reportLng: self.data.longitude, + reportPhotos: photo, + reportVideo: self.data.videoId, + gridMiniId: wx.getStorageSync('gridMiniId') + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.submitReport, [app.baseUrls.requestUrl]), info, { + headers: { + token: 'cVJWWXQ1UWpQWTQ1TDZMbEVtTmxiMlJVNkdvTzUwSTNHYzZaK3VTZmF0RXNITnQ3RXUxZ2F6eVU4dGpZWjFqWm5Pc0Fqd2l6MzAvMlZSckZaTkZITFZmVXk4YVNWVVErcEJ5SGZzVFRGeGFEenBMaDhZU0FFc1hnZ2RGc2hLUWZvMTJtWHRkcENmWThROTZFL2d5WDJxc0RBY2RzUkUzUzIyNlBmblFhUGdPZWdFY3JOeU5mME5veEk1aVU4a1hNMFNlaW1BemFwRjhRbXVRUUt1MTlObEViSTlhMUVoSEJDZ2ZFVTFYZlJNNGFoMTVOTXgyYytBdE96SUVmWmpYRQ==' + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '上报成功', + icon: 'success' + }) + + setTimeout(function () { + self.setData({ + isLoading: false + }) + wx.navigateBack({ + delta: 1, + }) + }, 1500) + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + // 删除附件 + deleteSource: function (e) { + var self = this + var type = e.currentTarget.dataset.type + if (type == 'video') { + self.setData({ + videoId: '' + }) + } else { + var cur = e.currentTarget.dataset.cur + self.data.imageList.splice(cur, 1) + self.setData({ + imageList: self.data.imageList + }) + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + // this.doLogin() + this.getCaseType() + this.getArea() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/report/report.json b/pages/report/report.json new file mode 100644 index 0000000..8e40969 --- /dev/null +++ b/pages/report/report.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "事件上报" +} \ No newline at end of file diff --git a/pages/report/report.wxml b/pages/report/report.wxml new file mode 100644 index 0000000..a29e326 --- /dev/null +++ b/pages/report/report.wxml @@ -0,0 +1,140 @@ + + + 基本信息 + + + + * + 事件类型 + + + + + {{typeArray[typeIdx]}} + + + + + + + * + 事件类型 + + + + + {{type2Array[type2Idx]}} + + + + + + + + * + 事发位置 + + + + + + + + * + 事发坐标 + + + 点击选择事发位置坐标 + {{longitude}},{{latitude}} + + + + + + + 详细信息 + + + + * + 事件说明 + + + + + + + + 事件图片 + + + + + + + + + + + + + + 视频 + + + + + + + + + + + + + + 录音 + + 长按录音 + 播放录音 + + + + 上报 + \ No newline at end of file diff --git a/pages/report/report.wxss b/pages/report/report.wxss new file mode 100644 index 0000000..5c81023 --- /dev/null +++ b/pages/report/report.wxss @@ -0,0 +1,166 @@ +page{ + background-color: #fafafa; +} +.report{ + width: 710rpx; + margin: 20rpx auto; + background-color: #fff; + padding: 20rpx 30rpx; + box-sizing: border-box; + border-radius: 10rpx; + box-shadow: 0px 2px 8px 0px rgba(35, 24, 21, 0.1); +} +.title{ + font-size: 36rpx; + color: #333; + margin-bottom: 20rpx; +} +.row{ + background-color: #f2f1f6; + padding: 15rpx; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + border-radius: 10rpx; + font-size: 32rpx; + margin-bottom: 15rpx; +} +.row:last-child{ + margin-bottom: 0; +} +.row-name{ + width: 200rpx; + border-right: 1px solid #9b9a9f; + flex-shrink: 0; +} +.row-name text{ + color: red; +} +.row-main{ + width: 410rpx; + text-align: right; + flex-shrink: 0; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.submit{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + background: #fff; + padding: 20rpx; +} +.submit-btn{ + background-color: #f55054; + color: #fff; + text-align: center; + height: 80rpx; + border-radius: 10rpx; + line-height: 80rpx; + font-size: 36rpx; +} +.file{ + width: 710rpx; + margin: 0 auto 130rpx; + background-color: #fff; + padding: 20rpx 30rpx; + box-sizing: border-box; + border-radius: 10rpx; + box-shadow: 0px 2px 8px 0px rgba(35, 24, 21, 0.1); +} +.file-box{ + background-color: #f2f1f6; + padding: 15rpx; + border-radius: 10rpx; + margin-bottom: 20rpx; +} +.file-box:last-child{ + margin-bottom: 0; +} +.file-title{ + font-size: 30rpx; +} +.file-title text{ + color: red; +} +.file-content{ + margin-top: 10rpx; +} +.file-content textarea{ + width: 100%; + height: 150rpx; +} +.upload-btn{ + width: 100rpx; + height: 100rpx; + text-align: center; + line-height: 100rpx; + display: inline-block; + font-size: 60rpx; + border-radius: 10rpx; + border: 2px solid #333; + vertical-align: top; + box-sizing: border-box; +} +.img-box{ + width: 32%; + display: inline-block; + margin-right: 2%; + height: 150rpx; + position: relative; + text-align: center; +} +.delete{ + width: 35rpx !important; + height: 35rpx !important; + position: absolute; + top: -18rpx; + right: -18rpx; +} +.img-box:nth-child(3n){ + margin-right: 0; +} +.img-box image{ + /* width: 100%; */ + height: 150rpx; +} +.video-box{ + width: 100%; + position: relative; +} +.video-box video{ + width: 100%; +} +.voice-box{ + display: flex; + justify-content: space-between; + padding: 0; +} +.voice-box image{ + width: 35rpx; + vertical-align: middle; + margin-top: -7rpx; +} +.voice-title{ + font-size: 30rpx; + line-height: 80rpx; + margin-left: 15rpx; +} +.record-btn{ + background-color: #f55054; + color: #fff; + line-height: 80rpx; + border-radius: 10rpx; + padding: 0 15rpx; +} +.map-box{ + width: 100%; + height: 300rpx; + margin-top: 10rpx; +} +.map{ + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/pages/serve/newsList.js b/pages/serve/newsList.js new file mode 100644 index 0000000..1970faa --- /dev/null +++ b/pages/serve/newsList.js @@ -0,0 +1,158 @@ +// pages/news/newsList.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + newsType: [], + curType: '', + page: { + page: 1, + rows: 10, + newsTypeId: '', + }, + newsList: [], + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + }, + // 获取新闻类型 + getNewsType: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getNewsType, [app.baseUrls.requestUrl]), { + showArea: '6dcbb862-4b48-4dca-aee1-d78fd76adc05' + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + newsType: data, + ['page.newsTypeId']: data[0].newsTypeId, + curType: data[0].newsTypeId + }) + self.getNewsList() + }, function (code, data) { + console.log(data) + }) + }, + // 切换新闻类型 + changeType: function (e) { + var id = e.currentTarget.dataset.id + this.setData({ + curType: id, + ['page.newsTypeId']: id, + ['page.page']: 1 + }) + this.getNewsList() + }, + // 获取新闻列表 + getNewsList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getNewsList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + for (let i = 0; i < data.rows.length; i++) { + if (data.rows[i].photo) { + data.rows[i].photo = data.rows[i].photo.split(',') + } + } + if (self.data.page.page == 1) { + self.setData({ + newsList: data.rows + }) + } else { + if (data.rows.length > 0) { + var arr = self.data.newsList + for (let i = 0; i < data.rows.length; i++) { + arr.push(data.rows[i]) + } + self.setData({ + newsList: arr + }) + } else { + wx.showToast({ + title: '暂无更多', + icon: 'none' + }) + self.setData({ + ['page.page']: self.data.page.page - 1 + }) + } + } + + }, function (code, data) { + console.log(data) + }) + }, + // 查看详情 + checkDetail: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: '../news/newsDetail?newsId=' + id, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getNewsType() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + var self = this + this.setData({ + ['page.page']: self.data.page.page + 1 + }) + this.getNewsList() + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/serve/newsList.json b/pages/serve/newsList.json new file mode 100644 index 0000000..3028f40 --- /dev/null +++ b/pages/serve/newsList.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "服务公告" +} \ No newline at end of file diff --git a/pages/serve/newsList.wxml b/pages/serve/newsList.wxml new file mode 100644 index 0000000..d895dae --- /dev/null +++ b/pages/serve/newsList.wxml @@ -0,0 +1,51 @@ + + {{item.typeName}} + + + + + + {{item.title}} + + + + + {{item.sendTime}} + + + + + + + {{item.title}} + {{item.sendTime}} + + + + + {{item.title}} + {{item.sendTime}} + + + + + + + + {{item.title}} + + + + + + + {{item.sendTime}} + + + + {{item.title}} + + {{item.sendTime}} + + + \ No newline at end of file diff --git a/pages/serve/newsList.wxss b/pages/serve/newsList.wxss new file mode 100644 index 0000000..1dd2759 --- /dev/null +++ b/pages/serve/newsList.wxss @@ -0,0 +1,102 @@ +page{ + background-color: #fff; +} +.news-type{ + position: fixed; + top: 0; + left: 0; + right: 0; + background-color: #fff; + z-index: 100; + display: flex; + flex-wrap: nowrap; + overflow-x: auto; + border-bottom: 1px solid #DDD; +} +.type-box{ + width: 25%; + line-height: 80rpx; + font-size: 32rpx; + text-align: center; + flex-shrink: 0; +} +.type-box.active{ + color: #f55054; +} +.news-list{ + margin-top: 80rpx; + padding: 20rpx; +} +.news-box{ + display: flex; + justify-content: space-between; + padding: 20rpx 0; + border-bottom: 1px solid #DDD; +} +.news-img{ + width: 30%; + height: 150rpx; + overflow: hidden; + text-align: center; +} +.news-img image{ + height: 100%; + border-radius: 10rpx; +} +.news-info{ + width: 68%; +} +.news-title{ + font-size: 32rpx; + font-weight: bold; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} +.news-date{ + font-size: 30rpx; + color: #bbb; + margin-top: 15rpx; +} +.style3, .style4{ + flex-direction: column; +} +.style3 .news-info, .style3 .news-img, .style4 .news-info{ + width: 100%; +} +.style3 .news-img{ + height: auto; + margin-top: 10rpx; +} +.style3 .news-img image, .style5 .news-info{ + width: 100%; +} +.style5{ + flex-direction: column; +} +.news-img-container .img-box{ + width: 32%; + margin-right: 2%; + height: 150rpx; + border-radius: 10rpx; + display: inline-block; + text-align: center; +} +.img-box image{ + height: 100%; +} +.news-img-container .img-box:last-child{ + margin-right: 0; +} +.news-img-container{ + margin-top: 10rpx; +} + + + + + + + + diff --git a/pages/serve/orgDetail.js b/pages/serve/orgDetail.js new file mode 100644 index 0000000..403d830 --- /dev/null +++ b/pages/serve/orgDetail.js @@ -0,0 +1,77 @@ +// pages/serve/orgDetail.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + sourceUrl: app.baseUrls.sourceUrl, + }, + // 复制文本 + copyText: function (e) { + var self = this + var text = e.currentTarget.dataset.text + if (text) { + wx.setClipboardData({ + data: text, + success: function () {} + }) + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/serve/orgDetail.json b/pages/serve/orgDetail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/serve/orgDetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/serve/orgDetail.wxml b/pages/serve/orgDetail.wxml new file mode 100644 index 0000000..618a541 --- /dev/null +++ b/pages/serve/orgDetail.wxml @@ -0,0 +1,330 @@ + + + + + + + + + 02/ + + + 加入卡包 + + + + 03/ + + + 名片码 + + + + + + + + 拨打电话 + + 13355556666 + + + + + 添加微信 + + dongbo + + + + + 邮箱 + + 358256383@qq.com + + + + + 地址 + + 地址 + + + + + + + + + + + + + + 999+ + + + + + 999+ + + + + + + + + + + + + + + {{item.name}} + + + + 更多 + + + + + + + + + + + + + + + {{child.value}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{child.value}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{audio.curDurationStr}} + + {{audio.totalDurationStr}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{child.value}} + + + + + + + + + + {{child.comment}}:{{child.selValue}} + + + + + + + + + {{child.comment}} + + + + + {{ss.dataName}} + + + + + + + + + + + + + + + 暂无数据 + + \ No newline at end of file diff --git a/pages/serve/orgDetail.wxss b/pages/serve/orgDetail.wxss new file mode 100644 index 0000000..b612e19 --- /dev/null +++ b/pages/serve/orgDetail.wxss @@ -0,0 +1,145 @@ + +.community{ + display: flex; + justify-content: space-between; +} +.card{ + width: 100%; + height: 0; + padding-bottom: 56%; + background-color: yellow; + margin: 20rpx 0; +} +.mid { + display: flex; + width: 100%; + position: relative; +} +.mid-box { + flex-shrink: 0; + width: 32% !important; + margin-right: 2% !important; + display: flex; + flex-direction: column; + align-items: left; + justify-content: left; + border: 2rpx solid #EAC390; + border-radius: 10rpx; + background-color: white; + font-weight: normal; + padding: 10rpx; +} +.mid-box:last-child{ + margin-right: 0; +} +.mid-box text{ + text-align: center; + line-height: 16px; + height: 16px; + font-size: 15px; + color: #CCC; +} +.mid-box image { + width: 48rpx; + height: 48rpx; +} +.mid-box-text{ + font-size: 28rpx; + text-align: left; +} +.good { + display: flex; + justify-content: space-between; + padding-left: 20rpx; + width: 100%; + padding-top: 20rpx; + padding-bottom: 20rpx; +} +.good-click { + display: flex; +} +.good-avatar { + font-size: 0; +} +.good-avatar, .good-click { + line-height: 45rpx; + color: #333; +} +.view-count { + margin-right: 30rpx; + padding-right: 30rpx; + border-right: 1px solid #808080; + color: #808080; + display: flex; + flex-direction: row; + font-size: 36rpx; +} +.view-count-no { + padding-right: 30rpx; + color: #808080; + display: flex; + flex-direction: row; + align-items: center; + font-size: 36rpx; +} +.view-count image, .view-count-no image { + width: 32rpx; + height: 32rpx; +} +.mid-btn { + position: relative; + margin-top: 20rpx; + display: flex; + padding: 10rpx; + width: 100%; + border: 1rpx solid rgb(235, 235, 235); + border-radius: 15rpx; + background: #fff; + box-shadow: 10rpx 10rpx 20rpx 20rpx #e4e4e426; + flex-wrap: nowrap; + flex-direction: column; + justify-content: center; +} + +.mid-btn-box { + flex-shrink: 0; + padding: 15rpx; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + box-sizing: border-box; +} + +.mid-btn-title { + display: flex; + flex-direction: row; + justify-content: flex-start; + flex: 3; + align-items: center; +} + +.mid-btn-title .image { + width: 48rpx; + height: 48rpx; +} + +.mid-btn-title text { + margin-left: 20rpx; + font-size: 28rpx; + color: #333333; +} + +.mid-btn-box:nth-child(3), +.mid-btn-box:nth-child(4) { + margin-bottom: 0; +} + +.mid-btn-box image { + width: 80rpx; + height: 80rpx; +} + +.mid-btn-text { + width: 200rpx; +} \ No newline at end of file diff --git a/pages/serve/orgList.js b/pages/serve/orgList.js new file mode 100644 index 0000000..9d2cc28 --- /dev/null +++ b/pages/serve/orgList.js @@ -0,0 +1,89 @@ +// pages/serve/orgList.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + orgList: [], + page: { + page: 1, + rows: 10 + } + }, + // 获取社会服务机构列表 + getServeOrg: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getOrgList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + console.log(data) + self.setData({ + orgList: data.rows + }) + }, function (code, data) { + console.log(data) + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getServeOrg() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/serve/orgList.json b/pages/serve/orgList.json new file mode 100644 index 0000000..8726031 --- /dev/null +++ b/pages/serve/orgList.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "社区服务机构" +} \ No newline at end of file diff --git a/pages/serve/orgList.wxml b/pages/serve/orgList.wxml new file mode 100644 index 0000000..c49d11c --- /dev/null +++ b/pages/serve/orgList.wxml @@ -0,0 +1,9 @@ + + + + + {{item.unitName}} + 服务人员:0人 + + + \ No newline at end of file diff --git a/pages/serve/orgList.wxss b/pages/serve/orgList.wxss new file mode 100644 index 0000000..810dea4 --- /dev/null +++ b/pages/serve/orgList.wxss @@ -0,0 +1,37 @@ +.container{ + background-color: #fff; +} +.org-box{ + display: flex; + justify-content: space-between; + border-bottom: 1px solid #DDD; + padding: 20rpx 0; +} +.org-box:last-child{ + border-bottom: none; +} +.org-box image{ + width: 120rpx; + height: 120rpx; +} +.org-info{ + width: 570rpx; +} +.org-name{ + font-size: 34rpx; + font-weight: bold; + line-height: 70rpx; +} +.org-count{ + font-size: 28rpx; + color: #bbb; +} + + + + + + + + + diff --git a/pages/serve/serve.js b/pages/serve/serve.js new file mode 100644 index 0000000..5f10e47 --- /dev/null +++ b/pages/serve/serve.js @@ -0,0 +1,163 @@ +// pages/serve/serve.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + showSettleType: false, + sourceUrl: app.baseUrls.sourceUrl, + settleType: '', + orgList: [], + page: { + page: 1, + rows:3, + // showArea: '6dcbb862-4b48-4dca-aee1-d78fd76adc05', + newsTypeId: 'b163953b-ed22-4041-a79f-73d5deedd025', + }, + serveOrgList: [], + indicatorDots: true, + vertical: false, + autoplay: true, + interval: 3000, + duration: 500, + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + }, + // 社会机构入驻 + orgSettle: function (e) { + var type = e.currentTarget.dataset.type + wx.navigateTo({ + url: './settle?type=' + type, + }) + // this.setData({ + // showSettleType: true, + // settleType: type + // }) + }, + // 关闭机构入驻 + closeSettleType: function () { + this.setData({ + showSettleType: false + }) + }, + // 前往入驻详情 + doSettle: function (e) { + var type = e.currentTarget.dataset.type + var name = e.currentTarget.dataset.name + this.setData({ + showSettleType: false + }) + wx.navigateTo({ + url: './settle?id=' + type + '&name=' + name, + }) + }, + // 更多机构 + checkMoreOrg: function () { + wx.navigateTo({ + url: './orgList', + }) + }, + // 获取社会服务机构列表 + getServeOrg: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getOrgList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + console.log(data) + self.setData({ + serveOrgList: data.rows + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取服务公告 + getNotice: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getNewsList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + noticeList: data.rows + }) + }, function (code, data) { + console.log(data) + }) + }, + // 查看服务公告详情 + checkNewsDetail: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: '../news/newsDetail?newsId=' + id, + }) + }, + // 查看更多服务公告 + checkMoreNews: function () { + wx.navigateTo({ + url: './newsList', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + this.getNotice() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getServeOrg() + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/serve/serve.json b/pages/serve/serve.json new file mode 100644 index 0000000..fa35962 --- /dev/null +++ b/pages/serve/serve.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "生活服务" +} \ No newline at end of file diff --git a/pages/serve/serve.wxml b/pages/serve/serve.wxml new file mode 100644 index 0000000..caf6244 --- /dev/null +++ b/pages/serve/serve.wxml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + 社区服务机构 + 查看更多 + + + + + {{item.unitName}} + + + + + + + + + + 服务公告 + 查看更多 + + + + + + + {{item.title}} + {{item.summary}} + {{item.gmtCreate}} + + + \ No newline at end of file diff --git a/pages/serve/serve.wxss b/pages/serve/serve.wxss new file mode 100644 index 0000000..1ac1b24 --- /dev/null +++ b/pages/serve/serve.wxss @@ -0,0 +1,216 @@ +.top-count image{ + width: 100%; +} +.settle-btn{ + width: 48%; + height: 120rpx; + background: #fff; + border-radius: 10rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 32rpx; + color: #f55054; +} +.swiper-box{ + margin-top: -325rpx; + position: relative; + padding: 0 20rpx; + height: 345rpx; +} +.swiper-box swiper{ + height: 100%; + border-radius: 30rpx; + overflow: hidden; +} +.swiper-box image{ + width: 100%; +} +.serve-org{ + padding: 0 20rpx; + margin: 20rpx 0; +} +.serve-title{ + font-size: 36rpx; + margin-bottom: 20rpx; + display: flex; + justify-content: space-between; +} +.title{ + font-weight: bold; + padding-left: 20rpx; + border-left: 5px solid #f55054; +} +.more{ + font-size: 30rpx; + color: #B5B5B5; +} +.org-list{ + width: 100%; +} +.org-box{ + display: inline-block; + width: 32%; + margin-right: 2%; + text-align: center; + padding: 20rpx; + box-sizing: border-box; + box-shadow: 0 0 10rpx #ccc; + background-color: #fff; + border-radius: 10rpx; +} +.org-box:last-child{ + margin-right: 0; +} +.org-box image{ + width: 100rpx; + height: 100rpx; + border-radius: 50%; +} +.org-name{ + font-size: 32rpx; + font-weight: bold; + margin: 10rpx 0; +} +.org-community{ + font-size: 28rpx; + color: #bbb; +} +.serve-join{ + padding: 0 20rpx; +} +.serve-join image{ + width: 100%; +} +.serve-news{ + margin: 20rpx 0; + padding: 0 20rpx; +} +.news-box{ + border-radius: 10rpx; + box-shadow: 0 0 10rpx #ccc; + background-color: #fff; + margin-bottom: 20rpx; +} +.news-top{ + padding: 20rpx; + border-bottom: 1px solid #DDD; + display: flex; + justify-content: space-between; +} +.news-info{ + width: 68%; +} +.news-img{ + width: 30%; + height: 150rpx; +} +.news-img image{ + height: 100%; + border-radius: 10rpx; +} +.news-title{ + font-size: 34rpx; + font-weight: bold; +} +.news-date{ + font-size: 26rpx; + color: #bbb; + margin-top: 20rpx; +} +.news-bottom{ + padding: 0 20rpx; + line-height: 60rpx; + font-size: 30rpx; +} +.settle-type{ + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(0,0,0,0.6); +} +.center{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + width: 710rpx; +} +.type-container{ + border-radius: 10rpx; + overflow: hidden; +} +.type-box{ + line-height: 80rpx; + text-align: center; + border-bottom: 1px solid #DDD; + font-size: 32rpx; + background-color: #fff; +} +.type-box:last-child{ + border-bottom: none; +} +.close-btn{ + margin-top: 20rpx; + line-height: 80rpx; + text-align: center; + font-size: 32rpx; + background-color: #fff; + border-radius: 40rpx; +} +.notice{ + margin-top: 20rpx; + padding: 20rpx; + background-color: #fff; +} +.notice-title{ + font-size: 36rpx; + font-weight: bold; + margin-bottom: 20rpx; + display: flex; + justify-content: space-between; +} +.notice-box{ + padding: 20rpx 0; + border-bottom: 1px solid #DDD; + display: flex; + justify-content: space-between; +} +.notice-box:last-child{ + border-bottom: none; +} +.title-text{ + padding-left: 20rpx; + border-left: 5px solid #f55054; +} +.notice-title-text{ + font-size: 34rpx; +} +.notice-more{ + font-size: 28rpx; + color: #BBB; + font-weight: normal; +} +.notice-time{ + font-size: 28rpx; + color: rgba(16, 16, 16, 0.7); + line-height: 45rpx; +} +.notice-img{ + width: 200rpx; + height: 140rpx; + text-align: center; +} +.notice-img image{ + height: 100%; +} +.notice-info{ + width: 490rpx; +} + + + + + diff --git a/pages/serve/settle.js b/pages/serve/settle.js new file mode 100644 index 0000000..75751b0 --- /dev/null +++ b/pages/serve/settle.js @@ -0,0 +1,515 @@ +// pages/serve/settle.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + pageType: '1', + // 区县 + areaList: [], + areaIndex: 0, + areaAll: [], + areaSelected: '', + // 街道 + streetList: [], + streetIndex: 0, + streetAll: [], + streetSelected: '', + // 社区 + communityList: [], + communityIndex: 0, + communityAll: [], + communitySelected: '', + // 小区 + xqList: [], + xqIndex: 0, + xqAll: [], + xqSelected: '', + officeAddress: '', + orgIntro: '', + imageList: [], + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + locationCode: '', + unitName: '', + serviceMode: '', + shopType: '', + phone: '', + chargePerson: '', + residential: '', + curType: [], + typeIndex: 0, + typeAll: [], + typeSelected: '', + typeSelectedName: '', + isLoading: false + }, + // 选择入驻类型 + bindTypePickerChange: function (e) { + var self = this + self.setData({ + typeIndex: e.detail.value, + typeSelected: self.data.typeAll[e.detail.value].dataId, + typeSelectedName: self.data.typeAll[e.detail.value].dataName, + pageType: self.data.typeAll[e.detail.value].dataId + }) + }, + // 获取区县 + getArea: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getArea, [app.baseUrls.serviceUrl, '110889']), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = ['请选择区县'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].areaName) + } + self.setData({ + areaList: arr, + areaAll: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 选择区县 + bindAreaPickerChange: function(e) { + var self = this + this.setData({ + areaIndex: e.detail.value, + areaSelected: self.data.areaAll[e.detail.value - 1].areaId + }) + this.getStreet() + }, + // 获取街道 + getStreet: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getArea, [app.baseUrls.serviceUrl, self.data.areaSelected]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = ['请选择街道'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].areaName) + } + self.setData({ + streetList: arr, + streetAll: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 选择街道 + bindStreetPickerChange: function (e) { + var self = this + self.setData({ + streetIndex: e.detail.value, + streetSelected: self.data.streetAll[e.detail.value - 1].areaId + }) + self.getCommunity() + }, + // 获取社区 + getCommunity: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getCommunityList, [app.baseUrls.communityUrl]), { + parentCode: self.data.streetSelected + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = ['请选择社区'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].communityName) + } + self.setData({ + communityList: arr, + communityAll: data + }) + console.log(data) + }, function (code, data) { + console.log(data) + }) + }, + // 选择社区 + bindCommunityPickerChange: function (e) { + var self = this + self.setData({ + communityIndex: e.detail.value, + communitySelected: self.data.communityAll[e.detail.value - 1].communityId, + locationCode: self.data.communityAll[e.detail.value - 1].locationCode, + }) + self.getHouseList() + }, + // 上传图片 + uploadImage: function () { + var self = this + if (!self.data.isLoading) { + wx.chooseImage({ + count: 9 - self.data.imageList.length, + sourceType: ['album', 'camera'], + success: function (res) { + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + self.setData({ + isLoading: true + }) + for (let i = 0; i < res.tempFiles.length; i++) { + var path = res.tempFiles[i].path; + app.restAjax.file(app.restAjax.path(app.apis.uploadImg, [app.baseUrls.serviceUrl]), path, 'image', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + var id = JSON.parse(data).data + var arr = self.data.imageList + arr.push(id) + self.setData({ + imageList: arr + }) + if (i == res.tempFiles.length - 1) { + self.setData({ + isLoading: false + }) + } + wx.hideToast() + } + }, function (code, data) { + console.log(data) + }) + } + } + }) + } + }, + // 获取小区 + getHouseList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getHouse, [app.baseUrls.communityUrl]), { + areaCode: self.data.locationCode + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + console.log(data) + var arr = ['请选择小区'] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].residentialName) + } + self.setData({ + xqList: arr, + xqAll: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 选择小区 + bindXqPickerChange: function (e) { + var self = this + self.setData({ + xqIndex: e.detail.value, + xqSelected: self.data.xqAll[e.detail.value - 1].residentialId + }) + }, + // 提交入驻 + submitSettle: function () { + var self = this + if (!self.data.isLoading) { + if (self.data.areaIndex == '0') { + wx.showToast({ + title: '请选择区县', + icon: 'error' + }) + return + } + if (self.data.streetIndex == '0' && self.data.streetAll.length > 1) { + wx.showToast({ + title: '请选择街道', + icon: 'error' + }) + return + } + if (self.data.communityIndex == '0' && self.data.communityAll.length > 1) { + wx.showToast({ + title: '请选择社区', + icon: 'error' + }) + return + } + if (!self.data.unitName) { + wx.showToast({ + title: '请填写单位名称', + icon: 'error' + }) + return + } + if (!self.data.officeAddress && self.data.pageType == '612be328-bb06-48b7-877c-7d816012f273') { + wx.showToast({ + title: '请填写办公地址', + icon: 'error' + }) + return + } + if (!self.data.officeAddress && self.data.pageType == '3c97be91-b7e5-498f-b0dd-cd097521549f') { + wx.showToast({ + title: '请填写营业地址', + icon: 'error' + }) + return + } + if (!self.data.unitName && self.data.pageType == '612be328-bb06-48b7-877c-7d816012f273') { + wx.showToast({ + title: '请填写单位名称', + icon: 'error' + }) + return + } + if (!self.data.unitName && self.data.pageType == '3c97be91-b7e5-498f-b0dd-cd097521549f') { + wx.showToast({ + title: '请填写店铺名称', + icon: 'error' + }) + return + } + if (!self.data.shopType && self.data.pageType == '3c97be91-b7e5-498f-b0dd-cd097521549f') { + wx.showToast({ + title: '请填写店铺品类', + icon: 'error' + }) + return + } + if (!self.data.orgIntro) { + wx.showToast({ + title: '请填写机构简介', + icon: 'error' + }) + return + } + if (!self.data.phone) { + wx.showToast({ + title: '请填写联系电话', + icon: 'error' + }) + return + } + if (!self.data.chargePerson) { + wx.showToast({ + title: '请填写负责人姓名', + icon: 'error' + }) + return + } + var file = '' + for (let i = 0; i < self.data.imageList.length; i++) { + file += self.data.imageList[i] + if (i != self.data.imageList.length - 1) { + file += ',' + } + } + if (self.data.pageType == '3c97be91-b7e5-498f-b0dd-cd097521549f' && !self.data.shopType) { + wx.showToast({ + title: '请填写品类', + }) + } + var residentialInfo = '' + var residentialValue = '非ID' + if (self.data.pageType == '6c290901-39dd-4b69-a7aa-c27d253ab152' || self.data.pageType == '45ad4873-af80-4d03-973d-3b746a889948') { + if (self.data.xqIndex == '0') { + if (!self.data.residential) { + wx.showToast({ + title: '请选择或填写您的小区名称', + icon: 'error' + }) + return + } else { + residentialValue = self.data.residential + } + } else { + residentialInfo = self.data.xqSelected + residentialValue = 'ID' + } + } + var info = { + organizationTypeId: self.data.pageType, + organizationTypeName: self.data.pageName, + cityId: self.data.areaSelected, + cityCode: self.data.areaAll[self.data.areaIndex - 1].areaCode, + cityName: self.data.areaAll[self.data.areaIndex - 1].areaName, + streetId: self.data.streetSelected, + streetCode: self.data.streetAll[self.data.streetIndex - 1].areaCode, + streetName:self.data.streetAll[self.data.streetIndex - 1].areaName, + communityId: self.data.communitySelected, + communityCode: self.data.communityAll[self.data.communityIndex - 1].locationCode, + communityName: self.data.communityAll[self.data.communityIndex - 1].communityName, + address: self.data.officeAddress, + introduction: self.data.orgIntro, + fileIds: file, + residential: residentialInfo, + serviceMode: self.data.serviceMode, + unitName: self.data.unitName, + shopType: self.data.shopType, + shopTypeName: self.data.shopType, + phone: self.data.phone, + chargePerson: self.data.chargePerson, + residentialValue: residentialValue + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.submitSettle, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + + wx.showToast({ + title: '入驻成功', + icon: 'success' + }) + setTimeout(function () { + self.setData({ + isLoading: false + }) + wx.navigateBack({ + delta: 1 + }) + }, 1500) + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + // 删除图片 + deleteImg: function (e) { + var self = this + var idx = e.currentTarget.dataset.cur + var arr = this.data.imageList + arr.splice(idx, 1) + this.setData({ + imageList: arr + }) + }, + // 获取社区机构入驻种类 + getOrgList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getDictionary, [app.baseUrls.serviceUrl, '8e981a56-afa1-4934-9d90-16aa1b8113ca']), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = [] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].dataName) + } + self.setData({ + curType: arr, + typeAll: data, + typeSelected: data[0].dataId, + typeSelectedName: data[0].dataName, + pageType: data[0].dataId + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取单位/店铺入驻种类 + getStoreList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getDictionary, [app.baseUrls.serviceUrl, '4a44a891-8a0c-4cad-ada6-09ce99118e27']), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + var arr = [] + for (let i = 0; i < data.length; i++) { + arr.push(data[i].dataName) + } + self.setData({ + curType: arr, + typeAll: data, + typeSelected: data[0].dataId, + typeSelectedName: data[0].dataName, + pageType: data[0].dataId + }) + }, function (code, data) { + console.log(data) + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this + if (options.type == '1') { + this.getOrgList() + } else { + this.getStoreList() + } + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + this.getArea() + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/serve/settle.json b/pages/serve/settle.json new file mode 100644 index 0000000..aca7bb8 --- /dev/null +++ b/pages/serve/settle.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "服务机构入驻" +} \ No newline at end of file diff --git a/pages/serve/settle.wxml b/pages/serve/settle.wxml new file mode 100644 index 0000000..edbceec --- /dev/null +++ b/pages/serve/settle.wxml @@ -0,0 +1,142 @@ + + + 入驻类型 + + + + {{curType[typeIndex]}} + + + + + + 请选择区县 + + + + {{areaList[areaIndex]}} + + + + + + 选择街道 + + + + {{streetList[streetIndex]}} + + + + + + 选择社区 + + + + {{communityList[communityIndex]}} + + + + + + 选择行政村 + + + + {{communityList[communityIndex]}} + + + + + + 选择小区 + + + + {{xqList[xqIndex]}} + + + + + + + + + 单位名称 + + + + + + 店铺名称 + + + + + + 品类 + + + + + + + 物业服务方式 + + + + + + + 营业地址 + + + + + + 办公地址 + + + + + + 机构简介 + + + + + + 联系电话 + + + + + + 负责人 + + + + + + + 上传资料 + + + + + + + + + + + 入驻 + \ No newline at end of file diff --git a/pages/serve/settle.wxss b/pages/serve/settle.wxss new file mode 100644 index 0000000..87d7859 --- /dev/null +++ b/pages/serve/settle.wxss @@ -0,0 +1,120 @@ +.base-info{ + padding: 0 20rpx; + background-color: #fff; +} +.row{ + display: flex; + justify-content: space-between; + border-bottom: 1px solid #DDD; + flex-wrap: wrap; +} +.row:last-child{ + border-bottom: none; +} +.row-name{ + width: 30%; + font-size: 32rpx; + line-height: 80rpx; + flex-shrink: 0; +} +.row-content{ + width: 70%; + text-align: right; + flex-shrink: 0; +} +.residential{ + width: 100%; +} +.residential input{ + height: 80rpx !important; +} +.intro{ + flex-direction: column; +} +.intro .row-content{ + width: 100%; + text-align: left; +} +picker{ + font-size: 32rpx; + line-height: 80rpx; +} +.row-content input{ + width: 100%; + height: 100%; + padding: 0 10rpx; + box-sizing: border-box; + font-size: 32rpx; +} +.row-content textarea{ + width: 100%; + height: 200rpx; + font-size: 32rpx; +} +.upload-file{ + margin-top: 20rpx; + margin-bottom: 100rpx; + padding: 0 20rpx 20rpx; + background-color: #fff; +} +.upload-title{ + font-size: 32rpx; + font-weight: bold; + line-height: 80rpx; +} +.add{ + display: inline-block; + width: 32%; + height: 150rpx; + text-align: center; + line-height: 150rpx; + font-size: 60rpx; + background-color: #ccc; + color: #eee; + margin-right: 2%; + margin-bottom: 20rpx; + vertical-align: top; +} +.add.image{ + background-color: #fff; + position: relative; +} +.add:nth-child(3n){ + margin-right: 0; +} +.add image{ + height: 100%; +} +.submit{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 20rpx; + background-color: #fff; +} +.submit-btn{ + margin-top: 0; + line-height: 60rpx; + height: 60rpx; + text-align: center; + border-radius: 40rpx; + background-color: #FF4949; +} +.delete{ + width: 30rpx; + height: 30rpx !important; + position: absolute; + top: -15rpx; + right: -15rpx; +} + + + + + + + + + + diff --git a/pages/talk/myTalk.js b/pages/talk/myTalk.js new file mode 100644 index 0000000..fdde17d --- /dev/null +++ b/pages/talk/myTalk.js @@ -0,0 +1,71 @@ +// pages/talk/myTalk.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + sourceUrl: app.baseUrls.sourceUrl, + }, + checkDetail: function () { + wx.navigateTo({ + url: './talkDetail', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/talk/myTalk.json b/pages/talk/myTalk.json new file mode 100644 index 0000000..e583ea3 --- /dev/null +++ b/pages/talk/myTalk.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的微事我言" +} \ No newline at end of file diff --git a/pages/talk/myTalk.wxml b/pages/talk/myTalk.wxml new file mode 100644 index 0000000..f1c5728 --- /dev/null +++ b/pages/talk/myTalk.wxml @@ -0,0 +1,95 @@ + + 我的发布 + 我的回复 + 我的赞 + + + + + + + + 100 + + + + 请问阿斯顿发射点饭卡手动阀垃圾筐第三方接口问阿斯顿发射点饭卡手动阀垃圾筐第三 + + + + + + + + + + + + + + + 100 + + + + 请问阿斯顿发射点饭卡手动阀垃圾筐第三方接口问阿斯顿发射点饭卡手动阀垃圾筐第三 + + + + + + + + + 100 + + + + 请问阿斯顿发射点饭卡手动阀垃圾筐第三方接口问阿斯顿发射点饭卡手动阀垃圾筐第三 + + + + + + + + + + + + + + + 100 + + + + 请问阿斯顿发射点饭卡手动阀垃圾筐第三方接口问阿斯顿发射点饭卡手动阀垃圾筐第三 + + + + \ No newline at end of file diff --git a/pages/talk/myTalk.wxss b/pages/talk/myTalk.wxss new file mode 100644 index 0000000..977fb1f --- /dev/null +++ b/pages/talk/myTalk.wxss @@ -0,0 +1,98 @@ +.tab{ + display: flex; + position: fixed; + top: 0; + left: 0; + right: 0; + background-color: #fff; + z-index: 100; + border-bottom: 1px solid #DDD; +} +.tab-box{ + flex: 1; + display: flex; + justify-content: center; + align-items: center; + font-size: 32rpx; + height: 100rpx; +} +.tab-box.active{ + color: #f55054; + border-bottom: 1px solid #f55054; +} +.talk-container{ + margin-top: 100rpx; +} +.talk{ + border-bottom: 1px solid #DDD; + padding: 20rpx; + background-color: #fff; +} +.talk:last-child{ + border-bottom: none; +} +.talk-user, .user-info{ + display: flex; + justify-content: space-between; + margin-bottom: 10rpx; +} +.user-info image{ + width: 80rpx; + height: 80rpx; + margin-right: 20rpx; +} +.good image{ + width: 40rpx; + height: 40rpx; + margin-top: -8rpx; + vertical-align: middle; +} +.name{ + font-size: 32rpx; + line-height: 50rpx; +} +.time{ + font-size: 24rpx; + color: #888; +} +.good text{ + line-height: 80rpx; +} +.talk-content{ + font-size: 30rpx; + line-height: 40rpx; +} +.reply{ + padding: 20rpx; + background-color: #eee; + margin-top: 10rpx; +} +.reply-content{ + padding-left: 100rpx; +} +.photo-box{ + width: 32%; + height: 150rpx; + overflow: hidden; + display: inline-block; + margin-right: 2%; + text-align: center; +} +.photo-box:nth-child(3n){ + margin-right: 0; +} +.photo-box image{ + height: 100%; +} + + + + + + + + + + + + diff --git a/pages/talk/newTalk.js b/pages/talk/newTalk.js new file mode 100644 index 0000000..a8cddd5 --- /dev/null +++ b/pages/talk/newTalk.js @@ -0,0 +1,228 @@ +// pages/talk/newTalk.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + content: '', + imageList: [], + videoId: '', + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + userIcon: '', + userName: '', + isLoading: false + }, + submitNewTalk: function () { + var self = this + if (!self.data.isLoading) { + var photo = '' + if (self.data.imageList.length > 0) { + for (let i = 0; i < self.data.imageList.length; i++) { + if (i != self.data.imageList.length - 1) { + photo += self.data.imageList[i] + ',' + } else { + photo += self.data.imageList[i] + } + } + } + var info = { + content: self.data.content, + video: self.data.videoId, + videoCover: '', + photo: photo, + headPortrait: self.data.userIcon, + nickName: self.data.userName, + // areaId: wx.getStorageSync('areaId'), + areaCode: wx.getStorageSync('areaCode') + } + self.setData({ + isLoading: true + }) + app.restAjax.post(app.restAjax.path(app.apis.submitTalk, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '发布成功!', + icon: 'success' + }) + setTimeout(function () { + self.setData({ + isLoading: false + }) + wx.navigateBack({ + delta: 1 + }) + }, 1500) + } else { + + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }, + // 上传图片 + uploadImage: function () { + var self = this + if (!self.data.isLoading) { + self.setData({ + isLoading: true + }) + wx.chooseImage({ + count: 9 - self.data.imageList.length, + sourceType: ['album', 'camera'], + success: function (res) { + wx.showToast({ + title: '上传中', + icon: 'loading' + }) + for (let i = 0; i < res.tempFiles.length; i++) { + var path = res.tempFiles[i].path; + app.restAjax.file(app.restAjax.path(app.apis.uploadImg, [app.baseUrls.serviceUrl]), path, 'image', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + self.setData({ + isLoading: false + }) + var id = JSON.parse(data).data + var arr = self.data.imageList + arr.push(id) + self.setData({ + imageList: arr + }) + wx.hideToast() + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + } + }) + } + }, + // 上传视频 + uploadVideo: function () { + var self = this + if (!self.data.isLoading) { + self.setData({ + isLoading: true + }) + wx.chooseVideo({ + sourceType: ['album','camera'], + success: function (res) { + app.restAjax.file(app.restAjax.path(app.apis.uploadVideo, [app.baseUrls.serviceUrl]), res.tempFilePath, 'video', { + headers: { + token: app.globalData.token + } + }, function (code, data) { + if (code == '200') { + self.setData({ + isLoading: false + }) + var id = JSON.parse(data).data + self.setData({ + videoId: id + }) + } + }, function (code, data) { + console.log(data) + self.setData({ + isLoading: false + }) + }) + } + }) + } + }, + // 删除图片 + deleteImg: function (e) { + var self = this + var idx = e.currentTarget.dataset.cur + var arr = this.data.imageList + arr.splice(idx, 1) + this.setData({ + imageList: arr + }) + }, + // 删除视频 + deleteVideo: function () { + this.setData({ + videoId: '' + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.setData({ + userIcon: wx.getStorageSync('userIcon'), + userName: wx.getStorageSync('name') + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/talk/newTalk.json b/pages/talk/newTalk.json new file mode 100644 index 0000000..1b7b4d5 --- /dev/null +++ b/pages/talk/newTalk.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "发表微事" +} \ No newline at end of file diff --git a/pages/talk/newTalk.wxml b/pages/talk/newTalk.wxml new file mode 100644 index 0000000..b4d5b5f --- /dev/null +++ b/pages/talk/newTalk.wxml @@ -0,0 +1,26 @@ + + + + + + 上传图片({{imageList.length}}/9) + + + + + + + + + + + 上传视频 + + + + + + + + + + +发表 \ No newline at end of file diff --git a/pages/talk/newTalk.wxss b/pages/talk/newTalk.wxss new file mode 100644 index 0000000..29d491f --- /dev/null +++ b/pages/talk/newTalk.wxss @@ -0,0 +1,76 @@ +.content{ + height: 400rpx; + border-bottom: 1px solid #DDD; +} +.content textarea{ + width: 100%; + height: 100%; + background-color: #fff; + padding: 20rpx; + box-sizing: border-box; + font-size: 32rpx; +} +.upload{ + padding: 20rpx; +} +.upload-box{ + margin-bottom: 20rpx; +} +.upload-title{ + font-size: 30rpx; + margin-bottom: 10rpx; +} +.upload-img, .add{ + display: inline-block; + width: 32%; + height: 150rpx; + margin-right: 2%; + vertical-align: top; + text-align: center; + margin-bottom: 20rpx; + position: relative; +} +.upload-video{ + width: 100%; + height: auto; +} +.upload-video video{ + width: 100%; +} +.upload-img:nth-child(3n), .add{ + margin-right: 0; +} +.upload-img image{ + height: 100%; +} +.add{ + font-size: 60rpx; + line-height: 150rpx; + background-color: #ccc; + color: #eee; +} +.delete{ + width: 30rpx; + height: 30rpx !important; + position: absolute; + top: -15rpx; + right: -15rpx; +} +.submit-new{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + line-height: 100rpx; + text-align: center; + font-size: 32rpx; + color: #fff; + background-color: #f55054; +} + + + + + + + diff --git a/pages/talk/talk.js b/pages/talk/talk.js new file mode 100644 index 0000000..a39023a --- /dev/null +++ b/pages/talk/talk.js @@ -0,0 +1,135 @@ +// pages/talk/talk.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: app.globalData.token, + sourceUrl: app.baseUrls.sourceUrl, + page: { + page: 1, + rows: 5 + }, + talkList: [], + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + }, + getTalkList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getTalkList, [app.baseUrls.requestUrl]), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (data.rows.length > 0) { + for (let i = 0; i < data.rows.length; i++) { + if (data.rows[i].photo) { + data.rows[i].photo = data.rows[i].photo.split(',') + } + } + if (self.data.page.page == 1) { + self.setData({ + talkList: data.rows + }) + } else { + var arr = self.data.talkList + for (let i = 0; i < data.rows.length; i++) { + arr.push(data.rows[i]) + } + self.setData({ + talkList: arr + }) + } + + } else { + wx.showToast({ + title: '暂无更多', + icon: 'none' + }) + } + + }, function (code, data) { + console.log(data) + }) + }, + newTalk: function () { + wx.navigateTo({ + url: './newTalk', + }) + }, + checkMyTalk: function () { + wx.navigateTo({ + url: './myTalk', + }) + }, + checkDetail: function (e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: './talkDetail?trifleMyselfId=' + id, + }) + }, + clickVideo: function () { + return + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getTalkList() + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + var page = this.data.page.page + 1 + this.setData({ + ['page.page']: page + }) + this.getTalkList() + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/talk/talk.json b/pages/talk/talk.json new file mode 100644 index 0000000..bcb4dec --- /dev/null +++ b/pages/talk/talk.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "微事我言" +} \ No newline at end of file diff --git a/pages/talk/talk.wxml b/pages/talk/talk.wxml new file mode 100644 index 0000000..302e476 --- /dev/null +++ b/pages/talk/talk.wxml @@ -0,0 +1,53 @@ + + + + + + + + {{item.content}} + + + + + + + + + + + + + + + + + + ++ \ No newline at end of file diff --git a/pages/talk/talk.wxss b/pages/talk/talk.wxss new file mode 100644 index 0000000..9cf0e3a --- /dev/null +++ b/pages/talk/talk.wxss @@ -0,0 +1,101 @@ +.talk-container{ + margin-bottom: 100rpx; +} +.talk{ + padding: 20rpx; + background-color: #fff; + margin-bottom: 10rpx; +} +.talk-user, .user-info{ + display: flex; + justify-content: space-between; + margin-bottom: 10rpx; +} +.user-info image{ + width: 80rpx; + height: 80rpx; + margin-right: 20rpx; + border-radius: 50%; +} +.good image{ + width: 40rpx; + height: 40rpx; + margin-top: -8rpx; + vertical-align: middle; +} +.name{ + font-size: 32rpx; + line-height: 50rpx; +} +.time{ + font-size: 24rpx; + color: #888; +} +.good text{ + line-height: 80rpx; +} +.talk-content{ + font-size: 30rpx; + line-height: 40rpx; + margin-bottom: 20rpx; +} +.reply{ + padding: 20rpx; + background-color: #eee; + margin-top: 10rpx; +} +.reply-content{ + padding-left: 100rpx; +} +.photo-box{ + width: 32%; + height: 150rpx; + overflow: hidden; + display: inline-block; + margin-right: 2%; + text-align: center; +} +.photo-box:nth-child(3n){ + margin-right: 0; +} +.photo-box image{ + height: 100%; +} +.my-talk{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + background-color: #fff; + text-align: center; + font-size: 32rpx; + line-height: 100rpx; + color: #f55054; +} +.new-talk{ + position: fixed; + bottom: 120rpx; + right: 20rpx; + width: 120rpx; + height:120rpx; + text-align: center; + line-height: 120rpx; + color: #fff; + border-radius: 50%; + font-size: 60rpx; + background-color: #f55054; +} +.video-box{ + width: 100%; + height: auto !important; +} +.video-box video{ + width: 100%; +} +.no-data{ + margin-top: 150rpx; + text-align: center; +} +.no-data image{ + width: 300rpx; +} diff --git a/pages/talk/talkDetail.js b/pages/talk/talkDetail.js new file mode 100644 index 0000000..87d7169 --- /dev/null +++ b/pages/talk/talkDetail.js @@ -0,0 +1,331 @@ +// pages/talk/talkDetail.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + sourceUrl: app.baseUrls.sourceUrl, + trifleMyselfId: '', + token: app.globalData.token, + talkDetail: {}, + serviceUrl: app.baseUrls.serviceUrl, + baseImgUrl: app.baseUrls.baseImgUrl, + reply: '', + userIcon: '', + userName: '', + replyList: [], + goodCount: 0, + isClickGood: 'no', + clickGoodPeople: [], + isGetFocus: false, + placeholder: '讨论一下', + replyTo: '', + replyUserName: '' + }, + // 获取详情 + getTalkDetail: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getTalkDetail, [app.baseUrls.requestUrl, self.data.trifleMyselfId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (data.photo) { + data.photo = data.photo.split(',') + } + self.setData({ + talkDetail: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 发布评论 + doReplyTalk: function () { + var self = this + var info = { + content: self.data.reply, + headPortrait: self.data.userIcon, + userName: self.data.userName, + trifleMyselfId: self.data.trifleMyselfId + } + app.restAjax.post(app.restAjax.path(app.apis.replyTalk, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '评论成功!', + icon: 'success' + }) + self.setData({ + reply: '', + }) + self.getReplyList() + } + }, function (code, data) { + console.log(data) + }) + }, + // 获取评论 + getReplyList: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getTalkReplyList, [app.baseUrls.requestUrl]), { + trifleMyselfId: self.data.trifleMyselfId + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + replyList: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 获取点赞数 + getGoodCount: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.getTalkGoodCount, [app.baseUrls.requestUrl]), { + trifleMyselfId: self.data.trifleMyselfId + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + goodCount: data.data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 判断我有没有点赞 + getIsClickGood: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.talkIsClicked, [app.baseUrls.requestUrl, self.data.trifleMyselfId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + isClickGood: data + }) + }, function (code, data) { + console.log(data) + }) + }, + // 点赞/取消赞 + toggleGood: function () { + if (this.data.isClickGood == 'no') { + this.clickGood() + } else { + this.cancelGood() + } + }, + // 获取点赞人列表 + getClickedPeople: function () { + var self = this + app.restAjax.get(app.restAjax.path(app.apis.talkClickPeople, [app.baseUrls.requestUrl]), { + page: 1, + rows: 10, + trifleMyselfId: self.data.trifleMyselfId + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + console.log(data) + self.setData({ + clickGoodPeople: data.rows + }) + }, function (code, data) { + console.log(data) + }) + }, + // 点赞 + clickGood: function () { + var self = this + var info = { + trifleMyselfId: self.data.trifleMyselfId, + userName: self.data.userName, + headPortrait: self.data.userIcon + } + app.restAjax.post(app.restAjax.path(app.apis.talkClickGood, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + self.getGoodCount() + self.getClickedPeople() + self.getIsClickGood() + } + // self.setData({ + // isClickGood: data.data + // }) + }, function (code, data) { + console.log(data) + }) + }, + // 取消咱 + cancelGood: function () { + var self = this + app.restAjax.delete(app.restAjax.path(app.apis.talkCancelGood, [app.baseUrls.requestUrl, self.data.trifleMyselfId]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + self.getGoodCount() + self.getClickedPeople() + self.getIsClickGood() + } + }, function (code, data) { + console.log(data) + }) + }, + // 输入评论 + getFocus: function (e) { + var user = e.currentTarget.dataset.user + var replyTo = e.currentTarget.dataset.id + var name = e.currentTarget.dataset.name + this.setData({ + isGetFocus: true, + placeholder: '回复' + user + ':', + replyTo: replyTo, + replyUserName: name + }) + }, + // 输入框失去焦点判断文字 + inputBlur: function () { + if (!this.data.reply) { + this.setData({ + placeholder: '讨论一下', + isGetFocus: false + }) + } + }, + // 确认回复 + doReply: function () { + if (!this.data.replyTo) { + this.doReplyTalk() + } else { + this.doReplyReply() + } + }, + // 回复 + doReplyReply: function () { + var self = this + var info = { + content: self.data.reply, + headPortrait: self.data.userIcon, + userName: self.data.userName, + trifleMyselfId: self.data.trifleMyselfId, + commentId: self.data.replyTo, + replyCommentId: self.data.replyTo, + replyUserName: self.data.replyUserName + } + app.restAjax.post(app.restAjax.path(app.apis.replyTalk, [app.baseUrls.requestUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + if (code == '200') { + wx.showToast({ + title: '评论成功!', + icon: 'success' + }) + self.getReplyList() + self.setData({ + reply: '', + replyTo: '', + replyUserName: '', + placeholder: '讨论一下' + }) + } + }, function (code, data) { + console.log(data) + }) + }, + viewImg: function (e) { + var id = this.data.serviceUrl + this.data.baseImgUrl + e.currentTarget.dataset.id + var arr = [] + for (let i = 0; i < this.data.talkDetail.photo.length; i++) { + var video = this.data.serviceUrl + this.data.baseImgUrl + this.data.talkDetail.photo[i] + arr.push(video) + } + wx.previewImage({ + current: id, + urls: arr, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + trifleMyselfId: options.trifleMyselfId, + userIcon: wx.getStorageSync('userIcon'), + userName: wx.getStorageSync('name') + }) + this.getTalkDetail() + this.getReplyList() + this.getGoodCount() + this.getIsClickGood() + this.getClickedPeople() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/talk/talkDetail.json b/pages/talk/talkDetail.json new file mode 100644 index 0000000..bcb4dec --- /dev/null +++ b/pages/talk/talkDetail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "微事我言" +} \ No newline at end of file diff --git a/pages/talk/talkDetail.wxml b/pages/talk/talkDetail.wxml new file mode 100644 index 0000000..5a05bb2 --- /dev/null +++ b/pages/talk/talkDetail.wxml @@ -0,0 +1,66 @@ + + + + + + + {{talkDetail.content}} + + + + + + + + + + + + + + + + + {{goodCount}}人点赞 + + + + + + + + + + + + + {{item.content}} + + + + {{child.userName}} 回复 {{child.replyUserName}} : {{child.content}} + + + + + + + \ No newline at end of file diff --git a/pages/talk/talkDetail.wxss b/pages/talk/talkDetail.wxss new file mode 100644 index 0000000..aa32746 --- /dev/null +++ b/pages/talk/talkDetail.wxss @@ -0,0 +1,137 @@ +.talk{ + border-bottom: 1px solid #DDD; + padding: 20rpx; + background-color: #fff; +} +.talk:last-child{ + border-bottom: none; +} +.talk-user, .user-info{ + display: flex; + justify-content: space-between; + margin-bottom: 10rpx; +} +.user-info image{ + width: 80rpx; + height: 80rpx; + margin-right: 20rpx; +} +.good image{ + width: 40rpx; + height: 40rpx; + margin-top: -8rpx; + vertical-align: middle; +} +.name{ + font-size: 32rpx; + line-height: 50rpx; +} +.time{ + font-size: 24rpx; + color: #888; +} +.good text{ + line-height: 80rpx; +} +.talk-content{ + font-size: 30rpx; + line-height: 40rpx; +} +.reply-container{ + margin-bottom: 100rpx; +} +.reply{ + padding: 20rpx; + background-color: #fff; + border-bottom: 1px solid #DDD; +} +.reply:last-child{ + border-bottom: none; +} +.reply-content, .reply-reply{ + padding-left: 100rpx; +} +.reply-content{ + margin-bottom: 20rpx; +} +.photo-box{ + width: 32%; + height: 150rpx; + overflow: hidden; + display: inline-block; + margin-right: 2%; + text-align: center; +} +.photo-box:nth-child(3n){ + margin-right: 0; +} +.photo-box image{ + height: 100%; +} +.click-good{ + padding: 20rpx; + margin: 20rpx 0; + background-color: #fff; + display: flex; + justify-content: space-between; +} +.good-text{ + text-align: center; + width: 20%; +} +.good-text image{ + width: 40rpx; + height: 40rpx; +} +.good-count{ + font-size: 24rpx; +} +.good-avatar{ + width: 80%; +} +.good-avatar image{ + width: 50rpx; + height: 50rpx; + margin: 12rpx 0 0 -15rpx; + border: 1px solid #FFF; + border-radius: 50%; +} +.good-avatar image:first-child{ + margin-left: 0; +} +.reply .click-good{ + background: none; +} +.edit-reply{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 20rpx; + background-color: #fff; + border-top: 1px solid #DDD; +} +.edit-reply input{ + height: 60rpx; + border-radius: 40rpx; + background-color: #EEE; + padding: 0 20rpx; +} +.video-box{ + width: 100%; + height: auto !important; +} +.video-box video{ + width: 100%; +} +.reply-row{ + line-height: 60rpx; + background-color: #F7F7F7; + padding: 0 10rpx; + word-break: break-all; +} +.reply-row text{ + font-weight: bold; +} + + diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..3d71b96 --- /dev/null +++ b/project.config.json @@ -0,0 +1,52 @@ +{ + "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "setting": { + "urlCheck": true, + "es6": false, + "enhance": true, + "postcss": true, + "preloadBackgroundData": false, + "minified": true, + "newFeature": false, + "coverView": true, + "nodeModules": false, + "autoAudits": false, + "showShadowRootInWxmlPanel": true, + "scopeDataCheck": false, + "uglifyFileName": false, + "checkInvalidKey": true, + "checkSiteMap": true, + "uploadWithSourceMap": true, + "compileHotReLoad": false, + "lazyloadPlaceholderEnable": false, + "useMultiFrameRuntime": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "useIsolateContext": true, + "userConfirmedBundleSwitch": false, + "packNpmManually": false, + "packNpmRelationList": [], + "minifyWXSS": true, + "disableUseStrict": false, + "minifyWXML": true, + "showES6CompileOption": false, + "useCompilerPlugins": false, + "ignoreUploadUnusedFiles": true, + "useStaticServer": true + }, + "compileType": "miniprogram", + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + }, + "libVersion": "2.24.3", + "packOptions": { + "ignore": [], + "include": [] + }, + "appid": "wxa49a60262e53d305" +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..0f228b6 --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,6 @@ +{ + "setting": { + "urlCheck": false + }, + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html" +} \ No newline at end of file diff --git a/sitemap.json b/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/utils/WSCoordinate.js b/utils/WSCoordinate.js new file mode 100644 index 0000000..1332765 --- /dev/null +++ b/utils/WSCoordinate.js @@ -0,0 +1,147 @@ +/** + * 判断经纬度是否超出中国境内 + */ +function isLocationOutOfChina(latitude, longitude) { + if (longitude < 72.004 || longitude > 137.8347 || latitude < 0.8293 || latitude > 55.8271) + return true; + return false; +} + + +/** + * 将WGS-84(国际标准)转为GCJ-02(火星坐标): + */ +function transformFromWGSToGCJ(latitude, longitude) { + var lat = ""; + var lon = ""; + var ee = 0.00669342162296594323; + var a = 6378245.0; + var pi = 3.14159265358979324; + + if (isLocationOutOfChina(latitude, longitude)) { + lat = latitude; + lon = longitude; + } + else { + var adjustLat = transformLatWithXY(longitude - 105.0, latitude - 35.0); + var adjustLon = transformLonWithXY(longitude - 105.0, latitude - 35.0); + var radLat = latitude / 180.0 * pi; + var magic = Math.sin(radLat); + magic = 1 - ee * magic * magic; + var sqrtMagic = Math.sqrt(magic); + adjustLat = (adjustLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); + adjustLon = (adjustLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi); + latitude = latitude + adjustLat; + longitude = longitude + adjustLon; + } + return { latitude: latitude, longitude: longitude }; + +} + +/** + * 将GCJ-02(火星坐标)转为百度坐标: + */ +function transformFromGCJToBaidu(latitude, longitude) { + var pi = 3.14159265358979324 * 3000.0 / 180.0; + + var z = Math.sqrt(longitude * longitude + latitude * latitude) + 0.00002 * Math.sin(latitude * pi); + var theta = Math.atan2(latitude, longitude) + 0.000003 * Math.cos(longitude * pi); + var a_latitude = (z * Math.sin(theta) + 0.006); + var a_longitude = (z * Math.cos(theta) + 0.0065); + + return { latitude: a_latitude, longitude: a_longitude }; +} + +/** + * 将百度坐标转为GCJ-02(火星坐标): + */ +function transformFromBaiduToGCJ(latitude, longitude) { + var xPi = 3.14159265358979323846264338327950288 * 3000.0 / 180.0; + + var x = longitude - 0.0065; + var y = latitude - 0.006; + var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * xPi); + var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * xPi); + var a_latitude = z * Math.sin(theta); + var a_longitude = z * Math.cos(theta); + + return { latitude: a_latitude, longitude: a_longitude }; +} + +/** + * 将GCJ-02(火星坐标)转为WGS-84: + */ +function transformFromGCJToWGS(latitude, longitude) { + var threshold = 0.00001; + + // The boundary + var minLat = latitude - 0.5; + var maxLat = latitude + 0.5; + var minLng = longitude - 0.5; + var maxLng = longitude + 0.5; + + var delta = 1; + var maxIteration = 30; + + while (true) { + var leftBottom = transformFromWGSToGCJ(minLat, minLng); + var rightBottom = transformFromWGSToGCJ(minLat, maxLng); + var leftUp = transformFromWGSToGCJ(maxLat, minLng); + var midPoint = transformFromWGSToGCJ((minLat + maxLat) / 2, (minLng + maxLng) / 2); + delta = Math.abs(midPoint.latitude - latitude) + Math.abs(midPoint.longitude - longitude); + + if (maxIteration-- <= 0 || delta <= threshold) { + return { latitude: (minLat + maxLat) / 2, longitude: (minLng + maxLng) / 2 }; + } + + if (isContains({ latitude: latitude, longitude: longitude }, leftBottom, midPoint)) { + maxLat = (minLat + maxLat) / 2; + maxLng = (minLng + maxLng) / 2; + } + else if (isContains({ latitude: latitude, longitude: longitude }, rightBottom, midPoint)) { + maxLat = (minLat + maxLat) / 2; + minLng = (minLng + maxLng) / 2; + } + else if (isContains({ latitude: latitude, longitude: longitude }, leftUp, midPoint)) { + minLat = (minLat + maxLat) / 2; + maxLng = (minLng + maxLng) / 2; + } + else { + minLat = (minLat + maxLat) / 2; + minLng = (minLng + maxLng) / 2; + } + } + +} + +function isContains(point, p1, p2) { + return (point.latitude >= Math.min(p1.latitude, p2.latitude) && point.latitude <= Math.max(p1.latitude, p2.latitude)) && (point.longitude >= Math.min(p1.longitude, p2.longitude) && point.longitude <= Math.max(p1.longitude, p2.longitude)); +} + +function transformLatWithXY(x, y) { + var pi = 3.14159265358979324; + var lat = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x)); + lat += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; + lat += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0; + lat += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0; + return lat; +} + +function transformLonWithXY(x, y) { + var pi = 3.14159265358979324; + var lon = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x)); + lon += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; + lon += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0; + lon += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 * pi)) * 2.0 / 3.0; + return lon; +} + + + +module.exports = { + isLocationOutOfChina: isLocationOutOfChina, + transformFromWGSToGCJ: transformFromWGSToGCJ, + transformFromGCJToBaidu: transformFromGCJToBaidu, + transformFromBaiduToGCJ: transformFromBaiduToGCJ, + transformFromGCJToWGS: transformFromGCJToWGS +} \ No newline at end of file diff --git a/utils/api.js b/utils/api.js new file mode 100644 index 0000000..e844701 --- /dev/null +++ b/utils/api.js @@ -0,0 +1,86 @@ +var baseUrls = { + baseImgUrl: 'route/file/download/true/', + requestUrl: 'http://192.168.0.111:8084/systemmunicipalmini/', + communityUrl: 'http://192.168.0.111:8083/systemhouse/', + serviceUrl: 'http://192.168.0.155:7011/usercenter/', + caseUrl: 'http://192.168.0.120:8081/case/', + sourceUrl: 'http://192.168.0.111:8084/systemmunicipalmini/assets/weCharMiniFile/images/' +} + +var apis = { + doLogin: '{baseUrl}wxminiapp/auth/login', // 登录 + getCommunityList: '{baseUrl}app/community/list', // 获取社区列表 + getCommunityListPage: '{baseUrl}app/community/listpagecommunity', // 获取社区列表-分页 + joinCommunity: '{baseUrl}app/joinCommunity/save', // 加入社区 + getArea: '{baseUrl}app/area/listbyparentid/{areaId}', // 获取区域 + getHouse: '{baseUrl}app/residential/list', // 获取小区 + mycommunity: '{baseUrl}app/joinCommunity/list', // 我的社区 + quitCommunity: '{baseUrl}app/joinCommunity/remove/{ids}', // 退出社区 + getDictionary: '{baseUrl}app/data/listbyparentid/{dataParentId}', // 获取字典 + getResidential: '{baseUrl}app/residential/get/{residentialId}', // 获取小区信息 + submitCheckIn: '{baseUrl}app/partymemberreport/save', // 提交报到 + getOrg: '{baseUrl}app/organization/save', // 获取服务机构入驻类型 + uploadImg: '{baseUrl}app/file/uploadimage', // 上传图片 + uploadVideo: '{baseUrl}app/file/uploadvideo', // 上传视频 + uploadAudio: '{baseUrl}app/file/uploadaudio', // 上传录音 + submitSettle: '{baseUrl}app/organization/save', // 提交入驻 + getOrgList: '{baseUrl}app/organization/listpageorganization', // 获取服务机构列表 + submitHelp: '{baseUrl}app/neighbor/save', // 发布邻里互助 + getHelpList: '{baseUrl}app/neighbor/listpageneighbor', // 获取邻里互助列表 + getHelpDetail: '{baseUrl}app/neighbor/get/{neighborId}', // 获取邻里互助详情 + doReplyHelp: '{baseUrl}app/neighborcomment/save', // 回复邻里互助详情 + getReplyList: '{baseUrl}app/neighborcomment/list', // 获取回复列表 + submitTalk: '{baseUrl}app/triflemyself/save', // 发布微事我言 + getTalkList: '{baseUrl}app/triflemyself/listpagetriflemyself', // 获取微事我言列表 + getTalkDetail: '{baseUrl}app/triflemyself/get/{trifleMyselfId}', // 获取微事我言详情 + replyTalk: '{baseUrl}app/comment/save', // 评论微事我言 + getTalkReplyList: '{baseUrl}app/comment/list', // 获取微事我言评论 + submitNeighborCircle: '{baseUrl}app/neighborcircle/save', // 发布邻里圈 + getCircleList: '{baseUrl}app/neighborcircle/listpageneighborcircle', // 获取邻里圈列表 + getCircleDetail: '{baseUrl}app/neighborcircle/get/{neighborCircleId}', // 获取邻里圈详情 + submitCircleReply: '{baseUrl}app/neighborcirclecomment/save', // 评论邻里圈 + getCircleReplyList: '{baseUrl}app/neighborcirclecomment/list', // 获取邻里圈评论列表 + circleClickGood: '{baseUrl}app/neighborcirclefabulous/save', // 邻里圈点赞 + getCircleGoodCount: '{baseUrl}app/neighborcirclefabulous/count', // 获取邻里圈点赞数 + circleIsClicked: '{baseUrl}app/neighborcirclefabulous/has-fabulous/{neighborCircleId}', // 邻里圈是否点赞 + cancelGood: '{baseUrl}app/neighborcirclefabulous/cancel/{ids}', // 邻里圈取消点赞 + getTalkGoodCount: '{baseUrl}app/fabulous/count', // 获取微事我言点赞数 + talkIsClicked: '{baseUrl}app/fabulous/has-fabulous/{neighborCircleId}', // 微事我言是否点赞 + talkClickPeople: '{baseUrl}app/fabulous/listpagefabulous', // 微事我言点赞人 + talkClickGood: '{baseUrl}app/fabulous/save', // 微事我言点赞 + talkCancelGood: '{baseUrl}app/fabulous/cancel/{ids}', // 微事我言取消赞 + getNewsType: '{baseUrl}app/newstype/list', // 获取新闻类型 + getNewsList: '{baseUrl}app/news/listpagenews', // 获取新闻列表 + getNewsDetail: '{baseUrl}app/news/get/{newsId}', // 获取新闻详情 + submitNewsReply: '{baseUrl}app/newscomment/save', // 发布新闻评论 + getNewsReplyList: '{baseUrl}app/newscomment/list', // 获取新闻评论列表 + isCollectNews: '{baseUrl}app/newscollection/has-collection/{newsId}', // 判断是否收藏了新闻 + doCollectNews: '{baseUrl}app/newscollection/save', // 收藏新闻 + cancelCollectNews: '{baseUrl}app/newscollection/cancel/{ids}', // 取消收藏 + getArea: '{baseUrl}app/area/listbyparentid/{parentid}', // 地区 + getChildArea: '{baseUrl}app/area/listallbyparentid/{areaParentId}', // 获取下级区域 + caseType: '{baseUrl}app/casetype/list-ztree', // 事件类型 + caseTypeChild: '{baseUrl}app/casetype/listall-byparentid', // 事件类型二级 + submitReport: '{baseUrl}app/report/save-miniapp', // 提交上报 + getHelpCount: '{baseUrl}app/neighbor/count', // 获取邻里统计 + getCardDetail: '{baseUrl}app/card/get/{cardId}', // 获取名片详情 + submitCreateCard: '{baseUrl}app/card/save', // 创建名片 + isCheckedIn: '{baseUrl}app/partymemberreport/has-report/{community}', // 判断是否报到 + checkGrid: '{baseUrl}app/gridmini/authentication', // 网格员认证 + getGridListPage: '{baseUrl}app/gridmini/listpagegridmini', // 获取网格员列表-分页 + getGridList: '{baseUrl}app/gridmini/list', // 获取网格员列表 + myCaseList: '{baseUrl}app/report/listpage-me', // 我的上报列表 + getLog: '{baseUrl}app/reportlog/list-activity/{businessId}', // 获取日志 + myCaseDetail: '{baseUrl}app/report/get/{reportId}', // 我的上报详情 + updateCaseStatus: '{baseUrl}app/report/updatereport/{reportId}', // 修改事件 + handleCase: '{baseUrl}app/reporthandle/save', // 处理事件 + getHandleList: '{baseUrl}app/reporthandle/list', // 处理列表 + getDefaultCard: '{baseUrl}app/card/get-default', // 获取默认名片 + getGirdDetail: '{baseUrl}app/gridmini/get/{gridMiniId}', // 获取网格员详情 + caseRedundancies: '{baseUrl}app/report/reassignment/{reportId}', // 事件转派 + } + +module.exports = { + apis, + baseUrls +} \ No newline at end of file diff --git a/utils/bmap-wx.min.js b/utils/bmap-wx.min.js new file mode 100644 index 0000000..f16b450 --- /dev/null +++ b/utils/bmap-wx.min.js @@ -0,0 +1 @@ +"use strict"; function _classCallCheck(t, a) { if (!(t instanceof a)) throw new TypeError("Cannot call a class as a function") } var _createClass = function () { function t(t, a) { for (var e = 0; e < a.length; e++) { var i = a[e]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i) } } return function (a, e, i) { return e && t(a.prototype, e), i && t(a, i), a } }(), BMapWX = function () { function t(a) { _classCallCheck(this, t), this.ak = a.ak } return _createClass(t, [{ key: "getWXLocation", value: function (t, a, e, i) { t = t || "gcj02", a = a || function () { }, e = e || function () { }, i = i || function () { }, wx.getLocation({ type: t, success: a, fail: e, complete: i }) } }, { key: "search", value: function (t) { var a = this; t = t || {}; var e = { query: t.query || "生活服务$美食&酒店", scope: t.scope || 1, filter: t.filter || "", coord_type: t.coord_type || 2, page_size: t.page_size || 10, page_num: t.page_num || 0, output: t.output || "json", ak: a.ak, sn: t.sn || "", timestamp: t.timestamp || "", radius: t.radius || 2e3, ret_coordtype: "gcj02ll" }, i = { iconPath: t.iconPath, iconTapPath: t.iconTapPath, width: t.width, height: t.height, alpha: t.alpha || 1, success: t.success || function () { }, fail: t.fail || function () { } }, n = function (t) { e.location = t.latitude + "," + t.longitude, wx.request({ url: "https://api.map.baidu.com/place/v2/search", data: e, header: { "content-type": "application/json" }, method: "GET", success: function (t) { var a = t.data; if (0 === a.status) { var e = a.results, n = {}; n.originalData = a, n.wxMarkerData = []; for (var s = 0; s < e.length; s++)n.wxMarkerData[s] = { id: s, latitude: e[s].location.lat, longitude: e[s].location.lng, title: e[s].name, iconPath: i.iconPath, iconTapPath: i.iconTapPath, address: e[s].address, telephone: e[s].telephone, alpha: i.alpha, width: i.width, height: i.height }; i.success(n) } else i.fail({ errMsg: a.message, statusCode: a.status }) }, fail: function (t) { i.fail(t) } }) }, s = function (t) { i.fail(t) }, o = function (t) { }; if (t.location) { var c = t.location.split(",")[1]; n({ errMsg: "input location", latitude: t.location.split(",")[0], longitude: c }) } else a.getWXLocation("gcj02", n, s, o) } }, { key: "suggestion", value: function (t) { var a = this; t = t || {}; var e = { query: t.query || "", region: t.region || "全国", city_limit: t.city_limit || !1, output: t.output || "json", ak: a.ak, sn: t.sn || "", timestamp: t.timestamp || "", ret_coordtype: "gcj02ll" }, i = { success: t.success || function () { }, fail: t.fail || function () { } }; wx.request({ url: "https://api.map.baidu.com/place/v2/suggestion", data: e, header: { "content-type": "application/json" }, method: "GET", success: function (t) { var a = t.data; 0 === a.status ? i.success(a) : i.fail({ errMsg: a.message, statusCode: a.status }) }, fail: function (t) { i.fail(t) } }) } }, { key: "regeocoding", value: function (t) { var a = this; t = t || {}; var e = { coordtype: t.coordtype || "gcj02ll", ret_coordtype: "gcj02ll", radius: t.radius || 1e3, ak: a.ak, sn: t.sn || "", output: t.output || "json", callback: t.callback || function () { }, extensions_poi: t.extensions_poi || 1, extensions_road: t.extensions_road || !1, extensions_town: t.extensions_town || !1, language: t.language || "zh-CN", language_auto: t.language_auto || 0 }, i = { iconPath: t.iconPath, iconTapPath: t.iconTapPath, width: t.width, height: t.height, alpha: t.alpha || 1, success: t.success || function () { }, fail: t.fail || function () { } }, n = function (t) { e.location = t.latitude + "," + t.longitude, wx.request({ url: "https://api.map.baidu.com/reverse_geocoding/v3", data: e, header: { "content-type": "application/json" }, method: "GET", success: function (a) { var e = a.data; if (0 === e.status) { var n = e.result, s = {}; s.originalData = e, s.wxMarkerData = [], s.wxMarkerData[0] = { id: 0, latitude: t.latitude, longitude: t.longitude, address: n.formatted_address, iconPath: i.iconPath, iconTapPath: i.iconTapPath, desc: n.sematic_description, business: n.business, alpha: i.alpha, width: i.width, height: i.height }, i.success(s) } else i.fail({ errMsg: e.message, statusCode: e.status }) }, fail: function (t) { i.fail(t) } }) }, s = function (t) { i.fail(t) }, o = function (t) { }; if (t.location) { var c = t.location.split(",")[1]; n({ errMsg: "input location", latitude: t.location.split(",")[0], longitude: c }) } else a.getWXLocation("gcj02", n, s, o) } }, { key: "geocoding", value: function (t) { var a = this; t = t || {}; var e = { address: t.address || "", city: t.city || "", ret_coordtype: t.coordtype || "gcj02ll", ak: a.ak, sn: t.sn || "", output: t.output || "json", callback: t.callback || function () { } }, i = { iconPath: t.iconPath, iconTapPath: t.iconTapPath, width: t.width, height: t.height, alpha: t.alpha || 1, success: t.success || function () { }, fail: t.fail || function () { } }; if (t.address) wx.request({ url: "https://api.map.baidu.com/geocoding/v3", data: e, header: { "content-type": "application/json" }, method: "GET", success: function (t) { var a = t.data; if (0 === a.status) { var e = a.result, n = a; n.originalData = a, n.wxMarkerData = [], n.wxMarkerData[0] = { id: 0, latitude: e.location.lat, longitude: e.location.lng, iconPath: i.iconPath, iconTapPath: i.iconTapPath, alpha: i.alpha, width: i.width, height: i.height }, i.success(n) } else i.fail({ errMsg: a.message, statusCode: a.status }) }, fail: function (t) { i.fail(t) } }); else { var n = { errMsg: "input address!" }; i.fail(n) } } }, { key: "weather", value: function (t) { var a = this; t = t || {}; var e = { coord_type: t.coord_type || "gcj02", output: t.output || "json", ak: a.ak, sn: t.sn || "", timestamp: t.timestamp || "" }, i = { success: t.success || function () { }, fail: t.fail || function () { } }, n = function (t) { e.location = t.longitude + "," + t.latitude, wx.request({ url: "https://api.map.baidu.com/telematics/v3/weather", data: e, header: { "content-type": "application/json" }, method: "GET", success: function (t) { var a = t.data; if (0 === a.error && "success" === a.status) { var e = a.results, n = {}; n.originalData = a, n.currentWeather = [], n.currentWeather[0] = { currentCity: e[0].currentCity, pm25: e[0].pm25, date: e[0].weather_data[0].date, temperature: e[0].weather_data[0].temperature, weatherDesc: e[0].weather_data[0].weather, wind: e[0].weather_data[0].wind }, i.success(n) } else i.fail({ errMsg: a.message, statusCode: a.status }) }, fail: function (t) { i.fail(t) } }) }, s = function (t) { i.fail(t) }, o = function (t) { }; if (t.location) { var c = t.location.split(",")[0]; n({ errMsg: "input location", latitude: t.location.split(",")[1], longitude: c }) } else a.getWXLocation("gcj02", n, s, o) } }]), t }(); module.exports.BMapWX = BMapWX; diff --git a/utils/md5.js b/utils/md5.js new file mode 100644 index 0000000..5e150fa --- /dev/null +++ b/utils/md5.js @@ -0,0 +1,205 @@ +/* + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 1.1 Copyright (C) Paul Johnston 1999 - 2002. + * Code also contributed by Greg Holt + * See http://pajhome.org.uk/site/legal.html for details. + */ + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF) + var msw = (x >> 16) + (y >> 16) + (lsw >> 16) + return (msw << 16) | (lsw & 0xFFFF) +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function rol(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)) +} + +/* + * These functions implement the four basic operations the algorithm uses. + */ +function cmn(q, a, b, x, s, t) { + return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b) +} +function ff(a, b, c, d, x, s, t) { + return cmn((b & c) | ((~b) & d), a, b, x, s, t) +} +function gg(a, b, c, d, x, s, t) { + return cmn((b & d) | (c & (~d)), a, b, x, s, t) +} +function hh(a, b, c, d, x, s, t) { + return cmn(b ^ c ^ d, a, b, x, s, t) +} +function ii(a, b, c, d, x, s, t) { + return cmn(c ^ (b | (~d)), a, b, x, s, t) +} + +/* + * Calculate the MD5 of an array of little-endian words, producing an array + * of little-endian words. + */ +function coreMD5(x) { + var a = 1732584193 + var b = -271733879 + var c = -1732584194 + var d = 271733878 + + for (var i = 0; i < x.length; i += 16) { + var olda = a + var oldb = b + var oldc = c + var oldd = d + + a = ff(a, b, c, d, x[i + 0], 7, -680876936) + d = ff(d, a, b, c, x[i + 1], 12, -389564586) + c = ff(c, d, a, b, x[i + 2], 17, 606105819) + b = ff(b, c, d, a, x[i + 3], 22, -1044525330) + a = ff(a, b, c, d, x[i + 4], 7, -176418897) + d = ff(d, a, b, c, x[i + 5], 12, 1200080426) + c = ff(c, d, a, b, x[i + 6], 17, -1473231341) + b = ff(b, c, d, a, x[i + 7], 22, -45705983) + a = ff(a, b, c, d, x[i + 8], 7, 1770035416) + d = ff(d, a, b, c, x[i + 9], 12, -1958414417) + c = ff(c, d, a, b, x[i + 10], 17, -42063) + b = ff(b, c, d, a, x[i + 11], 22, -1990404162) + a = ff(a, b, c, d, x[i + 12], 7, 1804603682) + d = ff(d, a, b, c, x[i + 13], 12, -40341101) + c = ff(c, d, a, b, x[i + 14], 17, -1502002290) + b = ff(b, c, d, a, x[i + 15], 22, 1236535329) + + a = gg(a, b, c, d, x[i + 1], 5, -165796510) + d = gg(d, a, b, c, x[i + 6], 9, -1069501632) + c = gg(c, d, a, b, x[i + 11], 14, 643717713) + b = gg(b, c, d, a, x[i + 0], 20, -373897302) + a = gg(a, b, c, d, x[i + 5], 5, -701558691) + d = gg(d, a, b, c, x[i + 10], 9, 38016083) + c = gg(c, d, a, b, x[i + 15], 14, -660478335) + b = gg(b, c, d, a, x[i + 4], 20, -405537848) + a = gg(a, b, c, d, x[i + 9], 5, 568446438) + d = gg(d, a, b, c, x[i + 14], 9, -1019803690) + c = gg(c, d, a, b, x[i + 3], 14, -187363961) + b = gg(b, c, d, a, x[i + 8], 20, 1163531501) + a = gg(a, b, c, d, x[i + 13], 5, -1444681467) + d = gg(d, a, b, c, x[i + 2], 9, -51403784) + c = gg(c, d, a, b, x[i + 7], 14, 1735328473) + b = gg(b, c, d, a, x[i + 12], 20, -1926607734) + + a = hh(a, b, c, d, x[i + 5], 4, -378558) + d = hh(d, a, b, c, x[i + 8], 11, -2022574463) + c = hh(c, d, a, b, x[i + 11], 16, 1839030562) + b = hh(b, c, d, a, x[i + 14], 23, -35309556) + a = hh(a, b, c, d, x[i + 1], 4, -1530992060) + d = hh(d, a, b, c, x[i + 4], 11, 1272893353) + c = hh(c, d, a, b, x[i + 7], 16, -155497632) + b = hh(b, c, d, a, x[i + 10], 23, -1094730640) + a = hh(a, b, c, d, x[i + 13], 4, 681279174) + d = hh(d, a, b, c, x[i + 0], 11, -358537222) + c = hh(c, d, a, b, x[i + 3], 16, -722521979) + b = hh(b, c, d, a, x[i + 6], 23, 76029189) + a = hh(a, b, c, d, x[i + 9], 4, -640364487) + d = hh(d, a, b, c, x[i + 12], 11, -421815835) + c = hh(c, d, a, b, x[i + 15], 16, 530742520) + b = hh(b, c, d, a, x[i + 2], 23, -995338651) + + a = ii(a, b, c, d, x[i + 0], 6, -198630844) + d = ii(d, a, b, c, x[i + 7], 10, 1126891415) + c = ii(c, d, a, b, x[i + 14], 15, -1416354905) + b = ii(b, c, d, a, x[i + 5], 21, -57434055) + a = ii(a, b, c, d, x[i + 12], 6, 1700485571) + d = ii(d, a, b, c, x[i + 3], 10, -1894986606) + c = ii(c, d, a, b, x[i + 10], 15, -1051523) + b = ii(b, c, d, a, x[i + 1], 21, -2054922799) + a = ii(a, b, c, d, x[i + 8], 6, 1873313359) + d = ii(d, a, b, c, x[i + 15], 10, -30611744) + c = ii(c, d, a, b, x[i + 6], 15, -1560198380) + b = ii(b, c, d, a, x[i + 13], 21, 1309151649) + a = ii(a, b, c, d, x[i + 4], 6, -145523070) + d = ii(d, a, b, c, x[i + 11], 10, -1120210379) + c = ii(c, d, a, b, x[i + 2], 15, 718787259) + b = ii(b, c, d, a, x[i + 9], 21, -343485551) + + a = safe_add(a, olda) + b = safe_add(b, oldb) + c = safe_add(c, oldc) + d = safe_add(d, oldd) + } + return [a, b, c, d] +} + +/* + * Convert an array of little-endian words to a hex string. + */ +function binl2hex(binarray) { + var hex_tab = "0123456789abcdef" + var str = "" + for (var i = 0; i < binarray.length * 4; i++) { + str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) + + hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF) + } + return str +} + +/* + * Convert an array of little-endian words to a base64 encoded string. + */ +function binl2b64(binarray) { + var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + var str = "" + for (var i = 0; i < binarray.length * 32; i += 6) { + str += tab.charAt(((binarray[i >> 5] << (i % 32)) & 0x3F) | + ((binarray[i >> 5 + 1] >> (32 - i % 32)) & 0x3F)) + } + return str +} + +/* + * Convert an 8-bit character string to a sequence of 16-word blocks, stored + * as an array, and append appropriate padding for MD4/5 calculation. + * If any of the characters are >255, the high byte is silently ignored. + */ +function str2binl(str) { + var nblk = ((str.length + 8) >> 6) + 1 // number of 16-word blocks + var blks = new Array(nblk * 16) + for (var i = 0; i < nblk * 16; i++) blks[i] = 0 + for (var i = 0; i < str.length; i++) + blks[i >> 2] |= (str.charCodeAt(i) & 0xFF) << ((i % 4) * 8) + blks[i >> 2] |= 0x80 << ((i % 4) * 8) + blks[nblk * 16 - 2] = str.length * 8 + return blks +} + +/* + * Convert a wide-character string to a sequence of 16-word blocks, stored as + * an array, and append appropriate padding for MD4/5 calculation. + */ +function strw2binl(str) { + var nblk = ((str.length + 4) >> 5) + 1 // number of 16-word blocks + var blks = new Array(nblk * 16) + for (var i = 0; i < nblk * 16; i++) blks[i] = 0 + for (var i = 0; i < str.length; i++) + blks[i >> 1] |= str.charCodeAt(i) << ((i % 2) * 16) + blks[i >> 1] |= 0x80 << ((i % 2) * 16) + blks[nblk * 16 - 2] = str.length * 16 + return blks +} + +/* + * External interface + */ +function hexMD5(str) { return binl2hex(coreMD5(str2binl(str))) } +function hexMD5w(str) { return binl2hex(coreMD5(strw2binl(str))) } +function b64MD5(str) { return binl2b64(coreMD5(str2binl(str))) } +function b64MD5w(str) { return binl2b64(coreMD5(strw2binl(str))) } +/* Backward compatibility */ +function calcMD5(str) { return binl2hex(coreMD5(str2binl(str))) } +module.exports = { + hexMD5: hexMD5 +} \ No newline at end of file diff --git a/utils/restAjax.js b/utils/restAjax.js new file mode 100644 index 0000000..e3a8be6 --- /dev/null +++ b/utils/restAjax.js @@ -0,0 +1,239 @@ +const api = require('../utils/api'); + +var methods = { + POST_METHOD: 'POST', + DELETE_METHOD: 'DELETE', + PUT_METHOD: 'PUT', + GET_METHOD: 'GET' +}; + +/** + * 新增 + * @param url + * @param dataObj + * @param args + * @param successCallback + * @param errorCallback + * @param completeCallback + */ +function postJson(url, dataObj, args, successCallback, errorCallback, completeCallback) { + doAjax(url, methods.POST_METHOD, dataObj, args, successCallback, errorCallback, completeCallback); +} + +/** + * 删除 + * @param url + * @param dataObj + * @param args + * @param successCallback + * @param errorCallback + * @param completeCallback + */ +function deleteForm(url, dataObj, args, successCallback, errorCallback, completeCallback) { + doAjax(url, methods.DELETE_METHOD, dataObj, args, successCallback, errorCallback, completeCallback); +} + +/** + * 修改 + * @param url + * @param dataObj + * @param args + * @param successCallback + * @param errorCallback + * @param completeCallback + */ +function putJson(url, dataObj, args, successCallback, errorCallback, completeCallback) { + doAjax(url, methods.PUT_METHOD, dataObj, args, successCallback, errorCallback, completeCallback); +} + +/** + * 查询 + * @param url + * @param dataObj + * @param args + * @param successCallback + * @param errorCallback + * @param completeCallback + */ +function getForm(url, dataObj, args, successCallback, errorCallback, completeCallback) { + doAjax(url, methods.GET_METHOD, dataObj, args, successCallback, errorCallback, completeCallback); +} + +/** + * 执行上传 + * @param url + * @param method + * @param dataObj + * @param args + * @param successCallback + * @param errorCallback + * @param completeCallback + */ +function doAjax(url, method, dataObj, args, successCallback, errorCallback, completeCallback) { + var headers = {}; + if (args != null && typeof (args.headers) != 'undefined' && args.headers != null) { + headers = args.headers; + } + wx.request({ + url: url, + method: method, + data: dataObj, + header: headers, + dataType: 'json', + success: function (response) { + if (response.statusCode == 200) { + successCallback(response.statusCode, response.data, args); + } else { + if (errorCallback && typeof (errorCallback) == 'function') { + errorCallback(response.statusCode, response.data); + } + } + }, + fail: function (response) { + if (errorCallback && typeof errorCallback == 'function') { + errorCallback(response.statusCode, response) + } + }, + complete: function () { + if (completeCallback && typeof (completeCallback) == 'function') { + completeCallback(); + } + } + }) +} + +/** + * 检测是路径参数有重复值 + * @param pathArgArray + * @returns {boolean} + */ +function pathArgsHasSameValue(pathArgArray) { + var tempArgIndex = 0; + var tempArgs = pathArgArray[tempArgIndex]; + for (var i = (tempArgIndex + 1), item; item = pathArgArray[i]; i++) { + if (tempArgs == item) { + throw new Error('参数' + item + '有重复值!!!'); + } + if (i == pathArgArray.length - 1) { + tempArgs = pathArgArray[++tempArgIndex]; + i = tempArgIndex; + continue; + } + } +} + +/** + * 获取页面间传递的参数 + * @param url + */ +function getParamsArg(url) { + var params = url.split('?')[1]; + var paramsObj = {}; + if (typeof (params) == 'undefined' || params == null) { + return paramsObj; + } + var paramsKVs = params.split('&'); + for (var i = 0, item = null; item = paramsKVs[i++];) { + var kvs = item.split('='); + if (kvs.length == 1) { + paramsObj[kvs[0]] = null; + } + if (kvs.length == 2) { + paramsObj[kvs[0]] = decodeURI(kvs[1]); + } + } + return paramsObj; +} + +/** + * 构建路径 + * @param basePath 请求路径,{参数}, + * @param pathArgs 替换的路径参数,不能重复 + * @returns {*} + */ +function buildPath(basePath, pathArgs) { + var path = basePath; + if (!basePath || !(typeof (basePath) == 'string')) { + throw new Error('basePath必须为字符串!!!'); + } + if (!pathArgs || !Array.isArray(pathArgs)) { + throw new Error('pathArgs必须为数组!!!'); + } + var pathArgArray = basePath.match(/\{\w+\}/g); + if (!pathArgArray) { + return path; + } + pathArgsHasSameValue(pathArgArray); + for (var i = 0, item; item = pathArgArray[i]; i++) { + path = path.replace(item, pathArgs[i]); + } + return path; +} + +/** + * 通过form对象上传文件 + * @param url + * @param formData + * @param args + * @param successCallback + * @param errorCallback + * @param beforeCallback + * @param completeCallback + */ +function postFile(url, path, name, args, successCallback, errorCallback, completeCallback) { + var headers = {}; + if (args != null && typeof (args.headers) != 'undefined' && args.headers != null) { + headers = args.headers; + } + wx.uploadFile({ + filePath: path, + name: name, + url: url, + header: headers, + success: function (response) { + if (response.statusCode == 200) { + successCallback(response.statusCode, response.data, args); + } else { + if (errorCallback && typeof (errorCallback) == 'function') { + errorCallback(response.statusCode, response.data); + } + } + }, + fail: function (response) { + if (errorCallback && typeof errorCallback == 'function') { + errorCallback(response.statusCode, response.data) + } + }, + complete: function () { + if (completeCallback && typeof (completeCallback) == 'function') { + completeCallback(); + } + } + }) +}; + +/** + * xss 转义 + * @param html + * @returns {string} + */ +function escape(html) { + return String(html || '').replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&') + .replace(//g, '>') + .replace(/'/g, ''').replace(/"/g, '"'); +} + + + +module.exports = { + post: postJson, + delete: deleteForm, + put: putJson, + get: getForm, + params: getParamsArg, + path: buildPath, + escape: escape, + file: postFile, + apis: api.apis, + baseUrl: api.baseUrls +} \ No newline at end of file diff --git a/utils/util.js b/utils/util.js new file mode 100644 index 0000000..a02f313 --- /dev/null +++ b/utils/util.js @@ -0,0 +1,67 @@ +const formatTime = date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + + return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}` +} + +const formatNumber = n => { + n = n.toString() + return n[1] ? n : `0${n}` +} +/** + * 坐标转换,百度地图坐标转换成腾讯地图坐标 + * lng 腾讯经度(pointy) + * lat 腾讯纬度(pointx) + * 经度>纬度 + */ +function bdMapToQQMap(lng, lat) { + if (lng == null || lng == '' || lat == null || lat == '') { + return [lng, lat] + } + var x_pi = 3.14159265358979324; + var x = parseFloat(lng) - 0.0065; + var y = parseFloat(lat) - 0.006; + var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); + var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi); + var lng = (z * Math.cos(theta)).toFixed(7); + var lat = (z * Math.sin(theta)).toFixed(7); + return [lng, lat]; +} +/** + * 坐标转换,腾讯地图转换成百度地图坐标 + * lng 腾讯经度(pointy) + * lat 腾讯纬度(pointx) + * 经度>纬度 + */ +function qqMapToBMap(lng, lat) { + if (lng == null || lng == '' || lat == null || lat == '') + return [lng, lat]; + var x_pi = 3.14159265358979324; + var x = parseFloat(lng); + var y = parseFloat(lat); + var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi); + var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi); + var lng = (z * Math.cos(theta) + 0.0065).toFixed(5); + var lat = (z * Math.sin(theta) + 0.006).toFixed(5); + return [lng, lat]; +} + +function isMobile(phone) { + var myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/; + if (!myreg.test(phone)) { + return false + } else { + return true + } +} +module.exports = { + formatTime, + bdMapToQQMap, + qqMapToBMap, + isMobile +} \ No newline at end of file