Files
frontend-app/App.vue
T

274 lines
3.7 KiB
Vue
Raw Normal View History

2026-08-20 17:31:00 +08:00
<script>
import { resumeDouyinPay } from '@/utils/douyin-pay.js';
2026-08-20 17:31:00 +08:00
import {
resumeKefuRealtime,
suspendKefuRealtime,
} from "@/uni_modules/hashmall-customer-service/js_sdk/kefu-realtime.js";
export default {
2026-08-26 17:00:58 +08:00
globalData: {
launchShown: false, // 内存标记,杀进程就清空
},
onLaunch: function () {
console.log("App Launch");
const res = uni.getSystemInfoSync();
uni.setStorageSync("platform", res.platform);
// #ifdef APP-PLUS
plus.navigator.closeSplashscreen(); // 立即关闭原生闪屏
// 获取应用版本信息
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
console.log("版本信息", inf.versionCode);
uni.setStorageSync("version-1", inf.version); // 大版本号
uni.setStorageSync("versionCode", inf.versionCode); // 小版本号
});
let uuid = plus.device.uuid;
// #endif
},
2026-08-20 17:31:00 +08:00
onShow: function () {
console.log("App Show");
uni.$emit("kefu-app-show");
resumeKefuRealtime();
resumeDouyinPay();
2026-08-26 17:00:58 +08:00
// 隐藏原生tabbar
/*#ifdef APP-PLUS*/
uni.hideTabBar({
animation: false,
});
/*#endif*/
},
2026-08-20 17:31:00 +08:00
onHide: function () {
console.log("App Hide");
uni.$emit("kefu-app-hide");
suspendKefuRealtime();
}
};
2026-08-26 17:00:58 +08:00
</script>
<style lang="scss">
@import "@/uni_modules/uview-plus/index.scss";
@import "@/uni.scss";
@import "@/common.scss";
page {
width: 100%;
max-width: 100%;
overflow-x: hidden;
}
.container {
padding: 15px;
}
.content {
display: flex;
min-width: 750rpx;
max-width: 750rpx;
height: 100vh;
padding: 0;
margin: 0;
flex-direction: column;
align-items: center;
position: relative;
overflow: hidden;
background-color: $app-bj;
}
.content-one {
display: flex;
min-width: 750rpx;
max-width: 750rpx;
height: calc(100vh - 100rpx);
padding: 0;
margin: 0;
flex-direction: column;
align-items: center;
position: relative;
overflow: hidden;
background-color: $app-bj;
}
.flex-r-lr {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.flex-c-lr {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.flex-c {
display: flex;
align-items: center;
justify-content: center;
}
.flex-r-e {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.flex-r {
display: flex;
flex-direction: row;
align-items: center;
}
.flex-col {
display: flex;
flex-direction: column;
}
.text-w-400 {
font-weight: 400;
}
.text-white {
color: #fff;
}
.text-zi {
color: #7934f6;
}
.text-zu {
color: #000;
}
.text-gray {
color: #333;
}
.text-fu {
color: #666;
}
.text-fu1 {
color: #999;
}
.text-lu {
color: #00a776;
}
.mt-12 {
margin-top: 12rpx;
}
.mt-24 {
margin-top: 24rpx;
}
.mb-32 {
margin-bottom: 32rpx;
}
.mt-32 {
margin-top: 32rpx;
}
.mt-48 {
margin-top: 48rpx;
}
.mt-88 {
margin-top: 88rpx;
}
.text-20 {
font-size: 20rpx;
}
.text-24 {
font-size: 24rpx;
}
.text-26 {
font-size: 26rpx;
}
.text-28 {
font-size: 28rpx;
}
.text-30 {
font-size: 30rpx;
}
.text-32 {
font-size: 32rpx;
}
.text-36 {
font-size: 36rpx;
}
.text-38 {
font-size: 38rpx;
}
.text-44 {
font-size: 44rpx;
}
.text-48 {
font-size: 48rpx;
}
.text-52 {
font-size: 52rpx;
}
.text-64 {
font-size: 64rpx;
}
.text-88 {
font-size: 88rpx;
}
.text-bold {
font-weight: bold;
}
.line-h {
line-height: 1.2;
}
.mr-32 {
margin-right: 32rpx;
}
.text-overflow1 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.text-d {
text-decoration: line-through;
}
.text-space {
white-space: nowrap;
}
button {
margin-bottom: 15px;
}
img {
width: 100%;
height: auto;
/* 保持图片比例 */
}
</style>