刘翔宇-旅管家 3 years ago
parent 9388463841
commit fc16d12271

@ -2,5 +2,5 @@
ENV = 'development'
# base api
#VUE_APP_BASE_API = http://yybtest.ali251.langye.net/
VUE_APP_BASE_API = https://yunyubang.ali251.langye.net/
VUE_APP_BASE_API = http://yybtest.ali251.langye.net/
#VUE_APP_BASE_API = https://yunyubang.ali251.langye.net/

@ -0,0 +1,41 @@
import request from '@/utils/request'
export function store(data){
return request({
method:'post',
url:'/api/admin/applet-menu-first/store',
data
})
}
export function index(params){
return request({
method:'get',
url:'/api/admin/applet-menu-first/index',
params
})
}
export function show(params){
return request({
method:'get',
url:'/api/admin/applet-menu-first/show',
params
})
}
export function update(data){
return request({
method:'post',
url:'/api/admin/applet-menu-first/save',
data
})
}
export function destroy(params){
return request({
method:'get',
url:'/api/admin/applet-menu-first/destroy',
params
})
}

@ -0,0 +1,41 @@
import request from '@/utils/request'
export function store(data){
return request({
method:'post',
url:'/api/admin/online-customer-service/store',
data
})
}
export function index(params){
return request({
method:'get',
url:'/api/admin/online-customer-service/index',
params
})
}
export function show(params){
return request({
method:'get',
url:'/api/admin/online-customer-service/show',
params
})
}
export function update(data){
return request({
method:'post',
url:'/api/admin/online-customer-service/save',
data
})
}
export function destroy(params){
return request({
method:'get',
url:'/api/admin/online-customer-service/destroy',
params
})
}

@ -20,7 +20,7 @@ export default {
props: {
icon: {
type: String,
default: ""
default: "md-apps"
},
text: {
type: String,
@ -38,14 +38,15 @@ export default {
margin-top: 3px;
padding-bottom: 6px;
// padding-top: 10px;
display: flex;
align-items: center;
font-weight: bold;
font-size: 15px;
color: #bf617c;
white-space: nowrap;
border-bottom: 2px solid #bf617c;
> span {
position: relative;
top: 2px;
}
}
.content {

@ -258,7 +258,7 @@ export default {
if(!newVal) return
this.form.lat = newVal[1]
this.form.lng = newVal[0]
this.form.address = newVal[2]
//this.form.address = newVal[2]
},
async isShow(newVal){
if(newVal){

@ -163,7 +163,7 @@
caret-color: $cursor;
&:-webkit-autofill {
box-shadow: 0 0 0px 1000px $bg inset !important;
//box-shadow: 0 0 0px 1000px $bg inset !important;
-webkit-text-fill-color: $cursor !important;
}
}

@ -5,9 +5,10 @@
<div slot="content"></div>
<slot>
<div style="display:flex;">
<Input v-model="select.name" placeholder="活动名称.." clearable style="width: 200px;margin-right: 10px;"/>
<Input v-model="select.name" placeholder="关键词" clearable style="width: 200px;margin-right: 10px;"/>
<Button type="primary" @click="$refs['addAd'].isShow = true,$refs['addAd'].type = 'add'" style="margin-right: 10px;">新增</Button>
<Button type="primary" @click="getAds" style="margin-right: 10px;">搜索</Button>
<xy-selectors @search="getAds" @add="$refs['addAd'].isShow = true,$refs['addAd'].type = 'add'" @reset="resetSelect">
<xy-selectors @search="getAds" @reset="resetSelect">
<template v-slot:selected>
<div style="display: flex;padding: 0 0 10px 20px;">
<span style="padding-right: 6px">当前搜索条件</span>

@ -1,439 +1,446 @@
<template>
<div>
<xy-dialog :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增广告' : '编辑广告'" :form="form" :rules="rules" ref="dialog" @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>活动名称
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写活动名称" v-model="form.name" style="width: 300px;"/>
</div>
</div>
</template>
<template v-slot:type>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>类型
</div>
<div class="xy-table-item-content">
<el-select clearable placeholder="请选择类型" v-model="form.type" style="width: 300px;">
<el-option v-for="item in types" :value="item.value" :key="item.value" :label="item.label"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:system>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>发布系统
</div>
<div class="xy-table-item-content">
<el-select clearable placeholder="请选择发布系统" v-model="form.system" style="width: 300px;">
<el-option v-for="item in systems" :key="item.value" :value="item.value" :label="item.label"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:to>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>跳转方向
</div>
<div class="xy-table-item-content">
<el-input
clearable
:placeholder="toType === 1 ? '请填写跳转方向' : '跳转商品选择'"
v-model="form.to"
style="width: 300px;"
:readonly="toType === 2 ? true :false">
<el-select
v-model="toType"
slot="prepend"
placeholder="方式选择"
style="width: 110px;"
@change="showToProductSelect">
<el-option label="指定地址" :value="1"></el-option>
<el-option label="指定商品" :value="2"></el-option>
</el-select>
</el-input>
</div>
</div>
</template>
<template v-slot:state>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>状态
</div>
<div class="xy-table-item-content">
<el-select clearable placeholder="请选择状态" v-model="form.state" style="width: 300px;">
<el-option v-for="item in states" :value="item.value" :label="item.label" :key="item.value"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>排序
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写排序" v-model="form.sort" style="width: 300px;"/>
</div>
</div>
</template>
<template v-slot:effectDate>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>有效期
</div>
<div class="xy-table-item-content">
<el-date-picker
:editable="false"
type="daterange"
append-to-body
clearable
placeholder="请选择有效期"
v-model="form.effectDate"
style="width: 300px;"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"/>
</div>
</div>
</template>
<template v-slot:img>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>图片
</div>
<div class="xy-table-item-content">
<div v-if="form.img" style="position: relative;">
<img :src="form.img" class="avatar">
<Button
shape="circle"
icon="md-close"
type="error"
size="small"
class="img__delete"
@click="form.img = ''"></Button>
</div>
<el-upload
v-else
accept="picture"
:limit="1"
class="avatar-uploader"
list-type="picture-card"
:action="action"
:show-file-list="true"
:on-error="uploadFail"
:on-success="uploadSuccess"
:before-upload="uploadBefore">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div style="font-size: 10px;white-space: nowrap;word-break: keep-all">建议尺寸 690*300</div>
</div>
</div>
</template>
</xy-dialog>
<!-- 跳转商品选择-->
<Modal v-model="isShowProductSelect" title="跳转商品选择">
<Input clearable v-model="nameKeywords" search enter-button placeholder="商品搜索.." @on-search="getProducts" style="margin-bottom: 10px;"/>
<Table
highlight-row
ref="currentRowTable"
:columns="productColumns"
:data="productData"
@on-current-change="productSelect" />
<Page :current="productPageIndex" :total="productTotal" simple style="padding-top: 14px;display: flex;justify-content: center;" @on-change="productPageChange"/>
</Modal>
</div>
</template>
<script>
import {store,show,update} from '@/api/ad'
import {getparameter} from '@/api/system/dictionary'
import {index} from '@/api/product'
import { Message } from 'element-ui'
import axios from 'axios'
export default {
props:{
systems:{
type:Array
}
},
data() {
return {
id:'',
type:'add',
isShow:false,
action:`${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
types:[{label:'首页轮播图',value:0},{label:'商品轮播图',value:1}],
states:[
{
label:'禁用',
value:0
},
{
label:'启动',
value:1
}
],
form:{
name:'',
type:'',
system:'',
to:'',
state:'',
sort:'',
effectDate:[],
img:''
},
rules:{
name:[
{required:true,message:"请填写活动名称"}
],
type:[
{required:true,message:"请选择类型"}
],
system:[
{required:true,message:"请选择发布系统"}
],
to:[
{required:true,message:"请填写跳转方向"}
],
state:[
{required:true,message:"请选择状态"}
],
sort:[
{required:true,message:"请填写排序"},
{pattern:/^[0-9]+/,message:"手机号格式错误"}
],
effectDate:[
{required:true,message:"请选择日期"}
],
img:[
{required:true,message:"请选择图片"}
]
},
//
toType:'',//
isShowProductSelect:false,
productTotal:0,
productPageIndex:1,
nameKeywords:'',
productColumns:[
{
title:'编号',
key:'id',
width:80
},
{
title:'商品名称',
key:'name'
},
{
title:'单价',
key:'price',
width: 120,
align:'right'
}
],
productData:[],
}
},
methods: {
async getToUrl(){
let res = await getparameter({number:'toUrl'})
this.toUrls = res.detail.map(item => {
return {
label:item.value,
value:item.id
}
})
},
//
uploadFail(err){
console.log(err)
},
uploadSuccess(response){
console.log(response)
this.form.img = response.url
},
uploadBefore(file){
console.log(file)
if((file.size/1000) > 2024){
Message({
type:'warning',
message:'上传图片大小超过2M'
})
return false
}
},
submit(){
console.log(this.form)
if(this.type === 'add'){
store({
pic:this.form.img,
name:this.form.name,
action:this.form.to,
origin_system:this.form.system,
type:this.form.type,
sort:this.form.sort,
state:this.form.state,
valid_time_begin:this.form.effectDate[0],
valid_time_over:this.form.effectDate[1]
}).then(res => {
Message({
type:'success',
message:'添加广告成功'
})
this.isShow = false
this.$emit('refresh')
this.form = {
name:'',
type:'',
system:'',
to:'',
state:'',
sort:'',
effectDate:[],
img:''
}
this.id = ''
})
return
}
if(this.type === 'editor'){
update({
id:this.id,
pic:this.form.img,
name:this.form.name,
action:this.form.to,
origin_system:this.form.system,
type:this.form.type,
sort:this.form.sort,
state:this.form.state,
valid_time_begin:this.form.effectDate[0],
valid_time_over:this.form.effectDate[1]
}).then(res => {
Message({
type:'success',
message:'编辑广告成功'
})
this.isShow = false
this.$emit('refresh')
this.form = {
name:'',
type:'',
system:'',
to:'',
state:'',
sort:'',
effectDate:[],
img:''
}
this.id = ''
})
return
}
},
//
async getDetailAd (){
const res = await show({id:this.id})
this.form.name = res?.name
this.form.state = res?.state
this.form.system = res?.origin_system
this.form.to = res?.action
this.form.sort = res?.sort
this.form.type = res?.type
this.form.img = res?.pic
this.form.effectDate = [res?.valid_time_begin,res?.valid_time_over]
},
//
productPageChange(e){
this.productPageIndex = e
this.getProducts()
},
showToProductSelect(){
if(this.toType == 2){
this.getProducts()
this.isShowProductSelect = true
this.toType = ''
}
},
async getProducts(){
const res = await index({rows:5,page:this.productPageIndex,name:this.nameKeywords})
this.productData = res.rows
this.productTotal = res.total
},
productSelect(row){
this.form.to = `/packages/packageBuy/pages/shopDetail/shopDetail?id=${row.id}`
}
},
watch:{
isShow(val){
if(val){
if(this.type === 'editor'){
this.getDetailAd()
}
}else{
this.$refs['dialog'].reset()
this.id = ''
this.toType = ''
}
}
}
}
</script>
<style>
.avatar-uploader .el-upload {
width: 110px;
height: 110px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.avatar-uploader .el-upload:hover {
border-color: #BF617C;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 110px;
height: 110px;
line-height: 110px;
text-align: center;
}
.avatar {
width: 110px;
display: block;
border-radius: 6px;
}
.img__delete{
transform: scale(0.7,0.7);
position: absolute;
top: 1px;
left: 2%;
}
<template>
<div>
<xy-dialog :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增广告' : '编辑广告'" :form="form" :rules="rules"
ref="dialog" @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>活动名称
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写活动名称" v-model="form.name" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:type>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>类型
</div>
<div class="xy-table-item-content">
<el-select clearable placeholder="请选择类型" v-model="form.type" style="width: 300px;">
<el-option v-for="item in types" :value="item.value" :key="item.value" :label="item.label"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:system>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>发布系统
</div>
<div class="xy-table-item-content">
<el-select clearable placeholder="请选择发布系统" v-model="form.system" style="width: 300px;">
<el-option v-for="item in systems" :key="item.value" :value="item.value" :label="item.label"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:to>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>跳转方向
</div>
<div class="xy-table-item-content">
<el-input clearable :placeholder="toType === 1 ? '请填写跳转方向' : '跳转商品选择'" v-model="form.to"
style="width: 300px;" :readonly="toType === 2 ? true :false">
<el-select v-model="toType" slot="prepend" placeholder="方式选择" style="width: 110px;"
@change="showToProductSelect">
<el-option label="指定地址" :value="1"></el-option>
<el-option label="指定商品" :value="2"></el-option>
</el-select>
</el-input>
</div>
</div>
</template>
<template v-slot:state>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>状态
</div>
<div class="xy-table-item-content">
<el-select clearable placeholder="请选择状态" v-model="form.state" style="width: 300px;">
<el-option v-for="item in states" :value="item.value" :label="item.label" :key="item.value"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>排序
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写排序" v-model="form.sort" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:effectDate>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>有效期
</div>
<div class="xy-table-item-content">
<el-date-picker :editable="false" type="daterange" append-to-body clearable placeholder="请选择有效期"
v-model="form.effectDate" style="width: 300px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
</div>
</div>
</template>
<template v-slot:img>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>图片
</div>
<div class="xy-table-item-content">
<div v-if="form.img" style="position: relative;">
<img :src="form.img" class="avatar">
<Button shape="circle" icon="md-close" type="error" size="small" class="img__delete"
@click="form.img = ''"></Button>
</div>
<el-upload v-else accept="picture" :limit="1" class="avatar-uploader" list-type="picture-card"
:action="action" :show-file-list="true" :on-error="uploadFail" :on-success="uploadSuccess"
:before-upload="uploadBefore">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div style="font-size: 10px;white-space: nowrap;word-break: keep-all">建议尺寸 690*300</div>
</div>
</div>
</template>
</xy-dialog>
<!-- 跳转商品选择-->
<Modal v-model="isShowProductSelect" title="跳转商品选择">
<Input clearable v-model="nameKeywords" search enter-button placeholder="商品搜索.." @on-search="getProducts"
style="margin-bottom: 10px;" />
<Table highlight-row ref="currentRowTable" :columns="productColumns" :data="productData"
@on-current-change="productSelect" />
<Page :current="productPageIndex" :total="productTotal" simple
style="padding-top: 14px;display: flex;justify-content: center;" @on-change="productPageChange" />
</Modal>
</div>
</template>
<script>
import {
store,
show,
update
} from '@/api/ad'
import {
getparameter
} from '@/api/system/dictionary'
import {
index
} from '@/api/product'
import {
Message
} from 'element-ui'
import axios from 'axios'
export default {
props: {
systems: {
type: Array
}
},
data() {
return {
id: '',
type: 'add',
isShow: false,
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
types: [{
label: '首页轮播图',
value: 0
}, {
label: '商品轮播图',
value: 1
}],
states: [{
label: '禁用',
value: 0
},
{
label: '启动',
value: 1
}
],
form: {
name: '',
type: '',
system: '',
to: '',
state: '',
sort: '',
effectDate: [],
img: ''
},
rules: {
name: [{
required: true,
message: "请填写活动名称"
}],
type: [{
required: true,
message: "请选择类型"
}],
system: [{
required: true,
message: "请选择发布系统"
}],
to: [{
required: true,
message: "请填写跳转方向"
}],
state: [{
required: true,
message: "请选择状态"
}],
sort: [{
required: true,
message: "请填写排序"
},
{
pattern: /^[0-9]+/,
message: "手机号格式错误"
}
],
effectDate: [{
required: true,
message: "请选择日期"
}],
img: [{
required: true,
message: "请选择图片"
}]
},
//
toType: '', //
isShowProductSelect: false,
productTotal: 0,
productPageIndex: 1,
nameKeywords: '',
productColumns: [{
title: '编号',
key: 'id',
width: 80
},
{
title: '商品名称',
key: 'name'
},
{
title: '单价',
key: 'price',
width: 120,
align: 'right'
}
],
productData: [],
}
},
methods: {
async getToUrl() {
let res = await getparameter({
number: 'toUrl'
})
this.toUrls = res.detail.map(item => {
return {
label: item.value,
value: item.id
}
})
},
//
uploadFail(err) {
console.log(err)
},
uploadSuccess(response) {
console.log(response)
this.form.img = response.url
},
uploadBefore(file) {
console.log(file)
if ((file.size / 1000) > 2024) {
Message({
type: 'warning',
message: '上传图片大小超过2M'
})
return false
}
},
submit() {
console.log(this.form)
if (this.type === 'add') {
store({
pic: this.form.img,
name: this.form.name,
action: this.form.to,
origin_system: this.form.system,
type: this.form.type,
sort: this.form.sort,
state: this.form.state,
valid_time_begin: this.form.effectDate[0],
valid_time_over: this.form.effectDate[1]
}).then(res => {
Message({
type: 'success',
message: '添加广告成功'
})
this.isShow = false
this.$emit('refresh')
this.form = {
name: '',
type: '',
system: '',
to: '',
state: '',
sort: '',
effectDate: [],
img: ''
}
this.id = ''
})
return
}
if (this.type === 'editor') {
update({
id: this.id,
pic: this.form.img,
name: this.form.name,
action: this.form.to,
origin_system: this.form.system,
type: this.form.type,
sort: this.form.sort,
state: this.form.state,
valid_time_begin: this.form.effectDate[0],
valid_time_over: this.form.effectDate[1]
}).then(res => {
Message({
type: 'success',
message: '编辑广告成功'
})
this.isShow = false
this.$emit('refresh')
this.form = {
name: '',
type: '',
system: '',
to: '',
state: '',
sort: '',
effectDate: [],
img: ''
}
this.id = ''
})
return
}
},
//
async getDetailAd() {
const res = await show({
id: this.id
})
this.form.name = res?.name
this.form.state = res?.state
this.form.system = res?.origin_system
this.form.to = res?.action
this.form.sort = res?.sort
this.form.type = res?.type
this.form.img = res?.pic
this.form.effectDate = [res?.valid_time_begin, res?.valid_time_over]
},
//
productPageChange(e) {
this.productPageIndex = e
this.getProducts()
},
showToProductSelect() {
if (this.toType == 2) {
this.getProducts()
this.isShowProductSelect = true
this.toType = ''
}
},
async getProducts() {
const res = await index({
rows: 5,
page: this.productPageIndex,
name: this.nameKeywords
})
this.productData = res.rows
this.productTotal = res.total
},
productSelect(row) {
this.form.to = `/packages/packageBuy/pages/shopDetail/shopDetail?id=${row.id}`
}
},
watch: {
isShow(val) {
if (val) {
if (this.type === 'editor') {
this.getDetailAd()
}
} else {
this.$refs['dialog'].reset()
this.id = ''
this.toType = ''
}
}
}
}
</script>
<style>
.avatar-uploader .el-upload {
width: 110px;
height: 110px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.avatar-uploader .el-upload:hover {
border-color: #BF617C;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 110px;
height: 110px;
line-height: 110px;
text-align: center;
}
.avatar {
width: 110px;
display: block;
border-radius: 6px;
}
.img__delete {
transform: scale(0.7, 0.7);
position: absolute;
top: 1px;
left: 2%;
}
</style>

@ -0,0 +1,249 @@
<template>
<div>
<xy-dialog :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增导航' : '编辑导航'" :form="form" :rules="rules"
ref="dialog" @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>名称
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写名称" v-model="form.name" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:link>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>跳转方向
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写跳转地址" v-model="form.link" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:state>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>状态
</div>
<div class="xy-table-item-content">
<el-select clearable placeholder="请选择状态" v-model="form.state" style="width: 300px;">
<el-option v-for="item in states" :value="item.value" :label="item.label" :key="item.value"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:sort_number>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>排序
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写排序" v-model="form.sort_number" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:icon>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>图标
</div>
<div class="xy-table-item-content">
<div v-if="form.icon" style="position: relative;">
<img :src="form.icon" class="avatar">
<Button shape="circle" icon="md-close" type="error" size="small" class="img__delete"
@click="form.icon = ''"></Button>
</div>
<el-upload v-else accept="picture" :limit="1" class="avatar-uploader" list-type="picture-card"
:action="action" :show-file-list="true" :on-error="uploadFail" :on-success="uploadSuccess"
:before-upload="uploadBefore">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div style="font-size: 10px;white-space: nowrap;word-break: keep-all">建议尺寸 88*88</div>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
store,
show,
update
} from '@/api/marketing/indexNav'
import {
Message
} from 'element-ui'
import axios from 'axios'
export default {
props: {
systems: {
type: Array
}
},
data() {
return {
id: '',
type: 'add',
isShow: false,
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
states: [{
label: '禁用',
value: 0
},
{
label: '启动',
value: 1
}
],
form: {
name: '',
link: '',
state: '',
sort_number: '',
icon: ''
},
rules: {
name: [{
required: true,
message: "请填写名称"
}],
link: [{
required: true,
message: "请填写跳转地址"
}],
state: [{
required: true,
message: "请选择状态"
}],
sort: [{
required: true,
message: "请填写排序"
}],
icon: [{
required: true,
message: "请选择图标"
}]
}
}
},
methods: {
//
uploadFail(err) {
console.log(err)
},
uploadSuccess(response) {
console.log(response)
this.form.icon = response.url
},
uploadBefore(file) {
console.log(file)
if ((file.size / 1000) > 2024) {
Message({
type: 'warning',
message: '上传图片大小超过2M'
})
return false
}
},
submit() {
if (this.type === 'add') {
store(this.form).then(res => {
Message({
type: 'success',
message: '添加导航成功'
})
this.resetForm();
})
} else if (this.type === 'editor') {
update({
id: this.id,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑导航成功'
})
this.resetForm();
})
}
},
resetForm() {
this.isShow = false
this.$emit('refresh')
Object.keys(this.form).forEach((key) => (this.form[key] = ''));
this.id = ''
},
//
async getDetail() {
const res = await show({
id: this.id
})
Object.assign(this.form, res);
}
},
watch: {
isShow(val) {
if (val) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.$refs['dialog'].reset()
this.id = ''
}
}
}
}
</script>
<style>
.avatar-uploader .el-upload {
width: 110px;
height: 110px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.avatar-uploader .el-upload:hover {
border-color: #BF617C;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 110px;
height: 110px;
line-height: 110px;
text-align: center;
}
.avatar {
width: 110px;
display: block;
border-radius: 6px;
}
.img__delete {
transform: scale(0.7, 0.7);
position: absolute;
top: 1px;
left: 2%;
}
</style>

@ -0,0 +1,308 @@
<template>
<div>
<xy-dialog :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增在线客服' : '编辑在线客服'" :form="form"
:rules="rules" ref="dialog" @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>姓名
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写姓名" v-model="form.name" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:nickname>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>昵称
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写昵称" v-model="form.nickname" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:phone>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>电话
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写电话" v-model="form.phone" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:wechat>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>微信号
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写微信" v-model="form.wechat" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:state>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>状态
</div>
<div class="xy-table-item-content">
<el-select clearable placeholder="请选择状态" v-model="form.state" style="width: 300px;">
<el-option v-for="item in states" :value="item.value" :label="item.label" :key="item.value"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:sort_number>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>排序
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写排序" v-model="form.sort_number" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:wechat_code>
<div class="xy-table-item">
<div class="xy-table-item-label">微信
</div>
<div class="xy-table-item-content">
<div v-if="form.wechat_code" style="position: relative;">
<img :src="form.wechat_code" class="avatar">
<Button shape="circle" icon="md-close" type="error" size="small" class="img__delete"
@click="form.wechat_code = ''"></Button>
</div>
<el-upload v-else accept="picture" :limit="1" class="avatar-uploader" list-type="picture-card"
:action="action" :show-file-list="true" :on-error="uploadFailCode" :on-success="uploadSuccessCode"
:before-upload="uploadBeforeCode">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div style="font-size: 10px;white-space: nowrap;word-break: keep-all">建议尺寸 宽度750*高度400</div>
</div>
</div>
</template>
<template v-slot:company_wechat_code>
<div class="xy-table-item">
<div class="xy-table-item-label">企业微信
</div>
<div class="xy-table-item-content">
<div v-if="form.company_wechat_code" style="position: relative;">
<img :src="form.company_wechat_code" class="avatar">
<Button shape="circle" icon="md-close" type="error" size="small" class="img__delete"
@click="form.company_wechat_code = ''"></Button>
</div>
<el-upload v-else accept="picture" :limit="1" class="avatar-uploader" list-type="picture-card"
:action="action" :show-file-list="true" :on-error="uploadFail" :on-success="uploadSuccess"
:before-upload="uploadBefore">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div style="font-size: 10px;white-space: nowrap;word-break: keep-all">建议尺寸 宽度750*高度400</div>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
store,
show,
update
} from '@/api/marketing/service'
import {
Message
} from 'element-ui'
import axios from 'axios'
export default {
props: {
systems: {
type: Array
}
},
data() {
return {
id: '',
type: 'add',
isShow: false,
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
states: [{
label: '禁用',
value: 0
},
{
label: '启动',
value: 1
}
],
form: {
name: '',
phone: '',
nickname: "",
wechat: "",
wechat_code: '',
company_wechat_code: '',
sort_number: '',
state: '',
},
rules: {
name: [{
required: true,
message: "请填写名称"
}],
phone: [{
required: true,
message: "请填写联系电话"
}],
state: [{
required: true,
message: "请选择状态"
}],
sort_number: [{
required: true,
message: "请填写排序"
}],
wechat_code: [{
required: true,
message: "请选择图标"
}]
}
}
},
methods: {
//
uploadFailCode(err) {
console.log(err)
},
uploadSuccessCode(response) {
console.log(response)
this.form.wechat_code = response.url
},
uploadBeforeCode(file) {
console.log(file)
if ((file.size / 1000) > 2024) {
Message({
type: 'warning',
message: '上传图片大小超过2M'
})
return false
}
},
//
uploadFail(err) {
console.log(err)
},
uploadSuccess(response) {
console.log(response)
this.form.company_wechat_code = response.url
},
uploadBefore(file) {
console.log(file)
if ((file.size / 1000) > 2024) {
Message({
type: 'warning',
message: '上传图片大小超过2M'
})
return false
}
},
submit() {
if (this.type === 'add') {
store(this.form).then(res => {
Message({
type: 'success',
message: '添加在线客服成功'
})
this.resetForm();
})
} else if (this.type === 'editor') {
update({
id: this.id,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑在线客服成功'
})
this.resetForm();
})
}
},
resetForm() {
this.isShow = false
this.$emit('refresh')
Object.keys(this.form).forEach((key) => (this.form[key] = ''));
this.id = ''
},
//
async getDetail() {
const res = await show({
id: this.id
})
Object.assign(this.form, res);
}
},
watch: {
isShow(val) {
if (val) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.$refs['dialog'].reset()
this.id = ''
}
}
}
}
</script>
<style>
.avatar-uploader .el-upload {
width: 110px;
height: 110px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.avatar-uploader .el-upload:hover {
border-color: #BF617C;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 110px;
height: 110px;
line-height: 110px;
text-align: center;
}
.avatar {
width: 110px;
display: block;
border-radius: 6px;
}
.img__delete {
transform: scale(0.7, 0.7);
position: absolute;
top: 1px;
left: 2%;
}
</style>

@ -0,0 +1,199 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header :icon="routeIcon" :text="routeTitle" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div style="display:flex;">
<Input v-model="select.name" placeholder="关键词" clearable style="width: 200px;margin-right: 10px;"/>
<Button type="primary" @click="$refs['addForm'].isShow = true,$refs['addForm'].type = 'add'" style="margin-right: 10px;">新增</Button>
<Button type="primary" @click="serachList()" style="margin-right: 10px;">搜索</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table
:list="list"
:table-item="table"
:total="total"
@pageSizeChange="e => select.pageSize = e"
@pageIndexChange="pageChange"
@editor="editorShow"
@delete="deleteAd">
</xy-table>
<!-- 新增-->
<add-nav ref="addForm" @refresh="getList"></add-nav>
</div>
</template>
<script>
import {index,destroy} from "@/api/marketing/indexNav"
import {parseTime} from '@/utils'
import addNav from './components/addNav.vue'
import { Message } from 'element-ui'
export default {
components:{
addNav
},
data() {
return {
routeTitle:"",
routeIcon:"",
select:{
pageSize:10,
pageIndex:1,
},
total:0,
list:[],
table:[
{
label:'图片',
sortable:false,
width:260,
align:'left',
customFn:(row)=>{
if(row.icon){
return (<el-image style={{'height':'120px'}} src={row.icon} fit='scale-down'></el-image>)
}else{
return (<div>暂无图片</div>)
}
}
},
{
label:'名称',
sortable:false,
width: 180,
align:'left',
prop:'name',
fixed:'left'
},
{
label:'跳转地址',
sortable:false,
minWidth: 300,
align:'left',
prop:'link'
},
{
label:'排序',
width: 100,
prop:'sort_number'
},
{
label:'状态',
width: 100,
customFn:(row)=>{
return (
<div>
<Tag color={row.state == 1 ? 'green' : 'blue'}>{row.state == 1 ? '启用' : '未启用'}</Tag>
</div>
)
}
},
{
label:'创建人/创建时间',
width: 220,
customFn:(row)=>{
return (<div>{row.admin.name} / {parseTime(new Date(row.created_at),'{y}-{m}-{d}')}</div>)
}
}
],
}
},
methods: {
serachList(){
this.resetSelect();
this.getList();
},
async getList(){
const res = await index({
page_size:this.select.pageSize,
page:this.select.pageIndex
})
this.list = res.data
this.total = res.total
},
resetSelect(){
this.select = {
pageSize:10,
pageIndex:1
}
},
pageChange(e){
this.select.pageIndex = e
this.getList()
},
editorShow(row){
this.$refs['addForm'].type = 'editor'
this.$refs['addForm'].id = row.id
this.$refs['addForm'].isShow = true
},
deleteAd(row){
destroy({id:row.id}).then(res => {
Message({
type:'success',
message:'删除成功'
})
this.getList()
})
}
},
mounted() {
this.routeTitle=this.$route.meta.title;
this.routeIcon=this.$route.meta.icon;
this.getList()
}
}
</script>
<style scoped lang="scss">
.selects {
display: flex;
flex-wrap: wrap;
&-item{
display: flex;
align-items: center;
justify-content: center;
margin-top: 6px;
&-label{
white-space: nowrap;
padding: 0px 6px;
}
}
}
.select-content-item{
display: flex;
align-items: center;
margin-bottom: 10px;
&-label{
padding: 0 20px;
}
}
$primaryColor: #bf617c;
::v-deep .ivu-alert-success{
color:#fff;
border-color: $primaryColor !important;
background: rgba(213, 120, 145, 0.8) !important;
margin: auto 0;
margin-right: 10px;
}
::v-deep .ivu-icon-ios-close:before{
color: #fff;
}
</style>

@ -0,0 +1,207 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header :icon="routeIcon" :text="routeTitle" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div style="display:flex;">
<Input v-model="select.name" placeholder="关键词" clearable style="width: 200px;margin-right: 10px;"/>
<Button type="primary" @click="$refs['addForm'].isShow = true,$refs['addForm'].type = 'add'" style="margin-right: 10px;">新增</Button>
<Button type="primary" @click="serachList" style="margin-right: 10px;">搜索</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table
:list="list"
:table-item="table"
:total="total"
@pageSizeChange="e => select.pageSize = e"
@pageIndexChange="pageChange"
@editor="editorShow"
@delete="deleteAd">
</xy-table>
<!-- 新增-->
<add ref="addForm" @refresh="getList"></add>
</div>
</template>
<script>
import {index,destroy} from "@/api/marketing/service"
import {parseTime} from '@/utils'
import add from './components/addService.vue'
import { Message } from 'element-ui'
export default {
components:{
add
},
data() {
return {
routeTitle:"",
routeIcon:"",
select:{
pageSize:10,
pageIndex:1,
},
total:0,
list:[],
table:[
{
label:'微信',
sortable:false,
width:260,
align:'left',
customFn:(row)=>{
if(row.wechat_code){
return (<el-image style={{'height':'120px','width':'100%'}} src={row.wechat_code} fit='scale-down'></el-image>)
}else{
return (<div>暂无图片</div>)
}
}
},
{
label:'姓名',
sortable:false,
width: 120,
align:'left',
prop:'name',
fixed:'left'
},
{
label:'昵称',
sortable:false,
width: 120,
align:'left',
prop:'nickname',
fixed:'left'
},
{
label:'电话',
sortable:false,
minWidth: 120,
align:'left',
prop:'link'
},
{
label:'排序',
width: 100,
prop:'sort_number'
},
{
label:'状态',
width: 100,
customFn:(row)=>{
return (
<div>
<Tag color={row.state == 1 ? 'green' : 'blue'}>{row.state == 1 ? '启用' : '未启用'}</Tag>
</div>
)
}
},
{
label:'创建人/创建时间',
width: 220,
customFn:(row)=>{
return (<div>{row.admin.name} / {parseTime(new Date(row.created_at),'{y}-{m}-{d}')}</div>)
}
}
],
}
},
methods: {
serachList(){
this.resetSelect();
this.getList();
},
async getList(){
const res = await index({
page_size:this.select.pageSize,
page:this.select.pageIndex
})
this.list = res.data
this.total = res.total
},
resetSelect(){
this.select = {
pageSize:10,
pageIndex:1
}
},
pageChange(e){
this.select.pageIndex = e
this.getList()
},
editorShow(row){
this.$refs['addForm'].type = 'editor'
this.$refs['addForm'].id = row.id
this.$refs['addForm'].isShow = true
},
deleteAd(row){
destroy({id:row.id}).then(res => {
Message({
type:'success',
message:'删除成功'
})
this.getList()
})
}
},
mounted() {
this.routeTitle=this.$route.meta.title;
this.routeIcon=this.$route.meta.icon;
this.getList()
}
}
</script>
<style scoped lang="scss">
.selects {
display: flex;
flex-wrap: wrap;
&-item{
display: flex;
align-items: center;
justify-content: center;
margin-top: 6px;
&-label{
white-space: nowrap;
padding: 0px 6px;
}
}
}
.select-content-item{
display: flex;
align-items: center;
margin-bottom: 10px;
&-label{
padding: 0 20px;
}
}
$primaryColor: #bf617c;
::v-deep .ivu-alert-success{
color:#fff;
border-color: $primaryColor !important;
background: rgba(213, 120, 145, 0.8) !important;
margin: auto 0;
margin-right: 10px;
}
::v-deep .ivu-icon-ios-close:before{
color: #fff;
}
</style>

@ -75,7 +75,7 @@
<xy-table :list="list" :table-item="table" :total="total" @pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="200" header-align="center">
<el-table-column fixed="right" label="操作" width="400" header-align="center">
<template slot-scope="scope">
<actions :row="scope.row" @log="showLog(scope.row)" @refresh="getOrders"></actions>
<!-- <Button icon="ios-chatbubbles-outline" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>跟进</Button>-->
@ -125,10 +125,17 @@ export default {
total:0,
list:[],
table:[
{
prop: "order.serial",
label:"订单编号",
width:150,
align:'center',
fixed:'left'
},
{
prop: "order_name",
label:"订单名称",
width:240,
width:340,
align:'left',
fixed:'left'
},

@ -10,7 +10,7 @@
:before-remove="handleBeforeRemove"
:on-remove="handleRemove"
:file-list="fileList"
list-type="picture">
list-type="picture" multiple>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过2M</div>
</el-upload>

@ -10,7 +10,7 @@
:before-remove="handleBeforeRemove"
:on-remove="handleRemove"
:file-list="fileList"
list-type="picture">
list-type="picture" multiple>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过2M</div>
</el-upload>

@ -68,7 +68,7 @@ export default {
return {
select:{
page:1,
pageSize:10,
page_size:10,
keywords:'',
type:''
},
@ -136,7 +136,7 @@ export default {
async getClubs(){
const res = await index({
page:this.select.page,
pageSize:this.select.pageSize,
page_size:this.select.page_size,
keyword:this.select.keywords
})
console.log(res)

Loading…
Cancel
Save