From 8db8ea688fea89b990c528fccc473b3383102a26 Mon Sep 17 00:00:00 2001 From: dengbw Date: Tue, 10 May 2022 15:56:18 +0800 Subject: [PATCH] material_510 --- admin/views/app/licheb/syt/live_edit.php | 176 +++++++++++++++++++++-- api/controllers/wxapp/material/Home.php | 3 +- 2 files changed, 167 insertions(+), 12 deletions(-) diff --git a/admin/views/app/licheb/syt/live_edit.php b/admin/views/app/licheb/syt/live_edit.php index f1a5729e..4f18879e 100644 --- a/admin/views/app/licheb/syt/live_edit.php +++ b/admin/views/app/licheb/syt/live_edit.php @@ -83,7 +83,7 @@
- +
@@ -109,19 +109,102 @@
+
+ +
+ +
+
-
-
{{v.title}}
-
- +
+ + + + + + + + + + + + + + + + + + + + +
图片标题排序链接 + 添加 +
+ +
+
@@ -159,7 +242,9 @@ el: '#vue-edit', data: { info: {}, - status_list: [] + status_list: [], + ad_list: [], + ad_item: {}, }, mounted() { var that = this; @@ -172,6 +257,75 @@ updated: function () { }, methods: { + // 修改排序 + showGroupEditForm: function (index) { + $("#group_name_" + index).show(); + $("#group_name_txt_" + index).hide(); + $('#group_name_' + index).focus(); + }, + // 排序 + editGroupName: function (index, group_id) { + var order_view = $("#group_name_" + index).val(); + if (order_view == '') { + layer.msg("排序值不能为空!", {icon: 2}); + return false; + } + this.ad_list.sort(function (a, b) { + return b.order_view - a.order_view; + }); + $("#group_name_" + index).hide(); + $("#group_name_txt_" + index).show(); + }, + adModal: function (item) { + var that = this; + var _title = '新增广告'; + that.ad_item = {}; + var _img = ''; + var _img_url = ''; + if (item) { + that.ad_item = item; + _title = '编辑广告'; + _img = item.img; + _img_url = item.img_url; + } else { + that.ad_item = {"order_view": 50, "jump_type": 0}; + } + $('#ad_img').val(_img); + $("#ad_img_url").attr('src', _img_url); + layer.open({ + type: 1, + area: ['50%', '38%'], //宽高 + content: $('#ad-modal'), + title: _title, + shade: false, + btn: ['确定', '取消'], + yes: function (index) { + _img = $('#ad_img').val(); + _img_url = $("#ad_img_url")[0].src; + if (!item) { + that.ad_list.push({ + title: that.ad_item.title, + img: _img, + img_url: _img_url, + link: that.ad_item.link, + order_view: that.ad_item.order_view, + jump_type: that.ad_item.jump_type + }); + } else { + item.img = _img; + item.img_url = _img_url; + } + that.ad_list.sort(function (a, b) { + return b.order_view - a.order_view; + }) + layer.close(index); + } + }); + }, + removeAd: function (index) { + var vm = this; + vm.ad_list.splice(index, 1); + }, editType: function (index) { var vm = this; if (index == 1) { diff --git a/api/controllers/wxapp/material/Home.php b/api/controllers/wxapp/material/Home.php index 88a88351..91e13916 100644 --- a/api/controllers/wxapp/material/Home.php +++ b/api/controllers/wxapp/material/Home.php @@ -38,7 +38,8 @@ class Home extends Wxapp */ protected function get_tabs() { - $distribute = intval($this->input_param('distribute')); + //$distribute = intval($this->input_param('distribute')); + $distribute = 1;//显示所有品牌 $list = array(); $res = []; if ($distribute == 1) {//分销