phizclip-uniapp-demo/finclip-uniapp-test/App.vue

82 lines
2.1 KiB
Vue
Raw Normal View History

2022-06-08 11:57:35 +08:00
<script>
const MopSdk = uni.requireNativePlugin('MopSdk');
export default {
2022-11-23 15:09:37 +08:00
onLaunch: function(options) {
console.log('App Launch',options)
2022-06-08 11:57:35 +08:00
MopSdk.initialize({
'sdkKey': '22LyZEib0gLTQdU3MUauAa2CctUv+NxTLFWyPxC28y2gA4x+JWh7hhNS5aO52BFs',
'sdkSecret': '65146ffa924ecfdc',
'apmServer': 'https://api.finclip.com',
2022-11-04 22:26:55 +08:00
'apiServer': 'https://api.finclip.com',
'enableAppletDebug': true,
'uiConfig': {
'hideTechSupport': true
}
2022-06-08 11:57:35 +08:00
},
(ret) => {
console.log('App Launch Success', ret)
},
(ret) =>{
console.log('App Launch Fail', ret)
2022-11-04 22:26:55 +08:00
})
//小程序关闭按钮事件
MopSdk.setNavigationBarCloseButtonClicked((res) => {
console.log('小程序关闭按钮事件', res)
})
//设置小程序button获取用户信息getUserInfo
MopSdk.setUserInfo({
name: '测试',
sex: '男'
},(res) => {
console.log('设置小程序用户信息成功', JSON.stringify(res))
},(res) => {
console.log('设置小程序用户信息失败', JSON.stringify(res))
})
//设置小程序button获取用户头像信息chooseavatar
MopSdk.setChooseAvatar('https://dddd.com/12121.jpg')
//设置小程序button获取用户手机信息getPhoneNumber
MopSdk.setGetPhoneNumber('13800000000')
//自定义小程序API
MopSdk.registerExtensionApi('getJWToken', (res) => {
//回调值
MopSdk.onSuccess(res.uuid, {
jwToken : 'jwToken'
})
})
MopSdk.registerExtensionApi('getJWToken2', (res) => {
//回调值
MopSdk.onSuccess(res.uuid, {
jwToken2 : 'jwToken2'
})
})
//自定义小程序webview API
MopSdk.registerWebExtentionApi('getJWToken', (res) => {
//回调值
MopSdk.onSuccess(res.uuid, {
jwToken : 'webview===>jwToken'
})
})
MopSdk.registerWebExtentionApi('getJWToken2', (res) => {
//回调值
MopSdk.onSuccess(res.uuid, {
jwToken2 : 'webview===>jwToken2'
})
})
2022-06-08 11:57:35 +08:00
},
onShow: function() {
//console.log('App Show')
},
onHide: function() {
//console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
</style>