index.js 1.72 KB
import { IMG_URL } from "~/utils/constantData";
import USERAPI from '~/api/usersApi/index'
import {taskLoginAndRegister} from '../../../common/common'
Page({

  data: {
    IMG_URL:IMG_URL
  },

  onRoute(options) {
    taskLoginAndRegister({options,pages:'addFLGStep'})
    // console.log(options);
    // if (!options) {
    //   return
    // }
    // if (options.merchantId) {
    //   options.pages = 'addFLGStep'
    //   const sessionId = wx.$storage.get('sessionId')
    //   if (!sessionId) {
    //     let para = {
    //       merchantId: options.merchantId,
    //       type: 1,
    //       pages:'addFLGStep'
    //     }
    //     let temp = encodeURIComponent(JSON.stringify(para))
    //     wx.navigateTo({
    //       url: '/packageStoreAssistant/packageAuth/pages/authentication/register/register?data=' + temp,
    //     });
    //   } else {
    //     const USERINFO = wx.$storage.get('userInfo')
    //     if (USERINFO.merchantId == options.merchantId) {
    //       USERAPI.checkSession().then(({
    //         code
    //       }) => {
    //         if (code == '0') {
    //           // this.getFLG(true,options.merchantId)
    //         } else {
    //           wx.$router.reLaunch('/packageStoreAssistant/packageAuth/pages/authentication/login/login', options)
    //         }
    //       })
    //     } else {
    //       let para = {
    //         merchantId: options.merchantId,
    //         type: 1,
    //         pages:'addFLGStep'
    //       }
    //       let temp = encodeURIComponent(JSON.stringify(para))
    //       wx.navigateTo({
    //         url: '/packageStoreAssistant/packageAuth/pages/authentication/register/register?data=' + temp,
    //       });
    //     }
    //   }
    // }

  },
})