| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- // pages/mytest/mytest.js
- const app = getApp()
- import http from "../../utils/http"
- import util from "../../utils/util"
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- safeTop: `40px`,
- info: '',
- config: '',
- appids: ''
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- const high = app.globalData.safeTop + 20
- this.setData({
- safeTop: `${high}px`
- })
-
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- this.getInfo();
- },
- onLoadConfig(option){
- this.setData({
- config: app.globalData.config
- })
- },
- toService(){
- wx.navigateToMiniProgram({
- appId: this.data.appids.skillappid,
- envVersion: 'develop'
- })
- },
- toShop(){
- wx.navigateToMiniProgram({
- appId: this.data.appids.shopappid,
- envVersion: 'develop'
- })
- },
- login(){
- util.skip('/service/login/login')
- },
- skip(e){
- let url = e.currentTarget.dataset.url
- util.authSkip(url)
- },
- myOrder(e){
- let type = e.currentTarget.dataset.type
- let active = e.currentTarget.dataset.active
- let num = this.data.info ? this.data.info.orderCount.unServiceCount : 0
- util.authSkip('/service/myorder/myorder?type='+type+'&active='+active+'&num='+num)
- },
- getInfo(){
- http.post('index/getAppid', '', !this.data.info).then(res => {
- this.setData({
- appids: res.data
- })
- })
- if(!wx.getStorageSync('token')) return
- http.post('index/userindex', '', !this.data.info).then(res => {
- this.setData({
- info: res.data
- })
- })
- },
- //跳转意见反馈
- tofeedback(){
- wx.navigateTo({
- url: '/service/feedback/feedback',
- })
- },
- //跳转领券中心
- tocouponscenter(){
- wx.navigateTo({
- url: '/service/couponscenter/couponscenter',
- })
- },
- //跳转我的评论
- tomycomment(){
- wx.navigateTo({
- url: '/service/mycomment/mycomment',
- })
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- return {}
- }
-
- })
|