| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- // index.js
- // 获取应用实例
- const app = getApp()
- import fetchutil from '../../utils/http'
- var mixins = require('../../utils/mixins')
- var {
- CDN_URL
- } = require('../../utils/util')
- Page({
- mixins: [mixins],
- data: {
- CDN_URL,
- isShowVideo: false,
- isShowAuthorize: false,
- },
- onLoad() {
- },
- onShow() {
- this.getUserInfo()
- },
- tapAuthclose() {
- this.setData({
- isShowAuthorize: false
- })
- },
- tapAuthComfirm() {
- this.setData({
- isShowAuthorize: false,
- isShowVideo: true
- })
- },
- onSkipButtonTap() {
- this.setData({
- isShowVideo: false
- })
- wx.navigateTo({
- url: '/pages/webview/index',
- })
- },
- onStart() {
- console.log(app.globalData.userInfo);
- let userInfo = app.globalData.userInfo || {}
- if (!userInfo.avatarUrl || !userInfo.nickName) {
- this.setData({
- isShowAuthorize: true
- })
- } else {
- this.setData({
- isShowVideo: true
- })
- }
- },
- getUserInfo() {
- fetchutil.get(`api/cms/wxUser/getUserInfo`, {}, {}).then((res) => {
- app.globalData.userInfo = res.data
- }).catch(() => { })
- },
- })
|