|
|
|
@ -1,41 +1,41 @@
@@ -1,41 +1,41 @@
|
|
|
|
|
import component from "@/utils/component"; |
|
|
|
|
import relativeTime from "@/utils/dayjs/relativeTime.js"; |
|
|
|
|
import page from "@/utils/page"; |
|
|
|
|
import { request } from "@/utils/request"; |
|
|
|
|
import { parseScene } from "./utils/util"; |
|
|
|
|
import component from '@/utils/component'; |
|
|
|
|
import relativeTime from '@/utils/dayjs/relativeTime.js'; |
|
|
|
|
import page from '@/utils/page'; |
|
|
|
|
import { request } from '@/utils/request'; |
|
|
|
|
import { parseScene } from './utils/util'; |
|
|
|
|
|
|
|
|
|
wx.WebIM = require("@/utils/webIM/WebIM.js").default; |
|
|
|
|
wx.WebIM = require('@/utils/webIM/WebIM.js').default; |
|
|
|
|
|
|
|
|
|
const dayjs = require("dayjs"); |
|
|
|
|
const licia = require("miniprogram-licia"); |
|
|
|
|
const dayjs = require('dayjs'); |
|
|
|
|
const licia = require('miniprogram-licia'); |
|
|
|
|
|
|
|
|
|
require("/utils/dayjs/day-zh-cn.js"); |
|
|
|
|
require('/utils/dayjs/day-zh-cn.js'); |
|
|
|
|
|
|
|
|
|
dayjs.locale("zh-cn"); // 全局使用
|
|
|
|
|
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/", |
|
|
|
|
// appid:wx2b0bb13edf717c1d
|
|
|
|
|
url: 'https://m.shizhong.hbraas.com', |
|
|
|
|
upFileUrl: 'https://m.shizhong.hbraas.com/', |
|
|
|
|
imageUrl: 'https://m.shizhong.hbraas.com/shizhong/', |
|
|
|
|
// pro
|
|
|
|
|
// appid:wx1e025040096c7e1d
|
|
|
|
|
// url: 'https://m.raredheart.hbsaas.com',
|
|
|
|
|
// upFileUrl: 'https://m.raredheart.hbsaas.com/',
|
|
|
|
|
// imageUrl: 'https://m.raredheart.hbsaas.com/wt/',
|
|
|
|
|
// url: 'https://m.shizhong.hbsaas.com',
|
|
|
|
|
// upFileUrl: 'https://m.shizhong.hbsaas.com/',
|
|
|
|
|
// imageUrl: 'https://m.shizhong.hbsaas.com/wt/',
|
|
|
|
|
|
|
|
|
|
loginState: "", |
|
|
|
|
loginState: '', |
|
|
|
|
isLogin: 0, |
|
|
|
|
doctorId: null, |
|
|
|
|
|
|
|
|
|
scene: null, |
|
|
|
|
|
|
|
|
|
needDeal: "", |
|
|
|
|
caseNav: "0", |
|
|
|
|
needDeal: '', |
|
|
|
|
caseNav: '0', |
|
|
|
|
}, |
|
|
|
|
onLaunch() { |
|
|
|
|
Page = page as WechatMiniprogram.Page.Constructor; |
|
|
|
@ -43,21 +43,20 @@ App<IAppOption>({
@@ -43,21 +43,20 @@ App<IAppOption>({
|
|
|
|
|
|
|
|
|
|
wx.ajax = licia.curry(request)({ gUrl: this.globalData.url }); |
|
|
|
|
|
|
|
|
|
// wx.login({
|
|
|
|
|
// success: (res) => {
|
|
|
|
|
// wx.ajax({
|
|
|
|
|
// method: "GET",
|
|
|
|
|
// url: "?r=takeda/user/init-login",
|
|
|
|
|
// data: {
|
|
|
|
|
// code: res.code,
|
|
|
|
|
// },
|
|
|
|
|
// }).then((res) => {
|
|
|
|
|
// this.globalData.loginState = res.loginState;
|
|
|
|
|
// this.globalData.isLogin = res.isLogin;
|
|
|
|
|
// this.globalData.doctorId = res.doctorId;
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// });
|
|
|
|
|
wx.login({ |
|
|
|
|
success: (res) => { |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'GET', |
|
|
|
|
url: '?r=shizhong/user/init-login', |
|
|
|
|
data: { |
|
|
|
|
code: res.code, |
|
|
|
|
}, |
|
|
|
|
}).then((res) => { |
|
|
|
|
this.globalData.loginState = res.loginState; |
|
|
|
|
this.globalData.isLogin = res.isLogin; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
wx.setInnerAudioOption({ |
|
|
|
|
obeyMuteSwitch: false, |
|
|
|
@ -68,7 +67,6 @@ App<IAppOption>({
@@ -68,7 +67,6 @@ App<IAppOption>({
|
|
|
|
|
if (options.query.scene) { |
|
|
|
|
this.globalData.scene = parseScene(options.query.scene); |
|
|
|
|
} |
|
|
|
|
// this.startLogin();
|
|
|
|
|
}, |
|
|
|
|
waitLogin(waitLoginState = false) { |
|
|
|
|
let time: number; |
|
|
|
@ -79,16 +77,15 @@ App<IAppOption>({
@@ -79,16 +77,15 @@ App<IAppOption>({
|
|
|
|
|
if (waitLoginState) { |
|
|
|
|
resolve(true); |
|
|
|
|
} else if (this.globalData.isLogin === 0) { |
|
|
|
|
reject(new Error("未登录")); |
|
|
|
|
wx.reLaunch({ url: "/module1/pages/login/index" }); |
|
|
|
|
wx.reLaunch({ url: '/module1/pages/login/index' }); |
|
|
|
|
} else if (this.globalData.doctorId === null) { |
|
|
|
|
this.getApplyDoctor().then((applyDoctorInfo) => { |
|
|
|
|
if (applyDoctorInfo.AuditStatus === 0) { |
|
|
|
|
wx.reLaunch({ url: "/module1/pages/setInfoResult/index" }); |
|
|
|
|
reject(new Error("还在审核中")); |
|
|
|
|
wx.reLaunch({ url: '/module1/pages/setInfoResult/index' }); |
|
|
|
|
reject(new Error('还在审核中')); |
|
|
|
|
} else { |
|
|
|
|
wx.reLaunch({ url: "/module1/pages/setInfo/index" }); |
|
|
|
|
reject(new Error("还不是医生")); |
|
|
|
|
wx.reLaunch({ url: '/module1/pages/setInfo/index' }); |
|
|
|
|
reject(new Error('还不是医生')); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
@ -100,14 +97,14 @@ App<IAppOption>({
@@ -100,14 +97,14 @@ App<IAppOption>({
|
|
|
|
|
}, |
|
|
|
|
getApplyDoctor() { |
|
|
|
|
return wx.ajax({ |
|
|
|
|
method: "GET", |
|
|
|
|
url: "?r=takeda/reg/get-apply-doctor", |
|
|
|
|
method: 'GET', |
|
|
|
|
url: '?r=takeda/reg/get-apply-doctor', |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getUserInfo(self: WechatMiniprogram.Page.Instance<any, any>, callback?: (res: any) => void) { |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: "GET", |
|
|
|
|
url: "?r=takeda/account/info", |
|
|
|
|
method: 'GET', |
|
|
|
|
url: '?r=shizhong/account/info', |
|
|
|
|
data: {}, |
|
|
|
|
}).then((res) => { |
|
|
|
|
self.setData({ |
|
|
|
|