diff --git a/app.json b/app.json
index a1ce906..3faea7a 100644
--- a/app.json
+++ b/app.json
@@ -45,7 +45,8 @@
"pages/topics/attract/oceanDetail/index",
"pages/topics/attract/spaceDetail/index",
"pages/topics/reportDemand/index",
- "pages/topics/activity/activityDetail/index"
+ "pages/topics/activity/activityDetail/index",
+ "pages/topics/activity/activitySign/index"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/models/topic.js b/models/topic.js
index 26de278..960be69 100644
--- a/models/topic.js
+++ b/models/topic.js
@@ -340,9 +340,9 @@ class TopicModel extends HTTP {
url: TopicBaseUrl.activity_list_url,
method: Method.POST,
data: {
- source: source,
- page: page,
- pageSize: 10,
+ source:source,
+ pageNo:page,
+ pageSize:10,
},
success: success
}
diff --git a/pages/resource/detail/index.js b/pages/resource/detail/index.js
index f2fcc53..6d1ae95 100644
--- a/pages/resource/detail/index.js
+++ b/pages/resource/detail/index.js
@@ -1,6 +1,10 @@
// pages/resource/detail/index.js
-import { TopicModel } from '../../../models/topic.js'
-import { config } from '../../../config.js'
+import {
+ TopicModel
+} from '../../../models/topic.js'
+import {
+ config
+} from '../../../config.js'
var WxParse = require('../../../components/wxParse/wxParse.js');
let topicModel = new TopicModel()
Page({
@@ -9,38 +13,48 @@ Page({
* 页面的初始数据
*/
data: {
- titlePic:config.api_url + "/image/head.jpg",
+ titlePic: config.api_url + "/image/head.jpg",
unStar: '/images/common/star.png',
star: '/images/common/star_light.png',
- detail:{},
- isCollect:false,
- show:false
+ detail: {},
+ isCollect: false,
+ show: false,
+ source:'',
+ currPage: 1,
+ activityList:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
+ console.log(options)
var id = options.id;
- topicModel.getResourceDetail(id,res=>{
- wx.setNavigationBarTitle({ title:res.result.typeName})
+ topicModel.getResourceDetail(id, res => {
+ this.setData({
+ source:res.result.title
+ })
+ this.fetchActivityList()
+ wx.setNavigationBarTitle({
+ title: res.result.typeName
+ })
- if(res.result.typeCode != 'zcfn'){
+ if (res.result.typeCode != 'zcfn') {
this.setData({
- show:true
+ show: true
})
}
- if(res.result.isCollection == 1){
+ if (res.result.isCollection == 1) {
this.setData({
- isCollect:true,
+ isCollect: true,
})
- }else{
+ } else {
this.setData({
- isCollect:false,
+ isCollect: false,
})
}
this.setData({
- detail:res.result,
+ detail: res.result,
})
WxParse.wxParse('article', 'html', this.data.detail.content, this, 5);
@@ -96,32 +110,32 @@ Page({
onShareAppMessage: function () {
},
- previewImage:function(e){
+ previewImage: function (e) {
// var current = e.target.dataset.src;
var th = this;
- if(th.data.detail.titlePic){
- var urls = [th.data.detail.titlePic];
+ if (th.data.detail.titlePic) {
+ var urls = [th.data.detail.titlePic];
wx.previewImage({
- urls:urls// 需要预览的图片http链接列表
+ urls: urls // 需要预览的图片http链接列表
})
- }else{
+ } else {
return;
}
-
+
},
- onClickCollect:function(){
+ onClickCollect: function () {
this.setData({
isCollect: !this.data.isCollect
})
let id = this.data.detail.id
- topicModel.resourceCollect(id,res =>{
+ topicModel.resourceCollect(id, res => {
//console.log('收藏')
- if(res.code === 200){
+ if (res.code === 200) {
wx.showToast({
title: '收藏成功',
icon: 'none'
})
- }else{
+ } else {
wx.showToast({
title: '取消收藏',
icon: 'none'
@@ -131,9 +145,60 @@ Page({
},
- onTap:function(){
+ onTap: function () {
wx.navigateTo({
url: '/pages/resource/demand/index?type=resource&id=' + this.data.detail.id
})
},
+
+ //活动
+ fetchActivityList() {
+ var th = this;
+ var page = th.data.currPage;
+ let source=th.data.source
+ topicModel.getActivityList(source, page, res => {
+ console.log('机构活动列表---', res)
+ const datas = res.result.records
+ let tempDatas = []
+ datas.forEach((item, index) => {
+ tempDatas.push({
+ activityId: item.id,
+ title: item.title,
+ activityImg: item.titlePic,
+ time: item.createTime,
+ commentNum:item.commentNum,
+ dataIndex: index + ((page - 1) * 10),
+ isTouchMove: false,
+ })
+ })
+ if (page == 1) {
+ this.setData({
+ activityList: tempDatas
+ })
+ } else {
+ if (tempDatas.length > 0) {
+ const list = [...this.data.activityList, ...tempDatas]
+ this.setData({
+ activityList: list
+ })
+ } else {
+ const page = this.data.currPage - 1
+ this.setData({
+ currPage: page
+ })
+ wx.showToast({
+ title: '已加载全部',
+ icon: 'none'
+ })
+ }
+ }
+ wx.stopPullDownRefresh()
+ })
+ },
+ clickListItem(e) {
+ const activityId = e.detail.activityId;
+ wx.navigateTo({
+ url: `/pages/topics/activity/activityDetail/index?activityId=${activityId}`,
+ })
+ },
})
\ No newline at end of file
diff --git a/pages/resource/detail/index.json b/pages/resource/detail/index.json
index 8835af0..97ebcea 100644
--- a/pages/resource/detail/index.json
+++ b/pages/resource/detail/index.json
@@ -1,3 +1,5 @@
{
- "usingComponents": {}
+ "usingComponents": {
+ "cell": "../../topics/activity/cell/index"
+ }
}
\ No newline at end of file
diff --git a/pages/resource/detail/index.wxml b/pages/resource/detail/index.wxml
index d3b0d10..e5ef7d9 100644
--- a/pages/resource/detail/index.wxml
+++ b/pages/resource/detail/index.wxml
@@ -1,25 +1,37 @@
-
-
-
-
-
-
-
- {{detail.title}}
- {{detail.typeName}}
-
+
+
+
+
+
-
-
+
+ {{detail.title}}
+ {{detail.typeName}}
-
-
-
+
+
+
+
+
+
+
-
+
+
+
+
+ 机构活动
+
+ |
+
+
+
报需求
diff --git a/pages/resource/detail/index.wxss b/pages/resource/detail/index.wxss
index ec1d522..0300796 100644
--- a/pages/resource/detail/index.wxss
+++ b/pages/resource/detail/index.wxss
@@ -77,3 +77,18 @@ page{
font-size: 15px;
line-height:18px;
}
+.resource-activity-lists{
+ width: 100%;
+ padding: 30rpx 30rpx 120rpx 30rpx;
+ box-sizing: border-box;
+}
+.resource-activity-lists .list-title{
+ font-size: 32rpx;
+ color: #4f4f4f;
+}
+.section_line {
+ padding: 0;
+ height: 20rpx;
+ width: 100%;
+ background-color: #FAFAFA;
+}
\ No newline at end of file
diff --git a/pages/resource/index.wxml b/pages/resource/index.wxml
index 5c7f32e..7eeface 100644
--- a/pages/resource/index.wxml
+++ b/pages/resource/index.wxml
@@ -1,27 +1,20 @@
-
+
-
+
赋能政策
-
-
-
+
+
+
-
+
不再提示
-
-
\ No newline at end of file
diff --git a/pages/resource/list/index.js b/pages/resource/list/index.js
index 50d952b..c22125b 100644
--- a/pages/resource/list/index.js
+++ b/pages/resource/list/index.js
@@ -1,26 +1,28 @@
// pages/resource/list/index.js
-import { config } from '../../../config.js'
+import {
+ config
+} from '../../../config.js'
Component({
/**
* 组件的属性列表
*/
properties: {
- list:{
- type:Array,
- value:[],
+ list: {
+ type: Array,
+ value: [],
},
- tp:{
- type:String,
- value:'1'
+ tp: {
+ type: String,
+ value: '1'
},
- apartmentId:String
+ apartmentId: String
},
/**
* 组件的初始数据
*/
data: {
- titlePic:config.api_url + "/image/head.jpg"
+ titlePic: config.api_url + "/image/head.jpg"
},
/**
@@ -28,19 +30,18 @@ Component({
*/
methods: {
- detail:function(e){
- if (!e.currentTarget.dataset.id){
+ detail: function (e) {
+ if (!e.currentTarget.dataset.id) {
return;
}
-
- if(this.properties.tp == '1'){ // 资源列表
- if(e.currentTarget.dataset.url){ // 跳转网站
+
+ 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 if(e.currentTarget.dataset.appid){ // 跳转小程序
+ } else if (e.currentTarget.dataset.appid) { // 跳转小程序
wx.navigateToMiniProgram({
appId: e.currentTarget.dataset.appid,
// path: 'page/index/index?id=123',
@@ -53,26 +54,24 @@ Component({
}
})
return;
- }else{ // 查看详情
+ } else { // 查看详情
wx.navigateTo({
url: '/pages/resource/detail/index?id=' + e.currentTarget.dataset.id
})
return;
}
- }else if(this.properties.tp == '2'){ // 房屋列表
+ } else if (this.properties.tp == '2') { // 房屋列表
wx.navigateTo({
url: '/pages/topics/rent/detail/index?id=' + e.currentTarget.dataset.id
})
return;
}
-
-
},
- onTap:function(){
+ onTap: function () {
wx.navigateTo({
url: '/pages/resource/demand/index?type=rent&id=' + this.properties.apartmentId
})
}
}
-})
+})
\ No newline at end of file
diff --git a/pages/topics/activity/activityDetail/index.js b/pages/topics/activity/activityDetail/index.js
index 9c85407..527eee6 100644
--- a/pages/topics/activity/activityDetail/index.js
+++ b/pages/topics/activity/activityDetail/index.js
@@ -328,48 +328,27 @@ Page({
//活动报名
onlineSubmit () {
// console.log('在线报名')
- wx.redirectTo({
- url: '/pages/weChatAuth/index',
- })
// this.setData({
// disable: true
// })
- // if (store.hasBindUserInfo()) {
- // this.onlineSignApi() // 在线报名
- // } else {
- // wx.redirectTo({
- // url: '/pages/weChatAuth/index',
- // })
- // }
- },
- onlineSignApi () {
- topicModel.onlineSign(this.data.aId, res => {
- if(res.code == 200){
- console.log(res.code);
- wx.showToast({
- title: res.message,
- icon: 'none'
- })
- }
- if(res.code != 200){
- // console.log(res.code);
- this.setData({
- disable: false
- })
- wx.showToast({
- title: res.message,
- icon: 'none'
- })
- }
- this.fetchDetail()
- })
+ if (store.hasBindUserInfo()) {
+ console.log(store.hasBindUserInfo())
+ // this.onlineSignApi() // 在线报名
+ wx.navigateTo({
+ url: `/pages/topics/activity/activitySign/index?activityId=${this.data.activityId}`,
+ })
+ } else {
+ wx.redirectTo({
+ url: '/pages/weChatAuth/index',
+ })
+ }
},
cancelSignApi () {
this.setData({
disable: true
})
if (store.hasBindUserInfo()) {
- topicModel.cancelOnlineSign(this.data.aId, res => {
+ topicModel.cancelOnlineSign(this.data.activityId, res => {
if(res.code == 200){
wx.showToast({
title: res.message,
diff --git a/pages/topics/activity/activityDetail/index.wxml b/pages/topics/activity/activityDetail/index.wxml
index d313333..23dd242 100644
--- a/pages/topics/activity/activityDetail/index.wxml
+++ b/pages/topics/activity/activityDetail/index.wxml
@@ -16,58 +16,63 @@
-
-