123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- <template>
- <view class="wrapper">
- <!-- 输入框 -->
- <view class="searchBox">
- <input bindconfirm="bindconfirm" bindinput="bindinput" placeholder="搜索您感兴趣内容" type='text'>
- </input>
- <!-- <image class="searchImg" src="../../assets/search-icon.png"></image> -->
- </view>
- <!-- <view class="content"> -->
- <view class="centerBox" data-id="list[0].dataId" data-format="list[0].format" data-index="list[0].dataTypeId"
- bindtap="nextUrl">
- <image :src="list[2].titlePicture"></image>
- <view class="sectionBox">
- <view class="title">
- <!-- style="color:{{list[0].fontcolor}};border:{{list[0].bordercolor}}" -->
- <text> {{list[0].dataTypeName}}</text>
- <text>{{list[0].title}}</text>
- </view>
- <view>
- <text> {{list[0].value}} </text>
- </view>
- <view class="timer">
- <text>{{list[0].issueTime}}</text>
- <view>
- <!-- <image src="../../assets/ydl.png"></image> -->
- <text>{{list[0].watchNumber}}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="lastBox">
- <view class="last-sec-box">
- <view data-id="item.dataId" data-index="item.dataTypeId" data-format="item.format" bindtap="nextUrl"
- v-for="(item,index) in list1" :key="index" class="table-col">
- <!-- 左 -->
- <view class="leftBox">
- <image :src="item.titlePicture"></image>
- </view>
- <!-- 右 -->
- <view class="rightBox">
- <view class="right-Box-top">
- <!-- style="color:{{item.fontcolor}};border:{{item.bordercolor}}" -->
- <text>{{item.dataTypeName}}</text>
- <view>{{item.title}}</view>
- </view>
- <view class="right-Box-bom">
- <text>{{item.issueTime}} </text>
- <view>
- <!-- <image src="../../assets/ydl.png"></image> -->
- <text>{{item.watchNumber}}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- </view> -->
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- title: 'Hello',
- list: [],
- list1: [],
- inputKey: '',
- dataTypeId: 3
- }
- },
- onLoad() {
- this.getlistData()
- },
- methods: {
- getlistData() {
- let that = this;
- uni.request({
- url: 'https://gjcx.zhoubianjun.com/keji/policynews/getPolicyNewsList',
- data: {
- key: this.inputKey,
- dataTypeId: this.dataTypeId
- },
- method: 'GET',
- success: (res) => {
- let resulte = res.data;
- resulte.forEach(it => {
- if (it.dataTypeName == '新闻') {
- it.fontcolor = '#FF3C1C'
- it.bordercolor = '1rpx solid #FF3C1C'
- } else {
- it.fontcolor = '#4DA4FF'
- it.bordercolor = '1rpx solid #4DA4FF'
- }
- if (it.content) {
- let text = it.content.split('\n');
- it.value = text[1]
- }
- })
- // this.list.push(resulte);
- // this.list1.push(resulte.slice(1))
- resulte.forEach(it => {
- this.list.push(it)
- })
- let demo = resulte.slice(1);
- demo.forEach(it => {
- this.list1.push(it)
- })
- console.log(this.list, 'list');
- console.log(this.list1, 'list1');
- }
- })
- },
- }
- }
- </script>
- <style>
- .wrapper {
- background: #F2F2F2;
- height: 100vh;
- width: 100%;
- }
- .searchBox {
- width: 100%;
- height: 100rpx;
- /* line-height: 100rpx; */
- z-index: 100;
- position: relative;
- background-color: white;
- display: flex;
- align-items: center;
- position: fixed;
- top: 0;
- }
- .searchImg {
- width: 40rpx;
- height: 40rpx;
- left: 85rpx;
- top: 13rpx;
- position: absolute;
- line-height: 66rpx;
- }
- .searchBox input {
- margin: 0 auto;
- width: calc(90% - 68rpx);
- height: 66rpx;
- /* line-height: 66rpx; */
- background: #F7F7F7;
- border-radius: 30rpx;
- font-size: 24rpx;
- box-sizing: border-box;
- /* position: relative; */
- padding: 0 0 0 68rpx;
- }
- .content {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- .centerBox {
- background-color: white;
- margin-top: 40rpx;
- padding: 24rpx;
- box-sizing: border-box;
- }
- .centerBox>image:first-child {
- width: 100%;
- height: 350rpx;
- }
- .sectionBox>view:nth-child(2) {
- text-indent: 40rpx;
- display: flex;
- flex-direction: column;
- font-size: 26rpx;
- font-weight: 500;
- color: #424764;
- }
- .title {
- display: flex;
- padding: 21rpx 0 25rpx 0;
- align-items: center;
- }
- .title>text:first-child {
- font-size: 14rpx;
- border-radius: 4rpx;
- padding: 3rpx 5rpx;
- display: inline-block;
- height: 100%;
- }
- .title>text:last-child {
- flex: 1;
- font-size: 26rpx;
- font-weight: bold;
- color: #424764;
- padding-left: 10rpx;
- }
- .timer {
- display: flex;
- justify-content: space-between;
- padding-top: 23rpx;
- }
- .timer>text:first-child {
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #686E92;
- }
- .timer>view:last-child {
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #4DA4FF;
- }
- .timer image {
- width: 25rpx;
- height: 17rpx;
- padding-right: 5rpx;
- }
- .lastBox {
- background-color: white;
- margin-top: 20rpx;
- }
- .table-col {
- display: flex;
- padding: 34rpx 40rpx 34rpx 24rpx;
- border-bottom: 1rpx solid #E6E6E6;
- }
- .leftBox image {
- width: 240rpx;
- height: 164rpx;
- }
- .rightBox image {
- width: 25rpx;
- height: 17rpx;
- padding-right: 5rpx;
- }
- .rightBox {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- margin-left: 13rpx;
- flex: 1;
- }
- .right-Box-top {
- display: flex;
- align-items: baseline;
- }
- .right-Box-top>text:first-child {
- font-size: 14rpx;
- border-radius: 4rpx;
- padding: 3rpx 5rpx;
- display: inline-block;
- vertical-align: middle;
- height: 25rpx;
- }
- .right-Box-top>view:last-child {
- font-size: 26rpx;
- flex: 1;
- color: #424764;
- font-weight: bold;
- padding-left: 10rpx;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- }
- .right-Box-bom {
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
- }
- .right-Box-bom>text:first-child {
- font-size: 22rpx;
- color: #686E92;
- }
- .right-Box-bom>view>text {
- font-size: 22rpx;
- font-weight: 500;
- color: #4DA4FF;
- }
- .wrapper::after {
- content: " ";
- width: 100%;
- height: 100rpx;
- background-color: white;
- float: left;
- }
- </style>
|