fix(config): 允许dev模式编译运行正常

This commit is contained in:
2025-10-29 16:44:33 +08:00
parent b56a977f2b
commit 19ba4856a4
2 changed files with 313 additions and 308 deletions

View File

@@ -1,69 +1,74 @@
// 发行版本,配置说明 // 发行版本,配置说明
const releaseCfg = { let releaseCfg = undefined;
baseUrl: site.baseUrl, try {
imgDomain: site.baseUrl, if (site) {
h5Domain: site.baseUrl, releaseCfg = {
uniacid: site.uniacid, //825 baseUrl: site.baseUrl,
}; imgDomain: site.baseUrl,
h5Domain: site.baseUrl,
// 调试版本,配置说明 uniacid: site.uniacid, //825
const devCfg = { }
// 商户ID }
uniacid: 305, //825 } catch (e) {}
//api请求地址 // 调试版本,配置说明
baseUrl: 'https://xcx30.5g-quickapp.com/', const devCfg = {
// 商户ID
// 图片域名 uniacid: 305, //825
imgDomain: 'https://xcx30.5g-quickapp.com/',
//api请求地址
// H5端域名 baseUrl: 'https://xcx30.5g-quickapp.com/',
h5Domain: 'https://xcx30.5g-quickapp.com/',
// 图片域名
// // api请求地址 imgDomain: 'https://xcx30.5g-quickapp.com/',
// baseUrl: 'https://tsaas.liveplatform.cn/',
// H5端域名
// // 图片域名 h5Domain: 'https://xcx30.5g-quickapp.com/',
// imgDomain: 'https://tsaas.liveplatform.cn/',
// // api请求地址
// // H5端域名 // baseUrl: 'https://tsaas.liveplatform.cn/',
// h5Domain: 'https://tsaas.liveplatform.cn/',
// // 图片域名
// api请求地址 // imgDomain: 'https://tsaas.liveplatform.cn/',
// baseUrl: 'http://saas.cn/',
// // H5端域名
// // 图片域名 // h5Domain: 'https://tsaas.liveplatform.cn/',
// imgDomain: 'http://saas.cn/',
// api请求地址
// // H5端域名 // baseUrl: 'http://saas.cn/',
// h5Domain: 'http://saas.cn/',
}; // // 图片域名
// imgDomain: 'http://saas.cn/',
export default { // // H5端域名
/** // h5Domain: 'http://saas.cn/',
* 1.开发调试模式 };
* 去掉注释 ...devCfg;
* 注释掉 ...releaseCfg, var config = {
* 2.发行/发布模式,例如通过`HBuilder>发行>小程序微信`的时候, /**
* 注释掉 ...devCfg; * 1.开发调试模式
* 去掉注释 ...releaseCfg, * 去掉注释 ...devCfg;
* 然后将 `import site from "../site.js";`追加到 `unpackage\dist\build\mp-weixin\common\vendor.js` 文件内容开头部分 * 注释掉 ...releaseCfg,
* 然后将 site.js 文件放到 `unpackage\dist\build\mp-weixin\` 目录下面 * 2.发行/发布模式,例如通过`HBuilder>发行>小程序微信`的时候,
*/ * 注释掉 ...devCfg;
...devCfg, * 去掉注释 ...releaseCfg,
// ...releaseCfg, * 然后将 `import site from "../site.js";`追加到 `unpackage\dist\build\mp-weixin\common\vendor.js` 文件内容开头部分
* 然后将 site.js 文件放到 `unpackage\dist\build\mp-weixin\` 目录下面
*/
// 腾讯地图key ...(releaseCfg ?? devCfg),
mpKey: 'TUHBZ-CNWKU-UHAVP-GZQ26-HNZFO-3YBF4',
//客服地址 // 腾讯地图key
webSocket: '{{$webSocket}}', mpKey: 'TUHBZ-CNWKU-UHAVP-GZQ26-HNZFO-3YBF4',
//本地端主动给服务器ping的时间, 0 则不开启 , 单位秒 //客服地址
pingInterval: 1500, webSocket: '{{$webSocket}}',
// 版本号 //本地端主动给服务器ping的时间, 0 则不开启 , 单位秒
version: '1.0' pingInterval: 1500,
};
// 版本号
version: '1.0'
};
export default config;

View File

@@ -1,240 +1,240 @@
<template> <template>
<page-meta :page-style="themeColor"></page-meta> <page-meta :page-style="themeColor"></page-meta>
<view :style="{ backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img"> <view :style="{ backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img">
<view class="site-info-box" v-if="$util.isWeiXin() && followOfficialAccount && followOfficialAccount.isShow && wechatQrcode"> <view class="site-info-box" v-if="$util.isWeiXin() && followOfficialAccount && followOfficialAccount.isShow && wechatQrcode">
<view class="site-info"> <view class="site-info">
<view class="img-box" v-if="siteInfo.logo_square"> <view class="img-box" v-if="siteInfo.logo_square">
<image :src="$util.img(siteInfo.logo_square)" mode="aspectFill"></image> <image :src="$util.img(siteInfo.logo_square)" mode="aspectFill"></image>
</view> </view>
<view class="info-box" :style="{ color: '#ffffff' }"> <view class="info-box" :style="{ color: '#ffffff' }">
<text class="font-size-base">{{ siteInfo.site_name }}</text> <text class="font-size-base">{{ siteInfo.site_name }}</text>
<text>{{ followOfficialAccount.welcomeMsg }}</text> <text>{{ followOfficialAccount.welcomeMsg }}</text>
</view> </view>
</view> </view>
<view class="dite-button" @click="officialAccountsOpen">关注公众号</view> <view class="dite-button" @click="officialAccountsOpen">关注公众号</view>
</view> </view>
<!-- <view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch" :style="{ backgroundImage: bgImg }"> <!-- <view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch" :style="{ backgroundImage: bgImg }">
<ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="false"/> <ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="false"/>
</view> --> </view> -->
<diy-index-page v-if="topIndexValue" ref="indexPage" :value="topIndexValue" :bgUrl="bgUrl" :scrollTop="scrollTop" :diyGlobal="diyData.global" class="diy-index-page"> <diy-index-page v-if="topIndexValue" ref="indexPage" :value="topIndexValue" :bgUrl="bgUrl" :scrollTop="scrollTop" :diyGlobal="diyData.global" class="diy-index-page">
<template v-slot:components> <template v-slot:components>
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop" :haveTopCategory="true" :followOfficialAccount="followOfficialAccount"/> <diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop" :haveTopCategory="true" :followOfficialAccount="followOfficialAccount"/>
</template> </template>
<template v-slot:default> <template v-slot:default>
<ns-copyright v-show="isShowCopyRight"/> <ns-copyright v-show="isShowCopyRight"/>
</template> </template>
</diy-index-page> </diy-index-page>
<view v-else class="bg-index" :style="{ backgroundImage: backgroundUrl, paddingTop: paddingTop, marginTop: marginTop }"> <view v-else class="bg-index" :style="{ backgroundImage: backgroundUrl, paddingTop: paddingTop, marginTop: marginTop }">
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop" :followOfficialAccount="followOfficialAccount"/> <diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop" :followOfficialAccount="followOfficialAccount"/>
<ns-copyright v-show="isShowCopyRight"/> <ns-copyright v-show="isShowCopyRight"/>
</view> </view>
<template v-if="adv.advshow != -1"> <template v-if="adv.advshow != -1">
<view @touchmove.prevent.stop> <view @touchmove.prevent.stop>
<uni-popup ref="uniPopupWindow" type="center" class="wap-floating" :maskClick="false"> <uni-popup ref="uniPopupWindow" type="center" class="wap-floating" :maskClick="false">
<view class="small-bot"> <view class="small-bot">
<!-- <view class="adver-time" wx:if="{{startadv.params.style=='default'&&startadv.params.canclose==1}}"> <!-- <view class="adver-time" wx:if="{{startadv.params.style=='default'&&startadv.params.canclose==1}}">
<view bindtap="adverclose">跳过</view> <view bindtap="adverclose">跳过</view>
<view class="time">{{clock}}s</view> <view class="time">{{clock}}s</view>
</view> </view>
<view class="adver-time" wx:if="{{startadv.params.style=='default'&&startadv.params.canclose==0}}"> <view class="adver-time" wx:if="{{startadv.params.style=='default'&&startadv.params.canclose==0}}">
<view class="time" style="line-height: 64rpx;">{{clock}}s</view> <view class="time" style="line-height: 64rpx;">{{clock}}s</view>
</view> --> </view> -->
<swiper autoplay="true" :circular="true" indicator-active-color="#fff" indicator-color="rgba(255,255,255,0.6)" :indicator-dots="true" interval="3000"> <swiper autoplay="true" :circular="true" indicator-active-color="#fff" indicator-color="rgba(255,255,255,0.6)" :indicator-dots="true" interval="3000">
<swiper-item v-for="(item, index) in adv.list" :key="index"> <swiper-item v-for="(item, index) in adv.list" :key="index">
<image class="slide-image" @click="$util.diyRedirectTo(item.link)" height="100%" :src="$util.img(item.imageUrl)" width="100%"></image> <image class="slide-image" @click="$util.diyRedirectTo(item.link)" height="100%" :src="$util.img(item.imageUrl)" width="100%"></image>
<!-- <image bindtap="adverclose" class="slide-image" height="100%" src="{{item.imgurl}}" width="100%" wx:if="{{item.click==1}}"></image> --> <!-- <image bindtap="adverclose" class="slide-image" height="100%" src="{{item.imgurl}}" width="100%" wx:if="{{item.click==1}}"></image> -->
</swiper-item> </swiper-item>
</swiper> </swiper>
<view bindtap="adverclose" class="small-bot-close" @click="closePopupWindow"> <view bindtap="adverclose" class="small-bot-close" @click="closePopupWindow">
<i class="iconfont icon-round-close" style="color:#fff"></i> <i class="iconfont icon-round-close" style="color:#fff"></i>
</view> </view>
</view> </view>
<!-- <view class="image-wrap"> <!-- <view class="image-wrap">
<swiper class="swiper" style="width:100%;height: 1200rpx;" :autoplay="true" interval="3000" circular="true" :indicator-dots="true" indicator-color="#000" indicator-active-color="red"> <swiper class="swiper" style="width:100%;height: 1200rpx;" :autoplay="true" interval="3000" circular="true" :indicator-dots="true" indicator-color="#000" indicator-active-color="red">
<swiper-item class="swiper-item" v-for="(item, index) in adv.list" :key="index" v-if="item.imageUrl" @click="$util.diyRedirectTo(item.link)"> <swiper-item class="swiper-item" v-for="(item, index) in adv.list" :key="index" v-if="item.imageUrl" @click="$util.diyRedirectTo(item.link)">
<view class="item"> <view class="item">
<image :src="$util.img(item.imageUrl)" mode="aspectFit" :show-menu-by-longpress="true"/> <image :src="$util.img(item.imageUrl)" mode="aspectFit" :show-menu-by-longpress="true"/>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
<text class="iconfont icon-round-close" @click="closePopupWindow"></text> --> <text class="iconfont icon-round-close" @click="closePopupWindow"></text> -->
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<!-- 底部tabBar --> <!-- 底部tabBar -->
<view class="page-bottom" v-if="openBottomNav"> <view class="page-bottom" v-if="openBottomNav">
<diy-bottom-nav @callback="callback" :name="name"/> <diy-bottom-nav @callback="callback" :name="name"/>
</view> </view>
<!-- 关注公众号弹窗 --> <!-- 关注公众号弹窗 -->
<view @touchmove.prevent class="official-accounts-inner" v-if="wechatQrcode"> <view @touchmove.prevent class="official-accounts-inner" v-if="wechatQrcode">
<uni-popup ref="officialAccountsPopup" type="center"> <uni-popup ref="officialAccountsPopup" type="center">
<view class="official-accounts-wrap"> <view class="official-accounts-wrap">
<image class="content" :src="$util.img(wechatQrcode)" mode="aspectFit"></image> <image class="content" :src="$util.img(wechatQrcode)" mode="aspectFit"></image>
<text class="desc">关注了解更多</text> <text class="desc">关注了解更多</text>
<text class="close iconfont icon-round-close" @click="officialAccountsClose"></text> <text class="close iconfont icon-round-close" @click="officialAccountsClose"></text>
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
<!-- 收藏 --> <!-- 收藏 -->
<uni-popup ref="collectPopupWindow" type="top" class="wap-floating wap-floating-collect"> <uni-popup ref="collectPopupWindow" type="top" class="wap-floating wap-floating-collect">
<view v-if="showTip" class="collectPopupWindow" :style="{ marginTop: (collectTop + statusBarHeight) * 2 + 'rpx' }"> <view v-if="showTip" class="collectPopupWindow" :style="{ marginTop: (collectTop + statusBarHeight) * 2 + 'rpx' }">
<image :src="$util.img('public/uniapp/index/collect2.png')" mode="aspectFit"/> <image :src="$util.img('public/uniapp/index/collect2.png')" mode="aspectFit"/>
<text @click="closeCollectPopupWindow">我知道了</text> <text @click="closeCollectPopupWindow">我知道了</text>
</view> </view>
</uni-popup> </uni-popup>
<!-- 选择门店弹出框定位当前位置展示最近的一个门店 --> <!-- 选择门店弹出框定位当前位置展示最近的一个门店 -->
<view @touchmove.prevent.stop class="choose-store"> <view @touchmove.prevent.stop class="choose-store">
<uni-popup ref="chooseStorePopup" type="center" :maskClick="false" class="choose-store"> <uni-popup ref="chooseStorePopup" type="center" :maskClick="false" class="choose-store">
<view class="choose-store-popup"> <view class="choose-store-popup">
<view class="head-wrap" @click="closeChooseStorePopup">请确认门店</view> <view class="head-wrap" @click="closeChooseStorePopup">请确认门店</view>
<view class="position-wrap"> <view class="position-wrap">
<text class="iconfont icon-dizhi"></text> <text class="iconfont icon-dizhi"></text>
<text class="address">{{ currentPosition }}</text> <text class="address">{{ currentPosition }}</text>
<view class="reposition" @click="reposition" v-if="globalStoreConfig && globalStoreConfig.is_allow_change == 1"> <view class="reposition" @click="reposition" v-if="globalStoreConfig && globalStoreConfig.is_allow_change == 1">
<text class="iconfont icon-dingwei"></text> <text class="iconfont icon-dingwei"></text>
<text>重新定位</text> <text>重新定位</text>
</view> </view>
</view> </view>
<view class="store-wrap" v-if="nearestStore"> <view class="store-wrap" v-if="nearestStore">
<text class="tag">当前门店</text> <text class="tag">当前门店</text>
<view class="store-name">{{ nearestStore.store_name }}</view> <view class="store-name">{{ nearestStore.store_name }}</view>
<view class="address">{{ nearestStore.show_address }}</view> <view class="address">{{ nearestStore.show_address }}</view>
<view class="distance" v-if="nearestStore.distance"> <view class="distance" v-if="nearestStore.distance">
<text class="iconfont icon-dizhi"></text> <text class="iconfont icon-dizhi"></text>
<text>{{ nearestStore.distance > 1 ? nearestStore.distance + 'km' : nearestStore.distance * 1000 + 'm' }}</text> <text>{{ nearestStore.distance > 1 ? nearestStore.distance + 'km' : nearestStore.distance * 1000 + 'm' }}</text>
</view> </view>
</view> </view>
<button type="primary" @click="enterStore">确认进入</button> <button type="primary" @click="enterStore">确认进入</button>
<view class="other-store" @click="chooseOtherStore" v-if="globalStoreConfig && globalStoreConfig.is_allow_change == 1"> <view class="other-store" @click="chooseOtherStore" v-if="globalStoreConfig && globalStoreConfig.is_allow_change == 1">
<text>选择其他门店</text> <text>选择其他门店</text>
<text class="iconfont icon-right"></text> <text class="iconfont icon-right"></text>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
<hover-nav></hover-nav> <hover-nav></hover-nav>
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 --> <!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup> <privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif --> <!-- #endif -->
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top> <to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
</view> </view>
</template> </template>
<script> <script>
import uniPopup from '@/components/uni-popup/uni-popup.vue'; import uniPopup from '@/components/uni-popup/uni-popup.vue';
import nsNavbar from '@/components/ns-navbar/ns-navbar.vue'; import nsNavbar from '@/components/ns-navbar/ns-navbar.vue';
import diyJs from '@/common/js/diy.js'; import diyJs from '@/common/js/diy.js';
import indexJs from './public/js/index.js'; import indexJs from './public/js/index.js';
import toTop from '@/components/toTop/toTop.vue'; import toTop from '@/components/toTop/toTop.vue';
import scroll from '@/common/js/scroll-view.js'; import scroll from '@/common/js/scroll-view.js';
export default { export default {
data() { data() {
return { return {
minScrollTop: 100, minScrollTop: 100, // 设置回到顶端按钮显示要求,最小滚动距离
} }
}, },
components: { components: {
uniPopup, uniPopup,
nsNavbar, nsNavbar,
toTop toTop
}, },
mixins: [diyJs, indexJs, scroll] mixins: [diyJs, indexJs, scroll]
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/common/css/diy.scss'; @import '@/common/css/diy.scss';
@import './public/css/index.scss'; @import './public/css/index.scss';
.small-bot { .small-bot {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: fixed; position: fixed;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
z-index: 122; z-index: 122;
} }
.small-bot swiper { .small-bot swiper {
width: 560rpx; width: 560rpx;
height: 784rpx; height: 784rpx;
margin: 120rpx auto 0; margin: 120rpx auto 0;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
} }
.small-bot swiper .slide-image { .small-bot swiper .slide-image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.small-bot-close { .small-bot-close {
width: 66rpx; width: 66rpx;
height: 66rpx; height: 66rpx;
border-radius: 50%; border-radius: 50%;
text-align: center; text-align: center;
line-height: 64rpx; line-height: 64rpx;
font-size: 64rpx; font-size: 64rpx;
color: #fff; color: #fff;
margin: 30rpx auto 0; margin: 30rpx auto 0;
} }
.small-bot-close i { .small-bot-close i {
font-size: 60rpx; font-size: 60rpx;
} }
</style> </style>
<style scoped> <style scoped>
.swiper /deep/ .uni-swiper-dots-horizontal { .swiper /deep/ .uni-swiper-dots-horizontal {
left: 40%; left: 40%;
bottom:40px bottom:40px
} }
.wap-floating>>>.uni-popup__wrapper.uni-custom .uni-popup__wrapper-box { .wap-floating>>>.uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none !important; background: none !important;
} }
.choose-store>>>.goodslist-uni-popup-box { .choose-store>>>.goodslist-uni-popup-box {
width: 80%; width: 80%;
} }
/deep/.diy-index-page .uni-popup .uni-popup__wrapper-box { /deep/.diy-index-page .uni-popup .uni-popup__wrapper-box {
border-radius: 0; border-radius: 0;
} }
/deep/ .placeholder { /deep/ .placeholder {
height: 0; height: 0;
} }
/deep/::-webkit-scrollbar { /deep/::-webkit-scrollbar {
width: 0; width: 0;
height: 0; height: 0;
background-color: transparent; background-color: transparent;
display: none; display: none;
} }
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box { /deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important; max-height: unset !important;
} }
/deep/ .mescroll-totop { /deep/ .mescroll-totop {
right: 24rpx!important; right: 24rpx!important;
bottom: 182rpx!important; bottom: 182rpx!important;
} }
</style> </style>