first commit

This commit is contained in:
Mauve
2026-09-08 17:20:27 +08:00
commit a7f2e0ca01
752 changed files with 111259 additions and 0 deletions
+112
View File
@@ -0,0 +1,112 @@
<template>
<view>
<u-navbar
:safeAreaInsetTop="true"
:placeholder="true"
:title="userName"
:fixed="true"
:autoBack="false"
leftIconColor="#C39A4B"
bgColor="#C39A4B"
titleStyle="max-width:none;width:auto;font-weight:bold;color:#ffffff;"
>
<view @tap="logout"
style="margin-top:2px;margin-right:3px;"
slot="right"
>
<image src="../../static/images/ico_exit.png" style="width:24px;height:24px;"></image>
</view>
</u-navbar>
</view>
</template>
<script>
import {logout} from '../../api/commonApi.js';
const ADFS_LOGOUT_URL = 'https://adfs.mgm.mo/adfs/ls/?wa=wsignout1.0&wtrealm=mgm_mobilecrm_app&wreply=https://hostcrmapp.mgm.mo/sso_callback/logout';
export default {
name:"mgmHeader",
data() {
return {
userName:'',
siteData:null,
userData:null
};
},
mounted() {
this.siteData = uni.getStorageSync("siteData");
this.userData = uni.getStorageSync("userData");
this.userName = this.userData.userName + ", " + this.userData.userId;
this.isLogin();
},
methods:{
updateUserData() {
this.userData = uni.getStorageSync("userData");
if (this.userData) {
this.userName = this.userData.userName + ", " + this.userData.userId;
} else {
this.userName = '';
}
},
async logout(){
uni.showLoading({
title: this.$t("common.loading")
});
try{
let params = {};
const res = await logout(params);
if(res.success == true){
if(res.data !== null){
uni.setTabBarItem({
index:0,
visible:false
});
uni.setTabBarItem({
index:1,
visible:false
});
uni.setTabBarItem({
index:2,
visible:false
});
if(this.siteData.mockSSO==false&&!this.siteData.internalTag){
//this.logoutWithADFSApp()
uni.redirectTo({
url:'/pages/azureLogout/azureLogout'
});
}else{
uni.removeStorageSync("userData");
uni.removeStorageSync("token");
uni.removeStorageSync("idToken");
this.navTo('/pages/login/login',2,false);
}
}
}else{
if(this.siteData.mockSSO==false&&!this.siteData.internalTag){
//this.logoutWithADFSApp()
uni.redirectTo({
url:'/pages/azureLogout/azureLogout'
});
}else{
uni.removeStorageSync("userData");
uni.removeStorageSync("token");
uni.removeStorageSync("idToken");
this.navTo('/pages/login/login',2,false);
}
}
}catch(e){
console.error(e);
uni.$u.toast(e.errMsg,5000);
var request = e.config!=undefined?JSON.stringify(e.config):"";
var response = e.data!=undefined?JSON.stringify(e.data):"";
await this.writeLog(this.userData.userId,"logout","","[APP][header.vue][logout][Catch Exception]"+e.errMsg,request,response,1,false);
}finally{
uni.hideLoading();
}
}
}
}
</script>
<style>
</style>
+78
View File
@@ -0,0 +1,78 @@
<template>
<view class="checkbox" :class="isOpen ? 'active' : ''" @click="handleToggle">
<text v-show="isOpen" style="padding-bottom:1px;">MASS</text>
<view class="circle"></view>
<text v-show="!isOpen" style="padding-bottom:1px;">IM</text>
</view>
</template>
<script>
export default {
props: {
isOpen: {
required: true,
type: Boolean,
default: false
}
},
data() {
return {};
},
methods: {
handleToggle() {
this.$emit('toggle');
}
}
};
</script>
<style scoped lang="scss">
.active {
background-color: #bd9c59 !important;
> .circle {
transform: translateX(92rpx); // 移动到右侧的距离
}
}
.checkbox {
width: 130rpx;
height: 40rpx;
padding: 4rpx;
border-radius: 24rpx;
background-color: #bd9c59; // 默认为灰色
display: flex;
justify-content: flex-start;
align-items: center;
position: relative; // 添加相对定位
> .circle {
width: 40rpx;
height: 40rpx;
background-color: white;
border-radius: 50%;
transition: transform 0.3s ease; // 添加过渡效果
position: absolute; // 使用绝对定位
left: 4rpx; // 左侧起始位置
}
> text {
flex: 1;
font-size: 26rpx;
margin-top:1px;
color: white;
position: relative; // 确保文本在圆形按钮上方
z-index: 1;
&:first-of-type {
text-align: left;
margin-left: 16rpx;
}
&:last-of-type {
text-align: right;
margin-right: 16rpx;
}
}
}
</style>
@@ -0,0 +1,20 @@
<template>
<view>
</view>
</template>
<script>
export default {
name:"playerInfoForBooking",
data() {
return {
};
}
}
</script>
<style>
</style>
@@ -0,0 +1,122 @@
<template>
<view v-if="showWatermark" class="watermark-container">
<view class="watermark-row" v-for="(row, rowIndex) in watermarkRows" :key="'row-' + rowIndex">
<text
class="watermark-text"
v-for="(col, colIndex) in watermarkCols"
:key="'col-' + colIndex"
:style="getWatermarkStyle(rowIndex, colIndex)"
>
{{ watermarkContent }}
</text>
</view>
</view>
</template>
<script>
export default {
name: 'SimpleWatermark',
data() {
return {
showWatermark: false,
watermarkContent: '',
watermarkRows: 8, // 竖直方向显示8行
watermarkCols: 2 // 水平方向显示2列
}
},
methods: {
getWatermarkStyle(rowIndex, colIndex) {
// 计算每个水印的位置
const rowSpacing = 100; // 行间距(px)
const colSpacing = 50; // 列间距(%)
return {
position: 'absolute',
top: (rowIndex * rowSpacing + 50) + 'px',
left: (colIndex * colSpacing + 25) + '%',
transform: 'translate(-50%, -50%) rotate(-45deg)',
color: 'rgba(0, 0, 0, 0.1)',
backgroundColor: 'transparent',
fontSize: '18px',
fontWeight: 'bold',
opacity: '0.6',
padding: '8px 16px',
whiteSpace: 'nowrap',
pointerEvents: 'none',
userSelect: 'none'
}
}
},
created() {
console.log('[SimpleWatermark] Component created');
console.log('[SimpleWatermark] uni object available:', typeof uni !== 'undefined');
// 立即注册事件监听器
console.log('[SimpleWatermark] Registering event listeners immediately');
// 监听显示水印事件
uni.$on('watermark-show', (content) => {
console.log('[SimpleWatermark] Received watermark-show event with content:', content);
this.watermarkContent = content;
this.showWatermark = true;
console.log('[SimpleWatermark] Watermark state updated - show:', this.showWatermark, 'content:', this.watermarkContent);
});
// 监听隐藏水印事件
uni.$on('watermark-hide', () => {
console.log('[SimpleWatermark] Received watermark-hide event');
this.showWatermark = false;
this.watermarkContent = '';
});
console.log('[SimpleWatermark] Event listeners registered successfully');
// 使用 nextTick 确保DOM完全渲染后再检查水印状态
this.$nextTick(() => {
// 延迟检查当前页面是否需要显示水印
setTimeout(() => {
console.log('[SimpleWatermark] Checking current page watermark status');
const watermarkStore = require('@/store/watermark.js');
if (watermarkStore && watermarkStore.updateWatermark) {
console.log('[SimpleWatermark] Triggering watermark update to sync current state');
watermarkStore.updateWatermark(true);
}
}, 200);
});
},
beforeDestroy() {
// 移除事件监听
uni.$off('watermark-show');
uni.$off('watermark-hide');
console.log('[SimpleWatermark] Event listeners removed');
}
}
</script>
<style scoped>
.watermark-container {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
z-index: 9999;
overflow: hidden;
}
.watermark-row {
position: relative;
width: 100%;
height: 100px;
}
.watermark-text {
position: absolute;
white-space: nowrap;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
</style>