Compare commits
33 Commits
release/v1
...
custom/com
| Author | SHA1 | Date | |
|---|---|---|---|
| 23c954981b | |||
| aa2f13f3b2 | |||
| 09c49365a3 | |||
| 40c1d27f02 | |||
| ae5577c0ee | |||
| 04d045e81e | |||
| 30fef9770a | |||
| 3f666a5e83 | |||
| 94c9d1c556 | |||
| 3acd3870b6 | |||
| bec0a51d81 | |||
| d744e1c16d | |||
| 6a1bf3b5bc | |||
| 526de0d73f | |||
| dcf3703892 | |||
| 6894950b7e | |||
| 781bb8845e | |||
| b70725c104 | |||
| 8dce1058f6 | |||
| 6b6c50ebb8 | |||
| b079487c9a | |||
| ef7b609efb | |||
| 7a28bb7f7a | |||
| 921e8b79b1 | |||
| 0101c36012 | |||
| 469bc4da81 | |||
| 50072c45ab | |||
| c790d63005 | |||
| 71c866c0f8 | |||
| a5740f53af | |||
| 8f0a13c473 | |||
| 6d0c914e79 | |||
| 3fec0470cf |
@@ -20,10 +20,6 @@ try {
|
|||||||
// 默认域名, 自定义发行时可以修改
|
// 默认域名, 自定义发行时可以修改
|
||||||
let defaultDomain = '';
|
let defaultDomain = '';
|
||||||
|
|
||||||
// #ifdef H5_XCX_5G_QUICKAPP_COM
|
|
||||||
defaultDomain = 'https://xcx20.5g-quickapp.com';
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifdef H5_XCX_AIGC_QUICKAPP_COM
|
// #ifdef H5_XCX_AIGC_QUICKAPP_COM
|
||||||
defaultDomain = 'https://xcx.aigc-quickapp.com/';
|
defaultDomain = 'https://xcx.aigc-quickapp.com/';
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ export default {
|
|||||||
groupby_promotion_aux_color: '#F7B500',//活动辅色
|
groupby_promotion_aux_color: '#F7B500',//活动辅色
|
||||||
},
|
},
|
||||||
...{
|
...{
|
||||||
hover_nav_bg_color: '#FFFC', //背景色: 红色 '#c6251b', 白色: '#FFFC'
|
hover_nav_bg_color: '#c6251b', //背景色: 红色 '#c6251b', 白色: '#FFFC'
|
||||||
hover_nav_text_color: '#000' // 文字颜色: 白色 '#FFFFFF', 黑色: '#000'
|
hover_nav_text_color: '#FFFFFF' // 文字颜色: 白色 '#FFFFFF', 黑色: '#000'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'green': {
|
'green': {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
},
|
},
|
||||||
"router" : {
|
"router" : {
|
||||||
"mode" : "history",
|
"mode" : "history",
|
||||||
"base" : "/hwappx/2811/"
|
"base" : "/hwappx/common/"
|
||||||
},
|
},
|
||||||
"title" : "",
|
"title" : "",
|
||||||
"devServer" : {
|
"devServer" : {
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -21,17 +21,6 @@
|
|||||||
"PRODUCTION": true
|
"PRODUCTION": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"h5-xcx20.5g-quickapp.com": {
|
|
||||||
"title": "H5-xcx20.5g-quickapp.com",
|
|
||||||
"env": {
|
|
||||||
"UNI_PLATFORM": "h5"
|
|
||||||
},
|
|
||||||
"define": {
|
|
||||||
"H5_XCX_5G_QUICKAPP_COM": true,
|
|
||||||
"H5_PRODUCTION": true,
|
|
||||||
"PRODUCTION": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"h5-xcx.aigc-quickapp.com": {
|
"h5-xcx.aigc-quickapp.com": {
|
||||||
"title": "H5-xcx.aigc-quickapp.com",
|
"title": "H5-xcx.aigc-quickapp.com",
|
||||||
"env": {
|
"env": {
|
||||||
|
|||||||
@@ -321,7 +321,6 @@ export default {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
>>>.uni-tag--primary.uni-tag--inverted {
|
>>>.uni-tag--primary.uni-tag--inverted {
|
||||||
background-color: #f5f5f5 !important;
|
background-color: #f5f5f5 !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<view class="view_ul_100" v-for="(item, index) in dataList" :key="index"
|
<view class="view_ul_100" v-for="(item, index) in dataList" :key="index"
|
||||||
style="margin-bottom: 20rpx;">
|
style="margin-bottom: 20rpx;">
|
||||||
|
|
||||||
@@ -88,12 +89,8 @@
|
|||||||
</map>
|
</map>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view wx:if="landline !=0">
|
<!-- <view wx:if="landline !=0">
|
||||||
<button bindtap="contact">
|
<button bindtap="contact">
|
||||||
<view class="message">
|
<view class="message">
|
||||||
@@ -116,44 +113,20 @@
|
|||||||
<view class="fui-cell ">
|
<view class="fui-cell ">
|
||||||
<view class="fui-cell-label ">{{ $lang('name') }}</view>
|
<view class="fui-cell-label ">{{ $lang('name') }}</view>
|
||||||
<view class="fui-cell-info">
|
<view class="fui-cell-info">
|
||||||
<input
|
<input v-model="Form.realname" class="fui-input" :placeholder="$lang('pleaseEnterName')" value=""></input>
|
||||||
id="input-realname"
|
|
||||||
:value="Form.realname"
|
|
||||||
@input="e => Form.realname = e.detail.value"
|
|
||||||
class="fui-input"
|
|
||||||
:placeholder="$lang('pleaseEnterName')"
|
|
||||||
:key="formKey"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fui-cell ">
|
<view class="fui-cell ">
|
||||||
<view class="fui-cell-label">{{ $lang('contactInfo') }}</view>
|
<view class="fui-cell-label">{{ $lang('contactInfo') }}</view>
|
||||||
<view class="fui-cell-info">
|
<view class="fui-cell-info">
|
||||||
<input
|
<input v-model="Form.mobile" class="fui-input" maxlength="11" :placeholder="$lang('pleaseEnterMobile')" type="number"></input>
|
||||||
id="input-mobile"
|
|
||||||
:value="Form.mobile"
|
|
||||||
@input="e => Form.mobile = e.detail.value"
|
|
||||||
class="fui-input"
|
|
||||||
maxlength="11"
|
|
||||||
:placeholder="$lang('pleaseEnterMobile')"
|
|
||||||
type="number"
|
|
||||||
:key="formKey"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fui-cell ">
|
<view class="fui-cell ">
|
||||||
<view class="fui-cell-label" style="position: absolute;top:10px">{{ $lang('messageContent') }}</view>
|
<view class="fui-cell-label" style="position: absolute;top:10px">{{ $lang('messageContent') }}</view>
|
||||||
<view class="fui-cell-info" style="margin-left: 160rpx;border: solid 2rpx #eee;">
|
<view class="fui-cell-info" style="margin-left: 160rpx;border: solid 2rpx #eee;">
|
||||||
<!-- <input v-model="Form.mailbox" class="fui-input" placeholder="请输入您的邮箱" type="text" ></input> -->
|
<!-- <input v-model="Form.mailbox" class="fui-input" placeholder="请输入您的邮箱" type="text" ></input> -->
|
||||||
<textarea
|
<textarea class="textarea" v-model="Form.remark" :placeholder="$lang('pleaseEnterMessage')" style="font-size: 28rpx;padding: 10rpx;"></textarea>
|
||||||
id="textarea-remark"
|
|
||||||
:value="Form.remark"
|
|
||||||
@input="e => Form.remark = e.detail.value"
|
|
||||||
class="textarea"
|
|
||||||
:placeholder="$lang('pleaseEnterMessage')"
|
|
||||||
style="font-size: 28rpx;padding: 10rpx;"
|
|
||||||
:key="formKey"
|
|
||||||
></textarea>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -176,15 +149,15 @@ export default {
|
|||||||
mixins: [scroll],
|
mixins: [scroll],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
minScrollTop: 100,
|
minScrollTop: 100, // 设置回到顶端按钮显示要求,最小页面滚动距离
|
||||||
dataList: [],
|
dataList: [],
|
||||||
ismessage: 0,
|
ismessage: 0,
|
||||||
Form: {
|
Form: {
|
||||||
realname: '',
|
realname: '',
|
||||||
mobile: '',
|
mobile: '',
|
||||||
remark: ''
|
remark: ''
|
||||||
|
|
||||||
},
|
},
|
||||||
formKey: Date.now(),
|
|
||||||
markers: [
|
markers: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@@ -209,22 +182,25 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
//刷新多语言
|
||||||
this.$langConfig.refresh();
|
this.$langConfig.refresh();
|
||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
url: '/api/member/personnel',
|
url: '/api/member/personnel',
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.dataList = res.data;
|
this.dataList = res.data
|
||||||
this.shop = res.shop;
|
this.shop = res.shop
|
||||||
this.personnel_bg = res.set.personnel_bg ? res.set.personnel_bg : 'public/static/img/diy_view/member_info_bg.png';
|
this.personnel_bg = res.set.personnel_bg ? res.set.personnel_bg : 'public/static/img/diy_view/member_info_bg.png'
|
||||||
this.markers = [{
|
this.markers = [{
|
||||||
id: 1,
|
id: 1,
|
||||||
|
//iconPath:'http://saas.cn//public/static/img/kefu.png',
|
||||||
latitude: this.shop.latitude,
|
latitude: this.shop.latitude,
|
||||||
longitude: this.shop.longitude
|
longitude: this.shop.longitude
|
||||||
}];
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: res => {}
|
fail: res => {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -246,105 +222,47 @@ export default {
|
|||||||
// window.open('https://xcx10.5g-quickapp.com/test.php')
|
// window.open('https://xcx10.5g-quickapp.com/test.php')
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
if (!this.Form.realname.trim()) {
|
|
||||||
uni.showToast({ title: '请填写姓名', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.Form.mobile || !/^1[3-9]\d{9}$/.test(this.Form.mobile)) {
|
|
||||||
uni.showToast({ title: '手机号格式不正确', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.Form.remark.trim()) {
|
|
||||||
uni.showToast({ title: '请填写留言内容', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
url: '/api/member/message',
|
url: '/api/member/message',
|
||||||
data: this.Form,
|
data: this.Form,
|
||||||
success: res => {
|
success: res => {
|
||||||
uni.showToast({ title: res.message || '提交成功', icon: 'success' });
|
|
||||||
|
|
||||||
|
|
||||||
// 重置表单数据
|
|
||||||
this.Form = { realname: '', mobile: '', remark: '' };
|
|
||||||
this.formKey = Date.now();
|
|
||||||
|
|
||||||
// 关闭弹窗
|
|
||||||
this.$refs.informationPopup.close();
|
this.$refs.informationPopup.close();
|
||||||
|
this.$util.showToast({
|
||||||
// 微信小程序:延迟清空原生输入框(确保 DOM 已更新)
|
title: res.message
|
||||||
// #ifdef MP-WEIXIN
|
});
|
||||||
setTimeout(() => {
|
|
||||||
this.clearInputValues();
|
|
||||||
}, 100);
|
|
||||||
// #endif
|
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: res => {
|
||||||
uni.showToast({ title: '提交失败,请重试', icon: 'none' });
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
change(e) {
|
change(e) {
|
||||||
this.ismessage = e.show ? 1 : 0;
|
console.log(e)
|
||||||
|
this.ismessage = e.show ? 1 : 0
|
||||||
},
|
},
|
||||||
|
//留言打开
|
||||||
tapMessage() {
|
tapMessage() {
|
||||||
// 重置数据
|
this.ismessage = 1
|
||||||
this.Form = { realname: '', mobile: '', remark: '' };
|
|
||||||
this.formKey = Date.now();
|
|
||||||
this.ismessage = 1;
|
|
||||||
this.$refs.informationPopup.open();
|
this.$refs.informationPopup.open();
|
||||||
|
|
||||||
// 微信小程序:打开后清空原生输入框
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
setTimeout(() => {
|
|
||||||
this.clearInputValues();
|
|
||||||
}, 300); // 确保弹窗已渲染
|
|
||||||
// #endif
|
|
||||||
},
|
},
|
||||||
|
//留言关闭
|
||||||
closeinformationPopup() {
|
closeinformationPopup() {
|
||||||
this.ismessage = 0;
|
this.ismessage = 0
|
||||||
this.$refs.informationPopup.close();
|
this.$refs.informationPopup.close();
|
||||||
|
|
||||||
// 微信小程序:关闭后也清空(防止下次打开残留)
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
setTimeout(() => {
|
|
||||||
this.clearInputValues();
|
|
||||||
}, 100);
|
|
||||||
// #endif
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 专门用于微信小程序清空原生 input/textarea
|
|
||||||
clearInputValues() {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
const query = uni.createSelectorQuery().in(this);
|
|
||||||
|
|
||||||
// 分别清空每个输入框
|
|
||||||
['input-realname', 'input-mobile', 'textarea-remark'].forEach(id => {
|
|
||||||
query.select('#' + id).fields({ node: true }, (res) => {
|
|
||||||
if (res && res.node) {
|
|
||||||
res.node.value = '';
|
|
||||||
}
|
|
||||||
}).exec();
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
|
|
||||||
Tel(m) {
|
Tel(m) {
|
||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: m + '',
|
phoneNumber: m + '',
|
||||||
success(e) {
|
success(e) {
|
||||||
console.log(e);
|
console.log(e)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
copy(text) {
|
copy(text) {
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: text,
|
data: text,
|
||||||
success: () => {
|
success: () => {
|
||||||
|
console.log('复制成功');
|
||||||
|
// 可以添加用户友好的提示,例如使用uni.showToast提示复制成功
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: this.$lang('copySuccess'),
|
title: this.$lang('copySuccess'),
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
@@ -352,6 +270,8 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
|
console.log('复制失败');
|
||||||
|
// 可以添加错误处理或用户友好的提示
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.message || err.errMsg || this.$lang('copyFailed'),
|
title: err.message || err.errMsg || this.$lang('copyFailed'),
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -360,13 +280,12 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
tomap() {
|
tomap() {
|
||||||
uni.openLocation({
|
uni.openLocation({
|
||||||
latitude: parseFloat(this.shop.latitude),
|
latitude: parseFloat(this.shop.latitude),
|
||||||
longitude: parseFloat(this.shop.longitude),
|
longitude: parseFloat(this.shop.longitude),
|
||||||
name: this.$lang('oneClickNavigation'),
|
name: this.$lang('oneClickNavigation'),
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -519,6 +438,7 @@ image {
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
image {
|
image {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
@@ -563,12 +483,13 @@ image {
|
|||||||
line-height: 20rpx;
|
line-height: 20rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.view_ul_100 .fl {
|
.view_ul_100 .fl {
|
||||||
width: 10%;
|
width: 10%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.view_ul_100 .fr {
|
.view_ul_100 .fr {
|
||||||
/* padding-left: 30rpx;*/
|
/* padding-left: 30rpx;*/
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -590,6 +511,7 @@ image {
|
|||||||
.list_cotact .view_ul_100>view {
|
.list_cotact .view_ul_100>view {
|
||||||
padding: 20rpx 30rpx 0rpx 30rpx;
|
padding: 20rpx 30rpx 0rpx 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list_cotact .view_ul_two .view_li>view {
|
.list_cotact .view_ul_two .view_li>view {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 20rpx 30rpx 0rpx 30rpx;
|
padding: 20rpx 30rpx 0rpx 30rpx;
|
||||||
@@ -609,6 +531,7 @@ image {
|
|||||||
.view_ul_two {
|
.view_ul_two {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contact_name {
|
.contact_name {
|
||||||
color: rgba(71, 71, 71, .79);
|
color: rgba(71, 71, 71, .79);
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
@@ -630,7 +553,7 @@ image {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 50rpx;
|
border-radius: 50rpx;
|
||||||
width: 160rpx;
|
width: 160rpx; // 足够容纳4个汉字(8个字符)
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.15), 0 1rpx 3rpx rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.15), 0 1rpx 3rpx rgba(0, 0, 0, 0.1);
|
||||||
@@ -642,6 +565,7 @@ image {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.message {
|
.message {
|
||||||
|
/* background-color: rgba(0,0,0,.8); */
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
bottom: 50%;
|
bottom: 50%;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
|
|||||||
14
readme.md
14
readme.md
@@ -30,10 +30,9 @@
|
|||||||
|
|
||||||
1. 使用HBuilderX打开项目
|
1. 使用HBuilderX打开项目
|
||||||
2. 选择菜单栏 "发行" -> "小程序-微信",进行发布构建
|
2. 选择菜单栏 "发行" -> "小程序-微信",进行发布构建
|
||||||
4. 0
|
3. 然后在终端进入项目根目录,执行 `npm run mp-weixin` 手动输出构建包。例如:mp-weixin-2025-10-31-1761881054836.zip
|
||||||
3. 然后在终端进入项目根目录,执行 `npm run mp-weixin` 手动输出构建包。例如:mp-weixin-2025-10-31-1761881054836.zip(改id)
|
4. 然后将mp-weixin-2025-10-31-1761881054836发给微信开发定制客户技术人员,
|
||||||
5. 然后将mp-weixin-2025-10-31-1761881054836发给微信开发定制客户技术人员,
|
5. 定制客户技术人员可以修改解压后,修改项目根目录下的site.js,进行针对客户的信息配置,然后使用微信开发者工具打开发布后的代码进行上传发布
|
||||||
6. 定制客户技术人员可以修改解压后,修改项目根目录下的site.js,进行针对客户的信息配置,然后使用微信开发者工具打开发布后的代码进行上传发布
|
|
||||||
|
|
||||||
参照:`common\js\config.js` 文件内容说明:
|
参照:`common\js\config.js` 文件内容说明:
|
||||||
|
|
||||||
@@ -115,8 +114,5 @@ export default config;
|
|||||||
|
|
||||||
### 快应用发布
|
### 快应用发布
|
||||||
1. 使用HBuilderX打开项目
|
1. 使用HBuilderX打开项目
|
||||||
2. manifest.jion---web配置---基础路径---/hwappx/改编号/
|
2. 选择菜单栏 "发行" -> "快应用",进行发布构建
|
||||||
3. 选择菜单栏 "发行" ->自定义发行---H5-xcx.aigc-quickapp.com "快应用",进行发布构建
|
3. 使用快应用开发者工具打开发布后的代码进行上传发布
|
||||||
4. unpackage---dist---build---web---打包(可以写上id)
|
|
||||||
5. 然后将压缩包发给开发定制客户技术人员,
|
|
||||||
6. 使用快应用开发者工具打开发布后的代码进行上传发布
|
|
||||||
@@ -1,40 +1,8 @@
|
|||||||
const path = require('path');
|
|
||||||
const { zionUniMpLoadPackagePlugin } = require('zion-uniapp-mp-load-package/webpack');
|
const { zionUniMpLoadPackagePlugin } = require('zion-uniapp-mp-load-package/webpack');
|
||||||
|
|
||||||
// 打印出process.env
|
|
||||||
// for (let key in process.env) {
|
|
||||||
// console.log(key, process.env[key]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// 定义UNI_OUTPUT_DIR环境变量
|
|
||||||
try {
|
|
||||||
if (!process.env.NODE_ENV) {
|
|
||||||
throw new Error('NODE_ENV 环境变量未设置');
|
|
||||||
}
|
|
||||||
|
|
||||||
const buildDir = process.env.NODE_ENV === 'production' ? 'build' : 'dev';
|
|
||||||
|
|
||||||
const UNI_SCRIPT = process.env.UNI_SCRIPT ?? '';
|
|
||||||
|
|
||||||
if ([
|
|
||||||
// 参照 package.json 中定义的 "uni-app" --> "scripts"
|
|
||||||
'h5-xcx20.5g-quickapp.com', 'h5-xcx.aigc-quickapp.com', 'h5-5g.aigc-quickapp.com', 'h5-test.aigc-quickapp.com'
|
|
||||||
].includes(UNI_SCRIPT)) {
|
|
||||||
process.env.UNI_OUTPUT_DIR = path.join(__dirname, `unpackage/dist/${buildDir}/h5/${UNI_SCRIPT}`);
|
|
||||||
console.log('UNI_OUTPUT_DIR = ', process.env.UNI_OUTPUT_DIR);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
console.log('NODE_ENV 环境变量未设置,默认使用开发模式');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出配置
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
configureWebpack: config => {
|
configureWebpack: config => {
|
||||||
console.log('config.mode = ', config.mode);
|
console.log('config.mode = ', config.mode);
|
||||||
|
|
||||||
if (config.mode === 'production') {
|
if (config.mode === 'production') {
|
||||||
console.log('开始尝试配置极限压缩');
|
console.log('开始尝试配置极限压缩');
|
||||||
// 配置zion-uniapp-mp-load-package插件
|
// 配置zion-uniapp-mp-load-package插件
|
||||||
|
|||||||
Reference in New Issue
Block a user