源文件
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<view class="agent-wrapper" :style="{ padding: pd }">
|
||||
<view class="agent-left">
|
||||
<image :src="userImg" mode="scaleToFill" />
|
||||
<view class="agent-info" :style="{ color: nameColor, fontWeight: nameWeight }">
|
||||
{{ name }}
|
||||
<view :style="{ color: textColor }">{{ agentNo }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<image :src="arrowImg" mode="scaleToFill" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
userImg: {
|
||||
type: String,
|
||||
default: "/static/iconImg/user-white.svg",
|
||||
},
|
||||
arrowImg: {
|
||||
type: String,
|
||||
default: "/static/iconImg/right-arrow.svg",
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
},
|
||||
agentNo: {
|
||||
type: String,
|
||||
},
|
||||
pd: {
|
||||
type: String,
|
||||
},
|
||||
textColor: {
|
||||
type: String,
|
||||
},
|
||||
nameColor: {
|
||||
type: String,
|
||||
},
|
||||
nameWeight: {
|
||||
type: String,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.agent-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
.agent-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image {
|
||||
width: 82rpx;
|
||||
height: 82rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.agent-info {
|
||||
font-size: 28rpx;
|
||||
view {
|
||||
margin-top: 10rpx;
|
||||
font-size: 23rpx;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
}
|
||||
}
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<JPopup ref="popup" @onClose="onClose">
|
||||
<view class="list-wrapper">
|
||||
<view class="list-header">
|
||||
<view class="list-title">
|
||||
<image src="/static/iconImg/left-black.svg" mode="scaleToFill" @tap="popup.close()" />
|
||||
单个子代理商
|
||||
</view>
|
||||
<JSearchInput bgColor="#fff" wrapPd="0" @search="getAgentList" @resetSearch="resetSearch"></JSearchInput>
|
||||
</view>
|
||||
<scroll-view class="list-main" scroll-y @scrolltolower="getList">
|
||||
<block v-for="v in list" :key="v.text">
|
||||
<JLine v-bind="v" :isSelect="v.text == agentNo.text" @tap="selected(v)"></JLine>
|
||||
</block>
|
||||
<jeepayListNull :isShow="true" :list="list.length"></jeepayListNull>
|
||||
</scroll-view>
|
||||
<view class="list-footer">
|
||||
<JButton size="max" pdTop="0" @HandleTouch="confirm">确认</JButton>
|
||||
</view>
|
||||
</view>
|
||||
</JPopup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from "vue"
|
||||
import { $getAgentList } from "@/http/apiManager.js"
|
||||
import JPopup from "@/components/newComponents/JPopup/JPopup"
|
||||
import JLine from "@/components/newComponents/JLine/JLine"
|
||||
import JSearchInput from "@/components/newComponents/JSearchInput/JSearchInput"
|
||||
import JButton from "@/components/newComponents/JButton/JButton"
|
||||
import jeepayListNull from "@/components/jeepayListNull/jeepayListNull"
|
||||
onMounted(() => {
|
||||
getAgentList("")
|
||||
})
|
||||
const emits = defineEmits(["confirm"])
|
||||
const searchInfo = ref({
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
})
|
||||
let flag = true
|
||||
const list = ref([])
|
||||
const agentNo = ref({})
|
||||
const popup = ref()
|
||||
const open = (val) => {
|
||||
if (val) agentNo.value.text = val.agentNo
|
||||
popup.value.open()
|
||||
}
|
||||
const close = () => {
|
||||
popup.value.close()
|
||||
}
|
||||
const getAgentList = (val) => {
|
||||
if (val) {
|
||||
list.value = []
|
||||
searchInfo.value.unionAgentInfo = val
|
||||
}
|
||||
$getAgentList(searchInfo.value).then(({ bizData }) => {
|
||||
const { records } = bizData
|
||||
if (records.length <= 0) flag = false
|
||||
records.forEach((v) => {
|
||||
let obj = {
|
||||
iconOn: "/static/navImg/nav-dailishang.svg",
|
||||
iconClose: "/static/navImg/user-close.svg",
|
||||
ml: "30rpx",
|
||||
pd: "32rpx 32rpx 32rpx 0",
|
||||
}
|
||||
obj.name = v.agentName
|
||||
obj.text = v.agentNo
|
||||
list.value.push(obj)
|
||||
})
|
||||
})
|
||||
}
|
||||
const getList = () => {
|
||||
if (!flag) return
|
||||
searchInfo.value.pageNumber++
|
||||
getAgentList()
|
||||
}
|
||||
const resetSearch = () => {
|
||||
list.value = []
|
||||
searchInfo.value.unionAgentInfo = ""
|
||||
searchInfo.value.pageNumber = 1
|
||||
searchInfo.value.pageSize = 10
|
||||
getAgentList()
|
||||
}
|
||||
const selected = (v) => {
|
||||
agentNo.value = JSON.parse(JSON.stringify(v))
|
||||
}
|
||||
const confirm = () => {
|
||||
emits("confirm", agentNo.value)
|
||||
close()
|
||||
}
|
||||
defineExpose({ open, close })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.list-wrapper {
|
||||
padding-top: 30rpx;
|
||||
background-color: #ece8f0;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
.list-header {
|
||||
padding: 0 30rpx 30rpx 30rpx;
|
||||
.list-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-main {
|
||||
height: 500rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.list-footer {
|
||||
padding: 30rpx 0 50rpx 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<view class="o-c-wrapper">
|
||||
<image :src="imgObj[wayCodeType]" mode="scaleToFill" />
|
||||
<view class="o-c-info">
|
||||
<view class="i-top">
|
||||
¥{{ (amount / 100).toFixed(2) }}
|
||||
<view class="t-state" v-if="refundState == 1 || refundState == 2"
|
||||
><text class="s-spot" :style="{ backgroundColor: refundStateList[refundState].bgColor }"></text>
|
||||
{{ refundStateList[refundState].text }}</view
|
||||
>
|
||||
<view class="t-state" v-else
|
||||
><text class="s-spot" :style="{ backgroundColor: stateList[state].bgColor }"></text>
|
||||
{{ stateList[state].text }}</view
|
||||
>
|
||||
</view>
|
||||
<view class="i-time">{{ createdAt.split("-").join("/") }}</view>
|
||||
<view class="i-refund" v-if="refundState == 1 || refundState == 2">
|
||||
<view>退款¥{{ (refundAmount / 100).toFixed(2) }}</view>
|
||||
<view class="i-last">剩余¥{{ ((amount - refundAmount) / 100).toFixed(2) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref } from "vue"
|
||||
const props = defineProps({
|
||||
wayCodeType: { type: String }, //图片地址
|
||||
state: { type: Number }, //订单状态
|
||||
amount: { type: String }, //订单金额
|
||||
createdAt: { type: String }, //订单创建时间
|
||||
refundState: { type: String }, //退款状态 0 为退款 1部分退款 2全额退款
|
||||
refundAmount: { type: String }, //退款金额
|
||||
})
|
||||
const imgObj = reactive({
|
||||
WECHAT: "/static/orderImg/wechat.svg",
|
||||
ALIPAY: "/static/orderImg/zfb.svg",
|
||||
YSFPAY: "/static/orderImg/ysf.svg",
|
||||
UNIONPAY: "/static/orderImg/union-pay.svg",
|
||||
OTHER: "/static/orderImg/default-pay.svg",
|
||||
})
|
||||
const stateList = reactive([
|
||||
{
|
||||
text: "订单生成",
|
||||
bgColor: "#FFA900",
|
||||
},
|
||||
{
|
||||
text: "支付中",
|
||||
bgColor: "#FFA900",
|
||||
},
|
||||
{
|
||||
text: "支付成功",
|
||||
bgColor: "#175be6",
|
||||
},
|
||||
{
|
||||
text: "支付失败",
|
||||
bgColor: "#ff0000",
|
||||
},
|
||||
{
|
||||
text: "已撤销",
|
||||
bgColor: "",
|
||||
},
|
||||
{
|
||||
text: "已退款",
|
||||
bgColor: "",
|
||||
},
|
||||
{
|
||||
text: "订单关闭",
|
||||
bgColor: "#9EA5B3",
|
||||
},
|
||||
])
|
||||
const refundStateList = reactive([
|
||||
{},
|
||||
{
|
||||
text: "部分退款",
|
||||
bgColor: "#FD2821",
|
||||
},
|
||||
{
|
||||
text: "全额退款",
|
||||
bgColor: "#FD2821",
|
||||
},
|
||||
])
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.o-c-wrapper {
|
||||
display: flex;
|
||||
padding: 30rpx 0 0 30rpx;
|
||||
image {
|
||||
width: 93rpx;
|
||||
height: 93rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.o-c-info {
|
||||
flex: 1;
|
||||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
|
||||
.i-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 23rpx;
|
||||
font-weight: 900;
|
||||
.t-state {
|
||||
margin-right: 30rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
.s-spot {
|
||||
display: inline-block;
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
vertical-align: middle;
|
||||
margin-right: 10rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #06c05f;
|
||||
}
|
||||
}
|
||||
}
|
||||
.i-time {
|
||||
margin: 25rpx 0;
|
||||
font-size: 25rpx;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
.i-refund {
|
||||
display: flex;
|
||||
margin-bottom: 30rpx;
|
||||
font-size: 25rpx;
|
||||
.i-last {
|
||||
margin-left: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,328 @@
|
||||
<template>
|
||||
<JPopup ref="popup" @onOpen="emits('onOpen')" @onClose="emits('onClose')">
|
||||
<JMainCard pd="0" wrapPd="30rpx">
|
||||
<ScreenTitle bgColor="#7737FE" :list="timeList" bdR="20rpx 20rpx 0 0" :index="timeIndex.i" @search="search" />
|
||||
<view class="screen-wrapper">
|
||||
<view class="src-main bgF">
|
||||
<view class="select-wrapper bgF2" @tap="sAgent.open(agentInfo)">
|
||||
<view class="select-mch" v-if="agentInfo.text == '' || agentInfo.text == 'onlyOne'">
|
||||
<image src="/static/navImg/disable-dailishang.svg" mode="scaleToFill" /> {{ agentInfo.name }}
|
||||
</view>
|
||||
<view class="mch-info" v-else>
|
||||
<image src="/static/navImg/nav-dailishang.svg" mode="scaleToFill" />
|
||||
<view
|
||||
>{{ agentInfo.name }} <text>{{ agentInfo.text }}代理商</text>
|
||||
</view>
|
||||
</view>
|
||||
<image src="/static/iconImg/right-arrow.svg" mode="scaleToFill" />
|
||||
</view>
|
||||
<view class="select-wrapper select-agent bgF2" v-if="agentInfo.text == 'onlyOne'" @tap="sMch.open()">
|
||||
<view class="select-mch" v-if="!mchInfo.text">
|
||||
<image src="/static/iconImg/icon-selected-mch.svg" mode="scaleToFill" /> 全部子商户
|
||||
</view>
|
||||
<view class="mch-info" v-else>
|
||||
<image src="/static/equipmentImg/mch-list.svg" mode="scaleToFill" />
|
||||
<view
|
||||
>{{ mchInfo.name }} <text>{{ mchInfo.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<image src="/static/iconImg/right-arrow.svg" mode="scaleToFill" />
|
||||
</view>
|
||||
<view class="title">订单状态</view>
|
||||
<view class="order-wrapper">
|
||||
<block v-for="(v, i) in stateList" :key="i">
|
||||
<view class="order-item" :class="{ 'selected-state': stateIndex.includes(i) }" @tap="stateChange(v, i)">{{
|
||||
v
|
||||
}}</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="title">支付方式</view>
|
||||
<view class="order-wrapper">
|
||||
<block v-for="(v, i) in payList" :key="i">
|
||||
<view
|
||||
class="order-item"
|
||||
@tap="selectedPay(v.value, i)"
|
||||
:class="{
|
||||
'selected-state': payIndex.includes(v.value) && v.value,
|
||||
'selected-none': payList.length - 1 == i,
|
||||
}"
|
||||
>{{ v.text }}</view
|
||||
>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</JMainCard>
|
||||
<view class="scr-footer">
|
||||
<view @tap="reset">重置</view>
|
||||
<view class="confirm" @tap="confirm">确认筛选</view>
|
||||
</view>
|
||||
</JPopup>
|
||||
<selectMch ref="sMch" @confirm="mchConfirm" />
|
||||
<selectAgent ref="sAgent" @selected="agentSelected" @oneAgent="onAgent" />
|
||||
<AgentList ref="AList" @confirm="agentListC" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref, watch, watchEffect } from "vue"
|
||||
import JPopup from "@/components/newComponents/JPopup/JPopup"
|
||||
import ScreenTitle from "@/components/newComponents/ScreenTitle/ScreenTitle"
|
||||
import JMainCard from "@/components/newComponents/JMainCard/JMainCard"
|
||||
import selectMch from "./selectMch.vue"
|
||||
import selectAgent from "./selectAgent.vue"
|
||||
import AgentList from "./AgentList.vue"
|
||||
const emits = defineEmits(["confirm", "onOpen", "onClose"])
|
||||
|
||||
const timeList = reactive([
|
||||
{ value: "", text: "全部" },
|
||||
{ value: "today", text: "今天" },
|
||||
{ value: "yesterday", text: "昨天" },
|
||||
{ value: "currMonth", text: "本月" },
|
||||
{ value: "prevMonth", text: "上月" },
|
||||
{ value: "customer", text: "自定义" },
|
||||
])
|
||||
const payList = reactive([
|
||||
{ value: "WECHAT", text: "微信支付" },
|
||||
{ value: "ALIPAY", text: "支付宝" },
|
||||
{ value: "YSFPAY", text: "云闪付" },
|
||||
{ value: "UNIONPAY", text: "银联" },
|
||||
{ value: "OTHER", text: "其他" },
|
||||
{ value: "", text: "" },
|
||||
])
|
||||
const stateList = reactive(["订单生成", "支付中", "支付成功", "支付失败", "已撤销", "已退款", "订单关闭"])
|
||||
// 获取组件身上的方法
|
||||
const popup = ref(null)
|
||||
const sMch = ref(null)
|
||||
const sAgent = ref(null)
|
||||
const AList = ref(null)
|
||||
const index = ref("all")
|
||||
const stateIndex = ref([5, 2])
|
||||
const timeIndex = ref({ val: { text: "全部", value: "" }, i: 0 })
|
||||
const payIndex = ref([])
|
||||
// 商户详情
|
||||
const mchInfo = ref({})
|
||||
// 代理商详情
|
||||
const agentInfo = ref({ name: "我与全部子代理商", text: "" })
|
||||
|
||||
const search = (val) => {
|
||||
if (val.val.text == "自定义" && val.val.time) {
|
||||
val.val.value = val.val.time
|
||||
}
|
||||
timeIndex.value = val
|
||||
}
|
||||
const stateChange = (v, i) => {
|
||||
if (stateIndex.value.findIndex((val) => val == i) != -1) {
|
||||
stateIndex.value.splice(
|
||||
stateIndex.value.findIndex((val) => val == i),
|
||||
1
|
||||
)
|
||||
} else {
|
||||
stateIndex.value.push(i)
|
||||
}
|
||||
}
|
||||
const selectedPay = (v, i) => {
|
||||
if (payIndex.value.findIndex((val) => val == v) != -1) {
|
||||
payIndex.value.splice(
|
||||
payIndex.value.findIndex((val) => val == v),
|
||||
1
|
||||
)
|
||||
} else {
|
||||
if (v == "none") return
|
||||
payIndex.value.push(v)
|
||||
}
|
||||
}
|
||||
const open = (val) => {
|
||||
stateIndex.value = []
|
||||
payIndex.value = []
|
||||
val.forEach((v) => {
|
||||
switch (v.type) {
|
||||
case 0:
|
||||
stateIndex.value.push(v.value)
|
||||
break
|
||||
case 2:
|
||||
payIndex.value.push(v.value)
|
||||
break
|
||||
}
|
||||
})
|
||||
payIndex.value = val.find((v) => v.type == 2) ? payIndex.value : payList.map((v) => v.value)
|
||||
if (payIndex.value.findIndex((v) => !v) != -1) {
|
||||
payIndex.value.splice(
|
||||
payIndex.value.findIndex((v) => !v),
|
||||
1
|
||||
)
|
||||
}
|
||||
timeIndex.value = val.find((v) => v.type == 1)?.value ? timeIndex.value : { val: { text: "全部", value: "" }, i: 0 }
|
||||
stateIndex.value = stateIndex.value.length == 0 ? (stateIndex.value = [2, 5]) : stateIndex.value
|
||||
popup.value.open()
|
||||
}
|
||||
// 选择商户回调
|
||||
const mchConfirm = (val) => {
|
||||
mchInfo.value = val
|
||||
confirm()
|
||||
}
|
||||
// 选择代理商回调
|
||||
const agentSelected = (val) => {
|
||||
agentInfo.value = val
|
||||
confirm()
|
||||
}
|
||||
// 列表选择回调
|
||||
const agentListC = (val) => {
|
||||
agentInfo.value = val
|
||||
confirm()
|
||||
}
|
||||
const confirm = () => {
|
||||
const list = []
|
||||
stateIndex.value.forEach((v) => {
|
||||
list.push({
|
||||
text: stateList[v],
|
||||
value: v,
|
||||
type: 0,
|
||||
})
|
||||
})
|
||||
list.push({
|
||||
text:
|
||||
timeIndex.value.val.text == "自定义"
|
||||
? timeIndex.value.val.value.split("_")[1] + "/" + timeIndex.value.val.value.split("_")[2]
|
||||
: timeIndex.value.val.text,
|
||||
value: timeIndex.value.val.value,
|
||||
type: 1,
|
||||
})
|
||||
|
||||
payIndex.value.forEach((v) => {
|
||||
list.push({
|
||||
text: payList.find((val) => val.value === v).text,
|
||||
value: v,
|
||||
type: 2,
|
||||
})
|
||||
})
|
||||
emits("confirm", { data: list, mch: mchInfo.value.text, agent: agentInfo.value.text })
|
||||
popup.value.close()
|
||||
sAgent.value.close()
|
||||
}
|
||||
// 重置 数据
|
||||
const reset = () => {
|
||||
timeIndex.value = { val: { text: "全部", value: "" }, i: 0 }
|
||||
stateIndex.value = [5, 2]
|
||||
payIndex.value = payList.map((v) => v.value)
|
||||
payIndex.value.splice(payIndex.value.length - 1, 1)
|
||||
agentInfo.value = { text: "", name: "我与全部子代理商" }
|
||||
mchInfo.value = { text: "", name: "全部商户" }
|
||||
}
|
||||
const onAgent = (val) => {
|
||||
AList.value.open(val)
|
||||
}
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.screen-wrapper {
|
||||
height: calc(100vh - 700rpx);
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.selected {
|
||||
padding: 20rpx;
|
||||
border-radius: 7rpx;
|
||||
color: $primaryColor;
|
||||
background-color: #fff;
|
||||
}
|
||||
.src-main {
|
||||
padding: 30rpx;
|
||||
.select-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
.select-mch {
|
||||
margin: 20rpx;
|
||||
image {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
.select-agent {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.title {
|
||||
margin: 35rpx 0 20rpx 0;
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.order-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
view {
|
||||
flex: 0 0 32%;
|
||||
padding: 20rpx 0;
|
||||
margin-bottom: 15rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #f2f2f2;
|
||||
border-radius: 10rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
.selected-state {
|
||||
border: 2rpx solid $primaryColor;
|
||||
color: $primaryColor;
|
||||
}
|
||||
.selected-none {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
.scr-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 30rpx 75rpx 30rpx;
|
||||
font-size: 33rpx;
|
||||
view {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 31rpx;
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.confirm {
|
||||
margin-left: 20rpx;
|
||||
color: $primaryColor;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<JPopup ref="popup">
|
||||
<JMainCard pd="0" wrapPd=" 0 30rpx ">
|
||||
<block v-for="(v, i) in list" :key="i">
|
||||
<JLine :name="v.name" :isSelect="v.text == index.text" :isBorder="true" @tap="agentChange(v)"></JLine>
|
||||
</block>
|
||||
<view class="search-agent" @tap="emits('oneAgent', childrenAgent)">
|
||||
<JInput name="选择代理商" :image="true" :isBorder="true" v-if="!index.text || index.text == 'onlyOne'">
|
||||
<image src="/static/iconImg/icon-right-jiantou.svg" mode="scaleToFill" />
|
||||
</JInput>
|
||||
<AgentCard v-else v-bind="childrenAgent" pd="30rpx"></AgentCard>
|
||||
</view>
|
||||
</JMainCard>
|
||||
<JButton size="max" bgColor="#f2f2f2" color="#000" pdTop="0" @HandleTouch="popup.close()">取消</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 JInput from "@/components/newComponents/JInput/JInput"
|
||||
import JButton from "@/components/newComponents/JButton/JButton"
|
||||
import AgentCard from "./AgentCArd"
|
||||
const emits = defineEmits(["selected", "oneAgent"])
|
||||
const list = reactive([
|
||||
{
|
||||
name: "我与全部子代理商",
|
||||
text: "",
|
||||
},
|
||||
{
|
||||
name: "仅我自己",
|
||||
text: "onlyOne",
|
||||
},
|
||||
{
|
||||
name: "单个子代理商",
|
||||
text: "one",
|
||||
},
|
||||
])
|
||||
const agentList = ref()
|
||||
const index = ref("")
|
||||
const popup = ref()
|
||||
const childrenAgent = ref({
|
||||
userImg: "/static/iconImg/user-theme.svg",
|
||||
nameColor: "#000",
|
||||
textColor: "#8C8C8C",
|
||||
nameWeight: "700",
|
||||
})
|
||||
const open = (val) => {
|
||||
const value = JSON.parse(JSON.stringify(val))
|
||||
if (value.text && value.text != "onlyOne") {
|
||||
childrenAgent.value.name = value.name
|
||||
childrenAgent.value.agentNo = value.text
|
||||
index.value.text = "one"
|
||||
}
|
||||
index.value = value
|
||||
popup.value.open()
|
||||
}
|
||||
const agentChange = (val) => {
|
||||
if (!val.text || val.text != "one") {
|
||||
index.value = val
|
||||
emits("selected", val)
|
||||
} else {
|
||||
emits("oneAgent", val)
|
||||
}
|
||||
close()
|
||||
}
|
||||
const close = () => {
|
||||
popup.value.close()
|
||||
}
|
||||
defineExpose({ open, close })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.search-agent {
|
||||
margin: 0 30rpx 30rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #f2f2f2;
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<JPopup ref="popup" @onClose="onClose">
|
||||
<view class="list-wrapper">
|
||||
<view class="list-header">
|
||||
<view class="list-title">
|
||||
<image src="/static/iconImg/left-black.svg" mode="scaleToFill" @tap="popup.close()" />
|
||||
单个商户
|
||||
</view>
|
||||
<JSearchInput
|
||||
bgColor="#fff"
|
||||
wrapPd="0"
|
||||
@search="getAgentList"
|
||||
place="请搜索商户名,用户号,联系人手机号"
|
||||
@resetSearch="resetSearch"
|
||||
></JSearchInput>
|
||||
</view>
|
||||
<scroll-view class="list-main" scroll-y @scrolltolower="getList">
|
||||
<JLine
|
||||
iconOn="/static/navImg/nav-shangdian.svg"
|
||||
iconClose="/static/navImg/disable-shangdian.svg"
|
||||
ml="30rpx"
|
||||
pd="32rpx 32rpx 32rpx 0"
|
||||
text="全部"
|
||||
name="全部商户"
|
||||
:isSelect="agentNo.text === ''"
|
||||
@tap="selected({ text: '' })"
|
||||
></JLine>
|
||||
<block v-for="v in list" :key="v.text">
|
||||
<JLine v-bind="v" :isSelect="agentNo.text === v.text" @tap="selected(v)"></JLine>
|
||||
</block>
|
||||
<jeepayListNull :isShow="true" :list="list.length"></jeepayListNull>
|
||||
</scroll-view>
|
||||
<view class="list-footer">
|
||||
<JButton size="max" pdTop="0" @HandleTouch="confirm">确认</JButton>
|
||||
</view>
|
||||
</view>
|
||||
</JPopup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from "vue"
|
||||
import { $getMerList } from "@/http/apiManager.js"
|
||||
import JPopup from "@/components/newComponents/JPopup/JPopup"
|
||||
import JLine from "@/components/newComponents/JLine/JLine"
|
||||
import JSearchInput from "@/components/newComponents/JSearchInput/JSearchInput"
|
||||
import JButton from "@/components/newComponents/JButton/JButton"
|
||||
import jeepayListNull from "@/components/jeepayListNull/jeepayListNull"
|
||||
onMounted(() => {
|
||||
getAgentList("")
|
||||
})
|
||||
const emits = defineEmits(["confirm"])
|
||||
const searchInfo = ref({
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
})
|
||||
let flag = true
|
||||
const list = ref([])
|
||||
const agentNo = ref({})
|
||||
const popup = ref()
|
||||
const open = (val) => {
|
||||
if (val) agentNo.value.text = val.agentNo
|
||||
popup.value.open()
|
||||
}
|
||||
const close = () => {
|
||||
popup.value.close()
|
||||
}
|
||||
const getAgentList = (val) => {
|
||||
if (val) {
|
||||
list.value = []
|
||||
searchInfo.value.unionMchInfo = val
|
||||
}
|
||||
$getMerList(searchInfo.value).then(({ bizData }) => {
|
||||
const { records } = bizData
|
||||
if (records.length <= 0) flag = false
|
||||
records.forEach((v) => {
|
||||
let obj = {
|
||||
iconOn: "/static/navImg/nav-shangdian.svg",
|
||||
iconClose: "/static/navImg/disable-shangdian.svg",
|
||||
ml: "30rpx",
|
||||
pd: "32rpx 32rpx 32rpx 0",
|
||||
}
|
||||
obj.name = v.mchName
|
||||
obj.text = v.mchNo
|
||||
list.value.push(obj)
|
||||
})
|
||||
})
|
||||
}
|
||||
const getList = () => {
|
||||
if (!flag) return
|
||||
searchInfo.value.pageNumber++
|
||||
getAgentList()
|
||||
}
|
||||
const resetSearch = () => {
|
||||
list.value = []
|
||||
searchInfo.value.unionMchInfo = ""
|
||||
searchInfo.value.pageNumber = 1
|
||||
searchInfo.value.pageSize = 10
|
||||
getAgentList()
|
||||
}
|
||||
const selected = (v) => {
|
||||
agentNo.value = v
|
||||
}
|
||||
const confirm = () => {
|
||||
emits("confirm", agentNo.value)
|
||||
close()
|
||||
}
|
||||
defineExpose({ open, close })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.list-wrapper {
|
||||
padding-top: 30rpx;
|
||||
background-color: #ece8f0;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
.list-header {
|
||||
padding: 0 30rpx 30rpx 30rpx;
|
||||
.list-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-main {
|
||||
height: 500rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.list-footer {
|
||||
padding: 30rpx 0 50rpx 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user