|
@@ -1,4 +1,5 @@
|
|
|
const app = getApp()
|
|
|
+import { match_status } from '../../utils/dict';
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
@@ -6,32 +7,36 @@ Page({
|
|
|
*/
|
|
|
data: {
|
|
|
frameStyle: { useTop: true, name: '首页', leftArrow: false, useBar: true },
|
|
|
+ //查询条件
|
|
|
searchInfo: {
|
|
|
name: '',
|
|
|
- type: ''
|
|
|
+ type: '',
|
|
|
+ city_type: '',
|
|
|
+ match_type: '',
|
|
|
+ type_name: '',
|
|
|
+ match_name: '',
|
|
|
+ city_name: ''
|
|
|
},
|
|
|
- // 查询选项
|
|
|
- searchType: '0',
|
|
|
- btnList: [
|
|
|
- {
|
|
|
- title: '运动类型',
|
|
|
- icon: 'arrow-down',
|
|
|
- value: '0'
|
|
|
- }, {
|
|
|
- title: '城市',
|
|
|
- icon: 'arrow-down',
|
|
|
- value: '1'
|
|
|
- }, {
|
|
|
- title: '比赛状态',
|
|
|
- icon: 'arrow-down',
|
|
|
- value: '2'
|
|
|
- }
|
|
|
+ //是否显示
|
|
|
+ show: false,
|
|
|
+ //按钮类型
|
|
|
+ btntype: '',
|
|
|
+ list: [
|
|
|
+ { id: "1", src: "/image/ceshi.jpg", name: "2021南宁·LYB李永波全球业余羽毛球锦标赛-南宁分站赛", status: '0', time: '2021/10/12-2022/07/15', match_time: '2021/10/12-2022/07/15', address: '广西壮族自治区南宁市李宁体育园羽毛球馆' },
|
|
|
+ { id: "2", src: "/image/ceshi.jpg", name: "李宁·谌龙杯羽毛球单打公开赛【厦门站团体赛】", status: '1', time: '2021/10/12-2022/07/15', match_time: '2021/10/12-2022/07/15', address: '福建省厦门市工人体育馆一楼羽毛球馆' },
|
|
|
+ { id: "3", src: "/image/ceshi.jpg", name: "李宁·谌龙杯羽毛球单打公开赛【厦门站单项赛】", status: '2', time: '2021/10/12-2022/07/15', match_time: '2021/10/12-2022/07/15', address: '福建省厦门市工人体育馆一楼羽毛球馆' },
|
|
|
+ { id: "3", src: "/image/ceshi.jpg", name: "李宁·谌龙杯羽毛球单打公开赛【厦门站单项赛】", status: '3', time: '2021/10/12-2022/07/15', match_time: '2021/10/12-2022/07/15', address: '福建省厦门市工人体育馆一楼羽毛球馆' },
|
|
|
+ { id: "3", src: "/image/ceshi.jpg", name: "李宁·谌龙杯羽毛球单打公开赛【厦门站单项赛】", status: '4', time: '2021/10/12-2022/07/15', match_time: '2021/10/12-2022/07/15', address: '福建省厦门市工人体育馆一楼羽毛球馆' }
|
|
|
],
|
|
|
- typeList:[
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- ]
|
|
|
+ typeList: [
|
|
|
+ { label: '', value: '全部' },
|
|
|
+ { label: '1', value: '羽毛球' },
|
|
|
+ ],
|
|
|
+ cityList: [
|
|
|
+ { label: '0', value: '吉林省' },
|
|
|
+ { label: '1', value: '长春市' },
|
|
|
+ ],
|
|
|
+ matchList: match_status
|
|
|
},
|
|
|
// 跳转菜单
|
|
|
tabPath(e) {
|
|
@@ -42,14 +47,69 @@ Page({
|
|
|
onSearch() {
|
|
|
console.log("搜索");
|
|
|
},
|
|
|
+ //按钮类型
|
|
|
+ btnChange: function (e) {
|
|
|
+ const that = this;
|
|
|
+ const { value } = e.currentTarget.dataset;
|
|
|
+ that.setData({ btntype: value })
|
|
|
+
|
|
|
+ },
|
|
|
+ //显示弹框
|
|
|
+ showPopup() {
|
|
|
+ this.setData({ show: true });
|
|
|
+ },
|
|
|
+ //关闭弹框
|
|
|
+ onClose() {
|
|
|
+ this.setData({ show: false });
|
|
|
+ },
|
|
|
+ //运动类型选择
|
|
|
+ ontypeConfirm(event) {
|
|
|
+ const that = this;
|
|
|
+ const { value } = event.detail;
|
|
|
+ that.setData({ "searchInfo.type_name": value.value })
|
|
|
+ that.setData({ "searchInfo.type": '0' })
|
|
|
+ this.setData({ show: false });
|
|
|
+ },
|
|
|
+ //城市选择
|
|
|
+ oncityConfirm(event) {
|
|
|
+ const that = this;
|
|
|
+ const { value } = event.detail;
|
|
|
+ that.setData({ "searchInfo.city_name": value.value })
|
|
|
+ that.setData({ "searchInfo.city_type": '1' })
|
|
|
+ this.setData({ show: false });
|
|
|
+ },
|
|
|
+ //比赛状态选择
|
|
|
+ onmatchConfirm(event) {
|
|
|
+ const that = this;
|
|
|
+ const { value } = event.detail;
|
|
|
+ that.setData({ "searchInfo.match_name": value.value })
|
|
|
+ that.setData({ "searchInfo.match_type": '2' })
|
|
|
+ this.setData({ show: false });
|
|
|
+ },
|
|
|
+ //取消类型选择
|
|
|
+ onCancel() {
|
|
|
+ const that = this;
|
|
|
+ console.log('取消');
|
|
|
+ that.setData({ btntype: '' })
|
|
|
+ this.setData({ show: false });
|
|
|
+
|
|
|
+ },
|
|
|
searchChange: function (e) {
|
|
|
const that = this;
|
|
|
const { value } = e.currentTarget.dataset;
|
|
|
that.setData({ searchType: value })
|
|
|
},
|
|
|
- // 值选择
|
|
|
- changeValue: function (e) {
|
|
|
- console.log(e);
|
|
|
+ // 运动类型选择
|
|
|
+ typeChange: function (e) {
|
|
|
+ const that = this;
|
|
|
+ let data = that.data.typeList.find((i) => i.label == e.detail.value);
|
|
|
+ if (data) { that.setData({ 'searchInfo.type': data.label }); that.setData({ 'searchInfo.type_name': data.value }); }
|
|
|
+ },
|
|
|
+ // 城市選擇
|
|
|
+ cityChange: function (e) {
|
|
|
+ const that = this;
|
|
|
+ let data = that.data.cityList.find((i) => i.label == e.detail.value);
|
|
|
+ if (data) { that.setData({ 'searchInfo.city': data.label }); that.setData({ 'searchInfo.city_name': data.value }); }
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|