Browse Source

1.0 接口联调

master
kola-web 1 week ago
parent
commit
09522ac3a2
  1. 10
      src/app.json
  2. 97
      src/app.ts
  3. 10
      src/components/popup/index.wxml
  4. 5
      src/doc/pages/doc1/index.json
  5. 0
      src/doc/pages/doc1/index.scss
  6. 8
      src/doc/pages/doc1/index.ts
  7. 2
      src/doc/pages/doc1/index.wxml
  8. BIN
      src/images/checkbox.png
  9. 20
      src/pages/home/index.scss
  10. 121
      src/pages/home/index.ts
  11. 63
      src/pages/home/index.wxml
  12. 10
      src/pages/information/index.scss
  13. 33
      src/pages/information/index.ts
  14. 33
      src/pages/information/index.wxml
  15. 26
      src/pages/informationDetail/index.scss
  16. 74
      src/pages/informationDetail/index.ts
  17. 27
      src/pages/informationDetail/index.wxml
  18. 3
      src/pages/login/index.json
  19. 117
      src/pages/login/index.ts
  20. 32
      src/pages/login/index.wxml
  21. 12
      src/pages/message/index.ts
  22. 2
      src/pages/message/index.wxml
  23. 4
      src/pages/my/index.json
  24. 121
      src/pages/my/index.ts
  25. 41
      src/pages/my/index.wxml
  26. 3
      src/pages/start/index.json
  27. 0
      src/pages/start/index.scss
  28. 21
      src/pages/start/index.ts
  29. 0
      src/pages/start/index.wxml
  30. 3
      src/pages/webview/index.json
  31. 0
      src/pages/webview/index.scss
  32. 14
      src/pages/webview/index.ts
  33. 1
      src/pages/webview/index.wxml
  34. 72
      src/utils/page.ts
  35. 8
      typings/index.d.ts

10
src/app.json

@ -1,12 +1,20 @@
{ {
"$schema": "https://dldir1.qq.com/WechatWebDev/editor-extension/wx-json/app.schema.json", "$schema": "https://dldir1.qq.com/WechatWebDev/editor-extension/wx-json/app.schema.json",
"pages": [ "pages": [
"pages/start/index",
"pages/home/index", "pages/home/index",
"pages/login/index", "pages/login/index",
"pages/my/index", "pages/my/index",
"pages/information/index", "pages/information/index",
"pages/informationDetail/index", "pages/informationDetail/index",
"pages/message/index" "pages/message/index",
"pages/webview/index"
],
"subPackages": [
{
"root": "doc",
"pages": ["pages/doc1/index"]
}
], ],
"preloadRule": {}, "preloadRule": {},
"window": { "window": {

97
src/app.ts

@ -22,13 +22,13 @@ App<IAppOption>({
// pro // pro
// appid:wxa4a28b299df7d921 // appid:wxa4a28b299df7d921
// url: 'https://m.shizhong.hbsaas.com', // url: 'https://m.xd.hbsaas.com',
// upFileUrl: 'https://m.shizhong.hbsaas.com/', // upFileUrl: 'https://m.xd.hbsaas.com/',
// imageUrl: 'https://m.shizhong.hbsaas.com/api/shizhong/', // imageUrl: 'https://m.xd.hbsaas.com/api/shizhong/',
loginState: '', loginState: '',
isLogin: 0, isLogin: 0,
isAnswer: '0', loginType: 0,
scene: null, scene: null,
@ -42,16 +42,17 @@ App<IAppOption>({
wx.login({ wx.login({
success: (res) => { success: (res) => {
console.log(res) console.log(res);
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=xd/user/init-login', url: '?r=xd/user/init-login',
data: { data: {
code: res.code, code: res.code,
}, },
}).then((res) => { }).then((res: any) => {
this.globalData.loginState = res.loginState; this.globalData.loginState = res.loginState;
this.globalData.isLogin = res.isLogin || 999; this.globalData.isLogin = res.isLogin;
this.globalData.loginType = res.loginType;
}); });
}, },
}); });
@ -66,40 +67,68 @@ App<IAppOption>({
this.globalData.scene = parseScene(options.query.scene); this.globalData.scene = parseScene(options.query.scene);
} }
}, },
waitLogin(waitLoginState = false, requireLogin = false, bakcPath = '') { waitLogin({ type = 0 } = { type: 'any' }) {
let time: number;
return new Promise((resolve) => { return new Promise((resolve) => {
time = setInterval(() => { const checkLogin = () => {
const { isLogin, loginState } = this.globalData; if (this.globalData.loginState) {
if (loginState) { if (this.checkLoginType(type)) {
clearInterval(time); resolve();
if (waitLoginState) {
resolve(true);
} else if (isLogin === 0 || !isLogin) {
this.globalData.backPath = bakcPath;
wx.reLaunch({ url: '/pages/login/index' });
} else if (requireLogin && isLogin === 999) {
this.globalData.backPath = bakcPath;
wx.reLaunch({ url: '/pages/login/index' });
} else {
resolve(true);
} }
return;
} }
}, 500); setTimeout(() => {
checkLogin();
}, 500);
};
checkLogin();
}); });
}, },
getUserInfo(self: WechatMiniprogram.Page.Instance<any, any>, callback?: (res: any) => void) { checkLoginType(type: 0 | 1 | 2 | 'any') {
wx.ajax({ const { loginType, isLogin } = this.globalData;
if (type === 'any') {
return true;
}
if (isLogin !== 1) {
if (type === 0) {
return true;
}
wx.reLaunch({
url: '/pages/login/index',
});
return false;
}
if (loginType !== type) {
const typePageUrl = {
2: '/pages/index/index',
}[type as 2];
wx.reLaunch({
url: typePageUrl,
});
return false;
}
return true;
},
getUserInfo(type: 0 | 1 | 2): Promise<never> {
const url = {
2: '?r=xd/doctor/index/get-doctor',
}[type];
return wx.ajax({
method: 'GET', method: 'GET',
url: '?r=shizhong/account/get-info', url,
data: {}, data: {},
}).then((res) => { }) as Promise<never>;
if (self) { },
self.setData({ mpBehavior(data) {
userInfo: res, wx.ajax({
}); method: 'POST',
} url: '?r=xd/doctor/index/operate-action-submit',
callback?.(res); data: data,
loading: false,
showMsg: false,
}); });
}, },
getMenuInfo(self) { getMenuInfo(self) {

10
src/components/popup/index.wxml

@ -11,7 +11,7 @@
> >
<view <view
class="popup1" class="popup1"
style="background: url('/images/bg4.png') no-repeat top center/100% 304rpx" style="background: url('{{imageUrl}}bg4.png?t={{Timestamp}}') no-repeat top center/100% 304rpx"
wx:if="{{type==='popup1'}}" wx:if="{{type==='popup1'}}"
> >
<view class="container"> <view class="container">
@ -33,14 +33,14 @@
</view> </view>
</view> </view>
<view class="popup2" wx:if="{{type==='popup2'}}"> <view class="popup2" wx:if="{{type==='popup2'}}">
<image class="p-img" src="/images/bg5.png" show-menu-by-longpress></image> <image class="p-img" src="{{imageUrl}}bg5.png?t={{Timestamp}}" show-menu-by-longpress></image>
</view> </view>
<view class="popup3" wx:if="{{type==='popup3'}}"> <view class="popup3" wx:if="{{type==='popup3'}}">
<image class="p-img" src="/images/bg6.png" show-menu-by-longpress></image> <image class="p-img" src="{{imageUrl}}bg6.png?t={{Timestamp}}" show-menu-by-longpress></image>
</view> </view>
<view class="popup4" wx:if="{{type==='popup4'}}"> <view class="popup4" wx:if="{{type==='popup4'}}">
<image class="p-img" src="/images/bg7.png" show-menu-by-longpress></image> <image class="p-img" src="{{imageUrl}}bg7.png?t={{Timestamp}}" show-menu-by-longpress></image>
</view> </view>
<image wx:if="{{params.close}}" class="close" src="/images/icon11.png" bind:tap="handleCancel"></image> <image wx:if="{{params.close}}" class="close" src="{{imageUrl}}icon11.png?t={{Timestamp}}" bind:tap="handleCancel"></image>
</van-popup> </van-popup>

5
src/doc/pages/doc1/index.json

@ -0,0 +1,5 @@
{
"navigationStyle": "default",
"navigationBarTitleText": "隐私协议保护政策",
"usingComponents": {}
}

0
src/doc/pages/doc1/index.scss

8
src/doc/pages/doc1/index.ts

@ -0,0 +1,8 @@
const _app = getApp<IAppOption>();
Page({
data: {},
onLoad() {},
});
export {}

2
src/doc/pages/doc1/index.wxml

@ -0,0 +1,2 @@
<!--pages/story/index.wxml-->
<text>pages/story/index.wxml</text>

BIN
src/images/checkbox.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

20
src/pages/home/index.scss

@ -43,6 +43,7 @@ page {
font-size: 28rpx; font-size: 28rpx;
color: rgba(173, 172, 178, 1); color: rgba(173, 172, 178, 1);
.tag { .tag {
margin-left: 10rpx;
display: inline-block; display: inline-block;
font-size: 24rpx; font-size: 24rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
@ -108,11 +109,15 @@ page {
} }
.ad { .ad {
margin-top: 32rpx; margin-top: 32rpx;
.ad-img { .swiper {
display: block;
width: 100%;
height: 224rpx; height: 224rpx;
box-shadow: 0 4rpx 22rpx 0 rgba(0, 0, 0, 0.03); .ad-img {
display: block;
width: 100%;
height: 224rpx;
border-radius: 24rpx;
box-shadow: 0 4rpx 22rpx 0 rgba(0, 0, 0, 0.03);
}
} }
} }
.list { .list {
@ -145,7 +150,7 @@ page {
border-radius: 12rpx; border-radius: 12rpx;
} }
.wrap { .wrap {
padding: 12rpx 0 0 24rpx; padding: 12rpx 24rpx 0 24rpx;
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -179,6 +184,11 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12rpx; gap: 12rpx;
background-color: transparent;
padding: 0;
&::after {
border: none;
}
.icon { .icon {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;

121
src/pages/home/index.ts

@ -1,3 +1,5 @@
import dayjs from 'dayjs';
const app = getApp<IAppOption>(); const app = getApp<IAppOption>();
Page({ Page({
@ -10,9 +12,112 @@ Page({
popupParams: { popupParams: {
close: true, close: true,
} as any, } as any,
userInfo: {},
unReadMsgCount: 0,
bannerList: [],
list: [] as any[],
total: 0,
pagination: {
page: 1,
pages: 1,
count: 1,
},
},
onShow() {
app.waitLogin({ type: 2 }).then(() => {
// this.getNotice();
this.getBanner();
this.getList();
app.getUserInfo(2).then((userInfo) => {
this.setData({
userInfo,
});
});
});
},
handleWebview() {
const encodeUrl = encodeURIComponent('https://dct.meddb.cn');
wx.navigateTo({
url: `/pages/webview/index?url=${encodeUrl}`,
});
},
getNotice() {
wx.ajax({
method: 'GET',
url: '?r=xd/doctor/index/get-unread-msg-count',
data: {},
}).then((res) => {
this.setData({
unReadMsgCount: res.unReadMsgCount,
});
});
},
handleNotice() {
wx.navigateTo({
url: '/pages/message/index',
});
},
getBanner() {
wx.ajax({
method: 'GET',
url: '?r=xd/doctor/index/get-banner',
data: {
count: 0,
},
}).then((res) => {
this.setData({
bannerList: res.list,
});
});
},
handleBanner(e) {
const { index } = e.currentTarget.dataset;
const { LinkUrl } = this.data.bannerList[index];
wx.navigateTo({
url: LinkUrl,
fail() {
wx.switchTab({
url: LinkUrl,
});
},
});
}, },
onLoad() { getList(newPage = 1) {
// app.waitLogin().then(() => {}); wx.ajax({
method: 'GET',
url: '?r=xd/doctor/index/get-latest-material',
data: {
page: newPage,
},
}).then((res) => {
res.list.forEach((item) => {
item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD');
});
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list];
this.setData({
total: res.count,
list,
pagination: {
page: res.page,
pages: res.pages,
count: res.count,
},
});
});
},
onReachBottom() {
const { page, pages } = this.data.pagination;
if (pages > page) {
this.getList(page + 1);
}
},
handleDetail(e: any) {
const { id } = e.currentTarget.dataset;
wx.navigateTo({
url: `/pages/informationDetail/index?id=${id}`,
});
}, },
handlePopupOk() { handlePopupOk() {
const { popupType } = this.data; const { popupType } = this.data;
@ -23,6 +128,18 @@ Page({
popupShow: false, popupShow: false,
}); });
}, },
onShareAppMessage(e) {
if (e.from === 'button') {
const { Title, CoverImgUrl, Id } = e.target.dataset.params;
app.mpBehavior({ PositionId: '1', OperateType: '3', OperateId: Id });
return {
title: Title,
path: `/pages/informationDetail/index?id=${Id}`,
imageUrl: CoverImgUrl,
};
}
return {};
},
}); });
export {}; export {};

63
src/pages/home/index.wxml

@ -1,65 +1,74 @@
<navbar fixed custom-style="background:{{background}}" back> <navbar fixed custom-style="background:{{background}}" back>
<image class="page-title" slot="left" src="/images/title2.png"></image> <image class="page-title" slot="left" src="{{imageUrl}}title2.png?t={{Timestamp}}"></image>
</navbar> </navbar>
<view <view
class="page" class="page"
style="background: url('/images/bg2.png') no-repeat top center/100% 616rpx;padding-top: {{pageTop + 20}}px;" style="background: url('{{imageUrl}}bg2.png?t={{Timestamp}}') no-repeat top center/100% 616rpx;padding-top: {{pageTop + 20}}px;"
> >
<view class="user"> <view class="user">
<button class="avatar-wrapper"> <button class="avatar-wrapper">
<image <image class="avatar" src="{{userInfo.Img}}"></image>
class="avatar"
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
></image>
</button> </button>
<view class="wrap"> <view class="wrap">
<view class="nickname">XX医生</view> <view class="nickname">{{userInfo.welcome}},{{userInfo.Name}}</view>
<view class="hostipal"> <view class="hostipal">
北京天坛医院 {{userInfo.HospitalName}}
<view class="tag">三甲</view> <view class="tag">{{userInfo.HospitalClassificationName}}{{userInfo.HospitalLevel}}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="banner"> <view class="banner" bind:tap="handleWebview">
<view class="title">甲状腺眼突登记研究项目</view> <view class="title">甲状腺眼突登记研究项目</view>
<view class="btn">点此进入EDC系统</view> <view class="btn">点此进入EDC系统</view>
</view> </view>
<view class="message" style="background: url('/images/bg3.png') no-repeat top center/100% 150rpx"> <view
<view class="content dot"> class="message"
wx:if="{{unReadMsgCount > 0}}"
style="background: url('{{imageUrl}}bg3.png?t={{Timestamp}}') no-repeat top center/100% 150rpx"
bind:tap="handleNotice"
>
<view class="content {{unReadMsgCount > 0 && 'dot'}}">
您有 您有
<text class="num">5</text> <text class="num">{{unReadMsgCount}}</text>
条新消息待查看 条新消息待查看
</view> </view>
</view> </view>
<view class="ad"> <view class="ad">
<image class="ad-img" src="/images/banner1.png"></image> <swiper class="swiper">
<swiper-item
class="swiper-item"
wx:for="{{bannerList}}"
wx:key="Id"
bind:tap="handleBanner"
data-index="{{index}}"
>
<image class="ad-img" src="{{item.ImgUrl}}"></image>
</swiper-item>
</swiper>
</view> </view>
<view class="list"> <view class="list">
<view class="list-header"> <view class="list-header">
<image class="title" src="/images/title3.png"></image> <image class="title" src="{{imageUrl}}title3.png?t={{Timestamp}}"></image>
<view class="more"> <view class="more">
查看全部 查看全部
<van-icon name="arrow" /> <van-icon name="arrow" />
</view> </view>
</view> </view>
<view class="card" bind:tap="handleDetail"> <view class="card" bind:tap="handleDetail" wx:for="{{list}}" wx:key="Id" data-id="{{item.Id}}">
<image <image class="photo" src="{{item.CoverImgUrl}}"></image>
class="photo"
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
></image>
<view class="wrap"> <view class="wrap">
<view class="title">替妥尤单抗的作用机制、适用场景、使用方式</view> <view class="title">{{item.Title}}</view>
<view class="w-footer"> <view class="w-footer">
<view class="date">2025-06-17</view> <view class="date">{{item.PublishTime}}</view>
<view class="options"> <view class="options">
<view class="o-item"> <view class="o-item">
<image class="icon" src="/images/icon7.png"></image> <image class="icon" src="{{imageUrl}}icon7.png?t={{Timestamp}}"></image>
24 {{item.ReadCount}}
</view>
<view class="o-item">
<image class="icon" src="/images/icon8.png"></image>
</view> </view>
<button open-type="share" class="o-item" data-params="{{item}}" catch:tap="handleShare">
<image class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
</button>
</view> </view>
</view> </view>
</view> </view>

10
src/pages/information/index.scss

@ -27,7 +27,7 @@ page {
} }
} }
.card { .card {
margin: 24rpx 40rpx 0; margin: 0 40rpx 24rpx;
padding: 12rpx; padding: 12rpx;
background-color: #fff; background-color: #fff;
border-radius: 24rpx; border-radius: 24rpx;
@ -39,7 +39,8 @@ page {
border-radius: 12rpx; border-radius: 12rpx;
} }
.wrap { .wrap {
padding: 12rpx 0 0 24rpx; padding: 12rpx 24rpx 0 24rpx;
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
@ -72,6 +73,11 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12rpx; gap: 12rpx;
background-color: transparent;
padding: 0;
&::after {
border: none;
}
.icon { .icon {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;

33
src/pages/information/index.ts

@ -1,4 +1,6 @@
const _app = getApp<IAppOption>(); import dayjs from 'dayjs';
const app = getApp<IAppOption>();
Page({ Page({
data: { data: {
@ -9,15 +11,22 @@ Page({
count: 1, count: 1,
}, },
}, },
onLoad() {}, onLoad() {
app.waitLogin({ type: 2 }).then(() => {
this.getList();
});
},
getList(newPage = 1) { getList(newPage = 1) {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=wtx/knowledge/list', url: '?r=xd/doctor/index/get-material-list',
data: { data: {
page: newPage, page: newPage,
}, },
}).then((res) => { }).then((res) => {
res.list.forEach((item) => {
item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD');
});
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list]; const list = res.page === 1 ? res.list : [...this.data.list, ...res.list];
this.setData({ this.setData({
total: res.count, total: res.count,
@ -36,11 +45,25 @@ Page({
this.getList(page + 1); this.getList(page + 1);
} }
}, },
handleDetail() { handleDetail(e) {
const { id } = e.currentTarget.dataset;
wx.navigateTo({ wx.navigateTo({
url: '/pages/informationDetail/index', url: `/pages/informationDetail/index?id=${id}`,
}); });
}, },
onShareAppMessage(e) {
if (e.from === 'button') {
const { Title, CoverImgUrl, Id } = e.target.dataset.params;
app.mpBehavior({ PositionId: '2', OperateType: '3', OperateId: Id });
return {
title: Title,
path: `/pages/informationDetail/index?id=${Id}`,
imageUrl: CoverImgUrl,
};
}
return {};
},
}); });
export {}; export {};

33
src/pages/information/index.wxml

@ -2,30 +2,27 @@
<view <view
class="page" class="page"
style="background: url('/images/bg2.png') no-repeat top center/100% 616rpx;padding-top: {{pageTop + 20}}px;" style="background: url('{{imageUrl}}bg2.png?t={{Timestamp}}') no-repeat top center/100% 616rpx;padding-top: {{pageTop + 20}}px;"
> >
<view class="page-tags" style="background:{{background}};top:{{pageTop}}px;"> <!-- <view class="page-tags" style="background:{{background}};top:{{pageTop}}px;"> -->
<view class="tag active">全部</view> <!-- <view class="tag active">全部</view> -->
<view class="tag">安全性</view> <!-- <view class="tag">安全性</view> -->
<view class="tag">有效性</view> <!-- <view class="tag">有效性</view> -->
</view> <!-- </view> -->
<view class="card" bind:tap="handleDetail"> <view class="card" bind:tap="handleDetail" wx:for="{{list}}" wx:key="Id" data-id="{{item.Id}}">
<image <image class="photo" src="{{item.CoverImgUrl}}"></image>
class="photo"
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
></image>
<view class="wrap"> <view class="wrap">
<view class="title">替妥尤单抗的作用机制、适用场景、使用方式</view> <view class="title">{{item.Title}}</view>
<view class="w-footer"> <view class="w-footer">
<view class="date">2025-06-17</view> <view class="date">{{item.PublishTime}}</view>
<view class="options"> <view class="options">
<view class="o-item"> <view class="o-item">
<image class="icon" src="/images/icon7.png"></image> <image class="icon" src="{{imageUrl}}icon7.png?t={{Timestamp}}"></image>
24 {{item.ReadCount}}
</view>
<view class="o-item">
<image class="icon" src="/images/icon8.png"></image>
</view> </view>
<button open-type="share" class="o-item" data-params="{{item}}" catch:tap="handleShare">
<image class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
</button>
</view> </view>
</view> </view>
</view> </view>

26
src/pages/informationDetail/index.scss

@ -41,10 +41,18 @@
width: 84rpx; width: 84rpx;
height: 84rpx; height: 84rpx;
} }
.content { .wrap {
font-size: 32rpx; flex: 1;
color: rgba(33, 29, 46, 1); .content {
line-height: 48rpx; font-size: 32rpx;
color: rgba(33, 29, 46, 1);
line-height: 40rpx;
}
.size {
margin-top: 8rpx;
font-size: 28rpx;
color: rgba(173, 172, 178, 1);
}
} }
.btn { .btn {
flex-shrink: 0; flex-shrink: 0;
@ -83,6 +91,16 @@
color: rgba(140, 117, 208, 1); color: rgba(140, 117, 208, 1);
line-height: 36rpx; line-height: 36rpx;
} }
.share {
flex-shrink: 0;
margin: 0;
padding: 0;
background-color: transparent;
line-height: 1;
&::after {
border: none;
}
}
.icon { .icon {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;

74
src/pages/informationDetail/index.ts

@ -1,9 +1,14 @@
const _app = getApp<IAppOption>(); import dayjs from 'dayjs';
const app = getApp<IAppOption>();
Page({ Page({
data: { data: {
doc: '1', doc: '1',
id: '',
detail: {} as any,
fileIcon: { fileIcon: {
pdf: 'file-icon1', pdf: 'file-icon1',
doc: 'file-icon2', doc: 'file-icon2',
@ -15,28 +20,85 @@ Page({
none: 'file-icon8', none: 'file-icon8',
}, },
}, },
onLoad() {}, onLoad(options) {
this.setData({
id: options.id,
});
app.waitLogin({ type: 2 }).then(() => {
app.mpBehavior({ PositionId: '1', OperateType: '1', OperateId: options.id as string });
this.getDetail();
});
},
getDetail() {
wx.ajax({
method: 'GET',
url: '?r=xd/doctor/index/get-material-detail',
data: {
Id: this.data.id,
},
}).then((res) => {
this.setData({
detail: {
...res,
PublishTime: dayjs(res.PublishTime).format('YYYY-MM-DD'),
},
});
});
},
handleDownload() { handleDownload() {
const { detail } = this.data;
wx.showLoading({
title: '加载中',
mask: true,
});
app.mpBehavior({ PositionId: '1', OperateType: '1', OperateId: detail.Id as string });
wx.downloadFile({ wx.downloadFile({
url: '', url: detail.FileUrl,
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
wx.openDocument({ wx.openDocument({
filePath: res.tempFilePath, filePath: res.tempFilePath,
success: () => { success: () => {
console.log('打开文档成功'); wx.hideLoading();
}, },
fail: (err) => { fail: (err) => {
console.error('打开文档失败', err); wx.showToast({
title: '下载文件失败',
icon: 'none',
});
wx.hideLoading();
}, },
}); });
} else { } else {
console.error('下载文件失败', res); wx.hideLoading();
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
} }
}, },
fail() {
wx.hideLoading();
wx.showToast({
title: '下载文件失败',
icon: 'none',
});
},
}); });
}, },
onShareAppMessage(e) {
if (e.from === 'button') {
const { Title, CoverImgUrl, Id } = this.data.detail;
app.mpBehavior({ PositionId: '3', OperateType: '3', OperateId: Id });
return {
title: Title,
path: `/pages/informationDetail/index?id=${Id}`,
imageUrl: CoverImgUrl,
};
}
return {};
},
}); });
export {}; export {};

27
src/pages/informationDetail/index.wxml

@ -1,25 +1,30 @@
<view class="page"> <view class="page">
<view class="title">70年来首款新药! 信达生物替妥尤单抗国内获批上市</view> <view class="title">{{detail.Title}}</view>
<view class="info"> <view class="info">
<view class="date">2025-06-17</view> <view class="date">{{detail.PublishTime}}</view>
<view class="eye"> <view class="eye">
<image class="icon" src="/images/icon9.png"></image> <image class="icon" src="{{imageUrl}}icon9.png?t={{Timestamp}}"></image>
24 {{detail.ReadCount}}
</view> </view>
</view> </view>
<view class="file-card"> <view class="file-card" wx:if="{{detail.FileUrl}}" bind:tap="handleDownload">
<image class="icon" src="/images/file-icon1.png"></image> <image class="icon" src="/images/{{fileIcon[detail.FileType] || 'none'}}.png"></image>
<view class="content">关于甲状腺眼病及其疗法</view> <view class="wrap">
<view class="content">{{detail.FileName}}</view>
<view class="size">{{detail.FileSizeName}}</view>
</view>
<view class="btn">下载</view> <view class="btn">下载</view>
</view> </view>
<view class="mp-html"> <view class="mp-html">
<mp-html content="{{doc}}"></mp-html> <mp-html content="{{detail.Content}}"></mp-html>
</view> </view>
<view class="page-footer"> <view class="page-footer">
<image class="avatar" src="/images/icon10.png"></image> <image class="avatar" src="{{imageUrl}}icon10.png?t={{Timestamp}}"></image>
<view class="title">TED规范化诊治中心</view> <view class="title">{{detail.CreateWorkerName}}</view>
<view class="icon" src="/images/icon8.png"></view> <button class="share" open-type="share">
<image class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
</button>
</view> </view>
</view> </view>

3
src/pages/login/index.json

@ -1,6 +1,7 @@
{ {
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"van-divider": "@vant/weapp/divider/index" "van-divider": "@vant/weapp/divider/index",
"popup": "/components/popup/index"
} }
} }

117
src/pages/login/index.ts

@ -1,36 +1,40 @@
const app = getApp<IAppOption>() const app = getApp<IAppOption>();
let timer = null as null | number let timer = null as null | number;
Page({ Page({
data: { data: {
popupShow: false,
popupType: 'popup4', // 登录失败弹窗
popupParams: {
close: true,
} as any,
showTel: false, showTel: false,
mobile: '', mobile: '',
code: '', code: '',
codeText: '发送验证码', codeText: '发送验证码',
check1: true, check1: false,
check2: true,
check3: true,
}, },
onLoad() {}, onLoad() {},
getCode() { getCode() {
if (timer) return if (timer) return;
const mobile = this.data.mobile const mobile = this.data.mobile;
if (!mobile) { if (!mobile) {
wx.showToast({ wx.showToast({
title: '手机号不能为空', title: '手机号不能为空',
icon: 'none', icon: 'none',
}) });
return return;
} }
// 验证手机号 // 验证手机号
if (!/^1[3-9,]\d{9}$/.test(mobile)) { if (!/^1[3-9,]\d{9}$/.test(mobile)) {
wx.showToast({ wx.showToast({
title: '手机号格式不正确', title: '手机号格式不正确',
icon: 'none', icon: 'none',
}) });
return return;
} }
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
@ -42,38 +46,43 @@ Page({
wx.showToast({ wx.showToast({
icon: 'none', icon: 'none',
title: '验证码已发送~', title: '验证码已发送~',
}) });
let time = 60 let time = 60;
timer = setInterval(() => { timer = setInterval(() => {
time-- time--;
this.setData({ this.setData({
codeText: `${time}s后重新发送`, codeText: `${time}s后重新发送`,
}) });
if (time <= 0) { if (time <= 0) {
clearInterval(timer as number) clearInterval(timer as number);
timer = null timer = null;
this.setData({ this.setData({
codeText: '发送验证码', codeText: '发送验证码',
}) });
} }
}, 1000) }, 1000);
}) });
},
handleCheck() {
this.setData({
check1: !this.data.check1,
});
}, },
handleDocRule() { handleDocRule() {
const { check1, check2, check3 } = this.data const { check1 } = this.data;
return new Promise((resolve) => { return new Promise((resolve) => {
if (check1 && check2 && check3) { if (check1) {
return resolve(true) return resolve(true);
} }
wx.showToast({ wx.showToast({
title: '请同意相关协议', title: '请同意相关协议',
icon: 'none', icon: 'none',
}) });
}) });
}, },
async handleSubmit() { async handleSubmit() {
await this.handleDocRule() await this.handleDocRule();
const { mobile, code } = this.data const { mobile, code } = this.data;
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
url: '?r=xd/login/reg-login', url: '?r=xd/login/reg-login',
@ -81,12 +90,12 @@ Page({
mobile, mobile,
code, code,
}, },
}).then((_res) => { }).then((res) => {
this.submitCallback() this.submitCallback(res);
}) });
}, },
handleWxSubmit(e: WechatMiniprogram.CustomEvent) { handleWxSubmit(e: WechatMiniprogram.CustomEvent) {
const { iv, encryptedData } = e.detail const { iv, encryptedData } = e.detail;
if (iv && encryptedData) { if (iv && encryptedData) {
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
@ -95,29 +104,39 @@ Page({
iv: encodeURIComponent(iv), iv: encodeURIComponent(iv),
encryptedData: encodeURIComponent(encryptedData), encryptedData: encodeURIComponent(encryptedData),
}, },
}).then((_res) => { }).then((res) => {
this.submitCallback() this.submitCallback(res);
}) });
} }
}, },
submitCallback() { submitCallback(res) {
app.getUserInfo(2).then((res) => { console.log('DEBUGPRINT[79]: index.ts:112: res=', res);
if (res.PatientId) { app.globalData.loginType = res.loginType;
wx.reLaunch({ app.globalData.isLogin = res.isLogin;
url: `/patient/pages/index/index`, if (res.isLogin == 1 && res.loginType == 2) {
}) wx.reLaunch({
} else { url: '/pages/home/index',
wx.navigateTo({ });
url: `/patient/pages/entryInfo/index?aid=${res.applyIntentionId}`, } else {
}) this.setData({
} popupShow: true,
}) popupType: 'popup4',
popupParams: {
close: true,
},
});
}
}, },
handleShowTel() { handleShowTel() {
this.setData({ this.setData({
showTel: !this.data.showTel, showTel: !this.data.showTel,
}) });
},
handleLink() {
wx.navigateTo({
url: '/doc/pages/doc1/index',
});
}, },
}) });
export {} export {};

32
src/pages/login/index.wxml

@ -1,25 +1,20 @@
<view <view
class="page" class="page"
style="padding-top: {{pageTop + 60}}px;background:url('/images/bg1.png') no-repeat top center/100% 484rpx;" style="padding-top: {{pageTop + 60}}px;background:url('{{imageUrl}}bg1.png?t={{Timestamp}}') no-repeat top center/100% 484rpx;"
> >
<image class="logo" src="/images/logo1.png"></image> <image class="logo" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image>
<image class="page-title" src="/images/title1.png"></image> <image class="page-title" src="{{imageUrl}}title1.png?t={{Timestamp}}"></image>
<view class="protocol"> <view class="protocol">
<view class="p-title">尊敬的医生您好</view> <view class="p-title">尊敬的医生您好</view>
<view class="p-content"> <view class="p-content">
在您加入TED规范化诊治中心之前,请您阅读并充分理解 在您加入TED规范化诊治中心之前,请您阅读并充分理解
<text class="link">《隐私协议保护政策》</text> <text class="link" bind:tap="handleLink">《隐私协议保护政策》</text>
,了解您的权益及相关数据处理方法,我们将严格按照法律法规及 ,了解您的权益及相关数据处理方法,我们将严格按照法律法规及
<text class="link">《隐私协议保护政策》</text> <text class="link" bind:tap="handleLink">《隐私协议保护政策》</text>
的相关规定,保证您的个人信息不受侵犯。 的相关规定,保证您的个人信息不受侵犯。
</view> </view>
</view> </view>
<button <button wx:if="{{check1 }}" class="phone" open-type="getPhoneNumber" bindgetphonenumber="handleWxSubmit">
wx:if="{{check1 && check2 && check3}}"
class="phone"
open-type="getPhoneNumber"
bindgetphonenumber="handleWxSubmit"
>
手机号一键登录 手机号一键登录
</button> </button>
<button wx:else class="phone" bind:tap="handleDocRule">手机号一键登录</button> <button wx:else class="phone" bind:tap="handleDocRule">手机号一键登录</button>
@ -27,7 +22,7 @@
<van-divider class="van-divider" contentPosition="center">或者</van-divider> <van-divider class="van-divider" contentPosition="center">或者</van-divider>
</view> </view>
<view class="tel-btn" bind:tap="handleShowTel"> <view class="tel-btn" bind:tap="handleShowTel">
<image class="icon" src="/images/icon1.png"></image> <image class="icon" src="{{imageUrl}}icon1.png?t={{Timestamp}}"></image>
手机号验证码 手机号验证码
</view> </view>
<view class="form" wx:if="{{showTel}}"> <view class="form" wx:if="{{showTel}}">
@ -56,12 +51,21 @@
</view> </view>
<view class="signature"> <view class="signature">
<view class="row"> <view class="row">
<image class="check" src="/images/checkbox-active.png"></image> <image wx:if="{{check1}}" bind:tap="handleCheck" class="check" src="{{imageUrl}}checkbox-active.png?t={{Timestamp}}"></image>
<image wx:else class="check" bind:tap="handleCheck" src="{{imageUrl}}checkbox.png?t={{Timestamp}}"></image>
<view class="r-content"> <view class="r-content">
我特此同意依照此 我特此同意依照此
<text class="link">《隐私协议保护政策》</text> <text class="link" bind:tap="handleLink">《隐私协议保护政策》</text>
规定收集我的个人敏感信息 规定收集我的个人敏感信息
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<popup
show="{{popupShow}}"
type="{{popupType}}"
params="{{popupParams}}"
bind:ok="handlePopupOk"
bind:cancel="handlePopupCancel"
></popup>

12
src/pages/message/index.ts

@ -1,4 +1,4 @@
const _app = getApp<IAppOption>(); const app = getApp<IAppOption>();
Page({ Page({
data: { data: {
@ -9,11 +9,15 @@ Page({
count: 1, count: 1,
}, },
}, },
onLoad() {}, onLoad() {
app.waitLogin().then(() => {
this.getList();
});
},
getList(newPage = 1) { getList(newPage = 1) {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=wtx/knowledge/list', url: '?r=xd/doctor/index/get-msg-list',
data: { data: {
page: newPage, page: newPage,
}, },
@ -38,4 +42,4 @@ Page({
}, },
}); });
export {} export {};

2
src/pages/message/index.wxml

@ -6,7 +6,7 @@
</view> </view>
<view class="c-footer"> <view class="c-footer">
<view class="btn">去查看</view> <view class="btn">去查看</view>
<image class="more" src="/images/icon3.png"></image> <image class="more" src="{{imageUrl}}icon3.png?t={{Timestamp}}"></image>
</view> </view>
</view> </view>
<view class="card2"> <view class="card2">

4
src/pages/my/index.json

@ -1,4 +1,6 @@
{ {
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": {} "usingComponents": {
"popup": "/components/popup/index"
}
} }

121
src/pages/my/index.ts

@ -2,19 +2,27 @@ const app = getApp<IAppOption>();
Page({ Page({
data: { data: {
toastShow: false, popupShow: false,
toastType: 1, // popupType: 'popup1', // 绑定医生弹窗
// popupType: 'popup2', // 去关注弹窗
// popupType: 'popup3', // 问题反馈弹窗
popupType: 'popup4', // 登录失败弹窗
popupParams: {
close: true,
} as any,
userInfo: {} as any, userInfo: {} as any,
}, },
onShow() { onShow() {
// app.waitLogin().then(() => { app.waitLogin().then(() => {
// app.getUserInfo(this); this.getUserInfo();
// }); });
}, },
handleCollection() { getUserInfo() {
wx.navigateTo({ app.getUserInfo(2).then((userInfo) => {
url: '/pages/collection/index', this.setData({
userInfo,
});
}); });
}, },
handleLogin() { handleLogin() {
@ -29,12 +37,14 @@ Page({
if (res.confirm) { if (res.confirm) {
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
url: '?r=shizhong/account/logout', url: '?r=xd/user/reg-logout',
data: {}, data: {},
}).then(() => { }).then((res) => {
app.globalData.isLogin = 0; app.globalData.isLogin = res.isLogin;
app.globalData.isAnswer = '0'; app.globalData.loginType = res.loginType;
app.waitLogin(); wx.reLaunch({
url: '/pages/start/index',
});
}); });
} }
}, },
@ -45,48 +55,71 @@ Page({
url: '/pages/userInfo/index', url: '/pages/userInfo/index',
}); });
}, },
handleAvatar(e) { onChooseAvatar(e) {
const avatar = e.detail.fileUrl; const { avatarUrl } = e.detail;
wx.ajax({ const url = `${app.globalData.upFileUrl}?r=file-service/upload-img`;
method: 'POST', wx.showLoading({
url: '?r=shizhong/account/update-info', title: '上传中',
data: { });
userName: this.data.userInfo.username, wx.uploadFile({
avatar, url,
filePath: avatarUrl,
name: 'file',
success: (res) => {
const data = JSON.parse(res.data);
const avatarUrl = data.data.Url;
wx.ajax({
method: 'POST',
url: '?r=xd/doctor/index/update-doctor-img',
data: {
UserImg: avatarUrl,
},
})
.then(() => {
wx.hideLoading();
wx.showToast({
title: '头像更新成功!',
icon: 'none',
});
this.setData({
'userInfo.Img': avatarUrl,
});
})
.catch(() => {
wx.hideLoading();
});
},
fail() {
wx.hideLoading();
}, },
}).then(() => {
app.getUserInfo(this);
}); });
}, },
handleOffice() { handleDoc() {
wx.hideTabBar({ wx.navigateTo({
success: () => { url: '/doc/pages/doc1/index',
this.setData({
toastShow: true,
toastType: 1,
});
},
}); });
}, },
handleCompanyOffice() { handlePublic() {
wx.hideTabBar({ this.setData({
success: () => { popupShow: true,
this.setData({ popupType: 'popup2',
toastShow: true, popupParams: {
toastType: 2, close: true,
});
}, },
}); });
}, },
handleToastClose() { handleQuestion() {
this.setData({ this.setData({
toastShow: false, popupShow: true,
popupType: 'popup3',
popupParams: {
close: true,
},
}); });
wx.showTabBar({});
}, },
handleTopic() { handlePopupCancel() {
wx.navigateTo({ this.setData({
url: '/pages/topic/index?back=1', popupShow: false,
}); });
}, },
}); });

41
src/pages/my/index.wxml

@ -4,36 +4,41 @@
> >
<view class="user"> <view class="user">
<button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar"> <button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
<image <image class="avatar" src="{{userInfo.Img}}"></image>
class="avatar"
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
></image>
</button> </button>
<view class="wrap"> <view class="wrap">
<view class="nickname">XX医生</view> <view class="nickname">{{userInfo.Name}}</view>
<view class="hostipal"> <view class="hostipal">
北京天坛医院 {{userInfo.HospitalName}}
<view class="tag">三甲</view> <view class="tag">{{userInfo.HospitalClassificationName}}{{userInfo.HospitalLevel}}</view>
</view> </view>
</view> </view>
<image class="edit" src="/images/icon2.png"></image> <!-- <image class="edit" src="{{imageUrl}}icon2.png?t={{Timestamp}}"></image> -->
</view> </view>
<view class="list"> <view class="list">
<view class="list-item"> <view class="list-item" bind:tap="handleDoc">
<image class="icon" src="/images/icon4.png"></image> <image class="icon" src="{{imageUrl}}icon4.png?t={{Timestamp}}"></image>
<view class="content">隐私协议</view> <view class="content">隐私协议</view>
<image class="more" src="/images/icon3"></image> <image class="more" src="{{imageUrl}}icon3?t={{Timestamp}}"></image>
</view> </view>
<view class="list-item"> <view class="list-item" bind:tap="handlePublic">
<image class="icon" src="/images/icon5.png"></image> <image class="icon" src="{{imageUrl}}icon5.png?t={{Timestamp}}"></image>
<view class="content">关注公众号</view> <view class="content">关注公众号</view>
<image class="more" src="/images/icon3"></image> <image class="more" src="{{imageUrl}}icon3?t={{Timestamp}}"></image>
</view> </view>
<view class="list-item"> <view class="list-item" bind:tap="handleQuestion">
<image class="icon" src="/images/icon6.png"></image> <image class="icon" src="{{imageUrl}}icon6.png?t={{Timestamp}}"></image>
<view class="content">问题反馈</view> <view class="content">问题反馈</view>
<image class="more" src="/images/icon3"></image> <image class="more" src="{{imageUrl}}icon3?t={{Timestamp}}"></image>
</view> </view>
</view> </view>
<view class="login-out">退出登录</view> <view class="login-out" bind:tap="handleLoginOut">退出登录</view>
</view> </view>
<popup
show="{{popupShow}}"
type="{{popupType}}"
params="{{popupParams}}"
bind:ok="handlePopupOk"
bind:cancel="handlePopupCancel"
></popup>

3
src/pages/start/index.json

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

0
src/pages/start/index.scss

21
src/pages/start/index.ts

@ -0,0 +1,21 @@
const app = getApp<IAppOption>();
Page({
data: {},
onLoad() {
app.waitLogin().then(() => {
const { isLogin, loginType } = app.globalData;
if (isLogin && loginType == 2) {
wx.reLaunch({
url: '/pages/home/index',
});
return;
}
wx.reLaunch({
url: '/pages/login/index',
});
});
},
});
export {};

0
src/pages/start/index.wxml

3
src/pages/webview/index.json

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

0
src/pages/webview/index.scss

14
src/pages/webview/index.ts

@ -0,0 +1,14 @@
const app = getApp<IAppOption>();
Page({
data: {
src: '',
},
onLoad(options) {
this.setData({
src: decodeURIComponent(options.url || ''),
});
},
});
export {};

1
src/pages/webview/index.wxml

@ -0,0 +1 @@
<web-view src="{{src}}"></web-view>

72
src/utils/page.ts

@ -4,78 +4,78 @@
* 2app.js onLaunch Page = page * 2app.js onLaunch Page = page
*/ */
const originalPage = Page const originalPage = Page;
function page(config: WechatMiniprogram.Page.Instance<WechatMiniprogram.IAnyObject, WechatMiniprogram.IAnyObject>) { function page(config: WechatMiniprogram.Page.Instance<WechatMiniprogram.IAnyObject, WechatMiniprogram.IAnyObject>) {
const originalOnLoad = config.onLoad const originalOnLoad = config.onLoad;
config.onLoad = function (options) { config.onLoad = function (options) {
setImageParams(this) setImageParams(this);
setNavBar(this) setNavBar(this);
if (originalOnLoad) { if (originalOnLoad) {
originalOnLoad.call(this, options) originalOnLoad.call(this, options);
} }
} };
const originalOnPageScroll = config.onPageScroll const originalOnPageScroll = config.onPageScroll;
config.onPageScroll = function (options): void { config.onPageScroll = function (options): void {
const scrollTop = options?.scrollTop const scrollTop = options?.scrollTop;
let background = 'transparent' let background = 'transparent';
if (Number(scrollTop) > 20) { if (Number(scrollTop) > 20) {
background = '#ffffff' background = '#ffffff';
} }
this.setData({ this.setData({
background, background,
}) });
if (originalOnPageScroll) { if (originalOnPageScroll) {
originalOnPageScroll.call(this, options) originalOnPageScroll.call(this, options);
} }
} };
const originalOnShareAppMessage = config.onShareAppMessage const originalOnShareAppMessage = config.onShareAppMessage;
config.onShareAppMessage = function (options) { config.onShareAppMessage = function (options) {
if (originalOnShareAppMessage) { if (originalOnShareAppMessage) {
return originalOnShareAppMessage.call(this, options) return originalOnShareAppMessage.call(this, options);
} else { } else {
const date = new Date() const date = new Date();
const Timestamp = date.getTime() const Timestamp = date.getTime();
const pages = getCurrentPages() const pages = getCurrentPages();
const currentPage = pages[pages.length - 1] const currentPage = pages[pages.length - 1];
const url = currentPage.route const url = currentPage.route;
const options = currentPage.options const options = currentPage.options;
let urlWithArgs = `${url}?` let urlWithArgs = `${url}?`;
for (const key in options) { for (const key in options) {
const value = options[key] const value = options[key];
urlWithArgs += `${key}=${value}&` urlWithArgs += `${key}=${value}&`;
} }
urlWithArgs = urlWithArgs.substring(0, urlWithArgs.length - 1) urlWithArgs = urlWithArgs.substring(0, urlWithArgs.length - 1);
return { return {
title: '信达', title: '甲状腺眼病TED规范化诊治中心',
path: url, path: url,
// imageUrl: `${getApp().globalData.imageUrl}1/1.png?t=${Timestamp}`, // imageUrl: `${getApp().globalData.imageUrl}1/1.png?t=${Timestamp}`,
} };
} }
} };
config.handleMakePhoneCall = function () { config.handleMakePhoneCall = function () {
wx.makePhoneCall({ wx.makePhoneCall({
phoneNumber: '4008102299', phoneNumber: '4008102299',
}) });
} };
return originalPage(config) return originalPage(config);
} }
function setImageParams( function setImageParams(
currPage: WechatMiniprogram.Page.Instance<WechatMiniprogram.IAnyObject, WechatMiniprogram.IAnyObject>, currPage: WechatMiniprogram.Page.Instance<WechatMiniprogram.IAnyObject, WechatMiniprogram.IAnyObject>,
) { ) {
const date = new Date() const date = new Date();
const Timestamp = date.getTime() const Timestamp = date.getTime();
currPage.setData({ currPage.setData({
imageUrl: getApp().globalData.imageUrl, imageUrl: getApp().globalData.imageUrl,
Timestamp, Timestamp,
}) });
} }
function setNavBar( function setNavBar(
@ -84,7 +84,7 @@ function setNavBar(
currPage.setData({ currPage.setData({
background: 'transparent', background: 'transparent',
pageTop: wx.getMenuButtonBoundingClientRect().bottom, pageTop: wx.getMenuButtonBoundingClientRect().bottom,
}) });
} }
export default page export default page;

8
typings/index.d.ts vendored

@ -6,14 +6,16 @@ interface IAppOption {
imageUrl: string; imageUrl: string;
loginState: string; loginState: string;
isLogin: 0 | 1 | 999; isLogin: 0 | 1 | 999;
isAnswer: '0' | '1'; loginType: 0 | 1 | 2;
scene: null | { [key: string]: any }; scene: null | { [key: string]: any };
backPath: string; backPath: string;
}; };
userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback; userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback;
waitLogin: (waitLoginState?: boolean, requireLogin?: boolean, backPath?: string) => Promise<any>; waitLogin: (params?: { type?: 0 | 1 | 2 | 'any' }) => Promise<void>;
checkLoginType: (type: 0 | 1 | 2 | 'any') => boolean;
getMenuInfo: (arg0: WechatMiniprogram.Page.Instance<any, any>) => void; getMenuInfo: (arg0: WechatMiniprogram.Page.Instance<any, any>) => void;
getUserInfo: (arg0: WechatMiniprogram.Page.Instance<any, any>, arg1?: (arg0: any) => void) => void; getUserInfo: (type: 0 | 1 | 2) => Promise<never>;
mpBehavior: (data: { PositionId: string; OperateType: string; OperateId: string }) => void;
} }
interface IAgaxParams extends WechatMiniprogram.RequestOption { interface IAgaxParams extends WechatMiniprogram.RequestOption {

Loading…
Cancel
Save