图片压缩、页面布局修改、部分接口添加areaCode

This commit is contained in:
itgaojian 2023-03-01 16:33:12 +08:00
parent ff9c36ae56
commit 0cf235c752
62 changed files with 1123 additions and 836 deletions

4
app.js
View File

@ -1,6 +1,7 @@
//app.js
var restAjax = require('utils/restAjax.js');
var dialog = require('utils/dialog.js');
var utils = require('utils/util.js');
// + 'https://www.xzszwhy.cn/usercenter'
App({
loginUrl: restAjax.baseUrl,
@ -13,7 +14,7 @@ App({
volunteerUrl: restAjax.baseUrl,
activityUrl: restAjax.baseUrl,
volunteerUrl: restAjax.baseUrl,
liveUrl: restAjax.ulr+'live/',
liveUrl: restAjax.url + 'live/',
liveRecordUrl: restAjax.baseUrl,
socialUrl: restAjax.baseUrl,
areaCode: '540200000000',
@ -23,6 +24,7 @@ App({
restAjax: restAjax,
shopImgUrl: restAjax.url + "xzshop/route/file/download/true/",
dialog: dialog,
utils: utils,
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []

View File

@ -1,10 +1,79 @@
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 689 B

BIN
images/activity.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 634 B

BIN
images/address.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 453 B

BIN
images/avatar.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 582 B

BIN
images/big-news.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
images/center-bg.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 KiB

After

Width:  |  Height:  |  Size: 122 KiB

BIN
images/center-on.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 606 B

BIN
images/center.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 599 B

BIN
images/collect.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 624 B

BIN
images/collected.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 510 B

BIN
images/culture-on.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 871 B

BIN
images/culture-slide.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 KiB

After

Width:  |  Height:  |  Size: 151 KiB

BIN
images/culture.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 728 B

BIN
images/delete-photo.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 289 B

BIN
images/delete.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

After

Width:  |  Height:  |  Size: 304 B

BIN
images/friend.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 510 B

BIN
images/good.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 796 B

After

Width:  |  Height:  |  Size: 383 B

BIN
images/ic_empty_data.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 944 B

After

Width:  |  Height:  |  Size: 454 B

BIN
images/ic_goods_type_default.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 519 B

BIN
images/ic_shop_car_icon.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 387 B

BIN
images/index-on.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 523 B

BIN
images/index.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 470 B

BIN
images/login-bg.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 41 KiB

BIN
images/logo.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/selected-l.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

After

Width:  |  Height:  |  Size: 121 B

BIN
images/selected-r.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 122 B

BIN
images/setting.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 716 B

BIN
images/share.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 757 B

View File

@ -2,145 +2,173 @@
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
dataList: [],
areaList: [],
pages: {
page: 1,
rows: 5,
county: ''
}
},
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
})
/**
* 页面的初始数据
*/
data: {
dataList: [],
areaList: [],
typeList: [],
pages: {
page: 1,
rows: 5,
activityType: ''
}
}
)
},
changeArea: function (e) {
app.dialog.loading('正在加载');
this.setData({
'pages.county': e.currentTarget.dataset.area
})
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 + '/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;
},
//获取活动分类
getActivityTypeList() {
var _self = this;
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dictionaryself/listdictionarybyparentidrelease/e36ad682-c6b4-44fe-a05c-889a5ff7c284', []),
null, null,
function (code, data) {
_self.setData({
typeList: data,
'pages.activityType': data[0].dataId
})
_self.getActivityList()
},
function (err) {
}
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 () {
// 在标题栏中显示加载图标
wx.showNavigationBarLoading();
var self = this;
self.setData({
[`pages.page`] : self.data.pages.page + 1
})
this.getActivityList();
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
// 在标题栏中显示加载图标
wx.showNavigationBarLoading();
var self = this;
self.setData({
[`pages.page`]: 1,
dataList: []
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
})
this.getActivityList();
},
}
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -1,23 +1,23 @@
<view class="area">
<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 {{'' == pages.county?'active': ''}}" bindtap="loadAll">全部</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 class="activity">
<view class="activity-box" bindtap="goDetail" data-id="{{item.activityLibraryId}}" wx:for="{{dataList}}" wx:key="index">
<view class="activity-img">
<image src="{{item.activityImage}}"></image>
<view class="activity-box" bindtap="goDetail" data-id="{{item.activityLibraryId}}" wx:for="{{dataList}}" wx:key="index">
<view class="activity-img">
<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 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 File

@ -1,89 +1,105 @@
.activity{
padding: 20rpx 30rpx 0;
margin-top: 80rpx;
.activity {
padding: 20rpx 30rpx 0;
margin-top: 80rpx;
}
.activity-box{
margin-bottom: 20rpx;
box-shadow:0px 0px 17rpx 0px rgba(0,0,0,0.1);
border-radius: 10rpx;
overflow: hidden;
.activity-box {
margin-bottom: 20rpx;
box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.1);
border-radius: 10rpx;
overflow: hidden;
}
.activity-img{
height: 320rpx;
position: relative;
.activity-img {
height: 320rpx;
position: relative;
}
.activity-img image{
width: 100%;
height: 100%;
.activity-img image {
width: 100%;
height: 100%;
}
.corner{
position: absolute;
top: 20rpx;
right: 20rpx;
display: flex;
color: #fff;
.corner {
position: absolute;
top: 20rpx;
right: 20rpx;
display: flex;
color: #fff;
}
.corner view{
padding: 0 10rpx;
background: rgba(0,0,0,0.6);
line-height: 40rpx;
vertical-align: middle;
display: flex;
align-items: center;
border-radius: 5rpx;
.corner view {
padding: 0 10rpx;
background: rgba(0, 0, 0, 0.6);
line-height: 40rpx;
vertical-align: middle;
display: flex;
align-items: center;
border-radius: 5rpx;
}
.view-count{
margin-right: 20rpx;
.view-count {
margin-right: 20rpx;
}
.view-count image{
width: 40rpx;
height: 40rpx;
.view-count image {
width: 40rpx;
height: 40rpx;
}
.activity-info{
padding: 15rpx 20rpx;
.activity-info {
padding: 15rpx 20rpx;
}
.title{
display: flex;
justify-content: space-between;
.title {
display: flex;
justify-content: space-between;
}
.activity-title{
width: 70%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 32rpx;
color: #242424;
line-height: 40rpx;
.activity-title {
width: 70%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 32rpx;
color: #242424;
line-height: 40rpx;
}
.sign{
background: rgba(159,21,18,.1);
color: #9F1512;
border-radius: 10rpx;
padding: 0 20rpx;
line-height: 40rpx;
font-size: 28rpx;
.sign {
background: rgba(159, 21, 18, .1);
color: #9F1512;
border-radius: 10rpx;
padding: 0 20rpx;
line-height: 40rpx;
font-size: 28rpx;
}
.date{
margin-top: 10rpx;
font-size: 24rpx;
color: #242424;
.date {
margin-top: 10rpx;
font-size: 24rpx;
color: #242424;
}
.area{
position: fixed;
top: 0;
left: 0;
right: 0;
height: 80rpx;
white-space: nowrap;
overflow-x: auto;
.area {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 80rpx;
white-space: nowrap;
overflow-x: auto;
box-shadow: 10rpx 10rpx 5rpx #f2f2f2;
}
.area-box{
display: inline-block;
width: 25%;
line-height: 80rpx;
text-align: center;
font-size: 30rpx;
.area-box {
display: inline-block;
width: 25%;
line-height: 80rpx;
text-align: center;
font-size: 30rpx;
}
.area-box.active{
color: #9F1512;
.area-box.active {
color: #9F1512;
}

View File

@ -58,12 +58,12 @@ Page({
var url;
var id = options.id;
if(!self.data.token) {
url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyidrelease/' + id;
url = '/app/activitylibrary/getactivitylibrarybyidrelease/' + id;
self.setData({
token: null
})
}else {
url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyid/' + id
url = '/app/activitylibrary/getactivitylibrarybyid/' + id
self.getToken()
}
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), {}, {

View File

@ -31,7 +31,7 @@ Page({
},
getActivityHis: function() {
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, {
headers: {
token: self.data.token

View File

@ -118,9 +118,9 @@ Page({
var url;
var id = options.id;
if (!self.data.token) {
url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyidrelease/' + id;
url = '/app/activitylibrary/getactivitylibrarybyidrelease/' + id;
} else {
url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyid/' + id
url = '/app/activitylibrary/getactivitylibrarybyid/' + id
}
self.setData({
activityId: options.id

View File

@ -33,7 +33,7 @@ Page({
doGetLibraryList: function(page) {
var self = this;
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,
rows: self.data.rows
}, null, function(code, data) {

View File

@ -121,7 +121,7 @@ Page({
},
doGetBanner: function () {
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',
page: 1,
rows: 5
@ -135,7 +135,7 @@ Page({
},
doGetVenueList: function () {
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,
rows: 3,
latitude: app.globalData.curLat,
@ -152,9 +152,26 @@ Page({
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 () {
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,
rows: 3
}, null, function (code, data) {
@ -264,8 +281,8 @@ Page({
})
},
goHeritage: function () {
wx.switchTab({
url: '../heritage/heritage',
wx.navigateTo({
url: '/pages/heritage/heritage',
})
},
goCultureDetail: function (event) {

View File

@ -1,7 +1,7 @@
<view class="swiper-box">
<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">
<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>
</view>
@ -41,12 +41,17 @@
<image src="../../images/selected-r.png" class="selected-r"></image>
</view>
</view>
<view class="line"></view>
<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-status">场馆导航</view>
<view class="recommend-name">{{item.venueName}}</view>
<image src="{{venue.venueUrl}}/route/file/download/true/{{item.venuePanoramaArray[0]}}"></image>
</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">
<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 File

@ -29,7 +29,7 @@ swiper {
}
.recommend {
padding: 30rpx;
padding: 0rpx 30rpx 30rpx 30rpx;
border-bottom: 5px solid #FBFBFB;
}
@ -37,6 +37,13 @@ swiper {
width: 100%;
display: flex;
overflow-x: auto;
margin-top: 10rpx;
}
.line {
width: 100%;
height: 1rpx;
background: #f2f2f2;
}
.recommend-box {
@ -49,11 +56,36 @@ swiper {
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 {
width: 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 {
text-align: center;
padding: 10rpx 0rpx;

View File

@ -48,10 +48,10 @@ Page({
})
if(self.data.type === '1') {
// 我发起的活动
self.myActivity(app.volunteerUrl + '/wechat-miniapp/volunteerservice/listpagevolunteerservice');
self.myActivity(app.volunteerUrl + '/app/volunteerservice/listpagevolunteerservice');
}else {
// 我参加的活动
self.myActivity(app.volunteerUrl + '/wechat-miniapp/volunteerservice/listpagemyjoinservice');
self.myActivity(app.volunteerUrl + '/app/volunteerservice/listpagemyjoinservice');
}
},
myActivity: function(url) {
@ -83,7 +83,7 @@ Page({
*/
onLoad: function (options) {
this.getToken().then(result => {
this.myActivity(app.volunteerUrl + '/wechat-miniapp/volunteerservice/listpagevolunteerservice');
this.myActivity(app.volunteerUrl + '/app/volunteerservice/listpagevolunteerservice');
})
},

View File

@ -68,14 +68,14 @@ Page({
var methodType;
var title;
if('1' == self.data.type) {
url = app.volunteerUrl + '/wechat-miniapp/teammember/saveteammember'
url = app.volunteerUrl + '/app/teammember/saveteammember'
teamMemberVO = {
teamId: e.currentTarget.dataset.teamid
}
methodType = app.restAjax.post
title = '申请成功!'
}else {
url = app.volunteerUrl + '/wechat-miniapp/teammember/quitTeam/' + self.data.teamId
url = app.volunteerUrl + '/app/teammember/quitTeam/' + self.data.teamId
methodType = app.restAjax.get
title = '退出成功!'
}
@ -103,7 +103,7 @@ Page({
*/
onLoad: function (options) {
this.getToken().then(result => {
this.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/myteamm');
this.otherTeam(app.volunteerUrl + '/app/team/myteamm');
})
},

View File

@ -198,7 +198,7 @@ Page({
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, {
headers: {
'token': self.data.token
@ -262,7 +262,7 @@ Page({
getDataFromArea: function(dictId, type) {
var self = this;
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: {
'token': self.data.token

View File

@ -177,7 +177,7 @@ Page({
photo: self.data.uploadPhoto,
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, {
headers: {
'token': self.data.token

View File

@ -17,6 +17,7 @@ Page({
areaId: app.areaCode,
defaultAreaId: app.areaCode
},
//获取下级子目录
doGetNewsDictionariesList: function () {
var self = this;
app.dialog.loading('正在加载');
@ -43,22 +44,19 @@ Page({
});
self.doGetNewsList(1);
},
//全部类型
doClearCurrentNewsDictionariesId: function () {
var self = this;
self.setData({
currentNewsDictionariesId: self.data.dirId
});
self.doGetNewsList(1);
},
//获取新闻
doGetNewsList: function (page, lv) {
var self = this;
app.dialog.loading('正在加载');
var info = {
newsDirectoriesId: self.data.currentNewsDictionariesId,
page: page,
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;
if (lv) {
tempAreaCode = self.data.areaId;
@ -94,7 +92,7 @@ Page({
},
getAreaList: function () {
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,
function (code, data) {
if (code == '200') {
@ -113,6 +111,15 @@ Page({
})
this.doGetNewsList(1, lv)
},
//加载全部类型
doClearCurrentNewsDictionariesId: function () {
var self = this;
self.setData({
currentNewsDictionariesId: self.data.dirId
});
self.doGetNewsList(1);
},
//加载全部地区
loadAll: function () {
this.setData({
areaId: app.areaCode

View File

@ -26,6 +26,7 @@
justify-content: space-between;
align-items: center;
width: 25%;
min-width: fit-content;
position: relative;
height: 90rpx;
font-size: 30rpx;

View File

@ -40,7 +40,7 @@ Page({
page: page,
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;
for (var i = 0; i < data.rows.length; i++) {
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId

View File

@ -134,7 +134,7 @@ Page({
*/
sendEnrollRequest: function(serviceMemberVO) {
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, {
headers: {
token: self.data.token
@ -159,9 +159,9 @@ Page({
var self = this;
var url;
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 {
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, []), {}, {
@ -187,7 +187,7 @@ Page({
getMyTeam: function() {
var self = this;
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: {
token: self.data.token

View File

@ -28,7 +28,7 @@ Page({
},
getDetail(teamId) {
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: {
token: self.data.token
@ -48,7 +48,7 @@ Page({
},
getMember(teamId) {
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: {
token: self.data.token
@ -80,7 +80,7 @@ Page({
console.log(e)
var id = e.currentTarget.dataset.teammemberid;
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: {
token: self.data.token

View File

@ -47,7 +47,7 @@ Page({
page: page,
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;
for (var i = 0; i < data.rows.length; i++) {
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId

View File

@ -20,7 +20,7 @@ Page({
rows: self.data.rows,
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;
for (var i = 0; i < data.rows.length; i++) {
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId

View File

@ -25,7 +25,7 @@ Page({
},
getUserAgree: function(type) {
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: {
token: self.data.token

View File

@ -2,226 +2,229 @@ var app = getApp();
// pages/venue/venue.js
Page({
/**
* 页面的初始数据
*/
data: {
venueUrl : app.venueUrl,
imgRoute : '/route/file/download/true/',
venueTypeParentId : 'df8b758c-f6d8-465a-9aa8-c451fde47076',
page : '1',
rows : '10',
venueTypeList: [],
venuesList: [],
orderKey : '',
venueType : '',
latitude: '',
longitude: '',
selectingArea: false, // 显示隐藏选择区域
areaList: [],
venueArea: '',
areaName: ''
},
/**
* 页面的初始数据
*/
data: {
venueUrl: app.venueUrl,
imgRoute: '/route/file/download/true/',
venueTypeParentId: 'df8b758c-f6d8-465a-9aa8-c451fde47076',
page: '1',
rows: '10',
venueTypeList: [],
venuesList: [],
orderKey: '',
venueType: '',
latitude: '',
longitude: '',
selectingArea: false, // 显示隐藏选择区域
areaList: [],
venueArea: '',
areaName: ''
},
//获取定位
getLocation: function () {
var self = this;
wx.getLocation({
type: 'gcj02',
success: function (res) {
self.setData({
latitude: res.latitude,
longitude: res.longitude
//获取定位
getLocation: function () {
var self = this;
wx.getLocation({
type: 'gcj02',
success: function (res) {
self.setData({
latitude: res.latitude,
longitude: res.longitude
})
},
complete: function () {
self.listPageVenuesInfo();
}
})
},
complete: function(){
self.listPageVenuesInfo();
}
})
},
//获取场馆分类
listVenueType : function(){
var self = this;
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuedictionary/listvenuedictionarybyparentidrelease/{venueTypeParentId}',
[app.venueUrl, self.data.venueTypeParentId]), {}, null,
function(code,data){
self.setData({
venueTypeList: data.data
});
},function(code, data){
app.dialog.msg(data.msg);
}
);
},
},
//获取场馆列表
listPageVenuesInfo : function(){
var self = this;
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease', [app.venueUrl]),
{
page : self.data.page,
rows : self.data.rows,
orderKey : self.data.orderKey,
venueType : self.data.venueType,
latitude: self.data.latitude,
longitude: self.data.longitude,
selfLocation: 'TX',
venueArea: self.data.venueArea
}, null,
function(code, data){
data.rows.forEach(element => {
element.venuePanorama = element.venuePanorama.split(',')[0];
if(element.apart >= 1000){
element.apart = (element.apart / 1000).toFixed(2) + 'km';
} else {
element.apart += 'm';
}
});
self.setData({
venuesList : data.rows,
page : data.page
});
if (data.rows.length == 0) {
app.dialog.msg('暂无数据');
//获取场馆分类
listVenueType: function () {
var self = this;
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuedictionary/listvenuedictionarybyparentidrelease/{venueTypeParentId}',
[app.venueUrl, self.data.venueTypeParentId]), {}, null,
function (code, data) {
self.setData({
venueTypeList: data.data
});
},
function (code, data) {
app.dialog.msg(data.msg);
}
);
},
//获取场馆列表
listPageVenuesInfo: function () {
var self = this;
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease/{areaCode}', [app.venueUrl, app.areaCode]), {
page: self.data.page,
rows: self.data.rows,
orderKey: self.data.orderKey,
venueType: self.data.venueType,
latitude: self.data.latitude,
longitude: self.data.longitude,
selfLocation: 'TX',
venueArea: self.data.venueArea
}, null,
function (code, data) {
data.rows.forEach(element => {
element.venuePanorama = element.venuePanorama.split(',')[0];
if (element.apart >= 1000) {
element.apart = (element.apart / 1000).toFixed(2) + 'km';
} else {
element.apart += 'm';
}
});
self.setData({
venuesList: data.rows,
page: data.page
});
if (data.rows.length == 0) {
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){
app.dialog.msg(data.msg);
},function(){
wx.hideNavigationBarLoading();
wx.stopPullDownRefresh();
wx.hideLoading();
}
);
},
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/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 () {
}
})

View File

@ -40,7 +40,7 @@ Page({
*/
activityList: function() {
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) {
if('200' == code) {
// 将活动照片,拼接为可访问地址
@ -119,7 +119,7 @@ Page({
wx.showNavigationBarLoading();
var self = this;
self.setData({
[`pages.page`] : self.data.pages.page + 1
[`pages.page`] : 1
})
this.activityList();
},

View File

@ -1,7 +1,6 @@
// pages/volunteerRegister/volunteerRegister.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
@ -233,10 +232,10 @@ Page({
var url;
var requ;
if(!self.data.volunteerMsg) {
url = '/wechat-miniapp/volunteer/savevolunteer';
url = '/app/volunteer/savevolunteer';
requ = app.restAjax.post;
}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.path(app.volunteerUrl + url, []),
@ -305,7 +304,8 @@ Page({
getDataFromArea: function(dictId, type) {
var self = this;
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: {
'token': self.data.token

View File

@ -1,4 +1,4 @@
{
"usingComponents": {},
"enablePullDownRefresh": true
"enablePullDownRefresh": false
}

View File

@ -1,128 +1,135 @@
<wxs src="/utils/indexof.wxs" module="utils" />
<view class="register">
<view class="row" wx:if="{{volunteerMsg}}" style="color:red;margin-bottom:15rpx;">您已经是志愿者,可修改以下信息!</view>
<view class="row" style="height: auto">
<view class="info-name">公开经历:</view>
<view class="info-text" style="height: auto">
<view class="section" style="height: auto">
<radio-group class="radio-group" bindchange="changeOpen">
<label class="radio">
<radio value="0" checked="checked"/>否
<radio value="1"/>是
</label>
</radio-group>
</view>
<view class="hint" wx:if="{{volunteerMsg}}">您已经是志愿者,可修改以下信息!</view>
<view class="thick-line"></view>
<view class="row" style="height: auto;">
<view class="info-name">公开经历:</view>
<view class="info-text" style="height: auto">
<view class="section" style="height: auto">
<radio-group class="radio-group" bindchange="changeOpen">
<label class="radio">
<radio value="0" checked="checked" />否
<radio value="1" />是
</label>
</radio-group>
</view>
</view>
</view>
</view>
<view class="row">
<view class="info-name">市:</view>
<view class="info-text">
<view class="section">
<picker bindchange="cityChange" value="{{teamCityIndex}}" range="{{teamCityArray}}">
<view class="picker">
{{teamCityArray[teamCityIndex]}}
</view>
</picker>
</view>
<view class="thin-line"></view>
<view class="row">
<view class="info-name">旗县区:</view>
<view class="info-text">
<view class="section">
<picker bindchange="cityChange" value="{{teamCityIndex}}" range="{{teamCityArray}}">
<view class="picker">
{{teamCityArray[teamCityIndex]}}
</view>
</picker>
</view>
</view>
</view>
</view>
<view class="row" hidden="{{countyShowStatus}}">
<view class="info-name">旗县区:</view>
<view class="info-text">
<view class="section">
<picker bindchange="countyChange" value="{{teamCountyIndex}}" range="{{teamCountyArray}}">
<view class="picker">
{{teamCountyArray[teamCountyIndex]}}
</view>
</picker>
</view>
<view class="thin-line"></view>
<view class="row" hidden="{{countyShowStatus}}">
<view class="info-name">乡镇街道:</view>
<view class="info-text">
<view class="section">
<picker bindchange="countyChange" value="{{teamCountyIndex}}" range="{{teamCountyArray}}">
<view class="picker">
{{teamCountyArray[teamCountyIndex]}}
</view>
</picker>
</view>
</view>
</view>
</view>
<view class="row" hidden="{{areaShowStatus}}">
<view class="info-name">乡镇村:</view>
<view class="info-text">
<view class="section">
<picker bindchange="areaChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
<view class="picker">
{{teamAreaArray[teamAreaIndex]}}
</view>
</picker>
</view>
<view class="thin-line"></view>
<view class="row" hidden="{{areaShowStatus}}">
<view class="info-name">村:</view>
<view class="info-text">
<view class="section">
<picker bindchange="areaChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
<view class="picker">
{{teamAreaArray[teamAreaIndex]}}
</view>
</picker>
</view>
</view>
</view>
</view>
<view class="row" style="height: auto">
<view class="info-name">服务意向:</view>
<view class="info-text" style="height: auto">
<view class="section" style="height: auto">
<checkbox-group bindchange="serviceTypeChange">
<checkbox value='{{item.dataId}}' wx:for="{{serviceType}}" wx:key="index">
<view>{{item.dataName}}</view>
</checkbox>
</checkbox-group>
</view>
<view class="thick-line"></view>
<view class="column" style="height: auto">
<view class="info-name">服务意向:</view>
<view class="info-text" style="height: auto">
<view class="section" style="height: auto">
<checkbox-group bindchange="serviceTypeChange">
<checkbox value='{{item.dataId}}' wx:for="{{serviceType}}" wx:key="index" checked="{{utils.indexOf(volunteerMsg.serviceType,item.dataId)}}">
<view>{{item.dataName}}</view>
</checkbox>
</checkbox-group>
</view>
</view>
</view>
</view>
<view class="row" style="height: auto">
<view class="info-name">服务领域或行业:</view>
<view class="info-text" style="height: auto">
<view class="section" style="height: auto">
<checkbox-group bindchange="serviceIndustryChange">
<checkbox value='{{item.dataId}}' wx:for="{{serviceIndustry}}" wx:key="index">
<view>{{item.dataName}}</view>
</checkbox>
</checkbox-group>
</view>
<view class="thin-line"></view>
<view class="column" style="height: auto">
<view class="info-name">服务领域或行业:</view>
<view class="info-text" style="height: auto">
<view class="section" style="height: auto">
<checkbox-group bindchange="serviceIndustryChange">
<checkbox value='{{item.dataId}}' wx:for="{{serviceIndustry}}" wx:key="index" checked="{{utils.indexOf(volunteerMsg.serviceIndustry,item.dataId)}}">
<view>{{item.dataName}}</view>
</checkbox>
</checkbox-group>
</view>
</view>
</view>
</view>
<view class="row">
<view class="info-name">职业:</view>
<view class="info-text">
<view class="section">
<picker value="{{occupationyIndex}}" range="{{occupationArray}}">
<view class="picker">
{{occupationArray[occupationIndex]}}
</view>
</picker>
</view>
<view class="thick-line"></view>
<view class="row">
<view class="info-name">职业:</view>
<view class="info-text">
<view class="section">
<picker value="{{occupationyIndex}}" range="{{occupationArray}}">
<view class="picker">
{{occupationArray[occupationIndex]}}
</view>
</picker>
</view>
</view>
</view>
</view>
<view class="row" style="height: auto">
<view class="info-name">工作单位及职务:</view>
<view class="info-text">
<input name="work" placeholder="请输入工作单位及职务" model:value="{{work}}"></input>
<view class="thin-line"></view>
<view class="row" style="height: auto">
<view class="info-name">工作单位及职务:</view>
<view class="info-text">
<input name="work" placeholder="请输入工作单位及职务" model:value="{{work}}"></input>
</view>
</view>
</view>
<view class="row">
<view class="info-name">特长爱好:</view>
<view class="info-text">
<input name="hobby" placeholder="请输入特长爱好" model:value="{{hobby}}"></input>
<view class="thin-line"></view>
<view class="row">
<view class="info-name">特长爱好:</view>
<view class="info-text">
<input name="hobby" placeholder="请输入特长爱好" model:value="{{hobby}}"></input>
</view>
</view>
</view>
<view class="row" style="height: auto">
<view class="info-name">个人简历:</view>
<view class="info-text" style="height: auto">
<textarea placeholder="请输入个人简历" model:value="{{cv}}"></textarea>
<view class="thin-line"></view>
<view class="column" style="height: auto">
<view class="info-name">个人简历:</view>
<view class="info-text" style="height: auto">
<textarea placeholder="请输入个人简历" model:value="{{cv}}"></textarea>
</view>
</view>
</view>
<view class="row" style="height: auto">
<view class="info-name">备注:</view>
<view class="info-text" style="height: auto">
<textarea placeholder="请输入备注" model:value="{{remark}}"></textarea>
<view class="column" style="height: auto">
<view class="info-name">备注:</view>
<view class="info-text" style="height: auto">
<textarea placeholder="请输入备注" model:value="{{remark}}"></textarea>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="is-agree">
<checkbox-group bindchange="changeAgree">
<label class="checkbox">
<checkbox value="{{isAgree}}" checked="{{isAgree}}" />我已阅读并同意<text class="bargain" data-type="volunteer" bindtap="userAgree">《志愿者注册服务协议》</text>
</label>
</checkbox-group>
</view>
<view class="submit" bindtap="submitRegister" wx:if="{{!volunteerMsg}}">立即注册</view>
<view class="submit" bindtap="submitRegister" wx:else>立即修改</view>
<view class="is-agree">
<checkbox-group bindchange="changeAgree">
<label class="checkbox">
<checkbox value="{{isAgree}}" checked="{{isAgree}}" />我已阅读并同意<text class="bargain" data-type="volunteer" bindtap="userAgree">《志愿者注册服务协议》</text>
</label>
</checkbox-group>
</view>
<view class="submit" bindtap="submitRegister" wx:if="{{!volunteerMsg}}">立即注册</view>
<view class="submit" bindtap="submitRegister" wx:else>立即修改</view>
</view>

View File

@ -1,69 +1,110 @@
.register{
padding: 30rpx;
margin-bottom: 150rpx;
page {
background: #ffffff;
}
.row{
display: flex;
justify-content: space-between;
margin-bottom: 15rpx;
height: 55rpx;
.register {
padding: 0rpx 0rpx 250rpx 0rpx;
}
.info-name{
width: 21%;
font-size: 26rpx;
color: #000;
line-height: 55rpx;
.hint {
background: white;
color: red;
padding: 20rpx;
}
.info-text{
width: 77%;
font-size: 26rpx;
height: 55rpx;
.thick-line {
align-self: center;
background: #f2f2f2;
height: 5rpx;
}
.info-text input{
width: 100%;
height: 55rpx;
border: 1px solid #ddd;
padding: 0 10rpx;
box-sizing: border-box;
.thin-line {
margin: 0rpx 30rpx;
align-self: center;
background: #f2f2f2;
height: 1rpx;
}
.info-text textarea{
width: 100%;
height: 150rpx;
padding: 10rpx;
box-sizing: border-box;
border: 1px solid #DDD;
.row {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 20rpx;
}
picker, .picker{
height: 55rpx;
line-height: 55rpx;
.column {
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;
padding: 0 10rpx;
height: 55rpx;
.info-text {
font-size: 26rpx;
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;
.info-text input {
width: 100%;
height: 55rpx;
padding: 0 10rpx;
box-sizing: border-box;
text-align: right;
}
checkbox{
transform: scale(0.8);
.info-text textarea {
height: 150rpx;
padding: 10rpx;
box-sizing: border-box;
border: 1px solid #DDD;
}
.bottom{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 0 30rpx 20rpx;
background: #fff;
picker,
.picker {
height: 55rpx;
line-height: 55rpx;
}
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;
}

View File

@ -2,163 +2,205 @@
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
token: '',
otherTeamMap: {},
type: '1',
teamId: '',
/**
* 页面的初始数据
*/
data: {
token: '',
otherTeamMap: [],
type: '1',
teamId: '',
page: {
page: 1,
rows: 10
},
totalSize: 0,
},
getToken: function() {
var self = this;
return new Promise(resolve =>{
wx.getStorage({
key: 'token',
success(res) {
self.setData({
token: res.data
})
return resolve();
},
getToken: function () {
var self = this;
return new Promise(resolve => {
wx.getStorage({
key: 'token',
success(res) {
self.setData({
token: res.data
})
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');
}
})
})
},
newTeam: function () {
wx.navigateTo({
url: '../newTeam/newTeam',
})
},
changeTab: function(e) {
var self = this;
self.setData({
type: e.currentTarget.dataset.type
})
if(self.data.type === '1') {
self.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/otherteamm?otherTeam=true');
}else {
self.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/myjointeam?myTeam=true');
},
otherTeam: function (url) {
var self = this;
app.restAjax.get(app.restAjax.path(url, []), self.data.page, {
headers: {
token: self.data.token
}
}, function (code, data) {
if ('200' == code) {
self.setData({
totalSize: data.total
})
if (data.rows && data.rows.length > 0) {
self.setData({
otherTeamMap: self.data.otherTeamMap.concat(data.rows)
})
} 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 () {
}
})

View File

@ -40,8 +40,7 @@
}
.team{
margin-top: 90rpx;
padding: 0 30rpx;
margin-bottom: 110rpx;
padding: 0rpx 30rpx 110rpx 30rpx;
}
.team-box{
padding: 20rpx 0;

10
utils/indexof.wxs Normal file
View File

@ -0,0 +1,10 @@
function indexOf(str, val) {
if (str.indexOf(val) != -1) {
return true;
} else {
return false;
}
}
module.exports = {
indexOf: indexOf
}

View File

@ -1,12 +1,12 @@
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
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
*/
const formatDate = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
return [year, month, day].map(formatNumber).join('-')
return [year, month, day].map(formatNumber).join('-')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
n = n.toString()
return n[1] ? n : '0' + n
}
module.exports = {
formatTime: formatTime,
formatDate: formatDate
function indexOf(str, val) {
if (str.indexOf(val) != -1) {
return true;
} else {
return false;
}
}
module.exports = {
formatTime: formatTime,
formatDate: formatDate,
indexOf: indexOf
}