mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 10:57:26 +08:00
feat: 增强组件功能与样式优化
- 在多个组件中添加了新的属性和方法以提升功能性,如在卡片组件中引入 _ActiveTab 属性以管理活动标签。 - 优化了商品详情和商户页面的收藏逻辑,确保在未登录状态下引导用户登录。 - 更新了轮播组件的路由解析逻辑,增强了用户体验。 - 改进了投诉列表和收藏列表的样式,提升了响应式布局和可读性。 - 在全局配置中添加了对开发环境的错误处理,提升了调试体验。
This commit is contained in:
@@ -31,9 +31,8 @@
|
||||
{{ showZoneText(zone) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="hotzone-box-item-actions">
|
||||
<div class="hotzone-btn" @click="editZone(index)">修改</div>
|
||||
|
||||
<div class="hotzone-btn" @click="delZone(index)">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -241,13 +240,16 @@ export default {
|
||||
}
|
||||
> div:nth-of-type(2) {
|
||||
width: 50%;
|
||||
min-width: 0;
|
||||
background: #f7f7f7;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.hotzone-add-box-body {
|
||||
height: 90%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.hotzone-box-item-main {
|
||||
@@ -258,11 +260,18 @@ export default {
|
||||
.hotzone-box-item {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
border-bottom: 1px solid #ededed;
|
||||
font-size: 12px;
|
||||
justify-content: space-between;
|
||||
padding: 5px 10px 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
min-width: 0;
|
||||
|
||||
> div:nth-child(2) {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.hotzone-add-box-footer {
|
||||
@@ -282,8 +291,18 @@ export default {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.hotzone-box-item-actions {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.hotzone-box-item-text {
|
||||
width: 200px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<img class="show-image" :src="zoneForm.img" alt />
|
||||
</div>
|
||||
|
||||
<el-form :model="zoneForm" label-width="80px">
|
||||
<el-form :model="zoneForm" label-width="90px" class="hz-edit-form">
|
||||
<el-form-item label="跳转链接:">
|
||||
<el-input type="textarea" v-if="zoneForm.type === 'other' && zoneForm.title === '外部链接'" v-model="zoneForm.link" />
|
||||
<el-button size="small" type="primary" @click="handleSelectLink"
|
||||
@@ -252,3 +252,9 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.hz-edit-form :deep(.el-form-item__label) {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,34 +1,31 @@
|
||||
import _ from '../utils'
|
||||
|
||||
export default {
|
||||
bind: function (el, binding, vnode) {
|
||||
const MIN_LIMIT = _.MIN_LIMIT
|
||||
mounted(el, binding) {
|
||||
const handleMouseDown = (e) => {
|
||||
const ctx = binding.instance
|
||||
if (!ctx) return
|
||||
|
||||
el.addEventListener('mousedown', handleMouseDown, { passive: false })
|
||||
|
||||
function handleMouseDown(e) {
|
||||
// console.log('additem', e)
|
||||
e && e.preventDefault()
|
||||
|
||||
let itemInfo = {
|
||||
top: _.getDistanceY(e, el),
|
||||
left: _.getDistanceX(e, el),
|
||||
width: 0,
|
||||
height: 0
|
||||
height: 0,
|
||||
}
|
||||
let container = _.getOffset(el)
|
||||
const container = _.getOffset(el)
|
||||
|
||||
// Only used once at the beginning of init
|
||||
let setting = {
|
||||
const setting = {
|
||||
topPer: _.decimalPoint(itemInfo.top / container.height),
|
||||
leftPer: _.decimalPoint(itemInfo.left / container.width),
|
||||
widthPer: 0,
|
||||
heightPer: 0
|
||||
heightPer: 0,
|
||||
}
|
||||
let preX = _.getPageX(e)
|
||||
let preY = _.getPageY(e)
|
||||
|
||||
vnode.context.addItem(setting)// 这里去添加并发送了add通知,不应该发送通知
|
||||
ctx.addItem(setting)
|
||||
|
||||
window.addEventListener('mousemove', handleChange, { passive: false })
|
||||
window.addEventListener('mouseup', handleMouseUp, { passive: false })
|
||||
@@ -36,56 +33,58 @@ export default {
|
||||
function handleChange(e) {
|
||||
e && e.preventDefault()
|
||||
|
||||
let moveX = _.getPageX(e) - preX
|
||||
let moveY = _.getPageY(e) - preY
|
||||
const moveX = _.getPageX(e) - preX
|
||||
const moveY = _.getPageY(e) - preY
|
||||
preX = _.getPageX(e)
|
||||
preY = _.getPageY(e)
|
||||
|
||||
// Not consider the direction of movement first, consider only the lower right drag point
|
||||
let minLimit = 0
|
||||
// 添加热区时,判定鼠标释放时,满足(热区大于48*48时)条件时生效
|
||||
let styleInfo = _.dealBR(itemInfo, moveX, moveY, minLimit)
|
||||
const minLimit = 0
|
||||
const styleInfo = _.dealBR(itemInfo, moveX, moveY, minLimit)
|
||||
|
||||
// Boundary value processing 改变热区大小时边界条件的处理
|
||||
itemInfo = _.dealEdgeValue(itemInfo, styleInfo, container, vnode.context.zones)
|
||||
itemInfo = _.dealEdgeValue(itemInfo, styleInfo, container, ctx.zones)
|
||||
|
||||
Object.assign(el.lastElementChild.style, {
|
||||
top: `${itemInfo.top}px`,
|
||||
left: `${itemInfo.left}px`,
|
||||
width: `${itemInfo.width}px`,
|
||||
height: `${itemInfo.height}px`
|
||||
height: `${itemInfo.height}px`,
|
||||
})
|
||||
}
|
||||
|
||||
function handleMouseUp() {
|
||||
let perInfo = {
|
||||
const perInfo = {
|
||||
topPer: _.decimalPoint(itemInfo.top / container.height),
|
||||
leftPer: _.decimalPoint(itemInfo.left / container.width),
|
||||
widthPer: _.decimalPoint(itemInfo.width / container.width),
|
||||
heightPer: _.decimalPoint(itemInfo.height / container.height),
|
||||
img: "",
|
||||
link: "",
|
||||
type: "",
|
||||
title: ""
|
||||
img: '',
|
||||
link: '',
|
||||
type: '',
|
||||
title: '',
|
||||
}
|
||||
|
||||
if (vnode.context.isOverRange()) {
|
||||
vnode.context.overRange() // 判断超出个数限制,给overRange钩子抛回调
|
||||
} else if (container.height < MIN_LIMIT && itemInfo.width > MIN_LIMIT) {
|
||||
vnode.context.changeItem(Object.assign(perInfo, {
|
||||
topPer: 0,
|
||||
heightPer: 1
|
||||
}), true)
|
||||
} else if (container.width < MIN_LIMIT && itemInfo.height > MIN_LIMIT) {
|
||||
vnode.context.changeItem(Object.assign(perInfo, {
|
||||
leftper: 0,
|
||||
widthPer: 1
|
||||
}), true)
|
||||
} else if (itemInfo.width > MIN_LIMIT && itemInfo.height > MIN_LIMIT) {
|
||||
vnode.context.changeItem(perInfo, true)
|
||||
if (ctx.isOverRange()) {
|
||||
ctx.overRange()
|
||||
} else if (container.height < _.MIN_LIMIT && itemInfo.width > _.MIN_LIMIT) {
|
||||
ctx.changeItem(
|
||||
Object.assign(perInfo, {
|
||||
topPer: 0,
|
||||
heightPer: 1,
|
||||
}),
|
||||
true
|
||||
)
|
||||
} else if (container.width < _.MIN_LIMIT && itemInfo.height > _.MIN_LIMIT) {
|
||||
ctx.changeItem(
|
||||
Object.assign(perInfo, {
|
||||
leftper: 0,
|
||||
widthPer: 1,
|
||||
}),
|
||||
true
|
||||
)
|
||||
} else if (itemInfo.width > _.MIN_LIMIT && itemInfo.height > _.MIN_LIMIT) {
|
||||
ctx.changeItem(perInfo, true)
|
||||
} else {
|
||||
// 当添加区域超出范围或小于最小区域(48*48)时触发,删除当亲绘制的热区并发送erase事件通知
|
||||
vnode.context.eraseItem()
|
||||
ctx.eraseItem()
|
||||
}
|
||||
|
||||
window.removeEventListener('mousemove', handleChange)
|
||||
@@ -93,9 +92,10 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
el.$destroy = () => el.removeEventListener('mousedown', handleMouseDown)
|
||||
el.__hotzoneAddDestroy = () => el.removeEventListener('mousedown', handleMouseDown)
|
||||
el.addEventListener('mousedown', handleMouseDown, { passive: false })
|
||||
},
|
||||
beforeUnmount(el) {
|
||||
el.__hotzoneAddDestroy?.()
|
||||
},
|
||||
unbind: function (el) {
|
||||
el.$destroy()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import _ from '../utils'
|
||||
|
||||
export default {
|
||||
bind: function (el, binding, vnode) {
|
||||
el.addEventListener('mousedown', handleMouseDown,{ passive: false })
|
||||
mounted(el, binding) {
|
||||
const handleMouseDown = (e) => {
|
||||
const ctx = binding.instance
|
||||
if (!ctx) return
|
||||
|
||||
function handleMouseDown (e) {
|
||||
let pointer = e.target.dataset.pointer //元素上绑定的方法名
|
||||
const pointer = e.target.dataset.pointer
|
||||
|
||||
if (!pointer) {
|
||||
return
|
||||
@@ -13,79 +14,81 @@ export default {
|
||||
|
||||
e && e.stopPropagation()
|
||||
|
||||
let zone = el.parentNode
|
||||
let setting = vnode.context.setting
|
||||
let currentIndex = vnode.context.index
|
||||
let container = _.getOffset(zone.parentNode)
|
||||
const zone = el.parentNode
|
||||
const setting = ctx.setting
|
||||
const currentIndex = ctx.index
|
||||
const container = _.getOffset(zone.parentNode)
|
||||
let itemInfo = {
|
||||
width: _.getOffset(zone).width || 0,
|
||||
height: _.getOffset(zone).height || 0,
|
||||
top: setting.topPer * container.height || 0,
|
||||
left: setting.leftPer * container.width || 0
|
||||
left: setting.leftPer * container.width || 0,
|
||||
}
|
||||
let preX = _.getPageX(e)
|
||||
let preY = _.getPageY(e)
|
||||
let flag
|
||||
|
||||
// Hide the info displayed by hover
|
||||
vnode.context.handlehideZone(true)
|
||||
ctx.handlehideZone(true)
|
||||
|
||||
window.addEventListener('mousemove', handleChange,{ passive: false })
|
||||
window.addEventListener('mouseup', handleMouseUp,{ passive: false })
|
||||
window.addEventListener('mousemove', handleChange, { passive: false })
|
||||
window.addEventListener('mouseup', handleMouseUp, { passive: false })
|
||||
|
||||
function handleChange (e) {
|
||||
function handleChange(e) {
|
||||
e && e.preventDefault()
|
||||
flag = true
|
||||
|
||||
let moveX = _.getPageX(e) - preX
|
||||
let moveY = _.getPageY(e) - preY
|
||||
const moveX = _.getPageX(e) - preX
|
||||
const moveY = _.getPageY(e) - preY
|
||||
|
||||
preX = _.getPageX(e)
|
||||
preY = _.getPageY(e)
|
||||
|
||||
// Handling the situation when different dragging points are selected
|
||||
let styleInfo = _[pointer](itemInfo, moveX, moveY)//调用对应的方法
|
||||
// Boundary value processing
|
||||
itemInfo = _.dealEdgeValue(itemInfo, styleInfo, container, vnode.context.$parent.zones, currentIndex)
|
||||
const styleInfo = _[pointer](itemInfo, moveX, moveY)
|
||||
itemInfo = _.dealEdgeValue(
|
||||
itemInfo,
|
||||
styleInfo,
|
||||
container,
|
||||
ctx.$parent.zones,
|
||||
currentIndex
|
||||
)
|
||||
|
||||
Object.assign(zone.style, {
|
||||
top: `${itemInfo.top}px`,
|
||||
left: `${itemInfo.left}px`,
|
||||
width: `${itemInfo.width}px`,
|
||||
height: `${itemInfo.height}px`
|
||||
height: `${itemInfo.height}px`,
|
||||
})
|
||||
}
|
||||
|
||||
function handleMouseUp () {
|
||||
function handleMouseUp() {
|
||||
if (flag) {
|
||||
flag = false
|
||||
let perInfo = {
|
||||
const perInfo = {
|
||||
topPer: _.decimalPoint(itemInfo.top / container.height),
|
||||
leftPer: _.decimalPoint(itemInfo.left / container.width),
|
||||
widthPer: _.decimalPoint(itemInfo.width / container.width),
|
||||
heightPer: _.decimalPoint(itemInfo.height / container.height)
|
||||
heightPer: _.decimalPoint(itemInfo.height / container.height),
|
||||
}
|
||||
vnode.context.changeInfo(perInfo)
|
||||
ctx.changeInfo(perInfo)
|
||||
|
||||
// 兼容数据无变更情况下导致 computed 不更新,数据仍为 px 时 resize 出现的问题
|
||||
Object.assign(zone.style, {
|
||||
top: `${itemInfo.top}px`,
|
||||
left: `${itemInfo.left}px`,
|
||||
width: `${itemInfo.width}px`,
|
||||
height: `${itemInfo.height}px`
|
||||
height: `${itemInfo.height}px`,
|
||||
})
|
||||
}
|
||||
// Show the info
|
||||
vnode.context.handlehideZone(false)
|
||||
ctx.handlehideZone(false)
|
||||
|
||||
window.removeEventListener('mousemove', handleChange)
|
||||
window.removeEventListener('mouseup', handleMouseUp)
|
||||
}
|
||||
}
|
||||
|
||||
el.$destroy = () => el.removeEventListener('mousedown', handleMouseDown)
|
||||
el.__hotzoneResizeDestroy = () => el.removeEventListener('mousedown', handleMouseDown)
|
||||
el.addEventListener('mousedown', handleMouseDown, { passive: false })
|
||||
},
|
||||
beforeUnmount(el) {
|
||||
el.__hotzoneResizeDestroy?.()
|
||||
},
|
||||
unbind: function (el) {
|
||||
el.$destroy()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
import _ from '../utils'
|
||||
|
||||
export default {
|
||||
bind: function (el, binding, vnode) {
|
||||
el.addEventListener('mousedown', handleMouseDown)
|
||||
mounted(el, binding) {
|
||||
let collision
|
||||
function handleMouseDown (e) {
|
||||
const handleMouseDown = (e) => {
|
||||
const ctx = binding.instance
|
||||
if (!ctx) return
|
||||
|
||||
e && e.stopPropagation()
|
||||
let container = _.getOffset(el.parentNode)
|
||||
const container = _.getOffset(el.parentNode)
|
||||
let preX = _.getPageX(e)
|
||||
let preY = _.getPageY(e)
|
||||
let topPer
|
||||
let leftPer
|
||||
let flag
|
||||
|
||||
window.addEventListener('mousemove', handleChange,{ passive: false })
|
||||
window.addEventListener('mouseup', handleMouseUp,{ passive: false })
|
||||
window.addEventListener('mousemove', handleChange, { passive: false })
|
||||
window.addEventListener('mouseup', handleMouseUp, { passive: false })
|
||||
|
||||
function handleChange (e) {
|
||||
function handleChange(e) {
|
||||
e && e.preventDefault()
|
||||
flag = true
|
||||
collision = false
|
||||
// Hide the info displayed by hover
|
||||
vnode.context.handlehideZone(true)
|
||||
ctx.handlehideZone(true)
|
||||
|
||||
let setting = vnode.context.setting
|
||||
let currentIndex = vnode.context.index
|
||||
const setting = ctx.setting
|
||||
const currentIndex = ctx.index
|
||||
let moveX = _.getPageX(e) - preX
|
||||
let moveY = _.getPageY(e) - preY
|
||||
|
||||
@@ -33,7 +34,6 @@ export default {
|
||||
topPer = _.decimalPoint(moveY / container.height + setting.topPer)
|
||||
leftPer = _.decimalPoint(moveX / container.width + setting.leftPer)
|
||||
|
||||
// Hotzone moving boundary processing
|
||||
if (topPer < 0) {
|
||||
topPer = 0
|
||||
moveY = -container.height * setting.topPer
|
||||
@@ -53,23 +53,20 @@ export default {
|
||||
leftPer = 1 - setting.widthPer
|
||||
moveX = container.width * (leftPer - setting.leftPer)
|
||||
}
|
||||
// 拖拽碰撞检测
|
||||
if (vnode.context.$parent.zones.length > 1) {
|
||||
let currentzones = JSON.parse(JSON.stringify(vnode.context.$parent.zones)).map((zone) => {
|
||||
return {
|
||||
left: (zone.leftPer || 0) * container.width,
|
||||
top: (zone.topPer || 0) * container.height,
|
||||
width: (zone.widthPer || 0) * container.width,
|
||||
height: (zone.heightPer || 0) * container.height
|
||||
}
|
||||
})
|
||||
// 矫正
|
||||
let changeSetting = {}
|
||||
changeSetting.left = setting.leftPer * container.width + moveX
|
||||
changeSetting.top = setting.topPer * container.height + moveY
|
||||
changeSetting.width = setting.widthPer * container.width
|
||||
changeSetting.height = setting.heightPer * container.height
|
||||
// 碰撞检测
|
||||
|
||||
if (ctx.$parent.zones.length > 1) {
|
||||
const currentzones = JSON.parse(JSON.stringify(ctx.$parent.zones)).map((zone) => ({
|
||||
left: (zone.leftPer || 0) * container.width,
|
||||
top: (zone.topPer || 0) * container.height,
|
||||
width: (zone.widthPer || 0) * container.width,
|
||||
height: (zone.heightPer || 0) * container.height,
|
||||
}))
|
||||
const changeSetting = {
|
||||
left: setting.leftPer * container.width + moveX,
|
||||
top: setting.topPer * container.height + moveY,
|
||||
width: setting.widthPer * container.width,
|
||||
height: setting.heightPer * container.height,
|
||||
}
|
||||
for (let i = 0, len = currentzones.length; i < len; i++) {
|
||||
if (currentIndex !== i && _.handleEgdeCollisions(currentzones[i], changeSetting)) {
|
||||
collision = true
|
||||
@@ -80,29 +77,29 @@ export default {
|
||||
el.style.transform = `translate(${moveX}px, ${moveY}px)`
|
||||
}
|
||||
|
||||
function handleMouseUp () {
|
||||
function handleMouseUp() {
|
||||
if (flag) {
|
||||
flag = false
|
||||
el.style.transform = 'translate(0, 0)'
|
||||
if (!collision) {
|
||||
vnode.context.changeInfo({
|
||||
ctx.changeInfo({
|
||||
topPer,
|
||||
leftPer
|
||||
leftPer,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Show the info
|
||||
vnode.context.handlehideZone(false)
|
||||
ctx.handlehideZone(false)
|
||||
|
||||
window.removeEventListener('mousemove', handleChange)
|
||||
window.removeEventListener('mouseup', handleMouseUp)
|
||||
}
|
||||
}
|
||||
|
||||
el.$destroy = () => el.removeEventListener('mousedown', handleMouseDown)
|
||||
el.__hotzoneDragDestroy = () => el.removeEventListener('mousedown', handleMouseDown)
|
||||
el.addEventListener('mousedown', handleMouseDown)
|
||||
},
|
||||
beforeUnmount(el) {
|
||||
el.__hotzoneDragDestroy?.()
|
||||
},
|
||||
unbind: function (el) {
|
||||
el.$destroy()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
destroy-on-close
|
||||
@close="clickClose"
|
||||
>
|
||||
<template v-if="flag">
|
||||
<template v-if="flag && hotzoneRes">
|
||||
<hotzone
|
||||
ref="hotzone"
|
||||
@change="changeHotzone"
|
||||
:zonesInit="res.zoneInfo"
|
||||
:image="res.img"
|
||||
:zonesInit="hotzoneRes.zoneInfo"
|
||||
:image="hotzoneRes.img"
|
||||
></hotzone>
|
||||
</template>
|
||||
<template #footer>
|
||||
@@ -31,30 +31,35 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
flag: false, // modal显隐
|
||||
flag: false,
|
||||
hotzoneRes: null,
|
||||
};
|
||||
},
|
||||
props: ["res"],
|
||||
mounted() {},
|
||||
methods: {
|
||||
changeHotzone(info) {
|
||||
if (this.hotzoneRes) {
|
||||
this.hotzoneRes.zoneInfo = info;
|
||||
}
|
||||
this.$emit("changeZone", info);
|
||||
},
|
||||
// 关闭弹窗
|
||||
clickClose() {
|
||||
this.flag = false;
|
||||
this.hotzoneRes = null;
|
||||
this.$emit("closeFlag", false);
|
||||
},
|
||||
// 点击确认
|
||||
clickOK() {
|
||||
this.clickClose();
|
||||
},
|
||||
// 打开组件方法
|
||||
open(type, mutiple) {
|
||||
open(val) {
|
||||
this.hotzoneRes = val || null;
|
||||
if (this.hotzoneRes && !this.hotzoneRes.zoneInfo) {
|
||||
this.hotzoneRes.zoneInfo = [];
|
||||
}
|
||||
this.flag = true;
|
||||
},
|
||||
// 关闭组件
|
||||
close() {
|
||||
this.flag = false;
|
||||
this.hotzoneRes = null;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -58,8 +58,9 @@ export default {
|
||||
},
|
||||
// 关闭弹窗
|
||||
clickClose() {
|
||||
this.$emit("closeFlag", false);
|
||||
this.flag = false;
|
||||
this.goodsFlag = false;
|
||||
this.$emit("closeFlag", false);
|
||||
},
|
||||
// 单选商品
|
||||
singleGoods() {
|
||||
|
||||
@@ -39,7 +39,7 @@ export const Notice = {
|
||||
|
||||
export const Modal = {
|
||||
confirm(options = {}) {
|
||||
const content = options.content || options.title || "确认操作?";
|
||||
const content = normalizeModalContent(options.content || options.title || "确认操作?");
|
||||
const title = options.title || "提示";
|
||||
return ElMessageBox.confirm(content, title, {
|
||||
confirmButtonText: options.okText || "确定",
|
||||
@@ -76,6 +76,18 @@ export const Modal = {
|
||||
}
|
||||
});
|
||||
},
|
||||
warning(options = {}) {
|
||||
const content = normalizeModalContent(options.content || options.title || "");
|
||||
const title = options.title || "提示";
|
||||
return ElMessageBox.alert(content, title, {
|
||||
confirmButtonText: options.okText || "确定",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
if (typeof options.onOk === "function") {
|
||||
return options.onOk();
|
||||
}
|
||||
});
|
||||
},
|
||||
remove() {
|
||||
try {
|
||||
ElMessageBox.close();
|
||||
@@ -91,6 +103,11 @@ function normalize(content) {
|
||||
return String(content ?? "");
|
||||
}
|
||||
|
||||
function normalizeModalContent(content) {
|
||||
const text = normalize(content);
|
||||
return text.replace(/<\/?p>/gi, "").trim();
|
||||
}
|
||||
|
||||
export function setupLegacyMessage(app) {
|
||||
app.config.globalProperties.$Message = Message;
|
||||
app.config.globalProperties.$Modal = Modal;
|
||||
|
||||
35
manager/src/utils/print.js
Normal file
35
manager/src/utils/print.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 打印指定 DOM 区域(替代 vue-print-nb)
|
||||
*/
|
||||
export function printElement(elementId, title = "打印") {
|
||||
const el = document.getElementById(elementId);
|
||||
if (!el) {
|
||||
console.warn(`[print] element #${elementId} not found`);
|
||||
return;
|
||||
}
|
||||
const iframe = document.createElement("iframe");
|
||||
iframe.style.cssText = "position:fixed;right:0;bottom:0;width:0;height:0;border:0";
|
||||
document.body.appendChild(iframe);
|
||||
const doc = iframe.contentWindow.document;
|
||||
doc.open();
|
||||
doc.write(
|
||||
`<!DOCTYPE html><html><head><title>${title}</title><style>
|
||||
body{font-family:Arial,sans-serif;padding:12px;color:#333}
|
||||
table{width:100%;border-collapse:collapse}
|
||||
td,th{border:1px solid #ddd;padding:6px}
|
||||
.lineH30{line-height:30px}
|
||||
.f14{font-size:14px;color:#333}
|
||||
.printgoodtitle{font-size:14px;line-height:1.5;margin-top:15px;color:#333}
|
||||
.printgoodinfo{padding:10px}
|
||||
.printgooditem{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid #eee}
|
||||
.printgoodname{flex:1}
|
||||
.printgoodguid{margin-top:4px;color:#666;font-size:12px}
|
||||
.printgoodguiditem{margin-right:8px}
|
||||
.printgoodnumber{white-space:nowrap;margin-left:12px}
|
||||
</style></head><body>${el.innerHTML}</body></html>`
|
||||
);
|
||||
doc.close();
|
||||
iframe.contentWindow.focus();
|
||||
iframe.contentWindow.print();
|
||||
setTimeout(() => document.body.removeChild(iframe), 1000);
|
||||
}
|
||||
@@ -6,7 +6,11 @@
|
||||
<div class="sidebar-menu-con menu-bar">
|
||||
<shrinkable-menu />
|
||||
</div>
|
||||
<div class="main-header-con" :style="{ height: '60px' }">
|
||||
<div
|
||||
class="main-header-con"
|
||||
:class="{ 'has-tabs': setting.isUseTabsRouter }"
|
||||
:style="{ height: setting.isUseTabsRouter ? '106px' : '60px' }"
|
||||
>
|
||||
<div class="main-header">
|
||||
<div class="header-logo-con">
|
||||
<img :src="domainLogo" key="max-logo" />
|
||||
@@ -51,15 +55,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="breadcrumb-bar" v-if="setting.isUseTabsRouter">
|
||||
<page-breadcrumb />
|
||||
<div class="tags-con" v-if="setting.isUseTabsRouter">
|
||||
<tags-page-opened :pageTagsList="pageTagsList" />
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="single-page-con"
|
||||
:style="{
|
||||
top: setting.isUseTabsRouter ? '104px' : '60px',
|
||||
height: setting.isUseTabsRouter ? 'calc(100% - 114px)' : 'calc(100% - 70px)',
|
||||
top: setting.isUseTabsRouter ? '106px' : '60px',
|
||||
height: setting.isUseTabsRouter ? 'calc(100% - 116px)' : 'calc(100% - 70px)',
|
||||
}"
|
||||
>
|
||||
<div class="single-page">
|
||||
@@ -75,7 +79,7 @@
|
||||
<script>
|
||||
import { UserFilled } from "@element-plus/icons-vue";
|
||||
import shrinkableMenu from "./main-parts/shrinkable-menu/shrinkable-menu.vue";
|
||||
import pageBreadcrumb from "./main-parts/page-breadcrumb.vue";
|
||||
import tagsPageOpened from "./main-parts/tags-page-opened.vue";
|
||||
import messageTip from "./main-parts/message-tip.vue";
|
||||
import circleLoading from "@/components/lili/circle-loading.vue";
|
||||
import Cookies from "js-cookie";
|
||||
@@ -88,7 +92,7 @@ export default {
|
||||
components: {
|
||||
UserFilled,
|
||||
shrinkableMenu,
|
||||
pageBreadcrumb,
|
||||
tagsPageOpened,
|
||||
messageTip,
|
||||
circleLoading,
|
||||
},
|
||||
|
||||
@@ -128,15 +128,16 @@ export default {
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
getCustomWordsPage(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
getCustomWordsPage(this.searchForm)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
|
||||
@@ -108,14 +108,15 @@
|
||||
<el-dialog
|
||||
v-model="modalVisible"
|
||||
title="修改分销员"
|
||||
width="600px"
|
||||
width="640px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
>
|
||||
<el-form
|
||||
ref="distributionForm"
|
||||
:model="distributionForm"
|
||||
label-width="150px"
|
||||
label-width="180px"
|
||||
class="distribution-form"
|
||||
:rules="distributionFormValidate"
|
||||
>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
@@ -268,3 +269,9 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.distribution-form :deep(.el-form-item__label) {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -128,15 +128,16 @@ export default {
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
getGoodsUnitPage(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
getGoodsUnitPage(this.searchForm)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
|
||||
@@ -264,15 +264,16 @@ export default {
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
API_Member.getMemberReview(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
API_Member.getMemberReview(this.searchForm)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
info(v) {
|
||||
this.currentReviewId = v.id;
|
||||
|
||||
@@ -152,14 +152,42 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.login {
|
||||
height: 100%;
|
||||
background: url("../assets/background.png") no-repeat;
|
||||
background-color: #f0f2f5;
|
||||
min-height: 100vh;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
background-image: url("../assets/background.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center bottom;
|
||||
background-size: 100% auto;
|
||||
display: flex;
|
||||
background-size: cover;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
:deep(.el-input__wrapper) {
|
||||
background-color: #fff !important;
|
||||
box-shadow: 0 0 0 1px var(--el-border-color) inset !important;
|
||||
|
||||
&.is-focus {
|
||||
box-shadow: 0 0 0 1px var(--el-border-color) inset !important;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-input__inner) {
|
||||
background-color: transparent !important;
|
||||
|
||||
&:-webkit-autofill,
|
||||
&:-webkit-autofill:hover,
|
||||
&:-webkit-autofill:focus,
|
||||
&:-webkit-autofill:active {
|
||||
-webkit-box-shadow: 0 0 0 1000px #fff inset !important;
|
||||
box-shadow: 0 0 0 1000px #fff inset !important;
|
||||
-webkit-text-fill-color: #606266 !important;
|
||||
caret-color: #606266;
|
||||
transition: background-color 99999s ease-out;
|
||||
}
|
||||
}
|
||||
|
||||
.verify-con {
|
||||
position: absolute;
|
||||
top: 150px;
|
||||
|
||||
@@ -42,17 +42,19 @@ export default {
|
||||
},
|
||||
getSite() {
|
||||
getBaseSite().then((res) => {
|
||||
const { domainLogo, domainIcon, siteName } = JSON.parse(
|
||||
res.result.settingValue
|
||||
);
|
||||
this.domainLogo = domainLogo;
|
||||
const expirationTime = new Date().setHours(new Date().getHours() + 1);
|
||||
localStorage.setItem("icontitle_expiration_time", expirationTime);
|
||||
localStorage.setItem("icon", domainLogo);
|
||||
localStorage.setItem("domainIcon", domainIcon);
|
||||
localStorage.setItem("title", siteName);
|
||||
this.applyFavicon(domainIcon || domainLogo);
|
||||
window.document.title = siteName + " - 运营后台";
|
||||
if (res.success && res.result && res.result.settingValue) {
|
||||
const { domainLogo, domainIcon, siteName } = JSON.parse(
|
||||
res.result.settingValue
|
||||
);
|
||||
this.domainLogo = domainLogo;
|
||||
const expirationTime = new Date().setHours(new Date().getHours() + 1);
|
||||
localStorage.setItem("icontitle_expiration_time", expirationTime);
|
||||
localStorage.setItem("icon", domainLogo);
|
||||
localStorage.setItem("domainIcon", domainIcon);
|
||||
localStorage.setItem("title", siteName);
|
||||
this.applyFavicon(domainIcon || domainLogo);
|
||||
window.document.title = siteName + " - 运营后台";
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -165,7 +165,6 @@ export default {
|
||||
watch: {
|
||||
$route(to) {
|
||||
this.currentPageName = to.name;
|
||||
this.tagsCount = this.pageTagsList?.length;
|
||||
},
|
||||
visible(value) {
|
||||
if (value) {
|
||||
@@ -175,6 +174,9 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeUnmount() {
|
||||
document.body.removeEventListener("click", this.closeMenu);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -188,13 +190,13 @@ export default {
|
||||
z-index: 11000;
|
||||
list-style-type: none;
|
||||
border-radius: 4px;
|
||||
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 5px 15px;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background: #eee;
|
||||
background: rgba($color: $theme_color, $alpha: 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,6 +209,21 @@ export default {
|
||||
font-size: 13px;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&.el-tag--info.el-tag--plain {
|
||||
color: #606266;
|
||||
border-color: #dcdfe6;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
&.el-tag--info.el-tag--plain .el-tag__close {
|
||||
color: #909399;
|
||||
|
||||
&:hover {
|
||||
color: #606266;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
& + .page-tag {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
@@ -55,9 +55,13 @@
|
||||
padding-left: 0;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
z-index: 22;
|
||||
z-index: 20;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
|
||||
transition: padding 0.3s;
|
||||
|
||||
&.has-tabs {
|
||||
box-shadow: 0 2px 1px 1px rgba(100, 100, 100, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
&-breadcrumb {
|
||||
@@ -81,29 +85,30 @@
|
||||
}
|
||||
|
||||
.tags-con {
|
||||
height: 44px;
|
||||
height: 46px;
|
||||
z-index: -1;
|
||||
background: #fff;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
margin-left: 200px;
|
||||
width: calc(100% - 200px);
|
||||
background: #f0f0f0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.tags-outer-scroll-con {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
padding-right: 12px;
|
||||
padding-right: 120px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.tags-inner-scroll-body {
|
||||
position: absolute;
|
||||
padding: 0 6px;
|
||||
overflow: visible;
|
||||
white-space: nowrap;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
padding: 0 10px;
|
||||
overflow: visible;
|
||||
white-space: nowrap;
|
||||
transition: left 0.3s ease;
|
||||
}
|
||||
|
||||
@@ -126,6 +131,7 @@
|
||||
min-width: 740px;
|
||||
height: 60px;
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 1px 1px rgba(100, 100, 100, 0.1);
|
||||
position: relative;
|
||||
z-index: 11;
|
||||
display: flex;
|
||||
@@ -242,28 +248,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
.breadcrumb-bar {
|
||||
position: fixed;
|
||||
top: 60px;
|
||||
left: 212px;
|
||||
right: 0;
|
||||
height: 44px;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
z-index: 19;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.single-page-con {
|
||||
min-width: 740px;
|
||||
position: relative;
|
||||
left: 200px;
|
||||
top: 100px;
|
||||
top: 106px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: calc(100% - 110px);
|
||||
height: calc(100% - 116px);
|
||||
width: calc(100% - 200px);
|
||||
overflow: auto;
|
||||
background-color: #f0f0f0;
|
||||
@@ -272,7 +264,7 @@
|
||||
|
||||
.single-page {
|
||||
position: relative;
|
||||
margin: 10px 12px;
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@
|
||||
direction="rtl"
|
||||
:z-index="950"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
class="benefit-form-drawer"
|
||||
>
|
||||
<el-form ref="addForm" :model="formAdd" :rules="rulesAdd" label-width="110px">
|
||||
@@ -218,6 +220,8 @@
|
||||
direction="rtl"
|
||||
:z-index="950"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
class="benefit-form-drawer"
|
||||
>
|
||||
<el-form ref="editForm" :model="formEdit" :rules="rulesEdit" label-width="110px">
|
||||
@@ -807,7 +811,7 @@ export default {
|
||||
const text = checked ? "开启" : "关闭";
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
content: `<p>确定${text}该客户权益?</p>`,
|
||||
content: `确定${text}该客户权益?`,
|
||||
onOk: () => {
|
||||
row._benefitStateLoading = true;
|
||||
return API_Member.updateMemberBenefitState(row.id, nextState)
|
||||
@@ -829,7 +833,7 @@ export default {
|
||||
remove(row) {
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
content: "<p>确定删除该客户权益?</p>",
|
||||
content: "确定删除该客户权益?",
|
||||
onOk: () => {
|
||||
API_Member.deleteMemberBenefit(row.id).then((res) => {
|
||||
if (res && res.success) {
|
||||
|
||||
@@ -154,13 +154,30 @@
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog v-model="addFlag" title="添加会员" width="500px" destroy-on-close>
|
||||
<el-form ref="addMemberForm" :model="addMemberForm" :rules="addRule" label-width="100px">
|
||||
<el-dialog v-model="addFlag" title="添加会员" width="500px" destroy-on-close class="add-member-dialog">
|
||||
<el-form
|
||||
ref="addMemberForm"
|
||||
:model="addMemberForm"
|
||||
:rules="addRule"
|
||||
label-width="100px"
|
||||
autocomplete="off"
|
||||
>
|
||||
<el-form-item label="手机号码" prop="mobile" style="width: 90%">
|
||||
<el-input v-model="addMemberForm.mobile" maxlength="11" placeholder="请输入手机号码" />
|
||||
<el-input
|
||||
v-model="addMemberForm.mobile"
|
||||
maxlength="11"
|
||||
placeholder="请输入手机号码"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员名称" prop="username" style="width: 90%">
|
||||
<el-input v-model="addMemberForm.username" maxlength="15" placeholder="请输入会员名称" />
|
||||
<el-input
|
||||
v-model="addMemberForm.username"
|
||||
maxlength="15"
|
||||
placeholder="请输入会员名称"
|
||||
autocomplete="off"
|
||||
name="member-username"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员密码" prop="password" style="width: 90%">
|
||||
<el-input
|
||||
@@ -169,6 +186,8 @@
|
||||
show-password
|
||||
maxlength="20"
|
||||
placeholder="请输入会员密码"
|
||||
autocomplete="new-password"
|
||||
name="member-password"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -509,8 +528,15 @@ export default {
|
||||
this.getMemberInfo(val.id);
|
||||
},
|
||||
addMember() {
|
||||
this.addMemberForm = {
|
||||
mobile: "",
|
||||
username: "",
|
||||
password: "",
|
||||
};
|
||||
this.addFlag = true;
|
||||
this.$refs.addMemberForm?.resetFields();
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addMemberForm?.clearValidate();
|
||||
});
|
||||
},
|
||||
getMemberInfo(id) {
|
||||
API_Member.getMemberInfoData(id).then((res) => {
|
||||
@@ -705,4 +731,30 @@ export default {
|
||||
margin: 0 8px;
|
||||
color: #dcdee2;
|
||||
}
|
||||
|
||||
.add-member-dialog {
|
||||
:deep(.el-input__wrapper) {
|
||||
background-color: #fff !important;
|
||||
box-shadow: 0 0 0 1px var(--el-border-color) inset !important;
|
||||
|
||||
&.is-focus {
|
||||
box-shadow: 0 0 0 1px var(--el-border-color) inset !important;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-input__inner) {
|
||||
background-color: transparent !important;
|
||||
|
||||
&:-webkit-autofill,
|
||||
&:-webkit-autofill:hover,
|
||||
&:-webkit-autofill:focus,
|
||||
&:-webkit-autofill:active {
|
||||
-webkit-box-shadow: 0 0 0 1000px #fff inset !important;
|
||||
box-shadow: 0 0 0 1000px #fff inset !important;
|
||||
-webkit-text-fill-color: #606266 !important;
|
||||
caret-color: #606266;
|
||||
transition: background-color 99999s ease-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -119,3 +119,14 @@
|
||||
line-height: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.member-tab-panel {
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.address-table {
|
||||
:deep(table) {
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,8 +237,9 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="TA收货地址" name="address">
|
||||
<el-table v-loading="loading" border :data="addressData" class="mt_10" style="width: 100%">
|
||||
<el-tab-pane label="TA收货地址" name="address" lazy>
|
||||
<div v-loading="addressLoading" class="member-tab-panel">
|
||||
<el-table border :data="addressData" class="mt_10 address-table" style="width: 100%">
|
||||
<el-table-column prop="alias" label="地址别名" min-width="80" show-overflow-tooltip />
|
||||
<el-table-column prop="name" label="收货人姓名" min-width="90" show-overflow-tooltip />
|
||||
<el-table-column prop="mobile" label="收货人电话" width="125" />
|
||||
@@ -263,6 +264,7 @@
|
||||
@size-change="addressChangePageSize"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="TA的余额" name="wallet">
|
||||
@@ -428,6 +430,7 @@ export default {
|
||||
id: "",
|
||||
activeTab: "point",
|
||||
loading: true,
|
||||
addressLoading: false,
|
||||
memberInfo: {},
|
||||
memberWalletInfo: {},
|
||||
addressModalTitle: "",
|
||||
@@ -565,7 +568,9 @@ export default {
|
||||
this.getPointData();
|
||||
}
|
||||
if (v == "address") {
|
||||
this.getAddressData();
|
||||
this.$nextTick(() => {
|
||||
this.getAddressData();
|
||||
});
|
||||
}
|
||||
if (v == "order") {
|
||||
this.getOrderData();
|
||||
@@ -723,15 +728,17 @@ export default {
|
||||
});
|
||||
},
|
||||
getAddressData() {
|
||||
this.loading = true;
|
||||
API_Member.getMemberAddressData(this.id, this.addressSearchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.addressData = res.result.records;
|
||||
this.addressTotal = res.result.total;
|
||||
}
|
||||
});
|
||||
this.loading = false;
|
||||
this.addressLoading = true;
|
||||
API_Member.getMemberAddressData(this.id, this.addressSearchForm)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
this.addressData = res.result.records;
|
||||
this.addressTotal = res.result.total;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.addressLoading = false;
|
||||
});
|
||||
},
|
||||
pointChangePage(v) {
|
||||
this.pointSearchForm.pageNumber = v;
|
||||
@@ -749,7 +756,7 @@ export default {
|
||||
addressChangePageSize(v) {
|
||||
this.addressSearchForm.pageNumber = 1;
|
||||
this.addressSearchForm.pageSize = v;
|
||||
this.getPointData();
|
||||
this.getAddressData();
|
||||
},
|
||||
walletChangePage(v) {
|
||||
this.walletSearchForm.pageNumber = v;
|
||||
@@ -770,9 +777,12 @@ export default {
|
||||
this.getOrderData();
|
||||
},
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
if (v && v.length === 2) {
|
||||
this.orderSearchForm.startDate = v[0];
|
||||
this.orderSearchForm.endDate = v[1];
|
||||
} else {
|
||||
delete this.orderSearchForm.startDate;
|
||||
delete this.orderSearchForm.endDate;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -81,33 +81,34 @@
|
||||
</template>
|
||||
<el-table
|
||||
v-loading="memberLoading"
|
||||
border
|
||||
:data="memberData"
|
||||
class="member-table"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column label="客户名称" width="180" show-overflow-tooltip>
|
||||
<el-table-column label="客户名称" min-width="160" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row">{{ row.nickName || "-" }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户账号" width="180" show-overflow-tooltip>
|
||||
<el-table-column label="客户账号" min-width="260" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row">{{ row.username || "-" }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="账号状态" width="180">
|
||||
<el-table-column label="账号状态" min-width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row" :type="row.disabled === true ? 'success' : 'info'">
|
||||
{{ row.disabled === true ? "启用" : "禁用" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="积分余额" width="180">
|
||||
<el-table-column label="积分余额" min-width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row">{{ row.point == null ? 0 : row.point }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" align="center">
|
||||
<el-table-column label="操作" width="120" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<a v-if="row" class="link-text" @click="detail(row)">详情</a>
|
||||
</template>
|
||||
@@ -409,8 +410,27 @@ export default {
|
||||
}
|
||||
|
||||
.member-table {
|
||||
:deep(.el-table__header th) {
|
||||
width: 100%;
|
||||
|
||||
:deep(.el-table__header th.el-table__cell) {
|
||||
background: #fafafa;
|
||||
padding: 14px 0;
|
||||
font-size: 14px;
|
||||
color: #17233d;
|
||||
}
|
||||
|
||||
:deep(.el-table__header .cell) {
|
||||
padding: 0 16px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
:deep(.el-table__body td.el-table__cell) {
|
||||
padding: 12px 0;
|
||||
}
|
||||
|
||||
:deep(.el-table__body .cell) {
|
||||
padding: 0 16px;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
||||
<el-button class="search-btn" @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -114,8 +113,6 @@
|
||||
|
||||
<script>
|
||||
import * as API_Order from "@/api/order";
|
||||
import * as API_Finance from "@/api/finance";
|
||||
import { downloadBlob } from "@/utils/downloadBlob";
|
||||
|
||||
export default {
|
||||
name: "paymentLog",
|
||||
@@ -167,11 +164,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
API_Finance.exportPaymentFlow(this.searchForm).then((blob) => {
|
||||
downloadBlob(blob, "支付流水.xlsx");
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
||||
@@ -422,7 +422,7 @@
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="printModal = false">关闭</el-button>
|
||||
<el-button type="primary" v-print="printInfoObj">打印发货单</el-button>
|
||||
<el-button type="primary" @click="handlePrintInvoice">打印发货单</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -437,6 +437,7 @@ import * as RegExp from "@/libs/RegExp.js";
|
||||
|
||||
import multipleMap from "@/components/map/multiple-map";
|
||||
import vueQr from "vue-qr";
|
||||
import { printElement } from "@/utils/print";
|
||||
export default {
|
||||
name: "orderList",
|
||||
components: {
|
||||
@@ -449,11 +450,6 @@ export default {
|
||||
typeList: [],
|
||||
showPrices: false,
|
||||
printHiddenFlag: false,//隐藏信息
|
||||
printInfoObj: {
|
||||
id: "printInfo",//要打印的id名 无#号
|
||||
popTitle: ' ',//页眉标题 默认浏览器标题 空字符串时显示undefined 使用html语言
|
||||
extraHead: '',//头部文字 默认空
|
||||
},
|
||||
loading: false, //加载表格
|
||||
|
||||
addr: "", //地区
|
||||
@@ -686,6 +682,9 @@ export default {
|
||||
printCancel () {
|
||||
// this.printHiddenFlag = false;
|
||||
},
|
||||
handlePrintInvoice () {
|
||||
printElement("printInfo", "发货单");
|
||||
},
|
||||
//弹出修改收货地址框
|
||||
editAddress () {
|
||||
this.addressModal = true;
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
class="search-form"
|
||||
@keyup.enter="handleSearch"
|
||||
>
|
||||
<el-form-item label="关键字" prop="keywords" style="display: block; width: 100%">
|
||||
<el-form-item label="关键字" prop="keywords">
|
||||
<el-input
|
||||
v-model="searchForm.keywords"
|
||||
placeholder="请输入商品名称/收货人/收货人手机号/店铺名称"
|
||||
clearable
|
||||
style="width: 500px"
|
||||
style="width: 380px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="orderSn">
|
||||
@@ -76,7 +76,7 @@
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="info" class="export" @click="exportOrder">导出订单</el-button>
|
||||
<el-button type="warning" class="export" @click="exportOrder">导出订单</el-button>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="loading" :data="data" ref="table" class="mt_10" style="width: 100%">
|
||||
|
||||
@@ -1,21 +1,27 @@
|
||||
:deep(.ivu-modal-mask),
|
||||
:deep(.ivu-modal-wrap) {
|
||||
z-index: 800;
|
||||
:deep(.ivu-modal-wrap),
|
||||
:deep(.el-overlay) {
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
.decorate-view-link {
|
||||
font-size: 12px;
|
||||
margin: 0 4px;
|
||||
flex:8;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
color: #999;
|
||||
}
|
||||
.decorate-view-btn{
|
||||
flex: 2;
|
||||
.decorate-view-btn {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
>button{
|
||||
align-items: stretch;
|
||||
gap: 8px;
|
||||
margin-left: 10px;
|
||||
|
||||
width: 70px;
|
||||
:deep(.el-button) {
|
||||
width: 76px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,14 @@
|
||||
</el-alert>
|
||||
|
||||
<!-- 右侧显示抽屉 -->
|
||||
<el-drawer title="选择风格" :show-close="false" size="400px" v-model="styleFlag">
|
||||
<el-drawer
|
||||
title="选择风格"
|
||||
:show-close="false"
|
||||
size="400px"
|
||||
v-model="styleFlag"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<div class="drawer">
|
||||
<template v-for="(item, index) in modelData" :key="index">
|
||||
<div
|
||||
@@ -67,6 +74,8 @@
|
||||
:show-close="false"
|
||||
size="400px"
|
||||
v-model="promotionsFlag"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<div class="drawer">
|
||||
<template v-for="(item, index) in modelData" :key="index">
|
||||
@@ -185,7 +194,6 @@
|
||||
<el-button
|
||||
@click="bindGoodsCategory(title_index)"
|
||||
size="small"
|
||||
style="margin-top: 20px"
|
||||
>选择分类</el-button
|
||||
>
|
||||
</div>
|
||||
@@ -686,6 +694,7 @@ export default {
|
||||
clickDrawer(item, index) {
|
||||
this.$emit("handleDrawer", item);
|
||||
this.styleFlag = false;
|
||||
this.promotionsFlag = false;
|
||||
},
|
||||
// 打开图片选择器
|
||||
liliDialogFlag(flag) {
|
||||
@@ -705,8 +714,7 @@ export default {
|
||||
if (!val.zoneInfo) {
|
||||
val.zoneInfo = [];
|
||||
}
|
||||
this.$refs.hotzone.flag = true;
|
||||
this.$refs.hotzone.res = val;
|
||||
this.$refs.hotzone.open(val);
|
||||
} else {
|
||||
this.liliDialogFlag(false);
|
||||
}
|
||||
|
||||
@@ -200,25 +200,27 @@ export default {
|
||||
API_Promotions.getLiveList({
|
||||
status: "START",
|
||||
pageSize: 1,
|
||||
}).then((res) => {
|
||||
if (res.success && res.result.size > 0) {
|
||||
API_Promotions.getLiveInfo(res.result.records[0].id).then(
|
||||
(res) => {
|
||||
if (res.success) {
|
||||
this.contentData.list[newIndex].options.list.push({
|
||||
type: val.promotionsType,
|
||||
title: val.name,
|
||||
title1: val.subName,
|
||||
color1: val.subColor,
|
||||
bk_color: val.subBkColor,
|
||||
data: res.result.commodityList
|
||||
? res.result.commodityList.splice(0, 2)
|
||||
: [],
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
pageNumber: 1,
|
||||
}).then((listRes) => {
|
||||
const records = listRes.result?.records || [];
|
||||
if (!listRes.success || records.length === 0) {
|
||||
this.$Message.warning("暂无进行中的直播活动");
|
||||
return;
|
||||
}
|
||||
API_Promotions.getLiveInfo(records[0].id).then((infoRes) => {
|
||||
if (infoRes.success) {
|
||||
this.contentData.list[newIndex].options.list.push({
|
||||
type: val.promotionsType,
|
||||
title: val.name,
|
||||
title1: val.subName,
|
||||
color1: val.subColor,
|
||||
bk_color: val.subBkColor,
|
||||
data: infoRes.result.commodityList
|
||||
? infoRes.result.commodityList.splice(0, 2)
|
||||
: [],
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
API_Promotions.getAllPromotion().then((res) => {
|
||||
|
||||
@@ -42,23 +42,36 @@
|
||||
text-align: center;
|
||||
height: 44px;
|
||||
border-bottom: 1px solid #ededed;
|
||||
background: #fff;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.content {
|
||||
box-sizing: border-box;
|
||||
margin: 20px 0;
|
||||
padding: 50px 13px;
|
||||
width: 360px;
|
||||
background: url("../../../assets/iPhoneX_model.png") no-repeat;
|
||||
height: 780px;
|
||||
background-size: 360px;
|
||||
background-size: 100% 100%;
|
||||
overflow: hidden;
|
||||
> .component,
|
||||
.draggable {
|
||||
height: 590px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
> .draggable {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
background: #ebebeb;
|
||||
}
|
||||
> .draggable {
|
||||
padding-bottom: 100px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
> .component,
|
||||
.draggable :deep(.component) {
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
.list {
|
||||
|
||||
@@ -13,14 +13,6 @@
|
||||
export default {
|
||||
title: "导航栏",
|
||||
props: ["res"],
|
||||
watch: {
|
||||
res: {
|
||||
handler(newValue, oldValue) {
|
||||
this['res'] = newValue;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<div v-if="goodsBlock" class="layout">
|
||||
<div class="goods-cell-title">
|
||||
<div
|
||||
class="goods-item-title"
|
||||
:class="{ selected: selected.index == index }"
|
||||
@click="handleClickTitle(title, index)"
|
||||
v-for="(title, index) in res.list[0].titleWay"
|
||||
v-for="(title, index) in goodsBlock.titleWay"
|
||||
:key="index"
|
||||
>
|
||||
<h4>{{ title.title }}</h4>
|
||||
@@ -13,36 +13,29 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="goods-list">
|
||||
<div
|
||||
v-if="
|
||||
item.___index != undefined
|
||||
? selected.index == item.___index
|
||||
: selected.val == item.type
|
||||
"
|
||||
class="goods-item"
|
||||
v-for="(item, item_index) in res.list[0].listWay"
|
||||
:key="item_index"
|
||||
>
|
||||
<div class="goods-img">
|
||||
<el-icon
|
||||
:size="20"
|
||||
color="#e1251b"
|
||||
@click="closeGoods(item, item_index)"
|
||||
class="goods-icon"
|
||||
>
|
||||
<CircleClose />
|
||||
</el-icon>
|
||||
<img :src="item.img" alt />
|
||||
</div>
|
||||
<div class="goods-desc">
|
||||
<div class="goods-title">
|
||||
{{ item.title }}
|
||||
<template v-for="(item, item_index) in goodsBlock.listWay" :key="item_index">
|
||||
<div v-if="isGoodsVisible(item)" class="goods-item">
|
||||
<div class="goods-img">
|
||||
<el-icon
|
||||
:size="20"
|
||||
color="#e1251b"
|
||||
@click="closeGoods(item, item_index)"
|
||||
class="goods-icon"
|
||||
>
|
||||
<CircleClose />
|
||||
</el-icon>
|
||||
<img :src="item.img" alt />
|
||||
</div>
|
||||
<div class="goods-bottom">
|
||||
<div class="goods-price">¥{{ $filters.unitPrice(item.price) }}</div>
|
||||
<div class="goods-desc">
|
||||
<div class="goods-title">
|
||||
{{ item.title }}
|
||||
</div>
|
||||
<div class="goods-bottom">
|
||||
<div class="goods-price">¥{{ $filters.unitPrice(item.price) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -53,29 +46,46 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
selected: {
|
||||
// 已选数据
|
||||
index: 0,
|
||||
val: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
props: ["res"],
|
||||
computed: {
|
||||
goodsBlock() {
|
||||
return this.res?.list?.[0] || null;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
res: {
|
||||
goodsBlock: {
|
||||
handler(val) {
|
||||
// 监听父级的值 如果有值将值赋给selected
|
||||
if (val) {
|
||||
this.selected.val = this.res.list[0].listWay[0].type;
|
||||
if (!val) {
|
||||
return;
|
||||
}
|
||||
const firstGoods = (val.listWay || []).find(Boolean);
|
||||
if (firstGoods) {
|
||||
this.selected.val = firstGoods.type;
|
||||
} else if (val.titleWay?.[0]?.title) {
|
||||
this.selected.val = val.titleWay[0].title;
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 删除商品
|
||||
closeGoods(val, index) {
|
||||
this.res.list[0].listWay.splice(index, 1);
|
||||
isGoodsVisible(item) {
|
||||
if (!item) {
|
||||
return false;
|
||||
}
|
||||
if (item.___index != undefined) {
|
||||
return this.selected.index == item.___index;
|
||||
}
|
||||
return this.selected.val == item.type;
|
||||
},
|
||||
closeGoods(val, index) {
|
||||
this.goodsBlock.listWay.splice(index, 1);
|
||||
},
|
||||
// 切换商品列表
|
||||
handleClickTitle(val, index) {
|
||||
this.selected.index = index;
|
||||
this.selected.val = val.title;
|
||||
|
||||
@@ -311,18 +311,16 @@ export default {
|
||||
getDataList(val) {
|
||||
if (val) this.form = {};
|
||||
this.loading = true;
|
||||
getArticle(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.total = res.result.total;
|
||||
this.data = [];
|
||||
if (res.result.records.length > 0) {
|
||||
this.data = res.result.records;
|
||||
getArticle(this.searchForm)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
this.total = res.result.total;
|
||||
this.data = res.result.records?.length ? res.result.records : [];
|
||||
}
|
||||
}
|
||||
});
|
||||
this.total = this.data?.length;
|
||||
this.loading = false;
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
|
||||
@@ -8,28 +8,35 @@
|
||||
:rules="ruleValidate"
|
||||
>
|
||||
<el-form-item label="热词默认配置" prop="hotWordsSettingItems">
|
||||
<div
|
||||
class="item-label"
|
||||
v-for="(item, index) in formValidate.hotWordsSettingItems"
|
||||
:key="index"
|
||||
>
|
||||
<div>
|
||||
<div class="item-keyword">
|
||||
<div>热词:</div>
|
||||
<el-input v-model="item.keywords" />
|
||||
<div class="hotwords-config">
|
||||
<div
|
||||
class="item-label"
|
||||
v-for="(item, index) in formValidate.hotWordsSettingItems"
|
||||
:key="index"
|
||||
>
|
||||
<div class="item-fields">
|
||||
<div class="item-keyword">
|
||||
<div>热词:</div>
|
||||
<el-input v-model="item.keywords" />
|
||||
</div>
|
||||
<div class="item-score">
|
||||
<div>分数:</div>
|
||||
<el-input-number :max="5" :min="0" v-model="item.score" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-score">
|
||||
<div>分数:</div>
|
||||
<el-input-number :max="5" :min="0" v-model="item.score" />
|
||||
<div class="item-actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="formValidate.hotWordsSettingItems.splice(index, 1)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-if="index === formValidate.hotWordsSettingItems.length - 1" @click="addSetItem">
|
||||
添加配置
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="formValidate.hotWordsSettingItems.splice(index, 1)">
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-button @click="addSetItem">添加配置</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="每日持久化热词数量" prop="saveNum">
|
||||
<el-input-number :min="0" v-model="formValidate.saveNum" />
|
||||
@@ -109,8 +116,21 @@ export default {
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 500px;
|
||||
width: 560px;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.item-fields {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.item-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.item-keyword,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-button style="margin-bottom: 10px" @click="back()">返回</el-button>
|
||||
|
||||
<el-card>
|
||||
<el-form ref="searchForm" :model="searchForm" inline label-width="75px" class="search-form mb_10">
|
||||
<el-form ref="searchForm" :model="searchForm" inline label-width="90px" class="search-form mb_10">
|
||||
<el-form-item label="优惠券名称" prop="couponName">
|
||||
<el-input
|
||||
v-model="searchForm.couponName"
|
||||
@@ -121,7 +121,7 @@
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="有效时间" width="150">
|
||||
<el-table-column label="有效时间" width="200">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
<span v-if="row.getType === 'ACTIVITY' && row.rangeDayType === 'DYNAMICTIME'">长期有效</span>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<div class="operation padding-row" v-if="getType !== 'ACTIVITY'">
|
||||
<el-button type="primary" @click="add">添加优惠券</el-button>
|
||||
<el-button @click="delAll">批量关闭</el-button>
|
||||
<el-button type="info" @click="receivePage()">优惠券领取记录</el-button>
|
||||
<el-button type="warning" @click="receivePage()">优惠券领取记录</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
|
||||
@@ -225,7 +225,10 @@ export default {
|
||||
this.form.stockTotal =
|
||||
d.stockTotal !== null && d.stockTotal !== undefined ? d.stockTotal : null;
|
||||
this.form.validityType = d.validityType || "LONG_TERM";
|
||||
this.form.validEndTime = this.parseDetailDate(d.validEndTime);
|
||||
const endDate = this.parseDetailDate(d.validEndTime);
|
||||
this.form.validEndTime = endDate
|
||||
? this.$filters.unixToDate(endDate.getTime() / 1000)
|
||||
: null;
|
||||
this.form.validMonthsAfterActivate =
|
||||
d.validMonthsAfterActivate !== null &&
|
||||
d.validMonthsAfterActivate !== undefined &&
|
||||
@@ -271,7 +274,10 @@ export default {
|
||||
stockTotal: this.form.stockTotal,
|
||||
};
|
||||
if (payload.validityType === "FIXED_UNTIL") {
|
||||
payload.validEndTime = this.form.validEndTime;
|
||||
const endDate = new Date(this.form.validEndTime);
|
||||
payload.validEndTime = Number.isNaN(endDate.getTime())
|
||||
? this.form.validEndTime
|
||||
: endDate.getTime();
|
||||
}
|
||||
if (payload.validityType === "AFTER_ACTIVATE_MONTHS") {
|
||||
payload.validMonthsAfterActivate = this.form.validMonthsAfterActivate;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
label-width="80px"
|
||||
label-width="100px"
|
||||
class="search-form mb_10"
|
||||
@keyup.enter="handleSearch"
|
||||
>
|
||||
|
||||
@@ -13,67 +13,72 @@
|
||||
<el-form-item style="width: 100%">
|
||||
<el-table
|
||||
border
|
||||
class="kanjia-goods-table"
|
||||
:data="form.promotionGoodsList"
|
||||
style="width: 100%"
|
||||
@selection-change="changeSelect"
|
||||
>
|
||||
<el-table-column type="selection" width="60" align="center" />
|
||||
<el-table-column prop="goodsName" label="商品名称" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="商品价格" width="120">
|
||||
<el-table-column label="商品价格" width="150">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row" :style="{ color: $mainColor }">
|
||||
{{ $filters.unitPrice(row.price, "¥") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存" width="100">
|
||||
<el-table-column label="库存" width="120">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row">{{ row.quantity }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结算价格" width="130">
|
||||
<el-table-column label="结算价格" width="160">
|
||||
<template #default="{ $index }">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
v-model="form.promotionGoodsList[$index].settlementPrice"
|
||||
style="width: 110px"
|
||||
controls-position="right"
|
||||
class="kanjia-goods-input"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最低砍" width="130">
|
||||
<el-table-column label="最低砍" width="160">
|
||||
<template #default="{ $index }">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
v-model="form.promotionGoodsList[$index].lowestPrice"
|
||||
style="width: 110px"
|
||||
controls-position="right"
|
||||
class="kanjia-goods-input"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最高砍" width="130">
|
||||
<el-table-column label="最高砍" width="160">
|
||||
<template #default="{ $index }">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
v-model="form.promotionGoodsList[$index].highestPrice"
|
||||
style="width: 110px"
|
||||
controls-position="right"
|
||||
class="kanjia-goods-input"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动库存" width="130">
|
||||
<el-table-column label="活动库存" width="160">
|
||||
<template #default="{ $index }">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
v-model="form.promotionGoodsList[$index].stock"
|
||||
style="width: 110px"
|
||||
controls-position="right"
|
||||
class="kanjia-goods-input"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" align="center">
|
||||
<el-table-column label="操作" width="120" align="center">
|
||||
<template #default="{ $index }">
|
||||
<el-button type="danger" size="small" plain @click="delGoods($index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动时间" prop="rangeTime">
|
||||
<el-form-item label="活动时间" prop="rangeTime" class="kanjia-activity-time-form-item">
|
||||
<el-date-picker
|
||||
type="datetimerange"
|
||||
v-model="form.rangeTime"
|
||||
@@ -82,7 +87,6 @@
|
||||
end-placeholder="结束时间"
|
||||
placeholder="请选择"
|
||||
:disabled-date="options.disabledDate"
|
||||
style="width: 260px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div>
|
||||
@@ -253,7 +257,27 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scpoed>
|
||||
<style lang="scss" scoped>
|
||||
.kanjia-goods-table {
|
||||
:deep(.el-table__body .el-table__cell .cell) {
|
||||
overflow: visible;
|
||||
text-overflow: clip;
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.kanjia-goods-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.kanjia-activity-time-form-item {
|
||||
:deep(.el-date-editor) {
|
||||
width: 360px !important;
|
||||
max-width: 360px;
|
||||
flex-grow: 0;
|
||||
}
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
|
||||
@@ -73,6 +73,14 @@ import {
|
||||
deletePointsGoodsCategoryById,
|
||||
} from "@/api/promotion";
|
||||
|
||||
const buildDefaultFormAdd = () => ({
|
||||
parentId: 0,
|
||||
name: "",
|
||||
deleteFlag: 0,
|
||||
level: 0,
|
||||
sortOrder: 1,
|
||||
});
|
||||
|
||||
export default {
|
||||
name: "pointsGoodsCategory",
|
||||
data() {
|
||||
@@ -88,13 +96,7 @@ export default {
|
||||
sort: "sortOrder",
|
||||
order: "asc",
|
||||
},
|
||||
formAdd: {
|
||||
parentId: 0,
|
||||
name: "",
|
||||
deleteFlag: 0,
|
||||
level: 0,
|
||||
sortOrder: 1,
|
||||
},
|
||||
formAdd: buildDefaultFormAdd(),
|
||||
formValidate: {
|
||||
name: [{ required: true, message: "商品分类名称不能为空", trigger: "blur" }],
|
||||
},
|
||||
@@ -109,18 +111,22 @@ export default {
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.formAdd.id = v.id;
|
||||
this.formAdd.name = v.name;
|
||||
this.formAdd.sortOrder = v.sortOrder;
|
||||
this.formAdd = {
|
||||
...buildDefaultFormAdd(),
|
||||
id: v.id,
|
||||
name: v.name,
|
||||
sortOrder: v.sortOrder,
|
||||
};
|
||||
this.modalVisible = true;
|
||||
},
|
||||
addParent() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加积分商品分类";
|
||||
this.$refs.form?.resetFields();
|
||||
delete this.formAdd.id;
|
||||
this.formAdd.parentId = 0;
|
||||
this.formAdd = buildDefaultFormAdd();
|
||||
this.modalVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form?.clearValidate();
|
||||
});
|
||||
},
|
||||
Submit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
@@ -134,7 +140,7 @@ export default {
|
||||
this.$Message.success("添加成功");
|
||||
this.getAllList();
|
||||
this.modalVisible = false;
|
||||
this.$refs.form.resetFields();
|
||||
this.formAdd = buildDefaultFormAdd();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -144,7 +150,7 @@ export default {
|
||||
this.$Message.success("修改成功");
|
||||
this.getAllList();
|
||||
this.modalVisible = false;
|
||||
this.$refs.form.resetFields();
|
||||
this.formAdd = buildDefaultFormAdd();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="活动时间" prop="rangeTime">
|
||||
<el-form-item label="活动时间" prop="rangeTime" class="points-goods-time-form-item">
|
||||
<el-date-picker
|
||||
type="datetimerange"
|
||||
v-model="form.rangeTime"
|
||||
@@ -100,7 +100,6 @@
|
||||
end-placeholder="结束时间"
|
||||
placeholder="请选择"
|
||||
:disabled-date="options.disabledDate"
|
||||
style="width: 260px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div>
|
||||
@@ -127,7 +126,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
rangeTime: ["", ""],
|
||||
rangeTime: null,
|
||||
promotionGoodsList: [],
|
||||
},
|
||||
showTable: true,
|
||||
@@ -136,7 +135,19 @@ export default {
|
||||
submitLoading: false,
|
||||
selectedGoods: [],
|
||||
formRule: {
|
||||
rangeTime: [{ required: true, message: "请选择活动时间" }],
|
||||
rangeTime: [
|
||||
{
|
||||
required: true,
|
||||
validator: (rule, value, callback) => {
|
||||
if (!value || !Array.isArray(value) || value.length < 2 || !value[0] || !value[1]) {
|
||||
callback(new Error("请选择活动时间"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
disabledDate(date) {
|
||||
@@ -154,33 +165,31 @@ export default {
|
||||
this.categoryList = res.result.records;
|
||||
},
|
||||
handleSubmit() {
|
||||
this.form.startTime = this.form.rangeTime[0];
|
||||
this.form.endTime = this.form.rangeTime[1];
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
let params = this.promotionGoodsList;
|
||||
const start = this.$filters.unixToDate(this.form.startTime / 1000);
|
||||
const end = this.$filters.unixToDate(this.form.endTime / 1000);
|
||||
|
||||
if (!params || params.length === 0) {
|
||||
this.$Modal.warning({ title: "提示", content: "请选择指定商品" });
|
||||
return;
|
||||
}
|
||||
|
||||
this.submitLoading = true;
|
||||
params = params.map((j) => {
|
||||
j.startTime = start;
|
||||
j.endTime = end;
|
||||
return j;
|
||||
});
|
||||
addPointsGoods(params).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("积分商品创建成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
if (!valid) return;
|
||||
let params = this.promotionGoodsList;
|
||||
if (!params || params.length === 0) {
|
||||
this.$Modal.warning({ title: "提示", content: "请选择指定商品" });
|
||||
return;
|
||||
}
|
||||
this.form.startTime = this.form.rangeTime[0];
|
||||
this.form.endTime = this.form.rangeTime[1];
|
||||
const start = this.$filters.unixToDate(this.form.startTime / 1000);
|
||||
const end = this.$filters.unixToDate(this.form.endTime / 1000);
|
||||
|
||||
this.submitLoading = true;
|
||||
params = params.map((j) => {
|
||||
j.startTime = start;
|
||||
j.endTime = end;
|
||||
return j;
|
||||
});
|
||||
addPointsGoods(params).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("积分商品创建成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
closeCurrentPage() {
|
||||
@@ -251,7 +260,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scpoed>
|
||||
<style lang="scss" scoped>
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
@@ -273,4 +282,13 @@ h4 {
|
||||
.wrapper {
|
||||
min-height: 800px;
|
||||
}
|
||||
|
||||
.points-goods-time-form-item {
|
||||
:deep(.el-date-editor.el-date-editor--datetimerange) {
|
||||
width: 420px !important;
|
||||
min-width: 420px;
|
||||
max-width: 420px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -134,15 +134,16 @@ export default {
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
getSensitiveWordsPage(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
getSensitiveWordsPage(this.searchForm)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
|
||||
Reference in New Issue
Block a user