feat: 完善登录流程、UI适配及协议文档更新
本次提交包含以下修改: 1. 新增微信登录相关服务及页面逻辑,实现首次微信绑定手机号流程 2. 优化产品匹配卡片 UI,移除不必要状态显示 3. 调整首页 scroll-view 属性及 banner 背景样式 4. 完善积分规则校验逻辑,增加时区及策略格式验证 5. 更新协议草案文档,补充资料清单及功能说明 6. 修复分析结果路由路径,适配新的匹配结果页面 7. 调整品牌 Logo 安卓端字体对齐样式
This commit is contained in:
@@ -4,6 +4,7 @@ const ts=require('D:/Develop/HBuilderX/plugins/uniapp-uts-v1/node_modules/@dclou
|
||||
const repo=path.resolve(__dirname,'..');
|
||||
const compile=source=>ts.transpileModule(source,{compilerOptions:{module:ts.ModuleKind.CommonJS,target:ts.ScriptTarget.ES2020}}).outputText;
|
||||
const routeExports={};vm.runInNewContext(compile(fs.readFileSync(path.join(repo,'services/report-route.uts'),'utf8')),{exports:routeExports});
|
||||
const matchRoutes={};vm.runInNewContext(compile(fs.readFileSync(path.join(repo,'services/match-route.uts'),'utf8')),{exports:matchRoutes});
|
||||
const script=fs.readFileSync(path.join(repo,'packages/finance/analyzing/analyzing.uvue'),'utf8').match(/<script setup lang="uts">([\s\S]*?)<\/script>/)[1];
|
||||
function status(overrides={}){return {id:'42',revisionId:'9',publishedRevisionId:'9',status:'succeeded',statusLabel:'分析完成',message:'',hasReport:true,stage:'completed',canRetry:false,taskId:'task9',...overrides};}
|
||||
function page(reply){
|
||||
@@ -13,7 +14,7 @@ function page(reply){
|
||||
onLoad:fn=>{onLoad=fn},onShow:fn=>{onShow=fn},onHide:fn=>{onHide=fn},onUnload:fn=>{onUnload=fn},
|
||||
setTimeout:fn=>{timers.push(fn);return timers.length},clearTimeout:()=>{},setInterval:()=>1,clearInterval:()=>{},
|
||||
uni:{redirectTo:({url})=>{navigations.push({kind:'redirect',url})},navigateTo:({url})=>{navigations.push({kind:'navigate',url})}},
|
||||
require:module=>module.endsWith('layout.uts')?{usePageLayout:()=>({})}:module.endsWith('api.uts')?{getSession:session}:module.endsWith('records.uts')?{fetchAssessmentStatus:async()=>typeof response==='function'?response():response}:module.endsWith('report-route.uts')?routeExports:(()=>{throw Error('Unexpected dependency '+module)})()};
|
||||
require:module=>module.endsWith('layout.uts')?{usePageLayout:()=>({})}:module.endsWith('api.uts')?{getSession:session}:module.endsWith('records.uts')?{fetchAssessmentStatus:async()=>typeof response==='function'?response():response}:module.endsWith('report-route.uts')?routeExports:module.endsWith('match-route.uts')?matchRoutes:(()=>{throw Error('Unexpected dependency '+module)})()};
|
||||
vm.runInNewContext(compile(script+'\nexports.refreshStatus=refreshStatus; exports.report=report; exports.statusMessage=()=>message.value;'),context);
|
||||
onLoad({assessmentId:'42'});
|
||||
return {navigations,timers,show:()=>onShow(),hide:()=>onHide(),setReply:r=>{response=r},setToken:t=>{token=t},refresh:()=>context.exports.refreshStatus(),manualReport:()=>context.exports.report(),message:()=>context.exports.statusMessage()};
|
||||
@@ -23,12 +24,13 @@ let checks=0;const check=(ok,label)=>{assert.ok(ok,label);checks++};
|
||||
(async()=>{
|
||||
let p=page(status());p.show();await flush();
|
||||
check(p.navigations.length===1,'successful analysis automatically opens its result');
|
||||
assert.deepEqual(p.navigations[0],{kind:'redirect',url:'/packages/finance/report/report?assessmentId=42&tab=matches&revisionId=9'});checks++;
|
||||
assert.deepEqual(p.navigations[0],{kind:'redirect',url:'/packages/finance/matches/matches?assessmentId=42&productIds=&revisionId=9&group=all'});checks++;
|
||||
p.manualReport();assert.deepEqual(p.navigations[1],p.navigations[0]);checks++;
|
||||
check(p.timers.length===0,'successful result does not keep polling');
|
||||
p=page(status({status:'processing',stage:'queued',revisionId:'10',publishedRevisionId:'9'}));p.show();await flush();
|
||||
check(p.navigations.length===0&&p.timers.length===1,'processing revision never opens the older published report');
|
||||
p.setReply(status({revisionId:'10',publishedRevisionId:'10'}));p.timers[0]();await flush();
|
||||
check(p.navigations.length===1&&p.navigations[0].url.endsWith('tab=matches&revisionId=10'),'poll completion opens the newly published revision');
|
||||
check(p.navigations.length===1&&p.navigations[0].url==='/packages/finance/matches/matches?assessmentId=42&productIds=&revisionId=10&group=all','poll completion opens the newly published match results');
|
||||
p=page(status({status:'failed',canRetry:true}));p.show();await flush();check(p.navigations.length===0,'failed assessment stays on recovery page');
|
||||
check(p.message().includes('分析未完成')&&!p.message().includes('可查看本次报告'),'failed analysis without server message does not announce completed report');
|
||||
p=page(status({hasReport:false,publishedRevisionId:''}));p.show();await flush();check(p.navigations.length===0,'missing report never navigates to an unfrozen result');
|
||||
|
||||
Reference in New Issue
Block a user