commit 4458f6037512a1dbc03361923c15f8a6dbf66123 Author: dong_bo0602 <358256383@qq.com> Date: Tue Jun 14 10:56:41 2022 +0800 0614 diff --git a/app.js b/app.js new file mode 100644 index 0000000..f3da787 --- /dev/null +++ b/app.js @@ -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/' + } +}) \ No newline at end of file diff --git a/app.json b/app.json new file mode 100644 index 0000000..553cc9c --- /dev/null +++ b/app.json @@ -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" + } + } +} diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..9f805f5 --- /dev/null +++ b/app.wxss @@ -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; +} diff --git a/images/activity.png b/images/activity.png new file mode 100644 index 0000000..9d93738 Binary files /dev/null and b/images/activity.png differ diff --git a/images/add.png b/images/add.png new file mode 100644 index 0000000..f40a7cc Binary files /dev/null and b/images/add.png differ diff --git a/images/address.png b/images/address.png new file mode 100644 index 0000000..6154847 Binary files /dev/null and b/images/address.png differ diff --git a/images/avatar.png b/images/avatar.png new file mode 100644 index 0000000..bf17584 Binary files /dev/null and b/images/avatar.png differ diff --git a/images/center-on.png b/images/center-on.png new file mode 100644 index 0000000..300fd94 Binary files /dev/null and b/images/center-on.png differ diff --git a/images/center.png b/images/center.png new file mode 100644 index 0000000..b166d5c Binary files /dev/null and b/images/center.png differ diff --git a/images/competition.png b/images/competition.png new file mode 100644 index 0000000..93e37fb Binary files /dev/null and b/images/competition.png differ diff --git a/images/delete.png b/images/delete.png new file mode 100644 index 0000000..db02a2f Binary files /dev/null and b/images/delete.png differ diff --git a/images/go.png b/images/go.png new file mode 100644 index 0000000..9d36135 Binary files /dev/null and b/images/go.png differ diff --git a/images/home-on.png b/images/home-on.png new file mode 100644 index 0000000..9537d7e Binary files /dev/null and b/images/home-on.png differ diff --git a/images/home.png b/images/home.png new file mode 100644 index 0000000..4fe20cc Binary files /dev/null and b/images/home.png differ diff --git a/images/link-bg1.png b/images/link-bg1.png new file mode 100644 index 0000000..4ad2815 Binary files /dev/null and b/images/link-bg1.png differ diff --git a/images/link-bg2.png b/images/link-bg2.png new file mode 100644 index 0000000..85307bc Binary files /dev/null and b/images/link-bg2.png differ diff --git a/images/link-bg3.png b/images/link-bg3.png new file mode 100644 index 0000000..7f6316e Binary files /dev/null and b/images/link-bg3.png differ diff --git a/images/link-bg4.png b/images/link-bg4.png new file mode 100644 index 0000000..a3e85ba Binary files /dev/null and b/images/link-bg4.png differ diff --git a/images/location.png b/images/location.png new file mode 100644 index 0000000..fe861ee Binary files /dev/null and b/images/location.png differ diff --git a/images/logo.jpg b/images/logo.jpg new file mode 100644 index 0000000..ef01962 Binary files /dev/null and b/images/logo.jpg differ diff --git a/images/map-on.png b/images/map-on.png new file mode 100644 index 0000000..3a819c9 Binary files /dev/null and b/images/map-on.png differ diff --git a/images/map.png b/images/map.png new file mode 100644 index 0000000..700a610 Binary files /dev/null and b/images/map.png differ diff --git a/images/marker_red.png b/images/marker_red.png new file mode 100644 index 0000000..8b4e20d Binary files /dev/null and b/images/marker_red.png differ diff --git a/images/marker_yellow.png b/images/marker_yellow.png new file mode 100644 index 0000000..febe8f6 Binary files /dev/null and b/images/marker_yellow.png differ diff --git a/images/match.jpg b/images/match.jpg new file mode 100644 index 0000000..16261c9 Binary files /dev/null and b/images/match.jpg differ diff --git a/images/no-data.png b/images/no-data.png new file mode 100644 index 0000000..d0aa2c7 Binary files /dev/null and b/images/no-data.png differ diff --git a/images/order-icon.png b/images/order-icon.png new file mode 100644 index 0000000..d8cc29b Binary files /dev/null and b/images/order-icon.png differ diff --git a/images/order.png b/images/order.png new file mode 100644 index 0000000..3cd7b9c Binary files /dev/null and b/images/order.png differ diff --git a/images/phone.png b/images/phone.png new file mode 100644 index 0000000..1e0353e Binary files /dev/null and b/images/phone.png differ diff --git a/images/race.png b/images/race.png new file mode 100644 index 0000000..c684442 Binary files /dev/null and b/images/race.png differ diff --git a/images/register-address.png b/images/register-address.png new file mode 100644 index 0000000..f3e996c Binary files /dev/null and b/images/register-address.png differ diff --git a/images/register-avatar.png b/images/register-avatar.png new file mode 100644 index 0000000..77dffcb Binary files /dev/null and b/images/register-avatar.png differ diff --git a/images/register-name.png b/images/register-name.png new file mode 100644 index 0000000..a5df2e0 Binary files /dev/null and b/images/register-name.png differ diff --git a/images/register-phone.png b/images/register-phone.png new file mode 100644 index 0000000..4e2c45f Binary files /dev/null and b/images/register-phone.png differ diff --git a/images/register.png b/images/register.png new file mode 100644 index 0000000..cb5f04a Binary files /dev/null and b/images/register.png differ diff --git a/images/search.png b/images/search.png new file mode 100644 index 0000000..d3d3e99 Binary files /dev/null and b/images/search.png differ diff --git a/images/search1.png b/images/search1.png new file mode 100644 index 0000000..12fd6a0 Binary files /dev/null and b/images/search1.png differ diff --git a/images/search2.png b/images/search2.png new file mode 100644 index 0000000..e821688 Binary files /dev/null and b/images/search2.png differ diff --git a/images/search3.png b/images/search3.png new file mode 100644 index 0000000..e49cbdf Binary files /dev/null and b/images/search3.png differ diff --git a/images/search4.png b/images/search4.png new file mode 100644 index 0000000..468462a Binary files /dev/null and b/images/search4.png differ diff --git a/images/search5.png b/images/search5.png new file mode 100644 index 0000000..2b2c00d Binary files /dev/null and b/images/search5.png differ diff --git a/images/search6.png b/images/search6.png new file mode 100644 index 0000000..84c9951 Binary files /dev/null and b/images/search6.png differ diff --git a/images/star-r.png b/images/star-r.png new file mode 100644 index 0000000..ea4c6ea Binary files /dev/null and b/images/star-r.png differ diff --git a/images/star.png b/images/star.png new file mode 100644 index 0000000..40db5be Binary files /dev/null and b/images/star.png differ diff --git a/images/title-bg.png b/images/title-bg.png new file mode 100644 index 0000000..86584d1 Binary files /dev/null and b/images/title-bg.png differ diff --git a/images/upload.png b/images/upload.png new file mode 100644 index 0000000..c6f1a88 Binary files /dev/null and b/images/upload.png differ diff --git a/images/venue.jpg b/images/venue.jpg new file mode 100644 index 0000000..5d8e526 Binary files /dev/null and b/images/venue.jpg differ diff --git a/lib/bmap-wx.js b/lib/bmap-wx.js new file mode 100644 index 0000000..c6ca337 --- /dev/null +++ b/lib/bmap-wx.js @@ -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; \ No newline at end of file diff --git a/pages/activity/activity.js b/pages/activity/activity.js new file mode 100644 index 0000000..6a8fc68 --- /dev/null +++ b/pages/activity/activity.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/activity/activity.json b/pages/activity/activity.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/activity/activity.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/activity/activity.wxml b/pages/activity/activity.wxml new file mode 100644 index 0000000..1fec83a --- /dev/null +++ b/pages/activity/activity.wxml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + 赛事 + Competition + + + + + + + + 活动 + Activity + + + + + 热门赛事 + + + + + + + {{item.title}} + + + + + + 最新活动 + + + + + + + {{item.title}} + {{item.activityTimeEnd}} + + + + diff --git a/pages/activity/activity.wxss b/pages/activity/activity.wxss new file mode 100644 index 0000000..a2bbc54 --- /dev/null +++ b/pages/activity/activity.wxss @@ -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%; +} \ No newline at end of file diff --git a/pages/around/around.js b/pages/around/around.js new file mode 100644 index 0000000..48818c8 --- /dev/null +++ b/pages/around/around.js @@ -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() + } + }) + } +}) \ No newline at end of file diff --git a/pages/around/around.json b/pages/around/around.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/around/around.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/around/around.wxml b/pages/around/around.wxml new file mode 100644 index 0000000..3eb2b68 --- /dev/null +++ b/pages/around/around.wxml @@ -0,0 +1,29 @@ + + + + 场馆 + + + + 健身 + + + + 公园 + + + + 运动场 + + + + + + + + {{placeData.title}} + {{placeData.address}} + {{placeData.telephone}} + + 到这去 + \ No newline at end of file diff --git a/pages/around/around.wxss b/pages/around/around.wxss new file mode 100644 index 0000000..928881e --- /dev/null +++ b/pages/around/around.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/book/book.js b/pages/book/book.js new file mode 100644 index 0000000..21305c1 --- /dev/null +++ b/pages/book/book.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/book/book.json b/pages/book/book.json new file mode 100644 index 0000000..8b3330f --- /dev/null +++ b/pages/book/book.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "htmltowxml": "plugin://htmltowxml/view" + } +} \ No newline at end of file diff --git a/pages/book/book.wxml b/pages/book/book.wxml new file mode 100644 index 0000000..bcfec4e --- /dev/null +++ b/pages/book/book.wxml @@ -0,0 +1,30 @@ + + + {{projectName}} + {{week}} + {{date}} + + + + + {{item.groundName}} + + + + {{item.timeStr}}-{{item.timeEnd}} + {{item.price}}元 + 免费 + + + 暂无可预订场次 + + + 合计:¥{{allPrice}} + 提交订单 + + + + {{item.start}}-{{item.end}} + {{item.groundName}} + + \ No newline at end of file diff --git a/pages/book/book.wxss b/pages/book/book.wxss new file mode 100644 index 0000000..204022a --- /dev/null +++ b/pages/book/book.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/center/center.js b/pages/center/center.js new file mode 100644 index 0000000..a4d9492 --- /dev/null +++ b/pages/center/center.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/center/center.json b/pages/center/center.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/center/center.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/center/center.wxml b/pages/center/center.wxml new file mode 100644 index 0000000..5597576 --- /dev/null +++ b/pages/center/center.wxml @@ -0,0 +1,27 @@ + + + + + + 场馆订单 + + + + + + + + 场馆入驻 + 已通过 + 未通过 + + + + + \ No newline at end of file diff --git a/pages/center/center.wxss b/pages/center/center.wxss new file mode 100644 index 0000000..6be210c --- /dev/null +++ b/pages/center/center.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/detail/detail.js b/pages/detail/detail.js new file mode 100644 index 0000000..195a150 --- /dev/null +++ b/pages/detail/detail.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/detail/detail.json b/pages/detail/detail.json new file mode 100644 index 0000000..79be446 --- /dev/null +++ b/pages/detail/detail.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + + } +} \ No newline at end of file diff --git a/pages/detail/detail.wxml b/pages/detail/detail.wxml new file mode 100644 index 0000000..1f685a5 --- /dev/null +++ b/pages/detail/detail.wxml @@ -0,0 +1,99 @@ + + + + + + + + + + + {{venueInfo.venueName}} + + + + + + + {{venueInfo.venuePosition}} + + 到这去 + + + + 营业时间:{{venueInfo.businessHours}} + + + + {{venueInfo.venueTelephone}} + + + + + 交通方式: + + {{venueInfo.venueRoute}} + + + + {{item.projectCategory}} + + {{desc}} + 场地设施 + {{project}} + + + + 场馆服务 + + + + {{item}} + + + + + + 其他服务 + + {{other}} + + + + 注意事项 + + {{venueInfo.bookingTips}} + + + [更多] + + + + + + 预定 + \ No newline at end of file diff --git a/pages/detail/detail.wxss b/pages/detail/detail.wxss new file mode 100644 index 0000000..2dc632c --- /dev/null +++ b/pages/detail/detail.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/exerciseNews/exerciseNews.js b/pages/exerciseNews/exerciseNews.js new file mode 100644 index 0000000..7ff1302 --- /dev/null +++ b/pages/exerciseNews/exerciseNews.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/exerciseNews/exerciseNews.json b/pages/exerciseNews/exerciseNews.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/exerciseNews/exerciseNews.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/exerciseNews/exerciseNews.wxml b/pages/exerciseNews/exerciseNews.wxml new file mode 100644 index 0000000..ade01a1 --- /dev/null +++ b/pages/exerciseNews/exerciseNews.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + {{item.title}} + {{item.publishDate}} + 来源:{{item.source}} + + + \ No newline at end of file diff --git a/pages/exerciseNews/exerciseNews.wxss b/pages/exerciseNews/exerciseNews.wxss new file mode 100644 index 0000000..766aa04 --- /dev/null +++ b/pages/exerciseNews/exerciseNews.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/home/home.js b/pages/home/home.js new file mode 100644 index 0000000..851be15 --- /dev/null +++ b/pages/home/home.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/home/home.json b/pages/home/home.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/home/home.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/home/home.wxml b/pages/home/home.wxml new file mode 100644 index 0000000..f2ea7d1 --- /dev/null +++ b/pages/home/home.wxml @@ -0,0 +1,39 @@ + + + + + + + + + + + 预约租赁 + + + + 赛事活动 + + + + 科学健身 + + + + 体育新闻 + + + + 场馆推荐 + + + + + + + {{item.venueName}} + + {{item.venuePosition}} + + + diff --git a/pages/home/home.wxss b/pages/home/home.wxss new file mode 100644 index 0000000..e28ae53 --- /dev/null +++ b/pages/home/home.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..005225b --- /dev/null +++ b/pages/index/index.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml new file mode 100644 index 0000000..ed764dc --- /dev/null +++ b/pages/index/index.wxml @@ -0,0 +1,28 @@ + + + + + + + + {{item.categoryName}} + + + + + + + + + + + + {{item.venueName}} + + {{item.venuePosition}} + + + + diff --git a/pages/index/index.wxss b/pages/index/index.wxss new file mode 100644 index 0000000..032c903 --- /dev/null +++ b/pages/index/index.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/list/list.js b/pages/list/list.js new file mode 100644 index 0000000..e820287 --- /dev/null +++ b/pages/list/list.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/list/list.json b/pages/list/list.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/list/list.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/list/list.wxml b/pages/list/list.wxml new file mode 100644 index 0000000..259b1ae --- /dev/null +++ b/pages/list/list.wxml @@ -0,0 +1,30 @@ + + {{cityName}}{{areaName}} + {{categoryName}} + {{chargeName}} + + + + + + + + + {{item.venueName}} + + {{item.venuePosition}} + + + + + + + + + + 查看全部 + {{item.dictionaryName}} + {{item.categoryName}} + {{item.dictionaryName}} + + \ No newline at end of file diff --git a/pages/list/list.wxss b/pages/list/list.wxss new file mode 100644 index 0000000..fbf2866 --- /dev/null +++ b/pages/list/list.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/map/map.js b/pages/map/map.js new file mode 100644 index 0000000..46fea2c --- /dev/null +++ b/pages/map/map.js @@ -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' + }); + } +}) \ No newline at end of file diff --git a/pages/map/map.json b/pages/map/map.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/map/map.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/map/map.wxml b/pages/map/map.wxml new file mode 100644 index 0000000..9557413 --- /dev/null +++ b/pages/map/map.wxml @@ -0,0 +1,6 @@ + + + + + 到这去 + diff --git a/pages/map/map.wxss b/pages/map/map.wxss new file mode 100644 index 0000000..5935bbe --- /dev/null +++ b/pages/map/map.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/matchDetail/matchDetail.js b/pages/matchDetail/matchDetail.js new file mode 100644 index 0000000..35924d4 --- /dev/null +++ b/pages/matchDetail/matchDetail.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/matchDetail/matchDetail.json b/pages/matchDetail/matchDetail.json new file mode 100644 index 0000000..f510c82 --- /dev/null +++ b/pages/matchDetail/matchDetail.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "htmltowxml": "plugin://htmltowxml/view" + } +} \ No newline at end of file diff --git a/pages/matchDetail/matchDetail.wxml b/pages/matchDetail/matchDetail.wxml new file mode 100644 index 0000000..846e5c7 --- /dev/null +++ b/pages/matchDetail/matchDetail.wxml @@ -0,0 +1,15 @@ + + + + +{{matchInfo.title}} +{{activityInfo.title}} + + + 赛事详情 + 活动详情 + + + + + \ No newline at end of file diff --git a/pages/matchDetail/matchDetail.wxss b/pages/matchDetail/matchDetail.wxss new file mode 100644 index 0000000..4be794c --- /dev/null +++ b/pages/matchDetail/matchDetail.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/matchList/matchList.js b/pages/matchList/matchList.js new file mode 100644 index 0000000..42d6be6 --- /dev/null +++ b/pages/matchList/matchList.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/matchList/matchList.json b/pages/matchList/matchList.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/matchList/matchList.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/matchList/matchList.wxml b/pages/matchList/matchList.wxml new file mode 100644 index 0000000..053376a --- /dev/null +++ b/pages/matchList/matchList.wxml @@ -0,0 +1,26 @@ +赛事 +活动 + + + + + + + + {{item.title}} + + + + + + + + + + + + {{item.title}} + + + + \ No newline at end of file diff --git a/pages/matchList/matchList.wxss b/pages/matchList/matchList.wxss new file mode 100644 index 0000000..a8e538f --- /dev/null +++ b/pages/matchList/matchList.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/newsDetail/newsDetail.js b/pages/newsDetail/newsDetail.js new file mode 100644 index 0000000..8969a15 --- /dev/null +++ b/pages/newsDetail/newsDetail.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/newsDetail/newsDetail.json b/pages/newsDetail/newsDetail.json new file mode 100644 index 0000000..8b3330f --- /dev/null +++ b/pages/newsDetail/newsDetail.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "htmltowxml": "plugin://htmltowxml/view" + } +} \ No newline at end of file diff --git a/pages/newsDetail/newsDetail.wxml b/pages/newsDetail/newsDetail.wxml new file mode 100644 index 0000000..25730e2 --- /dev/null +++ b/pages/newsDetail/newsDetail.wxml @@ -0,0 +1,12 @@ + + + {{articleInfo.title}} + + 来源:{{articleInfo.source}} + {{articleInfo.publishDate}} + + + + + + diff --git a/pages/newsDetail/newsDetail.wxss b/pages/newsDetail/newsDetail.wxss new file mode 100644 index 0000000..da19521 --- /dev/null +++ b/pages/newsDetail/newsDetail.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/order/order.js b/pages/order/order.js new file mode 100644 index 0000000..8d3cf3f --- /dev/null +++ b/pages/order/order.js @@ -0,0 +1,98 @@ +// pages/order/order.js +const app =getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + bookList: [], + token: '', + requestIp: '' + }, + getList: function () { + var self = this + wx.request({ + url: self.data.requestIp + 'app/wechatprogram/listpagemyticket', + header: { + "token": self.data.token + }, + success: function (res) { + self.setData({ + bookList: res.data.rows + }) + } + }) + }, + getToken: function () { + var self = this + wx.getStorage({ + key: 'token', + success: function (res) { + console.log(res) + self.setData({ + token: res.data + }) + 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 () { + + } +}) \ No newline at end of file diff --git a/pages/order/order.json b/pages/order/order.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/order/order.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/order/order.wxml b/pages/order/order.wxml new file mode 100644 index 0000000..50854e9 --- /dev/null +++ b/pages/order/order.wxml @@ -0,0 +1,14 @@ + + + + + {{item.venuesName}}({{item.projectName}}) + 退订 + + 场地:{{item.groundName}} + {{item.price}}元 + 免费 + {{item.bookingOrderDate}} {{item.timeStr}}-{{item.timeEnd}} + + + diff --git a/pages/order/order.wxss b/pages/order/order.wxss new file mode 100644 index 0000000..ea81a1d --- /dev/null +++ b/pages/order/order.wxss @@ -0,0 +1,69 @@ +.venue-list{ + width: 690rpx; + margin: 0 auto; +} +.venue-box{ + display: flex; + justify-content: space-between; + padding: 20rpx; + border: 1px solid #ddd; + margin-bottom: 20rpx; + border-radius: 10rpx; +} +.venue-pic{ + width: 35%; + height: 180rpx; + border-radius: 10rpx; + overflow: hidden; +} +.venue-img{ + width: 100%; + height: 100%; +} +.venue-info{ + width: 100%; +} +.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: #BBB; + margin-top: 10rpx; +} +.part-title{ + font-size: 36rpx; + padding: 15rpx 0; + border-bottom: 1px solid #ddd; +} +.venue-time{ + display: inline-block; + padding: 10rpx 20rpx; + background: #4B7AFE; + color: #fff; + margin-top: 10rpx; + border-radius: 10rpx; +} +.cancel-book{ + margin-top: 10rpx; +} +.cancel-btn{ + display: inline-block; + padding: 0 20rpx; + color: #fff; + border-radius: 10rpx; + background: rgba(255, 0, 0, 0.604); +} \ No newline at end of file diff --git a/pages/sportNews/sportNews.js b/pages/sportNews/sportNews.js new file mode 100644 index 0000000..8291f20 --- /dev/null +++ b/pages/sportNews/sportNews.js @@ -0,0 +1,112 @@ +// pages/sportNews/sportNews.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + curTab: 'bd29391f-b00a-4a29-9c2c-6ddfe53a60fe', + requestIp: '', + newsList: [], + token: '' + }, + changeTab: function (e) { + this.setData({ + curTab: e.currentTarget.dataset.id + }) + this.getList() + }, + getList: function () { + var self = this + wx.request({ + url: self.data.requestIp + 'wxminiapp/article/listpagearticlebycategoryrelease', + data: { + articleCategoryId: 'c4ccdc29-e351-440d-b6ac-ef162a73a972' + }, + header: { + 'token': self.data.token + }, + success: function (res) { + self.setData({ + newsList: res.data.rows + }) + } + }) + }, + goDetail: function (e) { + wx.navigateTo({ + url: '../newsDetail/newsDetail?articleContentId=' + e.currentTarget.dataset.id, + }) + }, + getToken: function () { + var self = this + wx.getStorage({ + key: 'token', + success: function (res) { + self.setData({ + token: res.data + }) + 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 () { + + } +}) \ No newline at end of file diff --git a/pages/sportNews/sportNews.json b/pages/sportNews/sportNews.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/sportNews/sportNews.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/sportNews/sportNews.wxml b/pages/sportNews/sportNews.wxml new file mode 100644 index 0000000..cbb6d5b --- /dev/null +++ b/pages/sportNews/sportNews.wxml @@ -0,0 +1,18 @@ + + + + + + + + + {{item.title}} + {{item.publishDate}} + 来源:{{item.source}} + + + \ No newline at end of file diff --git a/pages/sportNews/sportNews.wxss b/pages/sportNews/sportNews.wxss new file mode 100644 index 0000000..4cd2e64 --- /dev/null +++ b/pages/sportNews/sportNews.wxss @@ -0,0 +1,64 @@ +.tab{ + position: fixed; + top: 0; + left: 0; + right: 0; + width: 100%; + padding: 0 30rpx; + box-sizing: border-box; + overflow-x: scroll; + white-space: nowrap; +} +.tab-btn{ + display: inline-block; + width: 158rpx; + text-align: center; + line-height: 60rpx; + margin-right: 20rpx; + border-radius: 35rpx; + background:rgba(203,203,203,.3); + font-size: 28rpx; + color: #5e5e5e; +} +.tab-btn.active{ + color: #fff; + background: #4B7AFE; +} +.news-list{ + margin-top: 70rpx; + padding: 0 30rpx 10rpx; +} +.news-box{ + padding: 10rpx; + border: 1px solid #ddd; + display: flex; + border-radius: 10rpx; + justify-content: space-between; + margin-top: 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; + padding: 5rpx 0; + font-size: 34rpx; + color: #000; +} +.news-text{ + color: #BBB; + font-size: 28rpx; + margin-top: 10rpx; +} \ No newline at end of file diff --git a/pages/venueIntro/venueIntro.js b/pages/venueIntro/venueIntro.js new file mode 100644 index 0000000..7e161d9 --- /dev/null +++ b/pages/venueIntro/venueIntro.js @@ -0,0 +1,101 @@ +// pages/venueIntro/venueIntro.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + requestIp: '', + token: '', + venuesInfoId: '', + text: '' + }, + getText: 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) { + console.log(res) + self.setData({ + text: res.data.data.venueDescription + }) + } + }) + }, + getToken: function () { + var self = this + wx.getStorage({ + key: 'token', + success: function (res) { + self.setData({ + token: res.data + }) + self.getText() + }, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log(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 () { + + } +}) \ No newline at end of file diff --git a/pages/venueIntro/venueIntro.json b/pages/venueIntro/venueIntro.json new file mode 100644 index 0000000..8b3330f --- /dev/null +++ b/pages/venueIntro/venueIntro.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "htmltowxml": "plugin://htmltowxml/view" + } +} \ No newline at end of file diff --git a/pages/venueIntro/venueIntro.wxml b/pages/venueIntro/venueIntro.wxml new file mode 100644 index 0000000..f8ceda0 --- /dev/null +++ b/pages/venueIntro/venueIntro.wxml @@ -0,0 +1,6 @@ + + 场馆介绍 + + + + \ No newline at end of file diff --git a/pages/venueIntro/venueIntro.wxss b/pages/venueIntro/venueIntro.wxss new file mode 100644 index 0000000..6d35b31 --- /dev/null +++ b/pages/venueIntro/venueIntro.wxss @@ -0,0 +1,12 @@ +.title{ + font-size: 38rpx; + font-weight: bold; + text-align: center; + padding: 15rpx; + background: linear-gradient(to bottom,#4B7AFE,rgb(161, 161, 243)); + color: #fff; + margin-bottom: 20rpx; +} +.text-content{ + padding: 0 15rpx; +} \ No newline at end of file diff --git a/pages/venueRegister/venueRegister.js b/pages/venueRegister/venueRegister.js new file mode 100644 index 0000000..3e65d82 --- /dev/null +++ b/pages/venueRegister/venueRegister.js @@ -0,0 +1,246 @@ +// pages/venueRegister/venueRegister.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + requestIp: '', + photoList: [], + registerInfo: { + orgName: '', + userName: '', + cellphone: '', + papers: [] + }, + papers: '', + passtype: '', + orgName: '', + registerName: '', + cellphone: '', + registerId: '', + userName: '' + }, + inputing: function (e) { + if(e.currentTarget.dataset.type == 'org'){ + this.setData({ + 'registerInfo.orgName': e.detail.value + }) + } else if (e.currentTarget.dataset.type == 'name'){ + this.setData({ + 'registerInfo.userName': e.detail.value + }) + } else if (e.currentTarget.dataset.type == 'phone'){ + this.setData({ + 'registerInfo.cellphone': e.detail.value + }) + } else { + this.setData({ + 'registerInfo.location': e.detail.value + }) + } + }, + selectPhoto: function () { + var self = this; + wx.chooseImage({ + count: 6, + sizeType: ['original', 'compressed'], + sourceType: ['album', 'camera'], + success: function (res) { + const tempFilePaths = res.tempFilePaths; + var length = self.data.photoList.length + tempFilePaths.length + if(length > 6){ + wx.showToast({ + title: '最多上传6张图片', + }) + return; + } + self.getPhotoId(tempFilePaths); + }, + }) + }, + + getPhotoId: function (tempFilePaths) { + var self = this + for(var i = 0; i < tempFilePaths.length; i++){ + wx.uploadFile({ + url: self.data.requestIp + 'app/file/uploadimage', + filePath: tempFilePaths[i], + name: 'image', + header: { + 'token': self.data.token + }, + method: 'post', + success: function (res) { + var data = JSON.parse(res.data); + if(self.data.papers){ + self.data.papers += ',' + data.data; + } else { + self.data.papers = data.data; + } + var photoPath = self.data.requestIp + 'route/file/downloadfile/true/' + data.data; + console.log(photoPath); + self.data.photoList.push(photoPath) + self.setData({ + photoList: self.data.photoList, + papers: self.data.papers + }) + } + }) + } + }, + deletePhoto: function (e) { + var self = this + var cur = parseInt(e.currentTarget.dataset.idx) + var result = this.data.photoList + result.splice(cur,1) + var photoId = self.data.papers.split(','); + photoId.splice(cur,1) + var ids = ''; + photoId.forEach(element =>{ + ids += element + ',' + }); + this.setData({ + photoList: result, + papers: ids + }) + }, + submitRegister: function () { + var self = this + var info = { + orgName: self.data.orgName, + registerName: self.data.registerName, + cellphone: self.data.cellphone, + papers: self.data.papers, + registerId: self.data.registerId + } + var url = 'wxminiapp/register/saveregisterinfo' + if (self.data.registerId) { + url = 'wxminiapp/register/updateRegisterInfo' + } + wx.request({ + url: self.data.requestIp + url, + header: { + 'token': self.data.token + }, + method: 'post', + 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) + } + }) + } + } + }) + }, + 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.data) + var img = res.data.data.papers.split(',') + img.forEach(e=>{ + if (e) { + self.data.photoList.push(self.data.requestIp + 'route/file/downloadfile/true/' + e) + } + }) + self.setData({ + passtype: res.data.data.passType, + cellphone: res.data.data.cellphone, + orgName: res.data.data.orgName, + papers: res.data.data.papers, + photoList: self.data.photoList, + registerName: res.data.data.registerName, + registerId: res.data.data.registerId, + userName:res.data.data.userName + }) + } + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + 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 () { + + } +}) \ No newline at end of file diff --git a/pages/venueRegister/venueRegister.json b/pages/venueRegister/venueRegister.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/venueRegister/venueRegister.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/venueRegister/venueRegister.wxml b/pages/venueRegister/venueRegister.wxml new file mode 100644 index 0000000..61fbcf9 --- /dev/null +++ b/pages/venueRegister/venueRegister.wxml @@ -0,0 +1,41 @@ + + + 入驻申请 + 包头市体育局全民健身平台 + + + + + + + + + + + + + + + 相关证件 + + + + + + + + + + + 审核状态: + 审核中 + 已通过 + 未通过 + + 后台地址:https://www.tenlion.cn/venuebooking + 登录账号:{{userName}} + 默认密码:123456 + 审核意见:123 + 提交 + + \ No newline at end of file diff --git a/pages/venueRegister/venueRegister.wxss b/pages/venueRegister/venueRegister.wxss new file mode 100644 index 0000000..0708da9 --- /dev/null +++ b/pages/venueRegister/venueRegister.wxss @@ -0,0 +1,95 @@ +.register-container{ + width: 690rpx; + margin: 0 auto; +} +.top-bg{ + padding: 50rpx 0; + background: linear-gradient(to bottom,#4B7AFE,rgb(161, 161, 243)); + margin-bottom: 20rpx; +} +.page-title{ + text-align: center; + font-size: 46rpx; + color: #fff; +} +.page-text{ + text-align: center; + font-size: 32rpx; + color: #fff; + margin: 20rpx 0; +} +input{ + width: 100%; + height: 65rpx; + border: 1rpx solid #ddd; + margin-bottom: 15rpx; + background: #fff; + padding-left: 65rpx; + box-sizing: border-box; + font-size: 30rpx; +} +.text{ + padding: 0 15rpx; + line-height: 65rpx; + border: 1rpx solid #ddd; +} +.photo-list{ + margin-bottom: 15rpx; +} +.photo-box{ + display: inline-block; + width: 30%; + margin-right: 10rpx; + position: relative; +} +.photo-list image{ + width: 100%; + height: 180rpx; +} +.photo-list image:nth-child(3){ + margin-right: 0; +} +.photo-list image.add-btn{ + width: 80rpx; + height: 80rpx; + vertical-align: top; + margin-right: 0; +} +.submit-register{ + background: #4B7AFE; + text-align: center; + color: #fff; + font-size: 34rpx; + line-height: 80rpx; + border-radius: 10rpx; + margin-top: 15rpx; +} +.delete{ + position: absolute; + top: -12rpx; + right: -12rpx; + width: 30rpx; + height: 30rpx; +} +.delete image{ + width: 100%; + height: 100%; + vertical-align: top; +} +.input-container{ + position: relative; +} +.input-container image{ + width: 40rpx; + height: 40rpx; + position: absolute; + top: 12rpx; + left: 12rpx; +} +.text-box{ + line-height: 65rpx; + font-size: 30rpx; +} +.link{ + color: #4B7AFE; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..bce0733 --- /dev/null +++ b/project.config.json @@ -0,0 +1,57 @@ +{ + "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "setting": { + "urlCheck": true, + "es6": false, + "enhance": true, + "postcss": true, + "preloadBackgroundData": false, + "minified": true, + "newFeature": true, + "coverView": true, + "nodeModules": false, + "autoAudits": false, + "showShadowRootInWxmlPanel": true, + "scopeDataCheck": false, + "uglifyFileName": false, + "checkInvalidKey": true, + "checkSiteMap": true, + "uploadWithSourceMap": true, + "compileHotReLoad": false, + "useMultiFrameRuntime": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "enableEngineNative": false, + "bundle": false, + "useIsolateContext": true, + "useCompilerModule": true, + "userConfirmedUseCompilerModuleSwitch": false, + "userConfirmedBundleSwitch": false, + "packNpmManually": false, + "packNpmRelationList": [], + "minifyWXSS": true, + "minifyWXML": true, + "disableUseStrict": false, + "useStaticServer": true, + "showES6CompileOption": false, + "useCompilerPlugins": false, + "lazyloadPlaceholderEnable": false, + "ignoreUploadUnusedFiles": true + }, + "compileType": "miniprogram", + "simulatorType": "wechat", + "simulatorPluginLibVersion": {}, + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + }, + "libVersion": "2.24.5", + "packOptions": { + "ignore": [], + "include": [] + } +} \ No newline at end of file diff --git a/sitemap.json b/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/utils/util.js b/utils/util.js new file mode 100644 index 0000000..dbadbb8 --- /dev/null +++ b/utils/util.js @@ -0,0 +1,19 @@ +const formatTime = date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + + return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') +} + +const formatNumber = n => { + n = n.toString() + return n[1] ? n : '0' + n +} + +module.exports = { + formatTime: formatTime +}