| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808 |
- @extends('layouts.base')
- @section('title', '分类编辑')
- @section('content')
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-ohter.css')}}"/>
- <link rel="stylesheet" href="{{static_url('css/public-number.css')}}">
- <style>
- .el-checkbox-group {
- position: relative;
- z-index: 0;
- }
- .el-checkbox {
- margin-top: 10px !important;
- }
- </style>
- <div id='re_content'>
- <div class="con">
- <div class="setting">
- <el-form ref="form" label-width="15%">
- <div class="block">
- <div class="title"><span
- style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>分类详情</b>
- </div>
- <el-form-item label="分类名称">
- <el-input placeholder="请输入分类名称" style="width:50%;" v-model="form.title"></el-input>
- </el-form-item>
- <el-form-item label="排序">
- <el-input placeholder="数字越大,排序越靠前" style="width:50%;" v-model="form.sort"></el-input>
- </el-form-item>
- <el-form-item label="是否启用">
- <el-switch
- :active-value="1"
- :inactive-value="0"
- v-model="form.is_show"
- active-color="#13ce66"
- inactive-color="#C0C0C0"
- >
- </el-switch>
- </el-form-item>
- <template v-if="is_max">
- <el-form-item label="是否需要登录">
- <el-switch
- @change="changeAppUrl"
- :active-value="1"
- :inactive-value="0"
- v-model="form.need_login"
- active-color="#13ce66"
- inactive-color="#C0C0C0"
- >
- </el-switch>
- </el-form-item>
- <el-form-item label="分类类型">
- <el-select style="width: 150px" filterable v-model="form.target_type" placeholder="请选择"
- @change="changeAppUrl">
- <el-option label="淘宝" value="-1"></el-option>
- <el-option label="京东" value="-2"></el-option>
- <el-option label="拼多多" value="-3"></el-option>
- <el-option label="网页" value="-4"></el-option>
- <el-option label="自定义" value="-5"></el-option>
- <el-option label="小程序" value="-6"></el-option>
- <el-option label="品牌券" value="-7"></el-option>
- <el-option label="品牌券商品" value="-8"></el-option>
- <el-option label="京东/淘宝官方活动" value="-9"></el-option>
- <el-option label="特色商品列表" value="-10"></el-option>
- <el-option label="专辑" value="-11"></el-option>
- <el-option label="APP页面" value="-12"></el-option>
- </el-select>
- </el-form-item>
- <div v-if="form.target_type==-9">
- <el-form-item label="活动平台">
- <el-radio v-model="form.target.another_plat" label="1" @change="changeAppUrl">淘宝
- </el-radio>
- <el-radio v-model="form.target.another_plat" label="3" @change="changeAppUrl">京东
- </el-radio>
- </el-form-item>
- <el-form-item label="淘宝会场id/京东推广链接">
- <el-input placeholder="请输入id或链接" style="width:50%;"
- v-model="form.target.activity_info" @change="changeAppUrl"></el-input>
- </el-form-item>
- </div>
- <div v-if="form.target_type==-10">
- <el-form-item label="商品列表">
- <el-select style="width: 150px" v-model="form.target.list_type" placeholder="请选择"
- @change="changeAppUrl">
- <el-option label="淘宝特色物料" value="1"></el-option>
- <el-option label="京东特色列表" value="2"></el-option>
- <el-option label="拼多多特色列表" value="3"></el-option>
- {{-- <el-option label="拼多多爆款排行" value="4"></el-option>--}}
- </el-select>
- </el-form-item>
- <el-form-item label="列表类型"
- v-if="form.target.list_type!=4&&form.target.list_type!==''&&form.target_type==-10">
- <el-select v-if="form.target.list_type==1" filterable style="width: 250px"
- v-model="tb_list_id" placeholder="请选择" @change="changeAppUrl">
- <el-option v-for="item in special_goods_list.taobao_special_url_type"
- :key="item.type" :label="item.name" :value="item.type"></el-option>
- </el-select>
- <el-select v-if="form.target.list_type==2" filterable style="width: 200px"
- v-model="jd_list_id" placeholder="请选择" @change="changeAppUrl">
- <el-option v-for="item in special_goods_list.jd_special_url_type"
- :key="item.type" :label="item.name" :value="item.type"></el-option>
- </el-select>
- <el-select v-if="form.target.list_type==3" filterable style="width: 150px"
- v-model="pdd_list_id" placeholder="请选择" @change="changeAppUrl">
- <el-option v-for="item in special_goods_list.pdd_special_url_type"
- :key="item.type" :label="item.name" :value="item.type"></el-option>
- </el-select>
- </el-form-item>
- </div>
- <div v-if="form.target_type==-11">
- {{-- <el-form-item label="专辑页面类型">--}}
- {{-- <el-radio v-model="form.target.album_type" label="1">专辑列表</el-radio>--}}
- {{-- <el-radio v-model="form.target.album_type" label="2">专辑详情</el-radio>--}}
- {{-- </el-form-item>--}}
- <el-form-item label="专辑ID">
- <el-input placeholder="请输入专辑id" style="width:50%;"
- v-model="form.target.album_id" @change="changeAppUrl"></el-input>
- </el-form-item>
- </div>
- <el-form-item v-if="form.target_type==-1 || form.target_type==-2 || form.target_type==-3"
- label="关键词">
- <el-input placeholder="请输入关键词" style="width:50%;"
- v-model="form.target.keyword" @change="changeAppUrl"></el-input>
- </el-form-item>
- <el-form-item v-if="form.target_type==-4" label="网页标题">
- <el-input placeholder="请输入网页标题" style="width:50%;"
- v-model="form.target.web_title" @change="changeAppUrl"></el-input>
- </el-form-item>
- <el-form-item v-if="form.target_type==-4" label="网页链接">
- <el-input placeholder="请输入网页链接" style="width:50%;"
- v-model="form.target.web_url" @change="changeAppUrl"></el-input>
- <el-button type="primary" @click="showLink('link','web_url')">选择链接</el-button>
- </el-form-item>
- <el-form-item v-if="form.target_type==-5" label="自定义">
- <el-input placeholder="请输入app路径" style="width:50%;"
- v-model="form.target.app_route" @change="changeAppUrl"></el-input>
- <el-button type="primary" @click="showAppRouteModal()">选择APP路径</el-button>
- </el-form-item>
- <el-form-item v-if="form.target_type==-6" label="小程序原生id">
- <el-input placeholder="请输入小程序原生id" style="width:50%;"
- v-model="form.target.mini_id" @change="changeAppUrl"></el-input>
- </el-form-item>
- <el-form-item v-if="form.target_type==-6" label="小程序路径">
- <el-input placeholder="请输入小程序路径" style="width:50%;"
- v-model="form.target.mini_route" @change="changeAppUrl"></el-input>
- <el-button type="primary" @click="showLink('mini','mini_route')">选择小程序链接</el-button>
- </el-form-item>
- <el-form-item v-if="form.target_type==-7" label="品牌券id">
- <el-input placeholder="请输入品牌券id" style="width:50%;"
- v-model="form.target.brand_id" @change="changeAppUrl"></el-input>
- <el-button type="primary" @click="showBrandModal()">选择品牌券</el-button>
- </el-form-item>
- <el-form-item v-if="form.target_type==-8" label="品牌券商品第三方id">
- <el-input placeholder="请输入品牌券商品第三方id" style="width:50%;"
- v-model="form.target.brand_goods_id" @change="changeAppUrl"></el-input>
- <el-button type="primary" @click="showBrandGoodsModal()">选择品牌券商品</el-button>
- </el-form-item>
- </template>
- <el-form-item label="分类图标">
- <div class="upload-box" @click="openUpload('cover',1,'one')" v-if="!form.cover_url">
- <i class="el-icon-plus" style="font-size:32px"></i>
- </div>
- <div @click="openUpload('cover',1,'one')" class="upload-boxed" v-if="form.cover_url"
- style="height:150px;">
- <img :src="form.cover_url" alt=""
- style="width:150px;height:150px;border-radius: 5px;cursor: pointer;">
- <div class="upload-boxed-text">点击重新上传</div>
- <i class="el-icon-close" @click.stop="clearImg('cover')" title="点击清除图片"></i>
- </div>
- <div v-if="form.parent_id==0" class="tip">一级分类可不上传图标</div>
- </el-form-item>
- <template v-if="form.target_type==-12">
- <el-form-item label="APP页面路由">
- <el-input placeholder="" style="width:50%;" :disabled="true"
- v-model="form.target.app_path">
- </el-input>
- <el-button type="primary" @click="showAppPathModal">选择</el-button>
- </el-form-item>
- <el-form-item label="APP页面参数" v-if="app_path_param!=undefined&&app_path_param.length!=0">
- <template v-for="(v,k) in app_path_param">
- <el-input @change="appPathParamChange" placeholder="" style="width:50%;"
- v-model="v.value">
- <template slot="prepend">[[v.name]]</template>
- </el-input>
- <br>
- </template>
- </el-form-item>
- </template>
- <el-form-item label="装修DIY-APP页面链接" v-if="app_url_show">
- <el-input placeholder="装修DIY-APP页面链接" style="width:50%;"
- v-model="app_url"></el-input>
- <el-button type="primary" @click="copyUrl(app_url,'复制成功')">复制</el-button>
- </el-form-item>
- <upload-multimedia-img :upload-show="uploadShow" :type="type" :name="chooseImgName"
- :sel-Num="selNum" @replace="changeProp"
- @sure="sureImg"></upload-multimedia-img>
- </div>
- </el-form>
- </div>
- <div class="confirm-btn">
- <el-button :loading="submit_loading" type="primary" @click="submit">提交</el-button>
- </div>
- </div>
- <el-dialog title="" :visible.sync="app_modal_show" width="60%">
- <div>
- <el-tabs v-model="appModalShowTab">
- <el-tab-pane label="自定义路径" name="app_route"></el-tab-pane>
- <el-tab-pane label="品牌券" name="brand"></el-tab-pane>
- <el-tab-pane label="品牌券商品" name="brand_goods"></el-tab-pane>
- <el-tab-pane label="大促活动转链" name="activity_url"></el-tab-pane>
- <el-tab-pane label="APP页面" name="app_path"></el-tab-pane>
- </el-tabs>
- </div>
- <div v-if="appModalShowTab=='activity_url'">
- <el-form label-width="15%" style="margin-top: 50px">
- <el-form-item label="第三方平台">
- <el-radio v-model="form.goods_search_plat" label="1">京东</el-radio>
- <el-radio v-model="form.goods_search_plat" label="2">拼多多</el-radio>
- </el-form-item>
- </el-form>
- </div>
- <div v-if="appModalShowTab=='app_route'">
- <el-table :data="app_route_list" style="width: 100%;max-height:500px;overflow:auto;" :fit="true">
- <el-table-column label="" align="center">
- <template slot-scope="scope">
- <el-row :gutter="10">
- <el-col :span="5">
- <el-button v-if="scope.row[0]" @click="confirmAppRoute(scope.row[0].route)">
- [[scope.row[0].title]]
- </el-button>
- </el-col>
- <el-col :span="5">
- <el-button v-if="scope.row[1]" @click="confirmAppRoute(scope.row[1].route)">
- [[scope.row[1].title]]
- </el-button>
- </el-col>
- <el-col :span="5">
- <el-button v-if="scope.row[2]" @click="confirmAppRoute(scope.row[2].route)">
- [[scope.row[2].title]]
- </el-button>
- </el-col>
- <el-col :span="5">
- <el-button v-if="scope.row[3]" @click="confirmAppRoute(scope.row[3].route)">
- [[scope.row[3].title]]
- </el-button>
- </el-col>
- </el-row>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div v-if="appModalShowTab=='brand'">
- <div style="margin-top: 10px">
- <el-input v-model="brand_modal.keyword" style="width:60%;" placeholder="品牌id/品牌名"></el-input>
- <el-button @click="searchBrand">搜索</el-button>
- </div>
- <el-table :data="brand_modal.list" style="width: 100%;max-height:500px;overflow:auto" :fit="true">
- <el-table-column label="品牌id" prop="b_id" align="center" min-width="15%"></el-table-column>
- <el-table-column label="品牌logo" min-width="30%">
- <template slot-scope="scope">
- <div style="display:flex;align-items: center;">
- <div v-if="scope.row.logo" style="width:40px;">
- <el-image :src="scope.row.logo" alt=""
- style="width:40px;height:40px;border-radius:50%"></el-image>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="品牌名" prop="name" align="center" min-width="25%"></el-table-column>
- ></el-table-column>
- <el-table-column label="操作" align="center" min-width="30%">
- <template slot-scope="scope">
- <el-button @click="chooseBrandOrGoods(scope.row)">
- 选择
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div v-if="appModalShowTab=='app_path'">
- <el-table :data="app_path" style="width: 100%;max-height:500px;overflow:auto" :fit="true">
- <el-table-column label="页面" prop="name" align="center" min-width="10%"></el-table-column>
- <el-table-column label="路径" prop="route" align="center" min-width="10%"></el-table-column>
- <el-table-column label="操作" align="center" min-width="30%">
- <template slot-scope="scope">
- <el-button @click="chooseBrandOrGoods(scope.row)">
- 选择
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div v-if="appModalShowTab=='brand_goods'">
- <div style="margin-top: 10px">
- <el-input v-model="brand_goods_modal.keyword" style="width:60%;" placeholder="商品id/商品名"></el-input>
- <el-button @click="searchBrandGoods">搜索</el-button>
- </div>
- <el-table :data="brand_goods_modal.list" style="width: 100%;max-height:500px;overflow:auto" :fit="true">
- <el-table-column label="商品id" prop="goods_id" align="center" min-width="10%"></el-table-column>
- <el-table-column label="第三方id" prop="b_id" align="center" min-width="10%"></el-table-column>
- <el-table-column label="商品logo" min-width="25%">
- <template slot-scope="scope">
- <div style="display:flex;align-items: center;">
- <div v-if="scope.row.logo" style="width:40px;">
- <el-image :src="scope.row.logo" alt=""
- style="width:40px;height:40px;border-radius:50%"></el-image>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="商品名" prop="name" align="center" min-width="25%"></el-table-column>
- ></el-table-column>
- <el-table-column label="操作" align="center" min-width="30%">
- <template slot-scope="scope">
- <el-button @click="chooseBrandOrGoods(scope.row)">
- 选择
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="app_modal_show = false">取 消</el-button>
- </span>
- </el-dialog>
- <pop :show="show" @replace="changeLink" @add="parHref"></pop>
- <program :pro="pro" @replacepro="changeprogram" @addpro="parpro"></program>
- </div>
- <script src="{{resource_get('static/yunshop/tinymce4.7.5/tinymce.min.js')}}"></script>
- @include('public.admin.uploadMultimediaImg')
- @include('public.admin.tinymceee')
- @include('public.admin.pop')
- @include('public.admin.program')
- <script>
- var app = new Vue({
- el: "#re_content",
- delimiters: ['[[', ']]'],
- name: 'test',
- data() {
- let id = {!!($id) !!} ? {!!($id) !!} : 0;
- let parent_id = "{!!($parent_id) !!}" ? "{!!($parent_id) !!}" : 0;
- return {
- 'show': false,//是否开启公众号弹窗
- 'pro': false,//是否开启小程序弹窗
- 'brand_modal_show': false,
- 'brand_goods_modal_show': false,
- 'chooseLink': '',
- 'chooseMiniLink': '',
- 'app_modal_show': false,
- 'appModalShowTab': 'app_route',
- 'app_route_modal': {
- 'show': false,
- 'list':{!! $app_route !!},
- },
- 'app_route_show': false,
- 'app_route_list': {!! $app_route !!},
- 'app_path':{!! $app_path !!},
- 'brand_modal': {
- 'list': [],
- 'show': false,
- 'keyword': '',
- },
- 'brand_goods_modal': {
- 'list': [],
- 'show': false,
- 'keyword': '',
- },
- 'form': {
- 'id': id,
- 'parent_id': parent_id,
- 'cover': '',
- 'cover_url': '',
- 'title': '',
- 'sort': '0',
- 'is_show': '0',
- 'target': {},
- 'target_type': '-1',
- 'need_login': '0',
- },
- 'pdd_list_id': '',
- 'tb_list_id': '',
- 'jd_list_id': '',
- 'special_goods_list': {
- 'jd_special_url_type':{!! $jd_special_url_type !!},
- 'taobao_special_url_type':{!! $taobao_special_url_type !!},
- 'pdd_special_url_type':{!! $pdd_special_url_type !!},
- },
- // 'web_cps': {
- // 'show': false,
- // 'url': '',
- // },
- 'is_max': 0,
- 'uploadShow': false,
- 'type': '',
- 'selNum': '',
- 'chooseImgName': '',
- 'submit_loading': false,
- 'app_url': '',
- 'app_url_show': false,
- 'app_path_param': [],
- }
- },
- created() {
- this.getData();
- },
- mounted() {
- },
- methods: {
- chooseAppPath(data) {
- this.form.target_type = '-12';
- this.form.target.app_path = data.route;
- this.app_path_param = data.param;
- this.appPathParamChange();
- },
- appPathParamChange() {
- var json = {};
- console.log(this.app_path_param);
- if(this.app_path_param === undefined){
- return false;
- }
- if (this.app_path_param.length > 0) {
- this.app_path_param.forEach(function (v) {
- if (v.type === 'int') {
- json[v.key] = parseInt(v.value);
- } else if (v.type === 'string') {
- json[v.key] = v.value.toString();
- } else if (v.type === 'float') {
- json[v.key] = parseFloat(v.value);
- } else {
- json[v.key] = v.value;
- }
- })
- }
- this.form.target.pathParam = JSON.stringify(json);
- console.log(json);
- console.log(this.form.target.pathParam);
- this.changeAppUrl();
- },
- changeAppUrl() {
- console.log(123);
- this.app_url_show = false;
- if (!this.is_max) {
- return false;
- }
- let url = '';
- url += 'target_type=' + this.form.target_type;
- url += '&need_login=' + this.form.need_login;
- url += '&is_show=1';
- url += '&title=' + this.form.title + '&';
- let target = {};
- if (this.form.target_type === '-1' || this.form.target_type === '-2' || this.form.target_type === '-3') {
- target.keyword = this.form.target.keyword;
- } else if (this.form.target_type === '-4') {
- target.web_title = this.form.target.web_title;
- target.web_url = this.form.target.web_url;
- } else if (this.form.target_type === '-5') {
- target.app_route = this.form.target.app_route;
- } else if (this.form.target_type === '-6') {
- target.mini_id = this.form.target.mini_id;
- target.mini_route = this.form.target.mini_route;
- } else if (this.form.target_type === '-7') {
- target.brand_id = this.form.target.brand_id;
- } else if (this.form.target_type === '-8') {
- target.brand_goods_id = this.form.target.brand_goods_id;
- } else if (this.form.target_type === '-9') {
- target.another_plat = this.form.target.another_plat;
- target.activity_info = this.form.target.activity_info;
- } else if (this.form.target_type === '-10') {
- target.list_type = this.form.target.list_type;
- if (this.form.target.list_type === '1') {
- target.list_id = this.tb_list_id;
- } else if (this.form.target.list_type === '2') {
- target.list_id = this.jd_list_id;
- } else if (this.form.target.list_type === '3') {
- target.list_id = this.pdd_list_id;
- } else {
- target.list_id = '';
- }
- } else if (this.form.target_type === '-11') {
- target.album_type = '2';
- target.album_id = this.form.target.album_id;
- } else if (this.form.target_type === '-12') {
- target.app_path = this.form.target.app_path;
- target.pathParam = this.form.target.pathParam;
- }
- for (var k in target) {
- if (this.isEmpty(target[k]) && k !== 'web_title') {
- console.log(k);
- return false;
- }
- }
- url += $.param(target);
- this.app_url = url;
- this.app_url_show = true;
- console.log(this.app_url);
- },
- isEmpty(word) {
- if (word === undefined || word === '' || word === 0 || word === '0') {
- return true;
- }
- return false;
- },
- copyUrl(url, msg) {
- let oInput = document.createElement('input');
- oInput.value = url;
- document.body.appendChild(oInput);
- oInput.select(); // 选择对象;
- console.log(oInput.value);
- document.execCommand("Copy"); // 执行浏览器复制命令
- this.$message({message: msg, type: 'success'});
- oInput.remove()
- },
- showBrandModal() {
- this.app_modal_show = true;
- this.appModalShowTab = 'brand';
- },
- showAppPathModal() {
- this.app_modal_show = true;
- this.appModalShowTab = 'app_path';
- },
- searchBrand() {
- this.$http.post("{!! yzWebUrl('plugin.aggregation-cps.admin.equity.searchBrand') !!}", {keyword: this.brand_modal.keyword}).then(response => {
- if (response.data.result) {
- this.brand_modal.list = response.data.data
- } else {
- this.$message({type: 'error', message: response.data.msg});
- }
- }, response => {
- this.$message({type: 'error', message: response.data.msg});
- console.log(response);
- });
- },
- chooseBrandOrGoods(data) {
- if (this.appModalShowTab == 'brand') {
- this.chooseBrand(data);
- } else if (this.appModalShowTab == 'brand_goods') {
- this.chooseBrandGoods(data);
- } else if (this.appModalShowTab == 'app_path') {
- this.chooseAppPath(data);
- }
- },
- chooseBrand(data) {
- console.log('brand');
- this.form.target_type = '-7';
- this.form.target.brand_id = data.b_id;
- this.app_modal_show = false;
- this.changeAppUrl();
- },
- showBrandGoodsModal() {
- this.app_modal_show = true;
- this.appModalShowTab = 'brand_goods';
- },
- searchBrandGoods() {
- this.$http.post("{!! yzWebUrl('plugin.aggregation-cps.admin.equity-goods.searchBrandGoods') !!}", {keyword: this.brand_goods_modal.keyword}).then(response => {
- if (response.data.result) {
- this.brand_goods_modal.list = response.data.data
- } else {
- this.$message({type: 'error', message: response.data.msg});
- }
- }, response => {
- this.$message({type: 'error', message: response.data.msg});
- console.log(response);
- });
- },
- chooseBrandGoods(data) {
- this.form.target_type = '-8';
- this.form.target.brand_goods_id = data.b_id;
- this.app_modal_show = false;
- this.changeAppUrl();
- },
- showLink(type, name) {
- if (type == "link") {
- this.chooseLink = name;
- this.show = true;
- } else {
- this.chooseMiniLink = name;
- this.pro = true;
- }
- },
- //当前链接的增加
- parHref(child, confirm) {
- this.show = confirm;
- // this.form.link=child;
- this.form.target[this.chooseLink] = child;
- this.changeAppUrl();
- },
- parpro(child, confirm) {
- this.pro = confirm;
- // this.form.prolink=child;
- this.form.target[this.chooseMiniLink] = child;
- this.changeAppUrl();
- },
- //弹窗显示与隐藏的控制
- changeLink(item) {
- this.show = item;
- },
- changeprogram(item) {
- this.pro = item;
- },
- showAppRouteModal() {
- this.app_modal_show = true;
- this.appModalShowTab = 'app_route';
- },
- confirmAppRoute(route) {
- this.form.target.app_route = route;
- this.app_modal_show = false;
- this.form.target_type = '-5';
- this.changeAppUrl();
- },
- clearImg(str, type, index) {
- if (!type) {
- this.form[str] = "";
- this.form[str + '_url'] = "";
- } else {
- this.form[str].splice(index, 1);
- this.form[str + '_url'].splice(index, 1);
- }
- this.$forceUpdate();
- }, changeProp(val) {
- if (val == true) {
- this.uploadShow = false;
- } else {
- this.uploadShow = true;
- }
- },
- sureImg(name, uploadShow, fileList) {
- if (fileList.length <= 0) {
- return
- }
- console.log(name);
- console.log(fileList);
- this.form[name] = fileList[0].attachment;
- this.form[name + '_url'] = fileList[0].url;
- },
- openUpload(str, type, sel) {
- this.chooseImgName = str;
- this.uploadShow = true;
- this.type = type;
- this.selNum = sel;
- },
- getData() {
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.link-category.edit') !!}', {
- 'parent_id': this.form.parent_id,
- 'id': this.form.id,
- 'is_json': 1
- }).then(response => {
- if (response.data.result) {
- var category_data = response.data.data.category_data;
- this.form.id = category_data.id ? category_data.id : 0;
- this.form.cover = category_data.cover ? category_data.cover : '';
- this.form.cover_url = category_data.cover_url ? category_data.cover_url : '';
- this.form.title = category_data.title ? category_data.title : '';
- this.form.sort = category_data.sort ? category_data.sort : 0;
- this.form.is_show = category_data.is_show ? category_data.is_show : 0;
- this.form.target = category_data.target ? category_data.target : {};
- this.form.target_type = category_data.target_type ? String(category_data.target_type) : '-1';
- this.form.need_login = category_data.need_login ? category_data.need_login : '0';
- this.form.parent_id = response.data.data.parent_id ? response.data.data.parent_id : 0;
- this.app_path_param = response.data.data.app_path_param;
- this.appPathParamChange();
- if (this.form.target_type == -10) {
- if (this.form.target.list_type === '1') {
- this.tb_list_id = this.form.target.list_id;
- } else if (this.form.target.list_type === '2') {
- this.jd_list_id = this.form.target.list_id;
- } else if (this.form.target.list_type === '3') {
- this.pdd_list_id = this.form.target.list_id;
- }
- }
- this.is_max = response.data.data.is_max;
- this.changeAppUrl();
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- }
- }, response => {
- this.$message({message: response.data.msg, type: 'error'});
- })
- },
- submit() {
- let that = this;
- if (this.form.target_type === '-10') {
- if (this.form.target.list_type === '1') {
- this.form.target.list_id = this.tb_list_id;
- } else if (this.form.target.list_type === '2') {
- this.form.target.list_id = this.jd_list_id;
- } else if (this.form.target.list_type === '3') {
- this.form.target.list_id = this.pdd_list_id;
- } else {
- this.form.target.list_id = '';
- }
- if (this.form.target.list_type === '1' || this.form.target.list_type === '2' || this.form.target.list_type === '3') {
- if (this.form.target.list_id === undefined || this.form.target.list_id === '' || this.form.target.list_id === 0 || this.form.target.list_id === '0') {
- this.$message({message: '请选择列表类型', type: 'error'});
- return false;
- }
- }
- }
- if (this.form.target_type == '-11') {
- this.form.target.album_type = '2';
- }
- this.submit_loading = true;
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.link-category.change') !!}', this.form).then(response => {
- if (response.data.result) {
- console.log(response.data.data);
- // this.form.id = response.data.data;
- this.$message({message: response.data.msg, type: 'success'});
- this.submit_loading = false;
- let parent_id = response.data.data.parent_id;
- let level = response.data.data.level;
- window.location.href = "{!! yzWebUrl('plugin.aggregation-cps.admin.link-category.index') !!}" + '&level=' + level + '&parent_id=' + parent_id;
- {{--if (this.form.id == 0) {--}}
- {{-- let id = response.data.data;--}}
- {{-- this.form.id = id;--}}
- {{-- window.location.href = "{!! yzWebUrl('plugin.aggregation-cps.admin.link-category.edit') !!}" + '&id=' + id;--}}
- {{--} else {--}}
- {{-- this.getData();--}}
- {{--}--}}
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- this.submit_loading = false;
- }
- }, response => {
- this.$message({message: response.data.msg, type: 'error'});
- this.submit_loading = false;
- })
- }
- },
- })
- </script>
- @endsection
|