悬浮栏联调

master
yujialong 6 months ago
parent 4da9ff39b5
commit 50787383b2
  1. 1
      src/api/index.js
  2. 77
      src/pages/floatingFrame/index.vue
  3. 15
      src/plugins/requests/index.js

@ -87,5 +87,6 @@ export default {
findFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/findById`,
listFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/floatingBarList`,
saveFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/saveOrUpdate`,
checkEnableOrDisable: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/checkEnableOrDisable`,
enableOrDisableScheme: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/enableOrDisableScheme`,
}

@ -29,7 +29,7 @@
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" type="text"
@click="del(scope.row)">删除</el-button>
<el-switch class="m-l-10" v-model="scope.row.isDisable" :active-value="0" :inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
@change="switchOff(scope.row)">
</el-switch>
</template>
</el-table-column>
@ -62,16 +62,16 @@
<el-table-column prop="schemeTitle" label="标题" min-width="240"></el-table-column>
<el-table-column prop="schemeContentJson" label="内容" min-width="240">
<template slot-scope="scope">
<div v-html="scope.row.schemeContentJson"></div>
<div class="p-t-10 p-b-10" v-html="scope.row.schemeContentJson"></div>
</template>
</el-table-column>
<el-table-column label="操作" :width="110" align="center">
<el-table-column label="操作" :width="120" align="center">
<template slot-scope="scope">
<div class="flex a-center">
<el-switch v-model="scope.row.isDisable" :active-value="0" :inactive-value="1">
</el-switch>
<i class="el-icon-edit-outline del" @click="editRow(scope.row, scope.$index)"></i>
<i class="el-icon-delete del" @click="delRow(scope.$index)"></i>
<el-switch class="m-l-10" v-model="scope.row.isDisable" :active-value="0"
:inactive-value="1"></el-switch>
</div>
</template>
</el-table-column>
@ -168,7 +168,47 @@ export default {
schemeName: '',
floatingBarStyle: '1',
siteId: this.$store.state.content.site.id,
floatingColumnSchemeModules: [],
floatingColumnSchemeModules: [
{
pictureAddress: 'https://huorantech.com/images/index/wechat.png',
schemeTitle: '微信扫码添加职站售前咨询',
isDisable: 0,
schemeContentJson: `
<div style="width: 168px;text-align: center;line-height: normal;">
<p style="margin: 5px 0 15px;font-size: 12px;color: #333;">提供付费咨询及解决方案</p>
<img width="150" src="https://huorantech.com/images/index/customer.png" alt="">
</div>
`
},
{
pictureAddress: 'https://huorantech.com/images/index/tel.png',
schemeTitle: '',
isDisable: 0,
schemeContentJson: `
<div style="width: 190px;line-height: normal;">
<div style="display: flex;margin-bottom: 20px;">
<div>
<img src="https://huorantech.com/images/index/tel-2.png" alt="">
</div>
<div style="margin-left: 15px;">
<p style="font-size: 14px;cursor: pointer;">售前咨询</p>
<p style="margin: 5px 0;font-size: 12px;color: #006eff;">金老师</p>
<p style="font-size: 12px;color: #006eff;">15218726836</p>
</div>
</div>
<div style="display: flex;">
<div>
<img src="https://huorantech.com/images/index/sug.png" alt="">
</div>
<div style="margin-left: 15px;">
<a style="font-size: 14px;color: #333;text-decoration: none;cursor: pointer;" target="_blank" href="https://www.wjx.cn/vm/wB0RcMm.aspx">咨询建议与反馈</a>
<p style="margin-top: 5px;font-size: 12px;color: #686868;">您的每一条建议声音我们都认真对待</p>
</div>
</div>
</div>
`
}
],
floatingColumnSchemeScopeOfApplications: [],
},
originModules: {
@ -192,9 +232,9 @@ export default {
pictureAddress: [
{ required: true, message: '请上传图片', trigger: 'change' }
],
schemeTitle: [
{ required: true, message: '请输入标题', trigger: 'blur' }
],
// schemeTitle: [
// { required: true, message: '', trigger: 'blur' }
// ],
schemeContentJson: [
{ required: true, message: '请输入内容', trigger: 'blur' }
],
@ -202,7 +242,7 @@ export default {
cropperModel: false,
isUpload: false,
fixedNumber: [1.76, 1],
fixedNumber: [1, 1],
file: {}, //
};
},
@ -433,8 +473,23 @@ export default {
}).catch(() => { })
},
//
async switchOff (val, row) {
async switchOff (row) {
try {
const { code, msg } = await this.$post(`${this.api.checkEnableOrDisable}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
// debugger
if (code === 300) {
// 300
this.$confirm(msg, '提示', {
type: "warning"
}).then(async () => {
await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
}).catch(() => {
row.isDisable = row.isDisable ? 0 : 1
})
} else {
await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
}
} catch (e) { }
},
//
batchDel () {

@ -19,7 +19,7 @@ service.interceptors.request.use(config => {
}, err => {
Util.errorMsg({
message: "退出登陆",
onClose: function() {
onClose: function () {
store.dispatch('user/logout')
}
});
@ -32,13 +32,16 @@ service.interceptors.response.use(
const res = response.data
const { code } = res
if (code == 200) {
return Promise.resolve(res).catch(e => {});
return Promise.resolve(res).catch(e => { });
} else if (code === 401) {
Util.errorMsg(res.msg)
setTimeout(() => {
store.dispatch('user/logout')
}, 1000)
return Promise.reject(res)
} else if (code == 300) {
// 悬浮栏管理里的禁用启用返回300要弹询问框选择是否继续
return Promise.resolve(res).catch(e => { });
} else {
Util.errorMsg(res.msg);
return Promise.reject(res)
@ -73,7 +76,7 @@ service.interceptors.response.use(
}
);
function get(url, params) {
function get (url, params) {
return new Promise((resolve, reject) => {
service.get(url, { params: params }).then(res => {
resolve(res);
@ -83,7 +86,7 @@ function get(url, params) {
});
}
function post(url, params) {
function post (url, params) {
return new Promise((resolve, reject) => {
service.post(url, params).then(res => {
resolve(res);
@ -93,7 +96,7 @@ function post(url, params) {
});
}
function del(url, params) {
function del (url, params) {
return new Promise((resolve, reject) => {
service.delete(url, {
data: params
@ -105,7 +108,7 @@ function del(url, params) {
});
}
function put(url, params) {
function put (url, params) {
return new Promise((resolve, reject) => {
service.put(url, params).then(res => {
resolve(res);

Loading…
Cancel
Save