hookehuyr

fix 扫描功能测试

1 <!-- 1 <!--
2 * @Date: 2023-05-19 14:54:27 2 * @Date: 2023-05-19 14:54:27
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-09-23 14:54:34 4 + * @LastEditTime: 2024-09-23 15:50:51
5 * @FilePath: /map-demo/src/views/bieyuan/map.vue 5 * @FilePath: /map-demo/src/views/bieyuan/map.vue
6 * @Description: 公众地图主体页面 6 * @Description: 公众地图主体页面
7 --> 7 -->
...@@ -95,6 +95,7 @@ import pageInfo from '@/views/bieyuan/info.vue' ...@@ -95,6 +95,7 @@ import pageInfo from '@/views/bieyuan/info.vue'
95 import audioBackground1 from '@/components/audioBackground1.vue' 95 import audioBackground1 from '@/components/audioBackground1.vue'
96 import { mapState, mapActions } from 'pinia' 96 import { mapState, mapActions } from 'pinia'
97 import { mainStore } from '@/store' 97 import { mainStore } from '@/store'
98 +import { parseQueryString } from '@/utils/tools'
98 99
99 const GPS = { 100 const GPS = {
100 PI: 3.14159265358979324, 101 PI: 3.14159265358979324,
...@@ -639,12 +640,14 @@ export default { ...@@ -639,12 +640,14 @@ export default {
639 scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有 640 scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有
640 success: (res) => { 641 success: (res) => {
641 var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果 642 var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
642 - // TODO: 等待真实扫描数据结构 643 + let id = parseQueryString(result).id;
644 + let marker_id = parseQueryString(result).marker_id;
645 + // 跳转详情页
643 this.$router.push({ 646 this.$router.push({
644 path: '/bieyuan/info', 647 path: '/bieyuan/info',
645 query: { 648 query: {
646 - id: this.$route.query.id, 649 + id,
647 - marker_id: '2098987' 650 + marker_id
648 } 651 }
649 }) 652 })
650 } 653 }
......