接口修改

This commit is contained in:
itgaojian163 2022-11-16 14:44:04 +08:00
parent 290e82db6d
commit 0255a2d8e7
27 changed files with 167 additions and 144 deletions

4
app.js
View File

@ -52,6 +52,8 @@ App({
}) })
}, },
globalData: { globalData: {
userInfo: null userInfo: null,
curLat:-1,
curLng:-1,
} }
}) })

View File

@ -33,7 +33,11 @@
"pages/activityDetail/activityDetail", "pages/activityDetail/activityDetail",
"pages/activity/activity", "pages/activity/activity",
"pages/newsDetail/newsDetail", "pages/newsDetail/newsDetail",
"pages/newsList/newsList" "pages/newsList/newsList",
"pages/myActivity/myActivity",
"pages/myVolunteerTeam/myVolunteerTeam",
"pages/myVolunteerActivity/myVolunteerActivity",
"pages/serviceActivityDetail/serviceActivityDetail"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
@ -45,8 +49,7 @@
"color": "#BBBBBB", "color": "#BBBBBB",
"borderStyle": "black", "borderStyle": "black",
"selectedColor": "#000000", "selectedColor": "#000000",
"list": [ "list": [{
{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"iconPath": "images/index.png", "iconPath": "images/index.png",
"text": "首页", "text": "首页",
@ -83,6 +86,9 @@
"desc": "你的位置信息将用于您当前所在位置" "desc": "你的位置信息将用于您当前所在位置"
} }
}, },
"requiredPrivateInfos": [
"getLocation"
],
"style": "v2", "style": "v2",
"sitemapLocation": "sitemap.json" "sitemapLocation": "sitemap.json"
} }

View File

@ -16,7 +16,7 @@ Page({
}, },
getAreaList: function () { getAreaList: function () {
var self = this; var self = this;
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dataarea/listareabyparentidrelease/640675', []), app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listallbyparentidrelease/640675', []),
self.data.pages, null, function (code, data) { self.data.pages, null, function (code, data) {
if (code == '200') { if (code == '200') {
self.setData({ self.setData({
@ -47,8 +47,9 @@ Page({
}, },
getActivityList: function() { getActivityList: function() {
var self = this; var self = this;
app.restAjax.get(app.restAjax.path(app.activityUrl + '/wxminiapp/activitylibrary/listpageactivitylibraryfornetrelease', []), app.restAjax.get(app.restAjax.path(app.activityUrl + '/wechat-miniapp/activitylibrary/listpageactivitylibraryfornetrelease', []),
self.data.pages, null, function(code, data) { self.data.pages, null, function(code, data) {
console.log(code+"==="+data)
if('200' == code) { if('200' == code) {
for(var item of data.rows) { for(var item of data.rows) {
if('' != item.activityImage) { if('' != item.activityImage) {

View File

@ -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 = '/wxminiapp/activitylibrary/getactivitylibrarybyidrelease/' + id; url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyidrelease/' + id;
self.setData({ self.setData({
token: null token: null
}) })
}else { }else {
url = '/wxminiapp/activitylibrary/getactivitylibrarybyid/' + id url = '/wechat-miniapp/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, []), {}, {

View File

@ -31,7 +31,7 @@ Page({
}, },
getActivityHis: function() { getActivityHis: function() {
var self = this; var self = this;
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/teamactivityhis/listpageteamactivityhis?serviceId=' + self.data.serviceId, []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/teamactivityhis/listpageteamactivityhis?serviceId=' + self.data.serviceId, []),
self.data.pages, { self.data.pages, {
headers: { headers: {
token: self.data.token token: self.data.token

View File

@ -19,9 +19,9 @@ Page({
timer: '', timer: '',
gotCode: false gotCode: false
}, },
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) {
@ -33,51 +33,50 @@ Page({
}) })
}) })
}, },
getCode: function() { getCode: function () {
var self = this; var self = this;
if(!self.data.phone) { if (!self.data.phone) {
app.dialog.msg('请输入手机号'); app.dialog.msg('请输入手机号');
return false; return false;
} }
app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activityuserapply/saveSmsCoderelease/' + self.data.phone, []), app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/sms/verify-code/' + self.data.phone, []), {}, null, function (code, data) {
{}, null, function(code, data) { console.log(data)
console.log(data) if ('200' == code) {
if('200' == code) { self.setData({
self.setData({ gotCode: true
gotCode: true })
}) self.data.timer = setInterval(function () {
self.data.timer = setInterval(function () { var cur = self.data.restTime - 1
var cur = self.data.restTime - 1 if (cur == 0) {
if (cur == 0) { clearInterval(self.data.timer)
clearInterval(self.data.timer) self.setData({
self.setData({ restTime: 120,
restTime: 120, gotCode: false
gotCode: false })
}) } else {
} else { self.setData({
self.setData({ restTime: cur
restTime: cur })
}) }
} }, 1000)
}, 1000) }
} }, function (code, data) {
}, function(code, data) {
app.dialog.msg(data.msg) app.dialog.msg(data.msg)
}, function() { }, function () {
}) })
}, },
commit: function() { commit: function () {
var self = this; var self = this;
if(!self.data.phone) { if (!self.data.phone) {
app.dialog.msg('请输入手机号'); app.dialog.msg('请输入手机号');
return false; return false;
} }
if(!self.data.name) { if (!self.data.name) {
app.dialog.msg('请输入姓名'); app.dialog.msg('请输入姓名');
return false; return false;
} }
if(!self.data.idCard) { if (!self.data.idCard) {
app.dialog.msg('请输入身份证号码'); app.dialog.msg('请输入身份证号码');
return false; return false;
} }
@ -93,21 +92,22 @@ Page({
headers: { headers: {
token: self.data.token token: self.data.token
} }
}, function(code, data) { },
function (code, data) {
console.log(data) console.log(data)
if('200' == code) { if ('200' == code) {
app.dialog.msg('报名成功'); app.dialog.msg('报名成功');
setTimeout(function(){ setTimeout(function () {
wx.navigateTo({ wx.navigateBack({})
url: '../index/index'
})
}, 1000) }, 1000)
} }
}, function(code, data) { },
app.dialog.msg(data.msg); function (code, data) {
}, function() { app.dialog.msg(data.msg);
},
function () {
}) })
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -117,30 +117,29 @@ Page({
this.getToken().then(result => { this.getToken().then(result => {
var url; var url;
var id = options.id; var id = options.id;
if(!self.data.token) { if (!self.data.token) {
url = '/wxminiapp/activitylibrary/getactivitylibrarybyidrelease/' + id; url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyidrelease/' + id;
}else { } else {
url = '/wxminiapp/activitylibrary/getactivitylibrarybyid/' + id url = '/wechat-miniapp/activitylibrary/getactivitylibrarybyid/' + id
} }
self.setData({ self.setData({
activityId: options.id activityId: options.id
}) })
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), {}, {
{}, { headers: {
headers: { token: self.data.token
token: self.data.token }
} }, function (code, data) {
}, function(code, data) { if ('200' == code) {
if('200' == code) { data.activityImageArray = data.activityImage.split(',');
data.activityImageArray = data.activityImage.split(','); self.setData({
self.setData({ dataMap: data
dataMap: data })
}) console.log(self.data.dataMap)
console.log(self.data.dataMap) }
} }, function () {
}, function() {
}, function() { }, function () {
}) })
}) })

View File

@ -293,7 +293,7 @@ Page({
title: '请稍等...', title: '请稍等...',
mask: true mask: true
}) })
app.restAjax.get(app.restAjax.path('{venueUrl}/api/sms/getverificationcode/' + self.data.phoneNumber, [app.venueUrl]), {}, null, app.restAjax.get(app.restAjax.path('{venueUrl}/app/sms/verify-code/' + self.data.phoneNumber, [app.venueUrl]), {}, null,
function (code, data) { function (code, data) {
if (code == 200) { if (code == 200) {
self.setData({ self.setData({

View File

@ -93,9 +93,9 @@ Page({
/** /**
* 跳转到我的活动 * 跳转到我的活动
*/ */
toMyJoinActivity: function() { toMyJoinActivity(){
wx.navigateTo({ wx.navigateTo({
url: '../myActivity/myActivity', url: '/pages/myActivity/myActivity',
}) })
}, },
/** /**
@ -211,7 +211,7 @@ Page({
iv: e.detail.iv iv: e.detail.iv
} }
// app.dialog.loading('正在加载'); // app.dialog.loading('正在加载');
app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/miniuser/updatedefaultusernamebydata', [app.usercenterUrl]), info, { app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/miniapp/update-phone', [app.usercenterUrl]), info, {
headers: { headers: {
token: self.data.token token: self.data.token
} }
@ -256,7 +256,7 @@ Page({
// 获取用户信息 // 获取用户信息
getUserInfo: function () { getUserInfo: function () {
var self = this var self = this
app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/getappuser', [app.usercenterUrl]), {}, { app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/get-app-user', [app.usercenterUrl]), {}, {
headers: { headers: {
token: self.data.token token: self.data.token
} }

View File

@ -40,7 +40,6 @@ Page({
app.restAjax.post(app.restAjax.path('{url}/wechat-miniapp/sign/default', [app.loginUrl]), { app.restAjax.post(app.restAjax.path('{url}/wechat-miniapp/sign/default', [app.loginUrl]), {
jsCode: res.code jsCode: res.code
}, null, function (code, data) { }, null, function (code, data) {
// var token ='elMxZExMVzZ2ZnYyM0JKU1FWRTZKcDFiVFhZeXpGbFBMTFh6c2I0NjNmeWlrU0RwUmlHMDViY1QxY0hsZ1dpdzh1TFhKL0hMT1JRV2pMYkZ0emliNW1LNU0rVHYwNDQvYW5qV0ZwcitoWGhMMENBeFZxTmlDT0FjTThhaDZaM3pFSzFyUXlGbFN5MUlTaE80dG5aNFJYSWFlMEk4a0d0R0kyczRYanIwUUF6VkFmeGdlWEdIM3UzYmdOMWtZYUtrZTZJUVF1bm94V0p4QTlpVDBmb0U1bTkvSCt5UkpqemE3cGxYTDMzZG5SQmVzNXU4dHIxS3l5bHlINURkV1VTWVc2VHFRanVMN0t2eXd0YUhTcHJaQzNYaFhLVEFBYm9MU0hkS1lEaE41d1U9';
console.log(data) console.log(data)
var tokenArray = data.data.split('_'); var tokenArray = data.data.split('_');
var token = tokenArray[0]; var token = tokenArray[0];
@ -55,93 +54,96 @@ Page({
}); });
} else { } else {
console.log(res) console.log(res)
app.dialog.msg('登录失败!'+ res.errMsg); app.dialog.msg('登录失败!' + res.errMsg);
} }
} }
}) })
}, },
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', [self.data.news.newsUrl]), {
newsDirectoriesId: 'eab0ca3c-d35d-4c02-9397-ace2bdd10fc1', newsDirectoriesId: 'eab0ca3c-d35d-4c02-9397-ace2bdd10fc1',
page: 1, page: 1,
rows: 5 rows: 5
}, null, function(code, data) { }, null, function (code, data) {
self.setData({ self.setData({
'news.bannerList': data.rows 'news.bannerList': data.rows
}) })
}, function(code, data) { }, function (code, data) {
app.dialog.msg(data.msg); app.dialog.msg(data.msg);
}); });
}, },
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', [self.data.venue.venueUrl]), {
page: 1, page: 1,
rows: 3 rows: 3,
}, null, function(code, data) { latitude:app.globalData.curLat,
for(var i = 0, item; item = data.rows[i++];) { longitude:app.globalData.curLng,
orderKey:"",
}, null, function (code, data) {
for (var i = 0, item; item = data.rows[i++];) {
item.venuePanoramaArray = item.venuePanorama.split(','); item.venuePanoramaArray = item.venuePanorama.split(',');
} }
self.setData({ self.setData({
'venue.venueList': data.rows 'venue.venueList': data.rows
}); });
}, function(code, data) { }, function (code, data) {
app.dialog.msg(data.msg); app.dialog.msg(data.msg);
}); });
}, },
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/listpageactivitylibraryrelease', [self.data.activity.activityUrl]), {
page: 1, page: 1,
rows: 3 rows: 3
}, null, function(code, data) { }, null, function (code, data) {
console.log(data); console.log(data);
for(var i = 0, item; item = data.rows[i++];) { for (var i = 0, item; item = data.rows[i++];) {
item.activityImageArray = item.activityImage.split(','); item.activityImageArray = item.activityImage.split(',');
} }
self.setData({ self.setData({
'activity.activityList': data.rows 'activity.activityList': data.rows
}); });
}, function(code, data) { }, function (code, data) {
app.dialog.msg(data.msg); app.dialog.msg(data.msg);
}); });
}, },
doGetNewsList: function() { doGetNewsList: 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', [self.data.news.newsUrl]), {
newsDirectoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167', newsDirectoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167',
page: 1, page: 1,
rows: 5 rows: 5
}, null, function(code, data) { }, null, function (code, data) {
self.setData({ self.setData({
'news.newsList': data.rows 'news.newsList': data.rows
}) })
}, function(code, data) { }, function (code, data) {
app.dialog.msg(data.msg); app.dialog.msg(data.msg);
}); });
}, },
doGetLiveList: function() { doGetLiveList: function () {
var self = this; var self = this;
app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/listpageliveplanrelease', [self.data.live.liveUrl]), { app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/listpageliveplanrelease', [self.data.live.liveUrl]), {
page: 1, page: 1,
rows: 4 rows: 4
}, null, function(code, data) { }, null, function (code, data) {
self.setData({ self.setData({
'live.liveList': data.rows 'live.liveList': data.rows
}) })
}, function(code, data) { }, function (code, data) {
app.dialog.msg(data.msg); app.dialog.msg(data.msg);
}); });
}, },
goNewsDetail: function (event) { goNewsDetail: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '../newsDetail/newsDetail?templateRecordUrl='+ event.currentTarget.dataset.templateRecordUrl, url: '../newsDetail/newsDetail?templateRecordUrl=' + event.currentTarget.dataset.templateRecordUrl,
}) })
}, },
goNewsList: function(event) { goNewsList: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '../newsList/newsList?type='+ event.currentTarget.dataset.type, url: '../newsList/newsList?type=' + event.currentTarget.dataset.type,
}) })
}, },
goVolunteer: function () { goVolunteer: function () {
@ -159,14 +161,14 @@ Page({
url: '../venue/venue', url: '../venue/venue',
}) })
}, },
goVenueDetail: function(event) { goVenueDetail: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '../venueDetail/venueDetail?venuesInfoId=' + event.currentTarget.dataset.venuesInfoId, url: '../venueDetail/venueDetail?venuesInfoId=' + event.currentTarget.dataset.venuesInfoId,
}) })
}, },
goBroadcastDetail: function (event) { goBroadcastDetail: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '../broadcastDetail/broadcastDetail?livePlanId='+ event.currentTarget.dataset.livePlanId, url: '../broadcastDetail/broadcastDetail?livePlanId=' + event.currentTarget.dataset.livePlanId,
}) })
}, },
goActivity: function () { goActivity: function () {
@ -174,7 +176,7 @@ Page({
url: '../activity/activity', url: '../activity/activity',
}) })
}, },
goActivityDetail: function(event) { goActivityDetail: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '../activityDetail/activityDetail?id=' + event.currentTarget.dataset.activityLibraryId url: '../activityDetail/activityDetail?id=' + event.currentTarget.dataset.activityLibraryId
}) })
@ -184,9 +186,9 @@ Page({
url: '../heritage/heritage', url: '../heritage/heritage',
}) })
}, },
goCultureDetail: function(event) { goCultureDetail: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId, url: '../cultureDetail/cultureDetail?libraryId=' + event.currentTarget.dataset.libraryId,
}) })
}, },
// 获取用户信息 // 获取用户信息
@ -224,6 +226,17 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
var self = this; var self = this;
wx.getLocation({
type: 'gcj02',
success(res) {
// const latitude = res.latitude
// const longitude = res.longitude
// const speed = res.speed
// const accuracy = res.accuracy
app.globalData.curLng=res.longitude
app.globalData.curLat=res.latitude
}
})
self.doLogin(); self.doLogin();
self.doGetBanner(); self.doGetBanner();
self.doGetNewsList(); self.doGetNewsList();

View File

@ -1,6 +1,6 @@
<view class="team"> <view class="team">
<view class="team-box" bindtap="toTeamDetail" <view class="team-box" bindtap="toTeamDetail"
wx:for="{{dataMap}}"> wx:for="{{dataMap}}" wx:key="index">
<view class="name-join"> <view class="name-join">
<view class="name">{{item.activityTitle}}</view> <view class="name">{{item.activityTitle}}</view>
</view> </view>

View File

@ -48,10 +48,10 @@ Page({
}) })
if(self.data.type === '1') { if(self.data.type === '1') {
// 我发起的活动 // 我发起的活动
self.myActivity(app.volunteerUrl + '/wxminiapp/volunteerservice/listpagevolunteerservice'); self.myActivity(app.volunteerUrl + '/wechat-miniapp/volunteerservice/listpagevolunteerservice');
}else { }else {
// 我参加的活动 // 我参加的活动
self.myActivity(app.volunteerUrl + '/wxminiapp/volunteerservice/listpagemyjoinservice'); self.myActivity(app.volunteerUrl + '/wechat-miniapp/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 + '/wxminiapp/volunteerservice/listpagevolunteerservice'); this.myActivity(app.volunteerUrl + '/wechat-miniapp/volunteerservice/listpagevolunteerservice');
}) })
}, },

View File

@ -12,7 +12,7 @@
</view> </view>
<view class="volunteer-activity"> <view class="volunteer-activity">
<view class="activity"> <view class="activity">
<view class="activity-box" bindtap="goDetail" data-id="{{item.volunteerServiceId}}" wx:for="{{dataMap}}"> <view class="activity-box" bindtap="goDetail" data-id="{{item.volunteerServiceId}}" wx:for="{{dataMap}}" wx:key="index">
<view class="activity-img"> <view class="activity-img">
<image src="{{item.photo}}"></image> <image src="{{item.photo}}"></image>
</view> </view>

View File

@ -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 + '/wxminiapp/teammember/saveteammember' url = app.volunteerUrl + '/wechat-miniapp/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 + '/wxminiapp/teammember/quitTeam/' + self.data.teamId url = app.volunteerUrl + '/wechat-miniapp/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 + '/wxminiapp/team/myteamm'); this.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/myteamm');
}) })
}, },

View File

@ -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 + '/wxminiapp/team/saveteam', []), app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/team/saveteam', []),
teamVO, { teamVO, {
headers: { headers: {
'token': self.data.token 'token': self.data.token
@ -262,12 +262,13 @@ 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/dataarea/listareabyparentidrelease/' + dictId, []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/area/listallbyparentidrelease/' + dictId, []),
{}, { {}, {
headers: { headers: {
'token': self.data.token 'token': self.data.token
} }
}, function(code, data) { }, function(code, data) {
console.log(data)
if('200' == code) { if('200' == code) {
if(data || type === 2) { if(data || type === 2) {
var array = []; var array = [];
@ -311,6 +312,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
var self = this; var self = this;
this.getToken().then(result => { this.getToken().then(result => {
console.log(self.data.token)
this.getDataFromArea('640332', 2).then(result => { this.getDataFromArea('640332', 2).then(result => {
self.setData({ self.setData({
teamCity: self.data.tempObj, teamCity: self.data.tempObj,

View File

@ -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 + '/wxminiapp/volunteerservice/savevolunteerservice', []), app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/volunteerservice/savevolunteerservice', []),
volunteerServiceVO, { volunteerServiceVO, {
headers: { headers: {
'token': self.data.token 'token': self.data.token

View File

@ -90,7 +90,7 @@ Page({
}, },
getAreaList: function () { getAreaList: function () {
var self = this; var self = this;
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dataarea/listareabyparentidrelease/640675', []), app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listallbyparentidrelease/640675', []),
self.data.pages, null, function (code, data) { self.data.pages, null, function (code, data) {
if (code == '200') { if (code == '200') {
self.setData({ self.setData({

View File

@ -95,7 +95,7 @@ Page({
app.restAjax.delete(app.restAjax.path('{venueUrl}/app/booking/removemyticket/{groundBookingId}', app.restAjax.delete(app.restAjax.path('{venueUrl}/app/booking/removemyticket/{groundBookingId}',
[app.venueUrl,self.data.groundBookingId]), {}, {headers:{token : self.data.token}}, [app.venueUrl,self.data.groundBookingId]), {}, {headers:{token : self.data.token}},
function (code, data) { function (code, data) {
self.getDetail(); wx.navigateBack()
}, },
function (code, data) { function (code, data) {
app.dialog.msg(data.msg); app.dialog.msg(data.msg);

View File

@ -32,7 +32,7 @@ Page({
}, },
getDetail: function(id) { getDetail: function(id) {
var self = this; var self = this;
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/volunteerservice/getvolunteerservicebyid/' + id, []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/volunteerservice/getvolunteerservicebyid/' + id, []),
{}, { {}, {
headers: { headers: {
'token': self.data.token 'token': self.data.token
@ -130,7 +130,7 @@ Page({
*/ */
sendEnrollRequest: function(serviceMemberVO) { sendEnrollRequest: function(serviceMemberVO) {
var self = this; var self = this;
app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/wxminiapp/servicemember/saveservicemember', []), app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/servicemember/saveservicemember', []),
serviceMemberVO, { serviceMemberVO, {
headers: { headers: {
token: self.data.token token: self.data.token
@ -155,9 +155,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 + '/wxminiapp/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/' + self.data.team[self.data.teamIndex].teamId; url = app.volunteerUrl + '/wechat-miniapp/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/' + self.data.team[self.data.teamIndex].teamId;
}else { }else {
url = app.volunteerUrl + '/wxminiapp/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/null'; url = app.volunteerUrl + '/wechat-miniapp/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/null';
} }
app.restAjax.get(app.restAjax.path(url, []), {}, { app.restAjax.get(app.restAjax.path(url, []), {}, {
@ -183,7 +183,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 + '/wxminiapp/team/myteamm', []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/team/myteamm', []),
{}, { {}, {
headers: { headers: {
token: self.data.token token: self.data.token

View File

@ -28,7 +28,7 @@ Page({
}, },
getDetail(teamId) { getDetail(teamId) {
var self = this; var self = this;
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/team/getteambyid/' + teamId, []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/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 + '/wxminiapp/teammember/listteammember?teamId=' + teamId, []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/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 + '/wxminiapp/teammember/checkmember/'+id+'/' + type + '?teamId=' + self.data.teamId, []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/teammember/checkmember/'+id+'/' + type + '?teamId=' + self.data.teamId, []),
{}, { {}, {
headers: { headers: {
token: self.data.token token: self.data.token

View File

@ -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 + '/wxminiapp/agreecontent/getagreecontentbyid/' + type, []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/agreecontent/getagreecontentbyid/' + type, []),
{}, { {}, {
headers: { headers: {
token: self.data.token token: self.data.token

View File

@ -134,7 +134,7 @@ Page({
// 获取地区列表 // 获取地区列表
getAreaList: function () { getAreaList: function () {
var self = this; var self = this;
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dataarea/listareabyparentidrelease/640675', []), app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listallbyparentidrelease/640675', []),
self.data.pages, null, function (code, data) { self.data.pages, null, function (code, data) {
if (code == '200') { if (code == '200') {
self.setData({ self.setData({

View File

@ -40,7 +40,7 @@ Page({
*/ */
activityList: function() { activityList: function() {
var self = this; var self = this;
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/volunteerservice/listpagevolunteerservicerelease', []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/volunteerservice/listpagevolunteerservicerelease', []),
self.data.pages, null, function(code, data) { self.data.pages, null, function(code, data) {
if('200' == code) { if('200' == code) {
// 将活动照片,拼接为可访问地址 // 将活动照片,拼接为可访问地址

View File

@ -40,7 +40,7 @@
</view> </view>
</view> </view>
<view class="activity"> <view class="activity">
<view class="activity-box" bindtap="goDetail" data-id="{{item.volunteerServiceId}}" wx:for="{{serviceMap}}"> <view class="activity-box" bindtap="goDetail" data-id="{{item.volunteerServiceId}}" wx:for="{{serviceMap}}" wx:key="index">
<view class="activity-img"> <view class="activity-img">
<image src="{{item.photo}}"></image> <image src="{{item.photo}}"></image>
<view class="corner" wx:if="{{item.status == 'enroll'}}">报名中</view> <view class="corner" wx:if="{{item.status == 'enroll'}}">报名中</view>

View File

@ -233,10 +233,10 @@ Page({
var url; var url;
var requ; var requ;
if(!self.data.volunteerMsg) { if(!self.data.volunteerMsg) {
url = '/wxminiapp/volunteer/savevolunteer'; url = '/wechat-miniapp/volunteer/savevolunteer';
requ = app.restAjax.post; requ = app.restAjax.post;
}else { }else {
url = '/wxminiapp/volunteer/updatevolunteer/' + self.data.volunteerMsg.volunteerId; url = '/wechat-miniapp/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 +305,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/dataarea/listareabyparentidrelease/' + dictId, []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/area/listallbyparentidrelease/' + dictId, []),
{}, { {}, {
headers: { headers: {
'token': self.data.token 'token': self.data.token
@ -351,7 +351,7 @@ Page({
getVolunteerMsg() { getVolunteerMsg() {
var self = this; var self = this;
return new Promise(resolve => { return new Promise(resolve => {
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/volunteer/getvolunteerbyuserid', []), app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wechat-miniapp/volunteer/getvolunteerbyuserid', []),
{}, { {}, {
headers: { headers: {
'token': self.data.token 'token': self.data.token

View File

@ -54,7 +54,7 @@
<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.dictionaryId}}' wx:for="{{serviceType}}"> <checkbox value='{{item.dictionaryId}}' wx:for="{{serviceType}}" wx:key="index">
<view>{{item.dictionaryName}}</view> <view>{{item.dictionaryName}}</view>
</checkbox> </checkbox>
</checkbox-group> </checkbox-group>
@ -66,7 +66,7 @@
<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.dictionaryId}}' wx:for="{{serviceIndustry}}"> <checkbox value='{{item.dictionaryId}}' wx:for="{{serviceIndustry}}" wx:key="index">
<view>{{item.dictionaryName}}</view> <view>{{item.dictionaryName}}</view>
</checkbox> </checkbox>
</checkbox-group> </checkbox-group>

View File

@ -37,9 +37,9 @@ Page({
type: e.currentTarget.dataset.type type: e.currentTarget.dataset.type
}) })
if(self.data.type === '1') { if(self.data.type === '1') {
self.otherTeam(app.volunteerUrl + '/wxminiapp/team/otherteamm?otherTeam=true'); self.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/otherteamm?otherTeam=true');
}else { }else {
self.otherTeam(app.volunteerUrl + '/wxminiapp/team/myjointeam?myTeam=true'); self.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/myjointeam?myTeam=true');
} }
}, },
otherTeam: function(url) { otherTeam: function(url) {
@ -74,14 +74,14 @@ Page({
var methodType; var methodType;
var title; var title;
if('1' == self.data.type) { if('1' == self.data.type) {
url = app.volunteerUrl + '/wxminiapp/teammember/saveteammember' url = app.volunteerUrl + '/wechat-miniapp/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 + '/wxminiapp/teammember/quitTeam/' + self.data.teamId url = app.volunteerUrl + '/wechat-miniapp/teammember/quitTeam/' + self.data.teamId
methodType = app.restAjax.get methodType = app.restAjax.get
title = '退出成功!' title = '退出成功!'
} }
@ -109,7 +109,7 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.getToken().then(result => { this.getToken().then(result => {
this.otherTeam(app.volunteerUrl + '/wxminiapp/team/otherteamm?otherTeam=true'); this.otherTeam(app.volunteerUrl + '/wechat-miniapp/team/otherteamm?otherTeam=true');
}) })
}, },

View File

@ -11,7 +11,7 @@
</view> </view>
</view> </view>
<view class="team"> <view class="team">
<view class="team-box" wx:for="{{otherTeamMap}}" data-id="{{item.teamId}}"> <view class="team-box" wx:for="{{otherTeamMap}}" data-id="{{item.teamId}}" wx:key="index">
<view class="name-join"> <view class="name-join">
<view class="name">{{item.teamName}}</view> <view class="name">{{item.teamName}}</view>
<view class="join" wx:if="{{item.checkStatus == '' && type == 1}}" data-teamid="{{item.teamId}}" bindtap="joinOrOutTeam">申请加入</view> <view class="join" wx:if="{{item.checkStatus == '' && type == 1}}" data-teamid="{{item.teamId}}" bindtap="joinOrOutTeam">申请加入</view>