slj 4 years ago
parent
commit
48f496a0d1
  1. 3
      models/topic.js
  2. 96
      pages/home/index.js
  3. 2
      pages/topics/lease/index.js
  4. 10
      pages/topics/lease/index.wxml
  5. 9
      pages/topics/lease/index.wxss
  6. 2
      pages/topics/loan/index.wxml
  7. 2
      pages/topics/reportDemand/index.js

3
models/topic.js

@ -200,8 +200,7 @@ class TopicModel extends HTTP {
typeCode: datas.typeCode,
id: datas.id,
questionType: datas.questionType,
company: datas.company
workplace: datas.workplace
},
success: success
}

96
pages/home/index.js

@ -2,7 +2,9 @@
import dayjs from '../../utils/dayjs/index.js'
import relativeTime from '../../utils/dayjs/relativeTime.js'
dayjs.extend(relativeTime);
import { HomeModel } from '../../models/home.js'
import {
HomeModel
} from '../../models/home.js'
let homeModel = new HomeModel()
Page({
data: {
@ -11,9 +13,9 @@ Page({
banners: [],
hots: [],
list: [],
show:false,
show: false,
// url:"../../images/ad.jpg",
web:'https://wx.vzan.com/live/TpForm?zbid=860533452&oId=213742&type=0&v=1623841891714'
web: 'https://wx.vzan.com/live/TpForm?zbid=860533452&oId=213742&type=0&v=1623841891714'
// web:'http://www.rencaibeichu.cn'
},
onLoad: function () {
@ -35,8 +37,8 @@ Page({
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.setData({
currPage: 1,
@ -46,7 +48,7 @@ Page({
this.fetchHomeBanner()
this.fetchHomeHot()
wx.vibrateShort({
success () {
success() {
//console.log('震动')
}
})
@ -66,7 +68,7 @@ Page({
// 获取首页列表
fetchHomeList () {
fetchHomeList() {
let page = this.data.currPage
homeModel.getHomeList(page, res => {
this.setData({
@ -82,7 +84,7 @@ Page({
image: item.titlePic,
showTop: item.isTop == 1 ? true : false,
time: dayjs(item.createTime).toNow(),
type:item.type,
type: item.type,
readed: item.isRead == 0 ? false : true
})
})
@ -113,7 +115,7 @@ Page({
},
fetchHomeBanner () {
fetchHomeBanner() {
this.setData({
banners: []
})
@ -126,7 +128,8 @@ Page({
tempBanners.push({
id: item.id,
image: item.titlePic,
title: item.title
title: item.title,
type: item.type
})
})
this.setData({
@ -134,7 +137,7 @@ Page({
})
})
},
fetchHomeHot () {
fetchHomeHot() {
this.setData({
hots: []
})
@ -146,7 +149,8 @@ Page({
datas.forEach(item => {
tempHots.push({
id: item.id,
title: item.title
title: item.title,
type: item.type
})
})
this.setData({
@ -155,57 +159,81 @@ Page({
})
},
// Banner/Hot/List事件
tapSwiperItem (e) {
//console.log(e.detail)
if(e.detail.id == '987a8433d925f36d3690fab91fe9e137'){
tapSwiperItem(e) {
console.log(e)
const {
id,
type
} = e.detail
if (e.detail.id == '987a8433d925f36d3690fab91fe9e137') {
this.jump()
}else{
this.gotoArticePage(e.detail.id)
} else {
// this.gotoArticePage(e.detail.id)
if (type == 0) {
this.gotoArticePage(id)
} else {
this.gotoActivityPage(id)
}
}
},
tapFocusItem (e) {
tapFocusItem(e) {
// console.log(e)
const {
id,
title,
type
} = e.detail
//console.log(e.detail)
this.gotoArticePage(e.detail.id)
// this.gotoArticePage(e.detail.id)
//type 文章/活动标识0-文章,1-活动
if (type == 0) {
this.gotoArticePage(id)
} else {
this.gotoActivityPage(id)
}
},
//点击列表cell获取id,进入页面
clickListItem (e) {
clickListItem(e) {
//console.log(e.detail)
console.log('点击---',e)
const {id, index,type} = e.detail
console.log('点击---', e)
const {
id,
index,
type
} = e.detail
this.setData({
[`list[${index}].readed`]: true
})
//type 文章/活动标识0-文章,1-活动
if(type==0){
this.gotoArticePage(id)
}
else{
this.gotoActivityPage(id)
}
if (type == 0) {
this.gotoArticePage(id)
} else {
this.gotoActivityPage(id)
}
},
//文章 0
gotoArticePage (id) {
gotoArticePage(id) {
wx.navigateTo({
url: `/pages/article/index?id=${id}`,
})
},
//活动 1
gotoActivityPage (id) {
gotoActivityPage(id) {
wx.navigateTo({
url: `/pages/topics/activity/activityDetail/index?activityId=${id}`,
})
},
onClose(){
onClose() {
this.setData({
show:false
show: false
})
},
jump:function(){
jump: function () {
this.setData({
show:false
show: false
})
wx.navigateTo({
url: '/pages/resource/navigate/index?url=' + encodeURIComponent(this.data.web)

2
pages/topics/lease/index.js

@ -43,5 +43,7 @@ Component({
this.setData({
height:app.globalData.windowHeight - 44
})
console.log('windowHeight--->',app.globalData.windowHeight)
console.log('height--->',this.data.height)
},
})

10
pages/topics/lease/index.wxml

@ -1,8 +1,14 @@
<!--pages/topics/rentHouse/index.wxml-->
<!--pages/topics/loan/index.wxml-->
<view class="con"
<!-- <view class="con"
style="background: url({{imgUrl}}) no-repeat; background-size:cover;background-position-y:bottom;height:{{height}}px">
<view class="btnView">
<e-ibutton title="查看详情" bind:onTap="check" />
</view>
</view> -->
<view class="con" style="height:{{height}}px">
<image src="{{imgUrl}}" class="bg-image" style="height:{{height}}px"></image>
<view class="btnView">
<e-ibutton title="查看详情" bind:onTap="check" />
</view>
</view>

9
pages/topics/lease/index.wxss

@ -1,11 +1,16 @@
/* pages/topics/rentHouse/index.wxss */
.bg-image{
display: block;
width: 100%;
height: 100%;
/* background-color: rgba(0,0,0,.2); */
}
.con{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
background-size: 100% 100%;
/* background-size: 100% 100%; */
}
.img{
width: 200px;

2
pages/topics/loan/index.wxml

@ -1,5 +1,5 @@
<!--pages/topics/loan/index.wxml-->
<view class="con" style="background: url({{imgUrl}}) no-repeat; background-size:cover;background-position-y:bottom;height:{{height}}px">
<view class="con" style="overflow:hidden;background: url({{imgUrl}}) no-repeat; background-size:cover;background-position-y:bottom;height:{{height}}px">
<!-- <view class="img">
<image src="{{detail.titlePic}}"></image>
</view>

2
pages/topics/reportDemand/index.js

@ -313,7 +313,7 @@ Page({
workplace: this.data.company,
name: this.data.username
}
console.log('报需求-->',data)
topicModel.addTalents(data, res => {
const id = res.result;
if (res.code === 200) {

Loading…
Cancel
Save