const { defineConfig } = require('@vue/cli-service') const path = require('path') const DelPlugin = require('./webpack/plugins/DelPlugin') const prod = process.env.NODE_ENV === 'production' const retina = () => path.resolve(__dirname, './webpack/loaders/retina-loader.js') module.exports = defineConfig({ css: { loaderOptions: { scss: { additionalData: `@import "@/assets/scss/mixin.scss"; @import "@/assets/scss/variables.scss";` } } }, transpileDependencies: true, publicPath: prod ? './' : '/', configureWebpack: { plugins: [new DelPlugin()] }, chainWebpack: config => { config.resolve.alias.set('vue-i18n', 'vue-i18n/dist/vue-i18n.cjs.js') config.module .rule('vue') .test(/\.vue$/) .use(retina()) .loader(retina()) .options({ retina: false //默认不转换 true: 转换 只支持1920转4K分辨率 如需互相转换 改源码 }) .end() }, devServer: { setupMiddlewares(_middlewares, { app }) { //美味不用等 app.get('/Api/Delicious/GetShopdetail', (req, res) => { res.json({ code: '200', msg: '成功', data: { servicefee: 0, defaultprice: 0, rushAble: 0, shopName: '火地铁板烧(桥北万象汇店)', shopState: 3, discount: '', noneAble: 0, tlogo: 'https://m.mwfile.cn/mm1003/image/20210423/151507_9ae1be56ef.jpg', sid: 443645, avg: 99, showtime: 0, limit: '30000', logo: 'https://m.mwfile.cn/mm1003/image/20210423/151506_1e34f5d9a5.jpg', tel: '', state: 2, paynotice: '', addr: '南京市江北新区浦珠北路1号万象汇购物中心五层L514商铺', notice: '不用排队', last: '2021-09-07 14:59:39', mshopId: 19778, qnotice: '听到叫号请到迎宾台,过号作废,重新排队【实际规则以门店线下说明为准】', off: 0, enableMemberVipQueue: 0, queues: [ { wait: 0, qattr: '1-1人', qname: '一人桌', from: 1, to: 1, type: 0, waittime: '--分钟' }, { wait: 0, qattr: '2-2人', qname: '二人桌', from: 2, to: 2, type: 0, waittime: '--分钟' }, { wait: 0, qattr: '3-3人', qname: '三人桌', from: 3, to: 3, type: 0, waittime: '--分钟' }, { wait: 0, qattr: '4-4人', qname: '四人桌', from: 4, to: 4, type: 0, waittime: '--分钟' } ], name: '火地铁板烧(桥北万象汇店)', online: 1, TIMT: 1630997988, memberVipQueuePrivateDesc: '', phoneQueueAble: 1, open: '10:00-22:00' } }) }) //美味不用等排队二维码 app.get('/Api/Delicious/GetQRcode', (req, res) => { res.json({ code: '200', msg: '成功', data: { file: { base64Image: '' } } }) }) //评论 app.get('/Api/Koubei/GetStoreComment', (req, res) => { res.json({ code: '200', msg: '成功', data: { comment_info: { avg_score: '4.912871287128713', comment_tag_list: { comment_tag: [ { emotion: 1, tag_content: '服务周到', tag_count: 6 } ] }, image_count: 34, total_comments: 505 }, has_more: false, page_size: 20 } }) }) //推荐菜 app.get('/Api/Koubei/GetStoreDisplayGoods', (req, res) => { res.json({ code: '200', msg: '成功', data: { goods_detail_infos: { goods_detail_info: [ { good_detail_name: '测试推荐菜', picture: { picture_url: 'https://img1.baidu.com/it/u=761505298,746941072&fm=26&fmt=auto' } } ] } } }) }) //店铺信息 app.get('Api/Koubei/GetStoreDetail', (req, res) => { res.json({ code: '200', msg: '成功', data: { service_info: { service_desc: '有停车位 有WIFI 有包厢 无烟区', service_tag_list: ['有停车位', 'sadf', '有停车位', 'sadf', '有停车位', 'sadf', 'sadf', 'sadddddf', 'sadf阿斯蒂芬', 'sa顶顶顶df', 'sadf'] }, store_album: { picture_list: { picture: [ { picture_name: '门店内景', picture_url: 'https://img.alicdn.com/i4/2200788639881/O1CN01T3Urj72MrYBKTXquz_!!2200788639881-0-koubei.jpg', sequence: -1 }, { picture_name: '门店内景', picture_url: 'https://img.alicdn.com/i1/2200788639881/O1CN01xyp6q72MrYBGxRpS6_!!2200788639881-0-koubei.jpg', sequence: -1 }, { picture_name: '门店内景', picture_url: 'https://img.alicdn.com/i4/2200788639881/O1CN01T3Urj72MrYBKTXquz_!!2200788639881-0-koubei.jpg', sequence: -1 }, { picture_name: '门店内景', picture_url: 'https://img.alicdn.com/i2/2200788639881/O1CN01WKCpfo2MrYBLru6At_!!2200788639881-0-koubei.jpg', sequence: -1 } ] } }, store_dto: { billboard: '江宁区米粉米线热销榜第2名', brand_name: '阿香米线', business_time: '周一-周日 10:00-21:30', category_name: '美食,快餐小吃,米粉/米线', comment_score: '3.4444444444444446', comment_total_count: '9', contact_info: '18117095769', district_info: { address: '浦珠北路1号万象汇商业广场B1层Y103号商铺', city_code: '320100', city_name: '南京市', district_code: '320111', district_name: '浦口区', latitude: '32.125232', longitude: '118.730226', province_code: '320000', province_name: '江苏省' }, mall_id: '20210207880000000000000009900410', score: '2.9', store_detail_url: 'alipays://platformapi/startapp?appId=2021002144672445&supportTourist=true&startMultApp=YES&query=chInfo%3Dch_tribeopen__chsub_1000mu%26sourceFrom%3DTRIBE_OPEN_SHOP', store_id: '573127418', store_logo: 'https://img.alicdn.com/i4/2200788639881/O1CN01T3Urj72MrYBKTXquz_!!2200788639881-0-koubei.jpg', store_name: '阿香米线(南京桥北万象汇餐厅)' } } }) }) //商品列表 app.get('/Api/Koubei/GetItemShelf', (req, res) => { res.json({ code: '200', msg: '成功', data: { item_info_list: { item_dto: [ { item_store: { store_name: '大紧特紧测试门店' }, item_detail_url: 'alipays://platformapi/startapp?appId=77700272&startMultApp=YES&query=itemId%3D613552052869%26channel%3DALL%26cityId%3D330100%26storeId%3D230021002%26sourceFrom%3DITEM_DETAIL_BASE_INFO&url=%2Findex.html%23pages%2Findex%2Findex&chInfo=ch_tribeopen__chsub_yinli', item_cover: 'https://wx1.sinaimg.cn/orj360/004j2Ftyly1gt4lt4kltaj60u01c6n8r02.jpg', item_name: 'dddd', sub_title: 'sub_title', sell_price: '333', original_price: 'original_price' } ] } } }) }) return _middlewares } }, lintOnSave: true, productionSourceMap: false })