2025-03-01 13:36:26 +00:00

386 lines
10 KiB
JavaScript

// pages/chat/chat.js
Page({
/**
* Page initial data
*/
data: {
show_modal: '',
prompt: [],
response: [],
welcome_response: [
{
type: 'text',
content: '欢迎使用徵象AI,让每一次验证都成为与品牌的深度对话。'
},
{
type: 'text',
content: '为保障您的权益,本系统采用多模态AI深度鉴真引擎,通过多重校验机制实现智能二维码防伪核验。'
},
{
type: 'text',
content: '请将手机摄像头对准产品智能二维码,'
},
{
type: 'scanguidecss',
},
{
type: 'text',
content: '保持画面完整覆盖定位点(图示区域), 系统将自动触发高精度图像分割算法完成验证。 '
},
],
prompt_message_verify_result: [
{
type: 'text',
content: '查看验证结果'
},
],
},
/**
* Lifecycle function--Called when page load
*/
onLoad(options) {
this.show_welcome_response();
this.show_verify_result();
this.show_product_details();
this.show_promotions();
},
/**
* Lifecycle function--Called when page is initially rendered
*/
onReady() {
},
/**
* Lifecycle function--Called when page show
*/
onShow() {
},
/**
* Lifecycle function--Called when page hide
*/
onHide() {
},
/**
* Lifecycle function--Called when page unload
*/
onUnload() {
},
/**
* Page event handler function--Called when user drop down
*/
onPullDownRefresh() {
},
/**
* Called when page reach bottom
*/
onReachBottom() {
},
/**
* Called when user click on the top right corner to share
*/
onShareAppMessage() {
},
goto_camera() {
wx.navigateTo({
url: '/pages/camera/camera',
})
},
show_service() {
this.setData({
show_modal: 'service',
})
},
show_channel() {
this.setData({
show_modal: 'channel',
})
},
hide_modal() {
console.log('hide_modal');
this.setData({
show_modal: '',
})
},
show_verify_tech() {
this.setData({
prompt: [
{
type: 'text',
content: '这个验证结果可信吗?'
},
],
response: [
{
type: 'text',
content: '本次验证使用「Al图像识别+微米级特征对比」T4.2.2模型',
classes: 'margin-bottom-10',
},
{
type: 'text',
content: '更新时间:2025年2月27日',
classes: 'secondary',
},
{
type: 'text',
content: '1.微观特征捕捉:系统以0.1mm精度扫描二维码的30+项微观特征'
},
{
type: 'text',
content: '2.加密特征匹配:比对云端预存的特征图像代码,误差率万分之一'
},
{
type: 'text',
content: '若对验证结果有疑虑,可通过人工客服通道咨询'
},
{
type: 'splitline',
},
{
type: 'text',
content: '你可能会问:'
},
{
type: 'suggestion',
title: '重看验证结果',
onclick: () => {
this.show_verify_result();
}
},
{
type: 'suggestion',
title: '这个产品怎么样?',
onclick: () => {
this.show_product_details();
}
},
{
type: 'suggestion',
title: '有什么福利活动吗?',
onclick: () => {
this.show_promotions();
}
}
]
})
},
show_verify_result() {
var resp = [
{
type: 'text',
content: '正在生成您的专属验真档案...'
},
{
type: 'text',
content: '验真结论:',
classes: 'margin-bottom-10',
},
{
type: 'text',
content: '正品认证通过!',
mark: 'tick',
},
{
type: 'text',
content: '经系统比对,您扫描的【徵象AI体验码】产品二维码为官方认证正品,可放心使用。'
},
{
type: 'text',
content: '验证编码: xxxxx',
classes: 'margin-bottom-10',
},
{
type: 'text',
content: '验证时间: 2025-02-24 14:30'
},
{
type: 'splitline',
},
{
type: 'text',
classes: 'secondary',
content: '你可能会问:'
},
{
type: 'suggestion',
title: '这个验证结果可信吗?',
onclick: () => {
this.show_verify_tech();
}
},
{
type: 'suggestion',
title: '这个产品怎么样?',
onclick: () => {
this.show_product_details();
}
},
{
type: 'suggestion',
title: '有什么福利活动吗?',
onclick: () => {
this.show_promotions();
}
},
]
this.setData({
prompt: [{
type: 'text',
content: '查看验证结果'
}],
response: resp,
})
},
show_welcome_response() {
this.setData({
response: this.data.welcome_response,
})
},
show_product_details() {
var resp = [
{
type: 'text',
content: '微象AI是由「广州市诚投科技有限公司」开发的AI驱动的智能防伪平台。'
},
{
type: 'text',
content: '通过「多模态特征识别」构建新一代防伪验证体系,实现从物理防伪到数字认证的全链路保护。系统采用ISO 12931国际防伪标准,已获取国家发明专利(证书编号:CN 115222000 B)。'
},
{
type: 'text',
content: '应用场景',
classes: 'margin-bottom-10 bold',
},
{
type: 'text',
content: '1.商品防伪',
classes: 'margin-bottom-10 bold',
},
{
type: 'text',
content: '2.证件安全验证',
classes: 'margin-bottom-10 bold',
},
{
type: 'text',
content: '3.工业品防伪',
classes: 'bold',
},
{
type: 'splitline',
},
{
type: 'text',
content: '你可能会问:',
classes: 'secondary',
},
{
type: 'suggestion',
title: '重看验证结果',
onclick: () => {
this.show_verify_result();
}
},
{
type: 'suggestion',
title: '这个验证结果可信吗?',
onclick: () => {
this.show_verify_tech();
}
},
{
type: 'suggestion',
title: '有什么福利活动吗?',
onclick: () => {
this.show_promotions();
}
}
]
this.setData({
prompt: [{
type: 'text',
content: '这个产品怎么样'
}],
response: resp,
})
},
show_promotions() {
var resp = [
{
type: 'text',
content: '感谢您选择正品!为保障权益,建议:'
},
{
type: 'text',
content: '·关注品牌公众号',
classes: 'margin-bottom-10',
},
{
type: 'text',
content: '·定期访问「会员中心」查看产品溯源信息',
classes: 'margin-bottom-10',
},
{
type: 'text',
content: '·参与【正品守护计划】赢取专属福利'
},
{
type: 'text',
content: '若发现异常验证结果,请立即通过官方客服通道举报'
},
{
type: 'splitline',
},
{
type: 'text',
content: '你可能会问:',
classes: 'secondary',
},
{
type: 'suggestion',
title: '重看验证结果',
onclick: () => {
this.show_verify_result();
}
},
{
type: 'suggestion',
title: '这个产品怎么样?',
onclick: () => {
this.show_product_details();
}
},
{
type: 'suggestion',
title: '这个验证结果可信吗?',
onclick: () => {
this.show_verify_tech();
}
}
]
this.setData({
prompt: [{
type: 'text',
content: '有什么福利活动吗?'
}],
response: resp,
})
},
})