You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import component from '@/utils/component'
|
|
|
|
import relativeTime from '@/utils/dayjs/relativeTime.js'
|
|
|
|
import page from '@/utils/page'
|
|
|
|
|
|
|
|
import { request } from '@/utils/request'
|
|
|
|
|
|
|
|
const dayjs = require('dayjs')
|
|
|
|
const licia = require('miniprogram-licia')
|
|
|
|
require('/utils/dayjs/day-zh-cn.js')
|
|
|
|
|
|
|
|
dayjs.locale('zh-cn') // 全局使用
|
|
|
|
dayjs.extend(relativeTime)
|
|
|
|
|
|
|
|
App<IAppOption>({
|
|
|
|
globalData: {
|
|
|
|
// 测试号 wx2b0bb13edf717c1d
|
|
|
|
// dev
|
|
|
|
// appid:wxaae50c206446a964
|
|
|
|
url: 'https://m.takeda.hbraas.com',
|
|
|
|
upFileUrl: 'https://m.takeda.hbraas.com/',
|
|
|
|
imageUrl: 'https://m.takeda.hbraas.com/wt/',
|
|
|
|
// pro
|
|
|
|
// appid:wx96f45ca4f1fa36ec
|
|
|
|
// url: 'https://m.takeda.hbraas.com',
|
|
|
|
// upFileUrl: 'https://m.takeda.hbraas.com/',
|
|
|
|
// imageUrl: 'https://m.takeda.hbraas.com/zd/',
|
|
|
|
},
|
|
|
|
onLaunch() {
|
|
|
|
Page = page as WechatMiniprogram.Page.Constructor
|
|
|
|
Component = component as WechatMiniprogram.Component.Constructor
|
|
|
|
|
|
|
|
wx.ajax = licia.curry(request)({ gUrl: this.globalData.url })
|
|
|
|
|
|
|
|
wx.login({
|
|
|
|
success: (res) => {
|
|
|
|
console.log('code', res)
|
|
|
|
},
|
|
|
|
})
|
|
|
|
},
|
|
|
|
waitLogin() {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
resolve(true)
|
|
|
|
reject(false)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getMenuInfo(self) {
|
|
|
|
const menuButtonInfo = wx.getMenuButtonBoundingClientRect()
|
|
|
|
self.setData({
|
|
|
|
menuButtonInfo,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
})
|