Compare commits
8 Commits
84f4ad83c2
...
custom/281
| Author | SHA1 | Date | |
|---|---|---|---|
| 26f21bcbd0 | |||
| 13f54c5f8e | |||
| ff9677be71 | |||
| 4d70d2cdff | |||
| d1cf57717b | |||
| 012b1339aa | |||
| 4a44eb66c9 | |||
| 8e337da21e |
@@ -20,10 +20,6 @@ try {
|
||||
// 默认域名, 自定义发行时可以修改
|
||||
let defaultDomain = '';
|
||||
|
||||
// #ifdef H5_XCX_5G_QUICKAPP_COM
|
||||
defaultDomain = 'https://xcx20.5g-quickapp.com';
|
||||
// #endif
|
||||
|
||||
// #ifdef H5_XCX_AIGC_QUICKAPP_COM
|
||||
defaultDomain = 'https://xcx.aigc-quickapp.com/';
|
||||
// #endif
|
||||
|
||||
@@ -1162,47 +1162,5 @@ export default {
|
||||
verifyMobile(mobile) {
|
||||
var parse = /^\d{11}$/.test(mobile);
|
||||
return parse;
|
||||
},
|
||||
/**
|
||||
* 判断是否为快应用环境
|
||||
* @returns {boolean} 是否为快应用
|
||||
*/
|
||||
isQuickApp() {
|
||||
// #ifndef QUICKAPP-WEBVIEW
|
||||
let _isQuickApp = false;
|
||||
try {
|
||||
const ua = navigator?.userAgent?.toLowerCase();
|
||||
console.log('ua = ', ua);
|
||||
_isQuickApp = ua.indexOf('quickapp') !== -1;
|
||||
|
||||
if (!_isQuickApp) {
|
||||
// 特殊说明由于网站是嵌入到快应用的Webview组件中<web>,UA中不会包含quickapp字符串,
|
||||
// 但是会包含uniacid参数,所以这里通过uniacid参数来判断是否为快应用环境
|
||||
_isQuickApp = ua.indexOf('uniacid=') !== -1;
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
if (!_isQuickApp) {
|
||||
const systemInfo = this.getDeviceInfo();
|
||||
_isQuickApp = systemInfo?.platform === 'quickapp' || process?.env?.UNI_PLATFORM === 'quickapp';
|
||||
}
|
||||
return _isQuickApp;
|
||||
// #endif
|
||||
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 判断是否为华为快应用环境
|
||||
* @returns {boolean} 是否为华为快应用
|
||||
*/
|
||||
isHuaweiQuickApp() {
|
||||
if (!this.isQuickApp()) return false;
|
||||
|
||||
// #ifndef QUICKAPP-WEBVIEW-HUAWEI
|
||||
const systemInfo = this.getDeviceInfo();
|
||||
return systemInfo.brand === 'HUAWEI' || systemInfo.manufacturer === 'HUAWEI' ||
|
||||
(typeof qh !== 'undefined' && qh.platform === 'huawei');
|
||||
// #endif
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,385 +1,237 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="privacy-mask" v-if="showPop">
|
||||
<!-- #ifdef MP -->
|
||||
<view v-if="showPop">
|
||||
<view class="privacy-mask">
|
||||
<view class="privacy-wrap">
|
||||
<view class="privacy-title">用户隐私保护提示</view>
|
||||
<view class="privacy-desc">
|
||||
感谢您使用{{ appName }},在使用前您应当阅读并同意
|
||||
<text class="privacy-link" @tap="openPrivacyContract">{{ privacyContractName }}</text>
|
||||
<!-- #ifdef QUICKAPP-WEBVIEW || H5 -->
|
||||
<text class="privacy-link" @tap="openPrivacyService">{{ privacyServiceName }}</text>
|
||||
<!-- #endif -->
|
||||
,当点击同意并继续时,即表示您已理解并同意该条款内容,该条款将对您产生法律约束力;如您不同意,将无法继续使用{{ appName }}相关功能。
|
||||
感谢您使用本小程序,在使用前您应当阅读并同意
|
||||
<text class="privacy-link" @tap="openPrivacyContract">{{privacyContractName}}</text>,
|
||||
当点击同意并继续时,即表示您已理解并同意该条款内容,该条款将对您产生法律约束力;如您不同意,将无法继续使用小程序相关功能。
|
||||
</view>
|
||||
<view class="privacy-button-flex">
|
||||
<button class="privacy-button-btn bg-disagree" @tap="handleDisagree">不同意</button>
|
||||
<!-- #ifdef QUICKAPP-WEBVIEW || MP-WEIXIN -->
|
||||
<button id="agree-btn" class="privacy-button-btn bg-agree" open-type="agreePrivacyAuthorization"
|
||||
@agreeprivacyauthorization="handleAgree">同意并继续</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef WEB || H5 -->
|
||||
<button id="agree-btn" class="privacy-button-btn bg-agree" @tap="handleAgree" @click="handleAgree">同意并继续</button>
|
||||
<!-- #endif -->
|
||||
<button id="agree-btn" class="privacy-button-btn bg-agree" open-type="agreePrivacyAuthorization" @agreeprivacyauthorization="handleAgree">同意并继续</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef WEB || H5 -->
|
||||
<view v-if="showPop"></view>
|
||||
<!-- #endif -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// #ifdef QUICKAPP-WEBVIEW
|
||||
import has from '@system.has'
|
||||
// #endif
|
||||
|
||||
const closeOtherPagePopUpHooks = new Set();
|
||||
const privacyContractPage = '/pages_tool/agreement/contenr?type=0';
|
||||
const privacyServicePage = '/pages_tool/agreement/contenr?type=1';
|
||||
|
||||
export default {
|
||||
name: 'PrivacyPopup',
|
||||
data() {
|
||||
return {
|
||||
agree: false,
|
||||
showPop: false,
|
||||
privacyAuthorization: null,
|
||||
privacyResolves: new Set(),
|
||||
privacyContractName: '用户隐私保护指引',
|
||||
appName: '本小程序',
|
||||
// #ifdef WEB || H5
|
||||
appName: '本应用',
|
||||
privacyContractName: '《隐私条款》',
|
||||
privacyServiceName: '《用户服务协议》',
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.listenPrivacySettingChange()
|
||||
this.curPageShow()
|
||||
},
|
||||
created() {
|
||||
try {
|
||||
// #ifdef MP-WEIXIN
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
agree: false,
|
||||
showPop: false,
|
||||
privacyAuthorization: null,
|
||||
privacyResolves: new Set(),
|
||||
closeOtherPagePopUpHooks: new Set(),
|
||||
privacyContractName: '用户隐私保护指引'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
this.curPageShow()
|
||||
},
|
||||
created() {
|
||||
let that = this
|
||||
//查询微信侧记录的用户是否有待同意的隐私政策信息
|
||||
wx.getPrivacySetting({
|
||||
success: (res) => {
|
||||
// console.log('隐私政策信息', res);
|
||||
// console.log(res.privacyContractName);
|
||||
this.privacyContractName = res.privacyContractName
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef QUICKAPP-WEBVIEW || H5
|
||||
if (this.$util.isQuickApp()) {
|
||||
if (typeof has != 'undefined' && has?.getPrivacySetting) {
|
||||
has.getPrivacySetting({
|
||||
success: (res) => {
|
||||
if (res.privacyContractName) {
|
||||
this.privacyContractName = res.privacyContractName
|
||||
}
|
||||
},
|
||||
try {
|
||||
wx.getPrivacySetting({
|
||||
success(res) {
|
||||
// console.log('隐私政策信息', res);
|
||||
// console.log(res.privacyContractName);
|
||||
that.privacyContractName = res.privacyContractName
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
// console.log("=========低版本基础库==========")
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 监听何时需要提示用户阅读隐私政策
|
||||
init() {
|
||||
let that = this;
|
||||
if (wx.onNeedPrivacyAuthorization) {
|
||||
wx.onNeedPrivacyAuthorization((resolve) => {
|
||||
if (typeof that.privacyAuthorization === 'function') {
|
||||
that.privacyAuthorization(resolve)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
} catch (e) {
|
||||
console.error("=========低版本基础库==========", e)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getPrivacySettingByQuickApp() {
|
||||
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||
if (this.$util.isQuickApp()) {
|
||||
if (typeof has != 'undefined' && has?.getPrivacySetting) {
|
||||
has.getPrivacySetting({
|
||||
},
|
||||
proactive() {
|
||||
let that = this
|
||||
if (wx.getPrivacySetting) {
|
||||
wx.getPrivacySetting({
|
||||
success: (res) => {
|
||||
// console.log(res)
|
||||
if (res.needAuthorization) {
|
||||
this.popUp()
|
||||
that.popUp()
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
this.closeOtherPagePopUp(this.disPopUp)
|
||||
} else {
|
||||
this.$emit('agree')
|
||||
}
|
||||
},
|
||||
})
|
||||
});
|
||||
} else {
|
||||
// 属于嵌入到快应用Webview组件中的情况,按照H5的方式来处理,判断是否已经授权
|
||||
if (uni.getStorageSync('privacyAgreed')) {
|
||||
this.$emit('agree')
|
||||
} else {
|
||||
this.popUp()
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
this.closeOtherPagePopUp(this.disPopUp)
|
||||
}
|
||||
this.$emit('agree')
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
|
||||
listenPrivacySettingChange() {
|
||||
// #ifdef MP-WEIXIN
|
||||
// 监听微信侧隐私政策授权变化事件
|
||||
if (wx.onNeedPrivacyAuthorization) {
|
||||
wx.onNeedPrivacyAuthorization((resolve) => {
|
||||
if (typeof this.privacyAuthorization === 'function') {
|
||||
this.privacyAuthorization(resolve)
|
||||
},
|
||||
//初始化监听程序
|
||||
curPageShow() {
|
||||
this.privacyAuthorization = resolve => {
|
||||
this.privacyResolves.add(resolve)
|
||||
//打开弹窗
|
||||
this.popUp()
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
this.closeOtherPagePopUp(this.disPopUp)
|
||||
}
|
||||
this.closeOtherPagePopUpHooks.add(this.disPopUp)
|
||||
},
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
closeOtherPagePopUp(closePopUp) {
|
||||
this.closeOtherPagePopUpHooks.forEach(hook => {
|
||||
if (closePopUp !== hook) {
|
||||
hook()
|
||||
}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||
if (this.$util.isQuickApp()) {
|
||||
// 监听快速应用侧隐私政策授权变化事件
|
||||
if (typeof has != 'undefined' && has?.onPrivacySettingChange) {
|
||||
has.onPrivacySettingChange((res) => {
|
||||
// console.log(res)
|
||||
if (res.needAuthorization) {
|
||||
this.popUp()
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
this.closeOtherPagePopUp(this.disPopUp)
|
||||
} else {
|
||||
this.$emit('agree')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 主动查询用户隐私政策授权状态,针对快速应用
|
||||
this.getPrivacySettingByQuickApp();
|
||||
},
|
||||
// 主动查询用户隐私政策授权状态
|
||||
proactive() {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (wx.getPrivacySetting) {
|
||||
wx.getPrivacySetting({
|
||||
success: (res) => {
|
||||
// console.log(res)
|
||||
if (res.needAuthorization) {
|
||||
this.popUp()
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
this.closeOtherPagePopUp(this.disPopUp)
|
||||
} else {
|
||||
this.$emit('agree')
|
||||
}
|
||||
},
|
||||
//打开隐私协议
|
||||
openPrivacyContract() {
|
||||
wx.openPrivacyContract({
|
||||
success(res) {
|
||||
// console.log('打开隐私协议', res);
|
||||
},
|
||||
fail(err) {
|
||||
// console.error('打开隐私协议失败', err)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
},
|
||||
// 不同意
|
||||
handleDisagree() {
|
||||
this.privacyResolves.forEach(resolve => {
|
||||
resolve({
|
||||
event: 'disagree',
|
||||
})
|
||||
})
|
||||
this.privacyResolves.clear()
|
||||
//关闭弹窗
|
||||
this.disPopUp()
|
||||
//退出小程序
|
||||
uni.showModal({
|
||||
content: '未同意隐私协议,无法使用相关功能',
|
||||
success: () => {
|
||||
this.$emit('disagree')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 同意并继续
|
||||
handleAgree() {
|
||||
this.privacyResolves.forEach(resolve => {
|
||||
resolve({
|
||||
event: 'agree',
|
||||
buttonId: 'agree-btn'
|
||||
})
|
||||
})
|
||||
this.privacyResolves.clear()
|
||||
//关闭弹窗
|
||||
this.disPopUp()
|
||||
this.$emit('agree')
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef QUICKAPP-WEBVIEW
|
||||
this.getPrivacySettingByQuickApp();
|
||||
// #endif
|
||||
},
|
||||
//初始化监听程序
|
||||
curPageShow() {
|
||||
closeOtherPagePopUpHooks.add(this.disPopUp)
|
||||
this.privacyAuthorization = resolve => {
|
||||
this.privacyResolves.add(resolve)
|
||||
//打开弹窗
|
||||
this.popUp()
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
this.closeOtherPagePopUp(this.disPopUp)
|
||||
}
|
||||
},
|
||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||
closeOtherPagePopUp(closePopUp) {
|
||||
closeOtherPagePopUpHooks.forEach(hook => {
|
||||
if (closePopUp !== hook) {
|
||||
hook()
|
||||
},
|
||||
//打开弹窗
|
||||
popUp() {
|
||||
if (this.showPop === false) {
|
||||
this.showPop = true
|
||||
}
|
||||
})
|
||||
},
|
||||
//打开隐私协议
|
||||
openPrivacyContract() {
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.openPrivacyContract({
|
||||
success(res) {
|
||||
// console.log('打开隐私协议', res);
|
||||
},
|
||||
fail(err) {
|
||||
// console.error('打开隐私协议失败', err)
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||
if (this.$util.isQuickApp()) {
|
||||
if (typeof has != 'undefined' && has?.openPrivacySetting) {
|
||||
has.openPrivacySetting({
|
||||
success: (res) => {
|
||||
// console.log('打开隐私协议', res);
|
||||
},
|
||||
fail: (err) => {
|
||||
// console.error('打开隐私协议失败', err)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 属于嵌入到快应用Webview组件中的情况,按照H5的方式来处理
|
||||
this.$util.redirectTo(privacyContractPage);
|
||||
}
|
||||
} else {
|
||||
// H5 环境下的处理逻辑
|
||||
this.$util.redirectTo(privacyContractPage);
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
//打开用户服务协议
|
||||
openPrivacyService() {
|
||||
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||
if (this.$util.isQuickApp()) {
|
||||
if (typeof has != 'undefined' && has?.openPrivacySetting) {
|
||||
has.openPrivacySetting({
|
||||
success: (res) => {
|
||||
// console.log('打开用户服务协议', res);
|
||||
},
|
||||
fail: (err) => {
|
||||
// console.error('打开用户服务协议失败', err)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 属于嵌入到快应用Webview组件中的情况,按照H5的方式来处理
|
||||
this.$util.redirectTo(privacyServicePage);
|
||||
}
|
||||
} else {
|
||||
// H5 环境下的处理逻辑
|
||||
this.$util.redirectTo(privacyServicePage);
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
// 不同意
|
||||
handleDisagree() {
|
||||
this.privacyResolves.forEach(resolve => {
|
||||
resolve({
|
||||
event: 'disagree',
|
||||
})
|
||||
})
|
||||
this.privacyResolves.clear()
|
||||
},
|
||||
//关闭弹窗
|
||||
this.disPopUp()
|
||||
//退出小程序
|
||||
uni.showModal({
|
||||
content: '未同意隐私协议,无法使用相关功能',
|
||||
success: () => {
|
||||
this.$emit('disagree')
|
||||
disPopUp() {
|
||||
if (this.showPop === true) {
|
||||
this.showPop = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 同意并继续
|
||||
handleAgree() {
|
||||
this.privacyResolves.forEach(resolve => {
|
||||
resolve({
|
||||
event: 'agree',
|
||||
buttonId: 'agree-btn'
|
||||
})
|
||||
})
|
||||
this.privacyResolves.clear()
|
||||
//关闭弹窗
|
||||
this.disPopUp()
|
||||
|
||||
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||
// 保存用户授权状态到本地存储,用于快应用Webview组件中的H5方式处理
|
||||
uni.setStorageSync('privacyAgreed', true);
|
||||
// #endif
|
||||
this.$emit('agree')
|
||||
},
|
||||
//打开弹窗
|
||||
popUp() {
|
||||
this.showPop = true;
|
||||
},
|
||||
//关闭弹窗
|
||||
disPopUp() {
|
||||
this.showPop = false;
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 清理事件监听器和集合
|
||||
this.privacyResolves.clear()
|
||||
closeOtherPagePopUpHooks.delete(this.disPopUp)
|
||||
// 注意:这里需要根据实际情况清理微信和快速应用的事件监听器
|
||||
// 由于微信的 wx.onNeedPrivacyAuthorization 没有对应的 off 方法,这里可能需要其他方式处理
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.privacy-mask {
|
||||
position: fixed;
|
||||
z-index: 5000;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.privacy-mask {
|
||||
position: fixed;
|
||||
z-index: 5000;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.privacy-wrap {
|
||||
width: 632rpx;
|
||||
padding: 48rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.privacy-wrap {
|
||||
width: 632rpx;
|
||||
padding: 48rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.privacy-title {
|
||||
padding: 0rpx 30rpx 40rpx 30rpx;
|
||||
font-weight: 700;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.privacy-title {
|
||||
padding: 0rpx 30rpx 40rpx 30rpx;
|
||||
font-weight: 700;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.privacy-desc {
|
||||
font-size: 30rpx;
|
||||
color: #555;
|
||||
line-height: 2;
|
||||
text-align: left;
|
||||
padding: 0 40rpx;
|
||||
}
|
||||
.privacy-desc {
|
||||
font-size: 30rpx;
|
||||
color: #555;
|
||||
line-height: 2;
|
||||
text-align: left;
|
||||
padding: 0 40rpx;
|
||||
}
|
||||
|
||||
.privacy-link {
|
||||
color: #2f80ed;
|
||||
}
|
||||
.privacy-link {
|
||||
color: #2f80ed;
|
||||
}
|
||||
|
||||
.privacy-button-flex {
|
||||
display: flex;
|
||||
padding: 20rpx 40rpx;
|
||||
}
|
||||
.privacy-button-flex {
|
||||
display: flex;
|
||||
padding: 20rpx 40rpx;
|
||||
}
|
||||
|
||||
.privacy-button-btn {
|
||||
color: #FFF;
|
||||
font-size: 30rpx;
|
||||
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||
font-size: 28rpx;
|
||||
// #endif
|
||||
font-weight: 500;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
height: 100rpx;
|
||||
border-radius: 20rpx;
|
||||
border: none;
|
||||
background: #07c160;
|
||||
flex: 1;
|
||||
margin-right: 30rpx;
|
||||
justify-content: center;
|
||||
}
|
||||
.privacy-button-btn {
|
||||
color: #FFF;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
height: 100rpx;
|
||||
border-radius: 20rpx;
|
||||
border: none;
|
||||
background: #07c160;
|
||||
flex: 1;
|
||||
margin-right: 30rpx;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.privacy-button-btn::after {
|
||||
border: none;
|
||||
}
|
||||
.privacy-button-btn::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.bg-disagree {
|
||||
color: #07c160;
|
||||
background: #f2f2f2;
|
||||
}
|
||||
.bg-disagree {
|
||||
color: #07c160;
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
.bg-agree {
|
||||
margin-right: 0rpx;
|
||||
}
|
||||
.bg-agree {
|
||||
margin-right: 0rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -3,5 +3,5 @@ export const lang = {
|
||||
title: '商品分类',
|
||||
search:'商品搜索',
|
||||
seeMore : '查看更多',
|
||||
Make: "询底价"
|
||||
Make: "咨询"
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export const lang = {
|
||||
status:'该商品已下架',
|
||||
sellout:'库存不足',
|
||||
max:'已达最大限购数量',
|
||||
makebtn:'价格电议',
|
||||
makebtn:' ',
|
||||
sales:'销量',
|
||||
stock:'库存',
|
||||
kefu:'客服',
|
||||
|
||||
@@ -6,6 +6,6 @@ export const lang = {
|
||||
Price:'价格',
|
||||
Filter:'筛选',
|
||||
Search:'请输入您要搜索的商品',
|
||||
Make:'立即询底价',
|
||||
Make:'查看详情',
|
||||
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
},
|
||||
"router" : {
|
||||
"mode" : "history",
|
||||
"base" : "/hwappx/2811/"
|
||||
"base" : "/hwappx/common/"
|
||||
},
|
||||
"title" : "",
|
||||
"devServer" : {
|
||||
|
||||
11
package.json
11
package.json
@@ -21,17 +21,6 @@
|
||||
"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": {
|
||||
"title": "H5-xcx.aigc-quickapp.com",
|
||||
"env": {
|
||||
|
||||
@@ -137,8 +137,10 @@
|
||||
</uni-popup>
|
||||
</view>
|
||||
<hover-nav :need="true"></hover-nav>
|
||||
<!-- 隐私协议 -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
<!-- #endif -->
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
|
||||
@@ -90,10 +90,7 @@
|
||||
<view class="goods-tag-list" v-if="goodsSkuDetail.label_name">
|
||||
<text class="tag-item">{{ goodsSkuDetail.label_name }}</text>
|
||||
</view>
|
||||
<view class="logistics-wrap">
|
||||
<text v-if="goodsSkuDetail.stock_show">{{$lang('stock')}}: {{ goodsSkuDetail.stock +goodsSkuDetail.unit}}</text>
|
||||
<text v-if="goodsSkuDetail.sale_show">{{$lang('sales')}}: {{ goodsSkuDetail.sale_num+goodsSkuDetail.unit }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 会员卡 -->
|
||||
<!-- <view class="member-card-wrap" @click="$util.redirectTo('/pages_tool/member/card_buy')" v-if="membercard">
|
||||
<text class="iconfont icon-huiyuan"></text>
|
||||
|
||||
@@ -319,7 +319,7 @@ export default {
|
||||
@import './public/css/list.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
>>>.uni-tag--primary.uni-tag--inverted {
|
||||
.uni-tag--primary.uni-tag--inverted {
|
||||
background-color: #f5f5f5 !important;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view @click="test()">Test</view> -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="view_ul view_ul_one clearfix">
|
||||
@@ -33,6 +32,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="view_ul_100" v-for="(item, index) in dataList" :key="index"
|
||||
style="margin-bottom: 20rpx;">
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
<view class="text" style="font-size: 40rpx;font-weight: 600;color:#333">
|
||||
{{ item.realname }}</view>
|
||||
<view class="text">{{ item.position }}</view>
|
||||
<!-- <view class="text">{{item.mobile_text}}:{{item.mobile}}</view> -->
|
||||
<view class="text" style="padding-bottom:20rpx;color:#0054a5">{{ item.address }}</view>
|
||||
<view class="contact_name" v-if="item.mobile"
|
||||
style="padding-top:30rpx;padding-bottom:0rpx;border-top: solid 1px #eee;font-size:28rpx;display: flex;">
|
||||
@@ -64,20 +63,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="view_ul view_ul_two clearfix " v-if="dataList.length > 3" >
|
||||
<view @click="Tel(item.mobile)" class="view_li w50_li" v-for="(item,index) in dataList" >
|
||||
<view class="bl bor" hoverClass="none" url="" style="box-shadow: 5rpx 5rpx 10rpx #dcdcdc;height: 230rpx;position: relative;">
|
||||
<view class="contact_name" v-if="item.position">{{item.position_text}}:{{item.position}}</view>
|
||||
<view class="contact_name">{{item.title_text}}:{{item.realname}}</view>
|
||||
<view class="contact_name">{{item.mobile_text}}:{{item.mobile}}</view>
|
||||
<view class="contact_name" style="padding-bottom:10rpx;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">{{item.address_text}}:{{item.address}}</view>
|
||||
<view class="contact_name" style="padding-top:10rpx;padding-bottom:0rpx;border-top: solid 1px #eee;position: absolute;bottom: 0;display: flex">
|
||||
<image mode="widthFix":src="$util.img('public/static/img/boda.png')"></image>
|
||||
<view style="margin-top: -6rpx;margin-left: 10rpx;font-size: 24rpx;color:rgba(71,71,71,.79)">点击拨打电话</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<map v-if="shop.longitude > 0 && shop.latitude > 0 && ismessage == 0" id="map"
|
||||
style="width: 100%; height:400rpx" scale="12" :markers="markers" bindupdated="bindupdated"
|
||||
:longitude="shop.longitude" :latitude="shop.latitude" show-location>
|
||||
@@ -88,20 +73,8 @@
|
||||
</map>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
<!-- <view wx:if="landline !=0">
|
||||
<button bindtap="contact">
|
||||
<view class="message">
|
||||
<image mode="widthFix" src="{{contactbg}}"></image>
|
||||
</view>
|
||||
</button>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!--留言弹窗-->
|
||||
<view class="goods-sku">
|
||||
<uni-popup ref="informationPopup" type="bottom" @change="change">
|
||||
@@ -144,7 +117,6 @@
|
||||
<view class="fui-cell ">
|
||||
<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;">
|
||||
<!-- <input v-model="Form.mailbox" class="fui-input" placeholder="请输入您的邮箱" type="text" ></input> -->
|
||||
<textarea
|
||||
id="textarea-remark"
|
||||
:value="Form.remark"
|
||||
@@ -188,16 +160,8 @@ export default {
|
||||
markers: [
|
||||
{
|
||||
id: 1,
|
||||
/* width:20, //宽度
|
||||
height:20, //高度*/
|
||||
// iconPath: '../../static/goal_weizhi.png', //目标位置图标路径
|
||||
//这里的经纬度是 目的地 的经纬度
|
||||
latitude: 0,
|
||||
longitude: 0,
|
||||
callout: {
|
||||
/* title:123,
|
||||
content:'123' */
|
||||
}
|
||||
}
|
||||
],
|
||||
landline: 0,
|
||||
@@ -228,23 +192,6 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
test() {
|
||||
// channelReady(function(bAvailable) {
|
||||
// alert('是否存在框架服务:' + bAvailable)
|
||||
// })
|
||||
// window.location.href = 'https://hapjs.org/app//[path][?key=value] hap://app//[path][?key=value] '
|
||||
//参数说明: package: 应用包名,必选 path: 应用内页面的 path,可选,默认为首页 key-value: 希望传给页面的参数,可选,可以有多个
|
||||
|
||||
// const isQuickAppEnv = navigator.userAgent.includes('HuaweiQuickApp');
|
||||
// let quickAppBridge;
|
||||
// console.log(window.quickapp)
|
||||
// if (isQuickAppEnv) {
|
||||
// quickAppBridge = window.quickapp;
|
||||
// }
|
||||
// quickAppBridge.invoke('startQuickAppPage', { page: '/NativePage' });
|
||||
// window.postMessage({ action: 'someAction', data: 'some data' }, '*');
|
||||
// window.open('https://xcx10.5g-quickapp.com/test.php')
|
||||
},
|
||||
save() {
|
||||
if (!this.Form.realname.trim()) {
|
||||
uni.showToast({ title: '请填写姓名', icon: 'none' });
|
||||
@@ -258,13 +205,13 @@ export default {
|
||||
uni.showToast({ title: '请填写留言内容', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/message',
|
||||
data: this.Form,
|
||||
success: res => {
|
||||
uni.showToast({ title: res.message || '提交成功', icon: 'success' });
|
||||
|
||||
|
||||
// 重置表单数据
|
||||
this.Form = { realname: '', mobile: '', remark: '' };
|
||||
this.formKey = Date.now();
|
||||
@@ -519,13 +466,6 @@ image {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
}
|
||||
image {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.bl {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.line1 {
|
||||
overflow: hidden;
|
||||
@@ -563,18 +503,13 @@ image {
|
||||
line-height: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.view_ul_100 .fl {
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.view_ul_100 .fr {
|
||||
/* padding-left: 30rpx;*/
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.view_ul_100>view {
|
||||
background: #fff;
|
||||
// box-shadow: 5rpx 5rpx 10rpx #dcdcdc;
|
||||
}
|
||||
|
||||
.view_ul_100 .text {
|
||||
@@ -590,25 +525,7 @@ image {
|
||||
.list_cotact .view_ul_100>view {
|
||||
padding: 20rpx 30rpx 0rpx 30rpx;
|
||||
}
|
||||
.list_cotact .view_ul_two .view_li>view {
|
||||
background-color: #fff;
|
||||
padding: 20rpx 30rpx 0rpx 30rpx;
|
||||
}
|
||||
|
||||
.list_cotact .view_ul_two .view_li>view .address {
|
||||
background-color: #5dc2d0;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
font-size: 28rpx;
|
||||
line-height: 48rpx;
|
||||
margin-bottom: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.view_ul_two {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.contact_name {
|
||||
color: rgba(71, 71, 71, .79);
|
||||
font-size: 24rpx;
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
<view class="lineheight-clear">
|
||||
<view class="discount-price">
|
||||
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="price price-style large">{{ parseFloat(showPrice(item)).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
<view class="member-price-tag" v-if="item.member_price && item.member_price == showPrice(item)">
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" mode="widthFix"></image>
|
||||
@@ -39,7 +39,7 @@
|
||||
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text>{{ showMarketPrice(item) }}</text>
|
||||
</view>
|
||||
<view class="sale font-size-activity-tag color-tip" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit ? item.unit : '件' }}</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -96,7 +96,6 @@ export default {
|
||||
this.$store.commit('setMemberInfo', '');
|
||||
this.$store.dispatch('emptyCart');
|
||||
uni.removeStorageSync('authInfo');
|
||||
uni.removeStorageSync('privacyAgreed');
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}
|
||||
}
|
||||
@@ -119,9 +118,7 @@ export default {
|
||||
this.$store.commit('setMemberInfo', '');
|
||||
this.$store.dispatch('emptyCart');
|
||||
uni.removeStorageSync('authInfo');
|
||||
uni.removeStorageSync('privacyAgreed');
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: rres.message
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
1. 使用HBuilderX打开项目
|
||||
2. 选择菜单栏 "发行" -> "小程序-微信",进行发布构建
|
||||
3. 然后在终端进入项目根目录,执行 `npm run mp-weixin` 手动输出构建包。例如:mp-weixin-2025-10-31-1761881054836.zip(改id)
|
||||
3. 然后在终端进入项目根目录,执行 `npm run mp-weixin` 手动输出构建包。例如:mp-weixin-2025-10-31-1761881054836.zip
|
||||
4. 然后将mp-weixin-2025-10-31-1761881054836发给微信开发定制客户技术人员,
|
||||
5. 定制客户技术人员可以修改解压后,修改项目根目录下的site.js,进行针对客户的信息配置,然后使用微信开发者工具打开发布后的代码进行上传发布
|
||||
|
||||
@@ -114,8 +114,5 @@ export default config;
|
||||
|
||||
### 快应用发布
|
||||
1. 使用HBuilderX打开项目
|
||||
2. 点击项目中unpackage下面第六个【⚙】manifest.jion--->web配置--->运行的基础路径--->/hwappx/改编号/(编号可以在.local.config.js中找到需要的编号----.local.config.js在【⚙】manifest.jion上面第4个)
|
||||
3. 选择菜单栏 "发行" ->自定义发行--->H5-xcx.aigc-quickapp.com "快应用",进行发布构建
|
||||
4. 在电脑本地文件夹里找到unpackage--->dist--->build--->h5中h5-xcx.aigc-quickapp.com--->进行手动打包,例如:mp-weixin-2025-10-31-1761881054836.zip(可以写上id)
|
||||
5. 然后将压缩包发给开发定制客户技术人员,
|
||||
6. 使用快应用开发者工具打开发布后的代码进行上传发布
|
||||
2. 选择菜单栏 "发行" -> "快应用",进行发布构建
|
||||
3. 使用快应用开发者工具打开发布后的代码进行上传发布
|
||||
@@ -1,40 +1,8 @@
|
||||
const path = require('path');
|
||||
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 = {
|
||||
productionSourceMap: false,
|
||||
configureWebpack: config => {
|
||||
console.log('config.mode = ', config.mode);
|
||||
|
||||
if (config.mode === 'production') {
|
||||
console.log('开始尝试配置极限压缩');
|
||||
// 配置zion-uniapp-mp-load-package插件
|
||||
|
||||
Reference in New Issue
Block a user