123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- // index.js
- // 获取应用实例
- const app = getApp()
- Page({
- data: {
- isIPhoneX: false,
- follow: false,
- text: ''
- },
- // 事件处理函数
- bindViewTap() {
- wx.navigateTo({
- url: '../logs/logs'
- })
- },
- onLoad() {
- this.getText();
- },
- toOther(e) {
- var type = Number(e.currentTarget.dataset.type);
- switch (type) {
- case 1:
- wx.showToast({
- title: '敬请期待',
- icon: 'none'
- })
- break;
- case 2:
- wx.navigateTo({
- url: '/pages/floow/floow'
- })
- break;
- case 3:
- wx.navigateTo({
- url: '/pages/about/about'
- })
- break;
- default:
- wx.navigateTo({
- url: '/pages/historyLink/index'
- })
- break;
- }
- },
- getText() {
- wx.showLoading({
- title: '加载中',
- })
- app.func.req('/api/app/config', 'get', {
- 'version': '1.0.1'
- }, (res) => {
- wx.hideLoading()
- wx.setStorageSync('version',res.v)
- if(res && res.errno == 0){
- this.setData({
- text: res.rst.platform
- })
- }else {
- wx.showToast({
- title: res.err,
- icon: 'none',
- duration: 2000
- })
- }
- },()=>{
- wx.hideLoading()
- })
- },
- toLink(e) {
- if(wx.getStorageSync('isLogin')){
- wx.navigateTo({
- url: e.currentTarget.dataset.page,
- })
- }else{
- wx.setStorageSync('encryptedData',e.detail.encryptedData)
- wx.setStorageSync('iv',e.detail.iv)
- app.login((res)=>{
- wx.navigateTo({
- url: e.currentTarget.dataset.page,
- })
- },(err)=>{
- wx.showToast({
- title: '服务繁忙,请稍后重试!',
- icon: 'none',
- duration: 2000
- })
- })
- }
- },
- toApplet() {
- wx.navigateToMiniProgram({
- appId: 'wx5bcf8975e677d8d4',
- path: '/pages/index/index'
- })
- },
- closeToast() {
- this.setData({
- follow: false
- })
- },
- onShareAppMessage(res) {
- return app.shareEvent(res,'/pages/index/index')
- }
- })
|