Commit f1a9e2db by 岑成威

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

2 parents 2dfa5705 d4e1a948
......@@ -33,7 +33,7 @@ export default {
},
prelearnContext: {
type: Object,
default: () => ({skipCount: 2})
default: () => ({skipCount:0})
}
},
computed: {
......
......@@ -67,8 +67,10 @@ export default {
if (item.learnStatus !== 'NOT_STUDY') return
this.$emit('start-study', item, index)
console.log('预学习桥接页跳转***', item);
console.log('预学习桥接页跳转***', this.prelearnData);
this.prelearnData.activityProductId = item.activityProductId
const prelearnDataStr = encodeURIComponent(JSON.stringify(this.prelearnData))
console.log('预学习桥接页跳转***', prelearnDataStr);
uni.navigateTo({
url: `/pages/common/prelearnBridge?prelearnData=${prelearnDataStr}&entrySource=home_popup`,
fail: (err) => {
......
......@@ -8,7 +8,7 @@
@click="changeGoods(i, index)">
<view :class="['goods-status flex']">{{ statusText(i.isMainPush) }}</view>
<image class="goods-image" :src="i.thumbImageUrl"></image>
<view class="goods-title text-hide">{{ i.tabName }}</view>
<view class="goods-title">{{ i.tabName }}</view>
<view class="goods-description">
<rich-text :nodes="i.tabDescription"></rich-text>
</view>
......@@ -174,6 +174,8 @@ export default {
height: toRpx(240);
top: toRpx(24);
left: toRpx(32);
border-radius: toRpx(12);
overflow: hidden;
}
.goods-title {
......@@ -181,6 +183,7 @@ export default {
font-size: toRpx(30);
color: #1A1A2E;
line-height: toRpx(36);
word-break: break-all;
}
.goods-description {
......
......@@ -144,13 +144,21 @@ export default {
try {
const prelearnData = JSON.parse(decodeURIComponent(options.prelearnData))
console.log('[prelearnBridge] 预学习弹窗数据 prelearnData:', prelearnData)
const { activityId, activityProductId, entrySource } = prelearnData
const { activityId, packages, remainingSkipCount, entrySource } = prelearnData
if (activityId != null) {
this.prelearnContext.activityId = String(activityId)
}
const notStudyPackage = (packages || []).find(
(pkg) => pkg.learnStatus === 'NOT_STUDY'
)
const activityProductId = prelearnData.activityProductId
?? notStudyPackage?.activityProductId
if (activityProductId != null) {
this.prelearnContext.activityProductId = String(activityProductId)
}
if (remainingSkipCount != null) {
this.prelearnContext.skipCount = remainingSkipCount
}
if (entrySource) {
this.prelearnContext.entrySource = entrySource
}
......@@ -740,11 +748,13 @@ export default {
// #endif
},
async checkMainPushStaffLearnStatus() {
console.log('[prelearnBridge] goodsInfo res:',this.goodsInfo)
console.log('[prelearnBridge] prelearnContext res:', this.prelearnContext)
const res = await uni.$api.activityApi.getPrelearnScriptBoardAPI({
activityId: this.goodsInfo.activityId || this.prelearnContext.activityId,
activityProductId: this.goodsInfo.productId || this.prelearnContext.activityProductId,
})
console.log('[prelearnBridge] getPrelearnScriptBoardAPI res:', res)
console.log('[prelearnBridge] 查询状态结果 res:', res)
const status = Number(res?.staffLearnStatus)
return status === 1 || status === 2
},
......@@ -761,45 +771,51 @@ export default {
this.navigateBack()
return
}
if (Number(this.isMainPush) === 1) {
console.log('this.isMainPush***', this.isMainPush);
// if (Number(this.isMainPush) === 1) {
let learned = false
try {
const learned = await this.checkMainPushStaffLearnStatus()
learned = await this.checkMainPushStaffLearnStatus()
console.log("学习状态查询***", learned);
if (learned) {
this.navigateBack()
return
}
this.showMainPushBackTip()
} catch (error) {
console.error('[prelearnBridge] 预学习状态查询失败:', error)
this.showMainPushBackTip()
}
return
}
try {
const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
console.log('[prelearnBridge] getPrelernHomePopupAPI res:', res)
const packages = res.packages || []
const allStudied = packages.length > 0 && packages.every(
(pkg) => pkg.learnStatus === 'STUDIED'
)
if (allStudied) {
if (learned) {
this.navigateBack()
return
}
if (res.activityId != null) {
this.prelearnContext.activityId = String(res.activityId)
if (this.prelearnContext.entrySource === 'home_popup') {
this.showBackPopup = true
} else {
this.showMainPushBackTip()
}
this.prelearnContext.skipCount = res.remainingSkipCount ?? 0
this.showBackPopup = true
} catch (error) {
console.error('[prelearnBridge] 预学习返回弹框查询失败:', error)
this.showBackPopup = true
}
// }
// try {
// const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
// console.log('[prelearnBridge] getPrelernHomePopupAPI res:', res)
// const packages = res.packages || []
// const allStudied = packages.length > 0 && packages.every(
// (pkg) => pkg.learnStatus === 'STUDIED'
// )
// if (allStudied) {
// this.navigateBack()
// return
// }
// if (res.activityId != null) {
// this.prelearnContext.activityId = String(res.activityId)
// }
// // 仅当接口返回有效值时更新,避免 undefined 覆盖 onLoad 已写入的 skipCount
// if (res.remainingSkipCount != null) {
// this.prelearnContext.skipCount = res.remainingSkipCount
// }
// this.showBackPopup = true
// } catch (error) {
// console.error('[prelearnBridge] 预学习返回弹框查询失败:', error)
// this.showBackPopup = true
// }
},
handleBackPopupCancel() {
this.showBackPopup = false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!