This commit is contained in:
dong_bo0602 2022-06-14 10:56:41 +08:00
commit 4458f60375
119 changed files with 5392 additions and 0 deletions

41
app.js Normal file
View File

@ -0,0 +1,41 @@
//app.js
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
}
})
},
globalData: {
userInfo: null,
requestIp: 'https://www.tenlion.cn/venuebooking/'
// requestIp: 'http://192.168.0.109:8082/venuebooking/'
}
})

65
app.json Normal file
View File

@ -0,0 +1,65 @@
{
"pages":[
"pages/home/home",
"pages/venueIntro/venueIntro",
"pages/around/around",
"pages/activity/activity",
"pages/center/center",
"pages/index/index",
"pages/list/list",
"pages/detail/detail",
"pages/book/book",
"pages/order/order",
"pages/exerciseNews/exerciseNews",
"pages/matchList/matchList",
"pages/newsDetail/newsDetail",
"pages/sportNews/sportNews",
"pages/matchDetail/matchDetail",
"pages/venueRegister/venueRegister",
"pages/map/map"
],
"window":{
"backgroundTextStyle":"dark",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "包头市全民健身信息服务平台",
"navigationBarTextStyle":"black",
"enablePullDownRefresh":true
},
"tabBar": {
"color": "#BBBBBB",
"borderStyle": "black",
"selectedColor": "#000000",
"list": [
{
"pagePath": "pages/home/home",
"iconPath": "images/home.png",
"text": "首页",
"selectedIconPath": "images/home-on.png"
},
{
"pagePath": "pages/around/around",
"iconPath": "images/map.png",
"text": "健身地图",
"selectedIconPath": "images/map-on.png"
},
{
"pagePath": "pages/center/center",
"iconPath": "images/center.png",
"text": "我的",
"selectedIconPath": "images/center-on.png"
}
]
},
"sitemapLocation": "sitemap.json",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"plugins": {
"htmltowxml": {
"version": "1.4.0",
"provider": "wxa51b9c855ae38f3c"
}
}
}

9
app.wxss Normal file
View File

@ -0,0 +1,9 @@
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}

BIN
images/activity.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
images/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
images/address.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

BIN
images/center-on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/center.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/competition.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
images/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/go.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

BIN
images/home-on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
images/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/link-bg1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/link-bg2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/link-bg3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
images/link-bg4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/location.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
images/map-on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
images/map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
images/marker_red.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

BIN
images/marker_yellow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
images/match.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
images/no-data.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
images/order-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 941 B

BIN
images/order.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

BIN
images/phone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/race.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
images/register-address.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/register-avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
images/register-name.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/register-phone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
images/register.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

BIN
images/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

BIN
images/search1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
images/search2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
images/search3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
images/search4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
images/search5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
images/search6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
images/star-r.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

BIN
images/star.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

BIN
images/title-bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

BIN
images/upload.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

BIN
images/venue.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

452
lib/bmap-wx.js Normal file
View File

@ -0,0 +1,452 @@
/**
* @file 微信小程序JSAPI
* @author 崔健 cuijian03@baidu.com 2017.01.10
* @update 邓淑芳 623996689@qq.com 2019.07.03
*/
/**
* 百度地图微信小程序API类
*
* @class
*/
class BMapWX {
/**
* 百度地图微信小程序API类
*
* @constructor
*/
constructor(param) {
this.ak = param["ak"];
}
/**
* 使用微信接口进行定位
*
* @param {string} type 坐标类型
* @param {Function} success 成功执行
* @param {Function} fail 失败执行
* @param {Function} complete 完成后执行
*/
getWXLocation(type, success, fail, complete) {
type = type || 'gcj02',
success = success || function () { };
fail = fail || function () { };
complete = complete || function () { };
wx.getLocation({
type: type,
success: success,
fail: fail,
complete: complete
});
}
/**
* POI周边检索
*
* @param {Object} param 检索配置
* 参数对象结构可以参考
* http://lbsyun.baidu.com/index.php?title=webapi/guide/webservice-placeapi
*/
search(param) {
var that = this;
param = param || {};
let searchparam = {
query: param["query"] || '生活服务$美食&酒店',
scope: param["scope"] || 1,
filter: param["filter"] || '',
coord_type: param["coord_type"] || 2,
page_size: param["page_size"] || 10,
page_num: param["page_num"] || 0,
output: param["output"] || 'json',
ak: that.ak,
sn: param["sn"] || '',
timestamp: param["timestamp"] || '',
radius: param["radius"] || 2000,
ret_coordtype: 'gcj02ll'
};
let otherparam = {
iconPath: param["iconPath"],
iconTapPath: param["iconTapPath"],
width: param["width"],
height: param["height"],
alpha: param["alpha"] || 1,
success: param["success"] || function () { },
fail: param["fail"] || function () { }
};
let type = 'gcj02';
let locationsuccess = function (result) {
searchparam["location"] = result["latitude"] + ',' + result["longitude"];
wx.request({
url: 'https://api.map.baidu.com/place/v2/search',
data: searchparam,
header: {
"content-type": "application/json"
},
method: 'GET',
success(data) {
let res = data["data"];
if (res["status"] === 0) {
let poiArr = res["results"];
// outputRes 包含两个对象,
// originalData为百度接口返回的原始数据
// wxMarkerData为小程序规范的marker格式
let outputRes = {};
outputRes["originalData"] = res;
outputRes["wxMarkerData"] = [];
for (let i = 0; i < poiArr.length; i++) {
outputRes["wxMarkerData"][i] = {
id: i,
latitude: poiArr[i]["location"]["lat"],
longitude: poiArr[i]["location"]["lng"],
title: poiArr[i]["name"],
iconPath: otherparam["iconPath"],
iconTapPath: otherparam["iconTapPath"],
address: poiArr[i]["address"],
telephone: poiArr[i]["telephone"],
alpha: otherparam["alpha"],
width: otherparam["width"],
height: otherparam["height"]
}
}
otherparam.success(outputRes);
} else {
otherparam.fail({
errMsg: res["message"],
statusCode: res["status"]
});
}
},
fail(data) {
otherparam.fail(data);
}
});
}
let locationfail = function (result) {
otherparam.fail(result);
};
let locationcomplete = function (result) {
};
if (!param["location"]) {
that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
} else {
let longitude = param.location.split(',')[1];
let latitude = param.location.split(',')[0];
let errMsg = 'input location';
let res = {
errMsg: errMsg,
latitude: latitude,
longitude: longitude
};
locationsuccess(res);
}
}
/**
* sug模糊检索
*
* @param {Object} param 检索配置
* 参数对象结构可以参考
* http://lbsyun.baidu.com/index.php?title=webapi/place-suggestion-api
*/
suggestion(param) {
var that = this;
param = param || {};
let suggestionparam = {
query: param["query"] || '',
region: param["region"] || '全国',
city_limit: param["city_limit"] || false,
output: param["output"] || 'json',
ak: that.ak,
sn: param["sn"] || '',
timestamp: param["timestamp"] || '',
ret_coordtype: 'gcj02ll'
};
let otherparam = {
success: param["success"] || function () { },
fail: param["fail"] || function () { }
};
wx.request({
url: 'https://api.map.baidu.com/place/v2/suggestion',
data: suggestionparam,
header: {
"content-type": "application/json"
},
method: 'GET',
success(data) {
let res = data["data"];
if (res["status"] === 0) {
otherparam.success(res);
} else {
otherparam.fail({
errMsg: res["message"],
statusCode: res["status"]
});
}
},
fail(data) {
otherparam.fail(data);
}
});
}
/**
* rgc检索逆地理编码经纬度->地点描述
*
* @param {Object} param 检索配置
* 参数对象结构可以参考
* https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding-abroad
*
*/
regeocoding (param) {
var that = this;
param = param || {};
let regeocodingparam = {
coordtype: param["coordtype"] || 'gcj02ll',
ret_coordtype: 'gcj02ll',
radius: param["radius"] || 1000,
ak: that.ak,
sn: param["sn"] || '',
output: param["output"] || 'json',
callback: param["callback"] || function () { },
extensions_poi: param["extensions_poi"] || 1,
extensions_road: param["extensions_road"] || false,
extensions_town: param["extensions_town"] || false,
language: param["language"] || 'zh-CN',
language_auto: param["language_auto"] || 0
};
let otherparam = {
iconPath: param["iconPath"],
iconTapPath: param["iconTapPath"],
width: param["width"],
height: param["height"],
alpha: param["alpha"] || 1,
success: param["success"] || function () { },
fail: param["fail"] || function () { }
};
let type = 'gcj02';
let locationsuccess = function (result) {
regeocodingparam["location"] = result["latitude"] + ',' + result["longitude"];
wx.request({
url: 'https://api.map.baidu.com/reverse_geocoding/v3',
data: regeocodingparam,
header: {
"content-type": "application/json"
},
method: 'GET',
success(data) {
let res = data["data"];
if (res["status"] === 0) {
let poiObj = res["result"];
// outputRes 包含两个对象:
// originalData为百度接口返回的原始数据
// wxMarkerData为小程序规范的marker格式
let outputRes = {};
outputRes["originalData"] = res;
outputRes["wxMarkerData"] = [];
outputRes["wxMarkerData"][0] = {
id: 0,
latitude: result["latitude"],
longitude: result["longitude"],
address: poiObj["formatted_address"],
iconPath: otherparam["iconPath"],
iconTapPath: otherparam["iconTapPath"],
desc: poiObj["sematic_description"],
business: poiObj["business"],
alpha: otherparam["alpha"],
width: otherparam["width"],
height: otherparam["height"]
}
otherparam.success(outputRes);
} else {
otherparam.fail({
errMsg: res["message"],
statusCode: res["status"]
});
}
},
fail(data) {
otherparam.fail(data);
}
});
};
let locationfail = function (result) {
otherparam.fail(result);
}
let locationcomplete = function (result) {
};
if (!param["location"]) {
that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
} else {
let longitude = param.location.split(',')[1];
let latitude = param.location.split(',')[0];
let errMsg = 'input location';
let res = {
errMsg: errMsg,
latitude: latitude,
longitude: longitude
};
locationsuccess(res);
}
}
/**
* gc检索地理编码地点->经纬度
*
* @param {Object} param 检索配置
* 参数对象结构可以参考
* https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding
*
*/
geocoding(param) {
var that = this;
param = param || {};
let geocodingparam = {
address: param["address"] || '',
city: param["city"] || '',
ret_coordtype: param["coordtype"] || 'gcj02ll',
ak: that.ak,
sn: param["sn"] || '',
output: param["output"] || 'json',
callback: param["callback"] || function () { }
};
let otherparam = {
iconPath: param["iconPath"],
iconTapPath: param["iconTapPath"],
width: param["width"],
height: param["height"],
alpha: param["alpha"] || 1,
success: param["success"] || function () { },
fail: param["fail"] || function () { }
};
if (param["address"]) {
wx.request({
url: 'https://api.map.baidu.com/geocoding/v3',
data: geocodingparam,
header: {
"content-type": "application/json"
},
method: 'GET',
success(data) {
let res = data["data"];
if (res["status"] === 0){
let poiObj = res["result"];
// outputRes 包含两个对象:
// originalData为百度接口返回的原始数据
// wxMarkerData为小程序规范的marker格式
let outputRes = res;
outputRes["originalData"] = res;
outputRes["wxMarkerData"] = [];
outputRes["wxMarkerData"][0] = {
id: 0,
latitude: poiObj["location"]["lat"],
longitude: poiObj["location"]["lng"],
iconPath: otherparam["iconPath"],
iconTapPath: otherparam["iconTapPath"],
alpha: otherparam["alpha"],
width: otherparam["width"],
height: otherparam["height"]
}
otherparam.success(outputRes);
} else {
otherparam.fail({
errMsg: res["message"],
statusCode: res["status"]
});
}
},
fail(data) {
otherparam.fail(data);
}
});
} else {
let errMsg = 'input address!';
let res = {
errMsg: errMsg
};
otherparam.fail(res);
}
}
/**
* 天气检索
*
* @param {Object} param 检索配置
*/
weather(param) {
var that = this;
param = param || {};
let weatherparam = {
coord_type: param["coord_type"] || 'gcj02',
output: param["output"] || 'json',
ak: that.ak,
sn: param["sn"] || '',
timestamp: param["timestamp"] || ''
};
let otherparam = {
success: param["success"] || function () { },
fail: param["fail"] || function () { }
};
let type = 'gcj02';
let locationsuccess = function (result) {
weatherparam["location"] = result["longitude"] + ',' + result["latitude"];
wx.request({
url: 'https://api.map.baidu.com/telematics/v3/weather',
data: weatherparam,
header: {
"content-type": "application/json"
},
method: 'GET',
success(data) {
let res = data["data"];
if (res["error"] === 0 && res["status"] === 'success') {
let weatherArr = res["results"];
// outputRes 包含两个对象,
// originalData为百度接口返回的原始数据
// wxMarkerData为小程序规范的marker格式
let outputRes = {};
outputRes["originalData"] = res;
outputRes["currentWeather"] = [];
outputRes["currentWeather"][0] = {
currentCity: weatherArr[0]["currentCity"],
pm25: weatherArr[0]["pm25"],
date: weatherArr[0]["weather_data"][0]["date"],
temperature: weatherArr[0]["weather_data"][0]["temperature"],
weatherDesc: weatherArr[0]["weather_data"][0]["weather"],
wind: weatherArr[0]["weather_data"][0]["wind"]
};
otherparam.success(outputRes);
} else {
otherparam.fail({
errMsg: res["message"],
statusCode: res["status"]
});
}
},
fail(data) {
otherparam.fail(data);
}
});
}
let locationfail = function (result) {
otherparam.fail(result);
}
let locationcomplete = function (result) {
}
if (!param["location"]) {
that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
} else {
let longitude = param.location.split(',')[0];
let latitude = param.location.split(',')[1];
let errMsg = 'input location';
let res = {
errMsg: errMsg,
latitude: latitude,
longitude: longitude
};
locationsuccess(res);
}
}
}
module.exports.BMapWX = BMapWX;

172
pages/activity/activity.js Normal file
View File

@ -0,0 +1,172 @@
// pages/activity/activity.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
indicatorDots: true,
autoplay: true,
requestIp: '',
token: '',
matchList: [],
activityList: [],
swiperList: []
},
getSwiper: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/listpagearticlebycategoryrelease',
data: {
articleCategoryId: 'c3eeeaeb-d60b-4154-871b-67cdf027a558'
},
header: {
"token": self.data.token
},
success: function (res) {
var images = ''
for (var i = 0; i < res.data.rows.length; i++) {
if (i == 0) {
images = images + res.data.rows[i].images
} else {
images = images + ',' + res.data.rows[i].images
}
}
var result = images.split(',')
console.log(result)
self.setData({
swiperList: result
})
}
})
},
goDetail: function (e) {
wx.navigateTo({
url: '../newsDetail/newsDetail?articleContentId=' + e.currentTarget.dataset.id,
})
},
goMatch: function (e) {
wx.navigateTo({
url: '../matchList/matchList?type=' + e.currentTarget.dataset.type,
})
},
getMatchList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/listpagearticlebycategoryrelease',
header: {
'token': self.data.token
},
data: {
articleCategoryId: '674b6d2a-637b-4f65-950e-1343b602574a',
page: 1,
rows: 4
},
success: function (res) {
if(res.statusCode == 200){
for (var i = 0; i < res.data.rows.length; i++) {
res.data.rows[i].images = res.data.rows[i].images.split(',')[0]
}
self.setData({
matchList: res.data.rows
})
}
}
})
},
getAcitivityList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/listpagearticlebycategoryrelease',
header: {
'token': self.data.token
},
data: {
articleCategoryId: '48f0147d-5e12-493a-9d24-eb2d4f74064c',
page: 1,
rows: 4
},
success: function (res) {
for (var i = 0; i < res.data.rows.length; i++) {
res.data.rows[i].images = res.data.rows[i].images.split(',')[0]
}
self.setData({
activityList: res.data.rows
})
}
})
},
getToken: function () {
var self = this
wx.getStorage({
key: 'token',
success: function (res) {
self.setData({
token: res.data
})
self.getMatchList()
self.getAcitivityList()
self.getSwiper()
},
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
requestIp: app.globalData.requestIp
})
this.getToken()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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,54 @@
<view class="activity-swiper">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" >
<swiper-item class="swiper-item" wx:for="{{swiperList}}" wx:key="index">
<image src="{{requestIp}}route/file/downloadfile/true/{{item}}"></image>
</swiper-item>
</swiper>
</view>
<view class="link-box">
<view class="link" bindtap="goMatch" data-type="match">
<view class="link-img">
<image src="../../images/competition.png"></image>
</view>
<view class="link-text">
<view class="cn">赛事</view>
<view class="en">Competition</view>
</view>
</view>
<view class="link" bindtap="goMatch" data-type="activity">
<view class="link-img">
<image src="../../images/activity.png"></image>
</view>
<view class="link-text">
<view class="cn">活动</view>
<view class="en">Activity</view>
</view>
</view>
</view>
<view class="match">
<view class="match-title" style="background: url(../../images/title-bg.png) no-repeat left bottom">热门赛事</view>
<view class="match-list">
<view class="match-box" wx:for="{{matchList}}" wx:key="index" bindtap="goDetail" data-id="{{item.articleContentId}}" data-type="match">
<view class="match-image">
<image src="{{requestIp}}route/file/downloadfile/true/{{item.images}}"></image>
</view>
<view class="match-name">
{{item.title}}
</view>
</view>
</view>
</view>
<view class="activity">
<view class="activity-title" style="background: url(../../images/title-bg.png) no-repeat left bottom">最新活动</view>
<view class="activity-list">
<view class="activity-box" wx:for="{{activityList}}" wx:key="index" data-id="{{item.articleContentId}}" data-type="acitivty" bindtap="goDetail">
<view class="activity-image">
<image src="{{requestIp}}route/file/downloadfile/true/{{item.images}}"></image>
</view>
<view class="activity-name">
<view class="name">{{item.title}}</view>
<view class="date">{{item.activityTimeEnd}}</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,108 @@
.swiper-box, swiper, .swiper-item, .swiper-item image{
width: 100%;
height: 400rpx;
}
.link-box{
display: flex;
justify-content: space-between;
padding: 15rpx 30rpx;
}
.link{
width: 49%;
background:linear-gradient(90deg,rgba(113,150,254,1) 0%,rgba(75,122,254,1) 100%);
padding: 30rpx 35rpx;
box-sizing: border-box;
color: #fff;
border-radius: 10rpx;
display: flex;
justify-content: space-between;
}
.cn{
font-size: 32rpx;
}
.en{
font-size: 28rpx;
}
.link image{
width: 80rpx;
height: 80rpx;
}
.match{
margin: 10rpx 0;
padding: 0 30rpx;
}
.match-title{
padding-bottom: 10rpx;
font-size: 36rpx;
font-weight: bold;
}
.match-list{
margin: 15rpx 0;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.match-box{
width: 49%;
border: 2rpx solid #ECECEC;
border-radius: 10rpx;
margin-bottom: 15rpx;
}
.match-image image{
width: 100%;
height: 240rpx;
border-radius: 10rpx;
}
.match-name{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 28rpx;
padding: 0 10rpx 10rpx;
color: #000;
}
.match-date{
font-size: 24rpx;
color: #BBB;
padding: 0 10rpx 10rpx;
}
.activity{
margin-top: 15rpx;
padding: 0 30rpx;
}
.activity-title{
padding-bottom: 10rpx;
font-size: 36rpx;
font-weight: bold;
}
.activity-list{
margin-top: 15rpx;
}
.activity-box{
width: 100%;
margin-bottom: 15rpx;
border: 2rpx solid #ECECEC;
border-radius: 10rpx;
overflow: hidden;
}
.activity-image, .activity-box image{
width: 100%;
height: 320rpx;
}
.activity-name{
padding: 10rpx;
}
.name{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 28rpx;
margin-bottom: 10rpx;
}
.date{
font-size: 24rpx;
color: #BBBBBB;
}
.link-text{
width: 65%;
}

126
pages/around/around.js Normal file
View File

@ -0,0 +1,126 @@
// 引用百度地图微信小程序JSAPI模块
var bmap = require('../../lib/bmap-wx.js');
var wxMarkerData = [];
Page({
data: {
markers: [],
longitude: 111.75292024572663,
latitude: 40.85426882952502,
placeData: {},
searchType: '场馆',
showDetail: false
},
goHere: function () {
var self = this
wx.getLocation({
type: 'gcj02', //返回可以用于wx.openLocation的经纬度
success(res) {
const latitude = parseFloat(self.data.placeData.latitude)
const longitude = parseFloat(self.data.placeData.longitude)
wx.openLocation({
latitude,
longitude,
scale: 15
})
}
})
},
doSearch: function (e) {
this.setData({
searchType: e.currentTarget.dataset.poi
})
this.initMap()
},
makertap: function (e) {
var that = this;
var id = e.markerId;
that.showSearchInfo(wxMarkerData, id);
that.changeMarkerColor(wxMarkerData, id);
that.setData({
showDetail: true
})
},
initMap: function () {
var that = this;
// 新建百度地图对象
var BMap = new bmap.BMapWX({
ak: 'Zk732rbyjd327q7Zj9EOtRjUn2ED1GWK'
});
var fail = function (data) {
// console.log(data)
};
var success = function (data) {
wxMarkerData = data.wxMarkerData;
wxMarkerData[0].longitude = that.data.longitude
wxMarkerData[0].latitude = that.data.latitude
that.setData({
markers: wxMarkerData
});
that.setData({
latitude: wxMarkerData[0].latitude
});
that.setData({
longitude: wxMarkerData[0].longitude
});
}
// 发起POI检索请求
BMap.search({
"query": that.data.searchType,
fail: fail,
success: success,
// 此处需要在相应路径放置图片文件
iconPath: '../../images/marker_red.png',
// 此处需要在相应路径放置图片文件
iconTapPath: '../../images/marker_red.png'
});
},
showSearchInfo: function (data, i) {
var that = this;
if(data[i].telephone == undefined){
data[i].telephone = '暂无'
}
that.setData({
placeData: {
title: '名称:' + data[i].title + '\n',
address: '地址:' + data[i].address + '\n',
telephone: '电话:' + data[i].telephone + '\n',
longitude : data[i].longitude,
latitude : data[i].latitude
}
});
},
onLoad: function () {
this.getPosition()
},
changeMarkerColor: function (data, i) {
var that = this;
var markers = [];
for (var j = 0; j < data.length; j++) {
if (j == i) {
// 此处需要在相应路径放置图片文件
data[j].iconPath = "../../images/marker_yellow.png";
} else {
// 此处需要在相应路径放置图片文件
data[j].iconPath = "../../images/marker_red.png";
}
markers[j] = data[j];
}
that.setData({
markers: markers
});
},
getPosition: function (e) {
wx.getLocation({
type: 'wgs84',
success: (res)=> {
var latitude = res.latitude
var longitude = res.longitude
var speed = res.speed
var accuracy = res.accuracy
this.setData({ latitude: latitude, longitude: longitude})
this.initMap()
}
})
}
})

3
pages/around/around.json Normal file
View File

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

29
pages/around/around.wxml Normal file
View File

@ -0,0 +1,29 @@
<view class="select-search">
<view class="search-btn" data-poi="场馆" bindtap="doSearch">
<image src="../../images/search1.png"></image>
<text>场馆</text>
</view>
<view class="search-btn" data-poi="健身" bindtap="doSearch">
<image src="../../images/search2.png"></image>
<text>健身</text>
</view>
<view class="search-btn" data-poi="公园" bindtap="doSearch">
<image src="../../images/search3.png"></image>
<text>公园</text>
</view>
<view class="search-btn" data-poi="运动场" bindtap="doSearch">
<image src="../../images/search6.png"></image>
<text>运动场</text>
</view>
</view>
<view class="map_container">
<map bindtap="mapclick" class="map" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" show-location="true" markers="{{markers}}" bindmarkertap="makertap"></map>
</view>
<view class="place_info" wx:if="{{showDetail}}">
<view class="info-box">
<text class="title">{{placeData.title}}</text>
<text>{{placeData.address}}</text>
<text>{{placeData.telephone}}</text>
</view>
<view class="go-here" bindtap="goHere">到这去</view>
</view>

62
pages/around/around.wxss Normal file
View File

@ -0,0 +1,62 @@
page{
height: 100%;
}
.select-search{
height: 10%;
white-space: nowrap;
overflow-x: auto;
}
.search-btn{
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 150rpx;
}
.search-btn image{
display: block;
margin: 5rpx auto;
width: 60rpx;
height: 60rpx;
}
.map_container{
height: 75%;
width: 100%;
}
.map {
height: 100%;
width: 100%;
}
.go-here{
width: 160rpx;
height: 60rpx;
line-height: 60rpx;
margin: 0 auto;
background: #50A4F3;
color: #fff;
font-size: 30rpx;
text-align: center;
border-radius: 10rpx;
flex-shrink: 0;
margin-top: 30rpx;
}
.place_info{
height: 15%;
overflow-y: auto;
padding: 15rpx 20rpx;
display: flex;
box-sizing: border-box;
justify-content: space-between;
}
.info-box{
width: 470rpx;
}
.info-box text{
font-size: 28rpx;
color: #BBB;
}
.info-box text.title{
font-size: 34rpx;
color: #000;
}

254
pages/book/book.js Normal file
View File

@ -0,0 +1,254 @@
// pages/book/book.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
groundInfoId: '',
week: '',
date: '',
venueList: [],
allPrice: 0,
selectedTime: [],
isSelected: false,
token: '',
requestIp: '',
selectedTab: 0,
selectedGround: [],
projectId: '',
projectName: ''
},
changeTab: function (e) {
var cur = parseInt(e.currentTarget.dataset.idx)
var arr = this.data.venueList[cur].configSplitDTOS
this.setData({
selectedTab: cur,
selectedGround: arr
})
},
toggleSelect: function (e) {
var event = e.currentTarget.dataset
console.log(event)
var arr = this.data.venueList
var price = parseInt(this.data.allPrice)
var list = this.data.selectedTime
var change = 'selectedGround[' + event.count + '].status'
if(list.length <= 0){
var newTime = [{
start: event.start,
end: event.end,
price: event.price,
ground: event.ground,
groundName: this.data.venueList[this.data.selectedTab].groundName,
itemId: event.item
}]
var resultPrice = this.data.allPrice + parseInt(event.price)
this.setData({
selectedTime: this.data.selectedTime.concat(newTime),
allPrice: resultPrice,
[change]: 'selecting',
isSelected: true
})
} else {
var isExist = false;
var cur = 0;
for (var i = 0; i < list.length; i++) {
if (event.ground == list[i].ground && event.start == list[i].start) {
isExist = true;
cur = i;
break;
}
}
if (isExist) {
var result = this.data.selectedTime.splice(cur, 1);
var resultPrice = this.data.allPrice - parseInt(event.price);
this.setData({
allPrice: resultPrice,
selectedTime: this.data.selectedTime,
[change]: ''
})
if(this.data.selectedTime.length == 0){
this.setData({
isSelected: false
})
}
} else {
var newTime = [{
start: event.start,
end: event.end,
price: event.price,
ground: event.ground,
groundName: this.data.venueList[this.data.selectedTab].groundName,
itemId: event.item
}]
var resultPrice = this.data.allPrice + parseInt(event.price)
this.setData({
selectedTime: this.data.selectedTime.concat(newTime),
allPrice: resultPrice,
[change]: 'selecting'
})
}
}
},
submitOrder: function () {
var self = this
var submitInfo = []
for (var i = 0; i < self.data.selectedTime.length; i++) {
var item = {
bookingOrderDate: self.data.date,
groundItemId: self.data.selectedTime[i].itemId
}
submitInfo.push(item)
}
var info = {
venuesProjectId: self.data.projectId,
bookingItemList: submitInfo
}
wx.request({
url: self.data.requestIp + 'app/wechatprogram/savebookinginfo',
method: 'post',
header: {
"token": self.data.token
},
data: info,
success: function (res) {
if(res.statusCode == 200){
wx.showToast({
title: '预约成功',
icon: 'success',
duration: 2000,//持续的时间
success: function () {
setTimeout(function(){
wx.switchTab({
url: '../home/home',
})
}, 2000)
}
})
}
},
fail: function (res) {
wx.showToast({
title: res.msg,
duration: 2000
})
}
})
},
initDate: function () {
var date = new Date()
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate() + 1
if (month < 10) {
month = '0' + month
}
if (day < 10) {
day = '0' + day
}
var today = year + '-' + month + '-' + day
var weekArray = new Array("日", "一", "二", "三", "四", "五", "六");
var now = year + '/' + month + '/' + day;
var week = '星期' + weekArray[new Date(now).getDay()];
console.log(week)
this.setData({
date: today,
week: week
})
},
getToken: function () {
var self = this
wx.getStorage({
key: 'token',
success: function (res) {
self.setData({
token: res.data
})
self.initDate()
self.getGroundList()
},
})
},
getGroundList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/listgroundinfoanditem',
data: {
venuesProjectId: self.data.projectId,
},
header: {
"token": self.data.token
},
success: function (res) {
self.setData({
venueList: res.data.data,
selectedGround: res.data.data[0].groundItemList
})
console.log(self.data.venueList)
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
requestIp: app.globalData.requestIp,
projectId: options.projectId,
projectName: options.name
})
console.log()
this.getToken()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

5
pages/book/book.json Normal file
View File

@ -0,0 +1,5 @@
{
"usingComponents": {
"htmltowxml": "plugin://htmltowxml/view"
}
}

30
pages/book/book.wxml Normal file
View File

@ -0,0 +1,30 @@
<view class="date">
<view class="date-box">
<view>{{projectName}}</view>
<view>{{week}}</view>
<view>{{date}}</view>
</view>
</view>
<view class="date-container">
<view class="select-ground">
<view class="ground-name {{selectedTab == index?'active':''}}" wx:for="{{venueList}}" wx:key="index" data-idx="{{index}}" bindtap="changeTab">{{item.groundName}}</view>
</view>
<view class="time" wx:if="{{selectedGround.length>0}}">
<view class="date-state {{item.bookingType?'beenBooked':''}} {{item.status == 'selecting'?'selected':''}}" wx:for="{{selectedGround}}" wx:for-index="idx" wx:key="idx" data-ground="{{item.groundInfoId}}" data-start="{{item.timeStr}}" data-end="{{item.timeEnd}}" data-price="{{item.price}}" data-groundname="{{item.groundName}}" data-count="{{idx}}" data-item="{{item.groundItemId}}" bindtap="toggleSelect">
<view>{{item.timeStr}}-{{item.timeEnd}}</view>
<view wx:if="{{item.price > 0}}">{{item.price}}元</view>
<view wx:else>免费</view>
</view>
</view>
<view wx:else style="font-size: 32rpx;color: #565656">暂无可预订场次</view>
</view>
<view class="pay" wx:if="{{isSelected}}">
<view class="pay-count">合计:¥{{allPrice}}</view>
<view class="submit" bindtap="submitOrder">提交订单</view>
</view>
<view class="selected-venue">
<view class="selected-list" wx:for="{{selectedTime}}" wx:key="index">
<view class="selected-time">{{item.start}}-{{item.end}}</view>
<view class="selected-ground">{{item.groundName}}</view>
</view>
</view>

145
pages/book/book.wxss Normal file
View File

@ -0,0 +1,145 @@
.date{
overflow: hidden;
}
.date-box{
background: #50A4F3;
text-align: center;
display: inline-block;
padding: 10rpx;
color: #fff;
}
.date-container{
padding: 0 30rpx 20rpx;
margin-bottom: 260rpx;
}
.time{
width: 100%;
}
.time-text{
font-size: 34rpx;
color: #4B7AFE;
margin: 20rpx 0;
}
.date-state{
display: inline-block;
width: 215rpx;
padding: 10rpx 0;
margin-bottom: 10rpx;
text-align: center;
margin-right: 18rpx;
background: gray;
border-radius: 10rpx;
color: #fff;
}
.date-state.beenBooked{
background: rgba(80,164,243,.1);
}
.date-state.selected{
background: #50A4F3;
color: #fff;
}
.bottom-state{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 20rpx 0;
text-align: center;
background: #fff;
border-top: 1px solid #ddd;
}
.book, .no-book, .booked{
display: inline-block;
width: 25rpx;
height: 25rpx;
}
.book{
background: #50A4F3;
}
.no-book{
margin-left: 15rpx;
background: #CBCBCB;
}
.booked{
margin-left: 15rpx;
background: #4B7AFE;
}
.pay{
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 80rpx;
display: flex;
justify-content: space-between;
line-height: 80rpx;
background: #fff;
z-index: 10;
border-top: 1px solid #ddd;
}
.pay-count{
padding-left: 15rpx;
}
.submit{
padding: 0 15rpx;
color: #fff;
background: #50A4F3;
}
.selected-venue{
position: fixed;
bottom: 80rpx;
left: 0;
right: 0;
padding: 10rpx;
width: 100%;
overflow-x: scroll;
box-sizing: border-box;
white-space: nowrap;
background: #fff;
}
.selected-list{
width: 230rpx;
border: 1px solid #50A4F3;
border-radius: 15rpx;
display: inline-block;
margin-right: 10rpx;
text-align: center;
overflow: hidden;
}
.selected-time{
background: #50A4F3;
color: #fff;
padding: 10rpx 0;
}
.selected-ground{
color: #50A4F3;
padding: 10rpx 0;
}
.select-ground{
overflow-x: auto;
white-space: nowrap;
margin: 20rpx 0;
padding-bottom: 7rpx;
}
.ground-name{
display: inline-block;
margin-right: 20rpx;
color: #000;
font-size: 36rpx;
font-weight: bold;
position: relative;
}
.ground-name.active{
color: #50A4F3;
}
.ground-name.active::after{
content: '';
display: block;
position: absolute;
bottom: -5rpx;
left: 50%;
width: 40rpx;
height: 7rpx;
background: #50A4F3;
margin-left: -20rpx;
}

135
pages/center/center.js Normal file
View File

@ -0,0 +1,135 @@
// pages/center/center.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
userInfo: {
avatarUrl: '',
nickName: ''
},
requestIp: '',
passtype: ''
},
goRegister: function () {
if (this.data.userInfo.nickName == '' && this.data.userInfo.avatarUrl == ''){
wx.showToast({
title: '请先登录!',
icon: 'none'
})
}else{
wx.navigateTo({
url: '../venueRegister/venueRegister',
})
}
1 },
goOrder: function () {
if (this.data.userInfo.nickName == '' && this.data.userInfo.avatarUrl == '') {
wx.showToast({
title: '请先登录!',
icon: 'none'
})
} else {
wx.navigateTo({
url: '../order/order',
})
}
},
getUserInfo: function (e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
console.log(this.data.userInfo)
},
getToken: function () {
var self = this
wx.getStorage({
key: 'token',
success: function(res) {
self.setData({
token: res.data
})
self.getRegisterInfo()
},
})
},
getRegisterInfo: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/register/getregisterinfo',
header: {
'token': self.data.token
},
success: function (res) {
console.log(res.data)
self.setData({
passtype: res.data.data.passType
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
requestIp: app.globalData.requestIp
})
this.getToken()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/center/center.json Normal file
View File

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

27
pages/center/center.wxml Normal file
View File

@ -0,0 +1,27 @@
<button open-type="getUserInfo" bindgetuserinfo="getUserInfo" class="user-info">
<view class="user-avatar" wx:if="{{userInfo.avatarUrl != ''}}">
<image src="{{userInfo.avatarUrl}}" wx:if="{{userInfo.avatarUrl}}"></image>
</view>
<view class="user-name-empty" wx:if="{{userInfo.nickName == ''}}">请点击登录</view>
<view class="user-name" wx:if="{{userInfo.nickName != ''}}">{{userInfo.nickName}}</view>
</button>
<view class="item-list">
<view class="item" bindtap="goOrder">
<image src="../../images/order-icon.png" class="item-icon"></image>
<view class="item-name">
<text>场馆订单</text>
<image src="../../images/go.png"></image>
</view>
</view>
<view class="item" bindtap="goRegister">
<image src="../../images/register.png" class="item-icon"></image>
<view class="item-name">
<view class="left">
<text>场馆入驻</text>
<text class="pass" wx:if="{{passtype == 1 && userInfo.nickName != ''}}">已通过</text>
<text class="not-pass" wx:if="{{passtype == 2 && userInfo.nickName != ''}}">未通过</text>
</view>
<image src="../../images/go.png"></image>
</view>
</view>
</view>

81
pages/center/center.wxss Normal file
View File

@ -0,0 +1,81 @@
.user-info{
display: flex;
align-items: center;
width: 750rpx;
height: 300rpx;
background: linear-gradient(to bottom,#4B7AFE,rgb(161, 161, 243));
margin: 0 0 20rpx!important;
border-radius: 0;
font-size: 0;
padding: 0 75rpx;
box-sizing: border-box;
}
.user-info::after{
border: none;
}
.user-avatar{
font-size: 0;
width: 140rpx;
height: 140rpx;
margin-right: 30rpx;
}
.user-avatar image{
width: 100%;
height: 100%;
border-radius: 50%;
}
.user-name{
color: #fff;
font-size: 36rpx;
/* font-weight: bold; */
}
.item-list{
width: 690rpx;
margin: 0 auto;
border:2rpx solid rgba(236,236,236,1);
border-radius: 10rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.item{
display: flex;
justify-content: space-between;
border-bottom: 1px solid rgba(236,236,236,1);
}
.item:last-child{
border: none;
}
.item-icon{
width: 35rpx;
height: 35rpx;
margin-top: 28rpx;
}
.item-name{
width: 95%;
margin-left: 15rpx;
display: flex;
justify-content: space-between;
padding: 25rpx 0;
font-size: 34rpx;
}
.item-name image{
width: 30rpx;
height: 35rpx;
display: inline-block;
}
.user-name-empty{
text-align: center;
font-size: 36rpx;
width: 100%;
color: #fff;
}
.pass{
color: rgb(43, 209, 43);
font-size: 30rpx;
margin-left: 10rpx;
}
.not-pass{
color: red;
font-size: 30rpx;
margin-left: 10rpx;
}

206
pages/detail/detail.js Normal file
View File

@ -0,0 +1,206 @@
// pages/detail/detail.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
bookingType: '',
indicatorDots: true,
autoplay: true,
venuesInfoId: '',
venueInfo: {},
swiperList: [],
serviceList: [],
other: '',
tabList: [],
selectedTab: '',
tabContent: {},
facilitiesList: [],
dayList: [],
token: '',
requestIp: '',
project: '',
desc: '',
selectedProjectName: ''
},
getProject: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/listvenueproject?venuesInfoId=' + self.data.venuesInfoId,
header: {
'token': self.data.token
},
success: function (res) {
console.log(res)
self.setData({
facilitiesList: res.data.data,
selectedTab: res.data.data[0].venuesProjectId,
project: res.data.data[0].facilities,
desc: res.data.data[0].projectDescription,
selectedProjectName: res.data.data[0].projectCategory,
bookingType: res.data.data[0].bookingType
})
}
})
},
goVenueDetail: function () {
wx.navigateTo({
url: '../venueIntro/venueIntro?venuesInfoId=' + this.data.venuesInfoId,
})
},
callPhone: function (e) {
wx.makePhoneCall({
phoneNumber: e.currentTarget.dataset.phone,
})
},
goMap: function (e) {
wx.navigateTo({
url: '../map/map?long=' + e.currentTarget.dataset.long + '&lng=' + e.currentTarget.dataset.lng,
})
},
getDetail: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/getvenuesdetailbyId?venuesInfoId=' + self.data.venuesInfoId,
header: {
"token": self.data.token
},
success: function (res) {
if(res.statusCode == 200){
console.log(res)
var banner = res.data.data.venuePanorama.split(',')
if (res.data.data.venueService) {
var service = res.data.data.venueService.split(',')
} else {
var service = ''
}
// console.log(res.data)
// if (res.data.projectList.length > 0) {
// self.setData({
// selectedTab: res.data.projectList[0].venues_project_id
// })
// self.getTabContent()
// } else {
// self.setData({
// selectedTab: ''
// })
// }
self.setData({
venueInfo: res.data.data,
swiperList: banner,
serviceList: service,
other: res.data.data.venueOtherService,
// tabList: res.data.projectList
})
}
}
})
},
changeTab: function (e) {
console.log(e)
this.setData({
selectedTab: e.currentTarget.dataset.id,
desc: this.data.facilitiesList[e.currentTarget.dataset.idx].projectDescription,
project: this.data.facilitiesList[e.currentTarget.dataset.idx].facilities,
selectedProjectName: e.currentTarget.dataset.name,
bookingType: e.currentTarget.dataset.type
})
},
getTabContent: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/getvenuesprojectdetailbyId?venuesProjectId=' + self.data.selectedTab,
header: {
"token": self.data.token
},
success: function (res) {
if(res.statusCode == 200){
self.setData({
tabContent: res.data.venuesProjectInfo,
facilitiesList: res.data.venuesProjectInfo.facilities.split(','),
dayList: res.data.dayList
})
}
}
})
},
goBook: function (e) {
wx.navigateTo({
url: '../book/book?projectId=' + this.data.selectedTab + '&name=' + this.data.selectedProjectName,
})
},
getToken: function () {
var self = this
wx.getStorage({
key: 'token',
success: function (res) {
self.setData({
token: res.data
})
self.getDetail()
self.getProject()
},
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
venuesInfoId: options.venuesInfoId,
requestIp: app.globalData.requestIp
})
this.getToken()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

5
pages/detail/detail.json Normal file
View File

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

99
pages/detail/detail.wxml Normal file
View File

@ -0,0 +1,99 @@
<view class="swiper-box">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" class="swiper">
<swiper-item wx:for="{{swiperList}}" wx:key="idx" wx:for-index="idx">
<image src="{{requestIp}}route/file/downloadfile/true/{{item}}" class="swiper-image"></image>
</swiper-item>
</swiper>
</view>
<view class="venue-detail">
<view class="venue-title">
<view class="venue-name">
<view class="name-text">{{venueInfo.venueName}}</view>
</view>
</view>
<!-- <view class="venue-book">
<text class="book">已有0人预定</text>
<text class="type">国营</text>
</view> -->
<view class="venue-location location-box" bindtap="goMap" data-long="{{venueInfo.longitude}}" data-lng="{{venueInfo.latitude}}">
<view class="location-text">
<image src="../../images/location.png"></image>
{{venueInfo.venuePosition}}
</view>
<view class="go-there">到这去</view>
</view>
<view class="venue-location">
<!-- <image src="../../images/phone.png" class="phone"></image> -->
营业时间:{{venueInfo.businessHours}}
</view>
<view class="venue-location" bindtap="callPhone" data-phone="{{venueInfo.venueTelephone}}">
<image src="../../images/phone.png" class="phone"></image>
{{venueInfo.venueTelephone}}
</view>
<view class="venue-transportation">
<view class="left">
<image src="../../images/address.png"></image>
交通方式:
</view>
<view class="right">{{venueInfo.venueRoute}}</view>
</view>
<view class="project">
<view class="project-tab">
<view class="project-btn {{item.venuesProjectId == selectedTab?'active': ''}}" bindtap="changeTab" data-type="{{item.bookingType}}" data-id="{{item.venuesProjectId}}" data-idx="{{index}}" data-name="{{item.projectCategory}}" wx:for="{{facilitiesList}}" wx:key="index">{{item.projectCategory}}</view>
</view>
<view class="desc">{{desc}}</view>
<view class="project-title">场地设施</view>
<view class="project-content">{{project}}</view>
</view>
<view class="facilities service">
<view class="facilities-title">
场馆服务
</view>
<view class="facilities-detail">
<view class="row" >
<view class="service-item" wx:for="{{serviceList}}" wx:key="idx">{{item}}</view>
</view>
</view>
</view>
<view class="facilities service">
<view class="facilities-title">
其他服务
</view>
<view class="service-item">{{other}}</view>
</view>
<view class="facilities service">
<view class="facilities-title">
注意事项
</view>
<view class="service-item">{{venueInfo.bookingTips}}</view>
</view>
<view class="venue-intro">
<text bindtap="goVenueDetail">[更多]</text>
</view>
</view>
<!-- <view class="venue-info" wx:if="{{selectedTab}}">
<view class="venue-time">
<view class="title">营业时间:</view>
<view class="desc">{{tabContent.businessHours}}</view>
</view>
<view class="venue-desc">
<view class="title">项目描述:</view>
<view class="desc">{{tabContent.projectDescription}}</view>
</view>
</view>
<view class="date" wx:if="{{selectedTab}}">
<view class="date-container">
<view class="date-box" wx:for="{{dayList}}" wx:key="idx" wx:for-index="idx">
<view class="today">{{item.week}}</view>
<view class="day">{{item.dateFormat}}</view>
<view style="text-align: center" class="book-btn-box">
<view class="book-btn" wx:if="{{item.bookingType}}" bindtap="goBook" data-week="{{item.week}}" data-date="{{item.date}}">预定</view>
<view class="book-btn" wx:else>预定已满</view>
</view>
</view>
</view>
</view> -->
<view class="bottom-btn" bindtap="goBook" wx:if="{{bookingType == 1}}">
<view class="bottom-btn-box">预定</view>
</view>

348
pages/detail/detail.wxss Normal file
View File

@ -0,0 +1,348 @@
.swiper-box, swiper{
height: 400rpx;
}
.swiper-image{
width: 100%;
height: 100%;
}
.swiper .wx-swiper-dots.wx-swiper-dots-horizontal {
position: absolute;
z-index: 999;
}
.swiper .wx-swiper-dot {
display: inline-flex;
justify-content: space-between;
}
.swiper .wx-swiper-dot::before {
content: '';
flex-grow: 1;
background: #ffffff;
border-radius: 5px;
}
.swiper .wx-swiper-dot-active::before {
background: #0026ff;
}
.venue-detail{
padding: 0 20rpx;
border-bottom: 5px solid #ddd;
}
.venue-title{
width: 710rpx;
margin-top: 20rpx;
}
.venue-name{
display: flex;
justify-content: space-between;
}
.name-text{
font-weight: bold;
font-size: 34rpx;
color: #000;
}
.pay{
display: inline-block;
background: green;
color: #fff;
padding: 0 8rpx;
}
.star image{
width: 35rpx;
height: 35rpx;
vertical-align: middle;
}
.venue-book{
border-bottom: 1px solid #ddd;
padding: 20rpx 0;
display: flex;
justify-content: space-between;
}
.book{
color: #888;
}
.type{
display: inline-block;
color: #fff;
background: green;
padding: 0 8rpx;
}
.venue-location{
padding: 20rpx 0;
border-bottom: 1px solid #ddd;
color: #BBBBBB;
font-size: 32rpx;
}
.venue-location image, .venue-transportation image{
width: 28rpx;
height: 28rpx;
vertical-align: middle;
}
/* .venue-location image.phone{
width: 38rpx;
} */
.venue-transportation{
padding: 20rpx 0;
border-bottom: 1px solid #ddd;
display: flex;
justify-content: space-between;
color: #BBBBBB;
font-size: 28rpx;
}
.left{
width: 25%;
}
.right{
width: 75%;
}
.tab-btn{
overflow-x: auto;
white-space: nowrap;
font-size: 36rpx;
}
.tab{
display: inline-block;
text-align: center;
padding: 20rpx;
font-weight: bold;
font-size: 30rpx;
position: relative;
}
.tab.active{
color: #4B7AFE;
}
.tab.active::after{
content: '';
display: block;
width: 46rpx;
height: 6rpx;
background: #4B7AFE;
border-radius: 10rpx;
position: absolute;
bottom: 0;
left: 50%;
margin-left: -23rpx;
}
.venue-info{
padding: 15rpx 30rpx;
color: #888;
font-size: 32rpx;
}
.venue-desc{
margin: 10rpx 0;
}
.title{
font-size: 34rpx;
font-weight: bold;
color: #5F5F5F;
margin-bottom: 10rpx;
}
.desc{
color: #BBBBBB;
font-size: 28rpx;
margin: 20rpx 0;
}
.date{
padding: 15rpx 30rpx;
}
.date-container{
white-space: nowrap;
}
.date-box{
background: #fff;
padding: 0 20rpx;
text-align: center;
margin-right: 15rpx;
display: inline-block;
width: 180rpx;
font-size: 30rpx;
border:2rpx solid rgba(236,236,236,1);
position: relative;
padding-bottom: 30rpx;
}
.today{
font-weight: bold;
border-bottom: 2rpx solid #ECECEC;
color: #4B7AFE;
line-height: 60rpx;
}
.day{
color: #4B7AFE;
line-height: 60rpx;
margin: 10rpx 0 10rpx;
border-bottom: 2rpx solid #ECECEC;
}
.book-btn-box{
text-align: center;
position: absolute;
bottom: -20rpx;
left: 50%;
width: 124rpx;
height: 40rpx;
background: #4B7AFE;
margin-left: -62rpx;
color: #fff;
font-size: 26rpx;
line-height: 40rpx;
border-radius: 24rpx;
}
.book-btn{
width: 100%;
height: 100%;
}
.facilities-service{
padding: 0 30rpx;
margin-top: 20rpx;
}
.facilities{
padding: 15rpx 0;
border-bottom: 1px solid #ddd;
}
.facilities-title{
color: #5F5F5F;
font-weight: bold;
margin-bottom: 15rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.row{
margin-bottom: 15rpx;
font-size: 32rpx;
}
.name{
display: inline-block;
width: 25%;
text-align: right;
padding-right: 20rpx;
box-sizing: border-box;
color: #888;
vertical-align: top;
}
.service{
border: none;
}
.service-item{
display: inline-block;
margin-right: 15rpx;
padding-left: 5%;
box-sizing: border-box;
color: #888;
vertical-align: top;
font-size: 30rpx;
}
.content{
display: inline-block;
width: 75%;
color: #888;
}
.comment{
padding: 0 20rpx;
}
.comment-title{
padding: 20rpx 0;
border-bottom: 1px solid #ddd;
}
.comment-box{
display: flex;
justify-content: space-between;
padding: 20rpx 0;
border-bottom: 1px solid #ddd;
}
.user-avatar{
width: 60rpx;
height: 60rpx;
}
.user-avatar image{
width: 100%;
height: 100%;
}
.user-comment{
width: 630rpx;
}
.user-info{
line-height: 60rpx;
display: flex;
justify-content: space-between;
}
.username{
color: rgb(97, 190, 252);
}
.star-level image{
width: 35rpx;
height: 35rpx;
}
.venue-intro{
padding: 20rpx;
font-size: 28rpx;
color: #4B7AFE;
text-align: right;
margin-bottom: 120rpx;
}
.bottom-btn{
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #fff;
padding: 20rpx 30rpx;
height: 120rpx;
box-sizing: border-box;
box-shadow:0px 0px 17px 0px rgba(0,0,0,0.1);
}
.bottom-btn-box{
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
background: #4B7AFE;
font-size: 32rpx;
border-radius: 10rpx;
}
.project{
border-bottom: 3px solid #DEDEDE;
padding-bottom: 10rpx;
}
.project-tab{
display: flex;
}
.project-btn{
flex-shrink: 0;
padding: 15rpx 0;
font-size: 32rpx;
color: #242424;
margin-right: 30rpx;
font-weight: bold;
}
.project-btn.active{
color: #4B7AFE;
border-bottom: 2px solid #4B7AFE;
}
.project-title{
color: #5F5F5F;
font-weight: bold;
margin-bottom: 15rpx;
font-size: 28rpx;
}
.project-content{
text-indent: 10rpx;
font-size: 26rpx;
color: #888;
}
.location-box{
display: flex;
justify-content: space-between;
}
.location-text{
width: 80%;
}
.go-there{
width: 18%;
text-align: right;
color: #4B7AFE;
}

View File

@ -0,0 +1,143 @@
// pages/exerciseNews/exerciseNews.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
indicatorDots: true,
autoplay: true,
curTab: '021634c9-2a4b-4dd6-a997-3155e185d45d',
requestIp: '',
token: '',
newsList: [],
swiperList: []
},
getSwiper: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/listpagearticlebycategoryrelease',
data: {
articleCategoryId: '38a3409d-9ffb-4441-9f31-951306896e8f'
},
header: {
"token": self.data.token
},
success: function (res) {
var images = ''
for (var i = 0; i < res.data.rows.length; i++) {
if (i == 0) {
images = images + res.data.rows[i].images
} else {
images = images + ',' + res.data.rows[i].images
}
}
var result = images.split(',')
console.log(result)
self.setData({
swiperList: result
})
}
})
},
changeTab: function (e) {
this.setData({
curTab: e.currentTarget.dataset.id
})
this.getList()
},
goDetail: function (e) {
wx.navigateTo({
url: '../newsDetail/newsDetail?articleContentId=' + e.currentTarget.dataset.id,
})
},
getList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/listpagearticlebycategoryrelease',
data: {
articleCategoryId: 'c4c21643-4557-48ae-a5ac-0d2ea9cc2ce0'
},
header: {
'token': self.data.token
},
success: function (res) {
self.setData({
newsList: res.data.rows
})
}
})
},
getToken: function () {
var self = this
wx.getStorage({
key: 'token',
success: function (res) {
self.setData({
token: res.data
})
self.getList()
self.getSwiper()
},
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
requestIp: app.globalData.requestIp
})
this.getToken()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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,26 @@
<view class="swiper-box">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" >
<swiper-item class="swiper-item" wx:for="{{swiperList}}" wx:key="index">
<image src="{{requestIp}}route/file/downloadfile/true/{{item}}"></image>
</swiper-item>
</swiper>
</view>
<view class="tab">
<!-- <view class="tab-btn {{curTab == '021634c9-2a4b-4dd6-a997-3155e185d45d'?'active': ''}}" data-id="021634c9-2a4b-4dd6-a997-3155e185d45d" bindtap="changeTab">新闻资讯</view> -->
<!-- <view class="tab-btn {{curTab == 'c9794a0e-32f9-4859-be21-ce5786de8d44'?'active': ''}}" data-id="c9794a0e-32f9-4859-be21-ce5786de8d44" bindtap="changeTab">政策法规</view>
<view class="tab-btn {{curTab == '13970561-bdd8-47ac-8d63-fbf03b824b62'?'active': ''}}" data-id="13970561-bdd8-47ac-8d63-fbf03b824b62" bindtap="changeTab">通知公告</view>
<view class="tab-btn {{curTab == 'ffc197ce-83dc-4eac-96a8-68dff9868259'?'active': ''}}" data-id="ffc197ce-83dc-4eac-96a8-68dff9868259" bindtap="changeTab">媒体聚焦</view> -->
</view>
<view class="news-list">
<view class="news-box" bindtap="goDetail" wx:for="{{newsList}}" wx:key="index" data-id="{{item.articleContentId}}">
<view class="news-image">
<image src="../../images/logo.jpg" wx:if="{{item.images == ''}}"></image>
<image src="{{requestIp}}route/file/downloadfile/true/{{item.images}}" wx:else></image>
</view>
<view class="news-info">
<view class="news-title">{{item.title}}</view>
<view class="news-text">{{item.publishDate}}</view>
<view class="news-text">来源:{{item.source}}</view>
</view>
</view>
</view>

View File

@ -0,0 +1,64 @@
.swiper-box, swiper, .swiper-item, .swiper-item image{
width: 100%;
height: 400rpx;
}
.tab{
width: 100%;
overflow-x: auto;
padding: 0 30rpx;
box-sizing: border-box;
margin: 30rpx 0;
white-space: nowrap
}
.tab-btn{
display: inline-block;
width: 21%;
height: 60rpx;
line-height: 60rpx;
text-align: center;
background:rgba(203,203,203,.2);
margin-right: 20rpx;
border-radius: 35rpx;
font-size: 28rpx;
color: #5e5e5e;
}
.tab-btn.active{
background: #4B7AFE;
color: #fff;
}
.news-list{
padding: 0 30rpx;
}
.news-box{
padding: 10rpx;
border: 1px solid #ddd;
display: flex;
justify-content: space-between;
border-radius: 10rpx;
margin-bottom: 10rpx;
}
.news-image{
width: 35%;
height: 180rpx;
}
.news-image image{
width: 100%;
height: 100%;
}
.news-info{
width: 63%;
}
.news-title{
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
font-size: 34rpx;
color: #000;
}
.news-text{
color: #888;
font-size: 28rpx;
margin-top: 12rpx;
}

206
pages/home/home.js Normal file
View File

@ -0,0 +1,206 @@
// pages/home/home.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
indicatorDots: true,
autoplay: true,
venueList: [],
userInfo: {},
hasUserInfo: false,
token: '',
requestIp: '',
swiperList: []
},
getSwiper: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/listpagearticlebycategoryrelease',
data: {
articleCategoryId: '64342ca0-bef8-495e-8a2f-89dd54c50086'
},
header: {
"token": self.data.token
},
success: function (res) {
var images = ''
for (var i = 0; i < res.data.rows.length; i++) {
if (i == 0) {
images = images + res.data.rows[i].images
} else {
images = images + ',' + res.data.rows[i].images
}
}
var result = images.split(',')
self.setData({
swiperList: result
})
}
})
},
goDetail: function (event) {
wx.navigateTo({
url: '../detail/detail?venuesInfoId=' + event.currentTarget.dataset.id,
})
},
goBook: function () {
wx.navigateTo({
url: '../index/index',
})
},
goMatch: function () {
wx.navigateTo({
url: '../activity/activity',
})
},
goExercise: function () {
wx.navigateTo({
url: '../exerciseNews/exerciseNews',
})
},
goNews: function () {
wx.navigateTo({
url: '../sportNews/sportNews',
})
},
getList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/listvenuesbykeywords',
header: {
"token": self.data.token
},
success: function (res) {
self.setData({
venueList: res.data.data
})
wx.hideNavigationBarLoading()
wx.stopPullDownRefresh()
}
})
},
getUserInfo: function (e) {
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
},
doLogin: function(){
var self = this
wx.login({
success(res) {
if (res.code) {
//发起网络请求
wx.request({
url: self.data.requestIp + 'wxminiapp/auth/login',
method: 'post',
data: {
jsCode: res.code
},
success: function (res) {
self.setData({
token: res.data.data
})
wx.setStorage({
key: 'token',
data: res.data.data
})
self.getList()
self.getSwiper()
}
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
})
},
onPullDownRefresh: function () {
wx.showNavigationBarLoading()
this.setData({
venueList: []
})
this.onLoad()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
requestIp: app.globalData.requestIp
})
this.doLogin()
if (app.globalData.userInfo) {
this.setData({
userInfo: app.globalData.userInfo,
hasUserInfo: true
})
} else if (this.data.canIUse) {
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
app.userInfoReadyCallback = res => {
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
} else {
// 在没有 open-type=getUserInfo 版本的兼容处理
wx.getUserInfo({
success: res => {
app.globalData.userInfo = res.userInfo
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/home/home.json Normal file
View File

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

39
pages/home/home.wxml Normal file
View File

@ -0,0 +1,39 @@
<view class="swiper-box">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" >
<swiper-item class="swiper-item" wx:for="{{swiperList}}" wx:key="index">
<image src="{{requestIp}}route/file/downloadfile/true/{{item}}"></image>
</swiper-item>
</swiper>
</view>
<view class="link-container">
<view class="link-box" bindtap="goBook">
<image src="../../images/link-bg1.png"></image>
预约租赁
</view>
<view class="link-box" bindtap="goMatch">
<image src="../../images/link-bg2.png"></image>
赛事活动
</view>
<view class="link-box" bindtap="goNews">
<image src="../../images/link-bg3.png"></image>
科学健身
</view>
<view class="link-box" bindtap="goExercise">
<image src="../../images/link-bg4.png"></image>
体育新闻
</view>
</view>
<view class="venue-list">
<view class="venue-title" style="background: url(../../images/title-bg.png) no-repeat bottom left">场馆推荐</view>
<view class="venue-box" bindtap="goDetail" wx:for="{{venueList}}" data-id="{{item.venuesInfoId}}" wx:key="idx">
<view class="venue-pic">
<image src="{{requestIp}}route/file/downloadfile/true/{{item.venuePanorama}}" class="venue-img"></image>
</view>
<view class="venue-info">
<view class="venue-title">
<text class="venue-name">{{item.venueName}}</text>
</view>
<view class="venue-address">{{item.venuePosition}}</view>
</view>
</view>
</view>

85
pages/home/home.wxss Normal file
View File

@ -0,0 +1,85 @@
.swiper-box, swiper, .swiper-item, .swiper-item image{
width: 100%;
height: 400rpx;
}
.link-container{
padding: 0 30rpx;
display: flex;
margin: 20rpx 0;
justify-content: space-between;
}
.link-box{
display: inline-block;
width: 158rpx;
height: 80rpx;
font-size: 26rpx;
line-height: 80rpx;
text-align: center;
color: #fff;
position: relative;
}
.link-box image{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
.venue-title{
font-size: 36rpx;
color: #000;
font-weight: bold;
padding-bottom: 15rpx;
}
.venue-list{
width: 690rpx;
margin: 0 auto;
}
.venue-box{
display: flex;
justify-content: space-between;
padding: 15rpx;
border: 1px solid #ddd;
border-radius: 10rpx;
margin-bottom: 20rpx;
}
.venue-pic{
width: 35%;
height: 180rpx;
border-radius: 10rpx;
overflow: hidden;
}
.venue-img{
width: 100%;
height: 100%;
}
.venue-info{
width: 63%;
}
.venue-title{
display: flex;
justify-content: space-between;
}
.venue-name{
display: inline-block;
font-size: 30rpx;
}
.venue-pay{
background: green;
color: #fff;
display: inline-block;
width: 50rpx;
text-align: center;
font-size: 36rpx;
}
.venue-address{
font-size: 30rpx;
color: #888;
margin-top: 20rpx;
}
.part-title{
font-size: 36rpx;
padding: 15rpx 0;
border-bottom: 1px solid #ddd;
}

146
pages/index/index.js Normal file
View File

@ -0,0 +1,146 @@
//index.js
//获取应用实例
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
indicatorDots: false,
autoplay: false,
projectList: [],
venueList: [],
token: '',
requestIp: ''
},
goList: function (event) {
wx.navigateTo({
url: '../list/list?categoryId=' + event.currentTarget.dataset.id + '&categoryName=' + event.currentTarget.dataset.name,
})
},
goDetail: function (event) {
wx.navigateTo({
url: '../detail/detail?venuesInfoId=' + event.currentTarget.dataset.id,
})
},
getSwiper: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/listvenuesproject',
header:{
"token": self.data.token
},
data: {
id: 'f59ebf77-c2b7-49bc-8f58-2928bd2b450d'
},
success: function (res) {
if (res.statusCode == 200){
var list = [];
if(res.data.list.length > 8){
self.setData({
indicatorDots: true
})
}
res.data.list.forEach((item, index) => {
const page = Math.floor(index / 8)
if (!list[page]) {
list[page] = []
}
list[page].push(item)
})
console.log(list)
self.setData({
projectList: list
})
}
}
})
},
getList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/listvenuesbykeywords',
header: {
"token": self.data.token
},
success: function (res) {
self.setData({
venueList: res.data.data
})
}
})
},
getToken: function () {
var self = this
wx.getStorage({
key: 'token',
success: function(res) {
self.setData({
token: res.data
})
self.getSwiper()
self.getList()
},
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
requestIp: app.globalData.requestIp
})
this.getToken()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/index/index.json Normal file
View File

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

28
pages/index/index.wxml Normal file
View File

@ -0,0 +1,28 @@
<!--index.wxml-->
<view class="container">
<!-- <view class="search" style="background: url(../../images/search.png) no-repeat 98% center;background-size: 35rpx 35rpx;">
搜索场馆
</view> -->
<view class="swiper-box">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" >
<swiper-item class="swiper-scroll" wx:for="{{projectList}}" wx:for-item="out" wx:key="idx">
<view class="swiper-part" bindtap="goList" wx:for="{{out}}" data-id="{{item.categoryId}}" data-name="{{item.categoryName}}" wx:key="idx">
{{item.categoryName}}
</view>
</swiper-item>
</swiper>
</view>
<view class="venue-list">
<view class="venue-box" bindtap="goDetail" wx:for="{{venueList}}" data-id="{{item.venuesInfoId}}" wx:key="idx">
<view class="venue-pic">
<image src="{{requestIp}}route/file/downloadfile/true/{{item.venuePanorama}}" class="venue-img"></image>
</view>
<view class="venue-info">
<view class="venue-title">
<text class="venue-name">{{item.venueName}}</text>
</view>
<view class="venue-address">{{item.venuePosition}}</view>
</view>
</view>
</view>
</view>

86
pages/index/index.wxss Normal file
View File

@ -0,0 +1,86 @@
.search{
width: 720rpx;
height: 50rpx;
margin: 10rpx auto;
border-radius: 5rpx;
padding: 0 10rpx;
box-sizing: border-box;
color: #ddd;
display: flex;
align-items: center;
border: 1px solid #ddd;
}
swiper{height: 200rpx;}
.swiper-box{
width: 100%;
padding: 0 30rpx;
box-sizing: border-box;
border-bottom: 5px solid #ddd;
}
.swiper-scroll{
display: flex;
width: 100%;
flex-wrap: wrap;
align-content: flex-start;
justify-content: space-between;
}
.swiper-part{
width: 158rpx;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
align-self: flex-start;
font-size: 28rpx;
color: #5E5E5E;
background: #CBCBCB;
margin-bottom: 20rpx;
border-radius: 35rpx;
}
.venue-list{
width: 690rpx;
margin: 0 auto;
padding-bottom: 20rpx;
}
.venue-box{
display: flex;
justify-content: space-between;
padding: 15rpx;
border: 1px solid #ddd;
border-radius: 10rpx;
margin-top: 20rpx;
}
.venue-pic{
width: 35%;
height: 180rpx;
border-radius: 10rpx;
overflow: hidden;
}
.venue-img{
width: 100%;
height: 100%;
}
.venue-info{
width: 63%;
}
.venue-title{
display: flex;
justify-content: space-between;
}
.venue-name{
display: inline-block;
font-size: 32rpx;
}
.venue-pay{
background: green;
color: #fff;
display: inline-block;
width: 50rpx;
text-align: center;
font-size: 36rpx;
}
.venue-address{
font-size: 30rpx;
color: #888;
margin-top: 20rpx;
}

269
pages/list/list.js Normal file
View File

@ -0,0 +1,269 @@
// pages/list/list.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
categoryName: '',
categoryId: '',
venueList: [],
showSelect: false,
selectType: 1,
latitude: '',
longitude: '',
cityName: '',
cityId: '',
areaName: '',
areaId: '',
adcode: '',
district: '',
selectList: [],
chargeName: '场馆类型',
venueCharge: '',
token: '',
requestIp: ''
},
checkall: function () {
if(this.data.selectType == 1){
this.setData({
areaId: '',
areaName: ''
})
} else if (this.data.selectType == 2){
this.setData({
categoryName: '体育项目',
categoryId: ''
})
} else {
this.setData({
chargeName: '场馆类型',
venueCharge: ''
})
}
this.getList()
},
doSelcet: function (e) {
var self = this
var type = e.currentTarget.dataset.id
this.setData({
showSelect: true,
selectType: e.currentTarget.dataset.id
})
if(type == 1){
self.getAreaList()
}else if(type == 2){
self.getProjectList()
}else{
self.getTypeList()
}
},
hideSelect: function () {
this.setData({
showSelect: false
})
},
getNewList: function (e) {
var self = this
if (self.data.selectType == 1){
self.setData({
showSelect: false,
areaName: e.currentTarget.dataset.name,
areaId: e.currentTarget.dataset.id
})
} else if (self.data.selectType == 2){
self.setData({
categoryId: e.currentTarget.dataset.id,
categoryName: e.currentTarget.dataset.name
})
} else {
self.setData({
chargeName: e.currentTarget.dataset.name,
venueCharge: e.currentTarget.dataset.id
})
}
self.getList()
},
goDetail: function (event) {
wx.navigateTo({
url: '../detail/detail?venuesInfoId=' + event.currentTarget.dataset.id,
})
},
getAreaId: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/getcityinfobyname',
data: {
cityName: self.data.cityName
},
header: {
"token": self.data.token
},
success: function (res) {
self.setData({
cityId: res.data.dictionaryId
})
self.getList()
}
})
},
getList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/listvenuesbykeywords',
data: {
categoryId: self.data.categoryId,
cityName: self.data.cityName,
cityId: 'fbd845d6-a74b-457a-8da1-fec66ab0d400',
adcode: self.data.adcode,
district: self.data.district,
areaId: self.data.areaId,
venueCharge: self.data.venueCharge
},
header: {
"token": self.data.token
},
success: function (res) {
self.setData({
venueList: res.data.data,
showSelect: false
})
}
})
},
getPosition: function () {
var self = this
wx.getLocation({
success: function(res) {
const latitude = res.latitude
const longitude = res.longitude
wx.request({
url: 'https://api.map.baidu.com/reverse_geocoding/v3/?ak=Zk732rbyjd327q7Zj9EOtRjUn2ED1GWK&output=json&coordtype=wgs84ll&location=' + latitude + ',' + longitude,
success: function (res) {
self.setData({
cityName: res.data.result.addressComponent.city,
adcode: res.data.result.addressComponent.adcode,
district: res.data.result.addressComponent.district
})
self.getAreaId()
}
})
},
})
},
getAreaList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/getcityareabyid/' + self.data.cityId,
header: {
"token": self.data.token
},
success: function (res) {
self.setData({
selectList: res.data.areaList
})
}
})
},
getProjectList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/listvenuesproject',
header: {
"token": self.data.token
},
success: function (res) {
if (res.statusCode == 200) {
self.setData({
selectList: res.data.list
})
}
}
})
},
getTypeList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'app/wechatprogram/listvenuechargetype',
header: {
"token": self.data.token
},
success: function (res) {
self.setData({
selectList: res.data.chargeType
})
}
})
},
getToken: function () {
var self = this
wx.getStorage({
key: 'token',
success: function (res) {
self.setData({
token: res.data
})
self.getPosition()
},
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
categoryId: options.categoryId,
categoryName: options.categoryName,
requestIp: app.globalData.requestIp
})
this.getToken()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/list/list.json Normal file
View File

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

30
pages/list/list.wxml Normal file
View File

@ -0,0 +1,30 @@
<view class="select">
<view class="select-btn" bindtap="doSelcet" data-id="1">{{cityName}}{{areaName}}</view>
<view class="select-btn" bindtap="doSelcet" data-id="2">{{categoryName}}</view>
<view class="select-btn" bindtap="doSelcet" data-id="3">{{chargeName}}</view>
</view>
<view class="venue-list">
<view class="venue-box" bindtap="goDetail" wx:for="{{venueList}}" data-id="{{item.venuesInfoId}}" wx:key="idx">
<view class="venue-pic">
<image src="{{requestIp}}route/file/downloadfile/true/{{item.venuePanorama}}" class="venue-img"></image>
</view>
<view class="venue-info">
<view class="venue-title">
<text class="venue-name">{{item.venueName}}</text>
</view>
<view class="venue-address">{{item.venuePosition}}</view>
<!-- <view class="venue-phone">123456789</view> -->
</view>
</view>
<view class="no-data" wx:if="{{venueList.length == 0}}">
<image src="../../images/no-data.png"></image>
</view>
</view>
<view class="hide-select" bindtap="hideSelect" wx:if="{{showSelect}}">
<view class="select-box">
<view class="select-btn-box" catchtap="checkall">查看全部</view>
<view class="select-btn-box {{item.dictionaryId == areaId?'active': ''}}" wx:if="{{selectType == 1}}" catchtap="getNewList" wx:for="{{selectList}}" data-id="{{item.dictionaryId}}" data-name="{{item.dictionaryName}}" wx:key="idx">{{item.dictionaryName}}</view>
<view class="select-btn-box {{item.categoryId == categoryId?'active': ''}}" wx:if="{{selectType == 2}}" catchtap="getNewList" wx:for="{{selectList}}" data-id="{{item.categoryId}}" data-name="{{item.categoryName}}" wx:key="idx">{{item.categoryName}}</view>
<view class="select-btn-box {{item.dictionaryId == venueCharge?'active': ''}}" wx:if="{{selectType == 3}}" catchtap="getNewList" wx:for="{{selectList}}" data-id="{{item.dictionaryId}}" data-name="{{item.dictionaryName}}" wx:key="idx">{{item.dictionaryName}}</view>
</view>
</view>

115
pages/list/list.wxss Normal file
View File

@ -0,0 +1,115 @@
.select{
padding: 20rpx 0;
display: flex;
border-bottom: 1px solid #ddd;
font-size: 36rpx;
}
.select-btn{
flex: 1;
align-items: center;
justify-content: center;
display: flex;
border-right: 1px solid #ddd;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 28rpx;
}
.select-btn:last-child{
border: none
}
.venue-list{
width: 690rpx;
margin: 0 auto;
padding-bottom: 20rpx;
}
.venue-box{
display: flex;
justify-content: space-between;
padding: 15rpx;
border: 1px solid #ddd;
border-radius: 10rpx;
margin-top: 20rpx;
}
.venue-pic{
width: 35%;
height: 180rpx;
border-radius: 10rpx;
overflow: hidden;
}
.venue-img{
width: 100%;
height: 100%;
}
.venue-info{
width: 63%;
}
.venue-title{
display: flex;
justify-content: space-between;
}
.venue-name{
display: inline-block;
font-size: 34rpx;
}
.venue-pay{
background: green;
color: #fff;
display: inline-block;
width: 50rpx;
text-align: center;
font-size: 36rpx;
}
.venue-address{
font-size: 28rpx;
color: #BBBBBB;
margin-top: 20rpx;
}
.hide-select{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.6)
}
.select-box{
background: #fff;
width: 100%;
padding: 20rpx 30rpx;
box-sizing: border-box;
}
.select-btn-box{
display: inline-block;
width: 158rpx;
height: 60rpx;
color: #5E5E5E;
text-align: center;
line-height: 60rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 0 10rpx;
box-sizing: border-box;
margin-right: 10rpx;
margin-bottom: 10rpx;
background: #CBCBCB;
border-radius: 35rpx;
}
.select-btn-box.active{
background:rgba(75,122,254,1);
font-weight: bold;
color: #fff;
}
.select-btn-box:nth-child(4n){
margin-right: 0
}
.no-data{
padding: 150rpx 0;
text-align: center;
}
.no-data image{
width: 250rpx;
height: 250rpx;
}

66
pages/map/map.js Normal file
View File

@ -0,0 +1,66 @@
// 引用百度地图微信小程序JSAPI模块
var bmap = require('../../lib/bmap-wx.js');
var wxMarkerData = [];
Page({
data: {
markers: [],
latitude: 0,
longitude: 0,
rgcData: {}
},
goMap: function () {
var self = this
wx.getLocation({
type: 'gcj02', //返回可以用于wx.openLocation的经纬度
success(res) {
const latitude = self.data.latitude
const longitude = self.data.longitude
wx.openLocation({
latitude,
longitude,
scale: 15
})
}
})
},
makertap: function (e) {
var that = this;
var id = e.markerId;
that.showSearchInfo(wxMarkerData, id);
},
onLoad: function (options) {
this.setData({
longitude: parseFloat(options.long),
latitude: parseFloat(options.lng)
})
var that = this;
// 新建百度地图对象
var BMap = new bmap.BMapWX({
ak: 'Zk732rbyjd327q7Zj9EOtRjUn2ED1GWK'
});
var fail = function (data) {
console.log(data)
};
var success = function (data) {
wxMarkerData = data.wxMarkerData;
wxMarkerData[0].longitude = that.data.longitude
wxMarkerData[0].latitude = that.data.latitude
that.setData({
markers: wxMarkerData
});
that.setData({
latitude: wxMarkerData[0].latitude
});
that.setData({
longitude: wxMarkerData[0].longitude
});
}
// 发起regeocoding检索请求
BMap.regeocoding({
fail: fail,
success: success,
iconPath: '../../images/marker_red.png',
iconTapPath: '../../images/marker_red.png'
});
}
})

3
pages/map/map.json Normal file
View File

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

6
pages/map/map.wxml Normal file
View File

@ -0,0 +1,6 @@
<view class="map_container">
<map class="map" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" show-location="true" markers="{{markers}}"></map>
</view>
<view bindtap="goMap" class="go-here">
到这去
</view>

23
pages/map/map.wxss Normal file
View File

@ -0,0 +1,23 @@
page{
height: 100%;
}
.map_container{
height: 92%;
width: 100%;
}
.map {
height: 100%;
width: 100%;
}
.go-here{
height: 60rpx;
width: 180rpx;
margin: 15rpx auto;
border-radius: 10rpx;
color: #fff;
background: #50A4F3;
display: flex;
justify-content: center;
align-items: center;
}

View File

@ -0,0 +1,137 @@
// pages/matchDetail/matchDetail.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
requestIp: '',
token: '',
type: '',
matchId: '',
matchInfo: {},
activityInfo: {}
},
getMatchDetail: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/getmatchinfodetailrelease',
data: {
matchId: self.data.id
},
header: {
'token': self.data.token
},
success: function (res) {
var src = 'src="' + self.data.requestIp
if(res.data.data.matchSummary.indexOf('src="') != -1){
res.data.data.matchSummary =res.data.data.matchSummary.replace(/src="/g, src)
res.data.data.matchSummary =res.data.data.matchSummary.replace(/style="max-width:100%;"/g, '')
}
self.setData({
matchInfo: res.data.data
})
}
})
},
getActivityDetail: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/getactivityinfodetailrelease',
data: {
activityId: self.data.id
},
header: {
'token': self.data.token
},
success: function (res) {
console.log(res)
var src = 'src="' + self.data.requestIp
if(res.data.data.activitySummary.indexOf('src="') != -1){
res.data.data.activitySummary =res.data.data.activitySummary.replace(/src="/g, src)
res.data.data.activitySummary =res.data.data.activitySummary.replace(/style="max-width:100%;"/g, '')
}
self.setData({
activityInfo: res.data.data
})
}
})
},
getToken: function () {
var self = this
wx.getStorage({
key: 'token',
success: function (res) {
self.setData({
token: res.data
})
if(self.data.type == 'match'){
self.getMatchDetail()
}else{
self.getActivityDetail()
}
},
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
requestIp: app.globalData.requestIp,
id: options.id,
type: options.type
})
this.getToken()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,5 @@
{
"usingComponents": {
"htmltowxml": "plugin://htmltowxml/view"
}
}

View File

@ -0,0 +1,15 @@
<view class="match-img" wx:if="{{matchInfo.frontCover || activityInfo.frontCover}}">
<image src="{{requestIp}}route/file/downloadfile/true/{{matchInfo.frontCover}}" wx:if="{{type == 'match'}}"></image>
<image src="{{requestIp}}route/file/downloadfile/true/{{activityInfo.frontCover}}" wx:if="{{type == 'activity'}}"></image>
</view>
<view class="match-name" wx:if="{{type == 'match'}}">{{matchInfo.title}}</view>
<view class="match-name" wx:else>{{activityInfo.title}}</view>
<view class="match-detail">
<!-- <view class="match-summary-title">摘要</view> -->
<view class="match-summary-title" wx:if="{{type == 'match'}}">赛事详情</view>
<view class="match-summary-title" wx:else>活动详情</view>
<view class="match-summary">
<htmltowxml text="{{matchInfo.matchSummary}}" wx:if="{{type == 'match'}}"></htmltowxml>
<htmltowxml text="{{activityInfo.activitySummary}}" wx:else></htmltowxml>
</view>
</view>

View File

@ -0,0 +1,41 @@
.match-img, .match-img image{
width: 100%;
height: 400rpx;
}
.match-name{
padding: 20rpx 30rpx;
border-bottom: 10rpx solid #F7F7F7;
font-size: 34rpx;
font-weight: bold;
}
.match-detail{
padding: 10rpx 30rpx;
}
.match-summary-title{
padding-bottom: 20rpx;
font-size: 34rpx;
color: #5F5F5F;
font-weight: bold;
}
.match-summary{
padding: 10rpx;
margin-bottom: 10rpx;
}
.match-summary-text{
color: #BBB;
font-size: 28rpx;
line-height: 40rpx;
}
.title{
display: inline-block;
width: 22%;
text-align: right;
vertical-align: top;
}
.info{
display: inline-block;
width: 78%;
}
.html2wxml--html2wxml wx-view{
width: 100% !important;
}

View File

@ -0,0 +1,160 @@
// pages/matchList/matchList.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
token: '',
requestIp: '',
pageList: [],
type: '',
hideSelect: false
},
doSelect: function (e) {
var self = this
if(e.currentTarget.dataset.id == 1){
console.log('1')
} else if (e.currentTarget.dataset.id == 2){
console.log('2')
} else {
console.log('3')
}
self.setData({
hideSelect: true
})
},
checkall: function () {
},
getMatchList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/listpagearticlebycategoryrelease',
header: {
'token': self.data.token
},
data: {
articleCategoryId: '674b6d2a-637b-4f65-950e-1343b602574a'
},
success: function (res) {
if (res.statusCode == 200) {
for (var i = 0; i < res.data.rows.length; i++) {
res.data.rows[i].images = res.data.rows[i].images.split(',')[0]
}
self.setData({
pageList: res.data.rows
})
}
}
})
},
getActivityList: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/listpagearticlebycategoryrelease',
header: {
'token': self.data.token
},
data: {
articleCategoryId: '48f0147d-5e12-493a-9d24-eb2d4f74064c'
},
success: function (res) {
for (var i = 0; i < res.data.rows.length; i++) {
res.data.rows[i].images = res.data.rows[i].images.split(',')[0]
}
self.setData({
pageList: res.data.rows
})
}
})
},
goDetail: function (e) {
wx.navigateTo({
url: '../newsDetail/newsDetail?articleContentId=' + e.currentTarget.dataset.id,
})
},
hideSelect: function () {
this.setData({
hideSelect: false
})
},
getToken: function () {
var self = this
wx.getStorage({
key: 'token',
success: function (res) {
self.setData({
token: res.data
})
if(self.data.type == 'match'){
console.log('match')
self.getMatchList()
}else{
console.log('activity')
self.getActivityList()
}
},
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
requestIp: app.globalData.requestIp,
type: options.type
})
this.getToken()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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,26 @@
<view class="page-title" wx:if="{{type == 'match'}}">赛事</view>
<view class="page-title" wx:else>活动</view>
<view class="match-list" wx:if="{{type == 'match'}}">
<view class="match-box" bindtap="goDetail" wx:for="{{pageList}}" wx:key="index" data-id="{{item.articleContentId}}" data-type="match">
<view class="match">
<view class="mathch-image">
<image src="{{requestIp}}route/file/downloadfile/true/{{item.images}}"></image>
</view>
<view class="match-info">
<view class="match-name">{{item.title}}</view>
</view>
</view>
</view>
</view>
<view class="match-list" wx:else>
<view class="match-box" bindtap="goDetail" wx:for="{{pageList}}" wx:key="index" data-id="{{item.articleContentId}}" data-type="activity">
<view class="match">
<view class="mathch-image">
<image src="{{requestIp}}route/file/downloadfile/true/{{item.images}}"></image>
</view>
<view class="match-info">
<view class="match-name">{{item.title}}</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,80 @@
/* .top-select{
position: fixed;
top: 0;
left: 0;
right: 0;
padding: 15rpx 0;
display: flex;
background: #fff;
}
.select-item{
flex: 1;
text-align: center;
border-right: 1px solid #ddd;
}
.select-item:last-child{
border: none;
} */
.match-list{
/* margin-top: 70rpx; */
padding: 0 30rpx 10rpx;
}
.match-box{
border: 1px solid #ddd;
border-radius: 10rpx;
padding: 10rpx;
margin-top: 10rpx;
}
.match{
display: flex;
justify-content: space-between;
}
.mathch-image{
width: 40%;
height: 200rpx;
}
.mathch-image image{
width: 100%;
height: 100%;
border-radius: 10rpx;
}
.match-info{
width: 58%;
height: 200rpx;
/* border-bottom: 1px solid #ddd; */
}
.match-text{
color: #888;
font-size: 28rpx;
line-height: 55rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.sign-status{
padding: 10rpx 0;
text-align: right;
}
.status-info{
display: inline-block;
width: 150rpx;
padding: 10rpx 0;
color: #fff;
text-align: center;
border-radius: 40rpx;
}
.status-info.signing{
background: orange;
}
.status-info.sign-end{
background: #eee;
}
.page-title{
text-align: center;
padding: 10rpx;
background: linear-gradient(to bottom,#4B7AFE,rgb(161, 161, 243));
color: #fff;
font-size: 38rpx;
font-weight: bold;
margin-bottom: 10rpx;
}

View File

@ -0,0 +1,108 @@
// pages/newsDetail/newsDtail.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
requestIp: '',
articleContentId: '',
token: '',
articleInfo: {}
},
getNewsContent: function () {
var self = this
wx.request({
url: self.data.requestIp + 'wxminiapp/article/getarticledetailrelease',
data: {
articleContentId: self.data.articleContentId
},
header: {
'token': self.data.token
},
success: function (res) {
console.log(res)
var src = 'img src="' + self.data.requestIp
if(res.data.data.content.indexOf('src="') != -1){
res.data.data.content =res.data.data.content.replace(/src="/g, src)
}
self.setData({
articleInfo: res.data.data
})
}
})
},
getToken: function () {
var self = this
wx.getStorage({
key: 'token',
success: function (res) {
console.log(res)
self.setData({
token: res.data
})
self.getNewsContent()
},
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
requestIp: app.globalData.requestIp,
articleContentId: options.articleContentId
})
this.getToken()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,5 @@
{
"usingComponents": {
"htmltowxml": "plugin://htmltowxml/view"
}
}

View File

@ -0,0 +1,12 @@
<view class="news">
<view class="news-title">
<view class="title">{{articleInfo.title}}</view>
<view class="news-from-date">
<view>来源:{{articleInfo.source}}</view>
<view>{{articleInfo.publishDate}}</view>
</view>
</view>
<view class="news-content">
<htmltowxml text="{{articleInfo.content}}"></htmltowxml>
</view>
</view>

View File

@ -0,0 +1,18 @@
.news{
padding: 0 30rpx;
}
.news-title{
padding: 15rpx 0;
border-bottom: 1px solid #ddd;
margin-bottom: 30rpx;
}
.title{
font-weight: bold;
font-size: 36rpx;
text-align: center;
margin-bottom: 20rpx;
}
.news-from-date{
display: flex;
justify-content: space-between;
}

Some files were not shown because too many files have changed in this diff Show More