| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508 |
- <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('resources/img/mall/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>pk设置</span>
- </div>
- <el-tabs type="border-card">
- <el-tab-pane label="基础设置">
- <div class="form-body">
- <el-form :model="form" label-width="120px" ref="form" size="small" v-loading="loading" :rules="FormRules">
- <el-form-item label="PK排行榜开关:" >
- <el-switch v-model="form.is_enable" :active-value="1" :inactive-value="0" active-text="开" inactive-text="关">
- </el-switch>
- </el-form-item>
- <el-form-item label="PK聚合页:" >
- <el-input placeholder="请输入内容" v-model="form.web_url" style="width: 450px; cursor: pointer" id="urlId">
- <el-button slot="append" type="primary" @click.stop="copyFun">复制</el-button>
- </el-input>
- </el-form-item>
- <!-- <el-form-item label="禁止时间" >-->
- <!-- <el-input type="number" placeholder="请输入时间" style="width: 300px;margin-right: 20px;" v-model="form.not_allow_apply_hour">-->
- <!-- <template slot="append">小时</template>-->
- <!-- </el-input>-->
- <!-- <div style="color: #999">距离活动结束前几个小时禁止报名</div>-->
- <!-- <el-checkbox v-model="form.is_no_restrictions">不限制</el-checkbox>-->
- <!-- </el-form-item>-->
- <el-form-item label="规则说明" >
- <com-rich-text style="width: 750px" :simple-attachment="true" v-model="form.person"></com-rich-text>
- </el-form-item>
- <el-form-item label="背景图" prop="id_card_reverse">
- <div class="id-card">
- <com-attachment v-model="form.bg_img" :simple="false">
- <div class="card-upload">
- <img v-if="form.bg_img"
- :src="form.bg_img">
- <img v-else :src="diy_img_prefix+'/static/addons/pk/pk_head.jpg'">
- <el-button icon="el-icon-plus" circle type="primary" title="建议上传750*100"></el-button>
- </div>
- </com-attachment>
- </div>
- </el-form-item>
- </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,
- form: {
- bg_img: "",
- is_enable: 1,
- page: '',
- type: '',
- not_allow_apply_hour: '',
- is_no_restrictions: '',
- person: '',
- },
- diy_img_prefix: '<?= Yii::getAlias('@attachurl') ?>',
- form1: {},
- FormRules: {}
- }
- },
- methods: {
- copyFun(){
- let url = document.querySelector('#urlId');
- url.select(); // 选择对象
- document.execCommand("Copy");
- this.$message.success('复制成功');
- },
- onSubmit() {
- this.$refs.form.validate((valid) => {
- if (valid) {
- this.btnLoading = true;
- let para = Object.assign(this.form);
- console.log(para);
- request({
- params: {
- r: 'pk/setting/index',
- },
- data: para,
- 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: 'pk/setting/index',
- },
- }).then(e => {
- this.loading = false;
- if (e.data.code === 0) {
- let data = e.data.data
- if(e.data.data.length>0|| e.data.data.length == undefined) this.form = e.data.data;
- if(this.form.start_at && this.form.end_at) this.$set(this.form, 'open_time', [data.start_at, data.end_at]);
- this.form.bg_img = this.form.bg_img?this.form.bg_img : this.diy_img_prefix + '/static/addons/pk/pk_head.jpg';
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.loading = false;
- });
- },
- },
- mounted: function () {
- this.getList();
- }
- })
- </script>
|