cps-web-url.blade.php 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. @extends('layouts.base')
  2. @section('title', 'cps取链')
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  5. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-ohter.css')}}"/>
  6. <link rel="stylesheet" href="{{static_url('css/public-number.css')}}">
  7. <style>
  8. .el-checkbox-group {
  9. position: relative;
  10. z-index: 0;
  11. }
  12. .el-checkbox {
  13. margin-top: 10px !important;
  14. }
  15. </style>
  16. <div id='re_content'>
  17. <div class="con">
  18. <div class="setting">
  19. <el-form ref="form" label-width="15%">
  20. <div class="block">
  21. <div class="title"><span
  22. style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>cps取链</b>
  23. </div>
  24. <el-form-item label="资源信息">
  25. <el-card v-if="card.name" :body-style="{ padding: '0px' }" style="width: 200px;">
  26. <img style="width: 200px;height: 200px" :src="card.image" class="image">
  27. <div style="padding: 3px;text-align: center">
  28. [[card.name]]
  29. </div>
  30. <el-button type="primary" style="width: 100%" @click="showSpecialModal">选择资源
  31. </el-button>
  32. </el-card>
  33. <el-button v-if="!card.name" type="primary" @click="showSpecialModal()">选择资源
  34. </el-button>
  35. </el-form-item>
  36. <el-form-item v-if="url.web_url" label="H5链接">
  37. <el-input @ style="width: 50%" type="text" v-model="url.web_url"
  38. :disabled="true"></el-input>
  39. <el-button type="primary" @click="copyUrl(url.web_url)">复制</el-button>
  40. </el-form-item>
  41. <el-form-item v-if="url.mini_url" label="小程序路径">
  42. <el-input @ style="width: 50%" type="text" v-model="url.mini_url"
  43. :disabled="true"></el-input>
  44. <el-button type="primary" @click="copyUrl(url.mini_url)">复制</el-button>
  45. </el-form-item>
  46. <upload-multimedia-img :upload-show="uploadShow" :type="type" :name="chooseImgName"
  47. :sel-Num="selNum" @replace="changeProp"
  48. @sure="sureImg"></upload-multimedia-img>
  49. </div>
  50. </el-form>
  51. </div>
  52. {{-- <div class="confirm-btn">--}}
  53. {{-- <el-button :loading="submit_loading" type="primary" @click="submit">取链</el-button>--}}
  54. {{-- </div>--}}
  55. </div>
  56. <el-dialog title="" :visible.sync="app_modal_show" width="60%">
  57. <div>
  58. <el-tabs v-model="appModalShowTab">
  59. <el-tab-pane label="品牌券" name="brand"></el-tab-pane>
  60. <el-tab-pane label="品牌券商品" name="brand_goods"></el-tab-pane>
  61. <el-tab-pane label="京东商品资源" name="jd_special"></el-tab-pane>
  62. <el-tab-pane label="拼多多商品资源" name="pdd_special"></el-tab-pane>
  63. <el-tab-pane label="淘宝商品资源" name="taobao_special"></el-tab-pane>
  64. <el-tab-pane label="推广资源" name="plat"></el-tab-pane>
  65. <el-tab-pane label="推广页面" name="plat_activity"></el-tab-pane>
  66. <el-tab-pane label="商品搜索" name="goods_search"></el-tab-pane>
  67. </el-tabs>
  68. </div>
  69. <div v-if="appModalShowTab=='goods_search'">
  70. <el-form ref="form" label-width="15%" style="margin-top: 50px">
  71. <el-form-item label="第三方平台">
  72. <el-radio v-model="form.goods_search_plat" label="1">京东</el-radio>
  73. <el-radio v-model="form.goods_search_plat" label="2">拼多多</el-radio>
  74. <el-radio v-model="form.goods_search_plat" label="3">淘宝</el-radio>
  75. </el-form-item>
  76. {{-- <el-form-item v-if="form.goods_search_plat==2" label="活动商品(可不选)">--}}
  77. {{-- <el-select v-model="form.pdd_search_activity_tags" multiple>--}}
  78. {{-- <el-option--}}
  79. {{-- v-for="(item,index) in list.pdd_search_activity_tags"--}}
  80. {{-- :key="index"--}}
  81. {{-- :label="item.name"--}}
  82. {{-- :value="item.id">--}}
  83. {{-- </el-option>--}}
  84. {{-- </el-select>--}}
  85. {{-- </el-form-item>--}}
  86. <el-form-item label="关键词">
  87. <el-input style="width: 50%" type="text" v-model="form.search_keyword"
  88. placeholder="请输入搜索关键词"></el-input>
  89. </el-form-item>
  90. <el-form-item>
  91. <el-button @click="chooseBrandOrGoods()" type="primary">确认</el-button>
  92. </el-form-item>
  93. </el-form>
  94. </div>
  95. <div v-if="appModalShowTab=='plat'">
  96. <el-table :data="list.plat_list" style="width: 100%;max-height:500px;overflow:auto"
  97. :fit="true">
  98. <el-table-column label="推广资源" prop="name" align="center" min-width="15%"></el-table-column>
  99. <el-table-column label="操作" align="center" min-width="30%">
  100. <template slot-scope="scope">
  101. <el-button @click="chooseBrandOrGoods(scope.row)">
  102. 选择
  103. </el-button>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. </div>
  108. <div v-if="appModalShowTab=='plat_activity'">
  109. <el-table :data="list.plat_activity_list" style="width: 100%;max-height:500px;overflow:auto"
  110. :fit="true">
  111. <el-table-column label="推广页面" prop="another_name" align="center" min-width="15%"></el-table-column>
  112. <el-table-column label="操作" align="center" min-width="30%">
  113. <template slot-scope="scope">
  114. <el-button @click="chooseBrandOrGoods(scope.row)">
  115. 选择
  116. </el-button>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. </div>
  121. <div v-if="appModalShowTab=='taobao_special'">
  122. <el-table :data="list.taobao_special_url_type" style="width: 100%;max-height:500px;overflow:auto"
  123. :fit="true">
  124. <el-table-column label="资源类型" prop="name" align="center" min-width="15%"></el-table-column>
  125. <el-table-column label="操作" align="center" min-width="30%">
  126. <template slot-scope="scope">
  127. <el-button @click="chooseBrandOrGoods(scope.row)">
  128. 选择
  129. </el-button>
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. </div>
  134. <div v-if="appModalShowTab=='jd_special'">
  135. <el-table :data="list.jd_special_url_type" style="width: 100%;max-height:500px;overflow:auto"
  136. :fit="true">
  137. <el-table-column label="资源类型" prop="name" align="center" min-width="15%"></el-table-column>
  138. <el-table-column label="操作" align="center" min-width="30%">
  139. <template slot-scope="scope">
  140. <el-button @click="chooseBrandOrGoods(scope.row)">
  141. 选择
  142. </el-button>
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. </div>
  147. <div v-if="appModalShowTab=='pdd_special'">
  148. <el-table :data="list.pdd_special_url_type" style="width: 100%;max-height:500px;overflow:auto"
  149. :fit="true">
  150. <el-table-column label="资源类型" prop="name" align="center" min-width="15%"></el-table-column>
  151. <el-table-column label="操作" align="center" min-width="30%">
  152. <template slot-scope="scope">
  153. <el-button @click="chooseBrandOrGoods(scope.row)">
  154. 选择
  155. </el-button>
  156. </template>
  157. </el-table-column>
  158. </el-table>
  159. </div>
  160. <div v-if="appModalShowTab=='brand'">
  161. <div style="margin-top: 10px">
  162. <el-input v-model="brand_modal.keyword" style="width:60%;" placeholder="品牌id/品牌名"></el-input>
  163. <el-button @click="searchBrand">搜索</el-button>
  164. </div>
  165. <el-table :data="brand_modal.list" style="width: 100%;max-height:500px;overflow:auto" :fit="true">
  166. <el-table-column label="品牌id" prop="b_id" align="center" min-width="15%"></el-table-column>
  167. <el-table-column label="品牌logo" min-width="30%">
  168. <template slot-scope="scope">
  169. <div style="display:flex;align-items: center;">
  170. <div v-if="scope.row.logo" style="width:40px;">
  171. <el-image :src="scope.row.logo" alt=""
  172. style="width:40px;height:40px;border-radius:50%"></el-image>
  173. </div>
  174. </div>
  175. </template>
  176. </el-table-column>
  177. <el-table-column label="品牌名" prop="name" align="center" min-width="25%"></el-table-column>
  178. ></el-table-column>
  179. <el-table-column label="操作" align="center" min-width="30%">
  180. <template slot-scope="scope">
  181. <el-button @click="chooseBrandOrGoods(scope.row)">
  182. 选择
  183. </el-button>
  184. </template>
  185. </el-table-column>
  186. </el-table>
  187. </div>
  188. <div v-if="appModalShowTab=='brand_goods'">
  189. <div style="margin-top: 10px">
  190. <el-input v-model="brand_goods_modal.keyword" style="width:60%;" placeholder="商品id/商品名"></el-input>
  191. <el-button @click="searchBrandGoods">搜索</el-button>
  192. </div>
  193. <el-table :data="brand_goods_modal.list" style="width: 100%;max-height:500px;overflow:auto" :fit="true">
  194. <el-table-column label="商品id" prop="goods_id" align="center" min-width="10%"></el-table-column>
  195. <el-table-column label="第三方id" prop="b_id" align="center" min-width="10%"></el-table-column>
  196. <el-table-column label="商品logo" min-width="25%">
  197. <template slot-scope="scope">
  198. <div style="display:flex;align-items: center;">
  199. <div v-if="scope.row.logo" style="width:40px;">
  200. <el-image :src="scope.row.logo" alt=""
  201. style="width:40px;height:40px;border-radius:50%"></el-image>
  202. </div>
  203. </div>
  204. </template>
  205. </el-table-column>
  206. <el-table-column label="商品名" prop="name" align="center" min-width="25%"></el-table-column>
  207. ></el-table-column>
  208. <el-table-column label="操作" align="center" min-width="30%">
  209. <template slot-scope="scope">
  210. <el-button @click="chooseBrandOrGoods(scope.row)">
  211. 选择
  212. </el-button>
  213. </template>
  214. </el-table-column>
  215. </el-table>
  216. </div>
  217. <span slot="footer" class="dialog-footer">
  218. <el-button v-if="appModalShowTab=='plat'" :loading="refresh_plat_loading" type="primary"
  219. @click="refreshPlatList">刷新推广资源</el-button>
  220. <el-button @click="app_modal_show = false">取 消</el-button>
  221. </span>
  222. </el-dialog>
  223. {{-- <pop :show="show" @replace="changeLink" @add="parHref"></pop>--}}
  224. {{-- <program :pro="pro" @replacepro="changeprogram" @addpro="parpro"></program>--}}
  225. </div>
  226. <script src="{{resource_get('static/yunshop/tinymce4.7.5/tinymce.min.js')}}"></script>
  227. @include('public.admin.uploadMultimediaImg')
  228. @include('public.admin.tinymceee')
  229. @include('public.admin.pop')
  230. @include('public.admin.program')
  231. <script>
  232. var app = new Vue({
  233. el: "#re_content",
  234. delimiters: ['[[', ']]'],
  235. name: 'test',
  236. data() {
  237. {{--let id = {!!($id) !!} ? {!!($id) !!} : 0;--}}
  238. {{--let parent_id = "{!!($parent_id) !!}" ? "{!!($parent_id) !!}" : 0;--}}
  239. return {
  240. 'show': false,//是否开启公众号弹窗
  241. 'pro': false,//是否开启小程序弹窗
  242. 'brand_modal_show': false,
  243. 'brand_goods_modal_show': false,
  244. 'chooseLink': '',
  245. 'chooseMiniLink': '',
  246. 'app_modal_show': false,
  247. 'appModalShowTab': 'brand',
  248. {{--'app_route_modal': {--}}
  249. {{-- 'show': false,--}}
  250. {{-- 'list':{!! $app_route !!},--}}
  251. {{--},--}}
  252. {{--'app_route_show': false,--}}
  253. {{--'app_route_list': {!! $app_route !!},--}}
  254. 'brand_modal': {
  255. 'list': [],
  256. 'show': false,
  257. 'keyword': '',
  258. },
  259. 'brand_goods_modal': {
  260. 'list': [],
  261. 'show': false,
  262. 'keyword': '',
  263. },
  264. 'list': {
  265. 'another_type': [],
  266. 'url_type': [],
  267. 'jd_special_url_type': [],
  268. 'pdd_special_url_type': [],
  269. // 'pdd_search_activity_tags': [],
  270. 'plat_list': {},
  271. 'plat_activity_list': [],
  272. },
  273. 'form': {
  274. 'url_type': 4,
  275. 'another_type': 1,
  276. 'brand_id': '',
  277. 'brand_goods_id': '',
  278. 'search_keyword': '',
  279. 'goods_search_plat': '1',
  280. 'jd_special_url_type': '',
  281. 'pdd_special_url_type': '',
  282. 'taobao_special_url_type':'',
  283. 'plat_id': '',
  284. 'plat_activity_id': '',
  285. // 'pdd_search_activity_tags': [],
  286. },
  287. 'card': {
  288. 'name': '',
  289. 'image': '',
  290. },
  291. 'url': {
  292. 'web_url': '',
  293. 'mini_url': '',
  294. },
  295. 'logo_url': {},
  296. 'is_max': 0,
  297. 'uploadShow': false,
  298. 'type': '',
  299. 'selNum': '',
  300. 'chooseImgName': '',
  301. 'submit_loading': false,
  302. 'refresh_plat_loading': false,
  303. }
  304. },
  305. created() {
  306. this.getData();
  307. },
  308. mounted() {
  309. },
  310. methods: {
  311. refreshPlatList() {
  312. this.refresh_plat_loading = true;
  313. this.$http.post("{!! yzWebUrl('plugin.aggregation-cps.admin.web.refreshPlatList') !!}", {}).then(response => {
  314. console.log(response);
  315. if (response.data.result) {
  316. this.refresh_plat_loading = false;
  317. this.$message({type: 'success', message: response.data.msg});
  318. this.getData();
  319. } else {
  320. this.refresh_plat_loading = false;
  321. this.$message({type: 'error', message: response.data.msg});
  322. }
  323. }, response => {
  324. this.refresh_plat_loading = false;
  325. this.$message({type: 'error', message: response.data.msg});
  326. });
  327. },
  328. showSpecialModal() {
  329. this.app_modal_show = true;
  330. if (this.form.url_type == 1 || this.form.url_type == 8) {
  331. this.appModalShowTab = 'plat';
  332. } else if (this.form.url_type == 2) {
  333. this.appModalShowTab = 'brand';
  334. } else if (this.form.url_type == 3) {
  335. this.appModalShowTab = 'brand_goods';
  336. } else if (this.form.url_type == 4 || this.form.url_type == 6) {
  337. this.appModalShowTab = 'goods_search';
  338. } else if (this.form.url_type == 5) {
  339. this.appModalShowTab = 'jd_special';
  340. } else if (this.form.url_type == 7) {
  341. this.appModalShowTab = 'pdd_special';
  342. } else if (this.form.url_type == 9) {
  343. this.appModalShowTab = 'plat_activity';
  344. } else if(this.form.url_type == 10){
  345. this.appModalShowTab = 'taobao_special';
  346. }
  347. },
  348. getUrl() {
  349. this.url.web_url = '';
  350. this.url.mini_url = '';
  351. let json = this.form;
  352. json.is_url = 1;
  353. this.$http.post("{!! yzWebUrl('plugin.aggregation-cps.admin.web.index') !!}", json).then(response => {
  354. console.log(response);
  355. if (response.data.result) {
  356. this.$message({type: 'success', message: response.data.msg});
  357. this.url.web_url = response.data.data.web_url;
  358. this.url.mini_url = response.data.data.mini_url;
  359. this.app_modal_show = false;
  360. } else {
  361. this.$message({type: 'error', message: response.data.msg});
  362. }
  363. }, response => {
  364. this.$message({type: 'error', message: response.data.msg});
  365. });
  366. },
  367. copyUrl(url, msg) {
  368. if (msg === undefined) {
  369. msg = '复制成功';
  370. }
  371. let oInput = document.createElement('input');
  372. oInput.value = url;
  373. document.body.appendChild(oInput);
  374. oInput.select(); // 选择对象;
  375. console.log(oInput.value);
  376. document.execCommand("Copy"); // 执行浏览器复制命令
  377. this.$message({message: msg, type: 'success'});
  378. oInput.remove()
  379. },
  380. showBrandModal() {
  381. this.app_modal_show = true;
  382. this.appModalShowTab = 'brand';
  383. },
  384. searchBrand() {
  385. this.$http.post("{!! yzWebUrl('plugin.aggregation-cps.admin.equity.searchBrand') !!}", {keyword: this.brand_modal.keyword}).then(response => {
  386. if (response.data.result) {
  387. this.brand_modal.list = response.data.data
  388. } else {
  389. this.$message({type: 'error', message: response.data.msg});
  390. }
  391. }, response => {
  392. this.$message({type: 'error', message: response.data.msg});
  393. console.log(response);
  394. });
  395. },
  396. chooseBrandOrGoods(data) {
  397. if (this.appModalShowTab == 'brand') {
  398. this.chooseBrand(data);
  399. } else if (this.appModalShowTab == 'brand_goods') {
  400. this.chooseBrandGoods(data);
  401. } else if (this.appModalShowTab == 'jd_special') {
  402. this.chooseJdSpecial(data);
  403. } else if (this.appModalShowTab == 'pdd_special') {
  404. this.choosePddSpecial(data);
  405. } else if (this.appModalShowTab == 'goods_search') {
  406. this.chooseGoodsSearch();
  407. } else if (this.appModalShowTab == 'plat') {
  408. this.choosePlat(data);
  409. } else if (this.appModalShowTab == 'plat_activity') {
  410. this.choosePlatActivity(data);
  411. } else if(this.appModalShowTab == 'taobao_special'){
  412. this.chooseTaobaoSpecial(data);
  413. }
  414. this.getUrl();
  415. },
  416. chooseGoodsSearch() {
  417. if (this.form.goods_search_plat == 1) {
  418. this.form.another_type = 1;
  419. this.form.url_type = 4;
  420. this.card.image = this.logo_url.jd;
  421. this.card.name = '商品搜索-京东-' + this.form.search_keyword;
  422. } else if (this.form.goods_search_plat == 2) {
  423. this.form.another_type = 2;
  424. this.form.url_type = 6;
  425. this.card.image = this.logo_url.pdd;
  426. this.card.name = '商品搜索-拼多多-' + this.form.search_keyword;
  427. }else if(this.form.goods_search_plat == 3){
  428. this.form.another_type = 6;
  429. this.form.url_type = 11;
  430. this.card.image = this.logo_url.taobao;
  431. this.card.name = '商品搜索-淘宝-' + this.form.search_keyword;
  432. }
  433. },
  434. choosePlat(data) {
  435. if (data.id == '-1') {
  436. this.form.another_type = 3;
  437. this.form.url_type = 1;
  438. } else {
  439. this.form.another_type = 4;
  440. this.form.url_type = 8;
  441. this.form.plat_id = data.id;
  442. }
  443. this.card.image = this.logo_url[data.logo];
  444. this.card.name = '推广资源-' + data.name;
  445. },
  446. choosePlatActivity(data) {
  447. this.form.another_type = 5;
  448. this.form.url_type = 9;
  449. this.form.plat_activity_id = data.another_id;
  450. this.card.name = '推广页面-' + data.another_name;
  451. if (this.card.name.indexOf("美团") !== -1) {
  452. this.card.image = this.logo_url['meituan']
  453. } else if (this.card.name.indexOf("饿了") !== -1) {
  454. this.card.image = this.logo_url['eleme']
  455. } else {
  456. this.card.image = this.logo_url['default_introduce']
  457. }
  458. },
  459. chooseTaobaoSpecial(data) {
  460. this.form.another_type = 6;
  461. this.form.url_type = 10;
  462. this.form.taobao_special_url_type = data.type;
  463. // this.special_name.jd = data.name;
  464. this.card.image = this.logo_url.taobao;
  465. this.card.name = '淘宝商品资源-' + data.name;
  466. },
  467. chooseJdSpecial(data) {
  468. this.form.another_type = 1;
  469. this.form.url_type = 5;
  470. this.form.jd_special_url_type = data.type;
  471. // this.special_name.jd = data.name;
  472. this.card.image = this.logo_url.jd;
  473. this.card.name = '京东商品资源-' + data.name;
  474. },
  475. choosePddSpecial(data) {
  476. this.form.another_type = 2;
  477. this.form.url_type = 7;
  478. this.form.pdd_special_url_type = data.type;
  479. // this.special_name.pdd = data.name;
  480. this.card.image = this.logo_url.pdd;
  481. this.card.name = '拼多多商品资源-' + data.name;
  482. },
  483. chooseBrand(data) {
  484. console.log(data);
  485. this.form.another_type = 3;
  486. this.form.url_type = 2;
  487. this.form.brand_id = data.b_id;
  488. this.card.image = data.logo;
  489. this.card.name = '品牌券列表-' + data.name;
  490. // this.app_modal_show = false;
  491. },
  492. chooseBrandGoods(data) {
  493. console.log(data);
  494. this.form.another_type = 3;
  495. this.form.url_type = 3;
  496. this.form.brand_goods_id = data.goods_id;
  497. this.card.image = data.logo;
  498. this.card.name = '品牌券商品-' + data.name;
  499. // this.app_modal_show = false;
  500. },
  501. showBrandGoodsModal() {
  502. this.app_modal_show = true;
  503. this.appModalShowTab = 'brand_goods';
  504. },
  505. searchBrandGoods() {
  506. console.log('brand_goods');
  507. this.$http.post("{!! yzWebUrl('plugin.aggregation-cps.admin.equity-goods.searchBrandGoods') !!}", {keyword: this.brand_goods_modal.keyword}).then(response => {
  508. if (response.data.result) {
  509. this.brand_goods_modal.list = response.data.data
  510. } else {
  511. this.$message({type: 'error', message: response.data.msg});
  512. }
  513. }, response => {
  514. this.$message({type: 'error', message: response.data.msg});
  515. console.log(response);
  516. });
  517. },
  518. showLink(type, name) {
  519. if (type == "link") {
  520. this.chooseLink = name;
  521. this.show = true;
  522. } else {
  523. this.chooseMiniLink = name;
  524. this.pro = true;
  525. }
  526. },
  527. //当前链接的增加
  528. parHref(child, confirm) {
  529. this.show = confirm;
  530. // this.form.link=child;
  531. this.form.target[this.chooseLink] = child;
  532. },
  533. parpro(child, confirm) {
  534. this.pro = confirm;
  535. // this.form.prolink=child;
  536. this.form.target[this.chooseMiniLink] = child;
  537. },
  538. //弹窗显示与隐藏的控制
  539. changeLink(item) {
  540. this.show = item;
  541. },
  542. changeprogram(item) {
  543. this.pro = item;
  544. },
  545. showAppRouteModal() {
  546. this.app_modal_show = true;
  547. this.appModalShowTab = 'app_route';
  548. },
  549. confirmAppRoute(route) {
  550. this.form.target.app_route = route;
  551. this.app_modal_show = false;
  552. this.form.target_type = '-5';
  553. },
  554. clearImg(str, type, index) {
  555. if (!type) {
  556. this.form[str] = "";
  557. this.form[str + '_url'] = "";
  558. } else {
  559. this.form[str].splice(index, 1);
  560. this.form[str + '_url'].splice(index, 1);
  561. }
  562. this.$forceUpdate();
  563. }, changeProp(val) {
  564. if (val == true) {
  565. this.uploadShow = false;
  566. } else {
  567. this.uploadShow = true;
  568. }
  569. },
  570. sureImg(name, uploadShow, fileList) {
  571. if (fileList.length <= 0) {
  572. return
  573. }
  574. console.log(name);
  575. console.log(fileList);
  576. this.form[name] = fileList[0].attachment;
  577. this.form[name + '_url'] = fileList[0].url;
  578. },
  579. openUpload(str, type, sel) {
  580. this.chooseImgName = str;
  581. this.uploadShow = true;
  582. this.type = type;
  583. this.selNum = sel;
  584. },
  585. getData() {
  586. this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.web.index') !!}', {
  587. 'is_json': 1
  588. }).then(response => {
  589. if (response.data.result) {
  590. this.list = response.data.data.list;
  591. this.logo_url = response.data.data.logo_url;
  592. } else {
  593. this.$message({message: response.data.msg, type: 'error'});
  594. }
  595. }, response => {
  596. this.$message({message: response.data.msg, type: 'error'});
  597. })
  598. },
  599. {{--submit() {--}}
  600. {{-- let that = this;--}}
  601. {{-- this.submit_loading = true;--}}
  602. {{-- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.link-category.change') !!}', this.form).then(response => {--}}
  603. {{-- if (response.data.result) {--}}
  604. {{-- console.log(response.data.data);--}}
  605. {{-- // this.form.id = response.data.data;--}}
  606. {{-- this.$message({message: response.data.msg, type: 'success'});--}}
  607. {{-- this.submit_loading = false;--}}
  608. {{-- let parent_id = response.data.data.parent_id;--}}
  609. {{-- let level = response.data.data.level;--}}
  610. {{-- window.location.href = "{!! yzWebUrl('plugin.aggregation-cps.admin.link-category.index') !!}" + '&level=' + level + '&parent_id=' + parent_id;--}}
  611. {{-- --}}{{--if (this.form.id == 0) {--}}
  612. {{-- --}}{{-- let id = response.data.data;--}}
  613. {{-- --}}{{-- this.form.id = id;--}}
  614. {{-- --}}{{-- window.location.href = "{!! yzWebUrl('plugin.aggregation-cps.admin.link-category.edit') !!}" + '&id=' + id;--}}
  615. {{-- --}}{{--} else {--}}
  616. {{-- --}}{{-- this.getData();--}}
  617. {{-- --}}{{--}--}}
  618. {{-- } else {--}}
  619. {{-- this.$message({message: response.data.msg, type: 'error'});--}}
  620. {{-- this.submit_loading = false;--}}
  621. {{-- }--}}
  622. {{-- }, response => {--}}
  623. {{-- this.$message({message: response.data.msg, type: 'error'});--}}
  624. {{-- this.submit_loading = false;--}}
  625. {{-- })--}}
  626. {{--}--}}
  627. },
  628. })
  629. </script>
  630. @endsection