diff --git a/buyer/index.html b/buyer/index.html index 13a70c4d..3b299f1a 100644 --- a/buyer/index.html +++ b/buyer/index.html @@ -4,7 +4,7 @@ - +
-
- 高品质敢承诺:7天无理由退货,30天免费换新,质量问题商家承担来回运费换新;如需发票,请在确认收货无误后联系商家开出。(注*发票不随货品一同发出) -
-
-
- 平台卖家销售并发货的商品,由平台卖家提供发票和相应的售后服务。请您放心购买!
注:因厂家会在没有任何提前通知的情况下更改产品包装、产地或者一些附件,本司不能确保客户收到的货物与商城图片、产地、附件说明完全一致。只能确保为原厂正货!并且保证与当时市场上同样主流新品一致。若本商城没有及时更新,请大家谅解!
-
-
- BIT商城向您保证所售商品均为正品行货,BIT自营商品开具机打发票或电子发票。 -
-
-
- 凭质保证书及BIT商城发票,可享受全国联保服务(奢侈品、钟表除外;奢侈品、钟表由BIT联系保修,享受法定三包售后服务),与您亲临商场选购的商品享受相同的质量保证。BIT商城还为您提供具有竞争力的商品价格和运费政策,请您放心购买!
注:因厂家会在没有任何提前通知的情况下更改产品包装、产地或者一些附件,本司不能确保客户收到的货物与商城图片、产地、附件说明完全一致。只能确保为原厂正货!并且保证与当时市场上同样主流新品一致。若本商城没有及时更新,请大家谅解!
-
确认删除当前订单吗?
', @@ -255,7 +255,7 @@ export default { onCancel: () => {} }); }, - getList () { + getList () { // 获取订单列表 this.spinShow = true; let params = JSON.parse(JSON.stringify(this.params)) if (params.orderStatus === 'ALL') { @@ -269,11 +269,11 @@ export default { } }); }, - changePageNum (val) { + changePageNum (val) { // 修改页码 this.params.pageNumber = val; this.getList() }, - changePageSize (val) { + changePageSize (val) { // 修改页数 this.pageNumber = 1; this.params.pageSize = val; this.getList() @@ -289,7 +289,7 @@ export default { } }) }, - sureCancel () { + sureCancel () { // 确定取消 cancelOrder(this.cancelParams).then(res => { if (res.success) { this.$Message.success('取消订单成功') diff --git a/buyer/src/pages/home/orderCenter/OrderDetail.vue b/buyer/src/pages/home/orderCenter/OrderDetail.vue index a21d8731..629ac5aa 100644 --- a/buyer/src/pages/home/orderCenter/OrderDetail.vue +++ b/buyer/src/pages/home/orderCenter/OrderDetail.vue @@ -128,7 +128,7 @@ export default { } }) }, - traces () { + traces () { // 物流信息 getTraces(this.$route.query.sn).then(res => { if (res.success) { this.logistics = res.result diff --git a/buyer/src/pages/user/menu.js b/buyer/src/pages/user/menu.js index 78c3c093..7a9cf9ab 100644 --- a/buyer/src/pages/user/menu.js +++ b/buyer/src/pages/user/menu.js @@ -41,6 +41,11 @@ const member = [{ title: '账户安全', path: 'AccountSafe' }, + { + icon: '', + title: '我的消息', + path: 'MsgList' + }, { icon: '', title: '我的足迹', diff --git a/buyer/src/plugins/request.js b/buyer/src/plugins/request.js index c2c2b108..b937df34 100644 --- a/buyer/src/plugins/request.js +++ b/buyer/src/plugins/request.js @@ -1,77 +1,133 @@ // import Vue from 'vue'; -import axios from 'axios'; -import https from 'https'; -import { - Message, - Spin, - Modal -} from 'view-design'; -import Storage from './storage'; -import config from '@/config'; -import router from '../router/index.js'; -import store from '../vuex/store'; -import { - handleRefreshToken -} from '@/api/index'; -const qs = require('qs'); - -export const buyerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.buyer : config.api_prod.buyer); -export const commonUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.common : config.api_prod.common); -export const managerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.manager : config.api_prod.manager); -export const sellerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.seller : config.api_prod.seller); +import axios from "axios"; +import https from "https"; +import { Message, Spin, Modal } from "view-design"; +import Storage from "./storage"; +import config from "@/config"; +import router from "../router/index.js"; +import store from "../vuex/store"; +import { handleRefreshToken } from "@/api/index"; +const qs = require("qs"); +export const buyerUrl = + process.env.NODE_ENV === "development" + ? config.api_dev.buyer + : config.api_prod.buyer; +export const commonUrl = + process.env.NODE_ENV === "development" + ? config.api_dev.common + : config.api_prod.common; +export const managerUrl = + process.env.NODE_ENV === "development" + ? config.api_dev.manager + : config.api_prod.manager; +export const sellerUrl = + process.env.NODE_ENV === "development" + ? config.api_dev.seller + : config.api_prod.seller; // 创建axios实例 var isRefreshToken = 0; -const refreshToken = getTokenDebounce() +const refreshToken = getTokenDebounce(); const service = axios.create({ timeout: 10000, // 请求超时时间 baseURL: buyerUrl, // API httpsAgent: new https.Agent({ rejectUnauthorized: false }), - paramsSerializer: params => qs.stringify(params, { - arrayFormat: 'repeat' - }) + paramsSerializer: params => + qs.stringify(params, { + arrayFormat: "repeat" + }) }); // request拦截器 -service.interceptors.request.use(config => { - const { - loading - } = config; - // 如果是put/post请求,用qs.stringify序列化参数 - const isPutPost = config.method === 'put' || config.method === 'post'; - const isJson = config.headers['Content-Type'] === 'application/json'; - const isFile = config.headers['Content-Type'] === 'multipart/form-data'; - if (isPutPost && isJson) { - config.data = JSON.stringify(config.data); +service.interceptors.request.use( + config => { + const { loading } = config; + // 如果是put/post请求,用qs.stringify序列化参数 + const isPutPost = config.method === "put" || config.method === "post"; + const isJson = config.headers["Content-Type"] === "application/json"; + const isFile = config.headers["Content-Type"] === "multipart/form-data"; + if (isPutPost && isJson) { + config.data = JSON.stringify(config.data); + } + if (isPutPost && !isFile && !isJson) { + config.data = qs.stringify(config.data, { + arrayFormat: "repeat" + }); + } + /** 配置全屏加载 */ + if (process.client && loading !== false) { + config.loading = Spin.show(); + } + + const uuid = Storage.getItem("uuid"); + config.headers["uuid"] = uuid; + + // 获取访问Token + let accessToken = Storage.getItem("accessToken"); + if (accessToken && config.needToken) { + config.headers["accessToken"] = accessToken; + // 解析当前token时间 + let jwtData = JSON.parse( + decodeURIComponent(escape(window.atob(accessToken.split(".")[1]))) + ); + if (jwtData.exp < Math.round(new Date() / 1000)) { + refresh() + } + } + + return config; + }, + error => { + Promise.reject(error); } - if (isPutPost && !isFile && !isJson) { - config.data = qs.stringify(config.data, { - arrayFormat: 'repeat' +); + +async function refresh() { + const getTokenRes = await refreshToken(); + if (getTokenRes === "success") { + // 刷新token + if (isRefreshToken === 1) { + error.response.config.headers.accessToken = Storage.getItem( + "accessToken" + ); + return service(error.response.config); + } else { + router.go(0); + } + } else { + Storage.removeItem("accessToken"); + Storage.removeItem("refreshToken"); + Storage.removeItem("userInfo"); + Storage.setItem("cartNum", 0); + store.commit("SET_CARTNUM", 0); + console.log("1111"); + Modal.confirm({ + title: "请登录", + content: "请登录后执行此操作
", + okText: "立即登录", + cancelText: "继续浏览", + onOk: () => { + router.push({ + path: "/login", + query: { + rePath: router.history.current.path, + query: JSON.stringify(router.history.current.query) + } + }); + }, + onCancel: () => { + Modal.remove(); + } }); } - /** 配置全屏加载 */ - if (process.client && loading !== false) { - config.loading = Spin.show(); - } - - const uuid = Storage.getItem('uuid'); - config.headers['uuid'] = uuid; - - // 获取访问Token - let accessToken = Storage.getItem('accessToken'); - if (accessToken && config.needToken) { - config.headers['accessToken'] = accessToken; - } - return config; -}, error => { - Promise.reject(error); -}); +} // respone拦截器 service.interceptors.response.use( async response => { await closeLoading(response); + return response.data; }, async error => { @@ -84,45 +140,15 @@ service.interceptors.response.use( isRefreshToken++; if (isRefreshToken === 1) { - const getTokenRes = await refreshToken(); - if (getTokenRes === 'success') { // 刷新token - if (isRefreshToken === 1) { - error.response.config.headers.accessToken = Storage.getItem('accessToken') - return service(error.response.config) - } else { - router.go(0) - } - } else { - Storage.removeItem('accessToken'); - Storage.removeItem('refreshToken'); - Storage.removeItem('userInfo'); - Storage.setItem('cartNum', 0) - store.commit('SET_CARTNUM', 0) - console.log('1111'); - Modal.confirm({ - title: '请登录', - content: '请登录后执行此操作
', - okText: '立即登录', - cancelText: '继续浏览', - onOk: () => { - router.push({ - path: '/login', - query: { - rePath: router.history.current.path, - query: JSON.stringify(router.history.current.query) - } - }); - }, - onCancel: () => { - Modal.remove(); - } - }); - } - isRefreshToken = 0 + refresh() + isRefreshToken = 0; } } else { if (error.message) { - let _message = error.code === 'ECONNABORTED' ? '连接超时,请稍候再试!' : '网络错误,请稍后再试!'; + let _message = + error.code === "ECONNABORTED" + ? "连接超时,请稍候再试!" + : "网络错误,请稍后再试!"; Message.error(errorData.message || _message); } } @@ -134,7 +160,7 @@ service.interceptors.response.use( * 关闭全局加载 * @param target */ -const closeLoading = (target) => { +const closeLoading = target => { if (!target.config || !target.config.loading) return true; return new Promise((resolve, reject) => { setTimeout(() => { @@ -145,13 +171,13 @@ const closeLoading = (target) => { }; export const Method = { - GET: 'get', - POST: 'post', - PUT: 'put', - DELETE: 'delete' + GET: "get", + POST: "post", + PUT: "put", + DELETE: "delete" }; -export default function request (options) { +export default function request(options) { // 如果是服务端或者是请求的刷新token,不需要检查token直接请求。 // if (process.server || options.url.indexOf('passport/token') !== -1) { return service(options); @@ -160,47 +186,46 @@ export default function request (options) { } // 防抖闭包来一波 -function getTokenDebounce () { - let lock = false - let success = false - return function () { +function getTokenDebounce() { + let lock = false; + let success = false; + return function() { if (!lock) { - lock = true - let oldRefreshToken = Storage.getItem('refreshToken'); - handleRefreshToken(oldRefreshToken).then(res => { - if (res.success) { - let { - accessToken, - refreshToken - } = res.result; - Storage.setItem('accessToken', accessToken); - Storage.setItem('refreshToken', refreshToken); + lock = true; + let oldRefreshToken = Storage.getItem("refreshToken"); + handleRefreshToken(oldRefreshToken) + .then(res => { + if (res.success) { + let { accessToken, refreshToken } = res.result; + Storage.setItem("accessToken", accessToken); + Storage.setItem("refreshToken", refreshToken); - success = true - lock = false - } else { - success = false - lock = false - // router.push('/login') - } - }).catch((err) => { - console.log(err); - success = false - lock = false - }) + success = true; + lock = false; + } else { + success = false; + lock = false; + // router.push('/login') + } + }) + .catch(err => { + console.log(err); + success = false; + lock = false; + }); } return new Promise(resolve => { // 一直看lock,直到请求失败或者成功 const timer = setInterval(() => { if (!lock) { - clearInterval(timer) + clearInterval(timer); if (success) { - resolve('success') + resolve("success"); } else { - resolve('fail') + resolve("fail"); } } - }, 500) // 轮询时间间隔 - }) - } + }, 500); // 轮询时间间隔 + }); + }; } diff --git a/buyer/src/router/index.js b/buyer/src/router/index.js index 5eb51b0d..e8272c84 100644 --- a/buyer/src/router/index.js +++ b/buyer/src/router/index.js @@ -47,6 +47,8 @@ const ComplainList = resolve => require(['@/pages/home/memberCenter/ComplainList const ComplainDetail = resolve => require(['@/pages/home/memberCenter/ComplainDetail'], resolve); const Invoice = resolve => require(['@/pages/home/memberCenter/Invoice'], resolve); const Point = resolve => require(['@/pages/home/memberCenter/Point'], resolve); +const MsgList = resolve => require(['@/pages/home/memberCenter/memberMsg/MsgList'], resolve); +const MsgDetail = resolve => require(['@/pages/home/memberCenter/memberMsg/MsgDetail'], resolve); /* * 会员中心 @@ -316,6 +318,18 @@ export default new Router({ name: 'AddAddress', component: AddAddress }, + { + path: 'MsgList', + name: 'MsgList', + component: MsgList, + meta: {title: '我的消息'} + }, + { + path: 'MsgDetail', + name: 'MsgDetail', + component: MsgDetail, + meta: {title: '我的消息'} + }, { path: 'MyOrder', name: 'MyOrder', diff --git a/manager/package.json b/manager/package.json index feb7da85..112223b4 100644 --- a/manager/package.json +++ b/manager/package.json @@ -27,7 +27,6 @@ "print-js": "^1.0.63", "qrcodejs2": "0.0.2", "quill": "^1.3.7", - "vue-qr": "^2.3.0", "sass-loader": "^8.0.2", "sockjs-client": "^1.4.0", "stompjs": "^2.3.3", @@ -40,14 +39,17 @@ "vue-clipboard2": "^0.3.0", "vue-cropper": "^0.4.9", "vue-i18n": "^8.15.1", + "vue-json-excel": "^0.3.0", "vue-json-pretty": "^1.4.1", "vue-lazyload": "^1.3.3", + "vue-qr": "^2.3.0", "vue-router": "^3.1.3", "vuedraggable": "^2.23.2", "vuex": "^3.4.0", "wangeditor": "^4.5.3", "xlsx": "^0.16.2", - "xss": "^1.0.7" + "xss": "^1.0.7", + "uuid": "^8.3.2" }, "devDependencies": { "@vue/cli-plugin-babel": "^4.4.4", diff --git a/manager/src/App.vue b/manager/src/App.vue index e75223ee..1f8e3787 100644 --- a/manager/src/App.vue +++ b/manager/src/App.vue @@ -5,6 +5,7 @@ diff --git a/manager/src/api/common.js b/manager/src/api/common.js index aea5012d..d0690dda 100644 --- a/manager/src/api/common.js +++ b/manager/src/api/common.js @@ -1,4 +1,4 @@ -import {commonUrl, getRequest} from '@/libs/axios'; +import {commonUrl, getRequest, getRequestWithNoToken, postRequestWithNoToken} from '@/libs/axios'; // 通过id获取子地区 export const getChildRegion = (id) => { @@ -6,6 +6,16 @@ export const getChildRegion = (id) => { }; // 点地图获取地址信息 -export const getRegion = (parpams) => { - return getRequest(`${commonUrl}/common/region/region`, parpams); +export const getRegion = (params) => { + return getRequest(`${commonUrl}/common/region/region`, params); +}; + +// 获取拼图验证 +export const getVerifyImg = (verificationEnums) => { + return getRequestWithNoToken(`${commonUrl}/common/slider/${verificationEnums}`); +}; + +// 拼图验证 +export const postVerifyImg = (params) => { + return postRequestWithNoToken(`${commonUrl}/common/slider/${params.verificationEnums}`, params); }; diff --git a/manager/src/api/promotion.js b/manager/src/api/promotion.js index 4fd81dfd..42173562 100644 --- a/manager/src/api/promotion.js +++ b/manager/src/api/promotion.js @@ -1,174 +1,231 @@ // 统一请求路径前缀在libs/axios.js中修改 -import { getRequest, postRequest, putRequest, deleteRequest } from '@/libs/axios'; - - +import { + getRequest, + postRequest, + putRequest, + deleteRequest +} from "@/libs/axios"; // 获取限时抢购申请列表 -export const getPromotionSeckill = (params) => { +export const getPromotionSeckill = params => { + return getRequest(`/promotion/seckill/apply`, params); +}; - return getRequest(`/promotion/seckill/apply`, params) -} +// 是否推荐直播间 +export const whetherStar = params => { + return putRequest(`/broadcast/studio/recommend/${params.id}`,params); +}; + +// 添加优惠券活动 +export const addCouponActivity = params => { + return postRequest(`/promotion/couponActivity/addCouponActivity`, params); +}; + + +// 获取店铺直播间列表 +export const getLiveList = params => { + return getRequest("/broadcast/studio", params); +}; + +// 获取直播间详情 +export const getLiveInfo = studioId => { + return getRequest(`/broadcast/studio/studioInfo/${studioId}`); +}; // 获取当前进行中的促销活动商品 -export const getPromotionGoods = (promotionId,params) => { - return getRequest(`/promotion/${promotionId}/goods`, params) -} +export const getPromotionGoods = (promotionId, params) => { + return getRequest(`/promotion/${promotionId}/goods`, params); +}; // 获取当前进行中的促销活动 -export const getAllPromotion = (params) => { - return getRequest('/promotion/current', params) -} +export const getAllPromotion = params => { + return getRequest("/promotion/current", params); +}; // 获取拼团数据 -export const getPintuanList = (params) => { - return getRequest('/promotion/pintuan', params) -} +export const getPintuanList = params => { + return getRequest("/promotion/pintuan", params); +}; // 获取拼团详情 -export const getPintuanDetail = (id) => { - return getRequest(`/promotion/pintuan/${id}`) -} +export const getPintuanDetail = id => { + return getRequest(`/promotion/pintuan/${id}`); +}; // 获取拼团商品数据 -export const getPintuanGoodsList = (params) => { - return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`,params) -} +export const getPintuanGoodsList = params => { + return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`, params); +}; // 关闭拼团活动 -export const closePintuan = (pintuanId) => { - return putRequest(`/promotion/pintuan/close/${pintuanId}`) -} +export const closePintuan = pintuanId => { + return putRequest(`/promotion/pintuan/close/${pintuanId}`); +}; // 保存平台优惠券 -export const savePlatformCoupon = (params) => { - return postRequest('/promotion/coupon', params,{'Content-type': 'application/json'}) -} +export const savePlatformCoupon = params => { + return postRequest("/promotion/coupon", params, { + "Content-type": "application/json" + }); +}; // 修改平台优惠券 -export const editPlatformCoupon = (params) => { - return putRequest('/promotion/coupon', params,{'Content-type': 'application/json'}) -} +export const editPlatformCoupon = params => { + return putRequest("/promotion/coupon", params, { + "Content-type": "application/json" + }); +}; // 获取平台优惠券 -export const getPlatformCouponList = (params) => { - return getRequest('/promotion/coupon', params) -} +export const getPlatformCouponList = params => { + return getRequest("/promotion/coupon", params); +}; // 作废优惠券 -export const deletePlatformCoupon = (ids) => { - return deleteRequest(`/promotion/coupon/${ids}`) -} +export const deletePlatformCoupon = ids => { + return deleteRequest(`/promotion/coupon/${ids}`); +}; // 更新优惠券状态 -export const updatePlatformCouponStatus = ( params) => { - return putRequest(`/promotion/coupon/status`, params) -} +export const updatePlatformCouponStatus = params => { + return putRequest(`/promotion/coupon/status`, params); +}; // 获取单个优惠券 -export const getPlatformCoupon = (id) => { - return getRequest(`/promotion/coupon/${id}`) -} - +export const getPlatformCoupon = id => { + return getRequest(`/promotion/coupon/${id}`); +}; // 获取优惠券领取详情 -export const getMemberReceiveCouponList = (id) => { - return getRequest(`/promotion/coupon/member/${id}`) -} +export const getMemberReceiveCouponList = id => { + return getRequest(`/promotion/coupon/member/${id}`); +}; // 作废会员优惠券 -export const deleteMemberReceiveCoupon = (id) => { - return putRequest(`/promotion/coupon/member/cancellation/${id}`) -} +export const deleteMemberReceiveCoupon = id => { + return putRequest(`/promotion/coupon/member/cancellation/${id}`); +}; + + +// 保存平台优惠券 +export const saveActivityCoupon = params => { + return postRequest("/promotion/couponActivity", params, { + "Content-type": "application/json" + }); +}; +// 获取活动优惠券列表 +export const getActivityCouponList = params => { + return getRequest("/promotion/couponActivity/activityCoupons", params); +}; +// 获取平台优惠券活动 +export const getCouponActivityList = params => { + return getRequest("/promotion/couponActivity", params); +}; +// 作废优惠券 +export const closeActivity = id => { + return deleteRequest(`/promotion/couponActivity/${id}`); +}; +// 更新优惠券活动 +export const updateCouponActivity = params => { + return putRequest(`/promotion/couponActivity/status`, params); +}; +// 获取单个优惠券活动 +export const getCouponActivity = id => { + return getRequest(`/promotion/couponActivity/${id}`); +}; // 获取限时抢购数据 -export const getSeckillList = (params) => { - return getRequest('/promotion/seckill', params) -} +export const getSeckillList = params => { + return getRequest("/promotion/seckill", params); +}; // 获取限时抢购审核列表 -export const seckillGoodsList = (params) => { - return getRequest('/promotion/seckill/apply', params) -} +export const seckillGoodsList = params => { + return getRequest("/promotion/seckill/apply", params); +}; // 获取限时抢购详情数据 export const seckillDetail = (id, params) => { - return getRequest(`/promotion/seckill/${id}`, params) -} + return getRequest(`/promotion/seckill/${id}`, params); +}; // 删除限时抢购 -export const delSeckill = (id) => { - return deleteRequest(`/promotion/seckill/${id}`) -} +export const delSeckill = id => { + return deleteRequest(`/promotion/seckill/${id}`); +}; // 保存限时抢购 -export const saveSeckill = (params) => { - return postRequest('/promotion/seckill', params) -} +export const saveSeckill = params => { + return postRequest("/promotion/seckill", params); +}; // 修改限时抢购 -export const updateSeckill = (params) => { - return putRequest('/promotion/seckill', params) -} +export const updateSeckill = params => { + return putRequest("/promotion/seckill", params); +}; // 关闭限时抢购 -export const closeSeckill = (id) => { - return putRequest(`/promotion/seckill/close/${id}`) -} +export const closeSeckill = id => { + return putRequest(`/promotion/seckill/close/${id}`); +}; // 审核限时抢购 -export const auditApplySeckill = (params) => { - return putRequest(`/promotion/seckill/apply/audit/${params.ids}`, params) -} +export const auditApplySeckill = params => { + return putRequest(`/promotion/seckill/apply/audit/${params.ids}`, params); +}; // 满优惠列表 -export const getFullDiscountList = (params) => { - return getRequest(`/promotion/fullDiscount`,params) -} +export const getFullDiscountList = params => { + return getRequest(`/promotion/fullDiscount`, params); +}; // 满优惠列表 -export const getFullDiscountById = (id) => { - return getRequest(`/promotion/fullDiscount/${id}`) -} +export const getFullDiscountById = id => { + return getRequest(`/promotion/fullDiscount/${id}`); +}; // 积分商品列表 -export const getPointsGoodsList = (params) => { - return getRequest(`/promotion/pointsGoods`,params) -} +export const getPointsGoodsList = params => { + return getRequest(`/promotion/pointsGoods`, params); +}; // 积分商品详情 -export const getPointsGoodsById = (id) => { - return getRequest(`/promotion/pointsGoods/${id}`) -} +export const getPointsGoodsById = id => { + return getRequest(`/promotion/pointsGoods/${id}`); +}; // 添加积分商品 -export const addPointsGoods = (params) => { - return postRequest(`/promotion/pointsGoods`,params, {'Content-type': 'application/json'}) -} +export const addPointsGoods = params => { + return postRequest(`/promotion/pointsGoods`, params, { + "Content-type": "application/json" + }); +}; // 修改积分商品 -export const updatePointsGoods = (params) => { - return putRequest(`/promotion/pointsGoods`,params, {'Content-type': 'application/json'}) -} +export const updatePointsGoods = params => { + return putRequest(`/promotion/pointsGoods`, params, { + "Content-type": "application/json" + }); +}; // 修改积分商品状态 export const editPointsGoodsStatus = (id, params) => { - return putRequest(`/promotion/pointsGoods/${id}`,params) -} + return putRequest(`/promotion/pointsGoods/${id}`, params); +}; // 删除积分商品 -export const deletePointsGoodsStatus = (id) => { - return deleteRequest(`/promotion/pointsGoods/${id}`) -} - +export const deletePointsGoodsStatus = id => { + return deleteRequest(`/promotion/pointsGoods/${id}`); +}; // 积分商品分类列表 -export const getPointsGoodsCategoryList = (params) => { - return getRequest(`/promotion/pointsGoodsCategory`,params) -} +export const getPointsGoodsCategoryList = params => { + return getRequest(`/promotion/pointsGoodsCategory`, params); +}; // 积分商品分类详情 -export const getPointsGoodsCategoryById = (id) => { - return getRequest(`/promotion/pointsGoodsCategory/${id}`) -} +export const getPointsGoodsCategoryById = id => { + return getRequest(`/promotion/pointsGoodsCategory/${id}`); +}; // 添加积分商品分类 -export const addPointsGoodsCategory = (params) => { - return postRequest(`/promotion/pointsGoodsCategory`, params) -} +export const addPointsGoodsCategory = params => { + return postRequest(`/promotion/pointsGoodsCategory`, params); +}; // 更新积分商品分类 -export const updatePointsGoodsCategory = (params) => { - return putRequest(`/promotion/pointsGoodsCategory`, params) -} +export const updatePointsGoodsCategory = params => { + return putRequest(`/promotion/pointsGoodsCategory`, params); +}; // 删除积分商品分类 -export const deletePointsGoodsCategoryById = (id) => { - return deleteRequest(`/promotion/pointsGoodsCategory/${id}`) -} +export const deletePointsGoodsCategoryById = id => { + return deleteRequest(`/promotion/pointsGoodsCategory/${id}`); +}; diff --git a/manager/src/config/index.js b/manager/src/config/index.js index e8363c9d..8b6b162f 100644 --- a/manager/src/config/index.js +++ b/manager/src/config/index.js @@ -21,11 +21,10 @@ export default { // buyer: "https://buyer-api.pickmall.cn", // seller: "https://store-api.pickmall.cn", // manager: "https://admin-api.pickmall.cn" - common: "http://192.168.0.109:8890", - buyer: "http://192.168.0.109:8888", - seller: "http://192.168.0.109:8889", - manager: "http://192.168.0.109:8887" - + common: 'http://192.168.0.109:8890', + buyer: 'http://192.168.0.109:8888', + seller: 'http://192.168.0.109:8889', + manager: 'http://192.168.0.109:8887' }, api_prod: { common: "https://common-api.pickmall.cn", diff --git a/manager/src/libs/axios.js b/manager/src/libs/axios.js index 3e91766a..6bd6d6c1 100644 --- a/manager/src/libs/axios.js +++ b/manager/src/libs/axios.js @@ -24,6 +24,8 @@ service.interceptors.request.use( ...config.params } } + const uuid = getStore('uuid'); + config.headers['uuid'] = uuid; return config; }, err => { diff --git a/manager/src/router/router.js b/manager/src/router/router.js index 5e3497f7..d60e240f 100644 --- a/manager/src/router/router.js +++ b/manager/src/router/router.js @@ -5,7 +5,7 @@ export const loginRouter = { path: "/login", name: "login", meta: { - title: "登录 - lili " + title: "登录 - lili运营后台" }, component: () => import("@/views/login.vue") }; @@ -243,6 +243,43 @@ export const otherRouter = { name: "platform-coupon-info", component: () => import("@/views/promotion/coupon/couponInfo.vue") }, + { + path: "coupon-activity/add", + title: "添加优惠券活动", + name: "add-coupon-activity", + component: () => import("@/views/promotion/couponActivity/couponPublish.vue") + }, + { + path: "coupon-activity/edit", + title: "编辑平台优惠券活动", + name: "edit-coupon-activity", + component: () => import("@/views/promotion/couponActivity/couponPublish.vue") + }, + { + path: "promotion/coupon-activity-info", + title: "券活动详情", + name: "coupon-activity-info", + component: () => import("@/views/promotion/couponActivity/couponInfo.vue") + }, + { + path: "promotion/member-receive-coupon", + title: "领取详情", + name: "member-coupon-activity", + component: () => + import("@/views/promotion/coupon/memberReceiveCoupon.vue") + }, + { + path: "promotion/platform-coupon-info", + title: "详情", + name: "platform-coupon-activity", + component: () => import("@/views/promotion/coupon/couponInfo.vue") + }, + { + path: "promotion/add-coupon-specify", + title: "精准发劵", + name: "add-coupon-specify", + component: () => import("@/views/promotion/coupon/couponSpecify.vue") + }, { path: "promotion/manager-pintuan", title: "平台拼团", @@ -296,6 +333,12 @@ export const otherRouter = { title: "短信签名", name: "add-sms-sign", component: () => import("@/views/sys/message/smsSign.vue") + }, + { + path: "liveDetail", + title: "查看直播", + name: "liveDetail", + component: () => import("@/views/promotion/live/liveDetail.vue") } ] }; diff --git a/manager/src/utils/filters.js b/manager/src/utils/filters.js index d581cc7d..71c092db 100644 --- a/manager/src/utils/filters.js +++ b/manager/src/utils/filters.js @@ -18,6 +18,72 @@ export function unitPrice(val, unit, location) { + +let timer, flag; +/** + * 节流原理:在一定时间内,只能触发一次 + * + * @param {Function} func 要执行的回调函数 + * @param {Number} wait 延时的时间 + * @param {Boolean} immediate 是否立即执行 + * @return null + */ + export function throttle(func, wait = 500, immediate = true) { + if (immediate) { + if (!flag) { + flag = true; + // 如果是立即执行,则在wait毫秒内开始时执行 + typeof func === 'function' && func(); + timer = setTimeout(() => { + flag = false; + }, wait); + } + } else { + if (!flag) { + flag = true + // 如果是非立即执行,则在wait毫秒内的结束处执行 + timer = setTimeout(() => { + flag = false + typeof func === 'function' && func(); + }, wait); + } + + } +}; + + + + + +let timeout = null; + +/** + * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数 + * + * @param {Function} func 要执行的回调函数 + * @param {Number} wait 延时的时间 + * @param {Boolean} immediate 是否立即执行 + * @return null + */ + export function debounce(func, wait = 500, immediate = false) { + // 清除定时器 + if (timeout !== null) clearTimeout(timeout); + // 立即执行,此类情况一般用不到 + if (immediate) { + var callNow = !timeout; + timeout = setTimeout(function() { + timeout = null; + }, wait); + if (callNow) typeof func === 'function' && func(); + } else { + // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法 + timeout = setTimeout(function() { + typeof func === 'function' && func(); + }, wait); + } +} + + /** * 货币格式化 * @param price @@ -172,4 +238,4 @@ export function formatLinkType (item) { break; } return url; -} \ No newline at end of file +} diff --git a/manager/src/views/distribution/distributionSetting.vue b/manager/src/views/distribution/distributionSetting.vue index 096c33ac..8a6e48cb 100644 --- a/manager/src/views/distribution/distributionSetting.vue +++ b/manager/src/views/distribution/distributionSetting.vue @@ -10,67 +10,77 @@ 关闭 +
+
{{item.desc}}
+{{item.sellingPoint || ''}}
+