Compare commits

13 Commits

13 changed files with 910 additions and 591 deletions

View File

@@ -20,6 +20,10 @@ 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

View File

@@ -1162,5 +1162,47 @@ export default {
verifyMobile(mobile) { verifyMobile(mobile) {
var parse = /^\d{11}$/.test(mobile); var parse = /^\d{11}$/.test(mobile);
return parse; 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;
} }
} }

View File

@@ -1,78 +1,164 @@
<template> <template>
<!-- #ifdef MP --> <view>
<view v-if="showPop"> <view class="privacy-mask" v-if="showPop">
<view class="privacy-mask">
<view class="privacy-wrap"> <view class="privacy-wrap">
<view class="privacy-title">用户隐私保护提示</view> <view class="privacy-title">用户隐私保护提示</view>
<view class="privacy-desc"> <view class="privacy-desc">
感谢您使用本小程序在使用前您应当阅读并同意 感谢您使用{{ appName }}在使用前您应当阅读并同意
<text class="privacy-link" @tap="openPrivacyContract">{{privacyContractName}}</text> <text class="privacy-link" @tap="openPrivacyContract">{{ privacyContractName }}</text>
当点击同意并继续时即表示您已理解并同意该条款内容该条款将对您产生法律约束力如您不同意将无法继续使用小程序相关功能 <!-- #ifdef QUICKAPP-WEBVIEW || H5 -->
<text class="privacy-link" @tap="openPrivacyService">{{ privacyServiceName }}</text>
<!-- #endif -->
,当点击同意并继续时即表示您已理解并同意该条款内容该条款将对您产生法律约束力如您不同意将无法继续使用{{ appName }}相关功能
</view> </view>
<view class="privacy-button-flex"> <view class="privacy-button-flex">
<button class="privacy-button-btn bg-disagree" @tap="handleDisagree">不同意</button> <button class="privacy-button-btn bg-disagree" @tap="handleDisagree">不同意</button>
<button id="agree-btn" class="privacy-button-btn bg-agree" open-type="agreePrivacyAuthorization" @agreeprivacyauthorization="handleAgree">同意并继续</button> <!-- #ifdef QUICKAPP-WEBVIEW || MP-WEIXIN -->
</view> <button id="agree-btn" class="privacy-button-btn bg-agree" open-type="agreePrivacyAuthorization"
</view> @agreeprivacyauthorization="handleAgree">同意并继续</button>
</view>
</view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef WEB || H5 --> <!-- #ifdef WEB || H5 -->
<view v-if="showPop"></view> <button id="agree-btn" class="privacy-button-btn bg-agree" @tap="handleAgree" @click="handleAgree">同意并继续</button>
<!-- #endif --> <!-- #endif -->
</view>
</view>
</view>
</view>
</template> </template>
<script> <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 { export default {
name: 'PrivacyPopup',
data() { data() {
return { return {
agree: false, agree: false,
showPop: false, showPop: false,
privacyAuthorization: null, privacyAuthorization: null,
privacyResolves: new Set(), privacyResolves: new Set(),
closeOtherPagePopUpHooks: new Set(), privacyContractName: '用户隐私保护指引',
privacyContractName: '用户隐私保护指引' appName: '本小程序',
// #ifdef WEB || H5
appName: '本应用',
privacyContractName: '《隐私条款》',
privacyServiceName: '《用户服务协议》',
// #endif
} }
}, },
mounted() { mounted() {
this.init() this.listenPrivacySettingChange()
this.curPageShow() this.curPageShow()
}, },
created() { created() {
let that = this
//查询微信侧记录的用户是否有待同意的隐私政策信息
try { try {
// #ifdef MP-WEIXIN
//查询微信侧记录的用户是否有待同意的隐私政策信息
wx.getPrivacySetting({ wx.getPrivacySetting({
success(res) { success: (res) => {
// console.log('隐私政策信息', res); // console.log('隐私政策信息', res);
// console.log(res.privacyContractName); // console.log(res.privacyContractName);
that.privacyContractName = 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
}
},
})
}
}
// #endif
} catch (e) { } catch (e) {
// console.log("=========低版本基础库==========") console.error("=========低版本基础库==========", e)
} }
}, },
methods: { methods: {
// 监听何时需要提示用户阅读隐私政策 getPrivacySettingByQuickApp() {
init() { // #ifdef QUICKAPP-WEBVIEW || H5 || WEB
let that = this; if (this.$util.isQuickApp()) {
if (typeof has != 'undefined' && has?.getPrivacySetting) {
has.getPrivacySetting({
success: (res) => {
// console.log(res)
if (res.needAuthorization) {
this.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)
}
}
}
// #endif
},
listenPrivacySettingChange() {
// #ifdef MP-WEIXIN
// 监听微信侧隐私政策授权变化事件
if (wx.onNeedPrivacyAuthorization) { if (wx.onNeedPrivacyAuthorization) {
wx.onNeedPrivacyAuthorization((resolve) => { wx.onNeedPrivacyAuthorization((resolve) => {
if (typeof that.privacyAuthorization === 'function') { if (typeof this.privacyAuthorization === 'function') {
that.privacyAuthorization(resolve) this.privacyAuthorization(resolve)
} }
}) })
} }
// #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() { proactive() {
let that = this // #ifdef MP-WEIXIN
if (wx.getPrivacySetting) { if (wx.getPrivacySetting) {
wx.getPrivacySetting({ wx.getPrivacySetting({
success: (res) => { success: (res) => {
// console.log(res) // console.log(res)
if (res.needAuthorization) { if (res.needAuthorization) {
that.popUp() this.popUp()
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗 // 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
this.closeOtherPagePopUp(this.disPopUp) this.closeOtherPagePopUp(this.disPopUp)
} else { } else {
@@ -83,9 +169,15 @@
} else { } else {
this.$emit('agree') this.$emit('agree')
} }
// #endif
// #ifdef QUICKAPP-WEBVIEW
this.getPrivacySettingByQuickApp();
// #endif
}, },
//初始化监听程序 //初始化监听程序
curPageShow() { curPageShow() {
closeOtherPagePopUpHooks.add(this.disPopUp)
this.privacyAuthorization = resolve => { this.privacyAuthorization = resolve => {
this.privacyResolves.add(resolve) this.privacyResolves.add(resolve)
//打开弹窗 //打开弹窗
@@ -93,11 +185,10 @@
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗 // 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
this.closeOtherPagePopUp(this.disPopUp) this.closeOtherPagePopUp(this.disPopUp)
} }
this.closeOtherPagePopUpHooks.add(this.disPopUp)
}, },
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗 // 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
closeOtherPagePopUp(closePopUp) { closeOtherPagePopUp(closePopUp) {
this.closeOtherPagePopUpHooks.forEach(hook => { closeOtherPagePopUpHooks.forEach(hook => {
if (closePopUp !== hook) { if (closePopUp !== hook) {
hook() hook()
} }
@@ -105,6 +196,7 @@
}, },
//打开隐私协议 //打开隐私协议
openPrivacyContract() { openPrivacyContract() {
// #ifdef MP-WEIXIN
wx.openPrivacyContract({ wx.openPrivacyContract({
success(res) { success(res) {
// console.log('打开隐私协议', res); // console.log('打开隐私协议', res);
@@ -113,6 +205,51 @@
// console.error('打开隐私协议失败', 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() { handleDisagree() {
@@ -143,21 +280,29 @@
this.privacyResolves.clear() this.privacyResolves.clear()
//关闭弹窗 //关闭弹窗
this.disPopUp() this.disPopUp()
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
// 保存用户授权状态到本地存储用于快应用Webview组件中的H5方式处理
uni.setStorageSync('privacyAgreed', true);
// #endif
this.$emit('agree') this.$emit('agree')
}, },
//打开弹窗 //打开弹窗
popUp() { popUp() {
if (this.showPop === false) { this.showPop = true;
this.showPop = true
}
}, },
//关闭弹窗 //关闭弹窗
disPopUp() { disPopUp() {
if (this.showPop === true) { this.showPop = false;
this.showPop = false },
} },
beforeDestroy() {
// 清理事件监听器和集合
this.privacyResolves.clear()
closeOtherPagePopUpHooks.delete(this.disPopUp)
// 注意:这里需要根据实际情况清理微信和快速应用的事件监听器
// 由于微信的 wx.onNeedPrivacyAuthorization 没有对应的 off 方法,这里可能需要其他方式处理
}, },
}
} }
</script> </script>
@@ -210,6 +355,9 @@
.privacy-button-btn { .privacy-button-btn {
color: #FFF; color: #FFF;
font-size: 30rpx; font-size: 30rpx;
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
font-size: 28rpx;
// #endif
font-weight: 500; font-weight: 500;
line-height: 100rpx; line-height: 100rpx;
text-align: center; text-align: center;

View File

@@ -1,6 +1,6 @@
export const lang = { export const lang = {
//title为每个页面的标题 //title为每个页面的标题
title: '退款', title: '售后',
checkDetail: '查看详情', checkDetail: '查看详情',
emptyTips: '暂无退款记录' emptyTips: '暂无售后记录'
} }

View File

@@ -103,7 +103,7 @@
}, },
"router" : { "router" : {
"mode" : "history", "mode" : "history",
"base" : "/hwappx/common/" "base" : "/hwappx/2811/"
}, },
"title" : "", "title" : "",
"devServer" : { "devServer" : {

View File

@@ -21,6 +21,17 @@
"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": {

View File

@@ -137,10 +137,8 @@
</uni-popup> </uni-popup>
</view> </view>
<hover-nav :need="true"></hover-nav> <hover-nav :need="true"></hover-nav>
<!-- #ifdef MP-WEIXIN --> <!-- 隐私协议 -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup> <privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top> <to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
<ns-login ref="login"></ns-login> <ns-login ref="login"></ns-login>
</view> </view>

View File

@@ -321,6 +321,7 @@ 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 {

View File

@@ -400,7 +400,7 @@
.price { .price {
color: var(--price-color); color: var(--price-color);
color: #fff !important; color: #fff !important;
font-size: 15rpx !important; font-size: 27rpx !important;
font-weight: bold !important; font-weight: bold !important;
} }
} }

View File

@@ -33,7 +33,6 @@
</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;">
@@ -89,8 +88,12 @@
</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">
@@ -113,20 +116,44 @@
<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 v-model="Form.realname" class="fui-input" :placeholder="$lang('pleaseEnterName')" value=""></input> <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 v-model="Form.mobile" class="fui-input" maxlength="11" :placeholder="$lang('pleaseEnterMobile')" type="number"></input> <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 class="textarea" v-model="Form.remark" :placeholder="$lang('pleaseEnterMessage')" style="font-size: 28rpx;padding: 10rpx;"></textarea> <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>
@@ -149,15 +176,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,
@@ -182,25 +209,22 @@ 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: {
@@ -222,47 +246,105 @@ 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({
title: res.message // 微信小程序:延迟清空原生输入框(确保 DOM 已更新)
}); // #ifdef MP-WEIXIN
setTimeout(() => {
this.clearInputValues();
}, 100);
// #endif
}, },
fail: res => { fail: () => {
uni.showToast({ title: '提交失败,请重试', icon: 'none' });
} }
}); });
}, },
change(e) { change(e) {
console.log(e) this.ismessage = e.show ? 1 : 0;
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',
@@ -270,8 +352,6 @@ 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',
@@ -280,12 +360,13 @@ 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'),
}) });
} }
} }
}; };
@@ -438,7 +519,6 @@ image {
position: relative; position: relative;
z-index: 0; z-index: 0;
} }
image { image {
max-width: 100%; max-width: 100%;
} }
@@ -483,7 +563,6 @@ 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%;
} }
@@ -511,7 +590,6 @@ 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;
@@ -531,7 +609,6 @@ 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;
@@ -553,7 +630,7 @@ image {
color: #fff; color: #fff;
font-size: 24rpx; font-size: 24rpx;
border-radius: 50rpx; border-radius: 50rpx;
width: 160rpx; // 足够容纳4个汉字(8个字符) width: 160rpx;
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);
@@ -565,7 +642,6 @@ image {
} }
.message { .message {
/* background-color: rgba(0,0,0,.8); */
border-radius: 50%; border-radius: 50%;
bottom: 50%; bottom: 50%;
height: 90rpx; height: 90rpx;

View File

@@ -96,6 +96,7 @@ export default {
this.$store.commit('setMemberInfo', ''); this.$store.commit('setMemberInfo', '');
this.$store.dispatch('emptyCart'); this.$store.dispatch('emptyCart');
uni.removeStorageSync('authInfo'); uni.removeStorageSync('authInfo');
uni.removeStorageSync('privacyAgreed');
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL); this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
} }
} }
@@ -118,7 +119,9 @@ export default {
this.$store.commit('setMemberInfo', ''); this.$store.commit('setMemberInfo', '');
this.$store.dispatch('emptyCart'); this.$store.dispatch('emptyCart');
uni.removeStorageSync('authInfo'); uni.removeStorageSync('authInfo');
uni.removeStorageSync('privacyAgreed');
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL); this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
} else { } else {
this.$util.showToast({ this.$util.showToast({
title: rres.message title: rres.message

View File

@@ -30,9 +30,10 @@
1. 使用HBuilderX打开项目 1. 使用HBuilderX打开项目
2. 选择菜单栏 "发行" -> "小程序-微信",进行发布构建 2. 选择菜单栏 "发行" -> "小程序-微信",进行发布构建
3. 然后在终端进入项目根目录,执行 `npm run mp-weixin` 手动输出构建包。例如mp-weixin-2025-10-31-1761881054836.zip 4. 0
4. 然后mp-weixin-2025-10-31-1761881054836发给微信开发定制客户技术人员, 3. 然后在终端进入项目根目录,执行 `npm run mp-weixin` 手动输出构建包。例如:mp-weixin-2025-10-31-1761881054836.zip改id
5. 定制客户技术人员可以修改解压后修改项目根目录下的site.js进行针对客户的信息配置然后使用微信开发者工具打开发布后的代码进行上传发布 5. 然后将mp-weixin-2025-10-31-1761881054836发给微信开发定制客户技术人员
6. 定制客户技术人员可以修改解压后修改项目根目录下的site.js进行针对客户的信息配置然后使用微信开发者工具打开发布后的代码进行上传发布
参照:`common\js\config.js` 文件内容说明: 参照:`common\js\config.js` 文件内容说明:
@@ -114,5 +115,8 @@ export default config;
### 快应用发布 ### 快应用发布
1. 使用HBuilderX打开项目 1. 使用HBuilderX打开项目
2. 选择菜单栏 "发行" -> "快应用",进行发布构建 2. manifest.jion---web配置---基础路径---/hwappx/改编号/
3. 使用快应用开发者工具打开发布后的代码进行上传发布 3. 选择菜单栏 "发行" ->自定义发行---H5-xcx.aigc-quickapp.com "快应用",进行发布构建
4. unpackage---dist---build---web---打包可以写上id
5. 然后将压缩包发给开发定制客户技术人员,
6. 使用快应用开发者工具打开发布后的代码进行上传发布

View File

@@ -1,8 +1,40 @@
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插件