/pages/commission/team

pull/34/head
落日晚风 2024-01-03 14:40:49 +08:00
parent dbeb6eea6b
commit 70b92c6e98
7 changed files with 46 additions and 27 deletions

View File

@ -19,7 +19,7 @@
// urlSchemes // urlSchemes
const args = plus.runtime.arguments; const args = plus.runtime.arguments;
if (args) { if (args) {
} }
// //
uni.getClipboardData({ uni.getClipboardData({

View File

@ -15,21 +15,20 @@
</view> </view>
<view style='padding: 0 30rpx;'> <view style='padding: 0 30rpx;'>
<view class='nav acea-row row-around l1'> <view class='nav acea-row row-around l1'>
<view :class="state.level === 1 ? 'item on' : 'item'" @click='setType(1)'> <view :class="state.level == 1 ? 'item on' : 'item'" @click='setType(1)'>
一级({{state.getSummary.firstBrokerageUserCount || 0 }})</view> 一级({{state.getSummary.firstBrokerageUserCount || 0 }})</view>
<view :class="state.level === 2 ? 'item on' : 'item'" @click='setType(2)'> <view :class="state.level == 2 ? 'item on' : 'item'" @click='setType(2)'>
二级({{state.getSummary.secondBrokerageUserCount || 0 }}) 二级({{state.getSummary.secondBrokerageUserCount || 0 }})
</view> </view>
</view> </view>
<view class='search acea-row row-between-wrapper' <view class='search acea-row row-between-wrapper'
style="display: flex;height: 100rpx;align-items: center;"> style="display: flex;height: 100rpx;align-items: center;">
<view class='input'> <view class='input'>
<!-- placeholder-class='placeholder' --> <input placeholder='点击搜索会员名称' v-model="state.nickname" confirm-type='search' name="search"
<input placeholder='点击搜索会员名称' v-model="state.nickname" confirm-type='search' name="search" /> @confirm="submitForm" />
<!-- @confirm="submitForm" -->
</view> </view>
<button class='iconfont icon-sousuo2'></button> <image src="/static/images/search.png" mode="" style='width: 60rpx;height: 64rpx;' @click="submitForm"></image>
<!-- @click="submitForm" -->
</view> </view>
<view class='list'> <view class='list'>
<view class="sortNav acea-row row-middle" style="display: flex;align-items: center;"> <view class="sortNav acea-row row-middle" style="display: flex;align-items: center;">
@ -67,29 +66,28 @@
<image src='/static/images/sort2.png'></image> <image src='/static/images/sort2.png'></image>
</view> </view>
</view> </view>
<!-- <block v-for="(item,index) in recordList" :key="index"> <block v-for="(item,index) in state.pagination.data" :key="index">
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper' style="display: flex;">
<view class="picTxt acea-row row-between-wrapper"> <view class="picTxt acea-row row-between-wrapper" style="display: flex;align-items: center;">
<view class='pictrue'> <view class='pictrue'>
<image :src='item.avatar'></image> <image :src='item.avatar'></image>
</view> </view>
<view class='text'> <view class='text'>
<view class='name line1'>{{item.nickname}}</view> <view class='name line1'>{{item.nickname}}</view>
<view>加入时间: {{ formatDate(item.brokerageTime) }}</view> <view>加入时间: {{ sheep.$helper.timeFormat(item.brokerageTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right" style='justify-content:center;flex-direction: column;display: flex;margin-left: auto;'>
<view><text class='num font-color'>{{ item.brokerageUserCount || 0}}</text> <view><text class='num font-color'>{{ item.brokerageUserCount || 0}}</text>
</view> </view>
<view><text class="num">{{ item.orderCount|| 0}}</text></view> <view><text class="num">{{ item.orderCount|| 0}}</text></view>
<view><text class="num">{{ fen2yuan(item.brokeragePrice || 0) }}</text></view> <view><text class="num">{{ item.brokeragePrice || 0 }}</text></view>
</view> </view>
</view> </view>
</block> </block>
<Loading :loaded="status" :loading="loadingList"></Loading> <block v-if="state.pagination.data.length == 0">
<block v-if="recordList.length === 0 && isShow"> <view style='text-align: center;'>暂无推广人数</view>
<emptyPage title="暂无推广人数~"></emptyPage> </block>
</block> -->
</view> </view>
</view> </view>
</view> </view>
@ -199,6 +197,7 @@
state.scrollTop = true; state.scrollTop = true;
} }
}); });
let sort=ref();
const state = reactive({ const state = reactive({
getSummary: {}, getSummary: {},
pagination: { pagination: {
@ -210,7 +209,9 @@
loadStatus: '', loadStatus: '',
// ui // ui
level: 1, level: 1,
nickname: ref('') nickname: ref(''),
sortKey:'',
isAsc:''
}); });
@ -221,6 +222,10 @@
return `下级团队${num}`; return `下级团队${num}`;
} }
function submitForm() {
state.pagination.data = []
getTeamList();
}
async function getTeamList(page = 1, list_rows = 8) { async function getTeamList(page = 1, list_rows = 8) {
state.loadStatus = 'loading'; state.loadStatus = 'loading';
// nickname: this.nickname, // nickname: this.nickname,
@ -229,10 +234,10 @@
let res = await sheep.$api.commission.team({ let res = await sheep.$api.commission.team({
pageSize: list_rows, pageSize: list_rows,
pageNo: page, pageNo: page,
level: '1', level: state.level,
'sortingField.order': 'desc', 'sortingField.order': 'desc',
'sortingField.field': 'userCount', 'sortingField.field': 'userCount',
nickname: '' nickname: state.nickname
}); });
console.log(res, '分销团队列表'); console.log(res, '分销团队列表');
if (res.code === 0) { if (res.code === 0) {
@ -249,6 +254,19 @@
} }
} }
function setType(e) {
state.pagination.data = []
state.level = e + '';
getTeamList( )
}
function setSort(sortKey, isAsc) {
state.pagination.data = []
sort = sortKey + isAsc.toUpperCase();
state.isAsc=isAsc;
state.sortKey=sortKey;
getTeamList();
}
onLoad(async () => { onLoad(async () => {
getTeamList(); getTeamList();
let res = await sheep.$api.commission.getSummary(); let res = await sheep.$api.commission.getSummary();

View File

@ -94,7 +94,8 @@ http.interceptors.request.use(
if (config.url.indexOf('/app-api/') !== -1) { if (config.url.indexOf('/app-api/') !== -1) {
config.header['Accept'] = '*/*' config.header['Accept'] = '*/*'
config.header['tenant-id'] = '1'; config.header['tenant-id'] = '1';
config.header['terminal'] = '20'; config.header['terminal'] = '20';
config.header['Authorization'] = 'Bearer test247';
} }
return config; return config;
}, },
@ -108,10 +109,10 @@ http.interceptors.request.use(
*/ */
http.interceptors.response.use( http.interceptors.response.use(
(response) => { (response) => {
// 约定:如果是 /auth/ 下的 URL 地址,并且返回了 accessToken 说明是登录相关的接口,则自动设置登陆令牌 // 约定:如果是 /auth/ 下的 URL 地址,并且返回了 accessToken 说明是登录相关的接口,则自动设置登陆令牌
if (response.config.url.indexOf('/member/auth/') >= 0 && response.data?.data?.accessToken) { if (response.config.url.indexOf('/member/auth/') >= 0 && response.data?.data?.accessToken) {
$store('user').setToken(response.data.data.accessToken); $store('user').setToken(response.data.data.accessToken);
} }
response.config.custom.showLoading && closeLoading(); response.config.custom.showLoading && closeLoading();
if (response.data.error !== 0 && response.data.code !== 0) { if (response.data.error !== 0 && response.data.code !== 0) {

BIN
static/images/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
static/images/sort1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/images/sort2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/images/sort3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB