代码更新

This commit is contained in:
GaoHao
2025-02-26 19:46:20 +08:00
parent 7519ffced3
commit b4a0393d2d
413 changed files with 7483 additions and 60762 deletions

View File

@@ -27,7 +27,7 @@
<view class="u-flex">
<view>{{item.nickName}}</view>
</view>
<view class="u-m-t-12 ">手机号:{{item.telephone}}</view>
<view class="u-m-t-12 ">手机号:{{item.phone}}</view>
<view class=" u-font-24 u-m-t-12 u-flex">
<text class="color-999" v-if="!item.isVip">非会员</text>
<text class="color-main" v-else>会员</text>
@@ -63,28 +63,49 @@
</template>
<script setup>
import * as Api from '@/http/yskApi/shop-user.js'
import {
onLoad
} from '@dcloudio/uni-app'
import {
reactive,
onBeforeMount,
ref
} from 'vue';
import { onLoad } from '@dcloudio/uni-app'
import { reactive, onBeforeMount, ref } from 'vue';
import { shopUserList } from '@/api/shopUser.js';
let nouser = ref(false)
let timer = null
function emitChooser(data) {
uni.$emit('choose-user', data)
timer = setTimeout(() => {
uni.navigateBack()
}, 100)
}
onBeforeMount(() => {
clearInterval(timer)
})
const query = reactive({
page: 1,
name: '',
totalElements: 0,
size: 10,
isVip: 1
})
const list = reactive([])
let hasAjax = ref(false)
/**
* 获取用户列表
*/
async function getUser() {
const res = await shopUserList(query)
hasAjax.value = true
list.length = res.records.length
for (let i in res.records) {
list[i] = {
...res.records[i],
checked: false
}
}
query.totalElements = res.totalRow
console.log(list);
}
/**
* 用户选择
* @param {Object} index
* @param {Object} item
*/
function chooseUser(index, item) {
if (index === undefined || item === undefined) {
nouser.value = true
@@ -100,33 +121,12 @@
emitChooser(item)
}
}
const query = reactive({
page: 1,
name: '',
totalElements: 0,
size: 10,
isVip: 1
})
const list = reactive([])
let hasAjax = ref(false)
async function getUser() {
const {
content,
totalElements
} = await Api.queryAllShopUser(query)
hasAjax.value = true
list.length = content.length
for (let i in content) {
list[i] = {
...content[i],
checked: false
}
}
query.totalElements = totalElements
console.log(list);
function emitChooser(data) {
uni.$emit('choose-user', data)
timer = setTimeout(() => {
uni.navigateBack()
}, 100)
}
function pageChange(e) {
query.page = e
getUser()