|
|
@@ -11,6 +11,7 @@
|
|
|
<link rel="stylesheet"
|
|
|
href="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1758012584633/vant.css" />
|
|
|
<link rel="stylesheet" href="../css/select-tag.css">
|
|
|
+ <link rel="stylesheet" href="../css/page-return.css">
|
|
|
<!-- 必须先引入vue, 后使用vant-ui -->
|
|
|
<script
|
|
|
src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017957144/vue.js"></script>
|
|
|
@@ -22,6 +23,7 @@
|
|
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
|
|
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
|
|
|
<script src="../js/select-tag.js"></script>
|
|
|
+ <script src="../js/page-return.js"></script>
|
|
|
<!-- <script src="js/vconsole.min.js"></script>
|
|
|
<script>
|
|
|
var vConsole = new window.VConsole();
|
|
|
@@ -43,6 +45,7 @@
|
|
|
.page5 {
|
|
|
width: 100vw;
|
|
|
box-sizing: border-box;
|
|
|
+ padding-bottom: 39px;
|
|
|
}
|
|
|
|
|
|
.task_content {
|
|
|
@@ -726,6 +729,10 @@
|
|
|
<body>
|
|
|
<div id="box" class="box">
|
|
|
<div class="page5">
|
|
|
+ <van-dialog v-model="showReturn" title="提示" show-cancel-button :before-close="beforeClose" confirm-button-text="确定"
|
|
|
+ cancel-button-text="取消">
|
|
|
+ <div style="padding: 20px; text-align: center;">确认返回吗?</div>
|
|
|
+ </van-dialog>
|
|
|
<!-- 标签筛选组件 -->
|
|
|
<select-tag :show-Client-Tag.sync="showClientTag" :show-Label-Filter="showLabelFilter" :label-Filter.sync="selectLabelFilter" :select-Tag-List.sync="SelectWach" @add="handleAdd"></select-tag>
|
|
|
<!-- 选择群发时间 -->
|
|
|
@@ -1039,6 +1046,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 底部返回栏 -->
|
|
|
+ <page-return></page-return>
|
|
|
</div>
|
|
|
</body>
|
|
|
<script>
|
|
|
@@ -1053,6 +1062,10 @@
|
|
|
tenancyId: null,
|
|
|
token: null,
|
|
|
userId: null,
|
|
|
+ showReturn: false,
|
|
|
+ isConfirmingBack: false, // 标记是否已确认返回
|
|
|
+ pushStateCount: 0, // 记录 pushState 的次数
|
|
|
+ initialHistoryLength: 0, // 记录初始历史记录长度
|
|
|
clientBagKeyword: '',
|
|
|
showClientBag: false,
|
|
|
checkedCbIds: [], // 选中的客群包id
|
|
|
@@ -1090,7 +1103,6 @@
|
|
|
{ contentType: 3, name: '文件' },
|
|
|
{ contentType: 4, name: '外部链接' },
|
|
|
{ contentType: 15, name: '视频' },
|
|
|
- { contentType: 16, name: '视频链接' },
|
|
|
{ contentType: 17, name: '图集链接' },
|
|
|
],
|
|
|
|
|
|
@@ -1112,6 +1124,32 @@
|
|
|
showDateTime: [], // 外面展示的日期格式
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ // 监听浏览器返回按钮
|
|
|
+ if (window.history && window.history.pushState) {
|
|
|
+ // 记录初始历史记录长度
|
|
|
+ this.initialHistoryLength = window.history.length;
|
|
|
+ history.pushState(null, null, document.URL);
|
|
|
+ this.pushStateCount = 1; // 记录初始 pushState
|
|
|
+ window.addEventListener('popstate', this.handleBack, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 监听微信/企业微信返回按钮
|
|
|
+ if (typeof wx !== 'undefined' && wx.ready) {
|
|
|
+ wx.ready(() => {
|
|
|
+ wx.hideOptionMenu();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (typeof ww !== 'undefined' && ww.ready) {
|
|
|
+ ww.ready(() => {
|
|
|
+ ww.hideOptionMenu();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ // 移除事件监听
|
|
|
+ window.removeEventListener('popstate', this.handleBack, false);
|
|
|
+ },
|
|
|
created() {
|
|
|
this.bId = this.getQueryParam('bId')
|
|
|
this.env = this.getQueryParam('env')
|
|
|
@@ -1155,6 +1193,74 @@
|
|
|
this.checkedCbIds = this.SelectPackage.map(item => item.id)
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleBack(e) {
|
|
|
+ // 如果已经确认返回,直接返回,不显示弹框
|
|
|
+ if (this.isConfirmingBack) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果弹框已经显示,阻止默认返回行为,但不重复显示弹框
|
|
|
+ if (this.showReturn) {
|
|
|
+ // 阻止返回,重新添加历史记录
|
|
|
+ if (window.history && window.history.pushState) {
|
|
|
+ history.pushState(null, null, document.URL);
|
|
|
+ this.pushStateCount++;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 阻止默认返回行为
|
|
|
+ if (window.history && window.history.pushState) {
|
|
|
+ history.pushState(null, null, document.URL);
|
|
|
+ this.pushStateCount++;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 显示确认弹框
|
|
|
+ this.showReturn = true;
|
|
|
+ },
|
|
|
+ beforeClose(action, done) {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ // 点击确定,设置确认返回标志
|
|
|
+ this.isConfirmingBack = true;
|
|
|
+ // 清理数据
|
|
|
+ localStorage.removeItem('selectedMaters');
|
|
|
+ localStorage.removeItem('selectedMems');
|
|
|
+ localStorage.removeItem('clientMassData');
|
|
|
+ // 移除事件监听,避免触发弹框
|
|
|
+ window.removeEventListener('popstate', this.handleBack, false);
|
|
|
+ // 关闭弹框
|
|
|
+ done();
|
|
|
+ // 直接跳转到 WeCom.html 页面
|
|
|
+ setTimeout(() => {
|
|
|
+ // 获取当前 URL 的查询参数,保留必要的参数
|
|
|
+ const params = new URLSearchParams(window.location.search);
|
|
|
+ const memberId = params.get('memberId') || this.memberId;
|
|
|
+ const bId = params.get('bId') || this.bId;
|
|
|
+ const env = params.get('env') || this.env;
|
|
|
+
|
|
|
+ // 构建跳转 URL
|
|
|
+ let targetUrl = 'clientMassList.html';
|
|
|
+ if (memberId || bId || env) {
|
|
|
+ const queryParams = [];
|
|
|
+ if (memberId) queryParams.push(`memberId=${memberId}`);
|
|
|
+ if (bId) queryParams.push(`bId=${bId}`);
|
|
|
+ if (env) queryParams.push(`env=${env}`);
|
|
|
+ if (queryParams.length > 0) {
|
|
|
+ targetUrl += '?' + queryParams.join('&');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ window.location.href = targetUrl;
|
|
|
+ }, 150);
|
|
|
+ } else {
|
|
|
+ // 点击取消,关闭弹框,重新添加历史记录防止返回
|
|
|
+ done();
|
|
|
+ if (window.history && window.history.pushState) {
|
|
|
+ history.pushState(null, null, document.URL);
|
|
|
+ this.pushStateCount++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 打开顾问选择
|
|
|
handleAddMem() {
|
|
|
this.showMem = true
|
|
|
@@ -1202,7 +1308,7 @@
|
|
|
this.treeData = []
|
|
|
this.itemList = []
|
|
|
this.getTreeData(item.id)
|
|
|
- fetch(this.httpUrl + '/scrm/v1/wxcp-dept/m/findDeptMemberListByPage', {
|
|
|
+ fetch(this.httpUrl + '/scrm/v1/wxcp-dept/m/findActiveDeptMemberListByPage', {
|
|
|
method: 'post',
|
|
|
body: JSON.stringify({
|
|
|
deptId: item.id,
|
|
|
@@ -1782,6 +1888,9 @@
|
|
|
}),
|
|
|
headers: {
|
|
|
'Content-Type': 'application/json',
|
|
|
+ 'token': this.token,
|
|
|
+ 'tenancyId': this.tenancyId,
|
|
|
+ 'userId': this.userId,
|
|
|
}
|
|
|
}).then(res => {
|
|
|
return res.json()
|
|
|
@@ -1792,7 +1901,7 @@
|
|
|
localStorage.removeItem('selectedMems')
|
|
|
localStorage.removeItem('clientMassData')
|
|
|
localStorage.removeItem('selectedMaters')
|
|
|
- window.history.back()
|
|
|
+ this.beforeClose('confirm', () => { })
|
|
|
} else {
|
|
|
vant.Toast.fail(msg)
|
|
|
}
|