From 15d4861559f9975b2e5363f8832987db5a8fcb9a Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Wed, 15 Jan 2020 00:37:45 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 4 +- constant/UrlConstant.js | 12 +- pages/activites/activites.js | 139 +++++++++++++++++++++ pages/activites/activites.json | 3 + pages/activites/activites.wxml | 22 ++++ pages/activites/activites.wxss | 11 ++ pages/activitesDetail/activitesDetail.js | 130 +++++++++++++++++++ pages/activitesDetail/activitesDetail.json | 3 + pages/activitesDetail/activitesDetail.wxml | 16 +++ pages/activitesDetail/activitesDetail.wxss | 22 ++++ pages/index/index.js | 92 +++++++++++--- pages/index/index.wxml | 14 +-- project.config.json | 16 +-- 13 files changed, 451 insertions(+), 33 deletions(-) create mode 100644 pages/activites/activites.js create mode 100644 pages/activites/activites.json create mode 100644 pages/activites/activites.wxml create mode 100644 pages/activites/activites.wxss create mode 100644 pages/activitesDetail/activitesDetail.js create mode 100644 pages/activitesDetail/activitesDetail.json create mode 100644 pages/activitesDetail/activitesDetail.wxml create mode 100644 pages/activitesDetail/activitesDetail.wxss diff --git a/app.json b/app.json index 89036ea..be2b4d3 100644 --- a/app.json +++ b/app.json @@ -29,7 +29,9 @@ "pages/viewComplaint/viewComplaint", "pages/payParkingFeeList/payParkingFeeList", "pages/payParkingFee/payParkingFee", - "pages/my/myHouseDetail" + "pages/my/myHouseDetail", + "pages/activites/activites", + "pages/activitesDetail/activitesDetail" ], "window": { "navigationBarTextStyle": "white", diff --git a/constant/UrlConstant.js b/constant/UrlConstant.js index fd93c7e..944e3ea 100644 --- a/constant/UrlConstant.js +++ b/constant/UrlConstant.js @@ -58,6 +58,8 @@ const uploadOwnerPhoto = baseUrl +"app/owner.uploadOwnerPhoto"; const getOwnerPhotoPath = "https://hc.demo.winqi.cn/callComponent/download/getFile/fileByObjId"; +const filePath = "https://hc.demo.winqi.cn/callComponent/download/getFile/file"; + //查询业主车位信息 const queryParkingSpacesByOwner = baseUrl+"app/parkingSpace.queryParkingSpacesByOwner"; @@ -68,7 +70,11 @@ const queryFeeByParkingSpace = baseUrl+"app/fee.queryFeeByParkingSpace"; const preOrder = baseUrl +"/app/payment/toPay"; //查询小区 -const listCommunitys = baseUrl +"/app/community.listCommunitys" +const listCommunitys = baseUrl + "/app/community.listCommunitys"; +//查询小区文化 +const listActivitiess = baseUrl + "/app/activities.listActivitiess" + + module.exports = { @@ -95,5 +101,7 @@ module.exports = { queryParkingSpacesByOwner: queryParkingSpacesByOwner, queryFeeByParkingSpace: queryFeeByParkingSpace, preOrder: preOrder, - listCommunitys: listCommunitys + listCommunitys: listCommunitys, + listActivitiess: listActivitiess, + filePath: filePath }; \ No newline at end of file diff --git a/pages/activites/activites.js b/pages/activites/activites.js new file mode 100644 index 0000000..2262a48 --- /dev/null +++ b/pages/activites/activites.js @@ -0,0 +1,139 @@ +// pages/activites/activites.js +const context = require("../../context/Java110Context.js"); +const constant = context.constant; +const util = context.util; +Page({ + + /** + * 页面的初始数据 + */ + data: { + activities:[] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let _that =this; + context.getOwner(function (_owner) { + let _communityId = ''; + if (_owner == null) { + _communityId = '7020181217000001' + } else { + _communityId = _owner.communityId; + } + _that.setData({ + communityId: _communityId + }); + + //查询小区文化 + _that._loadActivites(); + + + }); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + /** + * 加载活动 + * 第一次加载是可能没有小区 则直接下载固定小区 + * + */ + _loadActivites: function () { + let _that = this; + let _objData = { + page: 1, + row: 15, + communityId: this.data.communityId + }; + context.request({ + url: constant.url.listActivitiess, + header: context.getHeaders(), + method: "GET", + data: _objData, //动态数据 + success: function (res) { + console.log("请求返回信息:", res); + if (res.statusCode == 200) { + + let _activites = res.data.activitiess; + let _acts = []; + _activites.forEach(function (_item) { + _item.src = constant.url.filePath + "?fileId=" + _item.headerImg + "&communityId=" + _that.data.communityId + "&time=" + new Date(); + let _startTime = _item.startTime.replace(/\-/g, "/") + let _tmpStartTime = new Date(_startTime); + + _item.startTime = util.date.formatDate(_tmpStartTime); + _acts.push(_item); + }); + + + _that.setData({ + activities: _acts + }); + + return; + } + wx.showToast({ + title: "服务器异常了", + icon: 'none', + duration: 2000 + }) + }, + fail: function (e) { + wx.showToast({ + title: "服务器异常了", + icon: 'none', + duration: 2000 + }) + } + }); + }, +}) \ No newline at end of file diff --git a/pages/activites/activites.json b/pages/activites/activites.json new file mode 100644 index 0000000..1921361 --- /dev/null +++ b/pages/activites/activites.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "小区文化" +} \ No newline at end of file diff --git a/pages/activites/activites.wxml b/pages/activites/activites.wxml new file mode 100644 index 0000000..ad4381d --- /dev/null +++ b/pages/activites/activites.wxml @@ -0,0 +1,22 @@ + + + + + + + + {{item.title}} + + + {{item.userName}} + + + + + + + + + + + \ No newline at end of file diff --git a/pages/activites/activites.wxss b/pages/activites/activites.wxss new file mode 100644 index 0000000..f083c70 --- /dev/null +++ b/pages/activites/activites.wxss @@ -0,0 +1,11 @@ +.act{ + background-color: #fff; +} +.act .act_title{ + padding: 10rpx 80rpx 10rpx 20rpx; +} + +.headImg{ + width: 100%; + height: 400rpx; +} \ No newline at end of file diff --git a/pages/activitesDetail/activitesDetail.js b/pages/activitesDetail/activitesDetail.js new file mode 100644 index 0000000..9d2971d --- /dev/null +++ b/pages/activitesDetail/activitesDetail.js @@ -0,0 +1,130 @@ +const context = require("../../context/Java110Context.js"); +const constant = context.constant; +const util = context.util; +Page({ + + /** + * 页面的初始数据 + */ + data: { + activitiesId:'', + title:'', + communityId:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + activitiesId: options.activitiesId, + title: options.title, + communityId: options.communityId + }); + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let _that = this; + context.getOwner(function (_owner) { + let _communityId = ''; + if (_owner == null) { + _communityId = '7020181217000001' + } else { + _communityId = _owner.communityId; + } + _that.setData({ + communityId: _communityId + }); + + _that._loadActivite(); + }) + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + _loadActivite:function(){ + let _that = this; + let _objData = { + page: 1, + row: 1, + communityId: this.data.communityId, + activitiesId: this.data.activitiesId + }; + context.request({ + url: constant.url.listActivitiess, + header: context.getHeaders(), + method: "GET", + data: _objData, //动态数据 + success: function (res) { + console.log("请求返回信息:", res); + if (res.statusCode == 200) { + + let _activites = res.data.activitiess[0]; + _activites.src = constant.url.filePath + "?fileId=" + _activites.headerImg + "&communityId=" + _that.data.communityId + "&time=" + new Date(); + let _startTime = _activites.startTime.replace(/\-/g, "/") + let _tmpStartTime = new Date(_startTime); + + _activites.startTime = util.date.formatDate(_tmpStartTime); + _that.setData(_activites); + return; + } + wx.showToast({ + title: "服务器异常了", + icon: 'none', + duration: 2000 + }) + }, + fail: function (e) { + wx.showToast({ + title: "服务器异常了", + icon: 'none', + duration: 2000 + }) + } + }); + } +}) \ No newline at end of file diff --git a/pages/activitesDetail/activitesDetail.json b/pages/activitesDetail/activitesDetail.json new file mode 100644 index 0000000..50b6c5d --- /dev/null +++ b/pages/activitesDetail/activitesDetail.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "小区文化内容" +} \ No newline at end of file diff --git a/pages/activitesDetail/activitesDetail.wxml b/pages/activitesDetail/activitesDetail.wxml new file mode 100644 index 0000000..4e039b1 --- /dev/null +++ b/pages/activitesDetail/activitesDetail.wxml @@ -0,0 +1,16 @@ + + + + + {{title}} + + + {{userName}} + {{startTime}} + + + + + + + \ No newline at end of file diff --git a/pages/activitesDetail/activitesDetail.wxss b/pages/activitesDetail/activitesDetail.wxss new file mode 100644 index 0000000..92265a7 --- /dev/null +++ b/pages/activitesDetail/activitesDetail.wxss @@ -0,0 +1,22 @@ +.detailContainer{ + background-color: #fff; +} +.detailContainer .headImg{ + width: 100%; + height: 400rpx; +} + +.detailContainer .ad_titile{ + text-align: center; + margin-top: 30rpx; + margin-bottom: 30rpx; + font-size: 44rpx; +} + +.detailContainer .ad_au_text{ + font-size: 32rpx; + color: #8e8e8e +} +.detailContainer .ad_context{ + padding: 0rpx 40rpx 40rpx 40rpx; +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 7e96682..d569309 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -8,6 +8,7 @@ Page({ * 页面的初始数据 */ data: { + communityId:'', ad: [{ imageUrl: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1573966727205&di=66965e182c0d2efd0818a7d9b8c2629a&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fcf482ffb4f3fc6d941664e1cba8ca3ca6e9c0a9443f84-AsGU9b_fw658", url: "http://www.homecommunity.cn/" @@ -17,18 +18,7 @@ Page({ url: "http://www.homecommunity.cn/" } ], - notices: [{ - name: "今日8:00-00:00 停电,请各位知晓", - src: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1573966727205&di=66965e182c0d2efd0818a7d9b8c2629a&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fcf482ffb4f3fc6d941664e1cba8ca3ca6e9c0a9443f84-AsGU9b_fw658", - }, - { - name: "今日8:00-00:00 停电,请各位知晓,测试测试测测人吃吃吃吃吃吃吃吃吃吃吃吃吃吃", - src: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1573966727205&di=66965e182c0d2efd0818a7d9b8c2629a&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fcf482ffb4f3fc6d941664e1cba8ca3ca6e9c0a9443f84-AsGU9b_fw658", - }, - { - name: "今日8:00-00:00 停电,请各位知晓", - src: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1573966727205&di=66965e182c0d2efd0818a7d9b8c2629a&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fcf482ffb4f3fc6d941664e1cba8ca3ca6e9c0a9443f84-AsGU9b_fw658", - } + notices: [ ], categoryList: { pageone: [{ @@ -154,12 +144,29 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { - var that = this; + var _that = this; - that.setData({ + _that.setData({ location: wx.getStorageSync('location') }); - that._judgeBindOwner(); + _that._judgeBindOwner(); + + context.getOwner(function (_owner) { + let _communityId = ''; + if(_owner == null ){ + _communityId = '7020181217000001' + }else{ + _communityId = _owner.communityId; + } + _that.setData({ + communityId: _communityId + }); + + //查询小区文化 + _that._loadActivites(); + + + }); }, _judgeBindOwner:function(){ @@ -223,5 +230,60 @@ Page({ */ onShareAppMessage: function() { + }, + /** + * 加载活动 + * 第一次加载是可能没有小区 则直接下载固定小区 + * + */ + _loadActivites:function(){ + let _that = this; + let _objData = { + page:1, + row:5, + communityId:this.data.communityId + }; + context.request({ + url: constant.url.listActivitiess, + header: context.getHeaders(), + method: "GET", + data: _objData, //动态数据 + success: function (res) { + console.log("请求返回信息:", res); + if (res.statusCode == 200) { + + let _activites = res.data.activitiess; + let _acts = []; + _activites.forEach(function(_item){ + _item.src = constant.url.filePath + "?fileId=" + _item.headerImg +"&communityId="+_that.data.communityId+"&time="+new Date(); + _acts.push(_item); + }); + + + _that.setData({ + notices: _acts + }); + + return; + } + wx.showToast({ + title: "服务器异常了", + icon: 'none', + duration: 2000 + }) + }, + fail: function (e) { + wx.showToast({ + title: "服务器异常了", + icon: 'none', + duration: 2000 + }) + } + }); + }, + _moreActivities:function(){ + wx.navigateTo({ + url: '/pages/activites/activites', + }) } }) \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 0481c8d..7c6141f 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -48,27 +48,27 @@ 小区文化 - + - - + + - {{item.name}} + {{item.title}} - wuxw + {{item.userName}} - 1179 + {{item.readCount}} - 37 + {{item.likeCount}} diff --git a/project.config.json b/project.config.json index 0c1e2a6..376bbf5 100644 --- a/project.config.json +++ b/project.config.json @@ -1,13 +1,13 @@ { "description": "项目配置文件。", - "packOptions": { - "ignore": [ - { - "type": "folder", - "value": "readme" - } - ] - }, + "packOptions": { + "ignore": [ + { + "type": "folder", + "value": "readme" + } + ] + }, "setting": { "urlCheck": false, "es6": true, From b4f2d5b96fabe7b0ecfdbee1f9d87292afa6babc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E7=A3=8A?= Date: Wed, 15 Jan 2020 10:58:26 +0800 Subject: [PATCH 2/5] 1 --- project.config.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/project.config.json b/project.config.json index 0c1e2a6..376bbf5 100644 --- a/project.config.json +++ b/project.config.json @@ -1,13 +1,13 @@ { "description": "项目配置文件。", - "packOptions": { - "ignore": [ - { - "type": "folder", - "value": "readme" - } - ] - }, + "packOptions": { + "ignore": [ + { + "type": "folder", + "value": "readme" + } + ] + }, "setting": { "urlCheck": false, "es6": true, From 79bcba744757e65b91613ed82c19078abcf934f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E7=A3=8A?= Date: Wed, 15 Jan 2020 15:16:17 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=AE=B6=E5=BA=AD=E6=88=90=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/family/family.js | 107 ++++++++++++++++++----------- pages/family/family.wxml | 111 +++++-------------------------- pages/family/family.wxss | 39 +++++++---- pages/familyList/familyList.js | 52 ++++++++++----- pages/familyList/familyList.wxml | 7 +- pages/familyList/familyList.wxss | 7 +- 6 files changed, 148 insertions(+), 175 deletions(-) diff --git a/pages/family/family.js b/pages/family/family.js index f11e2cc..d628a94 100644 --- a/pages/family/family.js +++ b/pages/family/family.js @@ -9,8 +9,9 @@ Page({ * 页面的初始数据 */ data: { - "sexArr":["男","女"], - "sex": "0", + "columns":["男","女"], + "sex": "", + sexValue:"", "name": "", "link": "", "remark": "", @@ -18,13 +19,26 @@ Page({ "userId": "", "ownerTypeCd": "1002", "age": "", - "memberId": "" + "memberId": -1, + communityId:"", + idCard:"", + sexShow: false }, /** * 生命周期函数--监听页面加载 */ - onLoad: function(options) {}, + onLoad: function(options) { + let that = this; + context.getOwner(function (_owner) { + console.log(_owner); + that.setData({ + ownerId: _owner.memberId, + userId: _owner.memberId, + communityId: _owner.communityId + }) + }) + }, /** * 生命周期函数--监听页面初次渲染完成 @@ -61,33 +75,39 @@ Page({ }, + bindInput: function (e) { + console.log('数据监听', e); + let _that = this; + let dataset = e.currentTarget.dataset; + let value = e.detail; + let name = dataset.name; + _that.data[name] = value; + // _that.setData({ + // name: value + // }); + console.log(this.data); + }, - bindSexChange: function(e) { + onSexConfirm: function (e) { + console.log("onConfirm", e); this.setData({ - sex: e.detail.value - }) + sexValue: e.detail.value, + sex: e.detail.index+'', + sexShow: false + }); }, - bindOwnerId: function(e) { + onSexCancel: function (e) { this.setData({ - ownerId: e.detail.value - }) + sexShow: false + }); }, - bindName: function(e) { + chooseSex: function (e) { this.setData({ - name: e.detail.value - }) + sexShow: true + }); }, - bindAge: function(e) { - this.setData({ - age: e.detail.value - }) - }, - bindRemark: function(e) { - this.setData({ - remark: e.detail.value - }) - }, - submitRepair: function(e) { + + submit: function(e) { let obj = { "sex": this.data.sex, "name": this.data.name, @@ -97,17 +117,21 @@ Page({ "userId": this.data.userId, "ownerTypeCd": this.data.ownerTypeCd, "age": this.data.age, - "memberId": this.data.memberId + "memberId": this.data.memberId, + "communityId": this.data.communityId, + "idCard": this.data.idCard } let msg = ""; - if (obj.ownerId == "") { - msg = "请填写业主"; - } else if (obj.name == "") { + if (obj.name == "") { msg = "请填写姓名"; } else if (obj.sex == "") { msg = "请填写性别"; + } else if (obj.idCard == "") { + msg = "请填写身份证"; } else if (obj.age == "") { msg = "请填写年龄"; + } else if (obj.link == "") { + msg = "请填写电话"; } if (msg != "") { wx.showToast({ @@ -121,20 +145,23 @@ Page({ url: constant.url.saveOwner, // http://hc.demo.winqi.cn:8012/appApi/ownerRepair.saveOwnerRepair header: context.getHeaders(), method: "POST", - data: { - "sex": "1", - "name": "1", - "link": "1", - "remark": "1", - "ownerId": "1", - "userId": "1", - "ownerTypeCd": "1002", - "age": "11", - "memberId": "1" - }, - // data:obj, //动态数据 + // data: { + // "sex": "1", + // "name": "1", + // "link": "1", + // "remark": "1", + // "ownerId": "1", + // "userId": "1", + // "ownerTypeCd": "1002", + // "age": "11", + // "memberId": "1" + // }, + data:obj, //动态数据 success: function(res) { console.log(res, 99999); + if (res.statusCode == 200){ + wx.navigateBack() + } } }); } diff --git a/pages/family/family.wxml b/pages/family/family.wxml index 9a09579..fd236db 100644 --- a/pages/family/family.wxml +++ b/pages/family/family.wxml @@ -1,99 +1,18 @@ - - - - - + 成员信息 + + + + + + + + + + + 提交 - - - - - - - - - - - - - - - - - - - - - - - - - - - {{sexArr[sex]}} - - - - - - - - - - - - - - - - - - - - - - - -