+
+
背景设置
+
+
+
+
+
+
数字文字设置
+
+
+
+
+
单位文字设置
+
+
+
+
+
+
描述文字设置
+
+
+
+
+
+
+
+
+
+
+ var listmenuNavResourcePath = "{$resource_path}"; // http路径
+ var listmenuNavRelativePath = "{$relative_path}"; // 相对路径
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/component/view/digit/js/design.js b/src/app/component/view/digit/js/design.js
index 4ffcb19a0..bbd9beda2 100644
--- a/src/app/component/view/digit/js/design.js
+++ b/src/app/component/view/digit/js/design.js
@@ -1,498 +1,510 @@
-/**
- * [图片导航的图片]·组件
- */
- var digitNavListHtml = '
';
- Vue.component("digit-nav-list", {
- template: digitNavListHtml,
- data: function () {
- return {
- data: this.$parent.data,
- list: this.$parent.data.list,
- rowCountList: [
- {
- name: "样式1",
- value: 2,
- src: "iconyihangliangge"
- },
- {
- name: "样式2",
- value: 3,
- src: "iconyihangsange"
- },
- ],
- };
- },
- created: function () {
- if (!this.$parent.data.verify) this.$parent.data.verify = [];
- this.$parent.data.verify.push(this.verify);//加载验证方法
-
- this.$parent.data.ignore = ['textColor', 'elementBgColor', 'elementAngle'];//加载忽略内容 -- 其他设置中的属性设置
- this.$parent.data.ignoreLoad = true; // 等待忽略数组赋值后加载
-
- // 组件所需的临时数据
- this.$parent.data.tempData = {
- ...this.$parent.data.tempData,
- modeList: this.modeList,
- showStyleList: this.showStyleList,
- ornamentList: this.ornamentList,
- carouselList: this.carouselList,
- rowCountList: this.rowCountList,
- pageCountList: this.pageCountList,
- thicknessList:this.thicknessList,
- carouselIndex: 0,
- methods: {
- addNav: this.addNav,
- setnum: this.setnum,
- }
- };
-
- this.list.forEach(function (e, i) {
- if(!e.id ) e.id = ns.gen_non_duplicate(6);
- });
- this.$parent.data.list = this.list;
-
- var moveBeforeIndex = 0;
- var _this = this;
- setTimeout(function () {
- var componentIndex = _this.data.index;
- $('[data-index="' + componentIndex + '"] .navigation-set-list').DDSort({
- target: 'li',
- floatStyle: {
- 'border': '1px solid #ccc',
- 'background-color': '#fff'
- },
- //设置可拖拽区域
- draggableArea: "icontuodong",
- down: function (index) {
- moveBeforeIndex = index;
- },
- up: function () {
- var index = $(this).index();
- var temp = _this.list[moveBeforeIndex];
- _this.list.splice(moveBeforeIndex, 1);
- _this.list.splice(index, 0, temp);
- _this.$parent.data.list = _this.list;
- }
- });
- })
- },
- watch: {
- "data.pageCount"() {
- if (this.data.showStyle == 'pageSlide')
- this.data.tempData.carouselIndex = 0
- },
- "data.rowCount"() {
- if (this.data.showStyle == 'pageSlide')
- this.data.tempData.carouselIndex = 0
- }
- },
- methods: {
-
- setnum(num){
- console.log(num)
- this.data.rowCount = num
- if(num == 3){
- this.data.list = [
- {
- "title": "200",
- "unit": "万",
- "desc": "这里填写描述",
- "style": {
- "fontSize": "60",
- "iconBgColor": [],
- "iconBgColorDeg": 0,
- "iconBgImg": "",
- "bgRadius": 0,
- "iconColor": [
- "#000000"
- ],
- "iconColorDeg": 0
- },
- "link": {
- "name": ""
- },
- "icon": "",
- "iconType": "img",
- "imageUrl": "",
- "label": {
- "control": false,
- "text": "热门",
- "textColor": "#FFFFFF",
- "bgColorStart": "#F83287",
- "bgColorEnd": "#FE3423"
- }
- },
- {
- "title": "300",
- "unit": "万",
- "desc": "这里填写描述",
- "style": {
- "fontSize": "60",
- "iconBgColor": [],
- "iconBgColorDeg": 0,
- "iconBgImg": "",
- "bgRadius": 0,
- "iconColor": [
- "#000000"
- ],
- "iconColorDeg": 0
- },
- "link": {
- "name": ""
- },
- "icon": "",
- "iconType": "img",
- "imageUrl": "",
- "label": {
- "control": false,
- "text": "热门",
- "textColor": "#FFFFFF",
- "bgColorStart": "#F83287",
- "bgColorEnd": "#FE3423"
- }
- },
- {
- "title": "400",
- "unit": "万",
- "desc": "这里填写描述",
- "style": {
- "fontSize": "60",
- "iconBgColor": [],
- "iconBgColorDeg": 0,
- "iconBgImg": "",
- "bgRadius": 0,
- "iconColor": [
- "#000000"
- ],
- "iconColorDeg": 0
- },
- "link": {
- "name": ""
- },
- "icon": "",
- "iconType": "img",
- "imageUrl": "",
- "label": {
- "control": false,
- "text": "热门",
- "textColor": "#FFFFFF",
- "bgColorStart": "#F83287",
- "bgColorEnd": "#FE3423"
- }
- }
- ]
- }else{
- this.data.list = [
- {
- "title": "200",
- "unit": "万",
- "desc": "这里填写描述",
- "style": {
- "fontSize": "60",
- "iconBgColor": [],
- "iconBgColorDeg": 0,
- "iconBgImg": "",
- "bgRadius": 0,
- "iconColor": [
- "#000000"
- ],
- "iconColorDeg": 0
- },
- "link": {
- "name": ""
- },
- "icon": "",
- "iconType": "img",
- "imageUrl": "",
- "label": {
- "control": false,
- "text": "热门",
- "textColor": "#FFFFFF",
- "bgColorStart": "#F83287",
- "bgColorEnd": "#FE3423"
- }
- },
- {
- "title": "300",
- "unit": "万",
- "desc": "这里填写描述",
- "style": {
- "fontSize": "60",
- "iconBgColor": [],
- "iconBgColorDeg": 0,
- "iconBgImg": "",
- "bgRadius": 0,
- "iconColor": [
- "#000000"
- ],
- "iconColorDeg": 0
- },
- "link": {
- "name": ""
- },
- "icon": "",
- "iconType": "img",
- "imageUrl": "",
- "label": {
- "control": false,
- "text": "热门",
- "textColor": "#FFFFFF",
- "bgColorStart": "#F83287",
- "bgColorEnd": "#FE3423"
- }
- },
- {
- "title": "400",
- "unit": "万",
- "desc": "这里填写描述",
- "style": {
- "fontSize": "60",
- "iconBgColor": [],
- "iconBgColorDeg": 0,
- "iconBgImg": "",
- "bgRadius": 0,
- "iconColor": [
- "#000000"
- ],
- "iconColorDeg": 0
- },
- "link": {
- "name": ""
- },
- "icon": "",
- "iconType": "img",
- "imageUrl": "",
- "label": {
- "control": false,
- "text": "热门",
- "textColor": "#FFFFFF",
- "bgColorStart": "#F83287",
- "bgColorEnd": "#FE3423"
- }
- },
- {
- "title": "500",
- "unit": "万",
- "desc": "这里填写描述",
- "style": {
- "fontSize": "60",
- "iconBgColor": [],
- "iconBgColorDeg": 0,
- "iconBgImg": "",
- "bgRadius": 0,
- "iconColor": [
- "#000000"
- ],
- "iconColorDeg": 0
- },
- "link": {
- "name": ""
- },
- "icon": "",
- "iconType": "img",
- "imageUrl": "",
- "label": {
- "control": false,
- "text": "热门",
- "textColor": "#FFFFFF",
- "bgColorStart": "#F83287",
- "bgColorEnd": "#FE3423"
- }
- }
- ]
- }
- },
-
- addNav() {
- this.list.push({
- "title": "",
- "icon": "",
- "imageUrl": "",
- "iconType": "img",
- "style": {
- "fontSize": "60",
- "iconBgColor": [],
- "iconBgColorDeg": 0,
- "iconBgImg": "",
- "bgRadius": 0,
- "iconColor": [
- "#000000"
- ],
- "iconColorDeg": 0
- },
- "link": {
- "name": ""
- },
- "label": {
- "control": false,
- "text": "热门",
- "textColor": "#FFFFFF",
- "bgColorStart": "#F83287",
- "bgColorEnd": "#FE3423"
- },
- id: ns.gen_non_duplicate(6)
- });
- },
- verify: function (index) {
- var res = {code: true, message: ""};
- /* $(".draggable-element[data-index='" + index + "'] .digit-navigation .digit-nav-list .navigation-set-list>li").each(function (i) {
- if (vue.data[index].mode === "img") {
- $(this).find("input[name='title']").removeAttr("style");//清空输入框的样式
- //检测是否有未上传的图片
- if (vue.data[index].list[i].imageUrl === "") {
- res.code = false;
- res.message = "请选择一张图片";
- $(this).find(".error-msg").text("请选择一张图片").show();
- return res;
- } else {
- $(this).find(".error-msg").text("").hide();
- }
- } else {
- if (vue.data[index].list[i].title === "") {
- res.code = false;
- res.message = "请输入标题";
- $(this).find("input[name='title']").attr("style", "border-color:red !important;").focus();
- $(this).find(".error-msg").text("请输入标题").show();
- return res;
- } else {
- $(this).find("input[name='title']").removeAttr("style");
- $(this).find(".error-msg").text("").hide();
- }
- }
- });*/
-
- return res;
- }
- }
- });
-
- var uploadImgHtml = '
';
- uploadImgHtml += '
';
- uploadImgHtml += '
';
- uploadImgHtml += '
';
- uploadImgHtml += '
';
- //uploadImgHtml += '
';
- uploadImgHtml += '
';
- uploadImgHtml += '
';
-
- Vue.component("image-upload", {
- template: uploadImgHtml,
- props: {
- data: {
- type: Object,
- default: function () {
- return {
- data: {},
- field: "",
- callback: null
- };
- }
- }
- },
- data: function () {
- return {
- myData: this.data,
- list: [],
- parent: this.$parent.data,
- id: ns.gen_non_duplicate(10),
- colorPicker:{}
- };
- },
- created: function () {
- if (this.myData.field === undefined) this.myData.field = "imageUrl";
- this.id = ns.gen_non_duplicate(10);
- },
- methods: {
- // 选择图标风格
- iconStyle(event) {
- var self = this;
- selectIconStyle({
- elem: event.currentTarget,
- icon: self.myData.data.icon,
- callback: function (data) {
- if (data) {
- self.myData.data.style = data;
- } else {
- iconStyleSet({
- style: JSON.stringify(self.myData.data.style),
- query: {
- icon: self.myData.data.icon
- }
- }, function (style) {
- self.myData.data.style = style;
- })
- }
- }
- })
- },
- /**
- * 渲染颜色组件
- * @param id
- * @param color
- * @param callback
- */
- colorRender(id, color, callback) {
- var self = this;
- if (this.colorPicker[id]) return;
- setTimeout(function () {
- self.colorPicker[id] = Colorpicker.create({
- el: id,
- color: color,
- change: function (elem, hex) {
- callback(elem, hex)
- }
- });
- $('#' + id).click();
- }, 10)
- },
- selectColor(id) {
- let self = this;
- this.colorRender(id, '', function (elem, color) {
- if (self.myData.data.style['iconBgImg'] || self.myData.data.style['iconBgColor'].length) {
- self.myData.data.style['iconBgColor'] = [color];
- } else {
- self.myData.data.style['iconColor'] = [color];
- }
- self.$forceUpdate();
- })
- },
- /**
- * 标签设置
- * @param data
- * @param callback
- */
- labelStyle(data, callback) {
- layer.open({
- title: "标签设置",
- type: 2,
- area: ['800px', '420px'],
- fixed: false, //不固定
- btn: ['保存', '取消'],
- content: ns.url("shop/diy/selectlabel?request_mode=iframe", data ? data : {}),
- yes: function (index, layero) {
- var iframeWin = window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.selectLabelListener(function (obj) {
- if (typeof callback == "string") {
- try {
- eval(callback + '(obj)');
- layer.close(index);
- } catch (e) {
- console.error('回调函数' + callback + '未定义');
- }
- } else if (typeof callback == "function") {
- callback(obj);
- layer.close(index);
- }
- });
- }
- });
- },
- selectLabel() {
- let self = this;
- this.labelStyle(self.myData.data.label, function (data) {
- self.myData.data.label = data;
- self.$forceUpdate();
- })
- }
- }
+/**
+ * [图片导航的图片]·组件
+ */
+// var digitNavListHtml = '
';
+ var igitNavHtml = '
';
+
+ igitNavHtml += '
';
+
+ igitNavHtml += '
';
+
+ igitNavHtml += '
';
+
+ igitNavHtml += '
';
+ Vue.component("digit-images", {
+ template: igitNavHtml,
+ data: function () {
+ return {
+ data: this.$parent.data,
+ list: this.$parent.data.list,
+ rowCountList: [
+ {
+ name: "样式1",
+ value: 2,
+ src: "iconyihangliangge"
+ },
+ {
+ name: "样式2",
+ value: 3,
+ src: "iconyihangsange"
+ },
+ ],
+ };
+ },
+ created: function () {
+ if (!this.$parent.data.verify) this.$parent.data.verify = [];
+ this.$parent.data.verify.push(this.verify);//加载验证方法
+
+ this.$parent.data.ignore = ['textColor', 'elementBgColor', 'elementAngle'];//加载忽略内容 -- 其他设置中的属性设置
+ this.$parent.data.ignoreLoad = true; // 等待忽略数组赋值后加载
+
+ // 组件所需的临时数据
+ this.$parent.data.tempData = {
+ ...this.$parent.data.tempData,
+ modeList: this.modeList,
+ showStyleList: this.showStyleList,
+ ornamentList: this.ornamentList,
+ carouselList: this.carouselList,
+ rowCountList: this.rowCountList,
+ pageCountList: this.pageCountList,
+ thicknessList:this.thicknessList,
+ carouselIndex: 0,
+ methods: {
+ addNav: this.addNav,
+ setnum: this.setnum,
+ }
+ };
+
+ this.list.forEach(function (e, i) {
+ if(!e.id ) e.id = ns.gen_non_duplicate(6);
+ });
+ this.$parent.data.list = this.list;
+
+ var moveBeforeIndex = 0;
+ var _this = this;
+ setTimeout(function () {
+ var componentIndex = _this.data.index;
+ $('[data-index="' + componentIndex + '"] .navigation-set-list').DDSort({
+ target: 'li',
+ floatStyle: {
+ 'border': '1px solid #ccc',
+ 'background-color': '#fff'
+ },
+ //设置可拖拽区域
+ draggableArea: "icontuodong",
+ down: function (index) {
+ moveBeforeIndex = index;
+ },
+ up: function () {
+ var index = $(this).index();
+ var temp = _this.list[moveBeforeIndex];
+ _this.list.splice(moveBeforeIndex, 1);
+ _this.list.splice(index, 0, temp);
+ _this.$parent.data.list = _this.list;
+ }
+ });
+ })
+ },
+ watch: {
+ "data.pageCount"() {
+ if (this.data.showStyle == 'pageSlide')
+ this.data.tempData.carouselIndex = 0
+ },
+ "data.rowCount"() {
+ if (this.data.showStyle == 'pageSlide')
+ this.data.tempData.carouselIndex = 0
+ }
+ },
+ methods: {
+
+ setnum(num){
+ console.log(this.data)
+ this.data.rowCount = num
+ if(num == 3){
+ this.data.list = [
+ {
+ "title": "200",
+ "unit": "万",
+ "desc": "这里填写描述",
+ "style": {
+ "fontSize": "60",
+ "iconBgColor": [],
+ "iconBgColorDeg": 0,
+ "iconBgImg": "",
+ "bgRadius": 0,
+ "iconColor": [
+ "#000000"
+ ],
+ "iconColorDeg": 0
+ },
+ "link": {
+ "name": ""
+ },
+ "icon": "",
+ "iconType": "img",
+ "imageUrl": "",
+ "label": {
+ "control": false,
+ "text": "热门",
+ "textColor": "#FFFFFF",
+ "bgColorStart": "#F83287",
+ "bgColorEnd": "#FE3423"
+ }
+ },
+ {
+ "title": "300",
+ "unit": "万",
+ "desc": "这里填写描述",
+ "style": {
+ "fontSize": "60",
+ "iconBgColor": [],
+ "iconBgColorDeg": 0,
+ "iconBgImg": "",
+ "bgRadius": 0,
+ "iconColor": [
+ "#000000"
+ ],
+ "iconColorDeg": 0
+ },
+ "link": {
+ "name": ""
+ },
+ "icon": "",
+ "iconType": "img",
+ "imageUrl": "",
+ "label": {
+ "control": false,
+ "text": "热门",
+ "textColor": "#FFFFFF",
+ "bgColorStart": "#F83287",
+ "bgColorEnd": "#FE3423"
+ }
+ },
+ {
+ "title": "400",
+ "unit": "万",
+ "desc": "这里填写描述",
+ "style": {
+ "fontSize": "60",
+ "iconBgColor": [],
+ "iconBgColorDeg": 0,
+ "iconBgImg": "",
+ "bgRadius": 0,
+ "iconColor": [
+ "#000000"
+ ],
+ "iconColorDeg": 0
+ },
+ "link": {
+ "name": ""
+ },
+ "icon": "",
+ "iconType": "img",
+ "imageUrl": "",
+ "label": {
+ "control": false,
+ "text": "热门",
+ "textColor": "#FFFFFF",
+ "bgColorStart": "#F83287",
+ "bgColorEnd": "#FE3423"
+ }
+ }
+ ]
+ }else{
+ this.data.list = [
+ {
+ "title": "200",
+ "unit": "万",
+ "desc": "这里填写描述",
+ "style": {
+ "fontSize": "60",
+ "iconBgColor": [],
+ "iconBgColorDeg": 0,
+ "iconBgImg": "",
+ "bgRadius": 0,
+ "iconColor": [
+ "#000000"
+ ],
+ "iconColorDeg": 0
+ },
+ "link": {
+ "name": ""
+ },
+ "icon": "",
+ "iconType": "img",
+ "imageUrl": "",
+ "label": {
+ "control": false,
+ "text": "热门",
+ "textColor": "#FFFFFF",
+ "bgColorStart": "#F83287",
+ "bgColorEnd": "#FE3423"
+ }
+ },
+ {
+ "title": "300",
+ "unit": "万",
+ "desc": "这里填写描述",
+ "style": {
+ "fontSize": "60",
+ "iconBgColor": [],
+ "iconBgColorDeg": 0,
+ "iconBgImg": "",
+ "bgRadius": 0,
+ "iconColor": [
+ "#000000"
+ ],
+ "iconColorDeg": 0
+ },
+ "link": {
+ "name": ""
+ },
+ "icon": "",
+ "iconType": "img",
+ "imageUrl": "",
+ "label": {
+ "control": false,
+ "text": "热门",
+ "textColor": "#FFFFFF",
+ "bgColorStart": "#F83287",
+ "bgColorEnd": "#FE3423"
+ }
+ },
+ {
+ "title": "400",
+ "unit": "万",
+ "desc": "这里填写描述",
+ "style": {
+ "fontSize": "60",
+ "iconBgColor": [],
+ "iconBgColorDeg": 0,
+ "iconBgImg": "",
+ "bgRadius": 0,
+ "iconColor": [
+ "#000000"
+ ],
+ "iconColorDeg": 0
+ },
+ "link": {
+ "name": ""
+ },
+ "icon": "",
+ "iconType": "img",
+ "imageUrl": "",
+ "label": {
+ "control": false,
+ "text": "热门",
+ "textColor": "#FFFFFF",
+ "bgColorStart": "#F83287",
+ "bgColorEnd": "#FE3423"
+ }
+ },
+ {
+ "title": "500",
+ "unit": "万",
+ "desc": "这里填写描述",
+ "style": {
+ "fontSize": "60",
+ "iconBgColor": [],
+ "iconBgColorDeg": 0,
+ "iconBgImg": "",
+ "bgRadius": 0,
+ "iconColor": [
+ "#000000"
+ ],
+ "iconColorDeg": 0
+ },
+ "link": {
+ "name": ""
+ },
+ "icon": "",
+ "iconType": "img",
+ "imageUrl": "",
+ "label": {
+ "control": false,
+ "text": "热门",
+ "textColor": "#FFFFFF",
+ "bgColorStart": "#F83287",
+ "bgColorEnd": "#FE3423"
+ }
+ }
+ ]
+ }
+ },
+
+ addNav() {
+ this.list.push({
+ "title": "",
+ "icon": "",
+ "imageUrl": "",
+ "iconType": "img",
+ "style": {
+ "fontSize": "60",
+ "iconBgColor": [],
+ "iconBgColorDeg": 0,
+ "iconBgImg": "",
+ "bgRadius": 0,
+ "iconColor": [
+ "#000000"
+ ],
+ "iconColorDeg": 0
+ },
+ "link": {
+ "name": ""
+ },
+ "label": {
+ "control": false,
+ "text": "热门",
+ "textColor": "#FFFFFF",
+ "bgColorStart": "#F83287",
+ "bgColorEnd": "#FE3423"
+ },
+ id: ns.gen_non_duplicate(6)
+ });
+ },
+ verify: function (index) {
+ var res = {code: true, message: ""};
+ /* $(".draggable-element[data-index='" + index + "'] .digit-navigation .digit-nav-list .navigation-set-list>li").each(function (i) {
+ if (vue.data[index].mode === "img") {
+ $(this).find("input[name='title']").removeAttr("style");//清空输入框的样式
+ //检测是否有未上传的图片
+ if (vue.data[index].list[i].imageUrl === "") {
+ res.code = false;
+ res.message = "请选择一张图片";
+ $(this).find(".error-msg").text("请选择一张图片").show();
+ return res;
+ } else {
+ $(this).find(".error-msg").text("").hide();
+ }
+ } else {
+ if (vue.data[index].list[i].title === "") {
+ res.code = false;
+ res.message = "请输入标题";
+ $(this).find("input[name='title']").attr("style", "border-color:red !important;").focus();
+ $(this).find(".error-msg").text("请输入标题").show();
+ return res;
+ } else {
+ $(this).find("input[name='title']").removeAttr("style");
+ $(this).find(".error-msg").text("").hide();
+ }
+ }
+ });*/
+
+ return res;
+ }
+ }
+ });
+
+ var uploadImgHtml = '
';
+ uploadImgHtml += '
';
+ uploadImgHtml += '
';
+ uploadImgHtml += '
';
+ uploadImgHtml += '
';
+ //uploadImgHtml += '
';
+ uploadImgHtml += '
';
+ uploadImgHtml += '
';
+
+ Vue.component("image-upload", {
+ template: uploadImgHtml,
+ props: {
+ data: {
+ type: Object,
+ default: function () {
+ return {
+ data: {},
+ field: "",
+ callback: null
+ };
+ }
+ }
+ },
+ data: function () {
+ return {
+ myData: this.data,
+ list: [],
+ parent: this.$parent.data,
+ id: ns.gen_non_duplicate(10),
+ colorPicker:{}
+ };
+ },
+ created: function () {
+ if (this.myData.field === undefined) this.myData.field = "imageUrl";
+ this.id = ns.gen_non_duplicate(10);
+ },
+ methods: {
+ // 选择图标风格
+ iconStyle(event) {
+ var self = this;
+ selectIconStyle({
+ elem: event.currentTarget,
+ icon: self.myData.data.icon,
+ callback: function (data) {
+ if (data) {
+ self.myData.data.style = data;
+ } else {
+ iconStyleSet({
+ style: JSON.stringify(self.myData.data.style),
+ query: {
+ icon: self.myData.data.icon
+ }
+ }, function (style) {
+ self.myData.data.style = style;
+ })
+ }
+ }
+ })
+ },
+ /**
+ * 渲染颜色组件
+ * @param id
+ * @param color
+ * @param callback
+ */
+ colorRender(id, color, callback) {
+ var self = this;
+ if (this.colorPicker[id]) return;
+ setTimeout(function () {
+ self.colorPicker[id] = Colorpicker.create({
+ el: id,
+ color: color,
+ change: function (elem, hex) {
+ callback(elem, hex)
+ }
+ });
+ $('#' + id).click();
+ }, 10)
+ },
+ selectColor(id) {
+ let self = this;
+ this.colorRender(id, '', function (elem, color) {
+ if (self.myData.data.style['iconBgImg'] || self.myData.data.style['iconBgColor'].length) {
+ self.myData.data.style['iconBgColor'] = [color];
+ } else {
+ self.myData.data.style['iconColor'] = [color];
+ }
+ self.$forceUpdate();
+ })
+ },
+ /**
+ * 标签设置
+ * @param data
+ * @param callback
+ */
+ labelStyle(data, callback) {
+ layer.open({
+ title: "标签设置",
+ type: 2,
+ area: ['800px', '420px'],
+ fixed: false, //不固定
+ btn: ['保存', '取消'],
+ content: ns.url("shop/diy/selectlabel?request_mode=iframe", data ? data : {}),
+ yes: function (index, layero) {
+ var iframeWin = window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
+ iframeWin.selectLabelListener(function (obj) {
+ if (typeof callback == "string") {
+ try {
+ eval(callback + '(obj)');
+ layer.close(index);
+ } catch (e) {
+ console.error('回调函数' + callback + '未定义');
+ }
+ } else if (typeof callback == "function") {
+ callback(obj);
+ layer.close(index);
+ }
+ });
+ }
+ });
+ },
+ selectLabel() {
+ let self = this;
+ this.labelStyle(self.myData.data.label, function (data) {
+ self.myData.data.label = data;
+ self.$forceUpdate();
+ })
+ }
+ }
});
\ No newline at end of file
diff --git a/src/app/cron/controller/Task.php b/src/app/cron/controller/Task.php
index bc9fc11f8..11202e012 100644
--- a/src/app/cron/controller/Task.php
+++ b/src/app/cron/controller/Task.php
@@ -31,7 +31,7 @@ class Task extends Controller
log_write('Task checkCron ...', 'debug');
$cron_model = new Cron();
$result = $cron_model->checkSchedule();
- log_write('Task checkCron result: ' . json_encode($result), 'debug');
+ log_write('Task checkCron result: ' . formatForLog($result), 'debug');
return $result;
}
diff --git a/src/app/event/init/InitConfig.php b/src/app/event/init/InitConfig.php
index 1fd17bd59..1bdf8e5bc 100644
--- a/src/app/event/init/InitConfig.php
+++ b/src/app/event/init/InitConfig.php
@@ -25,7 +25,6 @@ class InitConfig
$this->initConst();
//初始化配置信息
$this->initConfig();
- log_write('系统配置信息已初始化', 'debug');
}
/**
diff --git a/src/app/merchant/controller/Goods.php b/src/app/merchant/controller/Goods.php
index f5b147b8c..c76fa4d33 100644
--- a/src/app/merchant/controller/Goods.php
+++ b/src/app/merchant/controller/Goods.php
@@ -106,7 +106,6 @@ class Goods extends BaseMerchant
$condition[] = [ 'ischeck', '=', 1 ];
}
}
- file_put_contents(__DIR__ . '/debug.txt', var_export($condition,true));
if (!empty($start_sale)) $condition[] = [ 'sale_num', '>=', $start_sale ];
if (!empty($end_sale)) $condition[] = [ 'sale_num', '<=', $end_sale ];
if (!empty($start_price)) $condition[] = [ 'price', '>=', $start_price ];
diff --git a/src/app/merchant/controller/Order.php b/src/app/merchant/controller/Order.php
index 5a5dd8836..9057d05ab 100644
--- a/src/app/merchant/controller/Order.php
+++ b/src/app/merchant/controller/Order.php
@@ -75,7 +75,7 @@ class Order extends BaseMerchant
$order_status = input('order_status', '');//订单状态
}
}
- file_put_contents(__DIR__ . '/debug.txt', var_export($order_status,true));
+
$order_name = input('order_name', '');
$pay_type = input('pay_type', '');
$order_from = input('order_from', '');
diff --git a/src/app/model/goods/Goods.php b/src/app/model/goods/Goods.php
index 54a9d474d..3a73f36f2 100644
--- a/src/app/model/goods/Goods.php
+++ b/src/app/model/goods/Goods.php
@@ -2160,7 +2160,7 @@ class Goods extends BaseModel
return $this->addGoods($data);
} catch (Exception $e) {
- dump($e);
+ // dump($e);
return $this->error('', $e->getMessage());
}
}
diff --git a/src/app/model/goods/GoodsApi.php b/src/app/model/goods/GoodsApi.php
index ee7c05302..3e625e185 100644
--- a/src/app/model/goods/GoodsApi.php
+++ b/src/app/model/goods/GoodsApi.php
@@ -104,7 +104,8 @@ class GoodsApi extends BaseModel
$goods_sku_detail[ 'store_goods_status' ] = 1;
}
}
-
+ //后端处理缺少域名问题,后续处理到前端 add lucky
+ if($goods_sku_detail['pdf_url']) $goods_sku_detail['pdf_url'] = 'https://'.$_SERVER['HTTP_HOST'].'/'.$goods_sku_detail['pdf_url'];
$goods_sku_detail[ 'purchased_num' ] = 0; // 该商品已购数量
$res[ 'goods_sku_detail' ] = $goods_sku_detail;
diff --git a/src/app/model/member/Login.php b/src/app/model/member/Login.php
index fecf28026..875291492 100644
--- a/src/app/model/member/Login.php
+++ b/src/app/model/member/Login.php
@@ -76,7 +76,7 @@ class Login extends BaseModel
$info = [];
$auth_tag = '';
foreach ($data as $key => $value) {
- if (in_array($key, [ 'wx_unionid', 'wx_openid', 'weapp_openid', 'qq_openid', 'ali_openid', 'baidu_openid', 'toutiao_openid' ])) {
+ if (in_array($key, [ 'wx_unionid', 'wx_openid', 'weapp_openid', 'qq_openid', 'ali_openid', 'baidu_openid', 'toutiao_openid', 'huawei_openid' ])) {
$auth_tag = $key;
if (empty($value)) return $this->error('', 'PARAMETER_ERROR');
$info = model("member")->getInfo(
@@ -95,7 +95,8 @@ class Login extends BaseModel
// 会员不存在 第三方自动注册开启 未开启绑定手机 则进行自动注册
$config = new Config();
$config_info = $config->getRegisterConfig($data[ 'site_id' ], 'shop');
- if ($config_info[ 'data' ][ 'value' ][ 'third_party' ] && !$config_info[ 'data' ][ 'value' ][ 'bind_mobile' ]) {
+ //华为元服务静默不用判断强制手机号
+ if (($config_info[ 'data' ][ 'value' ][ 'third_party' ] && !$config_info[ 'data' ][ 'value' ][ 'bind_mobile' ]) || $auth_tag == 'huawei_openid') {
$register = new Register();
$register_res = $register->authRegister($data);
if ($register_res[ 'code' ] == 0) {
diff --git a/src/app/model/member/Member.php b/src/app/model/member/Member.php
index 786fa6f6e..4f521aab0 100644
--- a/src/app/model/member/Member.php
+++ b/src/app/model/member/Member.php
@@ -27,6 +27,14 @@ use think\facade\Config;
class Member extends BaseModel
{
+
+ public function getBusinessPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = '', $field = '*')
+ {
+ $list = model('business')->pageList($condition, $field, $order, $page, $page_size, '', '', '');
+ return $this->success($list);
+ }
+
+
/**
* 添加会员(注意等级名称)
* @param $data
@@ -256,6 +264,7 @@ class Member extends BaseModel
$member_info = model('member')->setIsCache(0)->getInfo($condition, $field);
if (!empty($member_info) && empty($member_info[ 'wx_openid' ]) && !empty($member_info[ 'wx_unionid' ])) {
+ // TODO: 注意, 华为云上的最新代码,下面都注释掉了,
$fans_model = new Fans();
$fans_condition[] = [ "unionid", "=", $member_info[ 'wx_unionid' ] ];
$fans_info = $fans_model->getFansInfo($fans_condition);
diff --git a/src/app/model/member/Register.php b/src/app/model/member/Register.php
index c1b0f6ec9..f631fbac6 100644
--- a/src/app/model/member/Register.php
+++ b/src/app/model/member/Register.php
@@ -143,6 +143,7 @@ class Register extends BaseModel
'ali_openid' => $data['ali_openid'] ?? '',
'baidu_openid' => $data['baidu_openid'] ?? '',
'toutiao_openid' => $data['toutiao_openid'] ?? '',
+ 'huawei_openid' => $data['huawei_openid'] ?? '',
'headimg' => $data['avatarUrl'] ?? '',
'member_level' => !empty($member_level_info) ? $member_level_info[ 'level_id' ] : 0,
'member_level_name' => !empty($member_level_info) ? $member_level_info[ 'level_name' ] : '',
diff --git a/src/app/model/order/OrderCommon.php b/src/app/model/order/OrderCommon.php
index 32b0e52ad..a02c155db 100644
--- a/src/app/model/order/OrderCommon.php
+++ b/src/app/model/order/OrderCommon.php
@@ -1198,7 +1198,6 @@ class OrderCommon extends BaseModel
public function getOrderPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = '', $field = '*', $alias = 'a', $join = [])
{
$order_list = model('order')->pageList($condition, $field, $order, $page, $page_size, $alias, $join);
- file_put_contents(__DIR__ . '/debug.txt', var_export($condition,true));
$check_condition = array_column($condition, 2, 0);
if (!empty($order_list[ 'list' ])) {
diff --git a/src/app/model/order/OrderCreate.php b/src/app/model/order/OrderCreate.php
index 87d96289a..a367f1458 100644
--- a/src/app/model/order/OrderCreate.php
+++ b/src/app/model/order/OrderCreate.php
@@ -36,6 +36,7 @@ class OrderCreate extends BaseModel
model('order')->startTrans();
$pay_model = new Pay();
$this->out_trade_no = $pay_model->createOutTradeNo($this->member_id);
+
try {
//循环生成多个订单
@@ -52,15 +53,16 @@ class OrderCreate extends BaseModel
$order_insert_data['order_type_name'] = $this->order_type['order_type_name'];
$order_insert_data['order_status_name'] = $this->order_type['order_status']['name'];
$order_insert_data['order_status_action'] = json_encode($this->order_type['order_status'], JSON_UNESCAPED_UNICODE);
+ $order_insert_data['business'] = input('business','');
if($i >= 1){
//主表订单id
$order_insert_data['host_order_id'] = $this->order_id;
- // file_put_contents(__DIR__ . '/debug.txt', var_export($order_insert_data,true));
$order_id = model('order')->add($order_insert_data);
}else{
$order_id = model('order')->add($order_insert_data);
$this->order_id = $order_id;
}
+
$order_goods_insert_data = [];
//订单项目表
foreach ($v['goods_list'] as $order_goods_v) {
diff --git a/src/app/model/system/Document.php b/src/app/model/system/Document.php
index 10a56c02c..c3eccfd6c 100644
--- a/src/app/model/system/Document.php
+++ b/src/app/model/system/Document.php
@@ -66,11 +66,11 @@ class Document extends BaseModel
public function getDocument($condition)
{
- // $json_condition = json_encode($condition);
- // $cache = Cache::get("document_" . $json_condition, "");
- // if (!empty($cache)) {
- // return $this->success($cache);
- // }
+ $json_condition = json_encode($condition);
+ $cache = Cache::get("document_" . $json_condition, "");
+ if (!empty($cache)) {
+ return $this->success($cache);
+ }
$check_condition = array_column($condition, 2, 0);
$site_id = $check_condition['site_id'] ?? '';
if ($site_id === '') {
@@ -98,7 +98,7 @@ class Document extends BaseModel
'modify_time' => 0
];
}
- // Cache::tag("document")->set("document_" . $json_condition, $info);
+ Cache::tag("document")->set("document_" . $json_condition, $info);
return $this->success($info);
}
diff --git a/src/app/model/system/Seal.php b/src/app/model/system/Seal.php
new file mode 100644
index 000000000..007cc2e43
--- /dev/null
+++ b/src/app/model/system/Seal.php
@@ -0,0 +1,338 @@
+getList($condition, $field, $order, '', '', '', $limit);
+ $categoryMap = [];
+ foreach ($list as $item) {
+ $categoryMap[$item['category_id']] = $item;
+ $categoryMap[$item['category_id']]['child_list'] = [];
+ }
+ $buildTree = function ($parentId = 0) use (&$buildTree, $categoryMap) {
+ $children = [];
+ foreach ($categoryMap as $id => $item) {
+ if ($item['pid'] == $parentId) {
+ $item['child_list'] = $buildTree($id);
+ $children[] = $item;
+ }
+ }
+ return $children;
+ };
+
+ $tree = $buildTree(0);
+ return $this->success($tree);
+ }
+
+
+ public function getTree1($condition = [], $field = '*', $order = 'sort asc,category_id desc', $limit = null)
+ {
+ $list = model('seal_structure')->getList($condition, $field, $order, '', '', '', $limit);
+ $categoryMap = [];
+ foreach ($list as $item) {
+ $categoryMap[$item['category_id']] = $item;
+ // 初始化子分类数组(避免子分类为null)
+ $categoryMap[$item['category_id']]['child_list'] = [];
+ }
+
+ // 递归构建树形结构:仅子层级(parentId≠0)添加「请选择」
+ $buildTree = function ($parentId = 0) use (&$buildTree, $categoryMap) {
+ $children = [];
+ foreach ($categoryMap as $id => $item) {
+ if ($item['pid'] == $parentId) {
+ // 1. 递归获取当前分类的子分类(子分类会根据parentId判断是否加占位项)
+ $item['child_list'] = $buildTree($id);
+ $children[] = $item;
+ }
+ }
+
+ // 2. 关键判断:仅当 parentId ≠ 0(子层级)时,才插入「请选择」占位项
+ if ($parentId != 0 && !empty($children)) { // 非顶级 + 有真实子分类时才加(可选,避免空列表加占位)
+ $defaultOption = [
+ 'category_id' => 0, // 虚拟ID(与真实分类区分)
+ 'pid' => $parentId, // 占位项父ID = 当前层级父ID(匹配真实子分类)
+ 'name' => '请选择', // 显示文本
+ 'child_list' => [], // 占位项无下级(避免无限嵌套)
+ 'is_placeholder' => true // 前端识别标记
+ // 真实分类的其他字段(如sort)可按需添加默认值
+ ];
+
+ // 在子层级分类列表头部插入占位项
+ array_unshift($children, $defaultOption);
+ }
+
+ return $children;
+ };
+
+ // 生成树形结构:顶级分类(parentId=0)不添加「请选择」
+ $tree = $buildTree(0);
+
+ return $this->success($tree);
+ }
+
+ /**
+ * 获取列表带分页
+ * @param array $condition
+ * @param int $page
+ * @param int $page_size
+ * @param string $order
+ * @param bool $field
+ * @param string $alias
+ * @param array $join
+ * @return array
+ */
+ public function getPageList($table,array $condition = [], $page = 1, $page_size = PAGE_LIST_ROWS,$order = '',$field = true, $alias = '', $join = [], $group='')
+ {
+ $res = model($table)->pageList($condition, $field, $order, $page, $page_size, $alias, $join, $group);
+ return $this->success($res);
+ }
+
+ /**
+ * 获取详情
+ * @param array $condition
+ * @param bool $field
+ * @return array
+ */
+ public function getInfo($table,$condition = [], $field = true, $alias = 'a', $join = null)
+ {
+ $info = model($table)->getInfo($condition, $field,$alias,$join);
+ return $this->success($info);
+ }
+
+ public function delete($table,$condition = [])
+ {
+ $info = model($table)->delete($condition);
+ return $this->success($info);
+ }
+ /**
+ * 获取列表不要分页
+ * @param array $condition
+ * @return array
+ * @throws DataNotFoundException
+ * @throws DbException
+ * @throws ModelNotFoundException
+ */
+ public function getList($table,$condition = [],$field="*", $order = '', $alias = 'a', $join = [], $group = '')
+ {
+ return model($table)->getList($condition,$field,$order,$alias,$join,$group);
+ }
+
+
+ /**
+ * 添加
+ * @param array $data
+ * @param array $params
+ * @return array
+ */
+ public function add($table,array $data)
+ {
+ if (empty($data) || empty($table)) {
+ return $this->error('', 'PARAMETER_ERROR');
+ }
+ $res = model($table)->add($data);
+ return $this->success($res);
+ }
+
+ /**
+ * 编辑
+ * @param array $data
+ * @param array $condition
+ * @param array $params
+ * @return array
+ */
+ public function edit($table,array $data, array $condition, array $params = [])
+ {
+ if (empty($data)) {
+ return $this->error('', 'PARAMETER_ERROR');
+ }
+
+ $res = model($table)->update($data, $condition);
+ return $this->success($res);
+ }
+
+
+
+
+
+ /**
+ * @param $param
+ * @param $site_id
+ * @return array
+ * @throws \PHPExcel_Exception
+ * @throws \PHPExcel_Reader_Exception
+ * @throws \think\exception\PDOException
+ */
+ public function importMedium($param, $site_id)
+ {
+
+
+
+ $PHPReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
+
+ //载入文件
+ $PHPExcel = $PHPReader->load($param[ 'path' ]);
+
+ //获取表中的第一个工作表,如果要获取第二个,把0改为1,依次类推
+ $currentSheet = $PHPExcel->getSheet(0);
+
+ //获取总行数
+ $allRow = $currentSheet->getHighestRow();
+
+ if ($allRow < 2) {
+ return $this->error('', '导入了一个空文件');
+ }
+
+ $index = $param[ 'index' ];
+
+ //每次导入100条
+ $length = $index * 2000;
+
+ if ($index == 1) {
+ $num = 27
+ ;
+ $success_num = 0;
+ $error_num = 0;
+
+ $data_record = [
+ "member_num" => ( $allRow - 1 ),
+ "success_num" => 0,
+ "error_num" => 0,
+ "create_time" => time(),
+ "status_name" => "等待导入"
+ ];
+ $record = model('seal_medium_import_record')->add($data_record);
+
+ } else {
+ $num = ( ( $index - 1 ) * 100 ) + 1;
+ $success_num = $param[ 'success_num' ];
+ $error_num = $param[ 'error_num' ];
+ $record = $param[ 'record' ];
+ }
+
+ $type_num = 0;
+ model('seal_medium')->startTrans();
+ $field = ['C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T'];
+ $name = ['全氟醚FFKM','聚全氟乙丙稀FEPM','丁苯橡胶SBR','氯丁橡胶CR','聚四氟乙烯PTFE','三元乙丙橡胶EPDM','氯醇橡胶 ECO','丁基橡胶 ⅡR','丁腈橡胶 NBR','丙烯酸酯橡胶ACM','聚氨酯 PU','天然橡胶 NR','氟橡胶 FKM','乙丙烯酸酯橡胶AEM','氢化丁腈橡胶HNBR','氟硅橡胶 FVMQ','氯磺化聚乙烯CSM','硅橡胶 VMQ'];
+ $colors = ['#D5663F','','#E09E36','','#DDDF37','','#75C551','','#54C28D','','#409CBD','','#5B5FBB','','#A061B5','','#BC5A6A',''];//颜色表
+ try {
+
+ for ($i = $num; $i <= $length; $i++) {
+
+ //这一行是化学介质行直接跳过
+ // if($num == 26) continue;
+
+ if ($i > $allRow) {
+ break;
+ }
+ $type_num = $i;
+
+
+
+ $title = $PHPExcel->getActiveSheet()->getCell('B' . $i)->getValue();
+ $title = trim($title);
+ if($title == '') break;
+ //获取每一列的值
+ $value_data = [];
+ foreach($field as $k=>$item){
+ $value = $PHPExcel->getActiveSheet()->getCell($item . $i)->getValue();
+ // //1推荐使用,2有条件使用,3不推荐使用,4不能使用,空格,数据不详
+ $colortext = '#333';
+ if($value == 1){
+ $colortext = '#75c551';
+ }else if($value == 2){
+ $colortext = '#409cbd';
+ }else if($value == 3){
+ $colortext = '#e09e36';
+ }else if($value == 4){
+ $colortext = '#ff0000';
+ }
+ $value_data[] = [
+ 'text'=>$name[$k],
+ 'value'=>trim($value),
+ 'color'=>$colortext,
+ 'background'=>$colors[$k]
+ ];
+ // echo $value.'
';
+ }
+ // dump($value_data);
+
+ $data = [
+ 'name'=>$title,
+ 'value'=>json_encode($value_data)
+ ];
+ $res = model('seal_medium')->add($data);
+ // dump($data);
+ // break;
+ // exit;
+
+ // $not_data = [
+ // "username" => $username,
+ // "number" => $number,
+ // "company" => $company,
+ // "company_realname" => $company_realname,
+ // "company_mobile" => $company_mobile,
+ // ];
+
+ // if ($username == "" && $mobile == "") {
+ // $not_data[ 'content' ] = "失败,用户名或手机号必须存在一个";
+ // model('member_import_log')->add($not_data);
+ // $error_num++;
+ // continue;
+ // }
+
+ // $data = [
+ // "username" => $username,
+ // "number" => $number,
+ // "company" => $company,
+ // "company_realname" => $company_realname,
+ // "company_mobile" => $company_mobile,
+ // ];
+ // $res = model('seal_medium_import_record')->add($data);
+ // $product = model('device')->getInfo([ [ 'id', '=', $res ]]);
+
+ $not_data[ 'content' ] = "成功";
+ // model('member_import_log')->add($not_data);
+ $success_num++;
+ }
+ model('seal_medium')->commit();
+ if ($success_num + $error_num == ( $allRow - 1 )) {
+ $data_record = [
+ "member_num" => ( $allRow - 1 ),
+ "success_num" => $success_num,
+ "error_num" => $error_num,
+ "create_time" => time()
+ ];
+ if ($success_num == ( $allRow - 1 )) {
+ $data_record[ 'status_name' ] = '导入成功';
+ } elseif ($error_num == ( $allRow - 1 )) {
+ $data_record[ 'status_name' ] = '导入失败';
+ }
+
+ model('seal_medium_import_record')->update($data_record, [ 'id' => $record ]);
+ }
+ return $this->success([
+ "allRow" => $allRow,
+ "num" => $type_num,
+ "path" => $param[ 'path' ],
+ "name" => $param[ 'filename' ],
+ "success_num" => $success_num,
+ "error_num" => $error_num,
+ "record" => $record
+ ]);
+ } catch (\Exception $e) {
+ model('seal_medium')->rollback();
+ return $this->error('', $e->getMessage());
+ }
+ }
+
+}
diff --git a/src/app/model/web/Config.php b/src/app/model/web/Config.php
index 3d4fa0e69..a65cbaab9 100644
--- a/src/app/model/web/Config.php
+++ b/src/app/model/web/Config.php
@@ -1,5 +1,4 @@
'清除',
'icon' => 'public/static/img/cache/template.png'
],
- /* [
+ /* [
'name' => '刷新菜单',
'desc' => '新增/修改插件菜单后,需要刷新插件菜单',
'key' => 'menu_cache',
@@ -61,7 +60,7 @@ class Config extends BaseModel
public function setCaptchaConfig($data, $site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '验证码设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'CAPTCHA_CONFIG']]);
+ $res = $config->setConfig($data, '验证码设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'CAPTCHA_CONFIG' ] ]);
return $res;
}
@@ -74,20 +73,20 @@ class Config extends BaseModel
public function getCaptchaConfig($site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'CAPTCHA_CONFIG']]);
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'CAPTCHA_CONFIG' ] ]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'shop_login' => 1,
'shop_reception_login' => 1,
'shop_reception_register' => 1
];
} else {
- if (isset($res['data']['value']['shop_reception_login']) === false) {
- $res['data']['value']['shop_reception_login'] = 1;
+ if (isset($res[ 'data' ][ 'value' ][ 'shop_reception_login' ]) === false) {
+ $res[ 'data' ][ 'value' ][ 'shop_reception_login' ] = 1;
}
- if (isset($res['data']['value']['shop_reception_register']) === false) {
- $res['data']['value']['shop_reception_register'] = 1;
+ if (isset($res[ 'data' ][ 'value' ][ 'shop_reception_register' ]) === false) {
+ $res[ 'data' ][ 'value' ][ 'shop_reception_register' ] = 1;
}
}
return $res;
@@ -102,31 +101,31 @@ class Config extends BaseModel
*/
public function setDefaultImg($data, $site_id = 0, $app_module = 'shop')
{
- $config_info = $this->getDefaultImg($site_id, $app_module)['data']['value'];
+ $config_info = $this->getDefaultImg($site_id, $app_module)[ 'data' ][ 'value' ];
if (!empty($config_info)) {
$upload_model = new Upload();
- if ($data['goods'] && $config_info['goods'] && $data['goods'] != $config_info['goods']) {
- $upload_model->deletePic($config_info['goods'], $site_id);
+ if ($data[ 'goods' ] && $config_info[ 'goods' ] && $data[ 'goods' ] != $config_info[ 'goods' ]) {
+ $upload_model->deletePic($config_info[ 'goods' ], $site_id);
}
- if ($data['head'] && $config_info['head'] && $data['head'] != $config_info['head']) {
- $upload_model->deletePic($config_info['head'], $site_id);
+ if ($data[ 'head' ] && $config_info[ 'head' ] && $data[ 'head' ] != $config_info[ 'head' ]) {
+ $upload_model->deletePic($config_info[ 'head' ], $site_id);
}
- if ($data['store'] && $config_info['store'] && $data['store'] != $config_info['store']) {
- $upload_model->deletePic($config_info['store'], $site_id);
+ if ($data[ 'store' ] && $config_info[ 'store' ] && $data[ 'store' ] != $config_info[ 'store' ]) {
+ $upload_model->deletePic($config_info[ 'store' ], $site_id);
}
- if ($data['article'] && $config_info['article'] && $data['article'] != $config_info['article']) {
- $upload_model->deletePic($config_info['article'], $site_id);
+ if ($data[ 'article' ] && $config_info[ 'article' ] && $data[ 'article' ] != $config_info[ 'article' ]) {
+ $upload_model->deletePic($config_info[ 'article' ], $site_id);
}
- if ($data['kefu'] && $config_info['kefu'] && $data['kefu'] != $config_info['kefu']) {
- $upload_model->deletePic($config_info['kefu'], $site_id);
+ if ($data[ 'kefu' ] && $config_info[ 'kefu' ] && $data[ 'kefu' ] != $config_info[ 'kefu' ]) {
+ $upload_model->deletePic($config_info[ 'kefu' ], $site_id);
}
- if ($data['phone'] && $config_info['phone'] && $data['phone'] != $config_info['phone']) {
- $upload_model->deletePic($config_info['phone'], $site_id);
+ if ($data[ 'phone' ] && $config_info[ 'phone' ] && $data[ 'phone' ] != $config_info[ 'phone' ]) {
+ $upload_model->deletePic($config_info[ 'phone' ], $site_id);
}
}
$config = new ConfigModel();
- $res = $config->setConfig($data, '默认图设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DEFAULT_IMAGE']]);
+ $res = $config->setConfig($data, '默认图设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DEFAULT_IMAGE' ] ]);
return $res;
}
@@ -139,9 +138,9 @@ class Config extends BaseModel
public function getDefaultImg($site_id, $app_model = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_model], ['config_key', '=', 'DEFAULT_IMAGE']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_model ], [ 'config_key', '=', 'DEFAULT_IMAGE' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'goods' => 'public/static/img/default_img/square.png',
'head' => 'public/static/img/default_img/head.png',
'store' => 'public/static/img/default_img/store.png',
@@ -151,14 +150,14 @@ class Config extends BaseModel
];
}
- if (empty($res['data']['value']['head'])) {
- $res['data']['value']['head'] = 'public/static/img/default_img/head.png';
+ if (empty($res[ 'data' ][ 'value' ][ 'head' ])) {
+ $res[ 'data' ][ 'value' ][ 'head' ] = 'public/static/img/default_img/head.png';
}
- if (empty($res['data']['value']['article'])) {
- $res['data']['value']['article'] = 'public/static/img/default_img/article.png';
+ if (empty($res[ 'data' ][ 'value' ][ 'article' ])) {
+ $res[ 'data' ][ 'value' ][ 'article' ] = 'public/static/img/default_img/article.png';
}
- if (empty($res['data']['value']['store'])) {
- $res['data']['value']['store'] = 'public/static/img/default_img/store.png';
+ if (empty($res[ 'data' ][ 'value' ][ 'store' ])) {
+ $res[ 'data' ][ 'value' ][ 'store' ] = 'public/static/img/default_img/store.png';
}
return $res;
}
@@ -174,7 +173,7 @@ class Config extends BaseModel
public function setCopyright($data, $site_id = 1, $app_model = 'shop')
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '版权设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_model], ['config_key', '=', 'COPYRIGHT']]);
+ $res = $config->setConfig($data, '版权设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_model ], [ 'config_key', '=', 'COPYRIGHT' ] ]);
return $res;
}
@@ -187,16 +186,16 @@ class Config extends BaseModel
public function getCopyright($site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'COPYRIGHT']]);
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'COPYRIGHT' ] ]);
$auth_info = cache('auth_info_copyright');
if (empty($auth_info)) {
$upgrade_model = new Upgrade();
$auth_info = $upgrade_model->authInfo();
- cache('auth_info_copyright', $auth_info, ['expire' => 604800]);
+ cache('auth_info_copyright', $auth_info, [ 'expire' => 604800 ]);
}
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'logo' => '',
'company_name' => '',
'copyright_link' => '',
@@ -207,15 +206,16 @@ class Config extends BaseModel
'market_supervision_url' => ''
];
} else {
- if (is_null($auth_info) || $auth_info['code'] != 0) {
- $res['data']['value']['logo'] = '';
- $res['data']['value']['company_name'] = '';
- $res['data']['value']['copyright_link'] = '';
- $res['data']['value']['copyright_desc'] = '';
+ if (is_null($auth_info) || $auth_info[ 'code' ] != 0) {
+ $res[ 'data' ][ 'value' ][ 'logo' ] = '';
+ $res[ 'data' ][ 'value' ][ 'company_name' ] = '';
+ $res[ 'data' ][ 'value' ][ 'copyright_link' ] = '';
+ $res[ 'data' ][ 'value' ][ 'copyright_desc' ] = '';
}
+
}
// 检查是否授权
- $res['data']['value']['auth'] = true;
+ $res[ 'data' ][ 'value' ][ 'auth' ] = true;
return $res;
}
@@ -229,7 +229,7 @@ class Config extends BaseModel
public function setAuth($data, $site_id = 1, $app_model = 'shop')
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '授权设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_model], ['config_key', '=', 'AUTH']]);
+ $res = $config->setConfig($data, '授权设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_model ], [ 'config_key', '=', 'AUTH' ] ]);
return $res;
}
@@ -240,9 +240,9 @@ class Config extends BaseModel
public function getAuth($site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'AUTH']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'AUTH' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'code' => '',
];
}
@@ -259,11 +259,11 @@ class Config extends BaseModel
public function setMapConfig($data, $site_id, $app_model = 'shop')
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '地图设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_model], ['config_key', '=', 'MAP_CONFIG']]);
+ $res = $config->setConfig($data, '地图设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_model ], [ 'config_key', '=', 'MAP_CONFIG' ] ]);
return $res;
}
- /**
+ /**
* 获取地图设置
* @param int $site_id
* @param string $app_module
@@ -273,16 +273,16 @@ class Config extends BaseModel
{
$config = new ConfigModel();
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'MAP_CONFIG']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
- 'tencent_map_key' => '2PJBZ-A263Q-SED5B-4SAAB-HCUQ5-DUFHE', //默认一个地图TB5BZ-FBRRX-2RJ4C-76SZY-TYQ3H-F4BFC
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
+ 'tencent_map_key' => '2PJBZ-A263Q-SED5B-4SAAB-HCUQ5-DUFHE',//默认一个地图TB5BZ-FBRRX-2RJ4C-76SZY-TYQ3H-F4BFC
'wap_is_open' => 1, // 手机端是否开启定位
'wap_valid_time' => 5 // 手机端定位有效期/分钟,过期后将重新获取定位信息,0为不过期
];
}
- $res['data']['value']['wap_is_open'] = $res['data']['value']['wap_is_open'] ?? 1;
- $res['data']['value']['wap_valid_time'] = $res['data']['value']['wap_valid_time'] ?? 5;
- $res['data']['value']['tencent_map_key'] = '2PJBZ-A263Q-SED5B-4SAAB-HCUQ5-DUFHE';
+ $res[ 'data' ][ 'value' ][ 'wap_is_open' ] = $res[ 'data' ][ 'value' ][ 'wap_is_open' ] ?? 1;
+ $res[ 'data' ][ 'value' ][ 'wap_valid_time' ] = $res[ 'data' ][ 'value' ][ 'wap_valid_time' ] ?? 5;
+ $res[ 'data' ][ 'value' ]['tencent_map_key'] = '2PJBZ-A263Q-SED5B-4SAAB-HCUQ5-DUFHE';
return $res;
}
@@ -296,19 +296,19 @@ class Config extends BaseModel
public function seth5DomainName($data, $site_id = 1, $app_module = 'shop')
{
$search = '/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/';
- if ($data['deploy_way'] == 'separate') {
- if (!preg_match($search, $data['domain_name_h5'])) {
+ if ($data[ 'deploy_way' ] == 'separate') {
+ if (!preg_match($search, $data[ 'domain_name_h5' ])) {
return $this->error('', '请输入正确的域名地址');
}
}
// 默认部署,更新店铺域名
- if ($data['deploy_way'] == 'default') {
+ if ($data[ 'deploy_way' ] == 'default') {
$this->setShopDomainConfig([
'domain_name' => __ROOT__
], $site_id);
}
$config = new ConfigModel();
- $res = $config->setConfig($data, 'H5域名配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'H5_DOMAIN_NAME']]);
+ $res = $config->setConfig($data, 'H5域名配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'H5_DOMAIN_NAME' ] ]);
return $res;
}
@@ -322,9 +322,9 @@ class Config extends BaseModel
public function getH5DomainName($site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'H5_DOMAIN_NAME']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'H5_DOMAIN_NAME' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'domain_name_h5' => __ROOT__ . '/h5',
'deploy_way' => 'default'
];
@@ -342,7 +342,7 @@ class Config extends BaseModel
public function setDomainJumpConfig($data, $site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '获取域名跳转配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DOMAIN_JUMP_CONFIG']]);
+ $res = $config->setConfig($data, '获取域名跳转配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DOMAIN_JUMP_CONFIG' ] ]);
return $res;
}
@@ -356,12 +356,12 @@ class Config extends BaseModel
{
$config = new ConfigModel();
$res = $config->getConfig([
- ['site_id', '=', $site_id],
- ['app_module', '=', $app_module],
- ['config_key', '=', 'DOMAIN_JUMP_CONFIG']
+ [ 'site_id', '=', $site_id ],
+ [ 'app_module', '=', $app_module ],
+ [ 'config_key', '=', 'DOMAIN_JUMP_CONFIG' ]
]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'jump_type' => 3, // 1:用户前台,2:商家后台,3:引导页
];
}
@@ -378,19 +378,19 @@ class Config extends BaseModel
public function setPcDomainName($data, $site_id = 1, $app_module = 'shop')
{
$search = '/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/';
- if ($data['deploy_way'] == 'separate') {
- if (!preg_match($search, $data['domain_name_pc'])) {
+ if ($data[ 'deploy_way' ] == 'separate') {
+ if (!preg_match($search, $data[ 'domain_name_pc' ])) {
return $this->error('', '请输入正确的域名地址');
}
}
// 默认部署,更新店铺域名
- if ($data['deploy_way'] == 'default') {
+ if ($data[ 'deploy_way' ] == 'default') {
$this->setShopDomainConfig([
'domain_name' => __ROOT__
], $site_id);
}
$config = new ConfigModel();
- $res = $config->setConfig($data, 'PC域名配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'PC_DOMAIN_NAME']]);
+ $res = $config->setConfig($data, 'PC域名配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'PC_DOMAIN_NAME' ] ]);
return $res;
}
@@ -403,19 +403,19 @@ class Config extends BaseModel
public function getPcDomainName($site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'PC_DOMAIN_NAME']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'PC_DOMAIN_NAME' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'domain_name_pc' => __ROOT__ . '/web',
'deploy_way' => 'default'
];
} else {
- if ($res['data']['value']['domain_name_pc'] == '' || empty($res['data']['value']['deploy_way']) || $res['data']['value']['deploy_way'] == 'default') {
- $res['data']['value'] = [
+ if ($res[ 'data' ][ 'value' ][ 'domain_name_pc' ] == '' || empty($res[ 'data' ][ 'value' ][ 'deploy_way' ]) || $res[ 'data' ][ 'value' ][ 'deploy_way' ] == 'default') {
+ $res[ 'data' ][ 'value' ] = [
'domain_name_pc' => __ROOT__ . '/web'
];
}
- $res['data']['value']['deploy_way'] = $res['data']['value']['deploy_way'] ?? 'default';
+ $res[ 'data' ][ 'value' ][ 'deploy_way' ] = $res[ 'data' ][ 'value' ][ 'deploy_way' ] ?? 'default';
}
return $res;
}
@@ -430,7 +430,7 @@ class Config extends BaseModel
public function setHotSearchWords($data, $site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '商品热门搜索关键词', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_HOT_SEARCH_WORDS_CONFIG']]);
+ $res = $config->setConfig($data, '商品热门搜索关键词', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_HOT_SEARCH_WORDS_CONFIG' ] ]);
return $res;
}
@@ -443,9 +443,9 @@ class Config extends BaseModel
public function getHotSearchWords($site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_HOT_SEARCH_WORDS_CONFIG']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_HOT_SEARCH_WORDS_CONFIG' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'words' => ''
];
}
@@ -462,7 +462,7 @@ class Config extends BaseModel
public function setGuessYouLike($data, $site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '商品推荐', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_GUESS_YOU_LIKE_CONFIG']]);
+ $res = $config->setConfig($data, '商品推荐', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_GUESS_YOU_LIKE_CONFIG' ] ]);
return $res;
}
@@ -475,11 +475,11 @@ class Config extends BaseModel
public function getGuessYouLike($site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_GUESS_YOU_LIKE_CONFIG']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_GUESS_YOU_LIKE_CONFIG' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'title' => '猜你喜欢',
- 'supportPage' => ['goods_detail', 'cart', 'collect', 'pay', 'order_detail', 'super_member', 'guafen', 'fenxiao_level'],
+ 'supportPage' => [ 'goods_detail', 'cart', 'collect', 'pay', 'order_detail', 'super_member', 'guafen', 'fenxiao_level' ],
'sources' => 'sort',
'goodsIds' => [],
'fontWeight' => false,
@@ -508,7 +508,7 @@ class Config extends BaseModel
],
];
}
- $res['data']['value']['nameLineMode'] = $res['data']['value']['nameLineMode'] ?? 'single'; // 商品名称,单行、多行展示
+ $res[ 'data' ][ 'value' ][ 'nameLineMode' ] = $res[ 'data' ][ 'value' ][ 'nameLineMode' ] ?? 'single'; // 商品名称,单行、多行展示
return $res;
}
@@ -522,17 +522,17 @@ class Config extends BaseModel
public function getDiyAdv($site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_STARTADV']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
- 'list' => [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DIY_STARTADV' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])){
+ $res[ 'data' ][ 'value' ] = [
+ 'list' =>[
[
- 'title' => '启动广告',
- 'link' => [
- 'name' => ''
+ 'title'=>'启动广告',
+ 'link'=>[
+ 'name'=>''
],
- 'iconType' => 'img',
- 'imageUrl' => "public/static/ext/diyview/img/preview/advs_default.png"
+ 'iconType'=>'img',
+ 'imageUrl'=>"public/static/ext/diyview/img/preview/advs_default.png"
]
],
'advtype' => 1,
@@ -552,12 +552,12 @@ class Config extends BaseModel
public function setDiyAdv($data, $site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '启动广告', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_STARTADV']]);
+ $res = $config->setConfig($data, '启动广告', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DIY_STARTADV' ] ]);
return $res;
}
- /**
+ /**
* 获取VR
* @param $site_id
* @param $app_module
@@ -566,14 +566,14 @@ class Config extends BaseModel
public function getDiyVr($site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_VR']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DIY_VR' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])){
+ $res[ 'data' ][ 'value' ] = [
'title' => '工厂展示',
'url' => 'https://baidu.com',
];
}
- // $res[ 'data' ][ 'value' ][ 'nameLineMode' ] = $res[ 'data' ][ 'value' ][ 'nameLineMode' ] ?? 'single'; // 商品名称,单行、多行展示
+// $res[ 'data' ][ 'value' ][ 'nameLineMode' ] = $res[ 'data' ][ 'value' ][ 'nameLineMode' ] ?? 'single'; // 商品名称,单行、多行展示
return $res;
}
@@ -587,7 +587,7 @@ class Config extends BaseModel
public function setDiyVr($data, $site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->setConfig($data, 'VR展示', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_VR']]);
+ $res = $config->setConfig($data, 'VR展示', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DIY_VR' ] ]);
return $res;
}
@@ -602,7 +602,7 @@ class Config extends BaseModel
public function setGoodsListConfig($data, $site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '商品列表配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_LIST_CONFIG']]);
+ $res = $config->setConfig($data, '商品列表配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_LIST_CONFIG' ] ]);
return $res;
}
@@ -615,9 +615,9 @@ class Config extends BaseModel
public function getGoodsListConfig($site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_LIST_CONFIG']]);
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_LIST_CONFIG' ] ]);
//数据格式化
- if (empty($res['data']['value'])) {
+ if (empty($res[ 'data' ][ 'value' ])) {
$data = [
'fontWeight' => false,
'padding' => 10,
@@ -644,9 +644,9 @@ class Config extends BaseModel
]
]
];
- $res['data']['value'] = $data;
+ $res[ 'data' ][ 'value' ] = $data;
}
- $res['data']['value']['nameLineMode'] = $res['data']['value']['nameLineMode'] ?? 'single'; // 商品名称,单行、多行展示
+ $res[ 'data' ][ 'value' ][ 'nameLineMode' ] = $res[ 'data' ][ 'value' ][ 'nameLineMode' ] ?? 'single'; // 商品名称,单行、多行展示
return $res;
}
@@ -660,7 +660,7 @@ class Config extends BaseModel
public function setDefaultSearchWords($data, $site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '默认搜索关键词', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_DEFAULT_SEARCH_WORDS_CONFIG']]);
+ $res = $config->setConfig($data, '默认搜索关键词', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_DEFAULT_SEARCH_WORDS_CONFIG' ] ]);
return $res;
}
@@ -673,9 +673,9 @@ class Config extends BaseModel
public function getDefaultSearchWords($site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_DEFAULT_SEARCH_WORDS_CONFIG']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_DEFAULT_SEARCH_WORDS_CONFIG' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'words' => '搜索 商品'
];
}
@@ -692,7 +692,7 @@ class Config extends BaseModel
public function setGoodsSort($data, $site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '商品默认排序方式', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_SORT_CONFIG']]);
+ $res = $config->setConfig($data, '商品默认排序方式', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_SORT_CONFIG' ] ]);
return $res;
}
@@ -705,9 +705,9 @@ class Config extends BaseModel
public function getGoodsSort($site_id, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_SORT_CONFIG']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_SORT_CONFIG' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'type' => 'asc',
'default_value' => 100
];
@@ -725,7 +725,7 @@ class Config extends BaseModel
public function setCategoryConfig($data, $site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->setConfig($data, 'PC端首页分类设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'SHOP_CATEGORY_CONFIG']]);
+ $res = $config->setConfig($data, 'PC端首页分类设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'SHOP_CATEGORY_CONFIG' ] ]);
return $res;
}
@@ -738,9 +738,9 @@ class Config extends BaseModel
public function getCategoryConfig($site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'SHOP_CATEGORY_CONFIG']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'SHOP_CATEGORY_CONFIG' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'category' => 1,
'img' => 1
];
@@ -758,7 +758,7 @@ class Config extends BaseModel
public function setGoodsDetailConfig($data, $site_id, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '商品详情配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_DETAIL_CONFIG']]);
+ $res = $config->setConfig($data, '商品详情配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_DETAIL_CONFIG' ] ]);
return $res;
}
@@ -771,9 +771,9 @@ class Config extends BaseModel
public function getGoodsDetailConfig($site_id, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_DETAIL_CONFIG']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_DETAIL_CONFIG' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'nav_bar_switch' => 0, // 是否透明,0:不透明,1:透明
'introduction_color' => '#303133',
];
@@ -791,7 +791,7 @@ class Config extends BaseModel
public function setShopDomainConfig($data, $site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '店铺域名配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'SHOP_DOMAIN_CONFIG']]);
+ $res = $config->setConfig($data, '店铺域名配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'SHOP_DOMAIN_CONFIG' ] ]);
return $res;
}
@@ -804,12 +804,12 @@ class Config extends BaseModel
public function getShopDomainConfig($site_id = 1, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'SHOP_DOMAIN_CONFIG']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'SHOP_DOMAIN_CONFIG' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'domain_name' => __ROOT__,
];
- $this->setShopDomainConfig($res['data']['value'], $site_id);
+ $this->setShopDomainConfig($res[ 'data' ][ 'value' ], $site_id);
}
return $res;
}
@@ -817,11 +817,11 @@ class Config extends BaseModel
{
$qq_map = new \app\model\map\QqMap(['key' => $tencent_map_key]);
$res = $qq_map->ipToDetail([
- 'ip' => request()->ip() != '127.0.0.1' ? $_SERVER['REMOTE_ADDR'] : '',
+ 'ip' => request()->ip() != '127.0.0.1' ? $_SERVER[ 'REMOTE_ADDR' ] : '',
]);
if (!empty($res)) {
- if ($res['status'] != 0 && $type == 0) {
- $res['message'] = '腾讯地图配置错误,无法定位地址';
+ if ($res[ 'status' ] != 0 && $type == 0) {
+ $res[ 'message' ] = '腾讯地图配置错误,无法定位地址';
}
}
return $res;
@@ -857,7 +857,7 @@ class Config extends BaseModel
public function setGoodsNo($data, $site_id, $app_module)
{
$config = new ConfigModel();
- $res = $config->setConfig($data, '商品编码设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_NO_CONFIG']]);
+ $res = $config->setConfig($data, '商品编码设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_NO_CONFIG' ] ]);
return $res;
}
@@ -870,12 +870,12 @@ class Config extends BaseModel
public function getGoodsNo($site_id, $app_module = 'shop')
{
$config = new ConfigModel();
- $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_NO_CONFIG']]);
- if (empty($res['data']['value'])) {
- $res['data']['value'] = [
+ $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_NO_CONFIG' ] ]);
+ if (empty($res[ 'data' ][ 'value' ])) {
+ $res[ 'data' ][ 'value' ] = [
'uniqueness_switch' => 1,
];
}
return $res;
}
-}
+}
\ No newline at end of file
diff --git a/src/app/model/web/DiyViewLink.php b/src/app/model/web/DiyViewLink.php
index 9c50919a2..526b092f1 100644
--- a/src/app/model/web/DiyViewLink.php
+++ b/src/app/model/web/DiyViewLink.php
@@ -201,8 +201,89 @@ class DiyViewLink extends BaseModel
$link_list[ $k ][ 'child_list' ] = [];
}
}
+
+ // PDF文件分类列表
+ foreach ($link_list as $k => $v) {
+ if (isset($v[ 'child_list' ])) {
+ foreach ($v[ 'child_list' ] as $ck => $cv) {
+ if ($cv[ 'name' ] == 'FILES_CATE_PAGE') {
+ $link_list[ $k ][ 'child_list' ][ $ck ][ 'child_list' ] = [ $this->getFllesCateGoryPageLinkList($params[ 'site_id' ])[ 'data' ] ];
+ }
+ }
+ } else {
+ $link_list[ $k ][ 'child_list' ] = [];
+ }
+ }
+
+ // PDF文件列表
+ foreach ($link_list as $k => $v) {
+ if (isset($v[ 'child_list' ])) {
+ foreach ($v[ 'child_list' ] as $ck => $cv) {
+ if ($cv[ 'name' ] == 'FILES_LIST_PAGE') {
+ $link_list[ $k ][ 'child_list' ][ $ck ][ 'child_list' ] = [ $this->getFllesPageLinkList($params[ 'site_id' ])[ 'data' ] ];
+ }
+ }
+ } else {
+ $link_list[ $k ][ 'child_list' ] = [];
+ }
+ }
+ file_put_contents(__DIR__ . '/debug.txt', var_export($link_list,true));
return $this->success($link_list);
}
+ /**
+ * 查询文章列表
+ * @param $site_id
+ * @return array
+ */
+ public function getFllesPageLinkList($site_id)
+ {
+ // $article_model = new ArticleModel();
+ // $condition = [ [ 'site_id', '=', $site_id ], [ 'status', '=', 1 ] ];
+ // $site_diy_view_list = $article_model->getArticleList($condition,'*', 'create_time desc', 100);
+ $files_list = model('files')->getList( [ [ 'site_id', '=', $site_id ] ]);
+
+ $link_mic = [
+ 'name' => 'FILES_LIST',
+ 'title' => '文件列表',
+ 'parent' => 'FILES_LIST_PAGE',
+ 'child_list' => []
+ ];
+ foreach ($files_list as $page_k => $page_v) {
+ $link_mic[ 'child_list' ][] = [
+ 'name' => 'FILES_'.$page_v[ 'files_id' ],
+ 'title' => $page_v[ 'files_title' ],
+ 'parent' => 'FILES_LIST',
+ 'wap_url' => '/pages_tool/files/detail?files_id=' . $page_v[ 'files_id' ]
+ ];
+ }
+
+ return $this->success($link_mic);
+ }
+ /**
+ * 查询文件分类列表
+ * @param $site_id
+ * @return array
+ */
+ public function getFllesCateGoryPageLinkList($site_id)
+ {
+ $cate_gorylist = model('files_category')->getList( [ [ 'site_id', '=', $site_id ] ]);
+ $link_mic = [
+ 'name' => 'FILESCATEGORY_LIST',
+ 'title' => '文件分类',
+ 'parent' => 'FILES_CATE_PAGE',
+ 'child_list' => []
+ ];
+ foreach ($cate_gorylist as $page_k => $page_v) {
+ $link_mic[ 'child_list' ][] = [
+ 'name' => 'FILES_CATEGORY_'.$page_v[ 'id' ],
+ 'title' => $page_v[ 'category_name' ],
+ 'parent' => 'FILES_CATEGORY_LIST',
+ 'wap_url' => '/pages_tool/files/list?category_id=' . $page_v[ 'id' ]
+ ];
+ }
+ return $this->success($link_mic);
+ }
+
/**
* 查询文章分类列表
* @param $site_id
diff --git a/src/app/shop/controller/BaseShop.php b/src/app/shop/controller/BaseShop.php
index 874e8dd34..a502904c7 100644
--- a/src/app/shop/controller/BaseShop.php
+++ b/src/app/shop/controller/BaseShop.php
@@ -123,11 +123,12 @@ class BaseShop extends Controller
$config_view = Config::get('view');
$config_view[ 'tpl_replace_string' ] = array_merge($config_view[ 'tpl_replace_string' ], $this->replace);
Config::set($config_view, 'view');
- // 其他操作
+
if (!request()->isAjax()) {
$this->initBaseInfo();
$this->loadTemplate();
}
+
}
/**
diff --git a/src/app/shop/controller/Goods.php b/src/app/shop/controller/Goods.php
index 8f4e59212..863622c24 100644
--- a/src/app/shop/controller/Goods.php
+++ b/src/app/shop/controller/Goods.php
@@ -1907,6 +1907,7 @@ class Goods extends BaseShop
if ($data[ 'code' ] < 0) {
return $data;
}
+
$result = ( new GoodsImport() )->importGoods($data[ 'data' ], $this->site_id, $type);
return $result;
} else {
diff --git a/src/app/shop/controller/Index.php b/src/app/shop/controller/Index.php
index c63d2d83b..81b4178f1 100644
--- a/src/app/shop/controller/Index.php
+++ b/src/app/shop/controller/Index.php
@@ -35,6 +35,7 @@ class Index extends BaseShop
*/
public function index()
{
+
$this->assign('shop_status', 1);
$this->handlePromotion();
diff --git a/src/app/shop/controller/Member.php b/src/app/shop/controller/Member.php
index d714ae9be..460007d13 100644
--- a/src/app/shop/controller/Member.php
+++ b/src/app/shop/controller/Member.php
@@ -25,6 +25,62 @@ use addon\coupon\model\Coupon as CouponModel;
*/
class Member extends BaseShop
{
+
+
+
+
+ public function business(){
+
+ $member = new MemberModel();
+ if (request()->isJson()) {
+ $page = input('page', 1);
+ $page_size = input('page_size', PAGE_LIST_ROWS);
+ $search_text = input('search_keys', '');
+
+ $condition = [];
+ if (!empty($search_text)) {
+ $condition[] = [ 'name', 'like', '%' . $search_text . '%' ];
+ }
+
+ return $member->getBusinessPageList($condition, $page, $page_size,'id desc');
+ } else {
+ return $this->fetch('member/business');
+
+ }
+ }
+
+ /**
+ * 添加/编辑
+ */
+ public function businesspost()
+ {
+ $member = new MemberModel();
+ if (request()->isJson()) {
+ $id = input('id', 0);
+ $data = [
+ 'realname' => input('realname', ''),
+ ];
+ if($id>0){
+ $res = model('business')->update($data,['id'=>$id]);
+ }else{
+ $res = model('business')->add($data);
+ }
+ return $member->success($res);
+ }
+ }
+
+ /**
+ * 删除
+ */
+ public function businessdelete()
+ {
+ $member = new MemberModel();
+ if (request()->isJson()) {
+ $id = input('id', 0);
+ $result = model('business')->delete([['id', '=', $id]]);
+ return $member->success($result);
+ }
+ }
/*
* 会员概况
*/
diff --git a/src/app/shop/controller/Order.php b/src/app/shop/controller/Order.php
index d69b9e415..0823c10a0 100644
--- a/src/app/shop/controller/Order.php
+++ b/src/app/shop/controller/Order.php
@@ -104,7 +104,7 @@ class Order extends BaseShop
a.invoice_type,a.invoice_title,a.taxpayer_number,a.invoice_rate,a.invoice_content,a.invoice_delivery_money,a.invoice_full_address,a.is_tax_invoice,a.invoice_email,a.invoice_title_type,a.is_fenxiao,
a.point_money,a.member_card_money,a.member_card_order,a.invoice_status,a.invoice_remark,a.invoice_code,a.invoice_image,a.invoice_time,a.predict_delivery_time,a.is_video_number,a.close_cause,
a.cashier_order_type,a.cashier_sell_time,a.cashier_operator_id,a.cashier_operator_name,a.balance,a.total_balance,a.store_id,a.reduction,a.round_money,a.order_scene,
- a.store_commission_rate,a.store_commission,s.store_name,a.merch_id';
+ a.store_commission_rate,a.store_commission,s.store_name,a.merch_id,a.business';
$order_common_model = new OrderCommonModel();
if (request()->isJson()) {
$page_index = input('page', 1);
diff --git a/src/app/shop/view/goods/edit_goods.html b/src/app/shop/view/goods/edit_goods.html
index 6a961cc61..a08f4b420 100644
--- a/src/app/shop/view/goods/edit_goods.html
+++ b/src/app/shop/view/goods/edit_goods.html
@@ -548,6 +548,30 @@