Compare commits
20 Commits
db467815dd
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 62c6b755af | |||
| 71bec03475 | |||
| ca182dc325 | |||
| 000f715bd8 | |||
| 9991248b08 | |||
| c607155734 | |||
| fdc939b0b7 | |||
| da125b0238 | |||
| 6e66f9138d | |||
| 527cfcdcf8 | |||
| 5d28477db9 | |||
| 92c3a45049 | |||
| 042dacec98 | |||
| ed8be8a16a | |||
| 3b19d58f27 | |||
| c95ab6fda5 | |||
| 084084c008 | |||
| d3aab47dad | |||
| 1516fefb2c | |||
| 98c7908417 |
@@ -1,10 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
import { Account_BaseUrl } from "@/api/config";
|
||||
import { Account_BaseUrl, Order_BaseUrl } from "@/api/config";
|
||||
const baseURL = Account_BaseUrl + "/admin/shopMerchant";
|
||||
const orderURL = Order_BaseUrl + "/admin/shopMerchant";
|
||||
const API = {
|
||||
get(shopId: string | number) {
|
||||
return request({
|
||||
url: `${baseURL}`,
|
||||
url: `${orderURL}`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: shopId
|
||||
@@ -14,7 +15,7 @@ const API = {
|
||||
edit(shopId: string | number, data: shopMerchantType) {
|
||||
delete data.id
|
||||
return request({
|
||||
url: `${baseURL}`,
|
||||
url: `${orderURL}`,
|
||||
method: "put",
|
||||
data: { ...data, shopId },
|
||||
});
|
||||
|
||||
@@ -71,7 +71,16 @@ const API = {
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
},
|
||||
// 导出
|
||||
export(params: any) {
|
||||
return request({
|
||||
url: `${baseURL}/export`,
|
||||
method: "get",
|
||||
params,
|
||||
responseType: 'blob'
|
||||
});
|
||||
},
|
||||
}
|
||||
export default API;
|
||||
export interface getRequest {
|
||||
|
||||
@@ -125,3 +125,42 @@ export const queryEntry = (params: Object) => {
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户支付信息获取
|
||||
* @data { params }
|
||||
* @returns
|
||||
*/
|
||||
export const shopMerchantGet = (params: Object) => {
|
||||
return request<any, any[]>({
|
||||
url: `/order/admin/shopMerchant`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户支付信息修改 修改聚合支付信息
|
||||
* @data { params }
|
||||
* @returns
|
||||
*/
|
||||
export const shopMerchantPut = (data: Object) => {
|
||||
return request<any, any[]>({
|
||||
url: `/order/admin/shopMerchant`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前店铺的主店进件信息
|
||||
* @data { params }
|
||||
* @returns
|
||||
*/
|
||||
export const getMainMerchant = (params: Object) => {
|
||||
return request<any, any[]>({
|
||||
url: `/order/admin/shopMerchant/getMainMerchant`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export function searchstorestatus(type) {
|
||||
return request_php({
|
||||
method: "post",
|
||||
headers: {
|
||||
clint_type: type
|
||||
'ClintType': type
|
||||
},
|
||||
url: "/meituan/searchstorestatus"
|
||||
});
|
||||
@@ -79,7 +79,7 @@ export function getuisdk(data) {
|
||||
return request_php({
|
||||
method: "post",
|
||||
headers: {
|
||||
clint_type: 2
|
||||
'ClintType': 2
|
||||
},
|
||||
url: "/douyin/getuisdk",
|
||||
data,
|
||||
@@ -214,7 +214,7 @@ export function thirdPartyCoupon_bindUrl(data) {
|
||||
return request_php({
|
||||
method: "post",
|
||||
headers: {
|
||||
clint_type: 1
|
||||
'ClintType': 1
|
||||
},
|
||||
url: "/meituan/getuisdkurl",
|
||||
data,
|
||||
|
||||
@@ -801,6 +801,68 @@ export function attendanceDetail(params) {
|
||||
});
|
||||
}
|
||||
|
||||
// 分享奖励基础:新增/修改
|
||||
export function shareBasePost(data) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/shareBase`,
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 分享奖励基础 查询
|
||||
export function shareBaseGet(params) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/shareBase`,
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 轮播图配置:新增/修改
|
||||
export function shareCarouselPost(data) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/carousel`,
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 分享轮播图配置
|
||||
export function shareCarouselGet(params) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/carousel`,
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 分享 轮播图配置 删除
|
||||
export function shareCarouselDel(id) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/carousel/${id}`,
|
||||
method: 'DELETE'
|
||||
});
|
||||
}
|
||||
|
||||
// 全民股东群聊 配置信息获取
|
||||
export function disGroupGet(params) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/disGroup`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 全民股东群聊:新增/修改
|
||||
export function disGroupPost(data) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/disGroup`,
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ export type statusType =
|
||||
| "done"
|
||||
| "refunding"
|
||||
| "refund"
|
||||
| "part-refund"
|
||||
| "part_refund"
|
||||
| "cancelled"
|
||||
| "";
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Order_BaseUrl } from "@/api/config";
|
||||
const baseURL = Order_BaseUrl + "/pay";
|
||||
const Api = {
|
||||
// h5支付
|
||||
|
||||
h5Pay(data: h5PayRequest) {
|
||||
return request<any>({
|
||||
url: `${baseURL}/h5Pay`,
|
||||
@@ -67,7 +66,6 @@ const Api = {
|
||||
params
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
export default Api;
|
||||
|
||||
@@ -26,7 +26,6 @@ const Api = {
|
||||
method: "get",
|
||||
params,
|
||||
responseType: 'blob'
|
||||
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
34
src/components/selectCoupon/index.vue
Normal file
34
src/components/selectCoupon/index.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<el-select v-model="modelValue" placeholder="请选择优惠券" clearable style="width: 300px;" @change="changHandle">
|
||||
<el-option v-for="coupon in couponList" :key="coupon.id" :label="coupon.title" :value="coupon.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
<script setup>
|
||||
import couponApi from "@/api/market/coupon";
|
||||
import { ref, onMounted } from "vue";
|
||||
|
||||
const modelValue = defineModel({
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
});
|
||||
|
||||
const name = defineModel('name', {
|
||||
type: String,
|
||||
default: ''
|
||||
});
|
||||
|
||||
function changHandle(value) {
|
||||
name.value = couponList.value.find(item => item.id === value)?.title || '';
|
||||
}
|
||||
|
||||
// 优惠券列表
|
||||
const couponList = ref([]);
|
||||
|
||||
onMounted(() => {
|
||||
couponApi.getList({ size: 999 }).then((res) => {
|
||||
if (res) {
|
||||
couponList.value = res.records || [];
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -111,8 +111,16 @@ export function downloadFile(obj: BlobPart, name: string, suffix: string, useUni
|
||||
const link = document.createElement("a");
|
||||
link.style.display = "none";
|
||||
link.href = url;
|
||||
const newFilename = useUnix ? (parseTime(new Date(), undefined) + "-") : '' + name.trim()
|
||||
const fileName = newFilename + "." + suffix;
|
||||
// 期望行为:
|
||||
// - 当 useUnix 为 true 且传入 name 时:`${timestamp}-${name}`
|
||||
// - 当 useUnix 为 true 且 name 为空时:仅 `${timestamp}`(不带多余的 `-`)
|
||||
// - 当 useUnix 为 false:使用传入的 name(如为空则回退到时间戳)
|
||||
const safeName = (name || "").trim();
|
||||
const timeStamp = parseTime(new Date(), undefined);
|
||||
const fileBase = useUnix
|
||||
? (safeName ? `${timeStamp}-${safeName}` : timeStamp)
|
||||
: (safeName || timeStamp);
|
||||
const fileName = fileBase + "." + suffix;
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
@@ -91,7 +91,7 @@ service.interceptors.response.use(
|
||||
return;
|
||||
}
|
||||
ElMessage.error(formatErrorMsg(msg || "Error"));
|
||||
return Promise.reject(new Error(formatErrorMsg(msg || "Error")));
|
||||
return Promise.reject(response.data);
|
||||
},
|
||||
async (error: any) => {
|
||||
|
||||
|
||||
@@ -311,13 +311,14 @@ const longTime = ref('2099-12-31')
|
||||
const wxProvinceCode = ref('')
|
||||
|
||||
// 获取进件详情
|
||||
async function getDetailAjax(shopId: string, licenceNo: string) {
|
||||
async function getDetailAjax(shopId: string) {
|
||||
try {
|
||||
const res: any = await entryManagerDetail({
|
||||
shopId: shopId,
|
||||
licenceNo: licenceNo
|
||||
shopId: shopId
|
||||
})
|
||||
if (res && res.shopId) {
|
||||
form.value = res
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
@@ -325,8 +326,6 @@ async function getDetailAjax(shopId: string, licenceNo: string) {
|
||||
|
||||
// 获取containerDomInfo信息
|
||||
function getContainerDomInfo() {
|
||||
console.log('getContainerDomInfo');
|
||||
|
||||
containerDomInfo.value = containerRef.value?.getBoundingClientRect() ?? {}
|
||||
}
|
||||
|
||||
@@ -336,14 +335,18 @@ onMounted(() => {
|
||||
getContainerDomInfo()
|
||||
window.addEventListener('resize', debouncedCheckWidth)
|
||||
|
||||
const type = route.query.type
|
||||
const shopId: string = String(route.query.shopId ?? '')
|
||||
const licenceNo: string = String(route.query.licenceNo ?? '')
|
||||
if (shopId && licenceNo) {
|
||||
formType.value = 'editor'
|
||||
getDetailAjax(shopId, licenceNo)
|
||||
|
||||
if (shopId) {
|
||||
getDetailAjax(shopId)
|
||||
}
|
||||
|
||||
if (licenceNo && type && type == 'editor') {
|
||||
formType.value = 'editor'
|
||||
}
|
||||
|
||||
const type = route.query.type
|
||||
if (type && type == 'check') {
|
||||
formType.value = 'check'
|
||||
}
|
||||
|
||||
@@ -70,11 +70,11 @@ const env = process.env.NODE_ENV
|
||||
// DEV-START
|
||||
const accountList = reactive([
|
||||
{ username: "admin", type: 'primary', label: 'admin' },
|
||||
{ username: "19191703856", type: 'warning', label: '喜气洋洋' },
|
||||
{ username: "18049104914", type: 'warning', label: '东风的店铺' },
|
||||
{ username: "19107220837", type: 'danger', label: '快乐时光店铺' },
|
||||
{ username: "18199991111", type: 'success', label: '草莓加盟主店可直接管理' },
|
||||
{ username: "18821670757", type: 'primary', label: '强盛集团' },
|
||||
{ username: "19112345678", type: 'danger', label: '酸橘子·云贵小馆' },
|
||||
// { username: "18199991111", type: 'success', label: '草莓加盟主店可直接管理' },
|
||||
{ username: "18821670757", type: 'success', label: '高歌的小店' },
|
||||
{ username: "191123456", type: 'primary', label: '酸橘子' },
|
||||
]);
|
||||
|
||||
// 快捷模拟登录
|
||||
|
||||
@@ -32,10 +32,10 @@ export const newMenus = [
|
||||
intro: '协助商家拉来新客户,拓展客户群体',
|
||||
childrenList: [
|
||||
{
|
||||
name: "分销",
|
||||
name: "全民股东",
|
||||
icon: "zhcz",
|
||||
pathName: "distribution_page",
|
||||
intro: "用户成为业务员,可促进消费"
|
||||
intro: "用户成为股东,可促进消费"
|
||||
},
|
||||
{
|
||||
name: "套餐推广",
|
||||
@@ -55,6 +55,12 @@ export const newMenus = [
|
||||
pathName: "group_booking",
|
||||
intro: "拼团"
|
||||
},
|
||||
{
|
||||
name: "分享配置",
|
||||
icon: "sppt",
|
||||
pathName: "share_setting",
|
||||
intro: "商家可配置用户分享后可获得的奖励"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,290 @@
|
||||
<template>
|
||||
<div class="form_content">
|
||||
<div class="left">
|
||||
<div class="new_preview">
|
||||
<div class="header">{{ shopInfo.shopName }}</div>
|
||||
<div class="content">
|
||||
<div class="title">{{ form.title }}</div>
|
||||
<div class="img_wrap">
|
||||
<div class="img">
|
||||
<el-image :src="form.groupUrl" style="width: 100%;height: 100%;border-radius: 4px;"></el-image>
|
||||
</div>
|
||||
</div>
|
||||
<div class="intro">
|
||||
{{ form.content }}
|
||||
</div>
|
||||
<div class="foot">
|
||||
{{ defaultNote }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-position="right" label-width="120px">
|
||||
<el-form-item label="群二维码" prop="groupUrl">
|
||||
<single-image-upload style="width: 120px; height: 120px" v-model="form.groupUrl"></single-image-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="模块标题" prop="title">
|
||||
<el-input :placeholder="defaultTitle" :maxlength="15" v-model.trim="form.title"
|
||||
style="width: 300px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="模块内容">
|
||||
<el-input type="textarea" :rows="4" :maxlength="20" show-word-limit placeholder="请输入内容"
|
||||
v-model.trim="form.content" style="width: 300px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="模块提示语">
|
||||
<div class="tips">{{ defaultNote }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态">
|
||||
<el-switch v-model="form.isEnable" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="loading" @click="submitHandle">保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ElNotification } from 'element-plus'
|
||||
import { disGroupGet, disGroupPost } from '@/api/coupon/index'
|
||||
|
||||
const defaultTitle = ref('扫码进群,优惠多多')
|
||||
const defaultNote = ref('如果长按不能识别,可截图或保存二维码图片至相册,通过微信扫码入群')
|
||||
const defaultContent = ref('长按识别上方企微好友码,添加【福利官】')
|
||||
const shopInfo = ref('')
|
||||
|
||||
const form = ref({
|
||||
id: '',
|
||||
groupUrl: '',
|
||||
title: defaultTitle.value,
|
||||
content: defaultContent.value,
|
||||
isEnable: 1,
|
||||
})
|
||||
|
||||
const rules = reactive({
|
||||
groupUrl: [
|
||||
{
|
||||
required: true,
|
||||
message: '请上传群二维码',
|
||||
triiger: 'change'
|
||||
}
|
||||
],
|
||||
title: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入模块标题',
|
||||
triiger: 'change'
|
||||
}
|
||||
],
|
||||
content: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入内容',
|
||||
triiger: 'change'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
// 开始提交
|
||||
const formRef = ref(null)
|
||||
const emits = defineEmits(["success"]);
|
||||
const loading = ref(false);
|
||||
function submitHandle() {
|
||||
formRef.value.validate(async (valid) => {
|
||||
try {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
|
||||
let data = { ...form.value }
|
||||
|
||||
if (data.title == '') {
|
||||
data.title = defaultTitle.value
|
||||
}
|
||||
|
||||
if (data.content == '') {
|
||||
data.content = defaultContent.value
|
||||
}
|
||||
|
||||
await disGroupPost(data);
|
||||
ElNotification({
|
||||
title: '注意',
|
||||
message: '保存成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 获取配置信息
|
||||
async function drainageConfigGetAjax() {
|
||||
try {
|
||||
const res = await disGroupGet()
|
||||
form.value = res
|
||||
if (form.value.title == '') {
|
||||
form.value.title = defaultTitle.value
|
||||
}
|
||||
if (form.value.content == '') {
|
||||
form.value.content = defaultContent.value
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
shopInfo.value = JSON.parse(localStorage.getItem('userInfo'))
|
||||
drainageConfigGetAjax()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.form_content {
|
||||
padding: 14px 0 0;
|
||||
display: flex;
|
||||
|
||||
.left {
|
||||
width: 374px;
|
||||
height: 720px;
|
||||
position: relative;
|
||||
background: url('https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/3/7da616a1c56a409dbdea8bf2f41cf14b.png') no-repeat center center / 100% 100%;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.preview {
|
||||
width: 350px;
|
||||
height: 130px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: #fff;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 14px;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 5px 0;
|
||||
|
||||
.top {
|
||||
flex: 1;
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.btm {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.img_wrap {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.new_preview {
|
||||
--bg: #3F3B37;
|
||||
--color: #F6DFC4;
|
||||
--borderColor: #f6dfc45b;
|
||||
width: 90%;
|
||||
background-color: var(--bg);
|
||||
border-radius: 4px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
color: var(--color);
|
||||
height: 50px;
|
||||
border-bottom: 1px dashed var(--borderColor);
|
||||
}
|
||||
|
||||
.content {
|
||||
padding-bottom: 14px;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
color: var(--color);
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.img_wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.img {
|
||||
--size: 220px;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
}
|
||||
}
|
||||
|
||||
.intro {
|
||||
height: 40px;
|
||||
font-size: 14px;
|
||||
color: var(--color);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 14px;
|
||||
}
|
||||
|
||||
.foot {
|
||||
height: 40px;
|
||||
color: var(--borderColor);
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 14px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -135,8 +135,8 @@
|
||||
<span class="required">*</span>分成比例
|
||||
</div>
|
||||
<div class="ipt">
|
||||
<el-input v-model="item.levelOneCommission" placeholder="请输入" :maxlength="5"
|
||||
style="width: 200px;" @input="e => item.levelOneCommission = filterNumberInput(e)">
|
||||
<el-input v-model="item.commission" placeholder="请输入" :maxlength="5" style="width: 200px;"
|
||||
@input="e => item.commission = filterNumberInput(e)">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</div>
|
||||
@@ -204,7 +204,7 @@ const levelConfigListObj = ref({
|
||||
name: '', // 名称
|
||||
inviteCount: '', // 有效人数
|
||||
costAmount: '', // 消费金额
|
||||
levelOneCommission: '', // 一级分销比例
|
||||
commission: '', // 一级分销比例
|
||||
levelTwoCommission: '', // 二级分销比例
|
||||
})
|
||||
const form = ref({
|
||||
@@ -281,7 +281,7 @@ const rules = ref({
|
||||
callback(new Error(tips))
|
||||
return
|
||||
}
|
||||
if (item.levelOneCommission === '' || item.levelOneCommission == 0) {
|
||||
if (item.commission === '' || item.commission == 0) {
|
||||
tips = `请输入${index + 1}级的分成比例`
|
||||
callback(new Error(tips))
|
||||
return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="gyq_container">
|
||||
<div class="gyq_content">
|
||||
<HeaderCard name="分销" intro="用户成为业务员,可促进消费" icon="xffx" showSwitch v-model:isOpen="form.isEnable">
|
||||
<HeaderCard name="全民股东" intro="用户成为股东,可促进消费" icon="xffx" showSwitch v-model:isOpen="form.isEnable">
|
||||
</HeaderCard>
|
||||
<div class="tips">
|
||||
<el-alert title="请记得前往《分销明细》充值余额,余额不足时用户收益将无法正常入账" type="primary" show-icon :closable="false" />
|
||||
@@ -18,6 +18,8 @@
|
||||
<activation_record key="activationRecord" v-if="tabActiveIndex == 2" />
|
||||
<!-- 分销明细 -->
|
||||
<distribution_details key="distributionDetails" v-if="tabActiveIndex == 3" />
|
||||
<!-- 股东管理群 -->
|
||||
<groupSetting name="groupSetting" key="groupSetting" v-if="tabActiveIndex == 4" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,6 +32,7 @@ import setting from "./components/setting.vue";
|
||||
import distributor from "./components/distributor.vue";
|
||||
import activation_record from "./components/activation_record.vue";
|
||||
import distribution_details from "./components/distribution_details.vue";
|
||||
import groupSetting from "./components/groupSetting.vue";
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { distributionGet, distributionPut } from '@/api/coupon'
|
||||
|
||||
@@ -53,6 +56,10 @@ const tabList = ref([
|
||||
label: '分销明细',
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
label: '股东管理群',
|
||||
value: 3
|
||||
},
|
||||
])
|
||||
|
||||
const form = ref({
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '添加'" width="800px" v-model="visible" @closed="resetForm">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px" label-position="left">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入轮播图名称" :maxlength="20" style="width: 300px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="轮播图片" prop="imageUrl">
|
||||
<div class="column">
|
||||
<div class="center">
|
||||
<SingleImageUpload v-model="form.imageUrl" />
|
||||
</div>
|
||||
<div class="tips" style="margin-bottom: 8px;">建议尺寸:750x300像素,支持jpg、png、gif格式,大小不超过2MB</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可分享" prop="isShareable">
|
||||
<div class="column">
|
||||
<div>
|
||||
<el-radio-group v-model="form.isShareable">
|
||||
<el-radio label="开启" :value="1"></el-radio>
|
||||
<el-radio label="关闭" :value="0"></el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class="tips">开启时,用户端会显示单独的分享按钮</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="跳转页面" prop="jumpPageId">
|
||||
<linkCard :includes-names="includesNames" v-model="form.jumpPageId" v-model:extendParam="form.extendParam" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序值" prop="sort">
|
||||
<el-input v-model="form.sort" @input="e => form.sort = filterNumberInput(e, 1)" style="width: 300px;"
|
||||
placeholder="排序值越大越靠前"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-radio-group v-model="form.isEnabled">
|
||||
<el-radio label="启用" :value="1"></el-radio>
|
||||
<el-radio label="禁用" :value="0"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm" :loading="loading">确 定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import _ from 'lodash';
|
||||
import { ref } from 'vue';
|
||||
import { filterNumberInput } from '@/utils';
|
||||
import SingleImageUpload from '@/components/Upload/SingleImageUpload.vue';
|
||||
import linkCard from './linkCard.vue';
|
||||
import { shareCarouselPost } from '@/api/coupon/index.js';
|
||||
|
||||
const visible = ref(false);
|
||||
const loading = ref(false);
|
||||
const formObj = ref({
|
||||
id: '', // 轮播图ID,编辑时传递
|
||||
name: '', // 轮播图名称(20字内)
|
||||
imageUrl: '', // 轮播图片地址
|
||||
isShareable: 1, // 是否可分享 1=开启 0=关闭
|
||||
jumpPageId: '', // 跳转页面 tb_mini_app_pages的 id
|
||||
extendParam: '', // 扩展参数
|
||||
sort: '', // 排序值,数值越大越靠前
|
||||
isEnabled: 1, // 是否启用 1=启用 0=禁用
|
||||
});
|
||||
const form = ref(_.cloneDeep(formObj.value));
|
||||
function resetForm() {
|
||||
form.value = _.cloneDeep(formObj.value);
|
||||
}
|
||||
const formRef = ref(null);
|
||||
const rules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入轮播图名称', trigger: 'blur' }
|
||||
],
|
||||
imageUrl: [
|
||||
{ required: true, message: '请上传轮播图片', trigger: 'change' }
|
||||
],
|
||||
jumpPageId: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (form.value.jumpPageId && _.includes(includesNames.value.map(item => item.id), form.value.jumpPageId)) {
|
||||
if (!form.value.extendParam) {
|
||||
callback(new Error('请选择具体菜品'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: '请输入排序值', trigger: 'blur' }
|
||||
],
|
||||
}
|
||||
|
||||
const includesNames = ref([
|
||||
{
|
||||
id: '4',
|
||||
name: '套餐推广商品详情页'
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: '商品拼团详情页'
|
||||
},
|
||||
{
|
||||
id: '10',
|
||||
name: '点餐商品详情弹窗页'
|
||||
},
|
||||
{
|
||||
id: '12',
|
||||
name: '积分商品详情页面'
|
||||
}
|
||||
]);
|
||||
|
||||
function submitForm() {
|
||||
console.log(form.value);
|
||||
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
shareCarouselPostAjax();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const emits = defineEmits(['success']);
|
||||
|
||||
// 轮播图配置:新增/修改
|
||||
async function shareCarouselPostAjax() {
|
||||
try {
|
||||
loading.value = true;
|
||||
await shareCarouselPost(form.value);
|
||||
ElNotification({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
emits('success');
|
||||
visible.value = false;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function show(obj) {
|
||||
visible.value = true;
|
||||
if (obj && obj.id) {
|
||||
form.value = _.cloneDeep(obj)
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.center {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="row">
|
||||
<el-form :model="queryForm" inline>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Plus" @click="AddBannerRef.show()">添加</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="queryForm.isShareable" style="width: 150px;">
|
||||
<el-option label="全部" :value="''" />
|
||||
<el-option label="开启" :value="1" />
|
||||
<el-option label="关闭" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="queryForm.isEnabled" style="width: 150px;">
|
||||
<el-option label="全部" :value="''" />
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="禁用" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="queryForm.name" placeholder="请输入名称搜索" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" :loading="tableData.loading" @click="queryHandle">搜索</el-button>
|
||||
<el-button icon="Refresh" :loading="tableData.loading" @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-table :data="tableData.list" border stripe v-loading="tableData.loading">
|
||||
<el-table-column label="ID" prop="id"></el-table-column>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="图片" prop="imageUrl">
|
||||
<template v-slot="scope">
|
||||
<el-image :src="scope.row.imageUrl" style="width: 50px;height: 50px;"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="分享" prop="isShareable">
|
||||
<template v-slot="scope">
|
||||
<span v-if="scope.row.isShareable == 1">开启</span>
|
||||
<span v-else>关闭</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="启用状态" prop="isEnabled">
|
||||
<template v-slot="scope">
|
||||
<el-tag v-if="scope.row.isEnabled == 1" type="primary" disable-transitions>已启用</el-tag>
|
||||
<el-tag v-if="scope.row.isEnabled == 0" type="info" disable-transitions>已禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序值" prop="sort"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" width="200"></el-table-column>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template v-slot="scope">
|
||||
<el-button link type="primary" @click="AddBannerRef.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确认要删除吗?" @confirm="deleteHandle(scope.row)">
|
||||
<template #reference>
|
||||
<el-button type="danger" link>删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<AddBanner @success="queryHandle" ref="AddBannerRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import AddBanner from './add_banner.vue';
|
||||
import { shareCarouselGet, shareCarouselDel } from '@/api/coupon/index.js';
|
||||
|
||||
const AddBannerRef = ref(null);
|
||||
|
||||
const queryForm = ref({
|
||||
name: '',
|
||||
isShareable: '', // 是否可分享 1=开启 0=关闭
|
||||
isEnabled: '', // 是否启用 1=启用 0=禁用
|
||||
})
|
||||
|
||||
const tableData = ref({
|
||||
loading: false,
|
||||
list: []
|
||||
})
|
||||
|
||||
// 搜索
|
||||
function queryHandle() {
|
||||
getTableData();
|
||||
}
|
||||
|
||||
// 重置
|
||||
function resetHandle() {
|
||||
queryForm.value = {
|
||||
name: '',
|
||||
isShareable: '',
|
||||
isEnabled: '',
|
||||
};
|
||||
queryHandle();
|
||||
}
|
||||
|
||||
// 轮播图配置
|
||||
async function getTableData() {
|
||||
try {
|
||||
tableData.value.loading = true;
|
||||
const res = await shareCarouselGet(queryForm.value);
|
||||
tableData.value.list = res;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
tableData.value.loading = false;
|
||||
}
|
||||
|
||||
// 删除轮播图配置
|
||||
async function deleteHandle(row) {
|
||||
try {
|
||||
await shareCarouselDel(row.id);
|
||||
getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getTableData();
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.row {
|
||||
&.mt14 {
|
||||
margin-top: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
213
src/views/marketing_center/share_setting/components/linkCard.vue
Normal file
213
src/views/marketing_center/share_setting/components/linkCard.vue
Normal file
@@ -0,0 +1,213 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-select v-model="jumpPageId" style="width: 300px;" placeholder="请选择跳转页面" @change="jumpPageIdChange">
|
||||
<el-option v-for="item in miniPageList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
<div class="tips">选填,轮播图点击后跳转的目标页面</div>
|
||||
<el-select v-model="goodsId" style="width: 300px;" placeholder="请选择具体菜品,可搜索" clearable filterable remote
|
||||
:remote-method="remoteMethod" :loading="loading" v-if="jumpPageId && isIncludeFlag" @change="goodsIdChange">
|
||||
<el-option v-for="item in goodsList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import _ from 'lodash';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import { pointsGoodsPage } from '@/api/points/index.js'
|
||||
import API from '@/views/application/list/advertisement/indexconfig/api';
|
||||
import { packageGet, getGbWarePage } from '@/api/market/ware'
|
||||
import productApi from '@/api/product';
|
||||
|
||||
const props = defineProps({
|
||||
includesNames: {
|
||||
type: Array,
|
||||
default: () => ([])
|
||||
}
|
||||
});
|
||||
|
||||
const jumpPageId = defineModel({
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
});
|
||||
|
||||
const jumpPageName = ref('');
|
||||
const isIncludeFlag = ref(false);
|
||||
|
||||
function checkIsInclude() {
|
||||
// 增加边界判断:避免includesNames为空或item.id不存在导致的错误
|
||||
if (!jumpPageId.value || !Array.isArray(props.includesNames) || props.includesNames.length === 0) {
|
||||
return false;
|
||||
}
|
||||
// 提取id数组并判断包含关系
|
||||
const idList = props.includesNames.map(item => item?.id); // 可选链避免item.id不存在
|
||||
return _.includes(idList, jumpPageId.value);
|
||||
}
|
||||
|
||||
watch(jumpPageId, async (newVal, oldVal) => {
|
||||
if (newVal) {
|
||||
await nextTick()
|
||||
watchJumpPageIdChange(newVal)
|
||||
}
|
||||
}, {
|
||||
immediate: true, // 可选:首次加载时立即执行一次(根据需求决定)
|
||||
deep: false // 无需深度监听,因为值是String/Number
|
||||
})
|
||||
|
||||
const miniPageList = ref([]);
|
||||
|
||||
// 获取小程序跳转页面列表
|
||||
async function getList() {
|
||||
try {
|
||||
const res = await API.miniAppPagesPage({ page: 1, size: 999 });
|
||||
miniPageList.value = res.records;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
function jumpPageIdChange(value) {
|
||||
goodsId.value = '';
|
||||
extendParam.value = ''
|
||||
jumpPageName.value = miniPageList.value.find(item => item.id == value)?.name || '';
|
||||
// 清空具体菜品选择
|
||||
if (checkIsInclude()) {
|
||||
isIncludeFlag.value = true;
|
||||
getGoodsList()
|
||||
} else {
|
||||
isIncludeFlag.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// watch监听jumpPageId变化
|
||||
async function watchJumpPageIdChange(value) {
|
||||
if (miniPageList.value.length === 0) {
|
||||
await getList()
|
||||
}
|
||||
// 清空具体菜品选择
|
||||
if (checkIsInclude()) {
|
||||
jumpPageName.value = miniPageList.value.find(item => item.id == value)?.name || '';
|
||||
isIncludeFlag.value = true;
|
||||
getGoodsList()
|
||||
} else {
|
||||
isIncludeFlag.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const loading = ref(false);
|
||||
const goodsList = ref([]); // 具体菜品列表
|
||||
const goodsId = defineModel('goodsId', {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
});
|
||||
const extendParam = defineModel('extendParam', {
|
||||
type: String,
|
||||
default: ''
|
||||
});
|
||||
|
||||
// 监听extendParam的变化,解析并赋值给goodsId
|
||||
watch(extendParam, async (newExtendParam, oldExtendParam) => {
|
||||
// console.log('extendParam变化:', newExtendParam);
|
||||
|
||||
// 1. 空值判断:如果extendParam为空,重置goodsId
|
||||
if (!newExtendParam) {
|
||||
goodsId.value = '';
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 解析字符串:匹配goodsId=xxx的格式
|
||||
// 正则表达式说明:匹配goodsId=后接任意字符(非空),直到字符串结束或遇到&等分隔符
|
||||
const reg = /goodsId=([^&]+)/;
|
||||
const matchResult = newExtendParam.match(reg);
|
||||
|
||||
// 3. 提取值并赋值:匹配成功则赋值,否则重置
|
||||
if (matchResult && matchResult[1]) {
|
||||
let extractedGoodsId = matchResult[1];
|
||||
|
||||
// 尝试将 id 转为数字(如果看起来像数字)以保持与后端 id 类型一致
|
||||
const numeric = Number(extractedGoodsId);
|
||||
const parsedId = !Number.isNaN(numeric) ? numeric : extractedGoodsId;
|
||||
|
||||
// 确保 options 已加载,这样 el-select 能根据 value 匹配到对应的 label
|
||||
try {
|
||||
await getGoodsList();
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
// 统一使用字符串类型的 id 以保证与 options 中的 value 匹配
|
||||
goodsId.value = String(parsedId);
|
||||
} else {
|
||||
goodsId.value = ''; // 匹配失败时清空
|
||||
}
|
||||
}, {
|
||||
immediate: true, // 初始加载时立即执行一次解析
|
||||
deep: false // 字符串是基本类型,无需深度监听
|
||||
});
|
||||
|
||||
// 具体菜品选择变化
|
||||
function goodsIdChange(value) {
|
||||
// 设置扩展参数,处理清空情况以避免出现 'undefined'
|
||||
if (value === null || typeof value === 'undefined' || value === '') {
|
||||
extendParam.value = '';
|
||||
goodsId.value = '';
|
||||
return;
|
||||
}
|
||||
|
||||
extendParam.value = `goodsId=${value}`;
|
||||
}
|
||||
|
||||
function remoteMethod(value) {
|
||||
getGoodsList(value);
|
||||
}
|
||||
|
||||
// 获取商品咧白哦
|
||||
async function getGoodsList(value = '') {
|
||||
try {
|
||||
// 获取套餐列表
|
||||
loading.value = true;
|
||||
let list = [];
|
||||
if (jumpPageName.value == '套餐推广商品详情页') {
|
||||
const res = await packageGet({ page: 1, size: 999, packageName: value });
|
||||
list = res.records.map(item => ({
|
||||
id: String(item.id),
|
||||
name: item.packageName
|
||||
}));
|
||||
} else if (jumpPageName.value == '商品拼团详情页') {
|
||||
const res = await getGbWarePage({ page: 1, size: 999, wareName: value });
|
||||
list = res.records.map(item => ({
|
||||
id: String(item.id),
|
||||
name: item.wareName
|
||||
}));
|
||||
} else if (jumpPageName.value == '点餐商品详情弹窗页') {
|
||||
const res = await productApi.getPage({ name: value });
|
||||
list = res.records.map(item => ({
|
||||
id: String(item.id),
|
||||
name: item.name
|
||||
}));
|
||||
} else if (jumpPageName.value == '积分商品详情页面') {
|
||||
const res = await pointsGoodsPage({ page: 1, size: 999 });
|
||||
list = res.records.map(item => ({
|
||||
id: String(item.id),
|
||||
name: item.goodsName
|
||||
}));
|
||||
}
|
||||
goodsList.value = list;
|
||||
loading.value = false;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.tips {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
135
src/views/marketing_center/share_setting/components/setting.vue
Normal file
135
src/views/marketing_center/share_setting/components/setting.vue
Normal file
@@ -0,0 +1,135 @@
|
||||
<template>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="160px" label-position="left">
|
||||
<el-form-item label="功能开启">
|
||||
<el-switch v-model="form.isEnabled" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="可获得奖励的分享" prop="rewardSharePages">
|
||||
<el-checkbox-group v-model="form.rewardSharePages">
|
||||
<el-checkbox :label="item.label" :value="item.value" v-for="item in typesList" :key="item.value"></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<div class="header">分享人可获得奖励</div>
|
||||
<el-form-item label="选择优惠券" prop="sharerCouponId">
|
||||
<SelectCoupon v-model="form.sharerCouponId" v-model:name="form.sharerCouponName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单次获得优惠券数量" prop="sharerCouponNum">
|
||||
<el-input v-model="form.sharerCouponNum" placeholder="请输入数量"
|
||||
@input="e => form.sharerCouponNum = filterNumberInput(e, 1)" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="可获得奖励次数">
|
||||
<el-radio-group v-model="form.rewardTimesType">
|
||||
<el-radio label="仅1次" :value="1"></el-radio>
|
||||
<el-radio label="每次分享成功" :value="2"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div class="header">被分享人可获得奖励</div>
|
||||
<el-form-item label="选择优惠券">
|
||||
<SelectCoupon v-model="form.sharedUserCouponId" v-model:name="form.sharedUserCouponName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单次获得优惠券数量">
|
||||
<el-input v-model="form.sharedUserCouponNum" placeholder="请输入数量"
|
||||
@input="e => form.sharedUserCouponNum = filterNumberInput(e, 1)" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="获得奖励时是否弹窗">
|
||||
<el-radio-group v-model="form.isSharedUserPopup">
|
||||
<el-radio label="是" :value="1"></el-radio>
|
||||
<el-radio label="否" :value="0"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm">保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import _ from 'lodash'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import typesList from '../data.js'
|
||||
import SelectCoupon from '@/components/selectCoupon/index.vue'
|
||||
import { filterNumberInput } from '@/utils/index.js'
|
||||
import { shareBasePost, shareBaseGet } from '@/api/coupon/index.js'
|
||||
|
||||
const formRef = ref(null)
|
||||
const form = ref({
|
||||
isEnabled: 0,
|
||||
rewardSharePages: [], // 可获得奖励的分享页面,用逗号分隔 typesList
|
||||
sharerCouponId: '', // 分享人可获得的优惠券ID
|
||||
sharerCouponName: '', // 分享人可获得的优惠券名称
|
||||
sharerCouponNum: '', // 分享人可获得的优惠券数量
|
||||
rewardTimesType: 1, // 可获得奖励次数 1=仅1次 2=每次分享成功
|
||||
sharedUserCouponId: '', // 被分享人可获得的优惠券ID
|
||||
sharedUserCouponName: '', // 被分享人可获得的优惠券名称
|
||||
sharedUserCouponNum: '', // 被分享人可获得的优惠券数量
|
||||
isSharedUserPopup: 1, // 被分享人获得奖励时是否弹窗 1=是 0=否
|
||||
})
|
||||
|
||||
const rules = {
|
||||
rewardSharePages: [
|
||||
{ required: true, message: '请选择可获得奖励的分享', trigger: 'change' }
|
||||
],
|
||||
sharerCouponId: [
|
||||
{ required: true, message: '请选择优惠券', trigger: 'change' }
|
||||
],
|
||||
sharerCouponNum: [
|
||||
{ required: true, message: '请输入单次获得优惠券数量', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
|
||||
function submitForm() {
|
||||
console.log(form.value);
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
console.log('提交表单', form.value)
|
||||
shareBasePostAjax()
|
||||
} else {
|
||||
console.log('表单验证失败')
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 分享奖励基础:新增/修改
|
||||
async function shareBasePostAjax() {
|
||||
try {
|
||||
const data = _.cloneDeep(form.value);
|
||||
data.rewardSharePages = data.rewardSharePages.join(',');
|
||||
await shareBasePost(data);
|
||||
ElNotification({
|
||||
title: '成功',
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 分享奖励基础 查询
|
||||
async function shareBaseGetAjax() {
|
||||
try {
|
||||
const res = await shareBaseGet();
|
||||
if (res) {
|
||||
form.value = { ...form.value, ...res };
|
||||
form.value.rewardSharePages = res.rewardSharePages ? res.rewardSharePages.split(',') : [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 初始化数据
|
||||
shareBaseGetAjax();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.header {
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
</style>
|
||||
38
src/views/marketing_center/share_setting/data.js
Normal file
38
src/views/marketing_center/share_setting/data.js
Normal file
@@ -0,0 +1,38 @@
|
||||
export default [
|
||||
{
|
||||
label: '店铺首页',
|
||||
value: 'index'
|
||||
},
|
||||
// {
|
||||
// label: '我的',
|
||||
// value: 'dine'
|
||||
// },
|
||||
{
|
||||
label: '点餐页',
|
||||
value: 'eat'
|
||||
},
|
||||
{
|
||||
label: '点餐页-详情',
|
||||
value: 'eat-detail'
|
||||
},
|
||||
{
|
||||
label: '套餐推广-列表',
|
||||
value: 'pp-list'
|
||||
},
|
||||
{
|
||||
label: '套餐推广-详情',
|
||||
value: 'pp-detail'
|
||||
},
|
||||
{
|
||||
label: '商品拼团-列表',
|
||||
value: 'gb-list'
|
||||
},
|
||||
{
|
||||
label: '商品拼团-详情',
|
||||
value: 'gb-detail'
|
||||
},
|
||||
{
|
||||
label: '全民股东',
|
||||
value: 'dis'
|
||||
}
|
||||
]
|
||||
56
src/views/marketing_center/share_setting/index.vue
Normal file
56
src/views/marketing_center/share_setting/index.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div class="gyq_container">
|
||||
<div class="gyq_content">
|
||||
<HeaderCard name="分享配置" intro="商家可配置用户分享后可获得的奖励" icon="sppt">
|
||||
</HeaderCard>
|
||||
<div class="row mt14">
|
||||
<tabHeader v-model="tabActiveIndex" :list="tabList" />
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<!-- 基础设置 -->
|
||||
<setting key="setting" name="setting" v-if="tabActiveIndex == 0" />
|
||||
<!-- 点餐页轮播图 -->
|
||||
<bannerSetting key="bannerSetting" name="bannerSetting" v-if="tabActiveIndex == 1" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import HeaderCard from "../components/headerCard.vue";
|
||||
import tabHeader from "../components/tabHeader.vue";
|
||||
import setting from "./components/setting.vue";
|
||||
import bannerSetting from "./components/banner_setting.vue";
|
||||
|
||||
const tabActiveIndex = ref(0)
|
||||
|
||||
const tabList = ref([
|
||||
{
|
||||
label: '基础设置',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '点餐页轮播图',
|
||||
value: 1
|
||||
},
|
||||
])
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.gyq_container {
|
||||
padding: 14px;
|
||||
|
||||
.gyq_content {
|
||||
padding: 14px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
&.mt14 {
|
||||
margin-top: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -233,7 +233,7 @@ import shopExtendApi from "@/api/account/shopExtend";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableActive: "",
|
||||
tableActive: "index_bg",
|
||||
tableData: [],
|
||||
selectItem: {},
|
||||
imageUrl: "",
|
||||
@@ -248,7 +248,10 @@ export default {
|
||||
methods: {
|
||||
// 刷新列表数据
|
||||
async doSubmit() {
|
||||
this.selectItem.value = JSON.stringify(this.imgList)
|
||||
// console.log('this.selectItem.value', this.selectItem.value);
|
||||
// return
|
||||
|
||||
// this.selectItem.value = JSON.stringify(this.imgList)
|
||||
await shopExtendApi.edit({
|
||||
...this.selectItem,
|
||||
autokey: this.selectItem.autoKey,
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="query.payType" placeholder="支付类型">
|
||||
<el-option label="微信支付" value="wechatPay" />
|
||||
<el-option label="支付宝支付" value="aliPay" />
|
||||
<el-option label="微信支付" value="WECHAT" />
|
||||
<el-option label="支付宝支付" value="ALIPAY" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -135,11 +135,11 @@ export default {
|
||||
},
|
||||
payTypes: [
|
||||
{
|
||||
value: "wechatPay",
|
||||
value: "WECHAT",
|
||||
label: "微信支付"
|
||||
},
|
||||
{
|
||||
value: "aliPay",
|
||||
value: "ALIPAY",
|
||||
label: "支付宝支付"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="item">
|
||||
<div class="t">订单类型</div>
|
||||
<div class="b">
|
||||
{{ sendTypeFilter(detail.sendType) }}
|
||||
{{ sendTypeFilter(detail.dineMode) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,12 +46,12 @@
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="t">下单时间</div>
|
||||
<div class="b">{{ timeFilter(detail.createdAt) }}</div>
|
||||
<div class="b">{{ timeFilter(detail.createTime) }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="t">支付时间</div>
|
||||
<div class="b">
|
||||
{{ timeFilter(detail.createdAt) }}
|
||||
{{ timeFilter(detail.paidTime) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -51,15 +51,15 @@ export default {
|
||||
label: "快递",
|
||||
},
|
||||
{
|
||||
key: "takeaway",
|
||||
key: "take-away",
|
||||
label: "外卖",
|
||||
},
|
||||
{
|
||||
key: "takeself",
|
||||
key: "take-out",
|
||||
label: "自提",
|
||||
},
|
||||
{
|
||||
key: "table",
|
||||
key: "dine-in",
|
||||
label: "堂食",
|
||||
},
|
||||
],
|
||||
|
||||
@@ -7,7 +7,7 @@ export const statusOptions: statusOptions[] = [
|
||||
{ label: "订单完成", value: "done" },
|
||||
{ label: "申请退单", value: "refunding" },
|
||||
{ label: "退单", value: "refund" },
|
||||
{ label: "部分退单", value: "part-refund" },
|
||||
{ label: "部分退单", value: "part_refund" },
|
||||
{ label: "取消订单", value: "cancelled" },
|
||||
];
|
||||
|
||||
@@ -78,6 +78,7 @@ export const options: { [key in optionsType]: options[] } = {
|
||||
{ label: '支付宝小程序', value: 'ALI' },
|
||||
{ label: '收银机客户端', value: 'PC' },
|
||||
{ label: '收款码', value: 'H5' },
|
||||
{ label: 'PAD点餐宝', value: 'PAD' },
|
||||
],
|
||||
sendType: [
|
||||
{ label: '快递', value: 'post' },
|
||||
|
||||
@@ -183,7 +183,6 @@ import editModalConfig from "./indexconfig/edit";
|
||||
import searchConfig from "./indexconfig/search";
|
||||
import MyDialog from "@/components/mycomponents/myDialog.vue";
|
||||
import Statistics from "./indexconfig/statistics.vue";
|
||||
import { min } from "lodash";
|
||||
|
||||
const {
|
||||
searchRef,
|
||||
@@ -242,13 +241,17 @@ if (isSyncStatus()) {
|
||||
contentConfig.cols[contentConfig.cols.length - 1].operat[2].hidden = false;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
console.log(route.query);
|
||||
if (route.query.id) {
|
||||
contentRef.value?.fetchPageData({ id: route.query.id });
|
||||
}
|
||||
// 获取耗材列表
|
||||
gethaocaiList();
|
||||
|
||||
const res = await UserAPI.getPage()
|
||||
form.warnLine = res.warnLine || ''
|
||||
// console.log('contentRef.value===', res);
|
||||
});
|
||||
|
||||
function newHandleQueryClick(e: IObject | undefined) {
|
||||
|
||||
@@ -75,11 +75,10 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||
{
|
||||
icon: "edit",
|
||||
text: "库存预警",
|
||||
type: "info",
|
||||
type: "danger",
|
||||
name: "custom1",
|
||||
auth: "import",
|
||||
},
|
||||
|
||||
],
|
||||
cols: [
|
||||
// { type: "selection", width: 50, align: "center" },
|
||||
|
||||
@@ -245,8 +245,8 @@ const tableData = reactive({
|
||||
// 支付方式类型
|
||||
function payTypeFilter(t) {
|
||||
const m = {
|
||||
wechatPay: '微信支付',
|
||||
aliPay: '支付宝支付'
|
||||
WECHAT: '微信支付',
|
||||
ALIPAY: '支付宝支付'
|
||||
}
|
||||
return m[t]
|
||||
}
|
||||
|
||||
@@ -1,156 +1,110 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" :show-close="false" @close="reset">
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="聚合支付" name="pay">
|
||||
<el-form ref="form" :model="form" label-width="120px" label-position="left">
|
||||
<el-form-item label="店铺id">
|
||||
<el-input v-model="form.storeId" placeholder="请输入店铺id"></el-input>
|
||||
<div class="row mt14">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<el-form-item label="店铺ID" prop="storeId">
|
||||
<el-input v-model="form.storeId" placeholder="请输入店铺ID" :style="inputStyle"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户名称">
|
||||
<el-input v-model="form.merchantName" placeholder="请输入支付系统商户名称"></el-input>
|
||||
<el-form-item label="商户名称" prop="merchantName">
|
||||
<el-input v-model="form.merchantName" placeholder="请输入商户名称" :style="inputStyle"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户应用id">
|
||||
<el-input v-model="form.appId" placeholder="请输入商户应用id"></el-input>
|
||||
<el-form-item label="appId" prop="appId">
|
||||
<el-input v-model="form.appId" placeholder="请输入appId" :style="inputStyle"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户密钥">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.appSecret"
|
||||
placeholder="请输入商户密钥"
|
||||
></el-input>
|
||||
<el-form-item label="appSecret" prop="appSecret">
|
||||
<el-input type="textarea" :rows="4" v-model="form.appSecret" placeholder="请输入appSecret"
|
||||
:style="inputStyle"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付密码">
|
||||
<el-input v-model="form.payPassword" placeholder="请输入支付密码"></el-input>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitHandle" v-loading="loading">保存</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信appid">
|
||||
<el-input
|
||||
v-model="form.wechatSmallAppid"
|
||||
placeholder="请输入微信小程序appid"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付宝appid">
|
||||
<el-input
|
||||
v-model="form.alipaySmallAppid"
|
||||
placeholder="请输入支付宝小程序appid"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="支付宝商户号">
|
||||
<el-input v-model="form.alipayAppId" placeholder="请输入支付宝商户号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付宝商户密钥">
|
||||
<el-input v-model="form.alipayAppToken" placeholder="请输入支付宝商户密钥"></el-input>
|
||||
</el-form-item> -->
|
||||
|
||||
<!-- <el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio :value="1">启用</el-radio>
|
||||
<el-radio :value="-1">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="close">取消</el-button>
|
||||
<el-button type="primary" @click="submitHandle" :loading="formLoading">
|
||||
<span v-if="!formLoading">保存</span>
|
||||
<span v-else>保存中...</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { tbMerchantThirdApply, tbMerchantThirdApplyPut } from "@/api/shop";
|
||||
import ShopApi from "@/api/account/shop";
|
||||
import shopMerchantApi from "@/api/account/shopMerchant";
|
||||
import { ElNotification } from "element-plus";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
activeName: "pay",
|
||||
formLoading: false,
|
||||
form: {
|
||||
appSecret: "",
|
||||
id: "",
|
||||
payPassword: "",
|
||||
status: 1,
|
||||
appId: "",
|
||||
wechatSmallAppid: "",
|
||||
storeId: "",
|
||||
alipaySmallAppid: "",
|
||||
alipayAppToken: "",
|
||||
alipayAppId: "",
|
||||
},
|
||||
shopId: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 保存
|
||||
async submitHandle() {
|
||||
this.formLoading = true;
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { shopMerchantPut } from '@/api/common'
|
||||
|
||||
const inputStyle = {
|
||||
width: '500px'
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
detail: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const formRef = ref(null)
|
||||
|
||||
const form = defineModel({
|
||||
storeId: '',
|
||||
merchantName: '',
|
||||
appId: '',
|
||||
appSecret: '',
|
||||
})
|
||||
|
||||
const rules = ref({
|
||||
storeId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入店铺ID',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
merchantName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入店铺名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
appId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入appId',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
appSecret: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入appSecret',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
// 验证表单
|
||||
function submitHandle() {
|
||||
formRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
shopMerchantPostAjax()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 更新聚合支付
|
||||
const loading = ref(false)
|
||||
async function shopMerchantPostAjax() {
|
||||
try {
|
||||
await shopMerchantApi.edit(this.shopId, this.form);
|
||||
this.$emit("success");
|
||||
this.formLoading = false;
|
||||
loading.value = true
|
||||
const res = await shopMerchantPut({
|
||||
shopId: route.query.shopId,
|
||||
polyMerchantDTO: form.value
|
||||
})
|
||||
ElNotification({
|
||||
title: "成功",
|
||||
message: `修改成功`,
|
||||
type: "success",
|
||||
});
|
||||
this.close();
|
||||
title: '注意',
|
||||
message: '更新成功',
|
||||
type: 'success'
|
||||
})
|
||||
} catch (error) {
|
||||
this.formLoading = false;
|
||||
console.log(error);
|
||||
console.log('shopMerchantPostAjax=', error);
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
reset() {
|
||||
this.form.appSecret = "";
|
||||
this.form.id = "";
|
||||
this.form.payPassword = "";
|
||||
this.form.status = 1;
|
||||
this.form.appId = "";
|
||||
this.shopId = "";
|
||||
},
|
||||
// 详情(配置三方支付)
|
||||
async getDetail(id) {
|
||||
console.log(id);
|
||||
this.shopId = id;
|
||||
try {
|
||||
const res = await shopMerchantApi.get(id);
|
||||
this.form.appSecret = res.appSecret || "";
|
||||
this.form.payPassword = res.payPassword || "";
|
||||
this.form.status = res.status || "";
|
||||
this.form.appId = res.appId || "";
|
||||
this.form.wechatSmallAppid = res.wechatSmallAppid || "";
|
||||
this.form.alipaySmallAppid = res.alipaySmallAppid || "";
|
||||
this.form.merchantName = res.merchantName || "";
|
||||
//this.form.alipayAppToken = res.alipayAppToken
|
||||
//this.form.alipayAppId = res.alipayAppId
|
||||
this.form.storeId = res.storeId || "";
|
||||
this.dialogVisible = true;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
loading.value = false
|
||||
}
|
||||
},
|
||||
show(obj) {
|
||||
if (obj && obj.id) {
|
||||
this.form.id = obj.id;
|
||||
this.getDetail(obj.id);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
:deep(.el-dialog__header) {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
325
src/views/shop/list/components/payStatusCard.vue
Normal file
325
src/views/shop/list/components/payStatusCard.vue
Normal file
@@ -0,0 +1,325 @@
|
||||
<template>
|
||||
<div class="row mt14">
|
||||
<el-form label-width="150" label-position="left" v-loading="loading">
|
||||
<el-form-item label="信息来源" v-if="isHeadShop != 1">
|
||||
<el-radio-group :model-value="typeValue" @change="typeValueChange">
|
||||
<el-radio label="进件信息" :value="route.query.shopId"></el-radio>
|
||||
<el-radio label="复用主店信息" :value="route.query.mainId" v-if="mainInfo && mainInfo.shopId"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<template v-if="!form.shopId">
|
||||
<el-form-item label-width="0">
|
||||
<el-text>您还未申请进件</el-text>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0">
|
||||
<el-button type="primary" @click="toApplyment">去申请</el-button>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-form-item label="商户号">
|
||||
<el-text>{{ form.merchantCode }}</el-text>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户类型">
|
||||
<el-text>{{ userTypeListFilter(form.userType).label }}</el-text>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付宝进件状态">
|
||||
<div class="column">
|
||||
<el-text :type="statusListFilter(form.alipayStatus).type">
|
||||
{{ statusListFilter(form.alipayStatus).label }}
|
||||
</el-text>
|
||||
<div class="center" v-if="form.alipayStatus == 'SIGN'">
|
||||
<el-text>待签约</el-text>
|
||||
<el-link type="primary" @click="singCodeDialogRef?.show(form.alipaySignUrl, 1)">查看签约码</el-link>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信进件状态">
|
||||
<div class="column">
|
||||
<el-text :type="statusListFilter(form.wechatStatus).type">
|
||||
{{ statusListFilter(form.wechatStatus).label }}
|
||||
</el-text>
|
||||
<div class="center" v-if="form.wechatStatus == 'SIGN'">
|
||||
<el-text>待签约</el-text>
|
||||
<el-link type="primary" @click="singCodeDialogRef?.show(form.wechatSignUrl, 2)">查看签约码</el-link>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="最后提交时间">
|
||||
<el-text>{{ form.updateTime }}</el-text>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-text>{{ form.createTime }}</el-text>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="typeValue == shopId">
|
||||
<el-button link type="primary"
|
||||
v-if="form.wechatStatus == 'INIT' || form.wechatStatus == 'AUDIT' || form.wechatStatus == 'SIGN' || form.alipayStatus == 'INIT' || form.alipayStatus == 'AUDIT' || form.alipayStatus == 'SIGN'"
|
||||
@click="checkStatusHandle()">查询</el-button>
|
||||
<el-button type="primary" @click="toDetail('check')">查看详情</el-button>
|
||||
<el-button type="primary" @click="toDetail('editor')"
|
||||
v-if="form.alipayStatus == 'REJECTED' || form.wechatStatus == 'REJECTED'">修改</el-button>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
<singCodeDialog ref="singCodeDialogRef" />
|
||||
<!-- 分店复用主店信息弹窗 -->
|
||||
<el-dialog title="注意" width="400px" top="40vh" v-model="mainDialogVisable">
|
||||
<span>是否复用主店?</span>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="toApplymentRouter">自己申请</el-button>
|
||||
<el-button type="primary" @click="shopMerchantPutAjax" :loading="mainDialogVisableLoading">复用主店信息</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { shopMerchantGet, getMainMerchant, shopMerchantPut, entryManagerDetail } from '@/api/common'
|
||||
import singCodeDialog from '@/views/applyments/components/singCodeDialog.vue';
|
||||
|
||||
const singCodeDialogRef = ref(null)
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const shopId = ref(route.query.shopId)
|
||||
const userTypeList = ref([
|
||||
{
|
||||
value: '0',
|
||||
label: '个体商户'
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: '企业商户'
|
||||
},
|
||||
])
|
||||
function userTypeListFilter(userType) {
|
||||
let obj = userTypeList.value.find(item => item.value == userType)
|
||||
if (obj) {
|
||||
return obj
|
||||
} else {
|
||||
return {
|
||||
label: userType,
|
||||
value: userType
|
||||
}
|
||||
}
|
||||
}
|
||||
const statusList = ref([
|
||||
{
|
||||
value: 'WAIT',
|
||||
label: '待提交',
|
||||
type: 'info'
|
||||
},
|
||||
{
|
||||
value: 'INIT',
|
||||
label: '待处理',
|
||||
type: 'info'
|
||||
},
|
||||
{
|
||||
value: 'AUDIT',
|
||||
label: '待审核',
|
||||
type: 'warning'
|
||||
},
|
||||
{
|
||||
value: 'SIGN',
|
||||
label: '待签约',
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
value: 'FINISH',
|
||||
label: '已完成',
|
||||
type: 'success'
|
||||
},
|
||||
{
|
||||
value: 'REJECTED',
|
||||
label: '失败',
|
||||
type: 'danger'
|
||||
},
|
||||
])
|
||||
function statusListFilter(status) {
|
||||
let obj = statusList.value.find(item => item.value == status)
|
||||
if (obj) {
|
||||
return obj
|
||||
} else {
|
||||
return {
|
||||
label: status,
|
||||
value: status
|
||||
}
|
||||
}
|
||||
}
|
||||
const loading = ref(false)
|
||||
const form = ref({})
|
||||
|
||||
|
||||
// 查询状态
|
||||
async function checkStatusHandle() {
|
||||
try {
|
||||
loading.value = true
|
||||
const businessLicenceInfo = form.value.businessLicenceInfo
|
||||
await queryEntry({
|
||||
shopId: form.value.shopId,
|
||||
licenceNo: businessLicenceInfo.licenceNo
|
||||
})
|
||||
updateData()
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取主店进件信息
|
||||
const mainInfo = ref({})
|
||||
async function headShopApplmentInfo() {
|
||||
try {
|
||||
if (route.query.mainId) {
|
||||
const res = await getMainMerchant({
|
||||
shopId: route.query.mainId
|
||||
})
|
||||
mainInfo.value = res
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 跳转进件逻辑处理
|
||||
const mainDialogVisable = ref(false)
|
||||
const mainDialogVisableLoading = ref(false)
|
||||
const isHeadShop = ref(route.query.isHeadShop)
|
||||
async function toApplyment() {
|
||||
let shopType = route.query.shopType
|
||||
if (shopType == 'chain' || shopType == 'join') {
|
||||
if (isHeadShop == 1) {
|
||||
toApplymentRouter()
|
||||
} else {
|
||||
// 分店弹窗选择
|
||||
await headShopApplmentInfo()
|
||||
if (mainInfo.value && mainInfo.value.shopId) {
|
||||
mainDialogVisable.value = true
|
||||
} else {
|
||||
toApplymentRouter()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
toApplymentRouter()
|
||||
}
|
||||
}
|
||||
|
||||
// 跳转进件
|
||||
function toApplymentRouter() {
|
||||
router.push({ name: 'applyment_in', query: { shopId: shopId.value } });
|
||||
}
|
||||
|
||||
// 复用主店的进件信息
|
||||
async function shopMerchantPutAjax() {
|
||||
try {
|
||||
mainDialogVisableLoading.value = true
|
||||
await shopMerchantPut({
|
||||
shopId: shopId.value,
|
||||
relatedId: mainInfo.value.shopId,
|
||||
nativeMerchantDTO: {
|
||||
wechatMerchantId: mainInfo.value.wechatMerchantId,
|
||||
alipayMerchantId: mainInfo.value.alipayMerchantId,
|
||||
alipayAuthInfo: mainInfo.value.alipayAuthInfo
|
||||
}
|
||||
})
|
||||
ElNotification({
|
||||
title: '注意',
|
||||
message: '复用成功',
|
||||
type: 'success'
|
||||
})
|
||||
mainDialogVisable.value = false
|
||||
updateData()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
mainDialogVisableLoading.value = false
|
||||
}
|
||||
|
||||
// 跳转编辑页面
|
||||
function toDetail(type) {
|
||||
const businessLicenceInfo = form.value.businessLicenceInfo
|
||||
router.push({
|
||||
name: 'applyment_in',
|
||||
query: {
|
||||
shopId: shopId.value,
|
||||
licenceNo: businessLicenceInfo.licenceNo,
|
||||
type: type
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 切换进件类型
|
||||
const typeValue = ref('')
|
||||
async function typeValueChange(e) {
|
||||
await ElMessageBox.confirm('确定要切换进件类型吗?', '注意').then(async () => {
|
||||
try {
|
||||
try {
|
||||
loading.value = true
|
||||
await shopMerchantPut({
|
||||
shopId: shopId.value,
|
||||
relatedId: e,
|
||||
})
|
||||
typeValue.value = e
|
||||
updateData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
loading.value = false
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
// 刷新进件数据
|
||||
async function updateData() {
|
||||
try {
|
||||
loading.value = true
|
||||
const res = await shopMerchantGet({
|
||||
shopId: shopId.value
|
||||
})
|
||||
|
||||
if (res && res.shopDirectMerchant) {
|
||||
form.value = res.shopDirectMerchant
|
||||
typeValue.value = res.relatedId
|
||||
} else {
|
||||
typeValue.value = shopId.value
|
||||
const applymentRes = await entryManagerDetail({ shopId: shopId.value })
|
||||
if (applymentRes && applymentRes.shopId) {
|
||||
form.value = applymentRes
|
||||
} else {
|
||||
form.value = ''
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
updateData()
|
||||
headShopApplmentInfo()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.row {
|
||||
&.mt14 {
|
||||
margin-top: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
@@ -25,7 +25,7 @@
|
||||
<el-button type="primary" icon="plus" @click="addShopShow">添加店铺</el-button>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list" stripe border>
|
||||
<el-table-column label="店铺信息" width="200">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
@@ -57,23 +57,25 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="登录账号" prop="phone"></el-table-column>
|
||||
<el-table-column prop="registerType" label="经营模式">
|
||||
<template v-slot="scope">
|
||||
<span v-if="scope.row.registerType == 'before'">快餐版</span>
|
||||
<span v-if="scope.row.registerType == 'after'">餐饮版</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="商户号" />
|
||||
<el-table-column prop="status" label="店铺类型" align="center">
|
||||
<template v-slot="scope">
|
||||
<div>
|
||||
<span v-if="scope.row.shopType == 'only'">单店</span>
|
||||
<span v-if="scope.row.shopType == 'chain'">连锁店</span>
|
||||
<span v-if="scope.row.shopType == 'join'">加盟店</span>
|
||||
<div v-if="scope.row.shopType != 'only'&&scope.row.isHeadShop == 0">(主店:{{ scope.row.headShopName }})</div>
|
||||
<div v-if="scope.row.shopType != 'only' && scope.row.isHeadShop == 0">(主店:{{ scope.row.headShopName }})
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="商户详细地址" />
|
||||
<el-table-column prop="status" label="店铺状态">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" disabled />
|
||||
@@ -113,7 +115,7 @@
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-if="scope.row.isHeadShop == 1" :command="0">添加分店</el-dropdown-item>
|
||||
<el-dropdown-item :command="{ row: scope.row, command: 1 }">
|
||||
三方配置
|
||||
支付配置
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="2">续费记录</el-dropdown-item>
|
||||
<el-dropdown-item :command="3">前往店铺</el-dropdown-item>
|
||||
@@ -132,7 +134,7 @@
|
||||
layout="total, sizes , prev, pager ,next, jumper " @current-change="paginationChange" />
|
||||
</div>
|
||||
<addShop ref="refAddShop" @success="getTableData" />
|
||||
<detailModal ref="refDetailModal" />
|
||||
<!-- <detailModal ref="refDetailModal" /> -->
|
||||
<!-- 激活码 -->
|
||||
<activateCode ref="refActivateCode" @success="getTableData" />
|
||||
</div>
|
||||
@@ -145,6 +147,10 @@ import ShopApi from "@/api/account/shop";
|
||||
import { ElNotification, ElMessageBox } from "element-plus";
|
||||
import addShop from "./components/addShop.vue";
|
||||
import detailModal from "./components/detailModal.vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const refActivateCode = ref(null);
|
||||
function activateCodeShow(row) {
|
||||
refActivateCode.value.open(row);
|
||||
@@ -191,7 +197,19 @@ function dropdownClick(e, row) {
|
||||
return;
|
||||
}
|
||||
if (e.command == 1) {
|
||||
refDetailModal.value.show(e.row);
|
||||
console.log('row===', row);
|
||||
|
||||
// refDetailModal.value.show(e.row);
|
||||
router.push({
|
||||
name: 'pay_setting',
|
||||
query: {
|
||||
shopId: row.id,
|
||||
shopType: row.shopType,
|
||||
isHeadShop: row.isHeadShop,
|
||||
mainId: row.mainId,
|
||||
shopName: row.shopName
|
||||
}
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (e == 5) {
|
||||
|
||||
149
src/views/shop/list/pay_setting.vue
Normal file
149
src/views/shop/list/pay_setting.vue
Normal file
@@ -0,0 +1,149 @@
|
||||
<!-- 支付配置页面 -->
|
||||
<template>
|
||||
<div class="gyq_container">
|
||||
<div class="header_wrap">
|
||||
<div class="left_btn" @click="router.back()">
|
||||
<el-icon size="22" color="#333">
|
||||
<Back />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="t">{{ route.query.shopName }} | 支付配置</div>
|
||||
<div class="intro">管理您的支付渠道和进件信息</div>
|
||||
</div>
|
||||
<div class="center">
|
||||
<el-text size="large">当前模式:</el-text>
|
||||
<el-radio-group size="large" :model-value="payModel" @change="handleRadioChange">
|
||||
<el-radio :label="item.label" :value="item.value" v-for="item in tabList" :key="item.value"></el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gyq_content row mt14">
|
||||
<tabHeader v-model="tabActiveIndex" :list="tabList" />
|
||||
<payStatusCard name="payStatusCard" key="payStatusCard" ref="payStatusCardRef" v-if="tabActiveIndex == 0" />
|
||||
<detailModal name="detailModal" key="detailModal" ref="detailModalRef" v-model="detail"
|
||||
v-if="tabActiveIndex == 1" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import detailModal from './components/detailModal.vue';
|
||||
import payStatusCard from './components/payStatusCard.vue';
|
||||
import { shopMerchantGet, shopMerchantPut } from '@/api/common'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const payModel = ref('')
|
||||
const tabActiveIndex = ref(0)
|
||||
const tabList = ref([
|
||||
{
|
||||
label: '支付进件',
|
||||
value: 'native'
|
||||
},
|
||||
{
|
||||
label: '聚合支付',
|
||||
value: 'poly'
|
||||
}
|
||||
])
|
||||
|
||||
// 二次确认支付模式 更换支付模式
|
||||
async function handleRadioChange(value) {
|
||||
await ElMessageBox.confirm('确定要选择该模式吗?', '注意').then(async () => {
|
||||
try {
|
||||
await shopMerchantPut({
|
||||
shopId: route.query.shopId,
|
||||
channel: value
|
||||
})
|
||||
payModel.value = value
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
// 与子组件的form绑定
|
||||
const detail = ref({})
|
||||
async function shopMerchantGetAjax() {
|
||||
try {
|
||||
const res = await shopMerchantGet({ shopId: route.query.shopId })
|
||||
console.log('shopMerchantGetAjax===', res);
|
||||
if (res && res.shopId) {
|
||||
payModel.value = res.channel
|
||||
|
||||
if (res && res.polyMerchantDTO) {
|
||||
detail.value = res.polyMerchantDTO
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
shopMerchantGetAjax()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.gyq_container {
|
||||
padding: 14px;
|
||||
|
||||
.gyq_content {
|
||||
padding: 14px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
&.mt14 {
|
||||
margin-top: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header_wrap {
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-right: 14px;
|
||||
|
||||
.left_btn {
|
||||
height: 73px;
|
||||
padding: 14px 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding: 14px 14px 14px 0;
|
||||
|
||||
.t {
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.intro {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -47,9 +47,9 @@
|
||||
{{ multiplyAndFormat(scope.row.amount || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="积分" prop="accountPoints">
|
||||
<el-table-column label="积分" prop="pointBalance">
|
||||
<template #default="scope">
|
||||
{{ scope.row.accountPoints || 0 }}
|
||||
{{ scope.row.pointBalance || 0 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90" fixed="right">
|
||||
|
||||
@@ -220,6 +220,25 @@
|
||||
<popup-coupon ref="refCoupon" :user="carts.vipUser" @confirm="refCouponConfirm"></popup-coupon>
|
||||
<!-- 挂账 -->
|
||||
<chooseGuaZahng ref="refGuaZhang" :payMoney="currentpayMoney" @confirm="refGuaZhangConfirm"></chooseGuaZahng>
|
||||
<!-- 扫码等待用户支付转台查询 -->
|
||||
<el-dialog v-model="showCheckPayStauts" width="400" title="订单支付状态查询中..." :close-on-click-modal="false"
|
||||
:show-close="false">
|
||||
<div class="pay_status_content">
|
||||
<div class="loading" v-loading="checkPayStautsLoading" element-loading-text="用户支付中..."></div>
|
||||
<div class="btn">
|
||||
<el-button style="width: 100%" :disabled="!closeState" type="primary" @click="resetScanCode">
|
||||
<span v-if="!closeState">{{ closeStateTime }}秒后可重新扫码</span>
|
||||
<span v-else>重新扫码</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<el-button style="width: 100%" :disabled="!closeState" @click="closeScanCode">
|
||||
<span v-if="!closeState">{{ closeStateTime }}秒后可关闭</span>
|
||||
<span v-else>关闭</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -243,6 +262,7 @@ import discount from "./discount.vue";
|
||||
import { ElLoading } from "element-plus";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { BigNumber } from "bignumber.js";
|
||||
import { onUnmounted } from 'vue'
|
||||
|
||||
// 配置BigNumber精度
|
||||
BigNumber.set({
|
||||
@@ -439,11 +459,17 @@ async function pointsInit() {
|
||||
|
||||
// 保险取值
|
||||
const eq = pointsConfig?.equivalentPoints || 0;
|
||||
const maxRatio = pointsConfig?.maxDeductionRatio || 0;
|
||||
const rawMaxRatio = pointsConfig?.maxDeductionRatio || 0;
|
||||
// 兼容后端返回的百分比或小数两种形式:如果大于1,则视为百分比(如100表示100%),需除以100
|
||||
const maxRatio = rawMaxRatio > 1 ? rawMaxRatio / 100 : rawMaxRatio;
|
||||
const minPay = pointsConfig?.minPaymentAmount || 0;
|
||||
|
||||
// 计算当前订单可抵扣金额上限(元)
|
||||
// 使用“抵扣前实付金额”作为门槛判断(即把当前已应用的积分抵扣金额加回),
|
||||
// 避免在已经抵扣导致 finalPay 变小后错误地判定为不可用。
|
||||
let finalPay = Number(carts.orderCostSummary.finalPayAmount) || 0;
|
||||
const currentPointDeduction = Number(carts.orderCostSummary.pointDeductionAmount) || 0;
|
||||
const basePay = finalPay + currentPointDeduction;
|
||||
|
||||
const res = {
|
||||
usable: true,
|
||||
@@ -455,8 +481,9 @@ async function pointsInit() {
|
||||
unusableReason: "",
|
||||
};
|
||||
|
||||
// 如果订单实付低于最小使用门槛,则不可用
|
||||
if (finalPay <= 0 || (minPay > 0 && finalPay < minPay)) {
|
||||
// 如果订单实付低于最小使用门槛,则不可用(门槛仅作为启用条件)
|
||||
// 这里使用 basePay(抵扣前实付)进行判断,确保已填写积分后不会回退为不可用
|
||||
if (basePay <= 0 || (minPay > 0 && basePay < minPay)) {
|
||||
res.usable = false;
|
||||
res.unusableReason = `订单实付金额低于 ${minPay} 元,无法使用积分抵扣`;
|
||||
} else if (eq <= 0) {
|
||||
@@ -464,23 +491,22 @@ async function pointsInit() {
|
||||
res.unusableReason = `积分换算比例配置错误,无法使用积分抵扣`;
|
||||
} else {
|
||||
// 计算基于比例限制的最大抵扣金额(元)
|
||||
let maxByRatio = finalPay * maxRatio;
|
||||
// 保证抵扣后剩余金额 >= minPaymentAmount
|
||||
if (minPay > 0) {
|
||||
const allowed = finalPay - minPay;
|
||||
if (allowed <= 0) {
|
||||
res.usable = false;
|
||||
res.unusableReason = `抵扣后实付金额必须大于等于 ${minPay} 元,当前不可使用积分`;
|
||||
} else {
|
||||
maxByRatio = Math.min(maxByRatio, allowed);
|
||||
}
|
||||
}
|
||||
// 注意:此处不再减少 minPaymentAmount,minPaymentAmount 仅用作是否可用的门槛;
|
||||
// 真正的最大抵扣由 maxRatio(抵扣比例)与用户积分数量共同决定。
|
||||
// 计算基于比例限制的最大抵扣金额(元),基于抵扣前实付金额
|
||||
let maxByRatio = basePay * maxRatio;
|
||||
|
||||
if (res.usable) {
|
||||
// 可用积分上限(向下取整为 eq 的倍数)
|
||||
// 可用积分上限(按等价积分步长对齐到 eq 的倍数)
|
||||
const maxByMoney = Math.floor(maxByRatio * eq);
|
||||
const userPoints = carts.vipUser.pointBalance || 0;
|
||||
res.maxUsablePoints = Math.min(userPoints, maxByMoney);
|
||||
let computedMax = Math.min(userPoints, maxByMoney);
|
||||
// 对齐到等价积分步长,保证输入步长生效
|
||||
if (eq > 0) {
|
||||
computedMax = Math.floor(computedMax / eq) * eq;
|
||||
}
|
||||
res.maxUsablePoints = computedMax;
|
||||
console.debug("pointsInit debug:", { finalPay: finalPay, basePay: basePay, eq, rawMaxRatio, maxRatio, maxByMoney, userPoints, computedMax });
|
||||
// 最小抵扣积分为配置值或等于换算比
|
||||
res.minDeductionPoints = pointsConfig?.minDeductionPoints || eq;
|
||||
if (res.maxUsablePoints < res.minDeductionPoints) {
|
||||
@@ -498,8 +524,20 @@ async function pointsInit() {
|
||||
return res;
|
||||
}
|
||||
|
||||
// 如果可用则默认填充可用最大值,否则清零
|
||||
usePointsNumber.value = res.usable ? res.maxUsablePoints : 0;
|
||||
// 如果可用则默认填充可用最大值(对齐步长),否则清零
|
||||
if (res.usable) {
|
||||
// 计算默认填充值:基于抵扣前实付的比例上限与等价比计算需要的积分数
|
||||
const defaultMaxByMoney = Math.floor(basePay * res.maxDeductionRatio * res.equivalentPoints);
|
||||
let defaultPts = Math.min(res.maxUsablePoints || 0, defaultMaxByMoney || 0);
|
||||
if (res.equivalentPoints > 0) {
|
||||
defaultPts = Math.floor(defaultPts / res.equivalentPoints) * res.equivalentPoints;
|
||||
}
|
||||
// 最终确保不超过用户积分
|
||||
const userPts = carts.vipUser.pointBalance || 0;
|
||||
usePointsNumber.value = Math.min(defaultPts, userPts);
|
||||
} else {
|
||||
usePointsNumber.value = 0;
|
||||
}
|
||||
if (!res.usable) score.sel = -1;
|
||||
|
||||
return res;
|
||||
@@ -532,17 +570,15 @@ function pointsToMoney(val) {
|
||||
// 再次校验不超过允许的最大抵扣金额(基于比例或门槛)
|
||||
let finalPay = Number(carts.orderCostSummary.finalPayAmount) || 0;
|
||||
let maxByRatio = finalPay * cfg.maxDeductionRatio;
|
||||
if (cfg.minPaymentAmount > 0) {
|
||||
const allowed = finalPay - cfg.minPaymentAmount;
|
||||
if (allowed <= 0) {
|
||||
// 对于单笔抵扣:若订单实付低于配置的最小门槛,则不可使用(作为启用条件)
|
||||
if (cfg.minPaymentAmount > 0 && finalPay < cfg.minPaymentAmount) {
|
||||
usePointsNumber.value = 0;
|
||||
carts.orderCostSummary.pointUsed = 0;
|
||||
carts.orderCostSummary.pointDeductionAmount = 0;
|
||||
return;
|
||||
}
|
||||
maxByRatio = Math.min(maxByRatio, allowed);
|
||||
}
|
||||
const maxAllowedMoney = new BigNumber(maxByRatio).decimalPlaces(2, BigNumber.ROUND_DOWN).toNumber();
|
||||
console.debug("pointsToMoney debug:", { finalPay, cfg, pts, money, maxByRatio, maxAllowedMoney });
|
||||
if (money > maxAllowedMoney) {
|
||||
// 调整积分到允许的最大金额对应的积分
|
||||
const allowedPts = Math.floor(maxAllowedMoney * cfg.equivalentPoints);
|
||||
@@ -735,7 +771,12 @@ async function payOrder(payType, isScan, guazhangren) {
|
||||
}
|
||||
carts.clear();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.log('payOrder===', error);
|
||||
// 启动状态查询
|
||||
if (error.code == 211) {
|
||||
showCheckPayStauts.value = true
|
||||
autoCheckOrder()
|
||||
}
|
||||
clearTimeout(payTimer);
|
||||
loading.close();
|
||||
}
|
||||
@@ -746,6 +787,102 @@ async function payOrder(payType, isScan, guazhangren) {
|
||||
}
|
||||
}
|
||||
|
||||
function clearAutoCheckOrder() {
|
||||
clearInterval(timer.value)
|
||||
timer.value = null
|
||||
}
|
||||
|
||||
// 关闭查询
|
||||
function closeScanCode() {
|
||||
showCheckPayStauts.value = false;
|
||||
reset()
|
||||
}
|
||||
|
||||
// 重新扫码
|
||||
function resetScanCode() {
|
||||
reset()
|
||||
showCheckPayStauts.value = false;
|
||||
clearInterval(timer.value)
|
||||
timer.value = null
|
||||
|
||||
clearInterval(closeStateTimer.value)
|
||||
closeStateTimer.value = null
|
||||
|
||||
setTimeout(() => {
|
||||
refScanPay.value.open(returnPayParams(), "scanCode")
|
||||
}, 500)
|
||||
}
|
||||
|
||||
const closeState = ref(false)
|
||||
const closeStateTime = ref(5);
|
||||
const closeStateTimer = ref(null)
|
||||
|
||||
function closeStateTimerFuc() {
|
||||
closeStateTimer.value = setInterval(() => {
|
||||
closeStateTime.value--
|
||||
if (closeStateTime.value <= 0) {
|
||||
clearInterval(closeStateTimer.value)
|
||||
closeStateTimer.value = null
|
||||
closeState.value = true
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
// 自动查询订单状态
|
||||
const timer = ref(null)
|
||||
function autoCheckOrder() {
|
||||
closeStateTimerFuc()
|
||||
timer.value = setInterval(() => {
|
||||
// 开始锁单
|
||||
// goodsStore.isOrderLock({
|
||||
// table_code: table_code.value
|
||||
// }, 'pay_lock')
|
||||
checkPayStauts(false)
|
||||
}, 2000)
|
||||
}
|
||||
|
||||
function reset() {
|
||||
checkPayStautsLoading.value = true;
|
||||
closeState.value = false
|
||||
closeStateTime.value = 5
|
||||
}
|
||||
|
||||
// 查询订单支付状态
|
||||
const showCheckPayStauts = ref(false)
|
||||
const checkPayStautsLoading = ref(true)
|
||||
async function checkPayStauts(tips = true) {
|
||||
try {
|
||||
// 扫码下单
|
||||
const res = await payApi.queryOrderStatus({ orderId: props.orderInfo.id });
|
||||
if (res == "done") {
|
||||
// 支付成功,解锁订单
|
||||
// await goodsStore.isOrderLock({
|
||||
// table_code: table_code.value
|
||||
// }, 'pay_unlock')
|
||||
|
||||
// userPayWait.value = false
|
||||
checkPayStautsLoading.value = false;
|
||||
// scanCode.value = "";
|
||||
showCheckPayStauts.value = false;
|
||||
clearAutoCheckOrder()
|
||||
paysuccess();
|
||||
return;
|
||||
}
|
||||
if (res == "unpaid") {
|
||||
if (tips) {
|
||||
ElMessage.warning("用户支付中...");
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
clearAutoCheckOrder()
|
||||
ElMessage.warning(res.msg || '');
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
function paysuccess() {
|
||||
clearTimeout(payTimer);
|
||||
ElMessage.success("支付成功");
|
||||
@@ -806,6 +943,10 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
clearAutoCheckOrder()
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
carts.payParamsInit();
|
||||
getPaytype();
|
||||
@@ -858,9 +999,13 @@ defineExpose({
|
||||
.order-info {
|
||||
font-size: 14px;
|
||||
|
||||
.title {}
|
||||
.title {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.value {}
|
||||
.value {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.price {
|
||||
color: #fa5555;
|
||||
@@ -879,4 +1024,30 @@ defineExpose({
|
||||
color: #666;
|
||||
padding: 8px 10px 8px 20px;
|
||||
}
|
||||
|
||||
.pay_status_content {
|
||||
flex: 1;
|
||||
padding: 0 var(--el-font-size-base);
|
||||
height: 400px;
|
||||
padding-bottom: 100px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.loading {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
--el-loading-spinner-size: 100px;
|
||||
|
||||
:deep(.el-loading-text) {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 200px;
|
||||
padding-top: var(--el-font-size-base);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,12 +2,8 @@
|
||||
<el-dialog width="400px" :title="title" v-model="show" @close="reset">
|
||||
<div class="u-p-15">
|
||||
<div v-if="openSwitch" class="u-m-b-20">
|
||||
<el-button
|
||||
@click="changeKey('paysSel', index)"
|
||||
v-for="(item, index) in pays"
|
||||
:key="index"
|
||||
:type="paysSel == index ? 'primary' : ''"
|
||||
>
|
||||
<el-button @click="changeKey('paysSel', index)" v-for="(item, index) in pays" :key="index"
|
||||
:type="paysSel == index ? 'primary' : ''">
|
||||
{{ item.text }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -21,13 +17,8 @@
|
||||
<el-input :value="form.money" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款码">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
@change="codeInputChange"
|
||||
autofocus
|
||||
placeholder="请扫码或者输入付款码"
|
||||
ref="refInputCode"
|
||||
></el-input>
|
||||
<el-input v-model="form.code" @change="inputChange" autofocus placeholder="请扫码或者输入付款码"
|
||||
ref="refInputCode"></el-input>
|
||||
</el-form-item>
|
||||
<div class="u-flex u-row-center u-m-t-50">
|
||||
<el-button @click="close">取消</el-button>
|
||||
@@ -46,7 +37,9 @@
|
||||
</div>
|
||||
<div class="color-333 u-font-20 u-m-t-20">{{ form.money }}元</div>
|
||||
<div class="color-aaa u-font-12 u-m-t-10">
|
||||
<el-icon class="loading-ani"><Loading /></el-icon>
|
||||
<el-icon class="loading-ani">
|
||||
<Loading />
|
||||
</el-icon>
|
||||
<span>等待用户支付</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -56,6 +49,7 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import _ from 'lodash'
|
||||
import QRCode from "qrcode";
|
||||
import orderApi from "@/api/order/order";
|
||||
import payApi from "@/api/order/pay";
|
||||
@@ -128,6 +122,9 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
inputChange: _.debounce(function (e) {
|
||||
this.confirm();
|
||||
}, 100),
|
||||
to2(n) {
|
||||
return n.toFixed(2);
|
||||
},
|
||||
@@ -175,7 +172,6 @@ export default {
|
||||
changeKey(key, val) {
|
||||
this[key] = val;
|
||||
},
|
||||
|
||||
confirm() {
|
||||
if (!this.form.code) {
|
||||
return ElMessage.error("请输入或扫付款码");
|
||||
@@ -247,6 +243,7 @@ export default {
|
||||
height: 164px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@keyframes rotating {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
@@ -258,6 +255,7 @@ export default {
|
||||
transform: rotate(1turn);
|
||||
}
|
||||
}
|
||||
|
||||
.loading-ani {
|
||||
animation: rotating 2s linear infinite;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ const contentConfig: IContentConfig<any> = {
|
||||
// // return shopUserApi.edit(data);
|
||||
// },
|
||||
pk: "id",
|
||||
toolbar: ["add"],
|
||||
toolbar: ["add", 'export'],
|
||||
defaultToolbar: ["refresh", "filter", "search"],
|
||||
cols: [
|
||||
{ type: "selection", width: 50, align: "center" },
|
||||
@@ -82,7 +82,7 @@ const contentConfig: IContentConfig<any> = {
|
||||
{
|
||||
label: "消费次数累计",
|
||||
align: "center",
|
||||
prop: "consumeAmount",
|
||||
prop: "consumeCount",
|
||||
},
|
||||
{
|
||||
label: "注册时间",
|
||||
|
||||
@@ -158,6 +158,7 @@ import { returnOptionsLabel } from "./config/config";
|
||||
import shopUserApi from "@/api/account/shopUser";
|
||||
import { useRoute } from 'vue-router'
|
||||
import { ElNotification } from 'element-plus'
|
||||
import { downloadFile } from "@/utils/index";
|
||||
const editMoneyModalRef = ref(null);
|
||||
const userCouponDialogRef = ref(null);
|
||||
const GiveCouponRef = ref(null);
|
||||
@@ -175,7 +176,7 @@ const {
|
||||
// handleAddClick,
|
||||
// handleEditClick,
|
||||
handleSubmitClick,
|
||||
handleExportClick,
|
||||
// handleExportClick,
|
||||
handleSearchClick,
|
||||
handleFilterChange,
|
||||
} = usePage();
|
||||
@@ -217,6 +218,16 @@ function formDataChange(type, val) {
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
async function handleExportClick() {
|
||||
try {
|
||||
const file = await shopUserApi.export(searchRef.value.getQueryParams());
|
||||
downloadFile(file, "用户列表", "xlsx");
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 新增
|
||||
async function handleAddClick() {
|
||||
addModalRef.value?.setModalVisible();
|
||||
|
||||
Reference in New Issue
Block a user