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

10
src/app.ts

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

2
src/components/popup/index.scss

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
width: 630rpx;
box-sizing: border-box;
.container {
margin-top: -60rpx;
padding: 32rpx;
background: linear-gradient(180deg, #ebe4ff 0%, #ffffff 100%);
border-radius: 24rpx;
@ -45,6 +46,7 @@ @@ -45,6 +46,7 @@
font-size: 28rpx;
color: rgba(173, 172, 178, 1);
.tag {
margin-left: 10rpx;
display: inline-block;
font-size: 24rpx;
color: rgba(255, 255, 255, 1);

18
src/components/popup/index.wxml

@ -17,16 +17,13 @@ @@ -17,16 +17,13 @@
<view class="container">
<view class="user">
<button class="avatar-wrapper">
<image
class="avatar"
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
></image>
<image class="avatar" src="{{params.Img}}"></image>
</button>
<view class="wrap">
<view class="nickname">XX医生</view>
<view class="nickname">{{params.Name}}医生</view>
<view class="hostipal">
北京天坛医院
<view class="tag">三甲</view>
{{params.HospitalName}}
<view class="tag">{{params.HospitalClassificationName}}{{params.HospitalLevel}}</view>
</view>
</view>
</view>
@ -42,5 +39,10 @@ @@ -42,5 +39,10 @@
<image class="p-img" src="{{imageUrl}}bg7.png?t={{Timestamp}}" show-menu-by-longpress></image>
</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>

42
src/pages/home/index.ts

@ -5,10 +5,10 @@ const app = getApp<IAppOption>(); @@ -5,10 +5,10 @@ const app = getApp<IAppOption>();
Page({
data: {
popupShow: false,
// popupType: 'popup1', // 绑定医生弹窗
popupType: 'popup1', // 绑定医生弹窗
// popupType: 'popup2', // 去关注弹窗
// popupType: 'popup3', // 问题反馈弹窗
popupType: 'popup4', // 登录失败弹窗
// popupType: 'popup4', // 登录失败弹窗
popupParams: {
close: true,
} as any,
@ -34,9 +34,28 @@ Page({ @@ -34,9 +34,28 @@ Page({
this.setData({
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() {
const encodeUrl = encodeURIComponent('https://dct.meddb.cn');
wx.navigateTo({
@ -119,11 +138,30 @@ Page({ @@ -119,11 +138,30 @@ Page({
url: `/pages/informationDetail/index?id=${id}`,
});
},
handleMore() {
wx.switchTab({
url: '/pages/information/index',
});
},
handlePopupOk() {
const { popupType } = this.data;
},
handlePopupCancel() {
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({
popupShow: false,
});

4
src/pages/home/index.wxml

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

2
src/pages/information/index.ts

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

2
src/pages/informationDetail/index.json

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

4
src/pages/informationDetail/index.scss

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

8
src/pages/informationDetail/index.ts

@ -52,13 +52,15 @@ Page({ @@ -52,13 +52,15 @@ Page({
title: '加载中',
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({
url: detail.FileUrl,
filePath: `${wx.env.USER_DATA_PATH}/${detail.FileName}`,
success: (res) => {
if (res.statusCode === 200) {
wx.openDocument({
filePath: res.tempFilePath,
showMenu: true,
filePath: res.filePath,
success: () => {
wx.hideLoading();
},
@ -78,7 +80,7 @@ Page({ @@ -78,7 +80,7 @@ Page({
});
}
},
fail() {
fail(err) {
wx.hideLoading();
wx.showToast({
title: '下载文件失败',

4
src/pages/informationDetail/index.wxml

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
</view>
</view>
<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="content">{{detail.FileName}}</view>
<view class="size">{{detail.FileSizeName}}</view>
@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
<view class="page-footer">
<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">
<image class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
</button>

39
src/pages/login/index.ts

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

1
src/pages/my/index.json

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

2
src/pages/my/index.scss

@ -38,6 +38,8 @@ page { @@ -38,6 +38,8 @@ page {
font-size: 28rpx;
color: rgba(173, 172, 178, 1);
.tag {
vertical-align: 0rpx;
margin-left: 10rpx;
display: inline-block;
font-size: 24rpx;
color: rgba(255, 255, 255, 1);

1
src/pages/my/index.ts

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

2
src/pages/my/index.wxml

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
<navbar fixed title="我的" custom-style="background:{{background}}" back>
</navbar>
<view
class="page"
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 @@ @@ -1,3 +1,4 @@
{
"navigationBarTitleText": "医脉通DCT平台",
"usingComponents": {}
}

Loading…
Cancel
Save