Files
houyi-uniapp/pages/admin/shop/index.vue
PC-202306242200\Administrator 85b89ccea7 first commit
2026-03-28 23:27:25 +08:00

128 lines
3.2 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="xkl-com-bg">
<view style="height: 20rpx;"></view>
<navigator url="/pages/admin/shop/create">
<u-button type="primary">添加</u-button>
</navigator>
<view style="height: 20rpx;"></view>
<u-search placeholder="请输入手机号" shape="square" v-model="search.mobile" @search="onsearch"></u-search>
<view style="height: 20rpx;"></view>
<view>
<navigator :url="`/pages/team/detail?team_shop_id=${item.id}`" v-for="(item,index) in shopItems"
:key="index"
style="background-color: #ffffff;color: #666666;padding: 20rpx;font-size: 28rpx; margin-bottom: 20rpx;border-radius: 12rpx;">
<view class="u-flex">
<view>
<view>用户名{{item.username}}</view>
<view style="height: 10rpx;"></view>
<view>手机号{{item.mobile}}</view>
<view style="height: 10rpx;"></view>
<view>余额{{item.money}}</view>
</view>
<view style="width: 100rpx;"></view>
<view>
<view>等级v{{item.vip}}</view>
<view style="height: 10rpx;"></view>
<view>充电桩{{item.device_num}}</view>
<view style="height: 10rpx;"></view>
<view>已安装{{item.install_num}}</view>
</view>
</view>
<view style="height: 20rpx;"></view>
<view>注册时间{{item.created_at}}</view>
<!-- <view class="u-flex u-flex-between">
<view>用户名{{item.username}}</view>
<view>手机号{{item.mobile}}</view>
</view>
<view style="height: 10rpx;"></view>
<view class="u-flex u-flex-between">
<view>等级v{{item.vip}}</view>
<view>余额{{item.money}}</view>
</view>
<view style="height: 10rpx;"></view>
<view class="u-flex u-flex-between">
<view>充电桩{{item.device_num}}</view>
<view>已安装{{item.install_num}}</view>
</view>
<view style="height: 10rpx;"></view>
<view>注册时间{{item.created_at}}</view> -->
</navigator>
</view>
<u-loadmore :status="loadStatus" />
<view style="height: 100rpx;"></view>
</view>
</template>
<script>
let self;
export default {
data() {
return {
shopItems: [],
status: [],
type: [],
loadStatus: 'loadmore',
search: {
page: 1,
status: 0,
mobile: ''
},
page: {
current: 0,
last_page: 1
}
}
},
onLoad() {
self = this;
},
onShow() {
self.shopItems = [];
self.getShopItems();
},
onPullDownRefresh() {
self.search.page = 1;
self.shopItems = [];
self.getShopItems();
uni.stopPullDownRefresh();
},
onReachBottom() {
if (!self.pageStatus()) {
return;
}
self.loadStatus = 'loading';
self.search.page = ++self.search.page;
self.getShopItems();
},
methods: {
onsearch() {
self.shopItems = [];
self.getShopItems();
},
pageStatus() {
self.loadStatus = 'loadmore';
if (self.search.page >= self.page.last_page) {
self.loadStatus = 'nomore';
return false;
}
return true;
},
getShopItems() {
self.$http.get('/shop/admin/shop/items', self.search).then(({
data,
success
}) => {
self.shopItems = self.shopItems.concat(data.data);
self.page.last_page = data.last_page;
self.pageStatus();
})
},
}
}
</script>
<style lang="scss">
</style>