diff --git a/app.json b/app.json
index d0ce9ac..cb10ea8 100644
--- a/app.json
+++ b/app.json
@@ -13,7 +13,8 @@
"pages/register/register",
"pages/detail/detail",
"pages/accept/accept",
- "pages/gridLeaderRegister/gridLeaderRegister"
+ "pages/gridLeaderRegister/gridLeaderRegister",
+ "pages/heart/heart"
],
"subPackages": [
{
@@ -74,6 +75,26 @@
"pages/inviteRecord/inviteRecord",
"pages/gridManage/gridManage"
]
+ },
+ {
+ "root": "subpages/integralCentre",
+ "name": "integralCentre",
+ "pages": [
+ "pages/index/index"
+ ]
+ },
+ {
+ "root": "subpages/heart",
+ "pages": [
+ "pages/heartDetail/heartDetail",
+ "pages/leaderboard/leaderboard",
+ "pages/myNews/myNews",
+ "pages/clockIn/clockIn",
+ "pages/volunteer/volunteer",
+ "pages/signed/signed",
+ "pages/refusedOrEndedDetail/refusedOrEndedDetail",
+ "pages/cancelDetail/cancelDetail"
+ ]
}
],
"preloadRule": {
@@ -102,6 +123,44 @@
]
}
},
+ "tabBar": {
+ "color": "#666666",
+ "selectedColor": "#FF0000",
+ "backgroundColor": "#FFFFFF",
+ "borderStyle": "white",
+ "list": [
+ {
+ "pagePath": "pages/index/index",
+ "text": "首页",
+ "iconPath": "images/home.png",
+ "selectedIconPath": "images/homeSelected.png"
+ },
+ {
+ "pagePath": "pages/discussion/discussion",
+ "text": "我有事说",
+ "iconPath": "images/discuss.png",
+ "selectedIconPath": "images/discussSelected.png"
+ },
+ {
+ "pagePath": "pages/association/association",
+ "text": "党群互动",
+ "iconPath": "images/association.png",
+ "selectedIconPath": "images/association-select.png"
+ },
+ {
+ "pagePath": "pages/heart/heart",
+ "text": "初心互助",
+ "iconPath": "images/mutual.png",
+ "selectedIconPath": "images/mutualSelected.png"
+ },
+ {
+ "pagePath": "pages/mine/mine",
+ "text": "我的",
+ "iconPath": "images/mine.png",
+ "selectedIconPath": "images/mineSelected.png"
+ }
+ ]
+ },
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
diff --git a/components/activity/activity.js b/components/activity/activity.js
new file mode 100644
index 0000000..0aff0dd
--- /dev/null
+++ b/components/activity/activity.js
@@ -0,0 +1,74 @@
+var api = require('../../utils/activity.js')
+
+const app = getApp()
+Component({
+ properties: {
+ state: Number
+ },
+ data: {
+ activityList: [],
+ nomore: false
+ },
+ attached: function() {},
+ ready: function() {},
+ pageLifetimes: {
+ show: function() {},
+ },
+ methods: {
+ getActivityList(params) {
+ let that = this
+ if (params.qkdat == true) {
+ console.log('清空')
+ that.setData({
+ activityList: [],
+ nomore: false
+ })
+ }
+
+ api.getActivityList(params).then((res) => {
+ console.log(res.data)
+ that.setData({
+ activityList: that.data.activityList.concat(res.data)
+ })
+ console.log(res.data.length)
+ //数据访问成功
+ var myEventDetail = {
+ listLength: res.data.length
+ }
+ that.triggerEvent('toActDetail', myEventDetail)
+ if (res.data.length == 0) {
+ that.setData({
+ nomore: true
+ })
+ }
+ })
+ },
+
+ toActDetail(e) {
+ const id = e.currentTarget.dataset.id
+ const actcurrentstate = e.currentTarget.dataset.actcurrentstate
+ const signupflag = e.currentTarget.dataset.signupflag
+ this.triggerEvent('toActDetail', {
+ actId: id
+ })
+ wx.navigateTo({
+ url: `/subpages/heart/pages/heartDetail/heartDetail?id=${id}&actcurrentstate=${actcurrentstate}&signupflag=${signupflag}`
+ })
+ },
+ updateActivityList(params) {
+ api.getActivityList(params).then(res => {
+ console.log('详情回列表刷新数据', res)
+ const index = this.data.activityList.findIndex(item => item.id === res.data[0].id)
+ if (index > -1) {
+ this.data.activityList.splice(index, 1, res.data[0])
+ } else {
+ this.data.activityList.splice(index, 1)
+ }
+ this.setData({
+ activityList: this.data.activityList
+ })
+ })
+ }
+ }
+
+})
\ No newline at end of file
diff --git a/components/activity/activity.json b/components/activity/activity.json
new file mode 100644
index 0000000..32640e0
--- /dev/null
+++ b/components/activity/activity.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
\ No newline at end of file
diff --git a/components/activity/activity.wxml b/components/activity/activity.wxml
new file mode 100644
index 0000000..612cd3f
--- /dev/null
+++ b/components/activity/activity.wxml
@@ -0,0 +1,38 @@
+
+
+
+
+ 报名中
+ 已报满
+ 未开始
+ 进行中
+ 已结束
+
+
+ {{item.title}}
+
+
+
+ 活动时间:{{item.actStartTime}}至
+
+ {{item.actEndTime}}
+
+
+ 活动地点:{{item.actAddress}}
+
+
+
+
+ 不限名额
+ 活动名额 {{item.actQuota}}人
+ 已报名 {{item.signupNum}}人
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/activity/activity.wxss b/components/activity/activity.wxss
new file mode 100644
index 0000000..ab1f81b
--- /dev/null
+++ b/components/activity/activity.wxss
@@ -0,0 +1,160 @@
+.layout {
+ display: table;
+ width: calc(100% - 40rpx);
+ height: 276rpx;
+ border-radius: 10rpx;
+ background: #fff;
+ margin: 20rpx 20rpx 0rpx 20rpx;
+ /* flex-direction: column;
+ justify-content: space-between;
+ box-sizing: border-box; */
+}
+
+.img {
+ display: table-cell;
+ width: 220rpx;
+ padding: 20rpx 20rpx 10rpx 20rpx;
+ height: 246rpx;
+}
+
+.img .imgsrc {
+ width: 220rpx;
+ height: 246rpx;
+ background: #f1f1f1;
+ border-radius: 16rpx;
+ position: absolute;
+}
+
+.left {
+ display: table-cell;
+ padding: 20rpx 20rpx 10rpx 20rpx;
+ width: 220rpx;
+ height: 246rpx;
+ border-radius: 16rpx;
+ overflow: hidden;
+ margin-right: 20rpx;
+ position: relative;
+}
+
+.activity-image {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+
+.user-state {
+ position: absolute;
+ z-index: 999;
+ font-size: 24rpx;
+ color: #fff;
+ width: 92rpx;
+ height: 36rpx;
+ line-height: 37rpx;
+ text-align: center;
+ border-radius: 16rpx 0;
+ background: #d1d1d1;
+}
+
+.signed-logo {
+ width: 174rpx;
+ height: 118rpx;
+ right: 20rpx;
+ margin: -262rpx 20rpx 0rpx 0rpx;
+ /* object-fit: cover; *//* right: 0;
+ top: 20rpx; */
+ position: absolute;
+ z-index: 9999;
+}
+
+.infos {
+ display: table-cell;
+ padding: 20rpx 20rpx 10rpx 0rpx;
+ height: 246rpx;
+ vertical-align: top;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.infos .infos_title {
+ font-size: 36rpx;
+ line-height: 50rpx;
+ height: 100rpx;
+ overflow: hidden;
+ color: #333;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+}
+
+.infos .infos_times {
+ font-size: 24rpx;
+ height: 100rpx;
+ overflow: hidden;
+ color: #a8a8a8;
+}
+
+.infos .infos_times view {
+ height: 28rpx;
+ padding-top: 4rpx;
+ display: flex;
+ align-items: center;
+}
+
+.infos .infos_times view text {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 1;
+}
+
+.endtime {
+ text-indent: 145rpx;
+}
+
+.imgsize {
+ width: 24rpx;
+ height: 24rpx;
+}
+
+.infos .infos_nums {
+ font-size: 26rpx;
+ height: 36rpx;
+ color: #666;
+}
+
+.infos .infos_nums {
+ height: 40rpx;
+ width: 100%;
+ display: table;
+}
+
+.loadmore {
+ width: 100%;
+ text-align: center;
+ height: 50px;
+ line-height: 50px;
+ background: #f6f8f8;
+ font-size: 12px;
+ color: #999;
+}
+
+.total, .signed {
+ display: block;
+ font-size: 26rpx;
+ padding: 0px 20rpx 0px 20rpx;
+ height: 40rpx;
+ line-height: 40rpx;
+ border-radius: 20rpx;
+ margin: 10rpx 20rpx 0rpx 0rpx;
+ float: left;
+}
+
+.total {
+ background: #d9d9d9;
+ color: #666;
+}
+
+.signed {
+ background: #ffeaea;
+ color: #fc5555;
+}
diff --git a/components/nodata/nodata.js b/components/nodata/nodata.js
new file mode 100644
index 0000000..e64ee38
--- /dev/null
+++ b/components/nodata/nodata.js
@@ -0,0 +1,9 @@
+Component({
+ properties: {
+ isShow: {
+ type: Boolean
+ }
+ },
+ data: {},
+ methods: {}
+});
diff --git a/components/nodata/nodata.json b/components/nodata/nodata.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/components/nodata/nodata.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/components/nodata/nodata.wxml b/components/nodata/nodata.wxml
new file mode 100644
index 0000000..2c2f61c
--- /dev/null
+++ b/components/nodata/nodata.wxml
@@ -0,0 +1,5 @@
+
+
+
+ 暂无数据~
+
diff --git a/components/nodata/nodata.wxss b/components/nodata/nodata.wxss
new file mode 100644
index 0000000..0a74b93
--- /dev/null
+++ b/components/nodata/nodata.wxss
@@ -0,0 +1,19 @@
+/* components/nodata/nodata.wxss */
+.box{
+ width: 100%;
+ height: auto;
+ box-sizing: border-box;
+ text-align: center;
+ margin-top: 100rpx;
+}
+.image{
+ width: 450rpx;
+ height: 240rpx;
+}
+.text{
+ width: 100%;
+ height: auto;
+ font-size: 28rpx;
+ color: #BCBCBC;
+ display: block;
+}
\ No newline at end of file
diff --git a/dist/upload/index.js b/dist/upload/index.js
new file mode 100644
index 0000000..ccd67da
--- /dev/null
+++ b/dist/upload/index.js
@@ -0,0 +1 @@
+"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,a=new Array(e.length);t
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/upload/index.wxss b/dist/upload/index.wxss
new file mode 100644
index 0000000..dcbbf9c
--- /dev/null
+++ b/dist/upload/index.wxss
@@ -0,0 +1 @@
+.wux-upload{position:relative;display:block}.wux-upload:after,.wux-upload:before{display:table;content:" "}.wux-upload:after{clear:both}.wux-upload--disabled{opacity:.3}.wux-upload--picture-card .wux-upload__select{border:2rpx dashed #d9d9d9;width:156rpx;height:156rpx;border-radius:8rpx;margin:0 16rpx 16rpx 0;background-color:#fafafa;transition:border-color .3s ease;box-sizing:border-box;float:left}.wux-upload--picture-card .wux-upload__button{width:100%;height:100%;display:-ms-flexbox;display:flex;text-align:center;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;vertical-align:middle;padding:8rpx;box-sizing:border-box}.wux-upload--picture-card .wux-upload__button image{width:100%;height:100%;display:inline-block;overflow:hidden}.wux-upload--picture-card .wux-upload__files{position:relative;display:block;float:left}.wux-upload--picture-card .wux-upload__files:after,.wux-upload--picture-card .wux-upload__files:before{display:table;content:" "}.wux-upload--picture-card .wux-upload__files:after{clear:both}.wux-upload--picture-card .wux-upload__file{float:left;width:156rpx;height:156rpx;margin:0 16rpx 16rpx 0;padding:8rpx;border-radius:8rpx;border:2rpx solid #d9d9d9;position:relative;box-sizing:border-box}.wux-upload--picture-card .wux-upload__file--uploading{border-style:dashed}.wux-upload--picture-card .wux-upload__file--error{border-color:#f5222d}.wux-upload--picture-card .wux-upload__thumb{width:100%;height:100%;display:inline-block;overflow:hidden}.wux-upload--picture-card .wux-upload__remove{width:30rpx;height:30rpx;position:absolute;right:12rpx;top:12rpx;text-align:right;vertical-align:top;z-index:2;background-size:30rpx auto;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle fill-opacity='.4' fill='%23404040' cx='8' cy='8' r='8'/%3E%3Cpath d='M11.898 4.101a.345.345 0 0 0-.488 0L8 7.511l-3.411-3.41a.345.345 0 0 0-.488.488l3.411 3.41-3.41 3.412a.345.345 0 0 0 .488.488L8 8.487l3.411 3.411a.345.345 0 0 0 .488-.488L8.488 8l3.41-3.412a.344.344 0 0 0 0-.487z' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E")}
\ No newline at end of file
diff --git a/images/mutual.png b/images/mutual.png
new file mode 100644
index 0000000..064a885
Binary files /dev/null and b/images/mutual.png differ
diff --git a/images/mutualSelected.png b/images/mutualSelected.png
new file mode 100644
index 0000000..6d41aaa
Binary files /dev/null and b/images/mutualSelected.png differ
diff --git a/images/nodata.png b/images/nodata.png
new file mode 100644
index 0000000..782f95e
Binary files /dev/null and b/images/nodata.png differ
diff --git a/images/top.png b/images/top.png
new file mode 100644
index 0000000..5297436
Binary files /dev/null and b/images/top.png differ
diff --git a/pages/complete/complete.js b/pages/complete/complete.js
index 4a461e4..f1b1340 100644
--- a/pages/complete/complete.js
+++ b/pages/complete/complete.js
@@ -210,7 +210,9 @@ Page({
encryptedData: this.data.unionIdStatus === '1' ? '' : this.data.encryptedData,
iv: this.data.unionIdStatus === '1' ? '' : this.data.iv
}
- api.completeInfo(para).then(function (res) {
+ console.log(this.data.tabType)
+ if (this.data.tabType == 'tab1'){
+ api.completeResidentInfo(para).then(function (res) {
// console.log(res.data.resultCode)
wx.hideLoading()
if (res.data.resultCode == 1) {
@@ -239,6 +241,66 @@ Page({
})
}
})
+ }else{
+ api.completePartyInfo(para).then(function (res) {
+ // console.log(res.data.resultCode)
+ wx.hideLoading()
+ if (res.data.resultCode == 1) {
+ wx.showModal({
+ title: '党员认证失败',
+ showCancel: false,
+ content: res.data.resultMsg,
+ success: function (res) {
+ wx.reLaunch({
+ url: '/pages/index/index'
+ })
+ }
+ })
+ } else {
+ wx.showToast({
+ title: '认证成功',
+ icon: 'none',
+ duration: 3000,
+ complete: function () {
+ setTimeout(function () {
+ wx.reLaunch({
+ url: '/pages/index/index'
+ })
+ }, 3000);
+ }
+ })
+ }
+ })
+ }
+ // api.completeInfo(para).then(function (res) {
+ // // console.log(res.data.resultCode)
+ // wx.hideLoading()
+ // if (res.data.resultCode == 1) {
+ // wx.showModal({
+ // title: '党员认证失败',
+ // showCancel: false,
+ // content: res.data.resultMsg,
+ // success: function (res) {
+ // wx.reLaunch({
+ // url: '/pages/index/index'
+ // })
+ // }
+ // })
+ // } else {
+ // wx.showToast({
+ // title: '认证成功',
+ // icon: 'none',
+ // duration: 3000,
+ // complete: function () {
+ // setTimeout(function () {
+ // wx.reLaunch({
+ // url: '/pages/index/index'
+ // })
+ // }, 3000);
+ // }
+ // })
+ // }
+ // })
},
getSmsCode() {
console.log(this.data.mobile)
diff --git a/pages/heart/heart.js b/pages/heart/heart.js
new file mode 100644
index 0000000..3ea20bb
--- /dev/null
+++ b/pages/heart/heart.js
@@ -0,0 +1,209 @@
+var api = require('../../utils/activity.js')
+import {
+ getTimestamp
+} from '../../utils/common'
+Page({
+ data: {
+ index: 0,
+ zml: false,
+ qkdat: false,
+ loadMoreVisible: false, //false
+ loadMoreType: 'none', //loading none
+ indexPage: 1,
+ indexPage2: 1,
+ pageSize: 10,
+ tabs: [{
+ key: 'tab1',
+ title: 'Tab 1',
+ },
+ {
+ key: 'tab2',
+ title: 'Tab 2',
+ },
+ {
+ key: 'tab3',
+ title: 'Tab 3',
+ },
+ ],
+ key: '',
+ actId: '',
+ banner: [],
+ indicatorDots: false, //指示点
+ autoplay: false, //true,//自动播放
+ circular: false, //衔接滑动
+ interval: 2000, //自动播放间隔时长(ms)
+ duration: 500, //幻灯片切换时长(ms)
+ currentSwiper: 0
+ },
+ onLoad: function(options) {
+ this.getBannerList()
+ const temp = Number(options.state) + 1
+ this.setData({
+ key: 'tab' + temp,
+ index: 0 //options.state
+ })
+ let parms = {
+ pageIndex: this.data.indexPage,
+ pageSize: this.data.pageSize,
+ timestamp: getTimestamp(),
+ actType: 0,
+ qkdat: true
+ }
+ this.selectComponent("#state-0").getActivityList(parms)
+ },
+ onShow() {
+ if (this.data.key === 'tab3') {
+ this.setData({
+ key: 'tab1',
+ zml: false,
+ qkdat: true
+ })
+ let parms = {
+ pageIndex: 1,
+ pageSize: this.data.pageSize,
+ qkdat: this.data.qkdat,
+ timestamp: getTimestamp(),
+ actType: 0
+ }
+ this.selectComponent("#state-0").getActivityList(parms)
+ }
+ if (this.data.actId) {
+ this.updateActivityList()
+ }
+ },
+ onPullDownRefresh: function() {
+ this.getBannerList()
+ },
+ getBannerList: function() {
+ let that = this
+ api.bannerList().then(function(res) {
+ that.setData({
+ banner: res.data
+ })
+ wx.stopPullDownRefresh();
+ })
+ },
+ onReachBottom: function() {
+ if (this.data.key == 'tab1') {
+ this.setData({
+ index: 0
+ })
+ }
+ if (this.data.index == 0) {
+ this.setData({
+ indexPage: this.data.indexPage + 1
+ })
+ let parms = {
+ pageIndex: this.data.indexPage,
+ pageSize: this.data.pageSize,
+ timestamp: getTimestamp(),
+ actType: 0
+ }
+ this.selectComponent("#state-" + this.data.index).getActivityList(parms)
+ } else {
+ this.setData({
+ indexPage2: this.data.indexPage2 + 1
+ })
+ let parms = {
+ pageIndex: this.data.indexPage2,
+ pageSize: this.data.pageSize,
+ timestamp: getTimestamp(),
+ actType: 1
+ }
+ this.selectComponent("#state-" + this.data.index).getActivityList(parms)
+ }
+ },
+ changeProperty: function(e) {
+ var propertyName = e.currentTarget.dataset.propertyName
+ var newData = {}
+ newData[propertyName] = e.detail.value
+ this.setData(newData)
+ },
+ swiperChange: function(e) {
+ this.setData({
+ currentSwiper: e.detail.current
+ })
+ },
+ onTabsChange(e) {
+ const {
+ key
+ } = e.detail
+ const index = this.data.tabs.map((n) => n.key).indexOf(key)
+ if (index == 0) {
+ this.setData({
+ zml: false
+ })
+ } else {
+ this.setData({
+ zml: true
+ })
+ }
+ this.setData({
+ key,
+ index,
+ indexPage: 1,
+ indexPage2: 1
+ })
+ if (key == 'tab3') {
+ wx.navigateTo({
+ url: '/subpages/heart/pages/signed/signed'
+ })
+ } else {
+ let parms = {
+ pageIndex: this.data.indexPage,
+ pageSize: this.data.pageSize,
+ timestamp: getTimestamp(),
+ actType: this.data.index,
+ qkdat: true
+ }
+ this.selectComponent("#state-" + this.data.index).getActivityList(parms)
+ }
+ },
+
+ toActDetail(e) {
+ const id = e.currentTarget.dataset.id
+ wx.navigateTo({
+ url: `/subpages/heart/pages/heartDetail/heartDetail?id=${id}`
+ })
+ },
+
+ toActDetailDown(e) {
+ if (e.detail.listLength !== this.data.pageSize) {
+ this.setData({
+ loadMoreVisible: true,
+ loadMoreType: 'none',
+ })
+ }
+ this.setData({
+ actId: e.detail.actId,
+ listLength: e.detail.listLength
+ })
+ },
+ toLeaderboard() {
+ wx.navigateTo({
+ url: `/subpages/heart/pages/leaderboard/leaderboard`
+ })
+ },
+ updateActivityList() {
+ if ((this.data.key === 'tab1')) {
+ this.setData({
+ index: 0
+ })
+ } else if (this.data.key === 'tab2') {
+ this.setData({
+ index: 1
+ })
+ }
+ let params = {
+ pageIndex: 1,
+ pageSize: 10,
+ timestamp: getTimestamp(),
+ actType: this.data.index,
+ actId: this.data.actId
+ }
+ this.selectComponent("#state-" + this.data.index).updateActivityList(params)
+ this.setData({
+ actId: ''
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/heart/heart.json b/pages/heart/heart.json
new file mode 100644
index 0000000..444f042
--- /dev/null
+++ b/pages/heart/heart.json
@@ -0,0 +1,12 @@
+{
+ "navigationBarTitleText": "爱心互助",
+ "usingComponents": {
+ "wux-tabs": "/dist/tabs/index",
+ "wux-tab": "/dist/tab/index",
+ "activity": "../../components/activity/activity",
+ "load-more": "../../components/loadMore/loadMore"
+ },
+ "enablePullDownRefresh": true,
+ "backgroundColor": "#f8f8f8",
+ "backgroundTextStyle": "dark"
+}
\ No newline at end of file
diff --git a/pages/heart/heart.wxml b/pages/heart/heart.wxml
new file mode 100644
index 0000000..0607389
--- /dev/null
+++ b/pages/heart/heart.wxml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 爱心榜
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/heart/heart.wxss b/pages/heart/heart.wxss
new file mode 100644
index 0000000..38d118e
--- /dev/null
+++ b/pages/heart/heart.wxss
@@ -0,0 +1,195 @@
+page {
+ height: 100%;
+ font-size: 32rpx;
+ line-height: 1.6;
+}
+.container{
+ width: 100vw;
+}
+.page-body{
+ padding-top: 30rpx;
+ background: #ffffff;
+}
+.page-section{
+ width: 100%;
+ margin-bottom: 60rpx;
+}
+.page-section_center{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+.page-section:last-child{
+ margin-bottom: 0;
+}
+.page-section-gap{
+ box-sizing: border-box;
+ padding: 0 30rpx;
+}
+.page-section-spacing{
+ box-sizing: border-box;
+ padding: 0 20rpx;
+}
+.page-section-title{
+ font-size: 28rpx;
+ color: #999999;
+ margin-bottom: 10rpx;
+ padding-left: 30rpx;
+ padding-right: 30rpx;
+}
+.page-section-gap .page-section-title{
+ padding-left: 0;
+ padding-right: 0;
+}
+
+.demo-text-1{
+ position: relative;
+ align-items: center;
+ justify-content: center;
+ background-color: #1AAD19;
+ color: #FFFFFF;
+ font-size: 36rpx;
+}
+.demo-text-1:before{
+ content: 'A';
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
+.demo-text-2{
+ position: relative;
+ align-items: center;
+ justify-content: center;
+ background-color: #2782D7;
+ color: #FFFFFF;
+ font-size: 36rpx;
+}
+.demo-text-2:before{
+ content: 'B';
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
+.demo-text-3{
+ position: relative;
+ align-items: center;
+ justify-content: center;
+ background-color: #F1F1F1;
+ color: #353535;
+ font-size: 36rpx;
+}
+.demo-text-3:before{
+ content: 'C';
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
+
+button{
+ margin-bottom: 30rpx;
+}
+button:last-child{
+ margin-bottom: 0;
+}
+.page-section-title{
+ padding: 0;
+}
+.swiper-item{
+ display: block;
+ height: 300rpx;
+
+}
+.banner {
+ overflow: hidden;
+ height: 300rpx;
+ display: flex;
+ width: 100%;
+ border-radius: 16rpx;
+}
+.dots {
+ display: flex;
+ justify-content: center;
+ padding-bottom: 10rpx;
+}
+
+.dots .dot {
+ width: 22rpx;
+ height: 16rpx;
+ border-radius: 8rpx;
+ margin-left: 10rpx;
+ background: #D2D5DA;
+ transition: all .3s;
+}
+
+.dots .dot.active {
+ width: 40rpx;
+ background-image: linear-gradient(90deg, #FC5555 58%, #FC5555 100%);
+}
+.page-section-title{
+ margin-top: 60rpx;
+ position: relative;
+}
+.info{
+ position: absolute;
+ right: 0;
+ color: #353535;
+ font-size: 30rpx;
+}
+.page-foot{
+ margin-top: 50rpx;
+}
+swiper{
+ height: 320rpx;
+}
+
+
+
+.tab-view{
+ height: 98rpx;
+ width: 100wh;
+ background-color: #FFFFFF;
+ margin-top: 30rpx;
+}
+.wux-tabs__tab {
+ font-size:32rpx!important;
+ color: #8393A0!important;
+}
+.wux-tabs__tab--current {
+ color:#333333!important;
+ font-weight: bold;
+ font-size: 40rpx!important;
+}
+.wux-tabs__tab-bar{
+ background: #FB3535!important;
+ height: 10rpx!important;
+ border-radius: 6rpx!important;
+ margin-top: -40rpx!important;
+ width: 80%!important;
+ margin-left: 10%!important;
+}
+.top{
+ position: absolute;
+ width: 200rpx;
+ height: 80rpx;
+ right: 20rpx;
+ margin-top: -80rpx;
+}
+.toptxt{
+ color: #8393A0;
+ line-height: 80rpx;
+}
+.imgtop{
+ width: 44rpx;
+ height: 32rpx;
+ float: left;
+ margin-top: 28rpx;
+ margin-right: 10rpx;
+}
+.topimg{
+ float: left;
+ width: 44rpx;
+ height: 32rpx;
+}
\ No newline at end of file
diff --git a/pages/mine/mine.js b/pages/mine/mine.js
index 23e8d9d..1d356d5 100644
--- a/pages/mine/mine.js
+++ b/pages/mine/mine.js
@@ -1,5 +1,7 @@
const api = require('../../utils/api')
-import { getTimestamp } from '../../utils/common'
+import {
+ getTimestamp
+} from '../../utils/common'
const app = getApp()
Page({
@@ -17,18 +19,20 @@ Page({
userInfo: {
faceImg: '',
nickname: '',
- partyFlag: ''
+ partyFlag: '',
+ points: 0,
+ grade: 0
},
completeInfoDialogVisible: false,
infoCompleted: 0
},
- onLoad () {
+ onLoad() {
this.getUserInfo()
this.setData({
infoCompleted: app.globalData.infoCompleted
})
},
- onShow () {
+ onShow() {
if (!app.globalData.previewImage) {
this.data.pageNo = 1
this.data.pageSize = 10
@@ -41,7 +45,7 @@ Page({
this.getIssueList()
} else if (this.data.selectedTabBar === 'project') {
this.getProjectList()
- } else if (this.data.selectedTabBar === 'topic') {
+ } else if (this.data.selectedTabBar === 'topic') {
this.getTopicList()
}
}
@@ -74,7 +78,7 @@ Page({
}
},
// tab 切换
- chooseTabBar (e) {
+ chooseTabBar(e) {
this.setData({
nomoreVisible: false,
nomoreStatus: 'loading',
@@ -90,13 +94,13 @@ Page({
this.getProjectList()
} else if (e.currentTarget.dataset.type === 'topic') {
this.getTopicList()
- }
+ }
this.setData({
selectedTabBar: e.currentTarget.dataset.type
})
},
// 获取 我的话题列表
- getTopicList () {
+ getTopicList() {
this.setData({
topicList: []
})
@@ -121,7 +125,7 @@ Page({
})
},
// 获取 我的话题列表 上拉加载
- loadMoreTopicList () {
+ loadMoreTopicList() {
const para = {
pageIndex: this.data.pageNo,
pageSize: this.data.pageSize
@@ -144,7 +148,7 @@ Page({
})
},
// 获取 我的议题列表
- getIssueList () {
+ getIssueList() {
this.setData({
issueList: []
})
@@ -165,7 +169,7 @@ Page({
})
},
// 获取 我的项目列表
- getProjectList () {
+ getProjectList() {
this.setData({
projectList: []
})
@@ -192,7 +196,7 @@ Page({
})
},
// 获取 我的项目列表 上拉加载
- loadMoreProjectList () {
+ loadMoreProjectList() {
const para = {
pageIndex: this.data.pageNo,
pageSize: this.data.pageSize,
@@ -200,7 +204,7 @@ Page({
}
api.getMyProjectList(para).then(res => {
console.log('我的项目列表', res)
- const projectList = [...this.data.projectList,...res.data]
+ const projectList = [...this.data.projectList, ...res.data]
this.setData({
nomoreStatus: res.data.length === 10 ? 'loading' : 'none',
preloadVisible: false,
@@ -216,11 +220,11 @@ Page({
})
},
// 获取用户信息
- getUserInfo () {
+ getUserInfo() {
api.getUserInfo().then(res => {
console.log('用户信息', res)
const userInfo = {}
- for(const key in this.data.userInfo) {
+ for (const key in this.data.userInfo) {
userInfo[key] = res.data[key]
}
this.setData({
@@ -231,21 +235,26 @@ Page({
userInfo: {
faceImg: '',
nickname: '',
- partyFlag: '0'
+ partyFlag: '0',
+ points: 0,
+ grade: 0
}
})
console.log(err)
})
},
// 完善信息
- navigateToComplete () {
+ navigateToComplete() {
wx.navigateTo({
url: '/pages/complete/complete'
})
},
// 议题列表 跳转详情
- toIssueDetail (e) {
- const { issueId, state } = e.detail
+ toIssueDetail(e) {
+ const {
+ issueId,
+ state
+ } = e.detail
if (state !== '待审核' && state !== '未通过') {
wx.navigateTo({
url: `/subpages/discussion/pages/discussionDetail/discussionDetail?type=issue&detailId=${issueId}`
@@ -257,21 +266,25 @@ Page({
}
},
// 项目列表 跳转详情
- toProjectDetail (e) {
- const { itemId } = e.detail
+ toProjectDetail(e) {
+ const {
+ itemId
+ } = e.detail
wx.navigateTo({
url: `/subpages/discussion/pages/discussionDetail/discussionDetail?type=project&detailId=${itemId}`
})
},
// 话题列表 跳转详情
- toTopicDetail (e) {
- const { topicId } = e.detail
+ toTopicDetail(e) {
+ const {
+ topicId
+ } = e.detail
wx.navigateTo({
url: `/subpages/association/pages/topicDetail/topicDetail?detailId=${topicId}`
})
},
// 我有事说
- addIssue () {
+ addIssue() {
if (this.data.infoCompleted == 0) {
this.setData({
completeInfoDialogVisible: !this.data.completeInfoDialogVisible
@@ -283,15 +296,29 @@ Page({
})
},
// 跳转到 邀请记录
- navigateToInviteRecord () {
+ navigateToInviteRecord() {
wx.navigateTo({
url: '/subpages/mine/pages/inviteRecord/inviteRecord'
})
},
// 跳转到 网格管理
- navigateToGridManage () {
+ navigateToGridManage() {
wx.navigateTo({
url: '/subpages/mine/pages/gridManage/gridManage'
})
+ },
+ //跳转到积分中心
+ navigateToIntegralCentre(e) {
+ this.getUserInfo();//防止积分变化
+ wx.navigateTo({
+ url: `/subpages/integralCentre/pages/index/index?points=` + this.data.userInfo.points
+ })
+ },
+ jqqd() {
+ wx.showToast({
+ title: '敬请期待~',
+ icon: 'none',
+ duration: 1000
+ })
}
})
\ No newline at end of file
diff --git a/pages/mine/mine.wxml b/pages/mine/mine.wxml
index e4074f3..040a008 100644
--- a/pages/mine/mine.wxml
+++ b/pages/mine/mine.wxml
@@ -25,6 +25,13 @@
+
+ 等级:{{userInfo.grade}}
+
+ 积分:{{userInfo.points}}
+
+ 积分兑换
+
+
+ {{title}}
+
+ {{item}}
+
+
+
+
+ {{cancelText}}
+ {{confirmText}}
+
+
+
\ No newline at end of file
diff --git a/subpages/heart/components/coverViewDialog/coverViewDialog.wxss b/subpages/heart/components/coverViewDialog/coverViewDialog.wxss
new file mode 100644
index 0000000..946d142
--- /dev/null
+++ b/subpages/heart/components/coverViewDialog/coverViewDialog.wxss
@@ -0,0 +1,84 @@
+.coverview-dialog {
+ width: 100%;
+ height: 100vh;
+ position: fixed;
+ z-index: 1000;
+ left: 0;
+ top: 0;
+ background: rgba(0,0,0, 0.4);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+.coverview-dialog .box {
+ padding: 0rpx 20rpx;
+ background: #fff;
+ border-radius: 16rpx;
+ overflow: hidden;
+ position: relative;
+ min-width: 490rpx;
+}
+.coverview-dialog .box .close {
+ width:100%;
+ height: 60rpx;
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+}
+.coverview-dialog .box .close cover-image {
+ width: 40rpx;
+ height: 40rpx;
+ object-fit: cover;
+ margin-right: 20rpx;
+}
+.coverview-dialog .box .title {
+ height: 60rpx;
+ line-height: 60rpx;
+ width: 100%;
+ text-align:center;
+ font-size: 36rpx;
+ color: #333;
+ margin-bottom: 23rpx;
+}
+.coverview-dialog .box .content {
+ height: auto;
+ width: 100%;
+ padding-bottom: 35rpx;
+}
+.coverview-dialog .box .content cover-view {
+ font-size: 30rpx;
+ line-height: 50rpx;
+ height: 50rpx;
+ /* width: calc(100% - 20rpx); */
+ text-align: center;
+ color: #666;
+ padding: 0 10rpx;
+}
+.coverview-dialog .box .border {
+ width: 100%;
+ height: 1rpx;
+ background: #eaeaea;
+ position: absolute;
+ left:0;
+ bottom: 105rpx;
+}
+.coverview-dialog .box .operation {
+ width: 100%;
+ height: 75rpx;
+ padding: 15rpx 0;
+ display: flex;
+ justify-content: space-around;
+ align-items: center;
+}
+.coverview-dialog .box .operation cover-view {
+ flex: 1;
+ color: #999;
+ font-size: 36rpx;
+ width: 49%;
+ height: 100%;
+ line-height: 75rpx;
+ text-align:center;
+}
+.coverview-dialog .box .operation .confirm{
+ color: #04BCA0;
+}
diff --git a/subpages/heart/images/activitytime.png b/subpages/heart/images/activitytime.png
new file mode 100644
index 0000000..38f590f
Binary files /dev/null and b/subpages/heart/images/activitytime.png differ
diff --git a/subpages/heart/images/aixin.png b/subpages/heart/images/aixin.png
new file mode 100644
index 0000000..17b21d7
Binary files /dev/null and b/subpages/heart/images/aixin.png differ
diff --git a/subpages/heart/images/bg-bottom.png b/subpages/heart/images/bg-bottom.png
new file mode 100644
index 0000000..b5000c7
Binary files /dev/null and b/subpages/heart/images/bg-bottom.png differ
diff --git a/subpages/heart/images/bg-top.png b/subpages/heart/images/bg-top.png
new file mode 100644
index 0000000..e6d8301
Binary files /dev/null and b/subpages/heart/images/bg-top.png differ
diff --git a/subpages/heart/images/bofangcishu.png b/subpages/heart/images/bofangcishu.png
new file mode 100644
index 0000000..d127f6e
Binary files /dev/null and b/subpages/heart/images/bofangcishu.png differ
diff --git a/subpages/heart/images/delete.png b/subpages/heart/images/delete.png
new file mode 100644
index 0000000..63160d8
Binary files /dev/null and b/subpages/heart/images/delete.png differ
diff --git a/subpages/heart/images/dianhua.png b/subpages/heart/images/dianhua.png
new file mode 100644
index 0000000..5289dcc
Binary files /dev/null and b/subpages/heart/images/dianhua.png differ
diff --git a/subpages/heart/images/didian.png b/subpages/heart/images/didian.png
new file mode 100644
index 0000000..b4e23d8
Binary files /dev/null and b/subpages/heart/images/didian.png differ
diff --git a/subpages/heart/images/dingdan.png b/subpages/heart/images/dingdan.png
new file mode 100644
index 0000000..1bca4a4
Binary files /dev/null and b/subpages/heart/images/dingdan.png differ
diff --git a/subpages/heart/images/endtime.png b/subpages/heart/images/endtime.png
new file mode 100644
index 0000000..2577dcb
Binary files /dev/null and b/subpages/heart/images/endtime.png differ
diff --git a/subpages/heart/images/first.png b/subpages/heart/images/first.png
new file mode 100644
index 0000000..02e4bec
Binary files /dev/null and b/subpages/heart/images/first.png differ
diff --git a/subpages/heart/images/heartDetail-bg.png b/subpages/heart/images/heartDetail-bg.png
new file mode 100644
index 0000000..7a970d6
Binary files /dev/null and b/subpages/heart/images/heartDetail-bg.png differ
diff --git a/subpages/heart/images/ic_chongxindingwei.png b/subpages/heart/images/ic_chongxindingwei.png
new file mode 100644
index 0000000..4e37635
Binary files /dev/null and b/subpages/heart/images/ic_chongxindingwei.png differ
diff --git a/subpages/heart/images/ic_hudongtongzhi.png b/subpages/heart/images/ic_hudongtongzhi.png
new file mode 100644
index 0000000..da1b116
Binary files /dev/null and b/subpages/heart/images/ic_hudongtongzhi.png differ
diff --git a/subpages/heart/images/jifen.png b/subpages/heart/images/jifen.png
new file mode 100644
index 0000000..d1bcd89
Binary files /dev/null and b/subpages/heart/images/jifen.png differ
diff --git a/subpages/heart/images/mdsz.png b/subpages/heart/images/mdsz.png
new file mode 100644
index 0000000..955215d
Binary files /dev/null and b/subpages/heart/images/mdsz.png differ
diff --git a/subpages/heart/images/reason.png b/subpages/heart/images/reason.png
new file mode 100644
index 0000000..7a2fcb8
Binary files /dev/null and b/subpages/heart/images/reason.png differ
diff --git a/subpages/heart/images/ren.png b/subpages/heart/images/ren.png
new file mode 100644
index 0000000..73d0203
Binary files /dev/null and b/subpages/heart/images/ren.png differ
diff --git a/subpages/heart/images/ren_red.png b/subpages/heart/images/ren_red.png
new file mode 100644
index 0000000..68aacc6
Binary files /dev/null and b/subpages/heart/images/ren_red.png differ
diff --git a/subpages/heart/images/renzheng-bg.png b/subpages/heart/images/renzheng-bg.png
new file mode 100644
index 0000000..50ec537
Binary files /dev/null and b/subpages/heart/images/renzheng-bg.png differ
diff --git a/subpages/heart/images/rili.png b/subpages/heart/images/rili.png
new file mode 100644
index 0000000..040d644
Binary files /dev/null and b/subpages/heart/images/rili.png differ
diff --git a/subpages/heart/images/second.png b/subpages/heart/images/second.png
new file mode 100644
index 0000000..1963de7
Binary files /dev/null and b/subpages/heart/images/second.png differ
diff --git a/subpages/heart/images/shijian.png b/subpages/heart/images/shijian.png
new file mode 100644
index 0000000..7b87c3d
Binary files /dev/null and b/subpages/heart/images/shijian.png differ
diff --git a/subpages/heart/images/signed.png b/subpages/heart/images/signed.png
new file mode 100644
index 0000000..49a2f41
Binary files /dev/null and b/subpages/heart/images/signed.png differ
diff --git a/subpages/heart/images/third.png b/subpages/heart/images/third.png
new file mode 100644
index 0000000..0894773
Binary files /dev/null and b/subpages/heart/images/third.png differ
diff --git a/subpages/heart/images/uploadImg3.png b/subpages/heart/images/uploadImg3.png
new file mode 100644
index 0000000..1b015c5
Binary files /dev/null and b/subpages/heart/images/uploadImg3.png differ
diff --git a/subpages/heart/images/xiangqing.png b/subpages/heart/images/xiangqing.png
new file mode 100644
index 0000000..832abfb
Binary files /dev/null and b/subpages/heart/images/xiangqing.png differ
diff --git a/subpages/heart/images/yuanjiao-gray.png b/subpages/heart/images/yuanjiao-gray.png
new file mode 100644
index 0000000..6b0b8d0
Binary files /dev/null and b/subpages/heart/images/yuanjiao-gray.png differ
diff --git a/subpages/heart/images/yuanjiao-orange.png b/subpages/heart/images/yuanjiao-orange.png
new file mode 100644
index 0000000..5b4724f
Binary files /dev/null and b/subpages/heart/images/yuanjiao-orange.png differ
diff --git a/subpages/heart/images/yuanjiao-red.png b/subpages/heart/images/yuanjiao-red.png
new file mode 100644
index 0000000..d031c8b
Binary files /dev/null and b/subpages/heart/images/yuanjiao-red.png differ
diff --git a/subpages/heart/pages/cancelDetail/cancelDetail.js b/subpages/heart/pages/cancelDetail/cancelDetail.js
new file mode 100644
index 0000000..aa4a250
--- /dev/null
+++ b/subpages/heart/pages/cancelDetail/cancelDetail.js
@@ -0,0 +1,44 @@
+const api = require('../../../../utils/api.js')
+
+Page({
+ data: {
+ detailObj: {
+ id: '',
+ title: '',
+ signupEndTime: '',
+ actStartTime: '',
+ actEndTime: '',
+ cancelReason: ''
+ },
+ signupEndTime:'',//报名截止时间
+ actStartTime:'',
+ actEndTime:''
+ },
+ onLoad (options) {
+ this.getUnPassActivityDetail(options.id)
+ },
+ onShow () {
+
+ },
+ getUnPassActivityDetail (id) {
+ api.cancelDetail(id).then(res => {
+ console.log('取消活动详情', res)
+ for(const key in this.data.detailObj) {
+ this.data.detailObj[key] = res.data[key]
+ }
+ this.setData({
+ detailObj: this.data.detailObj,
+ signupEndTime: this.data.detailObj.signupEndTime.substring(0, 16),
+ actStartTime: this.data.detailObj.actStartTime.substring(0, 16),
+ actEndTime: this.data.detailObj.actEndTime.substring(0, 16),
+ })
+ }).catch(err => {
+ console.log(err)
+ })
+ },
+ toDetail () {
+ wx.navigateTo({
+ url: `/subpages/heart/pages/heartDetail/heartDetail?id=${this.data.detailObj.id}`
+ })
+ }
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/cancelDetail/cancelDetail.json b/subpages/heart/pages/cancelDetail/cancelDetail.json
new file mode 100644
index 0000000..e6b7442
--- /dev/null
+++ b/subpages/heart/pages/cancelDetail/cancelDetail.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "活动取消"
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/cancelDetail/cancelDetail.wxml b/subpages/heart/pages/cancelDetail/cancelDetail.wxml
new file mode 100644
index 0000000..6011a01
--- /dev/null
+++ b/subpages/heart/pages/cancelDetail/cancelDetail.wxml
@@ -0,0 +1,33 @@
+
+
+
+ {{detailObj.title}}
+
+
+
+ 报名截止时间
+
+ {{signupEndTime}}
+
+
+
+
+ 活动时间
+
+ {{actStartTime}}至{{actEndTime}}
+
+
+
+
+
+
+ 活动取消原因
+
+
+ {{detailObj.cancelReason}}
+
+
+
+
+
+
diff --git a/subpages/heart/pages/cancelDetail/cancelDetail.wxss b/subpages/heart/pages/cancelDetail/cancelDetail.wxss
new file mode 100644
index 0000000..aef6cd0
--- /dev/null
+++ b/subpages/heart/pages/cancelDetail/cancelDetail.wxss
@@ -0,0 +1,148 @@
+page {
+ width: 100%;
+ min-height: 100vh;
+ height: auto;
+ overflow-y: auto;
+ background: #f7f7f7;
+}
+.refuse-or-end {
+ width: 100%;
+ height: 100%;
+ background: #f7f7f7;
+ box-sizing: border-box;
+ padding: 15rpx 20rpx 20rpx;
+}
+
+.refuse-or-end .top {
+ width: 100%;
+ border-radius: 16rpx;
+ background: #fff;
+ box-sizing: border-box;
+ padding: 0 20rpx;
+}
+.refuse-or-end .top .title {
+ color: #333333;
+ font-size: 44rpx;
+ font-weight: bolder;
+ padding: 50rpx 0 40rpx;
+ line-height: 60rpx;
+ border-bottom: 1rpx solid #EAEAEA;
+}
+.refuse-or-end .top .endtime {
+ width: 100%;
+ border-bottom: 1rpx solid #EAEAEA;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 100rpx;
+}
+.refuse-or-end .top .endtime .left {
+ display: flex;
+ align-items: center;
+ height: 100%;
+}
+.refuse-or-end .top .endtime .left image {
+ width: 34rpx;
+ height: 34rpx;
+ object-fit: cover;
+ margin-right: 6rpx;
+}
+.refuse-or-end .top .endtime .left .endtime-tip {
+ font-size: 32rpx;
+ color: #999;
+}
+.refuse-or-end .top .endtime .content {
+ font-size: 32rpx;
+ color: #333333;
+}
+.refuse-or-end .top .activitytime {
+ width: 100%;
+ border-bottom: 1rpx solid #EAEAEA;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 100rpx;
+}
+.refuse-or-end .top .activitytime .left {
+ display: flex;
+ align-items: center;
+ height: 100%;
+}
+.refuse-or-end .top .activitytime .left image {
+ width: 34rpx;
+ height: 34rpx;
+ object-fit: cover;
+ margin-right: 6rpx;
+}
+.refuse-or-end .top .activitytime .left .activitytime-tip {
+ font-size: 32rpx;
+ color: #999;
+}
+.refuse-or-end .top .activitytime .content {
+ font-size: 32rpx;
+ color: #333333;
+ width: 50%;
+ text-align: right;
+}
+
+.refuse-or-end .bottom {
+ width: 100%;
+ border-radius: 16rpx;
+ background: #fff;
+ box-sizing: border-box;
+ padding: 0 20rpx;
+ margin-top: 15rpx;
+ min-height: calc(100vh - 15rpx - 15rpx - 15rpx - 450rpx);
+ position: relative;
+ overflow: hidden;
+}
+.refuse-or-end .bottom .reason {
+ width: 100%;
+ height: 108rpx;
+ border-bottom: 1rpx solid #EAEAEA;
+ display: flex;
+ align-items: center;
+}
+.refuse-or-end .bottom .reason image {
+ width: 38rpx;
+ height: 38rpx;
+ object-fit: cover;
+ margin-right: 6rpx;
+}
+.refuse-or-end .bottom .reason .tip {
+ font-size: 34rpx;
+ color: #333333;
+ font-weight: bolder;
+}
+.refuse-or-end .bottom .reason-content {
+ color: #333;
+ font-size:34rpx;
+ line-height: 52rpx;
+ margin-top: 12rpx;
+ margin-bottom: 125rpx;
+}
+.look-detail {
+ width: 100%;
+ height: 85rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: absolute;
+ bottom: 20rpx;
+ left: 0rpx;
+}
+.look-detail button {
+ width: 560rpx;
+ height: 85rpx;
+ line-height: 85rpx;
+ text-align:center;
+ margin: 0rpx;
+ padding: 0rpx;
+ color: #fff;
+ font-size: 36rpx;
+ border-radius: 16rpx;
+ background: linear-gradient(to right, #f70e0f, #ff4c4b);
+}
+.look-detail .hover-button {
+ background: red;
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/clockIn/clockIn.js b/subpages/heart/pages/clockIn/clockIn.js
new file mode 100644
index 0000000..b89f921
--- /dev/null
+++ b/subpages/heart/pages/clockIn/clockIn.js
@@ -0,0 +1,310 @@
+import {
+ BASEURL
+} from '../../../../utils/config';
+var QQMapWX = require('../../utils/qqmap-wx-jssdk.js');
+const api = require('../../../../utils/api')
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ BASEURL: BASEURL(),
+ qqmapsdk:"",
+ signin: {},//活动打卡地点详情
+ actId: "",//活动ID
+ operationDesc: "",//打卡描述
+ operationDesc_:"",
+ locationLongitude: Number,//打卡位置经度
+ locationLatitude: Number,// 打卡位置纬度
+ operationAddress:"",//打卡地址
+ images: [],//图片
+ clockType: Number,//打卡类型(0-打卡,1-更新打卡)
+ effectiveFlag: Number,//打卡是否有效(0-否,1-是)
+ phraseList:[],//常用于列表
+ phraseId:"",//常用语id
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ const qqmapsdk = new QQMapWX({
+ key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ'
+ })
+ this.setData({
+ qqmapsdk,
+ id: options.id,
+ clockType:1,
+ 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)
+ },
+ //获取经纬度
+ getPosition() {
+ wx.showLoading({
+ title: '正在获取位置',
+ })
+ wx.getLocation({
+ type: 'gcj02',
+ success: (res) => {
+ this.reverseGeocoder(res)
+ this.setData({
+ location: {
+ locationLongitude: res.latitude,
+ locationLatitude: res.longitude
+ }
+ })
+ }
+ })
+ },
+ // 逆地址解析
+ reverseGeocoder({ latitude, longitude }) {
+ var that = this;
+ that.data.qqmapsdk.reverseGeocoder({
+ location: {
+ latitude,
+ longitude
+ },
+ success: (res) => {
+ wx.hideLoading();
+ if (res.message === 'query ok') {
+ that.setData({
+ operationAddress: res.result.address
+ })
+ }
+ }
+ })
+ },
+
+
+ // 上传图片
+ onChange(e) {
+ // console.log('onChange', e)
+ const {
+ file
+ } = e.detail
+ if (file.status === 'uploading') {
+ this.setData({
+ progress: 0,
+ })
+ wx.showLoading()
+ } else if (file.status === 'done') {
+ this.setData({
+ imageUrl: file.url,
+ })
+ }
+
+ let images = []
+ e.detail.fileList.forEach((item, index, array) => {
+ if (item.res !== undefined) {
+ const imageUrl = JSON.parse(e.detail.fileList[index].res.data).data
+ images.push(imageUrl)
+ }
+ })
+ 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
+ } = e.detail
+ wx.previewImage({
+ current: file.url,
+ urls: fileList.map((n) => n.url),
+ })
+ },
+ // 填写意见
+ // bindInput: function (e) {
+ // this.setData({
+ // operationDesc: e.detail.value + this.data.operationDesc,
+ // operationDesc_: e.detail.value
+ // })
+ // if (this.data.operationDesc_.length == 0){
+ // this.setData({
+ // operationDesc: e.detail.value,
+ // operationDesc_: e.detail.value
+ // })
+ // }
+ // console.log(this.data.operationDesc_)
+ // },
+ getbindinput(e) {
+ this.setData({
+ operationDesc: e.detail.value,
+ })
+ },
+ /**
+ * 数据提交方法
+ */
+ submission() {
+ // this.setData({
+ // clockType: 1
+ // })
+
+
+ if (this.data.operationDesc === '') {
+ wx.showToast({
+ title: '请先输入打卡描述',
+ icon: 'none',
+ duration: 3000
+ })
+ return false
+ }
+
+ if (this.data.images.length==0){
+ wx.showToast({
+ title: '请上传打卡图片',
+ icon: 'none',
+ duration: 3000
+ })
+ return false
+ }
+
+ if (this.data.phraseId) {
+ api.sagenumAddOne(this.data.phraseId).then(function (res) {
+ console.log('常用语言:' + res)
+ })
+ }
+
+ const signinLongitude = this.data.signin.signinLongitude;
+ const signinLatitude = this.data.signin.signinLatitude;
+
+ const clockLongitude = this.data.location.locationLongitude;
+ const clockLatitude = this.data.location.clockLatitude;
+
+ // Lat1 Lung1 表示A点纬度和经度,Lat2 Lung2 表示B点纬度和经度;
+ // a = Lat1 – Lat2 为两点纬度之差 b = Lung1 - Lung2 为两点经度之差;
+ // 6378.137为地球半径,单位为公里;计算出来的结果单位为公里;
+
+ // var a = rad(signinLatitude) - rad(clockLatitude);
+ // var b = rad(signinLongitude) - rad(clockLongitude);
+ // 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;
+ // s = Math.round(s * 10000) / 10000;
+
+ const params={
+ actId: this.data.id,
+ clockDesc: this.data.operationDesc,
+ clockLongitude: this.data.location.locationLongitude,
+ clockLatitude: this.data.location.locationLatitude,
+ clockAddress: this.data.operationAddress,
+ images: this.data.images,
+ clockType: this.data.clockType,//打卡类型(0-打卡,1-更新打卡)
+ effectiveFlag: this.data.effectiveFlag//打卡是否有效(0-否,1-是)
+ }
+ console.log('~~~~~~~":::::' + JSON.stringify(params))
+ api.clock(params).then(function (res) {
+ console.log('打卡成功' + JSON.stringify(res))
+ if (res.code == 0) {
+ wx.showToast({
+ title: '打卡成功',
+ icon: 'none',
+ duration: 3000,
+ complete: function () {
+ setTimeout(function () {
+ wx.navigateBack()
+ }, 1000);
+ }
+ })
+ }
+
+ })
+ },
+
+ clockAddressDetail() {//活动打卡地点详情
+ const id = this.data.id;
+ api.clockAddressDetail(id).then(function (res) {
+ if (res.data.code == 0) {
+ this.setData({
+ signin: res.data
+ })
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/clockIn/clockIn.json b/subpages/heart/pages/clockIn/clockIn.json
new file mode 100644
index 0000000..f18eeef
--- /dev/null
+++ b/subpages/heart/pages/clockIn/clockIn.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "志愿者打卡",
+ "usingComponents": {
+ "wux-upload": "../../../../dist/upload/index"
+ }
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/clockIn/clockIn.wxml b/subpages/heart/pages/clockIn/clockIn.wxml
new file mode 100644
index 0000000..fb92da4
--- /dev/null
+++ b/subpages/heart/pages/clockIn/clockIn.wxml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+ {{item.phrase}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 打卡地点
+
+
+ {{operationAddress}}
+
+
+
+ 重新选定
+
+
+
+
+
+ 提交打卡
+
\ No newline at end of file
diff --git a/subpages/heart/pages/clockIn/clockIn.wxss b/subpages/heart/pages/clockIn/clockIn.wxss
new file mode 100644
index 0000000..ecf6276
--- /dev/null
+++ b/subpages/heart/pages/clockIn/clockIn.wxss
@@ -0,0 +1,137 @@
+.container{
+ width: 100%;
+}
+.info{
+ background-color: #fff;
+ border-radius: 20rpx;
+ margin: 20rpx 20rpx 0rpx 20rpx;
+ padding-bottom: 10rpx;
+}
+textarea{
+ padding-top: 39rpx;
+ width: calc(100% - 50rpx);
+ margin-left: 25rpx;
+ /* padding: 39rpx 25rpx 39rpx 25rpx; */
+}
+.info-tips{
+ width: 100%;
+ height: auto;
+}
+.tips{
+ background-color: #D9D9D9;
+ border-radius: 20rpx;
+ margin: 20rpx 20rpx 0rpx 20rpx;
+ display:inline-block;
+ padding: 8rpx 10rpx;
+}
+.spot{
+ width: 14rpx;
+ height: 14rpx;
+ background-color: #C1C1C1;
+ border-radius: 50%;
+ position: relative;
+ float: left;
+ top: 10rpx;
+}
+.display-inline{display:inline}
+.content{
+ float: left;
+ font-size:28rpx;
+ font-weight:500;
+ margin-left: 10rpx;
+ color:rgba(102,102,102,1);
+}
+.info-line{
+ height: 3rpx;
+ background-color: #EAEAEA;
+ width: 100whh;
+ margin: 30rpx 24rpx 20rpx;
+}
+.photo{
+ padding: 18rpx;
+}
+.wux-upload--picture-card .wux-upload__select{
+ width: 220rpx !important;
+ height: 220rpx !important;
+}
+.wux-upload--picture-card .wux-upload__file{
+ width: 220rpx !important;
+ height: 220rpx !important;
+ border: 2rpx solid #EAEAEA !important;
+ margin: 0 40rpx 40rpx 0 !important;
+}
+.wux-upload--picture-card .wux-upload__remove{
+ width: 46rpx !important;
+ height: 46rpx !important;
+ background-size: 46rpx auto !important;
+ right: -20rpx !important;
+ top: -18rpx !important;
+}
+
+/* 定位 */
+.location{
+ margin: 20rpx 20rpx 0rpx 20rpx;
+ padding-bottom: 35rpx;
+ margin-bottom: 14rpx;
+ background-color: #fff;
+ border-radius: 20rpx;
+}
+
+.info-box {
+ width: 100wh;
+ height: auto;
+ border-bottom: 1rpx solid #e7eeee;
+ padding: 35rpx 0rpx;
+ margin: 0rpx 20rpx;
+ font-size:34rpx;
+ font-weight:bold;
+ color:rgba(51,51,51,1);
+}
+
+
+.info-box-last-require
+ {
+ width: 100wh;
+ height: auto;
+ padding: 30rpx 0rpx 0 0;
+ margin: 0rpx 20rpx;
+ font-size:34rpx;
+ font-weight:500;
+ color:rgba(51,51,51,1);
+ line-height:54rpx;
+}
+.refresh{
+ margin: 30rpx 20rpx;
+}
+.refresh image{
+ width: 30.3rpx;
+ height: 30.3rpx;
+ float: left;
+ position: relative;
+ top: 5rpx
+}
+.refresh-name{
+ font-size:28rpx;
+ font-weight:500;
+ color:rgba(0,179,152,1);
+ float: left;
+ margin-left: 10rpx;
+}
+
+.clear{
+ clear: both;
+}
+
+.button{
+ background:linear-gradient(90deg,rgba(244,12,12,1),rgba(255,78,78,1));
+ margin-left: 95rpx;
+ width: 560rpx;
+ height: 84rpx;
+ font-size:36rpx;
+ font-weight:500;
+ color:rgba(255,255,255,1);
+ text-align: center;
+ line-height: 84rpx;
+ border-radius: 20rpx;
+ margin: 78rpx 95rpx 48rpx 95rpx;
+}
diff --git a/subpages/heart/pages/heartDetail/heartDetail.js b/subpages/heart/pages/heartDetail/heartDetail.js
new file mode 100644
index 0000000..631ad20
--- /dev/null
+++ b/subpages/heart/pages/heartDetail/heartDetail.js
@@ -0,0 +1,213 @@
+const api = require('../../../../utils/api')
+import {
+ getTimestamp
+} from '../../../../utils/common'
+Page({
+ data: {
+ detail: {},
+ actCurrentState: 0, //活动当前状态(0-报名中,1-已报满,2-未开始,3-进行中,4-已结束)
+ actStartTime: '',
+ actEndTime: '',
+ signupEndTime: '',
+ signupFlag: 0, //用户报名状态(0-未报名,1已报名)
+ clocks: [], //打卡列表
+ clockNum: 0, //打卡人次
+ actContent: '', //富文本
+ dialogTitle: '',
+ dialogContent: '',
+ dialogConfirmText: '',
+ dialogCancelText: '',
+ uservolunteerflag: '',
+ cancelSignupVisible: false,
+ cancelSignupTipValue: '',
+ cancelSignupTipVisible: false
+ },
+ onLoad: function(options) {
+ this.setData({
+ id: options.id,
+ actCurrentState: options.actcurrentstate,
+ signupFlag: options.signupflag
+ })
+ // this.getDetail();//活动详情
+ // this.clockList();//打卡列表
+ // if (this.data.actCurrentState == 2 || this.data.actCurrentState == 3 || this.data.actCurrentState == 4){
+ // this.clockList();//打卡列表
+ // }
+ },
+ // 获取详情信息
+ getDetail() {
+ let id = this.data.id
+ api.detail(id).then(res => {
+ if (res.code === 0 && res.msg === 'success') {
+ this.setData({
+ detail: res.data,
+ actContent: res.data.actContent.replace(/\
{
+ console.log(err)
+ })
+ },
+ //打卡列表
+ clockList() {
+ let id = this.data.id
+ api.clockList(id).then(res => {
+ // console.log("打卡列表:" + JSON.stringify(res.data))
+ if (res.code === 0 && res.msg === 'success') {
+ this.setData({
+ clockNum: res.data.clockNum,
+ clocks: res.data.clocks
+ })
+ }
+ }).catch(err => {
+ console.log(err)
+ })
+ },
+ goClockIn(e) { //前往打卡页面
+ const id = e.currentTarget.dataset.id
+ wx.navigateTo({
+ url: `../clockIn/clockIn?id=${id}`
+ })
+ },
+ goVolunteer(e) { //我要报名 用户认证志愿者标识(0-未认证,1-已认证)
+ // 0-待审核 提醒用户志愿者身份认证审核中,不能报名也不用去认证
+ // 1 - 认证通过 直接报名
+ // 2 - 待认证 提示用户去认证
+ // 3 - 黑名单 提示用户已被拉入黑名单,不能报名
+ const uservolunteerflag = e.currentTarget.dataset.uservolunteerflag
+ this.setData({
+ uservolunteerflag: uservolunteerflag
+ })
+ if (uservolunteerflag == 0) {
+ // this.setData({
+ // dialogVisible: !this.data.dialogVisible,
+ // dialogTitle: '正在审核',
+ // dialogContent: ['志愿者身份审核中'],
+ // dialogConfirmText: '确定',
+ // dialogCancelText: ''
+ // })
+ this.setData({
+ dialogVisible: !this.data.dialogVisible,
+ dialogTitle: '报名提醒',
+ dialogContent: ['报名时间截止之前可取消', `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`],
+ dialogConfirmText: '是',
+ dialogCancelText: '否'
+ })
+ } else if (uservolunteerflag == 1) {
+ this.setData({
+ dialogVisible: !this.data.dialogVisible,
+ dialogTitle: '报名提醒',
+ dialogContent: ['报名时间截止之前可取消', `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`],
+ dialogConfirmText: '是',
+ dialogCancelText: '否'
+ })
+
+ } else if (uservolunteerflag == 2) {
+ this.setData({
+ dialogVisible: !this.data.dialogVisible,
+ dialogTitle: '志愿者认证',
+ dialogContent: ['是否认证志愿者,完成报名'],
+ dialogConfirmText: '是',
+ dialogCancelText: '否'
+ })
+ } else if (uservolunteerflag == 3) {
+ this.setData({
+ dialogVisible: !this.data.dialogVisible,
+ dialogTitle: '已被拉入黑名单',
+ dialogContent: ['您已被拉入黑名单,不能报名'],
+ dialogConfirmText: '确定',
+ dialogCancelText: ''
+ })
+ }
+ },
+ //已报满
+ signUpFull() {
+ this.setData({
+ dialogVisible: !this.data.dialogVisible,
+ dialogTitle: '已报满',
+ dialogContent: ['活动名额报名已满', '快去“招募令”中参加其他活动吧'],
+ dialogConfirmText: '确定',
+ dialogCancelText: ''
+ })
+ },
+ // 取消报名
+ prompt() {
+ const now = getTimestamp()
+ if (now > this.data.detail.signupEndTime) {
+ this.setData({
+ cancelSignupVisible: !this.data.cancelSignupVisible,
+ cancelSignupTipValue: `报名时间已结束,取消活动将扣除${this.data.detail.punishmentPoints}积分`,
+ cancelSignupTipVisible: true
+ })
+ } else {
+ this.setData({
+ cancelSignupVisible: !this.data.cancelSignupVisible,
+ cancelSignupTipVisible: false,
+ cancelSignupTipValue: ''
+ })
+ }
+ },
+ onShow: function() {
+ this.getDetail(); //活动详情
+ this.clockList(); //打卡列表
+ // if (this.data.actCurrentState == 2 || this.data.actCurrentState == 3 || this.data.actCurrentState == 4) {
+ // this.clockList();//打卡列表
+ // }
+ },
+ // 弹框确认
+ confirmDialog() {
+ console.log('::::::' + this.data.uservolunteerflag.length)
+ if (this.data.uservolunteerflag.length > 0) {
+ if (this.data.uservolunteerflag == 0 || this.data.uservolunteerflag == 1) {
+ let id = this.data.id
+ api.signup(id).then(res => {
+ if (res.code == 0) {
+ this.setData({
+ dialogVisible: !this.data.dialogVisible,
+ dialogTitle: '报名成功',
+ dialogContent: ['正在审核中', '请耐心等待消息通知!'],
+ dialogConfirmText: '确定',
+ dialogCancelText: '',
+ uservolunteerflag: ''
+ })
+ this.getDetail()
+ } else { //点击我要报名,刚好已经报满,此时弹出已报满的提示框,点击确定后,我要报名按钮变成已报满按钮(置灰)
+ this.getDetail()
+ }
+ })
+ } else if (this.data.uservolunteerflag == 2) {
+ wx.navigateTo({
+ url: '/subpages/heart/pages/volunteer/volunteer'
+ })
+ }
+ } else {
+ console.log('报名成功以后不进行操作')
+ }
+ },
+ cancelSignupCallback(e) {
+ let id = this.data.id
+ let reason = e.detail.data
+ api.cancelsignup(id, reason).then(res => {
+ wx.showToast({
+ title: '取消报名成功',
+ icon: 'none',
+ duration: 2000
+ })
+ this.getDetail()
+ setTimeout(() => {
+ wx.navigateBack({
+ delta: 1
+ })
+ }, 2000)
+ })
+ },
+ preViewImage(e) {
+ wx.previewImage({
+ urls: e.currentTarget.dataset.list,
+ current: e.currentTarget.dataset.src
+ })
+ }
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/heartDetail/heartDetail.json b/subpages/heart/pages/heartDetail/heartDetail.json
new file mode 100644
index 0000000..c20e21a
--- /dev/null
+++ b/subpages/heart/pages/heartDetail/heartDetail.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "详情",
+ "usingComponents": {
+ "wux-dialog": "../../../../dist/dialog/index",
+ "coverview-dialog": "../../components/coverViewDialog/coverViewDialog",
+ "cancel-signup-dialog": "../../components/cancelSignupDialog/cancelSignupDialog"
+ }
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/heartDetail/heartDetail.wxml b/subpages/heart/pages/heartDetail/heartDetail.wxml
new file mode 100644
index 0000000..2492fb8
--- /dev/null
+++ b/subpages/heart/pages/heartDetail/heartDetail.wxml
@@ -0,0 +1,267 @@
+
+
+
+
+
+ {{detail.title}}
+
+
+
+
+
+
+
+ 报名截止时间
+
+
+ {{signupEndTime}}
+
+
+
+
+
+
+ 活动时间
+
+
+ {{actStartTime}}至
+ {{actEndTime}}
+
+
+
+
+
+
+
+ 活动地点
+
+
+ {{detail.actAddress}}
+
+
+
+
+
+
+
+ 活动名额
+
+
+ {{ detail.actQuotaCategory === 0 ? '不限名额' : detail.actQuota + '人'}}
+
+
+
+
+
+
+
+ 联系人
+
+
+ {{detail.contacts}}
+
+
+
+
+
+
+
+ 联系电话
+
+
+ {{detail.tel}}
+
+
+
+
+
+
+
+ 积分奖励
+
+
+ {{detail.reward}}
+
+
+
+
+
+
+
+
+
+ 招募要求
+
+
+
+
+ {{detail.requirement}}
+
+
+
+
+
+
+
+
+
+ 活动详情
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 志愿者打卡
+
+
+ {{clockNum}}次
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.nickname}}
+ {{item.createdTime}}
+
+
+ {{item.clockDesc}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 已报名 {{detail.signupNum}}人
+
+
+
+
+
+
+
+
+
+ 我要报名
+
+
+
+
+
+
+
+
+
+
+ 取消报名
+
+
+
+
+
+ 未开始
+
+
+
+
+
+
+
+
+
+
+
+ 已报满
+
+
+
+
+
+
+
+
+
+
+
+
+ 未开始
+
+
+
+
+
+
+
+
+
+ 我要打卡
+ 更新打卡
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/subpages/heart/pages/heartDetail/heartDetail.wxss b/subpages/heart/pages/heartDetail/heartDetail.wxss
new file mode 100644
index 0000000..2a207db
--- /dev/null
+++ b/subpages/heart/pages/heartDetail/heartDetail.wxss
@@ -0,0 +1,345 @@
+.container {
+ width: 100%;
+}
+
+.top-bg {
+ width: 100%;
+ height: 354rpx;
+}
+
+.top-bg image {
+ width: 100%;
+ height: 354rpx;
+}
+
+.top-font {
+ color: #fff;
+ display: block;
+ position: absolute;
+ top: 67rpx;
+ left: 20rpx;
+ right: 20rpx;
+ font-size: 44rpx;
+}
+
+.position-absolute {
+ position: absolute;
+ left: 20rpx;
+ right: 20rpx;
+}
+
+.position-absolute-top1 {
+ top: 188rpx;
+}
+
+.position-absolute-top2 {
+ top: 245rpx;
+}
+
+.info {
+ background-color: #fff;
+ border-radius: 20rpx;
+}
+
+.info-box {
+ width: 100wh;
+ height: auto;
+ border-bottom: 1rpx solid #e7eeee;
+ padding: 20rpx 0rpx;
+ margin: 0rpx 20rpx;
+}
+
+.info-box-title {
+ width: 100wh;
+ height: auto;
+ border-bottom: 1rpx solid #e7eeee;
+ padding: 35rpx 0rpx;
+ margin: 0rpx 20rpx;
+}
+
+.display-inline {
+ display: inline;
+}
+
+.info-left {
+ width: 40%;
+ float: left;
+ word-wrap: break-word;
+}
+
+.info-right {
+ width: 60%;
+ float: left;
+ font-size: 32rpx;
+ text-align: right;
+ word-wrap: break-word;
+ position: relative;
+ top: 5rpx;
+}
+
+.info-right .color {
+ font-weight: 500;
+ color: rgba(51, 51, 51, 1);
+}
+
+.info-left image {
+ width: 34rpx;
+ height: 34rpx;
+ position: relative;
+ top: 5rpx;
+}
+
+.info-font {
+ font-size: 32rpx;
+ color: #999;
+ padding: 5rpx;
+ top: -4rpx;
+ position: relative;
+}
+
+.info-box-last {
+ width: 100wh;
+ height: auto;
+ padding: 25rpx 0rpx;
+ margin: 0rpx 20rpx;
+}
+
+.clear {
+ clear: both;
+}
+
+.require {
+ margin-top: 14rpx;
+ padding-bottom: 35rpx;
+ margin-bottom: 14rpx;
+ background-color: #fff;
+ border-radius: 20rpx;
+}
+
+.margin-bottom {
+ margin-bottom: 134rpx;
+}
+
+.require .info-box .info-left image {
+ width: 38rpx;
+ height: 38rpx;
+ position: relative;
+ top: 0rpx;
+}
+
+.info-font-zhaomu {
+ font-size: 34rpx;
+ color: #333;
+ font-weight: bold;
+ padding: 10rpx;
+}
+
+.info-box-last-require {
+ width: 100wh;
+ height: auto;
+ padding: 35rpx 0rpx 0 0;
+ margin: 0rpx 20rpx;
+ font-size: 34rpx;
+ font-weight: 500;
+ color: rgba(51, 51, 51, 1);
+ line-height: 54rpx;
+}
+
+.bottom {
+ width: 100%;
+ height: 120rpx;
+ background-color: #fff;
+ position: fixed;
+ bottom: 0rpx;
+ z-index: 777;
+ padding: 0rpx 20rpx;
+}
+
+.button-left {
+ width: 28%;
+ height: 100%;
+ float: left;
+ color: #fc5555;
+ text-align: left;
+ line-height: 120rpx;
+ font-size: 26rpx;
+}
+
+.button-right {
+ width: 70%;
+ height: 100%;
+ float: left;
+}
+
+.button-right1 {
+ width: 50%;
+ height: 100%;
+ float: left;
+ /* text-align: center; */
+ padding: 24rpx 0;
+}
+
+.button-right2 {
+ width: 50%;
+ height: 100%;
+ float: left;
+ /* text-align: center; */
+ padding: 24rpx 0;
+}
+
+.button-right3 {
+ width: 50%;
+ height: 100%;
+ float: right;
+ /* text-align: center; */
+ padding: 24rpx 0;
+}
+
+.button1 {
+ width: 240rpx;
+ height: 72rpx;
+ /* margin: 0 auto; */
+ display: flex;
+ position: relative;
+}
+
+.button2 {
+ margin-top: 24rpx;
+ margin-left: 255rpx;
+}
+
+.header-bg {
+ width: 100%;
+ height: 100%;
+}
+
+.button1 .font {
+ width: 240rpx;
+ height: 72rpx;
+ text-align: center;
+ z-index: 1;
+ line-height: 72rpx;
+ color: #fff;
+ font-size: 32rpx;
+ position: absolute;
+}
+
+.volunteer {
+ font-size: 26rpx;
+ font-family: PingFang SC;
+ font-weight: 500;
+ color: rgba(153, 153, 153, 1);
+ margin-top: 10rpx;
+}
+
+.info-box-volunteer {
+ width: 100wh;
+ height: auto;
+ border-bottom: 1rpx solid #e7eeee;
+ padding: 26rpx 0rpx;
+ margin: 0rpx 22rpx;
+}
+
+.info-box-volunteer-last {
+ width: 100wh;
+ height: auto;
+ padding: 26rpx 0rpx;
+ margin: 0rpx 22rpx;
+}
+
+.info-box-volunteer-ph {
+ width: 64rpx;
+ height: 64rpx;
+ border-radius: 50%;
+ float: left;
+}
+
+.info-box-volunteer-name {
+ height: 64rpx;
+ width: auto;
+ padding: 8rpx 0rpx;
+ float: left;
+ margin-left: 12rpx;
+}
+
+.info-box-volunteer-name-t {
+ height: 25rpx;
+ font-size: 25rpx;
+ font-family: PingFang SC;
+ font-weight: 500;
+ color: rgba(85, 85, 85, 1);
+}
+
+.info-box-volunteer-name-b {
+ height: 20rpx;
+ font-size: 20rpx;
+ font-weight: 500;
+ margin-top: 8rpx;
+ color: rgba(153, 153, 153, 1);
+}
+
+.info-box-volunteer-content {
+ width: 100%;
+ font-size: 34rpx;
+ font-family: PingFang SC;
+ font-weight: 500;
+ color: rgba(51, 51, 51, 1);
+ line-height: 50rpx;
+ margin-top: 80rpx;
+ word-wrap: break-word;
+}
+
+.photo {
+ margin-top: 27rpx;
+}
+
+.image-a {
+ margin-left: 10rpx;
+ height: 160rpx;
+ width: calc(33.3333333% - 10rpx);
+ border-radius: 15rpx;
+}
+
+.photo-one {
+ width: 100%;
+ height: 350rpx;
+ border-radius: 15rpx;
+}
+
+.photo-two-left {
+ float: left;
+ width: 49%;
+ height: 206rpx;
+ border-radius: 15rpx;
+}
+
+.photo-two-right {
+ float: left;
+ margin-left: 1%;
+ width: 49%;
+ height: 206rpx;
+ border-radius: 15rpx;
+}
+
+.photo-three-left {
+ float: left;
+ width: 32.333333%;
+ height: 160rpx;
+ border-radius: 15rpx;
+}
+
+.photo-three-center {
+ float: left;
+ width: 32.333333%;
+ height: 160rpx;
+ margin-left: 1%;
+ border-radius: 15rpx;
+}
+
+.photo-three-right {
+ float: left;
+ width: 32.333333%;
+ height: 160rpx;
+ margin-left: 1%;
+ border-radius: 15rpx;
+}
diff --git a/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.js b/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.js
new file mode 100644
index 0000000..ea378e7
--- /dev/null
+++ b/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.js
@@ -0,0 +1,11 @@
+Component({
+ data: {
+
+ },
+ properties: {
+
+ },
+ methods: {
+
+ }
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.json b/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.json
new file mode 100644
index 0000000..32640e0
--- /dev/null
+++ b/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.wxml b/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.wxml
new file mode 100644
index 0000000..8a1900b
--- /dev/null
+++ b/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.wxml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.wxss b/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.wxss
new file mode 100644
index 0000000..5b50203
--- /dev/null
+++ b/subpages/heart/pages/leaderboard/components/preloadLoverankingItem/preloadLoverankingItem.wxss
@@ -0,0 +1,42 @@
+.preload-loveranking-item {
+ width: 100%;
+ height: 140rpx;
+ display: flex;
+ align-items: center;
+}
+.preload-loveranking-item .avatar {
+ width: 90rpx;
+ height: 90rpx;
+ border-radius: 50%;
+ margin: 0 15rpx;
+ background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
+ animation: loading 1.4s ease infinite;
+ background-size: 400% 100%;
+}
+.preload-loveranking-item .info {
+ height: 90rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ width: calc(100% - 150rpx - 20rpx);
+}
+.preload-loveranking-item .info .top, .preload-loveranking-item .info .bottom {
+ width: 100%;
+ height: 30rpx;
+ background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
+ animation: loading 1.4s ease infinite;
+ background-size: 400% 100%;
+}
+.preload-loveranking-item .info .top {
+ margin-bottom: 20rpx;
+}
+
+@keyframes loading {
+ 0% {
+ background-position: 100% 50%
+ }
+
+ 100% {
+ background-position: 0 50%
+ }
+}
diff --git a/subpages/heart/pages/leaderboard/leaderboard.js b/subpages/heart/pages/leaderboard/leaderboard.js
new file mode 100644
index 0000000..2091f89
--- /dev/null
+++ b/subpages/heart/pages/leaderboard/leaderboard.js
@@ -0,0 +1,68 @@
+const api = require('../../../../utils/api')
+
+Page({
+ data: {
+ datalenght:0,
+ loveRankingList: [],
+ preloadVisible: true,
+ first: {
+ nickname: '',
+ faceImg: '',
+ kindnessTime: '',
+ participationNum: ''
+ },
+ second: {
+ nickname: '',
+ faceImg: '',
+ kindnessTime: '',
+ participationNum: ''
+ },
+ third: {
+ nickname: '',
+ faceImg: '',
+ kindnessTime: '',
+ participationNum: ''
+ }
+ },
+ onLoad () {
+ this.loadLoveRanking()
+ },
+ // 加载 爱心互助排行榜
+ loadLoveRanking () {
+ api.leaderboard().then(res => {
+ this.setData({
+ datalenght: res.data.length
+ })
+ console.log('爱心互助排行榜', res+":::::::::"+this.data.datalenght)
+ res.data.forEach((item,index) => {
+ if (index === 0) {
+ for(const key in this.data.first) {
+ this.data.first[key] = item[key]
+ }
+ } else if (index === 1) {
+ for(const key in this.data.second) {
+ this.data.second[key] = item[key]
+ }
+ } else if (index === 2) {
+ for(const key in this.data.third) {
+ this.data.third[key] = item[key]
+ }
+ } else {
+ this.data.loveRankingList.push(item)
+ }
+ })
+ this.setData({
+ loveRankingList: this.data.loveRankingList,
+ first: this.data.first,
+ second: this.data.second,
+ third: this.data.third,
+ preloadVisible: false
+ })
+ }).catch(() => {
+ this.setData({
+ loveRankingList: [],
+ preloadVisible: false
+ })
+ })
+ }
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/leaderboard/leaderboard.json b/subpages/heart/pages/leaderboard/leaderboard.json
new file mode 100644
index 0000000..7f07fd6
--- /dev/null
+++ b/subpages/heart/pages/leaderboard/leaderboard.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "爱心排行榜",
+ "usingComponents": {
+ "preload-loveranking-item": "./components/preloadLoverankingItem/preloadLoverankingItem"
+ }
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/leaderboard/leaderboard.wxml b/subpages/heart/pages/leaderboard/leaderboard.wxml
new file mode 100644
index 0000000..668e5d4
--- /dev/null
+++ b/subpages/heart/pages/leaderboard/leaderboard.wxml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+ 2
+
+ {{second.nickname}}
+ 爱心时长{{second.kindnessTime}}小时
+ 参加次数{{second.participationNum}}次
+
+
+
+
+
+ 1
+
+ {{first.nickname}}
+ 爱心时长{{first.kindnessTime}}小时
+ 参加次数{{first.participationNum}}次
+
+
+
+
+
+ 3
+
+ {{third.nickname}}
+ 爱心时长{{third.kindnessTime}}小时
+ 参加次数{{third.participationNum}}次
+
+
+
+
+
+
+
+
+
+
+
+
+ {{index + 4}}
+
+
+ {{item.nickname}}
+
+
+ 爱心时长 {{item.kindnessTime}}小时
+
+ 参加次数 {{item.participationNum}}次
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无排名
+ 快来参加吧
+
+
\ No newline at end of file
diff --git a/subpages/heart/pages/leaderboard/leaderboard.wxss b/subpages/heart/pages/leaderboard/leaderboard.wxss
new file mode 100644
index 0000000..1408ff1
--- /dev/null
+++ b/subpages/heart/pages/leaderboard/leaderboard.wxss
@@ -0,0 +1,264 @@
+page {
+ width: 100%;
+ min-height: 100vh;
+ height: auto;
+ overflow-y: auto;
+}
+.love-ranking {
+ width: 100%;
+ height: 100%;
+ background: #f7f7f7;
+}
+
+.love-ranking .top {
+ width: 100%;
+ height: 425rpx;
+ position: relative;
+}
+.love-ranking .top .top-bg {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+.love-ranking .top .top-content {
+ width: 100%;
+ height: 100%;
+ z-index: 100;
+ position: relative;
+ box-sizing: border-box;
+ padding: 0 15rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+.love-ranking .top .top-content .order {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-end;
+ height: 100%;
+}
+.love-ranking .top .top-content .order .num {
+ width: 36rpx;
+ height: 36rpx;
+ border-radius: 50%;
+ text-align:center;
+ line-height: 36rpx;
+ color: #333;
+ font-size: 28rpx;
+ font-weight: bolder;
+ position: absolute;
+ bottom: -18rpx;
+ 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;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.love-ranking .top .top-content .order .time {
+ font-size: 22rpx;
+ color:#FFE065;
+ line-height: 30rpx;
+}
+.love-ranking .top .top-content .order .times {
+ font-size: 22rpx;
+ color: #FFE065;
+ line-height: 30rpx;
+ margin-bottom: 30rpx;
+}
+.love-ranking .top .top-content .first .avatar {
+ width: 150rpx;
+ height: 166rpx;
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.love-ranking .top .top-content .first .avatar .avatar-bg {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+.love-ranking .top .top-content .first .avatar .avatar-content {
+ width: 134rpx;
+ height: 134rpx;
+ border-radius: 50%;
+ object-fit: cover;
+ position: relative;
+ z-index: 10;
+ top: 10rpx;
+}
+.love-ranking .top .top-content .first .num {
+ background: #FEDE66;
+ width: 40rpx;
+ height: 40rpxx;
+ line-height: 40rpx;
+ font-size: 30rpx;
+ bottom: -20rpx;
+ left: calc(50% - 20rpx);
+}
+.love-ranking .top .top-content .first .times {
+ margin-bottom: 50rpx
+}
+.love-ranking .top .top-content .second .avatar {
+ width: 108rpx;
+ height: 120rpx;
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.love-ranking .top .top-content .second .avatar .avatar-bg {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+.love-ranking .top .top-content .second .avatar .avatar-content {
+ width: 92rpx;
+ height: 92rpx;
+ border-radius: 50%;
+ object-fit: cover;
+ position: relative;
+ z-index: 10;
+ top: 8rpx;
+ left: 2rpx;
+}
+.love-ranking .top .top-content .second .num {
+ background: #DEDFE4;
+}
+.love-ranking .top .top-content .third .avatar {
+ width: 108rpx;
+ height: 120rpx;
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.love-ranking .top .top-content .third .avatar .avatar-bg {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+.love-ranking .top .top-content .third .avatar .avatar-content {
+ width: 92rpx;
+ height: 92rpx;
+ border-radius: 50%;
+ object-fit: cover;
+ position: relative;
+ z-index: 10;
+ top:4rpx;
+ top: 8rpx;
+ left: 2rpx;
+}
+.love-ranking .top .top-content .third .avatar .num {
+ background: #DAAF7C;
+}
+.love-ranking .top .top-content .third .times {
+ margin-bottom: 20rpx
+}
+
+.love-ranking .bottom {
+ width: 100%;
+ min-height: calc(100vh - 425rpx);
+ background: linear-gradient(to bottom, #fd880c, #feae02);
+ box-sizing: border-box;
+ padding: 0 20rpx 70rpx;
+}
+.love-ranking .bottom .love-ranking-list {
+ width: 100%;
+ background: #fff;
+ border-radius: 16rpx;
+ box-sizing: border-box;
+ padding: 0 20rpx;
+ 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;
+}
+.love-ranking .bottom .list-item .num {
+ font-size: 36rpx;
+ color: #333;
+ font-weight: bolder;
+ width: 60rpx;
+ text-indent: 6rpx;
+}
+.love-ranking .bottom .list-item .avatar {
+ width: 90rpx;
+ height: 90rpx;
+ object-fit: cover;
+ 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;
+ object-fit: cover;
+ margin-right: 6rpx;
+ margin-left: 20rpx;
+}
+
+
+.project-nodata {
+ width: 100%;
+ height: calc(100vh - 300rpx);
+ background: #f7f7f7;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+}
+ .project-nodata .nodata-image {
+ width: 256rpx;
+ height:245rpx;
+ object-fit: cover;
+}
+ .project-nodata .nodata-tip {
+ font-size: 28rpx;
+ color: #bcbcbc;
+ height: 50rpx;
+ line-height: 50rpx;
+}
diff --git a/subpages/heart/pages/myNews/myNews.js b/subpages/heart/pages/myNews/myNews.js
new file mode 100644
index 0000000..370adb4
--- /dev/null
+++ b/subpages/heart/pages/myNews/myNews.js
@@ -0,0 +1,65 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/myNews/myNews.json b/subpages/heart/pages/myNews/myNews.json
new file mode 100644
index 0000000..ecf0617
--- /dev/null
+++ b/subpages/heart/pages/myNews/myNews.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "我的消息"
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/myNews/myNews.wxml b/subpages/heart/pages/myNews/myNews.wxml
new file mode 100644
index 0000000..3d2f41a
--- /dev/null
+++ b/subpages/heart/pages/myNews/myNews.wxml
@@ -0,0 +1,20 @@
+
+
+
+
+
+ 互动通知
+
+
+
+ 查看详情
+
+
+
+
+
+ 活动提醒
+ 2019-08-26 16:56:02
+ 您报名的活动还有2天开始,立即查看
+
+
\ No newline at end of file
diff --git a/subpages/heart/pages/myNews/myNews.wxss b/subpages/heart/pages/myNews/myNews.wxss
new file mode 100644
index 0000000..212650b
--- /dev/null
+++ b/subpages/heart/pages/myNews/myNews.wxss
@@ -0,0 +1,95 @@
+.container{
+ width: 100%;
+}
+.info{
+ background-color: #fff;
+ border-radius: 20rpx;
+ margin: 13rpx 20rpx 0rpx 20rpx;
+ padding-bottom: 40rpx;
+}
+.info-box {
+ width: 100wh;
+ height: auto;
+ padding: 31rpx 25rpx;
+}
+.display-inline{display:inline}
+.info-left{
+ width: 50%;
+ float: left;
+}
+.info-right{
+ width: 50%;
+ float: left;
+ text-align: right;
+ word-wrap:break-word;
+}
+.color{
+ font-size:28rpx;
+ font-weight:500;
+ line-height: 56rpx;
+ color:rgba(255,197,41,1);
+}
+.info-left image{
+ width: 46rpx;
+ height: 46rpx;
+ position: relative;
+ top: 5rpx;
+}
+.info-font{
+ font-size:32rpx;
+ font-weight:500;
+ margin-left: 10rpx;
+ position: relative;
+ top: -5rpx;
+ color:rgba(51,51,51,1);
+}
+.info-red{
+ width: 15rpx;
+ height: 15rpx;
+ border-radius: 50%;
+ background-color: #FC5555;
+ position: relative;
+ margin-left: 180rpx;
+ top: -50rpx;
+}
+.clear{
+ clear: both;
+}
+
+
+.info-line{
+ height: 1rpx;
+ background-color: #EAEAEA;
+ width: 100whh;
+ margin: 0 10rpx;
+}
+
+.info-content-one{
+ font-size:36rpx;
+ font-weight:bold;
+ color:rgba(51,51,51,1);
+ margin: 26rpx 25rpx 0rpx 25rpx;
+}
+
+.info-content-two{
+ font-size:20rpx;
+ font-weight:500;
+ color:rgba(153,153,153,1);
+ margin: 14rpx 25rpx 0rpx 25rpx;
+}
+
+.info-content-three{
+ font-size:32rpx;
+ font-weight:500;
+ color:rgba(51,51,51,1);
+ margin: 27rpx 25rpx 0rpx 25rpx;
+}
+
+
+
+
+
+
+
+
+
diff --git a/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.js b/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.js
new file mode 100644
index 0000000..5a6e56e
--- /dev/null
+++ b/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.js
@@ -0,0 +1,44 @@
+const api = require('../../../../utils/api.js')
+
+Page({
+ data: {
+ detailObj: {
+ id: '',
+ title: '',
+ signupEndTime: '',
+ actStartTime: '',
+ actEndTime: '',
+ failureReason: ''
+ },
+ signupEndTime: '',
+ actStartTime: '',
+ actEndTime: '',
+ },
+ onLoad (options) {
+ this.getUnPassActivityDetail(options.id)
+ },
+ onShow () {
+
+ },
+ getUnPassActivityDetail (id) {
+ api.unpassActivityDetail(id).then(res => {
+ console.log('未通过活动详情', res)
+ for(const key in this.data.detailObj) {
+ this.data.detailObj[key] = res.data[key]
+ }
+ this.setData({
+ detailObj: this.data.detailObj,
+ signupEndTime: this.data.detailObj.signupEndTime.substring(0, 16),
+ actStartTime: this.data.detailObj.actStartTime.substring(0, 16),
+ actEndTime: this.data.detailObj.actEndTime.substring(0, 16),
+ })
+ }).catch(err => {
+ console.log(err)
+ })
+ },
+ toDetail () {
+ wx.navigateTo({
+ url: `/subpages/heart/pages/heartDetail/heartDetail?id=${this.data.detailObj.id}`
+ })
+ }
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.json b/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.json
new file mode 100644
index 0000000..7fe3f12
--- /dev/null
+++ b/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "未通过"
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.wxml b/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.wxml
new file mode 100644
index 0000000..d881462
--- /dev/null
+++ b/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.wxml
@@ -0,0 +1,33 @@
+
+
+
+ {{detailObj.title}}
+
+
+
+ 报名截止时间
+
+ {{signupEndTime}}
+
+
+
+
+ 活动时间
+
+ {{actStartTime}}至{{actEndTime}}
+
+
+
+
+
+
+ 未通过原因
+
+
+ {{detailObj.failureReason}}
+
+
+
+
+
+
diff --git a/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.wxss b/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.wxss
new file mode 100644
index 0000000..aef6cd0
--- /dev/null
+++ b/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail.wxss
@@ -0,0 +1,148 @@
+page {
+ width: 100%;
+ min-height: 100vh;
+ height: auto;
+ overflow-y: auto;
+ background: #f7f7f7;
+}
+.refuse-or-end {
+ width: 100%;
+ height: 100%;
+ background: #f7f7f7;
+ box-sizing: border-box;
+ padding: 15rpx 20rpx 20rpx;
+}
+
+.refuse-or-end .top {
+ width: 100%;
+ border-radius: 16rpx;
+ background: #fff;
+ box-sizing: border-box;
+ padding: 0 20rpx;
+}
+.refuse-or-end .top .title {
+ color: #333333;
+ font-size: 44rpx;
+ font-weight: bolder;
+ padding: 50rpx 0 40rpx;
+ line-height: 60rpx;
+ border-bottom: 1rpx solid #EAEAEA;
+}
+.refuse-or-end .top .endtime {
+ width: 100%;
+ border-bottom: 1rpx solid #EAEAEA;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 100rpx;
+}
+.refuse-or-end .top .endtime .left {
+ display: flex;
+ align-items: center;
+ height: 100%;
+}
+.refuse-or-end .top .endtime .left image {
+ width: 34rpx;
+ height: 34rpx;
+ object-fit: cover;
+ margin-right: 6rpx;
+}
+.refuse-or-end .top .endtime .left .endtime-tip {
+ font-size: 32rpx;
+ color: #999;
+}
+.refuse-or-end .top .endtime .content {
+ font-size: 32rpx;
+ color: #333333;
+}
+.refuse-or-end .top .activitytime {
+ width: 100%;
+ border-bottom: 1rpx solid #EAEAEA;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 100rpx;
+}
+.refuse-or-end .top .activitytime .left {
+ display: flex;
+ align-items: center;
+ height: 100%;
+}
+.refuse-or-end .top .activitytime .left image {
+ width: 34rpx;
+ height: 34rpx;
+ object-fit: cover;
+ margin-right: 6rpx;
+}
+.refuse-or-end .top .activitytime .left .activitytime-tip {
+ font-size: 32rpx;
+ color: #999;
+}
+.refuse-or-end .top .activitytime .content {
+ font-size: 32rpx;
+ color: #333333;
+ width: 50%;
+ text-align: right;
+}
+
+.refuse-or-end .bottom {
+ width: 100%;
+ border-radius: 16rpx;
+ background: #fff;
+ box-sizing: border-box;
+ padding: 0 20rpx;
+ margin-top: 15rpx;
+ min-height: calc(100vh - 15rpx - 15rpx - 15rpx - 450rpx);
+ position: relative;
+ overflow: hidden;
+}
+.refuse-or-end .bottom .reason {
+ width: 100%;
+ height: 108rpx;
+ border-bottom: 1rpx solid #EAEAEA;
+ display: flex;
+ align-items: center;
+}
+.refuse-or-end .bottom .reason image {
+ width: 38rpx;
+ height: 38rpx;
+ object-fit: cover;
+ margin-right: 6rpx;
+}
+.refuse-or-end .bottom .reason .tip {
+ font-size: 34rpx;
+ color: #333333;
+ font-weight: bolder;
+}
+.refuse-or-end .bottom .reason-content {
+ color: #333;
+ font-size:34rpx;
+ line-height: 52rpx;
+ margin-top: 12rpx;
+ margin-bottom: 125rpx;
+}
+.look-detail {
+ width: 100%;
+ height: 85rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: absolute;
+ bottom: 20rpx;
+ left: 0rpx;
+}
+.look-detail button {
+ width: 560rpx;
+ height: 85rpx;
+ line-height: 85rpx;
+ text-align:center;
+ margin: 0rpx;
+ padding: 0rpx;
+ color: #fff;
+ font-size: 36rpx;
+ border-radius: 16rpx;
+ background: linear-gradient(to right, #f70e0f, #ff4c4b);
+}
+.look-detail .hover-button {
+ background: red;
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/components/activityItem/activityItem.js b/subpages/heart/pages/signed/components/activityItem/activityItem.js
new file mode 100644
index 0000000..d4c79d2
--- /dev/null
+++ b/subpages/heart/pages/signed/components/activityItem/activityItem.js
@@ -0,0 +1,39 @@
+const app = getApp()
+
+Component({
+ data: {
+ imageUrl: '../../../../images/uploadImg3.png'
+ },
+ properties: {
+ activityItemObj: {
+ type: Object,
+ value: {}
+ },
+ actType: {
+ type: String,
+ value: 'tab0'
+ }
+ },
+ lifetimes: {
+ attached () {
+
+ }
+ },
+ pageLifetimes: {
+ show () {
+
+ }
+ },
+ methods: {
+ // 预览图片
+ previewImage (e) {
+ app.globalData.previewImage = true
+ wx.previewImage({
+ urls: [e.currentTarget.dataset.src]
+ })
+ },
+ toDetail (e) {
+ this.triggerEvent('toDetail', {detailId: e.currentTarget.dataset.detailid, actCurrentState: e.currentTarget.dataset.state})
+ }
+ }
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/components/activityItem/activityItem.json b/subpages/heart/pages/signed/components/activityItem/activityItem.json
new file mode 100644
index 0000000..32640e0
--- /dev/null
+++ b/subpages/heart/pages/signed/components/activityItem/activityItem.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/components/activityItem/activityItem.wxml b/subpages/heart/pages/signed/components/activityItem/activityItem.wxml
new file mode 100644
index 0000000..7df4fee
--- /dev/null
+++ b/subpages/heart/pages/signed/components/activityItem/activityItem.wxml
@@ -0,0 +1,31 @@
+
+
+
+ {{activityItemObj.actCurrentState == 0 ? '报名中' : activityItemObj.actCurrentState == 1 ? '已报满' : activityItemObj.actCurrentState == 2 ? '未开始' : activityItemObj.actCurrentState == 3 ? '进行中' : activityItemObj.actCurrentState == 4 ? '已结束' : activityItemObj.actCurrentState == 5 ? '已取消' : ''}}
+
+
+ {{activityItemObj.title}}
+
+
+
+ 活动时间:
+
+
+ {{activityItemObj.actStartTime}}至
+ {{activityItemObj.actEndTime}}
+
+
+
+
+
+ 活动地点:
+
+ {{activityItemObj.actAddress}}
+
+
+ 活动名额 {{activityItemObj.actQuotaCategory == 0 ? '不限' : activityItemObj.actQuota + '人'}}
+ 已报名 {{activityItemObj.signupNum}}人
+
+
+
+
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/components/activityItem/activityItem.wxss b/subpages/heart/pages/signed/components/activityItem/activityItem.wxss
new file mode 100644
index 0000000..19a6ccd
--- /dev/null
+++ b/subpages/heart/pages/signed/components/activityItem/activityItem.wxss
@@ -0,0 +1,148 @@
+.activity-item {
+ width: 100%;
+ height: 290rpx;
+ border-radius: 16rpx;
+ box-sizing: border-box;
+ padding: 20rpx;
+ display: flex;
+ background: #fff;
+ margin-bottom: 20rpx;
+}
+
+.activity-item .left {
+ width: 220rpx;
+ height: 246rpx;
+ border-radius: 16rpx;
+ overflow: hidden;
+ margin-right: 20rpx;
+ position: relative;
+}
+
+.activity-item .left .activity-image {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+
+.activity-item .left .user-state {
+ position: absolute;
+ left: 0;
+ top: 0;
+ font-size: 24rpx;
+ color: #fff;
+ width: 92rpx;
+ height: 36rpx;
+ line-height: 36rpx;
+ text-align: center;
+ border-radius: 16rpx 0;
+ background: #d1d1d1;
+}
+
+.activity-item .right {
+ width: calc(100% - 240rpx);
+ position: relative;
+}
+
+.activity-item .right .signed-logo {
+ width: 174rpx;
+ height: 118rpx;
+ object-fit: cover;
+ right: 0;
+ top: 20rpx;
+ position: absolute;
+}
+
+.activity-item .right .title {
+ font-size: 36rpx;
+ color: #333;
+ line-height: 44rpx;
+ display: -webkit-box;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ word-wrap: break-word;
+ white-space: normal !important;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+}
+
+.activity-item .right .activity-time {
+ font-size: 24rpx;
+ color: #a8a8a8;
+ line-height: 34rpx;
+ display: flex;
+}
+
+.activity-item .right .activity-time .activity-time-title {
+ display: flex;
+ align-items: center;
+ width: 150rpx;
+ height: 34rpx;
+}
+
+.activity-item .right .activity-time .activity-time-title image {
+ width: 24rpx;
+ height: 24rpx;
+ object-fit: cover;
+ margin-right: 4rpx;
+}
+
+.activity-item .right .activity-time .activity-time-content {
+ width: calc(100% - 150rpx);
+}
+
+.activity-item .right .activity-address {
+ font-size: 24rpx;
+ color: #a8a8a8;
+ line-height: 34rpx;
+ display: flex;
+ align-items: center;
+}
+
+.activity-item .right .activity-address .activity-address-title {
+ display: flex;
+ align-items: center;
+ width: 150rpx;
+}
+
+.activity-item .right .activity-address .activity-address-title image {
+ width: 24rpx;
+ height: 24rpx;
+ object-fit: cover;
+ margin-right: 4rpx;
+}
+
+.activity-item .right .activity-address .activity-address-content {
+ width: calc(100% - 150rpx);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.activity-item .right .activity-info {
+ display: flex;
+ align-items: center;
+ margin-top: 20rpx;
+}
+
+.activity-item .right .activity-info .num {
+ height: 42rpx;
+ line-height: 42rpx;
+ background: rgba(217, 217, 217, 0.4);
+ text-align: center;
+ font-size: 26rpx;
+ color: #666;
+ border-radius: 21rpx;
+ margin-right: 10rpx;
+ padding: 0 20rpx;
+}
+
+.activity-item .right .activity-info .already {
+ height: 42rpx;
+ line-height: 42rpx;
+ text-align: center;
+ background: rgba(252, 85, 85, 0.1);
+ color: #fc5555;
+ font-size: 26rpx;
+ border-radius: 21rpx;
+ padding: 0 20rpx;
+}
diff --git a/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.js b/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.js
new file mode 100644
index 0000000..a8352da
--- /dev/null
+++ b/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.js
@@ -0,0 +1,5 @@
+Component({
+ data: {
+
+ }
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.json b/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.json
new file mode 100644
index 0000000..32640e0
--- /dev/null
+++ b/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.wxml b/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.wxml
new file mode 100644
index 0000000..31e866b
--- /dev/null
+++ b/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.wxml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.wxss b/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.wxss
new file mode 100644
index 0000000..65d13d0
--- /dev/null
+++ b/subpages/heart/pages/signed/components/preloadActivityItem/preloadActivityItem.wxss
@@ -0,0 +1,61 @@
+.preload-activity-item {
+ width: 100%;
+ height: 290rpx;
+ border-radius: 16rpx;
+ box-sizing: border-box;
+ padding: 20rpx;
+ display: flex;
+ background: #fff;
+ margin-bottom: 20rpx;
+}
+.preload-activity-item .left {
+ width: 220rpx;
+ height: 246rpx;
+ border-radius: 16rpx;
+ overflow: hidden;
+ margin-right: 20rpx;
+ background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
+ animation: loading 1.4s ease infinite;
+ background-size: 400% 100%;
+}
+.preload-activity-item .right {
+ width: calc(100% - 240rpx);
+}
+.preload-activity-item .right .title {
+ height: 44rpx;
+ margin-top: 20rpx;
+ background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
+ animation: loading 1.4s ease infinite;
+ background-size: 400% 100%;
+}
+.preload-activity-item .right .activity-time {
+ height: 34rpx;
+ margin-top: 20rpx;
+ background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
+ animation: loading 1.4s ease infinite;
+ background-size: 400% 100%;
+}
+.preload-activity-item .right .activity-address {
+ height: 34rpx;
+ margin-top: 20rpx;
+ background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
+ animation: loading 1.4s ease infinite;
+ background-size: 400% 100%;
+}
+.preload-activity-item .right .activity-info {
+ margin-top: 20rpx;
+ height: 44rpx;
+ background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
+ animation: loading 1.4s ease infinite;
+ background-size: 400% 100%;
+}
+
+@keyframes loading {
+ 0% {
+ background-position: 100% 50%
+ }
+
+ 100% {
+ background-position: 0 50%
+ }
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/signed.js b/subpages/heart/pages/signed/signed.js
new file mode 100644
index 0000000..60f8527
--- /dev/null
+++ b/subpages/heart/pages/signed/signed.js
@@ -0,0 +1,130 @@
+import { getTimestamp } from '../../../../utils/common'
+const api = require('../../../../utils/api')
+const app = getApp()
+
+Page({
+ data: {
+ selectedTab: 'tab0',
+ loadMoreVisible: false,
+ loadMoreType: 'none',
+ pageNo: 1,
+ pageSize: 10,
+ signedList: [],
+ preloadVisible: true,
+ timer: '',
+ timestamp: getTimestamp()
+ },
+ onLoad () {
+ this.setData({
+ timestamp: getTimestamp(),
+ })
+ this.getSignedList()
+ },
+ onShow () {
+ if (!app.globalData.previewImage) {
+ console.log('过滤previewImage引起的onShow')
+ }
+ app.globalData.previewImage = false
+ },
+ onReady () {
+ this.pullDownRefresh = this.selectComponent('#pulldown-refresh')
+ },
+ onPageScroll (e) {
+ this.pullDownRefresh.onPageScroll(e)
+ },
+ onReachBottom () {
+ this.setData({
+ loadMoreVisible: true
+ })
+ if (this.data.loadMoreType === 'loading') {
+ this.setData({
+ pageNo: this.data.pageNo + 1
+ })
+ this.getSignedList()
+ }
+ },
+ // 列表 下拉刷新, 初始化加载
+ pulldownRefresh () {
+ this.setData({
+ pageNo: 1,
+ pageSize: 10,
+ loadMoreVisible: false,
+ loadMoreType: 'none',
+ preloadVisible: true,
+ signedList: [],
+ timestamp: getTimestamp()
+ })
+ const para = {
+ pageIndex: this.data.pageNo,
+ pageSize: this.data.pageSize,
+ timestamp: this.data.timestamp,
+ actType: this.data.selectedTab.substr(3,1)
+ }
+ api.getSignedList(para).then(res => {
+ this.pullDownRefresh.stopRefresh()
+ console.log('已报名活动', res)
+ this.setData({
+ signedList: [...res.data],
+ loadMoreType: res.data.length === 10 ? 'loading' : 'none',
+ preloadVisible: false
+ })
+ }).catch(err => {
+ this.pullDownRefresh.stopRefresh()
+ this.setData({
+ signedList: [],
+ loadMoreType: 'none',
+ preloadVisible: false
+ })
+ console.log(err)
+ })
+ },
+ // 列表 上拉加载
+ getSignedList () {
+ const para = {
+ pageIndex: this.data.pageNo,
+ pageSize: this.data.pageSize,
+ timestamp: this.data.timestamp,
+ actType: this.data.selectedTab.substr(3,1)
+ }
+ api.getSignedList(para).then(res => {
+ console.log('已报名活动', res)
+ this.setData({
+ signedList: [...this.data.signedList,...res.data],
+ loadMoreType: res.data.length === 10 ? 'loading' : 'none',
+ preloadVisible: false
+ })
+ }).catch(err => {
+ this.setData({
+ signedList: [],
+ loadMoreType: 'none',
+ preloadVisible: false
+ })
+ console.log(err)
+ }).finally(() => {
+ this.pullDownRefresh.stopRefresh()
+ })
+ },
+ // tab 切换
+ tabBarChange (e) {
+ this.setData({
+ selectedTab: e.currentTarget.dataset.tab
+ })
+ this.pulldownRefresh()
+ },
+ // 查看详情
+ toDetail (e) {
+ if (this.data.selectedTab === 'tab4') {
+ wx.navigateTo({
+ url: `/subpages/heart/pages/refusedOrEndedDetail/refusedOrEndedDetail?id=${e.detail.detailId}`
+ })
+ } else if (e.detail.actCurrentState == 5) {
+ wx.navigateTo({
+ url: `/subpages/heart/pages/cancelDetail/cancelDetail?id=${e.detail.detailId}`
+ })
+ } else {
+ wx.navigateTo({
+ url: `/subpages/heart/pages/heartDetail/heartDetail?id=${e.detail.detailId}`
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/signed.json b/subpages/heart/pages/signed/signed.json
new file mode 100644
index 0000000..a668d5e
--- /dev/null
+++ b/subpages/heart/pages/signed/signed.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "已报名活动",
+ "usingComponents": {
+ "activity-item": "./components/activityItem/activityItem",
+ "pulldown-refresh": "/components/pullDownRefresh/pullDownRefresh",
+ "load-more": "/components/loadMore/loadMore",
+ "preload-activity-item": "./components/preloadActivityItem/preloadActivityItem"
+ }
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/signed.wxml b/subpages/heart/pages/signed/signed.wxml
new file mode 100644
index 0000000..79921a1
--- /dev/null
+++ b/subpages/heart/pages/signed/signed.wxml
@@ -0,0 +1,37 @@
+
+
+
+ 审核中
+ 已通过
+ 未通过
+ 已结束
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无数据
+
+
+
+
+
\ No newline at end of file
diff --git a/subpages/heart/pages/signed/signed.wxss b/subpages/heart/pages/signed/signed.wxss
new file mode 100644
index 0000000..4002ab4
--- /dev/null
+++ b/subpages/heart/pages/signed/signed.wxss
@@ -0,0 +1,81 @@
+page {
+ width: 100%;
+ min-height: 100vh;
+ height: auto;
+ overflow-y: auto;
+}
+.signed-list {
+ width: 100%;
+ height: 100%;
+ background: #f7f7f7;
+}
+
+.tab-bar {
+ width: 100%;
+ height: 98rpx;
+ background: #fff;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+.tab-bar .tab {
+ font-size: 30rpx;
+ color: #999;
+ width: 165rpx;
+ height: 100%;
+ line-height: 98rpx;
+ text-indent: 20rpx;
+ position: relative;
+ z-index: 10;
+}
+.tab-bar .tab.select {
+ font-size:36rpx;
+ color: #333;
+ font-weight: bolder;
+}
+.tab-bar .select-bar {
+ position: absolute;
+ left: 14rpx;
+ bottom: 26rpx;
+ width: 120rpx;
+ height: 12rpx;
+ border-radius: 12rpx;
+ background: #fc5555;
+ z-index: 1;
+}
+.tab-bar .tab0.select-bar {
+ left: 14rpx;
+ transition: left 0.3s linear;
+}
+.tab-bar .tab1.select-bar {
+ left: 179rpx;
+ transition: left 0.3s linear;
+}
+.tab-bar .tab4.select-bar {
+ left: 344rpx;
+ transition: left 0.3s linear;
+}
+.tab-bar .tab5.select-bar {
+ left: 509rpx;
+ transition: left 0.3s linear;
+}
+.tab-bar .hover-tab {
+ background: #f7f7f7;
+}
+
+.activity-list {
+ width: 100%;
+ min-height: calc(100vh - 198rpx);
+ box-sizing: border-box;
+ padding: 15rpx 20rpx;
+}
+.activity-list .no-data {
+ width:100%;
+ height: calc(100vh - 238rpx);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 30rpx;
+ color: #999;
+ background: #f7f7f7;
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/volunteer/volunteer.js b/subpages/heart/pages/volunteer/volunteer.js
new file mode 100644
index 0000000..dee7ad5
--- /dev/null
+++ b/subpages/heart/pages/volunteer/volunteer.js
@@ -0,0 +1,319 @@
+const api = require('../../../../utils/api')
+import { $wuxDialog } from '../../../../dist/index'
+const app = getApp()
+Page({
+
+ /**
+ * 页面的初始数据 全部为必填项
+ */
+ data: {
+ realName: '',//真实姓名
+ mobile: '',//手机号
+ identityNo: '',//身份证号码
+ road: '',//所在道路
+ villageName: '',//小区名
+ dwellingPlace: '',//住处(楼栋-单元-房间)
+ gridId: Number,//居住网格id
+ gridName:'',
+ wxCode: '',//用户unionId为空时 传入
+ encryptedData: '',//用户unionId为空时 传入
+ iv: '',//用户unionId为空时 传入
+ introduce: '',//自我介绍
+ unionIdStatus: '0',
+ wait: 60,
+ smsCode: '',
+ btntxt: '获取验证码',
+ dialogTitle: '',
+ dialogContent: '',
+ dialogConfirmText: '',
+ dialogCancelText: '',
+ getMobileType: 'wx',
+ smsCodeText: '获取验证码'
+ },
+ onLoad: function (options) {
+ this.getPrepareComplete().then(res => {
+ this.getGridList()
+ })
+ this.checkWxUnionId()
+ this.getWxCode()
+ },
+ bindRealNameInput (e) {
+ this.setData({
+ realName: e.detail.value
+ })
+ },
+ bindMobileInput (e) {
+ this.setData({
+ mobile: e.detail.value
+ })
+ },
+ bindSmsCodeInput (e) {
+ this.setData({
+ smsCode: e.detail.value
+ })
+ },
+ bindIdentityNoInput (e) {
+ this.setData({
+ identityNo: e.detail.value
+ })
+ },
+
+ adInputStreet (e) {
+ this.setData({
+ road: e.detail.value
+ })
+ },
+
+ adInputCommunity (e) {
+ this.setData({
+ villageName: e.detail.value
+ })
+ },
+
+ adInputBuilding (e) {
+ this.setData({
+ dwellingPlace: e.detail.value
+ })
+ },
+
+ adInputIntroduce (e) {
+ this.setData({
+ introduce: e.detail.value
+ })
+ },
+ // 查看用户是否完善个人信息
+ checkWxUnionId() {
+ api.checkWxUnionId().then(res => {
+ console.log('查看用户是否已保存unionId', res)
+ this.setData({
+ unionIdStatus: res.data
+ })
+ }).catch(err => {
+ this.setData({
+ unionIdStatus: '0'
+ })
+ console.log(err)
+ })
+ },
+ // 获取wxCode
+ getWxCode() {
+ const that = this
+ wx.login({
+ success(res) {
+ that.setData({
+ wxCode: res.code
+ })
+ }
+ })
+ },
+ // 获取用户信息
+ getUserInfo(e) {
+ this.setData({
+ encryptedData: e.detail.encryptedData,
+ iv: e.detail.iv
+ })
+ this.submission()
+ },
+ // 拉取 用户信息
+ getPrepareComplete() {
+ return new Promise((resolve, reject) => {
+ api.prepareComplete().then(res => {
+ console.log('拉取用户信息', res)
+ this.setData({
+ identityNo: res.data.identityNo,
+ realName: res.data.realName,
+ mobile: res.data.mobile,
+ road: res.data.road,
+ villageName: res.data.villageName,
+ dwellingPlace: res.data.dwellingPlace,
+ state: res.data.state,
+ gridId: res.data.gridId,
+ gridName: res.data.gridName
+ })
+ resolve(true)
+ }).catch(err => {
+ reject(false)
+ })
+ })
+ },
+ // 获取所有网格
+ getGridList() {
+ api.getGridList().then(res => {
+ console.log('获取所有网格', res)
+ const buttonList = []
+ res.data.forEach(item => {
+ if (item.gridId !== this.data.gridId) {
+ buttonList.push({
+ id: item.gridId,
+ text: item.grid
+ })
+ }
+ })
+ this.setData({
+ gridList: res.data,
+ changeGridList: buttonList
+ })
+ }).catch(err => {
+ this.setData({
+ gridList: []
+ })
+ console.log(err)
+ })
+ },
+ // 志愿者认证提交
+ submission() {
+ if (!this.data.realName) {
+ this.showToast('请输入姓名')
+ return false
+ }
+ if (!this.data.identityNo) {
+ this.showToast('请输入身份证号')
+ return false
+ }
+ if(this.data.getMobileType === 'wx') {
+ if (!this.data.mobile) {
+ this.showToast('请获取手机号')
+ return false
+ }
+ } else if (this.data.getMobileType === 'self') {
+ if (!this.data.mobile) {
+ this.showToast('请输入手机号')
+ return false
+ }
+ if (!this.data.smsCode) {
+ this.showToast('请输入验证码')
+ return false
+ }
+ }
+ if (!this.data.road) {
+ this.showToast('请输入所在道路')
+ return false
+ }
+ if (!this.data.introduce) {
+ this.showToast('请输入自我介绍')
+ return false
+ }
+
+ if (!this.data.introduce.length > 200) {
+ this.showToast('自我介绍输入内容不超过200字')
+ return false
+ }
+ const params = {
+ smsCode: this.data.smsCode,
+ realName: this.data.realName,
+ mobile: this.data.mobile,
+ identityNo: this.data.identityNo,
+ road: this.data.road,
+ villageName: this.data.villageName,
+ dwellingPlace: this.data.dwellingPlace,
+ gridId: this.data.gridId,
+ introduce: this.data.introduce,
+ wxCode: this.data.unionIdStatus === '1' ? '' : this.data.wxCode,
+ encryptedData: this.data.unionIdStatus === '1' ? '' : this.data.encryptedData,
+ iv: this.data.unionIdStatus === '1' ? '' : this.data.iv
+ }
+ wx.showLoading({
+ title: '正在提交',
+ })
+ api.authenticate(params).then( res => {
+ wx.hideLoading()
+
+ let state = res.data.userState
+ app.globalData.infoCompleted = state
+ wx.removeStorageSync('token')
+ wx.setStorageSync('token', res.data.token)
+
+ this.setData({
+ dialogVisible: !this.data.dialogVisible,
+ dialogTitle: '志愿者认证',
+ dialogContent: ['您已认证成功,快去报名吧'],
+ dialogConfirmText: '是',
+ dialogCancelText: '否'
+ })
+ })
+ },
+ confirmDialog () {
+ wx.navigateBack({
+ delta: 1
+ })
+ },
+ changeGetMobileType () {
+ let type = 'wx'
+ if (this.data.getMobileType === 'wx') {
+ type = 'self'
+ } else if (this.data.getMobileType === 'self') {
+ type = 'wx'
+ }
+ this.setData({
+ getMobileType: type
+ })
+ },
+ // 获取验证码
+ getSmsCode () {
+ if (!this.data.mobile) {
+ this.showToast('请先输入手机号')
+ return false
+ }
+ this.setData({
+ smsCodeText: '获取中...'
+ })
+ const mobile = this.data.mobile
+ api.sendSms(mobile).then(res => {
+ this.showToast('验证码发送成功')
+ let num = 60
+ this.setData({
+ smsCodeText: "60s后重新获取"
+ })
+ const timer = setInterval(() => {
+ if (num >= 1) {
+ this.setData({
+ smsCodeText: `${num}s后重新获取`
+ })
+ --num
+ } else {
+ clearInterval(timer)
+ this.setData({
+ smsCodeText: '获取验证码'
+ })
+ }
+ }, 1000)
+ }).catch(err =>{
+ console.log(err)
+ this.setData({
+ smsCodeText: '获取验证码'
+ })
+ })
+ },
+ // 获取手机号
+ getPhoneNumber (e) {
+ if (e.detail.errMsg === 'getPhoneNumber:ok') {
+ const para = {
+ wxCode: '',
+ encryptedData: e.detail.encryptedData,
+ iv: e.detail.iv
+ }
+ const that = this
+ wx.login({
+ success (res) {
+ para.wxCode = res.code
+ api.getWxPhone(para).then(data => {
+ console.log('获取微信手机号', data)
+ that.setData({
+ mobile: data.data
+ })
+ }).catch(err => {
+ console.log(err)
+ })
+ }
+ })
+ }
+ },
+ // 代码简化,弹窗统一封装
+ showToast (title) {
+ wx.showToast({
+ title: title,
+ icon: 'none',
+ duration: 2000
+ })
+ },
+})
\ No newline at end of file
diff --git a/subpages/heart/pages/volunteer/volunteer.json b/subpages/heart/pages/volunteer/volunteer.json
new file mode 100644
index 0000000..2bbd9ca
--- /dev/null
+++ b/subpages/heart/pages/volunteer/volunteer.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "志愿者认证",
+ "usingComponents": {
+ "wux-dialog": "../../../../dist/dialog/index",
+ "coverview-dialog": "../../components/coverViewDialog/coverViewDialog"
+ }
+}
\ No newline at end of file
diff --git a/subpages/heart/pages/volunteer/volunteer.wxml b/subpages/heart/pages/volunteer/volunteer.wxml
new file mode 100644
index 0000000..711f01b
--- /dev/null
+++ b/subpages/heart/pages/volunteer/volunteer.wxml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+ 姓名
+
+
+
+
+
+
+
+ *
+ 身份证号
+
+
+
+
+
+
+
+ *
+ 手机号
+
+
+
+
+
+
+
+
+ *
+ 手机号
+
+
+
+
+
+
+
+ *
+ 验证码
+
+
+
+
+
+
+
+
+ {{getMobileType === 'wx' ? '*如若获取手机号异常,请点击切换至手机号/验证码注册方式' : '*点击可切回至从微信获取手机号注册方式'}}
+
+
+
+
+
+
+
+
+
+ {{gridName}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/subpages/heart/pages/volunteer/volunteer.wxss b/subpages/heart/pages/volunteer/volunteer.wxss
new file mode 100644
index 0000000..70d2793
--- /dev/null
+++ b/subpages/heart/pages/volunteer/volunteer.wxss
@@ -0,0 +1,242 @@
+.container{
+ width: 100%;
+}
+.top-bg{
+ width: 100%;
+ height: 354rpx;
+}
+.top-bg image{
+ width: 100%;
+ height: 290rpx;
+}
+.position-absolute{
+ position: absolute;
+ top: 225rpx;
+ left: 20rpx;
+ right: 20rpx;
+}
+.info{
+ background-color: #fff;
+ border-radius: 20rpx;
+}
+.info-box {
+ width: 100wh;
+ height: auto;
+ border-bottom: 1rpx solid #e7eeee;
+ padding: 35rpx 0rpx;
+ margin: 0rpx 20rpx;
+}
+
+.info-box-last {
+ width: 100wh;
+ height: auto;
+ padding: 35rpx 0rpx;
+ margin: 0rpx 20rpx;
+}
+
+.info-left{
+ width: 40%;
+ float: left;
+ word-wrap:break-word;
+}
+.name{
+ font-size:34rpx;
+ font-family:PingFang SC;
+ font-weight:500;
+ color:rgba(51,51,51,1);
+}
+
+.info-right{
+ width: 60%;
+ float: left;
+ text-align: right;
+ word-wrap:break-word;
+}
+.address{
+ text-align: right;
+ word-wrap:break-word;
+}
+.introduce{
+ text-align: left;
+ font-size:34rpx;
+ color:rgba(51,51,51,1);
+}
+.clear{
+ clear: both;
+}
+.red-button{
+ width: 144rpx;
+ height: 44rpx;
+ 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);
+ border-radius: 15rpx;
+ margin-top: 5rpx;
+ float: right;
+}
+.yzm{
+ float: right;
+ margin-right: 36rpx;
+ width: 190rpx;
+}
+.magin-top{
+ margin-top: 15rpx;
+}
+
+textarea {
+width: auto;
+}
+.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);
+ text-align: center;
+ line-height: 84rpx;
+ border-radius: 20rpx;
+ margin: 80rpx 95rpx 63rpx 75rpx;
+}
+
+
+.submit-btn {
+ width: 100%;
+ height: 85rpx;
+ display: flex;
+ justify-content: center;
+ align-items:center;
+ margin-top: 40rpx;
+ margin-bottom: 40rpx;
+
+}
+.submit-btn button {
+ background: linear-gradient(to right, #f51010, #ff4c4c);
+ width: 560rpx;
+ height: 85rpx;
+ border-radius: 16rpx;
+ line-height: 85rpx;
+ font-size: 36rpx;
+ color: #fff;
+ text-align: center;
+ margin: 0;
+ padding: 0;
+ outline: 0;
+}
+.submit-btn .hover-button {
+ background: red;
+}
+
+
+.basic-info {
+ width: 100%;
+ background: #fff;
+ border-radius: 16rpx;
+ box-sizing: border-box;
+ padding: 0 20rpx;
+ margin-top: 20rpx;
+}
+.basic-info .list-item {
+ width: 100%;
+ height: 100rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.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;
+ color: #333;
+ 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;
+ line-height: 60rpx;
+ background: linear-gradient(to right, #F40C0C, #FF4E4E);
+ color: #fff;
+ font-size: 24rpx;
+ border-radius: 6rpx;
+ margin: 0;
+ margin-left: 25rpx;
+}
+.basic-info .list-item .right .button-hover {
+ background: rgb(175, 1, 1);
+}
+
+.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);
+}
+
+.note {
+ font-size: 22rpx;
+ color: #999;
+ line-height: 62rpx;
+}
+.header {
+ color: #333;
+ font-size:34rpx;
+ font-weight: bold;
+}
\ No newline at end of file
diff --git a/subpages/heart/utils/qqmap-wx-jssdk.js b/subpages/heart/utils/qqmap-wx-jssdk.js
new file mode 100644
index 0000000..9724e31
--- /dev/null
+++ b/subpages/heart/utils/qqmap-wx-jssdk.js
@@ -0,0 +1,1123 @@
+/**
+ * 微信小程序JavaScriptSDK
+ *
+ * @version 1.2
+ * @date 2019-03-06
+ * @author v_ylyue@tencent.com
+ */
+
+var ERROR_CONF = {
+ KEY_ERR: 311,
+ KEY_ERR_MSG: 'key格式错误',
+ PARAM_ERR: 310,
+ PARAM_ERR_MSG: '请求参数信息有误',
+ SYSTEM_ERR: 600,
+ SYSTEM_ERR_MSG: '系统错误',
+ WX_ERR_CODE: 1000,
+ WX_OK_CODE: 200
+};
+var BASE_URL = 'https://apis.map.qq.com/ws/';
+var URL_SEARCH = BASE_URL + 'place/v1/search';
+var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion';
+var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/';
+var URL_CITY_LIST = BASE_URL + 'district/v1/list';
+var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren';
+var URL_DISTANCE = BASE_URL + 'distance/v1/';
+var URL_DIRECTION = BASE_URL + 'direction/v1/';
+var MODE = {
+ driving: 'driving',
+ transit: 'transit'
+};
+var EARTH_RADIUS = 6378136.49;
+var Utils = {
+ /**
+ * md5加密方法
+ * 版权所有©2011 Sebastian Tschan,https://blueimp.net
+ */
+ safeAdd(x, y) {
+ var lsw = (x & 0xffff) + (y & 0xffff);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xffff);
+ },
+ bitRotateLeft(num, cnt) {
+ return (num << cnt) | (num >>> (32 - cnt));
+ },
+ md5cmn(q, a, b, x, s, t) {
+ return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b);
+ },
+ md5ff(a, b, c, d, x, s, t) {
+ return this.md5cmn((b & c) | (~b & d), a, b, x, s, t);
+ },
+ md5gg(a, b, c, d, x, s, t) {
+ return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t);
+ },
+ md5hh(a, b, c, d, x, s, t) {
+ return this.md5cmn(b ^ c ^ d, a, b, x, s, t);
+ },
+ md5ii(a, b, c, d, x, s, t) {
+ return this.md5cmn(c ^ (b | ~d), a, b, x, s, t);
+ },
+ binlMD5(x, len) {
+ /* append padding */
+ x[len >> 5] |= 0x80 << (len % 32);
+ x[((len + 64) >>> 9 << 4) + 14] = len;
+
+ var i;
+ var olda;
+ var oldb;
+ var oldc;
+ var oldd;
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+
+ for (i = 0; i < x.length; i += 16) {
+ olda = a;
+ oldb = b;
+ oldc = c;
+ oldd = d;
+
+ a = this.md5ff(a, b, c, d, x[i], 7, -680876936);
+ d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586);
+ c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819);
+ b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
+ a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897);
+ d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
+ c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
+ b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983);
+ a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
+ d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
+ c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063);
+ b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
+ a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
+ d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101);
+ c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
+ b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
+
+ a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510);
+ d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
+ c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713);
+ b = this.md5gg(b, c, d, a, x[i], 20, -373897302);
+ a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691);
+ d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083);
+ c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335);
+ b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848);
+ a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438);
+ d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
+ c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961);
+ b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
+ a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
+ d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784);
+ c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
+ b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
+
+ a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558);
+ d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
+ c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
+ b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556);
+ a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
+ d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
+ c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632);
+ b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
+ a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174);
+ d = this.md5hh(d, a, b, c, x[i], 11, -358537222);
+ c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979);
+ b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189);
+ a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487);
+ d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835);
+ c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520);
+ b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651);
+
+ a = this.md5ii(a, b, c, d, x[i], 6, -198630844);
+ d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
+ c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
+ b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055);
+ a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
+ d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
+ c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523);
+ b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
+ a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
+ d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744);
+ c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
+ b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
+ a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070);
+ d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
+ c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259);
+ b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551);
+
+ a = this.safeAdd(a, olda);
+ b = this.safeAdd(b, oldb);
+ c = this.safeAdd(c, oldc);
+ d = this.safeAdd(d, oldd);
+ }
+ return [a, b, c, d];
+ },
+ binl2rstr(input) {
+ var i;
+ var output = '';
+ var length32 = input.length * 32;
+ for (i = 0; i < length32; i += 8) {
+ output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff);
+ }
+ return output;
+ },
+ rstr2binl(input) {
+ var i;
+ var output = [];
+ output[(input.length >> 2) - 1] = undefined;
+ for (i = 0; i < output.length; i += 1) {
+ output[i] = 0;
+ }
+ var length8 = input.length * 8;
+ for (i = 0; i < length8; i += 8) {
+ output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32);
+ }
+ return output;
+ },
+ rstrMD5(s) {
+ return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8));
+ },
+ rstrHMACMD5(key, data) {
+ var i;
+ var bkey = this.rstr2binl(key);
+ var ipad = [];
+ var opad = [];
+ var hash;
+ ipad[15] = opad[15] = undefined;
+ if (bkey.length > 16) {
+ bkey = this.binlMD5(bkey, key.length * 8);
+ }
+ for (i = 0; i < 16; i += 1) {
+ ipad[i] = bkey[i] ^ 0x36363636;
+ opad[i] = bkey[i] ^ 0x5c5c5c5c;
+ }
+ hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8);
+ return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128));
+ },
+ rstr2hex(input) {
+ var hexTab = '0123456789abcdef';
+ var output = '';
+ var x;
+ var i;
+ for (i = 0; i < input.length; i += 1) {
+ x = input.charCodeAt(i);
+ output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f);
+ }
+ return output;
+ },
+ str2rstrUTF8(input) {
+ return unescape(encodeURIComponent(input));
+ },
+ rawMD5(s) {
+ return this.rstrMD5(this.str2rstrUTF8(s));
+ },
+ hexMD5(s) {
+ return this.rstr2hex(this.rawMD5(s));
+ },
+ rawHMACMD5(k, d) {
+ return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d));
+ },
+ hexHMACMD5(k, d) {
+ return this.rstr2hex(this.rawHMACMD5(k, d));
+ },
+
+ md5(string, key, raw) {
+ if (!key) {
+ if (!raw) {
+ return this.hexMD5(string);
+ }
+ return this.rawMD5(string);
+ }
+ if (!raw) {
+ return this.hexHMACMD5(key, string);
+ }
+ return this.rawHMACMD5(key, string);
+ },
+ /**
+ * 得到md5加密后的sig参数
+ * @param {Object} requestParam 接口参数
+ * @param {String} sk签名字符串
+ * @param {String} featrue 方法名
+ * @return 返回加密后的sig参数
+ */
+ getSig(requestParam, sk, feature, mode) {
+ var sig = null;
+ var requestArr = [];
+ Object.keys(requestParam).sort().forEach(function(key){
+ requestArr.push(key + '=' + requestParam[key]);
+ });
+ if (feature == 'search') {
+ sig = '/ws/place/v1/search?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'suggest') {
+ sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'reverseGeocoder') {
+ sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'geocoder') {
+ sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'getCityList') {
+ sig = '/ws/district/v1/list?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'getDistrictByCityId') {
+ sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'calculateDistance') {
+ sig = '/ws/distance/v1/?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'direction') {
+ sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk;
+ }
+ sig = this.md5(sig);
+ return sig;
+ },
+ /**
+ * 得到终点query字符串
+ * @param {Array|String} 检索数据
+ */
+ location2query(data) {
+ if (typeof data == 'string') {
+ return data;
+ }
+ var query = '';
+ for (var i = 0; i < data.length; i++) {
+ var d = data[i];
+ if (!!query) {
+ query += ';';
+ }
+ if (d.location) {
+ query = query + d.location.lat + ',' + d.location.lng;
+ }
+ if (d.latitude && d.longitude) {
+ query = query + d.latitude + ',' + d.longitude;
+ }
+ }
+ return query;
+ },
+
+ /**
+ * 计算角度
+ */
+ rad(d) {
+ return d * Math.PI / 180.0;
+ },
+ /**
+ * 处理终点location数组
+ * @return 返回终点数组
+ */
+ getEndLocation(location){
+ var to = location.split(';');
+ var endLocation = [];
+ for (var i = 0; i < to.length; i++) {
+ endLocation.push({
+ lat: parseFloat(to[i].split(',')[0]),
+ lng: parseFloat(to[i].split(',')[1])
+ })
+ }
+ return endLocation;
+ },
+
+ /**
+ * 计算两点间直线距离
+ * @param a 表示纬度差
+ * @param b 表示经度差
+ * @return 返回的是距离,单位m
+ */
+ getDistance(latFrom, lngFrom, latTo, lngTo) {
+ var radLatFrom = this.rad(latFrom);
+ var radLatTo = this.rad(latTo);
+ var a = radLatFrom - radLatTo;
+ var b = this.rad(lngFrom) - this.rad(lngTo);
+ var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2)));
+ distance = distance * EARTH_RADIUS;
+ distance = Math.round(distance * 10000) / 10000;
+ return parseFloat(distance.toFixed(0));
+ },
+ /**
+ * 使用微信接口进行定位
+ */
+ getWXLocation(success, fail, complete) {
+ wx.getLocation({
+ type: 'gcj02',
+ success: success,
+ fail: fail,
+ complete: complete
+ });
+ },
+
+ /**
+ * 获取location参数
+ */
+ getLocationParam(location) {
+ if (typeof location == 'string') {
+ var locationArr = location.split(',');
+ if (locationArr.length === 2) {
+ location = {
+ latitude: location.split(',')[0],
+ longitude: location.split(',')[1]
+ };
+ } else {
+ location = {};
+ }
+ }
+ return location;
+ },
+
+ /**
+ * 回调函数默认处理
+ */
+ polyfillParam(param) {
+ param.success = param.success || function () { };
+ param.fail = param.fail || function () { };
+ param.complete = param.complete || function () { };
+ },
+
+ /**
+ * 验证param对应的key值是否为空
+ *
+ * @param {Object} param 接口参数
+ * @param {String} key 对应参数的key
+ */
+ checkParamKeyEmpty(param, key) {
+ if (!param[key]) {
+ var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误');
+ param.fail(errconf);
+ param.complete(errconf);
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ * 验证参数中是否存在检索词keyword
+ *
+ * @param {Object} param 接口参数
+ */
+ checkKeyword(param){
+ return !this.checkParamKeyEmpty(param, 'keyword');
+ },
+
+ /**
+ * 验证location值
+ *
+ * @param {Object} param 接口参数
+ */
+ checkLocation(param) {
+ var location = this.getLocationParam(param.location);
+ if (!location || !location.latitude || !location.longitude) {
+ var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误');
+ param.fail(errconf);
+ param.complete(errconf);
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * 构造错误数据结构
+ * @param {Number} errCode 错误码
+ * @param {Number} errMsg 错误描述
+ */
+ buildErrorConfig(errCode, errMsg) {
+ return {
+ status: errCode,
+ message: errMsg
+ };
+ },
+
+ /**
+ *
+ * 数据处理函数
+ * 根据传入参数不同处理不同数据
+ * @param {String} feature 功能名称
+ * search 地点搜索
+ * suggest关键词提示
+ * reverseGeocoder逆地址解析
+ * geocoder地址解析
+ * getCityList获取城市列表:父集
+ * getDistrictByCityId获取区县列表:子集
+ * calculateDistance距离计算
+ * @param {Object} param 接口参数
+ * @param {Object} data 数据
+ */
+ handleData(param,data,feature){
+ if (feature == 'search') {
+ var searchResult = data.data;
+ var searchSimplify = [];
+ for (var i = 0; i < searchResult.length; i++) {
+ searchSimplify.push({
+ id: searchResult[i].id || null,
+ title: searchResult[i].title || null,
+ latitude: searchResult[i].location && searchResult[i].location.lat || null,
+ longitude: searchResult[i].location && searchResult[i].location.lng || null,
+ address: searchResult[i].address || null,
+ category: searchResult[i].category || null,
+ tel: searchResult[i].tel || null,
+ adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null,
+ city: searchResult[i].ad_info && searchResult[i].ad_info.city || null,
+ district: searchResult[i].ad_info && searchResult[i].ad_info.district || null,
+ province: searchResult[i].ad_info && searchResult[i].ad_info.province || null
+ })
+ }
+ param.success(data, {
+ searchResult: searchResult,
+ searchSimplify: searchSimplify
+ })
+ } else if (feature == 'suggest') {
+ var suggestResult = data.data;
+ var suggestSimplify = [];
+ for (var i = 0; i < suggestResult.length; i++) {
+ suggestSimplify.push({
+ adcode: suggestResult[i].adcode || null,
+ address: suggestResult[i].address || null,
+ category: suggestResult[i].category || null,
+ city: suggestResult[i].city || null,
+ district: suggestResult[i].district || null,
+ id: suggestResult[i].id || null,
+ latitude: suggestResult[i].location && suggestResult[i].location.lat || null,
+ longitude: suggestResult[i].location && suggestResult[i].location.lng || null,
+ province: suggestResult[i].province || null,
+ title: suggestResult[i].title || null,
+ type: suggestResult[i].type || null
+ })
+ }
+ param.success(data, {
+ suggestResult: suggestResult,
+ suggestSimplify: suggestSimplify
+ })
+ } else if (feature == 'reverseGeocoder') {
+ var reverseGeocoderResult = data.result;
+ var reverseGeocoderSimplify = {
+ address: reverseGeocoderResult.address || null,
+ latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null,
+ longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null,
+ adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null,
+ city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null,
+ district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null,
+ nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null,
+ province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null,
+ street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null,
+ street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null,
+ recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null,
+ rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null
+ };
+ if (reverseGeocoderResult.pois) {//判断是否返回周边poi
+ var pois = reverseGeocoderResult.pois;
+ var poisSimplify = [];
+ for (var i = 0;i < pois.length;i++) {
+ poisSimplify.push({
+ id: pois[i].id || null,
+ title: pois[i].title || null,
+ latitude: pois[i].location && pois[i].location.lat || null,
+ longitude: pois[i].location && pois[i].location.lng || null,
+ address: pois[i].address || null,
+ category: pois[i].category || null,
+ adcode: pois[i].ad_info && pois[i].ad_info.adcode || null,
+ city: pois[i].ad_info && pois[i].ad_info.city || null,
+ district: pois[i].ad_info && pois[i].ad_info.district || null,
+ province: pois[i].ad_info && pois[i].ad_info.province || null
+ })
+ }
+ param.success(data,{
+ reverseGeocoderResult: reverseGeocoderResult,
+ reverseGeocoderSimplify: reverseGeocoderSimplify,
+ pois: pois,
+ poisSimplify: poisSimplify
+ })
+ } else {
+ param.success(data, {
+ reverseGeocoderResult: reverseGeocoderResult,
+ reverseGeocoderSimplify: reverseGeocoderSimplify
+ })
+ }
+ } else if (feature == 'geocoder') {
+ var geocoderResult = data.result;
+ var geocoderSimplify = {
+ title: geocoderResult.title || null,
+ latitude: geocoderResult.location && geocoderResult.location.lat || null,
+ longitude: geocoderResult.location && geocoderResult.location.lng || null,
+ adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null,
+ province: geocoderResult.address_components && geocoderResult.address_components.province || null,
+ city: geocoderResult.address_components && geocoderResult.address_components.city || null,
+ district: geocoderResult.address_components && geocoderResult.address_components.district || null,
+ street: geocoderResult.address_components && geocoderResult.address_components.street || null,
+ street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null,
+ level: geocoderResult.level || null
+ };
+ param.success(data,{
+ geocoderResult: geocoderResult,
+ geocoderSimplify: geocoderSimplify
+ });
+ } else if (feature == 'getCityList') {
+ var provinceResult = data.result[0];
+ var cityResult = data.result[1];
+ var districtResult = data.result[2];
+ param.success(data,{
+ provinceResult: provinceResult,
+ cityResult: cityResult,
+ districtResult: districtResult
+ });
+ } else if (feature == 'getDistrictByCityId') {
+ var districtByCity = data.result[0];
+ param.success(data, districtByCity);
+ } else if (feature == 'calculateDistance') {
+ var calculateDistanceResult = data.result.elements;
+ var distance = [];
+ for (var i = 0; i < calculateDistanceResult.length; i++){
+ distance.push(calculateDistanceResult[i].distance);
+ }
+ param.success(data, {
+ calculateDistanceResult: calculateDistanceResult,
+ distance: distance
+ });
+ } else if (feature == 'direction') {
+ var direction = data.result.routes;
+ param.success(data,direction);
+ } else {
+ param.success(data);
+ }
+ },
+
+ /**
+ * 构造微信请求参数,公共属性处理
+ *
+ * @param {Object} param 接口参数
+ * @param {Object} param 配置项
+ * @param {String} feature 方法名
+ */
+ buildWxRequestConfig(param, options, feature) {
+ var that = this;
+ options.header = { "content-type": "application/json" };
+ options.method = 'GET';
+ options.success = function (res) {
+ var data = res.data;
+ if (data.status === 0) {
+ that.handleData(param, data, feature);
+ } else {
+ param.fail(data);
+ }
+ };
+ options.fail = function (res) {
+ res.statusCode = ERROR_CONF.WX_ERR_CODE;
+ param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ };
+ options.complete = function (res) {
+ var statusCode = +res.statusCode;
+ switch(statusCode) {
+ case ERROR_CONF.WX_ERR_CODE: {
+ param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ break;
+ }
+ case ERROR_CONF.WX_OK_CODE: {
+ var data = res.data;
+ if (data.status === 0) {
+ param.complete(data);
+ } else {
+ param.complete(that.buildErrorConfig(data.status, data.message));
+ }
+ break;
+ }
+ default:{
+ param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG));
+ }
+
+ }
+ };
+ return options;
+ },
+
+ /**
+ * 处理用户参数是否传入坐标进行不同的处理
+ */
+ locationProcess(param, locationsuccess, locationfail, locationcomplete) {
+ var that = this;
+ locationfail = locationfail || function (res) {
+ res.statusCode = ERROR_CONF.WX_ERR_CODE;
+ param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ };
+ locationcomplete = locationcomplete || function (res) {
+ if (res.statusCode == ERROR_CONF.WX_ERR_CODE) {
+ param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ }
+ };
+ if (!param.location) {
+ that.getWXLocation(locationsuccess, locationfail, locationcomplete);
+ } else if (that.checkLocation(param)) {
+ var location = Utils.getLocationParam(param.location);
+ locationsuccess(location);
+ }
+ }
+};
+
+
+class QQMapWX {
+
+ /**
+ * 构造函数
+ *
+ * @param {Object} options 接口参数,key 为必选参数
+ */
+ constructor(options) {
+ if (!options.key) {
+ throw Error('key值不能为空');
+ }
+ this.key = options.key;
+ };
+
+ /**
+ * POI周边检索
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 参数对象结构可以参考
+ * @see http://lbs.qq.com/webservice_v1/guide-search.html
+ */
+ search(options) {
+ var that = this;
+ options = options || {};
+
+ Utils.polyfillParam(options);
+
+ if (!Utils.checkKeyword(options)) {
+ return;
+ }
+
+ var requestParam = {
+ keyword: options.keyword,
+ orderby: options.orderby || '_distance',
+ page_size: options.page_size || 10,
+ page_index: options.page_index || 1,
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.address_format) {
+ requestParam.address_format = options.address_format;
+ }
+
+ if (options.filter) {
+ requestParam.filter = options.filter;
+ }
+
+ var distance = options.distance || "1000";
+ var auto_extend = options.auto_extend || 1;
+ var region = null;
+ var rectangle = null;
+
+ //判断城市限定参数
+ if (options.region) {
+ region = options.region;
+ }
+
+ //矩形限定坐标(暂时只支持字符串格式)
+ if (options.rectangle) {
+ rectangle = options.rectangle;
+ }
+
+ var locationsuccess = function (result) {
+ if (region && !rectangle) {
+ //城市限定参数拼接
+ requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")";
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+ }
+ } else if (rectangle && !region) {
+ //矩形搜索
+ requestParam.boundary = "rectangle(" + rectangle + ")";
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+ }
+ } else {
+ requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")";
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+ }
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_SEARCH,
+ data: requestParam
+ }, 'search'));
+ };
+ Utils.locationProcess(options, locationsuccess);
+ };
+
+ /**
+ * sug模糊检索
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 参数对象结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-suggestion.html
+ */
+ getSuggestion(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (!Utils.checkKeyword(options)) {
+ return;
+ }
+
+ var requestParam = {
+ keyword: options.keyword,
+ region: options.region || '全国',
+ region_fix: options.region_fix || 0,
+ policy: options.policy || 0,
+ page_size: options.page_size || 10,//控制显示条数
+ page_index: options.page_index || 1,//控制页数
+ get_subpois : options.get_subpois || 0,//返回子地点
+ output: 'json',
+ key: that.key
+ };
+ //长地址
+ if (options.address_format) {
+ requestParam.address_format = options.address_format;
+ }
+ //过滤
+ if (options.filter) {
+ requestParam.filter = options.filter;
+ }
+ //排序
+ if (options.location) {
+ var locationsuccess = function (result) {
+ requestParam.location = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_SUGGESTION,
+ data: requestParam
+ }, "suggest"));
+ };
+ Utils.locationProcess(options, locationsuccess);
+ } else {
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_SUGGESTION,
+ data: requestParam
+ }, "suggest"));
+ }
+ };
+
+ /**
+ * 逆地址解析
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-gcoder.html
+ */
+ reverseGeocoder(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+ var requestParam = {
+ coord_type: options.coord_type || 5,
+ get_poi: options.get_poi || 0,
+ output: 'json',
+ key: that.key
+ };
+ if (options.poi_options) {
+ requestParam.poi_options = options.poi_options
+ }
+
+ var locationsuccess = function (result) {
+ requestParam.location = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_GET_GEOCODER,
+ data: requestParam
+ }, 'reverseGeocoder'));
+ };
+ Utils.locationProcess(options, locationsuccess);
+ };
+
+ /**
+ * 地址解析
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-geocoder.html
+ */
+ geocoder(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'address')) {
+ return;
+ }
+
+ var requestParam = {
+ address: options.address,
+ output: 'json',
+ key: that.key
+ };
+
+ //城市限定
+ if (options.region) {
+ requestParam.region = options.region;
+ }
+
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder');
+ }
+
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_GET_GEOCODER,
+ data: requestParam
+ },'geocoder'));
+ };
+
+
+ /**
+ * 获取城市列表
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-region.html
+ */
+ getCityList(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+ var requestParam = {
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList');
+ }
+
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_CITY_LIST,
+ data: requestParam
+ },'getCityList'));
+ };
+
+ /**
+ * 获取对应城市ID的区县列表
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-region.html
+ */
+ getDistrictByCityId(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'id')) {
+ return;
+ }
+
+ var requestParam = {
+ id: options.id || '',
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId');
+ }
+
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_AREA_LIST,
+ data: requestParam
+ },'getDistrictByCityId'));
+ };
+
+ /**
+ * 用于单起点到多终点的路线距离(非直线距离)计算:
+ * 支持两种距离计算方式:步行和驾车。
+ * 起点到终点最大限制直线距离10公里。
+ *
+ * 新增直线距离计算。
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-distance.html
+ */
+ calculateDistance(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'to')) {
+ return;
+ }
+
+ var requestParam = {
+ mode: options.mode || 'walking',
+ to: Utils.location2query(options.to),
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.from) {
+ options.location = options.from;
+ }
+
+ //计算直线距离
+ if(requestParam.mode == 'straight'){
+ var locationsuccess = function (result) {
+ var locationTo = Utils.getEndLocation(requestParam.to);//处理终点坐标
+ var data = {
+ message:"query ok",
+ result:{
+ elements:[]
+ },
+ status:0
+ };
+ for (var i = 0; i < locationTo.length; i++) {
+ data.result.elements.push({//将坐标存入
+ distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng),
+ duration:0,
+ from:{
+ lat: result.latitude,
+ lng:result.longitude
+ },
+ to:{
+ lat: locationTo[i].lat,
+ lng: locationTo[i].lng
+ }
+ });
+ }
+ var calculateResult = data.result.elements;
+ var distanceResult = [];
+ for (var i = 0; i < calculateResult.length; i++) {
+ distanceResult.push(calculateResult[i].distance);
+ }
+ return options.success(data,{
+ calculateResult: calculateResult,
+ distanceResult: distanceResult
+ });
+ };
+
+ Utils.locationProcess(options, locationsuccess);
+ } else {
+ var locationsuccess = function (result) {
+ requestParam.from = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_DISTANCE,
+ data: requestParam
+ },'calculateDistance'));
+ };
+
+ Utils.locationProcess(options, locationsuccess);
+ }
+ };
+
+ /**
+ * 路线规划:
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * https://lbs.qq.com/webservice_v1/guide-road.html
+ */
+ direction(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'to')) {
+ return;
+ }
+
+ var requestParam = {
+ output: 'json',
+ key: that.key
+ };
+
+ //to格式处理
+ if (typeof options.to == 'string') {
+ requestParam.to = options.to;
+ } else {
+ requestParam.to = options.to.latitude + ',' + options.to.longitude;
+ }
+ //初始化局部请求域名
+ var SET_URL_DIRECTION = null;
+ //设置默认mode属性
+ options.mode = options.mode || MODE.driving;
+
+ //设置请求域名
+ SET_URL_DIRECTION = URL_DIRECTION + options.mode;
+
+ if (options.from) {
+ options.location = options.from;
+ }
+
+ if (options.mode == MODE.driving) {
+ if (options.from_poi) {
+ requestParam.from_poi = options.from_poi;
+ }
+ if (options.heading) {
+ requestParam.heading = options.heading;
+ }
+ if (options.speed) {
+ requestParam.speed = options.speed;
+ }
+ if (options.accuracy) {
+ requestParam.accuracy = options.accuracy;
+ }
+ if (options.road_type) {
+ requestParam.road_type = options.road_type;
+ }
+ if (options.to_poi) {
+ requestParam.to_poi = options.to_poi;
+ }
+ if (options.from_track) {
+ requestParam.from_track = options.from_track;
+ }
+ if (options.waypoints) {
+ requestParam.waypoints = options.waypoints;
+ }
+ if (options.policy) {
+ requestParam.policy = options.policy;
+ }
+ if (options.plate_number) {
+ requestParam.plate_number = options.plate_number;
+ }
+ }
+
+ if (options.mode == MODE.transit) {
+ if (options.departure_time) {
+ requestParam.departure_time = options.departure_time;
+ }
+ if (options.policy) {
+ requestParam.policy = options.policy;
+ }
+ }
+
+ var locationsuccess = function (result) {
+ requestParam.from = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction',options.mode);
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: SET_URL_DIRECTION,
+ data: requestParam
+ }, 'direction'));
+ };
+
+ Utils.locationProcess(options, locationsuccess);
+ }
+};
+
+module.exports = QQMapWX;
\ No newline at end of file
diff --git a/subpages/home/pages/newsDetail/newsDetail.js b/subpages/home/pages/newsDetail/newsDetail.js
index cdeea90..02f7b6f 100644
--- a/subpages/home/pages/newsDetail/newsDetail.js
+++ b/subpages/home/pages/newsDetail/newsDetail.js
@@ -1,5 +1,7 @@
const api = require('../../../../utils/home')
-import { getTimestamp } from '../../../../utils/common'
+import {
+ getTimestamp
+} from '../../../../utils/common'
import util from '../../../../utils/util'
const app = getApp()
Page({
@@ -11,7 +13,7 @@ Page({
infoCompleted: 0,
noticeObjContent: ''
},
- onLoad (options) {
+ onLoad(options) {
this.setData({
detailId: options.id,
infoCompleted: app.globalData.infoCompleted
@@ -19,7 +21,7 @@ Page({
this.getNewsDetail(options.id)
this.browseNews(options.id)
},
- getNewsDetail (id) {
+ getNewsDetail(id) {
let that = this
api.getNewsDetail(id).then(res => {
that.setData({
@@ -40,18 +42,18 @@ Page({
console.log(err)
})
},
- browseNews (id) {
+ browseNews(id) {
let para = {
newsId: id
}
api.browseNews(para).then(res => {
-
+
}).catch(err => {
console.log(err)
})
},
// 检查 是否完善信息
- verifyCompleteInfo () {
+ verifyCompleteInfo() {
if (this.data.infoCompleted == 0) {
this.setData({
completeInfoDialogVisible: !this.data.completeInfoDialogVisible
@@ -61,15 +63,15 @@ Page({
return false
}
},
- newsPosition (e) {
- // newsPosition (attitude, bySelf = false) {
+ newsPosition(e) {
+ // newsPosition (attitude, bySelf = false) {
if (this.verifyCompleteInfo()) {
return false
}
console.log(e)
let attitude = e.currentTarget.dataset.state,
- bySelf = e.currentTarget.dataset.byself
- if (bySelf=='true') {
+ bySelf = e.currentTarget.dataset.byself
+ if (bySelf == 'true') {
let attitudeState = ''
if (attitude === '0') {
if (this.data.dispportStatus === 'dispported') {
@@ -128,13 +130,35 @@ Page({
newsId: this.data.detailId,
attitude: attitudeState
}
+ console.log(attitudeState)
+ if (attitudeState == 0) { //表态 0赞;1踩;2取消赞;3取消踩
+ api.newsSupport(para).then(res => {
+
+ }).catch(err => {
+ console.log(err)
+ })
+ } else if (attitudeState == 1) {
+ api.newsOpposition(para).then(res => {
+
+ }).catch(err => {
+ console.log(err)
+ })
+ } else {
+ // const res = await newsPosition(para)
+ // console.log('新闻表态', res)
+ api.newsPosition(para).then(res => {
+
+ }).catch(err => {
+ console.log(err)
+ })
+ }
// const res = await newsPosition(para)
// console.log('新闻表态', res)
- api.newsPosition(para).then(res => {
+ // api.newsPosition(para).then(res => {
- }).catch(err => {
- console.log(err)
- })
+ // }).catch(err => {
+ // console.log(err)
+ // })
}
}
})
\ No newline at end of file
diff --git a/subpages/integralCentre/images/first.png b/subpages/integralCentre/images/first.png
new file mode 100644
index 0000000..21f1a4f
Binary files /dev/null and b/subpages/integralCentre/images/first.png differ
diff --git a/subpages/integralCentre/images/fourth.png b/subpages/integralCentre/images/fourth.png
new file mode 100644
index 0000000..4aba9e8
Binary files /dev/null and b/subpages/integralCentre/images/fourth.png differ
diff --git a/subpages/integralCentre/images/second.png b/subpages/integralCentre/images/second.png
new file mode 100644
index 0000000..febb2b3
Binary files /dev/null and b/subpages/integralCentre/images/second.png differ
diff --git a/subpages/integralCentre/images/third.png b/subpages/integralCentre/images/third.png
new file mode 100644
index 0000000..fc5b687
Binary files /dev/null and b/subpages/integralCentre/images/third.png differ
diff --git a/subpages/integralCentre/pages/index/index.js b/subpages/integralCentre/pages/index/index.js
new file mode 100644
index 0000000..2e8d0c3
--- /dev/null
+++ b/subpages/integralCentre/pages/index/index.js
@@ -0,0 +1,223 @@
+// subpages/integralCentre/pages/index/index.js
+import {
+ pointsRecordlist,
+ pointsRankinglist
+} from '../../../../utils/api'
+import {
+ getTimestamp
+} from '../../../../utils/common'
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ nodatapointsRecord: false,
+ nodatapointsRanking: false,
+ points: 0, //积分
+ pageIndex: 1,
+ pageSize: 15,
+ pointsRecordlist: [], //积分记录列表
+ pointsRankinglist: [], //积分排行
+ rankingType: 0, //排名方式
+ selectTab: 'tab1',
+ typeList: [{ //排名方式:0-周,1-月
+ type: '0',
+ name: '本周排名',
+ select: true
+ },
+ {
+ type: '1',
+ name: '本月排名',
+ select: false
+ }
+ ],
+ timestamp: getTimestamp(),
+ loadMoreType: 'none',
+ loadMoreVisible: false,
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ this.setData({ //前面页面传过来的积分总数
+ points: options.points
+ })
+ this.pointsRankinglist(); //初始化加载积分记录列表
+ },
+ // tab 切换
+ onTabChange(e) {
+ this.setData({
+ pageIndex: 1,
+ pageSize: 15,
+ loadMoreType: 'none',
+ loadMoreVisible: false,
+ pointsRecordlist: [],
+ pointsRankinglist: [],
+ selectTab: e.currentTarget.dataset.tab,
+ nodatapointsRecord: false,
+ nodatapointsRanking: false,
+ })
+ if (this.data.selectTab == 'tab1') {
+ this.pointsRankinglist(); //积分排行
+ } else {
+ this.pointsRecordlist(); //初始化加载积分记录列表
+ }
+ },
+ // 排行切换
+ onButtonChange: function(e) {
+ const list = this.data.typeList
+ let that = this;
+ list.forEach(item => {
+ if (item.type === e.currentTarget.dataset.type) {
+ item.select = true
+ } else {
+ item.select = false
+ }
+ })
+ that.setData({
+ typeList: list,
+ rankingType: e.currentTarget.dataset.type,
+ pageIndex: 1,
+ pageSize: 15,
+ timestamp: this.data.timestamp,
+ loadMoreType: 'none',
+ loadMoreVisible: false,
+ pointsRankinglist: [],
+ nodatapointsRanking: false,
+ })
+
+ that.pointsRankinglist()
+ },
+
+
+ // 获取事件详情
+ pointsRecordlist() {
+ let that = this
+ const para = {
+ pageIndex: this.data.pageIndex,
+ pageSize: this.data.pageSize,
+ timestamp: this.data.timestamp,
+ }
+ pointsRecordlist(para).then(res => {
+ that.setData({
+ pointsRecordlist: that.data.pointsRecordlist.concat(res.data),
+ loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none',
+ })
+ if (that.data.pointsRecordlist.length > 0) {
+ that.setData({
+ nodatapointsRecord: false,
+ })
+ } else {
+ that.setData({
+ nodatapointsRecord: true,
+ })
+ }
+ }).catch(err => {
+ that.setData({
+ loadMoreType: 'none',
+ pointsRecordlist: [],
+ nodatapointsRecord: false,
+ })
+ console.log(err)
+ })
+ },
+
+ // 积分记录-积分排行接口
+ pointsRankinglist() {
+ 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 => {
+ that.setData({
+ pointsRankinglist: that.data.pointsRankinglist.concat(res.data),
+ loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none',
+ })
+ if (that.data.pointsRankinglist.length > 0) {
+ that.setData({
+ nodatapointsRanking: false
+ })
+ } else {
+ that.setData({
+ nodatapointsRanking: true
+ })
+ }
+ }).catch(err => {
+ that.setData({
+ loadMoreType: 'none',
+ pointsRankinglist: [],
+ nodatapointsRanking: false
+ })
+ console.log(err)
+ })
+ },
+
+
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function(options) {},
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+ 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 {
+ this.pointsRecordlist(); //初始化加载积分记录列表
+ }
+ }
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function() {
+
+ }
+})
\ No newline at end of file
diff --git a/subpages/integralCentre/pages/index/index.json b/subpages/integralCentre/pages/index/index.json
new file mode 100644
index 0000000..ed0a78d
--- /dev/null
+++ b/subpages/integralCentre/pages/index/index.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "积分中心",
+ "navigationBarTextStyle": "white",
+ "navigationBarBackgroundColor": "#DD5245",
+ "usingComponents": {
+ "load-more": "../../../../components/loadMore/loadMore",
+ "no-data":"../../../../components/nodata/nodata"
+ }
+}
\ No newline at end of file
diff --git a/subpages/integralCentre/pages/index/index.wxml b/subpages/integralCentre/pages/index/index.wxml
new file mode 100644
index 0000000..cfced3d
--- /dev/null
+++ b/subpages/integralCentre/pages/index/index.wxml
@@ -0,0 +1,58 @@
+
+
+ {{points}}
+ 积分
+
+
+
+ 积分排行
+ 积分记录
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{index+1}}
+
+
+ {{item.nickName}}
+
+ {{item.points}}
+
+
+
+
+
+
+
+
+ 事件名称
+ 积分
+ 时间
+
+
+
+ {{item.ruleDesc}}
+
+ -
+ +{{item.points}}
+ {{item.operationTime}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/subpages/integralCentre/pages/index/index.wxss b/subpages/integralCentre/pages/index/index.wxss
new file mode 100644
index 0000000..0342351
--- /dev/null
+++ b/subpages/integralCentre/pages/index/index.wxss
@@ -0,0 +1,250 @@
+.home {
+ width: 100%;
+ height: 100%;
+}
+
+.title {
+ width: 100%;
+ height: 300rpx;
+ background: linear-gradient(0deg, rgba(212, 45, 48, 1) 0%, rgba(221, 83, 70, 1) 100%);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.title .number {
+ height: 100rpx;
+ font-size: 100rpx;
+ line-height: 100rpx;
+ font-weight: bold;
+ color: rgba(255, 255, 255, 1);
+ margin-top: 100rpx;
+}
+
+.title .name {
+ height: 34rpx;
+ font-size: 34rpx;
+ line-height: 34rpx;
+ font-weight: 500;
+ color: rgba(255, 255, 255, 1);
+ margin-top: 29rpx;
+}
+
+.tab-bar {
+ width: 100%;
+ height: 80rpx;
+ background: #fff;
+ display: flex;
+ justify-content: space-around;
+ position: relative;
+}
+
+.tab-bar .tab {
+ flex: 1;
+ height: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ width: 50%;
+ font-size: 32rpx;
+ font-weight: 500;
+ color: rgba(153, 153, 153, 1);
+}
+
+.tab-bar .select-tab {
+ color: #b20004;
+ font-size: 32rpx;
+ font-weight: bold;
+}
+
+.tab-bar .select-bar {
+ width: 40rpx;
+ height: 8rpx;
+ border-radius: 5rpx;
+ background: #b20004;
+ position: absolute;
+ bottom: 0rpx;
+}
+
+.tab-bar .select-bar.tab1 {
+ left: calc(25% - 15rpx);
+ transition: left linear 0.4s;
+}
+
+.tab-bar .select-bar.tab2 {
+ left: calc(75% - 15rpx);
+ transition: left linear 0.4s;
+}
+
+/* 积分记录 */
+
+.jf-title {
+ margin-top: 20rpx;
+ background: #fff;
+ height: 80rpx;
+ width: calc(100% - 40rpx);
+ padding: 0 20rpx;
+ display: flex;
+ align-items: center;
+}
+
+.jf-title .jf-title-item {
+ width: 30%;
+ height: 80rpx;
+ font-size: 30rpx;
+ font-weight: bold;
+ color: rgba(51, 51, 51, 1);
+ line-height: 80rpx;
+}
+
+.jf-title .jf-title-item-last {
+ width: 40%;
+ height: 80rpx;
+ font-size: 30rpx;
+ font-weight: bold;
+ color: rgba(51, 51, 51, 1);
+ line-height: 80rpx;
+}
+
+.jf-list {
+ background: #fff;
+ height: 80rpx;
+ width: calc(100% - 40rpx);
+ padding: 0 20rpx;
+ display: flex;
+ align-items: center;
+}
+
+.jf-list .jf-list-li {
+ width: 30%;
+ height: 80rpx;
+ font-size: 30rpx;
+ font-weight: 500;
+ line-height: 80rpx;
+}
+
+.jf-list .jf-list-li.jf-list-li-last {
+ width: 40%;
+ height: 80rpx;
+ font-size: 30rpx;
+ font-weight: 500;
+ line-height: 80rpx;
+}
+
+.jf-list .jf-list-li.color1 {
+ color: rgba(51, 51, 51, 1);
+}
+
+.jf-list .jf-list-li.color2 {
+ color: rgba(178, 0, 4, 1);
+}
+
+/* 积分排行 */
+
+.tab-item {
+ margin-top: 20rpx;
+ background: #fff;
+ height: 80rpx;
+ width: calc(100% - 40rpx);
+ padding: 0 20rpx;
+ display: flex;
+ align-items: center;
+}
+
+.tab-item button {
+ position: relative;
+ display: inline-block;
+ margin: 0 42rpx 0 0;
+ flex-shrink: 0;
+ /* width: auto !important; */
+ width: 208rpx;
+ height: 52rpx;
+ min-height: 52rpx !important;
+ line-height: 52rpx;
+ border-radius: 30rpx;
+ padding: 0 20rpx;
+}
+
+button::after {
+ border: 0rpx;
+}
+
+.tab-item .font-w {
+ font-size: 30rpx;
+ font-weight: bold;
+ color: #fff;
+ background: linear-gradient(to right, #e95027, #db1a1f);
+}
+
+.tab-item .font-b {
+ background: #fff;
+ font-size: 30rpx;
+ font-weight: 500;
+ color: #333;
+ border: 1rpx solid #dbdbdb;
+}
+
+.tab-item .hover-btn {
+ box-shadow: 0px 0px 10px 0px rgba(188, 0, 5, 0.22);
+}
+
+/* 积分排行列表 */
+
+.ph-list {
+ background: #fff;
+ height: 80rpx;
+ width: calc(100% - 140rpx);
+ padding: 0 70rpx;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+}
+
+.ph-list .left {
+ display: flex;
+ align-items: center;
+}
+
+.left .left-img {
+ position: relative;
+ width: 41rpx;
+ height: 38rpx;
+}
+
+.left .left-img .img-bg {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ z-index: 10;
+ left: 0;
+ top: 0;
+}
+
+.left .left-img .list-number {
+ position: relative;
+ z-index: 100;
+ width: 100%;
+ height: 20rpx;
+ line-height: 20rpx;
+ text-align: center;
+ font-size: 20rpx;
+ font-weight: 500;
+ color: rgba(255, 255, 255, 1);
+ margin-top: 3rpx;
+}
+
+.left .list-name {
+ font-size: 32rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ font-weight: 500;
+ color: rgba(51, 51, 51, 1);
+ margin-left: 90rpx;
+}
+
+.ph-list .right {
+ height: 80rpx;
+ line-height: 80rpx;
+ font-size: 32rpx;
+ font-weight: 500;
+ color: rgba(178, 0, 4, 1);
+}
diff --git a/utils/activity.js b/utils/activity.js
new file mode 100644
index 0000000..b4dc943
--- /dev/null
+++ b/utils/activity.js
@@ -0,0 +1,14 @@
+var fly = require('./request.js')
+module.exports = {
+ getActivityList: getActivityList,
+ bannerList
+}
+
+function getActivityList(params) {
+ return fly.get('heart/act/list', params)
+}
+
+function bannerList() {
+ return fly.get('heart/act/banner/list')
+}
+
diff --git a/utils/api.js b/utils/api.js
index 1c98989..abe4562 100644
--- a/utils/api.js
+++ b/utils/api.js
@@ -11,6 +11,8 @@ module.exports = {
getGridList: getGridList,
changeGrid: changeGrid,
completeInfo: completeInfo,
+ completeResidentInfo: completeResidentInfo,
+ completePartyInfo: completePartyInfo,
prepareComplete: prepareComplete,
getUserInfo: getUserInfo,
getMyAssociation: getMyAssociation,
@@ -24,7 +26,27 @@ module.exports = {
noticelist: noticelist,
newsList: newsList,
getIssueList: getIssueList,
- getProjectList: getProjectList
+ getProjectList: getProjectList,
+ pointsRankinglist: pointsRankinglist,
+ pointsRecordlist: pointsRecordlist,
+ // 爱心互助
+ leaderboard: leaderboard,
+ detail: detail,
+ rejectDetail: rejectDetail,
+ cancelDetail: cancelDetail,
+ clockAddressDetail: clockAddressDetail,
+ clockList: clockList,
+ getPhraseList: getPhraseList,
+ sagenumAddOne: sagenumAddOne,
+ clock: clock,
+ authenticate: authenticate,
+ signup: signup,
+ cancelsignup:cancelsignup,
+ getSignedList: getSignedList,
+ unpassActivityDetail: unpassActivityDetail,
+ completeInfoV2: completeInfoV2,
+ getTokenV3: getTokenV3,
+ getWxPhone: getWxPhone
}
function getToken(wxCode) {
@@ -78,7 +100,11 @@ function saveWxFormid(wxCode, wxFormId) {
})
}
-function getTokenV2({wxCode, gridId, inviteUserId}) {
+function getTokenV2({
+ wxCode,
+ gridId,
+ inviteUserId
+}) {
return fly.get('app-user/user/ma/v2/getToken', {
wxCode,
gridId,
@@ -105,6 +131,15 @@ function gridLeaderRegister(mobile, smsCode, wxCode) {
function completeInfo(data) {
return fly.post('app-user/user/completeInfo', data)
}
+//用户完善个人信息 v2
+function completeResidentInfo(data) {
+ return fly.post('app-user/user/completeResidentInfo', data)
+}
+//党员完善个人信息: v2
+function completePartyInfo(data) {
+ return fly.post('app-user/user/completePartyInfo', data)
+}
+
function prepareComplete() {
return fly.get('app-user/user/prepareComplete', {})
@@ -137,14 +172,14 @@ function changeGrid(gridId) {
/**
* 获取 议题列表
*/
-function getIssueList (params) {
+function getIssueList(params) {
return fly.get('events/issue/list', params)
}
/**
* 获取项目列表
*/
-function getProjectList (params) {
+function getProjectList(params) {
return fly.get('events/item/list', params)
}
// ---------------------------------党群议事 end ---------------------
@@ -154,10 +189,12 @@ function getProjectList (params) {
* 获取用户信息
* @param {*} param0
*/
+// function getUserInfo() {
+// return fly.get('/app-user/user/getInfoById')
+// }
function getUserInfo() {
- return fly.get('/app-user/user/getInfoById')
+ return fly.get('app-user/user/getInfoById')
}
-
/**
* 我的群列表
*/
@@ -179,7 +216,10 @@ function getCommandAssociation() {
/**
* 我的话题列表
*/
-function getMyTopicList ({pageIndex, pageSize}) {
+function getMyTopicList({
+ pageIndex,
+ pageSize
+}) {
return fly.get('group/topic/listOfMine', {
pageIndex,
pageSize
@@ -189,14 +229,18 @@ function getMyTopicList ({pageIndex, pageSize}) {
/**
* 我的议题列表
*/
-function getMyIssueList () {
+function getMyIssueList() {
return fly.get('events/issue/listByUserId')
}
/**
* 我的项目列表
*/
-function getMyProjectList ({ pageIndex, pageSize, timestamp }) {
+function getMyProjectList({
+ pageIndex,
+ pageSize,
+ timestamp
+}) {
return fly.get('events/item/listByUserId', {
pageIndex,
pageSize,
@@ -207,8 +251,190 @@ function getMyProjectList ({ pageIndex, pageSize, timestamp }) {
/**
* 查看用户是否已保存unionId
*/
-function checkWxUnionId () {
+function checkWxUnionId() {
return fly.get('app-user/user/checkWxUnionId')
}
// ---------------------------------个人中心接口 end-------------------
+/**
+ * 积分记录-积分记录接口
+ * timestamp String 第一页查询发起时的时间
+ * pageIndex Number 页码
+ * pageSize Number 页容量
+ */
+function pointsRecordlist({
+ timestamp,
+ pageIndex,
+ pageSize
+}) {
+ return fly.get('points/pointsRecord/list', {
+ timestamp,
+ pageIndex,
+ pageSize
+ })
+}
+
+/**
+ * 积分记录-积分排行接口
+ * timestamp String 第一页查询发起时的时间
+ * pageIndex Number 页码
+ * pageSize Number 页容量
+ * rankingType Number 排名方式:0-周,1-月
+ */
+
+function pointsRankinglist({
+ timestamp,
+ pageIndex,
+ pageSize,
+ rankingType
+}) {
+ return fly.get('points/pointsRanking/list', {
+ timestamp,
+ pageIndex,
+ pageSize,
+ rankingType
+ })
+}
+
+// *****************************爱心互助接口***************************
+
+/**
+ * 排行榜
+ */
+function leaderboard() {
+ return fly.get('heart/volunteer/leaderboard')
+}
+/**
+ * 活动详情
+ */
+function detail(id) {
+ return fly.get(`heart/act/detail/${id}`)
+}
+
+/**
+ * 未通过活动详情
+ */
+function rejectDetail(id) {
+ return fly.get(`heart/act/rejectDetail/${id}`)
+}
+
+/**
+ * 取消活动详情
+ */
+function cancelDetail(id) {
+ return fly.get(`heart/act/cancelDetail/${id}`)
+}
+
+
+/**
+ * 活动打卡地点详情
+ */
+function clockAddressDetail(id) {
+ return fly.get('heart/act/clockAddressDetail', {
+ actId: id
+ })
+}
+
+/**
+ * 打卡列表
+ */
+function clockList(actId) {
+ return fly.get('heart/act/clockList', {
+ actId: actId
+ })
+}
+/**
+ * 常用语列表
+ */
+function getPhraseList() {
+ return fly.get('heart/phrase/getPhraseList')
+}
+
+/**
+ * 使用常用语
+ */
+function sagenumAddOne(id) {
+ return fly.post('heart/phrase/sagenumAddOne', {
+ id: id
+ })
+}
+
+
+/**
+ * 活动打卡
+ */
+function clock(data) {
+ return fly.post('heart/act/clock', data)
+}
+
+/**
+ * 志愿者认证
+ */
+function authenticate(data) {
+ return fly.post('app-user/volunteer/authenticate', data)
+}
+/**
+ * 活动报名
+ */
+
+function signup(actId) {
+ return fly.post(`heart/act/signup?actId=${actId}`)
+}
+
+/**
+ * 取消报名
+ */
+function cancelsignup(id, response) {
+ return fly.post('heart/act/cancelsignup', {
+ actId: id,
+ failureReason: response
+ })
+}
+
+
+
+/**
+ * 已报名活动
+ */
+function getSignedList({ pageIndex, pageSize, timestamp, actType }) {
+ return fly.get('heart/act/signupList', {
+ pageIndex,
+ pageSize,
+ timestamp,
+ actType
+ })
+}
+
+/**
+ * 未通过活动详情
+ */
+function unpassActivityDetail(id) {
+ return fly.get(`heart/act/rejectDetail/${id}`)
+}
+
+
+
+/**
+ * 用户完善个人信息v2(不穿验证码)
+ */
+function completeInfoV2(para) {
+ return fly.post('app-user/user/v2/completeInfo', para)
+}
+
+/**
+ * 获取Token v3 网格码和邀请码合二为一
+ */
+
+function getTokenV3(para) {
+ return fly.get('app-user/user/ma/v3/getToken', para)
+}
+
+/********微信获取手机号 ********/
+function getWxPhone({ wxCode, encryptedData, iv }) {
+ return fly.get('app-user/user/ma/getWxPhone', {
+ wxCode,
+ encryptedData,
+ iv
+ })
+}
+// *****************************爱心互助接口***************************end
diff --git a/utils/home.js b/utils/home.js
index dcd041d..86bbf44 100644
--- a/utils/home.js
+++ b/utils/home.js
@@ -7,7 +7,9 @@ module.exports = {
browseNews: browseNews,
newsPosition: newsPosition,
getInfoList: getInfoList,
- infoDetail: infoDetail
+ infoDetail: infoDetail,
+ newsSupport: newsSupport,
+ newsOpposition: newsOpposition
}
function getNoticeList(param) {
return fly.get('news/notice/list', param)
@@ -27,9 +29,21 @@ function browseNotice(param) {
function browseNews(param) {
return fly.post('news/news/browse', param)
}
+// 新闻支持原接口
function newsPosition(param) {
return fly.post('news/news/statement', param)
}
+
+// 新闻支持 v2
+function newsSupport(param) {
+ return fly.post('news/news/newsSupport', param)
+}
+
+// 新闻反对 v2
+function newsOpposition(param) {
+ return fly.post('news/news/newsOpposition', param)
+}
+
function infoDetail(param) {
return fly.post('news/information/read', param)
}