|
@@ -41,7 +41,7 @@
|
|
|
更多
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="asset-box">
|
|
|
+ <view class="asset-box" v-show="assetList.length > 0">
|
|
|
<view class="title">
|
|
|
公开设备
|
|
|
</view>
|
|
@@ -57,24 +57,39 @@
|
|
|
{{asset.name}}
|
|
|
</view>
|
|
|
<view class="introduce">
|
|
|
- <text>{{asset.introduce}}</text>
|
|
|
+ <text>简介:{{asset.introduce === null ? '暂无' : asset.introduce}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view class="asset-box" v-show="videoList.length > 0">
|
|
|
+ <view class="title">
|
|
|
+ 公开视频
|
|
|
+ <view class="right" @click="toMoreVideo">更多>>></view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="list">
|
|
|
+ <view class="video" v-for="(video, index) in videoList" :key="video.id">
|
|
|
+ <video :src="playerURL(video.url)" controls :id="video.id" :data-id="video.id" :title="video.name" @play="videoPlay" :type="video.type"></video>
|
|
|
+ <view class="info">{{video.name}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { assetList, studyNew, getImage } from '@/api/visitor.js'
|
|
|
+ import { assetList, studyNew, getImage, demoVideo, playerVideo } from '@/api/visitor.js'
|
|
|
export default {
|
|
|
name: 'Visitor-Index',
|
|
|
data() {
|
|
|
return {
|
|
|
studyNumber: 3,
|
|
|
assetList: [],
|
|
|
- studyList: []
|
|
|
+ studyList: [],
|
|
|
+ videoList: []
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -86,9 +101,30 @@
|
|
|
getNewStudy() {
|
|
|
studyNew(this.studyNumber).then(res => {
|
|
|
this.studyList = res
|
|
|
- console.log('研究成果数据', res);
|
|
|
})
|
|
|
},
|
|
|
+ getDemoVideo() {
|
|
|
+ demoVideo(1, 3).then(res => {
|
|
|
+ this.videoList = res.data.rows
|
|
|
+ })
|
|
|
+ },
|
|
|
+ playerURL(url) {
|
|
|
+ return playerVideo(url)
|
|
|
+ },
|
|
|
+ videoPlay(e) {
|
|
|
+ // 获取当前视频id
|
|
|
+ let currentId = e.currentTarget.dataset.id;
|
|
|
+ // uni.createVideoContext获取视频上下文对象
|
|
|
+ this.videoContent = uni.createVideoContext(currentId);
|
|
|
+ // 获取json对象并遍历, 停止非当前视频
|
|
|
+ let videoList = this.videoList;
|
|
|
+ for (let i = 0; i < videoList.length; i++) {
|
|
|
+ let temp = videoList[i].id;
|
|
|
+ if (temp !== currentId) {
|
|
|
+ uni.createVideoContext(temp).pause();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
imgSrc(src) {
|
|
|
return getImage(src)
|
|
|
},
|
|
@@ -103,7 +139,6 @@
|
|
|
});
|
|
|
},
|
|
|
toDetail(asset) {
|
|
|
- console.log('资产信息', asset);
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/visitor/assetDetail/assetDetail?barCode=' + asset.barCode
|
|
|
});
|
|
@@ -112,11 +147,17 @@
|
|
|
uni.navigateTo({
|
|
|
url:'/pages/notice/notice?id='+id,
|
|
|
})
|
|
|
+ },
|
|
|
+ toMoreVideo() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/visitor/modeVideo/modeVideo'
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.getNewStudy()
|
|
|
this.getAssetList()
|
|
|
+ this.getDemoVideo()
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -134,12 +175,12 @@
|
|
|
background-color: #fff;
|
|
|
border-radius: 20rpx;
|
|
|
padding: 10rpx 20rpx;
|
|
|
- box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
|
|
|
+ // box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
|
|
|
|
|
|
.title{
|
|
|
width: 100%;
|
|
|
text-align: center;
|
|
|
- font-weight: bold;
|
|
|
+ // font-weight: bold;
|
|
|
font-size: $uni-title-font-size;
|
|
|
margin-bottom: 40rpx;
|
|
|
}
|
|
@@ -179,9 +220,18 @@
|
|
|
margin-top: 40rpx;
|
|
|
|
|
|
.title{
|
|
|
- font-weight: bold;
|
|
|
+ font-weight: 500;
|
|
|
font-size: $uni-title-font-size;
|
|
|
margin-bottom: 20rpx;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .right{
|
|
|
+ position: absolute;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: 400;
|
|
|
+ right: 20rpx;
|
|
|
+ top: 25%;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.list{
|
|
@@ -191,7 +241,7 @@
|
|
|
align-items: center;
|
|
|
height: 260rpx;
|
|
|
border-radius: 20rpx;
|
|
|
- box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
|
|
|
+ // box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
|
|
|
|
|
|
padding: 60rpx 30rpx;
|
|
|
margin-bottom: 45rpx;
|
|
@@ -216,11 +266,24 @@
|
|
|
font-size: $uni-font-size;
|
|
|
display: -webkit-box;
|
|
|
-webkit-box-orient: vertical;
|
|
|
- -webkit-line-clamp: 4;
|
|
|
+ -webkit-line-clamp: 3;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .video {
|
|
|
+ text-align: center;
|
|
|
+ // box-shadow: rgba(17, 17, 26, 0.1) 0px 1px 0px;
|
|
|
+ margin-bottom: 50rpx;
|
|
|
+
|
|
|
+ &:last-child {
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ }
|
|
|
+ .info {
|
|
|
+ padding: 10rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|