diff --git a/.drone.yml b/.drone.yml index e8452cb..cd4ec61 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ name: build steps: - name: build - image: node:18.20.3-alpine + image: docker.linbin.site/node:18.20.3-alpine pull: if-not-exists volumes: - name: cache @@ -12,26 +12,27 @@ steps: - name: node-build path: /app/build commands: ## 此处自己定义项目工程的构建命令 - - npm install -g pnpm + - npm install -g pnpm --registry=https://registry.npmmirror.com + - pnpm config set registry https://registry.npmmirror.com - pnpm i - pnpm run build:prod - ls -l - cp -r dist /app/build/ when: ## 定义在什么情况下触发构建任务 branch: master #定义在哪个分支触发构建任务 - - name: scp - image: appleboy/drone-scp - volumes: - - name: node-build - path: /app/build - settings: - host: 60.204.138.3 - username: root - password: 5xhqamyZ - port: 22 - target: /data/app/dmjs-merchant-admin - source: /app/build/dist - overwrite: true +# - name: scp +# image: appleboy/drone-scp +# volumes: +# - name: node-build +# path: /app/build +# settings: +# host: 60.204.138.3 +# username: root +# password: 5xhqamyZ +# port: 22 +# target: /data/app/dmjs-merchant-admin +# source: /app/build/dist +# overwrite: true volumes: - name: node-build host: diff --git a/public/config/index-prod.js b/public/config/index-prod.js index 7ce89d8..6096255 100644 --- a/public/config/index-prod.js +++ b/public/config/index-prod.js @@ -9,14 +9,15 @@ /** * 生产环境 */ -;(function () { +(function () { window.SITE_CONFIG = {}; // 在线api接口请求地址 - window.SITE_CONFIG['baseUrl'] ="https://admin-test.damajishi.cn" + window.SITE_CONFIG["baseUrl"] = "https://admin-test.damajishi.cn/"; // cdn地址 = 域名 + 版本号 - window.SITE_CONFIG['domain'] = './'; // 域名 - window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分) - window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version; + window.SITE_CONFIG["domain"] = "./"; // 域名 + window.SITE_CONFIG["version"] = ""; // 版本号(年月日时分) + window.SITE_CONFIG["cdnUrl"] = + window.SITE_CONFIG.domain + window.SITE_CONFIG.version; })(); diff --git a/public/config/index.js b/public/config/index.js index 5e4df22..415da64 100644 --- a/public/config/index.js +++ b/public/config/index.js @@ -9,16 +9,18 @@ /** * 开发环境 */ -;(function () { +(function () { window.SITE_CONFIG = {}; // api接口请求地址 - window.SITE_CONFIG['baseUrl'] ="http://admin-test.damajishi.cn:8899" - // 在线api接口请求地址 + window.SITE_CONFIG["baseUrl"] = "https://admin-test.damajishi.cn/"; + // 在线api接口请求地址 // window.SITE_CONFIG['baseUrl'] = 'http://119.29.103.250:8082/red-memory'; - // 在线api接口请求地址 - window.SITE_CONFIG['baseUrlComment'] = 'http://123.60.109.11:8081/red-memory-user'; + // 在线api接口请求地址 + window.SITE_CONFIG["baseUrlComment"] = + "http://123.60.109.11:8081/red-memory-user"; // cdn地址 = 域名 + 版本号 - window.SITE_CONFIG['domain'] = './'; // 域名 - window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分) - window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version; + window.SITE_CONFIG["domain"] = "./"; // 域名 + window.SITE_CONFIG["version"] = ""; // 版本号(年月日时分) + window.SITE_CONFIG["cdnUrl"] = + window.SITE_CONFIG.domain + window.SITE_CONFIG.version; })(); diff --git a/src/api/modules/common.js b/src/api/modules/common.js index 930cbe0..0d5c907 100644 --- a/src/api/modules/common.js +++ b/src/api/modules/common.js @@ -15,7 +15,7 @@ export const password = (password, newPassword) => { // 退出登录 export const logout = () => { return $http({ - url: '/auth/logout', + url: '/merchant-api/auth/logout', method: 'post', data: $http.adornData() }) diff --git a/src/api/modules/mer_admin.js b/src/api/modules/mer_admin.js index 6948e3a..ad3bcd0 100644 --- a/src/api/modules/mer_admin.js +++ b/src/api/modules/mer_admin.js @@ -3,124 +3,163 @@ import city_data from "@/utils/country-level2-data.js"; import qs from "qs"; export const mer_admin = { - /** - * 登录 - * @param {object} params LoginParam - * @param {number} params.type - * @param {string} params.role - * @param {string} params.username - * @param {string} params.password - * @param {string} params.mobile - * @param {string} params.code - * @returns - */ - loginByAccount: (params) => { - return $http.post(`/auth/login`, { - ...params, - type: 1 - }) - }, - loginByMobile: (params) => { - return $http.post(`/merchant-api/auth/sms/login`, { - ...params, - type: 2 - }) - }, - getYZM(mobile) { - return $http.get(`/merchant-api/auth/login/code?mobile=${mobile}`); - }, - getInfo() { - return $http.get(`/merchant-api/auth/info`); - }, - //商品管理 - //保存商品信息 - saveProduct: (data) => { - return $http.post(`/merchant-api/product/save`, data); - }, - //保存商品基本信息 - saveProductBase: (data) => { - return $http.post(`/merchant-api/product/save/basic`, data); - }, - //返回商品分类以及列表(聚合) - getPolyProduct: (data) => { - return $http.post(`/merchant-api/product/polymerization/list`, data); - }, - //商品分页 - getProductPage: (data) => { - return $http.post(`/merchant-api/product/page`, data); - }, - //商户商品分类 - getProductCategory: () => { - return $http.get(`/merchant-api/product/category/list?shopId=${JSON.parse(sessionStorage.getItem('userInfo')).shopId}`); - }, - //上架或下架 - putOnShelvesProducts: (data) => { - return $http.post(`/merchant-api/product/batch/update/status`, data); - }, - //批量删除商品 - BatchDeleteProducts: (data) => { - return $http.post(`/merchant-api/product/batch/delete`, data); - }, - //打折扣 - setDiscounts: (data) => { - return $http.post(`merchant-api/activity/save`, data); - }, - //获取销售单位 - getSaleUnit: (data) => { - return $http.request({ url: `/merchant-api/product/unit/list`, method: 'get', params: data }); - }, - //文件上传 - uploadFile: () => { - return `${window.SITE_CONFIG['baseUrl']}/merchant-api/file/upload` - }, - //直接获取城市数据 - getCityOptions: () => { - return city_data; - }, - //省市县数据 - getCity: () => { - return $http.get(`/merchant-api/common/pca`); - }, - //添加运费模板 - addShippingTemplate: (data) => { - return $http.post(`/merchant-api/shippingTemplates/add`, data); - }, - //删除模板 - removeShippingTemplate: (id) => { - return $http.post(`/merchant-api/shippingTemplates/delete`, qs.stringify({ - id - }), { - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - } - }) - }, - //更新模板 - updateShippingTemplate: (data) => { - return $http.post(`/merchant-api/shippingTemplates/update`, data); - }, - //获取模板分页 - getShippingTemplatePage: (data) => { - return $http.request({ - method: 'get', - url: '/merchant-api/shippingTemplates/page', - params: data - }) - }, - //获取配送模板列表 - getShippingTemplateList: (data) => { - return $http.request({ - method: 'get', - url: '/merchant-api/shippingTemplates/list', - params: data - }) - }, - //获取模板详情 - getShippingTemplateInfo: (id) => { - return $http.request({ - method: 'get', - url: '/merchant-api/shippingTemplates/detail', - params: { id } - }) - } -} \ No newline at end of file + /** + * 登录 + * @param {object} params LoginParam + * @param {number} params.type + * @param {string} params.role + * @param {string} params.username + * @param {string} params.password + * @param {string} params.mobile + * @param {string} params.code + * @returns + */ + loginByAccount: (params) => { + return $http.post(`/merchant-api/auth/login`, { + ...params, + }); + }, + loginByMobile: (params) => { + return $http.post(`/merchant-api/auth/sms/login`, { + ...params, + type: 2, + }); + }, + getYZM(mobile) { + return $http.get(`/merchant-api/auth/login/code?mobile=${mobile}`); + }, + getInfo() { + return $http.get(`/merchant-api/auth/info`); + }, + //商品管理 + //保存商品信息 + saveProduct: (data) => { + return $http.post(`/merchant-api/product/save`, data); + }, + //保存商品基本信息 + saveProductBase: (data) => { + return $http.post(`/merchant-api/product/save/basic`, data); + }, + //返回商品分类以及列表(聚合) + getPolyProduct: (data) => { + return $http.post(`/merchant-api/product/polymerization/list`, data); + }, + //商品分页 + getProductPage: (data) => { + return $http.post(`/merchant-api/product/page`, data); + }, + //商户商品分类 + getProductCategory: () => { + return $http.get( + `/merchant-api/product/category/list?shopId=${ + JSON.parse(sessionStorage.getItem("userInfo")).shopId + }` + ); + }, + //上架或下架 + putOnShelvesProducts: (data) => { + return $http.post(`/merchant-api/product/batch/update/status`, data); + }, + //批量删除商品 + BatchDeleteProducts: (data) => { + return $http.post(`/merchant-api/product/batch/delete`, data); + }, + //打折扣 + setDiscounts: (data) => { + return $http.post(`merchant-api/activity/save`, data); + }, + //获取销售单位 + getSaleUnit: (data) => { + return $http.request({ + url: `/merchant-api/product/unit/list`, + method: "get", + params: data, + }); + }, + //文件上传 + uploadFile: () => { + return `${window.SITE_CONFIG["baseUrl"]}/merchant-api/file/upload`; + }, + //直接获取城市数据 + getCityOptions: () => { + return city_data; + }, + //省市县数据 + getCity: () => { + return $http.get(`/merchant-api/common/pca`); + }, + //添加运费模板 + addShippingTemplate: (data) => { + return $http.post(`/merchant-api/shippingTemplates/add`, data); + }, + //删除模板 + removeShippingTemplate: (id) => { + return $http.post( + `/merchant-api/shippingTemplates/delete`, + qs.stringify({ + id, + }), + { + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + } + ); + }, + //更新模板 + updateShippingTemplate: (data) => { + return $http.post(`/merchant-api/shippingTemplates/update`, data); + }, + //获取模板分页 + getShippingTemplatePage: (data) => { + return $http.request({ + method: "get", + url: "/merchant-api/shippingTemplates/page", + params: data, + }); + }, + //获取配送模板列表 + getShippingTemplateList: (data) => { + return $http.request({ + method: "get", + url: "/merchant-api/shippingTemplates/list", + params: data, + }); + }, + //获取模板详情 + getShippingTemplateInfo: (id) => { + return $http.request({ + method: "get", + url: "/merchant-api/shippingTemplates/detail", + params: { id }, + }); + }, + //银行卡分页 + bankCardPage: (data) => { + return $http.request({ + method: "get", + url: "/merchant-api/bank/page", + params: data, + }); + }, + //添加商家端银行卡 + bankCardAdd: (data) => { + return $http.post(`/merchant-api/bank/com-create`, data); + }, + //获取银行卡详情 + bankCardDetail: (id) => { + return $http.request({ + method: "get", + url: "/merchant-api/bank/detail", + params: { id }, + }); + }, + //获取品牌信息 + getBrandInfo: () => { + return $http.request({ + method: "get", + url: `/merchant-api/brand/info`, + params: {}, + }); + }, +}; diff --git a/src/router/full-routers.js b/src/router/full-routers.js index 1d24baa..d307d85 100644 --- a/src/router/full-routers.js +++ b/src/router/full-routers.js @@ -1,148 +1,192 @@ import { getUUID } from "@/utils"; export default { - "msg": "success", - "menuList": [ - // { - // "menuId": 999, - // url: 'http://localhost:8082/', - // type: 'iframe', - // // isMicroApp: true, - // name: '大屏展示', - // icon: 's-data', - // "type": 1, - // }, - // new=== - //放到首页 - // { - // "menuId": getUUID(), - // "parentId": 0, - // "parentName": null, - // "name": "数据看板", - // "url": "local-dashboard/dashboard", - // "perms": "", - // "type": 1, - // "elIcon": "el-icon-data-analysis", - // "orderNum": 0, - // "open": null, - // list: [] - // }, + msg: "success", + menuList: [ + // { + // "menuId": 999, + // url: 'http://localhost:8082/', + // type: 'iframe', + // // isMicroApp: true, + // name: '大屏展示', + // icon: 's-data', + // "type": 1, + // }, + // new=== + //放到首页 + // { + // "menuId": getUUID(), + // "parentId": 0, + // "parentName": null, + // "name": "数据看板", + // "url": "local-dashboard/dashboard", + // "perms": "", + // "type": 1, + // "elIcon": "el-icon-data-analysis", + // "orderNum": 0, + // "open": null, + // list: [] + // }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "商品", + url: "local-course/resources", + perms: "", + type: 0, + elIcon: "el-icon-menu", + orderNum: 0, + open: null, + list: [ { - "menuId": getUUID(), - "parentId": 0, - "parentName": null, - "name": "商品", - "url": "local-course/resources", - "perms": "", - "type": 0, - "elIcon": "el-icon-menu", - "orderNum": 0, - "open": null, - list: [{ - "menuId": getUUID(), - "parentId": 0, - "parentName": null, - "name": "商品管理", - "url": "product/index", - "perms": "", - "type": 1, - "elIcon": "el-icon-menu", - "orderNum": 0, - "open": null, - list: [] - }] + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "商品管理", + url: "product/index", + perms: "", + type: 1, + elIcon: "el-icon-menu", + orderNum: 0, + open: null, + list: [], }, + ], + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "运费管理", + url: "", + perms: "", + type: 0, + elIcon: "el-icon-money", + orderNum: 0, + open: null, + list: [ { - "menuId": getUUID(), - "parentId": 0, - "parentName": null, - "name": "运费管理", - "url": "", - "perms": "", - "type": 0, - "elIcon": "el-icon-money", - "orderNum": 0, - "open": null, - list: [{ - "menuId": getUUID(), - "parentId": 0, - "parentName": null, - "name": "运费模板", - "url": "logistics-fare/logistics-template/index", - "perms": "", - "type": 1, - "elIcon": "el-icon-postcard", - "orderNum": 0, - "open": null, - list: [] - }] + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "运费模板", + url: "logistics-fare/logistics-template/index", + perms: "", + type: 1, + elIcon: "el-icon-postcard", + orderNum: 0, + open: null, + list: [], }, - // { - // "menuId": getUUID(), - // "parentId": 0, - // "parentName": null, - // "name": "教务管理", - // "url": "local-affairs", - // "perms": "", - // "type": 0, - // "elIcon": "el-icon-office-building", - // "orderNum": 0, - // "open": null, - // list: [ - // { - // "menuId": getUUID(), - // "parentId": 2, - // "parentName": null, - // "name": "年级管理", - // "url": "local-affairs/grade", - // "perms": "", - // "type": 1, - // "icon": "log", - // "orderNum": 0, - // "open": null, - // "list": [] - // }, - // { - // "menuId": getUUID(), - // "parentId": 2, - // "parentName": null, - // "name": "班级管理", - // "url": "local-affairs/class", - // "perms": "", - // "type": 1, - // "icon": "log", - // "orderNum": 0, - // "open": null, - // "list": [] - // }, - // { - // "menuId": getUUID(), - // "parentId": 2, - // "parentName": null, - // "name": "教师管理", - // "url": "local-teacher/teacher", - // "perms": "", - // "type": 1, - // "icon": "log", - // "orderNum": 0, - // "open": null, - // "list": [] - // }, - // { - // "menuId": getUUID(), - // "parentId": 0, - // "parentName": null, - // "name": "学校管理", - // "url": "local-school/school", - // "perms": "", - // "type": 1, - // "elIcon": "el-icon-school", - // "orderNum": 0, - // "open": null, - // list: [] - // }, - // ] - // }, - ], - "code": 0, - "permissions": [] -} \ No newline at end of file + ], + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "银行卡管理", + url: "bank-card/index", + perms: "", + type: 0, + elIcon: "el-icon-picture-outline", + orderNum: 0, + open: null, + list: [], + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "品牌管理", + url: "", + perms: "", + type: 0, + elIcon: "el-icon-money", + orderNum: 0, + open: null, + list: [ + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "品牌管理", + url: "brand/config/index", + perms: "", + type: 1, + elIcon: "el-icon-postcard", + orderNum: 0, + open: null, + list: [], + }, + ], + }, + // { + // "menuId": getUUID(), + // "parentId": 0, + // "parentName": null, + // "name": "教务管理", + // "url": "local-affairs", + // "perms": "", + // "type": 0, + // "elIcon": "el-icon-office-building", + // "orderNum": 0, + // "open": null, + // list: [ + // { + // "menuId": getUUID(), + // "parentId": 2, + // "parentName": null, + // "name": "年级管理", + // "url": "local-affairs/grade", + // "perms": "", + // "type": 1, + // "icon": "log", + // "orderNum": 0, + // "open": null, + // "list": [] + // }, + // { + // "menuId": getUUID(), + // "parentId": 2, + // "parentName": null, + // "name": "班级管理", + // "url": "local-affairs/class", + // "perms": "", + // "type": 1, + // "icon": "log", + // "orderNum": 0, + // "open": null, + // "list": [] + // }, + // { + // "menuId": getUUID(), + // "parentId": 2, + // "parentName": null, + // "name": "教师管理", + // "url": "local-teacher/teacher", + // "perms": "", + // "type": 1, + // "icon": "log", + // "orderNum": 0, + // "open": null, + // "list": [] + // }, + // { + // "menuId": getUUID(), + // "parentId": 0, + // "parentName": null, + // "name": "学校管理", + // "url": "local-school/school", + // "perms": "", + // "type": 1, + // "elIcon": "el-icon-school", + // "orderNum": 0, + // "open": null, + // list: [] + // }, + // ] + // }, + ], + code: 0, + permissions: [], +}; diff --git a/src/utils/httpRequest.js b/src/utils/httpRequest.js index b5c86fe..15b2e25 100644 --- a/src/utils/httpRequest.js +++ b/src/utils/httpRequest.js @@ -35,18 +35,18 @@ http.interceptors.request.use( config => { config.headers["token"] =`Bearer ${Vue.cookie.get("token")}`; // 请求头带上token // 针对post请求加密 - if (config.method.toLowerCase() === "post" && process.env.NODE_ENV === "production" ) { - //如果已经转成字符串了,就不用再转了 - if (typeof config.data === "string") { - config.data = des.encryptByDES(config.data, "u48rE-RlGbua_K_m$*#z99lt"); - } else { - //否则要转一次 - config.data = des.encryptByDES( - JSON.stringify(config.data), - "u48rE-RlGbua_K_m$*#z99lt" - ); - } - } + // if (config.method.toLowerCase() === "post" && process.env.NODE_ENV === "production" ) { + // //如果已经转成字符串了,就不用再转了 + // if (typeof config.data === "string") { + // config.data = des.encryptByDES(config.data, "u48rE-RlGbua_K_m$*#z99lt"); + // } else { + // //否则要转一次 + // config.data = des.encryptByDES( + // JSON.stringify(config.data), + // "u48rE-RlGbua_K_m$*#z99lt" + // ); + // } + // } if (process.env.NODE_ENV !== "production") { console.log(`【请求】${config.url}`, config); } diff --git a/src/views/common/home.vue b/src/views/common/home.vue index 470580d..0d62a09 100644 --- a/src/views/common/home.vue +++ b/src/views/common/home.vue @@ -7,13 +7,11 @@ * @FilePath: \background-front-end\src\views\common\home.vue --> diff --git a/src/views/common/login.vue b/src/views/common/login.vue index e9c01ae..ab04ccd 100644 --- a/src/views/common/login.vue +++ b/src/views/common/login.vue @@ -3,9 +3,7 @@
-

- 大妈集市商户端 -

+

大妈集市商户端

@@ -13,15 +11,38 @@
@@ -87,6 +190,7 @@ import { getUUID } from "@/utils"; export default { data() { return { + value: true, loginWay: "code_login", loginType: "教育局", mobileCodeCountDown: 0, @@ -125,7 +229,7 @@ export default { this.getCaptcha(); }, methods: { - loginWayClick(tab, event) { }, + loginWayClick(tab, event) {}, // 提交表单 dataFormSubmit() { const _loginTypeMapper = { @@ -199,6 +303,31 @@ export default { }); }); }, + handleLogin() { + const _loginTypeMapper = { + 管理员: "ROLE_ADMIN", + 教育局: "ROLE_EDU", + 学校: "ROLE_SCHOOL", + 教师: "ROLE_TEACHER", + }; + this.$refs["dataForm"].validate((valid) => { + console.log("账号密码登录"); + this.$api.mer_admin + .loginByAccount({ + // role: _loginTypeMapper[this.loginType], + mobile: this.dataForm.userName, + password: this.dataForm.password, + }) + .then(({ data }) => { + console.log("data", data); + this.$cookie.set("token", data.data.token); + this.$router.replace({ name: "home" }); + }) + .catch((err) => { + console.log(err); + }); + }); + }, //获取短信验证码 getCode() { //正则表达式校验手机号是否合法 @@ -344,7 +473,7 @@ export default { .login-captcha { overflow: hidden; - >img { + > img { width: 100%; cursor: pointer; } diff --git a/src/views/modules/bank-card/index.vue b/src/views/modules/bank-card/index.vue new file mode 100644 index 0000000..cb8fa67 --- /dev/null +++ b/src/views/modules/bank-card/index.vue @@ -0,0 +1,198 @@ + + + + + \ No newline at end of file diff --git a/src/views/modules/bank-card/popup/add-or-update.vue b/src/views/modules/bank-card/popup/add-or-update.vue new file mode 100644 index 0000000..0fa56a6 --- /dev/null +++ b/src/views/modules/bank-card/popup/add-or-update.vue @@ -0,0 +1,798 @@ + + + \ No newline at end of file diff --git a/src/views/modules/bank-card/popup/view-details.vue b/src/views/modules/bank-card/popup/view-details.vue new file mode 100644 index 0000000..08b354e --- /dev/null +++ b/src/views/modules/bank-card/popup/view-details.vue @@ -0,0 +1,571 @@ + + + \ No newline at end of file diff --git a/src/views/modules/brand/config/index.vue b/src/views/modules/brand/config/index.vue new file mode 100644 index 0000000..97e8367 --- /dev/null +++ b/src/views/modules/brand/config/index.vue @@ -0,0 +1,178 @@ + + + + \ No newline at end of file diff --git a/src/views/modules/brand/config/popup/add-or-update.vue b/src/views/modules/brand/config/popup/add-or-update.vue new file mode 100644 index 0000000..722b9d9 --- /dev/null +++ b/src/views/modules/brand/config/popup/add-or-update.vue @@ -0,0 +1,266 @@ + + + \ No newline at end of file diff --git a/src/views/modules/brand/config/popup/change-password.vue b/src/views/modules/brand/config/popup/change-password.vue new file mode 100644 index 0000000..85fb772 --- /dev/null +++ b/src/views/modules/brand/config/popup/change-password.vue @@ -0,0 +1,141 @@ + + + \ No newline at end of file diff --git a/src/views/modules/brand/config/popup/to-configure.vue b/src/views/modules/brand/config/popup/to-configure.vue new file mode 100644 index 0000000..40e998e --- /dev/null +++ b/src/views/modules/brand/config/popup/to-configure.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/src/views/modules/logistics-fare/logistics-template/index.vue b/src/views/modules/logistics-fare/logistics-template/index.vue index b958aa4..4049b63 100644 --- a/src/views/modules/logistics-fare/logistics-template/index.vue +++ b/src/views/modules/logistics-fare/logistics-template/index.vue @@ -1,37 +1,53 @@ @@ -44,9 +60,29 @@ export default { dataList: [], searchForm: { name: "", + linkId: "", }, + shopId: "", + marketList: "", }; }, + created() { + if (JSON.parse(sessionStorage.getItem("userInfo")).markets.length > 0) { + this.shopId = true; + this.searchForm.linkId = JSON.parse( + sessionStorage.getItem("userInfo") + ).markets[0].marketId; + this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets; + console.log(this.marketList); + } else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) { + this.searchForm.linkId = JSON.parse( + sessionStorage.getItem("userInfo") + ).shopId; + this.shopId = true; + } else { + this.shopId = false; + } + }, methods: { queryList(pageNo, pageSize) { this.$api.mer_admin @@ -66,8 +102,16 @@ export default { this.$refs.oTable.complete(false); }); }, + Reset() { + this.searchForm = { + name: "", + linkId: JSON.parse(sessionStorage.getItem("userInfo")).markets[0] + .marketId, + }; + this.$refs.oTable.reload(); + }, addFareTemplate() { - this.$refs.addTemplate.toggle().add(); + this.$refs.addTemplate.toggle().add(this.searchForm.linkId); }, }, computed: { @@ -80,7 +124,6 @@ export default { this.$api.mer_admin.getShippingTemplateInfo(row.id).then((res) => { console.log(res); console.log("row.tableData", row.tableData); - if (!row.tableData) { if (res.data.data.shippingTemplatesRegionResultList) { this.$set( @@ -144,7 +187,7 @@ export default { } // 将所有找到的路径合并成字符串返回 - return paths.map((path) =>

{path.join("/")}

); + return paths.map((path) =>

{path.join("/")}

); }; const appointMapper = { diff --git a/src/views/modules/logistics-fare/logistics-template/popup/add-template.vue b/src/views/modules/logistics-fare/logistics-template/popup/add-template.vue index 025a327..7065558 100644 --- a/src/views/modules/logistics-fare/logistics-template/popup/add-template.vue +++ b/src/views/modules/logistics-fare/logistics-template/popup/add-template.vue @@ -57,6 +57,7 @@ export default { }, fileList: [], //回显图片 place: "", //场地 + linkId: "", }; }, mounted() { @@ -141,10 +142,11 @@ export default { this.modalData = _data; }; return { - add: () => { + add: (id) => { this.$nextTick(() => { this.modalData = cloneDeep(BASE_DATA); }); + this.linkId = id; this.isAdd = true; this.modalConfig.title = "添加运费模板"; }, @@ -832,7 +834,7 @@ export default { if (this.isAdd) { this.$api.mer_admin .addShippingTemplate({ - linkId: JSON.parse(sessionStorage.getItem("userInfo")).shopId, + linkId: this.linkId, defaults: 0, //默认值,待确认 sort: 0, //默认值,待确认 type: 2, //默认值,待确认 @@ -848,7 +850,7 @@ export default { }[this.modalData.fareConfig], shippingTemplatesRegionList: this.modalData.fareConfig == "全国包邮" - ? nu + ? null : [ ...this.modalData.shippingTemplatesRegionList, ...JSON.parse( @@ -891,7 +893,7 @@ export default { this.$api.mer_admin .updateShippingTemplate({ id: this.modalData.id, - linkId: JSON.parse(sessionStorage.getItem("userInfo")).shopId, + linkId: this.linkId, defaults: 0, //默认值,待确认 sort: 0, //默认值,待确认 type: 2, //默认值,待确认 diff --git a/src/views/modules/product/index.vue b/src/views/modules/product/index.vue index 928ce5d..1bb5a99 100644 --- a/src/views/modules/product/index.vue +++ b/src/views/modules/product/index.vue @@ -1,73 +1,89 @@ @@ -83,9 +99,10 @@ export default { activeName: "在售", dataList: [], formInline: { - user: "", - region: "", + name: "", + marketId: "", }, + marketList: [], tableProp: { "auto-resize": true, border: true, @@ -95,8 +112,23 @@ export default { }, productFilterType: "SALE", selectList: [], + shopId: "", }; }, + created() { + if (JSON.parse(sessionStorage.getItem("userInfo")).markets.length > 0) { + this.shopId = true; + this.formInline.marketId = JSON.parse( + sessionStorage.getItem("userInfo") + ).markets[0].marketId; + this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets; + console.log(this.marketList); + } else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) { + this.shopId = true; + } else { + this.shopId = false; + } + }, methods: { addProduct() { this.$refs.addOrUpdate.toggle().add(); @@ -131,6 +163,7 @@ export default { pageNumber: pageNo, pageSize: pageSize, }, + ...this.formInline, productFilterType: this.productFilterType, merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId, shopId: JSON.parse(sessionStorage.getItem("userInfo")).shopId, @@ -147,6 +180,14 @@ export default { this.$refs.oTable.complete(false); }); }, + Reset() { + this.formInline = { + name: "", + marketId: JSON.parse(sessionStorage.getItem("userInfo")).markets[0] + .marketId, + }; + this.$refs.oTable.reload(); + }, handleClick() { switch (this.activeName) { case "在售": @@ -288,6 +329,8 @@ export default { width: "340px", render: ({ row }) => { let edit = () => { + console.log(row); + this.$refs.addOrUpdate.toggle(row).update(); }; let priceAdjustment = () => { diff --git a/src/views/modules/product/popup/add-or-update.vue b/src/views/modules/product/popup/add-or-update.vue index fc0c9f1..25386cd 100644 --- a/src/views/modules/product/popup/add-or-update.vue +++ b/src/views/modules/product/popup/add-or-update.vue @@ -208,6 +208,7 @@ export default { }); this.isAdd = true; + console.log("112233"); }, update: () => { this.modalConfig.title = "编辑商品";