This commit is contained in:
qsh
2026-03-05 16:44:14 +08:00
parent 9baa76b62a
commit 9b4f404cb6

View File

@@ -43,7 +43,7 @@
<view class="section-title">二维码列表</view>
<view class="qrcode-grid">
<view
v-for="(qrcode, index) in qrcodeList"
v-for="(qrcode, index) in showList"
:key="index"
class="qrcode-item"
>
@@ -128,12 +128,16 @@
<script setup>
import { ref, computed, onMounted } from "vue"
import { getDistributorPage, updateQrcodeStatus } from "@/api/distribution/distributor"
import { getDistributorPage, updateQrcodeStatus,getDistributorDetail } from "@/api/distribution/distributor"
import { useUserStore } from '@/store'
const name = ref('')
const phone = ref('')
const qrcodeList = ref([])
const mineCode = ref({})
const currentPage = ref(1)
const totalQrcodes = ref(100)
@@ -143,10 +147,26 @@
return Math.ceil(totalQrcodes.value / pageSize.value)
})
const showList = computed(() => {
if(mineCode.value.appletUrl) {
return qrcodeList.value.concat(mineCode.value)
}
return qrcodeList.value
})
onMounted(() => {
loadQrcodeList()
getMineQrcode()
})
async function getMineQrcode() {
const res = await getDistributorDetail(useUserStore().id)
if(res.data.appletUrl) {
mineCode.value = res.data
}
}
async function loadQrcodeList() {
const res = await getDistributorPage({
pageNo: currentPage.value,