用户积分修改,修改分销员筛选,修改超级会员订单列表检索

This commit is contained in:
2026-01-13 14:52:10 +08:00
parent 63896046a8
commit 0990e08201
11 changed files with 2416 additions and 2014 deletions

View File

@@ -0,0 +1,222 @@
<template>
<view>
<view class="box" @click.stop="openPopup">
<text class="u-font-28 color-999 u-p-r-16" v-if="!modelValue||list.length==0">请选择用户</text>
<text class="u-font-28 color-333 u-p-r-16 u-line-1" v-else :style="{
maxWidth: maxWidth+'rpx'
}">{{returnLabel()}}</text>
<view class="icon ">
<up-icon name="arrow-down" size="14" color="#999"></up-icon>
</view>
</view>
<up-popup :show="show" placement="bottom" round="18rpx" closeOnClickOverlay @close="close">
<view class="u-p-30">
<view class="font-bold color-333 u-font-32">选择用户</view>
<view class="u-m-t-24">
<up-search v-model="query.key" @clear="search" @custom="search" @search="search"></up-search>
</view>
<scroll-view scroll-with-animation :scroll-into-view="selId" class="scroll-view u-m-t-30"
scroll-y="true" style="max-height :60vh;" @scrolltolower="scrolltolower">
<view class="u-m-b-10 u-flex item" v-for="item in list" :key="item.id" @click="itemClick(item)"
:id="'item_'+item.id" :class="{active:selItem&&selItem.id==item.id}">
<view class="checkbox">
<up-icon name="checkbox-mark" color="#fff"></up-icon>
</view>
<view class="u-flex-1">{{item.nickName}}/{{item.phone}}</view>
</view>
<template v-if="search.key!==''">
<up-empty v-if="list.length==0" text="未搜到相关用户"></up-empty>
<up-loadmore v-else :status="isEnd?'nomore':'loading'"></up-loadmore>
</template>
<template v-else>
<up-empty v-if="list.length==0" text="暂无用户"></up-empty>
<up-loadmore v-else :status="isEnd?'nomore':'loading'"></up-loadmore>
</template>
</scroll-view>
<view class="u-flex gap-20 u-m-t-30">
<view class="u-flex-1">
<my-button type="default" @click="close">取消</my-button>
</view>
<view class="u-flex-1">
<my-button type="primary" @click="submit">确定</my-button>
</view>
</view>
</view>
</up-popup>
</view>
</template>
<script setup>
import {
computed,
onMounted,
reactive,
ref,
watch
} from 'vue';
import {
getShopUser
} from '@/http/api/market/index.js';
const customStyle = ref({
marginRight: '20px'
});
const show = ref(false);
let modelValue = defineModel('modelValue', {
default: '',
});
const props = defineProps({
maxWidth: {
default: 240
}
})
const selId = ref('')
function returnLabel() {
const findItem = list.value.find(v => v.id == modelValue.value)
if (findItem) {
return findItem.nickName + (findItem.phone ? ('/' + findItem.phone) : '')
}
return ''
}
const selItem = ref(null)
function itemClick(item) {
selItem.value = item
}
function returnShopName(id) {
const item = list.value.find((v) => v.id == id);
return item?.shopName || '';
}
function close() {
show.value = false;
}
const emits = defineEmits(['change'])
function submit() {
if (!selItem.value) {
return uni.showToast({
title: '请选择用户'
})
}
if (modelValue.value != selItem.value.id) {
modelValue.value=selItem.value.id
emits('change')
}else{
modelValue.value=selItem.value.id
}
show.value = false;
}
const list = ref([]);
function openPopup() {
selId.value = 'item_' + modelValue.value
init()
show.value = true;
}
const isEnd = ref(false)
const query = reactive({
page: 1,
size: 10,
key: ''
})
function search() {
isEnd.value = false
query.page = 1
selItem.value = null
init()
}
async function init() {
const res = await getShopUser(query);
if (res) {
isEnd.value = query.page >= res.totalPage * 1
if (query.page == 1) {
list.value = res.records
} else {
list.value.push(...res.records)
}
}
}
function scrolltolower() {
if (!isEnd.value) {
query.page++
init()
}
}
</script>
<style lang="scss">
.box {
border-radius: 8upx;
display: flex;
flex-direction: row;
align-items: top;
flex-wrap: wrap;
padding: 10rpx 24rpx;
border: 2rpx solid #e5e5e5;
position: relative;
.icon {
position: absolute;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
}
}
.shop-item {
padding: 4rpx 8rpx 4rpx 16rpx;
border-radius: 4rpx;
border: 2rpx solid #f0f0f0;
background-color: #f5f5f5;
margin-bottom: 16rpx;
margin-left: 16rpx;
}
.scroll-view {
.item {
border: 1px solid #eee;
padding: 20rpx;
border-radius: 12rpx;
&.active {
border-color: $my-main-color;
}
}
}
.checkbox {
margin-right: 10rpx;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6rpx;
border: 1px solid #999;
}
.item {
&.active {
.checkbox {
background-color: $my-main-color;
border-color: $my-main-color;
}
}
}
</style>

View File

@@ -188,4 +188,13 @@ export function shopUserFlow(data) {
method: 'get',
data
});
}
}
export function getShopUser(data) {
return request({
url: `account/admin/shopUser`,
method: 'get',
data
});
}

17
http/api/market/points.js Normal file
View File

@@ -0,0 +1,17 @@
import http from '@/http/http.js'
const request = http.request
const MARKET_URL = 'market'
const ORDER_URL = 'order'
/**
* 积分:配置:新增/更新
* @param {Object} data
*/
export function pointsConfig(data) {
return request({
url: MARKET_URL+`/admin/points/config`,
method: "GET",
data
})
}

View File

@@ -14,7 +14,7 @@ import storageManage from '@/commons/utils/storageManage.js'
import infoBox from "@/commons/utils/infoBox.js"
import go from '@/commons/utils/go.js';
import { reject } from 'lodash';
let baseUrl = appConfig.returnBaseUrl({apiType:'php'});
let baseUrl = appConfig.returnBaseUrl({apiType:'java'});
const loadingShowTime = 200
function getHeader(){

View File

@@ -0,0 +1,219 @@
<template>
<view>
<view class="box" @click.stop="openPopup">
<text class="u-font-28 color-999 u-p-r-16" v-if="!modelValue||list.length==0">请选择用户</text>
<text class="u-font-28 color-333 u-p-r-16 u-line-1" v-else :style="{
maxWidth: maxWidth+'rpx'
}">{{returnLabel()}}</text>
<view class="icon ">
<up-icon name="arrow-down" size="14" color="#999"></up-icon>
</view>
</view>
<up-popup :show="show" placement="bottom" round="18rpx" closeOnClickOverlay @close="close">
<view class="u-p-30">
<view class="font-bold color-333 u-font-32">选择用户</view>
<view class="u-m-t-24">
<up-search v-model="query.key" @clear="search" @custom="search" @search="search"></up-search>
</view>
<scroll-view scroll-with-animation :scroll-into-view="selId" class="scroll-view u-m-t-30"
scroll-y="true" style="max-height :60vh;" @scrolltolower="scrolltolower">
<view class="u-m-b-10 u-flex item" v-for="item in list" :key="item.id" @click="itemClick(item)"
:id="'item_'+item.id" :class="{active:selItem&&selItem.id==item.id}">
<view class="checkbox">
<up-icon name="checkbox-mark" color="#fff"></up-icon>
</view>
<view class="u-flex-1">{{item.nickName}}/{{item.phone}}</view>
</view>
<template v-if="search.key!==''">
<up-empty v-if="list.length==0" text="未搜到相关用户"></up-empty>
<up-loadmore v-else :status="isEnd?'nomore':'loading'"></up-loadmore>
</template>
<template v-else>
<up-empty v-if="list.length==0" text="暂无用户"></up-empty>
<up-loadmore v-else :status="isEnd?'nomore':'loading'"></up-loadmore>
</template>
</scroll-view>
<view class="u-flex gap-20 u-m-t-30">
<view class="u-flex-1">
<my-button type="default" @click="close">取消</my-button>
</view>
<view class="u-flex-1">
<my-button type="primary" @click="submit">确定</my-button>
</view>
</view>
</view>
</up-popup>
</view>
</template>
<script setup>
import {
computed,
onMounted,
reactive,
ref,
watch
} from 'vue';
import {
getShopUser
} from '@/http/api/market/index.js';
const customStyle = ref({
marginRight: '20px'
});
const show = ref(false);
let modelValue = defineModel('modelValue', {
default: '',
});
const props=defineProps({
maxWidth:{
default:240
}
})
const selId = ref('')
function returnLabel() {
const findItem = list.value.find(v => v.id == modelValue.value)
if(findItem){
return findItem.nickName+(findItem.phone?('/'+findItem.phone):'')
}
return ''
}
const selItem=ref(null)
function itemClick(item) {
selItem.value=item
}
function returnShopName(id) {
const item = list.value.find((v) => v.id == id);
return item?.shopName || '';
}
function close() {
show.value = false;
}
const emits=defineEmits(['change'])
function submit() {
if(!selItem.value){
return uni.showToast({
title:'请选择用户'
})
}
modelValue.value = selItem.value.id
if(modelValue.value!=selItem.value.id){
emits('change')
}
show.value = false;
}
const list = ref([]);
function openPopup() {
selId.value = 'item_' + modelValue.value
init()
show.value = true;
}
const isEnd = ref(false)
const query = reactive({
page: 1,
size: 10,
key: ''
})
function search() {
isEnd.value = false
query.page = 1
selItem.value=null
init()
}
async function init() {
const res = await getShopUser(query);
if (res) {
isEnd.value = query.page >= res.totalPage * 1
if (query.page == 1) {
list.value = res.records
} else {
list.value.push(...res.records)
}
}
}
function scrolltolower() {
if (!isEnd.value) {
query.page++
init()
}
}
</script>
<style lang="scss">
.box {
border-radius: 8upx;
display: flex;
flex-direction: row;
align-items: top;
flex-wrap: wrap;
padding: 10rpx 24rpx;
border: 2rpx solid #e5e5e5;
position: relative;
.icon {
position: absolute;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
}
}
.shop-item {
padding: 4rpx 8rpx 4rpx 16rpx;
border-radius: 4rpx;
border: 2rpx solid #f0f0f0;
background-color: #f5f5f5;
margin-bottom: 16rpx;
margin-left: 16rpx;
}
.scroll-view {
.item {
border: 1px solid #eee;
padding: 20rpx;
border-radius: 12rpx;
&.active {
border-color: $my-main-color;
}
}
}
.checkbox {
margin-right: 10rpx;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6rpx;
border: 1px solid #999;
}
.item {
&.active {
.checkbox {
background-color: $my-main-color;
border-color: $my-main-color;
}
}
}
</style>

View File

@@ -1,34 +1,25 @@
<template>
<view class="min-page u-font-28">
<up-sticky>
<view class="bg-fff top">
<view class="bg-fff container u-flex u-m-b-48">
<image
style="width: 60rpx; height: 60rpx"
src="/pageMarket/static/images/distribution.png"
></image>
<view class="u-flex-1 u-flex u-p-l-24">
<view class="u-font-28 u-flex-1 u-p-r-4">
<view class="color-333 font-bold">分销</view>
<view class="color-666 u-m-t-4 u-font-24"
>用户成为业务员可促进消费
</view>
</view>
<up-switch
v-model="distributionStore.config.isEnable"
size="18"
:active-value="1"
:inactive-value="0"
></up-switch>
</view>
</view>
<my-tabs v-model="active" :list="tabs" textKey="label"></my-tabs>
<view
v-if="active == 1 || active == 2"
class="u-flex u-row-between u-m-t-32"
style="gap: 58rpx"
>
<view class="u-flex-1 filter-box" style="border-radius: 100rpx">
<view class="min-page u-font-28">
<up-sticky>
<view class="bg-fff top">
<view class="bg-fff container u-flex u-m-b-48">
<image style="width: 60rpx; height: 60rpx" src="/pageMarket/static/images/distribution.png"></image>
<view class="u-flex-1 u-flex u-p-l-24">
<view class="u-font-28 u-flex-1 u-p-r-4">
<view class="color-333 font-bold">分销</view>
<view class="color-666 u-m-t-4 u-font-24">用户成为业务员可促进消费
</view>
</view>
<up-switch v-model="distributionStore.config.isEnable" size="18" :active-value="1"
:inactive-value="0"></up-switch>
</view>
</view>
<my-tabs v-model="active" :list="tabs" textKey="label"></my-tabs>
<view v-if="active == 1 || active == 2" class="u-flex u-row-between u-m-t-32" style="gap: 58rpx">
<view class="u-flex-1">
<fenXiaoUserSelect v-model="userId" @change="getList()" />
</view>
<!-- <view class="u-flex-1 filter-box" style="border-radius: 100rpx">
<up-icon name="search" size="18"></up-icon>
<input
class="u-m-l-10 u-font-28"
@@ -39,476 +30,439 @@
@blur="keyWordBlur"
/>
<up-icon v-if="keyWord" name="close" size="14" @click="clearKeyWord"></up-icon>
</view>
<view
class="u-flex-1 u-font-28 filter-box u-flex u-row-between"
@click="showTimeArea = true"
>
<template
v-if="userComponentQuery.startTime && userComponentQuery.endTime"
>
<text class="u-font-20">
{{ userComponentQuery.startTime }} -
{{ userComponentQuery.endTime }}
</text>
<view @click.stop="clearTime">
<up-icon name="close" size="14"></up-icon>
</view>
</template>
<template v-else>
<text class="color-999">请选择日期范围</text>
<up-icon name="arrow-right" size="12"></up-icon>
</template>
</view>
</view>
<view
v-if="active == 3"
class="u-flex u-row-between u-m-t-32"
style="gap: 30rpx"
>
<view
class="u-font-28 filter-box u-flex u-row-between"
@click="showActions = true"
>
<template v-if="selActions && selActions.value">
<text class="u-font-28 u-m-r-10">{{ selActions.name }} </text>
</template>
<template v-else>
<text class="color-999 u-m-r-10">全部</text>
</template>
<up-icon name="arrow-down" size="12"></up-icon>
</view>
<view class="u-flex-1 filter-box" style="border-radius: 100rpx">
<up-icon name="search" size="18"></up-icon>
<input
class="u-m-l-10 u-font-28"
type="text"
placeholder-class="color-999 u-font-28"
placeholder="分销员昵称/手机号"
v-model="keyWord"
@blur="keyWordBlur"
/>
</view>
<view
class="u-flex-1 u-font-28 filter-box u-flex u-row-between"
@click="showTimeArea = true"
>
<template
v-if="userComponentQuery.startTime && userComponentQuery.endTime"
>
<text class="u-font-20">
{{ userComponentQuery.startTime }} -
{{ userComponentQuery.endTime }}
</text>
<view @click.stop="clearTime">
<up-icon name="close" size="14"></up-icon>
</view>
</template>
<template v-else>
<text class="color-999">请选择日期</text>
<up-icon name="arrow-right" size="12"></up-icon>
</template>
</view>
</view>
<view v-if="active == 2" class="u-flex u-p-l-32 u-p-r-32 u-m-t-32">
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{
</view> -->
<view class="u-flex-1 u-font-28 filter-box u-flex u-row-between" @click="showTimeArea = true">
<template v-if="userComponentQuery.startTime && userComponentQuery.endTime">
<text class="u-font-20">
{{ userComponentQuery.startTime }} -
{{ userComponentQuery.endTime }}
</text>
<view @click.stop="clearTime">
<up-icon name="close" size="14"></up-icon>
</view>
</template>
<template v-else>
<text class="color-999">请选择日期范围</text>
<up-icon name="arrow-right" size="12"></up-icon>
</template>
</view>
</view>
<view v-if="active == 3" class="u-flex u-row-between u-m-t-32" style="gap: 30rpx">
<view class="u-font-28 filter-box u-flex u-row-between" @click="showActions = true">
<template v-if="selActions && selActions.value">
<text class="u-font-28 u-m-r-10">{{ selActions.name }} </text>
</template>
<template v-else>
<text class="color-999 u-m-r-10">全部</text>
</template>
<up-icon name="arrow-down" size="12"></up-icon>
</view>
<view class="u-flex-1">
<fenXiaoUserSelect v-model="userId" :maxWidth="200" @change="getList()" />
</view>
<!-- <view class="u-flex-1 filter-box" style="border-radius: 100rpx">
<up-icon name="search" size="18"></up-icon>
<input class="u-m-l-10 u-font-28" type="text" placeholder-class="color-999 u-font-28"
placeholder="分销员昵称/手机号" v-model="keyWord" @blur="keyWordBlur" />
</view> -->
<view class="u-flex-1 u-font-28 filter-box u-flex u-row-between" @click="showTimeArea = true">
<template v-if="userComponentQuery.startTime && userComponentQuery.endTime">
<text class="u-font-20">
{{ userComponentQuery.startTime }} -
{{ userComponentQuery.endTime }}
</text>
<view @click.stop="clearTime">
<up-icon name="close" size="14"></up-icon>
</view>
</template>
<template v-else>
<text class="color-999">请选择日期</text>
<up-icon name="arrow-right" size="12"></up-icon>
</template>
</view>
</view>
<view v-if="active == 2" class="u-flex u-p-l-32 u-p-r-32 u-m-t-32">
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{
listRes.totalCount
}}</view>
<view class="u-font-24 color-666 u-m-t-16">支付开通人数</view>
</view>
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{
<view class="u-font-24 color-666 u-m-t-16">支付开通人数</view>
</view>
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{
listRes.totalAmount
}}</view>
<view class="u-font-24 color-666 u-m-t-16">已支付金额</view>
</view>
</view>
<view v-if="active == 3" class="u-flex u-m-t-32">
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{
<view class="u-font-24 color-666 u-m-t-16">已支付金额</view>
</view>
</view>
<view v-if="active == 3" class="u-flex u-m-t-32">
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{
listRes.successAmount
}}</view>
<view class="u-font-24 color-666 u-m-t-16">已入账金额</view>
</view>
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{
<view class="u-font-24 color-666 u-m-t-16">已入账金额</view>
</view>
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{
listRes.pendingAmount || 0
}}</view>
<view class="u-font-24 color-666 u-m-t-16">待入账金额</view>
</view>
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{
<view class="u-font-24 color-666 u-m-t-16">待入账金额</view>
</view>
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{
listRes.balanceAmount
}}</view>
<view class="u-font-24 color-666 u-m-t-16">
<text>运营余额</text>
<text class="color-main" @click="go.to('PAGES_PAY')"
>充值{{ ">" }}</text
>
</view>
</view>
</view>
</view>
</up-sticky>
<configVue v-if="active == 0"></configVue>
<fenxiaoUserListVue
v-if="active == 1"
:list="list"
:isEnd="isEnd"
@refresh="refresh"
></fenxiaoUserListVue>
<view class="u-font-24 color-666 u-m-t-16">
<text>运营余额</text>
<text class="color-main" @click="go.to('PAGES_PAY')">充值{{ ">" }}</text>
</view>
</view>
</view>
</view>
</up-sticky>
<configVue v-if="active == 0"></configVue>
<fenxiaoUserListVue v-if="active == 1" :list="list" :isEnd="isEnd" @refresh="refresh"></fenxiaoUserListVue>
<openListVue
v-if="active == 2"
:list="list"
:isEnd="isEnd"
@refresh="refresh"
></openListVue>
<fenxiaoMingxiVue
v-if="active == 3"
:list="list"
:isEnd="isEnd"
@refresh="refresh"
></fenxiaoMingxiVue>
<!-- 选择门店 -->
<shopSelActionSheetVue
@choose="chooseShop"
v-model="showShopSelActionSheet"
title="选择门店"
>
</shopSelActionSheetVue>
<openListVue v-if="active == 2" :list="list" :isEnd="isEnd" @refresh="refresh"></openListVue>
<fenxiaoMingxiVue v-if="active == 3" :list="list" :isEnd="isEnd" @refresh="refresh"></fenxiaoMingxiVue>
<!-- 选择门店 -->
<shopSelActionSheetVue @choose="chooseShop" v-model="showShopSelActionSheet" title="选择门店">
</shopSelActionSheetVue>
<dateAreaSel
:show="showTimeArea"
:minYear="2022"
@close="showTimeArea = false"
@confirm="confirmTimeArea"
></dateAreaSel>
<dateAreaSel :show="showTimeArea" :minYear="2022" @close="showTimeArea = false" @confirm="confirmTimeArea">
</dateAreaSel>
<!-- 分销明细状态 -->
<up-action-sheet
:show="showActions"
:actions="actions"
@select="handleSelect"
@close="showActions = false"
cancel-text="取消"
></up-action-sheet>
</view>
<!-- 分销明细状态 -->
<up-action-sheet :show="showActions" :actions="actions" @select="handleSelect" @close="showActions = false"
cancel-text="取消"></up-action-sheet>
</view>
</template>
<script setup>
import {
onLoad,
onReady,
onShow,
onPageScroll,
onReachBottom,
onBackPress,
} from "@dcloudio/uni-app";
import go from "@/commons/utils/go.js";
import { ref, onMounted, watch, provide } from "vue";
import * as consumeCashbackApi from "@/http/api/market/consumeCashback.js";
import * as distributionApi from "@/http/api/market/distribution.js";
import configVue from "./components/config.vue";
import shopSelActionSheetVue from "@/pageMarket/components/shop-sel-action-sheet.vue";
import dateAreaSel from "@/components/date-range-picker/date-range-picker.vue";
import fenxiaoUserListVue from "./components/fenxiao-user-list.vue";
import openListVue from "./components/open-list.vue";
import fenxiaoMingxiVue from "./components/fenxiao-mingxi.vue";
import {
onLoad,
onReady,
onShow,
onPageScroll,
onReachBottom,
onBackPress,
} from "@dcloudio/uni-app";
import go from "@/commons/utils/go.js";
import {
ref,
onMounted,
watch,
provide
} from "vue";
import * as consumeCashbackApi from "@/http/api/market/consumeCashback.js";
import * as distributionApi from "@/http/api/market/distribution.js";
import fenXiaoUserSelect from './components/fenxiao-user-select.vue'
import configVue from "./components/config.vue";
import shopSelActionSheetVue from "@/pageMarket/components/shop-sel-action-sheet.vue";
import dateAreaSel from "@/components/date-range-picker/date-range-picker.vue";
import fenxiaoUserListVue from "./components/fenxiao-user-list.vue";
import openListVue from "./components/open-list.vue";
import fenxiaoMingxiVue from "./components/fenxiao-mingxi.vue";
import { useDistributionStore } from "@/store/market.js";
import { reactive } from "vue";
import {
useDistributionStore
} from "@/store/market.js";
import {
reactive
} from "vue";
const actions = [
{
name: "全部",
value: "",
},
{
name: "已入账",
value: "success",
},
{
name: "待入账",
value: "pending",
},
{
name: "已退款",
value: "refund",
},
];
function clearKeyWord() {
keyWord.value = "";
userComponentQuery.user = "";
}
function clearTime() {
userComponentQuery.startTime = "";
userComponentQuery.endTime = "";
}
const selActions = ref("");
const showActions = ref(false);
function handleSelect(e) {
selActions.value = e;
}
const actions = [{
name: "全部",
value: "",
},
{
name: "已入账",
value: "success",
},
{
name: "待入账",
value: "pending",
},
{
name: "已退款",
value: "refund",
},
];
const distributionStore = useDistributionStore();
distributionStore.getConfig();
provide("distributionStore", distributionStore);
provide("distributionApi", distributionApi);
const showTimeArea = ref(false);
function confirmTimeArea(e) {
console.log(e);
userComponentQuery.startTime = e[0];
userComponentQuery.endTime = e[1];
}
const tabs = [
{
label: "基础设置",
value: "basic",
},
{
label: "分销员",
value: "user",
},
{
label: "开通记录",
value: "recoders",
},
{
label: "分销明细",
value: "details",
},
];
const keyWord = ref("");
function keyWordBlur() {
userComponentQuery.user = keyWord.value;
}
const userComponentQuery = reactive({
user: "",
startTime: "",
endTime: "",
});
const userId = ref('')
const form = ref({
isEnable: 0,
});
function clearKeyWord() {
keyWord.value = "";
userComponentQuery.user = "";
}
const list = ref([]);
const pageNum = ref(1);
const isEnd = ref(false);
const selShop = ref({
shopId: "",
shopName: "",
});
const searchText = ref("");
function clearTime() {
userComponentQuery.startTime = "";
userComponentQuery.endTime = "";
}
const selActions = ref("");
const showActions = ref(false);
function search() {
pageNum.value = 1;
getList();
}
function handleSelect(e) {
selActions.value = e;
}
function chooseShop(e) {
selShop.value = e;
}
const distributionStore = useDistributionStore();
distributionStore.getConfig();
provide("distributionStore", distributionStore);
provide("distributionApi", distributionApi);
const showTimeArea = ref(false);
watch(
() => selShop.value.shopId,
(newval) => {
pageNum.value = 1;
getList();
}
);
function confirmTimeArea(e) {
console.log(e);
userComponentQuery.startTime = e[0];
userComponentQuery.endTime = e[1];
}
const tabs = [{
label: "基础设置",
value: "basic",
},
{
label: "分销员",
value: "user",
},
{
label: "开通记录",
value: "recoders",
},
{
label: "分销明细",
value: "details",
},
];
watch(
() => userComponentQuery,
(newval) => {
isEnd.value = false;
pageNum.value = 1;
const keyWord = ref("");
getList();
},
{
deep: true,
}
);
function keyWordBlur() {
userComponentQuery.user = keyWord.value;
}
const userComponentQuery = reactive({
user: "",
startTime: "",
endTime: "",
});
function refresh() {
isEnd.value = false;
pageNum.value = 1;
getList();
}
const form = ref({
isEnable: 0,
});
const listRes = ref({});
async function getList() {
let res = null;
if (active.value == 1) {
//分销员列表
res = await distributionApi.distributionUser({
page: pageNum.value,
size: 10,
user: userComponentQuery.user,
startTime: userComponentQuery.startTime
? userComponentQuery.startTime + " 00:00:00"
: "",
endTime: userComponentQuery.endTime
? userComponentQuery.endTime + " 23:59:59"
: "",
});
}
if (active.value == 2) {
//开通记录
res = await distributionApi.openFlow({
page: pageNum.value,
size: 10,
key: userComponentQuery.user,
startTime: userComponentQuery.startTime
? userComponentQuery.startTime + " 00:00:00"
: "",
endTime: userComponentQuery.endTime
? userComponentQuery.endTime + " 23:59:59"
: "",
});
}
if (active.value == 3) {
//分销明细
res = await distributionApi.distributionFlow({
page: pageNum.value,
size: 10,
key: userComponentQuery.user,
status: selActions.value?.value || "",
startTime: userComponentQuery.startTime
? userComponentQuery.startTime + " 00:00:00"
: "",
endTime: userComponentQuery.endTime
? userComponentQuery.endTime + " 23:59:59"
: "",
});
}
if (res) {
listRes.value = res;
if (pageNum.value == 1) {
list.value = res.records || [];
} else {
list.value = [...list.value, ...(res.records || [])];
}
isEnd.value = pageNum.value >= res.totalPage * 1 ? true : false;
console.log(isEnd.value);
}
}
const list = ref([]);
const pageNum = ref(1);
const isEnd = ref(false);
const selShop = ref({
shopId: "",
shopName: "",
});
const searchText = ref("");
// 显示选择门店弹窗
const showShopSelActionSheet = ref(false);
function search() {
pageNum.value = 1;
getList();
}
function showShopSelActionSheetFun() {
showShopSelActionSheet.value = true;
}
const active = ref(0);
watch(
() => active.value,
(newval) => {
userComponentQuery.startTime = "";
userComponentQuery.endTime = "";
keyWord.value = "";
console.log(newval);
pageNum.value = 1;
getList();
}
);
watch(
() => active.value,
(newval) => {
function chooseShop(e) {
selShop.value = e;
}
refresh();
}
);
watch(
() => selActions.value,
() => {
refresh();
}
);
onReachBottom(() => {
if (!isEnd.value) {
pageNum.value++;
getList();
}
});
watch(
() => distributionStore.config.isEnable,
() => {
distributionStore.editConfig();
}
);
onShow(() => {
pageNum.value = 1;
getList();
});
watch(
() => selShop.value.shopId,
(newval) => {
pageNum.value = 1;
getList();
}
);
watch(
() => userComponentQuery,
(newval) => {
isEnd.value = false;
pageNum.value = 1;
getList();
}, {
deep: true,
}
);
function refresh() {
isEnd.value = false;
pageNum.value = 1;
getList();
}
const listRes = ref({});
async function getList() {
let res = null;
if (active.value == 1) {
//分销员列表
res = await distributionApi.distributionUser({
page: pageNum.value,
size: 10,
user: userComponentQuery.user,
id:userId.value,
startTime: userComponentQuery.startTime ?
userComponentQuery.startTime + " 00:00:00" : "",
endTime: userComponentQuery.endTime ?
userComponentQuery.endTime + " 23:59:59" : "",
});
}
if (active.value == 2) {
//开通记录
res = await distributionApi.openFlow({
page: pageNum.value,
size: 10,
id:userId.value,
key: userComponentQuery.user,
startTime: userComponentQuery.startTime ?
userComponentQuery.startTime + " 00:00:00" : "",
endTime: userComponentQuery.endTime ?
userComponentQuery.endTime + " 23:59:59" : "",
});
}
if (active.value == 3) {
//分销明细
res = await distributionApi.distributionFlow({
page: pageNum.value,
size: 10,
id:userId.value,
key: userComponentQuery.user,
status: selActions.value?.value || "",
startTime: userComponentQuery.startTime ?
userComponentQuery.startTime + " 00:00:00" : "",
endTime: userComponentQuery.endTime ?
userComponentQuery.endTime + " 23:59:59" : "",
});
}
if (res) {
listRes.value = res;
if (pageNum.value == 1) {
list.value = res.records || [];
} else {
list.value = [...list.value, ...(res.records || [])];
}
isEnd.value = pageNum.value >= res.totalPage * 1 ? true : false;
console.log(isEnd.value);
}
}
// 显示选择门店弹窗
const showShopSelActionSheet = ref(false);
function showShopSelActionSheetFun() {
showShopSelActionSheet.value = true;
}
const active = ref(0);
watch(
() => active.value,
(newval) => {
userComponentQuery.startTime = "";
userComponentQuery.endTime = "";
keyWord.value = "";
userId.value="";
console.log(newval);
pageNum.value = 1;
getList();
}
);
watch(
() => active.value,
(newval) => {
refresh();
}
);
watch(
() => selActions.value,
() => {
refresh();
}
);
onReachBottom(() => {
if (!isEnd.value) {
pageNum.value++;
getList();
}
});
watch(
() => distributionStore.config.isEnable,
() => {
distributionStore.editConfig();
}
);
onShow(() => {
pageNum.value = 1;
getList();
});
</script>
<style lang="scss" scoped>
.min-page {
background: #f7f7f7;
}
.min-page {
background: #f7f7f7;
}
.box {
}
.box {}
.top {
padding: 32rpx 24rpx;
}
.top {
padding: 32rpx 24rpx;
}
.list {
padding: 0 30rpx;
.list {
padding: 0 30rpx;
.item {
padding: 32rpx 24rpx;
border-radius: 14rpx;
background-color: #fff;
overflow: hidden;
}
}
.item {
padding: 32rpx 24rpx;
border-radius: 14rpx;
background-color: #fff;
overflow: hidden;
}
}
.tag {
border-radius: 12rpx;
padding: 8rpx 22rpx;
font-size: 28rpx;
.tag {
border-radius: 12rpx;
padding: 8rpx 22rpx;
font-size: 28rpx;
&.success {
background-color: #edfff0;
color: #5bbc6d;
}
&.success {
background-color: #edfff0;
color: #5bbc6d;
}
&.end {
background-color: #f7f7f7;
color: #999;
}
}
&.end {
background-color: #f7f7f7;
color: #999;
}
}
.my-btn {
font-size: 28rpx;
line-height: 36rpx;
padding: 8rpx 32rpx;
border-radius: 12rpx;
margin: 0;
}
.my-btn {
font-size: 28rpx;
line-height: 36rpx;
padding: 8rpx 32rpx;
border-radius: 12rpx;
margin: 0;
}
.edit-btn {
background: #e6f0ff;
color: $my-main-color;
}
.edit-btn {
background: #e6f0ff;
color: $my-main-color;
}
.delete-btn {
background: #ffe7e6;
color: #ff1c1c;
}
.filter-box {
display: flex;
padding: 8rpx 24rpx;
align-items: center;
border-radius: 8rpx;
border: 2rpx solid #d9d9d9;
background: #f7f7f7;
min-height: 62rpx;
box-sizing: border-box;
}
</style>
.delete-btn {
background: #ffe7e6;
color: #ff1c1c;
}
.filter-box {
display: flex;
padding: 8rpx 24rpx;
align-items: center;
border-radius: 8rpx;
border: 2rpx solid #d9d9d9;
background: #f7f7f7;
min-height: 62rpx;
box-sizing: border-box;
}
</style>

View File

@@ -14,10 +14,13 @@
</view>
<my-tabs v-model="active" :list="tabs" textKey="label"></my-tabs>
<view v-if="active == 2" class="u-flex u-row-between u-m-t-32" style="gap: 58rpx">
<view class="u-flex-1 filter-box" style="border-radius: 100rpx">
<!-- <view class="u-flex-1 filter-box" style="border-radius: 100rpx">
<up-icon name="search" size="18"></up-icon>
<input class="u-m-l-10 u-font-28" type="text" placeholder-class="color-999 u-font-28" placeholder="搜索关键词" v-model="keyWord" @blur="keyWordBlur" />
<up-icon v-if="keyWord" name="close" size="14" @click="clearKeyWord"></up-icon>
</view> -->
<view class="u-flex-1">
<my-user-select v-model="userId" @change="search()" ></my-user-select>
</view>
<view class="u-flex-1 u-font-28 filter-box u-flex u-row-between" @click="showTimeArea = true">
<template v-if="userComponentQuery.startTime && userComponentQuery.endTime">
@@ -215,6 +218,7 @@ function refresh() {
}
const listRes = ref({});
const userId=ref('')
async function getList() {
let res = null;
if (active.value == 1) {
@@ -232,7 +236,8 @@ async function getList() {
res = await memberApi.orderList({
page: pageNum.value,
size: 10,
key: userComponentQuery.user,
// key: userComponentQuery.user,
key: userId.value,
startTime: userComponentQuery.startTime ? userComponentQuery.startTime + ' 00:00:00' : '',
endTime: userComponentQuery.endTime ? userComponentQuery.endTime + ' 23:59:59' : ''
});
@@ -264,6 +269,7 @@ watch(
userComponentQuery.startTime = '';
userComponentQuery.endTime = '';
keyWord.value = '';
userId.value=''
refresh();
}
);

View File

@@ -37,7 +37,7 @@
</view>
<view class="u-m-l-30 u-flex">
<text class="">积分</text>
<text class="color-main">{{item.accountPoints}}</text>
<text class="color-main">{{item.pointBalance||0}}</text>
</view>
</view>
</view>
@@ -113,7 +113,7 @@
headImg: '',
telephone: '',
amount: '0.00',
accountPoints: '0.00'
pointBalance: '0.00'
})
} else {
list[index].checked = true

View File

@@ -32,7 +32,7 @@
<view class="u-font-24 u-m-l-30 u-text-center">
<text>积分</text>
<text class="color-main">{{
pageData.user.accountPoints
pageData.user.pointBalance||0
}}</text>
</view>
</view>
@@ -88,7 +88,7 @@
<view class="u-flex">
<view>积分</view>
<view class="color-333 u-m-l-10">{{
pageData.user.accountPoints
pageData.user.pointBalance||0
}}</view>
</view>
<view class="u-flex">
@@ -935,14 +935,15 @@ function watchChooseuser() {
if (pageData.user.id == data.id) {
return;
}
if (data.id) {
const res = await shopUserDetail({
userId: data.userId,
});
pageData.user = res;
} else {
pageData.user = data;
}
pageData.user = data;
// if (data.id) {
// const res = await shopUserDetail({
// userId: data.userId,
// });
// pageData.user = res;
// } else {
// pageData.user = data;
// }
// 更新购物车和历史订单数据
uodateCartAndHistory();
});

View File

@@ -2,20 +2,18 @@
<my-model ref="model" :title="title" iconColor="#000" @close="resetForm">
<template #desc>
<view class="u-text-left u-p-30 color-666 u-font-28">
<view class="u-m-t-32 u-flex ">
<view class="" v-if="accountPoints.calcRes.usable">
<view class="u-m-t-32 u-flex">
<view class="" v-if="pointDeductionRule.enableRewards">
<text class="color-red">*</text>
<text class=""
v-if="accountPoints.calcRes.equivalentPoints">100积分等于{{to2(accountPoints.calcRes.equivalentPoints*100)}},</text>
v-if="pointDeductionRule.equivalentPoints">{{ pointDeductionRule.equivalentPoints }}积分等于1,</text>
<text>
最大抵扣积分{{accountPoints.calcRes.maxUsablePoints}}
</text>
<text>,
最小抵扣积分0
最大抵扣积分{{ maxCanUsePoints }}
</text>
<text>, 最小抵扣积分0 </text>
</view>
</view>
<view class="u-m-t-40 u-flex ">
<view class="u-m-t-40 u-flex">
<view>积分</view>
<view class="u-m-l-32 border u-p-l-10 u-p-r-10 u-flex-1">
<uni-easyinput type="number" @input="pointsInput" @change="pointsChange" paddingNone
@@ -38,93 +36,103 @@
</template>
<script setup>
import { reactive, nextTick, ref, watch } from 'vue';
import myModel from '@/components/my-components/my-model.vue'
import myButton from '@/components/my-components/my-button.vue'
import myTabs from '@/components/my-components/my-tabs.vue'
import infoBox from '@/commons/utils/infoBox.js'
import {
reactive,
nextTick,
ref,
watch
} from "vue";
import myModel from "@/components/my-components/my-model.vue";
import myButton from "@/components/my-components/my-button.vue";
import myTabs from "@/components/my-components/my-tabs.vue";
import infoBox from "@/commons/utils/infoBox.js";
const props = defineProps({
title: {
type: String,
default: '积分抵扣'
default: "积分抵扣",
},
accountPoints:{
type:Object,
default:()=>{
maxCanUsePoints: {
type: Number,
default: 0
},
pointDeductionRule: {
type: Object,
default: () => {
return {
calcRes:{
usable: false,
unusableReason: '',
minDeductionPoints: 0,
maxUsablePoints: 0
}
}
}
enableRewards: false,
unusableReason: "",
minDeductionPoints: 0,
maxUsablePoints: 0,
};
},
},
price: {
type: [Number, String],
default: 0
}
})
default: 0,
},
});
function to2(n) {
if (!n) {
return ''
}
return n.toFixed(2)
}
function pointsInput(e){
setTimeout(()=>{
form.points=Math.floor(e)
},100)
}
function pointsChange(newval) {
form.points=Math.floor(newval)
if (newval < 0) {
form.points = 0
return infoBox.showToast('积分抵扣不能小于0')
}
if (newval > props.accountPoints.calcRes.maxUsablePoints) {
form.points = props.price
return infoBox.showToast('积分抵扣不能大于'+props.accountPoints.calcRes.maxUsablePoints)
return "";
}
return n.toFixed(2);
}
function pointsInput(e) {
setTimeout(() => {
form.points = Math.floor(e);
}, 100);
}
function pointsChange(newval) {
form.points = Math.floor(newval);
if (newval < 0) {
form.points = 0;
return infoBox.showToast("积分抵扣不能小于0");
}
if (newval > props.maxCanUsePoints) {
form.points = props.price;
return infoBox.showToast(
"积分抵扣不能大于" + props.maxCanUsePoints
);
}
}
const form = reactive({
points: props.price,
})
watch(() => props.price, (newval) => {
form.points = newval
})
});
watch(
() => props.price,
(newval) => {
form.points = newval;
}
);
function resetForm() {
form.points=0
form.points = 0;
}
const model = ref(null)
const model = ref(null);
function open() {
model.value.open()
form.points = props.price
model.value.open();
form.points = props.price;
}
function close() {
model.value.close()
model.value.close();
}
const emits = defineEmits(['confirm'])
const emits = defineEmits(["confirm"]);
function confirm() {
emits('confirm',Math.floor(form.points) )
close()
emits("confirm", Math.floor(form.points));
close();
}
defineExpose({
open,
close
})
close,
});
</script>
<style lang="scss" scoped>
@@ -140,7 +148,7 @@
.tag {
background-color: #fff;
border: 1px solid #E5E5E5;
border: 1px solid #e5e5e5;
line-height: inherit;
font-size: 24rpx;
color: #666666;
@@ -148,13 +156,13 @@
border-radius: 8rpx;
&.active {
border-color: #E6F0FF;
border-color: #e6f0ff;
color: $my-main-color;
}
}
.hover-class {
background-color: #E5E5E5;
background-color: #e5e5e5;
}
.discount {
@@ -166,7 +174,7 @@
}
.bg1 {
background: #F7F7FA;
background: #f7f7fa;
}
.tab {
@@ -174,7 +182,7 @@
}
.border {
border: 1px solid #E5E5E5;
border: 1px solid #e5e5e5;
border-radius: 4rpx;
}

File diff suppressed because it is too large Load Diff