sc
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
<view class="section-title">二维码列表</view>
|
<view class="section-title">二维码列表</view>
|
||||||
<view class="qrcode-grid">
|
<view class="qrcode-grid">
|
||||||
<view
|
<view
|
||||||
v-for="(qrcode, index) in qrcodeList"
|
v-for="(qrcode, index) in showList"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="qrcode-item"
|
class="qrcode-item"
|
||||||
>
|
>
|
||||||
@@ -128,12 +128,16 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from "vue"
|
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 name = ref('')
|
||||||
const phone = ref('')
|
const phone = ref('')
|
||||||
|
|
||||||
const qrcodeList = ref([])
|
const qrcodeList = ref([])
|
||||||
|
const mineCode = ref({})
|
||||||
|
|
||||||
const currentPage = ref(1)
|
const currentPage = ref(1)
|
||||||
const totalQrcodes = ref(100)
|
const totalQrcodes = ref(100)
|
||||||
@@ -142,11 +146,27 @@
|
|||||||
const totalPages = computed(() => {
|
const totalPages = computed(() => {
|
||||||
return Math.ceil(totalQrcodes.value / pageSize.value)
|
return Math.ceil(totalQrcodes.value / pageSize.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const showList = computed(() => {
|
||||||
|
if(mineCode.value.appletUrl) {
|
||||||
|
return qrcodeList.value.concat(mineCode.value)
|
||||||
|
}
|
||||||
|
return qrcodeList.value
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadQrcodeList()
|
loadQrcodeList()
|
||||||
|
|
||||||
|
getMineQrcode()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
async function getMineQrcode() {
|
||||||
|
const res = await getDistributorDetail(useUserStore().id)
|
||||||
|
if(res.data.appletUrl) {
|
||||||
|
mineCode.value = res.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function loadQrcodeList() {
|
async function loadQrcodeList() {
|
||||||
const res = await getDistributorPage({
|
const res = await getDistributorPage({
|
||||||
pageNo: currentPage.value,
|
pageNo: currentPage.value,
|
||||||
|
|||||||
Reference in New Issue
Block a user