Browse Source

bug fix

master
kola-web 1 week ago
parent
commit
72d198a78b
  1. 2
      README.md
  2. 10
      src/app.ts
  3. 2
      src/components/popup/index.scss
  4. 18
      src/components/popup/index.wxml
  5. 42
      src/pages/home/index.ts
  6. 4
      src/pages/home/index.wxml
  7. 2
      src/pages/information/index.ts
  8. 2
      src/pages/informationDetail/index.json
  9. 4
      src/pages/informationDetail/index.scss
  10. 8
      src/pages/informationDetail/index.ts
  11. 4
      src/pages/informationDetail/index.wxml
  12. 39
      src/pages/login/index.ts
  13. 1
      src/pages/my/index.json
  14. 2
      src/pages/my/index.scss
  15. 1
      src/pages/my/index.ts
  16. 2
      src/pages/my/index.wxml
  17. 1
      src/pages/webview/index.json

2
README.md

@ -21,7 +21,7 @@ showModel颜色统一
```ts ```ts
wx.showModal({ wx.showModal({
confirmColor: '#00B4C5', confirmColor: '#8c75d0',
cancelColor: '#141515', cancelColor: '#141515',
}); });
``` ```

10
src/app.ts

@ -99,15 +99,11 @@ App<IAppOption>({
}); });
return false; return false;
} }
if (loginType !== 2) {
if (loginType !== type) {
const typePageUrl = {
2: '/pages/index/index',
}[type as 2];
wx.reLaunch({ wx.reLaunch({
url: typePageUrl, url: '/pages/login/index',
}); });
return false; return false
} }
return true; return true;

2
src/components/popup/index.scss

@ -3,6 +3,7 @@
width: 630rpx; width: 630rpx;
box-sizing: border-box; box-sizing: border-box;
.container { .container {
margin-top: -60rpx;
padding: 32rpx; padding: 32rpx;
background: linear-gradient(180deg, #ebe4ff 0%, #ffffff 100%); background: linear-gradient(180deg, #ebe4ff 0%, #ffffff 100%);
border-radius: 24rpx; border-radius: 24rpx;
@ -45,6 +46,7 @@
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);

18
src/components/popup/index.wxml

@ -17,16 +17,13 @@
<view class="container"> <view class="container">
<view class="user"> <view class="user">
<button class="avatar-wrapper"> <button class="avatar-wrapper">
<image <image class="avatar" src="{{params.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">{{params.Name}}医生</view>
<view class="hostipal"> <view class="hostipal">
北京天坛医院 {{params.HospitalName}}
<view class="tag">三甲</view> <view class="tag">{{params.HospitalClassificationName}}{{params.HospitalLevel}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -42,5 +39,10 @@
<image class="p-img" src="{{imageUrl}}bg7.png?t={{Timestamp}}" 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="{{imageUrl}}icon11.png?t={{Timestamp}}" 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>

42
src/pages/home/index.ts

@ -5,10 +5,10 @@ const app = getApp<IAppOption>();
Page({ Page({
data: { data: {
popupShow: false, popupShow: false,
// popupType: 'popup1', // 绑定医生弹窗 popupType: 'popup1', // 绑定医生弹窗
// popupType: 'popup2', // 去关注弹窗 // popupType: 'popup2', // 去关注弹窗
// popupType: 'popup3', // 问题反馈弹窗 // popupType: 'popup3', // 问题反馈弹窗
popupType: 'popup4', // 登录失败弹窗 // popupType: 'popup4', // 登录失败弹窗
popupParams: { popupParams: {
close: true, close: true,
} as any, } as any,
@ -34,9 +34,28 @@ Page({
this.setData({ this.setData({
userInfo, userInfo,
}); });
this.getTab();
}); });
}); });
}, },
getTab() {
wx.ajax({
method: 'GET',
url: '?r=xd/doctor/index/is-welcome',
data: {},
}).then((res) => {
if (res.IsWelcome === 1) {
this.setData({
popupShow: true,
popupType: 'popup1',
popupParams: {
close: true,
...this.data.userInfo,
},
});
}
});
},
handleWebview() { handleWebview() {
const encodeUrl = encodeURIComponent('https://dct.meddb.cn'); const encodeUrl = encodeURIComponent('https://dct.meddb.cn');
wx.navigateTo({ wx.navigateTo({
@ -119,11 +138,30 @@ Page({
url: `/pages/informationDetail/index?id=${id}`, url: `/pages/informationDetail/index?id=${id}`,
}); });
}, },
handleMore() {
wx.switchTab({
url: '/pages/information/index',
});
},
handlePopupOk() { handlePopupOk() {
const { popupType } = this.data; const { popupType } = this.data;
}, },
handlePopupCancel() { handlePopupCancel() {
const { popupType } = this.data; const { popupType } = this.data;
if (popupType === 'popup1') {
wx.ajax({
method: 'POST',
url: '?r=xd/doctor/index/cancel-welcome',
data: {},
}).then(() => {
this.setData({
popupShow: false,
popupType: '',
popupParams: {},
});
});
return;
}
this.setData({ this.setData({
popupShow: false, popupShow: false,
}); });

4
src/pages/home/index.wxml

@ -11,7 +11,7 @@
<image class="avatar" src="{{userInfo.Img}}"></image> <image class="avatar" src="{{userInfo.Img}}"></image>
</button> </button>
<view class="wrap"> <view class="wrap">
<view class="nickname">{{userInfo.welcome}},{{userInfo.Name}}</view> <view class="nickname">{{userInfo.welcome}},{{userInfo.Name}}医生</view>
<view class="hostipal"> <view class="hostipal">
{{userInfo.HospitalName}} {{userInfo.HospitalName}}
<view class="tag">{{userInfo.HospitalClassificationName}}{{userInfo.HospitalLevel}}</view> <view class="tag">{{userInfo.HospitalClassificationName}}{{userInfo.HospitalLevel}}</view>
@ -48,7 +48,7 @@
</swiper> </swiper>
</view> </view>
<view class="list"> <view class="list">
<view class="list-header"> <view class="list-header" bind:tap="handleMore">
<image class="title" src="{{imageUrl}}title3.png?t={{Timestamp}}"></image> <image class="title" src="{{imageUrl}}title3.png?t={{Timestamp}}"></image>
<view class="more"> <view class="more">
查看全部 查看全部

2
src/pages/information/index.ts

@ -11,7 +11,7 @@ Page({
count: 1, count: 1,
}, },
}, },
onLoad() { onShow() {
app.waitLogin({ type: 2 }).then(() => { app.waitLogin({ type: 2 }).then(() => {
this.getList(); this.getList();
}); });

2
src/pages/informationDetail/index.json

@ -1,6 +1,6 @@
{ {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarTitleText": "资料详情页", "navigationBarTitleText": "资料详情页",
"usingComponents": { "usingComponents": {
"mp-html": "mp-html" "mp-html": "mp-html"
} }

4
src/pages/informationDetail/index.scss

@ -1,5 +1,5 @@
.page { .page {
padding: 40rpx; padding: 40rpx 40rpx 200rpx;
.title { .title {
font-size: 40rpx; font-size: 40rpx;
color: rgba(33, 29, 46, 1); color: rgba(33, 29, 46, 1);
@ -72,7 +72,7 @@
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;
left: 0; left: 0;
padding: 18rpx 40rpx; padding: 18rpx 40rpx calc(30rpx + env(safe-area-inset-bottom));
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;

8
src/pages/informationDetail/index.ts

@ -52,13 +52,15 @@ Page({
title: '加载中', title: '加载中',
mask: true, mask: true,
}); });
app.mpBehavior({ PositionId: '1', OperateType: '1', OperateId: detail.Id as string }); app.mpBehavior({ PositionId: '1', OperateType: '2', OperateId: detail.Id as string });
wx.downloadFile({ wx.downloadFile({
url: detail.FileUrl, url: detail.FileUrl,
filePath: `${wx.env.USER_DATA_PATH}/${detail.FileName}`,
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
wx.openDocument({ wx.openDocument({
filePath: res.tempFilePath, showMenu: true,
filePath: res.filePath,
success: () => { success: () => {
wx.hideLoading(); wx.hideLoading();
}, },
@ -78,7 +80,7 @@ Page({
}); });
} }
}, },
fail() { fail(err) {
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
title: '下载文件失败', title: '下载文件失败',

4
src/pages/informationDetail/index.wxml

@ -8,7 +8,7 @@
</view> </view>
</view> </view>
<view class="file-card" wx:if="{{detail.FileUrl}}" bind:tap="handleDownload"> <view class="file-card" wx:if="{{detail.FileUrl}}" bind:tap="handleDownload">
<image class="icon" src="/images/{{fileIcon[detail.FileType] || 'none'}}.png"></image> <image class="icon" src="{{imageUrl}}{{fileIcon[detail.FileType] || 'none'}}.png?t={{Timestamp}}"></image>
<view class="wrap"> <view class="wrap">
<view class="content">{{detail.FileName}}</view> <view class="content">{{detail.FileName}}</view>
<view class="size">{{detail.FileSizeName}}</view> <view class="size">{{detail.FileSizeName}}</view>
@ -22,7 +22,7 @@
<view class="page-footer"> <view class="page-footer">
<image class="avatar" src="{{imageUrl}}icon10.png?t={{Timestamp}}"></image> <image class="avatar" src="{{imageUrl}}icon10.png?t={{Timestamp}}"></image>
<view class="title">{{detail.CreateWorkerName}}</view> <view class="title"> TED规范化诊治中心</view>
<button class="share" open-type="share"> <button class="share" open-type="share">
<image class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
</button> </button>

39
src/pages/login/index.ts

@ -90,9 +90,20 @@ Page({
mobile, mobile,
code, code,
}, },
}).then((res) => { showMsg: false,
this.submitCallback(res); })
}); .then((res) => {
this.submitCallback(res);
})
.catch(() => {
this.setData({
popupShow: true,
popupType: 'popup4',
popupParams: {
close: true,
},
});
});
}, },
handleWxSubmit(e: WechatMiniprogram.CustomEvent) { handleWxSubmit(e: WechatMiniprogram.CustomEvent) {
const { iv, encryptedData } = e.detail; const { iv, encryptedData } = e.detail;
@ -104,9 +115,20 @@ Page({
iv: encodeURIComponent(iv), iv: encodeURIComponent(iv),
encryptedData: encodeURIComponent(encryptedData), encryptedData: encodeURIComponent(encryptedData),
}, },
}).then((res) => { showMsg: false,
this.submitCallback(res); })
}); .then((res) => {
this.submitCallback(res);
})
.catch(() => {
this.setData({
popupShow: true,
popupType: 'popup4',
popupParams: {
close: true,
},
});
});
} }
}, },
submitCallback(res) { submitCallback(res) {
@ -137,6 +159,11 @@ Page({
url: '/doc/pages/doc1/index', url: '/doc/pages/doc1/index',
}); });
}, },
handlePopupCancel() {
this.setData({
popupShow: false,
});
},
}); });
export {}; export {};

1
src/pages/my/index.json

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

2
src/pages/my/index.scss

@ -38,6 +38,8 @@ page {
font-size: 28rpx; font-size: 28rpx;
color: rgba(173, 172, 178, 1); color: rgba(173, 172, 178, 1);
.tag { .tag {
vertical-align: 0rpx;
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);

1
src/pages/my/index.ts

@ -33,6 +33,7 @@ Page({
handleLoginOut() { handleLoginOut() {
wx.showModal({ wx.showModal({
title: '是否确认退出登录?', title: '是否确认退出登录?',
confirmColor: '#8c75d0',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
wx.ajax({ wx.ajax({

2
src/pages/my/index.wxml

@ -1,3 +1,5 @@
<navbar fixed title="我的" custom-style="background:{{background}}" back>
</navbar>
<view <view
class="page" class="page"
style="background: url('{{imageUrl}}bg1.png?t={{Timestamp}}') no-repeat top center/100% 602rpx;padding-top:{{pageTop+21}}px;" style="background: url('{{imageUrl}}bg1.png?t={{Timestamp}}') no-repeat top center/100% 602rpx;padding-top:{{pageTop+21}}px;"

1
src/pages/webview/index.json

@ -1,3 +1,4 @@
{ {
"navigationBarTitleText": "医脉通DCT平台",
"usingComponents": {} "usingComponents": {}
} }

Loading…
Cancel
Save