feat: 小程序与管理端迭代(神仙AI、了解自己CRM、AI测试入口、报表与分润等)

Made-with: Cursor
This commit is contained in:
卡若
2026-04-17 19:46:48 +08:00
parent cf835ea585
commit 7108f28280
239 changed files with 21061 additions and 2175 deletions

View File

@@ -0,0 +1,31 @@
const analytics = require('../../utils/analytics.js')
Page({
data: { url: '', loadedAt: 0 },
onLoad(options) {
let url = decodeURIComponent(options && options.url || '')
if (!url) {
wx.showToast({ title: '链接为空', icon: 'none' })
return
}
// 仅允许 http/https
if (!/^https?:\/\//.test(url)) {
wx.showToast({ title: '链接非法', icon: 'none' })
return
}
this.setData({ url, loadedAt: Date.now() })
if (options && options.title) {
wx.setNavigationBarTitle({ title: decodeURIComponent(options.title) })
}
},
onLoad2() {},
onError() {
wx.showToast({ title: '页面加载失败', icon: 'none' })
},
onUnload() {
const readMs = Date.now() - (this.data.loadedAt || Date.now())
if (readMs > 5000) {
analytics.track('ai_article_read', { readMs })
}
}
})

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "阅读",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"usingComponents": {}
}

View File

@@ -0,0 +1,4 @@
<web-view wx:if="{{url}}" src="{{url}}" bindload="onLoad" binderror="onError"></web-view>
<view wx:else class="placeholder">
<view>链接为空或不可访问</view>
</view>

View File

@@ -0,0 +1,6 @@
.placeholder {
padding: 120rpx 40rpx;
text-align: center;
color: #9CA3AF;
font-size: 28rpx;
}