代码更新

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

@@ -7,18 +7,12 @@
</view>
<view class="u-p-l-30 u-flex-1" style="position: relative;">
<view class="u-flex">
<view class="color-000 font-bold">{{data.nickName}}</view>
<image style="width: 24rpx;height: 24rpx;" v-if="data.sex=='男'" src="./men.png" mode=""></image>
<image style="width: 24rpx;height: 24rpx;" v-if="data.sex=='女'" src="./women.png" mode=""></image>
<!-- <view class="color-999 u-m-l-40" @click="remark">备注</view> -->
<view class="color-000 font-bold" style="margin-right: 10rpx;">{{data.nickName}}</view>
<image style="width: 24rpx;height: 24rpx;" v-if="data.sex==1" src="./men.png" mode=""></image>
<image style="width: 24rpx;height: 24rpx;" v-if="data.sex==0" src="./women.png" mode=""></image>
</view>
<!-- <view class="u-m-t-6 u-flex u-row-between">
<view class="vip isvip" v-if="data.isVip">会员</view>
<view class=" vip noVip" v-else>非会员</view>
<view class="color-main" @click="bindMoblie">绑定号码</view>
</view> -->
<view class="u-m-t-30 color-666 ">
{{data.telephone||''}}
{{data.phone||''}}
</view>
<view style="position: absolute;right: 0;top: 0;border-radius: 4rpx 4rpx 4rpx 4rpx;background: #EAF4FD;font-weight: 400;font-size: 20rpx;color: #318AFE;">
会员等级{{data.isVip}}
@@ -29,7 +23,7 @@
<view class="info u-m-t-20 u-flex">
<view class="u-flex-1 u-text-center" >
<view class="font-bold color-000 pr-16" >{{data.amount}}</view>
<view class="font-bold color-000 pr-16" >{{data.amount||0.00}}</view>
<view class="u-flex u-row-center" >
<view class="color-999">余额</view>
<view class="u-flex">
@@ -38,7 +32,7 @@
</view>
</view>
<view class="u-flex-1 u-text-center" >
<view class="font-bold color-000 pr-16" >{{data.accountPoints}}</view>
<view class="font-bold color-000 pr-16" >{{data.accountPoints||0}}</view>
<view class="u-flex u-row-center" >
<view class="color-999">积分</view>
<view class="u-flex">
@@ -55,33 +49,8 @@
</view>
</view>
</view>
<!-- <view class="u-flex-1 u-text-center" @tap="toUser">
<view class="font-bold color-000 pr-16">{{data.accountPoints}}</view>
<view class="u-flex u-row-center">
<view class="color-999">已消费</view>
<view class="u-flex">
<uni-icons type="right" color="#999"></uni-icons>
</view>
</view>
</view> -->
<!-- <view class="u-flex-1 u-text-center">
<view class="font-bold color-000 pr-16">0</view>
<view class="u-flex u-row-center">
<view class="color-999">优惠券</view>
<view class="u-flex">
<uni-icons type="right" color="#999"></uni-icons>
</view>
</view>
</view>
<view class="u-flex-1 u-text-center">
<view class="font-bold color-000 ">0.00</view>
<view class="u-flex u-row-center">
<view class="color-999">已消费</view>
</view>
</view> -->
</view>
<view class="u-m-t-24 u-flex u-row-between">
<view></view>
<view class="u-flex">
@@ -89,20 +58,14 @@
<view class="btn-primary btn u-m-l-38" @click="moreOperate">更多操作</view>
</view>
</view>
</view>
</template>
<script setup>
import {
ref
} from 'vue';
import { ref } from 'vue';
import go from '@/commons/utils/go.js';
import {ColorMain} from '@/commons/color.js'
const emits=defineEmits(['remark','bindMoblie','moreOperate'])
const emits=defineEmits(['moreOperate'])
const props = defineProps({
index:{
type:Number
@@ -113,22 +76,12 @@
return{}
}
},
showChecked:{
type:Boolean,
default:false
},
showDetail:{
type:Boolean,
default:false
}
})
function toUser(){
go.to('PAGES_USER_INFO',{id:''})
}
function toYue(){
go.to('PAGES_RECHARGE_INDEX',{id:''})
}
function toOrder(){
go.to('PAGES_ORDER_INDEX',{
userId:props.data.id||'',
@@ -136,29 +89,15 @@
})
}
function remark(){
console.log(props.index);
emits('remark',props.index)
}
function bindMoblie(){
emits('bindMoblie',props.index)
}
function moreOperate(){
emits('moreOperate',props.index)
}
//携带参数type edit跳转到商品添加页面编辑与添加同一页面根据type值来判断
function toEdit(){
go.to('PAGES_PRODUCT_ADD',{type:'edit'})
}
</script>
<style lang="scss" scoped>
$imgSize: 126rpx;
$price-color: #F02C45;
.isvip{
color: $my-main-color;
background-color: rgb(234, 244, 255);
}
.pr-16{
padding-right: 16px;
}
@@ -166,14 +105,6 @@
background-color: rgb(250, 250, 250);
padding: 20rpx;
}
.vip{
padding:2rpx 6rpx;
border-radius: 10rpx;
}
.noVip{
background-color: #F9F9F9;
color: #999;
}
.btn{
padding: 10rpx 20rpx;
border-radius: 100rpx;
@@ -187,14 +118,7 @@
border-color: #F4F4F4;
color: #666;
}
.price {
color: $price-color;
}
.h-100 {
height: $imgSize;
}
.img {
width: $imgSize;
height: $imgSize;
@@ -202,27 +126,6 @@
border-radius: 16rpx;
}
.icon-arrow-right {
width: 32rpx;
height: 32rpx;
}
.stock {
padding-right: 46rpx;
position: relative;
}
.stock::after {
content: '';
position: absolute;
right: 10rpx;
top: 50%;
transform: translateY(-50%);
display: block;
width: 16rpx;
border: 2rpx solid #333333;
}
.goods {
border-radius: 10rpx 10rpx 10rpx 10rpx;
background-color: #fff;

View File

@@ -1,18 +1,12 @@
<template>
<view class="safe-page">
<!-- <view class="bg-fff u-p-l-30 u-p-r-30 ">
<view class="myTabs u-m-t-20">
<my-tabs :list="tabsList" @change="tabsChange"></my-tabs>
</view>
</view> -->
<view class="safe-page" style="padding-bottom: 230rpx!important;">
<!-- 用户列表 -->
<template v-if="tabsCurrent===0">
<template>
<view class="input-wrapper u-p-l-30 u-p-r-30 u-p-b-30 bg-fff">
<view class="input-main">
<uni-easyinput class='jeepay-search' :inputBorder="false" :placeholder="pageData.search.placeholder"
v-model="pageData.search.value" @confirm="searchFunc">
v-model="pageData.query.key" @confirm="searchFunc">
<template #prefixIcon>
<image src="@/static/iconImg/icon-search.svg" class="input-icon" />
</template>
@@ -20,30 +14,29 @@
<button type="text" @click="searchFunc()">搜索</button>
</view>
</view>
<view class="u-p-30">
<view class="data-statistics">
<view class="u-font-32">数据统计</view>
<view class="u-m-t-40 u-flex u-row-between">
<view class=" ">
<view>会员数</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.userTotal}}</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.userTotal||0}}</view>
</view>
<view class="line-l-r u-p-l-30 u-p-r-30">
<view>会员余额</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.balanceTotal}}</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.balanceTotal||0}}</view>
</view>
<view class="">
<view>充值金额</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.chageTotal}}</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.chageTotal||0}}</view>
</view>
</view>
</view>
</view>
<view class="goods-list u-p-l-30 u-p-r-30">
<view class="u-m-b-32" v-for="(item,index) in pageData.userList" :key="index">
<my-user @moreOperate="moreOperateClick" @remark="userRemarkClick" @bindMoblie="bindMoblieClick"
:index="index" :data="item" :showChecked="showChecked"
:showDetail="pageData.showGoodsDetail"></my-user>
<my-user @moreOperate="moreOperateClick" :index="index" :data="item" :showDetail="pageData.showGoodsDetail"></my-user>
</view>
<my-pagination @change="pageChange"></my-pagination>
</view>
@@ -52,106 +45,6 @@
</view>
</template>
<!-- 导入用户 -->
<template v-else>
<view class="u-p-30">
<view class="data-statistics user-statistics">
<view class="u-m-t-40 u-flex u-font-24 no-wrap">
<view class="u-flex-1 after-r u-p-l-30 u-p-r-30">
<view>已关联用户</view>
<view class="u-m-t-20 u-font-36 font-bold">0</view>
</view>
<view class="u-flex-1 after-r u-p-l-30 u-p-r-30">
<view>已关联余额</view>
<view class="u-m-t-20 u-font-36 font-bold">0</view>
</view>
<view class="u-flex-1 u-p-l-30 u-p-r-30">
<view>已关联积分</view>
<view class="u-m-t-20 u-font-36 font-bold">0</view>
</view>
</view>
<view class="u-m-t-40 u-flex u-font-24 no-wrap">
<view class="u-flex-1 after-r u-p-l-30 u-p-r-30">
<view>未关联用户</view>
<view class="u-m-t-20 u-font-36 font-bold">0</view>
</view>
<view class="u-flex-1 after-r u-p-l-30 u-p-r-30">
<view>未关联余额</view>
<view class="u-m-t-20 u-font-36 font-bold">0</view>
</view>
<view class="u-flex-1 u-p-l-30 u-p-r-30">
<view>未关联积分</view>
<view class="u-m-t-20 u-font-36 font-bold">27</view>
</view>
</view>
</view>
</view>
<view class="fixed_b">
<my-button showShadow @tap="toAddUser" shape="circle">新建用户</my-button>
</view>
</template>
<!-- 备注弹窗 -->
<my-model ref="remarkModel" title="修改备注">
<template #desc>
<view class="u-p-30 u-m-t-20">
<uni-easyinput v-model="remarModelData.remark" placeholder="请输入备注"></uni-easyinput>
</view>
</template>
<template #btn>
<view class="u-m-t-40 u-p-b-60" style="padding: 0 100rpx;">
<my-button shape="circle" @tap="remarkModelConfirm">确定</my-button>
</view>
</template>
</my-model>
<!-- 绑定手机号弹窗 -->
<my-model ref="phoneModel" title="绑定手机号">
<template #desc>
<view class="u-p-30 u-m-t-20">
<uni-easyinput v-model="phoneModelData.phone" placeholder="输入手机号码"></uni-easyinput>
</view>
</template>
<template #btn>
<view class="u-m-t-40 u-p-b-60" style="padding: 0 100rpx;">
<my-button shape="circle" @tap="phoneModelConfirm">确定</my-button>
</view>
</template>
</my-model>
<!-- 商品库存修改弹窗 -->
<my-model ref="goodsStockModel" title="商品修改" @close="goodsStockModelClose">
<template #desc>
<view class="u-p-40 u-text-left">
<view>
<view class="">排序:</view>
<view class="u-m-t-24">
<uni-easyinput v-model="goodsStockData.sort" placeholder="请输入排序"></uni-easyinput>
</view>
</view>
<view class="u-flex u-m-t-32">
<view class="">库存:</view>
<view class="u-m-l-46 ">
<my-switch v-model="goodsStockData.openStock"></my-switch>
</view>
</view>
<view class="u-m-t-24 u-m-t-32" v-if="goodsStockData.openStock">
<view class="">数量:</view>
<view class="u-m-t-24">
<uni-easyinput v-model="goodsStockData.number" placeholder="请输入库存数量"></uni-easyinput>
</view>
</view>
</view>
</template>
<template #btn>
<view class="stock-btns u-p-b-40">
<my-button shape="circle" @click="goodsStockModelSave">保存</my-button>
<my-button shape="circle" type="default" @click="goodsStockModelCancel">取消</my-button>
</view>
</template>
</my-model>
<my-action-sheet @itemClick="actionSheetClick" ref="moreOperate" :list="moreOperateList"></my-action-sheet>
</view>
<!-- 增减余额 -->
@@ -160,7 +53,7 @@
<view class="">
<span></span>
<span>增减余额</span>
<up-icon @tap="confirm" name="close-circle-fill"></up-icon>
<up-icon @tap="close" name="close-circle-fill"></up-icon>
</view>
<view style="display: flex;align-items: center;padding: 24rpx;">
<image v-if="datas.activeUser?datas.activeUser.headImg:''" :src="datas.activeUser.headImg"
@@ -181,30 +74,30 @@
增减
</view>
<view class="u-m-t-16">
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'operationType')">
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'type')">
<label class="radio u-m-r-60">
<radio value="in" :checked="datas.form.operationType == 'in'" class="scale7" />
<radio value="1" :checked="datas.form.type == '1'" class="scale7" />
<text>增加</text>
</label>
<label class="radio u-m-r-60">
<radio value="out" :checked="datas.form.operationType == 'out'" class="scale7" />
<radio value="0" :checked="datas.form.type == '0'" class="scale7" />
<text>扣除</text>
</label>
</radio-group>
</view>
</view>
<view class="zhezhaopopthree" v-if="datas.form.operationType=='in'">
<view class="zhezhaopopthree" v-if="datas.form.type == '1'">
<view style="font-weight: 400;font-size: 28rpx;color: #333333;">
类型
</view>
<view class="u-m-t-16">
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'type')">
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'bizEnum')">
<label class="radio u-m-r-60">
<radio value="inMoney" :checked="datas.form.type == 'inMoney'" class="scale7" />
<radio value="adminIn" :checked="datas.form.bizEnum == 'adminIn'" class="scale7" />
<text>充值</text>
</label>
<label class="radio u-m-r-60">
<radio value="consumeIn" :checked="datas.form.type == 'consumeIn'" class="scale7" />
<radio value="adminRefund" :checked="datas.form.bizEnum == 'adminRefund'" class="scale7" />
<text>消费退款</text>
</label>
</radio-group>
@@ -215,13 +108,13 @@
类型
</view>
<view class="u-m-t-16">
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'type')">
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'bizEnum')">
<label class="radio u-m-r-60">
<radio value="consumeOut" :checked="datas.form.type == 'consumeOut'" class="scale7" />
<radio value="adminOut" :checked="datas.form.bizEnum == 'adminOut'" class="scale7" />
<text>消费</text>
</label>
<label class="radio u-m-r-60">
<radio value="inMoneyOut" :checked="datas.form.type == 'inMoneyOut'" class="scale7" />
<radio value="adminInOut" :checked="datas.form.bizEnum == 'adminInOut'" class="scale7" />
<text>充值退款</text>
</label>
</radio-group>
@@ -232,7 +125,7 @@
</view>
<view class="">
<input type="number" v-model="datas.form.amount" placeholder="请输入金额" />
<input type="number" v-model="datas.form.money" placeholder="请输入金额" />
<view class="">
</view>
@@ -245,98 +138,126 @@
</template>
<script setup>
import {
reactive,
ref,
watch,
onMounted
} from 'vue';
import { reactive, ref } from 'vue';
import go from '@/commons/utils/go.js';
import myUser from './components/user.vue'
import infoBox from "@/commons/utils/infoBox.js"
import * as $Api from '@/http/yskApi/shop-user.js'
import API from '../../http/classApi';
import {
onShow,
} from '@dcloudio/uni-app';
import {
midfiyAccount
} from '@/http/yskApi/requestAll.js';
import { shopUserSummary, shopUserList,shopUserMoney } from '@/api/shopUser.js'
import { onShow } from '@dcloudio/uni-app';
import { midfiyAccount } from '@/http/yskApi/requestAll.js';
import {
onReachBottom
} from '@dcloudio/uni-app';
import {
hasPermission
} from '@/commons/utils/hasPermission.js';
let tabsCurrent = ref(0)
const tabsList = ['用户列表', '导入用户']
const remarkModel = ref(null)
const phoneModel = ref(null)
import { onReachBottom } from '@dcloudio/uni-app';
import { hasPermission } from '@/commons/utils/hasPermission.js';
const moreOperate = ref(null)
const moreOperateList = ['增减余额', '修改信息', ]
let datas = reactive({
show: false,
form: {
operationType: 'in',
type: 'inMoney'
type: '1',
bizEnum: 'adminIn',
money: ''
},
activeUser: null
})
let close = () => {
datas.form = {
operationType: 'in',
type: 'inMoney'
const pageData = reactive({
search: {
placeholder: '搜索昵称、手机号码'
},
query: {
page: 1,
size: 10,
key: '',
// isVip: 1
},
showGoodsDetail: false,
userList: [],
allShopInfo: {
balanceTotal: 0,
chageTotal: 0,
userTotal: 0
}
})
onShow(() => {
getUser()
getAllShopInfo()
})
onReachBottom(() => {
++pageData.query.page
getUser()
});
/**
* 获取用户数据统计
*/
async function getAllShopInfo() {
const res = await shopUserSummary({isVip: 1})
pageData.allShopInfo = res
}
const confirm = () => {
datas.show = false;
};
/**
* 获取用户列表
*/
async function getUser() {
const res = await shopUserList(pageData.query)
console.log(res)
if ( res ) {
if (res.pageNumber <= 1) {
pageData.userList = res.records
} else {
pageData.userList.push(...res.records)
}
}
}
/**
* 搜索
*/
function searchFunc() {
pageData.query.page = 1
getUser()
}
/**
* 新建用户
*/
function toAddUser() {
go.to('PAGES_USER_ADD')
}
let callTabletakeNumberEvent = async () => {
let res = await midfiyAccount({
id: datas.activeUser.id,
...datas.form
})
datas.show = false;
close()
getUser()
}
const remarModelData = reactive({
remark: ''
})
const phoneModelData = reactive({
phone: ''
})
/**
* 增减余额监听
* @param {Object} e
* @param {Object} name
*/
function sizeChange(e, name) {
datas.form[name] = e.detail.value
if (name == 'operationType') {
if (datas.form.operationType == 'in') {
datas.form.type = 'inMoney'
if (name == 'type') {
if (datas.form.type == '1') {
datas.form.bizEnum = 'adminIn'
} else {
datas.form.type = 'consumeOut'
datas.form.bizEnum = 'adminOut'
}
}
}
const goodsStockModel = ref(null)
const moreOperateList = ['增减余额', '修改信息', ]
/**
* 更多操作
* @param {Object} d
*/
function moreOperateClick(d) {
datas.activeUser = pageData.userList[d]
moreOperate.value.open()
}
onReachBottom(() => {
++page.value
getUser()
});
/**
* 判断是否可以修改余额、修改信息
* @param {Object} i
*/
function actionSheetClick(i) {
if (i == 0) {
hasPermission('允许修改会员余额').then(ele => {
@@ -352,182 +273,40 @@
})
}
}
//修改备注弹窗展示
function bindMoblieClick() {
phoneModel.value.open()
/**
* 修改余额关闭
*/
let close = () => {
datas.show = false;
datas.form = {
type: '1',
bizEnum: 'adminIn',
money: ''
}
}
//修改备注弹窗展示
function userRemarkClick() {
remarkModel.value.open()
}
//修改备注弹窗确认
function remarkModelConfirm() {
}
//修改手机号弹窗确认
function phoneModelConfirm() {
}
function returnGoodsStockData() {
return reactive({
sort: 0,
openStock: false,
number: 0,
/**
* 修改余额确定
*/
let callTabletakeNumberEvent = async () => {
let res = await shopUserMoney({
id: datas.activeUser.id,
...datas.form
})
}
let goodsStockData = returnGoodsStockData()
function goodsStockModelClose() {
console.log('goodsStockModelClose');
goodsStockData = returnGoodsStockData()
}
function goodsStockModelCancel() {
console.log('goodsStockModelCancel');
goodsStockModel.value.close()
}
function goodsStockModelSave() {
console.log('goodsStockModelSave');
}
//点击修改按钮弹出修改商品弹窗
function goodsChangeClick(index) {
console.log(index);
goodsStockModel.value.open()
}
function statesTableClick(index) {
pageData.stateCurrent = index
}
function states1TableClick(index) {
pageData.stateCurrent1 = index
}
let test = ref(false)
function tabsChange(i) {
console.log(i);
tabsCurrent.value = i
}
const pageData = reactive({
modelDesc: '是否下架',
stateCurrent: 0,
stateCurrent1: 0,
componentBottom: 264,
search: {
value: '',
placeholder: '搜索昵称、手机号码'
},
showGoodsDetail: false,
userList: [],
allShopInfo: {
balanceTotal: 0,
chageTotal: 0,
userTotal: 0
}
})
//改变商品的选中状态
function changeGoodsChecked(checked, index) {
if (index !== undefined) {
pageData.userList[index].checked = checked
} else {
pageData.userList.map(v => {
v.checked = checked
})
}
control.value.setisSelectAll(isAllChecked() ? true : false)
}
// 获取已经选中的商品
function getChechkeduserList() {
return pageData.userList.filter(v => v.checked)
}
//是否全部选中
function isAllChecked() {
return getChechkeduserList().length === pageData.userList.length
}
// 是否有商品选中
function isHasChekdGoods() {
return getChechkeduserList().length ? true : false
}
function searchFunc() {
page.value = 0
close()
getUser()
}
let showChecked = ref(false)
//商品start
function goodsRadioClick(index) {
var checked = !pageData.userList[index].checked
changeGoodsChecked(checked, index)
getAllShopInfo()
}
//下架
function offShelf() {
const hasCheckedArr = getChechkeduserList()
const hasChecked = isHasChekdGoods()
if (!hasChecked) {
return infoBox.showToast('您还没有选中商品!')
}
model.value.open()
}
//商品end
// 页数改变事件
function pageChange(page) {
console.log(page);
}
//分类
const category = ref(null)
function toggleCategory() {
category.value.toggle()
}
function cateClick(cate) {
console.log(cate);
}
let page = ref(0)
async function getUser() {
const {
content
} = await $Api.queryAllShopUser({
isVip: 1,
size: 10,
page: page.value,
name: pageData.search.value
})
if (page.value == 0) {
pageData.userList = content
} else {
pageData.userList.push(...content)
}
}
async function getAllShopInfo() {
const res = await $Api.queryAllShopInfo()
pageData.allShopInfo = res
}
onShow(() => {
getUser()
getAllShopInfo()
})
</script>
<style scoped>
page {