mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-27 17:00:16 +00:00
up
This commit is contained in:
parent
614b592dcc
commit
91283fe1bf
@ -190,3 +190,11 @@ export function changeTemplate(params: Record<string, any>) {
|
||||
export function getApps(params: Record<string, any>) {
|
||||
return request.get(`diy/apps`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制模版页面
|
||||
* @param params
|
||||
*/
|
||||
export function copyDiy(params: Record<string, any>) {
|
||||
return request.post(`diy/copy`, params, { showSuccessMessage: true })
|
||||
}
|
||||
@ -513,3 +513,26 @@ export function setSignConfig(params: Record<string, any>) {
|
||||
export function getMemberSignList(params: Record<string, any>) {
|
||||
return request.get(`member/sign`, { params });
|
||||
}
|
||||
|
||||
/***************************************************** 地址管理 ****************************************************/
|
||||
|
||||
/**
|
||||
* 获取收货地址
|
||||
*/
|
||||
export function getMemberAddress(params: Record<string, any>) {
|
||||
return request.get(`member/address`, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加收货地址
|
||||
*/
|
||||
export function addMemberAddress(params: Record<string, any>) {
|
||||
return request.post(`member/address`, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑收货地址
|
||||
*/
|
||||
export function editMemberAddress(params: Record<string, any>) {
|
||||
return request.put(`member/address`, params);
|
||||
}
|
||||
@ -75,3 +75,26 @@ export function getRefundTransfer(params: Record<string, any>) {
|
||||
export function getAllPayType() {
|
||||
return request.get(`pay/type/all`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付列表
|
||||
*/
|
||||
export function getPayList() {
|
||||
return request.get(`pay/type/list`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付
|
||||
*/
|
||||
export function pay(params: Record<string, any>) {
|
||||
return request.post(`pay`, params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 帮付
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getFriendsPay(tradeType : string, tradeId : number, channel: string) {
|
||||
return request.get(`pay/friendspay/info/${tradeType}/${tradeId}/${channel}`, { showErrorMessage: false })
|
||||
}
|
||||
@ -103,4 +103,13 @@ export function initPoster(params: Record<string, any>) {
|
||||
*/
|
||||
export function getPreviewPoster(params: Record<string, any>) {
|
||||
return request.get(`sys/poster/preview`, {params})
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getPosterGenerate(params: Record<string, any>) {
|
||||
return request.get(`sys/poster/generate`, {params, showErrorMessage: false})
|
||||
}
|
||||
@ -10,7 +10,7 @@
|
||||
<div class="mt-[10px]" v-if="upgradeContent.upgrade_version != upgradeContent.last_version">
|
||||
<el-alert type="info" show-icon>
|
||||
<template #title>
|
||||
当前最新版本为{{ upgradeContent.last_version }},您的服务已于{{ upgradeContent.expire_time }}到期。如需升级到最新版可在<a class="text-primary" href="https://www.niucloud.com" target="_blank">niucloud-admin官网</a>购买相关服务后再进行升级
|
||||
当前最新版本为{{ upgradeContent.last_version }},您的服务{{ upgradeContent.expire_time ? `已于${upgradeContent.expire_time}到期` : '长期有效' }}。如需升级到最新版可在<a class="text-primary" href="https://www.niucloud.com" target="_blank">niucloud-admin官网</a>购买相关服务后再进行升级
|
||||
</template>
|
||||
</el-alert>
|
||||
</div>
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
"titlePlaceholder": "请输入页面名称",
|
||||
"addDiyPage": "添加页面",
|
||||
"diyPageDeleteTips": "确定要删除该自定义页面吗?",
|
||||
"diyPageCopyTips": "确定要复制该自定义页面吗?",
|
||||
"preview": "预览",
|
||||
"share": "分享",
|
||||
"shareSet": "分享设置",
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
"isUse": "是否启用",
|
||||
"signPeriod": "签到周期",
|
||||
"signPeriodTip": "请输入签到周期",
|
||||
"signPeriodLimitTips": "签到周期格式错误",
|
||||
"signPeriodMustZeroTips": "签到周期必须大于0",
|
||||
"calendarSign": "日历签到",
|
||||
"periodSign": "周期签到",
|
||||
"daySignAward": "日签奖励",
|
||||
|
||||
@ -3,6 +3,6 @@
|
||||
"type": "协议类型",
|
||||
"titlePlaceholder": "请输入协议标题",
|
||||
"contentPlaceholder": "请填写协议内容",
|
||||
"contentMaxTips": "协议内容字符数应在5~50000之间",
|
||||
"contentMaxTips": "协议内容字符数应在5~100000之间",
|
||||
"content": "内容"
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,5 +65,21 @@
|
||||
"nativeDomain": "Native支付回调链接",
|
||||
"nativeDomainTips": "需在微信商户号>产品中心>开发配置>支付配置 Native支付回调链接中添加该链接",
|
||||
"wechatpayPublicCert": "微信支付公钥",
|
||||
"wechatpayPublicCertId": "微信支付公钥ID"
|
||||
"wechatpayPublicCertId": "微信支付公钥ID",
|
||||
"updateFriendsPay":"找朋友帮忙付",
|
||||
"friendsPaySwitch":"帮付说明",
|
||||
"friendsPayTitle":"帮付说明标题",
|
||||
"friendsPayTitlePlaceholder":"请输入帮付说明标题",
|
||||
"desContent":"说明内容",
|
||||
"friendsPayGoodsSwitch":"订单信息清单",
|
||||
"friendsPayGoodsSwitchTips":"开启后,帮付人可以看到订单信息清单",
|
||||
"friendsPayName":"支付方式名称",
|
||||
"friendsPayNamePlaceholder":"请输入支付方式名称",
|
||||
"desContentPlaceholder": "请输入说明内容",
|
||||
"helpName":"帮付页面名称",
|
||||
"helpNamePlaceholder":"请输入帮付页面名称",
|
||||
"helpBtn":"帮付按钮名称",
|
||||
"helpBtnPlaceholder":"请输入帮付按钮名称",
|
||||
"remark":"发起帮付留言",
|
||||
"remarkPlaceholder":"请输入留言备注"
|
||||
}
|
||||
|
||||
@ -13,5 +13,7 @@
|
||||
"batchEmptySelectedCronLogTips": "请选择要删除的日志",
|
||||
"batchDeleteTips": "确定要删除选中的日志吗?",
|
||||
"clearAllTips": "确定要清空所有日志吗?",
|
||||
"deleteTips": "确定要删除该条日志吗?"
|
||||
}
|
||||
"deleteTips": "确定要删除该条日志吗?",
|
||||
"startDate": "开始日期",
|
||||
"endDate": "结束日期"
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ const refreshData = () => {
|
||||
|
||||
if (import.meta.env.MODE == 'development') {
|
||||
// 开发模式情况下,并且未配置wap域名,则获取缓存域名
|
||||
if (wapDomain.value) {
|
||||
if (wapDomain.value && wapDomain.value.indexOf('localhost') != -1) {
|
||||
page.wapUrl = wapDomain.value + '/wap'
|
||||
repeat = false
|
||||
setDomain()
|
||||
|
||||
@ -57,6 +57,7 @@
|
||||
<el-button v-if="row.type == 'DIY_PAGE'" type="primary" link @click="openShare(row)">{{ t('shareSet') }}</el-button>
|
||||
<el-button type="primary" link @click="editEvent(row)">{{ t('edit') }}</el-button>
|
||||
<el-button v-if="row.is_default == 0 || row.type == 'DIY_PAGE'" type="primary" link @click="deleteEvent(row.id)">{{ t('delete') }}</el-button>
|
||||
<el-button type="primary" link @click="copyEvent(row.id)">{{ t('copy') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -126,7 +127,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, computed } from 'vue'
|
||||
import { t } from '@/lang'
|
||||
import { getApps,getDiyPageList, deleteDiyPage, getDiyTemplate, editDiyPageShare, setUseDiyPage } from '@/app/api/diy'
|
||||
import { getApps,getDiyPageList, deleteDiyPage, getDiyTemplate, editDiyPageShare, setUseDiyPage,copyDiy } from '@/app/api/diy'
|
||||
import { ElMessageBox, FormInstance } from 'element-plus'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { setTablePageStorage,getTablePageStorage } from "@/utils/common";
|
||||
@ -258,6 +259,30 @@ const setUse = (id: any) => {
|
||||
loadDiyPageList()
|
||||
})
|
||||
}
|
||||
const repeat = ref(false)
|
||||
|
||||
// 复制页面
|
||||
const copyEvent = (id: any) => {
|
||||
ElMessageBox.confirm(t('diyPageCopyTips'), t('warning'),
|
||||
{
|
||||
confirmButtonText: t('confirm'),
|
||||
cancelButtonText: t('cancel'),
|
||||
type: 'warning'
|
||||
}
|
||||
).then(() => {
|
||||
if (repeat.value) return
|
||||
repeat.value = true
|
||||
|
||||
copyDiy({id: id}).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
loadDiyPageList()
|
||||
}
|
||||
repeat.value = false
|
||||
}).catch(err => {
|
||||
repeat.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 删除自定义页面
|
||||
const deleteEvent = (id: number) => {
|
||||
|
||||
@ -155,7 +155,7 @@ const refreshData = () => {
|
||||
|
||||
if (import.meta.env.MODE == 'development') {
|
||||
// 开发模式情况下,并且未配置wap域名,则获取缓存域名
|
||||
if (wapDomain.value) {
|
||||
if (wapDomain.value && wapDomain.value.indexOf('localhost') != -1) {
|
||||
page.wapUrl = wapDomain.value + '/wap'
|
||||
repeat = false
|
||||
setDomain()
|
||||
|
||||
@ -154,6 +154,6 @@ defineExpose({
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.member-detail-drawer{
|
||||
width: 1000px !important;
|
||||
width: 1300px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -163,6 +163,6 @@ defineExpose({
|
||||
|
||||
<style lang="scss">
|
||||
.member-detail-drawer{
|
||||
width: 1000px !important;
|
||||
width: 1300px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
<el-switch v-model="formData.is_use" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="t('signPeriod')" v-if="formData.is_use">
|
||||
<el-input-number v-model="formData.sign_period" :min="1" :precision="0" clearable class="input-width" controls-position="right" /><span class="ml-[10px]">天</span>
|
||||
<el-form-item :label="t('signPeriod')" prop="sign_period" v-if="formData.is_use">
|
||||
<el-input v-model="formData.sign_period" placeholder="0" maxlength="8" clearable class="input-width" /><span class="ml-[10px]">天</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="t('daySignAward')" prop="day_award" v-if="formData.is_use">
|
||||
@ -130,14 +130,33 @@ const continue_award = ref({})
|
||||
let isEdit = false // 是否为编辑状态
|
||||
let editIndex = 0 // 连签奖励修改下标
|
||||
|
||||
// 正则表达式
|
||||
const regExp: any = {
|
||||
required: /[\S]+/,
|
||||
number: /^\d{0,10}$/,
|
||||
digit: /^\d{0,10}(.?\d{0,2})$/,
|
||||
special: /^\d{0,10}(.?\d{0,3})$/
|
||||
}
|
||||
// 表单验证规则
|
||||
const formRules = reactive<FormRules>({
|
||||
sign_period: [
|
||||
{ required: true, message: t('signPeriodTip'), trigger: 'blur' }
|
||||
],
|
||||
day_award: [
|
||||
{ required: true, message: t('daySignAwardPlaceholder'), trigger: 'change' }
|
||||
],
|
||||
sign_period:[{
|
||||
required: true,
|
||||
trigger: 'blur',
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value === null || value === '') {
|
||||
callback(t('signPeriodTip'))
|
||||
}else if (isNaN(value) || !regExp.number.test(value)) {
|
||||
callback(t('signPeriodLimitTips'))
|
||||
}else if (value <= 0) {
|
||||
callback(t('signPeriodMustZeroTips'))
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}],
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@ -401,6 +401,6 @@ defineExpose({
|
||||
|
||||
<style lang="scss">
|
||||
.member-detail-drawer{
|
||||
width: 1000px !important;
|
||||
width: 1300px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<!-- 属性内容 -->
|
||||
<div class="content-wrap">
|
||||
|
||||
<!-- 组件公共属性 -->
|
||||
<slot name="common"></slot>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { t } from '@/lang'
|
||||
import usePosterStore from '@/stores/modules/poster'
|
||||
|
||||
const posterStore = usePosterStore()
|
||||
|
||||
defineExpose({})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<!-- 属性内容 -->
|
||||
<div class="content-wrap">
|
||||
|
||||
<!-- 组件公共属性 -->
|
||||
<slot name="common"></slot>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { t } from '@/lang'
|
||||
import usePosterStore from '@/stores/modules/poster'
|
||||
|
||||
const posterStore = usePosterStore()
|
||||
|
||||
defineExpose({})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="overflow-hidden" :style="componentStyle">{{ data.value }}</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref,computed } from 'vue'
|
||||
import usePosterStore from '@/stores/modules/poster'
|
||||
|
||||
const posterStore = usePosterStore()
|
||||
|
||||
const prop = defineProps({
|
||||
value: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
|
||||
const data = computed(()=> {
|
||||
return prop.value;
|
||||
})
|
||||
|
||||
const componentStyle = computed(()=> {
|
||||
var style = '';
|
||||
style += `font-size: ${prop.value.fontSize}px;color: ${prop.value.fontColor};line-height: ${prop.value.lineHeight + prop.value.fontSize}px;`;
|
||||
if(prop.value.x == 'left' || prop.value.x == 'center' || prop.value.x == 'right'){
|
||||
style += `text-align: ${prop.value.x};`;
|
||||
}
|
||||
if(prop.value.weight){
|
||||
style += `font-weight: bold;`;
|
||||
}
|
||||
if(!prop.value.fontFamily || prop.value.fontFamily == 'static/font/SourceHanSansCN-Regular.ttf'){
|
||||
style += `font-family: poster_default_font;`;
|
||||
}
|
||||
let box: any = document.getElementById(prop.value.id)
|
||||
if (box) {
|
||||
style += `width:${box.offsetWidth}px;height:${box.offsetHeight}px;`;
|
||||
}else{
|
||||
style += `width:${prop.value.width}px;height:${prop.value.height}px;`;
|
||||
}
|
||||
return style;
|
||||
})
|
||||
|
||||
defineExpose({})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="overflow-hidden" :style="componentStyle">{{ data.value }}</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref,computed } from 'vue'
|
||||
import usePosterStore from '@/stores/modules/poster'
|
||||
|
||||
const posterStore = usePosterStore()
|
||||
|
||||
const prop = defineProps({
|
||||
value: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
|
||||
const data = computed(()=> {
|
||||
return prop.value;
|
||||
})
|
||||
|
||||
const componentStyle = computed(()=> {
|
||||
var style = '';
|
||||
style += `font-size: ${prop.value.fontSize}px;color: ${prop.value.fontColor};line-height: ${prop.value.lineHeight + prop.value.fontSize}px;`;
|
||||
if(prop.value.x == 'left' || prop.value.x == 'center' || prop.value.x == 'right'){
|
||||
style += `text-align: ${prop.value.x};`;
|
||||
}
|
||||
if(prop.value.weight){
|
||||
style += `font-weight: bold;`;
|
||||
}
|
||||
if(!prop.value.fontFamily || prop.value.fontFamily == 'static/font/SourceHanSansCN-Regular.ttf'){
|
||||
style += `font-family: poster_default_font;`;
|
||||
}
|
||||
let box: any = document.getElementById(prop.value.id)
|
||||
if (box) {
|
||||
style += `width:${box.offsetWidth}px;height:${box.offsetHeight}px;`;
|
||||
}else{
|
||||
style += `width:${prop.value.width}px;height:${prop.value.height}px;`;
|
||||
}
|
||||
return style;
|
||||
})
|
||||
|
||||
defineExpose({})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@ -134,7 +134,7 @@
|
||||
<!-- 文本 -->
|
||||
<template v-if="posterStore.editComponent.type == 'text'">
|
||||
<el-form-item :label="t('textFontSize')">
|
||||
<el-slider v-model="posterStore.editComponent.fontSize" show-input size="small" class="ml-[10px]" :min="14" :max="50" />
|
||||
<el-slider v-model="posterStore.editComponent.fontSize" show-input size="small" class="ml-[10px]" :min="14" :max="100" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('textColor')">
|
||||
<el-color-picker v-model="posterStore.editComponent.fontColor" />
|
||||
@ -284,7 +284,7 @@ const previewIframeStyle = (data: any)=>{
|
||||
break;
|
||||
default:
|
||||
style.top = data.y + 'px';
|
||||
}
|
||||
}
|
||||
switch(data.x) {
|
||||
case 'left':
|
||||
style.left = 0;
|
||||
|
||||
@ -81,7 +81,7 @@ const formRules = computed(() => {
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value === '') {
|
||||
callback(new Error(t('contentPlaceholder')))
|
||||
} else if (value.length < 5 || value.length > 50000) {
|
||||
} else if (value.length < 5 || value.length > 100000) {
|
||||
callback(new Error(t('contentMaxTips')))
|
||||
return false
|
||||
} else {
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button>
|
||||
<el-button @click="cancel">{{ t('cancel') }}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{t('confirm')}}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
@ -44,10 +44,11 @@ import { ref, reactive, computed } from 'vue'
|
||||
import { t } from '@/lang'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Test from '@/utils/test'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
|
||||
const showDialog = ref(false)
|
||||
const loading = ref(true)
|
||||
|
||||
const initData = ref<any>(null)
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
@ -105,15 +106,28 @@ const confirm = async (formEl: FormInstance | undefined) => {
|
||||
})
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
Object.assign(formData, initialFormData)
|
||||
if (initData.value) {
|
||||
Object.keys(formData).forEach((key: string) => {
|
||||
if (initData.value[key] != undefined) formData[key] = initData.value[key]
|
||||
})
|
||||
formData.channel = initData.value.redio_key.split('_')[0]
|
||||
formData.status = Number(formData.status)
|
||||
}
|
||||
emit('complete', formData)
|
||||
showDialog.value = false
|
||||
}
|
||||
const setFormData = async (data: any = null) => {
|
||||
initData.value = cloneDeep(data)
|
||||
loading.value = true
|
||||
Object.assign(formData, initialFormData)
|
||||
if (data) {
|
||||
Object.keys(formData).forEach((key: string) => {
|
||||
if (data[key] != undefined) formData[key] = data[key]
|
||||
})
|
||||
formData['channel'] = data['redio_key'].split('_')[0]
|
||||
formData['status'] = Number(formData['status'])
|
||||
formData.channel = data.redio_key.split('_')[0]
|
||||
formData.status = Number(formData.status)
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
174
admin/src/app/views/setting/components/pay-friendspay.vue
Normal file
174
admin/src/app/views/setting/components/pay-friendspay.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<el-dialog v-model="showDialog" :title="formData.config.pay_type_name ? formData.config.pay_type_name : t('updateFriendsPay')" width="550px" :destroy-on-close="true">
|
||||
<el-form :model="formData" label-width="110px" ref="formRef" :rules="formRules" class="page-form" v-loading="loading">
|
||||
<el-form-item :label="t('friendsPaySwitch')">
|
||||
<el-switch v-model="formData.config.pay_explain_switch" :active-value="1" :inactive-value="0"/>
|
||||
</el-form-item>
|
||||
<template v-if="formData.config.pay_explain_switch == 1">
|
||||
<el-form-item :label="t('friendsPayTitle')" prop="config.pay_explain_title">
|
||||
<el-input v-model.trim="formData.config.pay_explain_title" :placeholder="t('friendsPayTitlePlaceholder')" class="input-width" maxlength="10" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('desContent')" prop="config.pay_explain_content">
|
||||
<el-input v-model.trim="formData.config.pay_explain_content" :placeholder="t('desContentPlaceholder')" class="input-width" type="textarea" rows="4" maxlength="120" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item :label="t('friendsPayGoodsSwitch')">
|
||||
<div>
|
||||
<el-switch v-model="formData.config.pay_info_switch" :active-value="1" :inactive-value="0"/>
|
||||
<div class="text-[12px] text-[#999] leading-[20px]">{{ t('friendsPayGoodsSwitchTips') }}</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('friendsPayName')" prop="config.pay_type_name">
|
||||
<el-input v-model.trim="formData.config.pay_type_name" :placeholder="t('friendsPayNamePlaceholder')" class="input-width" maxlength="10" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('helpName')" prop="config.pay_page_name">
|
||||
<el-input v-model.trim="formData.config.pay_page_name" :placeholder="t('helpNamePlaceholder')" class="input-width" maxlength="10" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('helpBtn')" prop="config.pay_button_name">
|
||||
<el-input v-model.trim="formData.config.pay_button_name" :placeholder="t('helpBtnPlaceholder')" class="input-width" maxlength="10" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('remark')" prop="config.pay_leave_message">
|
||||
<el-input v-model.trim="formData.config.pay_leave_message" :placeholder="t('remarkPlaceholder')" class="input-width" type="textarea" rows="4" maxlength="20" show-word-limit clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="cancel()">{{ t('cancel') }}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{t('confirm')}}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { t } from '@/lang'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Test from '@/utils/test'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
|
||||
const showDialog = ref(false)
|
||||
const loading = ref(true)
|
||||
const initData = ref<any>(null)
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
const initialFormData = {
|
||||
type: 'friendspay',
|
||||
app_id: '',
|
||||
config: {
|
||||
pay_explain_switch: 0,
|
||||
pay_info_switch: 1,
|
||||
pay_explain_title: '',
|
||||
pay_explain_content: '',
|
||||
pay_type_name: '',
|
||||
pay_page_name: '',
|
||||
pay_button_name: '',
|
||||
pay_leave_message: '',
|
||||
},
|
||||
channel: '',
|
||||
status: 0,
|
||||
is_default: 0
|
||||
}
|
||||
const formData: Record<string, any> = reactive({ ...initialFormData })
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
// 表单验证规则
|
||||
const formRules = computed(() => {
|
||||
return {
|
||||
'config.pay_explain_title': [
|
||||
{ required: true, message: t('friendsPayTitlePlaceholder'), trigger: 'blur' },
|
||||
{
|
||||
validator: (rule: any, value: string, callback: any) => {
|
||||
if (formData.config.pay_explain_switch == 1 && value === '') {
|
||||
callback(new Error(t('friendsPayTitlePlaceholder')))
|
||||
}
|
||||
|
||||
callback()
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
'config.pay_explain_content': [
|
||||
{ required: true, message: t('desContentPlaceholder'), trigger: 'blur' },
|
||||
{
|
||||
validator: (rule: any, value: string, callback: any) => {
|
||||
if (formData.config.pay_explain_switch == 1 && value === '') {
|
||||
callback(new Error(t('desContentPlaceholder')))
|
||||
}
|
||||
|
||||
callback()
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
'config.pay_type_name': [
|
||||
{ required: true, message: t('friendsPayNamePlaceholder'), trigger: 'blur' }
|
||||
],
|
||||
'config.pay_page_name': [
|
||||
{ required: true, message: t('helpNamePlaceholder'), trigger: 'blur' }
|
||||
],
|
||||
'config.pay_button_name': [
|
||||
{ required: true, message: t('helpBtnPlaceholder'), trigger: 'blur' }
|
||||
],
|
||||
'config.pay_leave_message': [
|
||||
{ required: true, message: t('remarkPlaceholder'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['complete'])
|
||||
/**
|
||||
* 确认
|
||||
* @param formEl
|
||||
*/
|
||||
const confirm = async (formEl: FormInstance | undefined) => {
|
||||
if (loading.value || !formEl) return
|
||||
await formEl.validate(async (valid) => {
|
||||
if (valid) {
|
||||
emit('complete', formData)
|
||||
showDialog.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
Object.assign(formData, initialFormData)
|
||||
if (initData.value) {
|
||||
Object.keys(formData).forEach((key: string) => {
|
||||
if (initData.value[key] != undefined) formData[key] = initData.value[key]
|
||||
})
|
||||
formData.channel = initData.value.redio_key.split('_')[0]
|
||||
formData.status = Number(formData.status)
|
||||
}
|
||||
emit('complete', formData)
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
const setFormData = async (data: any = null) => {
|
||||
initData.value = cloneDeep(data)
|
||||
loading.value = true
|
||||
Object.assign(formData, initialFormData)
|
||||
if (data) {
|
||||
Object.keys(formData).forEach((key: string) => {
|
||||
if (data[key] != undefined) formData[key] = data[key]
|
||||
})
|
||||
formData.channel = data.redio_key.split('_')[0]
|
||||
formData.status = Number(formData.status)
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
const enableVerify = () => {
|
||||
let verify = true
|
||||
if ((formData.config.pay_explain_switch == 1 && Test.empty(formData.config.pay_explain_title)) || (formData.config.pay_explain_switch == 1 && Test.empty(formData.config.pay_explain_content)) || Test.empty(formData.config.pay_type_name) || Test.empty(formData.config.pay_page_name) || Test.empty(formData.config.pay_button_name) || Test.empty(formData.config.pay_leave_message)) verify = false
|
||||
return verify
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
showDialog,
|
||||
setFormData,
|
||||
enableVerify
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@ -71,7 +71,7 @@
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="showDialog = false">{{ t('cancel') }}</el-button>
|
||||
<el-button @click="cancel">{{ t('cancel') }}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="confirm(formRef)">{{ t('confirm') }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
@ -85,11 +85,13 @@ import { FormInstance, ElMessage } from 'element-plus'
|
||||
import Test from '@/utils/test'
|
||||
import { getUrl } from '@/app/api/sys'
|
||||
import { useClipboard } from '@vueuse/core'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
|
||||
const showDialog = ref(false)
|
||||
const loading = ref(true)
|
||||
const wapDomain = ref('')
|
||||
const serviceDomain = ref('')
|
||||
const initData = ref<any>(null)
|
||||
|
||||
getUrl().then((res: any) => {
|
||||
wapDomain.value = res.data.wap_domain
|
||||
@ -151,7 +153,20 @@ const confirm = async (formEl: FormInstance | undefined) => {
|
||||
})
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
Object.assign(formData, initialFormData)
|
||||
if (initData.value) {
|
||||
Object.keys(formData).forEach((key: string) => {
|
||||
if (initData.value[key] != undefined) formData[key] = initData.value[key]
|
||||
})
|
||||
formData.channel = initData.value.redio_key.split('_')[0]
|
||||
formData.status = Number(formData.status)
|
||||
}
|
||||
emit('complete', formData)
|
||||
showDialog.value = false
|
||||
}
|
||||
const setFormData = async (data: any = null) => {
|
||||
initData.value = cloneDeep(data)
|
||||
loading.value = true
|
||||
Object.assign(formData, initialFormData)
|
||||
if (data) {
|
||||
|
||||
@ -14,17 +14,17 @@
|
||||
|
||||
<div>
|
||||
<div class="flex items-center justify-between p-[10px] table-item-border bg">
|
||||
<span class="text-base w-[150px]">{{ t('payType') }}</span>
|
||||
<span class="text-base w-[230px]">{{ t('payType') }}</span>
|
||||
<span class="text-base w-[110px] text-center">{{ t('onState') }}</span>
|
||||
<span class="text-base w-[80px] text-center" v-if="isEdit">{{ t('templateName') }}</span>
|
||||
</div>
|
||||
|
||||
<div ref="fieldBoxRefs" :data-key="payKey">
|
||||
<div class="flex items-center justify-between p-[10px] table-item-border" v-for="(childrenItem, childrenIndex) in payItems.pay_type" :key="childrenItem.redio_key" :id="payKey + '_' + childrenIndex">
|
||||
<div class="flex w-[150px]">
|
||||
<div class="flex w-[230px] flex-shrink-0">
|
||||
<span v-if="isEdit" class="iconfont icontuodong mr-2 handle cursor-pointer"></span>
|
||||
<div class="flex items-center select-none">
|
||||
<div class="mr-[15px] w-[30px] h-[30px]">
|
||||
<div class="mr-[15px] w-[30px] h-[30px] flex-shrink-0">
|
||||
<img class="w-[30px]" :src="img(childrenItem.icon)" />
|
||||
</div>
|
||||
<span class="text-base text-[#666]">{{ childrenItem.name }}</span>
|
||||
@ -134,6 +134,7 @@ const setConfigInfo = (data:any) => {
|
||||
element.config = data.config
|
||||
}
|
||||
})
|
||||
console.log(payConfigData.value)
|
||||
}
|
||||
|
||||
// 初始化配置信息
|
||||
|
||||
@ -16,20 +16,20 @@
|
||||
<div v-for="(item, key) in rules.grant" :key="key" class="flex items-center">
|
||||
<span class="p-[15px] w-[25%] text-[14px]">{{ item.name }}</span>
|
||||
<span class="p-[15px] w-[50%] text-[14px] text-[#666]">{{ formData.grant[item.key] && formData.grant[item.key].content ? formData.grant[item.key].content : '--' }}</span>
|
||||
<span class="p-[15px] w-[10%] text-[14px] text-[#666]">
|
||||
<span class="p-[15px] w-[15%] text-[14px] text-[#666]">
|
||||
<el-tag type="success" v-if="formData.grant[item.key] && formData.grant[item.key].is_use">已启用</el-tag>
|
||||
<el-tag type="danger" v-else>未启用</el-tag>
|
||||
</span>
|
||||
<span class="p-[15px] w-[15%] text-[14px] text-[#666] text-[var(--el-color-primary)] cursor-pointer" @click="examineFn(key)">配置</span>
|
||||
<span class="p-[15px] w-[10%] text-[14px] text-[#666] text-[var(--el-color-primary)] cursor-pointer" @click="examineFn(key)">配置</span>
|
||||
</div>
|
||||
<div v-for="(item, key) in rules.consume" :key="key" class="flex items-center">
|
||||
<span class="p-[15px] w-[25%] text-[14px]">{{ item.name }}</span>
|
||||
<span class="p-[15px] w-[50%] text-[14px] text-[#666]">{{ formData.consume[item.key] && formData.consume[item.key].content ? formData.consume[item.key].content : '--' }}</span>
|
||||
<span class="p-[15px] w-[10%] text-[14px] text-[#666]">
|
||||
<span class="p-[15px] w-[15%] text-[14px] text-[#666]">
|
||||
<el-tag type="success" v-if="formData.consume[item.key] && formData.consume[item.key].is_use">已启用</el-tag>
|
||||
<el-tag type="danger" v-else>未启用</el-tag>
|
||||
</span>
|
||||
<span class="p-[15px] w-[15%] text-[14px] text-[#666] text-[var(--el-color-primary)] cursor-pointer" @click="examineFn(key)">配置</span>
|
||||
<span class="p-[15px] w-[10%] text-[14px] text-[#666] text-[var(--el-color-primary)] cursor-pointer" @click="examineFn(key)">配置</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -105,6 +105,16 @@ html, body {
|
||||
transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out;
|
||||
}
|
||||
}
|
||||
/* 单行超出隐藏 */
|
||||
.using-hidden {
|
||||
word-break: break-all;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
white-space: break-spaces;
|
||||
}
|
||||
|
||||
/** 多行超出隐藏 **/
|
||||
.multi-hidden {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "nc-iconfont"; /* Project id 4567203 */
|
||||
src: url('//at.alicdn.com/t/c/font_4567203_unxj5bqsj6o.woff2?t=1732704100572') format('woff2'),
|
||||
url('//at.alicdn.com/t/c/font_4567203_unxj5bqsj6o.woff?t=1732704100572') format('woff'),
|
||||
url('//at.alicdn.com/t/c/font_4567203_unxj5bqsj6o.ttf?t=1732704100572') format('truetype');
|
||||
src: url('//at.alicdn.com/t/c/font_4567203_vnozyu9086.woff2?t=1734084780804') format('woff2'),
|
||||
url('//at.alicdn.com/t/c/font_4567203_vnozyu9086.woff?t=1734084780804') format('woff'),
|
||||
url('//at.alicdn.com/t/c/font_4567203_vnozyu9086.ttf?t=1734084780804') format('truetype');
|
||||
}
|
||||
|
||||
.nc-iconfont {
|
||||
@ -13,6 +13,22 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.nc-icon-daifujineV6xx:before {
|
||||
content: "\e83b";
|
||||
}
|
||||
|
||||
.nc-icon-daifuliuyanV6xx:before {
|
||||
content: "\e83a";
|
||||
}
|
||||
|
||||
.nc-icon-jichuxinxiV6xx:before {
|
||||
content: "\e838";
|
||||
}
|
||||
|
||||
.nc-icon-dianpuzhandianV6xx:before {
|
||||
content: "\e836";
|
||||
}
|
||||
|
||||
.nc-icon-gouwucheV6xx6:before {
|
||||
content: "\e835";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user