修改随机获取二维码

This commit is contained in:
lcc
2025-09-09 17:19:50 +08:00
parent de8a22cee4
commit 4befb7833b
+23 -17
View File
@@ -49,20 +49,21 @@
<div class="mt10">有任何疑问可添加车管家的微信进行咨询~</div>
</div>
<div class="text-center">
<!--
<van-swipe class="van-swipe" :autoplay="3000">
<van-swipe-item v-for="(image, index) in qrImages" :key="index">
<van-image fit="cover" style="width:150px;height:150px" :src="image" />
</van-swipe-item>
</van-swipe>
-->
<div>
<van-image fit="cover" style="width:150px;height:150px" src="https://img.liche.cn/space/agent/admin/202509/p_56bb15d5873104537cd529832fb8521b.png" />
</div>
<div>
<van-image fit="cover" style="width:150px;height:150px" src="https://img.liche.cn/space/agent/admin/202509/p_bdce5bb61375127d3dc9f51ee7519fa3.png" />
</div>
<div>
<van-image fit="cover" style="width:150px;height:150px" src="https://img.liche.cn/space/agent/admin/202509/p_cf960a64eb62c7aa3cd25a3e81f9fe2d.png" />
<van-image fit="cover" style="width:150px;height:150px" :src="qrImage" />
</div>
<!--
<vue-qrcode class="qrcode" value="https://example.com"/>
<vue-qrcode class="qrcode" value="https://example.com"/>
<vue-qrcode class="qrcode" value="https://example.com"/>
-->
<vue-qrcode class="qrcode" value="https://example.com"/>
<vue-qrcode class="qrcode" value="https://example.com"/>
<vue-qrcode class="qrcode" value="https://example.com"/>
-->
</div>
</van-dialog>
@@ -75,7 +76,7 @@ import { ref, reactive, defineEmits, watch } from 'vue'
import CouponItem from '@/components/CouponItem.vue' // 导入CouponItem组件
import PopContent from '@/components/PopContent.vue' // 导入PopContent组件
import api from '@/utils/api' // 导入API模块
import { showToast,showDialog } from 'vant' // 导入Toast组件
import { showToast,showDialog,Lazyload,Swipe, SwipeItem } from 'vant' // 导入Toast组件
import { getBasicConfig } from '@/utils/basicSetting'
import VueQrcode from 'vue-qrcode'; // 直接导入
@@ -96,6 +97,14 @@ const code = ref('');
const is_show_count = ref(false);
const count_time = ref(60000);
const showConfirm = ref(false);
const qrImages = ref([
"https://img.liche.cn/space/agent/admin/202509/p_56bb15d5873104537cd529832fb8521b.png",
"https://img.liche.cn/space/agent/admin/202509/p_bdce5bb61375127d3dc9f51ee7519fa3.png",
"https://img.liche.cn/space/agent/admin/202509/p_cf960a64eb62c7aa3cd25a3e81f9fe2d.png"
])
const qrImage = ref('');
//随机取一张qrImages图片
qrImage.value = qrImages.value[Math.floor(Math.random() * qrImages.value.length)];
watch(() => props.showPop, async(val) => {
console.log('showPop', val);
@@ -241,10 +250,7 @@ function handleShowStores() {
<style>
.qrcode {
display: block;
width: 50vw;
height: 50vw;
margin: 0 auto;
.van-swipe {
transform: translateZ(0);
}
</style>