悬浮栏联调

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

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

@ -29,7 +29,7 @@
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" type="text" <el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" type="text"
@click="del(scope.row)">删除</el-button> @click="del(scope.row)">删除</el-button>
<el-switch class="m-l-10" v-model="scope.row.isDisable" :active-value="0" :inactive-value="1" <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> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
@ -62,16 +62,16 @@
<el-table-column prop="schemeTitle" label="标题" min-width="240"></el-table-column> <el-table-column prop="schemeTitle" label="标题" min-width="240"></el-table-column>
<el-table-column prop="schemeContentJson" label="内容" min-width="240"> <el-table-column prop="schemeContentJson" label="内容" min-width="240">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" :width="110" align="center"> <el-table-column label="操作" :width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex a-center"> <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-edit-outline del" @click="editRow(scope.row, scope.$index)"></i>
<i class="el-icon-delete del" @click="delRow(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> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -168,7 +168,47 @@ export default {
schemeName: '', schemeName: '',
floatingBarStyle: '1', floatingBarStyle: '1',
siteId: this.$store.state.content.site.id, 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: [], floatingColumnSchemeScopeOfApplications: [],
}, },
originModules: { originModules: {
@ -192,9 +232,9 @@ export default {
pictureAddress: [ pictureAddress: [
{ required: true, message: '请上传图片', trigger: 'change' } { required: true, message: '请上传图片', trigger: 'change' }
], ],
schemeTitle: [ // schemeTitle: [
{ required: true, message: '请输入标题', trigger: 'blur' } // { required: true, message: '', trigger: 'blur' }
], // ],
schemeContentJson: [ schemeContentJson: [
{ required: true, message: '请输入内容', trigger: 'blur' } { required: true, message: '请输入内容', trigger: 'blur' }
], ],
@ -202,7 +242,7 @@ export default {
cropperModel: false, cropperModel: false,
isUpload: false, isUpload: false,
fixedNumber: [1.76, 1], fixedNumber: [1, 1],
file: {}, // file: {}, //
}; };
}, },
@ -433,8 +473,23 @@ export default {
}).catch(() => { }) }).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}`) await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
}
} catch (e) { }
}, },
// //
batchDel () { batchDel () {

@ -39,6 +39,9 @@ service.interceptors.response.use(
store.dispatch('user/logout') store.dispatch('user/logout')
}, 1000) }, 1000)
return Promise.reject(res) return Promise.reject(res)
} else if (code == 300) {
// 悬浮栏管理里的禁用启用返回300要弹询问框选择是否继续
return Promise.resolve(res).catch(e => { });
} else { } else {
Util.errorMsg(res.msg); Util.errorMsg(res.msg);
return Promise.reject(res) return Promise.reject(res)

Loading…
Cancel
Save