Browse Source

邀约码

main
kola 4 months ago
parent
commit
0edb17c211
  1. 5
      README.md
  2. 15
      project.config.json
  3. 7
      project.private.config.json
  4. 13
      src/app.ts
  5. 4
      src/echart/components/homeLevel2/index.wxml
  6. 26
      src/pages/home/index.ts
  7. 2
      src/pages/home/index.wxml
  8. 8
      src/pages/start/index.ts
  9. 77
      src/utils/util.ts
  10. 2
      typings/index.d.ts

5
README.md

@ -3,13 +3,16 @@ @@ -3,13 +3,16 @@
3. 图像识别模糊 可以反向确认 通过ocr识别接口 接入ocr同时识别不到 姓名,年龄等字样,及判断该病历已被涂抹
<!--占位图像-->
https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567
images svn 地址
svn://39.106.86.127:28386/projects/takeda/proj_src/shop/frontend/web/wt
(/images/)(\S\*(?=["|']))
{{imageUrl}}$2?t={{Timestamp}}
ui问题
1. 首页绑定医生弹窗需要重新切图
2. 播放语音条图片没切

15
project.config.json

@ -39,7 +39,20 @@ @@ -39,7 +39,20 @@
},
"libVersion": "2.32.3",
"packOptions": {
"ignore": [],
"ignore": [
{
"value": "images/*.*",
"type": "glob"
},
{
"value": "images/**/*.*",
"type": "glob"
},
{
"value": "images/**/**/*.*",
"type": "glob"
}
],
"include": [
{
"value": "/echart/components/ec-canvas/echarts.js",

7
project.private.config.json

@ -9,6 +9,13 @@ @@ -9,6 +9,13 @@
"miniprogram": {
"list": [
{
"name": "邀约码",
"pathName": "pages/start/index",
"query": "scene=doctorId%3D2%26inviteChan%3D1",
"launchMode": "default",
"scene": 1047
},
{
"name": "指派医生",
"pathName": "module1/pages/setDoctor/index",
"query": "id=5",

13
src/app.ts

@ -1,11 +1,13 @@ @@ -1,11 +1,13 @@
/* eslint-disable perfectionist/sort-imports */
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";
const dayjs = require("dayjs");
const licia = require("miniprogram-licia");
require("/utils/dayjs/day-zh-cn.js");
dayjs.locale("zh-cn"); // 全局使用
@ -28,6 +30,8 @@ App<IAppOption>({ @@ -28,6 +30,8 @@ App<IAppOption>({
loginState: "",
isLogin: 0,
doctorId: null,
scene: null,
},
onLaunch() {
Page = page as WechatMiniprogram.Page.Constructor;
@ -47,11 +51,16 @@ App<IAppOption>({ @@ -47,11 +51,16 @@ App<IAppOption>({
this.globalData.loginState = res.loginState;
this.globalData.isLogin = res.isLogin;
this.globalData.doctorId = res.doctorId;
this.globalData.doctorAuditId = res.doctorAuditId;
});
},
});
},
onShow(options) {
if (options.query.scene) {
this.globalData.scene = parseScene(options.query.scene);
}
// this.startLogin();
},
waitLogin(waitLoginState = false) {
let time: number;
return new Promise((resolve, reject) => {

4
src/echart/components/homeLevel2/index.wxml

@ -213,9 +213,7 @@ @@ -213,9 +213,7 @@
</view>
<view class="none">
<image class="none-img1" src="/images/empty-5.png"></image>
<view class="content">
还没有邀约医生哦
</view>
<view class="content">还没有邀约医生哦</view>
</view>
</view>
</view>

26
src/pages/home/index.ts

@ -4,12 +4,36 @@ export {}; @@ -4,12 +4,36 @@ export {};
Page({
data: {
level: 2,
show1: false,
bindDoctorName: "",
},
onLoad() {
this.getTabBar().setData({
active: 1,
});
app.waitLogin().then(() => {});
app.waitLogin().then(() => {
this.handleBindDoctor()
});
},
handleBindDoctor() {
const scene = app.globalData.scene;
if (scene?.doctorId) {
wx.ajax({
method: "POST",
url: "?r=takeda/account/bind-doctor",
data: {
inviteDoctorId: scene.doctorId,
},
}).then((res) => {
if (res.Name) {
this.setData({
show1: true,
bindDoctorName: res.Name,
});
}
app.globalData.scene = null;
});
}
},
});

2
src/pages/home/index.wxml

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
<view class="container">
<view class="title">
您已绑定
<text class="name">陈艺莉医生</text>
<text class="name">{{bindDoctorName}}医生</text>
</view>
<view class="content">
作为您的合作医生

8
src/pages/start/index.ts

@ -3,6 +3,12 @@ const app = getApp<IAppOption>(); @@ -3,6 +3,12 @@ const app = getApp<IAppOption>();
Page({
data: {},
onLoad() {
app.waitLogin();
app.waitLogin().then(() => {
wx.reLaunch({
url: "/pages/home/index",
});
});
},
});
export {};

77
src/utils/util.ts

@ -1,19 +1,64 @@ @@ -1,19 +1,64 @@
export const formatTime = (date: Date) => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
return (
[year, month, day].map(formatNumber).join('/') +
' ' +
[hour, minute, second].map(formatNumber).join(':')
)
}
return `${[year, month, day].map(formatNumber).join("/")} ${[hour, minute, second].map(formatNumber).join(":")}`;
};
const formatNumber = (n: number) => {
const s = n.toString()
return s[1] ? s : '0' + s
}
export const formatNumber = (n: number) => {
const s = n.toString();
return s[1] ? s : `0${s}`;
};
/**
*
* @returns string
*/
export const getCurrentPageUrl = function () {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const url = `/${currentPage.route}`;
return url;
};
/**
* &
* @returns string
*/
export const getCurrentPageUrlWithArgs = function () {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const url = currentPage.route;
const options = currentPage.options;
let urlWithArgs = `/${url}?`;
for (const key in options) {
const value = options[key];
urlWithArgs += `${key}=${value}&`;
}
urlWithArgs = urlWithArgs.substring(0, urlWithArgs.length - 1);
return urlWithArgs;
};
const parseUrlArgsToArray = (urlArgs) => {
urlArgs = urlArgs.split("&");
const results = {};
urlArgs.forEach((arg) => {
arg = arg.split("=");
if (arg[0] && arg[1]) {
results[arg[0]] = arg[1];
}
});
return results;
};
export const parseScene = (scene) => {
if (scene) {
return parseUrlArgsToArray(decodeURIComponent(scene));
} else {
return null;
}
};

2
typings/index.d.ts vendored

@ -7,7 +7,7 @@ interface IAppOption { @@ -7,7 +7,7 @@ interface IAppOption {
loginState: string;
isLogin: number;
doctorId: null | number;
doctorAuditId: number;
scene: null | { [key: string]: any };
};
userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback;
waitLogin: (waitLoginState?: boolean) => Promise<any>;

Loading…
Cancel
Save