From 1112e38d079d608b0379c7bd045184ee7c15ff94 Mon Sep 17 00:00:00 2001 From: xuxu Date: Wed, 16 Sep 2020 13:45:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/resource/list/index.js | 58 +++++++++++++++ pages/resource/list/index.json | 4 ++ pages/resource/list/index.wxml | 28 ++++++++ pages/resource/list/index.wxss | 76 ++++++++++++++++++++ pages/resource/navigate/index.js | 69 ++++++++++++++++++ pages/resource/navigate/index.json | 3 + pages/resource/navigate/index.wxml | 2 + pages/resource/navigate/index.wxss | 1 + pages/topics/loan/index.js | 31 ++++++++ pages/topics/loan/index.json | 6 ++ pages/topics/loan/index.wxml | 18 +++++ pages/topics/loan/index.wxss | 27 +++++++ pages/topics/rent/detail/index.js | 105 ++++++++++++++++++++++++++++ pages/topics/rent/detail/index.json | 3 + pages/topics/rent/detail/index.wxml | 18 +++++ pages/topics/rent/detail/index.wxss | 60 ++++++++++++++++ pages/topics/rent/index.js | 33 +++++++++ pages/topics/rent/index.json | 6 ++ pages/topics/rent/index.wxml | 15 ++++ pages/topics/rent/index.wxss | 58 +++++++++++++++ pages/topics/rent/room/index.js | 104 +++++++++++++++++++++++++++ pages/topics/rent/room/index.json | 6 ++ pages/topics/rent/room/index.wxml | 2 + pages/topics/rent/room/index.wxss | 1 + 24 files changed, 734 insertions(+) create mode 100644 pages/resource/list/index.js create mode 100644 pages/resource/list/index.json create mode 100644 pages/resource/list/index.wxml create mode 100644 pages/resource/list/index.wxss create mode 100644 pages/resource/navigate/index.js create mode 100644 pages/resource/navigate/index.json create mode 100644 pages/resource/navigate/index.wxml create mode 100644 pages/resource/navigate/index.wxss create mode 100644 pages/topics/loan/index.js create mode 100644 pages/topics/loan/index.json create mode 100644 pages/topics/loan/index.wxml create mode 100644 pages/topics/loan/index.wxss create mode 100644 pages/topics/rent/detail/index.js create mode 100644 pages/topics/rent/detail/index.json create mode 100644 pages/topics/rent/detail/index.wxml create mode 100644 pages/topics/rent/detail/index.wxss create mode 100644 pages/topics/rent/index.js create mode 100644 pages/topics/rent/index.json create mode 100644 pages/topics/rent/index.wxml create mode 100644 pages/topics/rent/index.wxss create mode 100644 pages/topics/rent/room/index.js create mode 100644 pages/topics/rent/room/index.json create mode 100644 pages/topics/rent/room/index.wxml create mode 100644 pages/topics/rent/room/index.wxss diff --git a/pages/resource/list/index.js b/pages/resource/list/index.js new file mode 100644 index 0000000..523b3ed --- /dev/null +++ b/pages/resource/list/index.js @@ -0,0 +1,58 @@ +// pages/resource/list/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + list:{ + type:Array, + value:[], + }, + tp:{ + type:String, + value:'1' + } + }, + + /** + * 组件的初始数据 + */ + data: { + titlePic:"/images/temp_1.jpg" + }, + + /** + * 组件的方法列表 + */ + methods: { + + detail:function(e){ + if (!e.currentTarget.dataset.id){ + return; + } + + if(this.properties.tp == '1'){ + if(e.currentTarget.dataset.url){ + wx.navigateTo({ + url: '/pages/resource/navigate/index?url=' + encodeURIComponent(e.currentTarget.dataset.url) + }) + + return; + }else{ + wx.navigateTo({ + url: '/pages/resource/detail/index?id=' + e.currentTarget.dataset.id + }) + return; + } + }else if(this.properties.tp == '2'){ + wx.navigateTo({ + url: '/pages/topics/rent/detail/index?id=' + e.currentTarget.dataset.id + }) + return; + } + + + } + + } +}) diff --git a/pages/resource/list/index.json b/pages/resource/list/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/pages/resource/list/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/resource/list/index.wxml b/pages/resource/list/index.wxml new file mode 100644 index 0000000..e0b9ca3 --- /dev/null +++ b/pages/resource/list/index.wxml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + {{item.title}} + + {{item.typeName}} + + + {{item.price}}元/月 + + + + + + \ No newline at end of file diff --git a/pages/resource/list/index.wxss b/pages/resource/list/index.wxss new file mode 100644 index 0000000..cd3b8e6 --- /dev/null +++ b/pages/resource/list/index.wxss @@ -0,0 +1,76 @@ +/* pages/resource/list/index.wxss */ +@import '../../../style/font.wxss'; +.container{ + display: flex; + width: 100%; + flex-direction: column; + align-items: center; + background-color: white; + /* margin-top:10px; */ +} +.column{ + display: flex; + align-items: center; + justify-content: space-between; + width: 90%; + height: 90px; + border-bottom: 2px solid whitesmoke; +} + +.left{ + display: flex; + align-items: center; + flex: 1; +} + +.right{ + width: 15px; + text-align:right; +} + +.articleImg{ + width: 55px; + height: 55px; + display: flex; + align-items: center; + /* border-radius: 50%; */ +} + +.roomImg{ + width: 70px; + height: 55px; + display: flex; + align-items: center; +} + +.content{ + margin-left: 15px; + margin-right: 20px; + flex: 1; +} + +.title{ + width: 100%; + display: -webkit-box; + -webkit-line-clamp: 1; + overflow: hidden; + text-overflow: ellipsis; + -webkit-box-orient: vertical; + word-break: break-all; + font-weight:1000; +} + +.r_type{ + font-size: 13px; +} +.tips{ + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; +} +.tips-con{ + width: 90%; + height: 90; +} \ No newline at end of file diff --git a/pages/resource/navigate/index.js b/pages/resource/navigate/index.js new file mode 100644 index 0000000..516a6b7 --- /dev/null +++ b/pages/resource/navigate/index.js @@ -0,0 +1,69 @@ +// pages/resource/navigate/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + url:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + // console.log(decodeURIComponent(options.url)); + this.setData({ + url:decodeURIComponent(options.url) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/resource/navigate/index.json b/pages/resource/navigate/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/resource/navigate/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/resource/navigate/index.wxml b/pages/resource/navigate/index.wxml new file mode 100644 index 0000000..c911f37 --- /dev/null +++ b/pages/resource/navigate/index.wxml @@ -0,0 +1,2 @@ + + diff --git a/pages/resource/navigate/index.wxss b/pages/resource/navigate/index.wxss new file mode 100644 index 0000000..8dd6b65 --- /dev/null +++ b/pages/resource/navigate/index.wxss @@ -0,0 +1 @@ +/* pages/resource/navigate/index.wxss */ \ No newline at end of file diff --git a/pages/topics/loan/index.js b/pages/topics/loan/index.js new file mode 100644 index 0000000..d1d0220 --- /dev/null +++ b/pages/topics/loan/index.js @@ -0,0 +1,31 @@ +// pages/topics/loan/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + detail:{ + type:Object, + value:{} + } + }, + + /** + * 组件的初始数据 + */ + data: { + url:'https://m.qdjqt.com/#/enterpriseLoan?xihaian=&VNK=e92927fe' + }, + + /** + * 组件的方法列表 + */ + methods: { + check:function(){ + var url = this.data.url; + wx.navigateTo({ + url: '/pages/resource/navigate/index?url=' + encodeURIComponent(url) + }) + } + } +}) diff --git a/pages/topics/loan/index.json b/pages/topics/loan/index.json new file mode 100644 index 0000000..93850f5 --- /dev/null +++ b/pages/topics/loan/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "e-ibutton": "/components/image-button/index" + } +} \ No newline at end of file diff --git a/pages/topics/loan/index.wxml b/pages/topics/loan/index.wxml new file mode 100644 index 0000000..5c16d54 --- /dev/null +++ b/pages/topics/loan/index.wxml @@ -0,0 +1,18 @@ + + + + \ No newline at end of file diff --git a/pages/topics/loan/index.wxss b/pages/topics/loan/index.wxss new file mode 100644 index 0000000..f264fa3 --- /dev/null +++ b/pages/topics/loan/index.wxss @@ -0,0 +1,27 @@ +/* pages/topics/loan/index.wxss */ +.con{ + display: flex; + flex-direction: column; + align-items: center; +} +.img{ + width: 200px; + height: 150px; +} +.title{ + font-weight:1000; +} +.btnView{ + position: fixed; + padding: 10px 20px 20px 20px; + bottom: 0; + left: 0; + right: 0; + background-color: white; +} + +.text{ + width: 90%; + margin-top: 20px; + margin-bottom: 100px; +} \ No newline at end of file diff --git a/pages/topics/rent/detail/index.js b/pages/topics/rent/detail/index.js new file mode 100644 index 0000000..45e83c3 --- /dev/null +++ b/pages/topics/rent/detail/index.js @@ -0,0 +1,105 @@ +// pages/topics/rent/detail/index.js +import { TopicModel } from '../../../../models/topic.js' +let topicModel = new TopicModel() +Page({ + + /** + * 页面的初始数据 + */ + data: { + titlePic:"/images/temp_1.png", + unStar: '/images/common/star.png', + star: '/images/common/star_light.png', + detail:{}, + isCollect:false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var id = options.id; + topicModel.getRoomDetail(id,res=>{ + + if(res.result.isCollection == 1){ + this.setData({ + isCollect:true, + }) + }else{ + this.setData({ + isCollect:false, + }) + } + this.setData({ + detail:res.result, + }) + + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + onClickCollect:function(){ + this.setData({ + isCollect: !this.data.isCollect + }) + let id = this.data.detail.id + topicModel.roomCollect(id,res =>{ + //console.log('收藏') + if(res.code === 200){ + wx.showToast({ + title: '收藏成功', + icon: 'none' + }) + } + }) + + + } +}) \ No newline at end of file diff --git a/pages/topics/rent/detail/index.json b/pages/topics/rent/detail/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/topics/rent/detail/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/topics/rent/detail/index.wxml b/pages/topics/rent/detail/index.wxml new file mode 100644 index 0000000..7e50c35 --- /dev/null +++ b/pages/topics/rent/detail/index.wxml @@ -0,0 +1,18 @@ + + + + + + + + {{detail.title}} + {{detail.price}}元/月 + + + + + + + + + diff --git a/pages/topics/rent/detail/index.wxss b/pages/topics/rent/detail/index.wxss new file mode 100644 index 0000000..7c6fad6 --- /dev/null +++ b/pages/topics/rent/detail/index.wxss @@ -0,0 +1,60 @@ +/* pages/topics/rent/detail/index.wxss */ +page{ + width: 100%; + display: flex; + align-items: center; + flex-direction: column; +} + +.title{ + display: flex; + align-items: center; + justify-content: space-between; + width: 90%; + min-height: 90px; + border-bottom: 2px solid whitesmoke; + margin-top:5px; +} + +.left{ + display: flex; + align-items: center; + flex: 1; +} + +.right{ + width: 15px; + text-align:right; +} + +.articleImg{ + width: 55px; + height: 55px; + display: flex; + align-items: center; + /* border-radius: 50%; */ +} + +.content{ + margin-left: 15px; + margin-right: 20px; + flex: 1; +} + +.tit{ + width: 100%; + font-weight:1000; +} + +.r_type{ + font-size: 13px; +} + +.artice_collect { + width: 20px; + height: 20px; +} + +.text{ + width: 90%; +} \ No newline at end of file diff --git a/pages/topics/rent/index.js b/pages/topics/rent/index.js new file mode 100644 index 0000000..19d25d7 --- /dev/null +++ b/pages/topics/rent/index.js @@ -0,0 +1,33 @@ +// pages/rent/index.js +import { TopicModel } from '../../../models/topic.js' +let topicModel = new TopicModel() +Component({ + /** + * 组件的属性列表 + */ + properties: { + list:{ + type:Array, + value:[] + } + }, + + /** + * 组件的初始数据 + */ + data: { + img:'../../../images/' + }, + + /** + * 组件的方法列表 + */ + methods: { + check:function(e){ + var id = e.currentTarget.id; + wx.navigateTo({ + url: '/pages/topics/rent/room/index?id=' + id + }) + } + } +}) diff --git a/pages/topics/rent/index.json b/pages/topics/rent/index.json new file mode 100644 index 0000000..e24a242 --- /dev/null +++ b/pages/topics/rent/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-button": "/components/vant/button/index" + } +} \ No newline at end of file diff --git a/pages/topics/rent/index.wxml b/pages/topics/rent/index.wxml new file mode 100644 index 0000000..aa29742 --- /dev/null +++ b/pages/topics/rent/index.wxml @@ -0,0 +1,15 @@ + + + + + + + {{item.title}} + + + {{item.address}} + 查看 + + + + diff --git a/pages/topics/rent/index.wxss b/pages/topics/rent/index.wxss new file mode 100644 index 0000000..e890a4c --- /dev/null +++ b/pages/topics/rent/index.wxss @@ -0,0 +1,58 @@ +/* pages/rent/index.wxss */ +@import '../../../style/font.wxss'; +.main{ + display: flex; + flex-direction: column; + align-items: center; + padding-top: 30rpx; +} +.box{ + width:90%; + height:450rpx; + background-color: White; + margin-bottom:30rpx; + display: flex; + align-items: center; + /* justify-content: center; */ + flex-direction: column; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + box-shadow:0px 2px 4px 2px rgba(0, 0, 0, 0.05); +} + + +.image{ + height:350rpx; + width: 100%; + border-top-left-radius: 5px; + border-top-right-radius: 5px; +} + +.title{ + font-size: 50rpx; + color: white; + padding-left: 15px; + padding-top: 250rpx; +} + +.content{ + height:80rpx; + width:90%; + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 10rpx; + /* font-family: SimHei; */ + font-size: 29rpx; + font-weight: bold; + color:#979797; +} + +.address{ + margin-left: 8px; + font-size: 27rpx; +} + + diff --git a/pages/topics/rent/room/index.js b/pages/topics/rent/room/index.js new file mode 100644 index 0000000..a63a1ce --- /dev/null +++ b/pages/topics/rent/room/index.js @@ -0,0 +1,104 @@ +// pages/topics/rent/room/index.js +import { TopicModel } from '../../../../models/topic.js' +let topicModel = new TopicModel() +Page({ + + /** + * 页面的初始数据 + */ + data: { + page:1, + list:[], + apartmentId:'', + next:true + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var id = options.id; + this.setData({ + apartmentId:id + }) + var page = this.data.page; + topicModel.getRoomList(id,page,res=>{ + this.setData({ + list:res.result.records + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + var th = this; + var next = th.data.next; + var typeCode = th.data.typeCode; + if(!next){ + return; + } + var page = th.data.page; + var nextPage = page + 1; + var list = th.data.list; + + topicModel.getRoomList(typeCode,nextPage,res=>{ + + if(res.result.records.length > 0){ + list = list.concat(res.result.records); + th.setData({ + list: list, + page: nextPage + }) + }else{ + th.setData({ + next: false + }) + } + + }) + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/topics/rent/room/index.json b/pages/topics/rent/room/index.json new file mode 100644 index 0000000..ba414af --- /dev/null +++ b/pages/topics/rent/room/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "resource":"/pages/resource/list/index" + }, + "onReachBottomDistance":50 +} \ No newline at end of file diff --git a/pages/topics/rent/room/index.wxml b/pages/topics/rent/room/index.wxml new file mode 100644 index 0000000..1c74589 --- /dev/null +++ b/pages/topics/rent/room/index.wxml @@ -0,0 +1,2 @@ + + diff --git a/pages/topics/rent/room/index.wxss b/pages/topics/rent/room/index.wxss new file mode 100644 index 0000000..0fcd6d5 --- /dev/null +++ b/pages/topics/rent/room/index.wxss @@ -0,0 +1 @@ +/* pages/topics/rent/room/index.wxss */ \ No newline at end of file