From bdf674c396ba2128eaeb3a5625a167df5c7831e6 Mon Sep 17 00:00:00 2001
From: zhaoyongnian <541231643@qq.com>
Date: Wed, 13 May 2020 15:21:37 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/personalInfo/personalInfo.js | 83 +++++----
.../components/personalInfo/personalInfo.wxml | 10 +-
.../cancelSignupDialog.wxml | 2 +-
.../cancelSignupDialog.wxss | 2 +-
subpages/heart/pages/clockIn/clockIn.js | 175 ++++++++++--------
.../heart/pages/heartDetail/heartDetail.wxml | 8 +-
.../heart/pages/leaderboard/leaderboard.wxml | 2 +-
subpages/heart/pages/volunteer/volunteer.js | 80 ++++----
subpages/heart/pages/volunteer/volunteer.wxml | 49 +++--
subpages/integralCentre/pages/index/index.js | 82 ++++----
.../integralCentre/pages/index/index.wxml | 25 ++-
.../integralCentre/pages/index/index.wxss | 30 ++-
12 files changed, 308 insertions(+), 240 deletions(-)
diff --git a/pages/complete/components/personalInfo/personalInfo.js b/pages/complete/components/personalInfo/personalInfo.js
index 0ed57e1..fd8a3fd 100644
--- a/pages/complete/components/personalInfo/personalInfo.js
+++ b/pages/complete/components/personalInfo/personalInfo.js
@@ -17,7 +17,7 @@ Component({
gridId: '' // 网格id
},
wxInfo: {
- encryptedData:'',// 完整信息的加密数据
+ encryptedData: '', // 完整信息的加密数据
iv: '', // 初始向量
wxCode: '', // 微信cod
},
@@ -36,15 +36,15 @@ Component({
},
selectedGrid: {
type: Object,
- observer: function (value) {
+ observer: function(value) {
this.setData({
gridInfo: value
})
}
}
},
- lifetimes:{
- attached () {
+ lifetimes: {
+ attached() {
this.getPersonalInfo().then(res => {
this.getGridList()
})
@@ -54,63 +54,63 @@ Component({
},
methods: {
// 身份证号 双向绑定
- bindIdentityNoInput (e) {
+ bindIdentityNoInput(e) {
this.setData({
'personalInfo.identityNo': e.detail.value
})
console.log(this.data.personalInfo)
},
// 姓名 双向绑定
- bindRealNameInput (e) {
+ bindRealNameInput(e) {
this.setData({
'personalInfo.realName': e.detail.value
})
console.log(this.data.personalInfo)
},
// 选择性别回调
- bindSexChange (e) {
+ bindSexChange(e) {
this.setData({
'personalInfo.sex': e.detail.value
})
console.log(this.data.personalInfo)
},
// 手机号 双向绑定
- bindMobileInput (e) {
+ bindMobileInput(e) {
this.setData({
'personalInfo.mobile': e.detail.value
})
console.log(this.data.personalInfo)
},
// 验证码 双向绑定
- bindSmsCodeInput (e) {
+ bindSmsCodeInput(e) {
this.setData({
'personalInfo.smsCode': e.detail.value
})
console.log(this.data.personalInfo)
},
// 路 双向绑定
- bindRoadInput (e) {
+ bindRoadInput(e) {
this.setData({
'personalInfo.road': e.detail.value
})
console.log(this.data.personalInfo)
},
// 小区 双向绑定
- bindVillageNameInput (e) {
+ bindVillageNameInput(e) {
this.setData({
'personalInfo.villageName': e.detail.value
})
console.log(this.data.personalInfo)
},
// 楼栋号-单元室 双向绑定
- bindDwellingPlaceInput (e) {
+ bindDwellingPlaceInput(e) {
this.setData({
'personalInfo.dwellingPlace': e.detail.value
})
console.log(this.data.personalInfo)
},
// 获取验证码
- getSmsCode () {
+ getSmsCode() {
if (!this.data.personalInfo.mobile) {
this.showToast('请先输入手机号')
return false
@@ -128,9 +128,9 @@ Component({
const timer = setInterval(() => {
if (num >= 1) {
this.setData({
- smsCodeText: `${num}s后重新获取`
- })
- --num
+ smsCodeText: `${num}s后重新获取`
+ })
+ --num
} else {
clearInterval(timer)
this.setData({
@@ -138,7 +138,7 @@ Component({
})
}
}, 1000)
- }).catch(err =>{
+ }).catch(err => {
console.log(err)
this.setData({
smsCodeText: '获取验证码'
@@ -146,7 +146,7 @@ Component({
})
},
// 获取手机号
- getPhoneNumber (e) {
+ getPhoneNumber(e) {
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const para = {
wxCode: '',
@@ -155,7 +155,7 @@ Component({
}
const that = this
wx.login({
- success (res) {
+ success(res) {
para.wxCode = res.code
api.getWxPhone(para).then(data => {
console.log('获取微信手机号', data)
@@ -170,14 +170,14 @@ Component({
}
},
// 获取之前完善的个人信息
- getPersonalInfo () {
+ getPersonalInfo() {
return new Promise((resolve, reject) => {
api.prepareComplete().then(res => {
console.log('获取个人信息', res)
- for(const key in this.data.personalInfo) {
+ for (const key in this.data.personalInfo) {
this.data.personalInfo[key] = res.data[key]
}
- for(const key in this.data.gridInfo) {
+ for (const key in this.data.gridInfo) {
this.data.gridInfo[key] = res.data[key]
}
this.setData({
@@ -185,7 +185,10 @@ Component({
gridInfo: this.data.gridInfo
})
if (this.data.personalInfo.partyFlag === '1') {
- this.triggerEvent('selectTabChange', {tab: 'partyMember', partyFlag: '1' })
+ this.triggerEvent('selectTabChange', {
+ tab: 'partyMember',
+ partyFlag: '1'
+ })
}
resolve(true)
}).catch(err => {
@@ -238,7 +241,7 @@ Component({
console.log('wxInfo', that.data.wxInfo)
resolve(true)
},
- fail (err) {
+ fail(err) {
reject(false)
}
})
@@ -246,20 +249,24 @@ Component({
},
// 切换网格
changeGrid() {
- this.triggerEvent('changeGrid', { gridId: this.data.gridInfo.gridId })
+ this.triggerEvent('changeGrid', {
+ gridId: this.data.gridInfo.gridId
+ })
},
// 获取当前用户所有网格
getGridList() {
- this.triggerEvent('getGridList', { gridId: this.data.gridInfo.gridId })
+ this.triggerEvent('getGridList', {
+ gridId: this.data.gridInfo.gridId
+ })
},
// 提交完善信息-从微信获取手机号方式
- submitPersonalInfoByWx () {
+ submitPersonalInfoByWx() {
if (!this.data.personalInfo.identityNo) {
if (this.data.type === 'partyMember') {
this.showToast('请输入身份证号')
return false
}
- }
+ }
if (!this.data.personalInfo.realName) {
this.showToast('请填写姓名')
return false
@@ -267,7 +274,7 @@ Component({
if (!this.data.personalInfo.sex) {
this.showToast('请选择性别')
return false
- }
+ }
if (!this.data.personalInfo.mobile) {
this.showToast('请填写手机号')
return false
@@ -277,7 +284,11 @@ Component({
// return false
// }
if (!this.data.personalInfo.road) {
- this.showToast('请填写所在街道')
+ this.showToast('请填写所在小区或所在道路')
+ return false
+ }
+ if (this.data.personalInfo.road.length > 100) {
+ this.showToast('小区或所在道路不能超过100个字')
return false
}
const para = {
@@ -406,13 +417,13 @@ Component({
}
},
// 提交完善信息,手机号输入方式
- submitPersonalInfoBySelf () {
+ submitPersonalInfoBySelf() {
if (!this.data.personalInfo.identityNo) {
if (this.data.type === 'partyMember') {
this.showToast('请输入身份证号')
return false
}
- }
+ }
if (!this.data.personalInfo.realName) {
this.showToast('请填写姓名')
return false
@@ -420,7 +431,7 @@ Component({
if (!this.data.personalInfo.sex) {
this.showToast('请选择性别')
return false
- }
+ }
if (!this.data.personalInfo.mobile) {
this.showToast('请填写手机号')
return false
@@ -558,7 +569,7 @@ Component({
}
}
},
- submitPersonalInfo () {
+ submitPersonalInfo() {
if (this.data.getMobileType === 'wx') {
this.submitPersonalInfoByWx()
} else if (this.data.getMobileType === 'self') {
@@ -566,14 +577,14 @@ Component({
}
},
// 代码简化,弹窗统一封装
- showToast (title) {
+ showToast(title) {
wx.showToast({
title: title,
icon: 'none',
duration: 2000
})
},
- changeGetMobileType () {
+ changeGetMobileType() {
let type = 'wx'
if (this.data.getMobileType === 'wx') {
type = 'self'
diff --git a/pages/complete/components/personalInfo/personalInfo.wxml b/pages/complete/components/personalInfo/personalInfo.wxml
index 1e1cba0..62ea7dc 100644
--- a/pages/complete/components/personalInfo/personalInfo.wxml
+++ b/pages/complete/components/personalInfo/personalInfo.wxml
@@ -1,5 +1,5 @@
-
+
@@ -46,7 +46,7 @@
*
手机号
-
+
@@ -69,14 +69,14 @@
居住地址
切换网格
-
+
{{gridInfo.gridName}}
-
+
+
+ 不限名额
+
+
+ {{detail.actQuota}}人
diff --git a/subpages/heart/pages/leaderboard/leaderboard.wxml b/subpages/heart/pages/leaderboard/leaderboard.wxml
index 668e5d4..c4a4144 100644
--- a/subpages/heart/pages/leaderboard/leaderboard.wxml
+++ b/subpages/heart/pages/leaderboard/leaderboard.wxml
@@ -11,7 +11,7 @@
2
{{second.nickname}}
- 爱心时长{{second.kindnessTime}}小时
+ 爱心时长{{second.kindnessTime}}分钟
参加次数{{second.participationNum}}次
diff --git a/subpages/heart/pages/volunteer/volunteer.js b/subpages/heart/pages/volunteer/volunteer.js
index 7465ae6..40fd742 100644
--- a/subpages/heart/pages/volunteer/volunteer.js
+++ b/subpages/heart/pages/volunteer/volunteer.js
@@ -1,5 +1,7 @@
const api = require('../../../../utils/api')
-import { $wuxDialog } from '../../../../dist/index'
+import {
+ $wuxDialog
+} from '../../../../dist/index'
const app = getApp()
Page({
@@ -7,18 +9,18 @@ Page({
* 页面的初始数据 全部为必填项
*/
data: {
- realName: '',//真实姓名
- mobile: '',//手机号
- identityNo: '',//身份证号码
- road: '',//所在道路
- villageName: '',//小区名
- dwellingPlace: '',//住处(楼栋-单元-房间)
- gridId: Number,//居住网格id
- gridName:'',
- wxCode: '',//用户unionId为空时 传入
- encryptedData: '',//用户unionId为空时 传入
- iv: '',//用户unionId为空时 传入
- introduce: '',//自我介绍
+ realName: '', //真实姓名
+ mobile: '', //手机号
+ identityNo: '', //身份证号码
+ road: '', //所在道路
+ villageName: '', //小区名
+ dwellingPlace: '', //住处(楼栋-单元-房间)
+ gridId: Number, //居住网格id
+ gridName: '',
+ wxCode: '', //用户unionId为空时 传入
+ encryptedData: '', //用户unionId为空时 传入
+ iv: '', //用户unionId为空时 传入
+ introduce: '', //自我介绍
unionIdStatus: '0',
wait: 60,
smsCode: '',
@@ -30,53 +32,53 @@ Page({
getMobileType: 'wx',
smsCodeText: '获取验证码'
},
- onLoad: function (options) {
+ onLoad: function(options) {
this.getPrepareComplete().then(res => {
this.getGridList()
})
this.checkWxUnionId()
this.getWxCode()
},
- bindRealNameInput (e) {
+ bindRealNameInput(e) {
this.setData({
realName: e.detail.value
})
},
- bindMobileInput (e) {
+ bindMobileInput(e) {
this.setData({
mobile: e.detail.value
})
},
- bindSmsCodeInput (e) {
+ bindSmsCodeInput(e) {
this.setData({
smsCode: e.detail.value
})
},
- bindIdentityNoInput (e) {
+ bindIdentityNoInput(e) {
this.setData({
identityNo: e.detail.value
})
},
- adInputStreet (e) {
+ adInputStreet(e) {
this.setData({
road: e.detail.value
})
},
- adInputCommunity (e) {
+ adInputCommunity(e) {
this.setData({
villageName: e.detail.value
})
},
- adInputBuilding (e) {
+ adInputBuilding(e) {
this.setData({
dwellingPlace: e.detail.value
})
},
- adInputIntroduce (e) {
+ adInputIntroduce(e) {
this.setData({
introduce: e.detail.value
})
@@ -112,9 +114,9 @@ Page({
encryptedData: e.detail.encryptedData,
iv: e.detail.iv
})
- if (e.detail.iv){
+ if (e.detail.iv) {
this.submission()
- }else{
+ } else {
wx.showToast({
title: '您拒绝了获取信息,无法完成认证',
icon: 'none',
@@ -182,7 +184,7 @@ Page({
this.showToast('请输入身份证号')
return false
}
- if(this.data.getMobileType === 'wx') {
+ if (this.data.getMobileType === 'wx') {
if (!this.data.mobile) {
this.showToast('请获取手机号')
return false
@@ -198,11 +200,11 @@ Page({
}
}
if (!this.data.road) {
- this.showToast('请输入所在道路')
- return false
+ this.showToast('请填写所在小区或所在道路')
+ return false
}
if (this.data.road.length > 100) {
- this.showToast('所在小区不能超过100个字')
+ this.showToast('小区或所在道路不能超过100个字')
return false
}
if (!this.data.introduce) {
@@ -231,7 +233,7 @@ Page({
wx.showLoading({
title: '正在提交',
})
- api.authenticate(params).then( res => {
+ api.authenticate(params).then(res => {
wx.hideLoading()
let state = res.data.userState
@@ -248,12 +250,12 @@ Page({
})
})
},
- confirmDialog () {
+ confirmDialog() {
wx.navigateBack({
delta: 1
})
},
- changeGetMobileType () {
+ changeGetMobileType() {
let type = 'wx'
if (this.data.getMobileType === 'wx') {
type = 'self'
@@ -265,7 +267,7 @@ Page({
})
},
// 获取验证码
- getSmsCode () {
+ getSmsCode() {
if (!this.data.mobile) {
this.showToast('请先输入手机号')
return false
@@ -283,9 +285,9 @@ Page({
const timer = setInterval(() => {
if (num >= 1) {
this.setData({
- smsCodeText: `${num}s后重新获取`
- })
- --num
+ smsCodeText: `${num}s后重新获取`
+ })
+ --num
} else {
clearInterval(timer)
this.setData({
@@ -293,7 +295,7 @@ Page({
})
}
}, 1000)
- }).catch(err =>{
+ }).catch(err => {
console.log(err)
this.setData({
smsCodeText: '获取验证码'
@@ -301,7 +303,7 @@ Page({
})
},
// 获取手机号
- getPhoneNumber (e) {
+ getPhoneNumber(e) {
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const para = {
wxCode: '',
@@ -310,7 +312,7 @@ Page({
}
const that = this
wx.login({
- success (res) {
+ success(res) {
para.wxCode = res.code
api.getWxPhone(para).then(data => {
console.log('获取微信手机号', data)
@@ -325,7 +327,7 @@ Page({
}
},
// 代码简化,弹窗统一封装
- showToast (title) {
+ showToast(title) {
wx.showToast({
title: title,
icon: 'none',
diff --git a/subpages/heart/pages/volunteer/volunteer.wxml b/subpages/heart/pages/volunteer/volunteer.wxml
index ffc6fdf..52e7cb3 100644
--- a/subpages/heart/pages/volunteer/volunteer.wxml
+++ b/subpages/heart/pages/volunteer/volunteer.wxml
@@ -4,7 +4,7 @@
-
+
-
-
- *
- 身份证号
-
-
-
+
+
+ *
+ 身份证号
+
+
+
+
-
*
@@ -45,7 +45,7 @@
*
手机号
-
+
@@ -61,7 +61,7 @@
- {{getMobileType === 'wx' ? '*如若获取手机号异常,请点击切换至手机号/验证码注册方式' : '*点击可切回至从微信获取手机号注册方式'}}
+ {{getMobileType === 'wx' ? '*如若获取手机号异常,请点击切换至手机号/验证码注册方式' : '*点击可切回至从微信获取手机号注册方式'}}
@@ -79,7 +79,7 @@
-
+
@@ -110,28 +110,21 @@
-
+
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
\ No newline at end of file
diff --git a/subpages/integralCentre/pages/index/index.js b/subpages/integralCentre/pages/index/index.js
index 2e8d0c3..3393ff8 100644
--- a/subpages/integralCentre/pages/index/index.js
+++ b/subpages/integralCentre/pages/index/index.js
@@ -50,10 +50,11 @@ Page({
this.setData({
pageIndex: 1,
pageSize: 15,
- loadMoreType: 'none',
- loadMoreVisible: false,
+ loadMoreType: 'loading',
+ loadMoreVisible: true,
pointsRecordlist: [],
pointsRankinglist: [],
+ pointsRankingUser: {},//当前用户排名信息
selectTab: e.currentTarget.dataset.tab,
nodatapointsRecord: false,
nodatapointsRanking: false,
@@ -81,76 +82,81 @@ Page({
pageIndex: 1,
pageSize: 15,
timestamp: this.data.timestamp,
- loadMoreType: 'none',
- loadMoreVisible: false,
pointsRankinglist: [],
nodatapointsRanking: false,
+ loadMoreType: 'loading',
+ loadMoreVisible: true,
})
that.pointsRankinglist()
},
-
- // 获取事件详情
- pointsRecordlist() {
+ // 积分记录-积分排行接口
+ pointsRankinglist() {
let that = this
const para = {
- pageIndex: this.data.pageIndex,
- pageSize: this.data.pageSize,
+ pageIndex: 1,
+ pageSize: 10,
timestamp: this.data.timestamp,
+ rankingType: this.data.rankingType, //排名方式:0-周,1-月
}
- pointsRecordlist(para).then(res => {
+ pointsRankinglist(para).then(res => {
that.setData({
- pointsRecordlist: that.data.pointsRecordlist.concat(res.data),
- loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none',
+ pointsRankingUser: res.data.pointsRankingUser,
+ pointsRankinglist: that.data.pointsRankinglist.concat(res.data.pointsRankingTopTen),
})
- if (that.data.pointsRecordlist.length > 0) {
+ if (that.data.pointsRankinglist.length > 0) {
that.setData({
- nodatapointsRecord: false,
+ nodatapointsRanking: false,
+ loadMoreType: 'none',
})
} else {
that.setData({
- nodatapointsRecord: true,
+ nodatapointsRanking: true,
+ loadMoreType: 'none',
+ loadMoreVisible: false,
})
}
}).catch(err => {
that.setData({
+ pointsRankinglist: [],
+ nodatapointsRanking: true,
loadMoreType: 'none',
- pointsRecordlist: [],
- nodatapointsRecord: false,
+ loadMoreVisible: false,
})
console.log(err)
})
},
- // 积分记录-积分排行接口
- pointsRankinglist() {
+ // 积分记录-积分记录接口
+ pointsRecordlist() {
let that = this
const para = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize,
timestamp: this.data.timestamp,
- rankingType: this.data.rankingType, //排名方式:0-周,1-月
}
- pointsRankinglist(para).then(res => {
+ pointsRecordlist(para).then(res => {
that.setData({
- pointsRankinglist: that.data.pointsRankinglist.concat(res.data),
+ pointsRecordlist: that.data.pointsRecordlist.concat(res.data),
loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none',
})
- if (that.data.pointsRankinglist.length > 0) {
+ if (that.data.pointsRecordlist.length > 0) {
that.setData({
- nodatapointsRanking: false
+ nodatapointsRecord: false,
})
} else {
that.setData({
- nodatapointsRanking: true
+ nodatapointsRecord: true,
+ loadMoreVisible: false,
})
}
}).catch(err => {
that.setData({
loadMoreType: 'none',
- pointsRankinglist: [],
- nodatapointsRanking: false
+ loadMoreVisible: false,
+ pointsRecordlist: [],
+ nodatapointsRecord: true,
})
console.log(err)
})
@@ -158,6 +164,7 @@ Page({
+
/**
* 生命周期函数--监听页面初次渲染完成
*/
@@ -198,17 +205,18 @@ Page({
this.setData({
loadMoreVisible: true
})
- if (this.data.loadMoreType === 'loading') {
- this.setData({
- pageIndex: this.data.pageIndex + 1,
- pageSize: this.data.pageSize,
- timestamp: this.data.timestamp,
- nodatapointsRecord: false,
- })
- if (this.data.selectTab == 'tab1') {
- this.pointsRankinglist(); //积分排行
- } else {
+ if (this.data.selectTab == 'tab1') {
+ // this.pointsRankinglist(); //积分排行
+ } else {
+
+ if (this.data.loadMoreType === 'loading') {
+ this.setData({
+ pageIndex: this.data.pageIndex + 1,
+ pageSize: this.data.pageSize,
+ timestamp: this.data.timestamp,
+ nodatapointsRecord: false,
+ })
this.pointsRecordlist(); //初始化加载积分记录列表
}
}
diff --git a/subpages/integralCentre/pages/index/index.wxml b/subpages/integralCentre/pages/index/index.wxml
index fc71bab..bcb9e78 100644
--- a/subpages/integralCentre/pages/index/index.wxml
+++ b/subpages/integralCentre/pages/index/index.wxml
@@ -11,20 +11,34 @@
+
-
+
+
+
+
+ {{pointsRankingUser.rank}}
+
+
+ {{pointsRankingUser.nickName}}
+
+ {{pointsRankingUser.points}}
+
+
+
-
- {{index+1}}
+
+ {{index+1}}
+ {{index+1}}
{{item.nickName}}
@@ -36,14 +50,14 @@
-
+
事件名称
积分
时间
-
+
{{item.ruleDesc}}
-
@@ -52,7 +66,6 @@
-
\ No newline at end of file
diff --git a/subpages/integralCentre/pages/index/index.wxss b/subpages/integralCentre/pages/index/index.wxss
index 6e6be5e..f33a316 100644
--- a/subpages/integralCentre/pages/index/index.wxss
+++ b/subpages/integralCentre/pages/index/index.wxss
@@ -1,3 +1,6 @@
+page{
+ background: #f7f7f7;
+}
.home {
width: 100%;
height: 100%;
@@ -78,7 +81,6 @@
/* 积分记录 */
.jf-title {
- margin-top: 20rpx;
background: #fff;
height: 80rpx;
width: calc(100% - 40rpx);
@@ -157,9 +159,12 @@
}
/* 积分排行 */
-
+.Top{
+ height: 20rpx;
+ width: 100%;
+ background: #fff;
+}
.tab-item {
- margin-top: 20rpx;
background: #fff;
height: 80rpx;
width: calc(100% - 40rpx);
@@ -217,6 +222,11 @@ button::after {
justify-content: space-between;
}
+.marginTop {
+ background: #f7f7f7;
+ height: 10rpx;
+}
+
.ph-list .left {
display: flex;
align-items: center;
@@ -248,6 +258,20 @@ button::after {
font-weight: 500;
color: rgba(255, 255, 255, 1);
margin-top: 3rpx;
+ margin-left: 1rpx;
+}
+
+.list-number_ {
+ position: relative;
+ z-index: 100;
+ width: 100%;
+ height: 38rpx;
+ line-height: 38rpx;
+ text-align: center;
+ font-size: 32rpx;
+ font-weight: bold;
+ font-style: italic;
+ color: rgba(51, 51, 51, 1);
}
.left .list-name {