Commit c6494465 by 李伟康

Merge branch 'saas+v5.8.3' of http://192.168.3.233:8090/glsx/gl_tape into saas+v5.8.3

2 parents acdf60cf eeb7c314
......@@ -111,8 +111,8 @@ export default {
data() {
return {
activityTypeTabs: [
{ label: '售前活动', key: 'preSale' },
{ label: '售后活动', key: 'afterSale' }
{ label: '新享特惠', key: 'preSale' },
{ label: '售后钜惠', key: 'afterSale' }
],
activityTypeIndex: 0,
carModelTabs: [
......
......@@ -15,7 +15,11 @@
<!-- 右 -->
<view class="header-right" v-if="type === 'out'" @click="handleGoCustomerFiles">
<view class="header-right-icon">
<view class="sprite-icon icon-customer-add"></view>
<image
class="header-add-icon"
:src="require('@/assets/images/common/icon-add-files.png')"
mode="aspectFit"
/>
</view>
<view class="header-right-text">
客户建档
......@@ -211,6 +215,12 @@ export default {
justify-content: center;
}
.header-add-icon {
width: 16px;
height: 16px;
flex-shrink: 0;
}
.header-right-text {
line-height: 1;
color: #2C66F7;
......
......@@ -192,6 +192,13 @@
:confirmText="examPopInfo.confirmText" @cancel="handleExamCancel" @confirm="handleExamConfirm" />
</StudyPopup>
<!-- 预学习弹框 -->
<StudyPopup :show.sync="showPreStudyPopup" title="提示" :width="848" :height="968"
:topImage="require('@/assets/images/common/warning-notice.webp')" :topImageWidth="848" :topImageHeight="248">
<PreStudyPopup :confirmText="examPopInfo.confirmText" @cancel="handlePreStudyCancel"
@confirm="handlePreStudyConfirm" @start-study="handlePreStudyStart" />
</StudyPopup>
<!-- 学习中心权限弹窗 -->
<StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870"
:topImage="require('@/assets/images/common/warning-notice.webp')" :topImageWidth="848" :topImageHeight="248"
......@@ -259,6 +266,7 @@ import { interceptionMixin } from '@/mixin/index'
import StudyPopup from '@/components/StudyPopup.vue'
import StudyPopupContent from '@/components/StudyPopupContent.vue'
import ExamSubmitPopup from '@/components/ExamSubmitPopup.vue'
import PreStudyPopup from '@/components/PreStudyPopup.vue'
import StudyCenterPermissionPopup from '@/components/StudyCenterPermissionPopup.vue'
import ActivityPopup from './components/ActivityPopup.vue'
import ErrorOrderPopup from '@/components/ErrorOrderPopup.vue'
......@@ -296,6 +304,7 @@ export default {
StudyPopup,
StudyPopupContent,
ExamSubmitPopup,
PreStudyPopup,
StudyCenterPermissionPopup,
ActivityCenter,
ActivityPopup,
......@@ -358,6 +367,7 @@ export default {
confirmText: '确认已提交'
},
showStudyPermissionPopup: false,
showPreStudyPopup: true,
courseInfo: {
title: ''
},
......@@ -383,6 +393,7 @@ export default {
uni.$off('pageBack')
},
async mounted() {
console.log('sessionId', this.sessionId)
this._syncShowFloatLog()
this._unsubFloatLog = FloatLogConfig.subscribe(() => {
this._syncShowFloatLog()
......@@ -542,6 +553,15 @@ export default {
}
this.getLevelExamInfo()
},
handlePreStudyCancel() {
this.showPreStudyPopup = false
},
handlePreStudyConfirm() {
this.showPreStudyPopup = false
},
handlePreStudyStart() {
this.showPreStudyPopup = false
},
handleStudyPermissionConfirm() {
this.showStudyPermissionPopup = false
if (this.lockReason == '2') {
......
<template>
<view class="exam-submit-popup-wrapper">
<view class="content-box">
<scroll-view class="course-list" scroll-y>
<view
class="course-item"
v-for="(item, index) in displayCourseList"
:key="item.id || index"
>
<view class="course-item-title">
<view class="course-item-title-text">{{ item.title }}</view>
<view class="course-item-desc">{{ item.description }}</view>
</view>
<view
class="course-item-btn"
v-if="item.state === 0"
@click.stop="handleStartStudy(item, index)"
>开启学习</view>
<view class="course-item-btn course-item-btn--learned" v-else>已学习</view>
</view>
</scroll-view>
</view>
<!-- 按钮组(始终显示) -->
<view class="button-group">
<view class="confirm-button" @click="handleConfirm">
{{ confirmText }}
</view>
</view>
</view>
</template>
<script>
const DEFAULT_COURSE_LIST = [
{
id: 1,
title: 'AITO 春醒悦享车衣套餐',
description: '包含:原厂定制隐形车衣 + 专属天窗....',
state:1
},
{
id: 2,
title: 'AITO 春醒悦享车衣套餐',
description: '包含:原厂定制隐形车衣 + 专属天窗....',
state:0
}
]
export default {
name: 'PreStudyPopup',
props: {
confirmText: {
type: String,
default: '跳过'
},
courseList: {
type: Array,
default: () => []
}
},
computed: {
displayCourseList() {
return this.courseList.length ? this.courseList : DEFAULT_COURSE_LIST
}
},
methods: {
handleStartStudy(item, index) {
if (item.state !== 0) return
this.$emit('start-study', item, index)
uni.navigateTo({
url: '/pages/common/prelearnBridge'
})
},
handleCancel() {
this.$emit('cancel')
},
handleConfirm() {
this.$emit('confirm')
}
}
}
</script>
<style lang="scss" scoped>
.exam-submit-popup-wrapper {
position: relative;
width: 100%;
min-height: toRpx(400);
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: toRpx(48);
}
.content-box {
width: toRpx(720);
box-sizing: border-box;
}
.course-list {
width: 100%;
height: toRpx(440);
box-sizing: border-box;
}
.course-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: toRpx(16);
width: 100%;
padding: toRpx(16);
border-radius: toRpx(16);
border: toRpx(2) solid #e4e9f7;
background: #f5f7fa;
box-sizing: border-box;
margin-bottom: toRpx(48);
}
.course-item-title {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: toRpx(16);
}
.course-item-title-text {
width: 100%;
color: #333333;
font-size: toRpx(40);
font-weight: 500;
font-family: "HarmonyOSSansSC";
line-height: toRpx(60);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.course-item-desc {
width: 100%;
color: #999999;
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(48);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.course-item-btn {
flex-shrink: 0;
height: toRpx(56);
padding: 0 toRpx(16);
border-radius: toRpx(8);
border: toRpx(2) solid rgba(44, 102, 247, 0.1);
background: #2c66f7;
color: #ffffff;
font-size: toRpx(26);
font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(56);
text-align: center;
white-space: nowrap;
&--learned {
border: 1px solid rgba(44, 102, 247, 0.10);
background: rgba(44, 102, 247, 0.05);
color: #2c66f7;
}
}
.button-group {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
gap: toRpx(16);
margin-top: toRpx(8);
}
.confirm-button {
width: toRpx(338);
height: toRpx(80);
margin: 0 auto;
border-radius: toRpx(48);
border: toRpx(2) solid #979797;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: toRpx(28);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
&:active {
opacity: 0.8;
}
}
</style>
......@@ -15,6 +15,7 @@
v-if="webviewUrl && isAppClient"
class="demo-webview"
:src="webviewUrl"
:fullscreen="false"
:webview-styles="webviewInsetStyle"
@message="handleWebMessage"
@onPostMessage="handleWebMessage"
......@@ -52,6 +53,9 @@ export default {
employeeName: '演示员工',
storeId: 'STORE-DEMO-001',
},
pendingAppBackTimer: null,
pendingAppBackRequestId: null,
navBackHotArea: null,
}
},
computed: {
......@@ -100,6 +104,7 @@ export default {
this.measureNavBarForWebview()
this.captureChildWebview()
this.initBrowserBridge()
this.createNavBackHotArea()
},
onBackPress(options) {
if (options.from === 'backbutton') {
......@@ -109,6 +114,8 @@ export default {
return false
},
onUnload() {
this.clearPendingAppBack()
this.destroyNavBackHotArea()
// #ifdef H5
window.removeEventListener('message', this.handleBrowserMessage)
// #endif
......@@ -201,6 +208,10 @@ export default {
if (message.type === 'PRELEARN_BACK_TO_APP') {
this.handleH5BackEvent(message)
}
if (message.type === 'PRELEARN_APP_BACK_HANDLED') {
this.handleH5BackHandled(message)
}
},
captureChildWebview() {
// #ifdef APP-PLUS
......@@ -242,6 +253,10 @@ export default {
if (message.type === 'PRELEARN_BACK_TO_APP') {
this.handleH5BackEvent(message)
}
if (message.type === 'PRELEARN_APP_BACK_HANDLED') {
this.handleH5BackHandled(message)
}
})
},
normalizeMessages(event) {
......@@ -321,8 +336,34 @@ export default {
}
}, 500)
},
clearPendingAppBack() {
if (this.pendingAppBackTimer) {
clearTimeout(this.pendingAppBackTimer)
this.pendingAppBackTimer = null
}
this.pendingAppBackRequestId = null
},
scheduleAppBackFallback(requestId, delayMs = 400) {
this.clearPendingAppBack()
this.pendingAppBackRequestId = requestId
this.pendingAppBackTimer = setTimeout(() => {
if (this.pendingAppBackRequestId !== requestId) return
console.log('[prelearn bridge demo] H5 did not confirm back, fallback navigateBack')
this.clearPendingAppBack()
this.navigateBack()
}, delayMs)
},
handleH5BackHandled(message) {
const requestId = message && (message.requestId || message.data && message.data.requestId)
if (requestId && this.pendingAppBackRequestId && requestId !== this.pendingAppBackRequestId) {
return
}
console.log('[prelearn bridge demo] H5 handled back internally:', message)
this.clearPendingAppBack()
},
handleH5BackEvent(message) {
console.log('[prelearn bridge demo] APP received H5 back event:', message)
this.clearPendingAppBack()
this.navigateBack()
},
notifyH5AppBackPressed() {
......@@ -334,6 +375,8 @@ export default {
console.log('[prelearn bridge demo] APP header back pressed, notify H5:', payload)
let notifiedH5 = false
// #ifdef H5
const iframe = document.querySelector('iframe')
if (iframe && iframe.contentWindow) {
......@@ -342,7 +385,7 @@ export default {
type: 'PRELEARN_APP_BACK_PRESSED',
...payload,
}, '*')
return
notifiedH5 = true
}
// #endif
......@@ -355,13 +398,64 @@ export default {
if (this.childWebview && this.childWebview.evalJS) {
this.childWebview.evalJS(script)
return
notifiedH5 = true
}
// #endif
if (notifiedH5) {
this.scheduleAppBackFallback(requestId)
return
}
console.log('[prelearn bridge demo] H5 missing, fallback navigateBack')
this.navigateBack()
},
createNavBackHotArea() {
// #ifdef APP-PLUS
if (this.navBackHotArea) return
const run = () => {
uni.createSelectorQuery()
.in(this)
.select('.nav-leading')
.boundingClientRect((rect) => {
if (!rect || rect.width <= 0 || rect.height <= 0) return
try {
this.destroyNavBackHotArea()
this.navBackHotArea = new plus.nativeObj.View('prelearnNavBackHotArea', {
top: `${Math.max(0, Math.floor(rect.top))}px`,
left: `${Math.max(0, Math.floor(rect.left))}px`,
width: `${Math.ceil(rect.width)}px`,
height: `${Math.ceil(rect.height)}px`,
backgroundColor: 'rgba(0,0,0,0)',
})
this.navBackHotArea.addEventListener('click', () => {
this.back()
}, false)
this.navBackHotArea.show()
} catch (error) {
console.log('[prelearn bridge demo] create nav back hot area failed:', error)
}
})
.exec()
}
this.$nextTick(() => {
run()
setTimeout(run, 120)
setTimeout(run, 400)
})
// #endif
},
destroyNavBackHotArea() {
// #ifdef APP-PLUS
if (!this.navBackHotArea) return
try {
this.navBackHotArea.close()
} catch (error) {
console.log('[prelearn bridge demo] destroy nav back hot area failed:', error)
}
this.navBackHotArea = null
// #endif
},
back() {
this.notifyH5AppBackPressed()
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!