23 changed files with 306 additions and 24 deletions
@ -0,0 +1,79 @@ |
|||
const { default: https } = require("../../../utils/https") |
|||
|
|||
// pages/info/culturalUnitInfo/index.js
|
|||
import commonApi from "../../../utils/https/common" |
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
info:null |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
commonApi._post("pbservice/cultural_units/getDetail",{ |
|||
id:options.id |
|||
}).then(res=>{ |
|||
res.data.list_img = res.data.list_img?res.data.list_img.split(","):[] |
|||
if(res.data.list_img.length==0 && res.data.head_img){ |
|||
res.data.list_img.push(res.data.head_img) |
|||
} |
|||
this.setData({ |
|||
info:res.data |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
} |
|||
}) |
|||
@ -0,0 +1,5 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"title":"/pages/component/TitleHeader" |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
<!--pages/info/culturalUnitInfo/index.wxml--> |
|||
<wxs src="../../../utils/filter.wxs" module="tool" /> |
|||
<view wx:if="{{info}}"> |
|||
<title title="{{info.company_name}}"></title> |
|||
<swiper class="swiper" indicator-dots="{{true}}" |
|||
autoplay="{{true}}" interval="{{2000}}" duration="{{300}}"> |
|||
<block wx:for="{{info.list_img}}" wx:key="*this"> |
|||
<swiper-item> |
|||
<image src="{{item}}" mode="aspectFill"></image> |
|||
</swiper-item> |
|||
</block> |
|||
</swiper> |
|||
<view class="top-box"> |
|||
<view class="info-address" wx:if="{{info.address}}">地址:{{info.address}}</view> |
|||
<view class="info-address" wx:if="{{info.mobile}}">电话:{{info.mobile}}</view> |
|||
</view> |
|||
<view class="content" wx:if="{{info.content}}"> |
|||
<rich-text nodes="{{tool.formateRichText(info.content)}}"></rich-text> |
|||
</view> |
|||
</view> |
|||
@ -0,0 +1,32 @@ |
|||
.swiper { |
|||
width: 100%; |
|||
height: 400rpx; |
|||
} |
|||
.swiper image { |
|||
height: 400rpx; |
|||
display: block; |
|||
width: 100%; |
|||
} |
|||
page { |
|||
background: #fff; |
|||
} |
|||
.top-box { |
|||
padding: 20rpx 39rpx; |
|||
background: white; |
|||
border-radius: 20rpx 20rpx 0px 0px; |
|||
margin-bottom: 25rpx; |
|||
} |
|||
.title { |
|||
font-size: 32rpx; |
|||
color: #000; |
|||
font-weight:500; |
|||
} |
|||
.info-address { |
|||
color: #666; |
|||
font-size: 27rpx; |
|||
} |
|||
.content { |
|||
font-size: 30rpx; |
|||
padding: 40rpx; |
|||
background: white; |
|||
} |
|||
@ -0,0 +1,82 @@ |
|||
// pages/list/culturalUnit/index.js
|
|||
import commonApi from "../../../utils/https/common" |
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
page:1, |
|||
list:[], |
|||
total:1 |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
this.getList() |
|||
}, |
|||
getList(){ |
|||
if(this.data.total<=this.data.list.length) return; |
|||
commonApi._post("pbservice/cultural_units/getList",{ |
|||
limit:20, |
|||
page:this.data.page |
|||
}).then(res=>{ |
|||
this.setData({ |
|||
list:this.data.list.concat(res.data.data), |
|||
total:res.data.total, |
|||
page:this.data.page+1 |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
this.getList() |
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
} |
|||
}) |
|||
@ -0,0 +1,5 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"title":"/pages/component/TitleHeader" |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
<!--pages/list/culturalUnit/index.wxml--> |
|||
<title title="文化单位"></title> |
|||
<navigator wx:for="{{list}}" url="/pages/info/culturalUnitInfo/index?id={{item.id}}" class="item"> |
|||
<image src="{{item.head_img}}" mode="aspectFill"></image> |
|||
<view class="textOver title">{{item.company_name}}</view> |
|||
<view class="location textOver"><view class="iconfont icon-location"></view><text class="textOver">{{item.address}}</text></view> |
|||
</navigator> |
|||
<view class="nomoredata" wx:if="{{list.length==0}}">暂无数据</view> |
|||
@ -0,0 +1,39 @@ |
|||
/* pages/list/culturalUnit/index.wxss */ |
|||
page { |
|||
background: #EDEDED; |
|||
} |
|||
.item { |
|||
width: 690rpx; |
|||
height: 420rpx; |
|||
background: #fff; |
|||
border-radius: 20rpx; |
|||
margin: 20rpx auto; |
|||
overflow: hidden; |
|||
} |
|||
.item image { |
|||
display: block; |
|||
width: 100%; |
|||
height: 300rpx; |
|||
margin-bottom: 10rpx; |
|||
} |
|||
.title { |
|||
font-size: 30rpx; |
|||
margin: 0 20rpx; |
|||
padding: 10rpx 0; |
|||
} |
|||
.location { |
|||
display: flex; |
|||
align-items: center; |
|||
margin: 0 20rpx; |
|||
font-size: 26rpx; |
|||
} |
|||
.location .iconfont { |
|||
color: #0B898E; |
|||
margin-right: 10rpx; |
|||
} |
|||
.nomoredata { |
|||
text-align: center; |
|||
color: #666; |
|||
line-height: 90rpx; |
|||
font-size: 26rpx; |
|||
} |
|||
Loading…
Reference in new issue