diff --git a/app.json b/app.json index 9a9a339..a081b84 100644 --- a/app.json +++ b/app.json @@ -1,6 +1,7 @@ { "pages": [ "pages/index/index", + "pages/index/home/home", "pages/index/total/tatal", "pages/index/Rankdetail/Rankdetail", "pages/index/detailedvolume/detailedvolume", diff --git a/components/select/index.js b/components/select/index.js new file mode 100644 index 0000000..ef8cfa7 --- /dev/null +++ b/components/select/index.js @@ -0,0 +1,74 @@ +Component({ + /** + * 组件的属性列表 + */ + properties: { + roomType:{ + type: String, + value:"会议室类型" + }, + selectBox:{ + type: Array, + value:[] + } + }, + + /** + * 组件的初始数据 + */ + data: { + levelInd:0, + showItems:false, + array:[], + roomType:'', + }, + + /** + * 组件的方法列表 + */ + methods: { + bindLevelChange(e){ + let index = e.currentTarget.dataset.ind + let showItems = true + let array = this.data.selectBox[index].array + this.setData({ + showItems: showItems, + array, + levelInd:index, + roomType:'' + }) + }, + selectItem(e){ + // console.log(e.currentTarget.dataset.type) + let val = e.currentTarget.dataset.type + this.data.selectBox[this.data.levelInd].roomType = val + let selectBox = this.data.selectBox + let data = { + type: this.data.levelInd, + val: val + } + this.triggerEvent("bindValue",data) + + + this.setData({ + roomType: val, + showItems: false, + selectBox + }) + + + }, + tapPages(){ + this.setData({ + showItems: false, + }) + }, + showPicker(){ + this.setData({ + showItems: true, + }) + } + + } + }) + \ No newline at end of file diff --git a/components/select/index.json b/components/select/index.json new file mode 100644 index 0000000..fba482a --- /dev/null +++ b/components/select/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/components/select/index.wxml b/components/select/index.wxml new file mode 100644 index 0000000..6faf947 --- /dev/null +++ b/components/select/index.wxml @@ -0,0 +1,16 @@ + + + + + + {{item.roomType}} + + + + + + {{item}} + + + + \ No newline at end of file diff --git a/components/select/index.wxss b/components/select/index.wxss new file mode 100644 index 0000000..75d6193 --- /dev/null +++ b/components/select/index.wxss @@ -0,0 +1,58 @@ +.down-arrow{ + display: inline-block; + width: 10rpx; + height: 10rpx; + border-right: 2rpx solid #999; + border-bottom: 2rpx solid #999; + transform: rotate(45deg); + margin-left: 20rpx; +} +.roomType{ + display: flex; + align-items: center; + font-size: 30rpx; + +} +.selectBox{ + display: flex; +} +.selectTypeHead{ + display: flex; + justify-content: space-between; + flex-wrap: wrap; + padding: 20rpx 30rpx; + box-sizing: border-box; + background-color: #fff; + width: 100vw; +} +.selectItems{ + background-color: #fff; + animation:transp 0.5s ease-in-out; + position: absolute; + z-index: 100; + width: 100vw; + height: 80rpx; +} +.items{ + height: 100rpx; + padding: 10rpx; + box-sizing: border-box; + border-bottom: 1rpx solid #D9D9D9; +} +@keyframes transp { + from{opacity: 0;} + to{opacity: 1;} +} +.allPage{ + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: transparent; + z-index: 100; +} +.page{ + height: 88rpx; + overflow: hidden; +} diff --git a/pages/index/Salesranking/Vehicletype/Vehicletype.js b/pages/index/Salesranking/Vehicletype/Vehicletype.js index b378c52..a82f3ab 100644 --- a/pages/index/Salesranking/Vehicletype/Vehicletype.js +++ b/pages/index/Salesranking/Vehicletype/Vehicletype.js @@ -7,6 +7,21 @@ const dValue =[1500,1000,500,800,100,1000,300] const dColor=['#0084FF',] Component({ data: { + + selectBox:[ + { + roomType:"会议室类型", + array:['小型会议室', '中型会议室', '大型会议室'] + }, + { + roomType:"楼栋选择", + array:['一号楼','二号楼','三号楼'], + } + ], + roomLevel:"", //当前选择的类型 + builds:"", //当前选择的楼栋 + + select:false, grade_name1:'按级别', grade_name2:'按价格', @@ -107,6 +122,17 @@ Component({ }, methods: { + + bindValue(e){ + let type = e.detail.type + if(type == 0){ + this.data.roomLevel = e.detail.val + }else{ + this.data.builds = e.detail.val + } + console.log(this.data.roomLevel) + console.log(this.data.builds) + }, bindShowMsg(e){ var id=e.currentTarget.id console.log(id) diff --git a/pages/index/Salesranking/Vehicletype/Vehicletype.json b/pages/index/Salesranking/Vehicletype/Vehicletype.json index fe5f69f..fe5c8ce 100644 --- a/pages/index/Salesranking/Vehicletype/Vehicletype.json +++ b/pages/index/Salesranking/Vehicletype/Vehicletype.json @@ -1,6 +1,7 @@ { "usingComponents": { - "c-echars": "/components/c-echars/index" + "c-echars": "/components/c-echars/index", + "select":"/components/select/index" }, "component": true } \ No newline at end of file diff --git a/pages/index/Salesranking/Vehicletype/Vehicletype.wxml b/pages/index/Salesranking/Vehicletype/Vehicletype.wxml index be5bac5..be5c4a5 100644 --- a/pages/index/Salesranking/Vehicletype/Vehicletype.wxml +++ b/pages/index/Salesranking/Vehicletype/Vehicletype.wxml @@ -1,7 +1,12 @@ - - + + + + + + + 全部 @@ -19,7 +24,7 @@ - + {{grade_name1}} @@ -45,12 +50,12 @@ - + {{grade_name3}} - + {{item}} @@ -58,7 +63,7 @@ - + {{grade_name4}} @@ -80,7 +85,7 @@ 排名 品牌名称 - 销量 + 销量 diff --git a/pages/index/Salesranking/Vehicletype/Vehicletype.wxss b/pages/index/Salesranking/Vehicletype/Vehicletype.wxss index e1e3afe..500e07c 100644 --- a/pages/index/Salesranking/Vehicletype/Vehicletype.wxss +++ b/pages/index/Salesranking/Vehicletype/Vehicletype.wxss @@ -410,4 +410,10 @@ position:relative; left:24rpx ; /* top: 20rpx; */ +} + +.selectTypeHead{ + display: flex; + height: 200rpx; + background-color: #fff; } \ No newline at end of file diff --git a/pages/index/home/home.js b/pages/index/home/home.js new file mode 100644 index 0000000..105a3d5 --- /dev/null +++ b/pages/index/home/home.js @@ -0,0 +1,38 @@ +// pages/index/home/home.js +Page({ + /** + * 页面的初始数据 + */ + data: { + selectBox:[ + { + roomType:"会议室类型", + array:['小型会议室', '中型会议室', '大型会议室'] + }, + { + roomType:"楼栋选择", + array:['一号楼','二号楼','三号楼'], + } + ], + roomLevel:"", //当前选择的类型 + builds:"", //当前选择的楼栋 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + bindValue(e){ + let type = e.detail.type + if(type == 0){ + this.data.roomLevel = e.detail.val + }else{ + this.data.builds = e.detail.val + } + console.log(this.data.roomLevel) + console.log(this.data.builds) + }, + }) + \ No newline at end of file diff --git a/pages/index/home/home.json b/pages/index/home/home.json new file mode 100644 index 0000000..aa2c0e5 --- /dev/null +++ b/pages/index/home/home.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "select":"/components/select/index" + } +} \ No newline at end of file diff --git a/pages/index/home/home.wxml b/pages/index/home/home.wxml new file mode 100644 index 0000000..fc04262 --- /dev/null +++ b/pages/index/home/home.wxml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/pages/index/home/home.wxss b/pages/index/home/home.wxss new file mode 100644 index 0000000..2a54751 --- /dev/null +++ b/pages/index/home/home.wxss @@ -0,0 +1,19 @@ +/* pages/index/home/home.wxss */ +/* .allPage{ + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: transparent; + z-index: 9999; +} +.page{ + height: 88rpx; + overflow: hidden; +} */ + +.selectTypeHead{ + display: flex; + background-color: #fff; +} diff --git a/pages/index/total/tatal.js b/pages/index/total/tatal.js index 6485166..6fe39c1 100644 --- a/pages/index/total/tatal.js +++ b/pages/index/total/tatal.js @@ -167,6 +167,12 @@ Component({ }, methods: { + aa(){ + wx.reLaunch({ + url :'https://weibo.com/6443621722/LD0KoxFpJ' + }); + + }, // 时间 changeTime(e){ let sTimeType = e.detail.sTimeType; @@ -175,21 +181,20 @@ methods: { this.getData(sTimeType, sStartTime, sEndTime); }, getData(sTimeType, sStartTime, sEndTime){ - wx.showToast({ - title: '加载中', - icon: 'loading', - duration: 300000 - }) - let key = ele.key + // wx.showToast({ + // title: '加载中', + // icon: 'loading', + // duration: 300000 + // }) app.globalData.request({ action: 'getHomeList0528', sType: 'Home', sTimeType:sTimeType, sStartTime:sStartTime, sEndTime:sEndTime, - sQuDao:key + // sQuDao:key }).then(res => { - const data= res; + const data= res[0]; const _source = [] // for (let i = 0 ;i - + {{content.sourcetime}} diff --git a/project.private.config.json b/project.private.config.json index 861593a..58c8635 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -17,7 +17,7 @@ }, { "name": "", - "pathName": "pages/index/index", + "pathName": "pages/index/home/home", "query": "", "launchMode": "default", "scene": null @@ -35,6 +35,13 @@ "query": "", "launchMode": "default", "scene": null + }, + { + "name": "", + "pathName": "pages/index/index", + "query": "", + "launchMode": "default", + "scene": null } ] }