app.json冲突解决

This commit is contained in:
wans 2020-07-03 16:57:07 +08:00
commit a4012d1ebf
30 changed files with 692 additions and 202 deletions

View File

@ -23,6 +23,7 @@ Page({
app.restAjax.get(app.restAjax.path(app.activityUrl + '/wxminiapp/activitylibrary/listpageactivitylibraryfornetrelease', []), app.restAjax.get(app.restAjax.path(app.activityUrl + '/wxminiapp/activitylibrary/listpageactivitylibraryfornetrelease', []),
self.data.pages, null, function(code, data) { self.data.pages, null, function(code, data) {
if('200' == code) { if('200' == code) {
console.log(data.rows)
for(var item of data.rows) { for(var item of data.rows) {
if('' != item.activityImage) { if('' != item.activityImage) {
item.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + item.activityImage; item.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + item.activityImage;

View File

@ -54,13 +54,16 @@ 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)
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 = '/wxminiapp/activitylibrary/getactivitylibrarybyidrelease/' + id;
self.setData({
token: null
})
}else { }else {
url = '/wxminiapp/activitylibrary/getactivitylibrarybyid/' + id url = '/wxminiapp/activitylibrary/getactivitylibrarybyid/' + id
self.getToken()
} }
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), app.restAjax.get(app.restAjax.path(app.activityUrl + url, []),
{}, { {}, {
@ -73,6 +76,7 @@ Page({
self.setData({ self.setData({
dataMap: data dataMap: data
}) })
console.log(self.data.dataMap)
} }
}, function() { }, function() {

View File

@ -41,9 +41,9 @@
</view> </view>
</view> </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 class="sign-btn">报名</view>
</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-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 class="sign-btn">取消报名</view>
</view> </view>

View File

@ -41,8 +41,8 @@ Page({
if('200' == code) { if('200' == code) {
} }
}, function() { }, function(code, data) {
app.dialog.msg(data.msg)
}, function() { }, function() {
}) })
@ -68,7 +68,7 @@ Page({
userName: self.data.name, userName: self.data.name,
userPhone: self.data.phone userPhone: self.data.phone
} }
app.restAjax.post(app.restAjax.path(app.activityUrl + '/app/activityuserapply/saveactivityuserapplyrelease', []), app.restAjax.post(app.restAjax.path(app.activityUrl + '/app/activityuserapply/saveactivityuserapply', []),
activityUserApplyVO, { activityUserApplyVO, {
headers: { headers: {
token: self.data.token token: self.data.token
@ -76,7 +76,9 @@ Page({
}, function(code, data) { }, function(code, data) {
console.log(data) console.log(data)
if('200' == code) { if('200' == code) {
wx.navigateTo({
url: '../activitySign/activitySign?id=' + self.data.activityId
})
} }
}, function() { }, function() {

View File

@ -250,6 +250,11 @@ Page({
}) })
}, },
//获取验证码
getSmsCoce:function (){
},
doCheckOrder: function () { doCheckOrder: function () {
if(this.data.mySelectItem.length == 0){ if(this.data.mySelectItem.length == 0){
return false; return false;

View File

@ -42,7 +42,7 @@
<view class="row"> <view class="row">
<view class="row-title">验证码:</view> <view class="row-title">验证码:</view>
<view class="row-input"> <view class="row-input">
<input placeholder="请输入验证码" class="code-input" model:value="{{smsCode}}"></input> <input placeholder="请输入验证码" class="code-input" model:value="{{smsCode}}" bindtap="getSmsCoce"></input>
<view class="get-code">获取验证码</view> <view class="get-code">获取验证码</view>
</view> </view>
</view> </view>

View File

@ -120,126 +120,10 @@ Page({
url: '../myVolunteerActivity/myVolunteerActivity', url: '../myVolunteerActivity/myVolunteerActivity',
}) })
}, },
// 判断用户是否为随机名称
isRandomName: function () {
var self = this
wx.getStorage({
key: 'isRandomUsername',
success: function (res) {
if (res.data == 1) {
wx.hideTabBar()
self.setData({
randomName: true
})
}
}
})
},
// 取消绑定手机
cancelPhone: function () {
this.setData({
showPhone: false
})
wx.showTabBar()
},
// 获取输入的手机号
phoneNum: function (res) {
this.setData({
phone: res.detail.value
})
console.log(this.data.phone)
},
// 校验手机号
testPhone: function () {
var self = this
if (self.data.phone) {
if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.data.phone)) {
wx.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1500
})
} else {
self.getCode()
}
} else {
wx.showToast({
title: '手机号不能为空',
icon: 'none',
duration: 1500
})
}
},
// 获取验证码
getCode: function () {
var self = this
app.restAjax.get(app.restAjax.path('{usercenterUrl}/api/sms/getverificationcode/' + self.data.phone, [app.usercenterUrl]), {}, null,
function (code, data) {
if (code == 200) {
console.log(data)
self.setData({
gotCode: true
})
self.data.timer = setInterval(function () {
var cur = self.data.restTime - 1
console.log(cur)
if (cur == 0) {
clearInterval(self.data.timer)
self.setData({
restTime: 120,
gotCode: false
})
}
self.setData({
restTime: cur
})
}, 1000)
}
},
function (code, data) {
console.log(data)
wx.showToast({
title: data.msg,
icon: 'none',
duration: 1500
})
} )
},
// 提交绑定手机
submitPhone: function () {
var self = this
app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateminiappdefaultusername', [app.usercenterUrl]), {
phone: self.data.phone,
verificationCode: self.data.code
}, {
headers: {
token: self.data.token
}
}, function (code, data) {
console.log(data)
wx.setStorageSync('token', data.data);
wx.setStorageSync('isRandomUsername', 0)
clearInterval(self.data.timer)
self.setData({
showPhone: false,
restTime: 120
})
self.getUserInfo()
}, function (code, data) {
console.log(data)
})
},
// 验证码
inputCode: function (e) {
this.setData({
code: e.detail.value
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.isRandomName()
this.getToken() this.getToken()
}, },

View File

@ -1,20 +1,19 @@
// pages/cultureDetail/cultureDetail.js // pages/cultureDetail/cultureDetail.js
var app = getApp();
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
libraryUrl: app.libraryUrl,
swiper: { swiper: {
imgUrl: [ imgUrl: [],
'../../images/culture-slide.png',
'../../images/culture-slide.png',
'../../images/culture-slide.png'
],
indicatorDots: false, indicatorDots: false,
autoplay: true, autoplay: true,
current: 0 current: 0
} },
library: null
}, },
prevImg: function () { prevImg: function () {
var swiper = this.data.swiper; var swiper = this.data.swiper;
@ -33,11 +32,31 @@ Page({
swiper: swiper, swiper: swiper,
}) })
}, },
doGetLibrary: function(libraryId) {
var self = this;
app.dialog.loading('正在加载');
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/getintangiblelibrarybyidrelease/{libraryId}', [self.data.libraryUrl, libraryId]), {}, null, function(code, data) {
var covers = data.libraryCover.split(',');
var imageArray = [];
for(var i = 0, item; item = covers[i++];) {
imageArray.push(app.restAjax.path('{libraryUrl}/route/file/downloadfile/true/{cover}', [self.data.libraryUrl, item]));
}
self.setData({
library: data,
'swiper.imgUrl': imageArray
})
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
wx.stopPullDownRefresh();
wx.hideLoading();
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.doGetLibrary(options.libraryId);
}, },
/** /**

View File

@ -12,55 +12,55 @@
</view> </view>
</view> </view>
<view class="culture"> <view class="culture">
<view class="culture-title">民间舞蹈</view> <view class="culture-title">{{library.libraryTitle}}</view>
<view class="culture-info"> <view class="culture-info">
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>项目编号:</text> <text>项目编号:</text>
EKLAJNKAS09 {{library.libraryNumber}}
</view> </view>
<view class="info"> <view class="info">
<text>数据来源:</text> <text>数据来源:</text>
EKLAJNKAS09 {{library.librarySource}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>公布时间:</text> <text>公布时间:</text>
2020-02-03 {{library.libraryOpenDateValue}}
</view> </view>
<view class="info"> <view class="info">
<text>非遗级别:</text> <text>非遗级别:</text>
{{library.libraryLevel}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>所属地区:</text> <text>所属地区:</text>
西藏林芝市 {{library.libraryArea}}
</view> </view>
<view class="info"> <view class="info">
<text>类  型:</text> <text>类  型:</text>
新增项目 {{library.libraryTypeValue}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>申报地区或单位:</text> <text>申报地区或单位:</text>
测试 {{library.libraryAddress}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>保护单位:</text> <text>保护单位:</text>
测试 {{library.libraryAuthor}}
</view> </view>
</view> </view>
</view> </view>
<view class="part"> <view class="part">
<view class="part-title">相关描述</view> <view class="part-title">相关描述</view>
<view class="part-content"> <view class="part-content">
光拉便半运县写员二到院细天县见运命运感知争公着解全得律号深共权发市以家情军少先意单理样好族权达保很具你住红许气已第白知题候其然知王公众我头务族观经市指或七比生。适基历然题和低是局着先重信知议过说心龙素标安放大支入完二种设力果每角解收美约声里历美节办约管运但然新分活们心毛手过共点家或。革解快和特技县应精术被心走小器风育相条际北些有品同自群素革拉林积张严求选马打书。力问业光者最论快决装争每保时造何历入越日劳经干好东此金区法思设断这层压很决给地确思引光各年与队太习面方加族社种斗表越划快。 {{library.librarySummary}}
</view> </view>
</view> </view>
<view class="part"> <view class="part">
@ -68,11 +68,11 @@
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>编  号:</text> <text>编  号:</text>
EKLAJNKAS09 {{library.libraryNumber}}
</view> </view>
<view class="info"> <view class="info">
<text>姓  名:</text> <text>姓  名:</text>
Ruby Pope {{library.libraryAuthor}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
@ -93,6 +93,3 @@
</view> </view>
</view> </view>
</view> </view>
<view class="sign-box">
<view class="sign-btn">报名</view>
</view>

View File

@ -0,0 +1,66 @@
// pages/friendCircle/friendCircle.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,59 @@
<view class="friend-circle">
<view class="friend-circle-box">
<view class="avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="content">
<view class="name">张三</view>
<view class="text">内容内容内容内容内容</view>
<view class="date">2020-01-01 00:00:00</view>
</view>
</view>
<view class="friend-circle-box">
<view class="avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="content">
<view class="name">张三</view>
<view class="text">内容内容内容内容内容</view>
<view class="photo-one">
<image src="../../images/center-bg.png"></image>
</view>
<view class="date">2020-01-01 00:00:00</view>
</view>
</view>
<view class="friend-circle-box">
<view class="avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="content">
<view class="name">张三</view>
<view class="text">内容内容内容内容内容</view>
<view class="photo-more">
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
</view>
<view class="date">2020-01-01 00:00:00</view>
</view>
</view>
<view class="friend-circle-box">
<view class="avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="content">
<view class="name">张三</view>
<view class="text">内容内容内容内容内容</view>
<view class="video">
<video src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400"></video>
</view>
<view class="date">2020-01-01 00:00:00</view>
</view>
</view>
</view>

View File

@ -0,0 +1,48 @@
.friend-circle{
padding: 30rpx;
}
.friend-circle-box{
margin-bottom: 20rpx;
display: flex;
justify-content: space-between;
border-bottom: 1px solid #DEDEDE;
padding-bottom: 10rpx;
}
.avatar{
width: 8%;
}
.avatar image{
width: 100%;
height: 50rpx;
}
.content{
width: 90%;
}
.name{
font-size: 30rpx;
color: #949494;
}
.text{
font-size: 32rpx;
color: #000;
margin: 10rpx 0;
}
.date{
font-size: 28rpx;
color: #949494;
}
.photo-one image{
width: 80%;
}
.photo-more image{
width: 32%;
height: 150rpx;
margin-right: 2%;
margin-bottom: 10rpx;
}
.photo-more image:nth-child(3n){
margin-right: 0;
}
.video video{
width: 80%;
}

View File

@ -1,22 +1,57 @@
// pages/heritage/heritage.js // pages/heritage/heritage.js
var app = getApp();
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
libraryUrl: app.libraryUrl,
libraryList: [],
currentPage: 1,
rows: 20
}, },
goDetail: function () { goDetail: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '../cultureDetail/cultureDetail', url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId,
}) })
}, },
doGetLibraryList: function(page) {
var self = this;
app.dialog.loading('正在加载');
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/listpageintangiblelibraryrelease', [self.data.libraryUrl]), {
page: page,
rows: self.data.rows
}, null, function(code, data) {
if(data.rows.length == 0) {
app.dialog.msg('暂无数据');
return;
}
for(var i = 0, item; item = data.rows[i++];) {
item.libraryApplyTime = item.libraryApplyTime.substring(0, item.libraryApplyTime.length - 10);
}
var libraryArray;
if(page <= 1) {
libraryArray = data.rows;
} else {
libraryArray = self.data.news.newsList;
libraryArray = libraryArray.concat(data.rows);
}
self.setData({
currentPage: page,
libraryList: libraryArray
})
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
wx.stopPullDownRefresh();
wx.hideLoading();
});
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.doGetLibraryList(1);
}, },
/** /**
@ -51,14 +86,14 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.doGetLibraryList(1);
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
this.doGetLibraryList(this.data.currentPage + 1);
}, },
/** /**

View File

@ -1,3 +1,6 @@
{ {
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark",
"onReachBottomDistance": 50
} }

View File

@ -1,49 +1,27 @@
<view class="top-select"> <view class="top-select">
<view class="select-box active"> <view class="select-box active">
<image src="../../images/select-tab.png"></image> <image src="../../images/select-tab.png"></image>
<view class="select-title">非遗数据库</view> <view class="select-title">非物质文化数据库</view>
</view> </view>
<view class="select-box"> <view class="select-box">
<image src="../../images/select-tab.png"></image> <image src="../../images/select-tab.png"></image>
<view class="select-title">非遗数据库</view> <view class="select-title">文化直播</view>
</view> </view>
<view class="select-box"> <view class="select-box">
<image src="../../images/select-tab.png"></image> <image src="../../images/select-tab.png"></image>
<view class="select-title">非遗数据库</view> <view class="select-title">文化分享</view>
</view> </view>
</view> </view>
<view class="activity"> <view class="activity">
<view class="activity-box" bindtap="goDetail"> <view class="activity-box" bindtap="goDetail" data-library-id="{{item.intangibleLibraryId}}" wx:for="{{libraryList}}" wx:for-item="item" wx:for-index="index" wx:key="libraryList">
<view class="activity-img"> <view class="activity-img">
<image src="../../images/big-news.png"></image> <image src="{{libraryUrl}}/route/file/downloadfile/true/{{item.libraryCover}}"></image>
</view> </view>
<view class="activity-info"> <view class="activity-info">
<view class="title"> <view class="title">
<view class="activity-title">银保监会印发《关于加快推进意外险改…</view> <view class="activity-title">{{item.libraryTitle}}</view>
</view> </view>
<view class="date">2020-02-02 14:00:00至2020-02-03 14:00:00</view> <view class="date">{{item.libraryApplyTime}}</view>
</view>
</view>
<view class="activity-box" bindtap="goDetail">
<view class="activity-img">
<image src="../../images/big-news.png"></image>
</view>
<view class="activity-info">
<view class="title">
<view class="activity-title">银保监会印发《关于加快推进意外险改…</view>
</view>
<view class="date">2020-02-02 14:00:00至2020-02-03 14:00:00</view>
</view>
</view>
<view class="activity-box" bindtap="goDetail">
<view class="activity-img">
<image src="../../images/big-news.png"></image>
</view>
<view class="activity-info">
<view class="title">
<view class="activity-title">银保监会印发《关于加快推进意外险改…</view>
</view>
<view class="date">2020-02-02 14:00:00至2020-02-03 14:00:00</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -4,6 +4,11 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
randomName: '',
showPhone: true,
gotCode: false,
restTime: 10,
timer: '',
indicatorDots: true, indicatorDots: true,
autoplay: true, autoplay: true,
token: '', token: '',
@ -26,7 +31,8 @@ Page({
live: { live: {
liveUrl: app.liveUrl, liveUrl: app.liveUrl,
liveList: [] liveList: []
} },
usercenterUrl: app.usercenterUrl
}, },
doLogin: function () { doLogin: function () {
var self = this; var self = this;
@ -59,6 +65,9 @@ Page({
page: 1, page: 1,
rows: 5 rows: 5
}, null, function(code, data) { }, null, function(code, data) {
for(var i = 0, item; item = data.rows[i++];) {
item.cover = item.libraryCover.split(',')[0];
}
self.setData({ self.setData({
'library.bannerLibrary': data.rows 'library.bannerLibrary': data.rows
}); });
@ -118,6 +127,11 @@ Page({
app.dialog.msg(data.msg); app.dialog.msg(data.msg);
}); });
}, },
goCultureDetail: function(event) {
wx.navigateTo({
url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId,
})
},
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,
@ -158,6 +172,130 @@ Page({
url: '../heritage/heritage', url: '../heritage/heritage',
}) })
}, },
// 获取输入的手机号
phoneNum: function (res) {
this.setData({
phone: res.detail.value
})
console.log(this.data.phone)
},
// 校验手机号
testPhone: function () {
var self = this
if (self.data.phone) {
if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.data.phone)) {
wx.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1500
})
} else {
self.getCode()
}
} else {
wx.showToast({
title: '手机号不能为空',
icon: 'none',
duration: 1500
})
}
},
// 获取验证码
getCode: function () {
var self = this
app.restAjax.get(app.restAjax.path('{usercenterUrl}/api/sms/getverificationcode/' + self.data.phone, [app.usercenterUrl]), {}, null,
function (code, data) {
if (code == 200) {
console.log(data)
self.setData({
gotCode: true
})
self.data.timer = setInterval(function () {
var cur = self.data.restTime - 1
console.log(cur)
if (cur == 0) {
clearInterval(self.data.timer)
self.setData({
restTime: 120,
gotCode: false
})
} else {
self.setData({
restTime: cur
})
}
}, 1000)
}
},
function (code, data) {
console.log(data)
wx.showToast({
title: data.msg,
icon: 'none',
duration: 1500
})
} )
},
// 提交绑定手机
submitPhone: function () {
var self = this
app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateminiappdefaultusername', [app.usercenterUrl]), {
phone: self.data.phone,
verificationCode: self.data.code
}, {
headers: {
token: self.data.token
}
}, function (code, data) {
console.log(data)
wx.setStorageSync('token', data.data);
wx.setStorageSync('isRandomUsername', 0)
clearInterval(self.data.timer)
self.setData({
showPhone: false,
restTime: 120
})
self.getUserInfo()
}, function (code, data) {
console.log(data)
})
},
// 验证码
inputCode: function (e) {
this.setData({
code: e.detail.value
})
},
// 判断用户是否为随机名称
isRandomName: function () {
var self = this
wx.getStorage({
key: 'isRandomUsername',
success: function (res) {
if (res.data == 1) {
wx.hideTabBar()
self.setData({
randomName: true
})
}
}
})
},
// 获取用户信息
getUserInfo: function () {
var self = this
app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/getappuser', [app.usercenterUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
self.setData({
userInfo: data
})
}, function (code, data) {
console.log(data)
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -169,6 +307,7 @@ Page({
self.doGetLiveList(); self.doGetLiveList();
self.doGetVenueList(); self.doGetVenueList();
self.doGetActivityList(); self.doGetActivityList();
self.isRandomName();
}, },
/** /**

View File

@ -1,7 +1,7 @@
<view class="swiper-box"> <view class="swiper-box">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" > <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" >
<swiper-item class="swiper-item" wx:for="{{library.bannerLibrary}}" wx:for-index="idx" wx:for-item="item" wx:key="bannerLibrary"> <swiper-item class="swiper-item" wx:for="{{library.bannerLibrary}}" bindtap="goCultureDetail" data-library-id="{{item.intangibleLibraryId}}" wx:for-index="idx" wx:for-item="item" wx:key="bannerLibrary">
<image src="{{library.libraryUrl}}/route/file/downloadfile/true/{{item.libraryCover}}" class="swiper-img"></image> <image src="{{library.libraryUrl}}/route/file/downloadfile/true/{{item.cover}}" class="swiper-img"></image>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
@ -125,4 +125,20 @@
<view class="broadcast-status" wx:else>错误</view> <view class="broadcast-status" wx:else>错误</view>
</view> </view>
</view> </view>
</view>
<view class="set-phone" wx:if="{{randomName && showPhone}}">
<view class="set-phone-box">
<view class="tips">您还没有绑定手机号,请先绑定手机号</view>
<view class="phone-input">
<input placeholder="请输入手机号" bindinput="phoneNum" class="phone-input"></input>
</view>
<view class="code-input">
<input placeholder="请输入验证码" bindinput="inputCode"></input>
<view class="get-code" bindtap="testPhone" wx:if="{{!gotCode}}">获取验证码</view>
<view class="got-code" wx:else>{{restTime}}</view>
</view>
<view class="set-phone-btn-box">
<view class="set-phone-btn" bindtap="submitPhone">确认</view>
</view>
</view>
</view> </view>

View File

@ -156,4 +156,83 @@
color: #fff; color: #fff;
font-size: 26rpx; font-size: 26rpx;
border-radius: 10rpx; border-radius: 10rpx;
}
.set-phone{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, .6);
z-index: 100;
}
.set-phone-box{
width: 96%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #fff;
border-radius: 10rpx;
padding: 30rpx;
box-sizing: border-box;
}
.tips{
font-size: 28rpx;
color: #000;
}
.phone-input{
margin: 25rpx 0;
}
.code-input{
display: flex;
justify-content: space-between;
margin-bottom: 25rpx;
}
.code-input input{
width: 70%;
height: 55rpx;
border: 1px solid #dedede;
border-radius: 10rpx;
padding: 0 10rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.phone-input input{
width: 100%;
height: 55rpx;
border: 1px solid #dedede;
border-radius: 10rpx;
padding: 0 10rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.get-code, .got-code{
font-size: 28rpx;
background: rgba(159,21,18,.1);
color: #9F1512;
width: 28%;
line-height: 55rpx;
text-align: center;
border-radius: 10rpx;
}
.got-code{
background: #fff;
color: #4a4d52;
border: 1px solid #eaeaea;
}
.set-phone-btn-box{
display: flex;
justify-content: space-between;
}
.set-phone-btn{
width: 100%;
height: 65rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #fff;
background: #9F1512;
border-radius: 10rpx;
} }

View File

@ -9,7 +9,8 @@ Page({
isAgree: false, // 是否同意志愿者注册协议 isAgree: false, // 是否同意志愿者注册协议
index: 0, index: 0,
array: ['区域1','区域2','区域3','区域4'], array: ['区域1','区域2','区域3','区域4'],
photo: '', photo: '', // 用于页面显示的photo链接
uploadPhoto: '', // 用于传到后台的photoId
teamName: '', teamName: '',
count:'', count:'',
teamWatchword: '', teamWatchword: '',
@ -74,7 +75,8 @@ Page({
var data = data.substr(9, data.length); var data = data.substr(9, data.length);
data = data.substr(0, data.length - 2); data = data.substr(0, data.length - 2);
self.setData({ self.setData({
photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data,
uploadPhoto: data
}) })
} }
}, function(code, data) { }, function(code, data) {
@ -140,6 +142,18 @@ Page({
} }
}) })
}, },
areaChange: function(e) {
var self = this;
self.setData({
teamAreaIndex: e.detail.value
})
},
userAgree: function(e) {
var type = e.currentTarget.dataset.type;
wx.navigateTo({
url: '../userAgree/userAgree?type=' + type,
})
},
changeAgree: function (e) { changeAgree: function (e) {
if(e.detail.value == ''){ if(e.detail.value == ''){
this.setData({ this.setData({
@ -162,7 +176,7 @@ Page({
return false; return false;
} }
var teamVO = { var teamVO = {
photo: self.data.photo, photo: self.data.uploadPhoto,
teamName: self.data.teamName, teamName: self.data.teamName,
count:self.data.count, count:self.data.count,
teamWatchword: self.data.teamWatchword, teamWatchword: self.data.teamWatchword,

View File

@ -1,12 +1,11 @@
<view class="new-team"> <view class="new-team">
<view class="row img-row"> <view class="row img-row avatar-row">
<view class="row-title">团队头像:</view> <view class="row-title">团队头像:</view>
<view class="row-text" bindtap="uploadPhoto" wx:if="{{photo}}"> <view class="row-text avatar" bindtap="uploadPhoto" wx:if="{{photo}}">
<image src="{{photo}}" class="row-img"></image> <image src="{{photo}}" class="row-img"></image>
</view> </view>
<view class="row-text" wx:else bindtap="uploadPhoto"> <view class="row-text" wx:else bindtap="uploadPhoto">
点击上传 点击上传
<image src="" class="row-img"></image>
</view> </view>
</view> </view>
<view class="row"> <view class="row">
@ -50,7 +49,7 @@
<view class="row" hidden="{{areaShowStatus}}"> <view class="row" hidden="{{areaShowStatus}}">
<view class="row-title">乡镇村:</view> <view class="row-title">乡镇村:</view>
<view class="row-text"> <view class="row-text">
<picker bindchange="countyChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}"> <picker bindchange="areaChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
<view class="picker"> <view class="picker">
{{teamAreaArray[teamAreaIndex]}} {{teamAreaArray[teamAreaIndex]}}
</view> </view>
@ -68,7 +67,7 @@
<view class="agree"> <view class="agree">
<checkbox-group bindchange="changeAgree"> <checkbox-group bindchange="changeAgree">
<label> <label>
<checkbox value="{{isAgree}}" checked="{{isAgree}}" color="#9F1512" class="agree-checkbox"/>我已阅读并同意<text class="agreement">《团队注册服务协议》</text> <checkbox value="{{isAgree}}" checked="{{isAgree}}" color="#9F1512" class="agree-checkbox"/>我已阅读并同意<text class="agreement" style="color: red;" data-type="team" bindtap="userAgree">《团队注册服务协议》</text>
</label> </label>
</checkbox-group> </checkbox-group>
</view> </view>

View File

@ -11,6 +11,8 @@
color: #242424; color: #242424;
font-size: 32rpx; font-size: 32rpx;
width: 24%; width: 24%;
display: flex;
align-items: center;
} }
.row-text{ .row-text{
width: 75%; width: 75%;
@ -73,4 +75,14 @@ label{
width: 77%; width: 77%;
font-size: 26rpx; font-size: 26rpx;
height: 55rpx; height: 55rpx;
}
.avatar{
height: 150rpx;
}
.avatar image{
width: 150rpx;
height: 150rpx;
}
.avatar-row{
height: 150rpx;
} }

View File

@ -20,7 +20,8 @@ Page({
introduce: '', // 活动介绍 introduce: '', // 活动介绍
voluntaryType: 1, // 类型 voluntaryType: 1, // 类型
tempFilePaths: '', // 宣传图片 tempFilePaths: '', // 宣传图片
photo: '', // 宣传图片 photo: '', // 用于页面显示的宣传图片链接
uploadPhoto: '', // 用于传到后台的宣传图片Id
serviceRequirement: '', // 服务要求 serviceRequirement: '', // 服务要求
}, },
getToken: function() { getToken: function() {
@ -99,7 +100,8 @@ Page({
var data = data.substr(9, data.length); var data = data.substr(9, data.length);
data = data.substr(0, data.length - 2); data = data.substr(0, data.length - 2);
self.setData({ self.setData({
photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data,
uploadPhoto: data
}) })
} }
}, function(code, data) { }, function(code, data) {
@ -172,7 +174,7 @@ Page({
introduce: self.data.introduce, introduce: self.data.introduce,
startTime: self.data.startDate, startTime: self.data.startDate,
endTime: self.data.endDate, endTime: self.data.endDate,
photo: self.data.photo, 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 + '/wxminiapp/volunteerservice/savevolunteerservice', []),

View File

@ -138,7 +138,7 @@ Page({
}, function(code, data) { }, function(code, data) {
if('200' == code) { if('200' == code) {
app.dialog.msg('注册成功!'); app.dialog.msg('注册成功!');
wx.navigateTo({ wx.redirectTo({
url: '../volunteer/volunteer', url: '../volunteer/volunteer',
}) })
} }
@ -167,7 +167,7 @@ Page({
}, function(code, data) { }, function(code, data) {
if('200' == code) { if('200' == code) {
app.dialog.msg('取消报名成功!'); app.dialog.msg('取消报名成功!');
wx.navigateTo({ wx.redirectTo({
url: '../volunteer/volunteer', url: '../volunteer/volunteer',
}) })
} }

View File

@ -0,0 +1,104 @@
// pages/userAgree/userAgree.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
agreeContent: '',
token: ''
},
getToken: function() {
var self = this;
return new Promise(resolve =>{
wx.getStorage({
key: 'token',
success(res) {
self.setData({
token: res.data
})
return resolve();
}
})
})
},
getUserAgree: function(type) {
var self = this;
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/agreecontent/getagreecontentbyid/' + type, []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
self.setData({
agreeContent: data.content
})
}
}, function(code, data) {
app.dialog.msg(data.msg)
}, function() {
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var type = options.type;
var self = this;
this.getToken().then(result => {
this.getUserAgree(type);
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,4 @@
<!--pages/userAgree/userAgree.wxml-->
<view>
<rich-text nodes="{{agreeContent}}"></rich-text>
</view>

View File

@ -0,0 +1 @@
/* pages/userAgree/userAgree.wxss */

View File

@ -122,6 +122,7 @@ Page({
} }
}, },
changeAgree: function (e) { changeAgree: function (e) {
console.log(e)
if(e.detail.value == ''){ if(e.detail.value == ''){
this.setData({ this.setData({
isAgree: false isAgree: false
@ -132,6 +133,12 @@ Page({
}) })
} }
}, },
userAgree: function(e) {
var type = e.currentTarget.dataset.type;
wx.navigateTo({
url: '../userAgree/userAgree?type=' + type,
})
},
/** /**
* 服务类别选择 * 服务类别选择
* @param {}} e * @param {}} e
@ -205,12 +212,15 @@ Page({
openExperience : self.data.openExperience openExperience : self.data.openExperience
}; };
var url; var url;
var requ;
if(!self.data.volunteerMsg) { if(!self.data.volunteerMsg) {
url = '/wxminiapp/volunteer/savevolunteer'; url = '/wxminiapp/volunteer/savevolunteer';
requ = app.restAjax.post;
}else { }else {
url = '/wxminiapp/volunteer/updatevolunteer/' + self.data.volunteerMsg.volunteerId; url = '/wxminiapp/volunteer/updatevolunteer/' + self.data.volunteerMsg.volunteerId;
requ = app.restAjax.put;
} }
app.restAjax.post(app.restAjax.path(app.volunteerUrl + url, []), requ(app.restAjax.path(app.volunteerUrl + url, []),
volunteerVO, { volunteerVO, {
headers: { headers: {
'token': self.data.token 'token': self.data.token
@ -280,6 +290,7 @@ Page({
} }
}, function(code, data) { }, function(code, data) {
if('200' == code) { if('200' == code) {
console.log(data)
self.setData({ self.setData({
volunteerMsg: data volunteerMsg: data
}) })

View File

@ -1,4 +1,5 @@
<view class="register"> <view class="register">
<view class="row" wx:if="{{volunteerMsg}}" style="color:red;margin-bottom:15rpx;">您已经是志愿者,可修改以下信息!</view>
<view class="row" style="height: auto"> <view class="row" style="height: auto">
<view class="info-name">公开经历:</view> <view class="info-name">公开经历:</view>
<view class="info-text" style="height: auto"> <view class="info-text" style="height: auto">
@ -77,9 +78,10 @@
<view class="is-agree"> <view class="is-agree">
<checkbox-group bindchange="changeAgree"> <checkbox-group bindchange="changeAgree">
<label class="checkbox"> <label class="checkbox">
<checkbox value="{{isAgree}}" checked="{{isAgree}}" />我已阅读并同意<text class="bargain">《志愿者注册服务协议》</text> <checkbox value="{{isAgree}}" checked="{{isAgree}}" />我已阅读并同意<text class="bargain" data-type="volunteer" bindtap="userAgree">《志愿者注册服务协议》</text>
</label> </label>
</checkbox-group> </checkbox-group>
</view> </view>
<view class="submit" bindtap="submitRegister">立即注册</view> <view class="submit" bindtap="submitRegister" wx:if="{{!volunteerMsg}}">立即注册</view>
<view class="submit" bindtap="submitRegister" wx:else>立即修改</view>
</view> </view>