|
@@ -41,7 +41,7 @@
|
|
更多
|
|
更多
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="asset-box">
|
|
|
|
|
|
+ <view class="asset-box" v-show="assetList.length > 0">
|
|
<view class="title">
|
|
<view class="title">
|
|
公开设备
|
|
公开设备
|
|
</view>
|
|
</view>
|
|
@@ -57,24 +57,39 @@
|
|
{{asset.name}}
|
|
{{asset.name}}
|
|
</view>
|
|
</view>
|
|
<view class="introduce">
|
|
<view class="introduce">
|
|
- <text>{{asset.introduce}}</text>
|
|
|
|
|
|
+ <text>简介:{{asset.introduce === null ? '暂无' : asset.introduce}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</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>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import { assetList, studyNew, getImage } from '@/api/visitor.js'
|
|
|
|
|
|
+ import { assetList, studyNew, getImage, demoVideo, playerVideo } from '@/api/visitor.js'
|
|
export default {
|
|
export default {
|
|
name: 'Visitor-Index',
|
|
name: 'Visitor-Index',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
studyNumber: 3,
|
|
studyNumber: 3,
|
|
assetList: [],
|
|
assetList: [],
|
|
- studyList: []
|
|
|
|
|
|
+ studyList: [],
|
|
|
|
+ videoList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -86,9 +101,30 @@
|
|
getNewStudy() {
|
|
getNewStudy() {
|
|
studyNew(this.studyNumber).then(res => {
|
|
studyNew(this.studyNumber).then(res => {
|
|
this.studyList = 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) {
|
|
imgSrc(src) {
|
|
return getImage(src)
|
|
return getImage(src)
|
|
},
|
|
},
|
|
@@ -103,7 +139,6 @@
|
|
});
|
|
});
|
|
},
|
|
},
|
|
toDetail(asset) {
|
|
toDetail(asset) {
|
|
- console.log('资产信息', asset);
|
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pages/visitor/assetDetail/assetDetail?barCode=' + asset.barCode
|
|
url: '/pages/visitor/assetDetail/assetDetail?barCode=' + asset.barCode
|
|
});
|
|
});
|
|
@@ -112,11 +147,17 @@
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url:'/pages/notice/notice?id='+id,
|
|
url:'/pages/notice/notice?id='+id,
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ toMoreVideo() {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/visitor/modeVideo/modeVideo'
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
this.getNewStudy()
|
|
this.getNewStudy()
|
|
this.getAssetList()
|
|
this.getAssetList()
|
|
|
|
+ this.getDemoVideo()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -134,12 +175,12 @@
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
border-radius: 20rpx;
|
|
border-radius: 20rpx;
|
|
padding: 10rpx 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{
|
|
.title{
|
|
width: 100%;
|
|
width: 100%;
|
|
text-align: center;
|
|
text-align: center;
|
|
- font-weight: bold;
|
|
|
|
|
|
+ // font-weight: bold;
|
|
font-size: $uni-title-font-size;
|
|
font-size: $uni-title-font-size;
|
|
margin-bottom: 40rpx;
|
|
margin-bottom: 40rpx;
|
|
}
|
|
}
|
|
@@ -179,9 +220,18 @@
|
|
margin-top: 40rpx;
|
|
margin-top: 40rpx;
|
|
|
|
|
|
.title{
|
|
.title{
|
|
- font-weight: bold;
|
|
|
|
|
|
+ font-weight: 500;
|
|
font-size: $uni-title-font-size;
|
|
font-size: $uni-title-font-size;
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ .right{
|
|
|
|
+ position: absolute;
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ right: 20rpx;
|
|
|
|
+ top: 25%;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
.list{
|
|
.list{
|
|
@@ -191,7 +241,7 @@
|
|
align-items: center;
|
|
align-items: center;
|
|
height: 260rpx;
|
|
height: 260rpx;
|
|
border-radius: 20rpx;
|
|
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;
|
|
padding: 60rpx 30rpx;
|
|
margin-bottom: 45rpx;
|
|
margin-bottom: 45rpx;
|
|
@@ -216,11 +266,24 @@
|
|
font-size: $uni-font-size;
|
|
font-size: $uni-font-size;
|
|
display: -webkit-box;
|
|
display: -webkit-box;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-orient: vertical;
|
|
- -webkit-line-clamp: 4;
|
|
|
|
|
|
+ -webkit-line-clamp: 3;
|
|
overflow: hidden;
|
|
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;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|