123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <template>
- <view class="trajectory">
- <view class="title">访问轨迹</view>
- <time-axis v-for="item in trajectoryList" :key="item.userID">
- <template #title>
- <text>{{ item.accessTime }}(停留时长{{ item.accessDuration }})</text>
- </template>
- <template #content>
- <view class="time-axis-content" @click="handleLink(item)">
- <image
- :src="fileType(item)"
- class="axis-product"
- mode=""
- ></image>
- <view class="axis-product-info">
- <view class="product-title">【{{ item.pageType | pageTypeChange }}】</view>
- <view class="product-info" v-if="item.title">{{ item.title }}</view>
- </view>
- </view>
- </template>
- </time-axis>
- </view>
- </template>
- <script>
- import TimeAxis from './time-axis.vue'
- export default {
- props: {
- trajectoryList: {
- type: Array,
- default: () => []
- }
- },
- components: {
- TimeAxis
- },
- filters: {
- pageTypeChange(val) {
- const obj = {
- '6': '商品',
- '11': '文章',
- '8': '搜索记录',
- '69': '文件',
- '70': '图片',
- '71': '视频'
- }
- return obj[val]
- },
- },
- data() {
- return {}
- },
- methods: {
- handleLink(item) {
- if (Number(item.pageType) >= 69) {
- uni.setStorageSync('databaseurl', item.pagePath)
- uni.navigateTo({
- url: `/pages/h5/article/path?databaseurl=1`
- })
- }
- },
- fileType(item) {
- if (item.titleImage) return item.titleImage
- if (item.title) {
- return item.title?.indexOf('.pdf') !== -1
- ? 'https://static.caimei365.com/app/mini-database/H5-pdf.png'
- : item?.indexOf('.docx') !== -1
- ? 'https://static.caimei365.com/app/mini-database/H5-doc.png'
- : 'https://static.caimei365.com/app/mini-database/H5-ppt.png'
- }
- else return '../../../../static/temp/icon-new@2x.png'
- }
- }
- }
- </script>
- <style lang="scss">
- .trajectory {
- margin: 24rpx auto;
- width: 702rpx;
- background-color: #fff;
- border-radius: 16rpx;
- padding: 40rpx 32rpx;
- box-sizing: border-box;
- .title {
- color: #333333;
- font-size: 28rpx;
- font-weight: bold;
- margin-bottom: 30rpx;
- }
- }
- .axis-product {
- width: 136rpx;
- height: 136rpx;
- object-fit: contain;
- }
- .axis-product-info {
- display: flex;
- flex-direction: column;
- height: 136rpx;
- width: 426rpx;
- color: #333333;
- font-size: 26rpx;
- margin-left: 24rpx;
- .product-info {
- margin-top: 16rpx;
- overflow: hidden;
- -webkit-line-clamp: 2;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- height: 73rpx;
- width: 426rpx;
- }
- }
- .time-axis-content {
- display: flex;
- align-items: center;
- }
- </style>
|