Commit 9af2bfb4 by yancanhua

fix: 小程序预览优化

1 parent d755dc1e
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Vue } from "vue-facing-decorator"; import { Component, Hook, Vue } from "vue-facing-decorator";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import { AuctionController } from "@/api/AuctionController"; import { AuctionController } from "@/api/AuctionController";
...@@ -13,9 +13,22 @@ import { AuctionController } from "@/api/AuctionController"; ...@@ -13,9 +13,22 @@ import { AuctionController } from "@/api/AuctionController";
export default class InspectionPreview extends Vue { export default class InspectionPreview extends Vue {
h5Url: string = ''; h5Url: string = '';
vehicleId: string = '';
imageUrl: string = '';
created(): void { created(): void {
onLoad((option) => { onLoad((option) => {
this.vehicleId = option.vehicleId;
this.getReportVehicleData(option.vehicleId); this.getReportVehicleData(option.vehicleId);
this.getVehicleDetail(option.aucvehId);
});
}
getVehicleDetail(aucvehId: string) {
AuctionController.getAuctionVehicleDetailById(this.axios, aucvehId).then(res => {
const data = res.data || {};
this.imageUrl = data?.vehicle?.cover?.url || '';
}); });
} }
...@@ -24,6 +37,27 @@ export default class InspectionPreview extends Vue { ...@@ -24,6 +37,27 @@ export default class InspectionPreview extends Vue {
this.h5Url = res.data.data?.h5Url || ''; this.h5Url = res.data.data?.h5Url || '';
}); });
} }
// 定义分享内容(必写)
@Hook('onShareAppMessage')
onShareAppMessage(res: any) {
// res.from 可判断分享触发来源:'button'(按钮触发)、'menu'(右上角菜单)
console.debug('分享来源:', res.from);
return {
title: '拍卖车检报告',
path: '/module/auction/InspectionPreview?vehicleId=' + this.vehicleId,
imageUrl: this.imageUrl || '', // 分享图片(建议尺寸 5:4,默认使用页面截图)
};
}
@Hook('onShareTimeline')
onShareTimeline() {
return {
title: '拍卖车检报告',
query: `id=${this.vehicleId}`, // 分享参数
imageUrl: this.imageUrl || '',
};
}
} }
</script> </script>
......
...@@ -7,12 +7,11 @@ ...@@ -7,12 +7,11 @@
</view> </view>
<view class="averageHand"> <view class="averageHand">
<view class="average" <view class="average" :class="reportData.overallScore >= 90 ? 'value_color1'
:class="reportData.overallScore >= 90 ? 'value_color1'
: reportData.overallScore >= 80 && reportData.overallScore <= 89 ? 'value_color2' : reportData.overallScore >= 80 && reportData.overallScore <= 89 ? 'value_color2'
: reportData.overallScore >= 60 && reportData.overallScore <= 79 ? 'value_color3' : reportData.overallScore >= 60 && reportData.overallScore <= 79 ? 'value_color3'
: reportData.overallScore < 60 ? 'value_color4' : ''" : reportData.overallScore < 60 ? 'value_color4' : ''">{{ reportData.overallScore || '-' }}
>{{ reportData.overallScore || '-' }}</view> </view>
<view class="averageUnit">分</view> <view class="averageUnit">分</view>
<!-- 优秀 90-100分 --> <!-- 优秀 90-100分 -->
<view v-if="reportData.overallScore >= 90" class="averageBox averageBox_bg1"> <view v-if="reportData.overallScore >= 90" class="averageBox averageBox_bg1">
...@@ -104,7 +103,7 @@ export default class InspectionReport extends Vue { ...@@ -104,7 +103,7 @@ export default class InspectionReport extends Vue {
}); });
return console.log('请先登录'); return console.log('请先登录');
} }
uni.navigateTo({ url: '/module/auction/InspectionPreview?vehicleId=' + this.auctionVehicle.vehicle.vehicleId }); uni.navigateTo({ url: '/module/auction/InspectionPreview?vehicleId=' + this.auctionVehicle.vehicle.vehicleId + '&aucvehId=' + this.auctionVehicle.aucvehId });
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!