| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- // 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
- 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(() => {})
- },
- })
|