Browse Source

优化

master
zhaoyongnian 5 years ago
parent
commit
b530f40c74
  1. 2
      subpages/heart/components/cancelSignupDialog/cancelSignupDialog.wxss
  2. 121
      subpages/heart/pages/clockIn/clockIn.js
  3. 52
      subpages/heart/pages/clockIn/clockIn.wxml
  4. 13
      subpages/heart/pages/clockIn/clockIn.wxss
  5. 6
      subpages/heart/pages/leaderboard/leaderboard.wxml
  6. 66
      subpages/heart/pages/leaderboard/leaderboard.wxss
  7. 4
      subpages/integralCentre/pages/index/index.js
  8. 4
      subpages/integralCentre/pages/index/index.wxml

2
subpages/heart/components/cancelSignupDialog/cancelSignupDialog.wxss

@ -66,7 +66,7 @@
}
.notice-verify .content .note {
font-size: 24rpx;
color: #999;
color: red;
height:58rpx;
line-height: 58rpx;
}

121
subpages/heart/pages/clockIn/clockIn.js

@ -23,70 +23,59 @@ Page({
effectiveFlag: Number, //打卡是否有效(0-否,1-是)
phraseList: [], //常用于列表
phraseId: "", //常用语id
ldata: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
var that = this;
const qqmapsdk = new QQMapWX({
key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ'
})
if (options.currentUserStatus == "4") { //0-打卡
this.setData({
that.setData({
clockType: 0
})
} else { //更新打卡
this.setData({
that.setData({
clockType: 1
})
}
this.setData({
that.setData({
qqmapsdk,
id: options.id,
effectiveFlag: 1
})
this.getPhraseList(); //常用语列表
this.getPosition();
this.clockAddressDetail();
},
getPhraseList() {
let that = this;
api.getPhraseList().then(function(res) { //常用语列表
console.log('常用语列表:' + JSON.stringify(res.data))
that.setData({
phraseList: res.data,
})
})
},
toOperationDesc(phrase) { //常用于点击事件
// console.log(phrase.currentTarget.dataset.phrase)
this.setData({
operationDesc: this.data.operationDesc + phrase.currentTarget.dataset.phrase,
phraseId: phrase.currentTarget.dataset.id
})
// console.log(phrase.currentTarget.dataset.phrase)
that.getPhraseList(); //常用语列表
that.getPosition();
that.clockAddressDetail();
that.getPosition()
},
//获取经纬度
getPosition() {
var that = this;
wx.showLoading({
title: '正在获取位置',
})
wx.getLocation({
type: 'gcj02',
success: (res) => {
this.reverseGeocoder(res)
this.setData({
location: {
locationLongitude: res.longitude,
locationLatitude: res.latitude
}
that.reverseGeocoder(res)
that.setData({
ldata: false,
locationLongitude: res.longitude,
locationLatitude: res.latitude
})
},
fail: (res) => {
wx.hideLoading();
that.setData({
ldata: true
})
wx.showToast({
title: '位置获取失败,请开启手机GPS定位',
title: '位置获取失败,请开启手机GPS定位或重新授权获取位置信息',
icon: 'none',
duration: 3000
})
@ -94,6 +83,30 @@ Page({
}
})
},
handler: function(e) {
var that = this;
if (!e.detail.authSetting['scope.userLocation']) {
that.setData({
ldata: true
})
} else {
that.setData({
ldata: false,
})
wx.getLocation({
type: 'gcj02',
success: function(res) {
var latitude = res.latitude
var longitude = res.longitude
that.setData({
locationLongitude: longitude,
locationLatitude: latitude
})
}
})
}
},
// 逆地址解析
reverseGeocoder({
latitude,
@ -115,8 +128,23 @@ Page({
}
})
},
getPhraseList() {
let that = this;
api.getPhraseList().then(function(res) { //常用语列表
// console.log('常用语列表:' + JSON.stringify(res.data))
that.setData({
phraseList: res.data,
})
})
},
toOperationDesc(phrase) { //常用于点击事件
// console.log(phrase.currentTarget.dataset.phrase)
this.setData({
operationDesc: this.data.operationDesc + phrase.currentTarget.dataset.phrase,
phraseId: phrase.currentTarget.dataset.id
})
// console.log(phrase.currentTarget.dataset.phrase)
},
// 上传图片
onChange(e) {
// console.log('onChange', e)
@ -144,25 +172,19 @@ Page({
this.setData({
images: images
})
// console.log("~~~~~~@@@@@@@@" + JSON.stringify(images))
},
onSuccess(e) {
// console.log('onSuccess', e)
},
onFail(e) {
// console.log('onFail', e)
},
// 上传完成
onComplete(e) {
// console.log('onComplete', e)
wx.hideLoading()
},
// 点击图片放大
onPreview(e) {
// console.log('onPreview', e)
const {
file,
fileList
@ -215,7 +237,7 @@ Page({
if (this.data.phraseId) {
api.sagenumAddOne(this.data.phraseId).then(function(res) {
console.log('常用语言:' + res)
// console.log('常用语言:' + res)
})
}
@ -223,9 +245,11 @@ Page({
const signinLatitude = this.data.signin.signinLatitude; //纬度
var clockLongitudeMy = 0;
var clockLatitudeMy = 0;
if (this.data.location && this.data.location.locationLatitude && this.data.location.locationLongitude) {
clockLongitudeMy = this.data.location.locationLongitude; //经度
clockLatitudeMy = this.data.location.locationLatitude; //纬度
console.log(this.data.locationLatitude + '::::::::::::::' + this.data.locationLongitude)
if (this.data.locationLatitude > 0 && this.data.locationLongitude > 0) {
clockLongitudeMy = this.data.locationLongitude; //经度
clockLatitudeMy = this.data.locationLatitude; //纬度
// Lat1 Lung1 表示A点纬度和经度,Lat2 Lung2 表示B点纬度和经度;
// a = Lat1 – Lat2 为两点纬度之差 b = Lung1 - Lung2 为两点经度之差;
@ -234,13 +258,12 @@ Page({
var radLat2 = this.Rad(clockLatitudeMy);
var a = radLat1 - radLat2;
var b = this.Rad(signinLongitude) - this.Rad(clockLongitudeMy);
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
s = s * 6378.137; // EARTH_RADIUS;
s = Math.round(s * 10000) / 10000 * 1000;
//s=s.toFixed(4);
if (s > this.data.signin.clockRadius) {
s = Math.round(s * 10000) / 10000;
s = s.toFixed(4);
console.log(s + "::::::::::::::::::" + this.data.signin.clockRadius)
if (s * 1000 > this.data.signin.clockRadius) {
this.setData({
effectiveFlag: 0
})

52
subpages/heart/pages/clockIn/clockIn.wxml

@ -1,41 +1,45 @@
<view class="container">
<view class="info">
<textarea bindinput="getbindinput" value="{{operationDesc}}" placeholder="请拍摄活动图片打卡签到500字以内" maxlength="500"></textarea>
<textarea bindinput="getbindinput" value="{{operationDesc}}" placeholder="请拍摄活动图片打卡签到500字以内" maxlength="500"></textarea>
<view class="info-tips">
<view wx:for="{{phraseList}}" wx:key="{{index}}" class="tips"
bindtap="toOperationDesc"
data-phrase="{{item.phrase}}"
data-id="{{item.id}}">
<view class="info-tips">
<view wx:for="{{phraseList}}" wx:key="{{index}}" class="tips" bindtap="toOperationDesc" data-phrase="{{item.phrase}}" data-id="{{item.id}}">
<view class="spot"></view>
<view class="content display-inline">{{item.phrase}}</view>
</view>
</view>
</view>
<view class="info-line"></view>
<view class="photo">
<view class="info-line"></view>
<view class="photo">
<wux-upload listType="picture-card" defaultFileList="{{ fileList }}" max="3" count="3" url="{{BASEURL}}group/topic/upload" bind:change="onChange" bind:success="onSuccess" bind:fail="onFail" bind:complete="onComplete" bind:preview="onPreview">
<image src="../../images/uploadImg3.png"></image>
</wux-upload>
</view>
</view>
</view>
<!-- <view class="location">222</view> -->
<view class="location">
<view class="info-box">
打卡地点
</view>
<view class="info-box-last-require">
{{operationAddress}}
</view>
<view bindtap="getPosition" class="refresh">
<image src="../../images/ic_chongxindingwei.png"></image>
<view class="refresh-name">重新选定</view>
</view>
<view class="clear"></view>
<view class="location">
<view class="info-box">
打卡地点
</view>
<view class="info-box-last-require">
{{operationAddress}}
</view>
<button wx:if="{{ldata === true}}" open-type="openSetting" bindopensetting='handler' class="refresh" hover-class="hover-btn">
<image src="../../images/ic_chongxindingwei.png"></image>
<view class="refresh-name">点击授权并获取位置信息</view>
</button>
<button wx:else bindtap="getPosition" class="refresh" hover-class="hover-btn">
<image src="../../images/ic_chongxindingwei.png"></image>
<view class="refresh-name">重新选定</view>
</button>
<view class="clear"></view>
</view>
<view class="button" bindtap="submission">提交打卡</view>
<view class="button" bindtap="submission">提交打卡</view>
</view>

13
subpages/heart/pages/clockIn/clockIn.wxss

@ -154,3 +154,16 @@ textarea {
border-radius: 20rpx;
margin: 78rpx 95rpx 48rpx 95rpx;
}
button{
line-height: normal;
padding: 0 !important;
background: #fff !important;
border: 0rpx solid #fff;
position: relative;
/* position: static !important; */
width: 350rpx !important;
}
button::after{
border: none !important;
}

6
subpages/heart/pages/leaderboard/leaderboard.wxml

@ -21,7 +21,7 @@
<view class="num">1</view>
</view>
<view class="name" style="visibility: {{first.nickname ? 'visible' : 'hidden'}}">{{first.nickname}}</view>
<view class="time"style="visibility: {{first.kindnessTime ? 'visible' : 'hidden'}}">爱心时长{{first.kindnessTime}}小时</view>
<view class="time"style="visibility: {{first.kindnessTime ? 'visible' : 'hidden'}}">爱心时长{{first.kindnessTime}}分钟</view>
<view class="times" style="visibility: {{first.participationNum ? 'visible' : 'hidden'}}">参加次数{{first.participationNum}}次</view>
</view>
<view class="third order">
@ -31,7 +31,7 @@
<view class="num">3</view>
</view>
<view class="name" style="visibility: {{third.nickname ? 'visible' : 'hidden'}}">{{third.nickname}}</view>
<view class="time"style="visibility: {{third.kindnessTime ? 'visible' : 'hidden'}}">爱心时长{{third.kindnessTime}}小时</view>
<view class="time"style="visibility: {{third.kindnessTime ? 'visible' : 'hidden'}}">爱心时长{{third.kindnessTime}}分钟</view>
<view class="times" style="visibility: {{third.participationNum ? 'visible' : 'hidden'}}">参加次数{{third.participationNum}}次</view>
</view>
</view>
@ -59,7 +59,7 @@
<view class="name">{{item.nickname}}</view>
<view class="info-detail">
<image class="heart-time" src="../../images/aixin.png"></image>
<view> 爱心时长 {{item.kindnessTime}}小时</view>
<view> 爱心时长 {{item.kindnessTime}}分钟</view>
<image class="enter-times" src="../../images/bofangcishu.png"></image>
<view> 参加次数 {{item.participationNum}}次</view>
</view>

66
subpages/heart/pages/leaderboard/leaderboard.wxss

@ -5,6 +5,7 @@ page {
overflow-y: auto;
background: #f7f7f7;
}
.love-ranking {
width: 100%;
height: 100%;
@ -16,6 +17,7 @@ page {
height: 425rpx;
position: relative;
}
.love-ranking .top .top-bg {
width: 100%;
height: 100%;
@ -24,6 +26,7 @@ page {
left: 0;
top: 0;
}
.love-ranking .top .top-content {
width: 100%;
height: 100%;
@ -35,6 +38,7 @@ page {
justify-content: center;
align-items: center;
}
.love-ranking .top .top-content .order {
flex: 1;
display: flex;
@ -43,11 +47,12 @@ page {
justify-content: flex-end;
height: 100%;
}
.love-ranking .top .top-content .order .num {
width: 36rpx;
height: 36rpx;
border-radius: 50%;
text-align:center;
text-align: center;
line-height: 36rpx;
color: #333;
font-size: 28rpx;
@ -57,27 +62,33 @@ page {
left: calc(50% - 18rpx);
z-index: 20;
}
.love-ranking .top .top-content .order .name {
font-size: 32rpx;
height: 40rpx;
color: #fff;
margin: 30rpx 0 30rpx;
width: 100%;
white-space: nowrap;
/* white-space: nowrap; */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
text-overflow: ellipsis;
}
.love-ranking .top .top-content .order .time {
font-size: 22rpx;
color:#FFE065;
color: #ffe065;
line-height: 30rpx;
}
.love-ranking .top .top-content .order .times {
font-size: 22rpx;
color: #FFE065;
color: #ffe065;
line-height: 30rpx;
margin-bottom: 30rpx;
}
.love-ranking .top .top-content .first .avatar {
width: 150rpx;
height: 166rpx;
@ -86,6 +97,7 @@ page {
align-items: center;
justify-content: center;
}
.love-ranking .top .top-content .first .avatar .avatar-bg {
width: 100%;
height: 100%;
@ -94,6 +106,7 @@ page {
left: 0;
top: 0;
}
.love-ranking .top .top-content .first .avatar .avatar-content {
width: 134rpx;
height: 134rpx;
@ -103,8 +116,9 @@ page {
z-index: 10;
top: 10rpx;
}
.love-ranking .top .top-content .first .num {
background: #FEDE66;
background: #fede66;
width: 40rpx;
height: 40rpxx;
line-height: 40rpx;
@ -112,9 +126,11 @@ page {
bottom: -20rpx;
left: calc(50% - 20rpx);
}
.love-ranking .top .top-content .first .times {
margin-bottom: 50rpx
margin-bottom: 50rpx;
}
.love-ranking .top .top-content .second .avatar {
width: 108rpx;
height: 120rpx;
@ -123,6 +139,7 @@ page {
align-items: center;
justify-content: center;
}
.love-ranking .top .top-content .second .avatar .avatar-bg {
width: 100%;
height: 100%;
@ -131,6 +148,7 @@ page {
left: 0;
top: 0;
}
.love-ranking .top .top-content .second .avatar .avatar-content {
width: 92rpx;
height: 92rpx;
@ -141,9 +159,11 @@ page {
top: 8rpx;
left: 2rpx;
}
.love-ranking .top .top-content .second .num {
background: #DEDFE4;
background: #dedfe4;
}
.love-ranking .top .top-content .third .avatar {
width: 108rpx;
height: 120rpx;
@ -152,6 +172,7 @@ page {
align-items: center;
justify-content: center;
}
.love-ranking .top .top-content .third .avatar .avatar-bg {
width: 100%;
height: 100%;
@ -160,6 +181,7 @@ page {
left: 0;
top: 0;
}
.love-ranking .top .top-content .third .avatar .avatar-content {
width: 92rpx;
height: 92rpx;
@ -167,15 +189,17 @@ page {
object-fit: cover;
position: relative;
z-index: 10;
top:4rpx;
top: 4rpx;
top: 8rpx;
left: 2rpx;
}
.love-ranking .top .top-content .third .avatar .num {
background: #DAAF7C;
background: #daaf7c;
}
.love-ranking .top .top-content .third .times {
margin-bottom: 20rpx
margin-bottom: 20rpx;
}
.love-ranking .bottom {
@ -185,6 +209,7 @@ page {
box-sizing: border-box;
padding: 0 20rpx 70rpx;
}
.love-ranking .bottom .love-ranking-list {
width: 100%;
background: #fff;
@ -194,15 +219,18 @@ page {
position: relative;
top: -10rpx;
}
.love-ranking .bottom .list-item {
width: 100%;
height: 140rpx;
display: flex;
align-items: center;
}
.love-ranking .bottom .list-item + .list-item {
border-top: 1rpx solid #e5e5e5;
border-top: 1rpx solid #e5e5e5;
}
.love-ranking .bottom .list-item .num {
font-size: 36rpx;
color: #333;
@ -210,6 +238,7 @@ page {
width: 60rpx;
text-indent: 6rpx;
}
.love-ranking .bottom .list-item .avatar {
width: 90rpx;
height: 90rpx;
@ -217,23 +246,27 @@ page {
border-radius: 50%;
margin-right: 15rpx;
}
.love-ranking .bottom .list-item .info .name {
font-size: 32rpx;
color: #333;
line-height: 52rpx;
}
.love-ranking .bottom .list-item .info .info-detail {
font-size: 24rpx;
color: #999;
display: flex;
align-items: center;
}
.love-ranking .bottom .list-item .info .info-detail .heart-time {
width: 24rpx;
height: 24rpx;
object-fit: cover;
margin-right: 6rpx;
}
.love-ranking .bottom .list-item .info .info-detail .enter-times {
width: 24rpx;
height: 24rpx;
@ -242,7 +275,6 @@ page {
margin-left: 20rpx;
}
.project-nodata {
width: 100%;
height: calc(100vh - 300rpx);
@ -252,12 +284,14 @@ page {
align-items: center;
justify-content: center;
}
.project-nodata .nodata-image {
.project-nodata .nodata-image {
width: 256rpx;
height:245rpx;
height: 245rpx;
object-fit: cover;
}
.project-nodata .nodata-tip {
.project-nodata .nodata-tip {
font-size: 28rpx;
color: #bcbcbc;
height: 50rpx;

4
subpages/integralCentre/pages/index/index.js

@ -102,8 +102,8 @@ Page({
}
pointsRankinglist(para).then(res => {
that.setData({
pointsRankingUser: res.data.pointsRankingUser,
pointsRankinglist: that.data.pointsRankinglist.concat(res.data.pointsRankingTopTen),
pointsRankingUser: res.data.currentUser,
pointsRankinglist: that.data.pointsRankinglist.concat(res.data.rank),
})
if (that.data.pointsRankinglist.length > 0) {
that.setData({

4
subpages/integralCentre/pages/index/index.wxml

@ -37,8 +37,8 @@
<image class="img-bg" wx:elif="{{index == 1}}" src="../../images/second.png"></image>
<image class="img-bg" wx:elif="{{index == 2}}" src="../../images/third.png"></image>
<!-- <image class="img-bg" wx:else src="../../images/fourth.png"></image> -->
<view wx:if="{{index < 3}}" class="list-number">{{index+1}}</view>
<view wx:else class="list-number_">{{index+1}}</view>
<view wx:if="{{index < 3}}" class="list-number">{{item.rank}}</view>
<view wx:else class="list-number_">{{item.rank}}</view>
</view>
<!-- 名字 -->
<view class="list-name">{{item.nickName}}</view>

Loading…
Cancel
Save