图片压缩、页面布局修改、部分接口添加areaCode
4
app.js
@ -1,6 +1,7 @@
|
|||||||
//app.js
|
//app.js
|
||||||
var restAjax = require('utils/restAjax.js');
|
var restAjax = require('utils/restAjax.js');
|
||||||
var dialog = require('utils/dialog.js');
|
var dialog = require('utils/dialog.js');
|
||||||
|
var utils = require('utils/util.js');
|
||||||
// + 'https://www.xzszwhy.cn/usercenter'
|
// + 'https://www.xzszwhy.cn/usercenter'
|
||||||
App({
|
App({
|
||||||
loginUrl: restAjax.baseUrl,
|
loginUrl: restAjax.baseUrl,
|
||||||
@ -13,7 +14,7 @@ App({
|
|||||||
volunteerUrl: restAjax.baseUrl,
|
volunteerUrl: restAjax.baseUrl,
|
||||||
activityUrl: restAjax.baseUrl,
|
activityUrl: restAjax.baseUrl,
|
||||||
volunteerUrl: restAjax.baseUrl,
|
volunteerUrl: restAjax.baseUrl,
|
||||||
liveUrl: restAjax.ulr+'live/',
|
liveUrl: restAjax.url + 'live/',
|
||||||
liveRecordUrl: restAjax.baseUrl,
|
liveRecordUrl: restAjax.baseUrl,
|
||||||
socialUrl: restAjax.baseUrl,
|
socialUrl: restAjax.baseUrl,
|
||||||
areaCode: '540200000000',
|
areaCode: '540200000000',
|
||||||
@ -23,6 +24,7 @@ App({
|
|||||||
restAjax: restAjax,
|
restAjax: restAjax,
|
||||||
shopImgUrl: restAjax.url + "xzshop/route/file/download/true/",
|
shopImgUrl: restAjax.url + "xzshop/route/file/download/true/",
|
||||||
dialog: dialog,
|
dialog: dialog,
|
||||||
|
utils: utils,
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
// 展示本地存储能力
|
// 展示本地存储能力
|
||||||
var logs = wx.getStorageSync('logs') || []
|
var logs = wx.getStorageSync('logs') || []
|
||||||
|
83
app.wxss
@ -1,10 +1,79 @@
|
|||||||
/**app.wxss**/
|
/**app.wxss**/
|
||||||
.container {
|
.container {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 200rpx 0;
|
padding: 200rpx 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
radio-group text {
|
||||||
|
font-size: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
radio .wx-radio-input {
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 24rpx;
|
||||||
|
border: 2rpx solid #5e5e5f;
|
||||||
|
height: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
radio .wx-radio-input.wx-radio-input-checked {
|
||||||
|
border: none;
|
||||||
|
background: #07c160;
|
||||||
|
}
|
||||||
|
|
||||||
|
radio .wx-radio-input.wx-radio-input-checked::before {
|
||||||
|
border-radius: 50%;
|
||||||
|
/* 圆角 */
|
||||||
|
width: 28rpx;
|
||||||
|
/* 选中后对勾大小,不要超过背景的尺寸 */
|
||||||
|
height: 28rpx;
|
||||||
|
/* 选中后对勾大小,不要超过背景的尺寸 */
|
||||||
|
line-height: 28rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 20rpx;
|
||||||
|
/* 对勾大小 30rpx */
|
||||||
|
color: #fff;
|
||||||
|
/* 对勾颜色 白色 */
|
||||||
|
background: #07c160;
|
||||||
|
transform: translate(-50%, -50%) scale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
checkbox-group text {
|
||||||
|
font-size: 25rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
checkbox .wx-checkbox-input {
|
||||||
|
width: 24rpx;
|
||||||
|
border: 2rpx solid #5e5e5f;
|
||||||
|
height: 24rpx;
|
||||||
|
margin-left: 5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
|
||||||
|
border: none;
|
||||||
|
background: #07c160;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
|
||||||
|
/* 圆角 */
|
||||||
|
width: 28rpx;
|
||||||
|
/* 选中后对勾大小,不要超过背景的尺寸 */
|
||||||
|
height: 28rpx;
|
||||||
|
/* 选中后对勾大小,不要超过背景的尺寸 */
|
||||||
|
line-height: 28rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 20rpx;
|
||||||
|
margin-left: 5rpx;
|
||||||
|
/* 对勾大小 30rpx */
|
||||||
|
color: #fff;
|
||||||
|
/* 对勾颜色 白色 */
|
||||||
|
background: #07c160;
|
||||||
|
transform: translate(-50%, -50%) scale(1);
|
||||||
}
|
}
|
BIN
images/activity-on.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 689 B |
BIN
images/activity.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 634 B |
BIN
images/address.png
Normal file → Executable file
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 453 B |
BIN
images/avatar.png
Normal file → Executable file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 582 B |
BIN
images/big-news.png
Normal file → Executable file
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
images/center-bg.png
Normal file → Executable file
Before Width: | Height: | Size: 522 KiB After Width: | Height: | Size: 122 KiB |
BIN
images/center-on.png
Normal file → Executable file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 606 B |
BIN
images/center.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 599 B |
BIN
images/collect.png
Normal file → Executable file
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 624 B |
BIN
images/collected.png
Normal file → Executable file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 510 B |
BIN
images/culture-on.png
Normal file → Executable file
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 871 B |
BIN
images/culture-slide.png
Normal file → Executable file
Before Width: | Height: | Size: 553 KiB After Width: | Height: | Size: 151 KiB |
BIN
images/culture.png
Normal file → Executable file
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 728 B |
BIN
images/delete-photo.png
Normal file → Executable file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 289 B |
BIN
images/delete.png
Normal file → Executable file
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 304 B |
BIN
images/friend.png
Normal file → Executable file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 510 B |
BIN
images/good.png
Normal file → Executable file
Before Width: | Height: | Size: 796 B After Width: | Height: | Size: 383 B |
BIN
images/ic_empty_data.png
Normal file → Executable file
Before Width: | Height: | Size: 944 B After Width: | Height: | Size: 454 B |
BIN
images/ic_goods_type_default.png
Normal file → Executable file
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 519 B |
BIN
images/ic_shop_car_icon.png
Normal file → Executable file
Before Width: | Height: | Size: 685 B After Width: | Height: | Size: 387 B |
BIN
images/index-on.png
Normal file → Executable file
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 523 B |
BIN
images/index.png
Normal file → Executable file
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 470 B |
BIN
images/login-bg.png
Normal file → Executable file
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 41 KiB |
BIN
images/logo.png
Normal file → Executable file
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 4.7 KiB |
BIN
images/selected-l.png
Normal file → Executable file
Before Width: | Height: | Size: 163 B After Width: | Height: | Size: 121 B |
BIN
images/selected-r.png
Normal file → Executable file
Before Width: | Height: | Size: 175 B After Width: | Height: | Size: 122 B |
BIN
images/setting.png
Normal file → Executable file
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 716 B |
BIN
images/share.png
Normal file → Executable file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 757 B |
@ -2,145 +2,173 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
dataList: [],
|
dataList: [],
|
||||||
areaList: [],
|
areaList: [],
|
||||||
pages: {
|
typeList: [],
|
||||||
page: 1,
|
pages: {
|
||||||
rows: 5,
|
page: 1,
|
||||||
county: ''
|
rows: 5,
|
||||||
}
|
activityType: ''
|
||||||
},
|
|
||||||
getAreaList: function () {
|
|
||||||
var self = this;
|
|
||||||
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listallbyparentidrelease/640675', []),
|
|
||||||
self.data.pages, null, function (code, data) {
|
|
||||||
if (code == '200') {
|
|
||||||
self.setData({
|
|
||||||
areaList: data
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
)
|
//获取活动分类
|
||||||
},
|
getActivityTypeList() {
|
||||||
changeArea: function (e) {
|
var _self = this;
|
||||||
app.dialog.loading('正在加载');
|
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dictionaryself/listdictionarybyparentidrelease/e36ad682-c6b4-44fe-a05c-889a5ff7c284', []),
|
||||||
this.setData({
|
null, null,
|
||||||
'pages.county': e.currentTarget.dataset.area
|
function (code, data) {
|
||||||
})
|
_self.setData({
|
||||||
this.getActivityList()
|
typeList: data,
|
||||||
},
|
'pages.activityType': data[0].dataId
|
||||||
loadAll: function () {
|
})
|
||||||
this.setData({
|
_self.getActivityList()
|
||||||
'pages.county': ''
|
},
|
||||||
})
|
function (err) {
|
||||||
this.getActivityList()
|
|
||||||
},
|
|
||||||
goDetail: function (e) {
|
|
||||||
var id = e.currentTarget.dataset.id;
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '../activityDetail/activityDetail?id=' + id
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getActivityList: function() {
|
|
||||||
var self = this;
|
|
||||||
app.restAjax.get(app.restAjax.path(app.activityUrl + '/wechat-miniapp/activitylibrary/listpageactivitylibraryfornetrelease', []),
|
|
||||||
self.data.pages, null, function(code, data) {
|
|
||||||
console.log(code+"==="+data)
|
|
||||||
if('200' == code) {
|
|
||||||
for(var item of data.rows) {
|
|
||||||
if('' != item.activityImage) {
|
|
||||||
item.activityImage = app.activityUrl + '/route/file/download/true/' + item.activityImage;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(1 === self.data.pages.page) {
|
|
||||||
self.setData({
|
|
||||||
dataList: data.rows,
|
|
||||||
})
|
|
||||||
}else {
|
|
||||||
if(data.rows.length == 0) {
|
|
||||||
self.setData({
|
|
||||||
[`pages.page`] : self.data.pages.page - 1
|
|
||||||
})
|
|
||||||
app.dialog.msg('暂无更多')
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
self.setData({
|
);
|
||||||
dataList: data.rows.concat(self.data.dataList),
|
},
|
||||||
|
getAreaList: function () {
|
||||||
|
var self = this;
|
||||||
|
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dictionaryself/listdictionarybyparentidrelease/e36ad682-c6b4-44fe-a05c-889a5ff7c284', []),
|
||||||
|
self.data.pages, null,
|
||||||
|
function (code, data) {
|
||||||
|
if (code == '200') {
|
||||||
|
self.setData({
|
||||||
|
areaList: data,
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
changeArea: function (e) {
|
||||||
|
app.dialog.loading('正在加载');
|
||||||
|
console.log(e)
|
||||||
|
this.setData({
|
||||||
|
'pages.activityType': e.currentTarget.dataset.dataid
|
||||||
|
})
|
||||||
|
this.getActivityList()
|
||||||
|
},
|
||||||
|
loadAll: function () {
|
||||||
|
this.setData({
|
||||||
|
'pages.county': ''
|
||||||
|
})
|
||||||
|
this.getActivityList()
|
||||||
|
},
|
||||||
|
goDetail: function (e) {
|
||||||
|
var id = e.currentTarget.dataset.id;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '../activityDetail/activityDetail?id=' + id
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getActivityList: function () {
|
||||||
|
var self = this;
|
||||||
|
app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activitylibrary/listpageactivitylibraryfornetrelease/{areaCode}', [app.areaCode]),
|
||||||
|
self.data.pages, null,
|
||||||
|
function (code, data) {
|
||||||
|
console.log(code + "===" + data)
|
||||||
|
if ('200' == code) {
|
||||||
|
for (var item of data.rows) {
|
||||||
|
if ('' != item.activityImage) {
|
||||||
|
item.activityImage = app.activityUrl + '/route/file/download/true/' + item.activityImage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (1 === self.data.pages.page) {
|
||||||
|
self.setData({
|
||||||
|
dataList: data.rows,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
if (data.rows.length == 0) {
|
||||||
|
self.setData({
|
||||||
|
[`pages.page`]: self.data.pages.page - 1
|
||||||
|
})
|
||||||
|
app.dialog.msg('暂无更多')
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
self.setData({
|
||||||
|
dataList: data.rows.concat(self.data.dataList),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
function () {
|
||||||
|
wx.hideNavigationBarLoading(); //完成停止加载图标
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
wx.hideLoading();
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
}
|
/**
|
||||||
}, function() {
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
this.getActivityTypeList()
|
||||||
|
// this.getActivityList();
|
||||||
|
// this.getAreaList()
|
||||||
|
|
||||||
}, function() {
|
},
|
||||||
wx.hideNavigationBarLoading(); //完成停止加载图标
|
|
||||||
wx.stopPullDownRefresh();
|
|
||||||
wx.hideLoading();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad: function (options) {
|
|
||||||
this.getActivityList();
|
|
||||||
this.getAreaList()
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
*/
|
*/
|
||||||
onReady: function () {
|
onReady: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面隐藏
|
* 生命周期函数--监听页面隐藏
|
||||||
*/
|
*/
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面卸载
|
* 生命周期函数--监听页面卸载
|
||||||
*/
|
*/
|
||||||
onUnload: function () {
|
onUnload: function () {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh: function () {
|
onPullDownRefresh: function () {
|
||||||
// 在标题栏中显示加载图标
|
// 在标题栏中显示加载图标
|
||||||
wx.showNavigationBarLoading();
|
wx.showNavigationBarLoading();
|
||||||
var self = this;
|
var self = this;
|
||||||
self.setData({
|
self.setData({
|
||||||
[`pages.page`] : self.data.pages.page + 1
|
[`pages.page`]: 1,
|
||||||
})
|
dataList: []
|
||||||
this.getActivityList();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
})
|
||||||
* 页面上拉触底事件的处理函数
|
this.getActivityList();
|
||||||
*/
|
},
|
||||||
onReachBottom: function () {
|
|
||||||
|
|
||||||
},
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
/**
|
},
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage: function () {
|
|
||||||
|
|
||||||
}
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
@ -1,23 +1,23 @@
|
|||||||
<view class="area">
|
<view class="area">
|
||||||
<view class="area-box {{'' == pages.county?'active': ''}}" bindtap="loadAll">全部</view>
|
<!-- <view class="area-box {{'' == pages.county?'active': ''}}" bindtap="loadAll">全部</view> -->
|
||||||
<view class="area-box {{item.areaId == pages.county?'active': ''}}" wx:for="{{areaList}}" wx:key="index" data-area="{{item.areaId}}" bindtap="changeArea">{{item.areaName}}</view>
|
<view class="area-box {{item.dataId == pages.activityType? 'active' : ''}}" wx:for="{{typeList}}" wx:key="index" data-dataId="{{item.dataId}}" bindtap="changeArea">{{item.dataName}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="activity">
|
<view class="activity">
|
||||||
<view class="activity-box" bindtap="goDetail" data-id="{{item.activityLibraryId}}" wx:for="{{dataList}}" wx:key="index">
|
<view class="activity-box" bindtap="goDetail" data-id="{{item.activityLibraryId}}" wx:for="{{dataList}}" wx:key="index">
|
||||||
<view class="activity-img">
|
<view class="activity-img">
|
||||||
<image src="{{item.activityImage}}"></image>
|
<image src="{{item.activityImage}}"></image>
|
||||||
|
</view>
|
||||||
|
<view class="activity-info">
|
||||||
|
<view class="title">
|
||||||
|
<view class="activity-title">{{item.activityTitle}}</view>
|
||||||
|
<view class="sign" wx:if="{{item.activityState == '3'}}">报名中</view>
|
||||||
|
<view class="sign" wx:if="{{item.activityState == '4'}}">报名人数已满</view>
|
||||||
|
<view class="sign" wx:if="{{item.activityState == '5'}}">停止报名</view>
|
||||||
|
<view class="sign" wx:if="{{item.activityState == '6'}}">进行中</view>
|
||||||
|
<view class="sign" wx:if="{{item.activityState == '7'}}">直接进入</view>
|
||||||
|
<view class="sign" wx:if="{{item.activityState == '99'}}">已结束</view>
|
||||||
|
</view>
|
||||||
|
<view class="date">{{item.activityStartTime}}至{{item.activityEndTime}}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="activity-info">
|
|
||||||
<view class="title">
|
|
||||||
<view class="activity-title">{{item.activityTitle}}</view>
|
|
||||||
<view class="sign" wx:if="{{item.activityState == '3'}}">报名中</view>
|
|
||||||
<view class="sign" wx:if="{{item.activityState == '4'}}">报名人数已满</view>
|
|
||||||
<view class="sign" wx:if="{{item.activityState == '5'}}">停止报名</view>
|
|
||||||
<view class="sign" wx:if="{{item.activityState == '6'}}">进行中</view>
|
|
||||||
<view class="sign" wx:if="{{item.activityState == '7'}}">直接进入</view>
|
|
||||||
<view class="sign" wx:if="{{item.activityState == '99'}}">已结束</view>
|
|
||||||
</view>
|
|
||||||
<view class="date">{{item.activityStartTime}}至{{item.activityEndTime}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
@ -1,89 +1,105 @@
|
|||||||
.activity{
|
.activity {
|
||||||
padding: 20rpx 30rpx 0;
|
padding: 20rpx 30rpx 0;
|
||||||
margin-top: 80rpx;
|
margin-top: 80rpx;
|
||||||
}
|
}
|
||||||
.activity-box{
|
|
||||||
margin-bottom: 20rpx;
|
.activity-box {
|
||||||
box-shadow:0px 0px 17rpx 0px rgba(0,0,0,0.1);
|
margin-bottom: 20rpx;
|
||||||
border-radius: 10rpx;
|
box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.1);
|
||||||
overflow: hidden;
|
border-radius: 10rpx;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.activity-img{
|
|
||||||
height: 320rpx;
|
.activity-img {
|
||||||
position: relative;
|
height: 320rpx;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
.activity-img image{
|
|
||||||
width: 100%;
|
.activity-img image {
|
||||||
height: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
.corner{
|
|
||||||
position: absolute;
|
.corner {
|
||||||
top: 20rpx;
|
position: absolute;
|
||||||
right: 20rpx;
|
top: 20rpx;
|
||||||
display: flex;
|
right: 20rpx;
|
||||||
color: #fff;
|
display: flex;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
.corner view{
|
|
||||||
padding: 0 10rpx;
|
.corner view {
|
||||||
background: rgba(0,0,0,0.6);
|
padding: 0 10rpx;
|
||||||
line-height: 40rpx;
|
background: rgba(0, 0, 0, 0.6);
|
||||||
vertical-align: middle;
|
line-height: 40rpx;
|
||||||
display: flex;
|
vertical-align: middle;
|
||||||
align-items: center;
|
display: flex;
|
||||||
border-radius: 5rpx;
|
align-items: center;
|
||||||
|
border-radius: 5rpx;
|
||||||
}
|
}
|
||||||
.view-count{
|
|
||||||
margin-right: 20rpx;
|
.view-count {
|
||||||
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
.view-count image{
|
|
||||||
width: 40rpx;
|
.view-count image {
|
||||||
height: 40rpx;
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
}
|
}
|
||||||
.activity-info{
|
|
||||||
padding: 15rpx 20rpx;
|
.activity-info {
|
||||||
|
padding: 15rpx 20rpx;
|
||||||
}
|
}
|
||||||
.title{
|
|
||||||
display: flex;
|
.title {
|
||||||
justify-content: space-between;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
.activity-title{
|
|
||||||
width: 70%;
|
.activity-title {
|
||||||
white-space: nowrap;
|
width: 70%;
|
||||||
overflow: hidden;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
overflow: hidden;
|
||||||
font-size: 32rpx;
|
text-overflow: ellipsis;
|
||||||
color: #242424;
|
font-size: 32rpx;
|
||||||
line-height: 40rpx;
|
color: #242424;
|
||||||
|
line-height: 40rpx;
|
||||||
}
|
}
|
||||||
.sign{
|
|
||||||
background: rgba(159,21,18,.1);
|
.sign {
|
||||||
color: #9F1512;
|
background: rgba(159, 21, 18, .1);
|
||||||
border-radius: 10rpx;
|
color: #9F1512;
|
||||||
padding: 0 20rpx;
|
border-radius: 10rpx;
|
||||||
line-height: 40rpx;
|
padding: 0 20rpx;
|
||||||
font-size: 28rpx;
|
line-height: 40rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
.date{
|
|
||||||
margin-top: 10rpx;
|
.date {
|
||||||
font-size: 24rpx;
|
margin-top: 10rpx;
|
||||||
color: #242424;
|
font-size: 24rpx;
|
||||||
|
color: #242424;
|
||||||
}
|
}
|
||||||
.area{
|
|
||||||
position: fixed;
|
.area {
|
||||||
top: 0;
|
position: fixed;
|
||||||
left: 0;
|
top: 0;
|
||||||
right: 0;
|
left: 0;
|
||||||
height: 80rpx;
|
right: 0;
|
||||||
white-space: nowrap;
|
height: 80rpx;
|
||||||
overflow-x: auto;
|
white-space: nowrap;
|
||||||
|
overflow-x: auto;
|
||||||
|
box-shadow: 10rpx 10rpx 5rpx #f2f2f2;
|
||||||
}
|
}
|
||||||
.area-box{
|
|
||||||
display: inline-block;
|
.area-box {
|
||||||
width: 25%;
|
display: inline-block;
|
||||||
line-height: 80rpx;
|
width: 25%;
|
||||||
text-align: center;
|
line-height: 80rpx;
|
||||||
font-size: 30rpx;
|
text-align: center;
|
||||||
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
.area-box.active{
|
|
||||||
color: #9F1512;
|
.area-box.active {
|
||||||
|
color: #9F1512;
|
||||||
}
|
}
|
@ -58,12 +58,12 @@ Page({
|
|||||||
var url;
|
var url;
|
||||||
var id = options.id;
|
var id = options.id;
|
||||||
if(!self.data.token) {
|
if(!self.data.token) {
|
||||||
url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyidrelease/' + id;
|
url = '/app/activitylibrary/getactivitylibrarybyidrelease/' + id;
|
||||||
self.setData({
|
self.setData({
|
||||||
token: null
|
token: null
|
||||||
})
|
})
|
||||||
}else {
|
}else {
|
||||||
url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyid/' + id
|
url = '/app/activitylibrary/getactivitylibrarybyid/' + id
|
||||||
self.getToken()
|
self.getToken()
|
||||||
}
|
}
|
||||||
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), {}, {
|
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), {}, {
|
||||||
|
@ -31,7 +31,7 @@ Page({
|
|||||||
},
|
},
|
||||||
getActivityHis: function() {
|
getActivityHis: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/teamactivityhis/listpageteamactivityhis?serviceId=' + self.data.serviceId, []),
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/teamactivityhis/listpageteamactivityhis?serviceId=' + self.data.serviceId, []),
|
||||||
self.data.pages, {
|
self.data.pages, {
|
||||||
headers: {
|
headers: {
|
||||||
token: self.data.token
|
token: self.data.token
|
||||||
|
@ -118,9 +118,9 @@ Page({
|
|||||||
var url;
|
var url;
|
||||||
var id = options.id;
|
var id = options.id;
|
||||||
if (!self.data.token) {
|
if (!self.data.token) {
|
||||||
url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyidrelease/' + id;
|
url = '/app/activitylibrary/getactivitylibrarybyidrelease/' + id;
|
||||||
} else {
|
} else {
|
||||||
url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyid/' + id
|
url = '/app/activitylibrary/getactivitylibrarybyid/' + id
|
||||||
}
|
}
|
||||||
self.setData({
|
self.setData({
|
||||||
activityId: options.id
|
activityId: options.id
|
||||||
|
@ -33,7 +33,7 @@ Page({
|
|||||||
doGetLibraryList: function(page) {
|
doGetLibraryList: function(page) {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.dialog.loading('正在加载');
|
app.dialog.loading('正在加载');
|
||||||
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/listpageintangiblelibraryrelease', [self.data.libraryUrl]), {
|
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/listpageintangiblelibraryrelease/{areaCode}', [self.data.libraryUrl,app.areaCode]), {
|
||||||
page: page,
|
page: page,
|
||||||
rows: self.data.rows
|
rows: self.data.rows
|
||||||
}, null, function(code, data) {
|
}, null, function(code, data) {
|
||||||
|
@ -121,7 +121,7 @@ Page({
|
|||||||
},
|
},
|
||||||
doGetBanner: function () {
|
doGetBanner: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), {
|
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [self.data.news.newsUrl, app.areaCode]), {
|
||||||
newsDirectoriesId: 'eab0ca3c-d35d-4c02-9397-ace2bdd10fc1',
|
newsDirectoriesId: 'eab0ca3c-d35d-4c02-9397-ace2bdd10fc1',
|
||||||
page: 1,
|
page: 1,
|
||||||
rows: 5
|
rows: 5
|
||||||
@ -135,7 +135,7 @@ Page({
|
|||||||
},
|
},
|
||||||
doGetVenueList: function () {
|
doGetVenueList: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease', [self.data.venue.venueUrl]), {
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease/{areaCode}', [self.data.venue.venueUrl, app.areaCode]), {
|
||||||
page: 1,
|
page: 1,
|
||||||
rows: 3,
|
rows: 3,
|
||||||
latitude: app.globalData.curLat,
|
latitude: app.globalData.curLat,
|
||||||
@ -152,9 +152,26 @@ Page({
|
|||||||
app.dialog.msg(data.msg);
|
app.dialog.msg(data.msg);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//加载活动图片错误
|
||||||
|
loadImgErr(e) {
|
||||||
|
console.log(e)
|
||||||
|
var index = e.currentTarget.dataset.index
|
||||||
|
this.data.activity.activityList[index].activityImageArray.unshift("03c2ea0d-87ad-43db-bba0-ae6b4f827dba")
|
||||||
|
this.setData({
|
||||||
|
activity: this.data.activity
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//加载轮播图错误
|
||||||
|
loadBannerErr(e) {
|
||||||
|
var index = e.currentTarget.dataset.index
|
||||||
|
this.data.news.bannerList[index].newsContentCoverList.unshift('03c2ea0d-87ad-43db-bba0-ae6b4f827dba')
|
||||||
|
this.setData({
|
||||||
|
news: this.data.news
|
||||||
|
})
|
||||||
|
},
|
||||||
doGetActivityList: function () {
|
doGetActivityList: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path('{activityUrl}/app/activitylibrary/listpageactivitylibraryrelease', [self.data.activity.activityUrl]), {
|
app.restAjax.get(app.restAjax.path('{activityUrl}/app/activitylibrary/listpageactivitylibraryfornetrelease/{areaCode}', [self.data.activity.activityUrl, app.areaCode]), {
|
||||||
page: 1,
|
page: 1,
|
||||||
rows: 3
|
rows: 3
|
||||||
}, null, function (code, data) {
|
}, null, function (code, data) {
|
||||||
@ -264,8 +281,8 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
goHeritage: function () {
|
goHeritage: function () {
|
||||||
wx.switchTab({
|
wx.navigateTo({
|
||||||
url: '../heritage/heritage',
|
url: '/pages/heritage/heritage',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goCultureDetail: function (event) {
|
goCultureDetail: function (event) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<view class="swiper-box">
|
<view class="swiper-box">
|
||||||
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}">
|
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}">
|
||||||
<swiper-item class="swiper-item" wx:for="{{news.bannerList}}" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:for-index="idx" wx:for-item="item" wx:key="bannerList">
|
<swiper-item class="swiper-item" wx:for="{{news.bannerList}}" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:for-index="idx" wx:for-item="item" wx:key="bannerList">
|
||||||
<image src="{{news.newsUrl}}/route/file/download/true/{{coverItem.contentCoverId}}" wx:for="{{item.newsContentCoverList}}" wx:for-item="coverItem" class="swiper-img" wx:key="swiperImg"></image>
|
<image binderror="loadBannerErr" data-index="{{idx}}" src="{{news.newsUrl}}/route/file/download/true/{{coverItem.contentCoverId}}" wx:for="{{item.newsContentCoverList}}" wx:for-item="coverItem" class="swiper-img" wx:key="swiperImg"></image>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@ -41,12 +41,17 @@
|
|||||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="line"></view>
|
||||||
<view class="recommend-container">
|
<view class="recommend-container">
|
||||||
<view class="recommend-box" wx:for="{{venue.venueList}}" bindtap="goVenueDetail" data-venues-info-Id="{{item.venuesInfoId}}" wx:for-index="index" wx:for-item="item" wx:key="venueList">
|
<view class="recommend-box" wx:for="{{venue.venueList}}" bindtap="goVenueDetail" data-venues-info-Id="{{item.venuesInfoId}}" wx:for-index="index" wx:for-item="item" wx:key="venueList">
|
||||||
|
<view class="recommend-status">场馆导航</view>
|
||||||
|
<view class="recommend-name">{{item.venueName}}</view>
|
||||||
<image src="{{venue.venueUrl}}/route/file/download/true/{{item.venuePanoramaArray[0]}}"></image>
|
<image src="{{venue.venueUrl}}/route/file/download/true/{{item.venuePanoramaArray[0]}}"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="recommend-box" wx:for="{{activity.activityList}}" bindtap="goActivityDetail" data-activity-library-id="{{item.activityLibraryId}}" wx:for-index="index" wx:for-item="item" wx:key="activityList">
|
<view class="recommend-box" wx:for="{{activity.activityList}}" bindtap="goActivityDetail" data-activity-library-id="{{item.activityLibraryId}}" wx:for-index="index" wx:for-item="item" wx:key="activityList">
|
||||||
<image src="{{activity.activityUrl}}/route/file/download/true/{{item.activityImageArray[0]}}"></image>
|
<view class="recommend-status">精彩活动</view>
|
||||||
|
<view class="recommend-name">{{item.activityTitle}}</view>
|
||||||
|
<image src="{{activity.activityUrl}}/route/file/download/true/{{item.activityImageArray[0]}}" data-index="{{index}}" binderror="loadImgErr"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -29,7 +29,7 @@ swiper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.recommend {
|
.recommend {
|
||||||
padding: 30rpx;
|
padding: 0rpx 30rpx 30rpx 30rpx;
|
||||||
border-bottom: 5px solid #FBFBFB;
|
border-bottom: 5px solid #FBFBFB;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,6 +37,13 @@ swiper {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 100%;
|
||||||
|
height: 1rpx;
|
||||||
|
background: #f2f2f2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-box {
|
.recommend-box {
|
||||||
@ -49,11 +56,36 @@ swiper {
|
|||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.recommend-name {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
font-size: 20rpx;
|
||||||
|
background: #00000088;
|
||||||
|
color: white;
|
||||||
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
.recommend-box image {
|
.recommend-box image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.recommend-status {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
background: #9F1512;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
color: white;
|
||||||
|
font-size: 20rpx;
|
||||||
|
padding: 0rpx 10rpx;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
.public-title {
|
.public-title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 10rpx 0rpx;
|
padding: 10rpx 0rpx;
|
||||||
|
@ -48,10 +48,10 @@ Page({
|
|||||||
})
|
})
|
||||||
if(self.data.type === '1') {
|
if(self.data.type === '1') {
|
||||||
// 我发起的活动
|
// 我发起的活动
|
||||||
self.myActivity(app.volunteerUrl + '/wechat-miniapp/volunteerservice/listpagevolunteerservice');
|
self.myActivity(app.volunteerUrl + '/app/volunteerservice/listpagevolunteerservice');
|
||||||
}else {
|
}else {
|
||||||
// 我参加的活动
|
// 我参加的活动
|
||||||
self.myActivity(app.volunteerUrl + '/wechat-miniapp/volunteerservice/listpagemyjoinservice');
|
self.myActivity(app.volunteerUrl + '/app/volunteerservice/listpagemyjoinservice');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
myActivity: function(url) {
|
myActivity: function(url) {
|
||||||
@ -83,7 +83,7 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
this.getToken().then(result => {
|
this.getToken().then(result => {
|
||||||
this.myActivity(app.volunteerUrl + '/wechat-miniapp/volunteerservice/listpagevolunteerservice');
|
this.myActivity(app.volunteerUrl + '/app/volunteerservice/listpagevolunteerservice');
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -68,14 +68,14 @@ Page({
|
|||||||
var methodType;
|
var methodType;
|
||||||
var title;
|
var title;
|
||||||
if('1' == self.data.type) {
|
if('1' == self.data.type) {
|
||||||
url = app.volunteerUrl + '/wechat-miniapp/teammember/saveteammember'
|
url = app.volunteerUrl + '/app/teammember/saveteammember'
|
||||||
teamMemberVO = {
|
teamMemberVO = {
|
||||||
teamId: e.currentTarget.dataset.teamid
|
teamId: e.currentTarget.dataset.teamid
|
||||||
}
|
}
|
||||||
methodType = app.restAjax.post
|
methodType = app.restAjax.post
|
||||||
title = '申请成功!'
|
title = '申请成功!'
|
||||||
}else {
|
}else {
|
||||||
url = app.volunteerUrl + '/wechat-miniapp/teammember/quitTeam/' + self.data.teamId
|
url = app.volunteerUrl + '/app/teammember/quitTeam/' + self.data.teamId
|
||||||
methodType = app.restAjax.get
|
methodType = app.restAjax.get
|
||||||
title = '退出成功!'
|
title = '退出成功!'
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
this.getToken().then(result => {
|
this.getToken().then(result => {
|
||||||
this.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/myteamm');
|
this.otherTeam(app.volunteerUrl + '/app/team/myteamm');
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ Page({
|
|||||||
self.data.teamArea[self.data.teamAreaIndex].dictionaryId :
|
self.data.teamArea[self.data.teamAreaIndex].dictionaryId :
|
||||||
'',
|
'',
|
||||||
};
|
};
|
||||||
app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/team/saveteam', []),
|
app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/app/team/saveteam', []),
|
||||||
teamVO, {
|
teamVO, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': self.data.token
|
'token': self.data.token
|
||||||
@ -262,7 +262,7 @@ Page({
|
|||||||
getDataFromArea: function(dictId, type) {
|
getDataFromArea: function(dictId, type) {
|
||||||
var self = this;
|
var self = this;
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/area/listallbyparentidrelease/' + dictId, []),
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/area/listbyparentidrelease/' + dictId, []),
|
||||||
{}, {
|
{}, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': self.data.token
|
'token': self.data.token
|
||||||
|
@ -177,7 +177,7 @@ Page({
|
|||||||
photo: self.data.uploadPhoto,
|
photo: self.data.uploadPhoto,
|
||||||
serviceRequirement: self.data.serviceRequirement
|
serviceRequirement: self.data.serviceRequirement
|
||||||
};
|
};
|
||||||
app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/volunteerservice/savevolunteerservice', []),
|
app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/app/volunteerservice/savevolunteerservice', []),
|
||||||
volunteerServiceVO, {
|
volunteerServiceVO, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': self.data.token
|
'token': self.data.token
|
||||||
|
@ -17,6 +17,7 @@ Page({
|
|||||||
areaId: app.areaCode,
|
areaId: app.areaCode,
|
||||||
defaultAreaId: app.areaCode
|
defaultAreaId: app.areaCode
|
||||||
},
|
},
|
||||||
|
//获取下级子目录
|
||||||
doGetNewsDictionariesList: function () {
|
doGetNewsDictionariesList: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.dialog.loading('正在加载');
|
app.dialog.loading('正在加载');
|
||||||
@ -43,22 +44,19 @@ Page({
|
|||||||
});
|
});
|
||||||
self.doGetNewsList(1);
|
self.doGetNewsList(1);
|
||||||
},
|
},
|
||||||
//全部类型
|
//获取新闻
|
||||||
doClearCurrentNewsDictionariesId: function () {
|
|
||||||
var self = this;
|
|
||||||
self.setData({
|
|
||||||
currentNewsDictionariesId: self.data.dirId
|
|
||||||
});
|
|
||||||
self.doGetNewsList(1);
|
|
||||||
},
|
|
||||||
doGetNewsList: function (page, lv) {
|
doGetNewsList: function (page, lv) {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.dialog.loading('正在加载');
|
app.dialog.loading('正在加载');
|
||||||
var info = {
|
var info = {
|
||||||
newsDirectoriesId: self.data.currentNewsDictionariesId,
|
|
||||||
page: page,
|
page: page,
|
||||||
rows: self.data.rows
|
rows: self.data.rows
|
||||||
}
|
}
|
||||||
|
if (self.data.currentNewsDictionariesId == self.data.dirId) {
|
||||||
|
info.newsDirectoriesParentId = self.data.dirId;
|
||||||
|
} else {
|
||||||
|
info.newsDirectoriesId = self.data.currentNewsDictionariesId;
|
||||||
|
}
|
||||||
var tempAreaCode = app.areaCode;
|
var tempAreaCode = app.areaCode;
|
||||||
if (lv) {
|
if (lv) {
|
||||||
tempAreaCode = self.data.areaId;
|
tempAreaCode = self.data.areaId;
|
||||||
@ -94,7 +92,7 @@ Page({
|
|||||||
},
|
},
|
||||||
getAreaList: function () {
|
getAreaList: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listallbyparentidrelease/640675', []),
|
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listbyparentidrelease/' + app.areaId, []),
|
||||||
self.data.pages, null,
|
self.data.pages, null,
|
||||||
function (code, data) {
|
function (code, data) {
|
||||||
if (code == '200') {
|
if (code == '200') {
|
||||||
@ -113,6 +111,15 @@ Page({
|
|||||||
})
|
})
|
||||||
this.doGetNewsList(1, lv)
|
this.doGetNewsList(1, lv)
|
||||||
},
|
},
|
||||||
|
//加载全部类型
|
||||||
|
doClearCurrentNewsDictionariesId: function () {
|
||||||
|
var self = this;
|
||||||
|
self.setData({
|
||||||
|
currentNewsDictionariesId: self.data.dirId
|
||||||
|
});
|
||||||
|
self.doGetNewsList(1);
|
||||||
|
},
|
||||||
|
//加载全部地区
|
||||||
loadAll: function () {
|
loadAll: function () {
|
||||||
this.setData({
|
this.setData({
|
||||||
areaId: app.areaCode
|
areaId: app.areaCode
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 25%;
|
width: 25%;
|
||||||
|
min-width: fit-content;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
@ -40,7 +40,7 @@ Page({
|
|||||||
page: page,
|
page: page,
|
||||||
rows: self.data.rows
|
rows: self.data.rows
|
||||||
}
|
}
|
||||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [app.newsUrl]), info, null, function (code, data) {
|
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [app.newsUrl,app.areaCode]), info, null, function (code, data) {
|
||||||
var newsArray;
|
var newsArray;
|
||||||
for (var i = 0; i < data.rows.length; i++) {
|
for (var i = 0; i < data.rows.length; i++) {
|
||||||
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId
|
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId
|
||||||
|
@ -134,7 +134,7 @@ Page({
|
|||||||
*/
|
*/
|
||||||
sendEnrollRequest: function(serviceMemberVO) {
|
sendEnrollRequest: function(serviceMemberVO) {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/servicemember/saveservicemember', []),
|
app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/app/servicemember/saveservicemember', []),
|
||||||
serviceMemberVO, {
|
serviceMemberVO, {
|
||||||
headers: {
|
headers: {
|
||||||
token: self.data.token
|
token: self.data.token
|
||||||
@ -159,9 +159,9 @@ Page({
|
|||||||
var self = this;
|
var self = this;
|
||||||
var url;
|
var url;
|
||||||
if(self.data.teamArray.length > 0) {
|
if(self.data.teamArray.length > 0) {
|
||||||
url = app.volunteerUrl + '/wechat-miniapp/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/' + self.data.team[self.data.teamIndex].teamId;
|
url = app.volunteerUrl + '/app/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/' + self.data.team[self.data.teamIndex].teamId;
|
||||||
}else {
|
}else {
|
||||||
url = app.volunteerUrl + '/wechat-miniapp/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/null';
|
url = app.volunteerUrl + '/app/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/null';
|
||||||
}
|
}
|
||||||
|
|
||||||
app.restAjax.get(app.restAjax.path(url, []), {}, {
|
app.restAjax.get(app.restAjax.path(url, []), {}, {
|
||||||
@ -187,7 +187,7 @@ Page({
|
|||||||
getMyTeam: function() {
|
getMyTeam: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
console.log(self.data.token)
|
console.log(self.data.token)
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/team/myteamm', []),
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/team/myteamm', []),
|
||||||
{}, {
|
{}, {
|
||||||
headers: {
|
headers: {
|
||||||
token: self.data.token
|
token: self.data.token
|
||||||
|
@ -28,7 +28,7 @@ Page({
|
|||||||
},
|
},
|
||||||
getDetail(teamId) {
|
getDetail(teamId) {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/team/getteambyid/' + teamId, []),
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/team/getteambyid/' + teamId, []),
|
||||||
{}, {
|
{}, {
|
||||||
headers: {
|
headers: {
|
||||||
token: self.data.token
|
token: self.data.token
|
||||||
@ -48,7 +48,7 @@ Page({
|
|||||||
},
|
},
|
||||||
getMember(teamId) {
|
getMember(teamId) {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/teammember/listteammember?teamId=' + teamId, []),
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/teammember/listteammember?teamId=' + teamId, []),
|
||||||
{}, {
|
{}, {
|
||||||
headers: {
|
headers: {
|
||||||
token: self.data.token
|
token: self.data.token
|
||||||
@ -80,7 +80,7 @@ Page({
|
|||||||
console.log(e)
|
console.log(e)
|
||||||
var id = e.currentTarget.dataset.teammemberid;
|
var id = e.currentTarget.dataset.teammemberid;
|
||||||
var type = e.currentTarget.dataset.type;
|
var type = e.currentTarget.dataset.type;
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/teammember/checkmember/'+id+'/' + type + '?teamId=' + self.data.teamId, []),
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/teammember/checkmember/'+id+'/' + type + '?teamId=' + self.data.teamId, []),
|
||||||
{}, {
|
{}, {
|
||||||
headers: {
|
headers: {
|
||||||
token: self.data.token
|
token: self.data.token
|
||||||
|
@ -47,7 +47,7 @@ Page({
|
|||||||
page: page,
|
page: page,
|
||||||
rows: self.data.rows
|
rows: self.data.rows
|
||||||
}
|
}
|
||||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [app.newsUrl]), info, null, function (code, data) {
|
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [app.newsUrl,app.areaCode]), info, null, function (code, data) {
|
||||||
var newsArray;
|
var newsArray;
|
||||||
for (var i = 0; i < data.rows.length; i++) {
|
for (var i = 0; i < data.rows.length; i++) {
|
||||||
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId
|
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId
|
||||||
|
@ -20,7 +20,7 @@ Page({
|
|||||||
rows: self.data.rows,
|
rows: self.data.rows,
|
||||||
newsDirectoriesId: self.data.newsDirectoriesId
|
newsDirectoriesId: self.data.newsDirectoriesId
|
||||||
}
|
}
|
||||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [app.newsUrl]), info, null, function (code, data) {
|
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [app.newsUrl,app.areaCode]), info, null, function (code, data) {
|
||||||
var newsArray;
|
var newsArray;
|
||||||
for (var i = 0; i < data.rows.length; i++) {
|
for (var i = 0; i < data.rows.length; i++) {
|
||||||
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId
|
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId
|
||||||
|
@ -25,7 +25,7 @@ Page({
|
|||||||
},
|
},
|
||||||
getUserAgree: function(type) {
|
getUserAgree: function(type) {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/agreecontent/getagreecontentbyid/' + type, []),
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/agreecontent/getagreecontentbyid/' + type, []),
|
||||||
{}, {
|
{}, {
|
||||||
headers: {
|
headers: {
|
||||||
token: self.data.token
|
token: self.data.token
|
||||||
|
@ -2,226 +2,229 @@ var app = getApp();
|
|||||||
// pages/venue/venue.js
|
// pages/venue/venue.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
venueUrl : app.venueUrl,
|
venueUrl: app.venueUrl,
|
||||||
imgRoute : '/route/file/download/true/',
|
imgRoute: '/route/file/download/true/',
|
||||||
venueTypeParentId : 'df8b758c-f6d8-465a-9aa8-c451fde47076',
|
venueTypeParentId: 'df8b758c-f6d8-465a-9aa8-c451fde47076',
|
||||||
page : '1',
|
page: '1',
|
||||||
rows : '10',
|
rows: '10',
|
||||||
venueTypeList: [],
|
venueTypeList: [],
|
||||||
venuesList: [],
|
venuesList: [],
|
||||||
orderKey : '',
|
orderKey: '',
|
||||||
venueType : '',
|
venueType: '',
|
||||||
latitude: '',
|
latitude: '',
|
||||||
longitude: '',
|
longitude: '',
|
||||||
selectingArea: false, // 显示隐藏选择区域
|
selectingArea: false, // 显示隐藏选择区域
|
||||||
areaList: [],
|
areaList: [],
|
||||||
venueArea: '',
|
venueArea: '',
|
||||||
areaName: ''
|
areaName: ''
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取定位
|
//获取定位
|
||||||
getLocation: function () {
|
getLocation: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.getLocation({
|
wx.getLocation({
|
||||||
type: 'gcj02',
|
type: 'gcj02',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
self.setData({
|
self.setData({
|
||||||
latitude: res.latitude,
|
latitude: res.latitude,
|
||||||
longitude: res.longitude
|
longitude: res.longitude
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
self.listPageVenuesInfo();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
complete: function(){
|
|
||||||
self.listPageVenuesInfo();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
//获取场馆分类
|
//获取场馆分类
|
||||||
listVenueType : function(){
|
listVenueType: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuedictionary/listvenuedictionarybyparentidrelease/{venueTypeParentId}',
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuedictionary/listvenuedictionarybyparentidrelease/{venueTypeParentId}',
|
||||||
[app.venueUrl, self.data.venueTypeParentId]), {}, null,
|
[app.venueUrl, self.data.venueTypeParentId]), {}, null,
|
||||||
function(code,data){
|
function (code, data) {
|
||||||
self.setData({
|
self.setData({
|
||||||
venueTypeList: data.data
|
venueTypeList: data.data
|
||||||
});
|
});
|
||||||
},function(code, data){
|
},
|
||||||
app.dialog.msg(data.msg);
|
function (code, data) {
|
||||||
}
|
app.dialog.msg(data.msg);
|
||||||
);
|
}
|
||||||
},
|
);
|
||||||
|
},
|
||||||
|
|
||||||
//获取场馆列表
|
//获取场馆列表
|
||||||
listPageVenuesInfo : function(){
|
listPageVenuesInfo: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease', [app.venueUrl]),
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease/{areaCode}', [app.venueUrl, app.areaCode]), {
|
||||||
{
|
page: self.data.page,
|
||||||
page : self.data.page,
|
rows: self.data.rows,
|
||||||
rows : self.data.rows,
|
orderKey: self.data.orderKey,
|
||||||
orderKey : self.data.orderKey,
|
venueType: self.data.venueType,
|
||||||
venueType : self.data.venueType,
|
latitude: self.data.latitude,
|
||||||
latitude: self.data.latitude,
|
longitude: self.data.longitude,
|
||||||
longitude: self.data.longitude,
|
selfLocation: 'TX',
|
||||||
selfLocation: 'TX',
|
venueArea: self.data.venueArea
|
||||||
venueArea: self.data.venueArea
|
}, null,
|
||||||
}, null,
|
function (code, data) {
|
||||||
function(code, data){
|
data.rows.forEach(element => {
|
||||||
data.rows.forEach(element => {
|
element.venuePanorama = element.venuePanorama.split(',')[0];
|
||||||
element.venuePanorama = element.venuePanorama.split(',')[0];
|
if (element.apart >= 1000) {
|
||||||
if(element.apart >= 1000){
|
element.apart = (element.apart / 1000).toFixed(2) + 'km';
|
||||||
element.apart = (element.apart / 1000).toFixed(2) + 'km';
|
} else {
|
||||||
} else {
|
element.apart += 'm';
|
||||||
element.apart += 'm';
|
}
|
||||||
}
|
});
|
||||||
});
|
self.setData({
|
||||||
self.setData({
|
venuesList: data.rows,
|
||||||
venuesList : data.rows,
|
page: data.page
|
||||||
page : data.page
|
});
|
||||||
});
|
if (data.rows.length == 0) {
|
||||||
if (data.rows.length == 0) {
|
app.dialog.msg('暂无数据');
|
||||||
app.dialog.msg('暂无数据');
|
}
|
||||||
|
},
|
||||||
|
function (code, data) {
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
|
},
|
||||||
|
function () {
|
||||||
|
wx.hideNavigationBarLoading();
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
wx.hideLoading();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
//切换场馆类型
|
||||||
|
changeVenueType: function (options) {
|
||||||
|
var id = options.currentTarget.dataset.id;
|
||||||
|
if (id == this.data.venueType) {
|
||||||
|
id = ''
|
||||||
}
|
}
|
||||||
}, function(code,data){
|
this.setData({
|
||||||
app.dialog.msg(data.msg);
|
venueType: id
|
||||||
},function(){
|
})
|
||||||
wx.hideNavigationBarLoading();
|
this.listPageVenuesInfo();
|
||||||
wx.stopPullDownRefresh();
|
},
|
||||||
wx.hideLoading();
|
|
||||||
}
|
//切换场馆排序
|
||||||
);
|
changeVenuesOrderBy: function (options) {
|
||||||
},
|
var beCheck = options.currentTarget.dataset.becheck;
|
||||||
|
this.setData({
|
||||||
|
orderKey: beCheck
|
||||||
|
})
|
||||||
|
this.listPageVenuesInfo();
|
||||||
|
},
|
||||||
|
|
||||||
|
//去详情页
|
||||||
|
goDetail: function (options) {
|
||||||
|
var venuesInfoId = options.currentTarget.dataset.id;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '../venueDetail/venueDetail?venuesInfoId=' + venuesInfoId,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//选择区域
|
||||||
|
selectArea: function () {
|
||||||
|
this.setData({
|
||||||
|
selectingArea: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取地区列表
|
||||||
|
getAreaList: function () {
|
||||||
|
var self = this;
|
||||||
|
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listbyparentidrelease/640675', []),
|
||||||
|
self.data.pages, null,
|
||||||
|
function (code, data) {
|
||||||
|
if (code == '200') {
|
||||||
|
self.setData({
|
||||||
|
areaList: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 切换地区
|
||||||
|
changeArea: function (e) {
|
||||||
|
app.dialog.loading('正在加载');
|
||||||
|
this.setData({
|
||||||
|
venueArea: e.currentTarget.dataset.area,
|
||||||
|
selectingArea: false,
|
||||||
|
areaName: e.currentTarget.dataset.areaname
|
||||||
|
})
|
||||||
|
this.listPageVenuesInfo()
|
||||||
|
},
|
||||||
|
|
||||||
|
// 全部地区
|
||||||
|
loadAll: function () {
|
||||||
|
this.setData({
|
||||||
|
venueArea: '',
|
||||||
|
selectingArea: false
|
||||||
|
})
|
||||||
|
this.listPageVenuesInfo()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
this.listVenueType();
|
||||||
|
this.getLocation();
|
||||||
|
this.getAreaList();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
wx.showNavigationBarLoading();
|
||||||
|
this.setData({
|
||||||
|
venueType: '',
|
||||||
|
orderKey: '',
|
||||||
|
})
|
||||||
|
this.onLoad();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
//切换场馆类型
|
|
||||||
changeVenueType: function(options){
|
|
||||||
var id = options.currentTarget.dataset.id;
|
|
||||||
if(id == this.data.venueType){
|
|
||||||
id = ''
|
|
||||||
}
|
}
|
||||||
this.setData({
|
|
||||||
venueType : id
|
|
||||||
})
|
|
||||||
this.listPageVenuesInfo();
|
|
||||||
},
|
|
||||||
|
|
||||||
//切换场馆排序
|
|
||||||
changeVenuesOrderBy: function(options){
|
|
||||||
var beCheck = options.currentTarget.dataset.becheck;
|
|
||||||
this.setData({
|
|
||||||
orderKey : beCheck
|
|
||||||
})
|
|
||||||
this.listPageVenuesInfo();
|
|
||||||
},
|
|
||||||
|
|
||||||
//去详情页
|
|
||||||
goDetail: function (options) {
|
|
||||||
var venuesInfoId = options.currentTarget.dataset.id;
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '../venueDetail/venueDetail?venuesInfoId=' + venuesInfoId,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
//选择区域
|
|
||||||
selectArea: function () {
|
|
||||||
this.setData({
|
|
||||||
selectingArea: true
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取地区列表
|
|
||||||
getAreaList: function () {
|
|
||||||
var self = this;
|
|
||||||
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listallbyparentidrelease/640675', []),
|
|
||||||
self.data.pages, null, function (code, data) {
|
|
||||||
if (code == '200') {
|
|
||||||
self.setData({
|
|
||||||
areaList: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 切换地区
|
|
||||||
changeArea: function (e) {
|
|
||||||
app.dialog.loading('正在加载');
|
|
||||||
this.setData({
|
|
||||||
venueArea: e.currentTarget.dataset.area,
|
|
||||||
selectingArea: false,
|
|
||||||
areaName: e.currentTarget.dataset.areaname
|
|
||||||
})
|
|
||||||
this.listPageVenuesInfo()
|
|
||||||
},
|
|
||||||
|
|
||||||
// 全部地区
|
|
||||||
loadAll: function () {
|
|
||||||
this.setData({
|
|
||||||
venueArea: '',
|
|
||||||
selectingArea: false
|
|
||||||
})
|
|
||||||
this.listPageVenuesInfo()
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad: function (options) {
|
|
||||||
this.listVenueType();
|
|
||||||
this.getLocation();
|
|
||||||
this.getAreaList();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh: function () {
|
|
||||||
wx.showNavigationBarLoading();
|
|
||||||
this.setData({
|
|
||||||
venueType: '',
|
|
||||||
orderKey: '',
|
|
||||||
})
|
|
||||||
this.onLoad();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage: function () {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
})
|
@ -40,7 +40,7 @@ Page({
|
|||||||
*/
|
*/
|
||||||
activityList: function() {
|
activityList: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/volunteerservice/listpagevolunteerservicerelease', []),
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/volunteerservice/listpagevolunteerservicerelease/{areaCode}', [app.areaCode]),
|
||||||
self.data.pages, null, function(code, data) {
|
self.data.pages, null, function(code, data) {
|
||||||
if('200' == code) {
|
if('200' == code) {
|
||||||
// 将活动照片,拼接为可访问地址
|
// 将活动照片,拼接为可访问地址
|
||||||
@ -119,7 +119,7 @@ Page({
|
|||||||
wx.showNavigationBarLoading();
|
wx.showNavigationBarLoading();
|
||||||
var self = this;
|
var self = this;
|
||||||
self.setData({
|
self.setData({
|
||||||
[`pages.page`] : self.data.pages.page + 1
|
[`pages.page`] : 1
|
||||||
})
|
})
|
||||||
this.activityList();
|
this.activityList();
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// pages/volunteerRegister/volunteerRegister.js
|
// pages/volunteerRegister/volunteerRegister.js
|
||||||
var app = getApp();
|
var app = getApp();
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
@ -233,10 +232,10 @@ Page({
|
|||||||
var url;
|
var url;
|
||||||
var requ;
|
var requ;
|
||||||
if(!self.data.volunteerMsg) {
|
if(!self.data.volunteerMsg) {
|
||||||
url = '/wechat-miniapp/volunteer/savevolunteer';
|
url = '/app/volunteer/savevolunteer';
|
||||||
requ = app.restAjax.post;
|
requ = app.restAjax.post;
|
||||||
}else {
|
}else {
|
||||||
url = '/wechat-miniapp/volunteer/updatevolunteer/' + self.data.volunteerMsg.volunteerId;
|
url = '/app/volunteer/updatevolunteer/' + self.data.volunteerMsg.volunteerId;
|
||||||
requ = app.restAjax.put;
|
requ = app.restAjax.put;
|
||||||
}
|
}
|
||||||
requ(app.restAjax.path(app.volunteerUrl + url, []),
|
requ(app.restAjax.path(app.volunteerUrl + url, []),
|
||||||
@ -305,7 +304,8 @@ Page({
|
|||||||
getDataFromArea: function(dictId, type) {
|
getDataFromArea: function(dictId, type) {
|
||||||
var self = this;
|
var self = this;
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/area/listallbyparentidrelease/' + dictId, []),
|
// listbyparentidrelease
|
||||||
|
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/area/listbyparentidrelease/' + dictId, []),
|
||||||
{}, {
|
{}, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': self.data.token
|
'token': self.data.token
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {},
|
"usingComponents": {},
|
||||||
"enablePullDownRefresh": true
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
@ -1,128 +1,135 @@
|
|||||||
|
<wxs src="/utils/indexof.wxs" module="utils" />
|
||||||
<view class="register">
|
<view class="register">
|
||||||
<view class="row" wx:if="{{volunteerMsg}}" style="color:red;margin-bottom:15rpx;">您已经是志愿者,可修改以下信息!</view>
|
<view class="hint" wx:if="{{volunteerMsg}}">您已经是志愿者,可修改以下信息!</view>
|
||||||
<view class="row" style="height: auto">
|
<view class="thick-line"></view>
|
||||||
<view class="info-name">公开经历:</view>
|
<view class="row" style="height: auto;">
|
||||||
<view class="info-text" style="height: auto">
|
<view class="info-name">公开经历:</view>
|
||||||
<view class="section" style="height: auto">
|
<view class="info-text" style="height: auto">
|
||||||
<radio-group class="radio-group" bindchange="changeOpen">
|
<view class="section" style="height: auto">
|
||||||
<label class="radio">
|
<radio-group class="radio-group" bindchange="changeOpen">
|
||||||
<radio value="0" checked="checked"/>否
|
<label class="radio">
|
||||||
<radio value="1"/>是
|
<radio value="0" checked="checked" />否
|
||||||
</label>
|
<radio value="1" />是
|
||||||
</radio-group>
|
</label>
|
||||||
</view>
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="thin-line"></view>
|
||||||
<view class="row">
|
<view class="row">
|
||||||
<view class="info-name">市:</view>
|
<view class="info-name">旗县区:</view>
|
||||||
<view class="info-text">
|
<view class="info-text">
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<picker bindchange="cityChange" value="{{teamCityIndex}}" range="{{teamCityArray}}">
|
<picker bindchange="cityChange" value="{{teamCityIndex}}" range="{{teamCityArray}}">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
{{teamCityArray[teamCityIndex]}}
|
{{teamCityArray[teamCityIndex]}}
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="thin-line"></view>
|
||||||
<view class="row" hidden="{{countyShowStatus}}">
|
<view class="row" hidden="{{countyShowStatus}}">
|
||||||
<view class="info-name">旗县区:</view>
|
<view class="info-name">乡镇街道:</view>
|
||||||
<view class="info-text">
|
<view class="info-text">
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<picker bindchange="countyChange" value="{{teamCountyIndex}}" range="{{teamCountyArray}}">
|
<picker bindchange="countyChange" value="{{teamCountyIndex}}" range="{{teamCountyArray}}">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
{{teamCountyArray[teamCountyIndex]}}
|
{{teamCountyArray[teamCountyIndex]}}
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="thin-line"></view>
|
||||||
<view class="row" hidden="{{areaShowStatus}}">
|
<view class="row" hidden="{{areaShowStatus}}">
|
||||||
<view class="info-name">乡镇村:</view>
|
<view class="info-name">村:</view>
|
||||||
<view class="info-text">
|
<view class="info-text">
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<picker bindchange="areaChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
|
<picker bindchange="areaChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
{{teamAreaArray[teamAreaIndex]}}
|
{{teamAreaArray[teamAreaIndex]}}
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="thick-line"></view>
|
||||||
<view class="row" style="height: auto">
|
<view class="column" style="height: auto">
|
||||||
<view class="info-name">服务意向:</view>
|
<view class="info-name">服务意向:</view>
|
||||||
<view class="info-text" style="height: auto">
|
<view class="info-text" style="height: auto">
|
||||||
<view class="section" style="height: auto">
|
<view class="section" style="height: auto">
|
||||||
<checkbox-group bindchange="serviceTypeChange">
|
<checkbox-group bindchange="serviceTypeChange">
|
||||||
<checkbox value='{{item.dataId}}' wx:for="{{serviceType}}" wx:key="index">
|
<checkbox value='{{item.dataId}}' wx:for="{{serviceType}}" wx:key="index" checked="{{utils.indexOf(volunteerMsg.serviceType,item.dataId)}}">
|
||||||
<view>{{item.dataName}}</view>
|
<view>{{item.dataName}}</view>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="thin-line"></view>
|
||||||
<view class="row" style="height: auto">
|
<view class="column" style="height: auto">
|
||||||
<view class="info-name">服务领域或行业:</view>
|
<view class="info-name">服务领域或行业:</view>
|
||||||
<view class="info-text" style="height: auto">
|
<view class="info-text" style="height: auto">
|
||||||
<view class="section" style="height: auto">
|
<view class="section" style="height: auto">
|
||||||
<checkbox-group bindchange="serviceIndustryChange">
|
<checkbox-group bindchange="serviceIndustryChange">
|
||||||
<checkbox value='{{item.dataId}}' wx:for="{{serviceIndustry}}" wx:key="index">
|
<checkbox value='{{item.dataId}}' wx:for="{{serviceIndustry}}" wx:key="index" checked="{{utils.indexOf(volunteerMsg.serviceIndustry,item.dataId)}}">
|
||||||
<view>{{item.dataName}}</view>
|
<view>{{item.dataName}}</view>
|
||||||
</checkbox>
|
</checkbox>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="thick-line"></view>
|
||||||
<view class="row">
|
<view class="row">
|
||||||
<view class="info-name">职业:</view>
|
<view class="info-name">职业:</view>
|
||||||
<view class="info-text">
|
<view class="info-text">
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<picker value="{{occupationyIndex}}" range="{{occupationArray}}">
|
<picker value="{{occupationyIndex}}" range="{{occupationArray}}">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
{{occupationArray[occupationIndex]}}
|
{{occupationArray[occupationIndex]}}
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="thin-line"></view>
|
||||||
|
<view class="row" style="height: auto">
|
||||||
<view class="row" style="height: auto">
|
<view class="info-name">工作单位及职务:</view>
|
||||||
<view class="info-name">工作单位及职务:</view>
|
<view class="info-text">
|
||||||
<view class="info-text">
|
<input name="work" placeholder="请输入工作单位及职务" model:value="{{work}}"></input>
|
||||||
<input name="work" placeholder="请输入工作单位及职务" model:value="{{work}}"></input>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="thin-line"></view>
|
||||||
|
<view class="row">
|
||||||
<view class="row">
|
<view class="info-name">特长爱好:</view>
|
||||||
<view class="info-name">特长爱好:</view>
|
<view class="info-text">
|
||||||
<view class="info-text">
|
<input name="hobby" placeholder="请输入特长爱好" model:value="{{hobby}}"></input>
|
||||||
<input name="hobby" placeholder="请输入特长爱好" model:value="{{hobby}}"></input>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="thin-line"></view>
|
||||||
|
<view class="column" style="height: auto">
|
||||||
<view class="row" style="height: auto">
|
<view class="info-name">个人简历:</view>
|
||||||
<view class="info-name">个人简历:</view>
|
<view class="info-text" style="height: auto">
|
||||||
<view class="info-text" style="height: auto">
|
<textarea placeholder="请输入个人简历" model:value="{{cv}}"></textarea>
|
||||||
<textarea placeholder="请输入个人简历" model:value="{{cv}}"></textarea>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="column" style="height: auto">
|
||||||
|
<view class="info-name">备注:</view>
|
||||||
<view class="row" style="height: auto">
|
<view class="info-text" style="height: auto">
|
||||||
<view class="info-name">备注:</view>
|
<textarea placeholder="请输入备注" model:value="{{remark}}"></textarea>
|
||||||
<view class="info-text" style="height: auto">
|
</view>
|
||||||
<textarea placeholder="请输入备注" model:value="{{remark}}"></textarea>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<view class="is-agree">
|
<view class="is-agree">
|
||||||
<checkbox-group bindchange="changeAgree">
|
<checkbox-group bindchange="changeAgree">
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<checkbox value="{{isAgree}}" checked="{{isAgree}}" />我已阅读并同意<text class="bargain" data-type="volunteer" bindtap="userAgree">《志愿者注册服务协议》</text>
|
<checkbox value="{{isAgree}}" checked="{{isAgree}}" />我已阅读并同意<text class="bargain" data-type="volunteer" bindtap="userAgree">《志愿者注册服务协议》</text>
|
||||||
</label>
|
</label>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
<view class="submit" bindtap="submitRegister" wx:if="{{!volunteerMsg}}">立即注册</view>
|
<view class="submit" bindtap="submitRegister" wx:if="{{!volunteerMsg}}">立即注册</view>
|
||||||
<view class="submit" bindtap="submitRegister" wx:else>立即修改</view>
|
<view class="submit" bindtap="submitRegister" wx:else>立即修改</view>
|
||||||
</view>
|
</view>
|
@ -1,69 +1,110 @@
|
|||||||
.register{
|
page {
|
||||||
padding: 30rpx;
|
background: #ffffff;
|
||||||
margin-bottom: 150rpx;
|
|
||||||
}
|
}
|
||||||
.row{
|
|
||||||
display: flex;
|
.register {
|
||||||
justify-content: space-between;
|
padding: 0rpx 0rpx 250rpx 0rpx;
|
||||||
margin-bottom: 15rpx;
|
|
||||||
height: 55rpx;
|
|
||||||
}
|
}
|
||||||
.info-name{
|
|
||||||
width: 21%;
|
.hint {
|
||||||
font-size: 26rpx;
|
background: white;
|
||||||
color: #000;
|
color: red;
|
||||||
line-height: 55rpx;
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
.info-text{
|
|
||||||
width: 77%;
|
.thick-line {
|
||||||
font-size: 26rpx;
|
align-self: center;
|
||||||
height: 55rpx;
|
background: #f2f2f2;
|
||||||
|
height: 5rpx;
|
||||||
}
|
}
|
||||||
.info-text input{
|
|
||||||
width: 100%;
|
.thin-line {
|
||||||
height: 55rpx;
|
margin: 0rpx 30rpx;
|
||||||
border: 1px solid #ddd;
|
align-self: center;
|
||||||
padding: 0 10rpx;
|
background: #f2f2f2;
|
||||||
box-sizing: border-box;
|
height: 1rpx;
|
||||||
}
|
}
|
||||||
.info-text textarea{
|
|
||||||
width: 100%;
|
.row {
|
||||||
height: 150rpx;
|
display: flex;
|
||||||
padding: 10rpx;
|
flex-direction: row;
|
||||||
box-sizing: border-box;
|
justify-content: space-between;
|
||||||
border: 1px solid #DDD;
|
align-items: center;
|
||||||
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
picker, .picker{
|
|
||||||
height: 55rpx;
|
.column {
|
||||||
line-height: 55rpx;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
text{
|
|
||||||
color: red;
|
.info-name {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #000;
|
||||||
|
line-height: 55rpx;
|
||||||
|
width: 30%;
|
||||||
}
|
}
|
||||||
.section{
|
|
||||||
border: 1px solid #ddd;
|
.info-text {
|
||||||
padding: 0 10rpx;
|
font-size: 26rpx;
|
||||||
height: 55rpx;
|
height: 55rpx;
|
||||||
}
|
}
|
||||||
.submit{
|
|
||||||
width: 100%;
|
.info-text input {
|
||||||
margin: 20rpx auto 0;
|
width: 100%;
|
||||||
display: flex;
|
height: 55rpx;
|
||||||
justify-content: center;
|
padding: 0 10rpx;
|
||||||
align-items: center;
|
box-sizing: border-box;
|
||||||
height: 80rpx;
|
text-align: right;
|
||||||
color: #fff;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
background: #9F1512;
|
|
||||||
}
|
}
|
||||||
checkbox{
|
|
||||||
transform: scale(0.8);
|
.info-text textarea {
|
||||||
|
height: 150rpx;
|
||||||
|
padding: 10rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 1px solid #DDD;
|
||||||
}
|
}
|
||||||
.bottom{
|
|
||||||
position: fixed;
|
picker,
|
||||||
bottom: 0;
|
.picker {
|
||||||
left: 0;
|
height: 55rpx;
|
||||||
right: 0;
|
line-height: 55rpx;
|
||||||
padding: 0 30rpx 20rpx;
|
}
|
||||||
background: #fff;
|
|
||||||
|
text {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
padding: 0 10rpx;
|
||||||
|
height: 55rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
width: 100%;
|
||||||
|
margin: 20rpx auto 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 80rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background: #9F1512;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkbox:nth-of-type(n+2) {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
padding: 0 30rpx 20rpx;
|
||||||
|
background: #fff;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
@ -2,163 +2,205 @@
|
|||||||
var app = getApp();
|
var app = getApp();
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
token: '',
|
token: '',
|
||||||
otherTeamMap: {},
|
otherTeamMap: [],
|
||||||
type: '1',
|
type: '1',
|
||||||
teamId: '',
|
teamId: '',
|
||||||
|
page: {
|
||||||
|
page: 1,
|
||||||
|
rows: 10
|
||||||
|
},
|
||||||
|
totalSize: 0,
|
||||||
|
|
||||||
},
|
},
|
||||||
getToken: function() {
|
getToken: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
return new Promise(resolve =>{
|
return new Promise(resolve => {
|
||||||
wx.getStorage({
|
wx.getStorage({
|
||||||
key: 'token',
|
key: 'token',
|
||||||
success(res) {
|
success(res) {
|
||||||
self.setData({
|
self.setData({
|
||||||
token: res.data
|
token: res.data
|
||||||
})
|
})
|
||||||
return resolve();
|
return resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
newTeam: function () {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '../newTeam/newTeam',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeTab: function (e) {
|
||||||
|
var self = this;
|
||||||
|
self.data.page.page = 1;
|
||||||
|
self.setData({
|
||||||
|
page: self.data.page,
|
||||||
|
otherTeamMap: [],
|
||||||
|
totalSize: 0,
|
||||||
|
type: e.currentTarget.dataset.type
|
||||||
|
})
|
||||||
|
if (self.data.type === '1') {
|
||||||
|
self.otherTeam(app.volunteerUrl + '/app/team/otherteamm?otherTeam=true');
|
||||||
|
} else {
|
||||||
|
self.otherTeam(app.volunteerUrl + '/app/team/myjointeam?myTeam=true');
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
})
|
otherTeam: function (url) {
|
||||||
},
|
var self = this;
|
||||||
newTeam: function () {
|
app.restAjax.get(app.restAjax.path(url, []), self.data.page, {
|
||||||
wx.navigateTo({
|
headers: {
|
||||||
url: '../newTeam/newTeam',
|
token: self.data.token
|
||||||
})
|
}
|
||||||
},
|
}, function (code, data) {
|
||||||
changeTab: function(e) {
|
if ('200' == code) {
|
||||||
var self = this;
|
self.setData({
|
||||||
self.setData({
|
totalSize: data.total
|
||||||
type: e.currentTarget.dataset.type
|
})
|
||||||
})
|
if (data.rows && data.rows.length > 0) {
|
||||||
if(self.data.type === '1') {
|
self.setData({
|
||||||
self.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/otherteamm?otherTeam=true');
|
otherTeamMap: self.data.otherTeamMap.concat(data.rows)
|
||||||
}else {
|
})
|
||||||
self.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/myjointeam?myTeam=true');
|
} else {
|
||||||
|
app.dialog.msg('暂无更多数据了')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, function (code, data) {
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
|
}, function () {
|
||||||
|
wx.stopPullDownRefresh()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 申请/退出加入团队
|
||||||
|
*/
|
||||||
|
joinOrOutTeam: function (e) {
|
||||||
|
var self = this;
|
||||||
|
self.setData({
|
||||||
|
teamId: e.currentTarget.dataset.teamid
|
||||||
|
})
|
||||||
|
var teamMemberVO;
|
||||||
|
var url;
|
||||||
|
var methodType;
|
||||||
|
var title;
|
||||||
|
if ('1' == self.data.type) {
|
||||||
|
url = app.volunteerUrl + '/app/teammember/saveteammember'
|
||||||
|
teamMemberVO = {
|
||||||
|
teamId: e.currentTarget.dataset.teamid
|
||||||
|
}
|
||||||
|
methodType = app.restAjax.post
|
||||||
|
title = '申请成功!'
|
||||||
|
} else {
|
||||||
|
url = app.volunteerUrl + '/app/teammember/quitTeam/' + self.data.teamId
|
||||||
|
methodType = app.restAjax.get
|
||||||
|
title = '退出成功!'
|
||||||
|
}
|
||||||
|
|
||||||
|
methodType(app.restAjax.path(url, []),
|
||||||
|
teamMemberVO, {
|
||||||
|
headers: {
|
||||||
|
token: self.data.token
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function (code, data) {
|
||||||
|
if ('200' == code) {
|
||||||
|
app.dialog.msg(title);
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '../volunteer/volunteer',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function (code, data) {
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
|
},
|
||||||
|
function () {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
this.getToken().then(result => {
|
||||||
|
this.otherTeam(app.volunteerUrl + '/app/team/otherteamm?otherTeam=true');
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
var self = this;
|
||||||
|
self.data.page.page = 1;
|
||||||
|
self.setData({
|
||||||
|
page: self.data.page,
|
||||||
|
otherTeamMap: [],
|
||||||
|
totalSize: 0,
|
||||||
|
})
|
||||||
|
if (self.data.type === '1') {
|
||||||
|
self.otherTeam(app.volunteerUrl + '/app/team/otherteamm?otherTeam=true');
|
||||||
|
} else {
|
||||||
|
self.otherTeam(app.volunteerUrl + '/app/team/myjointeam?myTeam=true');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
var self = this;
|
||||||
|
if (self.data.otherTeamMap.length < self.data.totalSize) {
|
||||||
|
self.data.page.page = self.data.page.page + 1
|
||||||
|
self.setData({
|
||||||
|
page: self.data.page
|
||||||
|
})
|
||||||
|
if (self.data.type === '1') {
|
||||||
|
self.otherTeam(app.volunteerUrl + '/app/team/otherteamm?otherTeam=true');
|
||||||
|
} else {
|
||||||
|
self.otherTeam(app.volunteerUrl + '/app/team/myjointeam?myTeam=true');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
app.dialog.msg('暂无更多数据了')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
otherTeam: function(url) {
|
|
||||||
var self = this;
|
|
||||||
app.restAjax.get(app.restAjax.path(url, []),
|
|
||||||
{}, {
|
|
||||||
headers: {
|
|
||||||
token: self.data.token
|
|
||||||
}
|
|
||||||
}, function(code, data) {
|
|
||||||
if('200' == code) {
|
|
||||||
self.setData({
|
|
||||||
otherTeamMap: data.rows
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, function(code, data) {
|
|
||||||
app.dialog.msg(data.msg);
|
|
||||||
}, function() {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 申请/退出加入团队
|
|
||||||
*/
|
|
||||||
joinOrOutTeam: function(e) {
|
|
||||||
var self = this;
|
|
||||||
self.setData({
|
|
||||||
teamId: e.currentTarget.dataset.teamid
|
|
||||||
})
|
|
||||||
var teamMemberVO;
|
|
||||||
var url;
|
|
||||||
var methodType;
|
|
||||||
var title;
|
|
||||||
if('1' == self.data.type) {
|
|
||||||
url = app.volunteerUrl + '/wechat-miniapp/teammember/saveteammember'
|
|
||||||
teamMemberVO = {
|
|
||||||
teamId: e.currentTarget.dataset.teamid
|
|
||||||
}
|
|
||||||
methodType = app.restAjax.post
|
|
||||||
title = '申请成功!'
|
|
||||||
}else {
|
|
||||||
url = app.volunteerUrl + '/wechat-miniapp/teammember/quitTeam/' + self.data.teamId
|
|
||||||
methodType = app.restAjax.get
|
|
||||||
title = '退出成功!'
|
|
||||||
}
|
|
||||||
|
|
||||||
methodType(app.restAjax.path(url, []),
|
|
||||||
teamMemberVO, {
|
|
||||||
headers: {
|
|
||||||
token: self.data.token
|
|
||||||
}
|
|
||||||
}, function(code, data) {
|
|
||||||
if('200' == code) {
|
|
||||||
app.dialog.msg(title);
|
|
||||||
wx.navigateTo({
|
|
||||||
url: '../volunteer/volunteer',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, function(code, data) {
|
|
||||||
app.dialog.msg(data.msg);
|
|
||||||
}, function() {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad: function (options) {
|
|
||||||
this.getToken().then(result => {
|
|
||||||
this.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/otherteamm?otherTeam=true');
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom: function () {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage: function () {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
})
|
@ -40,8 +40,7 @@
|
|||||||
}
|
}
|
||||||
.team{
|
.team{
|
||||||
margin-top: 90rpx;
|
margin-top: 90rpx;
|
||||||
padding: 0 30rpx;
|
padding: 0rpx 30rpx 110rpx 30rpx;
|
||||||
margin-bottom: 110rpx;
|
|
||||||
}
|
}
|
||||||
.team-box{
|
.team-box{
|
||||||
padding: 20rpx 0;
|
padding: 20rpx 0;
|
||||||
|
10
utils/indexof.wxs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
function indexOf(str, val) {
|
||||||
|
if (str.indexOf(val) != -1) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = {
|
||||||
|
indexOf: indexOf
|
||||||
|
}
|
@ -1,12 +1,12 @@
|
|||||||
const formatTime = date => {
|
const formatTime = date => {
|
||||||
const year = date.getFullYear()
|
const year = date.getFullYear()
|
||||||
const month = date.getMonth() + 1
|
const month = date.getMonth() + 1
|
||||||
const day = date.getDate()
|
const day = date.getDate()
|
||||||
const hour = date.getHours()
|
const hour = date.getHours()
|
||||||
const minute = date.getMinutes()
|
const minute = date.getMinutes()
|
||||||
const second = date.getSeconds()
|
const second = date.getSeconds()
|
||||||
|
|
||||||
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
|
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,19 +14,27 @@ const formatTime = date => {
|
|||||||
* @param {*} date
|
* @param {*} date
|
||||||
*/
|
*/
|
||||||
const formatDate = date => {
|
const formatDate = date => {
|
||||||
const year = date.getFullYear()
|
const year = date.getFullYear()
|
||||||
const month = date.getMonth() + 1
|
const month = date.getMonth() + 1
|
||||||
const day = date.getDate()
|
const day = date.getDate()
|
||||||
|
|
||||||
return [year, month, day].map(formatNumber).join('-')
|
return [year, month, day].map(formatNumber).join('-')
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatNumber = n => {
|
const formatNumber = n => {
|
||||||
n = n.toString()
|
n = n.toString()
|
||||||
return n[1] ? n : '0' + n
|
return n[1] ? n : '0' + n
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
function indexOf(str, val) {
|
||||||
formatTime: formatTime,
|
if (str.indexOf(val) != -1) {
|
||||||
formatDate: formatDate
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = {
|
||||||
|
formatTime: formatTime,
|
||||||
|
formatDate: formatDate,
|
||||||
|
indexOf: indexOf
|
||||||
}
|
}
|