| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540 |
- <?php
- /**
- * @link:http://www.gdqijianshi.com/
- * @copyright: Copyright (c) 2020 广东七件事集团
- * Created by PhpStorm
- * Author: lun
- * Date: 2021-09-15
- * Time: 12:36
- */
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-attachment');
- ComponentHelper::loadComponentView('com-image');
- ?>
- <style>
- .el-tabs__header {
- padding: 0 20px;
- height: 56px;
- line-height: 56px;
- background-color: #fff;
- margin-bottom: 0;
- }
- .title {
- margin-top: 10px;
- padding: 18px 20px;
- border-top: 1px solid #F3F3F3;
- border-bottom: 1px solid #F3F3F3;
- background-color: #fff;
- }
- .form-body {
- background-color: #fff;
- padding: 20px 50% 20px 0;
- }
- .button-item {
- padding: 9px 25px;
- }
- .form-body .item {
- width: 300px;
- margin-bottom: 50px;
- margin-right: 25px;
- }
- .item-img {
- height: 550px;
- padding: 25px 10px;
- border-radius: 30px;
- border: 1px solid #CCCCCC;
- background-color: #fff;
- }
- .item .el-form-item {
- width: 300px;
- margin: 20px auto;
- }
- .left-setting-menu {
- width: 260px;
- }
- .left-setting-menu .el-form-item {
- height: 60px;
- padding-left: 20px;
- display: flex;
- align-items: center;
- margin-bottom: 0;
- cursor: pointer;
- }
- .left-setting-menu .el-form-item .el-form-item__label {
- cursor: pointer;
- }
- .left-setting-menu .el-form-item.active {
- background-color: #F3F5F6;
- border-top-left-radius: 10px;
- width: 105%;
- border-bottom-left-radius: 10px;
- }
- .left-setting-menu .el-form-item .el-form-item__content {
- margin-left: 0 !important
- }
- .no-radius {
- border-top-left-radius: 0 !important;
- }
- .del-btn {
- position: absolute;
- right: -8px;
- top: -8px;
- padding: 4px 4px;
- }
- .reset {
- position: absolute;
- top: 3px;
- left: 90px;
- }
- .app-tip {
- position: absolute;
- right: 24px;
- top: 16px;
- height: 72px;
- line-height: 72px;
- max-width: calc(100% - 78px);
- }
- .app-tip:before {
- content: ' ';
- width: 0;
- height: 0;
- border-color: inherit;
- position: absolute;
- top: -32px;
- right: 100px;
- border-width: 16px;
- border-style: solid;
- }
- .tip-content {
- display: block;
- white-space: nowrap;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- margin: 0 28px;
- font-size: 28px;
- }
- .btn-abs{
- position: absolute;
- top: 12px;
- right: 18px;
- }
- .form-body .app-share {
- padding-top: 12px;
- border-top: 1px solid #e2e2e2;
- margin-top: -20px;
- }
- .form-body .app-share .app-share-bg {
- position: relative;
- width: 310px;
- height: 360px;
- background-repeat: no-repeat;
- background-size: contain;
- background-position: center
- }
- .form-body .app-share .app-share-bg .title {
- width: 160px;
- height: 29px;
- line-height: 1;
- word-break: break-all;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- }
- .form-body .app-share .app-share-bg .pic-image {
- background-repeat: no-repeat;
- background-position: 0 0;
- background-size: cover;
- width: 160px;
- height: 130px;
- }
- </style>
- <div id="app" v-cloak>
- <el-card v-loading="loading" style="border:0" shadow="never" body-style="background-color: #f3f3f3;padding: 0 0;">
- <el-form :model="ruleForm" ref="ruleForm" label-width="172px" style="position: relative" size="small">
- <el-row>
- <el-col :span="24">
- <div class="title"><span>悬浮窗设置</span></div>
- <div class="form-body" style="margin-bottom: 0px;">
- <el-form-item label="启用悬浮按钮">
- <el-switch
- v-model="ruleForm.is_quick_navigation"
- :active-value="1"
- :inactive-value="0"
- active-color="#409EFF">
- </el-switch>
- </el-form-item>
- <el-form-item label="悬浮按钮样式" prop="quick_navigation_style">
- <el-radio v-model="ruleForm.quick_navigation_style" :label="1">展开收起</el-radio>
- <el-radio v-model="ruleForm.quick_navigation_style" :label="2">固定展开</el-radio>
- </el-form-item>
- <el-form-item label="展开图标">
- <com-attachment :multiple="false" :max="1" @selected="quickNavigationOpenedPic">
- <el-tooltip effect="dark" content="建议尺寸:100 * 100" placement="top">
- <el-button size="mini">选择图标</el-button>
- </el-tooltip>
- </com-attachment>
- <el-button size="mini" @click="resetImg('quick_navigation_opened_pic')" class="reset" type="primary">恢复默认</el-button>
- <com-image style="width: 80px; height: 80px;" :src="ruleForm.quick_navigation_opened_pic"></com-image>
- </el-form-item>
- <el-form-item label="收起图标">
- <com-attachment :multiple="false" :max="1" @selected="quickNavigationClosedPic">
- <el-tooltip effect="dark" content="建议尺寸:100 * 100" placement="top">
- <el-button size="mini">选择图标</el-button>
- </el-tooltip>
- </com-attachment>
- <el-button size="mini" @click="resetImg('quick_navigation_closed_pic')" class="reset" type="primary">恢复默认</el-button>
- <com-image style="width: 80px; height: 80px;" :src="ruleForm.quick_navigation_closed_pic"></com-image>
- </el-form-item>
- </div>
- </el-col>
- <el-col :span="24">
- <div class="title"><span>客服开关设置</span></div>
- <div class="form-body" style="background-color: #ffffff;padding: 0 0 20px 0;margin-bottom: 0px;">
- <el-form-item label="在线客服开关" style="padding-top: 20px;border-top: 1px solid #F3F3F3;">
- <el-switch
- v-model="ruleForm.is_customer_services"
- :active-value="1"
- :inactive-value="0"
- active-color="#409EFF">
- </el-switch>
- </el-form-item>
- <el-form-item label="客服图标">
- <com-attachment :multiple="false" :max="1" @selected="customerServicesPic">
- <el-tooltip effect="dark" content="建议尺寸:100 * 100" placement="top">
- <el-button size="mini">选择图标</el-button>
- </el-tooltip>
- </com-attachment>
- <el-button size="mini" @click="resetImg('customer_services_pic')" class="reset" type="primary">恢复默认</el-button>
- <com-image style="width: 80px; height: 80px;" :src="ruleForm.customer_services_pic"></com-image>
- </el-form-item>
- </div>
- <div class="title">
- <span>悬浮按钮设置</span>
- <el-tooltip effect="dark" content="用于商品列表页" placement="top">
- <i class="el-icon-info"></i>
- </el-tooltip>
- </div>
- <div class="form-body">
- <el-form-item label="启用回到顶部悬浮按钮" prop="is_show_scroll_top">
- <el-switch
- v-model="ruleForm.is_show_scroll_top"
- :active-value="1"
- :inactive-value="0"
- active-color="#409EFF">
- </el-switch>
- </el-form-item>
- </div>
- </el-col>
- </el-row>
- <el-button :loading="submitLoading" class="button-item" size="small" type="primary"
- @click="submit()">保存
- </el-button>
- <div style="height: 30px;"></div>
- </el-form>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- submitLoading: false,
- ruleForm: {
- is_quick_navigation: 0,// 启用悬浮按钮
- quick_navigation_style: 1,// 悬浮按钮样式
- quick_navigation_opened_pic: '',//悬浮按钮展开图标
- quick_navigation_closed_pic: '',// 悬浮按钮收起图标
- is_customer_services: 0,// 在线客服开关
- customer_services_pic: '',// 客服图标
- is_show_scroll_top: 0,// 启用回到顶部悬浮按钮
- }
- };
- },
- created() {
- this.loadData();
- },
- mounted: function () {
- },
- methods: {
- loadData() {
- this.loading = true;
- request({
- params: {
- r: 'mall/decorate/float-button',
- },
- }).then(e => {
- this.loading = false;
- if (e.data.code === 0) {
- if (!isEmpty(e.data.data)) {
- this.ruleForm = e.data.data;
- }
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- });
- },
- submit(){
- this.submitLoading = true;
- request({
- params: {
- r: 'mall/decorate/float-button',
- },
- method: 'post',
- data: {
- ruleForm: this.ruleForm
- },
- }).then(e => {
- this.submitLoading = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- });
- },
- //客服图标
- customerServicesPic(e) {
- if (e.length) {
- this.ruleForm.customer_services_pic = e[0].url;
- }
- },
- //拨号图标
- dialPic(e) {
- if (e.length) {
- this.ruleForm.dial_pic = e[0].url;
- }
- },
- //客服外链图标
- webServicePic(e) {
- if (e.length) {
- this.ruleForm.web_service_pic = e[0].url;
- }
- },
- //快捷导航图标(展开)
- quickNavigationOpenedPic(e) {
- if (e.length) {
- this.ruleForm.quick_navigation_opened_pic = e[0].url;
- }
- },
- //快捷导航图标(收起)
- quickNavigationClosedPic(e) {
- if (e.length) {
- this.ruleForm.quick_navigation_closed_pic = e[0].url;
- }
- },
- //客服外链图标
- smallAppPic(e) {
- if (e.length) {
- this.ruleForm.small_app_pic = e[0].url;
- }
- },
- //一键导航图标
- quickMapPic(e) {
- if (e.length) {
- this.ruleForm.quick_map_pic = e[0].url;
- }
- },
- resetImg(type) {
- const host = "<?php echo \Yii::$app->request->hostInfo . \Yii::$app->request->baseUrl . "/" ?>";
- if (type == 'quick_navigation_opened_pic') {
- this.ruleForm.quick_navigation_opened_pic = host + 'resources/img/mall/quick_navigation_opened_pic.png';
- } else if (type == 'quick_navigation_closed_pic') {
- this.ruleForm.quick_navigation_closed_pic = host + 'resources/img/mall/quick_navigation_closed_pic.png';
- } else if (type == 'small_app_pic') {
- this.ruleForm.small_app_pic = host + 'resources/img/mall/small_app_pic.png';
- } else if (type == 'quick_map_pic') {
- this.ruleForm.quick_map_pic = host + 'resources/img/mall/quick_map_pic.png';
- } else if (type == 'web_service_pic') {
- this.ruleForm.web_service_pic = host + 'resources/img/mall/web_service_pic.png';
- } else if (type == 'dial_pic') {
- this.ruleForm.dial_pic = host + 'resources/img/mall/dial_pic.png';
- } else if (type == 'quick_home_pic') {
- this.ruleForm.quick_home_pic = host + 'resources/img/mall/quick_home_pic.png';
- } else if (type == 'customer_services_pic') {
- this.ruleForm.customer_services_pic = host + 'resources/img/mall/customer_services_pic.png';
- }
- },
- },
- computed: {
- appTip() {
- let setting = this.ruleForm.setting;
- return `background-color:${setting.add_app_bg_color};` +
- `opacity:${setting.add_app_bg_transparency / 100};` +
- `border-radius:${setting.add_app_bg_radius}px;` +
- `border-color: transparent transparent ${setting.add_app_bg_color} transparent;` +
- `color:${setting.add_app_text_color}`;
- }
- }
- });
- </script>
- <style>
- .el-tabs__header {
- padding: 0 20px;
- height: 56px;
- line-height: 56px;
- background-color: #fff;
- margin-bottom: 0;
- }
- .title {
- margin-top: 10px;
- padding: 18px 20px;
- border-top: 1px solid #F3F3F3;
- border-bottom: 1px solid #F3F3F3;
- background-color: #fff;
- }
- .form-body {
- background-color: #fff;
- padding: 20px 50% 20px 0;
- }
- .button-item {
- margin-top: 12px;
- padding: 9px 25px;
- }
- .form-body .item {
- width: 300px;
- margin-bottom: 50px;
- margin-right: 25px;
- }
- .item-img {
- height: 550px;
- padding: 25px 10px;
- border-radius: 30px;
- border: 1px solid #CCCCCC;
- background-color: #fff;
- }
- .item .el-form-item {
- width: 300px;
- margin: 20px auto;
- }
- .left-setting-menu {
- width: 260px;
- }
- .left-setting-menu .el-form-item {
- height: 60px;
- padding-left: 20px;
- display: flex;
- align-items: center;
- margin-bottom: 0;
- cursor: pointer;
- }
- .left-setting-menu .el-form-item .el-form-item__label {
- cursor: pointer;
- }
- .left-setting-menu .el-form-item.active {
- background-color: #F3F5F6;
- border-top-left-radius: 10px;
- width: 105%;
- border-bottom-left-radius: 10px;
- }
- .left-setting-menu .el-form-item .el-form-item__content {
- margin-left: 0 !important
- }
- .no-radius {
- border-top-left-radius: 0 !important;
- }
- .del-btn {
- position: absolute;
- right: -8px;
- top: -8px;
- padding: 4px 4px;
- }
- .reset {
- position: absolute;
- top: 3px;
- left: 90px;
- }
- .app-tip {
- position: absolute;
- right: 24px;
- top: 16px;
- height: 72px;
- line-height: 72px;
- max-width: calc(100% - 78px);
- }
- .app-tip:before {
- content: ' ';
- width: 0;
- height: 0;
- border-color: inherit;
- position: absolute;
- top: -32px;
- right: 100px;
- border-width: 16px;
- border-style: solid;
- }
- .tip-content {
- display: block;
- white-space: nowrap;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- margin: 0 28px;
- font-size: 28px;
- }
- </style>
|