123456789101112131415161718192021222324252627282930313233 |
- // index.ts
- // 获取应用实例
- const app = getApp<IAppOption>()
- var mixins = require('../../utils/mixins')
- Page({
- mixins: [mixins],
- data: {
- motto: 'Hello World',
- userInfo: {},
- hasUserInfo: false,
- canIUse: wx.canIUse('button.open-type.getUserInfo'),
- canIUseGetUserProfile: false,
- canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
- },
- // 事件处理函数
- toPerson() {
- wx.navigateTo({
- url: '../person/index',
- })
- },
- onLoad() {
- // @ts-ignore
- if (wx.getUserProfile) {
- this.setData({
- canIUseGetUserProfile: true
- })
- }
- },
-
- })
|