Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-ui
commit
0d5c60ed8c
|
@ -0,0 +1,5 @@
|
||||||
|
# 默认依赖包指定淘宝源
|
||||||
|
registry=https://registry.npm.taobao.org/
|
||||||
|
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
|
||||||
|
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
|
||||||
|
electron_mirror=https://npm.taobao.org/mirrors/electron/
|
|
@ -0,0 +1,5 @@
|
||||||
|
registry "https://registry.npmmirror.com"
|
||||||
|
sass_binary_site "https://npmmirror.com/mirrors/node-sass"
|
||||||
|
phantomjs_cdnurl "https://npmmirror.com/mirrors/phantomjs"
|
||||||
|
electron_mirror "https://npmmirror.com/mirrors/electron"
|
||||||
|
|
|
@ -81,3 +81,14 @@ export function articleDetail (id) {
|
||||||
method: Method.GET
|
method: Method.GET
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取IM接口前缀
|
||||||
|
export function getIMDetail () {
|
||||||
|
return request({
|
||||||
|
url: `${commonUrl}/common/IM`,
|
||||||
|
method: Method.GET
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
@ -224,7 +224,7 @@ export default {
|
||||||
count: 1, // 商品数量
|
count: 1, // 商品数量
|
||||||
imgIndex: 0, // 展示图片下标
|
imgIndex: 0, // 展示图片下标
|
||||||
currentSelceted: [], // 当前商品sku
|
currentSelceted: [], // 当前商品sku
|
||||||
imgList: [{}], // 商品图片列表
|
imgList: [{url:''}], // 商品图片列表
|
||||||
skuDetail: this.detail.data, // sku详情
|
skuDetail: this.detail.data, // sku详情
|
||||||
goodsSpecList: this.detail.specs, // 商品spec
|
goodsSpecList: this.detail.specs, // 商品spec
|
||||||
promotionMap: {
|
promotionMap: {
|
||||||
|
|
|
@ -1,30 +1,12 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
/**
|
title: "lili-shop", //配置显示在浏览器标签的title、底部信息、部分信息展示的值
|
||||||
* @description 配置显示在浏览器标签的title、底部信息、部分信息展示的值
|
icpCard: "", // icp证
|
||||||
*/
|
|
||||||
title: "lili-shop",
|
|
||||||
/**
|
|
||||||
* @description icp证
|
|
||||||
*/
|
|
||||||
icpCard: "",
|
|
||||||
|
|
||||||
company: {
|
company: {
|
||||||
href: "https://pickmall.cn",
|
href: "https://pickmall.cn",
|
||||||
name:"北京宏业汇成科技有限公司"
|
name: "北京宏业汇成科技有限公司",
|
||||||
},
|
}, //公司信息
|
||||||
/**
|
icpMessage: "京ICP备20009696号-1", //icp备案
|
||||||
* @description icp备案号
|
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
|
||||||
*/
|
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
|
||||||
icpMessage: "京ICP备20009696号-1",
|
port:10000, //端口
|
||||||
/**
|
|
||||||
* @description 是否使用国际化,默认为false
|
|
||||||
* 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
|
|
||||||
* 用来在菜单中显示文字
|
|
||||||
*/
|
|
||||||
useI18n: false,
|
|
||||||
/**
|
|
||||||
* @description 高德web端申请的api key
|
|
||||||
*/
|
|
||||||
aMapKey: "b440952723253aa9fe483e698057bf7d",
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,14 +13,24 @@
|
||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
</Breadcrumb>
|
</Breadcrumb>
|
||||||
<div class="store-collect">
|
<div class="store-collect">
|
||||||
<span class="mr_10" v-if="goodsMsg.data"><router-link
|
<span class="mr_10" v-if="goodsMsg.data">
|
||||||
:to="'Merchant?id=' + goodsMsg.data.storeId">{{ goodsMsg.data.storeName }}</router-link></span>
|
|
||||||
<span @click="collect"><Icon type="ios-heart"
|
<router-link :to="'Merchant?id=' + goodsMsg.data.storeId">{{ goodsMsg.data.storeName }}</router-link>
|
||||||
:color="storeCollected ? '#ed3f14' : '#666'"/>
|
</span>
|
||||||
|
<span @click="collect">
|
||||||
|
<Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />
|
||||||
{{storeCollected ? '已收藏店铺' : '收藏店铺'}}
|
{{storeCollected ? '已收藏店铺' : '收藏店铺'}}
|
||||||
</span>
|
</span>
|
||||||
<span @click="connectCs(storeMsg.yzfSign)" class="ml_10"><Icon
|
<!--
|
||||||
custom="icomoon icon-customer-service"/>联系客服</span>
|
先看下udesk merchantEuid 是否有值
|
||||||
|
有的话 链接udesk
|
||||||
|
没有的话 显示云智服
|
||||||
|
-->
|
||||||
|
<span class="ml_10" v-if="storeMsg.merchantEuid" @click="IMService()">联系客服</span>
|
||||||
|
|
||||||
|
<span v-else @click="connectCs(storeMsg.yzfSign)" class="ml_10">
|
||||||
|
<Icon custom="icomoon icon-customer-service" />联系客服
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,22 +45,28 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Search from '@/components/Search';
|
import Search from "@/components/Search";
|
||||||
import ShopHeader from '@/components/header/ShopHeader';
|
import ShopHeader from "@/components/header/ShopHeader";
|
||||||
import ShowGoods from '@/components/goodsDetail/ShowGoods';
|
import ShowGoods from "@/components/goodsDetail/ShowGoods";
|
||||||
import ShowGoodsDetail from '@/components/goodsDetail/ShowGoodsDetail';
|
import ShowGoodsDetail from "@/components/goodsDetail/ShowGoodsDetail";
|
||||||
import {goodsSkuDetail} from '@/api/goods';
|
import { goodsSkuDetail } from "@/api/goods";
|
||||||
import {cancelCollect, collectGoods, isCollection, getGoodsDistribution} from '@/api/member';
|
import {
|
||||||
import {getDetailById} from '@/api/shopentry'
|
cancelCollect,
|
||||||
|
collectGoods,
|
||||||
|
isCollection,
|
||||||
|
getGoodsDistribution,
|
||||||
|
} from "@/api/member";
|
||||||
|
import { getDetailById } from "@/api/shopentry";
|
||||||
|
import { getIMDetail } from "@/api/common";
|
||||||
export default {
|
export default {
|
||||||
name: 'GoodsDetail',
|
name: "GoodsDetail",
|
||||||
beforeRouteEnter(to, from, next) {
|
beforeRouteEnter(to, from, next) {
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getGoodsDetail();
|
this.getGoodsDetail();
|
||||||
|
// this.getIMDetailMethods();
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -58,105 +74,129 @@ export default {
|
||||||
isLoading: false, // 加载状态
|
isLoading: false, // 加载状态
|
||||||
categoryBar: [], // 分类
|
categoryBar: [], // 分类
|
||||||
storeCollected: false, // 商品收藏
|
storeCollected: false, // 商品收藏
|
||||||
storeMsg: {} // 店铺信息
|
storeMsg: {}, // 店铺信息
|
||||||
|
IMLink: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 跳转im客服
|
||||||
|
IMService() {
|
||||||
|
window.open(this.IM);
|
||||||
|
},
|
||||||
|
// 获取im信息
|
||||||
|
async getIMDetailMethods() {
|
||||||
|
let res = await getIMDetail();
|
||||||
|
if (res.success) {
|
||||||
|
this.IMLink = res.result;
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取商品详情
|
// 获取商品详情
|
||||||
getGoodsDetail() {
|
getGoodsDetail() {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
const params = this.$route.query;
|
const params = this.$route.query;
|
||||||
// 分销员id
|
// 分销员id
|
||||||
let distributionId = (params && params.distributionId) ? params.distributionId : this.Cookies.getItem('distributionId');
|
let distributionId =
|
||||||
|
params && params.distributionId
|
||||||
|
? params.distributionId
|
||||||
|
: this.Cookies.getItem("distributionId");
|
||||||
// 如果有分销信息
|
// 如果有分销信息
|
||||||
if (distributionId) {
|
if (distributionId) {
|
||||||
console.log(distributionId)
|
console.log(distributionId);
|
||||||
// 先存储
|
// 先存储
|
||||||
this.Cookies.setItem('distributionId', params.distributionId)
|
this.Cookies.setItem("distributionId", params.distributionId);
|
||||||
let _this = this;
|
let _this = this;
|
||||||
// 绑定关系
|
// 绑定关系
|
||||||
getGoodsDistribution(params.distributionId).then(res => {
|
getGoodsDistribution(params.distributionId).then((res) => {
|
||||||
// 绑定成功,则清除关系
|
// 绑定成功,则清除关系
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
_this.Cookies.removeItem('distributionId');
|
_this.Cookies.removeItem("distributionId");
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
goodsSkuDetail(params).then((res) => {
|
goodsSkuDetail(params)
|
||||||
|
.then((res) => {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const result = res.result;
|
const result = res.result;
|
||||||
const cateName = res.result.categoryName;
|
const cateName = res.result.categoryName;
|
||||||
const cateId = result.data.categoryPath.split(',');
|
const cateId = result.data.categoryPath.split(",");
|
||||||
const cateArr = [];
|
const cateArr = [];
|
||||||
cateId.forEach((e, index) => { // 插入分类id和name
|
cateId.forEach((e, index) => {
|
||||||
|
// 插入分类id和name
|
||||||
cateArr.push({
|
cateArr.push({
|
||||||
id: e,
|
id: e,
|
||||||
name: cateName[index]
|
name: cateName[index],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.categoryBar = cateArr;
|
this.categoryBar = cateArr;
|
||||||
this.goodsMsg = res.result;
|
this.goodsMsg = res.result;
|
||||||
// 判断是否收藏
|
// 判断是否收藏
|
||||||
if (this.Cookies.getItem('userInfo')) {
|
if (this.Cookies.getItem("userInfo")) {
|
||||||
isCollection('STORE', this.goodsMsg.data.storeId).then(res => {
|
isCollection("STORE", this.goodsMsg.data.storeId).then((res) => {
|
||||||
if (res.success && res.result) {
|
if (res.success && res.result) {
|
||||||
this.storeCollected = true;
|
this.storeCollected = true;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 获取店铺信息
|
// 获取店铺信息
|
||||||
getDetailById(this.goodsMsg.data.storeId).then(res => {
|
getDetailById(this.goodsMsg.data.storeId).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.storeMsg = res.result
|
this.storeMsg = res.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$Message.error(res.message);
|
||||||
|
this.$router.push("/");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
.catch(() => {
|
||||||
this.$Message.error(res.message)
|
this.$router.push("/");
|
||||||
this.$router.push('/')
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
|
||||||
this.$router.push('/')
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
goGoodsList (currIndex) { // 跳转商品列表
|
goGoodsList(currIndex) {
|
||||||
const arr = []
|
// 跳转商品列表
|
||||||
|
const arr = [];
|
||||||
this.categoryBar.forEach((e, index) => {
|
this.categoryBar.forEach((e, index) => {
|
||||||
if (index <= currIndex) {
|
if (index <= currIndex) {
|
||||||
arr.push(e.id)
|
arr.push(e.id);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
return location.origin + '/goodsList?categoryId=' + arr.toString()
|
return location.origin + "/goodsList?categoryId=" + arr.toString();
|
||||||
},
|
},
|
||||||
async collect () { // 收藏店铺
|
async collect() {
|
||||||
|
// 收藏店铺
|
||||||
if (this.storeCollected) {
|
if (this.storeCollected) {
|
||||||
let cancel = await cancelCollect('STORE', this.goodsMsg.data.storeId)
|
let cancel = await cancelCollect("STORE", this.goodsMsg.data.storeId);
|
||||||
if (cancel.success) {
|
if (cancel.success) {
|
||||||
this.$Message.success('已取消收藏')
|
this.$Message.success("已取消收藏");
|
||||||
this.storeCollected = false;
|
this.storeCollected = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let collect = await collectGoods('STORE', this.goodsMsg.data.storeId);
|
let collect = await collectGoods("STORE", this.goodsMsg.data.storeId);
|
||||||
if (collect.code === 200) {
|
if (collect.code === 200) {
|
||||||
this.storeCollected = true;
|
this.storeCollected = true;
|
||||||
this.$Message.success('收藏店铺成功,可以前往个人中心我的收藏查看');
|
this.$Message.success("收藏店铺成功,可以前往个人中心我的收藏查看");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.query.skuId': function (val) {
|
"$route.query.skuId": function (val) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {},
|
},
|
||||||
|
computed: {
|
||||||
|
IM() {
|
||||||
|
return this.IMLink + this.storeMsg.merchantEuid;
|
||||||
|
},
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
Search,
|
Search,
|
||||||
ShopHeader,
|
ShopHeader,
|
||||||
ShowGoods,
|
ShowGoods,
|
||||||
ShowGoodsDetail
|
ShowGoodsDetail,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
@ -13,6 +13,7 @@ const configs = require('./src/config')
|
||||||
*/
|
*/
|
||||||
const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境
|
const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境
|
||||||
|
|
||||||
|
|
||||||
let externals = {
|
let externals = {
|
||||||
vue: "Vue",
|
vue: "Vue",
|
||||||
axios: "axios",
|
axios: "axios",
|
||||||
|
@ -53,8 +54,8 @@ let jsPlugin = [
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
// 判断是否需要加载CDN
|
// 判断是否需要加载CDN
|
||||||
cdn = enableProduction ? cdn : { css: [], js: [] };
|
cdn = enableProduction && configs.enableCDN ? cdn : { css: [], js: [] };
|
||||||
externals = enableProduction ? externals : {};
|
externals = enableProduction && configs.enableCDN ? externals : {};
|
||||||
jsPlugin = enableProduction ? jsPlugin : [];
|
jsPlugin = enableProduction ? jsPlugin : [];
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -80,7 +81,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
devServer: {
|
devServer: {
|
||||||
port: 10000
|
port: configs.port
|
||||||
},
|
},
|
||||||
|
|
||||||
// 打包时不生成.map文件 避免看到源码
|
// 打包时不生成.map文件 避免看到源码
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
# 默认依赖包指定淘宝源
|
||||||
|
registry=https://registry.npm.taobao.org/
|
||||||
|
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
|
||||||
|
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
|
||||||
|
electron_mirror=https://npm.taobao.org/mirrors/electron/
|
|
@ -0,0 +1,5 @@
|
||||||
|
registry "https://registry.npmmirror.com"
|
||||||
|
sass_binary_site "https://npmmirror.com/mirrors/node-sass"
|
||||||
|
phantomjs_cdnurl "https://npmmirror.com/mirrors/phantomjs"
|
||||||
|
electron_mirror "https://npmmirror.com/mirrors/electron"
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
export default {
|
module.exports = {
|
||||||
/**
|
title: "lilishop", //配置显示在浏览器标签的title
|
||||||
* @description 配置显示在浏览器标签的title
|
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
|
||||||
*/
|
website: "https://www.pickmall.cn", //官网地址
|
||||||
title: "lilishop",
|
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
|
||||||
/**
|
port:10003, //端口
|
||||||
* @description 高德web端申请的api key
|
|
||||||
*/
|
|
||||||
aMapKey: "b440952723253aa9fe483e698057bf7d",
|
|
||||||
/**
|
|
||||||
* @description 官网地址
|
|
||||||
*/
|
|
||||||
website: "https://www.pickmall.cn",
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
import config from '@/config/index'
|
|
||||||
export default {
|
export default {
|
||||||
lili: config.title,
|
|
||||||
usernameLogin: 'UsernameLogin',
|
usernameLogin: 'UsernameLogin',
|
||||||
mobileLogin: 'MobileLogin',
|
mobileLogin: 'MobileLogin',
|
||||||
autoLogin: 'Auto Login',
|
autoLogin: 'Auto Login',
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import config from '@/config/index'
|
|
||||||
export default {
|
export default {
|
||||||
lili: config.title,
|
|
||||||
usernameLogin: '账户密码登录',
|
usernameLogin: '账户密码登录',
|
||||||
mobileLogin: '手机号登录',
|
mobileLogin: '手机号登录',
|
||||||
autoLogin: '自动登录',
|
autoLogin: '自动登录',
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import Main from "@/views/Main.vue";
|
import Main from "@/views/Main.vue";
|
||||||
import config from '@/config/index'
|
|
||||||
|
const config = require('@/config/index')
|
||||||
// 不作为Main组件的子页面展示的页面单独写,如下
|
// 不作为Main组件的子页面展示的页面单独写,如下
|
||||||
export const loginRouter = {
|
export const loginRouter = {
|
||||||
path: "/login",
|
path: "/login",
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import config from '@/config/index'
|
|
||||||
|
const config = require('@/config/index')
|
||||||
export default {
|
export default {
|
||||||
name: "footer",
|
name: "footer",
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -31,7 +31,8 @@
|
||||||
<script>
|
<script>
|
||||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||||
import { getRegion } from "@/api/common.js";
|
import { getRegion } from "@/api/common.js";
|
||||||
import config from '@/config'
|
|
||||||
|
const config = require('@/config/index')
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -255,8 +255,8 @@ import {
|
||||||
deleteFile,
|
deleteFile,
|
||||||
} from "@/api/index";
|
} from "@/api/index";
|
||||||
import DPlayer from "dplayer";
|
import DPlayer from "dplayer";
|
||||||
import config from "@/config";
|
|
||||||
|
|
||||||
|
const config = require('@/config/index')
|
||||||
import { commonUrl } from "@/libs/axios";
|
import { commonUrl } from "@/libs/axios";
|
||||||
var dp;
|
var dp;
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
const configs = require('./src/config')
|
||||||
const CompressionPlugin = require("compression-webpack-plugin");
|
const CompressionPlugin = require("compression-webpack-plugin");
|
||||||
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
||||||
const resolve = dir => {
|
const resolve = dir => {
|
||||||
|
@ -12,6 +13,7 @@ const resolve = dir => {
|
||||||
*/
|
*/
|
||||||
const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境
|
const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境
|
||||||
|
|
||||||
|
|
||||||
let externals = {
|
let externals = {
|
||||||
vue: "Vue",
|
vue: "Vue",
|
||||||
axios: "axios",
|
axios: "axios",
|
||||||
|
@ -63,8 +65,9 @@ let jsPlugin = [
|
||||||
];
|
];
|
||||||
|
|
||||||
// 判断是否需要加载CDN,线上删除注释
|
// 判断是否需要加载CDN,线上删除注释
|
||||||
cdn = enableProduction ? cdn : { css: [], js: [] };
|
|
||||||
externals = enableProduction ? externals : {};
|
cdn = enableProduction && configs.enableCDN ? cdn : { css: [], js: [] };
|
||||||
|
externals = enableProduction && configs.enableCDN ? externals : {};
|
||||||
jsPlugin = enableProduction ? jsPlugin : [];
|
jsPlugin = enableProduction ? jsPlugin : [];
|
||||||
module.exports = {
|
module.exports = {
|
||||||
css: {
|
css: {
|
||||||
|
@ -78,7 +81,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
devServer: {
|
devServer: {
|
||||||
port: 10003
|
port: configs.port
|
||||||
},
|
},
|
||||||
|
|
||||||
// 打包时不生成.map文件 避免看到源码
|
// 打包时不生成.map文件 避免看到源码
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
registry "https://registry.npmmirror.com"
|
||||||
|
sass_binary_site "https://npmmirror.com/mirrors/node-sass"
|
||||||
|
phantomjs_cdnurl "https://npmmirror.com/mirrors/phantomjs"
|
||||||
|
electron_mirror "https://npmmirror.com/mirrors/electron"
|
||||||
|
|
|
@ -1,16 +1,7 @@
|
||||||
export default {
|
module.exports = {
|
||||||
/**
|
title: "lilishop", //配置显示在浏览器标签的title
|
||||||
* @description 配置显示在浏览器标签的title
|
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
|
||||||
*/
|
website: "https://www.pickmall.cn", //官网地址
|
||||||
title: "lilishop",
|
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
|
||||||
|
port:10002, //端口
|
||||||
/**
|
|
||||||
* @description 高德web端申请的api key
|
|
||||||
*/
|
|
||||||
aMapKey: "b440952723253aa9fe483e698057bf7d",
|
|
||||||
/**
|
|
||||||
* @description 官网地址
|
|
||||||
*/
|
|
||||||
website: "https://www.pickmall.cn",
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,8 @@ import lazyLoading from './lazyLoading.js';
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import { result } from './routerJson.js';
|
import { result } from './routerJson.js';
|
||||||
|
|
||||||
import config from '@/config/index'
|
const config = require('@/config/index')
|
||||||
|
|
||||||
let util = {
|
let util = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import Main from "@/views/Main.vue";
|
import Main from "@/views/Main.vue";
|
||||||
import config from '@/config/index'
|
|
||||||
|
const config = require('@/config/index')
|
||||||
// 不作为Main组件的子页面展示的页面单独写,如下
|
// 不作为Main组件的子页面展示的页面单独写,如下
|
||||||
export const loginRouter = {
|
export const loginRouter = {
|
||||||
path: "/login",
|
path: "/login",
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import config from '@/config/index'
|
|
||||||
|
const config = require('@/config/index')
|
||||||
export default {
|
export default {
|
||||||
name: "footer",
|
name: "footer",
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -31,7 +31,8 @@
|
||||||
<script>
|
<script>
|
||||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||||
import { getRegion } from "@/api/common.js";
|
import { getRegion } from "@/api/common.js";
|
||||||
import config from '@/config'
|
|
||||||
|
const config = require('@/config/index')
|
||||||
export default {
|
export default {
|
||||||
name: "map",
|
name: "map",
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
const configs = require('./src/config')
|
||||||
const CompressionPlugin = require("compression-webpack-plugin");
|
const CompressionPlugin = require("compression-webpack-plugin");
|
||||||
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
||||||
const resolve = dir => {
|
const resolve = dir => {
|
||||||
|
@ -11,6 +12,7 @@ const resolve = dir => {
|
||||||
* 我们可以根据环境变量进行相应的处理,只有在产品的时候,才让插件去自动注入相应的资源文件到html页面
|
* 我们可以根据环境变量进行相应的处理,只有在产品的时候,才让插件去自动注入相应的资源文件到html页面
|
||||||
*/
|
*/
|
||||||
const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境
|
const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境
|
||||||
|
// const enableProduction = false // 统一取消cdn加载 目前cdn链接的https请求挂了
|
||||||
|
|
||||||
let externals = {
|
let externals = {
|
||||||
vue: "Vue",
|
vue: "Vue",
|
||||||
|
@ -60,8 +62,8 @@ let jsPlugin = [
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
// 判断是否需要加载CDN
|
// 判断是否需要加载CDN
|
||||||
cdn = enableProduction ? cdn : { css: [], js: [] };
|
cdn = enableProduction && configs.enableCDN ? cdn : { css: [], js: [] };
|
||||||
externals = enableProduction ? externals : {};
|
externals = enableProduction && configs.enableCDN ? externals : {};
|
||||||
jsPlugin = enableProduction ? jsPlugin : [];
|
jsPlugin = enableProduction ? jsPlugin : [];
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -83,7 +85,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
devServer: {
|
devServer: {
|
||||||
port: 10002
|
port: configs.port
|
||||||
},
|
},
|
||||||
|
|
||||||
// 打包时不生成.map文件 避免看到源码
|
// 打包时不生成.map文件 避免看到源码
|
||||||
|
|
Loading…
Reference in New Issue