hwq 1 سال پیش
والد
کامیت
9ccee9b0cf

+ 1 - 1
src/api/shop_setting.js

@@ -19,7 +19,7 @@ import {
  */
 export function headerListApi(data) {
 	return request({
-		url: 'setting/config/header_basics',
+		url: 'mer/setting/config/header_basics',
 		method: 'get',
 		params: data,
 	});

+ 2 - 1
src/components/uploadPictures2/index.vue

@@ -453,7 +453,7 @@
 				};
 				let delfromData = {
 					title: '删除选中图片',
-					url: `file/file/delete`,
+					url: `mer/file/file/delete`,
 					method: 'POST',
 					ids: ids,
 				};
@@ -683,6 +683,7 @@
 			},
 			// 点击使用选中图片
 			checkPics() {
+				console.log(this.isChoice, '进入');
 				if (this.isChoice === '单选') {
 					if (this.checkPicList.length > 1) return this.$Message.warning('最多只能选一张图片');
 					this.$emit('getPic', this.checkPicList[0]);

+ 1 - 0
src/layout/component/columnsAside.vue

@@ -95,6 +95,7 @@
 					path,
 					redirect
 				} = v;
+				console.log(path, 'path')
 				if (path) this.$router.push(path);
 				else this.$router.push(path);
 				// 一个路由设置自动收起菜单

+ 107 - 9
src/pages/shop/shop.vue

@@ -31,7 +31,7 @@
 					</FormItem>
 					</Col>
 					<Col v-bind="grid">
-					<FormItem label="商搜索:" label-for="store_name">
+					<FormItem label="商搜索:" label-for="store_name">
 						<Input search enter-button placeholder="请输入商品名称/关键字/ID" v-model="artFrom.store_name"
 							@on-search="userSearchs" />
 					</FormItem>
@@ -64,8 +64,8 @@
 					</i-switch>
 				</template>
 				<template slot-scope="{ row, index }" slot="action">
-					<a @click="onLogo(row)">登录</a>
-					<Divider type="vertical" />
+					<!-- <a @click="onLogo(row)">登录</a>
+					<Divider type="vertical" /> -->
 					<a @click="edit(row)">编辑</a>
 					<Divider type="vertical" />
 					<a @click="openPwd(row)">修改密码</a>
@@ -108,14 +108,40 @@
 				<FormItem label="商户地址:" label-for="mer_address" prop="mer_address">
 					<Input placeholder="请输入商户地址" v-model="formInline.mer_address" />
 				</FormItem>
-				<FormItem label="商户关键字:" label-for="mer_keyword" prop="mer_keyword">
-					<Input placeholder="请输入商户关键字" v-model="formInline.mer_keyword" />
+				<FormItem label="商户简介:" label-for="introduction" prop="introduction">
+					<Input placeholder="请输入商户简介" v-model="formInline.introduction" />
+				</FormItem>
+				<FormItem label="身份证:" label-for="Idcard" prop="Idcard">
+					<Input placeholder="请输入身份证" v-model="formInline.Idcard" />
+				</FormItem>
+				<FormItem label="店铺logo" prop="image">
+					<div class="acea-row">
+						<div class="upLoad acea-row row-center-wrapper" @click="modalPicTap('image')">
+							<Icon v-if="!formInline.image" type="ios-camera-outline" size="26" />
+							<img style="width: 100px;height: 100px;" v-else v-lazy="formInline.image" />
+						</div>
+						<Input v-model="formInline.image" style="display: none"></Input>
+					</div>
+				</FormItem>
+				<FormItem label="门头照片" prop="shopImg">
+					<div class="acea-row">
+						<div class="upLoad acea-row row-center-wrapper" @click="modalPicTap('shopImg')">
+							<Icon v-if="!formInline.shopImg" type="ios-camera-outline" size="26" />
+							<img style="width: 100px;height: 100px;" v-else v-lazy="formInline.shopImg" />
+						</div>
+						<Input v-model="formInline.shopImg" style="display: none"></Input>
+					</div>
 				</FormItem>
 
 				<Button type="primary" size="large" long @click="handleSubmit('formInline')">提交</Button>
 
 			</Form>
 		</Modal>
+		<Modal v-model="modalPic" width="1024px" scrollable footer-hide closable title="上传商品图" :mask-closable="false"
+			:z-index="1">
+			<uploadPictures :isChoice="isChoice" @getPic="getPic" :gridBtn="gridBtn" :gridPic="gridPic" v-if="modalPic">
+			</uploadPictures>
+		</Modal>
 		<!-- 修改密码 -->
 		<Modal v-model="pwd" @on-cancel="onCancel" scrollable footer-hide closable title="修改密码" :mask-closable="false"
 			width="700">
@@ -142,7 +168,7 @@
 	import {
 		exportProductList
 	} from '@/api/export';
-
+	import uploadPictures from '@/components/uploadPictures';
 	import {
 		merchentlist,
 		getmerchent,
@@ -158,9 +184,19 @@
 	import {
 		setCookies
 	} from '@/libs/util';
+	import {
+		PrevLoading
+	} from '@/utils/loading.js';
+	import {
+		formatFlatteningRoutes,
+		findFirstNonNullChildren
+	} from '@/libs/system';
 	import SettingMer from "@/libs/settingMer";
 	export default {
 		name: 'shop_list',
+		components: {
+			uploadPictures
+		},
 		computed: {
 			...mapState('userLevel', ['categoryId']),
 			labelPosition2() {
@@ -177,6 +213,20 @@
 					sm: 24,
 					xs: 24,
 				},
+				gridBtn: {
+					xl: 4,
+					lg: 8,
+					md: 8,
+					sm: 8,
+					xs: 8,
+				},
+				gridPic: {
+					xl: 6,
+					lg: 8,
+					md: 12,
+					sm: 12,
+					xs: 12,
+				},
 				artFrom: {
 					page: 1,
 					limit: 10,
@@ -190,6 +240,7 @@
 				classifySelect: [],
 				typeSelect: [],
 				loading: false,
+				isChoice: '单选',
 				columns: [{
 						title: '商户ID',
 						key: 'mer_id',
@@ -227,7 +278,7 @@
 					},
 					{
 						title: '商户简介',
-						key: 'mer_info',
+						key: 'introduction',
 						minWidth: 150,
 					},
 					{
@@ -273,6 +324,7 @@
 				isProductBox: false,
 				treeSelect: [],
 				modals: false,
+				modalPic: false,
 				pwd: false,
 				modelTit: '',
 				formInline: {
@@ -284,7 +336,10 @@
 					pwd: '',
 					mer_phone: '',
 					mer_address: '',
-					mer_keyword: ''
+					Idcard: '',
+					introduction: '',
+					shopImg: '',
+					image: '',
 				},
 				pwdinfo: {
 					pwd: '',
@@ -343,7 +398,7 @@
 						message: '请输入商户地址',
 						trigger: 'blur'
 					}],
-					mer_keyword: [{
+					introduction: [{
 						required: true,
 						message: '请输入商户关键字',
 						trigger: 'blur'
@@ -373,9 +428,30 @@
 			}
 		},
 		methods: {
+			modalPicTap(picTit) {
+				this.modalPic = true;
+				this.modals = false;
+				this.picTit = picTit;
+			},
+			formatTwoStageRoutes(arr) {
+				if (arr.length <= 0) return false;
+				const newArr = [];
+				const cacheList = [];
+				arr.forEach((v) => {
+					if (v && v.meta && v.meta.keepAlive) {
+						newArr.push({
+							...v
+						});
+						cacheList.push(v.name);
+						this.$store.dispatch('keepAliveNames/setCacheKeepAlive', cacheList);
+					}
+				});
+				return newArr;
+			},
 			onLogo(row) {
 				merchantLoginApi({}, row.mer_id)
 					.then(res => {
+						console.log(res, 'rens');
 						let data = res.data;
 						let expires = this.getExpiresTime(data.expires_time);
 						// 记录用户登陆信息
@@ -405,10 +481,17 @@
 						this.$store.commit('userInfo/version', data.version);
 						this.$store.commit('userInfo/newOrderAudioLink', data.newOrderAudioLink);
 						this.login_captcha = 0;
+						PrevLoading.start();
+						return this.$router.push({
+							path: findFirstNonNullChildren(res.data.menus).path || this.$routeProStrshop +
+								'/',
+						});
+						setTimeout(location.reload(), 3000)
 					})
 					.catch(res => {
 						this.$message.error(res.message);
 					});
+
 			},
 			getExpiresTime(expiresTime) {
 				let nowTimeNum = Math.round(new Date() / 1000);
@@ -420,6 +503,21 @@
 				const res = new Map();
 				return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
 			},
+			getPic(pc) {
+				console.log(pc, 'info');
+				switch (this.picTit) {
+					case 'image':
+						this.formInline.image = pc.att_dir;
+						break;
+					case 'shopImg':
+						this.formInline.shopImg = pc.att_dir;
+						break;
+					default:
+				}
+				console.log(this.formInline, '');
+				this.modalPic = false;
+				this.modals = true;
+			},
 			getPath() {
 				this.columns2 = [...this.columns];
 				if (name !== '1' && name !== '2') {

+ 1 - 1
src/pages/shop_product/productAdd/index.vue

@@ -478,7 +478,7 @@
 									{{ item.name }}
 								</Option>
 							</Select>
-							<span class="addfont" @click="addTemp">新增运费模板</span>
+							<!-- <span class="addfont" @click="addTemp">新增运费模板</span> -->
 						</div>
 					</FormItem>
 					</Col>

+ 1 - 1
src/pages/shop_product/productAttr/index.vue

@@ -167,7 +167,7 @@
 				let delfromData = {
 					title: tit,
 					num: 0,
-					url: `product/product/rule/delete`,
+					url: `mer/product/rule/delete`,
 					method: 'DELETE',
 					ids: data,
 				};

+ 227 - 227
src/pages/shop_setting/setSystem/index.vue

@@ -1,236 +1,236 @@
 <template>
-  <div>
-    <div class="i-layout-page-header header-title" v-if="!headerList.length">
-      <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
-    </div>
-    <div class="article-manager">
-      <Card :bordered="false" dis-hover class="ivu-mt fromBox">
-        <Tabs v-model="currentTab" @on-click="changeTab" v-if="headerList.length">
-          <TabPane
-            :icon="item.icon"
-            :label="item.label"
-            :name="item.value.toString()"
-            v-for="(item, index) in headerList"
-            :key="index"
-          />
-        </Tabs>
-        <Tabs type="card" v-model="childrenId" v-if="headerChildrenList.length" @on-click="changeChildrenTab">
-          <TabPane
-            :label="item.label"
-            :name="item.id.toString()"
-            v-for="(item, index) in headerChildrenList"
-            :key="index"
-          ></TabPane>
-        </Tabs>
-        <form-create :option="option" :rule="rules" @submit="onSubmit" v-if="rules.length !== 0"></form-create>
-        <Spin size="large" fix v-if="spinShow"></Spin>
-      </Card>
-    </div>
-  </div>
+	<div>
+		<div class="i-layout-page-header header-title" v-if="!headerList.length">
+			<span class="ivu-page-header-title">{{ $route.meta.title }}</span>
+		</div>
+		<div class="article-manager">
+			<Card :bordered="false" dis-hover class="ivu-mt fromBox">
+				<Tabs v-model="currentTab" @on-click="changeTab" v-if="headerList.length">
+					<TabPane :icon="item.icon" :label="item.label" :name="item.value.toString()"
+						v-for="(item, index) in headerList" :key="index" />
+				</Tabs>
+				<Tabs type="card" v-model="childrenId" v-if="headerChildrenList.length" @on-click="changeChildrenTab">
+					<TabPane :label="item.label" :name="item.id.toString()" v-for="(item, index) in headerChildrenList"
+						:key="index"></TabPane>
+				</Tabs>
+				<form-create :option="option" :rule="rules" @submit="onSubmit" v-if="rules.length !== 0"></form-create>
+				<Spin size="large" fix v-if="spinShow"></Spin>
+			</Card>
+		</div>
+	</div>
 </template>
 
 <script>
-import formCreate from '@form-create/iview';
-import { headerListApi, dataFromApi } from '@/api/setting';
-import request from '@/libs/request';
-import { getLogo } from '@/api/common';
-export default {
-  name: 'setting_setSystem',
-  components: { formCreate: formCreate.$form() },
-  data() {
-    return {
-      rules: [],
-      option: {
-        form: {
-          labelWidth: 185,
-        },
-        submitBtn: {
-          col: {
-            span: 3,
-            push: 3,
-          },
-        },
-        global: {
-          upload: {
-            props: {
-              onSuccess(res, file) {
-                if (res.status === 200) {
-                  file.url = res.data.src;
-                } else {
-                  this.$Message.error(res.msg);
-                }
-              },
-            },
-          },
-          frame: {
-            props: {
-              closeBtn: false,
-              okBtn: false,
-            },
-          },
-        },
-      },
-      spinShow: false,
-      FromData: null,
-      currentTab: '',
-      headerList: [],
-      headerChildrenList: [],
-      childrenId: '',
-      title: '',
-    };
-  },
-  created() {
-    this.getAllData();
-  },
-  watch: {
-    $route(to, from) {
-      this.headerChildrenList = [];
-      this.getAllData();
-    },
-    childrenId() {
-      this.getFrom();
-    },
-  },
-  methods: {
-    childrenList(index) {
-      let that = this;
-      that.headerList.forEach(function (item) {
-        if (item.value.toString() === that.currentTab) {
-          if (item.children === undefined) {
-            that.childrenId = item.id;
-            that.headerChildrenList = [];
-          } else {
-            that.headerChildrenList = item.children;
-            that.childrenId = item.children.length ? item.children[index ? index : 0].id.toString() : '';
-          }
-        }
-      });
-    },
-    // 头部tab
-    getHeader(index) {
-      this.spinShow = true;
-      return new Promise((resolve, reject) => {
-        let tab_id = this.$route.params.tab_id;
-        let data = {
-          type: this.$route.params.type ? this.$route.params.type : 0,
-          pid: tab_id ? tab_id : 0,
-        };
-        headerListApi(data)
-          .then(async (res) => {
-            let config = res.data.config_tab;
-            this.headerList = config;
-            this.currentTab = config[index ? index : 0].value.toString();
-            this.childrenList(index ? 1 : 0);
-            resolve(this.currentTab);
-            this.spinShow = false;
-          })
-          .catch((err) => {
-            this.spinShow = false;
-            this.$Message.error(err);
-          });
-      });
-    },
-    // 表单
-    getFrom() {
-      this.spinShow = true;
-      return new Promise((resolve, reject) => {
-        let ids = '';
-        if (this.$route.params.type === '3') {
-          ids = this.$route.params.tab_id;
-        } else {
-          if (this.childrenId) {
-            ids = this.childrenId;
-          } else {
-            ids = this.currentTab;
-          }
-        }
-        let data = {
-          tab_id: Number(ids),
-        };
-        let logistics = 'freight/config/edit_basics',
-          agent = 'agent/config/edit_basics',
-          integral = 'marketing/integral_config/edit_basics',
-          sms = 'serve/sms_config/edit_basics',
-          config = 'setting/config/edit_basics';
-        let url =
-          this.$route.name === 'setting_logistics'
-            ? logistics
-            : this.$route.name === 'setting_distributionSet'
-            ? agent
-            : this.$route.name === 'setting_message'
-            ? sms
-            : this.$route.name === 'setting_setSystem'
-            ? config
-            : integral;
-        dataFromApi(data, url)
-          .then(async (res) => {
-            this.spinShow = false;
-            if (res.data.status === false) {
-              return this.$authLapse(res.data);
-            }
-            this.FromData = res.data;
-            this.rules = res.data.rules;
-            this.title = res.data.title;
-          })
-          .catch((res) => {
-            this.spinShow = false;
-            this.$Message.error(res.msg);
-          });
-      });
-    },
-    async getAllData() {
-      if (this.$route.query.from === 'download') {
-        await this.getHeader(2);
-      } else if (this.$route.params.type !== '3') {
-        this.childrenId = '';
-        await this.getHeader();
-      } else {
-        this.headerList = [];
-        this.getFrom();
-      }
-    },
-    // 选择
-    changeTab() {
-      this.childrenList();
-    },
-    // 二级选择
-    changeChildrenTab(name) {
-      this.childrenId = name;
-    },
-    // 提交表单 group
-    onSubmit(formData) {
-      request({
-        url: this.FromData.action,
-        method: this.FromData.method,
-        data: formData,
-      })
-        .then((res) => {
-          this.$Message.success(res.msg);
-          if (formData.site_name) {
-            localStorage.setItem('ADMIN_TITLE', formData.site_name);
-            this.$store.commit('setAdminTitle', formData.site_name);
-            window.document.title = `${formData.site_name} - 系统设置`;
-          }
-        })
-        .catch((res) => {
-          this.$Message.error(res.msg);
-        });
-    },
-  },
-};
+	import formCreate from '@form-create/iview';
+	import {
+		headerListApi,
+		dataFromApi
+	} from '@/api/setting';
+	import request from '@/libs/request';
+	import {
+		getLogo
+	} from '@/api/common';
+	export default {
+		name: 'setting_setSystem',
+		components: {
+			formCreate: formCreate.$form()
+		},
+		data() {
+			return {
+				rules: [],
+				option: {
+					form: {
+						labelWidth: 185,
+					},
+					submitBtn: {
+						col: {
+							span: 3,
+							push: 3,
+						},
+					},
+					global: {
+						upload: {
+							props: {
+								onSuccess(res, file) {
+									if (res.status === 200) {
+										file.url = res.data.src;
+									} else {
+										this.$Message.error(res.msg);
+									}
+								},
+							},
+						},
+						frame: {
+							props: {
+								closeBtn: false,
+								okBtn: false,
+							},
+						},
+					},
+				},
+				spinShow: false,
+				FromData: null,
+				currentTab: '',
+				headerList: [],
+				headerChildrenList: [],
+				childrenId: '',
+				title: '',
+			};
+		},
+		created() {
+			this.getAllData();
+		},
+		watch: {
+			$route(to, from) {
+				this.headerChildrenList = [];
+				this.getAllData();
+			},
+			childrenId() {
+				this.getFrom();
+			},
+		},
+		methods: {
+			childrenList(index) {
+				let that = this;
+				that.headerList.forEach(function(item) {
+					if (item.value.toString() === that.currentTab) {
+						if (item.children === undefined) {
+							that.childrenId = item.id;
+							that.headerChildrenList = [];
+						} else {
+							that.headerChildrenList = item.children;
+							that.childrenId = item.children.length ? item.children[index ? index : 0].id
+							.toString() : '';
+						}
+					}
+				});
+			},
+			// 头部tab
+			getHeader(index) {
+				this.spinShow = true;
+				return new Promise((resolve, reject) => {
+					let tab_id = this.$route.params.tab_id;
+					let data = {
+						type: this.$route.params.type ? this.$route.params.type : 0,
+						pid: tab_id ? tab_id : 0,
+					};
+					console.log(data, 'info');
+					headerListApi(data)
+						.then(async (res) => {
+							let config = res.data.config_tab;
+							this.headerList = config;
+							this.currentTab = config[index ? index : 0].value.toString();
+							this.childrenList(index ? 1 : 0);
+							resolve(this.currentTab);
+							this.spinShow = false;
+						})
+						.catch((err) => {
+							this.spinShow = false;
+							this.$Message.error(err);
+						});
+				});
+			},
+			// 表单
+			getFrom() {
+				this.spinShow = true;
+				return new Promise((resolve, reject) => {
+					let ids = '';
+					if (this.$route.params.type === '3') {
+						ids = this.$route.params.tab_id;
+					} else {
+						if (this.childrenId) {
+							ids = this.childrenId;
+						} else {
+							ids = this.currentTab;
+						}
+					}
+					let data = {
+						tab_id: Number(ids),
+					};
+					let logistics = 'freight/config/edit_basics',
+						agent = 'agent/config/edit_basics',
+						integral = 'marketing/integral_config/edit_basics',
+						sms = 'serve/sms_config/edit_basics',
+						config = 'setting/config/edit_basics';
+					let url =
+						this.$route.name === 'setting_logistics' ?
+						logistics :
+						this.$route.name === 'setting_distributionSet' ?
+						agent :
+						this.$route.name === 'setting_message' ?
+						sms :
+						this.$route.name === 'setting_setSystem' ?
+						config :
+						integral;
+					dataFromApi(data, url)
+						.then(async (res) => {
+							this.spinShow = false;
+							if (res.data.status === false) {
+								return this.$authLapse(res.data);
+							}
+							this.FromData = res.data;
+							this.rules = res.data.rules;
+							this.title = res.data.title;
+						})
+						.catch((res) => {
+							this.spinShow = false;
+							this.$Message.error(res.msg);
+						});
+				});
+			},
+			async getAllData() {
+				if (this.$route.query.from === 'download') {
+					await this.getHeader(2);
+				} else if (this.$route.params.type !== '3') {
+					this.childrenId = '';
+					await this.getHeader();
+				} else {
+					this.headerList = [];
+					this.getFrom();
+				}
+			},
+			// 选择
+			changeTab() {
+				this.childrenList();
+			},
+			// 二级选择
+			changeChildrenTab(name) {
+				this.childrenId = name;
+			},
+			// 提交表单 group
+			onSubmit(formData) {
+				request({
+						url: this.FromData.action,
+						method: this.FromData.method,
+						data: formData,
+					})
+					.then((res) => {
+						this.$Message.success(res.msg);
+						if (formData.site_name) {
+							localStorage.setItem('ADMIN_TITLE', formData.site_name);
+							this.$store.commit('setAdminTitle', formData.site_name);
+							window.document.title = `${formData.site_name} - 系统设置`;
+						}
+					})
+					.catch((res) => {
+						this.$Message.error(res.msg);
+					});
+			},
+		},
+	};
 </script>
 
 <style scoped lang="stylus">
-.ivu-tabs {
-  margin-bottom: 18px;
-}
+	.ivu-tabs {
+		margin-bottom: 18px;
+	}
 
-.fromBox {
-  min-height: calc(100vh - 200px);
-  margin-top: 0px !important;
-}
+	.fromBox {
+		min-height: calc(100vh - 200px);
+		margin-top: 0px !important;
+	}
 
-.article-manager /deep/ .ivu-form-item {
-  margin-bottom: 20px !important;
-}
-</style>
+	.article-manager /deep/ .ivu-form-item {
+		margin-bottom: 20px !important;
+	}
+</style>