api base 调整,接口对接
This commit is contained in:
@@ -1,20 +1,92 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<view class="course-item-box" @click="clickItem">
|
||||
<ImagePreview class="img-box"></ImagePreview>
|
||||
<view class="cont-box">
|
||||
<view class="item-title">{{itemInfo.crsName}}</view>
|
||||
<uv-scroll-list class="item-tags" :indicator="false">
|
||||
<view class="item-tag" v-for="item in itemInfo.tagsList">{{item.tagName}}</view>
|
||||
</uv-scroll-list>
|
||||
<view class="item-publish">发布:{{itemInfo.publicTime}}</view>
|
||||
<view class="item-num">已学:{{itemInfo.learnedNum}}人次</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script >
|
||||
import ImagePreview from '@/components/image-preview/image-preview.vue'
|
||||
export default {
|
||||
name:"course-item",
|
||||
components:{
|
||||
ImagePreview
|
||||
},
|
||||
props:{
|
||||
itemInfo:{
|
||||
type:Object,
|
||||
default:()=>({
|
||||
crsName: '银行核心业务全流程实践哒哒哒哒',
|
||||
tagsList:[{tagName:'公斤业务'},{tagName:'初级'}],
|
||||
publicTime:"2025-01-03",
|
||||
learnedNum:'2222222'
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
clickItem(){
|
||||
this.$emit('clickItem')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.course-item-box{
|
||||
padding: 15rpx;
|
||||
overflow: hidden;
|
||||
.img-box{
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
float: left;
|
||||
}
|
||||
.cont-box{
|
||||
width: calc(100% - 170rpx);
|
||||
box-sizing: border-box;
|
||||
padding: 0 10rpx 0 20rpx;
|
||||
float: left;
|
||||
.item-title{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 44rpx;
|
||||
font-size: 29rpx;
|
||||
font-weight: 500;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.item-tags{
|
||||
padding-bottom: 0 !important;
|
||||
.item-tag{
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
font-size: 20rpx;
|
||||
background-color: #eee;
|
||||
color: rgb(51, 51, 51);
|
||||
padding: 0 20rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
.item-publish,
|
||||
.item-num{
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
font-size: 20rpx;
|
||||
color: rgb(102,102,102);
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,9 +1,10 @@
|
||||
<template>
|
||||
<image :src="imgUrl"></image>
|
||||
<!-- <image :src="imgUrlShow"></image> -->
|
||||
<image class="img" src="@/static/images/test/1.png"></image>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import previewFile from'@/api/common.js'
|
||||
import {previewFile} from'@/api/common.js'
|
||||
export default {
|
||||
name:"image-preview",
|
||||
props:{
|
||||
@@ -14,7 +15,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imgUrl
|
||||
imgUrlShow:''
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -39,15 +40,15 @@
|
||||
},
|
||||
methods: {
|
||||
getPreviewUrlBlob(id) {
|
||||
previewFile(id).then((res) => {
|
||||
this.imgUrlShow = URL.createObjectURL(res);
|
||||
|
||||
// const reader = new FileReader();
|
||||
// reader.readAsDataURL(res)
|
||||
// reader.onloadend = () => {
|
||||
// this.imgUrlShow = reader.result;
|
||||
// }
|
||||
});
|
||||
this.imgUrlShow = '@/static/images/index/message_b.png'
|
||||
// previewFile(id).then((res) => {
|
||||
// this.imgUrlShow = URL.createObjectURL(res);
|
||||
// // const reader = new FileReader();
|
||||
// // reader.readAsDataURL(res)
|
||||
// // reader.onloadend = () => {
|
||||
// // this.imgUrlShow = reader.result;
|
||||
// // }
|
||||
// });
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
||||
Reference in New Issue
Block a user