diff --git a/models/topic.js b/models/topic.js
index 9644d6f..fbe6ded 100644
--- a/models/topic.js
+++ b/models/topic.js
@@ -12,7 +12,10 @@ const TopicBaseUrl = {
topic_collect_url:'/api/group/collectGroup/', // 收藏
topic_unCollect_url: '/api/collect/deleteCollection/', // 取消收藏
topic_commentPraise_url: '/api/comment/addSupport/', // 点赞
- topic_addMessage_url:'/api/message/addMessage' // 留言箱
+ topic_addMessage_url:'/api/message/addMessage' ,// 留言箱
+ topic_streets_url:'/api/whistle/getStreetList',//街道列表
+ topic_talents_url:'/api/whistle/save',//添加人才吹哨
+ topic_center_url:'/api/content/getListByCode' //赋能中心列表
}
class TopicModel extends HTTP {
@@ -151,14 +154,53 @@ class TopicModel extends HTTP {
this.request(params)
}
- addMessage(title, content, picList,success){
+ // addMessage(title, content, picList,success){
+ // let params = {
+ // url: TopicBaseUrl.topic_addMessage_url,
+ // method: Method.POST,
+ // data: {
+ // title:title,
+ // content: content,
+ // picList: picList,
+ // },
+ // success: success
+ // }
+ // this.request(params)
+ // }
+
+
+ //添加人才吹哨
+ addTalents(content, picList,departId,success){
let params = {
- url: TopicBaseUrl.topic_addMessage_url,
+ url: TopicBaseUrl.topic_talents_url,
method: Method.POST,
data: {
- title:title,
content: content,
- picList: picList,
+ picList1: picList,
+ departId:departId,
+ },
+ success: success
+ }
+ this.request(params)
+ }
+
+ // 街道列表
+ getStreetList(success) {
+ let params = {
+ url: TopicBaseUrl.topic_streets_url,
+ method: Method.POST,
+ data: {
+ },
+ success: success
+ }
+ this.request(params)
+ }
+ getCenterList(success) {
+ let params = {
+ url: TopicBaseUrl.topic_center_url,
+ method: Method.POST,
+ data: {
+ typeCode:'sc-fnzx',
},
success: success
}
diff --git a/pages/article/index.wxml b/pages/article/index.wxml
index eededd5..0579ca0 100644
--- a/pages/article/index.wxml
+++ b/pages/article/index.wxml
@@ -11,6 +11,7 @@
+
diff --git a/pages/home/index.js b/pages/home/index.js
index 7cd504d..bf57e4b 100644
--- a/pages/home/index.js
+++ b/pages/home/index.js
@@ -48,6 +48,9 @@ Page({
})
this.fetchHomeList()
},
+
+
+
// 获取首页列表
fetchHomeList () {
let page = this.data.currPage
@@ -93,6 +96,8 @@ Page({
wx.stopPullDownRefresh()
})
},
+
+
fetchHomeBanner () {
this.setData({
banners: []
@@ -143,6 +148,9 @@ Page({
//console.log(e.detail)
this.gotoArticePage(e.detail.id)
},
+
+
+ //点击列表cell获取id,进入页面
clickListItem (e) {
//console.log(e.detail)
const {id, index} = e.detail
diff --git a/pages/topics/center/index.js b/pages/topics/center/index.js
new file mode 100644
index 0000000..9845d14
--- /dev/null
+++ b/pages/topics/center/index.js
@@ -0,0 +1,48 @@
+// pages/topics/interactive/index.js
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ list:{
+ type:Array,
+ value:[]
+ }
+ },
+ /**
+ * 组件的初始数据
+ */
+ data: {
+
+ },
+ attached: function () {
+ console.log("center页面")
+ console.log(this.properties.list)
+
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ onTap(){
+ wx.navigateTo({
+ url: `/pages/topics/interactive/submitTopic/index`,
+ })
+ },
+ //点击列表cell
+ clickListItem(e) {
+ //获取文章id
+ const id = e.currentTarget.dataset.id
+ console.log("clickListItem")
+ // console.log(id)
+ console.log(e)
+ wx.navigateTo({
+ url: `/pages/article/index?id=${id}`,
+ })
+ },
+ deleteTopic(e){
+ this.triggerEvent('deleteTopic', { id: e.detail.id })
+ }
+ }
+})
diff --git a/pages/topics/center/index.json b/pages/topics/center/index.json
new file mode 100644
index 0000000..4a42478
--- /dev/null
+++ b/pages/topics/center/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+
+ }
+}
\ No newline at end of file
diff --git a/pages/topics/center/index.wxml b/pages/topics/center/index.wxml
new file mode 100644
index 0000000..d800d12
--- /dev/null
+++ b/pages/topics/center/index.wxml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+ 置顶
+
+ {{item.createTime}}
+
+
+
+
+
+
+
diff --git a/pages/topics/center/index.wxss b/pages/topics/center/index.wxss
new file mode 100644
index 0000000..a3fc33b
--- /dev/null
+++ b/pages/topics/center/index.wxss
@@ -0,0 +1,125 @@
+/* pages/topics/interactive/index.wxss */
+.publish{
+ position: fixed;
+ width: 40px;
+ height: 40px;
+ right: 20px;
+ bottom: 40px;
+}
+
+image{
+ width: 100%;
+ height: 100%;
+}
+.container{
+ font-family: PingFangSC-Regular;
+ font-weight: 300;
+}
+
+.cell {
+ /* border-bottom: 1px solid #E7E7E7;
+ display: flex;
+ flex-direction: row;
+ padding: 10px 20px;
+ align-items: center; */
+ /* min-height: 80px; */
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width:100%;
+ border-bottom: 1px solid #E7E7E7;
+}
+
+.content {
+ display: flex;
+ width:90%;
+ height:80px;
+ margin:15px 0px 5px 0px;
+}
+.left{
+ width:22%;
+ /* background-color: #EEEEEE; */
+ /* border:1px solid black; */
+ display: flex;
+ /* align-items: center; */
+ /* justify-content: center; */
+}
+.articleImg{
+ width: 55px;
+ height: 55px;
+ border-radius: 50%;
+}
+
+.right{
+ flex:1;
+ display: flex;
+ flex-direction: column;
+ /* justify-content: space-between; */
+ height: 100%;
+ /* align-items: center; */
+ justify-content: center;
+ /* border:1px solid black; */
+}
+.rightActive{
+
+}
+
+.right-top{
+ height:60%;
+ width:100%;
+ /* border:1px solid black; */
+ display: flex;
+ /* 底部对齐 */
+ align-items: center;
+
+}
+.right-title{
+ /* font-size: 17px;
+ color: #000;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ height:80%;
+ width:100%; */
+
+ font-size: 17px;
+ color: #000;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ /* height:85%; */
+ /* border: 1px solid black; */
+}
+
+.right-bottom{
+ display: flex;
+ /* flex-direction: row; */
+ align-items: center;
+ justify-content: flex-end;
+ height: 40%;
+ margin:10px 0px 5px 0px;
+ /* border:1px solid black; */
+ /* align-items: flex-end; */
+
+}
+.bottom-top{
+ font-size: 14px;
+ color:red;
+ border-radius: 5px;
+ border:1px solid red;
+ margin:0px 10px;
+ padding:0px 5px;
+}
+.cell_info_meta {
+ display: flex;
+ flex-direction: row;
+ font-size: 12px;
+ color: #D4D4D4;
+
+}
\ No newline at end of file
diff --git a/pages/topics/index.js b/pages/topics/index.js
index dfdbd00..4bf6ccf 100644
--- a/pages/topics/index.js
+++ b/pages/topics/index.js
@@ -13,11 +13,16 @@ Page({
* 页面的初始数据
*/
data: {
- headerTitles: ['互动区', '金点子', '留言箱'],
+ // headerTitles: ['互动区', '金点子', '留言箱'],
+ headerTitles: ['留言互动', '赋能中心', '人才吹哨'],
segmentIndex: 0,
currPage: 1,
+ //留言互动的列表
topicList: [],
- goodIdeaList: []
+ goodIdeaList: [],
+ //赋能中心的列表
+ centerList: []
+
},
/**
@@ -25,14 +30,19 @@ Page({
*/
onLoad: function () {
-
+
},
+
+ //进入页面判断是否绑定微信号,如果绑定手机号根据segmentIndex的数值fetch留言互动和赋能中心的资源,否则退回注册页面或者首页
onShow: function () {
if (store.hasBindUserInfo()) {
console.log('已经绑定微信')
if (store.hasPhone()) {
console.log('已经绑定手机号码')
// 页面出现在前台时执行
+ // 更新TopicList 和centerList
+ this.fetchTopicList()
+ this.fetchCenterList()
let segmentIndex = this.data.segmentIndex
if (segmentIndex === 0 || segmentIndex === 1) {
wx.pageScrollTo({
@@ -43,10 +53,12 @@ Page({
currPage: 1,
})
switch (this.data.segmentIndex) {
- case 0:
- return this.fetchTopicList()
+ case 0:
+ return this.fetchTopicList()
case 1:
- return this.fetchGoodIdeaList()
+ // return this.fetchGoodIdeaList()
+ //GoodIdea修改为center
+ return this.fetchCenterList()
}
}
} else {
@@ -91,6 +103,9 @@ Page({
})
}
},
+
+ //留言互动
+ //fetch留言互动的资源
fetchTopicList () {
let page = this.data.currPage
topicModel.getTopicList(page, res => {
@@ -102,7 +117,6 @@ Page({
icon: 'none'
})
}
-
const datas = res.result.list
let tempDatas = []
datas.forEach((item,index) => {
@@ -144,9 +158,33 @@ Page({
wx.stopPullDownRefresh()
})
},
+
+
+ //赋能中心
+ fetchCenterList(){
+ topicModel.getCenterList(res => {
+ console.log('赋能中心')
+ console.log(res)
+ if (res.list.length == 0) {
+ wx.showToast({
+ title: '暂无数据',
+ icon: 'none'
+ })
+ return
+ }
+ this.setData({
+ centerList: res.list
+ })
+ console.log("centerList已更新");
+ console.log(this.data.centerList);
+ })
+ },
+ //金点子
+ //金点子资源刷新
onRefreshList () {
this.fetchGoodIdeaList()
},
+ //fetch金点子的资源
fetchGoodIdeaList () {
let page = this.data.currPage
topicModel.goldenList(page, res => {
@@ -200,6 +238,7 @@ Page({
wx.stopPullDownRefresh()
})
},
+
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
@@ -220,7 +259,8 @@ Page({
case 0:
return this.fetchTopicList()
case 1:
- return this.fetchGoodIdeaList()
+ // return this.fetchGoodIdeaList()
+ return this.fetchCenterList()
}
}
},
@@ -243,7 +283,8 @@ Page({
case 0:
return this.fetchTopicList()
case 1:
- return this.fetchGoodIdeaList()
+ // return this.fetchGoodIdeaList()
+ return this.fetchCenterList()
}
}
@@ -263,7 +304,9 @@ Page({
case 0:
return this.fetchTopicList()
case 1:
- return this.fetchGoodIdeaList()
+ // return this.fetchGoodIdeaList()
+ console.log("点击页面fetchCenterList");
+ return this.fetchCenterList()
}
},
deleteTopic(e) {
@@ -283,13 +326,16 @@ Page({
case 0:
return that.fetchTopicList()
case 1:
- return that.fetchGoodIdeaList()
+ // return that.fetchGoodIdeaList()
+ //GoodIdea修改为center
+ return that.fetchCenterList()
}
}
})
}
})
},
+
deleteTopicComment(e){
let that = this
topicModel.deleteComment(e.detail.id,res=>{
@@ -305,7 +351,7 @@ Page({
case 0:
return that.fetchTopicList()
case 1:
- return that.fetchGoodIdeaList()
+ return that.fetchCenterList()
}
}
})
@@ -316,6 +362,7 @@ Page({
tapGoodIdeaPraise(e){
this.fetchGoodIdeaPraise(e.detail.commentId)
},
+
fetchGoodIdeaPraise(id) {
wx.showLoading()
topicModel.topicCommentPraise(id, res => {
@@ -325,4 +372,5 @@ Page({
}
})
},
+
})
\ No newline at end of file
diff --git a/pages/topics/index.json b/pages/topics/index.json
index eb096de..b8be08a 100644
--- a/pages/topics/index.json
+++ b/pages/topics/index.json
@@ -5,6 +5,8 @@
"e-segment":"/components/segment/index",
"message": "./message/index",
"interactive": "./interactive/index",
- "goodIdea": "./goodIdea/index"
+ "goodIdea": "./goodIdea/index",
+ "talents": "./talents/index",
+ "center": "./center/index"
}
}
\ No newline at end of file
diff --git a/pages/topics/index.wxml b/pages/topics/index.wxml
index f4a3402..f68836c 100644
--- a/pages/topics/index.wxml
+++ b/pages/topics/index.wxml
@@ -1,7 +1,20 @@
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/topics/index.wxss b/pages/topics/index.wxss
index a2216d8..dad29a1 100644
--- a/pages/topics/index.wxss
+++ b/pages/topics/index.wxss
@@ -1 +1,5 @@
-/* pages/topics/index.wxss */
\ No newline at end of file
+/* pages/topics/index.wxss */
+.content-wrapper{
+ display: flex;
+ flex-direction: column;
+}
\ No newline at end of file
diff --git a/pages/topics/interactive/cell/index.wxss b/pages/topics/interactive/cell/index.wxss
index 425c5f9..3ddc2ce 100644
--- a/pages/topics/interactive/cell/index.wxss
+++ b/pages/topics/interactive/cell/index.wxss
@@ -96,7 +96,6 @@ image{
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
-
}
.cell_title_selected {
color: #9C9C9C;
diff --git a/pages/topics/interactive/index.js b/pages/topics/interactive/index.js
index c445b58..97bf4b5 100644
--- a/pages/topics/interactive/index.js
+++ b/pages/topics/interactive/index.js
@@ -15,6 +15,11 @@ Component({
*/
data: {
+ },
+ attached: function () {
+ console.log("interactive页面")
+ console.log(this.properties.list)
+
},
/**
diff --git a/pages/topics/talents/index.js b/pages/topics/talents/index.js
new file mode 100644
index 0000000..a4a9681
--- /dev/null
+++ b/pages/topics/talents/index.js
@@ -0,0 +1,224 @@
+// pages/topics/common/message/index.js
+import { config } from '../../../config.js'
+import { store } from '../../../utils/store.js'
+import { TopicModel } from '../../../models/topic.js'
+let topicModel = new TopicModel()
+
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ messageTitle:"",
+ messageDetail:"",
+ files: [],
+ // 所在街道
+ streets: [],
+ streetsIndex: 0,
+
+ //接口街道的数据
+ results:[],
+ //选择后获取的街道的I,
+ streetID:'',
+ },
+ // lifetimes: {
+ // attached: function () {
+ // // 在组件实例进入页面节点树时执行
+ // },
+ // detached: function () {
+ // // 在组件实例被从页面节点树移除时执行
+ // }
+ // },
+ // attached: function () {
+ // console.log('啦啦啦')
+ // },
+
+ /**
+ * 组件的方法列表
+ */
+ attached: function () {
+ console.log('talents页面')
+ // var th = this;
+ this.setData({
+ uplaodFile: this.uplaodFile.bind(this)
+ })
+ topicModel.getStreetList(res=>{
+ var resultss = res.result
+ var streett = []
+ resultss.forEach((value,index)=>{
+ streett[index] = value.departName
+ })
+ //把streett添加第一项设为空
+ streett.unshift('')
+ console.log(streett)
+
+ this.setData({
+ streets: streett
+ })
+ //把接口数据放在results里
+ this.setData({
+ results: resultss
+ })
+ console.log(this.data.results)
+ })
+ },
+ methods: {
+ // 以下为修改
+ bindPickerStreetsChange: function(e) {
+ // console.log("1"+e.detail.value)
+ this.setData({
+ streetsIndex: e.detail.value
+ })
+ // console.log("2"+this.data.streetsIndex)
+ this.setData({
+ streetID: this.data.results[this.data.streetsIndex-1].id
+ })
+ // console.log(this.data.streetID)
+ },
+ //以上为修改
+ bindTextInput(e) {
+ this.setData({
+ messageTitle: e.detail.value
+ })
+ },
+ bindTextAreaInput(e) {
+ this.setData({
+ messageDetail: e.detail.value
+ })
+ },
+
+ uplaodFile(files) {
+ console.log('upload files', files)
+ // 文件上传的函数,返回一个promise
+ const token = store.readToken()
+ console.log(token)
+ return new Promise((resolve, reject) => {
+ files.tempFilePaths.forEach(item => {
+ wx.uploadFile({
+ url: config.api_url + "/api/common/upload",
+ filePath: item,
+ header: {
+ 'token': token,
+ 'content-type': 'application/json',
+ },
+ name: 'files',
+ success: (res) => {
+ console.log(res);
+ const data = JSON.parse(res.data)
+ const image = {
+ url: config.api_url + '/' + data.result.imgUrl,
+ }
+ this.setData({
+ files: [...this.data.files, image]
+ })
+ resolve(this.data.files)
+ }
+ })
+ })
+ })
+ },
+ deleteFile(e) {
+ console.log(e)
+ let tempImages = this.data.files
+ const index = e.detail.index
+
+ tempImages.splice(index, 1);
+ this.setData({
+ files: tempImages
+ })
+ },
+
+ submit() {
+ // if (this.data.messageTitle === '') {
+ // wx.showModal({
+ // title: '提示',
+ // content: '请输入标题',
+ // showCancel: false
+ // })
+ // return
+ // }
+ if (this.data.messageDetail === ''){
+ wx.showModal({
+ title: '提示',
+ content: '请输入正文内容',
+ showCancel:false
+ })
+ return
+ }
+ //判断是否选择街道
+ if (this.data.streetID === ''){
+ wx.showModal({
+ title: '提示',
+ content: '请输入街道',
+ showCancel:false
+ })
+ return
+ }
+ //仿照这个方法添加文本,图片,街道
+ // topicModel.addMessage(this.data.messageTitle, this.data.messageDetail,this.data.files,res=>{
+ // if(res.code === 200){
+ // this.setData({
+ // messageTitle:'',
+ // messageDetail: '',
+ // files:[],
+ // },()=>{
+ // wx.showToast({
+ // title: res.message,
+ // icon: 'none'
+ // })
+ // })
+ // }
+ // })
+
+ topicModel.addTalents(this.data.messageDetail, this.data.files,this.data.streetID,res=>{
+ if(res.code === 200){
+ this.setData({
+ messageDetail: '',
+ streetID:'',
+ files:[],
+ },()=>{
+ // wx.showToast({
+ // title: res.message,
+ // icon: 'none'
+ // })
+ wx.showModal({
+ title: '提交成功',
+ content: '问题已收到,我们会尽快给您答复的!',
+ cancelText:'知道了',
+ confirmText:'查看进度',
+ success (res) {
+ if (res.confirm) {
+ console.log('用户点击查看进度')
+ // 查看进度怎么填呀??
+
+ } else if (res.cancel) {
+ console.log('用户点击知道了')
+ }
+ }
+ })
+
+
+
+
+
+
+
+
+
+ })
+ }
+ })
+
+
+ }
+ },
+
+
+})
diff --git a/pages/topics/talents/index.json b/pages/topics/talents/index.json
new file mode 100644
index 0000000..719cee5
--- /dev/null
+++ b/pages/topics/talents/index.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "usingComponents": {
+ "e-ibutton": "/components/image-button/index",
+ "mp-cells": "/components/weui/cells/cells",
+ "mp-cell": "/components/weui/cell/cell",
+ "mp-uploader": "/components/weui/uploader/uploader"
+ }
+}
\ No newline at end of file
diff --git a/pages/topics/talents/index.wxml b/pages/topics/talents/index.wxml
new file mode 100644
index 0000000..4a47c24
--- /dev/null
+++ b/pages/topics/talents/index.wxml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择街道
+
+
+ {{streets[streetsIndex]}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/topics/talents/index.wxss b/pages/topics/talents/index.wxss
new file mode 100644
index 0000000..738384b
--- /dev/null
+++ b/pages/topics/talents/index.wxss
@@ -0,0 +1,87 @@
+/* pages/topics/common/message/index.wxss */
+@import '../../../style/font.wxss';
+.container{
+ padding: 0px 20px;
+}
+.item{
+ display: flex;
+ flex-direction: row;
+
+ /* align-items: center; */
+}
+.must_fill{
+ font-size: 13px;
+ color: red;
+ margin-right: 5px;
+}
+.title{
+ font-size: 15px;
+ width: 100%;
+}
+.textArea{
+ font-size: 14px;
+ width: 100%;
+ /* line-height: 10px; */
+}
+.line-view{
+ height: 1px;
+ background-color: #F1F1F1;
+ /* margin: 10px 0 10px 0; */
+ margin: 0px 0 10px 0;
+}
+.btnView{
+ position: fixed;
+ padding: 10px 20px 20px 20px;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+.submitBtn{
+ /* width: 100%; */
+ /* margin-left: 20px;
+ margin-right: 20px; */
+ /* position: fixed;
+ bottom: 10px; */
+ height: 45px;
+ line-height: 40px;
+ border-radius: 5px;
+ color: white;
+ font-size: 14px;
+ background-image: linear-gradient(
+ to right,
+ #FD6553 30%,
+ #D70403 100%
+ );
+}
+
+.uploader_msg_bd .weui-cell{
+ padding: 10px 0 10px 0;
+}
+/* .uploader_bd ::before{
+ border-top: none;
+} */
+.uploader_msg_bd .weui-uploader__title,.weui-uploader__info{
+ font-size: 14px;
+}
+.uploader_msg_bd .weui-uploader__input,
+.uploader_msg_bd .weui-uploader__input-box,
+.uploader_msg_bd .weui-uploader__file_status,
+.uploader_msg_bd .weui-uploader__img{
+ width: 77px;
+ height: 77px;
+}
+
+/* 以下为新增 */
+.question-image{
+ padding:20px 0px;
+}
+.select-view{
+ display: flex;
+}
+.select-mark{
+ width:15px;
+}
+.select-picker{
+ flex: 1;
+ margin:0px 10px;
+}