master
gongfuxiang 2023-11-17 15:17:14 +08:00
parent c533b1c2d4
commit 2627e672e9
6 changed files with 318 additions and 7 deletions

View File

@ -5,10 +5,10 @@
data: {
//
//
request_url: 'https://d1.shopxo.vip/',
request_url: 'http://shopxo.com/',
// publicpublichttps://d1.shopxo.vip/public/
static_url: 'https://d1.shopxo.vip/',
static_url: 'http://shopxo.com/',
// default
system_type: 'default',

View File

@ -532,6 +532,13 @@
"enablePullDownRefresh": true,
"navigationBarTitleText": "等级介绍"
}
},
{
"path": "promotion-user/promotion-user",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "推广用户"
}
}
]
},

View File

@ -155,8 +155,8 @@ export default {
title: "加载中...",
});
//
var status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]["value"]; //
//
var status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]["value"];
uni.request({
url: app.globalData.get_request_url("index", "profit", "distribution"),
method: "POST",

View File

@ -0,0 +1,7 @@
/*
*
*/
.data-list .item .base .avatar {
width: 40rpx;
height: 40rpx !important;
}

View File

@ -0,0 +1,292 @@
<template>
<view :class="theme_view">
<!-- 导航 -->
<view class="nav-base bg-white scroll-view-horizontal padding-horizontal-main">
<scroll-view :scroll-x="true">
<block v-for="(item, index) in nav_type_list" :key="index">
<view :class="'item dis-inline-block margin-right-lg ' + (nav_type_index == index ? 'cr-main' : 'cr-grey')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
</block>
</scroll-view>
</view>
<!-- 数据列表 -->
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @scrolltolower="scroll_lower" lower-threshold="60">
<view v-if="data_list.length > 0" class="data-list padding-horizontal-main padding-top-main">
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
<view class="base oh br-b padding-bottom-main">
<image class="avatar dis-block fl circle" :src="item.avatar" mode="widthFix" @tap="avatar_event" :data-value="item.avatar"></image>
<text class="cr-base margin-left-sm">{{ item.user_name_view || "" }}</text>
<text class="cr-base fr">{{ item.add_time }}</text>
</view>
<view class="content margin-top">
<block v-for="(fv, fi) in content_list" :key="fi">
<view class="single-text margin-top-xs">
<text class="cr-grey margin-right-xl">{{ fv.name }}</text>
<text class="cr-base" :data-event="fv.event" :data-value="item[fv.field]" @tap="text_event">{{ item[fv.field] || fv.default }}</text>
<text v-if="(fv.unit || null) != null" class="cr-grey">{{ fv.unit }}</text>
</view>
</block>
</view>
<view class="item-operation tr br-t padding-top-main margin-top-main">
<button v-if="(item.email || null) != null" class="round bg-white br cr-base" type="default" size="mini" hover-class="none" @tap="text_event" data-event="copy" :data-value="item.email"></button>
<button v-if="(item.mobile || null) != null" class="round bg-white br cr-base" type="default" size="mini" hover-class="none" @tap="text_event" data-event="tel" :data-value="item.mobile"></button>
<button class="round bg-white br cr-base" type="default" size="mini" hover-class="none" @tap="user_order_event" :data-value="item.id">用户订单</button>
</view>
</view>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</scroll-view>
</view>
</template>
<script>
const app = getApp();
import componentNoData from "../../../../components/no-data/no-data";
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
data_list: [],
data_total: 0,
data_page_total: 0,
data_page: 1,
data_list_loding_status: 1,
data_bottom_line_status: false,
data_is_loading: 0,
params: null,
nav_type_list: [
{ name: "推广用户", value: 0 },
{ name: "已消费用户", value: 1 },
{ name: "未消费用户", value: 2 },
{ name: "新增客户", value: 3 },
{ name: "新增客户(有效)", value: 4 },
{ name: "新增客户(需复购)", value: 5 },
],
nav_type_index: 0,
content_list: [
{ name: "消费订单", field: "order_count", unit: "", default: 0 },
{ name: "消费金额", field: "order_total", unit: "", default: 0 },
{ name: "最后下单时间", field: "order_last_time", default: "" },
{ name: "下级订单", field: "find_order_count", unit: "", default: 0 },
{ name: "下级消费", field: "find_order_total", unit: "", default: 0 },
{ name: "下级最后下单时间", field: "find_order_last_time", default: "" },
{ name: "下级用户", field: "referrer_count", unit: "", default: 0 },
],
nav_search_buy_type_list: [
{ value: -1, name: "全部" },
{ value: 0, name: "未下单" },
{ value: 1, name: "已下单" },
],
nav_search_value: {
team_search_user_time_start: "",
team_search_user_time_end: "",
team_search_user_time_reverse: [],
team_search_order_time_start: "",
team_search_order_time_end: "",
team_search_order_time_reverse: [],
team_search_buy_type: [],
},
};
},
components: {
componentNoData,
componentBottomLine,
},
props: {},
onLoad(params) {
//
var nav_type_index = 0;
if (params.type != undefined) {
for (var i in this.nav_type_list) {
if (this.nav_type_list[i]["value"] == params.type) {
nav_type_index = i;
break;
}
}
}
this.setData({
params: params,
nav_type_index: nav_type_index,
});
this.init();
},
onShow() {
//
app.globalData.page_share_handle();
},
//
onPullDownRefresh() {
this.setData({
data_page: 1,
});
this.get_data_list(1);
},
methods: {
init() {
var user = app.globalData.get_user_info(this, "init");
if (user != false) {
//
if (app.globalData.user_is_need_login(user)) {
uni.redirectTo({
url: "/pages/login/login?event_callback=init",
});
return false;
} else {
//
this.get_data_list();
}
} else {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
//
get_data_list(is_mandatory) {
//
if ((is_mandatory || 0) == 0) {
if (this.data_bottom_line_status == true) {
uni.stopPullDownRefresh();
return false;
}
}
//
if (this.data_is_loading == 1) {
return false;
}
this.setData({
data_is_loading: 1,
data_list_loding_status: 1,
});
// loding
uni.showLoading({
title: "加载中...",
});
//
var type = (this.nav_type_list[this.nav_type_index] || null) == null ? 0 : this.nav_type_list[this.nav_type_index]["value"];
var data = {
page: this.data_page,
type: type,
};
//
uni.request({
url: app.globalData.get_request_url("index", "promotionuser", "distribution"),
method: "POST",
data: data,
dataType: "json",
success: (res) => {
uni.hideLoading();
uni.stopPullDownRefresh();
if (res.data.code == 0) {
if (res.data.data.data.length > 0) {
if (this.data_page <= 1) {
var temp_data_list = res.data.data.data;
} else {
var temp_data_list = this.data_list || [];
var temp_data = res.data.data.data;
for (var i in temp_data) {
temp_data_list.push(temp_data[i]);
}
}
this.setData({
data_list: temp_data_list,
data_total: res.data.data.total,
data_page_total: res.data.data.page_total,
data_list_loding_status: 3,
data_page: this.data_page + 1,
data_is_loading: 0,
});
//
this.setData({
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
});
} else {
this.setData({
data_list_loding_status: 0,
data_list: [],
data_bottom_line_status: false,
data_is_loading: 0,
});
}
} else {
this.setData({
data_list_loding_status: 0,
data_is_loading: 0,
});
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_is_loading: 0,
});
app.globalData.showToast("网络开小差了哦~");
},
});
},
//
scroll_lower(e) {
this.get_data_list();
},
//
avatar_event(e) {
var value = e.currentTarget.dataset.value || null;
if (value != null) {
uni.previewImage({
current: value,
urls: [value],
});
} else {
app.globalData.showToast("头像地址有误");
}
},
//
user_order_event(e) {
var value = e.currentTarget.dataset.value;
uni.navigateTo({
url: "/pages/plugins/distribution/order/order?uid=" + value,
});
},
//
nav_event(e) {
this.setData({
nav_type_index: e.currentTarget.dataset.index || 0,
data_page: 1,
});
this.get_data_list(1);
},
},
};
</script>
<style>
@import "./promotion-user.css";
</style>

View File

@ -67,7 +67,7 @@
<view v-if="stats_user_promotion_data_list.length > 0" class="margin-top-main oh tc flex-row jc-sa align-c">
<block v-for="(item, index) in stats_user_promotion_data_list" :key="index">
<view class="padding-main flex-1" :class="stats_user_promotion_data_list.length - 1 > index ? 'divider-r-f5' : ''">
<view class="single-text margin-top-sm">
<view class="single-text margin-top-sm" :data-value="'/pages/plugins/distribution/promotion-user/promotion-user?type='+item.to_value" @tap="url_event">
<text class="fw-b promotion-size">{{ item.value }}</text>
<text v-if="(item.unit || null) != null" class="cr-grey-9 text-size-xs"></text>
</view>
@ -85,7 +85,7 @@
<image :src="child.icon" mode="widthFix" class="count-img" />
<view class="tl flex-1 flex-width padding-left-main">
<view class="text-size-xs single-text">{{ child.name }}</view>
<view class="single-text margin-top-sm">
<view class="single-text margin-top-sm" :data-value="'/pages/plugins/distribution/promotion-user/promotion-user?type='+item.to_value" @tap="url_event">
<text v-if="(child.first || null) != null" class="text-size-xs">{{ child.first }}</text>
<text class="text-size-lg fw-b">{{ child.value }}</text>
<text v-if="(child.unit || null) != null" class="cr-grey-9 text-size-xs">{{ child.unit }}</text>
@ -465,6 +465,11 @@
onPageScroll(res) {
uni.$emit('onPageScroll', res);
},
// url
url_event(e) {
app.globalData.url_event(e);
}
},
};
</script>