分享功能开发
This commit is contained in:
@@ -241,7 +241,7 @@
|
||||
import point from '@/static/icon/point.png';
|
||||
import VideoPlayer from './component/videoPlayer.vue';
|
||||
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
|
||||
import { onLoad, onShow, onHide } from '@dcloudio/uni-app';
|
||||
import { onLoad, onShow, onHide, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app';
|
||||
import dictLabel from '@/components/dict-Label/dict-Label.vue';
|
||||
import RadarMap from './component/radarMap.vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
@@ -364,10 +364,10 @@ function getCompanyIsAJobs(companyId) {
|
||||
}
|
||||
|
||||
function getTextWidth(text, size = 12) {
|
||||
const canvas = document.createElement('canvas');
|
||||
const context = canvas.getContext('2d');
|
||||
context.font = `${12}px Arial`;
|
||||
return -(context.measureText(text).width / 2) - 20; // 计算文字中心点
|
||||
// 在小程序环境中,document 对象不存在,使用估算方法
|
||||
// 简单估算:每个字符大约占 8px 宽度
|
||||
const estimatedWidth = text.length * 8;
|
||||
return -(estimatedWidth / 2) - 20; // 计算文字中心点
|
||||
}
|
||||
|
||||
function getCompetivetuveness(jobId) {
|
||||
|
||||
Reference in New Issue
Block a user