| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600 |
- <style>
- .form-body {
- padding: 20px 50% 20px 20px;
- background-color: #fff;
- margin-bottom: 20px;
- min-width: 1000px
- }
- .form-button {
- margin: 0;
- }
- .form-button .el-form-item__content {
- margin-left: 0 !important;
- }
- .button-item {
- padding: 9px 25px;
- }
- .red {
- color: #ff4544
- }
- .id-card {
- position: relative;
- /*height: 170px;*/
- width: 190px;
- float: left;
- text-align: center;
- /*margin-bottom: 20px;*/
- font-size: 12px;
- color: #666;
- margin-right: 30px;
- }
- .id-card img {
- max-height: 134px;
- max-width: 190px;
- background-color: #EEEFF3;
- }
- .card-upload .el-button {
- position: absolute;
- left: 50%;
- top: 50%;
- margin-top: -16px;
- margin-left: -16px;
- z-index: 1;
- }
- .com-attachment .card-upload {
- width: 100%;
- height: 100%;
- }
- .background-box {
- width: 100%;
- background-size: cover;
- background-repeat: no-repeat;
- background-position: center;
- padding-top: 100px;
- }
- .background-box .title {
- width: 280px;
- height: 138px;
- margin: auto;
- background-size: contain;
- background-repeat: no-repeat;
- margin-bottom: 50px;
- }
- .all-components {
- background: #fff;
- padding: 20px;
- }
- .all-components .component-group {
- border: 1px solid #eeeeee;
- width: 300px;
- margin-bottom: 20px;
- }
- .all-components .component-group:last-child {
- margin-bottom: 0;
- }
- .all-components .component-group-name {
- height: 35px;
- line-height: 35px;
- background: #f7f7f7;
- padding: 0 20px;
- border-bottom: 1px solid #eeeeee;
- }
- .all-components .component-list {
- margin-right: -2px;
- margin-top: -2px;
- flex-wrap: wrap;
- }
- .all-components .component-list .component-item {
- width: 100px;
- height: 100px;
- border: 0 solid #eeeeee;
- border-width: 0 1px 1px 0;
- text-align: center;
- padding: 15px 0 0;
- cursor: pointer;
- }
- .all-components .component-list .component-icon {
- width: 40px;
- height: 40px;
- /*border: 1px solid #eee;*/
- }
- .all-components .component-list .component-name {}
- #diy-list {
- width: 95%;
- padding: 20px;
- float: left;
- margin: 20px;
- border: 1px solid #eeeeee;
- }
- .all-components {
- background: #fff;
- padding: 20px;
- }
- .all-components .component-group {
- border: 1px solid #eeeeee;
- width: 300px;
- margin-bottom: 20px;
- }
- .all-components .component-group:last-child {
- margin-bottom: 0;
- }
- .all-components .component-group-name {
- height: 35px;
- line-height: 35px;
- background: #f7f7f7;
- padding: 0 20px;
- border-bottom: 1px solid #eeeeee;
- }
- .all-components .component-list {
- margin-right: -2px;
- margin-top: -2px;
- flex-wrap: wrap;
- }
- .all-components .component-list .component-item {
- width: 100px;
- height: 100px;
- border: 0 solid #eeeeee;
- border-width: 0 1px 1px 0;
- text-align: center;
- padding: 15px 0 0;
- cursor: pointer;
- }
- .all-components .component-list .component-icon {
- width: 40px;
- height: 40px;
- /*border: 1px solid #eee;*/
- }
- .all-components .component-list .component-name {}
- .mobile-framework {
- width: 375px;
- height: 100%;
- }
- .mobile-framework-header {
- height: 60px;
- line-height: 60px;
- background: #333;
- color: #fff;
- text-align: center;
- background: url("<?= Yii::getAlias('@attachurl') ?>"+"/static/addons/DepositPresale/head.png") no-repeat;
- }
- .mobile-framework-body {
- min-height: 645px;
- border: 1px solid #e2e2e2;
- background: #f5f7f9;
- }
- .mobile-framework .diy-component-preview {
- cursor: pointer;
- position: relative;
- zoom: 0.5;
- -moz-transform: scale(0.5);
- -moz-transform-origin: top left;
- font-size: 28px;
- }
- @-moz-document url-prefix() {
- .mobile-framework .diy-component-preview {
- cursor: pointer;
- position: relative;
- -moz-transform: scale(0.5);
- -moz-transform-origin: top left;
- font-size: 28px;
- width: 200% !important;
- height: 100%;
- margin-bottom: auto;
- }
- .mobile-framework .active .diy-component-preview {
- border: 2px dashed #409EFF;
- left: -2px;
- right: -2px;
- width: calc(200% + 4px) !important;
- }
- }
- .mobile-framework .diy-component-preview:hover {
- box-shadow: inset 0 0 10000px rgba(0, 0, 0, .03);
- }
- .mobile-framework .diy-component-edit {
- width: 100%;
- position: absolute;
- top: 0;
- bottom: 0;
- left: 465px;
- right: 0;
- background: #fff;
- padding: 20px;
- display: none;
- overflow: auto;
- }
- .diy-component-options {
- position: relative;
- }
- .diy-component-options .el-button {
- height: 25px;
- line-height: 25px;
- width: 25px;
- padding: 0;
- text-align: center;
- border: none;
- border-radius: 0;
- position: absolute;
- margin-left: 0;
- }
- .mobile-framework .active .diy-component-preview {
- border: 2px dashed #409EFF;
- left: -2px;
- right: -2px;
- width: calc(100% + 4px);
- }
- .mobile-framework .active .diy-component-edit {
- display: block;
- padding-right: 20%;
- min-width: 650px;
- }
- .all-components {
- max-height: 725px;
- overflow-y: auto;
- }
- .bottom-menu {
- text-align: center;
- height: 54px;
- width: 100%;
- }
- .bottom-menu .el-card__body {
- padding-top: 10px;
- }
- .el-dialog {
- min-width: 800px;
- }
- /* 公共样式 */
- .flex {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- }
- .flex-x-center {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
- justify-content: center;
- }
- .flex-x-between {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-pack: space-between;
- -webkit-justify-content: space-between;
- -ms-flex-pack: space-between;
- justify-content: space-between;
- }
- .flex-y-center {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-align: center;
- -webkit-align-items: center;
- -ms-flex-align: center;
- -ms-grid-row-align: center;
- align-items: center;
- }
- /* 溢出隐藏 */
- .over1 {
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- .over2 {
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .sava_btn .el-button {
- width: 150px;
- height: 40px;
- border-radius: 5px;
- }
- .page_msg_box {
- padding: 22px 23px;
- border-radius: 5px 5px 0 0;
- }
- </style>
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-rich-text');
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <span>基础设置</span>
- </div>
- <el-tabs type="border-card">
- <el-tab-pane label="基础设置">
- <div class="form-body">
- <el-form :model="ruleForm" label-width="auto" ref="ruleForm" size="small" v-loading="loading">
- <?= ComponentHelper::loadComponentView('notice', __DIR__ . '/'); ?>
- </el-form>
- </div>
- <el-button type="primary" class="button-item" size="small" :loading=btnLoading @click="onSubmit">提交</el-button>
- </el-tab-pane>
- </el-tabs>
- </el-card>
- </div>
- <style>
- .el-textarea__inner {
- padding: 0 15px;
- }
- </style>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- time: null,
- btnLoading: false,
- tabNotice: 'left',
- ruleForm: {
- general_settings: {
- is_refund_deposit: {
- title: "只付定金未付尾款是否退定金",
- value: '0',
- remark: ''
- }
- },
- notice_wechat: {
- is_logging: {
- title: "开启消息模板推送",
- value: '0',
- remark: ''
- },
- // template_no: {
- // title: "模板编号",
- // value: '',
- // remark: ''
- // },
- // template_id: {
- // title: "模板ID",
- // value: '',
- // remark: ''
- // },
- is_miniapp_priority: {
- title: "是否跳转链接小程序优先",
- value: '0',
- remark: ''
- },
- is_open: {
- title: "是否记录数据库日志",
- value: '0',
- remark: ''
- },
- template_message: {
- value: {
- order_deposit: {
- name: '订单支付定金',
- tempid: '',
- tem_key: '',
- },
- order_final_payment:{
- name: '订单支付尾款',
- tempid: '',
- tem_key: '',
- }
- }
- },
- },
- notice_sms: {
- status: {
- title: "状态",
- value: '0',
- remark: ''
- },
- platform: {
- title: "平台",
- value: 'aliyun',
- remark: ''
- },
- access_key_id: {
- title: "access_key_id",
- value: '',
- remark: ''
- },
- access_key_secret: {
- title: "access_key_secret",
- value: '',
- remark: ''
- },
- template_name: {
- title: "模板签名",
- value: '',
- remark: ''
- },
- register_template_id: {
- title: "模板ID",
- value: '',
- remark: ''
- },
- register_template_variable: {
- title: "模板签名",
- value: '',
- remark: ''
- },
- order_template_id: {
- title: "模板ID",
- value: '',
- remark: ''
- },
- order_template_variable: {
- title: "模板签名",
- value: '',
- remark: ''
- },
- sale_template_id: {
- title: "模板ID",
- value: '',
- remark: ''
- },
- sale_template_variable: {
- title: "模板签名",
- value: '',
- remark: ''
- },
- captcha_template_id: {
- title: "模板ID",
- value: '',
- remark: ''
- },
- captcha_template_variable: {
- title: "模板签名",
- value: '',
- remark: ''
- },
- },
- },
- FormRules: {
- },
- };
- },
- methods: {
- onSubmit() {
- this.$refs.ruleForm.validate((valid) => {
- if (valid) {
- this.btnLoading = true;
- console.log(this.ruleForm);
- request({
- params: {
- r: 'deposit-presale/setting/index',
- },
- data: {
- setting: this.ruleForm
- },
- method: 'post'
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code === 0) {
- this.$message({
- message: e.data.msg,
- type: 'success'
- });
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.btnLoading = false;
- this.$message.error(e.data.msg);
- });
- }
- });
- },
- getList() {
- this.loading = true;
- request({
- params: {
- r: 'deposit-presale/setting/index',
- },
- }).then(e => {
- this.loading = false;
- if (e.data.data) { //有选中的
- let data = e.data.data
- Object.keys(this.ruleForm).forEach((key) => {
- Object.keys(this.ruleForm[key]).forEach((k) => {
- if (!isEmpty(data[key][k])) {
- var dataValue = data[key][k].value;
- if (data[key][k].value != null && data[key][k].value != "") {
- if (typeof dataValue == 'string' && (dataValue.indexOf("{") !== -1 || dataValue.indexOf("[") !== -1)) {
- // 将json字符串转为对象
- this.ruleForm[key][k].value = JSON.parse(data[key][k].value);
- } else {
- this.ruleForm[key][k].value = data[key][k].value;
- }
- }
- }
- });
- });
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.loading = false;
- });
- },
- },
- mounted: function() {
- this.getList();
- }
- })
- </script>
|