处理冲突

This commit is contained in:
wenc000 2020-06-30 20:03:05 +08:00
parent 8792375b65
commit 9d98d767a0
25 changed files with 367 additions and 140 deletions

View File

@ -6,7 +6,11 @@ Page({
* 页面的初始数据
*/
data: {
dataList: []
dataList: [],
pages: {
page: 1,
rows: 5
}
},
goDetail: function (e) {
var id = e.currentTarget.dataset.id;
@ -14,29 +18,46 @@ Page({
url: '../activityDetail/activityDetail?id=' + id
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
getActivityList: function() {
var self = this;
app.restAjax.get(app.restAjax.path(app.activityUrl + '/wxminiapp/activitylibrary/listpageactivitylibraryfornetrelease', []),
{}, null, function(code, data) {
self.data.pages, null, function(code, data) {
if('200' == code) {
for(var item of data.rows) {
if('' != item.activityImage) {
item.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + item.activityImage;
}
}
self.setData({
dataList: data.rows,
})
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();
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getActivityList();
},
/**
* 生命周期函数--监听页面初次渲染完成
@ -70,14 +91,20 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
// 在标题栏中显示加载图标
wx.showNavigationBarLoading();
var self = this;
self.setData({
[`pages.page`] : self.data.pages.page + 1
})
this.getActivityList();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**

View File

@ -1,3 +1,5 @@
{
"usingComponents": {}
"usingComponents": {},
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
}

View File

@ -6,31 +6,79 @@ Page({
* 页面的初始数据
*/
data: {
dataMap: {}
dataMap: {},
token: ''
},
goSign: function () {
wx.navigateTo({
url: '../activitySign/activitySign'
getToken: function() {
var self = this;
return new Promise(resolve =>{
wx.getStorage({
key: 'token',
success(res) {
self.setData({
token: res.data
})
return resolve();
}
})
})
},
goSign: function (e) {
var activityId = e.currentTarget.dataset.id;
wx.navigateTo({
url: '../activitySign/activitySign?id=' + activityId
})
},
cancel: function(e) {
var activityId = e.currentTarget.dataset.id;
app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activityuserapply/cancelapply/' + activityId, []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
wx.navigateTo({
url: '../activityDetail/activityDetail?id=' + activityId
})
}
}, function() {
}, function() {
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var self = this;
var id = options.id;
app.restAjax.get(app.restAjax.path(app.activityUrl + '/wxminiapp/activitylibrary/getactivitylibrarybyidrelease/' + id, []),
{}, null, function(code, data) {
if('200' == code) {
data.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + data.activityImage;
self.setData({
dataMap: data
})
}
}, function() {
this.getToken().then(result => {
console.log(self.data.token)
var url;
var id = options.id;
if(!self.data.token) {
url = '/wxminiapp/activitylibrary/getactivitylibrarybyidrelease/' + id;
}else {
url = '/wxminiapp/activitylibrary/getactivitylibrarybyid/' + id
}
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
data.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + data.activityImage;
self.setData({
dataMap: data
})
}
}, function() {
}, function() {
}, function() {
})
})
},

View File

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

View File

@ -41,6 +41,9 @@
</view>
</view>
</view>
<view class="sign-box" bindtap="goSign" data-id="{{dataMap.activityLibraryId }}" wx-if="{{dataMap.activityState == 3 && dataMap.isEnroll == ''}}">
<view class="sign-box" bindtap="goSign" data-id="{{dataMap.activityLibraryId}}" wx-if="{{dataMap.activityState == 3 && dataMap.isEnroll == ''}}">
<view class="sign-btn">报名</view>
</view>
<view class="sign-box" bindtap="cancel" data-id="{{dataMap.activityLibraryId}}" wx-if="{{dataMap.activityState != 6 && dataMap.activityState != 7 && dataMap.activityState != 99 && dataMap.isEnroll != ''}}">
<view class="sign-btn">取消报名</view>
</view>

View File

@ -7,7 +7,12 @@ Page({
*/
data: {
token: '',
serviceId: ''
serviceId: '',
pages: {
page: 1,
rows: 5
},
dataList: {}
},
getToken: function() {
var self = this;
@ -26,18 +31,55 @@ Page({
getActivityHis: function() {
var self = this;
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/teamactivityhis/listpageteamactivityhis?serviceId=' + self.data.serviceId, []),
{}, {
self.data.pages, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
console.log(data)
var photos = [];
for(var item of data.rows) {
if('' != item.photo) {
item.photo = app.volunteerUrl + '/route/file/downloadfile/true/' + item.photo;
}
if('' != item.photos) {
var photoArr = item.photos.split(",");
for(var i=0; i<photoArr.length; i++) {
photoArr[i] = app.volunteerUrl + '/route/file/downloadfile/true/' + photoArr[i];
}
item.photos = photoArr
}
if('' != item.videos) {
var videoArr = item.videos.split(",");
for(var i=0; i<videoArr.length; i++) {
videoArr[i] = app.volunteerUrl + '/route/file/downloadfile/true/' + videoArr[i];
}
item.videos = videoArr
}
}
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();
})
},
/**
@ -85,7 +127,14 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
// 在标题栏中显示加载图标
wx.showNavigationBarLoading();
var self = this;
self.setData({
[`pages.page`] : self.data.pages.page + 1
})
console.log(self.data.pages)
this.getActivityHis();
},
/**

View File

@ -1,3 +1,5 @@
{
"usingComponents": {}
"usingComponents": {},
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
}

View File

@ -1,31 +1,23 @@
<view class="dialog">
<view class="dialog-box">
<view class="dialog-box" wx:for="{{dataList}}">
<view class="avatar">
<image src="../../images/avatar.png"></image>
<image wx:if="{{item.photo}}" src="{{item.photo}}"></image>
<image wx:else src="../../images/avatar.png"></image>
</view>
<view class="user-info">
<view class="name">姓名</view>
<view class="content">哈哈哈哈哈</view>
<view class="public-time">
<view class="time">2020-02-02 00:00:00</view>
<view class="delete">
<image src="../../images/delete.png"></image>
</view>
<view class="name">{{item.volunteerName}}</view>
<view class="content">{{item.content}}</view>
<view class="content" wx:if="{{item.photos}}">
<image wx:for="{{item.photos}}" wx:for-item="subItem" src="{{subItem}}"></image>
</view>
<view class="content" wx:if="{{item.videos}}">
<video wx:for="{{item.videos}}" wx:for-item="subItem" src="{{subItem}}"></video>
</view>
</view>
</view>
<view class="dialog-box">
<view class="avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="user-info">
<view class="name">姓名</view>
<view class="content">哈哈哈哈哈</view>
<view class="public-time">
<view class="time">2020-02-02 00:00:00</view>
<view class="delete">
<view class="time">{{item.uploadTime}}</view>
<!--<view class="delete">
<image src="../../images/delete.png"></image>
</view>
</view>-->
</view>
</view>
</view>

View File

@ -1,18 +1,123 @@
// pages/activitySign/activitySign.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
token: '',
dataMap: {},
phone: '',
code: '',
name: '',
idCard: '',
trueCode: '',
activityId: ''
},
getToken: function() {
var self = this;
return new Promise(resolve =>{
wx.getStorage({
key: 'token',
success(res) {
self.setData({
token: res.data
})
return resolve();
}
})
})
},
getCode: function() {
var self = this;
if(!self.data.phone) {
app.dialog.msg('请输入手机号');
return false;
}
app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activityuserapply/saveSmsCoderelease/' + self.data.phone, []),
{}, null, function(code, data) {
console.log(data)
if('200' == code) {
}
}, function() {
}, function() {
})
},
commit: function() {
var self = this;
if(!self.data.phone) {
app.dialog.msg('请输入手机号');
return false;
}
if(!self.data.name) {
app.dialog.msg('请输入姓名');
return false;
}
if(!self.data.idCard) {
app.dialog.msg('请输入身份证号码');
return false;
}
var activityUserApplyVO = {
activityId: self.data.activityId,
code: self.data.code,
userIdCard: self.data.idCard,
userName: self.data.name,
userPhone: self.data.phone
}
app.restAjax.post(app.restAjax.path(app.activityUrl + '/app/activityuserapply/saveactivityuserapplyrelease', []),
activityUserApplyVO, {
headers: {
token: self.data.token
}
}, function(code, data) {
console.log(data)
if('200' == code) {
}
}, function() {
}, function() {
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var self = this;
this.getToken().then(result => {
var url;
var id = options.id;
if(!self.data.token) {
url = '/wxminiapp/activitylibrary/getactivitylibrarybyidrelease/' + id;
}else {
url = '/wxminiapp/activitylibrary/getactivitylibrarybyid/' + id
}
self.setData({
activityId: options.id
})
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
data.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + data.activityImage;
self.setData({
dataMap: data
})
}
}, function() {
}, function() {
})
})
},
/**

View File

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

View File

@ -1,29 +1,29 @@
<view class="activity">
<view class="activity-img">
<image src="../../images/big-news.png"></image>
<image src="{{dataMap.activityImage}}"></image>
</view>
<view class="activity-info">
<view class="activity-title">银保监会印发《关于加快推进意外金融风险…</view>
<view class="activity-title">{{dataMap.activityTitle}}</view>
<view class="activity-text">
<view class="left-title">
<image src="../../images/people.png"></image>
<text>活动人数:</text>
</view>
<view class="right-content">100人</view>
<view class="right-content">{{dataMap.activityUserNum }}</view>
</view>
<view class="activity-text">
<view class="left-title">
<image src="../../images/time.png"></image>
<text>活动时间:</text>
</view>
<view class="right-content">2020-02-03至2020-02-04</view>
<view class="right-content">{{dataMap.activityStartTime}}至{{dataMap.activityEndTime}}</view>
</view>
<view class="activity-text">
<view class="left-title">
<image src="../../images/address.png"></image>
<text>活动地址:</text>
</view>
<view class="right-content">活动地址</view>
<view class="right-content">{{dataMap.activityAddress }}</view>
</view>
</view>
</view>
@ -32,23 +32,23 @@
<view class="personal-info">
<view class="info-box">
手机号:
<input placeholder="请输入手机号"></input>
<input placeholder="请输入手机号" model:value="{{phone}}"></input>
</view>
<view class="info-box">
验证码:
<input placeholder="请输入验证码"></input>
<view class="get-code">获取验证码</view>
<input placeholder="请输入验证码" model:value="{{code}}"></input>
<view class="get-code" bindtap="getCode">获取验证码</view>
</view>
<view class="info-box">
姓 名:
<input placeholder="请输入姓名"></input>
<input placeholder="请输入姓名" model:value="{{name}}"></input>
</view>
<view class="info-box">
身份证:
<input placeholder="请输入身份证号码"></input>
<input placeholder="请输入身份证号码" model:value="{{idCard}}"></input>
</view>
</view>
</view>
<view class="sign-box">
<view class="sign-btn">立即报名</view>
<view class="sign-btn" bindtap="commit">立即报名</view>
</view>

View File

@ -9,8 +9,7 @@ Page({
token: '',
dataMap: {},
type: '1',
teamId: '',
teamId: ''
},
getToken: function() {
var self = this;
@ -58,7 +57,7 @@ Page({
myActivity: function(url) {
var self = this;
app.restAjax.get(app.restAjax.path(url, []),
{}, {
self.data.pages, {
headers: {
token: self.data.token
}
@ -77,50 +76,6 @@ Page({
}, 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 + '/wxminiapp/teammember/saveteammember'
teamMemberVO = {
teamId: e.currentTarget.dataset.teamid
}
methodType = app.restAjax.post
title = '申请成功!'
}else {
url = app.volunteerUrl + '/wxminiapp/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() {
})
},
/**
@ -164,7 +119,7 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**

View File

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

View File

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

View File

@ -74,7 +74,7 @@ Page({
var data = data.substr(9, data.length);
data = data.substr(0, data.length - 2);
self.setData({
photo: data
photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data
})
}
}, function(code, data) {

View File

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

View File

@ -1,10 +1,13 @@
<view class="new-team">
<view class="row img-row">
<view class="row-title">团队头像:</view>
<view class="row-text" bindtap="uploadPhoto">
<!--<image src="http://192.168.0.111:8888/volunteer/route/file/downloadfile/true/{{photo}}" class="row-img"></image>-->
<view class="row-text" bindtap="uploadPhoto" wx:if="{{photo}}">
<image src="{{photo}}" class="row-img"></image>
</view>
<view class="row-text" wx:else bindtap="uploadPhoto">
点击上传
<image src="" class="row-img"></image>
</view>
</view>
<view class="row">
<view class="row-title">团队名称:</view>

View File

@ -99,7 +99,7 @@ Page({
var data = data.substr(9, data.length);
data = data.substr(0, data.length - 2);
self.setData({
photo: data
photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data
})
}
}, function(code, data) {

View File

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

View File

@ -86,8 +86,12 @@
</view>
<view class="row img-row">
<view class="row-title">宣传图片:</view>
<view class="row-text" bindtap="uploadPhoto">
<image src="{{photo}}" class="row-img"></image>
<view class="row-text" bindtap="uploadPhoto" wx:if="{{photo}}">
<image wx:if="{{photo}}" src="{{photo}}" class="row-img"></image>
</view>
<view class="row-text" bindtap="uploadPhoto" wx:else>
点击上传
<image src="" class="row-img"></image>
</view>
</view>
</view>

View File

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

View File

@ -8,7 +8,11 @@ Page({
data: {
indicatorDots: true,
autoplay: true,
serviceMap: []
serviceMap: [],
pages: {
page: 1,
rows: 5
}
},
goDetail: function (e) {
var id = e.currentTarget.dataset.id;
@ -37,7 +41,7 @@ Page({
activityList: function() {
var self = this;
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/volunteerservice/listpagevolunteerservicerelease', []),
{}, null, function(code, data) {
self.data.pages, null, function(code, data) {
if('200' == code) {
// 将活动照片,拼接为可访问地址
for(var item of data.rows) {
@ -46,14 +50,30 @@ Page({
item.photo = app.volunteerUrl + '/route/file/downloadfile/true/' + photoArr[0];
}
}
self.setData({
serviceMap: data.rows
})
if(1 === self.data.pages.page) {
self.setData({
serviceMap: data.rows
})
}else {
if(data.rows.length == 0) {
self.setData({
[`pages.page`] : self.data.pages.page - 1
})
app.dialog.msg('暂无更多')
return false;
}
self.setData({
serviceMap: data.rows.concat(self.data.serviceMap),
})
}
}
}, function() {
}, function() {
wx.hideNavigationBarLoading(); //完成停止加载图标
wx.stopPullDownRefresh();
})
},
/**
@ -95,7 +115,13 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
// 在标题栏中显示加载图标
wx.showNavigationBarLoading();
var self = this;
self.setData({
[`pages.page`] : self.data.pages.page + 1
})
this.activityList();
},
/**

View File

@ -1,3 +1,5 @@
{
"usingComponents": {}
"usingComponents": {},
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
}

View File

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

View File

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