138 lines
4.9 KiB
PHP
138 lines
4.9 KiB
PHP
@extends('layouts.base')
|
|
@section('content')
|
|
<link rel="stylesheet" href="{{static_url('css/public-number.css')}}">
|
|
<link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
|
|
<style>
|
|
.content{
|
|
background: #eff3f6;
|
|
padding: 10px!important;
|
|
padding-top:20px!important;
|
|
}
|
|
.con{
|
|
padding-bottom:20px;
|
|
position:relative;
|
|
border-radius: 8px;
|
|
background-color:#fff;
|
|
min-height:100vh;
|
|
}
|
|
.con .setting .block{
|
|
padding:10px;
|
|
background-color:#fff;
|
|
border-radius: 8px;
|
|
}
|
|
.con .setting .block .title{
|
|
font-size:18px;
|
|
margin-bottom:15px;
|
|
display:flex;
|
|
align-items:center;
|
|
}
|
|
.confirm-btn{
|
|
width: calc(100% - 266px);
|
|
position:fixed;
|
|
bottom:0;
|
|
right:0;
|
|
margin-right:10px;
|
|
line-height:63px;
|
|
background-color: #ffffff;
|
|
box-shadow: 0px 8px 23px 1px
|
|
rgba(51, 51, 51, 0.3);
|
|
background-color:#fff;
|
|
text-align:center;
|
|
}
|
|
b{
|
|
font-size:14px;
|
|
}
|
|
.vue-crumbs a {
|
|
color: #333;
|
|
}
|
|
.vue-crumbs a:hover {
|
|
color: #29ba9c;
|
|
}
|
|
.vue-crumbs {
|
|
margin: 0 20px;
|
|
font-size: 14px;
|
|
color: #333;
|
|
font-weight: 400;
|
|
padding-bottom: 10px;
|
|
}
|
|
</style>
|
|
<div id='re_content'>
|
|
<div class="con" style="margin: 30px 0">
|
|
<div class="setting">
|
|
<el-form ref="form" :model="form" label-width="15%" :rules="rules">
|
|
<div class="block">
|
|
<div class="vue-main-title">
|
|
<div class="vue-main-title-left"></div>
|
|
<div class="vue-main-title-content">添加标签</div>
|
|
</div>
|
|
<el-form-item label="标签名称" prop="name">
|
|
<el-input v-model="form.name" style="width:50%;"></el-input>
|
|
</el-form-item>
|
|
</div>
|
|
<div class="confirm-btn">
|
|
<el-button type="primary" @click="submit('form')">提交</el-button>
|
|
</div>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
var vm = new Vue({
|
|
el: "#re_content",
|
|
delimiters: ['[[', ']]'],
|
|
data() {
|
|
let model = {!! $model ?: '{}' !!};
|
|
return {
|
|
form:{
|
|
name: '',
|
|
...model,
|
|
},
|
|
rules: {
|
|
name: [
|
|
{ required: true, message: '请输入标签名称', trigger: 'blur' },
|
|
],
|
|
}
|
|
}
|
|
},
|
|
mounted () {
|
|
this.id = this.getParam("id");
|
|
},
|
|
methods: {
|
|
submit(form) {
|
|
this.$refs[form].validate((valid) => {
|
|
if (valid) {
|
|
let json = {
|
|
id: this.id,
|
|
form: this.form,
|
|
};
|
|
let url = '{!! yzWebFullUrl('plugin.new-poster.admin.poster.labelAdd') !!}';
|
|
if (this.id) {
|
|
url = '{!! yzWebFullUrl('plugin.new-poster.admin.poster.labelEdit') !!}';
|
|
}
|
|
this.$http.post(url,json).then(function (response){
|
|
if (response.data.result) {
|
|
this.$message({message: response.data.msg,type: 'success'});
|
|
window.location.href = '{!! yzWebFullUrl('plugin.new-poster.admin.poster.labelIndex') !!}';
|
|
}else{
|
|
this.$message({type: 'error',message: response.data.msg});
|
|
}
|
|
},function (response) {
|
|
this.$message({message: response.data.msg,type: 'error'});
|
|
})
|
|
} else {
|
|
console.log('error submit!!');
|
|
return false;
|
|
}
|
|
});
|
|
},
|
|
getParam(name) {
|
|
return location.href.match(new RegExp("[?#&]" + name + "=([^?#&]+)", "i"))
|
|
? RegExp.$1
|
|
: "";
|
|
},
|
|
},
|
|
});
|
|
</script>
|
|
@endsection('content')
|
|
|