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', []),
self.data.pages, null, function(code, data) {
if('200' == code) {
console.log(data.rows)
for(var item of data.rows) {
if('' != item.activityImage) {
item.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + item.activityImage;

View File

@ -54,13 +54,16 @@ Page({
onLoad: function (options) {
var self = this;
this.getToken().then(result => {
console.log(self.data.token)
var url;
var id = options.id;
if(!self.data.token) {
url = '/wxminiapp/activitylibrary/getactivitylibrarybyidrelease/' + id;
self.setData({
token: null
})
}else {
url = '/wxminiapp/activitylibrary/getactivitylibrarybyid/' + id
self.getToken()
}
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []),
{}, {
@ -73,6 +76,7 @@ Page({
self.setData({
dataMap: data
})
console.log(self.data.dataMap)
}
}, function() {

View File

@ -41,9 +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-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

@ -41,8 +41,8 @@ Page({
if('200' == code) {
}
}, function() {
}, function(code, data) {
app.dialog.msg(data.msg)
}, function() {
})
@ -68,7 +68,7 @@ Page({
userName: self.data.name,
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, {
headers: {
token: self.data.token
@ -76,7 +76,9 @@ Page({
}, function(code, data) {
console.log(data)
if('200' == code) {
wx.navigateTo({
url: '../activitySign/activitySign?id=' + self.data.activityId
})
}
}, function() {

View File

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

View File

@ -42,7 +42,7 @@
<view class="row">
<view class="row-title">验证码:</view>
<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>
</view>

View File

@ -120,126 +120,10 @@ Page({
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) {
this.isRandomName()
this.getToken()
},

View File

@ -1,20 +1,19 @@
// pages/cultureDetail/cultureDetail.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
libraryUrl: app.libraryUrl,
swiper: {
imgUrl: [
'../../images/culture-slide.png',
'../../images/culture-slide.png',
'../../images/culture-slide.png'
],
imgUrl: [],
indicatorDots: false,
autoplay: true,
current: 0
}
},
library: null
},
prevImg: function () {
var swiper = this.data.swiper;
@ -33,11 +32,31 @@ Page({
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) {
this.doGetLibrary(options.libraryId);
},
/**

View File

@ -12,55 +12,55 @@
</view>
</view>
<view class="culture">
<view class="culture-title">民间舞蹈</view>
<view class="culture-title">{{library.libraryTitle}}</view>
<view class="culture-info">
<view class="row">
<view class="info">
<text>项目编号:</text>
EKLAJNKAS09
{{library.libraryNumber}}
</view>
<view class="info">
<text>数据来源:</text>
EKLAJNKAS09
{{library.librarySource}}
</view>
</view>
<view class="row">
<view class="info">
<text>公布时间:</text>
2020-02-03
{{library.libraryOpenDateValue}}
</view>
<view class="info">
<text>非遗级别:</text>
{{library.libraryLevel}}
</view>
</view>
<view class="row">
<view class="info">
<text>所属地区:</text>
西藏林芝市
{{library.libraryArea}}
</view>
<view class="info">
<text>类  型:</text>
新增项目
{{library.libraryTypeValue}}
</view>
</view>
<view class="row">
<view class="info">
<text>申报地区或单位:</text>
测试
{{library.libraryAddress}}
</view>
</view>
<view class="row">
<view class="info">
<text>保护单位:</text>
测试
{{library.libraryAuthor}}
</view>
</view>
</view>
<view class="part">
<view class="part-title">相关描述</view>
<view class="part-content">
光拉便半运县写员二到院细天县见运命运感知争公着解全得律号深共权发市以家情军少先意单理样好族权达保很具你住红许气已第白知题候其然知王公众我头务族观经市指或七比生。适基历然题和低是局着先重信知议过说心龙素标安放大支入完二种设力果每角解收美约声里历美节办约管运但然新分活们心毛手过共点家或。革解快和特技县应精术被心走小器风育相条际北些有品同自群素革拉林积张严求选马打书。力问业光者最论快决装争每保时造何历入越日劳经干好东此金区法思设断这层压很决给地确思引光各年与队太习面方加族社种斗表越划快。
{{library.librarySummary}}
</view>
</view>
<view class="part">
@ -68,11 +68,11 @@
<view class="row">
<view class="info">
<text>编  号:</text>
EKLAJNKAS09
{{library.libraryNumber}}
</view>
<view class="info">
<text>姓  名:</text>
Ruby Pope
{{library.libraryAuthor}}
</view>
</view>
<view class="row">
@ -93,6 +93,3 @@
</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
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
libraryUrl: app.libraryUrl,
libraryList: [],
currentPage: 1,
rows: 20
},
goDetail: function () {
goDetail: function (event) {
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) {
this.doGetLibraryList(1);
},
/**
@ -51,14 +86,14 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.doGetLibraryList(1);
},
/**
* 页面上拉触底事件的处理函数
*/
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="select-box active">
<image src="../../images/select-tab.png"></image>
<view class="select-title">非遗数据库</view>
<view class="select-title">非物质文化数据库</view>
</view>
<view class="select-box">
<image src="../../images/select-tab.png"></image>
<view class="select-title">非遗数据库</view>
<view class="select-title">文化直播</view>
</view>
<view class="select-box">
<image src="../../images/select-tab.png"></image>
<view class="select-title">非遗数据库</view>
<view class="select-title">文化分享</view>
</view>
</view>
<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">
<image src="../../images/big-news.png"></image>
<image src="{{libraryUrl}}/route/file/downloadfile/true/{{item.libraryCover}}"></image>
</view>
<view class="activity-info">
<view class="title">
<view class="activity-title">银保监会印发《关于加快推进意外险改…</view>
<view class="activity-title">{{item.libraryTitle}}</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 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 class="date">{{item.libraryApplyTime}}</view>
</view>
</view>
</view>

View File

@ -4,6 +4,11 @@ Page({
* 页面的初始数据
*/
data: {
randomName: '',
showPhone: true,
gotCode: false,
restTime: 10,
timer: '',
indicatorDots: true,
autoplay: true,
token: '',
@ -26,7 +31,8 @@ Page({
live: {
liveUrl: app.liveUrl,
liveList: []
}
},
usercenterUrl: app.usercenterUrl
},
doLogin: function () {
var self = this;
@ -59,6 +65,9 @@ Page({
page: 1,
rows: 5
}, null, function(code, data) {
for(var i = 0, item; item = data.rows[i++];) {
item.cover = item.libraryCover.split(',')[0];
}
self.setData({
'library.bannerLibrary': data.rows
});
@ -118,6 +127,11 @@ Page({
app.dialog.msg(data.msg);
});
},
goCultureDetail: function(event) {
wx.navigateTo({
url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId,
})
},
goNewsDetail: function (event) {
wx.navigateTo({
url: '../newsDetail/newsDetail?templateRecordUrl='+ event.currentTarget.dataset.templateRecordUrl,
@ -158,6 +172,130 @@ Page({
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.doGetVenueList();
self.doGetActivityList();
self.isRandomName();
},
/**

View File

@ -1,7 +1,7 @@
<view class="swiper-box">
<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">
<image src="{{library.libraryUrl}}/route/file/downloadfile/true/{{item.libraryCover}}" class="swiper-img"></image>
<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.cover}}" class="swiper-img"></image>
</swiper-item>
</swiper>
</view>
@ -125,4 +125,20 @@
<view class="broadcast-status" wx:else>错误</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 File

@ -156,4 +156,83 @@
color: #fff;
font-size: 26rpx;
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, // 是否同意志愿者注册协议
index: 0,
array: ['区域1','区域2','区域3','区域4'],
photo: '',
photo: '', // 用于页面显示的photo链接
uploadPhoto: '', // 用于传到后台的photoId
teamName: '',
count:'',
teamWatchword: '',
@ -74,7 +75,8 @@ Page({
var data = data.substr(9, data.length);
data = data.substr(0, data.length - 2);
self.setData({
photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data
photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data,
uploadPhoto: 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) {
if(e.detail.value == ''){
this.setData({
@ -162,7 +176,7 @@ Page({
return false;
}
var teamVO = {
photo: self.data.photo,
photo: self.data.uploadPhoto,
teamName: self.data.teamName,
count:self.data.count,
teamWatchword: self.data.teamWatchword,

View File

@ -1,12 +1,11 @@
<view class="new-team">
<view class="row img-row">
<view class="row img-row avatar-row">
<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>
</view>
<view class="row-text" wx:else bindtap="uploadPhoto">
点击上传
<image src="" class="row-img"></image>
</view>
</view>
<view class="row">
@ -50,7 +49,7 @@
<view class="row" hidden="{{areaShowStatus}}">
<view class="row-title">乡镇村:</view>
<view class="row-text">
<picker bindchange="countyChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
<picker bindchange="areaChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
<view class="picker">
{{teamAreaArray[teamAreaIndex]}}
</view>
@ -68,7 +67,7 @@
<view class="agree">
<checkbox-group bindchange="changeAgree">
<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>
</checkbox-group>
</view>

View File

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

View File

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

View File

@ -138,7 +138,7 @@ Page({
}, function(code, data) {
if('200' == code) {
app.dialog.msg('注册成功!');
wx.navigateTo({
wx.redirectTo({
url: '../volunteer/volunteer',
})
}
@ -167,7 +167,7 @@ Page({
}, function(code, data) {
if('200' == code) {
app.dialog.msg('取消报名成功!');
wx.navigateTo({
wx.redirectTo({
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) {
console.log(e)
if(e.detail.value == ''){
this.setData({
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
@ -205,12 +212,15 @@ Page({
openExperience : self.data.openExperience
};
var url;
var requ;
if(!self.data.volunteerMsg) {
url = '/wxminiapp/volunteer/savevolunteer';
requ = app.restAjax.post;
}else {
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, {
headers: {
'token': self.data.token
@ -280,6 +290,7 @@ Page({
}
}, function(code, data) {
if('200' == code) {
console.log(data)
self.setData({
volunteerMsg: data
})

View File

@ -1,4 +1,5 @@
<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">
@ -77,9 +78,10 @@
<view class="is-agree">
<checkbox-group bindchange="changeAgree">
<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>
</checkbox-group>
</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>