diff --git a/pages/topics/common/goodIdea/cell/images/goodIdea.png b/pages/topics/common/goodIdea/cell/images/goodIdea.png new file mode 100755 index 0000000..d38e4c6 Binary files /dev/null and b/pages/topics/common/goodIdea/cell/images/goodIdea.png differ diff --git a/pages/topics/common/goodIdea/cell/index.js b/pages/topics/common/goodIdea/cell/index.js new file mode 100644 index 0000000..0eb6393 --- /dev/null +++ b/pages/topics/common/goodIdea/cell/index.js @@ -0,0 +1,34 @@ +// pages/topics/common/goodIdea/cell/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + ideaId: String, + articleImg: String, + userIcon: String, + userName: String, + time: String, + isGoodIdea:Number, + detail:{ + type: Object + } + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + onTap() { + console.log(this.properties) + // this.triggerEvent('clickListItem', { articleId: this.properties.articleId }) + } + } +}) diff --git a/pages/topics/common/goodIdea/cell/index.json b/pages/topics/common/goodIdea/cell/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/pages/topics/common/goodIdea/cell/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/topics/common/goodIdea/cell/index.wxml b/pages/topics/common/goodIdea/cell/index.wxml new file mode 100644 index 0000000..f8a1110 --- /dev/null +++ b/pages/topics/common/goodIdea/cell/index.wxml @@ -0,0 +1,37 @@ + + + + + + + + {{userName}} + 刚刚 + + + + + 评论内容 + + {{detail.title}} + + + + + + + {{detail.userName}} + {{detail.time}} + + + + + + + {{detail.commentNum}} + + {{detail.text}} + + + + diff --git a/pages/topics/common/goodIdea/cell/index.wxss b/pages/topics/common/goodIdea/cell/index.wxss new file mode 100644 index 0000000..3e00807 --- /dev/null +++ b/pages/topics/common/goodIdea/cell/index.wxss @@ -0,0 +1,96 @@ +/* pages/topics/common/goodIdea/cell/index.wxss */ +.cell{ + display: flex; + flex-direction: row; + padding: 10px; +} +.content-left{ + width: 20px; + height: 20px; + border-radius: 50%; + background-color: red; +} +.content-right{ + width: 100%; + display: flex; + flex-direction: column; + padding: 0 10px 0 10px; +} +.userInfo{ + display: flex; + flex-direction: row; + align-items: center; + padding: 0 0 5px 0; +} +.userName{ + color: #66708B; + font-size: 14px; +} +.goodIdeaIcon{ + width: 30px; + height: 15px; + line-height: 10px; +} +.comment-time{ + margin: 0 5px 0 5px; + font-size: 12px; + line-height: 12px; + color: #D4D4D4; +} +.detail{ + height: 200px; + border-radius: 10px; + background-color: #F8F8F8; +} +.detail-title{ + padding: 10px; +} + +.detail-userInfo{ + display: flex; + flex: row; + justify-content: space-between; + padding: 10px; +} +.detail-userInfo-left{ + display: flex; + flex: row; + align-items: center; +} +.detail-user-icon{ + width: 20px; + height: 20px; + border-radius: 50%; + background-color: red; +} +.detail-userName{ + margin: 0 5px 0 5px; + font-size: 12px; + color: #3B3B3B; +} +.detail-time { + font-size: 12px; + line-height: 12px; + color: #D4D4D4; +} +.detail-userInfo-right{ + display: flex; + flex: row; + align-items: center; + margin-right: 10px; +} +.detail-comments-icon{ + width: 20px; + height: 15px; + margin-right: 5px; + border-radius: 5px; + background-color: red; +} +.detail-commentNum{ + font-size: 12px; + color: #3B3B3B; +} +.detail-text{ + color: #373737; + +} \ No newline at end of file diff --git a/pages/topics/common/goodIdea/index.js b/pages/topics/common/goodIdea/index.js index 1181c77..8140502 100644 --- a/pages/topics/common/goodIdea/index.js +++ b/pages/topics/common/goodIdea/index.js @@ -5,7 +5,38 @@ Page({ * 页面的初始数据 */ data: { - + list: [ + { + ideaId: '1', + userIcon: "", + userName: "用户名", + time: "刚刚", + isGoodIdea:1, + detail:{ + title:"习近平主持政治局第十七次集体... 拷贝", + userIcon:"", + userName:"用户名", + time:"刚刚", + commentNum:"33", + text:"【内容以实际活动为准】市北区位于青岛市主城区地理位置的中心,西部濒临胶州湾,东部与崂山区为邻,北部与李沧区接壤,南部与市南区毗" + } + }, + { + ideaId: "2", + userIcon: "", + userName: "用户名", + time: "1分钟前", + isGoodIdea: 0, + detail: { + title: "习近平主持政治局第十七次集体... 拷贝", + userIcon: "", + userName: "用户名", + time: "刚刚", + commentNum: "33", + text: "市北区位于青岛市主城区地理位置的中心,西部濒临胶州湾,东部与崂山区为邻,北部与李沧区接壤,南部与市南区毗连,东西最大距离11. 拷贝 2" + } + } + ] }, /** @@ -62,5 +93,8 @@ Page({ */ onShareAppMessage: function () { + }, + clickListItem(e) { + console.log(e.detail) } }) \ No newline at end of file diff --git a/pages/topics/common/goodIdea/index.json b/pages/topics/common/goodIdea/index.json index 8835af0..93fc6f3 100644 --- a/pages/topics/common/goodIdea/index.json +++ b/pages/topics/common/goodIdea/index.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "cell": "./cell/index" + } } \ No newline at end of file diff --git a/pages/topics/common/goodIdea/index.wxml b/pages/topics/common/goodIdea/index.wxml index 1b000c0..6736ea7 100644 --- a/pages/topics/common/goodIdea/index.wxml +++ b/pages/topics/common/goodIdea/index.wxml @@ -1,2 +1,13 @@ -pages/topics/common/goodIdea/index.wxml + + + + + diff --git a/pages/topics/common/interactive/cell/images/articleImg.png b/pages/topics/common/interactive/cell/images/articleImg.png new file mode 100644 index 0000000..548a1c4 Binary files /dev/null and b/pages/topics/common/interactive/cell/images/articleImg.png differ diff --git a/pages/topics/common/interactive/cell/index.js b/pages/topics/common/interactive/cell/index.js new file mode 100644 index 0000000..66c9126 --- /dev/null +++ b/pages/topics/common/interactive/cell/index.js @@ -0,0 +1,36 @@ +// pages/topics/common/interactive/common/imageCell/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + articleId: String, + title: String, + articleImg:String, + userIcon:String, + userName:String, + time: String, + commentNum: String, + showTop: { + type: Boolean, + value: false, + } + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + onTap() { + console.log(this.properties) + this.triggerEvent('clickListItem', { articleId: this.properties.articleId }) + } + } +}) diff --git a/pages/topics/common/interactive/cell/index.json b/pages/topics/common/interactive/cell/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/pages/topics/common/interactive/cell/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/topics/common/interactive/cell/index.wxml b/pages/topics/common/interactive/cell/index.wxml new file mode 100644 index 0000000..a61c2f5 --- /dev/null +++ b/pages/topics/common/interactive/cell/index.wxml @@ -0,0 +1,29 @@ + + + + + {{title}} + + + + + + + + {{userName}} + {{time}} + + + + + + + {{commentNum}} + + + + + + + + diff --git a/pages/topics/common/interactive/cell/index.wxss b/pages/topics/common/interactive/cell/index.wxss new file mode 100644 index 0000000..ebfb3e9 --- /dev/null +++ b/pages/topics/common/interactive/cell/index.wxss @@ -0,0 +1,88 @@ +/* pages/topics/common/interactive/common/imageCell/index.wxss */ +.cell { + border-bottom: 1px solid #E7E7E7; + display: flex; + flex-direction: row; + padding: 10px 20px; + align-items: center; +} +.left{ + display: flex; + flex-direction: column; + width: 70%; +} +.leftActive{ + display: flex; + flex-direction: column; + width: 100%; +} +.left-bottom{ + display: flex; + flex: row; + justify-content: space-between; +} +.left-bottom-userInfo{ + display: flex; + flex: row; + align-items: center; +} +.user-icon{ + width: 20px; + height: 20px; + border-radius: 50%; + background-color: red; +} +.userName{ + margin: 0 5px 0 5px; + font-size: 12px; + color: #3B3B3B; +} +.left-bottom-comments{ + display: flex; + flex: row; + align-items: center; + margin-right: 10px; +} +.comments-icon{ + width: 20px; + height: 15px; + margin-right: 5px; + border-radius: 5px; + background-color: red; +} +.commentNum{ + font-size: 12px; + color: #3B3B3B; +} +.right{ + width: 30%; + height: 70px; + border-radius: 5px; +} +image{ + width: 100%; + height: 100%; + border-radius: 5px; +} +.cell_title { + font-weight: 300; + font-size: 17px; + color: #000; +} +.cell_title_selected { + color: #9C9C9C; +} +.cell_info_meta { + padding-top: 10rpx; + display: flex; + flex-direction: row; + align-items: center; + font-size: 12px; + line-height: 12px; + color: #D4D4D4; +} +.cell_info_top { + padding: 0 10px; + width: 20px; + height: 12px; +} \ No newline at end of file diff --git a/pages/topics/common/interactive/index.js b/pages/topics/common/interactive/index.js index 8531848..2efd82c 100644 --- a/pages/topics/common/interactive/index.js +++ b/pages/topics/common/interactive/index.js @@ -5,7 +5,35 @@ Page({ * 页面的初始数据 */ data: { - + list:[ + { + articleId: '1', + title:"市北区举行国际航运贸易金融创新中心核心区产业建设", + articleImg:"asdsad", + userIcon:"", + userName:"用户名", + time:"刚刚", + commentNum:"33", + }, + { + articleId: "2", + title: "《大众日报》市北区举行国际航运贸易金融创新中心核心区产业建设", + articleImg: "", + userIcon: "", + userName: "用户名", + time: "1分钟前", + commentNum: "33", + }, + { + articleId: "3", + title: "青岛医疗人工智能科技创新中心落户市北", + articleImg: "asdsadad", + userIcon: "", + userName: "用户名", + time: "1分钟前", + commentNum: "33", + } + ] }, /** @@ -47,7 +75,7 @@ Page({ * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { - + wx.showNavigationBarLoading(); }, /** @@ -62,5 +90,9 @@ Page({ */ onShareAppMessage: function () { + }, + + clickListItem(e){ + console.log(e.detail) } }) \ No newline at end of file diff --git a/pages/topics/common/interactive/index.json b/pages/topics/common/interactive/index.json index 8835af0..6177863 100644 --- a/pages/topics/common/interactive/index.json +++ b/pages/topics/common/interactive/index.json @@ -1,3 +1,7 @@ { - "usingComponents": {} + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "usingComponents": { + "cell":"./cell/index" + } } \ No newline at end of file diff --git a/pages/topics/common/interactive/index.wxml b/pages/topics/common/interactive/index.wxml index 92548ab..050efee 100644 --- a/pages/topics/common/interactive/index.wxml +++ b/pages/topics/common/interactive/index.wxml @@ -1,2 +1,14 @@ -pages/topics/common/interactive/index.wxml + + + + + diff --git a/pages/topics/common/message/index.js b/pages/topics/common/message/index.js index f9781db..e39de63 100644 --- a/pages/topics/common/message/index.js +++ b/pages/topics/common/message/index.js @@ -1,75 +1,30 @@ // pages/topics/common/message/index.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - textAreaString:"" - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - +Component({ /** - * 生命周期函数--监听页面显示 + * 组件的属性列表 */ - onShow: function () { + properties: { }, /** - * 生命周期函数--监听页面隐藏 + * 组件的初始数据 */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - + data: { + textAreaString:"" }, /** - * 用户点击右上角分享 + * 组件的方法列表 */ - onShareAppMessage: function () { - - }, - - bindTextAreaInput(e){ - this.setData({ - textAreaString:e.detail.value - }) - }, - submit(){ - console.log(this.data.textAreaString) + methods: { + bindTextAreaInput(e) { + this.setData({ + textAreaString: e.detail.value + }) + }, + submit() { + console.log(this.data.textAreaString) + } } -}) \ No newline at end of file +}) diff --git a/pages/topics/common/message/index.json b/pages/topics/common/message/index.json index 8835af0..e8cfaaf 100644 --- a/pages/topics/common/message/index.json +++ b/pages/topics/common/message/index.json @@ -1,3 +1,4 @@ { + "component": true, "usingComponents": {} } \ No newline at end of file diff --git a/pages/topics/index.js b/pages/topics/index.js index f2bfe16..d93368a 100644 --- a/pages/topics/index.js +++ b/pages/topics/index.js @@ -1,12 +1,12 @@ // pages/topics/index.js Page({ - + /** * 页面的初始数据 */ data: { - headerTitles:['互动区','金点子','留言箱','1','2','3','4','5','6'], - selectedTitle:2 + headerTitles: ['互动区', '金点子', '留言箱', '1', '2', '3', '4', '5', '6'], + selectedTitle: 1 }, /** @@ -15,7 +15,7 @@ Page({ onLoad: function (options) { }, - + /** * 生命周期函数--监听页面初次渲染完成 */ @@ -65,16 +65,9 @@ Page({ }, // 定义点击标题的事件处理函数,将选中标题的id赋值给selectedTitle - bindtap: function (e) { - console.log(e) + tapSegment: function (e) { this.setData({ - selectedTitle: e.currentTarget.id + selectedTitle: e.detail }); - }, - //定义滑块改变的事件处理函数,将current赋值给selectedTitle - bindChange: function (e) { - this.setData({ - selectedTitle: e.detail.current - }) } }) \ No newline at end of file diff --git a/pages/topics/index.json b/pages/topics/index.json index 32c1360..bc26df1 100644 --- a/pages/topics/index.json +++ b/pages/topics/index.json @@ -1,8 +1,8 @@ { "usingComponents": { + "e-segment":"/components/segment/index", + "message": "./common/message/index", "interactive": "./common/interactive/index", - "goodIdea":"./common/goodIdea/index", - "message": "./common/message/index" - + "goodIdea": "./common/goodIdea/index" } } \ No newline at end of file diff --git a/pages/topics/index.wxml b/pages/topics/index.wxml index 87b499d..a634b86 100644 --- a/pages/topics/index.wxml +++ b/pages/topics/index.wxml @@ -1,18 +1,7 @@ - - - - - - {{item}} - - - - - - + diff --git a/pages/topics/index.wxss b/pages/topics/index.wxss index ec73719..a2216d8 100644 --- a/pages/topics/index.wxss +++ b/pages/topics/index.wxss @@ -1,56 +1 @@ -/* pages/topics/index.wxss */ -.header-titles { - height: 36px; - display: flex; - /* justify-content: space-around; */ - padding: 5px; -} -.title { - width: 150rpx; - display: flex; - align-items: center; - justify-content: center; - color: #999999; - font-size: 14px; - margin-top: 5px; -} -.item-title{ - display: flex; - flex-direction: column; - align-items: center; -} -.title-selected { - font-size: 16px; - color: #292E3E; -} -.select-line{ - margin-top: 5px; - width: 10px; - height: 2px; - border-radius: 5px; - background-color: #FA4646; -} -.page { - width: 100%; - height: 100%; - display: flex; - align-items: center; - justify-content: center; - font-size: 90rpx; - color: white; -} -.bc_Yellow { - background-color: yellow; -} -.bc_Orange { - background-color: orange; -} -.bc_Green { - background-color: green; -} -.bc_Blue { - background-color: blue; -} -.bc_Purple { - background-color: purple; -} \ No newline at end of file +/* pages/topics/index.wxss */ \ No newline at end of file