flat: bug修复2
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
baseUrl: 'https://fw.rc.qingdao.gov.cn/rgpp-api/api', // 内网
|
||||
// baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试
|
||||
// baseUrl: 'https://fw.rc.qingdao.gov.cn/rgpp-api/api', // 内网
|
||||
baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试
|
||||
// baseUrl: 'http://192.168.3.29:8081',
|
||||
// baseUrl: 'http://10.213.6.207:19010/api',
|
||||
// 语音转文字
|
||||
|
||||
@@ -9,8 +9,12 @@
|
||||
</view>
|
||||
<canvas canvas-id="qrcode" id="qrcode" />
|
||||
</view>
|
||||
<view class="tips" v-if="!loading"> 已上传 <span class="num">{{fileCount}}</span> 个文件 </view>
|
||||
<view class="tips" v-if="!loading"> 请使用手机扫描二维码上传文件 </view>
|
||||
<view class="tips" v-if="!loading">
|
||||
已上传
|
||||
<span class="num">{{ fileCount }}</span>
|
||||
个文件
|
||||
</view>
|
||||
<view class="tips" v-if="!loading">请使用手机扫描二维码上传文件</view>
|
||||
<view class="close-btn" @click="close"></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
@@ -24,8 +28,8 @@ import { onShow, onHide } from '@dcloudio/uni-app';
|
||||
import { UUID } from '../../../lib/uuid-min';
|
||||
const props = defineProps({
|
||||
sessionId: {
|
||||
type: [Number ,String],
|
||||
default:'',
|
||||
type: [Number, String],
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
@@ -46,14 +50,13 @@ const loadingText = computed(() => ({
|
||||
contentrefresh: '二维码生成中',
|
||||
}));
|
||||
|
||||
|
||||
onUnmounted(() => {
|
||||
stopPolling();
|
||||
clearResources();
|
||||
});
|
||||
|
||||
function open() {
|
||||
uuid.value = UUID.generate()
|
||||
uuid.value = UUID.generate();
|
||||
resetState();
|
||||
isVisible.value = true;
|
||||
popup.value.open();
|
||||
@@ -104,12 +107,18 @@ async function initQrCode() {
|
||||
}
|
||||
|
||||
function makeQrcode() {
|
||||
const htmlPath = `${window.location.host}/static/upload.html?sessionId=${uuid.value}&uploadApi=${
|
||||
config.baseUrl + '/app/kiosk/upload'
|
||||
}`;
|
||||
// const htmlPath = `${window.location.host}/static/upload.html?sessionId=${props.sessionId}&uploadApi=${
|
||||
// config.baseUrl + '/app/kiosk/upload'
|
||||
// }`;
|
||||
const protocol = window.location.protocol;
|
||||
const host = window.location.host;
|
||||
const isLocal = host.includes('localhost') || host.includes('127.0.0.1');
|
||||
const pathPrefix = isLocal ? '' : '/rgpp-api/all-in-one';
|
||||
const htmlPath = `${protocol}//${host}${pathPrefix}/static/upload.html?sessionId=${uuid.value}&uploadApi=${config.baseUrl}/app/kiosk/upload`;
|
||||
|
||||
// const htmlPath = `${window.location.host}/static/upload.html?sessionId=${uuid.value}&uploadApi=${
|
||||
// config.baseUrl + '/app/kiosk/upload'
|
||||
// }`;
|
||||
// const htmlPath = `${window.location.host}/static/upload.html?sessionId=${props.sessionId}&uploadApi=${
|
||||
// config.baseUrl + '/app/kiosk/upload'
|
||||
// }`;
|
||||
console.log(htmlPath);
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
@@ -144,11 +153,11 @@ function startPolling() {
|
||||
// 轮询检查上传状态
|
||||
const poll = async () => {
|
||||
if (!isPolling.value || !isVisible.value) return;
|
||||
const { data } = await $api.createRequest('/app/kiosk/list',{sessionId:uuid.value});
|
||||
const { data } = await $api.createRequest('/app/kiosk/list', { sessionId: uuid.value });
|
||||
// const { data } = await $api.createRequest('/app/kiosk/list',{sessionId:props.sessionId});
|
||||
if (data && data.length) {
|
||||
// 上传完成,触发事件
|
||||
fileCount.value = data.length
|
||||
fileCount.value = data.length;
|
||||
emit('onSend', data);
|
||||
}
|
||||
if (isPolling.value && isVisible.value) {
|
||||
@@ -230,8 +239,8 @@ defineExpose({ open, close });
|
||||
text-align: center;
|
||||
line-height: 1.6;
|
||||
padding: 0 20rpx;
|
||||
.num{
|
||||
color: #4191FE;
|
||||
.num {
|
||||
color: #4191fe;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ const useLocationStore = defineStore("location", () => {
|
||||
type: 'gcj02',
|
||||
highAccuracyExpireTime: 3000,
|
||||
isHighAccuracy: true,
|
||||
timeout: 2000,
|
||||
success: function(data) {
|
||||
longitudeVal.value = Number(data.longitude)
|
||||
latitudeVal.value = Number(data.latitude)
|
||||
|
||||
Reference in New Issue
Block a user