import { getLogger } from "../../utils/log" ; import autologBehavior from "../../behaviors/autolog-behavior" ; import { getLaunchOptions } from "../../utils/util" ; import { reLaunch } from "../../utils/navigate" ; const PAGE_NAME = "result" ; const logger = getLogger ( PAGE_NAME ) ; Component ( { behaviors : [ autologBehavior ] , data : { PAGE_NAME , type : "success" , title : "成功" , info : "" , isFromApp : false , isFromMiniProgram : false } , properties : { type : String , title : String , info : String } , methods : { onLoad ( ) { const options = getLaunchOptions ( ) ; logger . RUN ( "onLoad, this.data = " , this . data , "options = " , options ) ; this . setData ( { isFromApp : options . scene === 1069 , isFromMiniProgram : options . scene === 1037 } ) ; } , clickReturn ( ) { const { isFromMiniProgram } = this . data ; if ( isFromMiniProgram ) { wx . navigateBackMiniProgram ( { fail ( ) { wx . showToast ( { title : "无法返回小程序" , icon : "none" } ) ; } } ) ; } else { reLaunch ( "/pages/index/index" ) ; } } , launchAppFail ( ) { wx . showToast ( { title : "无法返回App" , icon : "none" } ) ; } } } ) ;