Commit d8940d5d authored by 杨硕's avatar 杨硕

对接接口

parent 1baeabb4
...@@ -106,7 +106,16 @@ ...@@ -106,7 +106,16 @@
} }
} }
,{ ,
{
"path" : "pages/sort/index",
"style" :
{
"navigationBarTitleText":"分类",
"enablePullDownRefresh": false
}
},{
"path" : "pages/menu/list", "path" : "pages/menu/list",
"style" : "style" :
{ {
...@@ -239,7 +248,7 @@ ...@@ -239,7 +248,7 @@
"text": "首页" "text": "首页"
}, },
{ {
"pagePath": "pages/menu/index", "pagePath": "pages/sort/index",
"iconPath": "static/img/image/tab_icon_fenlei_default@2x.png", "iconPath": "static/img/image/tab_icon_fenlei_default@2x.png",
"selectedIconPath": "static/img/image/tab_icon_fenlei_selected@2x.png", "selectedIconPath": "static/img/image/tab_icon_fenlei_selected@2x.png",
"text": "分类" "text": "分类"
......
<template> <template>
<view class="u-wrap"> <view class="u-wrap">
<view class="u-search-box"> <!-- <view class="u-search-box">
<view class="u-search-inner"> <view class="u-search-inner">
<u-icon name="search" color="#909399" :size="28"></u-icon> <u-icon name="search" color="#909399" :size="28"></u-icon>
<u-input class="u-search-text" type="text" height="50" @click="toSearch" placeholder="标题" /> <u-input class="u-search-text" type="text" height="50" @click="toSearch" placeholder="标题" />
</view> </view>
</view> </view> -->
<view class="u-menu-wrap"> <view class="u-menu-wrap">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" <scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop"
:scroll-into-view="itemId"> :scroll-into-view="itemId">
......
...@@ -15,33 +15,7 @@ ...@@ -15,33 +15,7 @@
export default { export default {
data() { data() {
return { return {
hotList: [ hotList: []
{
'title': '11111',
'details': '1111',
'path': '11111'
},
{
'title': '11111',
'details': '1111',
'path': '11111'
},
{
'title': '11111',
'details': '1111',
'path': '11111'
},
{
'title': '11111',
'details': '1111',
'path': '11111'
},
{
'title': '11111',
'details': '1111',
'path': '11111'
}
]
} }
}, },
onLoad() { onLoad() {
...@@ -49,7 +23,11 @@ ...@@ -49,7 +23,11 @@
}, },
methods: { methods: {
init(){ init(){
const unitList = this.vuex_unit
this.$u.get('cmsnews/miniProgram/listByClassification?page=1&rows=10&unitId='+unitList[0].businessId).then(res => {
const videoChild = res.records
this.hotList = videoChild
})
}, },
toDetail(id){ toDetail(id){
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<view v-for="(item,index) in hotList" :key="index" class="indexcard"> <view v-for="(item,index) in hotList" :key="index" class="indexcard">
<image class="cardimage" :src="item.path" @click="toDetail(item.id)"></image> <image class="cardimage" :src="item.path" @click="toDetail(item.id)"></image>
<view class="cardtitle" @click="toDetail(item.id)"> <view class="cardtitle" @click="toDetail(item.id)">
<view class="cardtitle1">{{item.title}}</view> <view class="cardtitle1">{{item.videoTitle}}</view>
<view class="cardtitle2">{{item.details.replace(/<[^>]*>/g, '')}}</view> <!-- <view class="cardtitle2">{{item.details.replace(/<[^>]*>/g, '')}}</view> -->
<!-- <view class="cardtitle3">{{formatPrice(item.price)}}</view>--> <!-- <view class="cardtitle3">{{formatPrice(item.price)}}</view>-->
</view> </view>
</view> </view>
...@@ -64,7 +64,12 @@ ...@@ -64,7 +64,12 @@
}, },
methods: { methods: {
init(){ init(){
const unitList = this.vuex_unit
this.$u.get('cmsvideo/miniProgram/listByClassification?page=1&rows=10&unitId='+unitList[0].businessId).then(res => {
const videoChild = res.records
this.hotList= videoChild
})
}, },
toDetail(id){ toDetail(id){
......
...@@ -152,6 +152,7 @@ import pic2 from '../../static/image/pic2.png' ...@@ -152,6 +152,7 @@ import pic2 from '../../static/image/pic2.png'
<style> <style>
.top{ .top{
background-color: #F6F6F6; background-color: #F6F6F6;
min-height: 100vh;
} }
.gl-title { .gl-title {
/* padding: 20rpx; */ /* padding: 20rpx; */
......
<template>
<view class="u-wrap">
<u-subsection :list="list" :current="curNow" @change="sectionChange"></u-subsection>
<view class="body">
<view v-if="curNow===0" v-for="(item,index) in hotList" :key="index" class="indexcard">
<image class="cardimage" :src="item.path" @click="toDetail(item.id)"></image>
<view class="cardtitle" @click="toDetail(item.id)">
<view class="cardtitle1">{{item.title}}</view>
<view class="cardtitle2">{{item.details.replace(/<[^>]*>/g, '')}}</view>
<!-- <view class="cardtitle3">{{formatPrice(item.price)}}</view>-->
</view>
</view>
<view v-if="curNow===1" v-for="(item,index) in videoList" :key="index" class="indexcard">
<image class="cardimage" :src="item.path" @click="toDetail(item.id)"></image>
<view class="cardtitle" @click="toDetail(item.id)">
<view class="cardtitle1">{{item.videoTitle}}</view>
<!-- <view class="cardtitle2">{{item.details.replace(/<[^>]*>/g, '')}}</view> -->
<!-- <view class="cardtitle3">{{formatPrice(item.price)}}</view>-->
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: ['文章', '视频'],
curNow: 0,
hotList: [],
videoList: []
}
},
onLoad() {
this.init()
},
methods: {
sectionChange(index) {
this.curNow = index;
},
init() {
const unitList = this.vuex_unit
this.$u.get('cmsnews/miniProgram/listByClassification?page=1&rows=10&unitId='+unitList[0].businessId).then(res => {
const videoChild = res.records
this.hotList = videoChild
})
this.$u.get('cmsvideo/miniProgram/listByClassification?page=1&rows=10&unitId='+unitList[0].businessId).then(res => {
const videoChild = res.records
this.videoList= videoChild
})
}
}
}
</script>
<style>
.u-wrap{
background: #F6F6F6;
min-height: 100vh;
}
.body{
padding: 30rpx 0;
}
.indexcard{
/* height: 127px; */
background: #FFFFFF;
box-shadow: 0px 0px 15px 1px rgba(0,0,0,0.06);
border-radius: 12px 12px 12px 12px;
display: flex;
margin: 0 30rpx 22rpx 30rpx;
/* margin-bottom: 22rpx; */
padding: 22rpx;
}
.cardimage{
width: 210rpx !important;
height: 210rpx !important;
border-radius: 8px 8px 8px 8px;
margin-right: 22rpx;
/* margin: 22rpx; */
}
.cardtitle{
width: 414rpx;
}
.cardtitle1{
font-size: 16px;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #333333;
margin-bottom: 30rpx;
overflow: hidden;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.cardtitle2{
font-size: 14px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #666666;
/* margin-bottom: 30rpx; */
overflow: hidden;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.cardtitle3{
font-size: 16px;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #D94343;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment