sc
This commit is contained in:
@@ -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)
|
||||
@@ -142,11 +146,27 @@
|
||||
const totalPages = computed(() => {
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user