This commit is contained in:
dong_bo0602 2022-06-07 15:43:05 +08:00
commit a1f9e23f6d
165 changed files with 19511 additions and 0 deletions

31
.eslintrc.js Normal file
View File

@ -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: {},
}

48
app.js Normal file
View File

@ -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=='
}
})

84
app.json Normal file
View File

@ -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": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}

4364
app.wxss Normal file

File diff suppressed because it is too large Load Diff

BIN
images/home-on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

BIN
images/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

BIN
images/law-on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/law.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
images/my-on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

BIN
images/my.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

BIN
images/neighbor-on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

BIN
images/neighbor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

162
pages/card/cardDetail.js Normal file
View File

@ -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() {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "创建名片"
}

View File

@ -0,0 +1,66 @@
<view class="container">
<view class="card">
<view class="photo">
<image src="../../images/photo-defalut.png" mode="heightFix" wx:if="{{!photo}}"></image>
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="heightFix" wx:else></image>
</view>
<view class="name">{{realName}}</view>
<view class="desc">{{intro}} ...</view>
<view class="phone">
<image src="../../images/card-phone.png"></image>
{{phone}}
</view>
<view class="phone position">
<image src="../../images/card-position.png"></image>
{{address}}
</view>
<view class="qr-code">
<image src="../../images/qr-code-defalut.png" wx:if="{{!qrCode}}"></image>
<image src="{{serviceUrl + baseImgUrl + qrCode}}" wx:else></image>
</view>
</view>
<view class="edite-card">
<view class="title">编辑名片</view>
<view class="card-row">
<view class="row-name">姓名:</view>
<view class="row-content">
<input type="text" placeholder="请输入姓名" model:value="{{realName}}" />
</view>
</view>
<view class="card-row">
<view class="row-name">简介:</view>
<view class="row-content">
<input type="text" placeholder="请输入简介" model:value="{{intro}}" />
</view>
</view>
<view class="card-row">
<view class="row-name">电话:</view>
<view class="row-content">
<input type="text" placeholder="请输入电话" model:value="{{phone}}" />
</view>
</view>
<view class="card-row">
<view class="row-name">位置:</view>
<view class="row-content">
<input type="text" placeholder="请输入位置" model:value="{{address}}" />
</view>
</view>
<view class="card-row">
<view class="row-name">照片:</view>
<view class="row-content">
<view class="add-photo" bindtap="choosePhoto" wx:if="{{!photo}}">+</view>
<image src="{{serviceUrl + baseImgUrl + photo}}" wx:else mode="widthFix" class="photo-img"></image>
</view>
</view>
<view class="card-row">
<view class="row-name">二维码:</view>
<view class="row-content">
<view class="add-photo" bindtap="chooseQrCode" wx:if="{{!qrCode}}">+</view>
<image src="{{serviceUrl + baseImgUrl + qrCode}}" wx:else mode="widthFix" class="qrCode-img"></image>
</view>
</view>
</view>
</view>
<view class="create-card">
<view class="create-btn" bindtap="submitCreate">创建名片</view>
</view>

121
pages/card/cardDetail.wxss Normal file
View File

@ -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;
}

71
pages/card/cardList.js Normal file
View File

@ -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() {
}
})

4
pages/card/cardList.json Normal file
View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "名片"
}

6
pages/card/cardList.wxml Normal file
View File

@ -0,0 +1,6 @@
<view class="container">
<view class="card-box" bindtap="checkDetail" data-type="1">
<image src="../../images/card-template.png" mode="widthFix"></image>
<view class="card-name">名片模板</view>
</view>
</view>

24
pages/card/cardList.wxss Normal file
View File

@ -0,0 +1,24 @@
.card-box{
margin-bottom: 20rpx;
background-color: #fff;
}
.card-box image{
width: 100%;
}
.card-name{
padding: 15rpx;
font-size: 32rpx;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "事件详情"
}

View File

@ -0,0 +1,173 @@
<view class="report">
<view class="title">
基本信息
</view>
<view class="row">
<view class="row-name">
<text>*</text>
事件类型
</view>
<view class="row-main">
{{caseDetail.caseTypeName1}}
</view>
</view>
<view class="row" wx:if="{{caseDetail.caseTypeName2}}">
<view class="row-name">
<text>*</text>
事件类型
</view>
<view class="row-main">
{{caseDetail.caseTypeName2}}
</view>
</view>
<view class="row">
<view class="row-name">
<text>*</text>
事发地区
</view>
<view class="row-main">
{{caseDetail.reportAreaName}}
</view>
</view>
<view class="row">
<view class="row-name">
<text>*</text>
事发位置
</view>
<view class="row-main">
{{caseDetail.reportLng}},{{caseDetail.reportLat}}
</view>
<view class="map">
<map scale="14" longitude="{{caseDetail.reportLng}}" latitude="{{caseDetail.reportLat}}" markers="{{markers}}" enable-zoom="false"></map>
</view>
</view>
</view>
<view class="file">
<view class="title">
详细信息
</view>
<view class="file-box">
<view class="file-title">
<text>*</text>
事件说明
</view>
<view class="file-content">
<textarea value="{{caseDetail.reportContent}}" disabled></textarea>
</view>
</view>
<view class="file-box" wx:if="{{caseDetail.reportPhotos.length > 0}}">
<view class="file-title">
事件图片
</view>
<view class="file-content">
<view class="img-box1" wx:for="{{caseDetail.reportPhotos}}" wx:key="index">
<image src="{{baseUrl + imgUrl + item}}" mode="heightFix" bindtap="previewImg" data-src="{{item}}"></image>
</view>
<!-- <view class="upload-btn">+</view> -->
</view>
</view>
<view class="file-box" wx:if="{{reportVideo}}">
<view class="file-title">
视频
</view>
<view class="file-content">
<video src="{{baseUrl + imgUrl + caseDetail.reportVideo}}"></video>
</view>
</view>
<view class="file-box voice-box" wx:if="{{reportAudio}}">
<view class="file-title voice-title">
<image src="{{sourceUrl}}voice.png" mode="widthFix"></image>
录音
</view>
<view class="record-btn" bindtap="playRecord">播放录音</view>
</view>
</view>
<view class="file" wx:if="{{caseDetail.handleStatus == '0' && caseDetail.isAccept != '-1' && caseDetail.isGridUser}}">
<view class="title">
事件处理
</view>
<view class="file-box">
<view class="file-title">
<text>*</text>
事件处理说明
</view>
<view class="file-content">
<textarea placeholder="请输入事件说明" model:value="{{content}}"></textarea>
</view>
</view>
<view class="file-box">
<view class="file-title">
事件处理图片
</view>
<view class="file-content">
<view class="img-box" wx:for="{{handleImg}}" wx:key="index">
<image src="{{baseUrl + imgUrl + item}}" mode="heightFix"></image>
<image class="delete" src="{{sourceUrl}}delete.png" bindtap="deleteSource" data-type="img" data-cur="{{index}}"></image>
<!-- <image src="../../images/delete.png" class="delete-btn" data-num="{{index}}" bindtap="deleteImg"></image> -->
</view>
<view class="upload-btn" bindtap="uploadImage" wx:if="{{handleImg.length < 9}}">+</view>
</view>
</view>
<view class="file-box">
<view class="file-title">
事件处理视频
</view>
<view class="file-content">
<view class="video-box" wx:if="{{videoId}}">
<video src="{{baseUrl + imgUrl + videoId}}"></video>
<image class="delete" src="{{sourceUrl}}delete.png" data-type="video" bindtap="deleteVideo"></image>
</view>
<view class="upload-btn" bindtap="uploadVideo" wx:else>+</view>
</view>
</view>
<!-- <view class="file-box voice-box">
<view class="file-title voice-title">
<image src="../../images/voice.png" mode="widthFix"></image>
录音
</view>
<view class="record-btn" bindlongpress="recordVoice" bindtouchend="recordEnd" wx:if="{{!audioId}}">长按录音</view>
<view class="record-btn" wx:if="{{audioId}}" bindtap="playRecord">播放录音</view>
</view> -->
<view class="handle-btn">
<view class="handle-btn-box" wx:if="{{caseDetail.isAccept != '0' && caseDetail.isAccept != '-1' && caseDetail.handleStatus == '0'}}" bindtap="handleComplete">处理完成</view>
<view class="handle-btn-box" wx:if="{{caseDetail.isAccept != '0' && caseDetail.isAccept != '-1' && caseDetail.handleStatus == '0'}}" bindtap="caseRedundancies">转派</view>
<view class="handle-btn-box" wx:if="{{caseDetail.isAccept == '0'}}" bindtap="acceptance">受理</view>
<view class="handle-btn-box" wx:if="{{caseDetail.isAccept == '0'}}" bindtap="notAcceptance">不予受理</view>
</view>
</view>
<view class="file" wx:if="{{caseDetail.handleStatus == '1'}}">
<view class="title">
事件处理
</view>
<view class="file-box">
<view class="file-title">
<text>*</text>
事件处理说明
</view>
<view class="file-content">
<textarea placeholder="请输入事件说明" value="{{handleDetail.content}}" disabled></textarea>
</view>
</view>
<view class="file-box" wx:if="{{handleDetail.photo.length > 0}}">
<view class="file-title">
事件处理图片
</view>
<view class="file-content">
<view class="img-box" wx:for="{{handleDetail.photo}}" wx:key="index">
<image src="{{baseUrl + imgUrl + item}}" mode="heightFix"></image>
</view>
</view>
</view>
<view class="file-box" wx:if="{{videoId}}">
<view class="file-title">
事件处理视频
</view>
<view class="file-content">
<view class="video-box" >
<video src="{{baseUrl + imgUrl + handleDetail.video}}"></video>
</view>
</view>
</view>
</view>

View File

@ -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%;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的上报"
}

View File

@ -0,0 +1,30 @@
<view class="list">
<view class="case-box" wx:for="{{caseList}}" wx:key="index" data-id="{{item.reportId}}" bindtap="goDetail">
<view class="top">
<view class="case-img">
<image src="{{baseUrl + imgUrl + item.reportPhotos}}" wx:if="{{item.reportPhotos}}" mode="heightFix"></image>
<image src="{{sourceUrl}}case.png" wx:else></image>
</view>
<view class="case-info">
<view class="case-text-box">
<view class="case-title">
<view class="case-title-text">{{item.caseTypeName1}}</view>
<view class="status status1">{{item.caseStatus}}</view>
</view>
<view class="case-text">编码:{{item.reportCode}}</view>
<view class="case-text">上报时间:{{item.gmtCreate}}</view>
<view class="case-text">处理结果:{{item.reportResultText}}</view>
</view>
</view>
</view>
<view class="bottom">
<image src="{{sourceUrl}}marker_red.png"></image>
{{item.reportAreaName}}
</view>
<!-- <view class="btn-box">
<view class="btn btn1" catchtap="checkLog" data-log="{{item.businessId}}">查看日志</view>
<view class="btn btn2" bindtap="doEvaluate" data-id="{{item.reportId}}" wx:if="{{item.isEvaluate == '1'}}">评价</view> -->
<!-- <view class="btn btn3">处理结果</view> -->
<!-- </view> -->
</view>
</view>

View File

@ -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;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,36 @@
<view class="log">
<view class="log-box" wx:for="{{logList}}" wx:key="index">
<view class="log-time">{{item.nodeStateTime}}</view>
<view class="log-info">
<view class="log-row">
<view class="row-name">节点名称:</view>
<view class="row-content red">{{item.nodeName}}</view>
</view>
<view class="log-row">
<view class="row-name">开始时间:</view>
<view class="row-content">{{item.nodeStateTime}}</view>
</view>
<view class="log-row" wx:if="{{item.nodeState == '1'}}">
<view class="row-name">结束时间:</view>
<view class="row-content">{{item.nodeEndTime}}</view>
</view>
<view class="log-row" wx:if="{{item.nodeState == '1'}}">
<view class="row-name">耗时:</view>
<view class="row-content red">{{item.nodeTimeConsuming}}</view>
</view>
<view class="log-row">
<view class="row-name">处理人:</view>
<view class="row-content">{{item.nodeUserName }}</view>
</view>
<view class="log-row">
<view class="row-name">处理状态:</view>
<view class="row-content red" wx:if="{{item.nodeState == '1'}}">已完成</view>
<view class="row-content red" wx:if="{{item.nodeState == '2'}}">进行中</view>
</view>
<view class="log-row" wx:if="{{item.nodeState == '1'}}">
<view class="row-name">说明:</view>
<view class="row-content">{{item.nodeSummary}}</view>
</view>
</view>
</view>
</view>

View File

@ -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;
}

387
pages/center/center.js Normal file
View File

@ -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 () {
}
})

4
pages/center/center.json Normal file
View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的"
}

107
pages/center/center.wxml Normal file
View File

@ -0,0 +1,107 @@
<view class="center-top">
<view class="user-btn">
<view class="user-info">
<image src="{{userIcon}}"></image>
<view class="user-name">
<view class="name">{{userName}}</view>
<view class="user-community">{{curCommunityName}}</view>
</view>
</view>
<view class="btn" bindtap="checkGrid">网格员认证>></view>
</view>
<!-- <view class="integral">
<view class="integral-box">
<view class="integral-count">100</view>
<view class="integral-name">积分总额</view>
</view>
<view class="integral-box">
<view class="integral-count">100</view>
<view class="integral-name">积分余额</view>
</view>
<view class="integral-box">
<view class="integral-count">100</view>
<view class="integral-name">已兑换积分</view>
</view>
</view> -->
</view>
<view class="case">
<view class="case-title no-padding">
<view class="title">上报案件</view>
<view class="more" bindtap="checkMoreCase">查看更多<image src="{{sourceUrl}}arrow-right-d.png" mode="heightFix"></image></view>
</view>
<view class="case-count">
<view class="case-count-box" bindtap="checkCaseStatus" data-status="0">
<image src="{{sourceUrl}}case-icon1.png"></image>
<view class="case-count-name">待受理</view>
</view>
<view class="case-count-box" bindtap="checkCaseStatus" data-status="1">
<image src="{{sourceUrl}}case-icon2.png"></image>
<view class="case-count-name">已受理</view>
</view>
<view class="case-count-box" bindtap="checkCaseStatus" data-status="2">
<image src="{{sourceUrl}}case-icon3.png"></image>
<view class="case-count-name">已完结</view>
</view>
</view>
</view>
<!-- <view class="case card">
<view class="case-title">
<view class="title">名片</view>
</view>
<view class="case-count">
<view class="case-count-box">
<image src="../../images/case-icon1.png"></image>
<view class="case-count-name">创建名片</view>
</view>
<view class="case-count-box">
<image src="../../images/case-icon2.png"></image>
<view class="case-count-name">我的名片</view>
</view>
</view>
</view> -->
<view class="contact" wx:if="{{gridList.length > 0}}">
<view class="case-title">
<view class="title">快速反馈</view>
<view class="more" bindtap="checkGridMore">查看更多<image src="{{sourceUrl}}arrow-right-d.png" mode="heightFix"></image></view>
</view>
<view class="contact-container">
<view class="contact-box" wx:for="{{gridList}}" wx:key="index" data-id="{{item.gridMiniId}}" bindtap="contactGrid">
<image src="{{sourceUrl}}avatar-default.png" wx:if="{{!item.photo}}"></image>
<image src="{{serviceUrl + baseImgUrl + item.photo}}" wx:else></image>
<view class="contact-name">{{item.userUserName}}</view>
<view class="contact-type">网格员</view>
<view class="contact-btn">立即联系</view>
</view>
</view>
</view>
<view class="help">
<view class="case-title help-title">
<view class="title">邻里互助</view>
<!-- <view class="more">查看更多</view> -->
</view>
<view class="help-type">
<view class="type-name">交友</view>
<view class="type-count">{{friendCount}}</view>
</view>
<view class="help-type">
<view class="type-name">求助</view>
<view class="type-count">{{helpCount}}</view>
</view>
<view class="help-type">
<view class="type-name">其他</view>
<view class="type-count">{{otherCount}}</view>
</view>
</view>
<view class="authentication" wx:if="{{showAuthentication}}">
<view class="authentication-container">
<view class="authentication-img">
<image src="{{sourceUrl}}rz-img.png" mode="widthFix"></image>
<image src="{{sourceUrl}}close-rz.png" class="close" bindtap="closeAuthentication"></image>
</view>
<view class="authentication-box">
<input type="text" placeholder="请输入用户名" model:value="{{userNameText}}"/>
<input type="password" placeholder="请输入密码" model:value="{{userPassword}}"/>
<view class="authentication-btn" bindtap="doAuthentication">立即认证</view>
</view>
</view>
</view>

232
pages/center/center.wxss Normal file
View File

@ -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;
}

93
pages/center/contact.js Normal file
View File

@ -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() {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "快速反馈"
}

13
pages/center/contact.wxml Normal file
View File

@ -0,0 +1,13 @@
<view class="contact">
<view class="contact-box" wx:for="{{gridList}}" wx:key="index" bindtap="contactGrid" data-id="{{item.gridMiniId}}">
<view class="contact-info">
<image src="{{sourceUrl}}avatar-default.png" wx:if="{{!item.photo}}"></image>
<image src="{{serviceUrl + baseImgUrl + item.photo}}" wx:else></image>
<view class="info-text">
<view class="name">{{item.userUserName}}</view>
<view class="type">网格员</view>
</view>
</view>
<view class="contact-btn">立即联系</view>
</view>
</view>

47
pages/center/contact.wxss Normal file
View File

@ -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;
}

View File

@ -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
}
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "立即联系"
}

View File

@ -0,0 +1,48 @@
<view class="top-bg"></view>
<view class="container">
<view class="card">
<view class="photo">
<image src="{{serviceUrl + baseImgUrl + gridDetail.photo}}" mode="heightFix"></image>
</view>
<view class="name">{{gridDetail.userUserName}}</view>
<!-- <view class="desc">{{intro}}</view> -->
<view class="phone">
<image src="{{sourceUrl}}card-phone.png"></image>
{{gridDetail.phone}}
</view>
<view class="phone position">
<image src="{{sourceUrl}}card-position.png"></image>
{{gridDetail.address}}
</view>
<!-- <view class="qr-code">
<image src="../../../images/qr-code-defalut.png" wx:if="{{!gridDetail.qrCode}}"></image>
<image src="{{serviceUrl + baseImgUrl + gridDetail.qrCode}}" wx:else></image>
</view> -->
</view>
<view class="card-btn">
<button open-type="share" class="card-btn-box">
<image src="{{sourceUrl}}share.png" mode="heightFix"></image>
<view class="btn-name">分享</view>
</button>
<view class="card-btn-box" bindtap="copyText" data-text="{{gridDetail.wechatNum}}">
<image src="{{sourceUrl}}wechate.png" mode="heightFix"></image>
<view class="btn-name">复制微信</view>
</view>
<view class="card-btn-box" bindtap="showCardCode">
<image src="{{sourceUrl}}card.png" mode="heightFix"></image>
<view class="btn-name">名片码</view>
</view>
</view>
<!-- <view class="intro">
<view class="intro-title">简介</view>
<view class="intro-content">阿尔巴尼斯承诺将开启“变革之旅”,以应对气候变化、生活成本上升和不平等问题。“我想抓住塑造变革的机会,以便带领人们一起踏上变革的旅程。我想把这个国...</view>
</view> -->
</view>
<view class="card-code" wx:if="{{showCode}}" bindtap="hideCardCode">
<view class="card-code-container">
<image src="{{serviceUrl + baseImgUrl + gridDetail.photo}}" class="code-photo" wx:if="{{gridDetail.photo}}"></image>
<image src="{{sourceUrl}}avatar-default1.png" class="code-photo" wx:else></image>
<view class="code-name">{{gridDetail.userUserName}}</view>
<image src="{{serviceUrl + baseImgUrl + gridDetail.qrCode}}" class="code-img" mode="widthFix"></image>
</view>
</view>

View File

@ -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;
}

96
pages/checkIn/checkIn.js Normal file
View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "党员报到"
}

View File

@ -0,0 +1,21 @@
<view class="top-img">
<image src="{{sourceUrl}}checkin-bg.png" mode="widthFix"></image>
</view>
<view class="person-info">
<view class="person-info-box">
<view class="userinfo">
<image src="{{userIcon}}"></image>
<view class="user-info">
<view class="user-name">{{name}}</view>
<view class="check-status join-btn not-check" wx:if="{{!isChecked}}">未报到</view>
<view class="check-status join-btn" wx:else>已报到</view>
</view>
</view>
<view class="checkin-btn" bindtap="doCheckIn" wx:if="{{!isChecked}}">
立即报到
</view>
</view>
</view>
<view class="affair">
<view class="affair-title">我已承办社区事务<text>(0)</text></view>
</view>

View File

@ -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;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "党员报到"
}

View File

@ -0,0 +1,92 @@
<view class="tips">
温馨提示:绑定房屋需要您在首页加入并选择您所在的社区。
</view>
<view class="community">
<view class="community-title">当前社区</view>
<view class="community-name">{{curCommunityName}}</view>
</view>
<view class="detail">
<view class="row">
<view class="row-name">姓名</view>
<view class="row-content">
<input type="text" placeholder-class="input-color" placeholder="请输入您的真实姓名" model:value="{{realName}}" />
</view>
</view>
<view class="row">
<view class="row-name">性别</view>
<view class="row-content">
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<view class="picker">
{{array[index]}}
</view>
</picker>
</view>
</view>
<view class="row">
<view class="row-name">出生日期</view>
<view class="row-content">
<picker mode="date" value="{{date}}" start="1900-01-01" end="2099-01-01" bindchange="bindDateChange">
<view class="picker">
{{date}}
</view>
</picker>
</view>
</view>
<view class="row">
<view class="row-name">入党时间</view>
<view class="row-content">
<picker mode="date" value="{{partyDate}}" start="1900-01-01" end="2099-01-01" bindchange="bindPartyDateChange">
<view class="picker">
{{partyDate}}
</view>
</picker>
</view>
</view>
<view class="row">
<view class="row-name">工作单位</view>
<view class="row-content">
<input type="text" placeholder-class="input-color" placeholder="请输入您的工作单位" model:value="{{workUnit}}" />
</view>
</view>
<view class="row">
<view class="row-name">所在居住社区</view>
<view class="row-content">
<picker bindchange="bindCommunityPickerChange" value="{{communityIndex}}" range="{{communityArray}}">
<view class="picker">
{{communityArray[communityIndex]}}
</view>
</picker>
</view>
</view>
<view class="row">
<view class="row-name">所在小区</view>
<view class="row-content">
<picker bindchange="bindNeighbourPickerChange" value="{{neighbourIndex}}" range="{{neighbourArray}}">
<view class="picker">
{{neighbourArray[neighbourIndex]}}
</view>
</picker>
</view>
</view>
<view class="row">
<view class="row-name">所在楼栋</view>
<view class="row-content">
<input type="text" placeholder-class="input-color" placeholder="请填写您的所在楼栋" model:value="{{floorNum}}" />
</view>
</view>
<view class="row">
<view class="row-name">单元/门牌号</view>
<view class="row-content">
<input type="text" placeholder-class="input-color" placeholder="请填写您所在的单元/门牌号" model:value="{{roomNum}}" />
</view>
</view>
<view class="row">
<view class="row-name">适合承办事务</view>
<view class="row-content">
<input type="text" placeholder-class="input-color" placeholder="请填写感兴趣的事务类型" model:value="{{affair}}" />
</view>
</view>
</view>
<view class="submit-join">
<view class="join-btn" bindtap="submitCheckIn">立即报到</view>
</view>

View File

@ -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;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "切换社区"
}

View File

@ -0,0 +1,37 @@
<view class="area">
<picker bindchange="bindAreaPickerChange" value="{{areaIndex}}" range="{{areaList}}">
<image src="{{sourceUrl}}position.png" mode="widthFix"></image>
<view class="picker">
{{areaList[areaIndex]}}
<image src="{{sourceUrl}}arrow-down1.png" mode="widthFix"></image>
</view>
</picker>
</view>
<view class="community">
<view class="select">选择社区</view>
<view class="current-area" bindtap="enterCurrentArea">
<view class="area-text">
<image src="{{sourceUrl}}community.png"></image>
<view>{{areaList[areaIndex]}}</view>
</view>
<view class="area-join">进入</view>
</view>
<view class="community-box" wx:for="{{communityList}}" wx:key="index" bindtap="selectCommunity" data-item="{{item}}">
<view class="community-name">
{{item.communityName}}
</view>
<view class="community-status">进入</view>
</view>
<view class="load-more" bindtap="loadMore" wx:if="{{haveMore}}">加载更多</view>
<!-- <view class="other-community" bindtap="otherCommunity">选择其他社区</view> -->
</view>
<view class="my-community">
<view class="select">我的社区</view>
<view class="community-box" wx:for="{{myCommunityList}}" wx:key="index" bindtap="selectMyCommunity" data-item="{{item}}">
<view class="community-name">
{{item.communityName}}
</view>
<view class="community-status">进入</view>
</view>
</view>

View File

@ -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;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "加入社区/村委会"
}

View File

@ -0,0 +1,48 @@
<view class="page-title">居民信息</view>
<view class="join-info">
<view class="join-row">
<view class="row-name">当前社区居委会</view>
<view class="row-content">{{communityName}}</view>
</view>
<view class="join-row">
<view class="row-name">建筑物类型</view>
<view class="row-content">
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<view class="picker">
{{array[index]}}
</view>
</picker>
</view>
</view>
<view class="join-row">
<view class="row-name">小区</view>
<view class="row-content">
<picker bindchange="bindPickerChange1" value="{{xqIndex}}" range="{{xqArray}}">
<view class="picker">
{{xqArray[xqIndex]}}
</view>
</picker>
</view>
</view>
<!-- <view class="join-row text-row">
<view class="row-name"></view>
<view class="row-content">
<input type="text" placeholder="若无您所在的小区,请在此输入小区名称" model:value="{{houseName}}" />
</view>
</view> -->
<view class="join-row">
<view class="row-name">楼栋</view>
<view class="row-content">
<input type="text" placeholder="请输入楼栋" model:value="{{floorNum}}" />
</view>
</view>
<view class="join-row">
<view class="row-name">门牌号</view>
<view class="row-content">
<input type="text" placeholder="请输入单元/门牌号" model:value="{{roomNum}}" />
</view>
</view>
</view>
<view class="submit-join">
<view class="join-btn" bindtap="submitJoin">加入</view>
</view>

View File

@ -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;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "加入社区居委会/村委会"
}

View File

@ -0,0 +1,29 @@
<view class="select">
<view class="select-box">
<view class="select-lv">选择区域</view>
<view class="select-picker">
<picker bindchange="bindAreaPickerChange" value="{{areaIndex}}" range="{{areaList}}">
<view class="picker">
{{areaList[areaIndex]}}
</view>
</picker>
</view>
</view>
<view class="select-box" wx:if="{{officeList.length > 1}}">
<view class="select-lv">选择办事处</view>
<view class="select-picker">
<picker bindchange="bindOfficePickerChange" value="{{officeIndex}}" range="{{officeList}}">
<view class="picker">
{{officeList[officeIndex]}}
</view>
</picker>
</view>
</view>
</view>
<view class="select-join" wx:if="{{committeeList.length > 0}}">
<view class="join-title">请选择社区居委会/村委会</view>
<view class="join-box" wx:for="{{committeeList}}" wx:key="index">
<view class="join-name">{{item.communityName}}</view>
<view class="border-btn joined-btn" bindtap="joinCommunity" data-item="{{item}}">加入</view>
</view>
</view>

View File

@ -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;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "所在社区"
}

View File

@ -0,0 +1,22 @@
<view class="join">
<view class="join-btn-box">社区机构入驻</view>
<view class="join-btn-box">单位/店铺入驻</view>
</view>
<view class="joined">
<view class="joined-tab">
<view class="joined-tab-box active">所在社区</view>
<view class="joined-tab-box">所在单位</view>
</view>
<view class="joined-list">
<view class="joined-box" wx:for="{{communityList}}" wx:key="index" wx:if="{{communityList.length > 0}}">
<view class="joined-name">{{item.communityName}}</view>
<view class="quit border-btn" bindtap="quitCommunity" data-id="{{item.joinCommunityId}}" data-community="{{item.communityId}}">退出</view>
</view>
<view class="no-data" wx:if="{{communityList.length == 0}}">
<image src="{{sourceUrl}}no-data.png" mode="widthFix"></image>
</view>
</view>
<view class="select-btn border-btn" bindtap="selectCommunity">
选择加入社区居委会 / 村委会
</view>
</view>

View File

@ -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;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "选择您的社区"
}

View File

@ -0,0 +1,27 @@
<view class="container">
<view class="search">
<view class="area">
<picker bindchange="bindPickerChange" value="{{index}}" range="{{areaList}}">
<view class="picker">
{{areaList[index]}}
</view>
</picker>
</view>
<view class="search-box">
<input type="text" model:value="{{keywords}}"/>
<view class="search-icon-box">
<image src="{{sourceUrl}}search.png"></image>
</view>
</view>
</view>
<view class="list">
<view class="community-box" wx:for="{{communityList}}" wx:key="index" data-item="{{item}}" bindtap="selectCommunity">
<view class="community-name">
<image src="{{sourceUrl}}community-icon.png"></image>
<view class="community-name-text">{{item.communityName}}</view>
</view>
<view class="community-join join-btn" bindtap="enterCommunity" data-location="{{item.locationCode}}" data-communityName="{{item.communityName}}" data-communityId="{{item.communityId}}">进入社区</view>
</view>
</view>
<view class="load-more" bindtap="loadMore" wx:if="{{haveMore}}">加载更多</view>
</view>

View File

@ -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;
}

345
pages/index/index.js Normal file
View File

@ -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 () {
}
})

4
pages/index/index.json Normal file
View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "首页"
}

125
pages/index/index.wxml Normal file
View File

@ -0,0 +1,125 @@
<!-- 切换社区 -->
<view class="community">
<view class="change-community" bindtap="changeCommunity">
{{curCommunityName}}
<image src="{{sourceUrl}}arrow-down.png"></image>
</view>
<view class="join-community" bindtap="joinCommunity">
加入
<image src="{{sourceUrl}}arrow-right.png"></image>
</view>
</view>
<view class="card-container">
<!-- 默认名片 -->
<view class="card" wx:if="{{!curCommunity}}">
<view class="card-area photo">
<image src="{{serviceUrl + baseImgUrl + cardInfo.photo}}" mode="heightFix"></image>
</view>
<view class="card-area name">{{cardInfo.realName}}</view>
<view class="card-area phone">
<image src="{{sourceUrl}}card-phone.png"></image>
{{cardInfo.phone}}
</view>
<view class="card-area phone position">
<image src="{{sourceUrl}}card-position.png"></image>
{{cardInfo.address}}
</view>
<view class="card-area qr-code">
<!-- <image src="../../images/qr-code-defalut.png" wx:if="{{!cardInfo.qrCode}}"></image> -->
<image src="{{serviceUrl + baseImgUrl + cardInfo.qrCode}}"></image>
</view>
</view>
<!-- 名片 -->
<view class="card" wx:else>
<view class="card-img">
<image src="{{sourceUrl}}card-img.png"></image>
</view>
<view class="card-area name white-name">{{curCommunity}}</view>
</view>
<!-- 名片按钮 -->
<!-- <view class="mid">
<button open-type="share" class="mid-box">
<view class="flex justify-between align-center" style="width:100%;">
<text style="text-align:center;line-height:30rpx;height:30rpx;font-size:28rpx;color:#CCC;">01/</text>
<image src="/images/ic_share_icon.png"></image>
</view>
<view class="mid-box-text margin-top-xs">分享名片</view>
</button>
<view class="mid-box" bindtap="includedCard">
<view class="flex justify-between align-center" style="width:100%;">
<text style="text-align:center;line-height:30rpx;height:30rpx;font-size:28rpx;color:#CCC;">02/</text>
<image src="/images/ic_phone_icon.png"></image>
</view>
<view class="mid-box-text margin-top-xs">加入卡包</view>
</view>
<view class="mid-box bg-yellow-yellow" bindtap="showBarCode">
<view class="flex justify-between align-center" style="width:100%;">
<text style="text-align:center;line-height:30rpx;height:30rpx;font-size:28rpx;color:#fff;">03/</text>
<image src="/images/ic_code_icon.png"></image>
</view>
<view class="mid-box-text-white margin-top-xs">名片码</view>
</view>
</view> -->
<!-- 名片信息 -->
<!-- <view class="good">
<view class="good-avatar">
<view class="avatar-list" wx:for="{{browUserList}}" wx:key="index" wx:for-item="user"> -->
<!-- <image src="{{user.creatorIcon}}" wx:if="{{user.creatorIcon}}"></image>
<image src="/images/ic_user_default.png" wx:if="{{!user.creatorIcon}}"></image> -->
<!-- </view>
</view>
<view class="good-click">
<view class="view-count">
<image src="/images/view-count.png" mode="scaleToFill"></image> -->
<!-- <text class="margin-left-sm text-center"> {{cardInfo.cardTemplateUseScansNumber >999? '999+' :
cardInfo.cardTemplateUseScansNumber}}</text> -->
<!-- <text class="margin-left-sm text-center">999+</text>
</view>
<view class="view-count-no">
<image src="/images/share_count.png" mode="scaleToFill"></image> -->
<!-- <text class="margin-left-sm text-center">{{cardInfo.cardTemplateUseDispatchNumber>999 ?
'999+':cardInfo.cardTemplateUseDispatchNumber}}</text> -->
<!-- <text class="margin-left-sm text-center">999+</text>
</view>
</view>
</view> -->
</view>
<!-- 跳转按钮 -->
<view class="tab">
<view class="tab-box" bindtap="doCheckIn">
<image src="{{sourceUrl}}tab-icon1.png"></image>
<view class="tab-text">党员报到</view>
</view>
<view class="tab-box" bindtap="goTalk">
<image src="{{sourceUrl}}tab-icon4.png"></image>
<view class="tab-text">微事我言</view>
</view>
<view class="tab-box">
<image src="{{sourceUrl}}tab-icon3.png" bindtap="goReport"></image>
<view class="tab-text">事件上报</view>
</view>
<view class="tab-box" bindtap="goServe">
<image src="{{sourceUrl}}tab-icon2.png"></image>
<view class="tab-text">生活服务</view>
</view>
</view>
<!-- 通知公告 -->
<view class="notice">
<view class="notice-title">
<view class="title-text">通知公告</view>
<view class="notice-more" bindtap="checkMoreNews">查看更多<image src="{{sourceUrl}}arrow-right-d.png" mode="heightFix"></image></view>
</view>
<view class="notice-box" wx:for="{{noticeList}}" wx:key="index" data-id="{{item.newsId}}" bindtap="checkNewsDetail">
<view class="notice-img">
<image src="{{serviceUrl + baseImgUrl + item.photoCover}}" mode="heightFix"></image>
</view>
<view class="notice-info">
<view class="notice-title-text cut-text">{{item.title}}</view>
<view class="notice-time cut-text">{{item.summary}}</view>
<view class="notice-from">
<view class="from">{{item.source}}</view>
<view class="date">{{item.gmtCreate}}</view>
</view>
</view>
</view>
</view>

273
pages/index/index.wxss Normal file
View File

@ -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;
}

66
pages/law/law.js Normal file
View File

@ -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 () {
}
})

4
pages/law/law.json Normal file
View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "AI法律"
}

1
pages/law/law.wxml Normal file
View File

@ -0,0 +1 @@
<web-view src="https://www.cispirit.com/IntelligentConsulting"></web-view>

1
pages/law/law.wxss Normal file
View File

@ -0,0 +1 @@
/* pages/law/law.wxss */

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "邻里圈"
}

View File

@ -0,0 +1,62 @@
<view class="help-detail">
<view class="talk-user">
<view class="user-info">
<image src="{{circleDetail.headPortrait}}"></image>
<view class="user-name">
<view class="name">{{circleDetail.nickName}}</view>
<view class="time">{{circleDetail.gmtCreate}}</view>
</view>
</view>
<view class="good" bindtap="toggleGood">
<image src="{{sourceUrl}}good-on.png" wx:if="{{isClickedGood == 'yes'}}"></image>
<image src="{{sourceUrl}}good.png" wx:else></image>
<text>{{goodCount}}</text>
</view>
</view>
<view class="talk-content">
{{circleDetail.content}}
</view>
<view class="help-type">{{circleDetail.problemTypeName}}</view>
<view class="help-photo" wx:if="{{circleDetail.photo.length > 0}}">
<view class="photo-box" wx:for="{{circleDetail.photo}}" wx:if="{{item}}" wx:key="index" bindtap="viewImg" data-id="{{item}}">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image>
</view>
</view>
<view class="help-video" wx:if="{{circleDetail.video}}">
<video src="{{serviceUrl + baseImgUrl + circleDetail.video}}"></video>
</view>
<!-- <view class="help-date">{{helpDetail.gmtCreate}}</view> -->
</view>
<!-- <view class="explain">
<view class="explain-title">补充说明</view>
<view class="explain-detail">{{circleDetail.contentSupplement}}</view>
</view> -->
<view class="reply" wx:if="{{replyList.length > 0}}">
<view class="reply-title">回复</view>
<view class="reply-box" wx:for="{{replyList}}" wx:key="index" bindtap="getFocus" data-user="{{item.userName}}" data-id="{{item.neighborCircleCommentId}}" data-name="{{item.userName}}">
<view class="talk-user">
<view class="user-info">
<image src="{{item.headPortrait}}"></image>
<view class="user-name">
<view class="name">{{item.userName}}</view>
<view class="time">{{item.gmtCreate}}</view>
</view>
</view>
<!-- <view class="good">
<image src="/images/good.png"></image>
<text>100</text>
</view> -->
</view>
<view class="talk-content">
{{item.content}}
</view>
<view class="reply-reply">
<view class="reply-row" wx:for="{{item.subCommentList}}" wx:for-item="child" catchtap="getFocus" data-user="{{child.userName}}" data-id="{{item.neighborCircleCommentId}}" data-name="{{child.userName}}">
<text>{{child.userName}}</text> 回复 <text>{{child.replyUserName}}</text> : {{child.content}}
</view>
</view>
</view>
</view>
<view class="answer">
<input type="text" model:value="{{reply}}" bindconfirm="doReply" placeholder="{{placeholder}}" model:value="{{reply}}" bindconfirm="doReply" focus="{{isGetFocus}}" bindblur="inputBlur"/>
</view>

View File

@ -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;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "邻里圈"
}

View File

@ -0,0 +1,28 @@
<view class="container">
<view class="talk-box" bindtap="checkDetail" wx:for="{{circleList}}" wx:key="index" data-id="{{item.neighborCircleId}}">
<view class="talk-user">
<view class="user-info">
<image src="{{item.headPortrait}}"></image>
<view class="user-name">
<view class="name">{{item.nickName}}</view>
<view class="time">{{item.gmtCreate}}</view>
</view>
</view>
</view>
<view class="talk-content">
{{item.content}}
</view>
<view class="help-photo" wx:if="{{item.photo.length > 0}}">
<view class="photo-box" wx:for="{{item.photo}}" wx:if="{{item}}" wx:key="index" wx:for-item="photo" bindtap="viewImg" data-id="{{item}}">
<image src="{{serviceUrl + baseImgUrl + photo}}" mode="heightFix"></image>
</view>
</view>
<view class="help-video" wx:if="{{item.video}}">
<video src="{{serviceUrl + baseImgUrl + item.video}}"></video>
</view>
<!-- <view class="talk-count">
<view class="date">2022-01-01</view>
<view class="count">0人评论</view>
</view> -->
</view>
</view>

View File

@ -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%;
}

View File

@ -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() {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "邻里圈"
}

View File

@ -0,0 +1,84 @@
<!-- <view class="help-row">
<view class="row-title">发布类型</view>
<view class="row-content">
<picker bindchange="bindPickerChange" value="{{index}}" range="{{helpType}}">
<view class="picker">
{{helpType[index]}}
</view>
</picker>
</view>
</view> -->
<view class="help-desc">
<view class="desc-title">邻里圈</view>
<textarea placeholder="请输入您要发表的内容" model:value="{{content}}"></textarea>
<view class="upload-file">
<view class="upload">
<view class="image" wx:for="{{imageList}}" wx:key="index">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image>
<image class="delete" src="{{sourceUrl}}delete.png" bindtap="deleteImg" data-cur="{{index}}"></image>
</view>
<view class="add" bindtap="uploadImage" wx:if="{{imageList.length < 9}}">
<view class="add-icon">+</view>
添加照片
</view>
</view>
</view>
<view class="upload-file">
<view class="upload">
<view class="add video" wx:if="{{videoId}}">
<video src="{{serviceUrl + baseImgUrl + videoId}}"></video>
<image class="delete" src="{{sourceUrl}}delete.png" bindtap="deleteVideo"></image>
</view>
<view class="add" bindtap="uploadVideo" wx:if="{{!videoId}}">
<view class="add-icon">+</view>
添加视频
</view>
</view>
</view>
</view>
<!-- <view class="new-help">
<view class="new-title">互助标题</view>
<view class="new-textarea">
<input type="text" placeholder="请输入标题" model:value="{{content}}"/>
</view>
<view class="new-title">互助类型</view>
<view class="new-textarea">
<picker bindchange="bindPickerChange" value="{{index}}" range="{{helpType}}">
<view class="picker">
{{helpType[index]}}
</view>
</picker>
</view>
<view class="new-title">补充说明</view>
<view class="new-textarea">
<textarea placeholder="请输入补充说明" model:value="{{contentSupplement}}"></textarea>
</view>
<view class="upload-file">
<view class="upload-title">上传图片</view>
<view class="upload">
<view class="add image" wx:for="{{imageList}}" wx:key="index">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image>
<image class="delete" src="../../../images/delete.png" bindtap="deleteImg" data-cur="{{index}}"></image>
</view>
<view class="add" bindtap="uploadImage" wx:if="{{imageList.length < 9}}">+</view>
</view>
</view>
<view class="upload-file">
<view class="upload-title">上传视频</view>
<view class="upload">
<view class="add video" wx:if="{{videoId}}">
<video src="{{serviceUrl + baseImgUrl + videoId}}"></video>
<image class="delete" src="../../../images/delete.png" bindtap="deleteVideo"></image>
</view>
<view class="add" bindtap="uploadVideo" wx:if="{{!videoId}}">+</view>
</view>
</view>
</view> -->
<view class="submit">
<view class="submit-btn join-btn" bindtap="submitHelp">发布</view>
</view>

View File

@ -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;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "邻里互助"
}

View File

@ -0,0 +1,61 @@
<view class="help-detail">
<view class="talk-user">
<view class="user-info">
<image src="{{helpDetail.headPortrait}}"></image>
<view class="user-name">
<view class="name">{{helpDetail.nickName}}</view>
<view class="time">{{helpDetail.gmtCreate}}</view>
</view>
</view>
<!-- <view class="good" bindtap="clickGood">
<image src="/images/good.png"></image>
<text>100</text>
</view> -->
</view>
<view class="talk-content">
{{helpDetail.content}}
</view>
<view class="help-type">{{helpDetail.problemTypeName}}</view>
<view class="help-photo" wx:if="{{helpDetail.photo.length > 0}}">
<view class="photo-box" wx:for="{{helpDetail.photo}}" wx:if="{{item}}" wx:key="index" bindtap="viewImg" data-id="{{item}}">
<image src="{{serviceUrl + baseImgUrl + item}}" mode="heightFix"></image>
</view>
</view>
<view class="help-video" wx:if="{{helpDetail.video}}">
<video src="{{serviceUrl + baseImgUrl + helpDetail.video}}"></video>
</view>
<!-- <view class="help-date">{{helpDetail.gmtCreate}}</view> -->
</view>
<!-- <view class="explain">
<view class="explain-title">补充说明</view>
<view class="explain-detail">{{helpDetail.contentSupplement}}</view>
</view> -->
<view class="reply" wx:if="{{replyList.length > 0}}">
<view class="reply-title">回复</view>
<view class="reply-box" wx:for="{{replyList}}" wx:key="index" bindtap="getFocus" data-user="{{item.userName}}" data-id="{{item.neighborCommentId}}" data-name="{{item.userName}}" data-neighbor="{{item.neighborId}}">
<view class="talk-user">
<view class="user-info">
<image src="{{item.headPortrait}}"></image>
<view class="user-name">
<view class="name">{{item.userName}}</view>
<view class="time">{{item.gmtCreate}}</view>
</view>
</view>
<!-- <view class="good">
<image src="/images/good.png"></image>
<text>100</text>
</view> -->
</view>
<view class="talk-content">
{{item.content}}
</view>
<view class="reply-reply">
<view class="reply-row" wx:key="index" wx:for="{{item.subCommentList}}" wx:for-item="child" catchtap="getFocus" data-user="{{child.userName}}" data-id="{{item.neighborCommentId}}" data-name="{{child.userName}}" data-neighbor="{{child.neighborId}}">
<text>{{child.userName}}</text> 回复 <text>{{child.replyUserName}}</text> : {{child.content}}
</view>
</view>
</view>
</view>
<view class="answer">
<input type="text" placeholder="输入回答" model:value="{{reply}}" bindconfirm="doReply" placeholder="{{placeholder}}" model:value="{{reply}}" bindconfirm="doReply" focus="{{isGetFocus}}" bindblur="inputBlur"/>
</view>

View File

@ -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;
}

View File

@ -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 () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "邻里互助"
}

View File

@ -0,0 +1,23 @@
<view class="help-container">
<view class="help-box" bindtap="checkHelpDetail" wx:for="{{helpList}}" wx:key="index" data-id="{{item.neighborId}}">
<view class="help-user">
<image src="{{item.headPortrait}}"></image>
<view class="user-name-time">
<view class="user-name">{{item.nickName}}</view>
<view class="user-time">{{item.gmtCreate}}</view>
</view>
</view>
<view class="help-content">
{{item.content}}
</view>
<view class="help-photo" wx:if="{{item.photo.length > 0}}">
<view class="help-photo-box">
<image src="{{serviceUrl + baseImgUrl + photo}}" wx:for="{{item.photo}}" wx:for-item="photo" wx:key="photo" mode="heightFix"></image>
</view>
</view>
<view class="help-video" wx:if="{{item.video}}">
<video src="{{serviceUrl + baseImgUrl + item.video}}"></video>
</view>
</view>
</view>
<view class="load-more" bindtap="loadMore" wx:if="{{haveMore}}">加载更多</view>

View File

@ -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;
}

Some files were not shown because too many files have changed in this diff Show More