Browse Source

优化

master
zhaoyongnian 5 years ago
parent
commit
accee998f0
  1. 2
      components/activity/activity.wxss
  2. 4
      pages/heartNew/heartNew.wxml
  3. 2
      subpages/discussion/pages/addIssue/addIssue.wxml
  4. BIN
      subpages/heart/images/ic_jinruxiayiye@2x.png
  5. 3
      subpages/heart/pages/leaderboardNew/leaderboardNew.js
  6. 2
      subpages/heart/pages/leaderboardNew/leaderboardNew.json
  7. 2
      subpages/heart/pages/leaderboardNew/leaderboardNew.wxml
  8. 2
      subpages/heart/pages/leaderboardNew/leaderboardNew.wxss
  9. 151
      subpages/heart/pages/volunteer/volunteer.js
  10. 3
      subpages/heart/pages/volunteer/volunteer.json
  11. 35
      subpages/heart/pages/volunteer/volunteer.wxml
  12. 202
      subpages/heart/pages/volunteer/volunteer.wxss
  13. 13
      utils/api.js

2
components/activity/activity.wxss

@ -89,7 +89,7 @@
.infos .infos_times {
font-size: 24rpx;
height: 100rpx;
height: 90rpx;
overflow: hidden;
color: #a8a8a8;
}

4
pages/heartNew/heartNew.wxml

@ -65,7 +65,7 @@
精彩说说
</view>
<view class="tab tab3 {{selectedTab === 'tab3' ? 'select' : ''}}" data-tab="tab3" bindtap="tabBarChange">
志愿积分榜
志愿排行
</view>
<view class="select-bar {{selectedTab}}"></view>
</view>
@ -80,7 +80,7 @@
<view class="volunteer-box">
<volunteer-list wx:for="{{volunteerlist}}" volunteerItemObj="{{item}}" wx:for-index="index" wx:for-item="item" wx:key="{{index}}"></volunteer-list>
</view>
<view class="show">*按姓氏拼音排序</view>
<!-- <view class="show">*按姓氏拼音排序</view> -->
</view>
</block>
<!-- 精彩说说 -->

2
subpages/discussion/pages/addIssue/addIssue.wxml

@ -3,7 +3,7 @@
<view class="issue-content">
<textarea maxlength="500" value="{{issueContent}}" bindinput="bindTextareaInput">
<view class="textarea-placeholder" style="display: {{issueContent ? 'none': 'block'}}">
<view>请把您要上报的事写明白</view>
<view>把事说清楚</view>
<!-- <view>2、请提出您的诉求和希望</view> -->
</view>
</textarea>

BIN
subpages/heart/images/ic_jinruxiayiye@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

3
subpages/heart/pages/leaderboardNew/leaderboardNew.js

@ -30,7 +30,7 @@ Page({
}
],
// 积分排行榜相关
datalenght: 0,
datalenght: null,
loveRankingList: [],
preloadVisible: true,
// 列表相关
@ -90,6 +90,7 @@ Page({
})
}).catch(() => {
this.setData({
datalenght:0,
loveRankingList: [],
preloadVisible: false
})

2
subpages/heart/pages/leaderboardNew/leaderboardNew.json

@ -1,5 +1,5 @@
{
"navigationBarTitleText": "志愿积分榜",
"navigationBarTitleText": "志愿排行",
"usingComponents": {
"preload-loveranking-item": "./components/preloadLoverankingItem/preloadLoverankingItem",
"activity-item": "./components/activityItem/activityItem",

2
subpages/heart/pages/leaderboardNew/leaderboardNew.wxml

@ -1,6 +1,6 @@
<!-- tabbar -->
<view class="tab-bar">
<view class="tab tab1 {{selectTab === 'tab1' ? 'select-tab' : ''}}" data-tab="tab1" bindtap="onTabChange">志愿排行
<view class="tab tab1 {{selectTab === 'tab1' ? 'select-tab' : ''}}" data-tab="tab1" bindtap="onTabChange">排行
</view>
<view class="tab tab2 {{selectTab === 'tab2' ? 'select-tab' : ''}}" data-tab="tab2" bindtap="onTabChange">参与纪录
</view>

2
subpages/heart/pages/leaderboardNew/leaderboardNew.wxss

@ -101,7 +101,7 @@ button::after {
box-sizing: border-box;
background: #fff;
margin-top: 17rpx;
/* padding: 0 30rpx; */
padding: 0 30rpx;
}

151
subpages/heart/pages/volunteer/volunteer.js

@ -3,6 +3,8 @@ import {
$wuxDialog
} from '../../../../dist/index'
const app = getApp()
import { $wuxActionSheet } from '../../../../dist/index'
const config = require('../../../../utils/config')
Page({
/**
@ -21,6 +23,9 @@ Page({
encryptedData: '', //用户unionId为空时 传入
iv: '', //用户unionId为空时 传入
introduce: '', //自我介绍
volunteerNickname:'',//昵称
volunteerSignature:'',//签名
volunteerFaceImg:'',//头像
unionIdStatus: '0',
wait: 60,
smsCode: '',
@ -30,7 +35,8 @@ Page({
dialogConfirmText: '',
dialogCancelText: '',
getMobileType: 'wx',
smsCodeText: '获取验证码'
smsCodeText: '获取验证码',
uploadImageList: [],
},
onLoad: function(options) {
this.getPrepareComplete().then(res => {
@ -49,6 +55,11 @@ Page({
mobile: e.detail.value
})
},
nickname(e){
this.setData({
volunteerNickname: e.detail.value
})
},
bindSmsCodeInput(e) {
this.setData({
smsCode: e.detail.value
@ -83,6 +94,11 @@ Page({
introduce: e.detail.value
})
},
volunteerSignature(e) {
this.setData({
volunteerSignature: e.detail.value
})
},
// 查看用户是否完善个人信息
checkWxUnionId() {
api.checkWxUnionId().then(res => {
@ -138,7 +154,11 @@ Page({
dwellingPlace: res.data.dwellingPlace,
state: res.data.state,
gridId: res.data.gridId,
gridName: res.data.gridName
gridName: res.data.gridName,
volunteerNickname:res.data.volunteerNickname,
volunteerSignature:res.data.volunteerSignature,
volunteerFaceImg:res.data.volunteerFaceImg,
introduce:res.data.introduce
})
resolve(true)
}).catch(err => {
@ -199,6 +219,18 @@ Page({
return false
}
}
if(!this.data.volunteerFaceImg){
this.showToast('请上传头像')
return false
}
if(!this.data.volunteerNickname){
this.showToast('请输入昵称')
return false
}
if(!this.data.volunteerSignature){
this.showToast('请输入签名')
return false
}
if (!this.data.road) {
this.showToast('请填写所在小区或所在道路')
return false
@ -226,6 +258,9 @@ Page({
dwellingPlace: this.data.dwellingPlace,
gridId: this.data.gridId,
introduce: this.data.introduce,
volunteerFaceImg:this.data.volunteerFaceImg,
volunteerNickname:this.data.volunteerNickname,
volunteerSignature:this.data.volunteerSignature,
wxCode: this.data.unionIdStatus === '1' ? '' : this.data.wxCode,
encryptedData: this.data.unionIdStatus === '1' ? '' : this.data.encryptedData,
iv: this.data.unionIdStatus === '1' ? '' : this.data.iv
@ -334,4 +369,116 @@ Page({
duration: 2000
})
},
// 上传头像
// 选择图片 上传弹窗 - 上传图片方式 - 选择图片 - 上传图片 - 回调赋值
chooseImage () {
const _this = this
_this.setData({
uploadImageList: [],
})
$wuxActionSheet().showSheet({
buttons: [
{ text: '拍照' },
{ text: '从相册中获取' },
],
className: 'dialog-class',
buttonClicked(index) {
console.log(':::::::::::::'+index)
if (index === 0) {
wx.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['camera'],
success (res) {
const uploadImageList = [..._this.data.uploadImageList]
uploadImageList.push({
uploaded: false,
ossUrl: '',
imgUrl: res.tempFilePaths[0],
imageId: ++_this.data.imageId
})
_this.setData({
uploadImageList
})
wx.uploadFile({
url: `${config.BASEURL()}group/topic/upload`,
filePath: res.tempFilePaths[0],
name: 'file',
header: {
'Content-type': 'multipart/form-data'
},
success (fileRes){
uploadImageList[uploadImageList.length - 1].uploaded = true
uploadImageList[uploadImageList.length - 1].ossUrl = JSON.parse(fileRes.data).data
_this.setData({
uploadImageList
})
_this.setData({
volunteerFaceImg:uploadImageList[0].ossUrl
})
console.log('>>>>>>>>>>>'+_this.data.volunteerFaceImg)
}
})
}
})
} else if (index === 1) {
wx.chooseImage({
count: 3 - _this.data.uploadImageList.length,
sizeType: ['original', 'compressed'],
sourceType: ['album'],
success (res) {
const uploadImageList = []
const endIndex = _this.data.uploadImageList.length
res.tempFilePaths.forEach(item => {
uploadImageList.push({
uploaded: false,
ossUrl: '',
imgUrl: item,
imageId: ++_this.data.imageId
})
})
_this.setData({
uploadImageList: [..._this.data.uploadImageList,...uploadImageList]
})
uploadImageList.forEach((item, index) => {
return (function (index) {
wx.uploadFile({
url: `${config.BASEURL()}group/topic/upload`,
filePath: res.tempFilePaths[index],
name: 'file',
header: {
'Content-type': 'multipart/form-data'
},
success (fileRes){
uploadImageList[index].uploaded = true
uploadImageList[index].ossUrl = JSON.parse(fileRes.data).data
_this.data.uploadImageList = _this.data.uploadImageList.slice(0, endIndex)
_this.setData({
uploadImageList: [..._this.data.uploadImageList, ...uploadImageList]
})
// _this.data.setData({
// volunteerFaceImg:uploadImageList[0].ossUrl
// })
_this.setData({
volunteerFaceImg:uploadImageList[0].ossUrl
})
}
})
})(index)
})
}
})
}
return true
},
cancelText: '取消',
cancel() {},
destructiveButtonClicked() {},
})
},
})

3
subpages/heart/pages/volunteer/volunteer.json

@ -2,6 +2,7 @@
"navigationBarTitleText": "志愿者认证",
"usingComponents": {
"wux-dialog": "../../../../dist/dialog/index",
"coverview-dialog": "../../components/coverViewDialog/coverViewDialog"
"coverview-dialog": "../../components/coverViewDialog/coverViewDialog",
"wux-actionsheet": "../../../../dist/actionsheet/index"
}
}

35
subpages/heart/pages/volunteer/volunteer.wxml

@ -62,6 +62,34 @@
</view>
<view class="note" bindtap="changeGetMobileType">{{getMobileType === 'wx' ? '*如若获取手机号异常,请点击切换至手机号/验证码注册方式' : '*点击可切回至从微信获取手机号注册方式'}}</view>
<!-- 头像 -->
<view class="my-info magin-top">
<view class="head-portrait">
<view class="head-portrait-name">头像</view>
<view class="head-portrait-image" bindtap="chooseImage">
<image class="photo" src="{{volunteerFaceImg}}"></image>
<image class="photo-right" src="../../images/ic_jinruxiayiye@2x.png"></image>
</view>
</view>
<view class="head-portrait">
<view class="head-portrait-name">昵称</view>
<view class="nickname">
<input class="nicknameinput" bindblur="nickname" bindinput="nickname" value="{{volunteerNickname}}" placeholder-class="placeholder-style" placeholder="请输入您的昵称" />
</view>
</view>
<view class="head-portrait-last">
<view class="head-portrait-name-last">签名</view>
</view>
<view class="info-box-last-v2">
<view class="introduce">
<textarea value="{{volunteerSignature}}" placeholder="请输入您的签名" bindblur="volunteerSignature" bindinput="volunteerSignature" maxlength="20"></textarea>
</view>
</view>
</view>
<!-- 居住地址 -->
<view class="info magin-top">
<view class="info-box">
@ -71,11 +99,11 @@
<view class="clear"></view>
</view>
<view class="info-box">
<!-- <view class="info-box">
<view class="address name">
{{gridName}}
</view>
</view>
</view> -->
<view class="info-box">
<view class="address name">
@ -110,7 +138,7 @@
<view class="info-box-last">
<view class="introduce">
<textarea placeholder="请输入自我介绍、是否参加过公益活动、参加了哪些公益活动" bindblur="adInputIntroduce" bindinput="adInputIntroduce" maxlength="500"></textarea>
<textarea value="{{introduce}}" placeholder="请输入自我介绍、是否参加过公益活动、参加了哪些公益活动" bindblur="adInputIntroduce" bindinput="adInputIntroduce" maxlength="500"></textarea>
</view>
</view>
</view>
@ -128,3 +156,4 @@
<coverview-dialog bind:close="confirmDialog" bind:confirm="confirmDialog" dialogVisible="{{dialogVisible}}" title="{{dialogTitle}}" content="{{dialogContent}}" confirmText="{{dialogConfirmText}}" cancelText="{{dialogCancelText}}">
</coverview-dialog>
<wux-actionsheet id="wux-actionsheet" />

202
subpages/heart/pages/volunteer/volunteer.wxss

@ -1,24 +1,33 @@
.container{
page {
background: #f7f7f7;
}
.container {
width: 100%;
}
.top-bg{
.top-bg {
width: 100%;
height: 354rpx;
}
.top-bg image{
.top-bg image {
width: 100%;
height: 290rpx;
}
.position-absolute{
.position-absolute {
position: absolute;
top: 225rpx;
left: 20rpx;
right: 20rpx;
}
.info{
.info {
background-color: #fff;
border-radius: 20rpx;
}
.info-box {
width: 100wh;
height: auto;
@ -33,70 +42,84 @@
padding: 35rpx 0rpx;
margin: 0rpx 20rpx;
}
.info-box-last-v2 {
width: 100wh;
height: auto;
/* padding: 35rpx 0rpx; */
margin: 0rpx 20rpx;
}
.info-left{
.info-left {
width: 40%;
float: left;
word-wrap:break-word;
word-wrap: break-word;
}
.name{
font-size:34rpx;
font-family:PingFang SC;
font-weight:500;
color:rgba(51,51,51,1);
.name {
font-size: 34rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
}
.info-right{
.info-right {
width: 60%;
float: left;
text-align: right;
word-wrap:break-word;
word-wrap: break-word;
}
.address{
.address {
text-align: right;
word-wrap:break-word;
word-wrap: break-word;
}
.introduce{
.introduce {
text-align: left;
font-size:34rpx;
color:rgba(51,51,51,1);
font-size: 34rpx;
color: rgba(51, 51, 51, 1);
}
.clear{
.clear {
clear: both;
}
.red-button{
.red-button {
width: 144rpx;
height: 44rpx;
background-color: rgba(250,47,47);
background-color: rgba(250, 47, 47);
text-align: center;
line-height: 44rpx;
font-size:24rpx;
font-family:PingFang SC;
font-weight:500;
color:rgba(255,255,255,1);
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
border-radius: 15rpx;
margin-top: 5rpx;
float: right;
}
.yzm{
.yzm {
float: right;
margin-right: 36rpx;
width: 190rpx;
}
.magin-top{
.magin-top {
margin-top: 15rpx;
}
textarea {
width: auto;
width: auto;
}
.button{
background:linear-gradient(90deg,rgba(244,12,12,1),rgba(255,78,78,1));
.button {
background: linear-gradient(90deg, rgba(244, 12, 12, 1), rgba(255, 78, 78, 1));
width: 560rpx;
height: 84rpx;
font-size:36rpx;
font-weight:500;
color:rgba(255,255,255,1);
font-size: 36rpx;
font-weight: 500;
color: rgba(255, 255, 255, 1);
text-align: center;
line-height: 84rpx;
border-radius: 20rpx;
@ -109,11 +132,12 @@ width: auto;
height: 85rpx;
display: flex;
justify-content: center;
align-items:center;
align-items: center;
margin-top: 40rpx;
margin-bottom: 40rpx;
}
.submit-btn button {
background: linear-gradient(to right, #f51010, #ff4c4c);
width: 560rpx;
@ -127,6 +151,7 @@ width: auto;
padding: 0;
outline: 0;
}
.submit-btn .hover-button {
background: red;
}
@ -140,6 +165,7 @@ width: auto;
padding: 0 20rpx;
margin-top: 20rpx;
}
.basic-info .list-item {
width: 100%;
height: 100rpx;
@ -147,36 +173,44 @@ width: auto;
align-items: center;
justify-content: space-between;
}
.basic-info .list-item + .list-item {
.basic-info .list-item+.list-item {
border-top: 1rpx solid #eaeaea;
}
.basic-info .list-item .left {
display: flex;
align-items: center;
height: 100rpx;
}
.basic-info .list-item .left .must {
color: #F61616;
font-size: 30rpx;
}
.basic-info .list-item .left .title {
color: #333;
font-size: 34rpx;
}
.basic-info .list-item .right {
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
.basic-info .list-item .right.code {
width: calc(100% - 120rpx);
overflow: hidden;
}
.basic-info .list-item .right .placeholder-style {
font-size: 28rpx;
color: #999;
}
.basic-info .list-item .right input {
text-align: right;
font-size: 34rpx;
@ -184,9 +218,11 @@ width: auto;
height: 100%;
width: 100%;
}
.basic-info .list-item .right.code input {
width: calc(100% - 300rpx);
}
.basic-info .list-item .right .get-code {
padding: 0 15rpx;
height: 60rpx;
@ -198,6 +234,7 @@ width: auto;
margin: 0;
margin-left: 25rpx;
}
.basic-info .list-item .right .button-hover {
background: rgb(175, 1, 1);
}
@ -205,27 +242,35 @@ width: auto;
.basic-info .list-item.identity-no .left {
width: 160rpx;
}
.basic-info .list-item.identity-no .right {
width: calc(100% - 160rpx);
}
.basic-info .list-item.real-name .left {
width: 140rpx;
}
.basic-info .list-item.real-name .right {
width: calc(100% - 140rpx);
}
.basic-info .list-item.mobile .left {
width: 140rpx;
}
.basic-info .list-item.mobile .right {
width: calc(100% - 140rpx);
}
.basic-info .list-item.mobile .right input {
width: calc(100% - 25rpx - 200rpx);
}
.basic-info .list-item.sms-code .left {
width: 140rpx;
}
.basic-info .list-item.sms-code .right {
width: calc(100% - 140rpx);
}
@ -235,8 +280,91 @@ width: auto;
color: #999;
line-height: 62rpx;
}
.header {
color: #333;
font-size:34rpx;
font-size: 34rpx;
font-weight: bold;
}
.my-info {
background-color: #fff;
border-radius: 20rpx;
}
.head-portrait {
width: 100wh;
height: auto;
border-bottom: 1rpx solid #e7eeee;
height: 100rpx;
/* padding: 35rpx 0rpx; */
margin: 0rpx 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.head-portrait .head-portrait-name {
font-size: 34rpx;
font-weight: 500;
color: rgba(51, 51, 51, 1);
}
.head-portrait .head-portrait-image {
width: 95rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.head-portrait .head-portrait-image .photo {
border-radius: 50%;
width: 64rpx;
height: 64rpx;
}
.head-portrait .head-portrait-image .photo-right {
width: 24rpx;
height: 24rpx;
}
.nickname {
width: calc(100% - 120rpx);
height: 100%;
}
.nickname .nicknameinput {
text-align: right;
font-size: 34rpx;
color: #333;
height: 100%;
width: 100%;
}
.head-portrait-last {
width: 100wh;
height: 100rpx;
/* padding: 35rpx 0rpx; */
margin: 0rpx 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.head-portrait-last .head-portrait-name-last {
font-size: 34rpx;
font-weight: 500;
color: rgba(51, 51, 51, 1);
}
.wux-actionsheet__button {
font-size: 34rpx !important;
color: #333 !important;
}
.wux-actionsheet{
background: #999 !important;
}
/* .wux-actionsheet__group--options{
background: #fff !important;
} */

13
utils/api.js

@ -133,7 +133,7 @@ function gridLeaderRegister(mobile, smsCode, wxCode) {
function prepareComplete() {
return fly.get('app-user/user/prepareComplete', {})
return fly.get('app-user/user/getInfoById', {})
}
function sendSms(mobile) {
@ -358,11 +358,18 @@ function clock(data) {
return fly.post('heart/act/clock', data)
}
// /**
// * 志愿者认证
// */
// function authenticate(data) {
// return fly.post('app-user/volunteer/authenticate', data)
// }
/**
* 志愿者认证
* 志愿者认证 v2
*/
function authenticate(data) {
return fly.post('app-user/volunteer/authenticate', data)
return fly.post('app-user/volunteer/v2/authenticate', data)
}
/**
* 活动报名

Loading…
Cancel
Save