Merge branch 'master' of https://github.com/wanggeng888/xz_mini
This commit is contained in:
commit
92417388f2
5
app.js
5
app.js
@ -3,12 +3,13 @@ var restAjax = require('utils/restAjax.js');
|
|||||||
var dialog = require('utils/dialog.js');
|
var dialog = require('utils/dialog.js');
|
||||||
App({
|
App({
|
||||||
loginUrl: 'http://192.168.0.113:7001/usercenter',
|
loginUrl: 'http://192.168.0.113:7001/usercenter',
|
||||||
usercenterUrl: 'http://192.168.0.113:7001/usesrcenter',
|
usercenterUrl: 'http://192.168.0.113:7001/usercenter',
|
||||||
newsUrl: 'http://192.168.0.113:8082/news',
|
newsUrl: 'http://192.168.0.113:8082/news',
|
||||||
libraryUrl: 'http://192.168.0.113:8081/library',
|
libraryUrl: 'http://192.168.0.113:8081/library',
|
||||||
|
venueUrl: 'http://192.168.0.109:8082/venuebooking',
|
||||||
activityUrl: 'http://192.168.0.111:8080/culturalactivity/',
|
activityUrl: 'http://192.168.0.111:8080/culturalactivity/',
|
||||||
volunteerUrl: 'http://192.168.0.111:8888/volunteer/',
|
volunteerUrl: 'http://192.168.0.111:8888/volunteer/',
|
||||||
venueUrl: '',
|
|
||||||
restAjax: restAjax,
|
restAjax: restAjax,
|
||||||
dialog: dialog,
|
dialog: dialog,
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
|
9
app.json
9
app.json
@ -1,7 +1,9 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
"pages/center/center",
|
|
||||||
"pages/index/index",
|
"pages/index/index",
|
||||||
|
"pages/activityDialog/activityDialog",
|
||||||
|
"pages/teamDetail/teamDetail",
|
||||||
|
"pages/center/center",
|
||||||
"pages/volunteerRegister/volunteerRegister",
|
"pages/volunteerRegister/volunteerRegister",
|
||||||
"pages/volunteer/volunteer",
|
"pages/volunteer/volunteer",
|
||||||
"pages/heritage/heritage",
|
"pages/heritage/heritage",
|
||||||
@ -64,6 +66,11 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"permission": {
|
||||||
|
"scope.userLocation": {
|
||||||
|
"desc": "你的位置信息将用于您当前所在位置"
|
||||||
|
}
|
||||||
|
},
|
||||||
"style": "v2",
|
"style": "v2",
|
||||||
"sitemapLocation": "sitemap.json"
|
"sitemapLocation": "sitemap.json"
|
||||||
}
|
}
|
BIN
images/delete.png
Normal file
BIN
images/delete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 497 B |
66
pages/activityDialog/activityDialog.js
Normal file
66
pages/activityDialog/activityDialog.js
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// pages/activityDialog/activityDialog.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
3
pages/activityDialog/activityDialog.json
Normal file
3
pages/activityDialog/activityDialog.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
32
pages/activityDialog/activityDialog.wxml
Normal file
32
pages/activityDialog/activityDialog.wxml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<view class="dialog">
|
||||||
|
<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">
|
||||||
|
<image src="../../images/delete.png"></image>
|
||||||
|
</view>
|
||||||
|
</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">
|
||||||
|
<image src="../../images/delete.png"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
42
pages/activityDialog/activityDialog.wxss
Normal file
42
pages/activityDialog/activityDialog.wxss
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
.dialog{
|
||||||
|
padding: 30rpx;
|
||||||
|
}
|
||||||
|
.dialog-box{
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.avatar{
|
||||||
|
width: 15%;
|
||||||
|
}
|
||||||
|
.avatar image{
|
||||||
|
width: 100%;
|
||||||
|
height: 90rpx;
|
||||||
|
}
|
||||||
|
.user-info{
|
||||||
|
width: 83%;
|
||||||
|
border-bottom: 1px solid #DEDEDE;
|
||||||
|
padding-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
.name{
|
||||||
|
font-size: 34rpx;
|
||||||
|
color: #949494;
|
||||||
|
margin: 15rpx 0;
|
||||||
|
}
|
||||||
|
.content{
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #000;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
}
|
||||||
|
.public-time{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.time{
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #949494;
|
||||||
|
}
|
||||||
|
.delete, .delete image{
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
@ -7,8 +7,19 @@ Page({
|
|||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
userAvatar: '',
|
userAvatar: '',
|
||||||
token: ''
|
token: '',
|
||||||
|
userInfo: {},
|
||||||
|
usercenterUrl: app.usercenterUrl,
|
||||||
|
sourcePath: '/route/file/downloadfile/true/',
|
||||||
|
randomName: '',
|
||||||
|
showPhone: true,
|
||||||
|
phone: '',
|
||||||
|
code: '',
|
||||||
|
gotCode: false,
|
||||||
|
restTime: 120,
|
||||||
|
timer: ''
|
||||||
},
|
},
|
||||||
|
// 选择头像来源
|
||||||
changeAvatar: function () {
|
changeAvatar: function () {
|
||||||
var self = this
|
var self = this
|
||||||
wx.showActionSheet({
|
wx.showActionSheet({
|
||||||
@ -24,6 +35,7 @@ Page({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 选择图片
|
||||||
chooseAvatar: function (type) {
|
chooseAvatar: function (type) {
|
||||||
var self = this
|
var self = this
|
||||||
wx.chooseImage({
|
wx.chooseImage({
|
||||||
@ -32,16 +44,13 @@ Page({
|
|||||||
sourceType: [type],
|
sourceType: [type],
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
var avatar = res.tempFilePaths[0];
|
var avatar = res.tempFilePaths[0];
|
||||||
console.log(avatar)
|
app.restAjax.file(app.restAjax.path('{usercenterUrl}/app/file/uploadimage', [app.usercenterUrl]), avatar, 'image', {
|
||||||
app.restAjax.post(app.restAjax.path('{usercenterUrl}/app/file/uploadimage', [app.usercenterUrl]), {
|
|
||||||
image: avatar
|
|
||||||
}, {
|
|
||||||
headers: {
|
headers: {
|
||||||
token: self.data.token
|
token: self.data.token
|
||||||
}
|
}
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
console.log(data);
|
var id = JSON.parse(data).data
|
||||||
|
self.uploadAvatar(id)
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
})
|
})
|
||||||
@ -51,6 +60,38 @@ Page({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 上传
|
||||||
|
uploadAvatar: function (avatarId) {
|
||||||
|
var self = this
|
||||||
|
app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateuseravatar', [app.usercenterUrl]), {
|
||||||
|
avatar: avatarId
|
||||||
|
}, {
|
||||||
|
headers: {
|
||||||
|
token: self.data.token
|
||||||
|
}
|
||||||
|
}, function (code, data) {
|
||||||
|
wx.setStorageSync('token', data.data);
|
||||||
|
self.getUserInfo()
|
||||||
|
}, function (code, data) {
|
||||||
|
console.log(data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取用户信息
|
||||||
|
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)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取token
|
||||||
getToken: function () {
|
getToken: function () {
|
||||||
var self = this
|
var self = this
|
||||||
wx.getStorage({
|
wx.getStorage({
|
||||||
@ -59,6 +100,7 @@ Page({
|
|||||||
self.setData({
|
self.setData({
|
||||||
token: res.data
|
token: res.data
|
||||||
})
|
})
|
||||||
|
self.getUserInfo()
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -78,11 +120,126 @@ 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()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="page-container">
|
<view class="page-container">
|
||||||
<view class="person">
|
<view class="person">
|
||||||
<view class="user-avatar" bindtap="changeAvatar">
|
<view class="user-avatar" bindtap="changeAvatar" wx:if="{{userInfo.avatar}}">
|
||||||
<image src="{{userAvatar}}"></image>
|
<image src="{{usercenterUrl}}{{sourcePath}}{{userInfo.avatar}}"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="user-name">杜若无心</view>
|
<view class="user-name">{{userInfo.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="main">
|
<view class="main">
|
||||||
<view class="main-title">常用功能</view>
|
<view class="main-title">常用功能</view>
|
||||||
@ -42,3 +42,20 @@
|
|||||||
</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 class="set-phone-btn" bindtap="cancelPhone">取消</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
@ -64,3 +64,82 @@
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #242424;
|
color: #242424;
|
||||||
}
|
}
|
||||||
|
.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: 49%;
|
||||||
|
height: 65rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #fff;
|
||||||
|
background: #9F1512;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
66
pages/teamDetail/teamDetail.js
Normal file
66
pages/teamDetail/teamDetail.js
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// pages/teamDetail/teamDetail.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
3
pages/teamDetail/teamDetail.json
Normal file
3
pages/teamDetail/teamDetail.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
68
pages/teamDetail/teamDetail.wxml
Normal file
68
pages/teamDetail/teamDetail.wxml
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<view class="team">
|
||||||
|
<view class="team-info">
|
||||||
|
<view class="row">
|
||||||
|
<view class="title">团队名称:</view>
|
||||||
|
<view class="content">团队名称</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="title">团队人数:</view>
|
||||||
|
<view class="content">1</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="title">所属区域:</view>
|
||||||
|
<view class="content">所属区域</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="title">团队介绍:</view>
|
||||||
|
<view class="content intro">团队介绍</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="team-member">
|
||||||
|
<view class="member-title">团队成员</view>
|
||||||
|
<view class="member-box">
|
||||||
|
<view class="member-avatar">
|
||||||
|
<image src="../../images/avatar.png"></image>
|
||||||
|
</view>
|
||||||
|
<view class="member-info">
|
||||||
|
<view class="name">名字<text class="post">队长</text></view>
|
||||||
|
<view class="join-time">加入时间:2020-02-02</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="member-box">
|
||||||
|
<view class="member-avatar">
|
||||||
|
<image src="../../images/avatar.png"></image>
|
||||||
|
</view>
|
||||||
|
<view class="member-info">
|
||||||
|
<view class="name">名字<text class="post">队长</text></view>
|
||||||
|
<view class="join-time">加入时间:2020-02-02</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="member-box">
|
||||||
|
<view class="member-avatar">
|
||||||
|
<image src="../../images/avatar.png"></image>
|
||||||
|
</view>
|
||||||
|
<view class="member-info">
|
||||||
|
<view class="name">名字<text class="post">队长</text></view>
|
||||||
|
<view class="join-time">加入时间:2020-02-02</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="team-member">
|
||||||
|
<view class="member-title">申请人员</view>
|
||||||
|
<view class="member-box">
|
||||||
|
<view class="member-avatar">
|
||||||
|
<image src="../../images/avatar.png"></image>
|
||||||
|
</view>
|
||||||
|
<view class="member-info">
|
||||||
|
<view class="name apply-member">
|
||||||
|
<view class="name-box">名字</view>
|
||||||
|
<view class="btn">
|
||||||
|
<view class="agree">通过</view>
|
||||||
|
<view class="refuse">拒绝</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="join-time">加入时间:2020-02-02</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
83
pages/teamDetail/teamDetail.wxss
Normal file
83
pages/teamDetail/teamDetail.wxss
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
.team{
|
||||||
|
padding: 30rpx;
|
||||||
|
}
|
||||||
|
.team-info{
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
.row{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
width: 23%;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 65rpx;
|
||||||
|
}
|
||||||
|
.content{
|
||||||
|
width: 75%;
|
||||||
|
line-height: 65rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
border-bottom: 1px solid #DEDEDE;
|
||||||
|
}
|
||||||
|
.intro{
|
||||||
|
min-height: 200rpx;
|
||||||
|
}
|
||||||
|
.team-member{
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
.member-title{
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #000;
|
||||||
|
padding-left: 25rpx;
|
||||||
|
border-left: 10rpx solid #9F1512;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
.member-box{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 10rpx 0;
|
||||||
|
border-bottom: 1px solid #DEDEDE;
|
||||||
|
}
|
||||||
|
.member-avatar{
|
||||||
|
width: 15%;
|
||||||
|
}
|
||||||
|
.member-avatar image{
|
||||||
|
width: 100%;
|
||||||
|
height: 90rpx;
|
||||||
|
}
|
||||||
|
.member-info{
|
||||||
|
width: 83%;
|
||||||
|
}
|
||||||
|
.name{
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
|
.post{
|
||||||
|
display: inline-block;
|
||||||
|
background: rgba(159,21,18,.1);
|
||||||
|
color: #9F1512;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
margin-left: 15rpx;
|
||||||
|
}
|
||||||
|
.join-time{
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #949494;
|
||||||
|
}
|
||||||
|
.apply-member, .btn{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.agree, .refuse{
|
||||||
|
padding: 0 10rpx;
|
||||||
|
background: rgba(159,21,18,.1);
|
||||||
|
color: #9F1512;
|
||||||
|
}
|
||||||
|
.refuse{
|
||||||
|
margin-left: 15rpx;
|
||||||
|
}
|
||||||
|
.name-box{
|
||||||
|
width: 60%;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
var app = getApp();
|
||||||
// pages/venue/venue.js
|
// pages/venue/venue.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@ -5,8 +6,8 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
baseUrl : 'http://192.168.0.109:8082/venuebooking/',
|
venueUrl : app.venueUrl,
|
||||||
imgRoute : 'route/file/downloadfile/true/',
|
imgRoute : '/route/file/downloadfile/true/',
|
||||||
venueTypeParentId : 'df8b758c-f6d8-465a-9aa8-c451fde47076',
|
venueTypeParentId : 'df8b758c-f6d8-465a-9aa8-c451fde47076',
|
||||||
page : '1',
|
page : '1',
|
||||||
rows : '10',
|
rows : '10',
|
||||||
@ -38,23 +39,23 @@ Page({
|
|||||||
//获取场馆分类
|
//获取场馆分类
|
||||||
listVenueType : function(){
|
listVenueType : function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.request({
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuedictionary/listvenuedictionarybyparentidrelease/{venueTypeParentId}',
|
||||||
url: self.data.baseUrl + 'app/venuedictionary/listvenuedictionarybyparentidrelease/' + self.data.venueTypeParentId,
|
[app.venueUrl, self.data.venueTypeParentId]), {}, null,
|
||||||
success : function(res){
|
function(code,data){
|
||||||
var data = res.data;
|
|
||||||
self.setData({
|
self.setData({
|
||||||
venueTypeList : data.data
|
venueTypeList: data.data
|
||||||
})
|
});
|
||||||
|
},function(code, data){
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取场馆列表
|
//获取场馆列表
|
||||||
listPageVenuesInfo : function(){
|
listPageVenuesInfo : function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.request({
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease', [app.venueUrl]),
|
||||||
url: self.data.baseUrl + 'app/venuesinfo/listpagevenuesinforelease',
|
{
|
||||||
data : {
|
|
||||||
page : self.data.page,
|
page : self.data.page,
|
||||||
rows : self.data.rows,
|
rows : self.data.rows,
|
||||||
orderKey : self.data.orderKey,
|
orderKey : self.data.orderKey,
|
||||||
@ -62,9 +63,8 @@ Page({
|
|||||||
latitude: self.data.latitude,
|
latitude: self.data.latitude,
|
||||||
longitude: self.data.longitude,
|
longitude: self.data.longitude,
|
||||||
selfLocation: 'TX',
|
selfLocation: 'TX',
|
||||||
},
|
}, null,
|
||||||
success : function(res){
|
function(code, data){
|
||||||
var data = res.data;
|
|
||||||
data.rows.forEach(element => {
|
data.rows.forEach(element => {
|
||||||
element.venuePanorama = element.venuePanorama.split(',')[0];
|
element.venuePanorama = element.venuePanorama.split(',')[0];
|
||||||
if(element.apart >= 1000){
|
if(element.apart >= 1000){
|
||||||
@ -76,10 +76,14 @@ Page({
|
|||||||
self.setData({
|
self.setData({
|
||||||
venuesList : data.rows,
|
venuesList : data.rows,
|
||||||
page : data.page
|
page : data.page
|
||||||
})
|
});
|
||||||
|
}, function(code,data){
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
|
},function(){
|
||||||
|
wx.hideNavigationBarLoading();
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
//切换场馆类型
|
//切换场馆类型
|
||||||
@ -97,7 +101,6 @@ Page({
|
|||||||
//切换场馆排序
|
//切换场馆排序
|
||||||
changeVenuesOrderBy: function(options){
|
changeVenuesOrderBy: function(options){
|
||||||
var beCheck = options.currentTarget.dataset.becheck;
|
var beCheck = options.currentTarget.dataset.becheck;
|
||||||
console.log(options);
|
|
||||||
this.setData({
|
this.setData({
|
||||||
orderKey : beCheck
|
orderKey : beCheck
|
||||||
})
|
})
|
||||||
@ -158,10 +161,6 @@ Page({
|
|||||||
orderKey: '',
|
orderKey: '',
|
||||||
})
|
})
|
||||||
this.onLoad();
|
this.onLoad();
|
||||||
setTimeout(() => {
|
|
||||||
wx.hideNavigationBarLoading()
|
|
||||||
wx.stopPullDownRefresh()
|
|
||||||
}, 500);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<view class="fixed-top">
|
<view class="fixed-top">
|
||||||
<view class="fixed-tab">
|
<view class="fixed-tab">
|
||||||
<view class="tab-box {{item.dictionaryId == venueType ? 'active' : ''}}" wx:for="{{venueTypeList}}" bindtap="changeVenueType" data-id="{{item.dictionaryId}}">
|
<view class="tab-box {{item.dictionaryId == venueType ? 'active' : ''}}" wx:for="{{venueTypeList}}" wx:key="index" bindtap="changeVenueType" data-id="{{item.dictionaryId}}">
|
||||||
<image src="{{baseUrl}}{{imgRoute}}{{item.dictionaryIcon}}"></image>
|
<image src="{{venueUrl}}{{imgRoute}}{{item.dictionaryIcon}}"></image>
|
||||||
<view class="tab-title">{{item.dictionaryName}}</view>
|
<view class="tab-title">{{item.dictionaryName}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -18,9 +18,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="venue">
|
<view class="venue">
|
||||||
<view class="venue-box" wx:for="{{venuesList}}" bindtap="goDetail" data-id="{{item.venuesInfoId}}">
|
<view class="venue-box" wx:for="{{venuesList}}" wx:key="index" bindtap="goDetail" data-id="{{item.venuesInfoId}}">
|
||||||
<view class="venue-img">
|
<view class="venue-img">
|
||||||
<image src="{{baseUrl}}{{imgRoute}}{{item.venuePanorama}}"></image>
|
<image src="{{venueUrl}}{{imgRoute}}{{item.venuePanorama}}"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="venue-info">
|
<view class="venue-info">
|
||||||
<view class="name-distance">
|
<view class="name-distance">
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
|
background: #fff;
|
||||||
}
|
}
|
||||||
.fixed-tab{
|
.fixed-tab{
|
||||||
padding: 30rpx 0;
|
padding: 30rpx 0;
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
|
var app = getApp();
|
||||||
// pages/venueDetail/venueDetail.js
|
// pages/venueDetail/venueDetail.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
baseUrl: 'http://192.168.0.109:8082/venuebooking/',
|
venueUrl: app.venueUrl,
|
||||||
imgRoute : 'route/file/downloadfile/true/',
|
imgRoute : '/route/file/downloadfile/true/',
|
||||||
indicatorDots: true,
|
indicatorDots: true,
|
||||||
autoplay: true,
|
autoplay: true,
|
||||||
|
|
||||||
venuesInfoId: '',
|
venuesInfoId: '',
|
||||||
venuesDetail:{},
|
venuesDetail:{},
|
||||||
venuesProjectList: [],
|
venuesProjectList: [],
|
||||||
@ -22,37 +21,35 @@ Page({
|
|||||||
//场馆详情接口
|
//场馆详情接口
|
||||||
getVenuesDetail: function(){
|
getVenuesDetail: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.request({
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/getvenuesinfobyidrelease/{venuesInfoId}',[app.venueUrl, self.data.venuesInfoId]),
|
||||||
url: self.data.baseUrl + 'app/venuesinfo/getvenuesinfobyidrelease/' + self.data.venuesInfoId,
|
{
|
||||||
data: {
|
|
||||||
resultLocation: 'TX'
|
resultLocation: 'TX'
|
||||||
},
|
}, null, function(code, data){
|
||||||
success:(res) => {
|
var swiperImg = data.venuePanorama.split(',');
|
||||||
var swiperImg = res.data.venuePanorama.split(',');
|
|
||||||
if(swiperImg.length <= 1){
|
if(swiperImg.length <= 1){
|
||||||
self.setData({
|
self.setData({
|
||||||
indicatorDots: false,
|
indicatorDots: false,
|
||||||
autoplay: false
|
autoplay: false
|
||||||
})
|
})
|
||||||
}
|
};
|
||||||
self.setData({
|
self.setData({
|
||||||
venuesDetail: res.data,
|
venuesDetail: data,
|
||||||
swiperImg: swiperImg,
|
swiperImg: swiperImg,
|
||||||
venueCharge: res.data.venueCharge
|
venueCharge: data.venueCharge
|
||||||
});
|
});
|
||||||
console.log(self.data.venuesDetail);
|
}, function(code,data){
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取项目列表
|
//获取项目列表
|
||||||
listVenuesProject: function(){
|
listVenuesProject: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.request({
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesproject/listprojectinforelease/{venuesInfoId}', [app.venueUrl, self.data.venuesInfoId]), {}, null ,
|
||||||
url: self.data.baseUrl + 'app/venuesproject/listprojectinforelease/' + self.data.venuesInfoId,
|
function(code,data){
|
||||||
success: (res) => {
|
|
||||||
self.setData({
|
self.setData({
|
||||||
venuesProjectList: res.data
|
venuesProjectList: data
|
||||||
});
|
});
|
||||||
if(self.data.venuesProjectList.length > 0){
|
if(self.data.venuesProjectList.length > 0){
|
||||||
self.setData({
|
self.setData({
|
||||||
@ -60,8 +57,10 @@ Page({
|
|||||||
});
|
});
|
||||||
self.getVenuesProjectDetail();
|
self.getVenuesProjectDetail();
|
||||||
};
|
};
|
||||||
|
}, function(code, data){
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
//切换当前选择项目
|
//切换当前选择项目
|
||||||
@ -79,21 +78,22 @@ Page({
|
|||||||
//获取项目详情信息
|
//获取项目详情信息
|
||||||
getVenuesProjectDetail: function(){
|
getVenuesProjectDetail: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
wx.request({
|
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesproject/getvenuesprojectdetailrelease/{selectVenuesProject}',
|
||||||
url: self.data.baseUrl + 'app/venuesproject/getvenuesprojectdetailrelease/' + self.data.selectVenuesProject,
|
[app.venueUrl, self.data.selectVenuesProject]), {}, null,
|
||||||
success: function(res){
|
function(code,data){
|
||||||
|
console.log(data);
|
||||||
self.setData({
|
self.setData({
|
||||||
selectVenuesProjectDetail: res.data.data
|
selectVenuesProjectDetail: data.data
|
||||||
});
|
});
|
||||||
|
}, function(code,data){
|
||||||
|
app.dialog.msg(data.msg);
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
//场馆地图导航
|
//场馆地图导航
|
||||||
showMap: function(options){
|
showMap: function(options){
|
||||||
console.log(options);
|
|
||||||
var dataObj = options.currentTarget.dataset
|
var dataObj = options.currentTarget.dataset
|
||||||
console.log(dataObj.latitude + 0)
|
|
||||||
wx.openLocation({//使用微信内置地图查看位置。
|
wx.openLocation({//使用微信内置地图查看位置。
|
||||||
latitude: Number(dataObj.latitude),//要去的纬度-地址
|
latitude: Number(dataObj.latitude),//要去的纬度-地址
|
||||||
longitude: Number(dataObj.longitude),//要去的经度-地址
|
longitude: Number(dataObj.longitude),//要去的经度-地址
|
||||||
|
@ -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="{{swiperImg}}">
|
<swiper-item class="swiper-item" wx:for="{{swiperImg}}" wx:key="index">
|
||||||
<image src="{{baseUrl}}{{imgRoute}}{{item}}"></image>
|
<image src="{{venueUrl}}{{imgRoute}}{{item}}"></image>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<view wx:if="{{venuesProjectList.length > 0}}">
|
<view wx:if="{{venuesProjectList.length > 0}}">
|
||||||
<view class="selecet-tab">
|
<view class="selecet-tab">
|
||||||
<view class="tab-btn {{selectVenuesProject == item.venuesProjectId ? 'active' : ''}}"
|
<view class="tab-btn {{selectVenuesProject == item.venuesProjectId ? 'active' : ''}}"
|
||||||
wx:for="{{venuesProjectList}}" bindtap="changeVenuesProject" data-id="{{item.venuesProjectId}}">{{item.projectName}}</view>
|
wx:for="{{venuesProjectList}}" wx:key="index" bindtap="changeVenuesProject" data-id="{{item.venuesProjectId}}">{{item.projectName}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tab-info">
|
<view class="tab-info">
|
||||||
<view class="tab-content">
|
<view class="tab-content">
|
||||||
|
Loading…
Reference in New Issue
Block a user