| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <?php
- use common\helpers\ComponentHelper;
- ?>
- <style>
- .app-share {
- padding-top: 12px;
- border-top: 1px solid #e2e2e2;
- margin-top: -20px;
- }
- .app-share .app-share-bg {
- position: relative;
- width: 310px;
- height: 360px;
- background-repeat: no-repeat;
- background-size: contain;
- background-position: center
- }
- .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;
- }
- .app-share .app-share-bg .pic-image {
- background-repeat: no-repeat;
- background-position: 0 0;
- background-size: cover;
- width: 160px;
- height: 130px;
- }
- .el-card__header {
- padding: 8px 20px;
- }
- .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
- margin: 5px;
- }
- .el-form-item__content, .el-form-item__label{
- margin-top: 10px;
- }
- </style>
- <div id="app" v-cloak>
- <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div class="form_box">
- <template>
- <el-card>
- <div style="display: flex;align-items: center;padding-bottom: 10px;border-bottom: 1px solid #E4E7ED;margin:10px 0 20px 15px;font-size:14px;">
- <div>社区设置</div>
- </div>
- <el-form size="small" ref="ruleForm" label-width="150px">
- <el-row>
- <el-col :span="24">
- <el-form-item label="社区开关">
- <el-switch v-model="ruleForm.community_status">
- </el-switch>
- </el-form-item>
- </el-col>
- </el-row>
- <div style="display: flex;align-items: center;padding-bottom: 10px;border-bottom: 1px solid #E4E7ED;margin:10px 0 20px 15px;font-size:18px;">
- <span class="tips-text" style="padding-left:70px;line-height:24px;color:red;margin-top:5px;font-size: 14px">开关控制前端页面与后台门店设置社区/村的字段选择的显示</span>
- </div>
- <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;" @click="submit" size="small">保存
- </el-button>
- </el-form>
- </el-card>
- </template>
- </div>
- </el-card>
- </div>
- <script src="<?= Yii::$app->request->baseUrl ?>/resources/unpkg/vuedraggable@2.18.1/dist/vuedraggable.umd.min.js"></script>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- btnLoading: false,
- params: {},
- activeName: 'community_setting',
- keyword: '',
- ruleForm:{
- community_status:false
- }
- }
- },
- mounted: function() {
- this.loadData();
- },
- methods: {
- loadData() {
- if(this.loading === true) return;
- this.loading = true;
- request({
- params: {
- r: 'store/store-community/setting',
- },
- method: 'get'
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- if(e.data.data) {//有选中的
- this.ruleForm.community_status=e.data.data.mall_info.community_status == 1;
- }
- }
- console.log(this.ruleForm.community_status)
- }).catch(e => {
- this.loading = false;
- })
- },
- submit() {
- this.btnLoading = true;
- request({
- params: {
- r: 'store/store-community/setting',
- },
- method: 'post',
- data: this.ruleForm,
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code === 0) {
- this.ruleForm.community_status = this.ruleForm.community_status == 1;
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- this.loading = false;
- this.settingPop = false;
- }).catch(e => {
- this.btnLoading = false;
- this.loading = false;
- this.settingPop = false;
- });
- },
- HandleChangeChecked(val, index) {
- this.$forceUpdate();
- },
- }
- });
- </script>
|