源文件
This commit is contained in:
@@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<view class="e-card-wrapper" @tap="isOpen">
|
||||
<view class="e-card-left">
|
||||
<image :src="imgList[0]" mode="scaleToFill" />
|
||||
<view class="expand-info">
|
||||
{{ teamName }}
|
||||
<text>成员数量:{{ userList.length }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="e-card-right">
|
||||
<image src="/static/iconImg/top-arrow.svg" :class="{ rotate: flag }" mode="scaleToFill" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="expand-card-list" v-if="flag">
|
||||
<view class="expand-card-main bdR20">
|
||||
<view class="expand-main-left">
|
||||
<view>
|
||||
拓展商户总数
|
||||
<text>{{ totalMchCount }}</text>
|
||||
</view>
|
||||
<view>
|
||||
商户交易总额
|
||||
<text>{{ totalOrderAmount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="expand-main-right" @tap="jumpPage">
|
||||
<image src="/static/iconImg/edit-team.svg" mode="scaleToFill" />
|
||||
编辑团队
|
||||
</view>
|
||||
</view>
|
||||
<block v-for="v in userList" :key="v.sysUserId">
|
||||
<view class="expand-team bdR20" @tap="detail(v.sysUserId)">
|
||||
<view class="expand-team-top">
|
||||
<view class="e-team-t-left">
|
||||
<image :src="imgList[v.state ? 2 : 3]" mode="scaleToFill" />
|
||||
<view>
|
||||
{{ v.realname }}
|
||||
<text>{{ v.telphone }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="e-team-t-right" :class="{ isStateNone: !v.state }">
|
||||
{{ v.state ? "已启用" : "已禁用" }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="expand-team-bottom">
|
||||
<view
|
||||
>拓展商户数 <text>{{ v.mchCount }}</text>
|
||||
</view>
|
||||
<view
|
||||
>商户交易额 <text>{{ v.orderCount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref } from "vue"
|
||||
const emits = defineEmits(["isOpen", "jumpPage", "detail"])
|
||||
const props = defineProps({
|
||||
teamName: { type: String },
|
||||
flag: { type: Boolean },
|
||||
state: { type: Number },
|
||||
userList: { type: Array, default: [] },
|
||||
totalMchCount: { type: Number },
|
||||
totalOrderAmount: { type: Number },
|
||||
teamId: { type: Number },
|
||||
state: { type: Number },
|
||||
})
|
||||
const imgList = reactive([
|
||||
"/static/iconImg/expand-fill.svg",
|
||||
"/static/iconImg/expand-team-close.svg",
|
||||
"/static/iconImg/expand-member.svg",
|
||||
"/static/iconImg/expand-member-close.svg",
|
||||
])
|
||||
const isOpen = () => {
|
||||
emits("isOpen")
|
||||
}
|
||||
const jumpPage = (val) => {
|
||||
emits("jumpPage")
|
||||
}
|
||||
const detail = (val) => {
|
||||
uni.navigateTo({ url: "/pageWork/developerManagement/developerDetail?id=" + val })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.e-card-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx;
|
||||
.e-card-left {
|
||||
display: flex;
|
||||
image {
|
||||
width: 93rpx;
|
||||
height: 93rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.expand-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 33rpx;
|
||||
font-weight: 700;
|
||||
text {
|
||||
margin-top: 12rpx;
|
||||
font-size: 25rpx;
|
||||
font-weight: 500;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
}
|
||||
}
|
||||
.e-card-right {
|
||||
display: flex;
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
transform: rotate(180deg);
|
||||
transition: 0.3s linear;
|
||||
}
|
||||
.rotate {
|
||||
transform: rotate(0deg);
|
||||
transition: 0.3s linear;
|
||||
}
|
||||
}
|
||||
}
|
||||
.expand-card-list {
|
||||
padding: 0 30rpx;
|
||||
padding-bottom: 30rpx;
|
||||
.expand-card-main {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
background: rgba(81, 36, 178, 0.1);
|
||||
.expand-main-left {
|
||||
padding: 30rpx;
|
||||
flex: 1;
|
||||
view {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: rgba(81, 36, 178, 0.7);
|
||||
text {
|
||||
color: #5124b2;
|
||||
}
|
||||
&:last-child {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.expand-main-right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30rpx;
|
||||
font-size: 25rpx;
|
||||
color: #ffffff;
|
||||
background-color: #5124b3;
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.expand-team {
|
||||
padding: 30rpx 0 30rpx 30rpx;
|
||||
margin-top: 30rpx;
|
||||
background: #f7f7f7;
|
||||
.expand-team-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 30rpx;
|
||||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
|
||||
.e-team-t-left {
|
||||
display: flex;
|
||||
image {
|
||||
width: 93rpx;
|
||||
height: 93rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 33rpx;
|
||||
font-weight: 700;
|
||||
color: #000000;
|
||||
text {
|
||||
margin-top: 15rpx;
|
||||
font-size: 25rpx;
|
||||
font-weight: 500;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
}
|
||||
}
|
||||
.e-team-t-right {
|
||||
margin-right: 30rpx;
|
||||
font-size: 30rpx;
|
||||
color: #666666;
|
||||
&::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
border-radius: 50%;
|
||||
background-color: $primaryColor;
|
||||
}
|
||||
}
|
||||
.isStateNone::before {
|
||||
background-color: #999 !important;
|
||||
}
|
||||
}
|
||||
.expand-team-bottom {
|
||||
margin-top: 30rpx;
|
||||
view {
|
||||
font-size: 28rpx;
|
||||
color: #8c8c8c;
|
||||
text {
|
||||
margin-left: 30rpx;
|
||||
color: #000000;
|
||||
}
|
||||
&:last-child {
|
||||
margin-top: 25rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<JPopup ref="popup">
|
||||
<JMainCard wrapPd="0 30rpx" pd="0">
|
||||
<block v-for="(v, i) in sexList" :key="i">
|
||||
<JLine :name="v" :isSelect="index === i" @tap="selected(i)"></JLine>
|
||||
</block>
|
||||
</JMainCard>
|
||||
<JButton pd="30rpx" pdTop="0" bgColor="rgba(255,255,255,0.8)" @HandleTouch="popup.close()" color="#000"
|
||||
>取消</JButton
|
||||
>
|
||||
</JPopup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref } from "vue"
|
||||
import JPopup from "@/components/newComponents/JPopup/JPopup"
|
||||
import JMainCard from "@/components/newComponents/JMainCard/JMainCard"
|
||||
import JLine from "@/components/newComponents/JLine/JLine"
|
||||
import JButton from "@/components/newComponents/JButton/JButton"
|
||||
const sexList = reactive(["未知", "男", "女"])
|
||||
const emits = defineEmits(["selected"])
|
||||
const index = ref(undefined)
|
||||
const popup = ref()
|
||||
const open = (i) => {
|
||||
index.value = i
|
||||
popup.value.open()
|
||||
}
|
||||
const selected = (i) => {
|
||||
emits("selected", i)
|
||||
popup.value.close()
|
||||
}
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,285 @@
|
||||
<template>
|
||||
<view class="page-wrapper">
|
||||
<JHeaderTitle title="拓展员详情" :bgColor="headerBgColor" color="#fff" imgUrl="/static/iconImg/left-white.svg" />
|
||||
<image src="/static/iconImg/bg-tuozhanyuan.svg" class="bg-image" mode="scaleToFill" />
|
||||
<view class="expand-header">
|
||||
<image src="/static/iconImg/expand-img.svg" mode="scaleToFill" />
|
||||
<view class="expand-title">{{ expandInfo.realname }}</view>
|
||||
<view class="expand-phone">{{ expandInfo.telphone }}</view>
|
||||
<view class="expand-edit bgF bdR10" @tap="jumpPage">
|
||||
<image src="/static/iconImg/expand-edit.svg" mode="scaleToFill" />
|
||||
编辑信息
|
||||
</view>
|
||||
</view>
|
||||
<JMainCard pd="0" bgColor="rgba(0,0,0,0.1)">
|
||||
<JInput name="拓展员姓名" pd="40rpx" textColor="rgba(255,255,255,0.6)" :isBorder="true">
|
||||
<text class="right-color">{{ expandInfo.realname }}</text></JInput
|
||||
>
|
||||
<JInput name="性别" pd="0 40rpx" textColor="rgba(255,255,255,0.6)" :isBorder="true">
|
||||
<text class="right-color">{{ expandInfo.sex == 1 ? "男" : expandInfo.sex == 2 ? "女" : "未知" }}</text></JInput
|
||||
>
|
||||
<JInput name="编号" pd="40rpx" textColor="rgba(255,255,255,0.6)" :isBorder="true">
|
||||
<text class="right-color">{{ expandInfo.userNo }}</text></JInput
|
||||
>
|
||||
<JInput name="所属团队" pd="0 40rpx" textColor="rgba(255,255,255,0.6)" :isBorder="true">
|
||||
<text class="right-color">{{ expandInfo.teamName }}</text></JInput
|
||||
>
|
||||
<JInput name="创建时间" pd="40rpx" textColor="rgba(255,255,255,0.6)" :isBorder="true">
|
||||
<text class="right-color">{{ expandInfo.createdAt }}</text></JInput
|
||||
>
|
||||
<JInput name="是否队长" pd="0 40rpx" textColor="rgba(255,255,255,0.6)" :isBorder="true">
|
||||
<view class="dis-wrapper">
|
||||
<text v-if="expandInfo.isTeamLeader == 1">是</text>
|
||||
<text v-else>否</text>
|
||||
<switch
|
||||
:checked="expandInfo.isTeamLeader == 1 ? true : false"
|
||||
@change="change($event, 'isTeamLeader')"
|
||||
style="margin-left: 20rpx; transform: scale(1.2)"
|
||||
color="#BF80FF"
|
||||
/>
|
||||
</view>
|
||||
</JInput>
|
||||
<JInput name="拓展员状态" pd="40rpx" textColor="rgba(255,255,255,0.6)" :isBorder="true">
|
||||
<view class="dis-wrapper">
|
||||
<text v-if="expandInfo.state == 1">启用</text>
|
||||
<text v-else>禁用</text>
|
||||
<switch
|
||||
:checked="expandInfo.state == 1 ? true : false"
|
||||
style="margin-left: 20rpx; transform: scale(1.2)"
|
||||
color="#BF80FF"
|
||||
@change="change($event, 'state')"
|
||||
/>
|
||||
</view>
|
||||
</JInput>
|
||||
</JMainCard>
|
||||
<view class="page-title">数据统计</view>
|
||||
<JMainCard pd="0" bgColor="rgba(0,0,0,0.1)" wrapPd="0 50rpx">
|
||||
<ScreenTitle bdR="20rpx 20rpx 0 0" @search="screening" :index="index" />
|
||||
<view class="mch-info">
|
||||
<view class="mch-many">
|
||||
<text>商户交易额(元)</text>
|
||||
{{ (mchInfo.payAmount / 100).toFixed(2) }}
|
||||
</view>
|
||||
<view class="mch-footer">
|
||||
<view>
|
||||
<text>新增商户数</text>
|
||||
{{ mchInfo.mchOnNetCount }}
|
||||
</view>
|
||||
<view>
|
||||
<text>新增入网商户数</text>
|
||||
{{ mchInfo.mchOnNetNewCount }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</JMainCard>
|
||||
<JMainCard pd="0" bgColor="rgba(0,0,0,0.1)">
|
||||
<view class="mch-info">
|
||||
<view class="mch-many">
|
||||
<text>商户交易总额(元)</text>
|
||||
{{ (mchInfo.payAllAmount / 100).toFixed(2) }}
|
||||
</view>
|
||||
<view class="mch-footer">
|
||||
<view>
|
||||
<text>商户总数</text>
|
||||
{{ mchInfo.mchTodayAddCount }}
|
||||
</view>
|
||||
<view>
|
||||
<text>入网商户总数</text>
|
||||
{{ mchInfo.mchOnNetNewCount }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</JMainCard>
|
||||
<JButton
|
||||
color="#FF4D6A"
|
||||
bgColor="rgba(255,255,255,0.85)"
|
||||
pd="0 50rpx 50rpx"
|
||||
pdTop="0"
|
||||
@HandleTouch="deletedTips.open()"
|
||||
>删除拓展员</JButton
|
||||
>
|
||||
</view>
|
||||
<JDeletedTips ref="deletedTips" @confirm="deleted" />
|
||||
<JDeletedTips ref="switchTips" @confirm="confirm" @cancel="cancel" />
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, onUnmounted } from "vue"
|
||||
import { onLoad, onShow, onPageScroll } from "@dcloudio/uni-app"
|
||||
import { $devDetail, $editDev, $getDevDetail, $delSysUser } from "@/http/apiManager.js"
|
||||
import JHeaderTitle from "@/components/newComponents/JHeaderTitle/JHeaderTitle"
|
||||
import JMainCard from "@/components/newComponents/JMainCard/JMainCard"
|
||||
import JInput from "@/components/newComponents/JInput/JInput"
|
||||
import JButton from "@/components/newComponents/JButton/JButton"
|
||||
import JDeletedTips from "@/components/newComponents/JDeletedTips/JDeletedTips"
|
||||
import ScreenTitle from "@/components/newComponents/ScreenTitle/ScreenTitle"
|
||||
onLoad((options) => {
|
||||
console.log("options", options)
|
||||
params.sysUserId = options.id
|
||||
})
|
||||
onShow(() => {
|
||||
if (params.sysUserId) {
|
||||
getInfo(params.sysUserId)
|
||||
getDevDetail()
|
||||
}
|
||||
})
|
||||
const expandInfo = ref({})
|
||||
const mchInfo = ref({})
|
||||
const deletedTips = ref(null)
|
||||
const switchTips = ref(null)
|
||||
const index = ref(0)
|
||||
const params = {
|
||||
queryDateRange: "",
|
||||
}
|
||||
const deleted = () => {
|
||||
$delSysUser(expandInfo.value.sysUserId).then((res) => {
|
||||
uni.showToast({
|
||||
title: "删除成功",
|
||||
icon: "success|none",
|
||||
mask: true,
|
||||
})
|
||||
uni.navigateBack()
|
||||
})
|
||||
}
|
||||
const getInfo = (val) => {
|
||||
$devDetail(val).then(({ bizData }) => {
|
||||
expandInfo.value = bizData
|
||||
})
|
||||
}
|
||||
const screening = (data) => {
|
||||
index.value = data.i
|
||||
if (data.val.value != "customer") {
|
||||
params.queryDateRange = data?.val.value
|
||||
getDevDetail()
|
||||
}
|
||||
}
|
||||
const getDevDetail = () => {
|
||||
$getDevDetail(params).then((res) => {
|
||||
mchInfo.value = res.bizData
|
||||
})
|
||||
}
|
||||
|
||||
let keys = null
|
||||
const change = (e, val) => {
|
||||
keys = val
|
||||
expandInfo.value[val] = e.detail.value ? 1 : 0
|
||||
switchTips.value.open("确认修改吗?")
|
||||
}
|
||||
const confirm = () => {
|
||||
const data = {}
|
||||
data[keys] = expandInfo.value[keys]
|
||||
keys = null
|
||||
$editDev(expandInfo.value.sysUserId, data).then(() => {
|
||||
Object.assign(data, expandInfo.value)
|
||||
uni.showToast({
|
||||
title: "修改成功",
|
||||
icon: "success",
|
||||
})
|
||||
})
|
||||
}
|
||||
const cancel = () => {
|
||||
if (!keys) return
|
||||
expandInfo.value[keys] = Number(!expandInfo.value[keys])
|
||||
}
|
||||
const jumpPage = () => {
|
||||
uni.navigateTo({ url: "/pageWork/developerManagement/editDeveloper?id=" + expandInfo.value.sysUserId })
|
||||
}
|
||||
const headerBgColor = ref("transparent")
|
||||
onPageScroll((data) => {
|
||||
if (data.scrollTop > 20) {
|
||||
headerBgColor.value = "$primaryColor"
|
||||
} else {
|
||||
headerBgColor.value = "transparent"
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-wrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
background-color: $primaryColor;
|
||||
text {
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
}
|
||||
.bg-image {
|
||||
position: absolute;
|
||||
top: -40rpx;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 650rpx;
|
||||
}
|
||||
.expand-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
image {
|
||||
width: 93rpx;
|
||||
height: 93rpx;
|
||||
}
|
||||
.expand-title {
|
||||
margin-top: 20rpx;
|
||||
font-size: 33rpx;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
}
|
||||
.expand-phone {
|
||||
margin: 30rpx 0;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-size: 25rpx;
|
||||
}
|
||||
.expand-edit {
|
||||
position: relative;
|
||||
z-index: 30;
|
||||
padding: 20rpx 41rpx;
|
||||
font-size: 28rpx;
|
||||
color: $primaryColor;
|
||||
image {
|
||||
width: 26.25rpx;
|
||||
height: 26.25rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.right-color {
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.page-title {
|
||||
margin-bottom: 30rpx;
|
||||
text-align: center;
|
||||
font-size: 33rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.mch-info {
|
||||
border-top: 1rpx solid rgba(0, 0, 0, 0.1);
|
||||
padding: 60rpx;
|
||||
view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
text {
|
||||
margin-bottom: 20rpx;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-size: 25rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.mch-many {
|
||||
color: #fff;
|
||||
font-size: 56rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.mch-footer {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-top: 50rpx;
|
||||
view {
|
||||
flex: 1;
|
||||
font-size: 33rpx;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<div class="global-wrapper bgF2">
|
||||
<view class="mch-header">
|
||||
<JHeaderTitle bgColor="#f2f2f2" title="拓展员管理" />
|
||||
<view class="search bgF2">
|
||||
<JSearchInput place="搜索拓展员姓名、手机号" wrapPd="0 30rpx" ref="search" :isDisabled="true" @tap="toSearch" />
|
||||
<view class="switch-title">
|
||||
<view :class="{ 'active-title': titleFlag }" @tap="titleFlag = true">全部拓展员</view>
|
||||
<view :class="{ 'active-title': !titleFlag }" @tap="titleFlag = false">按团队分组</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="expand-wrapper bgF">
|
||||
<template v-if="titleFlag">
|
||||
<block v-for="v in useDataResult.dataList" :key="v.sysUserId">
|
||||
<view class="page-main bgF" @tap="toDetails(v.sysUserId)">
|
||||
<image :src="imgList[v.state ? 0 : 1]" />
|
||||
<view class="page-left">
|
||||
<view class="page-text">
|
||||
{{ v.realname }}
|
||||
<view class="text-but">
|
||||
<text>{{ v.telphone }}</text>
|
||||
<!-- <text class="team-name single-text-beyond">团队名称</text> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="state-flag" :class="{ 'state-active': v.state == 1, 'state-none': v.state == 0 }">{{
|
||||
v.state == 1 ? "已启用" : "已禁用"
|
||||
}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<jeepayListNull :isShow="true" :list="useDataResult.dataList.length" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<block v-for="v in dataList.dataList" :key="v.teamId">
|
||||
<ExpandCard
|
||||
v-bind="v"
|
||||
@isOpen="v.flag = !v.flag"
|
||||
@jumpPage="jumpPage('/pageWork/developerManagement/newTeam', v)"
|
||||
/>
|
||||
</block>
|
||||
<jeepayListNull :isShow="true" :list="dataList.dataList.length" />
|
||||
</template>
|
||||
</view>
|
||||
<view class="add-block"></view>
|
||||
<view class="add-wrapper ButtonBor bgF2">
|
||||
<view class="add-expand">
|
||||
<view @tap="jumpPage('/pageWork/developerManagement/newTeam')">创建团队</view>
|
||||
<view @tap="jumpPage('/pageWork/developerManagement/newDeveloper')">创建拓展员</view>
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, onUnmounted } from "vue"
|
||||
import { onBackPress } from "@dcloudio/uni-app"
|
||||
import { $getTeams, $getDev } from "@/http/apiManager.js"
|
||||
import useStore from "@/hooks/useStore.js"
|
||||
import useGetList from "@/hooks/useList.js"
|
||||
const { setStore } = useStore()
|
||||
import jeepayListNull from "@/components/jeepayListNull/jeepayListNull" //最后一条数据提示
|
||||
import JHeaderTitle from "@/components/newComponents/JHeaderTitle/JHeaderTitle"
|
||||
import JSearchInput from "@/components/newComponents/JSearchInput/JSearchInput"
|
||||
import ExpandCard from "./components/ExpandCard"
|
||||
const imgList = reactive(["/static/iconImg/expand-member.svg", "/static/iconImg/expand-member-close.svg"])
|
||||
const titleFlag = ref(true)
|
||||
const { useDataResult, getList } = useGetList({
|
||||
requestFun: $getDev,
|
||||
params: {
|
||||
userType: 3,
|
||||
},
|
||||
})
|
||||
const { useDataResult: dataList } = useGetList({
|
||||
requestFun: $getTeams,
|
||||
})
|
||||
const list = ref([])
|
||||
const params = {}
|
||||
const searchList = (data) => {
|
||||
params.queryNameOrPhone = data == "reset" ? "" : data
|
||||
getList(params)
|
||||
}
|
||||
const jumpPage = (url, val) => {
|
||||
setStore("teamInfo", val)
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
const toSearch = () => {
|
||||
uni.navigateTo({ url: `/pageWork/SelectedList/SelectedList?title=expand&search=${JSON.stringify({ userType: 3 })}` })
|
||||
}
|
||||
const toDetails = (sysUserId) => {
|
||||
uni.navigateTo({ url: `/pageWork/developerManagement/developerDetail?id=${sysUserId}` })
|
||||
}
|
||||
// 获取搜索组件暴露出来的数据
|
||||
const search = ref()
|
||||
onBackPress(() => {
|
||||
if (search.value.searchText != "") {
|
||||
search.value.searchText = ""
|
||||
list(search.value.searchText)
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mch-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.add-block {
|
||||
height: 220rpx;
|
||||
}
|
||||
.add-wrapper {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 30rpx 30rpx 55rpx 30rpx;
|
||||
.add-expand {
|
||||
display: flex;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
background: #5124b2;
|
||||
view {
|
||||
flex: 1;
|
||||
padding: 32rpx;
|
||||
&:last-child {
|
||||
border-radius: 20rpx;
|
||||
background: #7737fe;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.switch-title {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
.active-title {
|
||||
color: $primaryColor;
|
||||
font-weight: 700;
|
||||
}
|
||||
view {
|
||||
color: #a6a6a6;
|
||||
}
|
||||
}
|
||||
.page-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 30rpx;
|
||||
image {
|
||||
width: 93rpx;
|
||||
height: 93rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.page-left {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f9f9f9;
|
||||
.page-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 33rpx;
|
||||
font-weight: 700;
|
||||
.text-but {
|
||||
text {
|
||||
margin-top: 15rpx;
|
||||
font-size: 25rpx;
|
||||
font-weight: 500;
|
||||
color: #a6a6a6;
|
||||
}
|
||||
.team-name {
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.state-flag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-self: flex-start;
|
||||
margin-right: 15rpx;
|
||||
transform: translateY(30rpx);
|
||||
}
|
||||
.state-active::before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
margin-right: 8rpx;
|
||||
border-radius: 50%;
|
||||
background-color: $primaryColor;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="search">
|
||||
<JeepaySearch
|
||||
ref="search"
|
||||
v-model:value="data.queryNameOrPhone"
|
||||
@searchHandle="searchHandle"
|
||||
:placeholder="data.placeholder"
|
||||
@focusHandle="focusHandle"
|
||||
:isFocus="data.isFocus"
|
||||
>
|
||||
</JeepaySearch>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view
|
||||
class="list-item"
|
||||
v-for="(item, index) in useDataResult.dataList"
|
||||
@click="toDevDetail(item.sysUserId)"
|
||||
:key="index"
|
||||
>
|
||||
<view class="item-left">
|
||||
<view class="avatar">
|
||||
<image :src="item.avatarUrl" mode=""></image>
|
||||
</view>
|
||||
<view class="devinfo">
|
||||
<text style="font-weight: bold; font-size: 27rpx; color: #000">{{ item.realname }}</text>
|
||||
<text>{{ item.telphone }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<view class="dealinfo">
|
||||
<text>拓展商户数:{{ item.mchCount }}</text>
|
||||
<text
|
||||
>商户交易额:¥{{
|
||||
typeof item.orderAmount === "undefined" ? "0.00" : (item.orderAmount / 100).toFixed(2)
|
||||
}}</text
|
||||
>
|
||||
</view>
|
||||
<view class="icon">
|
||||
<image src="../../static/indexImg/up.svg" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<jeepayListNull :list="useDataResult.dataList"></jeepayListNull>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import JeepaySearch from "@/components/jeepaySearch/jeepaySearch.vue"
|
||||
import jeepayListNull from "@/components/jeepayListNull/jeepayListNull.vue"
|
||||
import { reactive, watch, ref } from "vue"
|
||||
import { onLoad, onShow, onBackPress } from "@dcloudio/uni-app"
|
||||
import { $getDev } from "@/http/apiManager.js"
|
||||
import useGetList from "@/hooks/useGetList.js"
|
||||
const { useDataResult, getList } = useGetList($getDev, undefined, {}, false)
|
||||
const data = reactive({
|
||||
queryNameOrPhone: "",
|
||||
placeholder: "搜索拓展员姓名、手机号…",
|
||||
isA: false, //动画
|
||||
isPlus: false, //添加键的动画
|
||||
isFocus: false, //聚焦
|
||||
flag: false,
|
||||
startSearch: false,
|
||||
})
|
||||
onLoad(() => {
|
||||
data.isFocus = false // 每次都要初始化 focus 属性
|
||||
setTimeout(() => {
|
||||
data.isFocus = true
|
||||
}, 0)
|
||||
uni.hideTabBar()
|
||||
})
|
||||
// watch(() => data, (newValue, oldValue) => {
|
||||
// //监听这个数组,要是没内容就重新请求列表
|
||||
|
||||
// if(newValue.flag){
|
||||
// if(newValue.queryNameOrPhone === ''){
|
||||
// // getList({ queryNameOrPhone: newValue.queryNameOrPhone,loginType:'APP',userType:3 })
|
||||
// }
|
||||
// }
|
||||
// }, {deep: true})
|
||||
const searchHandle = () => {
|
||||
data.flag = true
|
||||
data.startSearch = true
|
||||
getList({
|
||||
queryNameOrPhone: data.queryNameOrPhone,
|
||||
loginType: "APP",
|
||||
userType: 3,
|
||||
})
|
||||
}
|
||||
const toDevDetail = (sysUserId) => {
|
||||
uni.navigateTo({
|
||||
url: "./developerDetail?sysUserId=" + sysUserId,
|
||||
})
|
||||
}
|
||||
const search = ref()
|
||||
onBackPress(() => {
|
||||
if (data.startSearch || search.value.backPressHandel()) {
|
||||
if (data.queryNameOrPhone !== "" && data.startSearch === true) {
|
||||
// getList({ queryNameOrPhone: '',
|
||||
// loginType:'APP',
|
||||
// userType:3 })
|
||||
}
|
||||
data.startSearch = false
|
||||
data.queryNameOrPhone = ""
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
page {
|
||||
background-color: #f5f6fc;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped>
|
||||
.search {
|
||||
height: 93rpx;
|
||||
}
|
||||
.list-item {
|
||||
height: 138rpx;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1rpx solid #f5f6fc;
|
||||
.item-left {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
width: 40%;
|
||||
//background-color: beige;
|
||||
|
||||
padding: 33rpx 0 33rpx 30rpx;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.avatar {
|
||||
height: 72rpx;
|
||||
width: 72rpx;
|
||||
//background-color: #345;
|
||||
image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.devinfo {
|
||||
height: 72rpx;
|
||||
width: 172rpx;
|
||||
// background-color: aqua;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
font-weight: Medium;
|
||||
font-size: 22rpx;
|
||||
color: #8d95a6;
|
||||
}
|
||||
}
|
||||
.item-right {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
width: 45%;
|
||||
//background-color: #345;
|
||||
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-right: 30rpx;
|
||||
.dealinfo {
|
||||
height: 72rpx;
|
||||
width: 292rpx;
|
||||
//background-color: #8d95a6;
|
||||
|
||||
margin-right: 20rpx;
|
||||
|
||||
font-weight: Medium;
|
||||
font-size: 22rpx;
|
||||
color: #8d95a6;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
}
|
||||
.icon {
|
||||
height: 20rpx;
|
||||
width: 20rpx;
|
||||
//background-color: #5500ff;
|
||||
margin-bottom: 30rpx;
|
||||
//margin-left: 20rpx;
|
||||
image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<view class="page-wrapper global-wrapper bgF2">
|
||||
<JHeaderTitle title="编辑拓展员" bgColor="#f2f2f2" />
|
||||
<JMainCard pd="0" wrapPd="0 30rpx">
|
||||
<JInput
|
||||
v-model:value="member.realname"
|
||||
name="拓展员姓名"
|
||||
place="请输入拓展员姓名"
|
||||
:rules="{ name: 'realname', rule: 'REG_NotNUll' }"
|
||||
:isBorder="true"
|
||||
></JInput>
|
||||
<JInput
|
||||
v-model:value="member.userNo"
|
||||
name="拓展员编号"
|
||||
place="请输入拓展员编号"
|
||||
:rules="{ name: 'userNo', rule: 'REG_NotNUll' }"
|
||||
:isBorder="true"
|
||||
></JInput>
|
||||
<JInput name="拓展员性别" :isBorder="true">
|
||||
<view class="place-text" :class="{ 'selected-text': member.sex > 0 }" @tap="sex.open(member.sex)">
|
||||
{{ sexList[member.sex] }}
|
||||
<image src="/static/iconImg/right-arrow.svg" mode="scaleToFill" />
|
||||
</view>
|
||||
</JInput>
|
||||
<JInput
|
||||
v-model:value="member.loginUsername"
|
||||
name="登录名"
|
||||
place="请输入登录名"
|
||||
:rules="{ name: 'loginUsername', rule: 'REG_LoginName' }"
|
||||
:isBorder="true"
|
||||
></JInput>
|
||||
|
||||
<JInput
|
||||
v-model:value="member.telphone"
|
||||
name="拓展员手机号"
|
||||
place="请输入拓展员手机号"
|
||||
:rules="{ name: 'telphone', rule: 'REG_Phone' }"
|
||||
:isBorder="true"
|
||||
></JInput>
|
||||
</JMainCard>
|
||||
<JMainCard wrapPd="30rpx" pd="30rpx">
|
||||
<view
|
||||
class="team-wrapper"
|
||||
@tap="jumpPage('/pageWork/SelectedList/SelectedList?title=team&&selected=' + member.teamId)"
|
||||
>
|
||||
<view>
|
||||
<image src="/static/iconImg/expand-fill.svg" mode="scaleToFill" />
|
||||
<view>
|
||||
{{ member.teamName }}
|
||||
<text>{{ member.teamId }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<image src="/static/iconImg/icon-right-jiantou.svg" mode="scaleToFill" />
|
||||
</view>
|
||||
</JMainCard>
|
||||
<JButton pd="30rpx" @HandleTouch="editExpand" pdTop="0">保存</JButton>
|
||||
</view>
|
||||
<SelectSex ref="sex" @selected="selectedSex" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue"
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app"
|
||||
import JHeaderTitle from "@/components/newComponents/JHeaderTitle/JHeaderTitle"
|
||||
import JMainCard from "@/components/newComponents/JMainCard/JMainCard"
|
||||
import JInput from "@/components/newComponents/JInput/JInput"
|
||||
import JButton from "@/components/newComponents/JButton/JButton"
|
||||
import SelectSex from "./components/SelectSex.vue"
|
||||
import { $devDetail, $editDev } from "@/http/apiManager.js"
|
||||
import { validateArray } from "@/hooks/rules" //校验函数
|
||||
import useStore from "@/hooks/useStore.js"
|
||||
const { getStore } = useStore()
|
||||
onLoad((options) => {
|
||||
console.log(options.id)
|
||||
if (options.id) return getInfo(options.id)
|
||||
})
|
||||
onShow(() => {
|
||||
if (getStore("team").teamId) {
|
||||
member.value.teamId = getStore("team").teamId
|
||||
member.value.teamName = getStore("team").teamName
|
||||
}
|
||||
})
|
||||
const sexList = reactive(["请选择拓展员性别", "男", "女"])
|
||||
const member = ref({})
|
||||
const sex = ref()
|
||||
const getInfo = (val) => {
|
||||
$devDetail(val).then(({ bizData }) => {
|
||||
member.value = bizData
|
||||
})
|
||||
}
|
||||
const editExpand = () => {
|
||||
if (validateArray(member.value)) {
|
||||
$editDev(member.value.sysUserId, member.value).then((res) => {
|
||||
uni.showToast({
|
||||
title: "保存成功",
|
||||
icon: "success|none",
|
||||
mask: true,
|
||||
})
|
||||
uni.navigateBack()
|
||||
})
|
||||
}
|
||||
}
|
||||
const selectedSex = (val) => {
|
||||
member.value.sex = val
|
||||
}
|
||||
const jumpPage = (url) => {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-wrapper {
|
||||
.place-text {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
font-size: 33rpx;
|
||||
color: #a6a6a6;
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
transform: translateX(20rpx);
|
||||
}
|
||||
}
|
||||
.selected-text {
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
.team-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image {
|
||||
width: 93rpx;
|
||||
height: 93rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
font-size: 33rpx;
|
||||
font-weight: 700;
|
||||
text {
|
||||
margin-top: 10rpx;
|
||||
font-size: 25rpx;
|
||||
font-weight: 500;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<view class="page-wrapper global-wrapper bgF2">
|
||||
<JHeaderTitle title="创建拓展员" bgColor="#f2f2f2" />
|
||||
<JMainCard pd="0" wrapPd="0 30rpx">
|
||||
<JInput
|
||||
v-model:value="member.realname"
|
||||
name="拓展员姓名"
|
||||
place="请输入拓展员姓名"
|
||||
:rules="{ name: 'realname', rule: 'REG_NotNUll' }"
|
||||
:isBorder="true"
|
||||
></JInput>
|
||||
<JInput
|
||||
v-model:value="member.userNo"
|
||||
name="拓展员编号"
|
||||
place="请输入拓展员编号"
|
||||
:rules="{ name: 'userNo', rule: 'REG_NotNUll' }"
|
||||
:isBorder="true"
|
||||
></JInput>
|
||||
<JInput name="拓展员性别" :isBorder="true">
|
||||
<view class="place-text" :class="{ 'selected-text': member.sex > 0 }" @tap="sex.open(member.sex)">
|
||||
{{ sexList[member.sex] }}
|
||||
<image src="/static/iconImg/right-arrow.svg" mode="scaleToFill" />
|
||||
</view>
|
||||
</JInput>
|
||||
<JInput
|
||||
v-model:value="member.loginUsername"
|
||||
name="登录名"
|
||||
place="字母开头6到18位"
|
||||
:rules="{ name: 'loginUsername', rule: 'REG_LoginName' }"
|
||||
:isBorder="true"
|
||||
></JInput>
|
||||
|
||||
<JInput
|
||||
v-model:value="member.telphone"
|
||||
name="拓展员手机号"
|
||||
place="请输入拓展员手机号"
|
||||
:rules="{ name: 'telphone', rule: 'REG_Phone' }"
|
||||
:isBorder="true"
|
||||
></JInput>
|
||||
<JInput name="拓展员状态" :isBorder="true">
|
||||
<view class="dis-wrapper">
|
||||
<text v-if="member.state">启用</text>
|
||||
<text v-else>禁用</text>
|
||||
<switch
|
||||
:checked="member.state == 1 ? true : false"
|
||||
@change="change($event, 'state')"
|
||||
style="margin-left: 15rpx; transform: scale(1.2)"
|
||||
color="#7737FE"
|
||||
/>
|
||||
</view>
|
||||
</JInput>
|
||||
</JMainCard>
|
||||
<JMainCard pd="0" wrapPd="30rpx">
|
||||
<view
|
||||
class="select-wrapper"
|
||||
@tap="jumpPage('/pageWork/SelectedList/SelectedList?title=team&&selected=' + member.teamId)"
|
||||
>
|
||||
<view class="select-mch" v-if="!member.teamId"> 请选择团队 </view>
|
||||
<view class="mch-info" v-else>
|
||||
<image src="/static/iconImg/expand-fill.svg" mode="scaleToFill" />
|
||||
<view
|
||||
>{{ member.teamName }} <text>{{ member.teamId }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<image src="/static/iconImg/right-arrow.svg" mode="scaleToFill" />
|
||||
</view>
|
||||
</JMainCard>
|
||||
<JMainCard pd="0" wrapPd="0 30rpx">
|
||||
<JInput name="是否发送开通提醒" :isBorder="true">
|
||||
<view class="dis-wrapper">
|
||||
<text v-if="member.isNotify">启用</text>
|
||||
<text v-else>禁用</text>
|
||||
<switch
|
||||
:checked="member.isNotify == 1 ? true : false"
|
||||
@change="change($event, 'isNotify')"
|
||||
style="margin-left: 15rpx; transform: scale(1.2)"
|
||||
color="#7737FE"
|
||||
/>
|
||||
</view>
|
||||
</JInput>
|
||||
<JInput name="是否使用默认密码" :isBorder="true">
|
||||
<view class="dis-wrapper">
|
||||
<switch
|
||||
:checked="member.defaultPass == 1 ? true : false"
|
||||
@change="change($event, 'defaultPass')"
|
||||
style="margin-left: 15rpx; transform: scale(1.2)"
|
||||
color="#7737FE"
|
||||
/>
|
||||
</view>
|
||||
</JInput>
|
||||
<JInput
|
||||
name="自定义密码"
|
||||
v-model:value="member.loginPassword"
|
||||
:rules="{ name: 'loginPassword', rule: 'REG_NotNUll' }"
|
||||
place="请输入自定义密码"
|
||||
v-if="!member.defaultPass == 1"
|
||||
></JInput>
|
||||
</JMainCard>
|
||||
<JButton pdTop="0" pd="30rpx 30rpx 50rpx" @HandleTouch="addMember">创建成员</JButton>
|
||||
<SelectSex ref="sex" @selected="selectedSex" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue"
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app"
|
||||
import { $addDev, $devDetail } from "@/http/apiManager.js"
|
||||
import { validateArray } from "@/hooks/rules" //校验函数
|
||||
import JHeaderTitle from "@/components/newComponents/JHeaderTitle/JHeaderTitle"
|
||||
import JMainCard from "@/components/newComponents/JMainCard/JMainCard"
|
||||
import JInput from "@/components/newComponents/JInput/JInput"
|
||||
import JButton from "@/components/newComponents/JButton/JButton"
|
||||
import SelectSex from "./components/SelectSex.vue"
|
||||
import useStore from "@/hooks/useStore.js"
|
||||
const { getStore, clearItem } = useStore()
|
||||
|
||||
onShow(() => {
|
||||
if (getStore("team").teamId) {
|
||||
member.value.teamId = getStore("team").teamId
|
||||
member.value.teamName = getStore("team").teamName
|
||||
clearItem("team")
|
||||
}
|
||||
})
|
||||
const member = ref({
|
||||
state: 1,
|
||||
isNotify: 0,
|
||||
defaultPass: 1,
|
||||
sex: 0,
|
||||
userType: 3,
|
||||
isTeamLeader: 0,
|
||||
})
|
||||
const sexList = reactive(["请选择拓展员性别", "男", "女"])
|
||||
const sex = ref()
|
||||
const change = (e, val) => {
|
||||
member.value[val] = e.detail.value ? 1 : 0
|
||||
}
|
||||
const selectedSex = (val) => {
|
||||
member.value.sex = val
|
||||
}
|
||||
const jumpPage = (url) => {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
})
|
||||
}
|
||||
const addMember = () => {
|
||||
if (validateArray(member.value)) {
|
||||
uni.showLoading({ title: "添加中..." })
|
||||
$addDev(member.value).then((res) => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: "新增成功", icon: "success" })
|
||||
uni.navigateBack()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-wrapper {
|
||||
.place-text {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
font-size: 33rpx;
|
||||
color: #a6a6a6;
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
transform: translateX(20rpx);
|
||||
}
|
||||
}
|
||||
.selected-text {
|
||||
color: #000;
|
||||
}
|
||||
.select-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
.select-mch {
|
||||
margin: 20rpx;
|
||||
}
|
||||
.mch-info {
|
||||
display: flex;
|
||||
image {
|
||||
width: 93rpx;
|
||||
height: 93rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 33rpx;
|
||||
font-weight: 700;
|
||||
text {
|
||||
margin-top: 15rpx;
|
||||
color: #8c8c8c;
|
||||
font-size: 25rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.img-wrapper {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
width: 93rpx;
|
||||
height: 93rpx;
|
||||
margin-right: 20rpx;
|
||||
image {
|
||||
width: 60rpx;
|
||||
height: 66rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<view class="page-wrapper global-wrapper bgF2">
|
||||
<JHeaderTitle :title="team.teamId ? '编辑团队' : '创建团队'" bgColor="#f2f2f2" />
|
||||
<JMainCard pd="0" wrapPd="0 30rpx">
|
||||
<JInput
|
||||
v-model:value="team.teamName"
|
||||
name="团队名称"
|
||||
place="请输入团队名称"
|
||||
:isBorder="true"
|
||||
:rules="{ name: 'teamName', rule: 'REG_NotNUll' }"
|
||||
></JInput>
|
||||
<JInput
|
||||
v-model:value="team.teamNo"
|
||||
name="团队编号"
|
||||
place="请输入团队编号"
|
||||
:rules="{ name: 'teamNo', rule: 'REG_NotNUll' }"
|
||||
:isBorder="true"
|
||||
></JInput>
|
||||
</JMainCard>
|
||||
<JMainCard wrapPd="30rpx" pd="0">
|
||||
<JInput name="备注" place="请输入团队备注" v-model:value="team.remark" :isBorder="true"> </JInput>
|
||||
</JMainCard>
|
||||
<JButton pd="0 30rpx 50rpx" @HandleTouch="addTeam">{{ team.teamId ? "保存" : "创建团队" }}</JButton>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue"
|
||||
import { $addTeam, $editTeam } from "@/http/apiManager.js"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import useStore from "@/hooks/useStore.js"
|
||||
const { getStore } = useStore()
|
||||
import JHeaderTitle from "@/components/newComponents/JHeaderTitle/JHeaderTitle"
|
||||
import JMainCard from "@/components/newComponents/JMainCard/JMainCard"
|
||||
import JInput from "@/components/newComponents/JInput/JInput"
|
||||
import JButton from "@/components/newComponents/JButton/JButton"
|
||||
import { validateArray } from "@/hooks/rules"
|
||||
onShow(() => {
|
||||
if (getStore("teamInfo")) {
|
||||
team.value = getStore("teamInfo")
|
||||
}
|
||||
})
|
||||
const team = ref({
|
||||
state: 1,
|
||||
statRangeType: "year",
|
||||
})
|
||||
const change = (val) => {
|
||||
team.value.state = val.detail.value ? 1 : 0
|
||||
}
|
||||
const addTeam = () => {
|
||||
if (team.value.teamId) return editTeam()
|
||||
if (validateArray(team.value)) {
|
||||
uni.showLoading({
|
||||
title: "创建中",
|
||||
mask: true,
|
||||
})
|
||||
$addTeam(team.value).then((res) => {
|
||||
uni.hideLoading()
|
||||
|
||||
uni.showToast({
|
||||
title: "创建成功",
|
||||
icon: "success",
|
||||
mask: true,
|
||||
})
|
||||
uni.navigateBack()
|
||||
})
|
||||
}
|
||||
}
|
||||
const editTeam = () => {
|
||||
if (validateArray(team.value)) {
|
||||
$editTeam(team.value).then((res) => {
|
||||
uni.showToast({
|
||||
title: "修改成功",
|
||||
icon: "success",
|
||||
mask: true,
|
||||
})
|
||||
uni.navigateBack()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user