diff --git a/project.private.config.json b/project.private.config.json index d96a279..7c6e787 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -23,11 +23,18 @@ "miniprogram": { "list": [ { + "name": "患者端-登录", + "pathName": "patient/pages/login/index", + "query": "", + "scene": null, + "launchMode": "default" + }, + { "name": "资料库详情", "pathName": "pages/informationDetail/index", "query": "id=76", - "scene": null, - "launchMode": "default" + "launchMode": "default", + "scene": null }, { "name": "通知资料", diff --git a/src/app.json b/src/app.json index f7108e4..d1cc702 100644 --- a/src/app.json +++ b/src/app.json @@ -12,6 +12,65 @@ ], "subPackages": [ { + "root": "patient", + "pages": [ + "pages/index/index", + "pages/login/index", + "pages/vipLogin/index", + "pages/vipLoginReject/index", + "pages/startReject/index", + "pages/startPending/index", + "pages/story/index", + "pages/publishStoryDetail/index", + "pages/storyEnter/index", + "pages/storyEnterResult/index", + "pages/storyList/index", + "pages/storyGuide/index", + "pages/storyDetail/index", + "pages/my/index", + "pages/mySave/index", + "pages/myLive/index", + "pages/getUserInfo/index", + "pages/personalInformation/index", + "pages/changePhone/index", + "pages/changeUser/index", + "pages/cancellation/index", + "pages/family/index", + "pages/familyList/index", + "pages/familyScan/index", + "pages/thePublic/index", + "pages/privacyAgreement/index", + "pages/taskAgreement/index", + "pages/enterInfo/index", + "pages/uploadCert/index", + "pages/certReslove/index", + "pages/certPending/index", + "pages/repository/index", + "pages/repositoryDetail/index", + "pages/live/index", + "pages/liveDetail/index", + "pages/liveResult/index", + "pages/signIn/index", + "pages/adl/index", + "pages/adlShare/index", + "pages/adlTest/index", + "pages/adlResult/index", + "pages/smallPage/index", + "pages/hospital/index", + "pages/doctor/index", + "pages/doctorDetail/index", + "pages/drugRecord/index", + "pages/comIns/index", + "pages/webview/index", + "pages/nrdl/index", + "pages/nrdlDetail/index", + "pages/infusionCenter/index", + "pages/nrdlTable/index", + "pages/interactivePatient/index", + "pages/referral/index" + ] + }, + { "root": "doc", "pages": ["pages/doc1/index"] } diff --git a/src/app.ts b/src/app.ts index 0526c95..54249f7 100644 --- a/src/app.ts +++ b/src/app.ts @@ -126,6 +126,22 @@ App({ showMsg: false, }); }, + zdMpBehavior(data: { PageName: string; doctor?: boolean }) { + let url = '?r=xd/mp-behavior/add'; + if (data.doctor) { + url = '?r=xd/doctor/mp-behavior/add'; + } + delete data.doctor; + wx.ajax({ + method: 'POST', + url, + data, + loading: false, + showMsg: false, + }).then((res) => { + console.log('res: ', res); + }); + }, getMenuInfo(self) { const menuButtonInfo = wx.getMenuButtonBoundingClientRect(); self.setData({ diff --git a/src/components/customPoster/README.md b/src/components/customPoster/README.md new file mode 100644 index 0000000..22a0fca --- /dev/null +++ b/src/components/customPoster/README.md @@ -0,0 +1,160 @@ +# 海报插件 + +## 基于[wxml2canvas](https://github.com/wg-front/wxml2canvas)插件 + +### 插件引入 + +```json +{ + "customPoster": "/components/customPoster/index" +} +``` + +```wxml + +``` + +### 参数示例 + +```js +const data = { + params: { + info: { id: 'circle-note_mp', title: '动态页', desc: '指定动态的页面,mp' }, + body: { + bgImg: + 'https://picsissiok-10049618.cos.ap-shanghai.myqcloud.com/a74018e725861534f1644cff04780f4e_16273677601587.png', + width: '750', + height: '1254', + }, + elements: [ + { + id: 'circle-name', + desc: '圈名称', + type: 1, + text: '治疗讨论', + font: '宋体', + 'font-size': '42', + color: '#FFFFFF', + 'single-line': true, + halign: 'center', + top: '106', + }, + { + id: 'master-name', + desc: '专家名称', + type: 1, + text: '健康小贴士', + font: '宋体', + 'font-size': '38', + color: '#FFFFFF', + 'single-line': true, + halign: 'center', + top: '237', + }, + { + id: 'master-avatar', + desc: '专家头像', + type: 0, + picType: 'avatar', + src: 'https://picsissiok-10049618.cos.ap-shanghai.myqcloud.com/ceb31ac6137e873225b8cc826389a267_16655329078962.jpg', + width: '120', + height: '120', + halign: 'center', + shape: 'circle', + top: '328', + }, + { + id: 'note-content', + desc: '动态内容', + type: 1, + text: '11月5日上海组织进口博览会CIIE大会,邀请大家来我们的展馆现场交流。', + font: '宋体', + 'font-size': '45', + color: '#18191A', + width: '630', + height: '348', + left: '60', + top: '495', + }, + { + id: 'note-title', + desc: '长文标题', + type: 1, + text: '', + font: '宋体', + 'font-size': '42', + color: '#18191A', + width: '659', + height: '116', + left: '46', + top: '495', + 'font-weight': 'bold', + }, + { + id: 'note-summary', + desc: '长文摘要 ', + type: 1, + text: '', + font: '宋体', + 'font-size': '42', + color: '#18191A', + width: '672', + height: '232', + left: '39', + top: '646', + }, + { + id: 'note-more', + desc: '还有', + type: 1, + text: '还有3条精彩附件>', + font: '宋体', + 'font-size': '31', + color: '#666666', + 'single-line': true, + width: '292', + height: '46', + left: '60', + top: '1024', + }, + { + id: 'scanText', + desc: '扫描二维码查看详情', + type: 1, + text: '扫描二维码查看详情', + font: '宋体', + 'font-size': '31', + color: '#666666', + 'single-line': true, + width: '279', + height: '43', + left: '60', + top: '1087', + }, + { + id: 'note-qrcode', + desc: '专家列表的二维码', + type: 0, + picType: 'qrcode', + src: 'https://family.devred.hbraas.com/proxy/mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQHJ8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyUWhDdGhTWVNlTjMxMDAwMDAwN3gAAgSonPxjAwQAAAAA', + width: '130', + height: '130', + left: '554', + top: '1012', + }, + { + id: 'brand', + desc: 'brand×华秉科技', + type: 1, + text: '做企业数字化转型的亲密伙伴×华秉科技', + font: '宋体', + 'font-size': '24', + color: '#B2B3B4', + 'single-line': true, + halign: 'center', + top: '1192', + }, + ], + }, +} +``` diff --git a/src/components/customPoster/index.js b/src/components/customPoster/index.js new file mode 100644 index 0000000..96b2865 --- /dev/null +++ b/src/components/customPoster/index.js @@ -0,0 +1,101 @@ +import Wxml2Canvas from "./wxml2canvas/index.js"; // 根据具体路径修改,node_modules会被忽略 + +Component({ + properties: { + params: { + type: Object, + observer(newVal, _olVal) { + if (Object.keys(newVal).length > 0) { + this.paramsFormat(newVal); + this.setData({ + width: newVal.body.width, + height: newVal.body.height, + bgImg: newVal.body.bgImg, + elementsMp: newVal.elements, + }); + this.drawImage1(); + } + }, + }, + }, + data: { + imgUrl: "", + width: "", + height: "", + imgheight: "", + bgImg: "", + elementsMp: [], + }, + lifetimes: { + attached() {}, + }, + methods: { + paramsFormat(params) { + params.elements.forEach((item) => { + if (item.type === 0) { + // 图片居中 + if (item.halign === "center") { + item.left = (params.body.width - item.width) / 2; + } + } else { + item.text = item.text.replace(/[\r\n]/g, ""); + // 文字居中(使文字标签宽度等于画布宽度,文字加上居中的className) + if (item.halign === "center") { + item.width = item.width || params.body.width; + item.left = (params.body.width - item.width) / 2; + } + if (item.halign === "right") { + item.width = params.body.width; + } + if (item.id === "shareText" && item.text.length > 30) { + item.text = item.text.slice(0, 30) + "..."; + } + if (item.id === "note-title" && item.text.length > 28) { + item.text = item.text.slice(0, 28) + "..."; + } + if (item.id === "note-content" && item.text.length > 90) { + item.text = item.text.slice(0, 90) + "..."; + } + let len = params.elements.some((x) => x.id === "note-title" && x.text.length); + if (len && item.id === "note-summary" && item.text.length > 62) { + item.text = item.text.slice(0, 62) + "..."; + } else if (item.id === "note-summary" && item.text.length > 76) { + item.text = item.text.slice(0, 76) + "..."; + } + } + }); + }, + drawImage1() { + let self = this; + this.drawImage1 = new Wxml2Canvas({ + obj: self, + width: this.data.width, // 宽, 以iphone6为基准,传具体数值,其它机型自动适配 + height: this.data.height, // 高 + element: "canvas1", + background: "transparent", + progress(percent) {}, + finish(url) { + self.setData({ + imgUrl: url, + }); + self.triggerEvent("finish", url); + }, + error(res) {}, + }); + + let data = { + list: [ + { + type: "wxml", + class: "#canvas-bill-body-mp .draw_canvas", + limit: "#canvas-bill-body-mp", + x: 0, + y: 0, + }, + ], + }; + + this.drawImage1.draw(data); + }, + }, +}); diff --git a/src/components/customPoster/index.json b/src/components/customPoster/index.json new file mode 100644 index 0000000..3dae481 --- /dev/null +++ b/src/components/customPoster/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} diff --git a/src/components/customPoster/index.scss b/src/components/customPoster/index.scss new file mode 100644 index 0000000..5dce05f --- /dev/null +++ b/src/components/customPoster/index.scss @@ -0,0 +1,53 @@ +.canvas-box { + position: fixed; + left: 1000000rpx; + top: -1000000rpx; +} +.canvas-body { + background-position: center; + background-repeat: no-repeat; + background-size: cover; + background-color: #fff; +} +.draw_canvas { + position: absolute; +} +.canvas-bill { + position: fixed; + width: 750rpx; + left: 1000000rpx; + top: -1000000rpx; + visibility: hidden; +} +.lineOne { + // overflow: hidden; + // text-overflow: ellipsis; + // white-space: nowrap; +} +.textCenter { + text-align: center; +} +.textRight { + text-align: right; +} +.billImg-box { + position: fixed; + left: 0; + top: 0; + z-index: 10; + width: 750rpx; + height: 100vh; + display: flex; + justify-content: center; + align-items: center; + background-color: rgba(0, 0, 0, 0.75); +} +.image-load-text { + width: 750rpx; + text-align: center; + color: #fff; + line-height: 50rpx; + margin-top: 20rpx; + font-size: 28rpx; + letter-spacing: 2rpx; +} diff --git a/src/components/customPoster/index.wxml b/src/components/customPoster/index.wxml new file mode 100644 index 0000000..511c91a --- /dev/null +++ b/src/components/customPoster/index.wxml @@ -0,0 +1,43 @@ + + + + + + {{item.text}} + + + + + + + + + + + + + + diff --git a/src/components/customPoster/wxml2canvas/README.md b/src/components/customPoster/wxml2canvas/README.md new file mode 100644 index 0000000..e69de29 diff --git a/src/components/customPoster/wxml2canvas/index.js b/src/components/customPoster/wxml2canvas/index.js new file mode 100644 index 0000000..df28992 --- /dev/null +++ b/src/components/customPoster/wxml2canvas/index.js @@ -0,0 +1,1692 @@ +module.exports = (function () { + var __MODS__ = {}; + var __DEFINE__ = function (modId, func, req) { + var m = { exports: {}, _tempexports: {} }; + __MODS__[modId] = { status: 0, func: func, req: req, m: m }; + }; + var __REQUIRE__ = function (modId, source) { + if (!__MODS__[modId]) return require(source); + if (!__MODS__[modId].status) { + var m = __MODS__[modId].m; + m._exports = m._tempexports; + var desp = Object.getOwnPropertyDescriptor(m, "exports"); + if (desp && desp.configurable) + Object.defineProperty(m, "exports", { + set: function (val) { + if (typeof val === "object" && val !== m._exports) { + m._exports.__proto__ = val.__proto__; + Object.keys(val).forEach(function (k) { + m._exports[k] = val[k]; + }); + } + m._tempexports = val; + }, + get: function () { + return m._tempexports; + }, + }); + __MODS__[modId].status = 1; + __MODS__[modId].func(__MODS__[modId].req, m, m.exports); + } + return __MODS__[modId].m.exports; + }; + var __REQUIRE_WILDCARD__ = function (obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var k in obj) { + if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; + } + } + newObj.default = obj; + return newObj; + } + }; + var __REQUIRE_DEFAULT__ = function (obj) { + return obj && obj.__esModule ? obj.default : obj; + }; + __DEFINE__( + 1685064731946, + function (require, module, exports) { + var __TEMP__ = require("./src/index"); + var Wxml2Canvas = __REQUIRE_DEFAULT__(__TEMP__); + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Wxml2Canvas; + }, + function (modId) { + var map = { "./src/index": 1685064731947 }; + return __REQUIRE__(map[modId], modId); + }, + ); + __DEFINE__( + 1685064731947, + function (require, module, exports) { + var __TEMP__ = require("./util"); + var Util = __REQUIRE_DEFAULT__(__TEMP__); + + const imageMode = [ + "scaleToFill", + "aspectFit", + "aspectFill", + "widthFix", + "top", + "bottom", + "center", + "left", + "right", + "top left", + "top right", + "bottom left", + "bottom right", + ]; + + class Wxml2Canvas { + constructor(options = {}) { + this.device = (wx.getSystemInfoSync && wx.getSystemInfoSync()) || {}; + + if (!options.zoom) { + this.zoom = this.device.windowWidth / 375; + } else { + this.zoom = options.zoom || 1; + } + + this.element = options.element; + this.object = options.obj; + this.width = options.width * this.zoom || 0; + this.height = options.height * this.zoom || 0; + this.destZoom = options.destZoom || 3; + this.destWidth = this.width * this.destZoom; + this.destHeight = this.height * this.destZoom; + this.translateX = options.translateX * this.zoom || 0; + this.translateY = options.translateY * this.zoom || 0; + this.gradientBackground = options.gradientBackground || null; + this.background = options.background || "#ffffff"; + this.finishDraw = options.finish || function finish(params) {}; + this.errorHandler = options.error || function error(params) {}; + this.progress = options.progress || function progress(params) {}; + this.textAlign = options.textAlign || "left"; + this.fullText = options.fullText || false; + this.font = options.font || "14px PingFang SC"; + + this._init(); + } + + draw(data = {}, that) { + let self = this; + this.data = data; + this.fef = that; + + this.progress(10); + this._preloadImage(data.list) + .then((result) => { + this.progress(30); + self._draw(); + }) + .catch((res) => { + self.errorHandler(res); + }); + } + + measureWidth(text, font) { + if (font) { + this.ctx.font = font; + } + let res = this.ctx.measureText(text) || {}; + return res.width || 0; + } + + _init() { + this.progressPercent = 0; // 绘制进度百分比 + this.data = null; + this.ref = null; + this.allPic = []; + this.screenList = []; + this.asyncList = []; + this.imgUrl = ""; + this.progressPercent = 0; + this.distance = 0; + this.progress(0); + + this.ctx = wx.createCanvasContext(this.element, this.object); + this.ctx.font = this.font; + this.ctx.setTextBaseline("top"); + this.ctx.setStrokeStyle("white"); + + this.debug = this.device.platform === "devtools" ? true : false; + + this._drawBakcground(); + } + + _drawBakcground() { + if (this.gradientBackground) { + let line = this.gradientBackground.line || [0, 0, 0, this.height]; + let color = this.gradientBackground.color || ["#fff", "#fff"]; + let style = { fill: { line, color } }; + this._drawRectToCanvas(0, 0, this.width, this.height, style); + } else { + let style = { fill: this.background }; + this._drawRectToCanvas(0, 0, this.width, this.height, style); + } + } + + _draw() { + let self = this; + let list = this.data.list || []; + let index = 0; + let all = []; + let count = 0; + + list.forEach((item) => { + if (item.type === "wxml") { + count += 3; + } else { + count += 1; + } + }); + + this.distance = 60 / (count || 1); // 进度条的间距 + this.progressPercent = 30; + this.asyncList = list.filter((item) => item.delay == true); + list = list.filter((item) => item.delay != true); + drawList(list); + + Promise.all(all) + .then((results) => { + index = 0; + drawList(self.asyncList, true); + + Promise.all(all).then((results) => { + self.progress(90); + self._saveCanvasToImage(); + }); + }) + .catch((e) => { + console.log(e); + self.errorHandler(e); + }); + + function drawList(list = [], noDelay) { + list.forEach((item, i) => { + all[index++] = new Promise((resolve, reject) => { + let attr = item.style; + item.progress = self.distance; + if (noDelay) { + item.delay = 0; + } + if (item.type === "radius-image") { + self._drawCircle(item, attr, resolve, reject, "image"); + } else if (item.type === "text") { + self._drawText(item, attr, resolve, reject); + } else if (item.type === "line") { + self._drawLine(item, attr, resolve, reject); + } else if (item.type === "circle") { + self._drawCircle(item, attr, resolve, reject); + } else if (item.type === "rect") { + self._drawRect(item, attr, resolve, reject); + } else if (item.type === "image") { + self._drawRect(item, attr, resolve, reject, "image"); + } else if (item.type === "wxml") { + self._drawWxml(item, attr, resolve, reject); + } else { + resolve(); + } + }); + }); + } + } + + _saveCanvasToImage() { + let self = this; + + // 延时保存有两个原因,一个是等待绘制delay的元素,另一个是安卓上样式会错乱 + setTimeout( + () => { + self.progress(95); + + let obj = { + x: 0, + y: 0, + width: self.width, + height: self.height, + canvasId: self.element, + success: function (res) { + self.progress(100); + self.imgUrl = res.tempFilePath; + self.finishDraw(self.imgUrl); + }, + fail: function (res) { + self.errorHandler({ errcode: 1000, errmsg: "save canvas error", e: res }); + }, + }; + + if (self.destZoom !== 3) { + obj.destWidth = self.destWidth; + obj.destHeight = self.destHeight; + } + + wx.canvasToTempFilePath(obj, self.object); + }, + self.device.system.indexOf("iOS") === -1 ? 300 : 100, + ); + } + + _preloadImage(list = []) { + let self = this; + let all = []; + let count = 0; + + list.forEach((item, i) => { + if (item.url && self._findPicIndex(item.url) === -1) { + // 避免重复下载同一图片 + self.allPic.push({ + url: item.url, + local: "", + }); + all[count++] = new Promise((resolve, reject) => { + // 非http(s)域名的就不下载了 + if ( + !/^http/.test(item.url) || + /^http:\/\/(tmp)|(usr)\//.test(item.url) || + /^http:\/\/127\.0\.0\.1/.test(item.url) + ) { + if (item.isBase64) { + let fileManager = wx.getFileSystemManager(); + + fileManager.writeFile({ + filePath: item.url, + data: item.isBase64.replace(/data:image\/(.*);base64,/, ""), + encoding: "base64", + success(res) { + imageInfo(item.url); + }, + fail(res) { + reject(res); + }, + }); + } else { + imageInfo(item.url); + } + + function imageInfo(url) { + wx.getImageInfo({ + src: url, + success(res) { + let index = self._findPicIndex(url); + if (index > -1) { + self.allPic[index].local = url; + self.allPic[index].width = res.width; + self.allPic[index].height = res.height; + } + resolve({ tempFilePath: url }); + }, + fail(res) { + reject(res); + }, + }); + } + } else { + wx.downloadFile({ + url: item.url.replace(/^https?/, "https"), + success: function (res) { + wx.getImageInfo({ + src: res.tempFilePath, + success(img) { + let index = self._findPicIndex(item.url); + if (index > -1) { + self.allPic[index].local = res.tempFilePath; + self.allPic[index].width = img.width; + self.allPic[index].height = img.height; + } + resolve(res); + }, + fail(res) { + reject(res); + }, + }); + }, + fail: (res) => { + reject({ errcode: 1001, errmsg: "download pic error" }); + }, + }); + } + }); + } + }); + + return Promise.all(all) + .then((results) => { + return new Promise((resolve) => { + resolve(); + }); + }) + .catch((results) => { + return new Promise((resolve, reject) => { + reject(results); + }); + }); + } + + _findPicIndex(url) { + let index = this.allPic.findIndex((pic) => pic.url === url); + return index; + } + + _drawRect(item, style, resolve, reject, isImage, isWxml) { + let zoom = this.zoom; + let leftOffset = 0; + let topOffset = 0; + let width = style.width; + let height = style.height; + let imgWidth = style.width; + let imgHeight = style.height; + let mode = null; + + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + + let url; + if (isImage) { + let index = this._findPicIndex(item.url); + if (index > -1) { + url = this.allPic[index].local; + imgWidth = this.allPic[index].width; + imgHeight = this.allPic[index].height; + } else { + url = item.url; + } + } + + style.padding = style.padding || []; + if (isWxml === "inline-wxml") { + item.x = item.x + ((style.padding[3] && style.padding[3]) || 0); + item.y = item.y + ((style.padding[0] && style.padding[0]) || 0); + } + + leftOffset = item.x + style.width + ((style.padding[1] && style.padding[1]) || 0); + + if (!isWxml) { + width = width * zoom; + height = height * zoom; + } + + if (style.dataset && style.dataset.mode && imageMode.indexOf(style.dataset.mode) > -1) { + mode = { + type: style.dataset.mode, + width: imgWidth, + height: imgHeight, + }; + } + + this._drawRectToCanvas(item.x, item.y, width, height, style, url, mode); + this._updateProgress(item.progress); + + if (resolve) { + resolve(); + } else { + return { + leftOffset, + topOffset, + }; + } + } catch (e) { + reject && + reject({ errcode: isImage ? 1003 : 1002, errmsg: isImage ? "drawImage error" : "drawRect error", e }); + } + } + + _drawRectToCanvas(x, y, width, height, style, url, mode) { + let { fill, border, boxShadow } = style; + this.ctx.save(); + this._drawBoxShadow(boxShadow, (res) => { + // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影 + if (fill && typeof fill !== "string" && !this.debug) { + this.ctx.setFillStyle(res.color || "#ffffff"); + this.ctx.fillRect(x, y, width, height); + } + }); + + if (url) { + // 开发者工具有bug,先不裁剪 + if (mode) { + this._resetImageByMode(url, x, y, width, height, mode); + } else { + this.ctx.drawImage(url, x, y, width, height); + } + } else { + this._setFill(fill, () => { + this.ctx.fillRect(x, y, width, height); + }); + } + + this._drawBorder(border, style, (border) => { + let fixBorder = border.width; + this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder); + }); + + this.ctx.draw(true); + this.ctx.restore(); + this.ctx.strokeStyle = "#fff"; + } + + _resetImageByMode(url, x, y, width, height, mode) { + let self = this; + let offsetX = 0; + let offsetY = 0; + let imgWidth = mode.width; + let imgHeight = mode.height; + + switch (mode.type) { + case "scaleToFill": + imgWidth = width; + imgHeight = height; + self.ctx.drawImage(url, x, y, width, height); + break; + case "widthFix": + height = width / ((imgWidth || 1) / (imgHeight || 1)); + self.ctx.drawImage(url, x, y, width, height); + break; + case "aspectFit": + if (imgWidth > imgHeight) { + let realHeight = width / ((imgWidth || 1) / (imgHeight || 1)); + offsetY = -(height - realHeight) / 2; + imgWidth = width; + imgHeight = realHeight; + } else { + let realWidth = height / ((imgHeight || 1) / (imgWidth || 1)); + offsetX = -(width - realWidth) / 2; + imgWidth = realWidth; + imgHeight = height; + } + + _clip(); + break; + case "aspectFill": + if (imgWidth > imgHeight) { + let realWidth = imgWidth / ((imgHeight || 1) / (height || 1)); + offsetX = (realWidth - width) / 2; + imgWidth = realWidth; + imgHeight = height; + } else { + let realHeight = imgHeight / ((imgWidth || 1) / (width || 1)); + offsetY = (realHeight - height) / 2; + imgWidth = width; + imgHeight = realHeight; + } + + _clip(); + break; + case "top left": + _clip(); + break; + case "top": + offsetX = (mode.width - width) / 2; + _clip(); + break; + case "top right": + offsetX = mode.width - width; + _clip(); + break; + case "left": + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "center": + offsetX = (mode.width - width) / 2; + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "right": + offsetX = mode.width - width; + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "bottom left": + offsetY = mode.height - height; + _clip(); + break; + case "bottom": + offsetX = (mode.width - width) / 2; + offsetY = mode.height - height; + _clip(); + break; + case "bottom right": + offsetX = mode.width - width; + offsetY = mode.height - height; + _clip(); + break; + default: + imgWidth = width; + imgHeight = height; + break; + } + + function _clip() { + self.ctx.save(); + self.ctx.beginPath(); + self.ctx.rect(x, y, width, height); + self.ctx.clip(); + self.ctx.drawImage(url, x - offsetX, y - offsetY, imgWidth, imgHeight); + self.ctx.closePath(); + self.ctx.restore(); + } + } + + _drawText(item, style, resolve, reject, type, isWxml) { + let zoom = this.zoom; + let leftOffset = 0; + let topOffset = 0; + + try { + style.fontSize = this._parseNumber(style.fontSize); + let fontSize = Math.ceil((style.fontSize || 14) * zoom); + this.ctx.setTextBaseline("top"); + this.ctx.font = `${style.fontWeight ? style.fontWeight : "normal"} ${fontSize}px ${ + style.fontFamily || "PingFang SC" + }`; + this.ctx.setFillStyle(style.color || "#454545"); + + let text = item.text || ""; + let textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font)); + let lineHeight = this._getLineHeight(style); + let textHeight = Math.ceil(textWidth / (style.width || textWidth)) * lineHeight; + let width = Math.ceil((style.width || textWidth) * (!isWxml ? zoom : 1)); + let whiteSpace = style.whiteSpace || "wrap"; + let x = 0; + let y = 0; + + if (typeof style.padding === "string") { + style.padding = Util.transferPadding(style.padding); + } + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style, textHeight); + this._drawBoxShadow(style.boxShadow); + + if (style.background || style.border) { + this._drawTextBackgroud(item, style, textWidth, textHeight, isWxml); + } + + // 行内文本 + if (type === "inline-text") { + width = item.maxWidth; + if (item.leftOffset + textWidth > width) { + // 如果上一个行内元素换行了,这个元素要继续在后面补足一行 + let lineNum = Math.max(Math.floor(textWidth / width), 1); + let length = text.length; + let singleLength = Math.floor(length / lineNum); + let widthOffset = item.leftOffset ? item.leftOffset - item.originX : 0; + let { + endIndex: currentIndex, + single, + singleWidth, + } = this._getTextSingleLine(text, width, singleLength, 0, widthOffset); + x = this._resetTextPositionX(item, style, singleWidth); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(single, x, y); + leftOffset = x + singleWidth; + topOffset = y; + + // 去除第一行补的内容,然后重置 + text = text.substring(currentIndex, text.length); + currentIndex = 0; + lineNum = Math.max(Math.floor(textWidth / width), 1); + textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font)); + item.x = item.originX; // 还原换行后的x + for (let i = 0; i < lineNum; i++) { + let { endIndex, single, singleWidth } = this._getTextSingleLine( + text, + width, + singleLength, + currentIndex, + ); + currentIndex = endIndex; + if (single) { + x = this._resetTextPositionX(item, style, singleWidth, width); + y = this._resetTextPositionY(item, style, i + 1); + this.ctx.fillText(single, x, y); + if (i === lineNum - 1) { + leftOffset = x + singleWidth; + topOffset = lineHeight * lineNum; + } + } + } + + let last = text.substring(currentIndex, length); + let lastWidth = this.measureWidth(last); + + if (last) { + x = this._resetTextPositionX(item, style, lastWidth, width); + y = this._resetTextPositionY(item, style, lineNum + 1); + this.ctx.fillText(last, x, y); + leftOffset = x + lastWidth; + topOffset = lineHeight * (lineNum + 1); + } + } else { + x = this._resetTextPositionX(item, style, textWidth, width); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(item.text, x, y); + leftOffset = x + textWidth; + topOffset = lineHeight; + } + } else { + // block文本,如果文本长度超过宽度换行 + if (width && textWidth > width && whiteSpace !== "nowrap") { + let lineNum = Math.max(Math.floor(textWidth / width), 1); + let length = text.length; + let singleLength = Math.floor(length / lineNum); + let currentIndex = 0; + + // lineClamp参数限制最多行数 + if (style.lineClamp && lineNum + 1 > style.lineClamp) { + lineNum = style.lineClamp - 1; + } + + for (let i = 0; i < lineNum; i++) { + let { endIndex, single, singleWidth } = this._getTextSingleLine( + text, + width, + singleLength, + currentIndex, + ); + currentIndex = endIndex; + x = this._resetTextPositionX(item, style, singleWidth, width); + y = this._resetTextPositionY(item, style, i); + this.ctx.fillText(single, x, y); + } + + // 换行后剩余的文字,超过一行则截断增加省略号 + let last = text.substring(currentIndex, length); + let lastWidth = this.measureWidth(last); + if (lastWidth > width) { + let { single, singleWidth } = this._getTextSingleLine(last, width, singleLength); + lastWidth = singleWidth; + last = single.substring(0, single.length - 1) + "..."; + } + + x = this._resetTextPositionX(item, style, lastWidth, width); + y = this._resetTextPositionY(item, style, lineNum); + this.ctx.fillText(last, x, y); + } else { + x = this._resetTextPositionX(item, style, textWidth, width); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(item.text, x, y); + } + } + + this.ctx.draw(true); + + this._updateProgress(item.progress); + + if (resolve) { + resolve(); + } else { + return { + leftOffset, + topOffset, + }; + } + } catch (e) { + reject && reject({ errcode: 1004, errmsg: "drawText error", e: e }); + } + } + + _drawTextBackgroud(item, style, textWidth, textHeight, isWxml) { + if (!style.width) return; + let zoom = isWxml ? 1 : this.zoom; + let width = style.width || textWidth; + let height = style.height || textHeight; + let rectStyle = { + fill: style.background, + border: style.border, + }; + style.padding = style.padding || [0, 0, 0, 0]; + width += (style.padding[1] || 0) + (style.padding[3] || 0); + height += (style.padding[0] || 0) + (style.padding[2] || 0); + width = width * zoom; + height = height * zoom; + this._drawRectToCanvas(item.x, item.y, width, height, rectStyle); + } + + _drawCircle(item, style, resolve, reject, isImage, isWxml) { + let zoom = this.zoom; + let r = style.r; + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + + let url; + if (isImage) { + let index = this._findPicIndex(item.url); + if (index > -1) { + url = this.allPic[index].local; + } else { + url = item.url; + } + } + + if (!isWxml) { + r = r * zoom; + } + + this._drawCircleToCanvas(item.x, item.y, r, style, url); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && + reject({ + errcode: isImage ? 1006 : 1005, + errmsg: isImage ? "drawCircleImage error" : "drawCircle error", + e, + }); + } + } + + _drawCircleToCanvas(x, y, r, style, url) { + let { fill, border, boxShadow } = style; + + this.ctx.save(); + + this._drawBoxShadow(boxShadow, (res) => { + // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影 + if ((fill && typeof fill !== "string") || (url && res.color)) { + this.ctx.setFillStyle(res.color || "#ffffff"); + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.closePath(); + this.ctx.fill(); + } + }); + + if (url) { + this.ctx.save(); + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.clip(); + this.ctx.drawImage(url, x, y, r * 2, r * 2); + this.ctx.closePath(); + this.ctx.restore(); + } else { + this._setFill(fill, () => { + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.closePath(); + this.ctx.fill(); + }); + } + + this._drawBorder(border, style, (border) => { + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r + border.width / 2, 0, 2 * Math.PI); + this.ctx.stroke(); + this.ctx.closePath(); + }); + + this.ctx.draw(true); + this.ctx.restore(); + } + + _drawLine(item, style, resolve, reject, isWxml) { + let zoom = this.zoom; + try { + let x1 = item.x * zoom + this.translateX; + let y1 = item.y * zoom + this.translateY; + let x2 = item.x2 * zoom + this.translateX; + let y2 = item.y2 * zoom + this.translateY; + this._drawLineToCanvas(x1, y1, x2, y2, style); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && reject({ errcode: 1007, errmsg: "drawLine error", e }); + } + } + + _drawLineToCanvas(x1, y1, x2, y2, style) { + let { stroke, dash, boxShadow } = style; + + this.ctx.save(); + if (stroke) { + this._setStroke(stroke); + } + + this._drawBoxShadow(boxShadow); + + if (dash) { + let dash = [style.dash[0] || 5, style.dash[1] || 5]; + let offset = style.dash[2] || 0; + this.ctx.setLineDash(dash, offset || 0); + } + + this.ctx.moveTo(x1, y1); + this.ctx.setLineWidth((style.width || 1) * this.zoom); + this.ctx.lineTo(x2, y2); + this.ctx.stroke(); + this.ctx.draw(true); + this.ctx.restore(); + } + + // 废弃,合并到_drawRect + _drawImage(item, style, resolve, reject, isWxml) { + let zoom = this.zoom; + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + item.x = item.x + (style.padding[3] || 0); + item.y = item.y + (style.padding[0] || 0); + + let index = this._findPicIndex(item.url); + let url = index > -1 ? this.allPic[index].local : item.url; + this._drawImageToCanvas(url, item.x, item.y, style.width * zoom, style.height * zoom, style); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && reject({ errcode: 1012, errmsg: "drawRect error", e }); + } + } + + // 废弃,合并到_drawRect + _drawImageToCanvas(url, x, y, width, height, style) { + let { fill, border, boxShadow } = style; + this.ctx.save(); + + this._drawBoxShadow(boxShadow); + this.ctx.drawImage(url, x, y, width, height); + + this._drawBorder(border, style, (border) => { + let fixBorder = border.width; + this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder); + }); + this.ctx.draw(true); + this.ctx.restore(); + } + + _drawWxml(item, style, resolve, reject) { + let self = this; + let all = []; + try { + this._getWxml(item, style).then((results) => { + // 上 -> 下 + let sorted = self._sortListByTop(results[0]); + let count = 0; + let progress = 0; + Object.keys(sorted).forEach((item) => { + count += sorted[item].length; + }); + progress = (this.distance * 3) / (count || 1); + + all = this._drawWxmlBlock(item, sorted, all, progress, results[1]); + all = this._drawWxmlInline(item, sorted, all, progress, results[1]); + + Promise.all(all) + .then((results) => { + resolve && resolve(); + }) + .catch((e) => { + reject && reject(e); + }); + }); + } catch (e) { + reject && reject({ errcode: 1008, errmsg: "drawWxml error" }); + } + } + + _drawWxmlBlock(item, sorted, all, progress, results) { + let self = this; + // 用来限定位置范围,取相对位置 + let limitLeft = results ? results.left : 0; + let limitTop = results ? results.top : 0; + Object.keys(sorted).forEach((top, topIndex) => { + // 左 -> 右 + let list = sorted[top].sort((a, b) => { + return a.left - b.left; + }); + + list = list.filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") === -1); + + list.forEach((sub, index) => { + all[index] = new Promise((resolve2, reject2) => { + sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop); + sub.progress = progress; + let type = sub.dataset.type; + if (sub.dataset.delay) { + setTimeout(() => { + drawWxmlItem(); + }, sub.dataset.delay); + } else { + drawWxmlItem(); + } + function drawWxmlItem() { + if (type === "text") { + self._drawWxmlText(sub, resolve2, reject2); + } else if (type === "image") { + self._drawWxmlImage(sub, resolve2, reject2); + } else if (type === "radius-image") { + self._drawWxmlCircleImage(sub, resolve2, reject2); + } else if (type === "background-image") { + self._drawWxmlBackgroundImage(sub, resolve2, reject2); + } + } + }); + }); + }); + + return all; + } + + _drawWxmlInline(item, sorted, all, progress, results) { + let self = this; + let topOffset = 0; + let leftOffset = 0; + let lastTop = 0; + let limitLeft = results ? results.left : 0; + let limitTop = results ? results.top : 0; + let p = new Promise((resolve2, reject2) => { + let maxWidth = 0; + let minLeft = Infinity; + let maxRight = 0; + + // 找出同一top下的最小left和最大right,得到最大的宽度,用于换行 + Object.keys(sorted).forEach((top) => { + let inlineList = sorted[top].filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") > -1); + inlineList.forEach((sub) => { + if (sub.left < minLeft) { + minLeft = sub.left; + } + if (sub.right > maxRight) { + maxRight = sub.right; + } + }); + }); + maxWidth = Math.ceil(maxRight - minLeft || self.width); + + Object.keys(sorted).forEach((top, topIndex) => { + // 左 -> 右 + let list = sorted[top].sort((a, b) => { + return a.left - b.left; + }); + + // 换行的行内元素left放到后面,version2.0.6后无法获取高度,改用bottom值来判断是否换行了 + let position = -1; + for (let i = 0, len = list.length; i < len; i++) { + if (list[i] && list[i + 1]) { + if (list[i].bottom > list[i + 1].bottom) { + position = i; + break; + } + } + } + + if (position > -1) { + list.push(list.splice(position, 1)[0]); + } + + let inlineList = list.filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") > -1); + let originLeft = inlineList[0] ? inlineList[0].left : 0; + // 换行后和top不相等时,认为是换行了,要清除左边距;当左偏移量大于最大宽度时,也要清除左边距; 当左偏移小于左边距时,也要清除 + if ( + Math.abs(topOffset + lastTop - top) > 2 || + leftOffset - originLeft - limitLeft >= maxWidth || + leftOffset <= originLeft - limitLeft - 2 + ) { + leftOffset = 0; + } + + lastTop = +top; + topOffset = 0; + + inlineList.forEach((sub, index) => { + sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop); + sub.progress = progress; + let type = sub.dataset.type; + if (type === "inline-text") { + let drawRes = self._drawWxmlInlineText(sub, leftOffset, maxWidth); + leftOffset = drawRes.leftOffset; + topOffset = drawRes.topOffset; + } else if (type === "inline-image") { + let drawRes = self._drawWxmlImage(sub) || {}; + leftOffset = drawRes.leftOffset || 0; + topOffset = drawRes.topOffset || 0; + } + }); + }); + resolve2(); + }); + + all.push(p); + return all; + } + + _drawWxmlInlineText(sub, leftOffset = 0, maxWidth) { + let text = sub.dataset.text || ""; + if (sub.dataset.maxlength && text.length > sub.dataset.maxlength) { + text = text.substring(0, sub.dataset.maxlength) + "..."; + } + + let textData = { + text, + originX: sub.left, + x: leftOffset ? leftOffset : sub.left, + y: sub.top, + progress: sub.progress, + leftOffset: leftOffset, + maxWidth: maxWidth, // 行内元素的最大宽度,取决于limit的宽度 + }; + + if (sub.backgroundColor !== "rgba(0, 0, 0, 0)") { + sub.background = sub.backgroundColor; + } else { + sub.background = "rgba(0, 0, 0, 0)"; + } + + if (sub.dataset.background) { + sub.background = sub.dataset.background; + } + + let res = this._drawText(textData, sub, null, null, "inline-text", "wxml"); + + return res; + } + + _drawWxmlText(sub, resolve, reject) { + let text = sub.dataset.text || ""; + if (sub.dataset.maxlength && text.length > sub.dataset.maxlength) { + text = text.substring(0, sub.dataset.maxlength) + "..."; + } + + let textData = { + text, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + if (sub.backgroundColor !== "rgba(0, 0, 0, 0)") { + sub.background = sub.backgroundColor; + } else { + sub.background = "rgba(0, 0, 0, 0)"; + } + + if (sub.dataset.background) { + sub.background = sub.dataset.background; + } + + this._drawText(textData, sub, resolve, reject, "text", "wxml"); + } + + _drawWxmlImage(sub, resolve, reject) { + let imageData = { + url: sub.dataset.url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + + let res = this._drawRect(imageData, sub, resolve, reject, "image", "inline-wxml"); + + return res; + } + + _drawWxmlCircleImage(sub, resolve, reject) { + let imageData = { + url: sub.dataset.url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + sub.r = sub.width / 2; + + this._drawCircle(imageData, sub, resolve, reject, true, "wxml"); + } + + _drawWxmlBackgroundImage(sub, resolve, reject) { + let url = sub.dataset.url; + let index = this._findPicIndex(url); + url = index > -1 ? this.allPic[index].local : url; + let size = sub.backgroundSize.replace(/px/g, "").split(" "); + + let imageData = { + url: url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + + this._drawRect(imageData, sub, resolve, reject, "image", "wxml"); + } + + _getWxml(item, style) { + let self = this; + let query; + // if (this.obj) { + // query = wx.createSelectorQuery().in(this.obj); + // } else { + // query = wx.createSelectorQuery(); + // } + if (this.object) { + query = wx.createSelectorQuery().in(this.object); + } else { + query = wx.createSelectorQuery(); + } + + let p1 = new Promise((resolve, reject) => { + // 会触发两次,要限制 + let count = 0; + query + .selectAll(`${item.class}`) + .fields( + { + dataset: true, + size: true, + rect: true, + computedStyle: [ + "width", + "height", + "font", + "fontSize", + "fontFamily", + "fontWeight", + "fontStyle", + "textAlign", + "color", + "lineHeight", + "border", + "borderColor", + "borderStyle", + "borderWidth", + "verticalAlign", + "boxShadow", + "background", + "backgroundColor", + "backgroundImage", + "backgroundPosition", + "backgroundSize", + "paddingLeft", + "paddingTop", + "paddingRight", + "paddingBottom", + ], + }, + (res) => { + if (count++ === 0) { + let formated = self._formatImage(res); + let list = formated.list; + res = formated.res; + + self + ._preloadImage(list) + .then((result) => { + resolve(res); + }) + .catch((res) => { + reject && reject({ errcode: 1009, errmsg: "drawWxml preLoadImage error" }); + }); + } + }, + ) + .exec(); + }); + + let p2 = new Promise((resolve, reject) => { + if (!item.limit) { + resolve({ top: 0, width: self.width / self.zoom }); + } + + query + .select(`${item.limit}`) + .fields( + { + dataset: true, + size: true, + rect: true, + }, + (res) => { + resolve(res); + }, + ) + .exec(); + }); + + return Promise.all([p1, p2]); + } + + _getLineHeight(style) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + let lineHeight; + if (!isNaN(style.lineHeight) && style.lineHeight > style.fontSize) { + lineHeight = style.lineHeight; + } else { + style.lineHeight = (style.lineHeight || "") + ""; + lineHeight = +style.lineHeight.replace("px", ""); + lineHeight = lineHeight ? lineHeight : (style.fontSize || 14) * 1.2; + } + return lineHeight * zoom; + } + + _formatImage(res = []) { + let list = []; + res.forEach((item, index) => { + let dataset = item.dataset; + let uid = Util.getUid(); + let filename = `${wx.env.USER_DATA_PATH}/${uid}.png`; + if ((dataset.type === "image" || dataset.type === "radius-image") && dataset.url) { + let sub = { + url: dataset.base64 ? filename : dataset.url, + isBase64: dataset.base64 ? dataset.url : false, + }; + + res[index].dataset = Object.assign(res[index].dataset, sub); + list.push(sub); + } else if (dataset.type === "background-image" && item.backgroundImage.indexOf("url") > -1) { + let url = item.backgroundImage.replace(/url\((\"|\')?/, "").replace(/(\"|\')?\)$/, ""); + let sub = { + url: dataset.base64 ? filename : url, + isBase64: dataset.base64 ? url : false, + }; + res[index].dataset = Object.assign(res[index].dataset, sub); + list.push(sub); + } + }); + + return { list, res }; + } + + _updateProgress(distance) { + this.progressPercent += distance; + this.progress(this.progressPercent); + } + + _sortListByTop(list = []) { + let sorted = {}; + + // 粗略地认为2px相差的元素在同一行 + list.forEach((item, index) => { + let top = item.top; + if (!sorted[top]) { + if (sorted[top - 2]) { + top = top - 2; + } else if (sorted[top - 1]) { + top = top - 1; + } else if (sorted[top + 1]) { + top = top + 1; + } else if (sorted[top + 2]) { + top = top + 2; + } else { + sorted[top] = []; + } + } + sorted[top].push(item); + }); + + return sorted; + } + + _parseNumber(number) { + return isNaN(number) ? +(number || "").replace("px", "") : number; + } + + _transferWxmlStyle(sub, item, limitLeft, limitTop) { + let leftFix = +sub.dataset.left || 0; + let topFix = +sub.dataset.top || 0; + + sub.width = this._parseNumber(sub.width); + sub.height = this._parseNumber(sub.height); + sub.left = this._parseNumber(sub.left) - limitLeft + (leftFix + (item.x || 0)) * this.zoom; + sub.top = this._parseNumber(sub.top) - limitTop + (topFix + (item.y || 0)) * this.zoom; + + let padding = sub.dataset.padding || "0 0 0 0"; + if (typeof padding === "string") { + padding = Util.transferPadding(padding); + } + let paddingTop = Number(sub.paddingTop.replace("px", "")) + Number(padding[0]); + let paddingRight = Number(sub.paddingRight.replace("px", "")) + Number(padding[1]); + let paddingBottom = Number(sub.paddingBottom.replace("px", "")) + Number(padding[2]); + let paddingLeft = Number(sub.paddingLeft.replace("px", "")) + Number(padding[3]); + sub.padding = [paddingTop, paddingRight, paddingBottom, paddingLeft]; + + return sub; + } + + /** + * 支持负值绘制,从右边计算 + * @param {*} item + * @param {*} style + */ + _resetPositionX(item, style) { + let zoom = this.zoom; + let x = 0; + + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + // 通过wxml获取的不需要重置坐标 + if (item.x < 0 && item.type) { + x = this.width + item.x * zoom - style.width * zoom; + } else { + x = item.x * zoom; + } + + if (parseInt(style.borderWidth)) { + x += parseInt(style.borderWidth); + } + + return x + this.translateX; + } + + /** + * 支持负值绘制,从底部计算 + * @param {*} item + * @param {*} style + */ + _resetPositionY(item, style, textHeight) { + let zoom = this.zoom; + let y = 0; + + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + if (item.y < 0) { + y = this.height + item.y * zoom - (textHeight ? textHeight : style.height * zoom); + } else { + y = item.y * zoom; + } + + if (parseInt(style.borderWidth)) { + y += parseInt(style.borderWidth); + } + + return y + this.translateY; + } + + /** + * 文字的padding、text-align + * @param {*} item + * @param {*} style + * @param {*} textWidth + */ + _resetTextPositionX(item, style, textWidth, width) { + let textAlign = style.textAlign || "left"; + let x = item.x; + if (textAlign === "center") { + x = (width - textWidth) / 2 + item.x; + } else if (textAlign === "right") { + x = width - textWidth + item.x; + } + + let left = style.padding ? style.padding[3] || 0 : 0; + + return x + left + this.translateX; + } + + /** + * 文字的padding、text-align + * @param {*} item + * @param {*} style + * @param {*} textWidth + */ + _resetTextPositionY(item, style, lineNum = 0) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + let lineHeight = this._getLineHeight(style); + let fontSize = Math.ceil((style.fontSize || 14) * zoom); + + let blockLineHeightFix = + ((style.dataset && style.dataset.type) || "").indexOf("inline") > -1 ? 0 : (lineHeight - fontSize) / 2; + + let top = style.padding ? style.padding[0] || 0 : 0; + + // y + lineheight偏移 + 行数 + paddingTop + 整体画布位移 + return item.y + blockLineHeightFix + lineNum * lineHeight + top + this.translateY; + } + + /** + * 当文本超过宽度时,计算每一行应该绘制的文本 + * @param {*} text + * @param {*} width + * @param {*} singleLength + * @param {*} currentIndex + * @param {*} widthOffset + */ + _getTextSingleLine(text, width, singleLength, currentIndex = 0, widthOffset = 0) { + let offset = 0; + let endIndex = currentIndex + singleLength + offset; + let single = text.substring(currentIndex, endIndex); + let singleWidth = this.measureWidth(single); + + while (Math.round(widthOffset + singleWidth) > width) { + offset--; + endIndex = currentIndex + singleLength + offset; + single = text.substring(currentIndex, endIndex); + singleWidth = this.measureWidth(single); + } + + return { + endIndex, + single, + singleWidth, + }; + } + + _drawBorder(border, style, callback) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + border = Util.transferBorder(border); + + if (border && border.width) { + // 空白阴影,清空掉边框的阴影 + this._drawBoxShadow(); + if (border) { + this.ctx.setLineWidth(border.width * zoom); + + if (border.style === "dashed") { + let dash = style.dash || [5, 5, 0]; + let offset = dash[2] || 0; + let array = [dash[0] || 5, dash[1] || 5]; + this.ctx.setLineDash(array, offset); + } + this.ctx.setStrokeStyle(border.color); + } + callback && callback(border); + } + } + + _drawBoxShadow(boxShadow, callback) { + boxShadow = Util.transferBoxShadow(boxShadow); + if (boxShadow) { + this.ctx.setShadow(boxShadow.offsetX, boxShadow.offsetY, boxShadow.blur, boxShadow.color); + } else { + this.ctx.setShadow(0, 0, 0, "#ffffff"); + } + + callback && callback(boxShadow || {}); + } + + _setFill(fill, callback) { + if (fill) { + if (typeof fill === "string") { + this.ctx.setFillStyle(fill); + } else { + let line = fill.line; + let color = fill.color; + let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]); + grd.addColorStop(0, color[0]); + grd.addColorStop(1, color[1]); + this.ctx.setFillStyle(grd); + } + callback && callback(); + } + } + + _setStroke(stroke, callback) { + if (stroke) { + if (typeof stroke === "string") { + this.ctx.setStrokeStyle(stroke); + } else { + let line = stroke.line; + let color = stroke.color; + let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]); + grd.addColorStop(0, color[0]); + grd.addColorStop(1, color[1]); + this.ctx.setStrokeStyle(grd); + } + + callback && callback(); + } + } + } + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Wxml2Canvas; + }, + function (modId) { + var map = { "./util": 1685064731948 }; + return __REQUIRE__(map[modId], modId); + }, + ); + __DEFINE__( + 1685064731948, + function (require, module, exports) { + /** + * 获取字符的长度,full为true时,一个汉字算两个长度 + * @param {String} str + * @param {Boolean} full + */ + + function getTextLength(str, full) { + let len = 0; + for (let i = 0; i < str.length; i++) { + let c = str.charCodeAt(i); + //单字节加1 + if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) { + len++; + } else { + len += full ? 2 : 1; + } + } + return len; + } + + /** + * rgba(255, 255, 255, 1) => #ffffff + * @param {String} color + */ + function transferColor(color = "") { + let res = "#"; + color = color.replace(/^rgba?\(/, "").replace(/\)$/, ""); + color = color.split(", "); + + color.length > 3 ? (color.length = 3) : ""; + for (let item of color) { + item = parseInt(item || 0); + if (item < 10) { + res += "0" + item; + } else { + res += item.toString(16); + } + } + + return res; + } + + function transferBorder(border = "") { + let res = border.match(/(\w+)px\s(\w+)\s(.*)/); + let obj = {}; + + if (res) { + obj = { + width: +res[1], + style: res[2], + color: res[3], + }; + } + + return res ? obj : null; + } + + /** + * 内边距,依次为上右下左 + * @param {*} padding + */ + function transferPadding(padding = "0 0 0 0") { + padding = padding.split(" "); + for (let i = 0, len = padding.length; i < len; i++) { + padding[i] = +padding[i].replace("px", ""); + } + + return padding; + } + /** + * type1: 0, 25, 17, rgba(0, 0, 0, 0.3) + * type2: rgba(0, 0, 0, 0.3) 0px 25px 17px 0px => (0, 25, 17, rgba(0, 0, 0, 0.3)) + * @param {*} shadow + */ + function transferBoxShadow(shadow = "", type) { + if (!shadow || shadow === "none") return; + let color; + let split; + + split = shadow.match(/(\w+)\s(\w+)\s(\w+)\s(rgb.*)/); + + if (split) { + split.shift(); + shadow = split; + color = split[3] || "#ffffff"; + } else { + split = shadow.split(") "); + color = split[0] + ")"; + shadow = split[1].split("px "); + } + + return { + offsetX: +shadow[0] || 0, + offsetY: +shadow[1] || 0, + blur: +shadow[2] || 0, + color, + }; + } + + function getUid(prefix) { + prefix = prefix || ""; + + return ( + prefix + + "xxyxxyxx".replace(/[xy]/g, (c) => { + let r = (Math.random() * 16) | 0; + let v = c === "x" ? r : (r & 0x3) | 0x8; + return v.toString(16); + }) + ); + } + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = { + getTextLength, + transferBorder, + transferColor, + transferPadding, + transferBoxShadow, + getUid, + }; + }, + function (modId) { + var map = {}; + return __REQUIRE__(map[modId], modId); + }, + ); + return __REQUIRE__(1685064731946); +})(); +//miniprogram-npm-outsideDeps=[] +//# sourceMappingURL=index.js.map diff --git a/src/components/customPoster/wxml2canvas/index.js.map b/src/components/customPoster/wxml2canvas/index.js.map new file mode 100644 index 0000000..bbbdbec --- /dev/null +++ b/src/components/customPoster/wxml2canvas/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js","src/index.js","src/util.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;ACFA;AACA;AACA;AACA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["var __TEMP__ = require('./src/index');var Wxml2Canvas = __REQUIRE_DEFAULT__(__TEMP__);\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = Wxml2Canvas;","var __TEMP__ = require('./util');var Util = __REQUIRE_DEFAULT__(__TEMP__);\n\nconst imageMode = ['scaleToFill', 'aspectFit', 'aspectFill', 'widthFix', 'top', 'bottom', 'center', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right']\n\nclass Wxml2Canvas {\n constructor (options = {}) {\n this.device = wx.getSystemInfoSync && wx.getSystemInfoSync() || {};\n \n if (!options.zoom) {\n this.zoom = this.device.windowWidth / 375;\n } else {\n this.zoom = options.zoom || 1;\n } \n \n this.element = options.element;\n this.object = options.obj;\n this.width = options.width * this.zoom || 0;\n this.height = options.height * this.zoom || 0;\n this.destZoom = options.destZoom || 3;\n this.destWidth = this.width * this.destZoom;\n this.destHeight = this.height * this.destZoom;\n this.translateX = options.translateX * this.zoom || 0;\n this.translateY = options.translateY * this.zoom || 0;\n this.gradientBackground = options.gradientBackground || null;\n this.background = options.background || '#ffffff';\n this.finishDraw = options.finish || function finish(params) {}\n this.errorHandler = options.error || function error(params) {}\n this.progress = options.progress || function progress(params) {}\n this.textAlign = options.textAlign || 'left';\n this.fullText = options.fullText || false;\n this.font = options.font || '14px PingFang SC';\n\n this._init();\n }\n\n draw (data = {}, that) {\n let self = this;\n this.data = data;\n this.fef = that;\n\n this.progress(10);\n this._preloadImage(data.list).then((result) => {\n this.progress(30);\n self._draw();\n }).catch((res) => {\n self.errorHandler(res);\n })\n }\n\n measureWidth (text, font) {\n if(font) {\n this.ctx.font = font;\n }\n let res = this.ctx.measureText(text) || {};\n return res.width || 0;\n }\n\n _init () {\n this.progressPercent = 0; // 绘制进度百分比\n this.data = null;\n this.ref = null;\n this.allPic = [];\n this.screenList = []; \n this.asyncList = [];\n this.imgUrl = '';\n this.progressPercent = 0;\n this.distance = 0;\n this.progress(0);\n\n this.ctx = wx.createCanvasContext(this.element, this.obj);\n this.ctx.font = this.font;\n this.ctx.setTextBaseline('top');\n this.ctx.setStrokeStyle('white');\n\n this.debug = this.device.platform === 'devtools' ? true : false;\n\n this._drawBakcground();\n }\n\n _drawBakcground () {\n if (this.gradientBackground) {\n let line = this.gradientBackground.line || [0, 0, 0, this.height];\n let color = this.gradientBackground.color || ['#fff', '#fff'];\n let style = { fill: { line, color } }\n this._drawRectToCanvas(0, 0, this.width, this.height, style);\n } else {\n let style = { fill: this.background }\n this._drawRectToCanvas(0, 0, this.width, this.height, style);\n }\n }\n\n _draw () {\n let self = this;\n let list = this.data.list || [];\n let index = 0;\n let all = [];\n let count = 0;\n\n list.forEach(item => {\n if(item.type === 'wxml') {\n count += 3;\n } else {\n count += 1;\n }\n })\n\n this.distance = 60 / (count || 1); // 进度条的间距\n this.progressPercent = 30;\n this.asyncList = list.filter( item => item.delay == true );\n list = list.filter( item => item.delay != true );\n drawList(list);\n\n Promise.all(all).then(results => {\n index = 0;\n drawList(self.asyncList, true);\n\n Promise.all(all).then(results => {\n self.progress(90);\n self._saveCanvasToImage();\n });\n }).catch (e => {\n console.log(e)\n self.errorHandler(e);\n });\n\n function drawList(list = [], noDelay) {\n list.forEach((item, i) => {\n all[index++] = new Promise((resolve, reject) => {\n let attr = item.style;\n item.progress = self.distance;\n if (noDelay) {\n item.delay = 0;\n }\n if (item.type === 'radius-image') {\n self._drawCircle(item, attr, resolve, reject, 'image');\n } else if (item.type === 'text') {\n self._drawText(item, attr, resolve, reject);\n } else if (item.type === 'line') {\n self._drawLine(item, attr, resolve, reject);\n } else if (item.type === 'circle') {\n self._drawCircle(item, attr, resolve, reject);\n } else if (item.type === 'rect') {\n self._drawRect(item, attr, resolve, reject);\n } else if (item.type === 'image') {\n self._drawRect(item, attr, resolve, reject, 'image');\n } else if (item.type === 'wxml') {\n self._drawWxml(item, attr, resolve, reject);\n }else {\n resolve();\n }\n });\n });\n }\n }\n\n _saveCanvasToImage () {\n let self = this; \n\n // 延时保存有两个原因,一个是等待绘制delay的元素,另一个是安卓上样式会错乱\n setTimeout(() => {\n self.progress(95);\n\n let obj = {\n x: 0,\n y: 0,\n width: self.width,\n height: self.height,\n canvasId: self.element,\n success: function (res) {\n\n self.progress(100);\n self.imgUrl = res.tempFilePath;\n self.finishDraw(self.imgUrl);\n },\n fail: function (res) {\n\n self.errorHandler({errcode: 1000, errmsg: 'save canvas error', e: res});\n }\n }\n\n if(self.destZoom !== 3) {\n obj.destWidth = self.destWidth;\n obj.destHeight = self.destHeight;\n }\n\n wx.canvasToTempFilePath(obj, self.object);\n }, self.device.system.indexOf('iOS') === -1 ? 300 : 100);\n }\n\n _preloadImage (list = []) {\n let self = this;\n let all = [];\n let count = 0;\n\n list.forEach((item, i) => {\n if (item.url && self._findPicIndex(item.url) === -1) {\n \n // 避免重复下载同一图片\n self.allPic.push({\n url: item.url,\n local: ''\n });\n all[count++] = new Promise((resolve, reject) => {\n // 非http(s)域名的就不下载了\n if (!/^http/.test(item.url) || /^http:\\/\\/(tmp)|(usr)\\//.test(item.url) || /^http:\\/\\/127\\.0\\.0\\.1/.test(item.url)) {\n if(item.isBase64) {\n let fileManager = wx.getFileSystemManager();\n\n fileManager.writeFile({\n filePath: item.url,\n data: item.isBase64.replace(/data:image\\/(.*);base64,/, ''),\n encoding: 'base64',\n success (res) {\n imageInfo(item.url);\n },\n fail (res) {\n reject(res);\n },\n })\n \n }else {\n imageInfo(item.url);\n }\n\n function imageInfo (url) {\n wx.getImageInfo({\n src: url,\n success (res) {\n let index = self._findPicIndex(url);\n if(index > -1) {\n self.allPic[index].local = url;\n self.allPic[index].width = res.width;\n self.allPic[index].height = res.height;\n }\n resolve({ tempFilePath: url });\n }, \n fail (res) {\n reject(res);\n }\n })\n }\n } else {\n wx.downloadFile({\n url: item.url.replace(/^https?/, 'https'),\n success: function (res) {\n wx.getImageInfo({\n src: res.tempFilePath,\n success (img) {\n let index = self._findPicIndex(item.url);\n if (index > -1) {\n self.allPic[index].local = res.tempFilePath;\n self.allPic[index].width = img.width;\n self.allPic[index].height = img.height;\n }\n resolve(res);\n },\n fail (res) {\n reject(res);\n }\n })\n },\n fail: (res) => {\n reject({errcode: 1001, errmsg: 'download pic error'});\n }\n })\n }\n }) \n }\n });\n\n return Promise.all(all).then(results => {\n return new Promise(resolve => { resolve() })\n }).catch((results) => {\n return new Promise((resolve, reject) => { reject(results) })\n })\n }\n\n _findPicIndex (url) {\n let index = this.allPic.findIndex(pic => pic.url === url);\n return index;\n }\n\n _drawRect (item, style, resolve, reject, isImage, isWxml) {\n let zoom = this.zoom;\n let leftOffset = 0;\n let topOffset = 0;\n let width = style.width;\n let height = style.height;\n let imgWidth = style.width;\n let imgHeight = style.height;\n let mode = null;\n\n try {\n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n \n let url;\n if(isImage) {\n let index = this._findPicIndex(item.url);\n if(index > -1) {\n url = this.allPic[index].local\n imgWidth = this.allPic[index].width\n imgHeight = this.allPic[index].height\n }else {\n url = item.url;\n }\n }\n\n style.padding = style.padding || [];\n if(isWxml === 'inline-wxml') {\n item.x = item.x + (style.padding[3] && style.padding[3] || 0)\n item.y = item.y + (style.padding[0] && style.padding[0] || 0)\n }\n\n leftOffset = item.x + style.width + (style.padding[1] && style.padding[1] || 0);\n\n if(!isWxml) {\n width = width * zoom;\n height = height * zoom;\n }\n\n if(style.dataset && style.dataset.mode && imageMode.indexOf(style.dataset.mode) > -1) {\n mode = {\n type: style.dataset.mode,\n width: imgWidth,\n height: imgHeight\n };\n }\n\n this._drawRectToCanvas(item.x, item.y, width, height, style, url, mode);\n this._updateProgress(item.progress);\n\n if(resolve) {\n resolve();\n }else {\n return {\n leftOffset,\n topOffset\n }\n }\n } catch (e) {\n reject && reject({ errcode: (isImage ? 1003 : 1002), errmsg: (isImage ? 'drawImage error' : 'drawRect error'), e });\n }\n }\n\n _drawRectToCanvas (x, y, width, height, style, url, mode) {\n let { fill, border, boxShadow } = style;\n this.ctx.save();\n this._drawBoxShadow(boxShadow, (res) => {\n // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影\n if(fill && typeof fill !== 'string' && !this.debug) {\n this.ctx.setFillStyle(res.color || '#ffffff');\n this.ctx.fillRect(x, y, width, height);\n }\n });\n \n if(url) {\n // 开发者工具有bug,先不裁剪\n if(mode) {\n this._resetImageByMode(url, x, y, width, height, mode);\n }else {\n this.ctx.drawImage(url, x, y, width, height)\n }\n }else {\n this._setFill(fill, () => {\n this.ctx.fillRect(x, y, width, height);\n });\n }\n\n this._drawBorder(border, style, (border) => {\n let fixBorder = border.width;\n this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder);\n });\n\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _resetImageByMode (url, x, y, width, height, mode) {\n let self = this;\n let offsetX = 0;\n let offsetY = 0;\n let imgWidth = mode.width;\n let imgHeight = mode.height;\n\n switch (mode.type) {\n case 'scaleToFill': \n imgWidth = width;\n imgHeight = height;\n self.ctx.drawImage(url, x, y, width, height)\n break;\n case 'widthFix': \n height = width / ((imgWidth || 1) / (imgHeight || 1))\n self.ctx.drawImage(url, x, y, width, height)\n break; \n case 'aspectFit': \n if(imgWidth > imgHeight) {\n let realHeight = width / ((imgWidth || 1) / (imgHeight || 1))\n offsetY = -(height - realHeight) / 2\n imgWidth = width;\n imgHeight = realHeight;\n }else {\n let realWidth = height / ((imgHeight || 1) / (imgWidth || 1))\n offsetX = -(width - realWidth) / 2\n imgWidth = realWidth;\n imgHeight = height;\n }\n\n _clip();\n break;\n case 'aspectFill': \n if(imgWidth > imgHeight) {\n let realWidth = imgWidth / ((imgHeight || 1) / (height || 1))\n offsetX = (realWidth - width) / 2\n imgWidth = realWidth;\n imgHeight = height;\n }else {\n let realHeight = imgHeight / ((imgWidth || 1) / (width || 1))\n offsetY = (realHeight - height) / 2\n imgWidth = width;\n imgHeight = realHeight;\n }\n\n _clip();\n break;\n case 'top left': \n _clip();\n break;\n case 'top': \n offsetX = (mode.width - width) / 2;\n _clip();\n break;\n case 'top right': \n offsetX = (mode.width - width);\n _clip();\n break;\n case 'left': \n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'center': \n offsetX = (mode.width - width) / 2;\n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'right': \n offsetX = (mode.width - width);\n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'bottom left': \n offsetY = (mode.height - height)\n _clip();\n break;\n case 'bottom': \n offsetX = (mode.width - width) / 2;\n offsetY = (mode.height - height)\n _clip();\n break;\n case 'bottom right': \n offsetX = (mode.width - width);\n offsetY = (mode.height - height)\n _clip();\n break;\n default: \n imgWidth = width;\n imgHeight = height;\n break; \n }\n\n function _clip () {\n self.ctx.save();\n self.ctx.beginPath()\n self.ctx.rect(x, y, width, height)\n self.ctx.clip();\n self.ctx.drawImage(url, x - offsetX, y - offsetY, imgWidth, imgHeight)\n self.ctx.closePath();\n self.ctx.restore();\n }\n }\n\n _drawText (item, style, resolve, reject, type, isWxml) {\n let zoom = this.zoom;\n let leftOffset = 0;\n let topOffset = 0;\n\n try {\n style.fontSize = this._parseNumber(style.fontSize);\n let fontSize = Math.ceil((style.fontSize || 14) * zoom)\n this.ctx.setTextBaseline('top');\n this.ctx.font = (`${style.fontWeight ? (style.fontWeight) : 'normal'} ${ fontSize }px ${ style.fontFamily || 'PingFang SC' }`);\n this.ctx.setFillStyle(style.color || '#454545');\n\n let text = item.text || '';\n let textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font));\n let lineHeight = this._getLineHeight(style);\n let textHeight = Math.ceil(textWidth / (style.width || textWidth)) * lineHeight;\n let width = Math.ceil((style.width || textWidth) * (!isWxml ? zoom : 1));\n let whiteSpace = style.whiteSpace || 'wrap';\n let x = 0;\n let y = 0; \n\n if(typeof style.padding === 'string') {\n style.padding = Util.transferPadding(style.padding);\n }\n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style, textHeight);\n this._drawBoxShadow(style.boxShadow);\n\n if(style.background || style.border) {\n this._drawTextBackgroud(item, style, textWidth, textHeight, isWxml);\n }\n \n // 行内文本\n if(type === 'inline-text') {\n width = item.maxWidth;\n if(item.leftOffset + textWidth > width) {\n // 如果上一个行内元素换行了,这个元素要继续在后面补足一行\n let lineNum = Math.max(Math.floor(textWidth / width), 1);\n let length = text.length;\n let singleLength = Math.floor(length / lineNum);\n let widthOffset = item.leftOffset ? item.leftOffset - item.originX : 0;\n let { endIndex: currentIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, 0, widthOffset)\n x = this._resetTextPositionX(item, style, singleWidth);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(single, x, y);\n leftOffset = x + singleWidth;\n topOffset = y;\n\n // 去除第一行补的内容,然后重置\n text = text.substring(currentIndex, text.length);\n currentIndex = 0;\n lineNum = Math.max(Math.floor(textWidth / width), 1);\n textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font));\n item.x = item.originX; // 还原换行后的x\n for (let i = 0; i < lineNum; i++) {\n let { endIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, currentIndex);\n currentIndex = endIndex;\n if(single) {\n x = this._resetTextPositionX(item, style, singleWidth, width);\n y = this._resetTextPositionY(item, style, i + 1);\n this.ctx.fillText(single, x, y);\n if(i === lineNum - 1) {\n leftOffset = x + singleWidth;\n topOffset = lineHeight * lineNum;\n }\n }\n }\n\n let last = text.substring(currentIndex, length);\n let lastWidth = this.measureWidth(last);\n\n if(last) {\n x = this._resetTextPositionX(item, style, lastWidth, width);\n y = this._resetTextPositionY(item, style, lineNum + 1);\n this.ctx.fillText(last, x, y);\n leftOffset = x + lastWidth;\n topOffset = lineHeight * (lineNum + 1);\n }\n }else {\n x = this._resetTextPositionX(item, style, textWidth, width);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(item.text, x, y);\n leftOffset = x + textWidth;\n topOffset = lineHeight;\n }\n }else {\n // block文本,如果文本长度超过宽度换行\n if (width && textWidth > width && whiteSpace !== 'nowrap') {\n let lineNum = Math.max(Math.floor(textWidth / width), 1);\n let length = text.length;\n let singleLength = Math.floor(length / lineNum);\n let currentIndex = 0;\n\n // lineClamp参数限制最多行数\n if (style.lineClamp && lineNum + 1 > style.lineClamp) {\n lineNum = style.lineClamp - 1;\n }\n\n for (let i = 0; i < lineNum; i++) {\n let { endIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, currentIndex);\n currentIndex = endIndex;\n x = this._resetTextPositionX(item, style, singleWidth, width);\n y = this._resetTextPositionY(item, style, i);\n this.ctx.fillText(single, x, y);\n\n }\n\n // 换行后剩余的文字,超过一行则截断增加省略号\n let last = text.substring(currentIndex, length);\n let lastWidth = this.measureWidth(last);\n if(lastWidth > width) {\n let { single, singleWidth } = this._getTextSingleLine(last, width, singleLength);\n lastWidth = singleWidth;\n last = single.substring(0, single.length - 1) + '...';\n }\n\n x = this._resetTextPositionX(item, style, lastWidth, width);\n y = this._resetTextPositionY(item, style, lineNum);\n this.ctx.fillText(last, x, y);\n\n }else {\n x = this._resetTextPositionX(item, style, textWidth, width);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(item.text, x, y);\n }\n }\n \n this.ctx.draw(true);\n \n this._updateProgress(item.progress);\n\n if(resolve) {\n resolve();\n }else {\n return {\n leftOffset,\n topOffset\n }\n }\n } catch(e) {\n reject && reject({ errcode: 1004, errmsg: 'drawText error', e: e });\n }\n }\n\n _drawTextBackgroud (item, style, textWidth, textHeight, isWxml) {\n if(!style.width) return;\n let zoom = isWxml ? 1 : this.zoom;\n let width = style.width || textWidth;\n let height = style.height || textHeight;\n let rectStyle = {\n fill: style.background,\n border: style.border\n }\n style.padding = style.padding || [0, 0, 0, 0];\n width += (style.padding[1] || 0) + (style.padding[3] || 0);\n height += (style.padding[0] || 0) + (style.padding[2] || 0);\n width = width * zoom\n height = height * zoom\n this._drawRectToCanvas(item.x, item.y, width, height, rectStyle);\n }\n\n _drawCircle (item, style, resolve, reject, isImage, isWxml) {\n let zoom = this.zoom;\n let r = style.r;\n try {\n \n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n\n let url;\n if(isImage) {\n let index = this._findPicIndex(item.url);\n if (index > -1) {\n url = this.allPic[index].local;\n } else {\n url = item.url;\n }\n }\n\n if(!isWxml) {\n r = r * zoom;\n }\n\n this._drawCircleToCanvas(item.x, item.y, r, style, url);\n \n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: (isImage ? 1006 : 1005), errmsg: (isImage ? 'drawCircleImage error' : 'drawCircle error'), e });\n }\n }\n\n _drawCircleToCanvas (x, y, r, style, url) {\n let { fill, border, boxShadow } = style;\n\n this.ctx.save();\n\n this._drawBoxShadow(boxShadow, (res) => {\n // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影\n if((fill && typeof fill !== 'string') || (url && res.color)) {\n this.ctx.setFillStyle(res.color || '#ffffff');\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.closePath();\n this.ctx.fill();\n }\n });\n\n if(url) {\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.clip();\n this.ctx.drawImage(url, x, y, r * 2, r * 2);\n this.ctx.closePath();\n this.ctx.restore();\n }else {\n this._setFill(fill, () => {\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.closePath();\n this.ctx.fill();\n });\n }\n\n this._drawBorder(border, style, (border) => {\n this.ctx.beginPath()\n this.ctx.arc(x + r, y + r, r + border.width / 2, 0, 2 * Math.PI)\n this.ctx.stroke()\n this.ctx.closePath();\n });\n\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _drawLine (item, style, resolve, reject, isWxml) {\n let zoom = this.zoom;\n try {\n let x1 = item.x * zoom + this.translateX;\n let y1 = item.y * zoom + this.translateY;\n let x2 = item.x2 * zoom + this.translateX;\n let y2 = item.y2 * zoom + this.translateY;\n this._drawLineToCanvas(x1, y1, x2, y2, style);\n\n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: 1007, errmsg: 'drawLine error', e });\n }\n }\n\n _drawLineToCanvas (x1, y1, x2, y2, style) {\n let { stroke, dash, boxShadow } = style;\n\n this.ctx.save();\n if(stroke) {\n this._setStroke(stroke);\n }\n\n this._drawBoxShadow(boxShadow);\n\n if(dash) {\n let dash = [style.dash[0] || 5, style.dash[1] || 5];\n let offset = style.dash[2] || 0;\n this.ctx.setLineDash(dash, offset || 0);\n }\n\n this.ctx.moveTo(x1, y1);\n this.ctx.setLineWidth((style.width || 1) * this.zoom);\n this.ctx.lineTo(x2, y2);\n this.ctx.stroke();\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n // 废弃,合并到_drawRect\n _drawImage (item, style, resolve, reject, isWxml) {\n let zoom = this.zoom;\n try {\n \n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n item.x = item.x + (style.padding[3] || 0);\n item.y = item.y + (style.padding[0] || 0);\n\n let index = this._findPicIndex(item.url);\n let url = index > -1 ? this.allPic[index].local : item.url;\n this._drawImageToCanvas(url, item.x, item.y, style.width * zoom, style.height * zoom, style);\n\n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: 1012, errmsg: 'drawRect error', e });\n }\n }\n\n // 废弃,合并到_drawRect\n _drawImageToCanvas (url, x, y, width, height, style) {\n let { fill, border, boxShadow } = style;\n this.ctx.save();\n\n this._drawBoxShadow(boxShadow);\n this.ctx.drawImage(url, x, y, width, height);\n\n this._drawBorder(border, style, (border) => {\n let fixBorder = border.width;\n this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder);\n });\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _drawWxml (item, style, resolve, reject) {\n let self = this;\n let all = [];\n try {\n this._getWxml(item, style).then((results) => {\n \n // 上 -> 下\n let sorted = self._sortListByTop(results[0]);\n let count = 0;\n let progress = 0;\n Object.keys(sorted).forEach(item => {\n count += sorted[item].length;\n })\n progress = this.distance * 3 / (count || 1);\n\n all = this._drawWxmlBlock(item, sorted, all, progress, results[1]);\n all = this._drawWxmlInline(item, sorted, all, progress, results[1]);\n\n Promise.all(all).then(results => {\n resolve && resolve();\n }).catch (e => {\n reject && reject(e);\n });\n });\n } catch (e) {\n reject && reject({ errcode: 1008, errmsg: 'drawWxml error' });\n }\n }\n\n _drawWxmlBlock (item, sorted, all, progress, results) {\n let self = this;\n // 用来限定位置范围,取相对位置\n let limitLeft = (results ? results.left : 0);\n let limitTop = (results ? results.top : 0);\n Object.keys(sorted).forEach((top, topIndex) => {\n // 左 -> 右\n let list = sorted[top].sort((a, b) => {\n return (a.left - b.left);\n });\n\n list = list.filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') === -1);\n\n list.forEach((sub, index) => {\n all[index] = new Promise((resolve2, reject2) => {\n sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop);\n sub.progress = progress;\n let type = sub.dataset.type;\n if(sub.dataset.delay) {\n setTimeout(() => {\n drawWxmlItem();\n }, sub.dataset.delay)\n } else {\n drawWxmlItem();\n }\n function drawWxmlItem () {\n if (type === 'text') {\n self._drawWxmlText(sub, resolve2, reject2);\n } else if (type === 'image') {\n self._drawWxmlImage(sub, resolve2, reject2);\n } else if (type === 'radius-image') {\n self._drawWxmlCircleImage(sub, resolve2, reject2);\n } else if (type === 'background-image') {\n self._drawWxmlBackgroundImage(sub, resolve2, reject2);\n }\n }\n });\n });\n });\n\n return all;\n\n }\n\n _drawWxmlInline (item, sorted, all, progress, results) {\n let self = this;\n let topOffset = 0;\n let leftOffset = 0;\n let lastTop = 0;\n let limitLeft = (results ? results.left : 0);\n let limitTop = (results ? results.top : 0);\n let p = new Promise((resolve2, reject2) => {\n let maxWidth = 0;\n let minLeft = Infinity;\n let maxRight = 0;\n\n // 找出同一top下的最小left和最大right,得到最大的宽度,用于换行\n Object.keys(sorted).forEach(top => {\n let inlineList = sorted[top].filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') > -1);\n inlineList.forEach(sub => {\n if(sub.left < minLeft) {\n minLeft = sub.left\n }\n if(sub.right > maxRight) {\n maxRight = sub.right;\n }\n })\n });\n maxWidth = Math.ceil((maxRight - minLeft) || self.width);\n\n Object.keys(sorted).forEach((top, topIndex) => {\n // 左 -> 右\n let list = sorted[top].sort((a, b) => {\n return (a.left - b.left);\n });\n\n // 换行的行内元素left放到后面,version2.0.6后无法获取高度,改用bottom值来判断是否换行了\n let position = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i] && list[i + 1]) {\n if(list[i].bottom > list[i + 1].bottom) {\n position = i;\n break;\n }\n }\n }\n\n if(position > -1) {\n list.push(list.splice(position, 1)[0]);\n }\n\n let inlineList = list.filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') > -1);\n let originLeft = (inlineList[0] ? inlineList[0].left : 0);\n // 换行后和top不相等时,认为是换行了,要清除左边距;当左偏移量大于最大宽度时,也要清除左边距; 当左偏移小于左边距时,也要清除\n if (Math.abs(topOffset + lastTop - top) > 2 || leftOffset - originLeft - limitLeft >= maxWidth || leftOffset <= originLeft - limitLeft - 2) {\n leftOffset = 0;\n }\n\n lastTop = +top;\n topOffset = 0;\n \n inlineList.forEach((sub, index) => {\n sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop);\n sub.progress = progress;\n let type = sub.dataset.type;\n if (type === 'inline-text') {\n let drawRes = self._drawWxmlInlineText(sub, leftOffset, maxWidth);\n leftOffset = drawRes.leftOffset;\n topOffset = drawRes.topOffset;\n } else if (type === 'inline-image') {\n let drawRes = self._drawWxmlImage(sub) || {};\n leftOffset = drawRes.leftOffset || 0;\n topOffset = drawRes.topOffset || 0;\n }\n });\n });\n resolve2();\n })\n\n all.push(p); \n return all;\n }\n\n _drawWxmlInlineText (sub, leftOffset = 0, maxWidth) {\n let text = sub.dataset.text || '';\n if(sub.dataset.maxlength && text.length > sub.dataset.maxlength) {\n text = text.substring(0, sub.dataset.maxlength) + '...';\n }\n \n let textData = {\n text,\n originX: sub.left,\n x: leftOffset ? leftOffset : sub.left,\n y: sub.top,\n progress: sub.progress,\n leftOffset: leftOffset,\n maxWidth: maxWidth // 行内元素的最大宽度,取决于limit的宽度\n }\n\n if (sub.backgroundColor !== 'rgba(0, 0, 0, 0)') {\n sub.background = sub.backgroundColor;\n }else {\n sub.background = 'rgba(0, 0, 0, 0)';\n }\n\n if(sub.dataset.background) {\n sub.background = sub.dataset.background;\n }\n\n let res = this._drawText(textData, sub, null, null, 'inline-text', 'wxml');\n\n return res\n }\n\n _drawWxmlText (sub, resolve, reject) {\n let text = sub.dataset.text || '';\n if(sub.dataset.maxlength && text.length > sub.dataset.maxlength) {\n text = text.substring(0, sub.dataset.maxlength) + '...';\n }\n \n let textData = {\n text,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n if (sub.backgroundColor !== 'rgba(0, 0, 0, 0)') {\n sub.background = sub.backgroundColor;\n }else {\n sub.background = 'rgba(0, 0, 0, 0)';\n }\n\n if(sub.dataset.background) {\n sub.background = sub.dataset.background;\n }\n\n this._drawText(textData, sub, resolve, reject, 'text', 'wxml');\n }\n\n _drawWxmlImage (sub, resolve, reject) {\n let imageData = {\n url: sub.dataset.url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n\n let res = this._drawRect(imageData, sub, resolve, reject, 'image', 'inline-wxml');\n\n return res\n }\n\n _drawWxmlCircleImage (sub, resolve, reject) {\n let imageData = {\n url: sub.dataset.url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n sub.r = sub.width / 2;\n\n this._drawCircle(imageData, sub, resolve, reject, true, 'wxml');\n }\n\n _drawWxmlBackgroundImage (sub, resolve, reject) {\n let url = sub.dataset.url;\n let index = this._findPicIndex(url);\n url = index > -1 ? this.allPic[index].local : url;\n let size = sub.backgroundSize.replace(/px/g, '').split(' ');\n\n let imageData = {\n url: url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n\n this._drawRect(imageData, sub, resolve, reject, 'image', 'wxml');\n }\n\n _getWxml (item, style) {\n let self = this;\n let query;\n if(this.obj) {\n query = wx.createSelectorQuery().in(this.obj);\n }else {\n query = wx.createSelectorQuery();\n }\n\n let p1 = new Promise((resolve, reject) => {\n // 会触发两次,要限制\n let count = 0;\n query.selectAll(`${item.class}`).fields({\n dataset: true,\n size: true,\n rect: true,\n computedStyle: ['width', 'height', 'font', 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'textAlign', \n 'color', 'lineHeight', 'border', 'borderColor', 'borderStyle', 'borderWidth', 'verticalAlign', 'boxShadow',\n 'background', 'backgroundColor', 'backgroundImage', 'backgroundPosition', 'backgroundSize', 'paddingLeft', 'paddingTop',\n 'paddingRight', 'paddingBottom'\n ]\n }, (res) => {\n if(count++ === 0) {\n let formated = self._formatImage(res);\n let list = formated.list;\n res = formated.res;\n\n self._preloadImage(list).then(result => {\n resolve(res);\n }).catch((res) => {\n reject && reject({ errcode: 1009, errmsg: 'drawWxml preLoadImage error' });\n });\n }\n }).exec();\n });\n\n let p2 = new Promise((resolve, reject) => {\n if (!item.limit) {\n resolve({ top: 0, width: self.width / self.zoom });\n }\n\n query.select(`${item.limit}`).fields({\n dataset: true,\n size: true,\n rect: true,\n }, (res) => {\n resolve(res);\n }).exec();\n });\n\n return Promise.all([p1, p2]);\n }\n\n _getLineHeight (style) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n let lineHeight;\n if(!isNaN(style.lineHeight) && style.lineHeight > style.fontSize) {\n lineHeight = style.lineHeight;\n }else {\n style.lineHeight = (style.lineHeight || '') + '';\n lineHeight = +style.lineHeight.replace('px', '');\n lineHeight = lineHeight ? lineHeight : (style.fontSize || 14) * 1.2;\n }\n return lineHeight * zoom;\n }\n\n _formatImage (res = []) {\n let list = [];\n res.forEach((item, index) => {\n let dataset = item.dataset;\n let uid = Util.getUid();\n let filename = `${wx.env.USER_DATA_PATH}/${uid}.png`;\n if ((dataset.type === \"image\" || dataset.type === \"radius-image\") && dataset.url) {\n let sub = {\n url: dataset.base64 ? filename : dataset.url,\n isBase64: dataset.base64 ? dataset.url : false\n }\n\n res[index].dataset = Object.assign(res[index].dataset, sub);\n list.push(sub)\n } else if (dataset.type === 'background-image' && item.backgroundImage.indexOf('url') > -1) {\n let url = item.backgroundImage.replace(/url\\((\\\"|\\')?/, '').replace(/(\\\"|\\')?\\)$/, '');\n let sub = {\n url: dataset.base64 ? filename : url,\n isBase64: dataset.base64 ? url : false\n }\n res[index].dataset = Object.assign(res[index].dataset, sub);\n list.push(sub)\n }\n });\n\n return { list, res };\n }\n\n _updateProgress (distance) {\n this.progressPercent += distance;\n this.progress(this.progressPercent);\n }\n\n _sortListByTop (list = []) {\n let sorted = {};\n\n // 粗略地认为2px相差的元素在同一行\n list.forEach((item, index) => {\n let top = item.top;\n if (!sorted[top]) {\n if (sorted[top - 2]) {\n top = top - 2;\n }else if (sorted[top - 1]) {\n top = top - 1;\n } else if (sorted[top + 1]) {\n top = top + 1;\n } else if (sorted[top + 2]) {\n top = top + 2;\n } else {\n sorted[top] = [];\n }\n }\n sorted[top].push(item);\n });\n\n return sorted;\n }\n\n _parseNumber (number) {\n return isNaN(number) ? +(number || '').replace('px', '') : number;\n }\n\n _transferWxmlStyle (sub, item, limitLeft, limitTop) {\n let leftFix = (+sub.dataset.left || 0);\n let topFix = (+sub.dataset.top || 0);\n\n sub.width = this._parseNumber(sub.width);\n sub.height = this._parseNumber(sub.height);\n sub.left = this._parseNumber(sub.left) - limitLeft + (leftFix + (item.x || 0)) * this.zoom;\n sub.top = this._parseNumber(sub.top) - limitTop + (topFix + (item.y || 0)) * this.zoom;\n\n let padding = sub.dataset.padding || '0 0 0 0';\n if (typeof padding === 'string') {\n padding = Util.transferPadding(padding);\n }\n let paddingTop = Number(sub.paddingTop.replace('px', '')) + Number(padding[0]);\n let paddingRight = Number(sub.paddingRight.replace('px', '')) + Number(padding[1]);\n let paddingBottom = Number(sub.paddingBottom.replace('px', '')) + Number(padding[2]);\n let paddingLeft = Number(sub.paddingLeft.replace('px', '')) + Number(padding[3]);\n sub.padding = [paddingTop, paddingRight, paddingBottom, paddingLeft];\n \n return sub;\n }\n\n /**\n * 支持负值绘制,从右边计算\n * @param {*} item \n * @param {*} style \n */\n _resetPositionX (item, style) {\n let zoom = this.zoom;\n let x = 0;\n\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n // 通过wxml获取的不需要重置坐标\n if (item.x < 0 && item.type) {\n x = this.width + item.x * zoom - style.width * zoom;\n } else {\n x = item.x * zoom;\n }\n\n if (parseInt(style.borderWidth)) {\n x += parseInt(style.borderWidth)\n }\n\n return x + this.translateX;\n }\n\n /**\n * 支持负值绘制,从底部计算\n * @param {*} item \n * @param {*} style \n */\n _resetPositionY (item, style, textHeight) {\n let zoom = this.zoom;\n let y = 0;\n\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n if (item.y < 0) {\n y = this.height + item.y * zoom - (textHeight ? textHeight : style.height * zoom)\n } else {\n y = item.y * zoom;\n }\n\n if (parseInt(style.borderWidth)) {\n y += parseInt(style.borderWidth)\n }\n \n return y + this.translateY;\n }\n\n /**\n * 文字的padding、text-align\n * @param {*} item \n * @param {*} style \n * @param {*} textWidth\n */\n _resetTextPositionX (item, style, textWidth, width) {\n let textAlign = style.textAlign || 'left';\n let x = item.x;\n if (textAlign === 'center') {\n x = (width - textWidth) / 2 + item.x;\n } else if (textAlign === 'right') {\n x = width - textWidth + item.x;\n }\n\n let left = style.padding ? (style.padding[3] || 0) : 0;\n\n return x + left + this.translateX;\n }\n\n /**\n * 文字的padding、text-align\n * @param {*} item \n * @param {*} style \n * @param {*} textWidth\n */\n _resetTextPositionY (item, style, lineNum = 0) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n let lineHeight = this._getLineHeight(style);\n let fontSize = Math.ceil((style.fontSize || 14) * zoom)\n\n let blockLineHeightFix = (style.dataset && style.dataset.type || '').indexOf('inline') > -1 ? 0 : (lineHeight - fontSize) / 2\n\n let top = style.padding ? (style.padding[0] || 0) : 0;\n\n // y + lineheight偏移 + 行数 + paddingTop + 整体画布位移\n return item.y + blockLineHeightFix + lineNum * lineHeight + top + this.translateY;\n }\n\n /**\n * 当文本超过宽度时,计算每一行应该绘制的文本\n * @param {*} text \n * @param {*} width \n * @param {*} singleLength \n * @param {*} currentIndex \n * @param {*} widthOffset\n */\n _getTextSingleLine(text, width, singleLength, currentIndex = 0, widthOffset = 0) {\n let offset = 0;\n let endIndex = currentIndex + singleLength + offset;\n let single = text.substring(currentIndex, endIndex);\n let singleWidth = this.measureWidth(single);\n\n while (Math.round(widthOffset + singleWidth) > width) {\n offset--;\n endIndex = currentIndex + singleLength + offset;\n single = text.substring(currentIndex, endIndex);\n singleWidth = this.measureWidth(single);\n }\n\n return {\n endIndex, \n single, \n singleWidth\n }\n }\n\n _drawBorder (border, style, callback) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n border = Util.transferBorder(border);\n\n if (border && border.width) {\n // 空白阴影,清空掉边框的阴影\n this._drawBoxShadow();\n if (border) {\n \n this.ctx.setLineWidth(border.width * zoom);\n\n if (border.style === 'dashed') {\n let dash = style.dash || [5, 5, 0];\n let offset = dash[2] || 0;\n let array = [dash[0] || 5, dash[1] || 5];\n this.ctx.setLineDash(array, offset);\n }\n this.ctx.setStrokeStyle(border.color);\n }\n callback && callback(border);\n }\n } \n\n _drawBoxShadow (boxShadow, callback) {\n boxShadow = Util.transferBoxShadow(boxShadow);\n if (boxShadow) {\n this.ctx.setShadow(boxShadow.offsetX, boxShadow.offsetY, boxShadow.blur, boxShadow.color);\n }else {\n this.ctx.setShadow(0, 0, 0, '#ffffff');\n }\n\n callback && callback(boxShadow || {});\n }\n\n _setFill (fill, callback) {\n if(fill) {\n if (typeof fill === 'string') {\n this.ctx.setFillStyle(fill);\n } else {\n let line = fill.line;\n let color = fill.color;\n let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]);\n grd.addColorStop(0, color[0]);\n grd.addColorStop(1, color[1]);\n this.ctx.setFillStyle(grd);\n }\n callback && callback();\n }\n }\n\n _setStroke (stroke, callback) {\n if(stroke) {\n if (typeof stroke === 'string') {\n this.ctx.setStrokeStyle(stroke);\n } else {\n let line = stroke.line;\n let color = stroke.color;\n let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]);\n grd.addColorStop(0, color[0]);\n grd.addColorStop(1, color[1]);\n this.ctx.setStrokeStyle(grd);\n }\n\n callback && callback();\n }\n }\n}\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = Wxml2Canvas;","/**\n * 获取字符的长度,full为true时,一个汉字算两个长度\n * @param {String} str \n * @param {Boolean} full \n */\n\nfunction getTextLength (str, full) {\n let len = 0;\n for (let i = 0; i < str.length; i++) {\n let c = str.charCodeAt(i);\n //单字节加1 \n if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {\n len++;\n }\n else {\n len += (full ? 2 : 1);\n }\n }\n return len;\n}\n\n/**\n * rgba(255, 255, 255, 1) => #ffffff\n * @param {String} color \n */\nfunction transferColor (color = '') {\n let res = '#';\n color = color.replace(/^rgba?\\(/, '').replace(/\\)$/, '');\n color = color.split(', ');\n \n color.length > 3 ? color.length = 3 : '';\n for(let item of color) {\n item = parseInt(item || 0);\n if(item < 10) {\n res += ('0' + item)\n }else {\n res += (item.toString(16))\n }\n }\n\n return res;\n}\n\nfunction transferBorder (border = '') {\n let res = border.match(/(\\w+)px\\s(\\w+)\\s(.*)/);\n let obj = {};\n\n if(res) {\n obj = {\n width: +res[1],\n style: res[2],\n color: res[3]\n }\n }\n \n return res ? obj : null;\n}\n\n\n/**\n * 内边距,依次为上右下左\n * @param {*} padding \n */\nfunction transferPadding (padding = '0 0 0 0') {\n padding = padding.split(' ');\n for(let i = 0, len = padding.length; i < len; i++) {\n padding[i] = +padding[i].replace('px', '');\n }\n\n return padding;\n}\n/**\n * type1: 0, 25, 17, rgba(0, 0, 0, 0.3)\n * type2: rgba(0, 0, 0, 0.3) 0px 25px 17px 0px => (0, 25, 17, rgba(0, 0, 0, 0.3))\n * @param {*} shadow \n */\nfunction transferBoxShadow(shadow = '', type) {\n if(!shadow || shadow === 'none') return;\n let color;\n let split;\n\n split = shadow.match(/(\\w+)\\s(\\w+)\\s(\\w+)\\s(rgb.*)/);\n\n if (split) {\n split.shift();\n shadow = split;\n color = split[3] || '#ffffff';\n } else {\n split = shadow.split(') ');\n color = split[0] + ')'\n shadow = split[1].split('px ');\n }\n\n return {\n offsetX: +shadow[0] || 0,\n offsetY: +shadow[1] || 0,\n blur: +shadow[2] || 0,\n color\n }\n}\n\nfunction getUid(prefix) {\n prefix = prefix || '';\n\n return (\n prefix +\n 'xxyxxyxx'.replace(/[xy]/g, c => {\n let r = (Math.random() * 16) | 0;\n let v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n })\n );\n}\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = {\n getTextLength,\n transferBorder,\n transferColor,\n transferPadding,\n transferBoxShadow,\n getUid\n};"]} diff --git a/src/components/customTable/README.md b/src/components/customTable/README.md new file mode 100644 index 0000000..22a0fca --- /dev/null +++ b/src/components/customTable/README.md @@ -0,0 +1,160 @@ +# 海报插件 + +## 基于[wxml2canvas](https://github.com/wg-front/wxml2canvas)插件 + +### 插件引入 + +```json +{ + "customPoster": "/components/customPoster/index" +} +``` + +```wxml + +``` + +### 参数示例 + +```js +const data = { + params: { + info: { id: 'circle-note_mp', title: '动态页', desc: '指定动态的页面,mp' }, + body: { + bgImg: + 'https://picsissiok-10049618.cos.ap-shanghai.myqcloud.com/a74018e725861534f1644cff04780f4e_16273677601587.png', + width: '750', + height: '1254', + }, + elements: [ + { + id: 'circle-name', + desc: '圈名称', + type: 1, + text: '治疗讨论', + font: '宋体', + 'font-size': '42', + color: '#FFFFFF', + 'single-line': true, + halign: 'center', + top: '106', + }, + { + id: 'master-name', + desc: '专家名称', + type: 1, + text: '健康小贴士', + font: '宋体', + 'font-size': '38', + color: '#FFFFFF', + 'single-line': true, + halign: 'center', + top: '237', + }, + { + id: 'master-avatar', + desc: '专家头像', + type: 0, + picType: 'avatar', + src: 'https://picsissiok-10049618.cos.ap-shanghai.myqcloud.com/ceb31ac6137e873225b8cc826389a267_16655329078962.jpg', + width: '120', + height: '120', + halign: 'center', + shape: 'circle', + top: '328', + }, + { + id: 'note-content', + desc: '动态内容', + type: 1, + text: '11月5日上海组织进口博览会CIIE大会,邀请大家来我们的展馆现场交流。', + font: '宋体', + 'font-size': '45', + color: '#18191A', + width: '630', + height: '348', + left: '60', + top: '495', + }, + { + id: 'note-title', + desc: '长文标题', + type: 1, + text: '', + font: '宋体', + 'font-size': '42', + color: '#18191A', + width: '659', + height: '116', + left: '46', + top: '495', + 'font-weight': 'bold', + }, + { + id: 'note-summary', + desc: '长文摘要 ', + type: 1, + text: '', + font: '宋体', + 'font-size': '42', + color: '#18191A', + width: '672', + height: '232', + left: '39', + top: '646', + }, + { + id: 'note-more', + desc: '还有', + type: 1, + text: '还有3条精彩附件>', + font: '宋体', + 'font-size': '31', + color: '#666666', + 'single-line': true, + width: '292', + height: '46', + left: '60', + top: '1024', + }, + { + id: 'scanText', + desc: '扫描二维码查看详情', + type: 1, + text: '扫描二维码查看详情', + font: '宋体', + 'font-size': '31', + color: '#666666', + 'single-line': true, + width: '279', + height: '43', + left: '60', + top: '1087', + }, + { + id: 'note-qrcode', + desc: '专家列表的二维码', + type: 0, + picType: 'qrcode', + src: 'https://family.devred.hbraas.com/proxy/mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQHJ8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyUWhDdGhTWVNlTjMxMDAwMDAwN3gAAgSonPxjAwQAAAAA', + width: '130', + height: '130', + left: '554', + top: '1012', + }, + { + id: 'brand', + desc: 'brand×华秉科技', + type: 1, + text: '做企业数字化转型的亲密伙伴×华秉科技', + font: '宋体', + 'font-size': '24', + color: '#B2B3B4', + 'single-line': true, + halign: 'center', + top: '1192', + }, + ], + }, +} +``` diff --git a/src/components/customTable/index.js b/src/components/customTable/index.js new file mode 100644 index 0000000..1246bab --- /dev/null +++ b/src/components/customTable/index.js @@ -0,0 +1,240 @@ +const app = getApp(); +import Wxml2Canvas from "./wxml2canvas/index.js"; // 根据具体路径修改,node_modules会被忽略 + +Component({ + properties: { + params: { + type: Object, + observer(newVal, _olVal) { + if (Object.keys(newVal).length > 0) { + this.drawImage1(); + } + }, + }, + }, + data: { + imageUrl: app.globalData.imageUrl, + imgUrl: "", + width: "626", + height: "980", + imgheight: "", + bgImg: "", + elementsMp: [], + tableData: [ + { + title: "说话", + key: "TalkingScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "间或有点含糊或有鼻音", + }, + { + id: "3", + title: "经常含糊不清或者有鼻音,但是别人还能听懂", + }, + { + id: "4", + title: "别人听不太懂", + }, + ], + }, + { + title: "咀嚼", + key: "ChewScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "咀嚼固体食物会感到疲劳", + }, + { + id: "3", + title: "咀嚼松软食物会感到疲劳", + }, + { + id: "4", + title: "使用喂食管进食,如鼻胃管胃肠管等", + }, + ], + }, + { + title: "吞咽", + key: "SwallowScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "偶尔会噎到", + }, + { + id: "3", + title: "经常会噎到,因而需要改变饮食习惯", + }, + { + id: "4", + title: "使用喂食管进食,如鼻胃管胃肠管等", + }, + ], + }, + { + title: "呼吸", + key: "BreathScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "劳累后感到气促或呼吸不畅", + }, + { + id: "3", + title: "静止时感到气促或呼吸不畅", + }, + { + id: "4", + title: "依赖呼吸机", + }, + ], + }, + { + title: "刷牙梳头能力受损", + key: "BrushTeethAndCombHairScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "需要多费些力气但是不需要停下来", + }, + { + id: "3", + title: "需要停下来休息才能完成", + }, + { + id: "4", + title: "无法自己完成", + }, + ], + }, + { + title: "从椅子上起身能力受损", + key: "GetUpFromChairScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "轻度受损,有时需要用手帮忙", + }, + { + id: "3", + title: "中度受损,总是需要用手帮忙", + }, + { + id: "4", + title: "严重受损,需要他人帮助", + }, + ], + }, + { + title: "复视/重影", + key: "DoubleVisionScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "有,但不是每天", + }, + { + id: "3", + title: "每天,但不是持续一整天", + }, + { + id: "4", + title: "持续有", + }, + ], + }, + { + title: "眼睑下垂", + key: "DroopyEyelidsScore", + list: [ + { + id: "1", + title: "正常", + }, + { + id: "2", + title: "有,但不是每天", + }, + { + id: "3", + title: "每天,但不是持续一整天", + }, + { + id: "4", + title: "持续有", + }, + ], + }, + ], + }, + lifetimes: { + attached() {}, + }, + methods: { + drawImage1() { + let self = this; + // destZoom: 10, + this.drawImage1 = new Wxml2Canvas({ + obj: self, + width: this.data.width, // 宽, 以iphone6为基准,传具体数值,其它机型自动适配 + height: this.data.height, // 高 + element: "canvas1", + background: "#ffffff", + progress(_percent) {}, + finish(url) { + self.setData({ + imgUrl: url, + }); + self.triggerEvent("finish", url); + }, + error(_res) {}, + }); + + let data = { + list: [ + { + type: "wxml", + class: "#canvas-bill-body-mp .draw_canvas", + limit: "#canvas-bill-body-mp", + x: 0, + y: 0, + }, + ], + }; + + this.drawImage1.draw(data); + }, + }, +}); diff --git a/src/components/customTable/index.json b/src/components/customTable/index.json new file mode 100644 index 0000000..3dae481 --- /dev/null +++ b/src/components/customTable/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} diff --git a/src/components/customTable/index.scss b/src/components/customTable/index.scss new file mode 100644 index 0000000..4ec1821 --- /dev/null +++ b/src/components/customTable/index.scss @@ -0,0 +1,141 @@ +.canvas-box { + position: fixed; + left: 1000000rpx; + top: -1000000rpx; +} +.canvas-body { + background-position: center; + background-repeat: no-repeat; + background-size: cover; + background-color: #fff; + .detail { + width: 622rpx; + border: 1rpx solid rgba(0, 0, 0, 0.1); + background-color: rgba(0, 0, 0, 0.08); + .d-header { + display: flex; + height: 40rpx; + .none { + flex-shrink: 0; + width: 150rpx; + background-color: rgba(228, 228, 228, 1); + } + .bar { + flex: 1; + display: flex; + .num-normal { + width: 64rpx; + text-align: center; + font-size: 24rpx; + color: #fff; + line-height: 40rpx; + } + .num { + flex: 1; + text-align: center; + font-size: 24rpx; + color: #fff; + line-height: 40rpx; + } + } + } + .d-body { + display: flex; + .d-aside { + width: 28rpx; + flex-shrink: 0; + .da-item { + text-align: center; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + line-height: 1; + background-color: #e5e5e5; + } + .da-item1 { + padding-top: 150rpx; + display: flex; + height: 200rpx; + margin-bottom: 1px; + } + .da-item2 { + padding-top: 43rpx; + height: 75rpx; + margin-bottom: 1px; + } + .da-item3 { + padding-top: 100rpx; + height: 135rpx; + margin-bottom: 1px; + } + .da-item4 { + padding-top: 100rpx; + height: 135rpx; + } + } + .d-container { + flex: 1; + .dc-row { + display: flex; + height: 117rpx; + line-height: 24rpx; + margin-bottom: 1px; + .dc-title { + padding: 12rpx 12rpx 0; + width: 100rpx; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + } + .dc-sub-title { + width: 64rpx; + text-align: center; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + padding: 12rpx 0; + margin-left: 1px; + } + .dc-col { + margin-left: 1px; + padding: 12rpx; + flex: 1; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + } + .active { + color: #fff !important; + background-color: rgba(207, 83, 117, 1) !important; + } + } + .dc-row:nth-of-type(2n-1) { + .dc-title { + background-color: #f6f6f6; + } + .dc-sub-title { + background-color: #f6f6f6; + } + .dc-col { + background-color: #f6f6f6; + } + } + .dc-row:nth-of-type(2n-2) { + .dc-title { + background-color: #fff; + } + .dc-sub-title { + background-color: #fff; + } + .dc-col { + background-color: #fff; + } + } + } + } + } +} + +.canvas-bill { + position: fixed; + width: 750rpx; + left: 1000000rpx; + top: -1000000rpx; + visibility: hidden; +} diff --git a/src/components/customTable/index.wxml b/src/components/customTable/index.wxml new file mode 100644 index 0000000..9fde26d --- /dev/null +++ b/src/components/customTable/index.wxml @@ -0,0 +1,55 @@ + + + + + + + 0分 + 1分 + 2分 + 3分 + + + + + 延髓 + 呼吸 + 四肢 + 眼肌 + + + + {{item.title}} + + + {{lItem.title}} + + + + + + + + + + + + + diff --git a/src/components/customTable/wxml2canvas/README.md b/src/components/customTable/wxml2canvas/README.md new file mode 100644 index 0000000..e69de29 diff --git a/src/components/customTable/wxml2canvas/index.js b/src/components/customTable/wxml2canvas/index.js new file mode 100644 index 0000000..88e188b --- /dev/null +++ b/src/components/customTable/wxml2canvas/index.js @@ -0,0 +1,1691 @@ +module.exports = (function () { + var __MODS__ = {}; + var __DEFINE__ = function (modId, func, req) { + var m = { exports: {}, _tempexports: {} }; + __MODS__[modId] = { status: 0, func: func, req: req, m: m }; + }; + var __REQUIRE__ = function (modId, source) { + if (!__MODS__[modId]) return require(source); + if (!__MODS__[modId].status) { + var m = __MODS__[modId].m; + m._exports = m._tempexports; + var desp = Object.getOwnPropertyDescriptor(m, "exports"); + if (desp && desp.configurable) + Object.defineProperty(m, "exports", { + set: function (val) { + if (typeof val === "object" && val !== m._exports) { + m._exports.__proto__ = val.__proto__; + Object.keys(val).forEach(function (k) { + m._exports[k] = val[k]; + }); + } + m._tempexports = val; + }, + get: function () { + return m._tempexports; + }, + }); + __MODS__[modId].status = 1; + __MODS__[modId].func(__MODS__[modId].req, m, m.exports); + } + return __MODS__[modId].m.exports; + }; + var __REQUIRE_WILDCARD__ = function (obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var k in obj) { + if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; + } + } + newObj.default = obj; + return newObj; + } + }; + var __REQUIRE_DEFAULT__ = function (obj) { + return obj && obj.__esModule ? obj.default : obj; + }; + __DEFINE__( + 1685064731946, + function (require, module, exports) { + var __TEMP__ = require("./src/index"); + var Wxml2Canvas = __REQUIRE_DEFAULT__(__TEMP__); + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Wxml2Canvas; + }, + function (modId) { + var map = { "./src/index": 1685064731947 }; + return __REQUIRE__(map[modId], modId); + }, + ); + __DEFINE__( + 1685064731947, + function (require, module, exports) { + var __TEMP__ = require("./util"); + var Util = __REQUIRE_DEFAULT__(__TEMP__); + + const imageMode = [ + "scaleToFill", + "aspectFit", + "aspectFill", + "widthFix", + "top", + "bottom", + "center", + "left", + "right", + "top left", + "top right", + "bottom left", + "bottom right", + ]; + + class Wxml2Canvas { + constructor(options = {}) { + this.device = (wx.getSystemInfoSync && wx.getSystemInfoSync()) || {}; + + if (!options.zoom) { + this.zoom = this.device.windowWidth / 375; + } else { + this.zoom = options.zoom || 1; + } + + this.element = options.element; + this.object = options.obj; + this.width = options.width * this.zoom || 0; + this.height = options.height * this.zoom || 0; + this.destZoom = options.destZoom || 3; + this.destWidth = this.width * this.destZoom; + this.destHeight = this.height * this.destZoom; + this.translateX = options.translateX * this.zoom || 0; + this.translateY = options.translateY * this.zoom || 0; + this.gradientBackground = options.gradientBackground || null; + this.background = options.background || "#ffffff"; + this.finishDraw = options.finish || function finish(params) {}; + this.errorHandler = options.error || function error(params) {}; + this.progress = options.progress || function progress(params) {}; + this.textAlign = options.textAlign || "left"; + this.fullText = options.fullText || false; + this.font = options.font || "14px PingFang SC"; + + this._init(); + } + + draw(data = {}, that) { + let self = this; + this.data = data; + this.fef = that; + + this.progress(10); + this._preloadImage(data.list) + .then((result) => { + this.progress(30); + self._draw(); + }) + .catch((res) => { + self.errorHandler(res); + }); + } + + measureWidth(text, font) { + if (font) { + this.ctx.font = font; + } + let res = this.ctx.measureText(text) || {}; + return res.width || 0; + } + + _init() { + this.progressPercent = 0; // 绘制进度百分比 + this.data = null; + this.ref = null; + this.allPic = []; + this.screenList = []; + this.asyncList = []; + this.imgUrl = ""; + this.progressPercent = 0; + this.distance = 0; + this.progress(0); + + this.ctx = wx.createCanvasContext(this.element, this.object); + this.ctx.font = this.font; + this.ctx.setTextBaseline("top"); + this.ctx.setStrokeStyle("white"); + + this.debug = this.device.platform === "devtools" ? true : false; + + this._drawBakcground(); + } + + _drawBakcground() { + if (this.gradientBackground) { + let line = this.gradientBackground.line || [0, 0, 0, this.height]; + let color = this.gradientBackground.color || ["#fff", "#fff"]; + let style = { fill: { line, color } }; + this._drawRectToCanvas(0, 0, this.width, this.height, style); + } else { + let style = { fill: this.background }; + this._drawRectToCanvas(0, 0, this.width, this.height, style); + } + } + + _draw() { + let self = this; + let list = this.data.list || []; + let index = 0; + let all = []; + let count = 0; + + list.forEach((item) => { + if (item.type === "wxml") { + count += 3; + } else { + count += 1; + } + }); + + this.distance = 60 / (count || 1); // 进度条的间距 + this.progressPercent = 30; + this.asyncList = list.filter((item) => item.delay == true); + list = list.filter((item) => item.delay != true); + drawList(list); + + Promise.all(all) + .then((results) => { + index = 0; + drawList(self.asyncList, true); + + Promise.all(all).then((results) => { + self.progress(90); + self._saveCanvasToImage(); + }); + }) + .catch((e) => { + console.log(e); + self.errorHandler(e); + }); + + function drawList(list = [], noDelay) { + list.forEach((item, i) => { + all[index++] = new Promise((resolve, reject) => { + let attr = item.style; + item.progress = self.distance; + if (noDelay) { + item.delay = 0; + } + if (item.type === "radius-image") { + self._drawCircle(item, attr, resolve, reject, "image"); + } else if (item.type === "text") { + self._drawText(item, attr, resolve, reject); + } else if (item.type === "line") { + self._drawLine(item, attr, resolve, reject); + } else if (item.type === "circle") { + self._drawCircle(item, attr, resolve, reject); + } else if (item.type === "rect") { + self._drawRect(item, attr, resolve, reject); + } else if (item.type === "image") { + self._drawRect(item, attr, resolve, reject, "image"); + } else if (item.type === "wxml") { + self._drawWxml(item, attr, resolve, reject); + } else { + resolve(); + } + }); + }); + } + } + + _saveCanvasToImage() { + let self = this; + + // 延时保存有两个原因,一个是等待绘制delay的元素,另一个是安卓上样式会错乱 + setTimeout( + () => { + self.progress(95); + + let obj = { + x: 0, + y: 0, + width: self.width, + height: self.height, + canvasId: self.element, + success: function (res) { + self.progress(100); + self.imgUrl = res.tempFilePath; + self.finishDraw(self.imgUrl); + }, + fail: function (res) { + self.errorHandler({ errcode: 1000, errmsg: "save canvas error", e: res }); + }, + }; + + if (self.destZoom !== 3) { + obj.destWidth = self.destWidth; + obj.destHeight = self.destHeight; + } + + wx.canvasToTempFilePath(obj, self.object); + }, + self.device.system.indexOf("iOS") === -1 ? 300 : 100, + ); + } + + _preloadImage(list = []) { + let self = this; + let all = []; + let count = 0; + + list.forEach((item, i) => { + if (item.url && self._findPicIndex(item.url) === -1) { + // 避免重复下载同一图片 + self.allPic.push({ + url: item.url, + local: "", + }); + all[count++] = new Promise((resolve, reject) => { + // 非http(s)域名的就不下载了 + if ( + !/^http/.test(item.url) || + /^http:\/\/(tmp)|(usr)\//.test(item.url) || + /^http:\/\/127\.0\.0\.1/.test(item.url) + ) { + if (item.isBase64) { + let fileManager = wx.getFileSystemManager(); + + fileManager.writeFile({ + filePath: item.url, + data: item.isBase64.replace(/data:image\/(.*);base64,/, ""), + encoding: "base64", + success(res) { + imageInfo(item.url); + }, + fail(res) { + reject(res); + }, + }); + } else { + imageInfo(item.url); + } + + function imageInfo(url) { + wx.getImageInfo({ + src: url, + success(res) { + let index = self._findPicIndex(url); + if (index > -1) { + self.allPic[index].local = url; + self.allPic[index].width = res.width; + self.allPic[index].height = res.height; + } + resolve({ tempFilePath: url }); + }, + fail(res) { + reject(res); + }, + }); + } + } else { + wx.downloadFile({ + url: item.url.replace(/^https?/, "https"), + success: function (res) { + wx.getImageInfo({ + src: res.tempFilePath, + success(img) { + let index = self._findPicIndex(item.url); + if (index > -1) { + self.allPic[index].local = res.tempFilePath; + self.allPic[index].width = img.width; + self.allPic[index].height = img.height; + } + resolve(res); + }, + fail(res) { + reject(res); + }, + }); + }, + fail: (res) => { + reject({ errcode: 1001, errmsg: "download pic error" }); + }, + }); + } + }); + } + }); + + return Promise.all(all) + .then((results) => { + return new Promise((resolve) => { + resolve(); + }); + }) + .catch((results) => { + return new Promise((resolve, reject) => { + reject(results); + }); + }); + } + + _findPicIndex(url) { + let index = this.allPic.findIndex((pic) => pic.url === url); + return index; + } + + _drawRect(item, style, resolve, reject, isImage, isWxml) { + let zoom = this.zoom; + let leftOffset = 0; + let topOffset = 0; + let width = style.width; + let height = style.height; + let imgWidth = style.width; + let imgHeight = style.height; + let mode = null; + + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + + let url; + if (isImage) { + let index = this._findPicIndex(item.url); + if (index > -1) { + url = this.allPic[index].local; + imgWidth = this.allPic[index].width; + imgHeight = this.allPic[index].height; + } else { + url = item.url; + } + } + + style.padding = style.padding || []; + if (isWxml === "inline-wxml") { + item.x = item.x + ((style.padding[3] && style.padding[3]) || 0); + item.y = item.y + ((style.padding[0] && style.padding[0]) || 0); + } + + leftOffset = item.x + style.width + ((style.padding[1] && style.padding[1]) || 0); + + if (!isWxml) { + width = width * zoom; + height = height * zoom; + } + + if (style.dataset && style.dataset.mode && imageMode.indexOf(style.dataset.mode) > -1) { + mode = { + type: style.dataset.mode, + width: imgWidth, + height: imgHeight, + }; + } + + this._drawRectToCanvas(item.x, item.y, width, height, style, url, mode); + this._updateProgress(item.progress); + + if (resolve) { + resolve(); + } else { + return { + leftOffset, + topOffset, + }; + } + } catch (e) { + reject && + reject({ errcode: isImage ? 1003 : 1002, errmsg: isImage ? "drawImage error" : "drawRect error", e }); + } + } + + _drawRectToCanvas(x, y, width, height, style, url, mode) { + let { fill, border, boxShadow } = style; + this.ctx.save(); + this._drawBoxShadow(boxShadow, (res) => { + // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影 + if (fill && typeof fill !== "string" && !this.debug) { + this.ctx.setFillStyle(res.color || "#ffffff"); + this.ctx.fillRect(x, y, width, height); + } + }); + + if (url) { + // 开发者工具有bug,先不裁剪 + if (mode) { + this._resetImageByMode(url, x, y, width, height, mode); + } else { + this.ctx.drawImage(url, x, y, width, height); + } + } else { + this._setFill(fill, () => { + this.ctx.fillRect(x, y, width, height); + }); + } + + this._drawBorder(border, style, (border) => { + let fixBorder = border.width; + this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder); + }); + + this.ctx.draw(true); + this.ctx.restore(); + } + + _resetImageByMode(url, x, y, width, height, mode) { + let self = this; + let offsetX = 0; + let offsetY = 0; + let imgWidth = mode.width; + let imgHeight = mode.height; + + switch (mode.type) { + case "scaleToFill": + imgWidth = width; + imgHeight = height; + self.ctx.drawImage(url, x, y, width, height); + break; + case "widthFix": + height = width / ((imgWidth || 1) / (imgHeight || 1)); + self.ctx.drawImage(url, x, y, width, height); + break; + case "aspectFit": + if (imgWidth > imgHeight) { + let realHeight = width / ((imgWidth || 1) / (imgHeight || 1)); + offsetY = -(height - realHeight) / 2; + imgWidth = width; + imgHeight = realHeight; + } else { + let realWidth = height / ((imgHeight || 1) / (imgWidth || 1)); + offsetX = -(width - realWidth) / 2; + imgWidth = realWidth; + imgHeight = height; + } + + _clip(); + break; + case "aspectFill": + if (imgWidth > imgHeight) { + let realWidth = imgWidth / ((imgHeight || 1) / (height || 1)); + offsetX = (realWidth - width) / 2; + imgWidth = realWidth; + imgHeight = height; + } else { + let realHeight = imgHeight / ((imgWidth || 1) / (width || 1)); + offsetY = (realHeight - height) / 2; + imgWidth = width; + imgHeight = realHeight; + } + + _clip(); + break; + case "top left": + _clip(); + break; + case "top": + offsetX = (mode.width - width) / 2; + _clip(); + break; + case "top right": + offsetX = mode.width - width; + _clip(); + break; + case "left": + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "center": + offsetX = (mode.width - width) / 2; + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "right": + offsetX = mode.width - width; + offsetY = (mode.height - height) / 2; + _clip(); + break; + case "bottom left": + offsetY = mode.height - height; + _clip(); + break; + case "bottom": + offsetX = (mode.width - width) / 2; + offsetY = mode.height - height; + _clip(); + break; + case "bottom right": + offsetX = mode.width - width; + offsetY = mode.height - height; + _clip(); + break; + default: + imgWidth = width; + imgHeight = height; + break; + } + + function _clip() { + self.ctx.save(); + self.ctx.beginPath(); + self.ctx.rect(x, y, width, height); + self.ctx.clip(); + self.ctx.drawImage(url, x - offsetX, y - offsetY, imgWidth, imgHeight); + self.ctx.closePath(); + self.ctx.restore(); + } + } + + _drawText(item, style, resolve, reject, type, isWxml) { + let zoom = this.zoom; + let leftOffset = 0; + let topOffset = 0; + + try { + style.fontSize = this._parseNumber(style.fontSize); + let fontSize = Math.ceil((style.fontSize || 14) * zoom); + this.ctx.setTextBaseline("top"); + this.ctx.font = `${style.fontWeight ? style.fontWeight : "normal"} ${fontSize}px ${ + style.fontFamily || "PingFang SC" + }`; + this.ctx.setFillStyle(style.color || "#454545"); + + let text = item.text || ""; + let textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font)); + let lineHeight = this._getLineHeight(style); + let textHeight = Math.ceil(textWidth / (style.width || textWidth)) * lineHeight; + let width = Math.ceil((style.width || textWidth) * (!isWxml ? zoom : 1)); + let whiteSpace = style.whiteSpace || "wrap"; + let x = 0; + let y = 0; + + if (typeof style.padding === "string") { + style.padding = Util.transferPadding(style.padding); + } + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style, textHeight); + this._drawBoxShadow(style.boxShadow); + + if (style.background || style.border) { + this._drawTextBackgroud(item, style, textWidth, textHeight, isWxml); + } + + // 行内文本 + if (type === "inline-text") { + width = item.maxWidth; + if (item.leftOffset + textWidth > width) { + // 如果上一个行内元素换行了,这个元素要继续在后面补足一行 + let lineNum = Math.max(Math.floor(textWidth / width), 1); + let length = text.length; + let singleLength = Math.floor(length / lineNum); + let widthOffset = item.leftOffset ? item.leftOffset - item.originX : 0; + let { + endIndex: currentIndex, + single, + singleWidth, + } = this._getTextSingleLine(text, width, singleLength, 0, widthOffset); + x = this._resetTextPositionX(item, style, singleWidth); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(single, x, y); + leftOffset = x + singleWidth; + topOffset = y; + + // 去除第一行补的内容,然后重置 + text = text.substring(currentIndex, text.length); + currentIndex = 0; + lineNum = Math.max(Math.floor(textWidth / width), 1); + textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font)); + item.x = item.originX; // 还原换行后的x + for (let i = 0; i < lineNum; i++) { + let { endIndex, single, singleWidth } = this._getTextSingleLine( + text, + width, + singleLength, + currentIndex, + ); + currentIndex = endIndex; + if (single) { + x = this._resetTextPositionX(item, style, singleWidth, width); + y = this._resetTextPositionY(item, style, i + 1); + this.ctx.fillText(single, x, y); + if (i === lineNum - 1) { + leftOffset = x + singleWidth; + topOffset = lineHeight * lineNum; + } + } + } + + let last = text.substring(currentIndex, length); + let lastWidth = this.measureWidth(last); + + if (last) { + x = this._resetTextPositionX(item, style, lastWidth, width); + y = this._resetTextPositionY(item, style, lineNum + 1); + this.ctx.fillText(last, x, y); + leftOffset = x + lastWidth; + topOffset = lineHeight * (lineNum + 1); + } + } else { + x = this._resetTextPositionX(item, style, textWidth, width); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(item.text, x, y); + leftOffset = x + textWidth; + topOffset = lineHeight; + } + } else { + // block文本,如果文本长度超过宽度换行 + if (width && textWidth > width && whiteSpace !== "nowrap") { + let lineNum = Math.max(Math.floor(textWidth / width), 1); + let length = text.length; + let singleLength = Math.floor(length / lineNum); + let currentIndex = 0; + + // lineClamp参数限制最多行数 + if (style.lineClamp && lineNum + 1 > style.lineClamp) { + lineNum = style.lineClamp - 1; + } + + for (let i = 0; i < lineNum; i++) { + let { endIndex, single, singleWidth } = this._getTextSingleLine( + text, + width, + singleLength, + currentIndex, + ); + currentIndex = endIndex; + x = this._resetTextPositionX(item, style, singleWidth, width); + y = this._resetTextPositionY(item, style, i); + this.ctx.fillText(single, x, y); + } + + // 换行后剩余的文字,超过一行则截断增加省略号 + let last = text.substring(currentIndex, length); + let lastWidth = this.measureWidth(last); + if (lastWidth > width) { + let { single, singleWidth } = this._getTextSingleLine(last, width, singleLength); + lastWidth = singleWidth; + last = single.substring(0, single.length - 1) + "..."; + } + + x = this._resetTextPositionX(item, style, lastWidth, width); + y = this._resetTextPositionY(item, style, lineNum); + this.ctx.fillText(last, x, y); + } else { + x = this._resetTextPositionX(item, style, textWidth, width); + y = this._resetTextPositionY(item, style); + this.ctx.fillText(item.text, x, y); + } + } + + this.ctx.draw(true); + + this._updateProgress(item.progress); + + if (resolve) { + resolve(); + } else { + return { + leftOffset, + topOffset, + }; + } + } catch (e) { + reject && reject({ errcode: 1004, errmsg: "drawText error", e: e }); + } + } + + _drawTextBackgroud(item, style, textWidth, textHeight, isWxml) { + if (!style.width) return; + let zoom = isWxml ? 1 : this.zoom; + let width = style.width || textWidth; + let height = style.height || textHeight; + let rectStyle = { + fill: style.background, + border: style.border, + }; + style.padding = style.padding || [0, 0, 0, 0]; + width += (style.padding[1] || 0) + (style.padding[3] || 0); + height += (style.padding[0] || 0) + (style.padding[2] || 0); + width = width * zoom; + height = height * zoom; + this._drawRectToCanvas(item.x, item.y, width, height, rectStyle); + } + + _drawCircle(item, style, resolve, reject, isImage, isWxml) { + let zoom = this.zoom; + let r = style.r; + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + + let url; + if (isImage) { + let index = this._findPicIndex(item.url); + if (index > -1) { + url = this.allPic[index].local; + } else { + url = item.url; + } + } + + if (!isWxml) { + r = r * zoom; + } + + this._drawCircleToCanvas(item.x, item.y, r, style, url); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && + reject({ + errcode: isImage ? 1006 : 1005, + errmsg: isImage ? "drawCircleImage error" : "drawCircle error", + e, + }); + } + } + + _drawCircleToCanvas(x, y, r, style, url) { + let { fill, border, boxShadow } = style; + + this.ctx.save(); + + this._drawBoxShadow(boxShadow, (res) => { + // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影 + if ((fill && typeof fill !== "string") || (url && res.color)) { + this.ctx.setFillStyle(res.color || "#ffffff"); + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.closePath(); + this.ctx.fill(); + } + }); + + if (url) { + this.ctx.save(); + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.clip(); + this.ctx.drawImage(url, x, y, r * 2, r * 2); + this.ctx.closePath(); + this.ctx.restore(); + } else { + this._setFill(fill, () => { + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI); + this.ctx.closePath(); + this.ctx.fill(); + }); + } + + this._drawBorder(border, style, (border) => { + this.ctx.beginPath(); + this.ctx.arc(x + r, y + r, r + border.width / 2, 0, 2 * Math.PI); + this.ctx.stroke(); + this.ctx.closePath(); + }); + + this.ctx.draw(true); + this.ctx.restore(); + } + + _drawLine(item, style, resolve, reject, isWxml) { + let zoom = this.zoom; + try { + let x1 = item.x * zoom + this.translateX; + let y1 = item.y * zoom + this.translateY; + let x2 = item.x2 * zoom + this.translateX; + let y2 = item.y2 * zoom + this.translateY; + this._drawLineToCanvas(x1, y1, x2, y2, style); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && reject({ errcode: 1007, errmsg: "drawLine error", e }); + } + } + + _drawLineToCanvas(x1, y1, x2, y2, style) { + let { stroke, dash, boxShadow } = style; + + this.ctx.save(); + if (stroke) { + this._setStroke(stroke); + } + + this._drawBoxShadow(boxShadow); + + if (dash) { + let dash = [style.dash[0] || 5, style.dash[1] || 5]; + let offset = style.dash[2] || 0; + this.ctx.setLineDash(dash, offset || 0); + } + + this.ctx.moveTo(x1, y1); + this.ctx.setLineWidth((style.width || 1) * this.zoom); + this.ctx.lineTo(x2, y2); + this.ctx.stroke(); + this.ctx.draw(true); + this.ctx.restore(); + } + + // 废弃,合并到_drawRect + _drawImage(item, style, resolve, reject, isWxml) { + let zoom = this.zoom; + try { + item.x = this._resetPositionX(item, style); + item.y = this._resetPositionY(item, style); + item.x = item.x + (style.padding[3] || 0); + item.y = item.y + (style.padding[0] || 0); + + let index = this._findPicIndex(item.url); + let url = index > -1 ? this.allPic[index].local : item.url; + this._drawImageToCanvas(url, item.x, item.y, style.width * zoom, style.height * zoom, style); + + this._updateProgress(item.progress); + resolve && resolve(); + } catch (e) { + reject && reject({ errcode: 1012, errmsg: "drawRect error", e }); + } + } + + // 废弃,合并到_drawRect + _drawImageToCanvas(url, x, y, width, height, style) { + let { fill, border, boxShadow } = style; + this.ctx.save(); + + this._drawBoxShadow(boxShadow); + this.ctx.drawImage(url, x, y, width, height); + + this._drawBorder(border, style, (border) => { + let fixBorder = border.width; + this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder); + }); + this.ctx.draw(true); + this.ctx.restore(); + } + + _drawWxml(item, style, resolve, reject) { + let self = this; + let all = []; + try { + this._getWxml(item, style).then((results) => { + // 上 -> 下 + let sorted = self._sortListByTop(results[0]); + let count = 0; + let progress = 0; + Object.keys(sorted).forEach((item) => { + count += sorted[item].length; + }); + progress = (this.distance * 3) / (count || 1); + + all = this._drawWxmlBlock(item, sorted, all, progress, results[1]); + all = this._drawWxmlInline(item, sorted, all, progress, results[1]); + + Promise.all(all) + .then((results) => { + resolve && resolve(); + }) + .catch((e) => { + reject && reject(e); + }); + }); + } catch (e) { + reject && reject({ errcode: 1008, errmsg: "drawWxml error" }); + } + } + + _drawWxmlBlock(item, sorted, all, progress, results) { + let self = this; + // 用来限定位置范围,取相对位置 + let limitLeft = results ? results.left : 0; + let limitTop = results ? results.top : 0; + Object.keys(sorted).forEach((top, topIndex) => { + // 左 -> 右 + let list = sorted[top].sort((a, b) => { + return a.left - b.left; + }); + + list = list.filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") === -1); + + list.forEach((sub, index) => { + all[index] = new Promise((resolve2, reject2) => { + sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop); + sub.progress = progress; + let type = sub.dataset.type; + if (sub.dataset.delay) { + setTimeout(() => { + drawWxmlItem(); + }, sub.dataset.delay); + } else { + drawWxmlItem(); + } + function drawWxmlItem() { + if (type === "text") { + self._drawWxmlText(sub, resolve2, reject2); + } else if (type === "image") { + self._drawWxmlImage(sub, resolve2, reject2); + } else if (type === "radius-image") { + self._drawWxmlCircleImage(sub, resolve2, reject2); + } else if (type === "background-image") { + self._drawWxmlBackgroundImage(sub, resolve2, reject2); + } + } + }); + }); + }); + + return all; + } + + _drawWxmlInline(item, sorted, all, progress, results) { + let self = this; + let topOffset = 0; + let leftOffset = 0; + let lastTop = 0; + let limitLeft = results ? results.left : 0; + let limitTop = results ? results.top : 0; + let p = new Promise((resolve2, reject2) => { + let maxWidth = 0; + let minLeft = Infinity; + let maxRight = 0; + + // 找出同一top下的最小left和最大right,得到最大的宽度,用于换行 + Object.keys(sorted).forEach((top) => { + let inlineList = sorted[top].filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") > -1); + inlineList.forEach((sub) => { + if (sub.left < minLeft) { + minLeft = sub.left; + } + if (sub.right > maxRight) { + maxRight = sub.right; + } + }); + }); + maxWidth = Math.ceil(maxRight - minLeft || self.width); + + Object.keys(sorted).forEach((top, topIndex) => { + // 左 -> 右 + let list = sorted[top].sort((a, b) => { + return a.left - b.left; + }); + + // 换行的行内元素left放到后面,version2.0.6后无法获取高度,改用bottom值来判断是否换行了 + let position = -1; + for (let i = 0, len = list.length; i < len; i++) { + if (list[i] && list[i + 1]) { + if (list[i].bottom > list[i + 1].bottom) { + position = i; + break; + } + } + } + + if (position > -1) { + list.push(list.splice(position, 1)[0]); + } + + let inlineList = list.filter((sub) => sub.dataset.type && sub.dataset.type.indexOf("inline") > -1); + let originLeft = inlineList[0] ? inlineList[0].left : 0; + // 换行后和top不相等时,认为是换行了,要清除左边距;当左偏移量大于最大宽度时,也要清除左边距; 当左偏移小于左边距时,也要清除 + if ( + Math.abs(topOffset + lastTop - top) > 2 || + leftOffset - originLeft - limitLeft >= maxWidth || + leftOffset <= originLeft - limitLeft - 2 + ) { + leftOffset = 0; + } + + lastTop = +top; + topOffset = 0; + + inlineList.forEach((sub, index) => { + sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop); + sub.progress = progress; + let type = sub.dataset.type; + if (type === "inline-text") { + let drawRes = self._drawWxmlInlineText(sub, leftOffset, maxWidth); + leftOffset = drawRes.leftOffset; + topOffset = drawRes.topOffset; + } else if (type === "inline-image") { + let drawRes = self._drawWxmlImage(sub) || {}; + leftOffset = drawRes.leftOffset || 0; + topOffset = drawRes.topOffset || 0; + } + }); + }); + resolve2(); + }); + + all.push(p); + return all; + } + + _drawWxmlInlineText(sub, leftOffset = 0, maxWidth) { + let text = sub.dataset.text || ""; + if (sub.dataset.maxlength && text.length > sub.dataset.maxlength) { + text = text.substring(0, sub.dataset.maxlength) + "..."; + } + + let textData = { + text, + originX: sub.left, + x: leftOffset ? leftOffset : sub.left, + y: sub.top, + progress: sub.progress, + leftOffset: leftOffset, + maxWidth: maxWidth, // 行内元素的最大宽度,取决于limit的宽度 + }; + + if (sub.backgroundColor !== "rgba(0, 0, 0, 0)") { + sub.background = sub.backgroundColor; + } else { + sub.background = "rgba(0, 0, 0, 0)"; + } + + if (sub.dataset.background) { + sub.background = sub.dataset.background; + } + + let res = this._drawText(textData, sub, null, null, "inline-text", "wxml"); + + return res; + } + + _drawWxmlText(sub, resolve, reject) { + let text = sub.dataset.text || ""; + if (sub.dataset.maxlength && text.length > sub.dataset.maxlength) { + text = text.substring(0, sub.dataset.maxlength) + "..."; + } + + let textData = { + text, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + if (sub.backgroundColor !== "rgba(0, 0, 0, 0)") { + sub.background = sub.backgroundColor; + } else { + sub.background = "rgba(0, 0, 0, 0)"; + } + + if (sub.dataset.background) { + sub.background = sub.dataset.background; + } + + this._drawText(textData, sub, resolve, reject, "text", "wxml"); + } + + _drawWxmlImage(sub, resolve, reject) { + let imageData = { + url: sub.dataset.url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + + let res = this._drawRect(imageData, sub, resolve, reject, "image", "inline-wxml"); + + return res; + } + + _drawWxmlCircleImage(sub, resolve, reject) { + let imageData = { + url: sub.dataset.url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + sub.r = sub.width / 2; + + this._drawCircle(imageData, sub, resolve, reject, true, "wxml"); + } + + _drawWxmlBackgroundImage(sub, resolve, reject) { + let url = sub.dataset.url; + let index = this._findPicIndex(url); + url = index > -1 ? this.allPic[index].local : url; + let size = sub.backgroundSize.replace(/px/g, "").split(" "); + + let imageData = { + url: url, + x: sub.left, + y: sub.top, + progress: sub.progress, + }; + + this._drawRect(imageData, sub, resolve, reject, "image", "wxml"); + } + + _getWxml(item, style) { + let self = this; + let query; + // if (this.obj) { + // query = wx.createSelectorQuery().in(this.obj); + // } else { + // query = wx.createSelectorQuery(); + // } + if (this.object) { + query = wx.createSelectorQuery().in(this.object); + } else { + query = wx.createSelectorQuery(); + } + + let p1 = new Promise((resolve, reject) => { + // 会触发两次,要限制 + let count = 0; + query + .selectAll(`${item.class}`) + .fields( + { + dataset: true, + size: true, + rect: true, + computedStyle: [ + "width", + "height", + "font", + "fontSize", + "fontFamily", + "fontWeight", + "fontStyle", + "textAlign", + "color", + "lineHeight", + "border", + "borderColor", + "borderStyle", + "borderWidth", + "verticalAlign", + "boxShadow", + "background", + "backgroundColor", + "backgroundImage", + "backgroundPosition", + "backgroundSize", + "paddingLeft", + "paddingTop", + "paddingRight", + "paddingBottom", + ], + }, + (res) => { + if (count++ === 0) { + let formated = self._formatImage(res); + let list = formated.list; + res = formated.res; + + self + ._preloadImage(list) + .then((result) => { + resolve(res); + }) + .catch((res) => { + reject && reject({ errcode: 1009, errmsg: "drawWxml preLoadImage error" }); + }); + } + }, + ) + .exec(); + }); + + let p2 = new Promise((resolve, reject) => { + if (!item.limit) { + resolve({ top: 0, width: self.width / self.zoom }); + } + + query + .select(`${item.limit}`) + .fields( + { + dataset: true, + size: true, + rect: true, + }, + (res) => { + resolve(res); + }, + ) + .exec(); + }); + + return Promise.all([p1, p2]); + } + + _getLineHeight(style) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + let lineHeight; + if (!isNaN(style.lineHeight) && style.lineHeight > style.fontSize) { + lineHeight = style.lineHeight; + } else { + style.lineHeight = (style.lineHeight || "") + ""; + lineHeight = +style.lineHeight.replace("px", ""); + lineHeight = lineHeight ? lineHeight : (style.fontSize || 14) * 1.2; + } + return lineHeight * zoom; + } + + _formatImage(res = []) { + let list = []; + res.forEach((item, index) => { + let dataset = item.dataset; + let uid = Util.getUid(); + let filename = `${wx.env.USER_DATA_PATH}/${uid}.png`; + if ((dataset.type === "image" || dataset.type === "radius-image") && dataset.url) { + let sub = { + url: dataset.base64 ? filename : dataset.url, + isBase64: dataset.base64 ? dataset.url : false, + }; + + res[index].dataset = Object.assign(res[index].dataset, sub); + list.push(sub); + } else if (dataset.type === "background-image" && item.backgroundImage.indexOf("url") > -1) { + let url = item.backgroundImage.replace(/url\((\"|\')?/, "").replace(/(\"|\')?\)$/, ""); + let sub = { + url: dataset.base64 ? filename : url, + isBase64: dataset.base64 ? url : false, + }; + res[index].dataset = Object.assign(res[index].dataset, sub); + list.push(sub); + } + }); + + return { list, res }; + } + + _updateProgress(distance) { + this.progressPercent += distance; + this.progress(this.progressPercent); + } + + _sortListByTop(list = []) { + let sorted = {}; + + // 粗略地认为2px相差的元素在同一行 + list.forEach((item, index) => { + let top = item.top; + if (!sorted[top]) { + if (sorted[top - 2]) { + top = top - 2; + } else if (sorted[top - 1]) { + top = top - 1; + } else if (sorted[top + 1]) { + top = top + 1; + } else if (sorted[top + 2]) { + top = top + 2; + } else { + sorted[top] = []; + } + } + sorted[top].push(item); + }); + + return sorted; + } + + _parseNumber(number) { + return isNaN(number) ? +(number || "").replace("px", "") : number; + } + + _transferWxmlStyle(sub, item, limitLeft, limitTop) { + let leftFix = +sub.dataset.left || 0; + let topFix = +sub.dataset.top || 0; + + sub.width = this._parseNumber(sub.width); + sub.height = this._parseNumber(sub.height); + sub.left = this._parseNumber(sub.left) - limitLeft + (leftFix + (item.x || 0)) * this.zoom; + sub.top = this._parseNumber(sub.top) - limitTop + (topFix + (item.y || 0)) * this.zoom; + + let padding = sub.dataset.padding || "0 0 0 0"; + if (typeof padding === "string") { + padding = Util.transferPadding(padding); + } + let paddingTop = Number(sub.paddingTop.replace("px", "")) + Number(padding[0]); + let paddingRight = Number(sub.paddingRight.replace("px", "")) + Number(padding[1]); + let paddingBottom = Number(sub.paddingBottom.replace("px", "")) + Number(padding[2]); + let paddingLeft = Number(sub.paddingLeft.replace("px", "")) + Number(padding[3]); + sub.padding = [paddingTop, paddingRight, paddingBottom, paddingLeft]; + + return sub; + } + + /** + * 支持负值绘制,从右边计算 + * @param {*} item + * @param {*} style + */ + _resetPositionX(item, style) { + let zoom = this.zoom; + let x = 0; + + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + // 通过wxml获取的不需要重置坐标 + if (item.x < 0 && item.type) { + x = this.width + item.x * zoom - style.width * zoom; + } else { + x = item.x * zoom; + } + + if (parseInt(style.borderWidth)) { + x += parseInt(style.borderWidth); + } + + return x + this.translateX; + } + + /** + * 支持负值绘制,从底部计算 + * @param {*} item + * @param {*} style + */ + _resetPositionY(item, style, textHeight) { + let zoom = this.zoom; + let y = 0; + + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + if (item.y < 0) { + y = this.height + item.y * zoom - (textHeight ? textHeight : style.height * zoom); + } else { + y = item.y * zoom; + } + + if (parseInt(style.borderWidth)) { + y += parseInt(style.borderWidth); + } + + return y + this.translateY; + } + + /** + * 文字的padding、text-align + * @param {*} item + * @param {*} style + * @param {*} textWidth + */ + _resetTextPositionX(item, style, textWidth, width) { + let textAlign = style.textAlign || "left"; + let x = item.x; + if (textAlign === "center") { + x = (width - textWidth) / 2 + item.x; + } else if (textAlign === "right") { + x = width - textWidth + item.x; + } + + let left = style.padding ? style.padding[3] || 0 : 0; + + return x + left + this.translateX; + } + + /** + * 文字的padding、text-align + * @param {*} item + * @param {*} style + * @param {*} textWidth + */ + _resetTextPositionY(item, style, lineNum = 0) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + + let lineHeight = this._getLineHeight(style); + let fontSize = Math.ceil((style.fontSize || 14) * zoom); + + let blockLineHeightFix = + ((style.dataset && style.dataset.type) || "").indexOf("inline") > -1 ? 0 : (lineHeight - fontSize) / 2; + + let top = style.padding ? style.padding[0] || 0 : 0; + + // y + lineheight偏移 + 行数 + paddingTop + 整体画布位移 + return item.y + blockLineHeightFix + lineNum * lineHeight + top + this.translateY; + } + + /** + * 当文本超过宽度时,计算每一行应该绘制的文本 + * @param {*} text + * @param {*} width + * @param {*} singleLength + * @param {*} currentIndex + * @param {*} widthOffset + */ + _getTextSingleLine(text, width, singleLength, currentIndex = 0, widthOffset = 0) { + let offset = 0; + let endIndex = currentIndex + singleLength + offset; + let single = text.substring(currentIndex, endIndex); + let singleWidth = this.measureWidth(single); + + while (Math.round(widthOffset + singleWidth) > width) { + offset--; + endIndex = currentIndex + singleLength + offset; + single = text.substring(currentIndex, endIndex); + singleWidth = this.measureWidth(single); + } + + return { + endIndex, + single, + singleWidth, + }; + } + + _drawBorder(border, style, callback) { + let zoom = this.zoom; + if (style.dataset && style.dataset.type) { + zoom = 1; + } + border = Util.transferBorder(border); + + if (border && border.width) { + // 空白阴影,清空掉边框的阴影 + this._drawBoxShadow(); + if (border) { + this.ctx.setLineWidth(border.width * zoom); + + if (border.style === "dashed") { + let dash = style.dash || [5, 5, 0]; + let offset = dash[2] || 0; + let array = [dash[0] || 5, dash[1] || 5]; + this.ctx.setLineDash(array, offset); + } + this.ctx.setStrokeStyle(border.color); + } + callback && callback(border); + } + } + + _drawBoxShadow(boxShadow, callback) { + boxShadow = Util.transferBoxShadow(boxShadow); + if (boxShadow) { + this.ctx.setShadow(boxShadow.offsetX, boxShadow.offsetY, boxShadow.blur, boxShadow.color); + } else { + this.ctx.setShadow(0, 0, 0, "#ffffff"); + } + + callback && callback(boxShadow || {}); + } + + _setFill(fill, callback) { + if (fill) { + if (typeof fill === "string") { + this.ctx.setFillStyle(fill); + } else { + let line = fill.line; + let color = fill.color; + let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]); + grd.addColorStop(0, color[0]); + grd.addColorStop(1, color[1]); + this.ctx.setFillStyle(grd); + } + callback && callback(); + } + } + + _setStroke(stroke, callback) { + if (stroke) { + if (typeof stroke === "string") { + this.ctx.setStrokeStyle(stroke); + } else { + let line = stroke.line; + let color = stroke.color; + let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]); + grd.addColorStop(0, color[0]); + grd.addColorStop(1, color[1]); + this.ctx.setStrokeStyle(grd); + } + + callback && callback(); + } + } + } + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = Wxml2Canvas; + }, + function (modId) { + var map = { "./util": 1685064731948 }; + return __REQUIRE__(map[modId], modId); + }, + ); + __DEFINE__( + 1685064731948, + function (require, module, exports) { + /** + * 获取字符的长度,full为true时,一个汉字算两个长度 + * @param {String} str + * @param {Boolean} full + */ + + function getTextLength(str, full) { + let len = 0; + for (let i = 0; i < str.length; i++) { + let c = str.charCodeAt(i); + //单字节加1 + if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) { + len++; + } else { + len += full ? 2 : 1; + } + } + return len; + } + + /** + * rgba(255, 255, 255, 1) => #ffffff + * @param {String} color + */ + function transferColor(color = "") { + let res = "#"; + color = color.replace(/^rgba?\(/, "").replace(/\)$/, ""); + color = color.split(", "); + + color.length > 3 ? (color.length = 3) : ""; + for (let item of color) { + item = parseInt(item || 0); + if (item < 10) { + res += "0" + item; + } else { + res += item.toString(16); + } + } + + return res; + } + + function transferBorder(border = "") { + let res = border.match(/(\w+)px\s(\w+)\s(.*)/); + let obj = {}; + + if (res) { + obj = { + width: +res[1], + style: res[2], + color: res[3], + }; + } + + return res ? obj : null; + } + + /** + * 内边距,依次为上右下左 + * @param {*} padding + */ + function transferPadding(padding = "0 0 0 0") { + padding = padding.split(" "); + for (let i = 0, len = padding.length; i < len; i++) { + padding[i] = +padding[i].replace("px", ""); + } + + return padding; + } + /** + * type1: 0, 25, 17, rgba(0, 0, 0, 0.3) + * type2: rgba(0, 0, 0, 0.3) 0px 25px 17px 0px => (0, 25, 17, rgba(0, 0, 0, 0.3)) + * @param {*} shadow + */ + function transferBoxShadow(shadow = "", type) { + if (!shadow || shadow === "none") return; + let color; + let split; + + split = shadow.match(/(\w+)\s(\w+)\s(\w+)\s(rgb.*)/); + + if (split) { + split.shift(); + shadow = split; + color = split[3] || "#ffffff"; + } else { + split = shadow.split(") "); + color = split[0] + ")"; + shadow = split[1].split("px "); + } + + return { + offsetX: +shadow[0] || 0, + offsetY: +shadow[1] || 0, + blur: +shadow[2] || 0, + color, + }; + } + + function getUid(prefix) { + prefix = prefix || ""; + + return ( + prefix + + "xxyxxyxx".replace(/[xy]/g, (c) => { + let r = (Math.random() * 16) | 0; + let v = c === "x" ? r : (r & 0x3) | 0x8; + return v.toString(16); + }) + ); + } + + if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = { + getTextLength, + transferBorder, + transferColor, + transferPadding, + transferBoxShadow, + getUid, + }; + }, + function (modId) { + var map = {}; + return __REQUIRE__(map[modId], modId); + }, + ); + return __REQUIRE__(1685064731946); +})(); +//miniprogram-npm-outsideDeps=[] +//# sourceMappingURL=index.js.map diff --git a/src/components/customTable/wxml2canvas/index.js.map b/src/components/customTable/wxml2canvas/index.js.map new file mode 100644 index 0000000..bbbdbec --- /dev/null +++ b/src/components/customTable/wxml2canvas/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js","src/index.js","src/util.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;ACFA;AACA;AACA;AACA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["var __TEMP__ = require('./src/index');var Wxml2Canvas = __REQUIRE_DEFAULT__(__TEMP__);\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = Wxml2Canvas;","var __TEMP__ = require('./util');var Util = __REQUIRE_DEFAULT__(__TEMP__);\n\nconst imageMode = ['scaleToFill', 'aspectFit', 'aspectFill', 'widthFix', 'top', 'bottom', 'center', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right']\n\nclass Wxml2Canvas {\n constructor (options = {}) {\n this.device = wx.getSystemInfoSync && wx.getSystemInfoSync() || {};\n \n if (!options.zoom) {\n this.zoom = this.device.windowWidth / 375;\n } else {\n this.zoom = options.zoom || 1;\n } \n \n this.element = options.element;\n this.object = options.obj;\n this.width = options.width * this.zoom || 0;\n this.height = options.height * this.zoom || 0;\n this.destZoom = options.destZoom || 3;\n this.destWidth = this.width * this.destZoom;\n this.destHeight = this.height * this.destZoom;\n this.translateX = options.translateX * this.zoom || 0;\n this.translateY = options.translateY * this.zoom || 0;\n this.gradientBackground = options.gradientBackground || null;\n this.background = options.background || '#ffffff';\n this.finishDraw = options.finish || function finish(params) {}\n this.errorHandler = options.error || function error(params) {}\n this.progress = options.progress || function progress(params) {}\n this.textAlign = options.textAlign || 'left';\n this.fullText = options.fullText || false;\n this.font = options.font || '14px PingFang SC';\n\n this._init();\n }\n\n draw (data = {}, that) {\n let self = this;\n this.data = data;\n this.fef = that;\n\n this.progress(10);\n this._preloadImage(data.list).then((result) => {\n this.progress(30);\n self._draw();\n }).catch((res) => {\n self.errorHandler(res);\n })\n }\n\n measureWidth (text, font) {\n if(font) {\n this.ctx.font = font;\n }\n let res = this.ctx.measureText(text) || {};\n return res.width || 0;\n }\n\n _init () {\n this.progressPercent = 0; // 绘制进度百分比\n this.data = null;\n this.ref = null;\n this.allPic = [];\n this.screenList = []; \n this.asyncList = [];\n this.imgUrl = '';\n this.progressPercent = 0;\n this.distance = 0;\n this.progress(0);\n\n this.ctx = wx.createCanvasContext(this.element, this.obj);\n this.ctx.font = this.font;\n this.ctx.setTextBaseline('top');\n this.ctx.setStrokeStyle('white');\n\n this.debug = this.device.platform === 'devtools' ? true : false;\n\n this._drawBakcground();\n }\n\n _drawBakcground () {\n if (this.gradientBackground) {\n let line = this.gradientBackground.line || [0, 0, 0, this.height];\n let color = this.gradientBackground.color || ['#fff', '#fff'];\n let style = { fill: { line, color } }\n this._drawRectToCanvas(0, 0, this.width, this.height, style);\n } else {\n let style = { fill: this.background }\n this._drawRectToCanvas(0, 0, this.width, this.height, style);\n }\n }\n\n _draw () {\n let self = this;\n let list = this.data.list || [];\n let index = 0;\n let all = [];\n let count = 0;\n\n list.forEach(item => {\n if(item.type === 'wxml') {\n count += 3;\n } else {\n count += 1;\n }\n })\n\n this.distance = 60 / (count || 1); // 进度条的间距\n this.progressPercent = 30;\n this.asyncList = list.filter( item => item.delay == true );\n list = list.filter( item => item.delay != true );\n drawList(list);\n\n Promise.all(all).then(results => {\n index = 0;\n drawList(self.asyncList, true);\n\n Promise.all(all).then(results => {\n self.progress(90);\n self._saveCanvasToImage();\n });\n }).catch (e => {\n console.log(e)\n self.errorHandler(e);\n });\n\n function drawList(list = [], noDelay) {\n list.forEach((item, i) => {\n all[index++] = new Promise((resolve, reject) => {\n let attr = item.style;\n item.progress = self.distance;\n if (noDelay) {\n item.delay = 0;\n }\n if (item.type === 'radius-image') {\n self._drawCircle(item, attr, resolve, reject, 'image');\n } else if (item.type === 'text') {\n self._drawText(item, attr, resolve, reject);\n } else if (item.type === 'line') {\n self._drawLine(item, attr, resolve, reject);\n } else if (item.type === 'circle') {\n self._drawCircle(item, attr, resolve, reject);\n } else if (item.type === 'rect') {\n self._drawRect(item, attr, resolve, reject);\n } else if (item.type === 'image') {\n self._drawRect(item, attr, resolve, reject, 'image');\n } else if (item.type === 'wxml') {\n self._drawWxml(item, attr, resolve, reject);\n }else {\n resolve();\n }\n });\n });\n }\n }\n\n _saveCanvasToImage () {\n let self = this; \n\n // 延时保存有两个原因,一个是等待绘制delay的元素,另一个是安卓上样式会错乱\n setTimeout(() => {\n self.progress(95);\n\n let obj = {\n x: 0,\n y: 0,\n width: self.width,\n height: self.height,\n canvasId: self.element,\n success: function (res) {\n\n self.progress(100);\n self.imgUrl = res.tempFilePath;\n self.finishDraw(self.imgUrl);\n },\n fail: function (res) {\n\n self.errorHandler({errcode: 1000, errmsg: 'save canvas error', e: res});\n }\n }\n\n if(self.destZoom !== 3) {\n obj.destWidth = self.destWidth;\n obj.destHeight = self.destHeight;\n }\n\n wx.canvasToTempFilePath(obj, self.object);\n }, self.device.system.indexOf('iOS') === -1 ? 300 : 100);\n }\n\n _preloadImage (list = []) {\n let self = this;\n let all = [];\n let count = 0;\n\n list.forEach((item, i) => {\n if (item.url && self._findPicIndex(item.url) === -1) {\n \n // 避免重复下载同一图片\n self.allPic.push({\n url: item.url,\n local: ''\n });\n all[count++] = new Promise((resolve, reject) => {\n // 非http(s)域名的就不下载了\n if (!/^http/.test(item.url) || /^http:\\/\\/(tmp)|(usr)\\//.test(item.url) || /^http:\\/\\/127\\.0\\.0\\.1/.test(item.url)) {\n if(item.isBase64) {\n let fileManager = wx.getFileSystemManager();\n\n fileManager.writeFile({\n filePath: item.url,\n data: item.isBase64.replace(/data:image\\/(.*);base64,/, ''),\n encoding: 'base64',\n success (res) {\n imageInfo(item.url);\n },\n fail (res) {\n reject(res);\n },\n })\n \n }else {\n imageInfo(item.url);\n }\n\n function imageInfo (url) {\n wx.getImageInfo({\n src: url,\n success (res) {\n let index = self._findPicIndex(url);\n if(index > -1) {\n self.allPic[index].local = url;\n self.allPic[index].width = res.width;\n self.allPic[index].height = res.height;\n }\n resolve({ tempFilePath: url });\n }, \n fail (res) {\n reject(res);\n }\n })\n }\n } else {\n wx.downloadFile({\n url: item.url.replace(/^https?/, 'https'),\n success: function (res) {\n wx.getImageInfo({\n src: res.tempFilePath,\n success (img) {\n let index = self._findPicIndex(item.url);\n if (index > -1) {\n self.allPic[index].local = res.tempFilePath;\n self.allPic[index].width = img.width;\n self.allPic[index].height = img.height;\n }\n resolve(res);\n },\n fail (res) {\n reject(res);\n }\n })\n },\n fail: (res) => {\n reject({errcode: 1001, errmsg: 'download pic error'});\n }\n })\n }\n }) \n }\n });\n\n return Promise.all(all).then(results => {\n return new Promise(resolve => { resolve() })\n }).catch((results) => {\n return new Promise((resolve, reject) => { reject(results) })\n })\n }\n\n _findPicIndex (url) {\n let index = this.allPic.findIndex(pic => pic.url === url);\n return index;\n }\n\n _drawRect (item, style, resolve, reject, isImage, isWxml) {\n let zoom = this.zoom;\n let leftOffset = 0;\n let topOffset = 0;\n let width = style.width;\n let height = style.height;\n let imgWidth = style.width;\n let imgHeight = style.height;\n let mode = null;\n\n try {\n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n \n let url;\n if(isImage) {\n let index = this._findPicIndex(item.url);\n if(index > -1) {\n url = this.allPic[index].local\n imgWidth = this.allPic[index].width\n imgHeight = this.allPic[index].height\n }else {\n url = item.url;\n }\n }\n\n style.padding = style.padding || [];\n if(isWxml === 'inline-wxml') {\n item.x = item.x + (style.padding[3] && style.padding[3] || 0)\n item.y = item.y + (style.padding[0] && style.padding[0] || 0)\n }\n\n leftOffset = item.x + style.width + (style.padding[1] && style.padding[1] || 0);\n\n if(!isWxml) {\n width = width * zoom;\n height = height * zoom;\n }\n\n if(style.dataset && style.dataset.mode && imageMode.indexOf(style.dataset.mode) > -1) {\n mode = {\n type: style.dataset.mode,\n width: imgWidth,\n height: imgHeight\n };\n }\n\n this._drawRectToCanvas(item.x, item.y, width, height, style, url, mode);\n this._updateProgress(item.progress);\n\n if(resolve) {\n resolve();\n }else {\n return {\n leftOffset,\n topOffset\n }\n }\n } catch (e) {\n reject && reject({ errcode: (isImage ? 1003 : 1002), errmsg: (isImage ? 'drawImage error' : 'drawRect error'), e });\n }\n }\n\n _drawRectToCanvas (x, y, width, height, style, url, mode) {\n let { fill, border, boxShadow } = style;\n this.ctx.save();\n this._drawBoxShadow(boxShadow, (res) => {\n // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影\n if(fill && typeof fill !== 'string' && !this.debug) {\n this.ctx.setFillStyle(res.color || '#ffffff');\n this.ctx.fillRect(x, y, width, height);\n }\n });\n \n if(url) {\n // 开发者工具有bug,先不裁剪\n if(mode) {\n this._resetImageByMode(url, x, y, width, height, mode);\n }else {\n this.ctx.drawImage(url, x, y, width, height)\n }\n }else {\n this._setFill(fill, () => {\n this.ctx.fillRect(x, y, width, height);\n });\n }\n\n this._drawBorder(border, style, (border) => {\n let fixBorder = border.width;\n this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder);\n });\n\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _resetImageByMode (url, x, y, width, height, mode) {\n let self = this;\n let offsetX = 0;\n let offsetY = 0;\n let imgWidth = mode.width;\n let imgHeight = mode.height;\n\n switch (mode.type) {\n case 'scaleToFill': \n imgWidth = width;\n imgHeight = height;\n self.ctx.drawImage(url, x, y, width, height)\n break;\n case 'widthFix': \n height = width / ((imgWidth || 1) / (imgHeight || 1))\n self.ctx.drawImage(url, x, y, width, height)\n break; \n case 'aspectFit': \n if(imgWidth > imgHeight) {\n let realHeight = width / ((imgWidth || 1) / (imgHeight || 1))\n offsetY = -(height - realHeight) / 2\n imgWidth = width;\n imgHeight = realHeight;\n }else {\n let realWidth = height / ((imgHeight || 1) / (imgWidth || 1))\n offsetX = -(width - realWidth) / 2\n imgWidth = realWidth;\n imgHeight = height;\n }\n\n _clip();\n break;\n case 'aspectFill': \n if(imgWidth > imgHeight) {\n let realWidth = imgWidth / ((imgHeight || 1) / (height || 1))\n offsetX = (realWidth - width) / 2\n imgWidth = realWidth;\n imgHeight = height;\n }else {\n let realHeight = imgHeight / ((imgWidth || 1) / (width || 1))\n offsetY = (realHeight - height) / 2\n imgWidth = width;\n imgHeight = realHeight;\n }\n\n _clip();\n break;\n case 'top left': \n _clip();\n break;\n case 'top': \n offsetX = (mode.width - width) / 2;\n _clip();\n break;\n case 'top right': \n offsetX = (mode.width - width);\n _clip();\n break;\n case 'left': \n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'center': \n offsetX = (mode.width - width) / 2;\n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'right': \n offsetX = (mode.width - width);\n offsetY = (mode.height - height) / 2;\n _clip();\n break;\n case 'bottom left': \n offsetY = (mode.height - height)\n _clip();\n break;\n case 'bottom': \n offsetX = (mode.width - width) / 2;\n offsetY = (mode.height - height)\n _clip();\n break;\n case 'bottom right': \n offsetX = (mode.width - width);\n offsetY = (mode.height - height)\n _clip();\n break;\n default: \n imgWidth = width;\n imgHeight = height;\n break; \n }\n\n function _clip () {\n self.ctx.save();\n self.ctx.beginPath()\n self.ctx.rect(x, y, width, height)\n self.ctx.clip();\n self.ctx.drawImage(url, x - offsetX, y - offsetY, imgWidth, imgHeight)\n self.ctx.closePath();\n self.ctx.restore();\n }\n }\n\n _drawText (item, style, resolve, reject, type, isWxml) {\n let zoom = this.zoom;\n let leftOffset = 0;\n let topOffset = 0;\n\n try {\n style.fontSize = this._parseNumber(style.fontSize);\n let fontSize = Math.ceil((style.fontSize || 14) * zoom)\n this.ctx.setTextBaseline('top');\n this.ctx.font = (`${style.fontWeight ? (style.fontWeight) : 'normal'} ${ fontSize }px ${ style.fontFamily || 'PingFang SC' }`);\n this.ctx.setFillStyle(style.color || '#454545');\n\n let text = item.text || '';\n let textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font));\n let lineHeight = this._getLineHeight(style);\n let textHeight = Math.ceil(textWidth / (style.width || textWidth)) * lineHeight;\n let width = Math.ceil((style.width || textWidth) * (!isWxml ? zoom : 1));\n let whiteSpace = style.whiteSpace || 'wrap';\n let x = 0;\n let y = 0; \n\n if(typeof style.padding === 'string') {\n style.padding = Util.transferPadding(style.padding);\n }\n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style, textHeight);\n this._drawBoxShadow(style.boxShadow);\n\n if(style.background || style.border) {\n this._drawTextBackgroud(item, style, textWidth, textHeight, isWxml);\n }\n \n // 行内文本\n if(type === 'inline-text') {\n width = item.maxWidth;\n if(item.leftOffset + textWidth > width) {\n // 如果上一个行内元素换行了,这个元素要继续在后面补足一行\n let lineNum = Math.max(Math.floor(textWidth / width), 1);\n let length = text.length;\n let singleLength = Math.floor(length / lineNum);\n let widthOffset = item.leftOffset ? item.leftOffset - item.originX : 0;\n let { endIndex: currentIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, 0, widthOffset)\n x = this._resetTextPositionX(item, style, singleWidth);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(single, x, y);\n leftOffset = x + singleWidth;\n topOffset = y;\n\n // 去除第一行补的内容,然后重置\n text = text.substring(currentIndex, text.length);\n currentIndex = 0;\n lineNum = Math.max(Math.floor(textWidth / width), 1);\n textWidth = Math.floor(this.measureWidth(text, style.font || this.ctx.font));\n item.x = item.originX; // 还原换行后的x\n for (let i = 0; i < lineNum; i++) {\n let { endIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, currentIndex);\n currentIndex = endIndex;\n if(single) {\n x = this._resetTextPositionX(item, style, singleWidth, width);\n y = this._resetTextPositionY(item, style, i + 1);\n this.ctx.fillText(single, x, y);\n if(i === lineNum - 1) {\n leftOffset = x + singleWidth;\n topOffset = lineHeight * lineNum;\n }\n }\n }\n\n let last = text.substring(currentIndex, length);\n let lastWidth = this.measureWidth(last);\n\n if(last) {\n x = this._resetTextPositionX(item, style, lastWidth, width);\n y = this._resetTextPositionY(item, style, lineNum + 1);\n this.ctx.fillText(last, x, y);\n leftOffset = x + lastWidth;\n topOffset = lineHeight * (lineNum + 1);\n }\n }else {\n x = this._resetTextPositionX(item, style, textWidth, width);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(item.text, x, y);\n leftOffset = x + textWidth;\n topOffset = lineHeight;\n }\n }else {\n // block文本,如果文本长度超过宽度换行\n if (width && textWidth > width && whiteSpace !== 'nowrap') {\n let lineNum = Math.max(Math.floor(textWidth / width), 1);\n let length = text.length;\n let singleLength = Math.floor(length / lineNum);\n let currentIndex = 0;\n\n // lineClamp参数限制最多行数\n if (style.lineClamp && lineNum + 1 > style.lineClamp) {\n lineNum = style.lineClamp - 1;\n }\n\n for (let i = 0; i < lineNum; i++) {\n let { endIndex, single, singleWidth } = this._getTextSingleLine(text, width, singleLength, currentIndex);\n currentIndex = endIndex;\n x = this._resetTextPositionX(item, style, singleWidth, width);\n y = this._resetTextPositionY(item, style, i);\n this.ctx.fillText(single, x, y);\n\n }\n\n // 换行后剩余的文字,超过一行则截断增加省略号\n let last = text.substring(currentIndex, length);\n let lastWidth = this.measureWidth(last);\n if(lastWidth > width) {\n let { single, singleWidth } = this._getTextSingleLine(last, width, singleLength);\n lastWidth = singleWidth;\n last = single.substring(0, single.length - 1) + '...';\n }\n\n x = this._resetTextPositionX(item, style, lastWidth, width);\n y = this._resetTextPositionY(item, style, lineNum);\n this.ctx.fillText(last, x, y);\n\n }else {\n x = this._resetTextPositionX(item, style, textWidth, width);\n y = this._resetTextPositionY(item, style);\n this.ctx.fillText(item.text, x, y);\n }\n }\n \n this.ctx.draw(true);\n \n this._updateProgress(item.progress);\n\n if(resolve) {\n resolve();\n }else {\n return {\n leftOffset,\n topOffset\n }\n }\n } catch(e) {\n reject && reject({ errcode: 1004, errmsg: 'drawText error', e: e });\n }\n }\n\n _drawTextBackgroud (item, style, textWidth, textHeight, isWxml) {\n if(!style.width) return;\n let zoom = isWxml ? 1 : this.zoom;\n let width = style.width || textWidth;\n let height = style.height || textHeight;\n let rectStyle = {\n fill: style.background,\n border: style.border\n }\n style.padding = style.padding || [0, 0, 0, 0];\n width += (style.padding[1] || 0) + (style.padding[3] || 0);\n height += (style.padding[0] || 0) + (style.padding[2] || 0);\n width = width * zoom\n height = height * zoom\n this._drawRectToCanvas(item.x, item.y, width, height, rectStyle);\n }\n\n _drawCircle (item, style, resolve, reject, isImage, isWxml) {\n let zoom = this.zoom;\n let r = style.r;\n try {\n \n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n\n let url;\n if(isImage) {\n let index = this._findPicIndex(item.url);\n if (index > -1) {\n url = this.allPic[index].local;\n } else {\n url = item.url;\n }\n }\n\n if(!isWxml) {\n r = r * zoom;\n }\n\n this._drawCircleToCanvas(item.x, item.y, r, style, url);\n \n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: (isImage ? 1006 : 1005), errmsg: (isImage ? 'drawCircleImage error' : 'drawCircle error'), e });\n }\n }\n\n _drawCircleToCanvas (x, y, r, style, url) {\n let { fill, border, boxShadow } = style;\n\n this.ctx.save();\n\n this._drawBoxShadow(boxShadow, (res) => {\n // 真机上填充渐变色时,没有阴影,先画个相等大小的纯色矩形来实现阴影\n if((fill && typeof fill !== 'string') || (url && res.color)) {\n this.ctx.setFillStyle(res.color || '#ffffff');\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.closePath();\n this.ctx.fill();\n }\n });\n\n if(url) {\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.clip();\n this.ctx.drawImage(url, x, y, r * 2, r * 2);\n this.ctx.closePath();\n this.ctx.restore();\n }else {\n this._setFill(fill, () => {\n this.ctx.beginPath();\n this.ctx.arc(x + r, y + r, r, 0, 2 * Math.PI);\n this.ctx.closePath();\n this.ctx.fill();\n });\n }\n\n this._drawBorder(border, style, (border) => {\n this.ctx.beginPath()\n this.ctx.arc(x + r, y + r, r + border.width / 2, 0, 2 * Math.PI)\n this.ctx.stroke()\n this.ctx.closePath();\n });\n\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _drawLine (item, style, resolve, reject, isWxml) {\n let zoom = this.zoom;\n try {\n let x1 = item.x * zoom + this.translateX;\n let y1 = item.y * zoom + this.translateY;\n let x2 = item.x2 * zoom + this.translateX;\n let y2 = item.y2 * zoom + this.translateY;\n this._drawLineToCanvas(x1, y1, x2, y2, style);\n\n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: 1007, errmsg: 'drawLine error', e });\n }\n }\n\n _drawLineToCanvas (x1, y1, x2, y2, style) {\n let { stroke, dash, boxShadow } = style;\n\n this.ctx.save();\n if(stroke) {\n this._setStroke(stroke);\n }\n\n this._drawBoxShadow(boxShadow);\n\n if(dash) {\n let dash = [style.dash[0] || 5, style.dash[1] || 5];\n let offset = style.dash[2] || 0;\n this.ctx.setLineDash(dash, offset || 0);\n }\n\n this.ctx.moveTo(x1, y1);\n this.ctx.setLineWidth((style.width || 1) * this.zoom);\n this.ctx.lineTo(x2, y2);\n this.ctx.stroke();\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n // 废弃,合并到_drawRect\n _drawImage (item, style, resolve, reject, isWxml) {\n let zoom = this.zoom;\n try {\n \n item.x = this._resetPositionX(item, style);\n item.y = this._resetPositionY(item, style);\n item.x = item.x + (style.padding[3] || 0);\n item.y = item.y + (style.padding[0] || 0);\n\n let index = this._findPicIndex(item.url);\n let url = index > -1 ? this.allPic[index].local : item.url;\n this._drawImageToCanvas(url, item.x, item.y, style.width * zoom, style.height * zoom, style);\n\n this._updateProgress(item.progress);\n resolve && resolve();\n } catch (e) {\n reject && reject({ errcode: 1012, errmsg: 'drawRect error', e });\n }\n }\n\n // 废弃,合并到_drawRect\n _drawImageToCanvas (url, x, y, width, height, style) {\n let { fill, border, boxShadow } = style;\n this.ctx.save();\n\n this._drawBoxShadow(boxShadow);\n this.ctx.drawImage(url, x, y, width, height);\n\n this._drawBorder(border, style, (border) => {\n let fixBorder = border.width;\n this.ctx.strokeRect(x - fixBorder / 2, y - fixBorder / 2, width + fixBorder, height + fixBorder);\n });\n this.ctx.draw(true);\n this.ctx.restore();\n }\n\n _drawWxml (item, style, resolve, reject) {\n let self = this;\n let all = [];\n try {\n this._getWxml(item, style).then((results) => {\n \n // 上 -> 下\n let sorted = self._sortListByTop(results[0]);\n let count = 0;\n let progress = 0;\n Object.keys(sorted).forEach(item => {\n count += sorted[item].length;\n })\n progress = this.distance * 3 / (count || 1);\n\n all = this._drawWxmlBlock(item, sorted, all, progress, results[1]);\n all = this._drawWxmlInline(item, sorted, all, progress, results[1]);\n\n Promise.all(all).then(results => {\n resolve && resolve();\n }).catch (e => {\n reject && reject(e);\n });\n });\n } catch (e) {\n reject && reject({ errcode: 1008, errmsg: 'drawWxml error' });\n }\n }\n\n _drawWxmlBlock (item, sorted, all, progress, results) {\n let self = this;\n // 用来限定位置范围,取相对位置\n let limitLeft = (results ? results.left : 0);\n let limitTop = (results ? results.top : 0);\n Object.keys(sorted).forEach((top, topIndex) => {\n // 左 -> 右\n let list = sorted[top].sort((a, b) => {\n return (a.left - b.left);\n });\n\n list = list.filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') === -1);\n\n list.forEach((sub, index) => {\n all[index] = new Promise((resolve2, reject2) => {\n sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop);\n sub.progress = progress;\n let type = sub.dataset.type;\n if(sub.dataset.delay) {\n setTimeout(() => {\n drawWxmlItem();\n }, sub.dataset.delay)\n } else {\n drawWxmlItem();\n }\n function drawWxmlItem () {\n if (type === 'text') {\n self._drawWxmlText(sub, resolve2, reject2);\n } else if (type === 'image') {\n self._drawWxmlImage(sub, resolve2, reject2);\n } else if (type === 'radius-image') {\n self._drawWxmlCircleImage(sub, resolve2, reject2);\n } else if (type === 'background-image') {\n self._drawWxmlBackgroundImage(sub, resolve2, reject2);\n }\n }\n });\n });\n });\n\n return all;\n\n }\n\n _drawWxmlInline (item, sorted, all, progress, results) {\n let self = this;\n let topOffset = 0;\n let leftOffset = 0;\n let lastTop = 0;\n let limitLeft = (results ? results.left : 0);\n let limitTop = (results ? results.top : 0);\n let p = new Promise((resolve2, reject2) => {\n let maxWidth = 0;\n let minLeft = Infinity;\n let maxRight = 0;\n\n // 找出同一top下的最小left和最大right,得到最大的宽度,用于换行\n Object.keys(sorted).forEach(top => {\n let inlineList = sorted[top].filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') > -1);\n inlineList.forEach(sub => {\n if(sub.left < minLeft) {\n minLeft = sub.left\n }\n if(sub.right > maxRight) {\n maxRight = sub.right;\n }\n })\n });\n maxWidth = Math.ceil((maxRight - minLeft) || self.width);\n\n Object.keys(sorted).forEach((top, topIndex) => {\n // 左 -> 右\n let list = sorted[top].sort((a, b) => {\n return (a.left - b.left);\n });\n\n // 换行的行内元素left放到后面,version2.0.6后无法获取高度,改用bottom值来判断是否换行了\n let position = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i] && list[i + 1]) {\n if(list[i].bottom > list[i + 1].bottom) {\n position = i;\n break;\n }\n }\n }\n\n if(position > -1) {\n list.push(list.splice(position, 1)[0]);\n }\n\n let inlineList = list.filter(sub => sub.dataset.type && sub.dataset.type.indexOf('inline') > -1);\n let originLeft = (inlineList[0] ? inlineList[0].left : 0);\n // 换行后和top不相等时,认为是换行了,要清除左边距;当左偏移量大于最大宽度时,也要清除左边距; 当左偏移小于左边距时,也要清除\n if (Math.abs(topOffset + lastTop - top) > 2 || leftOffset - originLeft - limitLeft >= maxWidth || leftOffset <= originLeft - limitLeft - 2) {\n leftOffset = 0;\n }\n\n lastTop = +top;\n topOffset = 0;\n \n inlineList.forEach((sub, index) => {\n sub = self._transferWxmlStyle(sub, item, limitLeft, limitTop);\n sub.progress = progress;\n let type = sub.dataset.type;\n if (type === 'inline-text') {\n let drawRes = self._drawWxmlInlineText(sub, leftOffset, maxWidth);\n leftOffset = drawRes.leftOffset;\n topOffset = drawRes.topOffset;\n } else if (type === 'inline-image') {\n let drawRes = self._drawWxmlImage(sub) || {};\n leftOffset = drawRes.leftOffset || 0;\n topOffset = drawRes.topOffset || 0;\n }\n });\n });\n resolve2();\n })\n\n all.push(p); \n return all;\n }\n\n _drawWxmlInlineText (sub, leftOffset = 0, maxWidth) {\n let text = sub.dataset.text || '';\n if(sub.dataset.maxlength && text.length > sub.dataset.maxlength) {\n text = text.substring(0, sub.dataset.maxlength) + '...';\n }\n \n let textData = {\n text,\n originX: sub.left,\n x: leftOffset ? leftOffset : sub.left,\n y: sub.top,\n progress: sub.progress,\n leftOffset: leftOffset,\n maxWidth: maxWidth // 行内元素的最大宽度,取决于limit的宽度\n }\n\n if (sub.backgroundColor !== 'rgba(0, 0, 0, 0)') {\n sub.background = sub.backgroundColor;\n }else {\n sub.background = 'rgba(0, 0, 0, 0)';\n }\n\n if(sub.dataset.background) {\n sub.background = sub.dataset.background;\n }\n\n let res = this._drawText(textData, sub, null, null, 'inline-text', 'wxml');\n\n return res\n }\n\n _drawWxmlText (sub, resolve, reject) {\n let text = sub.dataset.text || '';\n if(sub.dataset.maxlength && text.length > sub.dataset.maxlength) {\n text = text.substring(0, sub.dataset.maxlength) + '...';\n }\n \n let textData = {\n text,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n if (sub.backgroundColor !== 'rgba(0, 0, 0, 0)') {\n sub.background = sub.backgroundColor;\n }else {\n sub.background = 'rgba(0, 0, 0, 0)';\n }\n\n if(sub.dataset.background) {\n sub.background = sub.dataset.background;\n }\n\n this._drawText(textData, sub, resolve, reject, 'text', 'wxml');\n }\n\n _drawWxmlImage (sub, resolve, reject) {\n let imageData = {\n url: sub.dataset.url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n\n let res = this._drawRect(imageData, sub, resolve, reject, 'image', 'inline-wxml');\n\n return res\n }\n\n _drawWxmlCircleImage (sub, resolve, reject) {\n let imageData = {\n url: sub.dataset.url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n sub.r = sub.width / 2;\n\n this._drawCircle(imageData, sub, resolve, reject, true, 'wxml');\n }\n\n _drawWxmlBackgroundImage (sub, resolve, reject) {\n let url = sub.dataset.url;\n let index = this._findPicIndex(url);\n url = index > -1 ? this.allPic[index].local : url;\n let size = sub.backgroundSize.replace(/px/g, '').split(' ');\n\n let imageData = {\n url: url,\n x: sub.left,\n y: sub.top,\n progress: sub.progress\n }\n\n this._drawRect(imageData, sub, resolve, reject, 'image', 'wxml');\n }\n\n _getWxml (item, style) {\n let self = this;\n let query;\n if(this.obj) {\n query = wx.createSelectorQuery().in(this.obj);\n }else {\n query = wx.createSelectorQuery();\n }\n\n let p1 = new Promise((resolve, reject) => {\n // 会触发两次,要限制\n let count = 0;\n query.selectAll(`${item.class}`).fields({\n dataset: true,\n size: true,\n rect: true,\n computedStyle: ['width', 'height', 'font', 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'textAlign', \n 'color', 'lineHeight', 'border', 'borderColor', 'borderStyle', 'borderWidth', 'verticalAlign', 'boxShadow',\n 'background', 'backgroundColor', 'backgroundImage', 'backgroundPosition', 'backgroundSize', 'paddingLeft', 'paddingTop',\n 'paddingRight', 'paddingBottom'\n ]\n }, (res) => {\n if(count++ === 0) {\n let formated = self._formatImage(res);\n let list = formated.list;\n res = formated.res;\n\n self._preloadImage(list).then(result => {\n resolve(res);\n }).catch((res) => {\n reject && reject({ errcode: 1009, errmsg: 'drawWxml preLoadImage error' });\n });\n }\n }).exec();\n });\n\n let p2 = new Promise((resolve, reject) => {\n if (!item.limit) {\n resolve({ top: 0, width: self.width / self.zoom });\n }\n\n query.select(`${item.limit}`).fields({\n dataset: true,\n size: true,\n rect: true,\n }, (res) => {\n resolve(res);\n }).exec();\n });\n\n return Promise.all([p1, p2]);\n }\n\n _getLineHeight (style) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n let lineHeight;\n if(!isNaN(style.lineHeight) && style.lineHeight > style.fontSize) {\n lineHeight = style.lineHeight;\n }else {\n style.lineHeight = (style.lineHeight || '') + '';\n lineHeight = +style.lineHeight.replace('px', '');\n lineHeight = lineHeight ? lineHeight : (style.fontSize || 14) * 1.2;\n }\n return lineHeight * zoom;\n }\n\n _formatImage (res = []) {\n let list = [];\n res.forEach((item, index) => {\n let dataset = item.dataset;\n let uid = Util.getUid();\n let filename = `${wx.env.USER_DATA_PATH}/${uid}.png`;\n if ((dataset.type === \"image\" || dataset.type === \"radius-image\") && dataset.url) {\n let sub = {\n url: dataset.base64 ? filename : dataset.url,\n isBase64: dataset.base64 ? dataset.url : false\n }\n\n res[index].dataset = Object.assign(res[index].dataset, sub);\n list.push(sub)\n } else if (dataset.type === 'background-image' && item.backgroundImage.indexOf('url') > -1) {\n let url = item.backgroundImage.replace(/url\\((\\\"|\\')?/, '').replace(/(\\\"|\\')?\\)$/, '');\n let sub = {\n url: dataset.base64 ? filename : url,\n isBase64: dataset.base64 ? url : false\n }\n res[index].dataset = Object.assign(res[index].dataset, sub);\n list.push(sub)\n }\n });\n\n return { list, res };\n }\n\n _updateProgress (distance) {\n this.progressPercent += distance;\n this.progress(this.progressPercent);\n }\n\n _sortListByTop (list = []) {\n let sorted = {};\n\n // 粗略地认为2px相差的元素在同一行\n list.forEach((item, index) => {\n let top = item.top;\n if (!sorted[top]) {\n if (sorted[top - 2]) {\n top = top - 2;\n }else if (sorted[top - 1]) {\n top = top - 1;\n } else if (sorted[top + 1]) {\n top = top + 1;\n } else if (sorted[top + 2]) {\n top = top + 2;\n } else {\n sorted[top] = [];\n }\n }\n sorted[top].push(item);\n });\n\n return sorted;\n }\n\n _parseNumber (number) {\n return isNaN(number) ? +(number || '').replace('px', '') : number;\n }\n\n _transferWxmlStyle (sub, item, limitLeft, limitTop) {\n let leftFix = (+sub.dataset.left || 0);\n let topFix = (+sub.dataset.top || 0);\n\n sub.width = this._parseNumber(sub.width);\n sub.height = this._parseNumber(sub.height);\n sub.left = this._parseNumber(sub.left) - limitLeft + (leftFix + (item.x || 0)) * this.zoom;\n sub.top = this._parseNumber(sub.top) - limitTop + (topFix + (item.y || 0)) * this.zoom;\n\n let padding = sub.dataset.padding || '0 0 0 0';\n if (typeof padding === 'string') {\n padding = Util.transferPadding(padding);\n }\n let paddingTop = Number(sub.paddingTop.replace('px', '')) + Number(padding[0]);\n let paddingRight = Number(sub.paddingRight.replace('px', '')) + Number(padding[1]);\n let paddingBottom = Number(sub.paddingBottom.replace('px', '')) + Number(padding[2]);\n let paddingLeft = Number(sub.paddingLeft.replace('px', '')) + Number(padding[3]);\n sub.padding = [paddingTop, paddingRight, paddingBottom, paddingLeft];\n \n return sub;\n }\n\n /**\n * 支持负值绘制,从右边计算\n * @param {*} item \n * @param {*} style \n */\n _resetPositionX (item, style) {\n let zoom = this.zoom;\n let x = 0;\n\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n // 通过wxml获取的不需要重置坐标\n if (item.x < 0 && item.type) {\n x = this.width + item.x * zoom - style.width * zoom;\n } else {\n x = item.x * zoom;\n }\n\n if (parseInt(style.borderWidth)) {\n x += parseInt(style.borderWidth)\n }\n\n return x + this.translateX;\n }\n\n /**\n * 支持负值绘制,从底部计算\n * @param {*} item \n * @param {*} style \n */\n _resetPositionY (item, style, textHeight) {\n let zoom = this.zoom;\n let y = 0;\n\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n if (item.y < 0) {\n y = this.height + item.y * zoom - (textHeight ? textHeight : style.height * zoom)\n } else {\n y = item.y * zoom;\n }\n\n if (parseInt(style.borderWidth)) {\n y += parseInt(style.borderWidth)\n }\n \n return y + this.translateY;\n }\n\n /**\n * 文字的padding、text-align\n * @param {*} item \n * @param {*} style \n * @param {*} textWidth\n */\n _resetTextPositionX (item, style, textWidth, width) {\n let textAlign = style.textAlign || 'left';\n let x = item.x;\n if (textAlign === 'center') {\n x = (width - textWidth) / 2 + item.x;\n } else if (textAlign === 'right') {\n x = width - textWidth + item.x;\n }\n\n let left = style.padding ? (style.padding[3] || 0) : 0;\n\n return x + left + this.translateX;\n }\n\n /**\n * 文字的padding、text-align\n * @param {*} item \n * @param {*} style \n * @param {*} textWidth\n */\n _resetTextPositionY (item, style, lineNum = 0) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n\n let lineHeight = this._getLineHeight(style);\n let fontSize = Math.ceil((style.fontSize || 14) * zoom)\n\n let blockLineHeightFix = (style.dataset && style.dataset.type || '').indexOf('inline') > -1 ? 0 : (lineHeight - fontSize) / 2\n\n let top = style.padding ? (style.padding[0] || 0) : 0;\n\n // y + lineheight偏移 + 行数 + paddingTop + 整体画布位移\n return item.y + blockLineHeightFix + lineNum * lineHeight + top + this.translateY;\n }\n\n /**\n * 当文本超过宽度时,计算每一行应该绘制的文本\n * @param {*} text \n * @param {*} width \n * @param {*} singleLength \n * @param {*} currentIndex \n * @param {*} widthOffset\n */\n _getTextSingleLine(text, width, singleLength, currentIndex = 0, widthOffset = 0) {\n let offset = 0;\n let endIndex = currentIndex + singleLength + offset;\n let single = text.substring(currentIndex, endIndex);\n let singleWidth = this.measureWidth(single);\n\n while (Math.round(widthOffset + singleWidth) > width) {\n offset--;\n endIndex = currentIndex + singleLength + offset;\n single = text.substring(currentIndex, endIndex);\n singleWidth = this.measureWidth(single);\n }\n\n return {\n endIndex, \n single, \n singleWidth\n }\n }\n\n _drawBorder (border, style, callback) {\n let zoom = this.zoom;\n if(style.dataset && style.dataset.type) {\n zoom = 1;\n }\n border = Util.transferBorder(border);\n\n if (border && border.width) {\n // 空白阴影,清空掉边框的阴影\n this._drawBoxShadow();\n if (border) {\n \n this.ctx.setLineWidth(border.width * zoom);\n\n if (border.style === 'dashed') {\n let dash = style.dash || [5, 5, 0];\n let offset = dash[2] || 0;\n let array = [dash[0] || 5, dash[1] || 5];\n this.ctx.setLineDash(array, offset);\n }\n this.ctx.setStrokeStyle(border.color);\n }\n callback && callback(border);\n }\n } \n\n _drawBoxShadow (boxShadow, callback) {\n boxShadow = Util.transferBoxShadow(boxShadow);\n if (boxShadow) {\n this.ctx.setShadow(boxShadow.offsetX, boxShadow.offsetY, boxShadow.blur, boxShadow.color);\n }else {\n this.ctx.setShadow(0, 0, 0, '#ffffff');\n }\n\n callback && callback(boxShadow || {});\n }\n\n _setFill (fill, callback) {\n if(fill) {\n if (typeof fill === 'string') {\n this.ctx.setFillStyle(fill);\n } else {\n let line = fill.line;\n let color = fill.color;\n let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]);\n grd.addColorStop(0, color[0]);\n grd.addColorStop(1, color[1]);\n this.ctx.setFillStyle(grd);\n }\n callback && callback();\n }\n }\n\n _setStroke (stroke, callback) {\n if(stroke) {\n if (typeof stroke === 'string') {\n this.ctx.setStrokeStyle(stroke);\n } else {\n let line = stroke.line;\n let color = stroke.color;\n let grd = this.ctx.createLinearGradient(line[0], line[1], line[2], line[3]);\n grd.addColorStop(0, color[0]);\n grd.addColorStop(1, color[1]);\n this.ctx.setStrokeStyle(grd);\n }\n\n callback && callback();\n }\n }\n}\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = Wxml2Canvas;","/**\n * 获取字符的长度,full为true时,一个汉字算两个长度\n * @param {String} str \n * @param {Boolean} full \n */\n\nfunction getTextLength (str, full) {\n let len = 0;\n for (let i = 0; i < str.length; i++) {\n let c = str.charCodeAt(i);\n //单字节加1 \n if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {\n len++;\n }\n else {\n len += (full ? 2 : 1);\n }\n }\n return len;\n}\n\n/**\n * rgba(255, 255, 255, 1) => #ffffff\n * @param {String} color \n */\nfunction transferColor (color = '') {\n let res = '#';\n color = color.replace(/^rgba?\\(/, '').replace(/\\)$/, '');\n color = color.split(', ');\n \n color.length > 3 ? color.length = 3 : '';\n for(let item of color) {\n item = parseInt(item || 0);\n if(item < 10) {\n res += ('0' + item)\n }else {\n res += (item.toString(16))\n }\n }\n\n return res;\n}\n\nfunction transferBorder (border = '') {\n let res = border.match(/(\\w+)px\\s(\\w+)\\s(.*)/);\n let obj = {};\n\n if(res) {\n obj = {\n width: +res[1],\n style: res[2],\n color: res[3]\n }\n }\n \n return res ? obj : null;\n}\n\n\n/**\n * 内边距,依次为上右下左\n * @param {*} padding \n */\nfunction transferPadding (padding = '0 0 0 0') {\n padding = padding.split(' ');\n for(let i = 0, len = padding.length; i < len; i++) {\n padding[i] = +padding[i].replace('px', '');\n }\n\n return padding;\n}\n/**\n * type1: 0, 25, 17, rgba(0, 0, 0, 0.3)\n * type2: rgba(0, 0, 0, 0.3) 0px 25px 17px 0px => (0, 25, 17, rgba(0, 0, 0, 0.3))\n * @param {*} shadow \n */\nfunction transferBoxShadow(shadow = '', type) {\n if(!shadow || shadow === 'none') return;\n let color;\n let split;\n\n split = shadow.match(/(\\w+)\\s(\\w+)\\s(\\w+)\\s(rgb.*)/);\n\n if (split) {\n split.shift();\n shadow = split;\n color = split[3] || '#ffffff';\n } else {\n split = shadow.split(') ');\n color = split[0] + ')'\n shadow = split[1].split('px ');\n }\n\n return {\n offsetX: +shadow[0] || 0,\n offsetY: +shadow[1] || 0,\n blur: +shadow[2] || 0,\n color\n }\n}\n\nfunction getUid(prefix) {\n prefix = prefix || '';\n\n return (\n prefix +\n 'xxyxxyxx'.replace(/[xy]/g, c => {\n let r = (Math.random() * 16) | 0;\n let v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n })\n );\n}\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = {\n getTextLength,\n transferBorder,\n transferColor,\n transferPadding,\n transferBoxShadow,\n getUid\n};"]} diff --git a/src/components/freeAudio/free-audio.vue b/src/components/freeAudio/free-audio.vue new file mode 100644 index 0000000..0862552 --- /dev/null +++ b/src/components/freeAudio/free-audio.vue @@ -0,0 +1,158 @@ + + + + + diff --git a/src/components/freeAudio/index.js b/src/components/freeAudio/index.js new file mode 100644 index 0000000..8b916f4 --- /dev/null +++ b/src/components/freeAudio/index.js @@ -0,0 +1,176 @@ +const app = getApp(); +import dayjs from "dayjs"; +Component({ + behaviors: [], + properties: { + audio: { + type: Object, + observer(val) { + if (this.audioContext) { + const { play } = this.data; + if (play) { + this.audioContext.pause(); + this.setData({ + play: false, + progress: 0, + time: "00", + }); + } + this.audioContext.destroy(); + } + if (val) { + this.audioAddEventListener(val); + } + }, + }, + }, + data: { + Timestamp: app.globalData.Timestamp, + progress: 0, + time: "00", + duration: "00", + play: false, + loading: true, + + imageUrl: app.globalData.imageUrl, + progressimg: true, + }, + lifetimes: { + created() {}, + async attached() {}, + moved() {}, + detached() { + if (this.audioContext) { + const { play } = this.data; + if (play) { + this.audioContext.pause(); + } + this.audioContext.destroy(); + } + this.audioAddEventListener = null; + this.setData({ + play: false, + progress: 0, + time: "00", + }); + }, + }, + pageLifetimes: { + // 组件所在页面的生命周期函数 + show: function () {}, + hide: function () { + const { play } = this.data; + if (play) { + this.audioContext.pause(); + } + }, + resize: function () {}, + }, + methods: { + togglePlay() { + const { play, loading } = this.data; + if (loading) { + wx.showToast({ + title: "音频加载中", + icon: "none", + }); + return; + } + if (play) { + this.audioContext.pause(); + } else { + this.audioContext.play(); + } + }, + formatTime(time) { + let m = parseInt(time / 60); + let s = parseInt(time % 60); + return this.towNum(m) + ":" + this.towNum(s); + }, + towNum(num) { + if (num >= 10) { + return num; + } else { + return "0" + num; + } + }, + audioAddEventListener(val) { + const that = this; + this.setData({ + duration: this.formatTime(val.size), + }); + that.audioContext = wx.createInnerAudioContext(); + that.audioContext.src = val.url; + that.setData({ + loading: false, + }); + that.audioContext.onError(({ errCode, ...reset }) => { + console.log("reset: ", reset); + console.log("errCode: ", errCode); + if (errCode === 10004 || errCode == 10001 || errCode == -1) { + that.audioContext.destroy(); + that.setData({ + loading: true, + }); + setTimeout(() => { + that.audioAddEventListener(val); + }, 300); + } + }); + that.audioContext.onPlay(() => { + that.setData({ + play: true, + }); + }); + that.audioContext.onPause(() => { + console.log(1111111); + that.setData({ + play: false, + }); + }); + that.audioContext.onEnded(() => { + that.audioContext.seek(0); + that.setData({ + play: false, + progress: 0, + time: "00", + }); + }); + that.audioContext.onTimeUpdate(() => { + const duration = that.audioContext.duration || 0; + const currentTime = that.audioContext.currentTime || 0; + const progress = (currentTime / duration) * 100; + if (duration == Infinity) { + return; + } + that.setData({ + play: true, + duration: that.formatTime(duration), + time: that.formatTime(currentTime), + }); + if (that.data.progressimg) { + this.setData({ + progress: progress, + }); + } + }); + }, + handleAuthChangeimg() { + console.log(11111); + this.setData({ + progressimg: false, + }); + }, + handleAuthChange(e) { + console.log(22222222222); + let { duration } = this.data; + const secods = this.audioContext.duration || duration.split(":")[0] * 60 + duration.split(":")[1] * 1; + const progress = e.detail.value; + let seek = ((secods / 100) * progress).toFixed(3) * 1; + this.audioContext.seek(seek); + this.setData({ + progressimg: true, + }); + }, + }, +}); diff --git a/src/components/freeAudio/index.json b/src/components/freeAudio/index.json new file mode 100644 index 0000000..0d72f50 --- /dev/null +++ b/src/components/freeAudio/index.json @@ -0,0 +1,5 @@ +{ + "navigationBarTitleText": "", + "component": true, + "usingComponents": {} +} diff --git a/src/components/freeAudio/index.scss b/src/components/freeAudio/index.scss new file mode 100644 index 0000000..412714c --- /dev/null +++ b/src/components/freeAudio/index.scss @@ -0,0 +1,54 @@ +.audio { + width: 100%; + height: 86rpx; + position: relative; + .audio-bg { + margin: 0 120rpx 0 80rpx; + height: 100%; + width: calc(100% - 200rpx); + } + .card-auth { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 14rpx 26rpx 12rpx; + display: flex; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + background: rgba(174, 182, 205, 0.1); + border-radius: 50rpx 50rpx 50rpx 50rpx; + border: 1rpx solid rgba(181, 205, 255, 0.1); + .icon { + width: 60rpx; + height: 60rpx; + flex-shrink: 0; + } + .center { + position: relative; + width: 100%; + margin: 0 30rpx; + display: flex; + align-items: center; + .progress-bg { + width: 100%; + height: 60rpx; + } + + .progress { + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + width: 100%; + margin: 0; + } + } + .time { + flex-shrink: 0; + font-size: 24rpx; + color: #e04775; + } + } +} diff --git a/src/components/freeAudio/index.wxml b/src/components/freeAudio/index.wxml new file mode 100644 index 0000000..706fc0a --- /dev/null +++ b/src/components/freeAudio/index.wxml @@ -0,0 +1,26 @@ + + + + + + + + {{duration}} + + diff --git a/src/components/loginNavbar/index.json b/src/components/loginNavbar/index.json new file mode 100644 index 0000000..072b74e --- /dev/null +++ b/src/components/loginNavbar/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-nav-bar": "@vant/weapp/nav-bar/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/components/loginNavbar/index.scss b/src/components/loginNavbar/index.scss new file mode 100644 index 0000000..3a9d725 --- /dev/null +++ b/src/components/loginNavbar/index.scss @@ -0,0 +1,24 @@ +.navbar { + padding: 0 20rpx 0 0; + display: flex; + align-items: center; + .back-icon { + margin-right: 40rpx; + } + .num { + width: 64rpx; + height: 64rpx; + border-radius: 50%; + border: 3rpx solid #e04876; + text-align: center; + line-height: 64rpx; + margin-right: 24rpx; + font-size: 40rpx; + color: #e04876; + font-weight: bold; + &.active { + background-color: #e04876; + color: #fff; + } + } +} diff --git a/src/components/loginNavbar/index.ts b/src/components/loginNavbar/index.ts new file mode 100644 index 0000000..707881d --- /dev/null +++ b/src/components/loginNavbar/index.ts @@ -0,0 +1,23 @@ +const app = getApp(); + +Component({ + properties: { + num: { + type: Number, + value: 0, + }, + back: { + type: Boolean, + value: false, + }, + }, + data: { + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + }, + methods: { + handleBack() { + this.triggerEvent("back"); + }, + }, +}); diff --git a/src/components/loginNavbar/index.wxml b/src/components/loginNavbar/index.wxml new file mode 100644 index 0000000..62d2b7c --- /dev/null +++ b/src/components/loginNavbar/index.wxml @@ -0,0 +1,7 @@ + + + + 1 + 2 + + diff --git a/src/components/pageNavbar/index.json b/src/components/pageNavbar/index.json new file mode 100644 index 0000000..072b74e --- /dev/null +++ b/src/components/pageNavbar/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-nav-bar": "@vant/weapp/nav-bar/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/components/pageNavbar/index.scss b/src/components/pageNavbar/index.scss new file mode 100644 index 0000000..7b11609 --- /dev/null +++ b/src/components/pageNavbar/index.scss @@ -0,0 +1,16 @@ +.navbar { + padding: 0 20rpx 0 0; + display: flex; + align-items: center; + .back-icon { + margin-right: 40rpx; + } + .nav-img { + width: 356rpx; + height: 46rpx; + } + .drug-nav-img { + width: 199rpx; + height: 36rpx; + } +} diff --git a/src/components/pageNavbar/index.ts b/src/components/pageNavbar/index.ts new file mode 100644 index 0000000..8872734 --- /dev/null +++ b/src/components/pageNavbar/index.ts @@ -0,0 +1,23 @@ +const app = getApp(); + +Component({ + properties: { + back: { + type: Boolean, + value: false, + }, + drug: { + type: Boolean, + value: false, + }, + }, + data: { + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + }, + methods: { + handleBack() { + wx.navigateBack(); + }, + }, +}); diff --git a/src/components/pageNavbar/index.wxml b/src/components/pageNavbar/index.wxml new file mode 100644 index 0000000..2c17406 --- /dev/null +++ b/src/components/pageNavbar/index.wxml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/components/pickerArea/index.json b/src/components/pickerArea/index.json new file mode 100644 index 0000000..cf286db --- /dev/null +++ b/src/components/pickerArea/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "@vant/weapp/popup/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/components/pickerArea/index.scss b/src/components/pickerArea/index.scss new file mode 100644 index 0000000..de262c0 --- /dev/null +++ b/src/components/pickerArea/index.scss @@ -0,0 +1,128 @@ +.aside-share { + position: fixed; + right: 22rpx; + bottom: 120rpx; + width: 136rpx; + height: 136rpx; +} + +.popup { + position: relative; + background-color: #fff; + .close { + position: absolute; + top: 52rpx; + right: 32rpx; + color: rgba(72, 72, 72, 1); + font-size: 34rpx; + } + .p-header { + padding: 46rpx 30rpx 0; + .title { + text-align: center; + font-size: 36rpx; + color: rgba(72, 72, 72, 1); + font-weight: bold; + } + .tip { + text-align: center; + margin-top: 16rpx; + font-size: 32rpx; + color: rgba(72, 72, 72, 1); + } + .area { + margin-top: 48rpx; + display: flex; + align-items: center; + justify-content: space-between; + gap: 14rpx; + .item { + flex: 1; + padding: 18rpx 30rpx; + box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 0, 0, 0.11); + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 2rpx solid #e04775; + display: flex; + align-items: center; + justify-content: space-between; + .content { + font-size: 32rpx; + color: rgba(72, 72, 72, 1); + max-width: 5em; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .icon { + width: 32rpx; + height: 32rpx; + } + } + .picker { + flex: 1; + } + .btn { + width: 126rpx; + height: 76rpx; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + display: flex; + align-items: center; + justify-content: center; + background: #e04775; + border-radius: 12rpx 12rpx 12rpx 12rpx; + } + } + } + .select { + margin-top: 44rpx; + padding: 0 30rpx 0; + display: grid; + grid-template-columns: repeat(auto-fit, 68rpx); + gap: 26rpx 20rpx; + .s-item { + width: 68rpx; + height: 68rpx; + text-align: center; + line-height: 68rpx; + font-size: 28rpx; + color: rgba(158, 158, 158, 1); + border-radius: 50%; + background: #f7f8f9; + &.active { + color: #fff; + background-color: rgba(224, 71, 117, 1); + } + } + } + .scroll { + padding: 0 30rpx; + height: 45vh; + box-sizing: border-box; + .item { + padding: 32rpx 0; + font-size: 28rpx; + color: rgba(72, 72, 72, 1); + border-bottom: 2px solid #fbfbfb; + display: flex; + align-items: center; + justify-content: space-between; + .word { + margin-right: 24rpx; + display: inline-block; + width: 1em; + color: rgba(158, 158, 158, 1); + } + .icon { + width: 36rpx; + height: 36rpx; + } + &.active { + color: rgba(224, 71, 117, 1); + .word { + color: rgba(224, 71, 117, 1); + } + } + } + } +} diff --git a/src/components/pickerArea/index.ts b/src/components/pickerArea/index.ts new file mode 100644 index 0000000..3e2c22c --- /dev/null +++ b/src/components/pickerArea/index.ts @@ -0,0 +1,312 @@ +const app = getApp() + +Component({ + properties: { + // 省份名称 + pname: { + type: String, + value: '', + }, + // 省份ID + pid: { + type: String, + value: '', + }, + // 城市名称 + cname: { + type: String, + value: '', + }, + // 城市ID + cid: { + type: String, + value: '', + }, + }, + observers: { + show(newVal: boolean) { + this.triggerEvent('show', newVal) + }, + }, + data: { + show: false, + word: '', + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + + active: 0, + ProvinceName: '', + ProvinceId: '', + CityName: '', + CityId: '', + proList: { + A: [ + { + name: '安徽省', + code: '340000', + }, + { + name: '澳门特别行政区', + code: '820000', + }, + ], + B: [ + { + name: '北京市', + code: '110000', + }, + ], + C: [ + { + name: '重庆市', + code: '500000', + }, + ], + F: [ + { + name: '福建省', + code: '350000', + }, + ], + G: [ + { + name: '甘肃省', + code: '620000', + }, + { + name: '广东省', + code: '440000', + }, + { + name: '广西壮族自治区', + code: '450000', + }, + { + name: '贵州省', + code: '520000', + }, + ], + H: [ + { + name: '海南省', + code: '460000', + }, + { + name: '河北省', + code: '130000', + }, + { + name: '河南省', + code: '410000', + }, + { + name: '黑龙江省', + code: '230000', + }, + { + name: '湖北省', + code: '420000', + }, + { + name: '湖南省', + code: '430000', + }, + ], + J: [ + { + name: '吉林省', + code: '220000', + }, + { + name: '江苏省', + code: '320000', + }, + { + name: '江西省', + code: '360000', + }, + ], + L: [ + { + name: '辽宁省', + code: '210000', + }, + ], + N: [ + { + name: '宁夏回族自治区', + code: '640000', + }, + { + name: '内蒙古自治区', + code: '150000', + }, + ], + Q: [ + { + name: '青海省', + code: '630000', + }, + ], + S: [ + { + name: '山东省', + code: '370000', + }, + { + name: '山西省', + code: '140000', + }, + { + name: '陕西省', + code: '610000', + }, + { + name: '上海市', + code: '310000', + }, + { + name: '四川省', + code: '510000', + }, + ], + T: [ + { + name: '天津市', + code: '120000', + }, + { + name: '台湾省', + code: '710000', + }, + ], + X: [ + { + name: '西藏自治区', + code: '540000', + }, + { + name: '新疆维吾尔自治区', + code: '650000', + }, + { + name: '香港特别行政区', + code: '810000', + }, + ], + Y: [ + { + name: '云南省', + code: '530000', + }, + ], + Z: [ + { + name: '浙江省', + code: '330000', + }, + ], + }, + area: [] as any, + range: [], + + scrollIntoView0: '', + scrollIntoView1: '', + }, + methods: { + handleShow() { + this.setData({ + show: true, + ProvinceName: this.data.pname || '', + ProvinceId: this.data.pid || '', + CityName: this.data.cname || '', + CityId: this.data.cid || '', + + scrollIntoView0: this.data.pid || '', + scrollIntoView1: this.data.cid || '', + }) + this.getArea() + }, + getArea() { + wx.ajax({ + method: 'GET', + url: '/js/area.json', + isJSON: true, + }).then((res) => { + this.setData({ + area: res, + }) + this.getRangeList() + }) + }, + handleItem(e: any) { + const { code, name } = e.currentTarget.dataset + this.setData({ + ProvinceId: code, + ProvinceName: name, + CityId: '', + CityName: '', + }) + this.getRangeList() + }, + handleChangeCity(e: any) { + const { code, name } = e.currentTarget.dataset + this.setData({ + CityId: code, + CityName: name, + }) + }, + handleShare() { + this.setData({ + show: false, + }) + this.triggerEvent('ok', { + ProvinceName: this.data.ProvinceName, + ProvinceId: this.data.ProvinceId, + CityName: this.data.CityName, + CityId: this.data.CityId, + }) + }, + handleSelect(e) { + const { id } = e.currentTarget.dataset + this.setData({ + word: id, + scrollIntoView0: id, + }) + }, + getRangeList() { + const { area, ProvinceId } = this.data + if (!ProvinceId) return + const range = area.filter((item: any) => item.value == ProvinceId)[0].children + this.setData({ + range, + active: 1, + scrollIntoView0: '', + scrollIntoView1: `id${this.data.CityId}`, + }) + }, + handleProvince() { + this.setData({ + active: 0, + scrollIntoView0: this.data.word || `id${this.data.ProvinceId}`, + scrollIntoView1: '', + }) + }, + handleCity() { + const { ProvinceId } = this.data + if (!ProvinceId) { + wx.showToast({ + title: '请先选择省份', + icon: 'none', + }) + return + } + this.getRangeList() + }, + handleClose() { + this.setData({ + show: false, + }) + }, + }, +}) diff --git a/src/components/pickerArea/index.wxml b/src/components/pickerArea/index.wxml new file mode 100644 index 0000000..7b4f01e --- /dev/null +++ b/src/components/pickerArea/index.wxml @@ -0,0 +1,87 @@ + + + + + + + 选择省份和地区 + + + + {{ProvinceName || '请选择省份'}} + + + + {{CityName || '请选择城市'}} + + + 确定 + + + + + + {{item.label}} + + + + + + + + {{index}} + + + + + + + + + {{index===0 ? key : ''}} + {{item.name}} + + + + + + + + + diff --git a/src/components/referralFrom/index.json b/src/components/referralFrom/index.json new file mode 100644 index 0000000..074f50b --- /dev/null +++ b/src/components/referralFrom/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/components/referralFrom/index.scss b/src/components/referralFrom/index.scss new file mode 100644 index 0000000..9561175 --- /dev/null +++ b/src/components/referralFrom/index.scss @@ -0,0 +1,95 @@ +.from { + padding: 48rpx 40rpx; + width: 650rpx; + box-sizing: border-box; + background: linear-gradient(349deg, #ffffff 0%, #e2f1f4 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .title { + font-size: 32rpx; + color: #283031; + font-weight: bold; + } + .date { + margin-top: 24rpx; + padding: 14rpx 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + background-color: #f2f4f5; + border-radius: 16rpx; + + .conetent { + font-size: 32rpx; + color: #283031; + } + .tril { + width: 0; + height: 0; + border-style: solid; + border-width: 10rpx 10rpx 0 10rpx; + border-color: #aeb3b4 transparent transparent transparent; + } + } + .select-title { + margin-top: 48rpx; + font-size: 32rpx; + color: #283031; + font-weight: bold; + .sub { + font-weight: normal; + } + } + .list { + margin-top: 26rpx; + max-height: 55vh; + overflow-y: auto; + &::-webkit-scrollbar{ + display: none; + } + .item { + margin-bottom: 16rpx; + padding: 14rpx 32rpx; + font-size: 32rpx; + color: #283031; + line-height: 48rpx; + background-color: #f2f4f5; + border: 1px solid #f2f4f5; + border-radius: 16rpx; + &.active { + border-color: #67baca; + background-color: #e7f5f8; + color: #67baca; + } + } + } + .footer { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + gap: 26rpx; + text-align: center; + .cancel { + flex: 1; + height: 80rpx; + font-size: 36rpx; + color: #67BACA; + line-height: 80rpx; + background: #ffffff; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + } + + .submit { + flex: 1; + height: 80rpx; + font-size: 36rpx; + color: #FFFFFF; + line-height: 80rpx; + background: #67baca; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + } + } +} diff --git a/src/components/referralFrom/index.ts b/src/components/referralFrom/index.ts new file mode 100644 index 0000000..00306a2 --- /dev/null +++ b/src/components/referralFrom/index.ts @@ -0,0 +1,139 @@ +import dayjs from 'dayjs' + +const _app = getApp() + +// pages/story/a.ts +Component({ + /** + * 组件的属性列表 + */ + properties: { + show: { + type: Boolean, + value: false, + }, + params: { + type: Object, + value: undefined, + }, + }, + + observers: { + show() { + if (this.data.params) { + this.setData({ + ...this.data.params, + }) + this.handleDateChange() + } else { + this.setData({ + visitDateName: '', + visitDate: '', + hormone: 2, + traditionalInhibitor: 2, + gammaGlobulin: 2, + plasmaExchange: 2, + bCellInhibitor: 2, + fcRnAntagonists: 2, + c5ComplementInhibitor: 2, + chineseMedicine: 2, + other: 2, + recordId: '', + }) + } + }, + }, + data: { + currentDate: dayjs().format('YYYY-MM-DD'), + + visitDateName: '', + visitDate: '', + hormone: 2, + traditionalInhibitor: 2, + gammaGlobulin: 2, + plasmaExchange: 2, + bCellInhibitor: 2, + fcRnAntagonists: 2, + c5ComplementInhibitor: 2, + chineseMedicine: 2, + other: 2, + recordId: '', + }, + + methods: { + handleDateChange() { + this.setData({ + visitDateName: dayjs(this.data.visitDate).format('YYYY年MM月DD日'), + }) + }, + handleSelect(e) { + const { name } = e.currentTarget.dataset + const value = this.data[name] + this.setData({ + [name]: value === 2 ? 1 : 2, + }) + }, + submit() { + const { visitDate, recordId } = this.data + const params = { + visitDate, + recordId, + } + if(!visitDate){ + wx.showToast({ + title: '请选择复诊日期', + icon: 'none', + }) + return + } + const selectKeys = [ + 'hormone', + 'traditionalInhibitor', + 'gammaGlobulin', + 'plasmaExchange', + 'bCellInhibitor', + 'fcRnAntagonists', + 'c5ComplementInhibitor', + 'chineseMedicine', + 'other', + ] + selectKeys.forEach((item) => { + params[item] = this.data[item] + }) + const onlySelect = selectKeys.some((item) => { + return this.data[item] === 1 + }) + if (!onlySelect) { + wx.showToast({ + title: '请至少选择一种复诊后的方案', + icon: 'none', + }) + return + } + wx.ajax({ + method: 'POST', + url: '?r=xd/re-visit/save-record', + data: params, + }).then(() => { + if (recordId) { + wx.showToast({ + icon: 'none', + title: '编辑成功', + }) + } else { + wx.showToast({ + icon: 'none', + title: '添加成功', + }) + } + this.handleCancel() + this.triggerEvent('refresh', params) + }) + }, + handleCancel() { + this.setData({ + show: false, + }) + }, + }, +}) diff --git a/src/components/referralFrom/index.wxml b/src/components/referralFrom/index.wxml new file mode 100644 index 0000000..0bc0b42 --- /dev/null +++ b/src/components/referralFrom/index.wxml @@ -0,0 +1,52 @@ + + + 您上一次复诊时间? + + + {{visitDateName||'请选择'}} + + + + + 您复诊后的方案是? + (多选) + + + 1.激素 + + 2.传统免疫抑制剂(如他克莫司、吗 替麦考酚酯等) + + + 3.静脉输注丙种球蛋白 + + + 4.血浆置换 + + + 5.B细胞抑制剂(如:利妥昔单抗、泰 它西普、伊奈利珠单抗) + + + 6.FcRn拮抗剂(如:艾加莫德) + + + 7.C5补体抑制剂(如:依库珠单抗) + + + 8.中药或中成药 + + 9.其他 + + + 取消 + 确定 + + + diff --git a/src/components/star/index.json b/src/components/star/index.json new file mode 100644 index 0000000..f719411 --- /dev/null +++ b/src/components/star/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/star/index.scss b/src/components/star/index.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/components/star/index.ts b/src/components/star/index.ts new file mode 100644 index 0000000..af9a4a6 --- /dev/null +++ b/src/components/star/index.ts @@ -0,0 +1,204 @@ +const app = getApp(); +/** + * >=min && <=max + * @param min + * @param max + */ +function getRandom(min, max) { + return min + Math.floor(Math.random() * (max - min + 1)); +} +Component({ + options: {}, + lifetimes: { + attached() { + const query = wx.createSelectorQuery().in(this); + query + .select("#thumsCanvas") + .fields({ node: true, size: true }) + .exec((res) => { + const canvas = res[0].node; + const context = canvas.getContext("2d"); + this.setData({ + context: context, + }); + + const dpr = wx.getSystemInfoSync().pixelRatio; + canvas.width = res[0].width * dpr; + canvas.height = res[0].height * dpr; + this.data.width = res[0].width * dpr; + this.data.height = res[0].height * dpr; + // context.fillStyle = "rgba(255, 255, 255, 0)"; + const images = [ + "star/icon1.png", + "star/icon2.png", + "star/icon3.png", + "star/icon4.png", + "star/icon5.png", + "star/icon6.png", + "star/icon7.png", + "star/icon8.png", + ]; + const promiseAll = [] as Array>; + images.forEach((src) => { + const p = new Promise(function (resolve) { + const img = canvas.createImage(); + img.onerror = img.onload = resolve.bind(null, img); + img.src = app.globalData.imageUrl + src; + }); + promiseAll.push(p); + }); + Promise.all(promiseAll).then((imgsList) => { + const imgsLists = imgsList.filter((d) => { + if (d && d.width > 0) return true; + return false; + }); + this.setData({ + imgsList: imgsLists, + }); + if (this.data.imgsList.length == 0) { + // logger.error("imgsList load all error"); + wx.showToast({ + icon: "none", + title: "imgsList load all error", + }); + return; + } + }); + }); + }, + }, + properties: {}, + data: { + imgsList: [] as WechatMiniprogram.ImageData[], + width: 0, + height: 0, + context: null as any, + scanning: false, + renderList: [], + scaleTime: 0.1, // 百分比 + }, + methods: { + handleTap() { + this.start(); + }, + createRender() { + if (this.data.imgsList.length == 0) return null; + const basicScale = [0.6, 0.9, 1.2][getRandom(0, 2)]; + + const getScale = (diffTime) => { + if (diffTime < this.data.scaleTime) { + return +(diffTime / this.data.scaleTime).toFixed(2) * basicScale; + } else { + return basicScale; + } + }; + const context = this.data.context; + // 随机读取一个图片来渲染 + const image: any = this.data.imgsList[getRandom(0, this.data.imgsList.length - 1)]; + const offset = 20; + const basicX = this.data.width / 2 + getRandom(-offset, offset); + const angle = getRandom(2, 10); + let ratio = getRandom(10, 30) * (getRandom(0, 1) ? 1 : -1); + const getTranslateX = (diffTime) => { + if (diffTime < this.data.scaleTime) { + // 放大期间,不进行摇摆位移 + return basicX; + } else { + return basicX + ratio * Math.sin(angle * (diffTime - this.data.scaleTime)); + } + }; + + const getTranslateY = (diffTime) => { + return image.height / 2 + (this.data.height - image.height / 2) * (1 - diffTime); + }; + + const fadeOutStage = getRandom(14, 18) / 100; + const getAlpha = (diffTime) => { + let left = 1 - +diffTime; + if (left > fadeOutStage) { + return 1; + } else { + return 1 - +((fadeOutStage - left) / fadeOutStage).toFixed(2); + } + }; + + return (diffTime) => { + // 差值满了,即结束了 0 ---》 1 + if (diffTime >= 1) return true; + context.save(); + const scale = getScale(diffTime); + // const rotate = getRotate(); + const translateX = getTranslateX(diffTime); + const translateY = getTranslateY(diffTime); + context.translate(translateX, translateY); + context.scale(scale, scale); + // context.rotate(rotate * Math.PI / 180); + context.globalAlpha = getAlpha(diffTime); + context.drawImage(image, -image.width / 2, -image.height / 2, image.width, image.height); + context.restore(); + }; + }, + scan() { + this.data.context.clearRect(0, 0, this.data.width, this.data.height); + this.data.context.fillStyle = "rgba(255, 255, 255, 0)"; + this.data.context.fillRect(0, 0, 200, 400); + let index = 0; + let length = this.data.renderList.length; + if (length > 0) { + this.requestFrame(this.scan.bind(this)); + this.setData({ + scanning: true, + }); + } else { + this.setData({ + scanning: false, + }); + } + while (index < length) { + const child = this.data.renderList[index]; + if (!child || !child.render || child.render.call(null, (Date.now() - child.timestamp) / child.duration)) { + // 结束了,删除该动画 + this.setData({ + renderList: [...this.data.renderList].filter((_item, fIndex) => fIndex != index), + }); + length--; + } else { + // continue + index++; + } + } + }, + start() { + const render = this.createRender(); + const duration = getRandom(1500, 3000); + this.setData({ + renderList: [ + ...this.data.renderList, + { + render, + duration, + timestamp: Date.now(), + }, + ], + }); + + if (!this.data.scanning) { + this.setData({ + scanning: true, + }); + + this.requestFrame(this.scan.bind(this)); + // this.scan.bind(this)(); + } + return this; + }, + requestFrame(cb) { + return ( + this.data.context.requestAnimationFrame || + (function (callback) { + setTimeout(callback, 1000 / 60); + })(cb) + ); + }, + }, +}); diff --git a/src/components/star/index.wxml b/src/components/star/index.wxml new file mode 100644 index 0000000..3fb0131 --- /dev/null +++ b/src/components/star/index.wxml @@ -0,0 +1 @@ + diff --git a/src/components/text-expandsion/index.json b/src/components/text-expandsion/index.json new file mode 100644 index 0000000..f719411 --- /dev/null +++ b/src/components/text-expandsion/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/text-expandsion/index.scss b/src/components/text-expandsion/index.scss new file mode 100644 index 0000000..3fa0914 --- /dev/null +++ b/src/components/text-expandsion/index.scss @@ -0,0 +1,62 @@ +.text-expansion { + display: flex; + &__text { + position: relative; + width: 100%; + font-size: 28rpx; + color: var(--color); + overflow: hidden; + line-height: 1.5; + max-height: 9em; + text-align: justify; + &::before { + content: ""; + float: right; + height: 100%; + margin-bottom: -40rpx; + } + &::after { + content: ""; + width: 100vw; + height: 100vh; + position: absolute; + box-shadow: inset calc(120rpx - 100vw) calc(1.45em - 100vh) 0 0 #fff; + margin-left: -120rpx; + } + } + &__button { + position: relative; + font-size: 24rpx; + font-weight: bold; + float: right; + clear: both; + line-height: 42rpx; + &::before { + content: "..."; + margin-right: 8rpx; + } + &::after { + content: ""; + display: inline-block; + margin-bottom: 2rpx; + margin-left: 4rpx; + transition: transform 0.3s; + border-top: 10rpx solid var(--color); + border-left: 8rpx solid transparent; + border-right: 8rpx solid transparent; + } + } +} + +.text-expansion__text--expand { + max-height: none; + &::after { + visibility: hidden; + } + .text-expansion__button::before { + visibility: hidden; + } + .text-expansion__button::after { + transform: rotate(180deg); + } +} diff --git a/src/components/text-expandsion/index.ts b/src/components/text-expandsion/index.ts new file mode 100644 index 0000000..7882886 --- /dev/null +++ b/src/components/text-expandsion/index.ts @@ -0,0 +1,34 @@ +Component({ + properties: { + text: { + type: String, + value: '', + }, + expandText: { + type: String, + value: '展开', + }, + collapseText: { + type: String, + value: '收起', + }, + color: { + type: String, + value: '#000', + }, + expendColor: { + type: String, + value: '#e04775', + }, + }, + data: { + isExpand: false, + }, + methods: { + onClick() { + this.setData({ + isExpand: !this.data.isExpand, + }) + }, + }, +}) diff --git a/src/components/text-expandsion/index.wxml b/src/components/text-expandsion/index.wxml new file mode 100644 index 0000000..fba81eb --- /dev/null +++ b/src/components/text-expandsion/index.wxml @@ -0,0 +1,6 @@ + + + {{ isExpand ? collapseText : expandText }} + {{ text }} + + diff --git a/src/components/timeOut/index.json b/src/components/timeOut/index.json new file mode 100644 index 0000000..f719411 --- /dev/null +++ b/src/components/timeOut/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/timeOut/index.scss b/src/components/timeOut/index.scss new file mode 100644 index 0000000..0779aa3 --- /dev/null +++ b/src/components/timeOut/index.scss @@ -0,0 +1,154 @@ +.movearea { + position: fixed; + right: 0; + top: 100rpx; + height: calc(100vh - 200rpx); + width: 0; + .moveview { + position: relative; + width: 0; + height: 0; + .move-container { + perspective: 1000px; + position: absolute; + left: -20rpx; + top: 50%; + width: 112rpx; + height: 112rpx; + transform: translate(-100%, -50%); + .aside-out { + width: 100%; + height: 100%; + position: relative; + transition: 1.5s; + transition-timing-function: cubic-bezier(0.075, 0.82, 0.165, 1); + transform-style: preserve-3d; + transform-origin: center; + .front { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + .progress { + width: inherit; + height: inherit; + background: conic-gradient(#e04775 var(--progress), #fff 0%); + border-radius: 50%; + position: relative; + box-sizing: border-box; + box-shadow: + 0rpx 8rpx 18rpx 0rpx rgba(0, 0, 0, 0.12), + -6rpx 0rpx 18rpx 0rpx rgba(0, 0, 0, 0.09); + .progress-wrpa { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + width: 92rpx; + height: 92rpx; + background-color: #fff; + border-radius: 50%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + .icon { + width: 56rpx; + height: 56rpx; + } + .content { + margin-top: -12rpx; + width: 68rpx; + height: 26rpx; + text-align: center; + line-height: 26rpx; + font-size: 20rpx; + color: #eaeded; + background: linear-gradient(180deg, #fddd39 0%, #f5ad1d 100%); + border-radius: 16rpx; + text-shadow: 0px 0px 6px #ba7000; + } + } + } + } + .back { + position: absolute; + width: 100%; + height: 100%; + background-color: darkseagreen; + transform: rotateY(180deg); + backface-visibility: hidden; + box-sizing: border-box; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background-color: #fff; + border-radius: 50%; + // border: 7rpx solid #e04775; + .icon { + width: 56rpx; + height: 56rpx; + } + .sub-icon { + position: absolute; + top: 40rpx; + right: 16rpx; + width: 20rpx; + height: 20rpx; + } + .content { + margin-top: -12rpx; + width: 80rpx; + height: 26rpx; + text-align: center; + line-height: 26rpx; + font-size: 16rpx; + color: #eaeded; + background: linear-gradient(180deg, #fddd39 0%, #f5ad1d 100%); + border-radius: 16rpx; + text-shadow: 0px 0px 6px #ba7000; + } + } + &.perspective { + transform: rotateY(180deg); + .front { + .progress { + background: conic-gradient(#fff var(--progress), #fff 0%); + } + } + } + } + } + } +} + +.toast { + padding: 50rpx; + position: fixed; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + background-color: rgba(0, 0, 0, 0.74); + border-radius: 32rpx; + max-width: 80vw; + .icon { + display: block; + margin: 0 auto; + width: 80rpx; + height: 80rpx; + } + .content { + margin-top: 24rpx; + text-align: center; + font-size: 32rpx; + color: #ffffff; + .p { + white-space: nowrap; + } + .num { + color: #f5ad1d; + } + } +} diff --git a/src/components/timeOut/index.ts b/src/components/timeOut/index.ts new file mode 100644 index 0000000..08c16d9 --- /dev/null +++ b/src/components/timeOut/index.ts @@ -0,0 +1,101 @@ +const app = getApp(); + +// pages/story/a.ts +Component({ + /** + * 组件的属性列表 + */ + properties: { + detailId: { + type: String, + value: "0", + }, + asideOut: { + type: Boolean, + value: false, + }, + asideType: { + type: String, + value: "", + }, + timeToast: { + type: Boolean, + value: false, + }, + timeToastType: { + type: String, + value: "", + }, + timeToastParams: { + type: Object, + value() { + return {}; + }, + }, + }, + observers: { + asideOut: function (asideOut) { + if (asideOut) { + setTimeout(() => { + this.countDown(); + }, 1000); + } + }, + }, + lifetimes: { + attached() { + let systemInfo = wx.getSystemInfoSync(); + this.setData({ + sliderTop: systemInfo.screenHeight - 250, + }); + }, + detached() { + if (this.timer) clearInterval(this.timer); + }, + }, + data: { + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + + rewardScore: 0, + + circleVal: 100, + centerVal: 9, + sliderTop: 450, + }, + methods: { + timer: null as any, + countDown() { + const that = this; + if (that.timer) return; + let circle = 100; + that.timer = setInterval(() => { + circle--; + that.setData({ + circleVal: circle, + centerVal: Math.floor(circle / 10), + }); + if (circle <= 0) { + clearInterval(that.timer); + this.handleAsideOut(); + } + }, 100); + }, + handleAsideOut() { + wx.ajax({ + method: "POST", + url: "?r=xd/score/send-score", + data: { + Type: this.data.asideType, + Id: this.data.detailId, + }, + }).then((res) => { + if (!Array.isArray(res)) { + this.setData({ + rewardScore: res.rewardScore, + }); + } + }); + }, + }, +}); diff --git a/src/components/timeOut/index.wxml b/src/components/timeOut/index.wxml new file mode 100644 index 0000000..5bcf11d --- /dev/null +++ b/src/components/timeOut/index.wxml @@ -0,0 +1,117 @@ + + + + + + + + + {{centerVal}}秒 + + + + + + + +{{rewardScore}}能量 + + + + + + + + + + 与病友同行 + 治病路上你不再孤独 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 点赞,也是一种力量! + 愿你的每一天都充满阳光 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 感谢您的分享 + 让我们一起传递爱与温暖 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 今天又学到一个健康知识啦 + 掌握健康,从学习知识开始获得 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 点赞,也是一种力量! + 愿你的每一天都充满阳光 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 感谢您的分享 + 让我们一起传递知识与智慧 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 收藏知识,构建属于你的知识库 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 了解医保知识 享受健康保障 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 今天又学到一个医保知识啦~ + 学习医保知识,为您的治疗减负 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 使用就诊地图 + 为您的健康保驾护航 + + +{{timeToastParams.rewardScore}} + 能量 + + + + 今天又认识一个医院啦~ + 了解更多医院,让您的治疗更方便 + + +{{timeToastParams.rewardScore}} + 能量 + + + + + +{{timeToastParams.rewardScore}} + 能量 + + + diff --git a/src/components/toast/index.json b/src/components/toast/index.json new file mode 100644 index 0000000..a5782f0 --- /dev/null +++ b/src/components/toast/index.json @@ -0,0 +1,9 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "@vant/weapp/popup/index", + "mp-html": "mp-html", + "van-icon": "@vant/weapp/icon/index", + "van-checkbox": "@vant/weapp/checkbox/index" + } +} diff --git a/src/components/toast/index.scss b/src/components/toast/index.scss new file mode 100644 index 0000000..bc2557c --- /dev/null +++ b/src/components/toast/index.scss @@ -0,0 +1,2578 @@ +.row-close { + margin-top: 44rpx; + display: flex; + justify-content: center; +} + +.popup { + position: relative; + z-index: 9999999999; + .badge { + position: relative; + display: block; + margin: 0 auto 0; + width: 350rpx; + height: 350rpx; + z-index: 1; + } + + .popup-container { + margin-top: -200rpx; + width: 90vw; + border-radius: 24rpx; + padding: 164rpx 50rpx 62rpx; + box-sizing: border-box; + text-align: center; + background: linear-gradient(180deg, #82a4f7 0%, #fbfcff 30%, #ffffff 100%); + + .title { + margin-top: 38rpx; + font-size: 36rpx; + color: #3b4f98; + font-weight: bold; + } + + .content { + margin-top: 20rpx; + font-size: 32rpx; + color: #afb7cb; + line-height: 52rpx; + + .num { + color: #ee9d1f; + font-size: 48rpx; + font-weight: bold; + } + .beg { + .b-title { + font-size: 32rpx; + color: #ee9d1f; + } + } + .operate-one { + .o-title { + font-size: 32rpx; + color: #afb7cb; + .o-num { + font-size: 48rpx; + } + } + .o-content { + font-size: 40rpx; + color: #ee9d1f; + } + } + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #1241b3; + } + + .submit { + background-color: #1241b3; + } + } + } +} + +.popup-medicine { + .badge { + position: relative; + display: block; + margin: 0 auto 0; + width: 304rpx; + height: 299rpx; + z-index: 1; + } + + .popup-container { + margin-top: -250rpx; + width: 90vw; + border-radius: 24rpx; + padding: 255rpx 50rpx 50rpx; + box-sizing: border-box; + text-align: center; + background-color: #fff; + + .label { + margin-top: 7rpx; + font-size: 36rpx; + color: #afb7cb; + margin-bottom: 10rpx; + } + + .name { + font-size: 32rpx; + color: #3b4f98; + font-weight: bold; + } + } +} + +.popup-scan { + width: 90vw; + position: relative; + + .bg { + width: 100%; + } + + .popup-container { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + box-sizing: border-box; + margin-top: 255rpx; + padding: 40rpx 50rpx 62rpx; + border-radius: 19rpx; + background-color: #fff; + text-align: center; + + .title { + margin-top: 38rpx; + font-size: 48rpx; + color: #3b4f98; + font-weight: bold; + } + + .content { + margin-top: 20rpx; + font-size: 36rpx; + color: #3b4f98; + line-height: 62rpx; + + .num { + color: #ee9d1f; + font-size: 36rpx; + font-weight: bold; + } + } + + .label { + margin-top: 7rpx; + font-size: 36rpx; + color: #afb7cb; + } + + .name { + font-size: 36rpx; + color: #3b4f98; + font-weight: bold; + } + } +} + +.popup-record-success { + .badge { + position: relative; + display: block; + margin: 0 auto 0; + width: 350rpx; + height: 350rpx; + z-index: 1; + } + .popup-container { + margin-top: -200rpx; + width: 80vw; + box-sizing: border-box; + padding: 204rpx 50rpx 62rpx; + border-radius: 19rpx; + background-color: #fff; + text-align: center; + background: linear-gradient(180deg, #82a4f7 0%, #fbfcff 30%, #ffffff 100%); + + .tip { + font-size: 36rpx; + color: #3b4f98; + line-height: 67rpx; + font-weight: bold; + } + .beginner { + font-size: 32rpx; + color: #ee9d1f; + margin-top: 10rpx; + } + } +} + +.popup-class { + position: relative; + width: 100vw; + padding: 304rpx 0; + + .bg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + + .popup-container { + position: relative; + margin: 0 auto; + z-index: 1; + width: 600rpx; + padding: 0 40rpx 62rpx; + border-radius: 19rpx; + box-sizing: border-box; + background-color: #fff; + text-align: center; + background: linear-gradient(180deg, #c6d6fa 0%, #f8fafe 30%, #ffffff 100%); + + .badge { + margin-top: -80rpx; + width: 376rpx; + height: 350rpx; + } + + .op { + .op-tip { + margin-top: 40rpx; + font-size: 40rpx; + color: #3b4f98; + font-weight: bold; + } + .title { + margin-top: 20rpx; + font-size: 32rpx; + color: #ee9d1f; + } + .price { + margin-top: 16rpx; + font-size: 32rpx; + color: #afb7cb; + .p-num { + font-size: 48rpx; + color: #ee9d1f; + } + } + } + + .tip { + margin-top: 40rpx; + font-size: 36rpx; + color: #3b4f98; + font-weight: bold; + } + .ml { + margin-top: 20rpx; + font-size: 32rpx; + color: #afb7cb; + .num { + font-size: 48rpx; + color: #ee9d1f; + } + } + + .done { + margin-top: 56rpx; + height: 80rpx; + text-align: center; + line-height: 80rpx; + font-size: 32rpx; + font-weight: bold; + color: #ffffff; + background: #1241b3; + border-radius: 49px; + } + } +} + +.popup-class-inject { + .badge { + position: relative; + z-index: 1; + display: block; + margin: 0 auto; + width: 364rpx; + height: 380rpx; + } + + .popup-container { + margin-top: -277rpx; + width: 90vw; + padding: 248rpx 50rpx 62rpx; + border-radius: 19rpx; + box-sizing: border-box; + background-color: #fff; + text-align: center; + + .content { + font-size: 40rpx; + color: #3b4f98; + line-height: 60rpx; + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + } +} + +.popup-unbind { + .badge { + position: relative; + z-index: 1; + display: block; + margin: 0 auto; + width: 256rpx; + height: 256rpx; + } + + .popup-container { + margin-top: -177rpx; + width: 90vw; + padding: 220rpx 50rpx 62rpx; + border-radius: 19rpx; + box-sizing: border-box; + background-color: #fff; + text-align: center; + + .content { + font-size: 36rpx; + color: #cf5375; + line-height: 60rpx; + font-weight: bold; + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #cf5375; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #cf5375; + } + } + } +} + +.popup-withdraw { + .badge { + position: relative; + z-index: 1; + display: block; + margin: 0 auto; + width: 204rpx; + height: 278rpx; + } + + .popup-container { + margin-top: -206rpx; + width: 626rpx; + padding: 220rpx 50rpx 62rpx; + border-radius: 19rpx; + box-sizing: border-box; + background-color: #fff; + text-align: center; + + .content { + font-size: 32rpx; + color: #484848; + font-weight: bold; + line-height: 50rpx; + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #e04775; + border: 2rpx solid #f0b8c9; + } + + .submit { + background: #e04775; + } + } + } +} + +.popup-home-inhibitor { + text-align: center; + .badge { + width: 481rpx; + height: 476rpx; + } + .popup-container { + margin-top: -310rpx; + border-top: 129rpx solid #023ebb; + width: 90vw; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + background-color: #023ebb; + .container { + position: relative; + z-index: 10; + background-color: #fff; + border-radius: 19rpx; + padding: 69rpx 42rpx 62rpx; + .title { + font-size: 36rpx; + color: #023eba; + font-weight: bold; + } + .day { + font-size: 28rpx; + color: #aeb7cd; + .num { + font-size: 42rpx; + color: #fa7b7e; + } + } + + .content { + margin-top: 29rpx; + padding: 38rpx 16rpx; + font-size: 28rpx; + color: #9ba5bd; + line-height: 42rpx; + border-radius: 12rpx; + background-color: #f7f8fb; + .c-title { + color: #3b4f98; + font-weight: bold; + margin-bottom: 30rpx; + } + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + } + } +} + +.popup-my-health-record { + .badge { + position: relative; + display: block; + margin: 0 auto 0; + width: 285rpx; + height: 282rpx; + z-index: 1; + } + + .popup-container { + margin-top: -170rpx; + width: 90vw; + border-radius: 24rpx; + padding: 164rpx 50rpx 62rpx; + box-sizing: border-box; + text-align: center; + background-color: #fff; + + .title { + margin-top: 28rpx; + font-size: 44rpx; + color: #3b4f98; + font-weight: bold; + line-height: 62rpx; + } + .week { + margin-top: 19rpx; + font-size: 44rpx; + color: #3b4f98; + font-weight: bold; + line-height: 62rpx; + } + + .content { + font-size: 32rpx; + color: #afb7cb; + line-height: 52rpx; + + .num { + color: #ee9d1f; + font-size: 48rpx; + font-weight: bold; + } + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #1241b3; + } + + .submit { + background-color: #1241b3; + } + } + } +} + +.popup-doc { + .popup-container { + width: 90vw; + border-radius: 24rpx; + padding: 62rpx 50rpx 62rpx; + box-sizing: border-box; + text-align: center; + background-color: #fff; + + .title { + margin-top: 28rpx; + font-size: 44rpx; + color: #3b4f98; + font-weight: bold; + line-height: 62rpx; + } + + .content { + margin-top: 20rpx; + font-size: 28rpx; + height: 50vh; + overflow-y: scroll; + text-align: left; + .h1 { + text-indent: 2em; + color: #919191; + line-height: 52rpx; + } + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #1241b3; + } + + .submit { + background-color: #1241b3; + } + } + } +} + +.popup-reg-protocol { + text-align: center; + .popup-container { + width: 90vw; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + background-color: #023ebb; + .container { + position: relative; + z-index: 10; + background-color: #fff; + border-radius: 19rpx; + padding: 69rpx 42rpx 62rpx; + .title { + font-size: 40rpx; + color: #495069; + font-weight: bold; + } + + .content { + margin-top: 29rpx; + padding: 38rpx 16rpx; + font-size: 32rpx; + color: #9ba5bd; + border-radius: 12rpx; + line-height: 54rpx; + } + + .footer { + margin-top: 42rpx; + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + .protocol { + display: flex; + justify-content: center; + align-items: center; + margin-top: 30rpx; + font-size: 24rpx; + color: #9ba5bd; + .checkbox { + display: inline; + width: 32rpx; + height: 32rpx; + } + .a { + color: #1241b3; + } + } + } + } + } +} + +.popup-class-detail-once { + text-align: center; + .popup-container { + width: 90vw; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + background-color: #023ebb; + .container { + position: relative; + z-index: 10; + background-color: #fff; + border-radius: 19rpx; + padding: 69rpx 42rpx 62rpx; + .title { + font-size: 36rpx; + color: #023eba; + font-weight: bold; + } + + .content { + margin-top: 29rpx; + padding: 38rpx 16rpx; + font-size: 28rpx; + color: #9ba5bd; + line-height: 42rpx; + border-radius: 12rpx; + background-color: #f7f8fb; + text-align: justify; + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + } + } +} + +.popup-soory-enter { + text-align: center; + .popup-container { + width: 90vw; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + background-color: #023ebb; + .container { + position: relative; + z-index: 10; + background-color: #fff; + background-size: 100% 100%; + background-repeat: no-repeat; + border-radius: 19rpx; + padding: 69rpx 42rpx 62rpx; + .badge { + display: block; + margin: 0 auto; + width: 110rpx; + height: 138rpx; + } + + .content { + max-height: 35vh; + overflow-y: scroll; + font-size: 26rpx; + color: #495069; + text-align: justify; + line-height: 44rpx; + .br { + padding: 12rpx 0; + } + } + + .protocol { + margin-top: 32rpx; + font-size: 24rpx; + color: #495069; + .p-header { + display: flex; + justify-content: center; + .checkbox { + margin-right: 12rpx; + width: 32rpx; + height: 32rpx; + display: inline; + overflow: hidden; + } + .a { + color: #1241b3; + } + } + .tip { + margin-top: 24rpx; + text-align: justify; + color: #b6b7ba; + } + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 84rpx; + box-sizing: border-box; + line-height: 84rpx; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #e04775; + } + } + } + } +} + +.popup-story-lead { + padding-top: 20rpx; + text-align: center; + .popup-header { + position: relative; + padding: 43rpx 0 60rpx 54rpx; + font-size: 28rpx; + background: #1241b3; + border-radius: 24rpx 93rpx 24rpx 24rpx; + .content { + font-size: 28rpx; + line-height: 46rpx; + color: #fff; + text-align-last: left; + .num { + font-size: 36rpx; + } + } + .bg { + position: absolute; + right: 0; + top: 0; + width: 196rpx; + height: 181rpx; + } + } + .popup-container { + position: relative; + margin-top: -20rpx; + width: 90vw; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + .bg { + width: 100%; + height: 600rpx; + } + .container { + position: absolute; + top: 0; + left: 0; + width: 100%; + box-sizing: border-box; + // background-color: #fff; + border-radius: 19rpx; + padding: 69rpx 42rpx 62rpx; + + .content { + font-size: 42rpx; + color: #023eba; + font-weight: bold; + text-align: justify; + line-height: 60rpx; + } + .sub-content { + margin-top: 21rpx; + font-size: 28rpx; + text-align: justify; + line-height: 44rpx; + color: #aeb7cd; + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: center; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + max-width: 312rpx; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + } + } +} + +.popup-story-star { + text-align: center; + .badge { + position: relative; + z-index: 2; + display: block; + width: 306rpx; + height: 233rpx; + margin: 0 auto; + } + .popup-container { + position: relative; + z-index: 1; + margin-top: -156rpx; + width: 624rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + height: 600rpx; + background-color: #fff; + .bg { + width: 100%; + } + .container { + position: absolute; + top: 0; + left: 0; + width: 100%; + box-sizing: border-box; + border-radius: 19rpx; + padding: 163rpx 42rpx 62rpx; + + .content { + font-size: 42rpx; + color: #023eba; + font-weight: bold; + text-align: justify; + text-align: center; + } + .sub-content { + text-align: center; + margin-top: 21rpx; + font-size: 28rpx; + text-align: justify; + line-height: 52rpx; + color: #023eba; + view { + text-align: center; + } + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: center; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + max-width: 312rpx; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + .tip { + margin-top: 30rpx; + font-size: 28rpx; + color: #aeb7cd; + } + } + } +} + +.popup-story-share { + text-align: center; + .badge { + position: relative; + z-index: 2; + width: 325rpx; + height: 335rpx; + } + .popup-container { + margin-top: -250rpx; + position: relative; + z-index: 1; + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + height: 652rpx; + padding-right: 20rpx; + margin-left: 10rpx; + .bg { + width: 100%; + height: 100%; + } + .container { + position: absolute; + left: 0; + top: 0; + width: 100%; + box-sizing: border-box; + border-radius: 19rpx; + padding: 251rpx 42rpx 62rpx; + .satellite1 { + width: 62rpx; + height: 62rpx; + position: absolute; + top: 133rpx; + left: 19px; + } + .satellite2 { + width: 52rpx; + height: 52rpx; + position: absolute; + top: 370rpx; + right: 0; + } + .sub-content { + padding: 23rpx 0 39rpx; + margin: 36rpx 15rpx 0; + text-align: center; + font-size: 28rpx; + text-align: justify; + line-height: 44rpx; + color: #495069; + background-color: #fff; + border-radius: 22rpx; + view { + text-align: center; + text { + color: #ee9d1f; + font-size: 28rpx; + font-weight: bold; + } + } + } + + .footer { + margin-top: 43rpx; + display: flex; + justify-content: center; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + max-width: 312rpx; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #fff; + border-color: #afb7cb; + background-color: #afb7cb; + } + + .submit { + background-color: #1241b3; + } + } + .tip { + margin-top: 30rpx; + font-size: 28rpx; + color: #aeb7cd; + } + } + } +} + +.popup-beginner-guide { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .container { + box-sizing: border-box; + border-radius: 19rpx; + padding: 0 42rpx 62rpx; + background-color: #fff; + .badge { + width: 320rpx; + height: 320rpx; + } + .content { + margin-top: 28rpx; + font-size: 36rpx; + color: #023eba; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 20rpx; + font-size: 28rpx; + color: #364e9e; + font-weight: bold; + .num { + color: #fc7c7c; + } + } + .submit { + margin-top: 56rpx; + width: 100%; + height: 80rpx; + font-size: 32rpx; + color: #ffffff; + text-align: center; + line-height: 80rpx; + background: #023eba; + border-radius: 100rpx 100rpx 100rpx 100rpx; + } + } + } +} + +.popup-tfb-success { + .badge { + position: relative; + display: block; + margin: 0 auto 0; + width: 350rpx; + height: 350rpx; + z-index: 1; + } + .popup-container { + margin-top: -200rpx; + width: 80vw; + box-sizing: border-box; + padding: 204rpx 50rpx 62rpx; + border-radius: 19rpx; + background-color: #fff; + text-align: center; + background: linear-gradient(180deg, #82a4f7 0%, #fbfcff 30%, #ffffff 100%); + + .tip { + font-size: 40rpx; + color: #3b4f98; + line-height: 67rpx; + font-weight: bold; + } + .beginner { + font-size: 32rpx; + color: #afb7cb; + margin-top: 10rpx; + line-height: 44rpx; + .num { + font-size: 48rpx; + color: #ee9d1f; + } + } + } +} + +.popup-adl-alert { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 430rpx; + height: 304rpx; + } + .container { + margin-top: -184rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 184rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 16rpx; + font-size: 32rpx; + color: #484848; + .num { + color: #fc7c7c; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + display: flex; + justify-content: space-between; + .cancel { + margin-right: 30rpx; + flex: 1; + height: 88rpx; + font-size: 32rpx; + color: #cf5375; + text-align: center; + line-height: 84rpx; + border-radius: 24rpx; + box-sizing: border-box; + border: 2rpx solid #f0b8c9; + } + .submit { + flex: 1; + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } + &.popup-adl-alert-drug { + .container { + background: linear-gradient(180deg, #dffffc 0%, #ffffff 40%, #ffffff 100%); + .c-footer { + .cancel { + border-color: #25d9c8; + color: #25d9c8; + } + .submit { + background-color: #4cebdc; + } + } + } + } +} + +.popup-adl-alert-test { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 274rpx; + height: 230rpx; + } + .container { + margin-top: -184rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 184rpx 42rpx 20rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 16rpx; + font-size: 32rpx; + color: #484848; + .num { + color: #fc7c7c; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + .submit { + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + .cancel { + margin-top: 10rpx; + height: 88rpx; + font-size: 34rpx; + color: #484848; + line-height: 88rpx; + } + } + } + } + &.popup-adl-alert-test-drug { + .container { + background: linear-gradient(180deg, #dffffc 0%, #ffffff 40%, #ffffff 100%); + .c-footer { + .submit { + background-color: #4cebdc; + } + } + } + } +} + +.popup-vip { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .container { + box-sizing: border-box; + border-radius: 19rpx; + padding: 48rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .badge { + width: 166rpx; + height: 170rpx; + } + .content { + margin-top: 24rpx; + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 32rpx; + font-size: 32rpx; + color: #cf5375; + .icon { + width: 32rpx; + height: 22rpx; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + .submit { + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } +} + +.popup-task-model { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 430rpx; + height: 304rpx; + } + .container { + margin-top: -184rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 184rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + font-size: 36rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 16rpx; + font-size: 28rpx; + color: #484848; + .num { + color: #fc7c7c; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + .link { + color: #cf5375; + } + } + .c-footer { + margin: 32rpx 0 0; + display: flex; + justify-content: space-between; + .cancel { + margin-right: 30rpx; + flex: 1; + height: 88rpx; + font-size: 32rpx; + color: #cf5375; + text-align: center; + line-height: 84rpx; + border-radius: 24rpx; + box-sizing: border-box; + border: 2rpx solid #f0b8c9; + } + .submit { + flex: 1; + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } + &.popup-task-model-drug { + .container { + background: linear-gradient(180deg, #dffffc 0%, #ffffff 40%, #ffffff 100%); + .warn { + .link { + color: #25d9c8; + } + } + .c-footer { + .cancel { + border-color: #25d9c8; + color: #25d9c8; + } + .submit { + background-color: #4cebdc; + } + } + } + } +} + +.popup-health-care { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 430rpx; + height: 304rpx; + } + .container { + margin-top: -184rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 184rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 16rpx; + font-size: 32rpx; + color: #484848; + .num { + color: #fc7c7c; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + display: flex; + justify-content: space-between; + .cancel { + margin-right: 30rpx; + flex: 1; + height: 88rpx; + font-size: 32rpx; + color: #cf5375; + text-align: center; + line-height: 84rpx; + border-radius: 24rpx; + box-sizing: border-box; + border: 2rpx solid #f0b8c9; + } + .submit { + flex: 1; + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } + &.popup-health-care-drug { + .container { + background: linear-gradient(180deg, #dffffc 0%, #ffffff 40%, #ffffff 100%); + .c-footer { + .cancel { + border-color: #25d9c8; + color: #25d9c8; + } + .submit { + background-color: #4cebdc; + } + } + } + } +} + +.popup-ndrl-adl-alert { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 430rpx; + height: 304rpx; + } + .container { + margin-top: -184rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 184rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 16rpx; + font-size: 32rpx; + color: #484848; + .num { + color: #fc7c7c; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + display: flex; + justify-content: space-between; + .cancel { + margin-right: 30rpx; + flex: 1; + height: 88rpx; + font-size: 32rpx; + color: #cf5375; + text-align: center; + line-height: 84rpx; + border-radius: 24rpx; + box-sizing: border-box; + border: 2rpx solid #f0b8c9; + } + .submit { + flex: 1; + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } + &.popup-ndrl-adl-alert-drug { + .container { + background: linear-gradient(180deg, #dffffc 0%, #ffffff 40%, #ffffff 100%); + .c-footer { + .cancel { + border-color: #25d9c8; + color: #25d9c8; + } + .submit { + background-color: #4cebdc; + } + } + } + } +} + +.popup-ndrl-follow { + position: relative; + z-index: 9999999999; + .badge { + position: relative; + display: block; + margin: 0 0 0 205rpx; + width: 231rpx; + height: 207rpx; + z-index: 1; + } + + .popup-container { + width: calc(100vw - 160rpx); + border-radius: 24rpx; + box-sizing: border-box; + text-align: center; + .container { + margin-top: -80rpx; + padding: 53rpx 40rpx 58rpx; + background: linear-gradient(180deg, #ffe0ea 0%, #fff 50%, #ffffff 100%); + border-radius: 24rpx; + .title { + margin-top: 38rpx; + font-size: 40rpx; + color: #cd355f; + font-weight: bold; + } + .price { + margin: 10rpx auto 0; + font-size: 56rpx; + color: #f5ad1d; + display: flex; + justify-content: center; + align-items: baseline; + font-weight: bold; + .sub { + font-size: 36rpx; + color: #484848; + } + } + + .content { + margin-top: 16rpx; + font-size: 32rpx; + color: #333333; + line-height: 45rpx; + } + .code { + display: block; + margin: 28rpx auto 0; + width: 238rpx; + height: 238rpx; + } + .tip { + margin-top: 14rpx; + font-size: 28rpx; + color: #666666; + } + } + + .footer { + margin-top: 37rpx; + display: flex; + justify-content: space-between; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 33rpx; + } + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #1241b3; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + color: #1241b3; + } + + .submit { + background-color: #1241b3; + } + } + } +} + +.popup-adl-progress { + position: relative; + text-align: center; + .close { + position: absolute; + top: 224rpx; + right: 40rpx; + width: 28rpx; + height: 26rpx; + } + .popup-container { + padding: 342rpx 0 0; + width: 632rpx; + height: 944rpx; + box-sizing: border-box; + background-size: 100% 100%; + .container { + width: 100%; + height: 100%; + .title { + font-size: 36rpx; + font-weight: bold; + color: #484848; + line-height: 50rpx; + } + .content { + margin-top: 32rpx; + display: flex; + justify-content: center; + align-items: baseline; + font-weight: bold; + .price { + font-size: 56rpx; + color: #f5ad1d; + } + .sub { + text-indent: 5rpx; + font-size: 36rpx; + color: #484848; + } + } + .progress { + margin-top: 10px; + position: relative; + padding: 0 80rpx; + box-sizing: border-box; + height: 142rpx; + .progress-bar { + padding: 60rpx 0 0; + } + .wrap { + position: absolute; + top: 0; + left: 80rpx; + display: flex; + justify-content: space-between; + width: calc(100% - 160rpx); + box-sizing: border-box; + .item { + text-align: center; + width: 48rpx; + .name { + font-size: 24rpx; + color: #3f3f3f; + line-height: 34rpx; + white-space: nowrap; + } + .el { + margin-top: 10rpx; + position: relative; + width: 48rpx; + height: 46rpx; + .icon { + width: 100%; + height: 100%; + } + .status { + position: absolute; + bottom: 0; + right: 0; + width: 20rpx; + height: 20rpx; + background-color: #eaeaea; + border-radius: 50%; + border: 2rpx solid #fff; + display: flex; + align-items: center; + justify-content: center; + .mini { + width: 12rpx; + height: 8rpx; + } + } + } + .num { + white-space: nowrap; + margin-top: 10rpx; + font-size: 24rpx; + color: #e7e7e7; + font-weight: bold; + &.more { + text-indent: -20rpx; + } + } + &.active { + .name { + color: #3f3f3f; + } + .el { + .status { + background-color: #e04775; + } + } + .num { + color: #e04775; + } + } + } + } + } + .tip { + margin-top: 24rpx; + font-size: 24rpx; + height: 34rpx; + color: #9e9e9e; + } + .footer { + margin-top: 22rpx; + .submit { + margin: 0 auto; + width: 350rpx; + height: 96rpx; + background: linear-gradient(180deg, #f27dad 0%, #e04775 100%); + box-shadow: 0rpx 10rpx 28rpx 0rpx rgba(207, 83, 117, 0.44); + border-radius: 48rpx; + border: 3rpx solid #ffffff; + font-size: 36rpx; + color: #ffffff; + line-height: 96rpx; + } + } + } + } + &.popup-adl-progress-drug { + .popup-container { + .container { + .progress { + .wrap { + .item { + &.active { + .status { + background: #25d9c8; + } + .num { + color: #24d8c8; + } + } + .num { + color: #e7e7e7; + } + } + } + } + .footer { + .submit { + background: linear-gradient(157deg, #4cebdc 0%, #25d9c8 100%); + box-shadow: 0rpx 10rpx 28rpx 0rpx rgba(36, 216, 200, 0.43); + } + } + } + } + } +} + +.popup-adl-progress-end { + position: relative; + text-align: center; + .close { + position: absolute; + top: 224rpx; + right: 40rpx; + width: 28rpx; + height: 26rpx; + } + .popup-container { + padding: 342rpx 0 0; + width: 630rpx; + height: 640rpx; + box-sizing: border-box; + background-size: 100% 100%; + .container { + width: 100%; + height: 100%; + .title { + font-size: 36rpx; + font-weight: bold; + color: #484848; + line-height: 50rpx; + } + .footer { + margin-top: 22rpx; + .submit { + margin: 0 auto; + width: 350rpx; + height: 96rpx; + background: linear-gradient(180deg, #f27dad 0%, #e04775 100%); + box-shadow: 0rpx 10rpx 28rpx 0rpx rgba(207, 83, 117, 0.44); + border-radius: 48rpx; + border: 3rpx solid #ffffff; + font-size: 36rpx; + color: #ffffff; + line-height: 96rpx; + } + } + } + } + &.popup-adl-progress-end-drug { + .popup-container { + .container { + .footer { + .submit { + background: linear-gradient(157deg, #4cebdc 0%, #25d9c8 100%); + box-shadow: 0rpx 10rpx 28rpx 0rpx rgba(36, 216, 200, 0.43); + } + } + } + } + } +} + +.popup-dtp-drup { + position: relative; + .popup-container { + padding: 56rpx 48rpx 48rpx; + width: 630rpx; + box-sizing: border-box; + background-size: 100% 100%; + background-color: #fff; + .container { + width: 100%; + height: 100%; + .title { + width: 384rpx; + max-height: 50rpx; + } + .content { + margin-top: 24rpx; + font-size: 32rpx; + color: #9e9e9e; + } + .footer { + margin-top: 48rpx; + .submit { + margin: 0 auto; + height: 96rpx; + text-align: center; + background: #e04775; + border-radius: 48rpx; + font-size: 36rpx; + color: #ffffff; + line-height: 96rpx; + } + } + } + } +} + +.popup-double-standards { + text-align: center; + .popup-container { + width: 604rpx; + border-radius: 19rpx; + box-sizing: border-box; + text-align: center; + padding-right: 20rpx; + margin-left: 10rpx; + .badge { + width: 435rpx; + height: 266rpx; + } + .container { + margin-top: -180rpx; + box-sizing: border-box; + border-radius: 19rpx; + padding: 166rpx 42rpx 62rpx; + background: linear-gradient(180deg, #edcfd8 0%, #ffffff 40%, #ffffff 100%); + .content { + margin-top: 24rpx; + font-size: 40rpx; + color: #484848; + line-height: 48rpx; + font-weight: bold; + } + .tip { + margin-top: 30rpx; + font-size: 28rpx; + color: #cccccc; + .icon { + width: 32rpx; + height: 22rpx; + } + } + .warn { + margin-top: 44rpx; + display: inline-flex; + align-items: center; + padding: 0 14rpx; + height: 48rpx; + background: #ededed; + border-radius: 24rpx; + font-size: 28rpx; + color: #484848; + line-height: 48rpx; + .icon { + width: 32rpx; + height: 32rpx; + margin-right: 8rpx; + } + } + .c-footer { + margin: 32rpx 0 0; + .submit { + height: 88rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 88rpx; + background: #cf5375; + border-radius: 24rpx; + } + } + } + } + &.popup-double-standards-drug { + .popup-container { + .container { + background: #fff linear-gradient(180deg, rgba(38, 218, 200, 0.3) 0%, #fff 40%, #ffffff 100%); + .c-footer { + .submit { + background-color: #24d8c8; + } + } + } + } + } +} + +.popup-dedicated-doctor { + .popup-container { + position: relative; + padding: 392rpx 40rpx 0; + width: 670rpx; + height: 496rpx; + box-sizing: border-box; + .content { + position: absolute; + top: 78rpx; + right: 20rpx; + width: 462rpx; + height: 122rpx; + animation: hu__hu__ infinite 2s ease-in-out; + @keyframes hu__hu__ { + 50% { + transform: translateY(20rpx); + } + } + } + .btn { + width: 610rpx; + height: 80rpx; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + text-align: center; + line-height: 80rpx; + background: #cf5375; + border-radius: 24rpx 24rpx 24rpx 24rpx; + } + } + .close { + margin: 68rpx auto 0; + display: block; + width: 64rpx; + height: 64rpx; + } + &.popup-dedicated-doctor-drug { + .popup-container { + .btn { + background-color: rgba(37, 217, 200, 1); + } + } + } +} + +.popup-export-loading-doctor { + .badge { + position: relative; + z-index: 1; + display: block; + margin: 0 auto; + width: 240rpx; + height: 402rpx; + } + .popup-container { + padding: 188rpx 30rpx 48rpx; + margin-top: -170rpx; + width: 650rpx; + height: 460rpx; + box-sizing: border-box; + background-color: #fff; + border-radius: 24rpx; + text-align: center; + .title { + font-size: 40rpx; + color: #283031; + line-height: 48rpx; + } + .content { + margin-top: 20rpx; + font-size: 32rpx; + color: #9aa1a2; + line-height: 40rpx; + } + .btn { + margin-top: 32rpx; + font-size: 36rpx; + color: #3464d4; + text-align: center; + line-height: 84rpx; + } + } +} + +.popup-referral-toast { + .popup-container { + position: relative; + padding: 504rpx 120rpx 0; + width: 532rpx; + height: 654rpx; + box-sizing: border-box; + .btn { + width: 296rpx; + height: 84rpx; + font-size: 36rpx; + color: rgba(255, 255, 255, 1); + text-align: center; + line-height: 80rpx; + background: #67baca; + border-radius: 48rpx; + } + } + .close { + margin: 68rpx auto 0; + display: block; + width: 64rpx; + height: 64rpx; + } +} + +.popup-patient-detail-safe-doctor { + .popup-container { + position: relative; + padding: 228rpx 50rpx 0; + width: 670rpx; + height: 566rpx; + box-sizing: border-box; + .content { + font-size: 32rpx; + color: #283031; + line-height: 48rpx; + } + .btn { + margin: 32rpx auto 0; + width: 364rpx; + height: 84rpx; + font-size: 36rpx; + color: rgba(255, 255, 255, 1); + text-align: center; + line-height: 80rpx; + background: linear-gradient(345deg, #d76c6c 0%, #fb7474 100%); + border-radius: 48rpx; + } + } + .close { + margin: 68rpx auto 0; + display: block; + width: 64rpx; + height: 64rpx; + } +} +.popup-public-toast { + .popup-container { + position: relative; + padding: 360rpx 146rpx 0; + width: 590rpx; + height: 880rpx; + box-sizing: border-box; + .code { + width: 286rpx; + height: 286rpx; + } + } + .close { + margin: 68rpx auto 0; + display: block; + width: 64rpx; + height: 64rpx; + } +} + +.popup-site-conform { + .badge { + position: relative; + z-index: 1; + display: block; + margin: 0 auto; + width: 263rpx; + height: 198rpx; + } + .popup-container { + margin-top: -138rpx; + width: 622rpx; + padding: 160rpx 34rpx 48rpx; + box-sizing: border-box; + border-radius: 24rpx; + background: linear-gradient(180deg, #ffedf3 0%, #ffffff 40%, #ffffff 100%); + .title { + text-align: center; + font-size: 32rpx; + color: rgba(72, 72, 72, 1); + line-height: 56rpx; + } + .content { + text-align: center; + font-size: 44rpx; + color: rgba(224, 71, 117, 1); + line-height: 56rpx; + font-weight: bold; + } + .footer { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + text-align: center; + + .cancel, + .submit { + flex: 1; + height: 80rpx; + box-sizing: border-box; + line-height: 78rpx; + border: 1rpx solid #cf5375; + border-radius: 48rpx; + color: #fff; + font-size: 32rpx; + font-weight: bold; + } + + .cancel { + margin-right: 33rpx; + color: #cf5375; + } + + .submit { + background-color: #cf5375; + padding: 0; + margin: 0; + } + } + } + .close { + margin: 68rpx auto 0; + display: block; + width: 64rpx; + height: 64rpx; + } +} + +.popup-level-up { + .popup-container { + position: relative; + width: 650rpx; + height: 538rpx; + padding: 328rpx 0 0 284rpx; + box-sizing: border-box; + border-radius: 24rpx; + background: linear-gradient(180deg, #ffedf3 0%, #ffffff 40%, #ffffff 100%); + .close { + position: absolute; + top: 20rpx; + right: 20rpx; + width: 60rpx; + height: 60rpx; + } + .btn { + width: 316rpx; + height: 88rpx; + } + } +} diff --git a/src/components/toast/index.ts b/src/components/toast/index.ts new file mode 100644 index 0000000..c21e978 --- /dev/null +++ b/src/components/toast/index.ts @@ -0,0 +1,139 @@ +const app = getApp() +Component({ + properties: { + show: { + type: Boolean, + value: false, + }, + type: String, + params: { + type: Object, + value() { + return {} + }, + }, + }, + observers: { + show(val) { + if (val) { + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + if (this.data.params.timeOut) { + let time = this.data.params.timeOut + const timerFunc = () => { + if (time <= 0) { + this.setData({ + timeOut: '', + }) + clearInterval(this.timer) + return + } + this.setData({ + timeOut: `${time}s`, + }) + --time + } + timerFunc() + this.timer = setInterval(timerFunc, 1000) + } + if (['storyLead', 'storyStar', 'storyShare'].includes(this.data.type)) { + this.getSettingInfo() + } + } + this.setData({ + userInfo: app.globalData.userInfo, + }) + }, + type(val) { + if (val === 'healthCare') { + this.getOpenPatientList() + } + }, + }, + data: { + imageUrl: '', + protocol: true, + timeOut: '', + settingsInfo: {}, + userInfo: {}, + openPatientList: {}, + }, + lifetimes: { + attached() { + this.setData({ + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + }) + }, + }, + methods: { + timer: null as any, + handleOk() { + if (this.data.timeOut) { + return + } + this.triggerEvent('ok', { protocol: this.data.protocol }) + }, + handleCancel(e = { currentTarget: { dataset: { key: '' } } }) { + const { key } = e.currentTarget.dataset + if (this.timer) { + clearInterval(this.timer) + this.setData({ + timeOut: '', + }) + } + this.triggerEvent('cancel', { key }) + }, + handleTaskCancel() { + this.triggerEvent('taskCancel') + }, + handleJump() { + this.triggerEvent('jump') + }, + handleDel() { + this.triggerEvent('del') + }, + routerTo(e) { + const { path } = e.currentTarget.dataset + wx.navigateTo({ + url: path, + }) + this.handleCancel() + }, + getSettingInfo() { + wx.ajax({ + method: 'GET', + url: '?r=xd/drugs/setting-info', + data: {}, + }).then((res) => { + this.setData({ + settingsInfo: res, + }) + }) + }, + getOpenPatientList() { + wx.ajax({ + method: 'GET', + url: '?r=xd/nrdl/open-patient-list', + data: {}, + }).then((res) => { + this.setData({ + openPatientList: res, + }) + }) + }, + handleProtocolChange() { + this.setData({ + protocol: !this.data.protocol, + }) + }, + handleAdlQuestion() { + wx.navigateTo({ + url: '/pages/repositoryDetail/index?id=9', + }) + }, + }, +}) diff --git a/src/components/toast/index.wxml b/src/components/toast/index.wxml new file mode 100644 index 0000000..f98a49e --- /dev/null +++ b/src/components/toast/index.wxml @@ -0,0 +1,756 @@ + + + + + + + 训练完成 + + 完成会员日活动,已获取 + {{params.MemberDayRehabilitationScore}} + 倍能量 + + + 已获取 + {{params.MemberDayScore}} + 能量 + + + + 您已完成第{{params.CompleteTimes + 1}}次训练! + + 获取 + {{params.SendScore}} + 能量能量 + + + 完成 + + + + + + + 该亲友号解绑后 + + 将无法查看ID:{{params.PatientId}}的 + + 所有健康数据,是否继续解绑? + + + 取消 + 确认 + + + + + + + + 删除代表您将放弃发布此条内容 + 删除后无法恢复且不可见 + 确认删除? + + + 确认撤回 + 取消 + + + + + + + 您是希望继续投稿吗? + + 提交 + 取消 + + + + + + + + 删除代表您将放弃发布此条内容 + + 删除后无法恢复且不可见 + + 确认删除? + + + 删除后将从平台同步撤下 + + 您将无法查看和管理 + + 确认删除? + + + 删除 + 取消 + + + + + + + + 抑制物检测提醒 + + {{params.PatientName}}已经有 + {{params.ExposureDays}}个 + 暴露日 + + + 建议做抑制物检测 + {{params.Content}} + + + 我知道了 + + + + + + + + {{params.date}} + {{params.week}} + 请选择您的要添加的记录 + + 录入出血 + 录入治疗 + + + + + + 用户须知 + + + + + {{timeOut || '同意'}} + + + + + + + 康复训练提示 + + (1)因个人体质、病情等不同,本康复训练视频仅供参考; + + (2)不满14岁儿童请或行动不便者,请在监护人、监护人委托的照管人或其它照管人的照看下进行适量训练; + + (3)建议在专业医护人员的指导下进行适量训练并由专业医生评估康复训练前的预防治疗剂量; + + (4)建议遵循说明书指引进行适量训练; + + (5)训练时请按确保您的训练环境安全; + + (6)若训练过程中有任何不适,请立即停止并立刻向医疗卫生专业人士咨询和就诊。 + + + 我已知晓 + + + + + + + + + + (1)您的故事中可能会涉及您、您的孩子或其它人的个人信息甚至敏感个人信息,如个人影像、个人健康信息及生活经历。建议您不要在故事中提及真实身份信息。请您谨慎考虑是否在此公开发布您的故事。您确认并承诺您已经向有关个人进行充分的告知并征得同意。如果有关个人未满14周岁,您确认并承诺您为该儿童的监护人并且同意公开发表该儿童的个人信息。 + + (2)若您上传图片,请您确保享有版权或已经获得第三方的合法授权有权使用,且不侵犯任何其它第三人的合法权益(包括但不限于肖像权、隐私权等)。 + + (3)您故事提交后,由运营人员进行审核、校正和编辑后,才会被发布;您的故事内容将长期发布在“我的故事”版块内。您可以随时从“我的-我的故事”撤回为仅本人查看的非公开模式。 + + + + + 同意审核和编辑后公开发布 + + 您可以随时从“我的-我的故事”撤回为仅本人查看的非公开模式。 + + + 提交我的故事 + + + + + + + + 邀请您分享本人故事 + 发布后获取 + {{settingsInfo.PublishStoryScore}} + 能量激励 + + + + + + + + 你知道吗? + 你的经历 + 可以帮助更多人 + + + 您是否有不一样的故事? + 您的经历或许能给他人带来希望和能量! + 诺和关怀邀请您分享自己的故事。 + + + + 去看看 + + + + + + + + + + + 感谢加油! + + 您的故事或许也能为他人带来能量 + 期待您的故事 + + + + 看看我能做些什么 + + + 审核发布后获取{{settingsInfo.PublishStoryScore}}能量 + + + + + + + + + + + + + 分享您的经验或故事 + 审核发布后 + + 获取 + {{settingsInfo.PublishStoryScore}} + 能量 + + + + + 看看我能做些什么 + + + + + + + + + + + + Hi,{{params.patientName}} + Hi,{{params.patientName}}妈妈 + Hi,{{params.patientName}}爸爸 + Hi,{{params.patientName}}亲友 + + 一分钟探索诺和服务 + + + 领取 + {{params.countIntegralNum}}能量 + 免费兑换礼品 + + 去领取 + + + + + + + + + 自在生活“双达标”测评提醒 + + 建议您每次用药7天后做1次“双达标”测评,更好了解身体变化 + + + + + + 取消 + 立即去做 + + + + + + + + + + + 完成您的MG-ADL评测 + 即可申请项目 + + + + 每周1次MG-ADL记录 + 身体变化有序记录 + + + 1分钟完成MG-ADL + 取消 + + + + + + + + + + + 一步认证成为 + 艾加莫德用药患友 + + + + 专属服务用户登记 + + + + 立即认证 + + + + + + + + + + 给力加油站电话随访服务启动 + + + 随访专员定期和您电话沟通 + 提醒您健康管理 + + + + 《电话随访知情同意书》 + + + 不接受随访 + 接受随访 + + + + + + + + + + 艾加莫德进入医保 + 如何报销立即查看 + + + + 立即查看 + + {{openPatientList.PatientNum}}位用户正在关注 + + + + + + + + + + 完成ADL评分 + 查阅您的专属医保报销解读 + + + + + 什么是MG-ADL? + + + 立即去做 + + + + + + + + + + + + + + + + 同意《用户须知》 + + + + 确定 + + + + + + + + + + 恭喜您完成本周测评,坚持每周评估 + 赚取能量积分拥抱有力人生 + + + +{{params.RewardScore}} + 能量 + + + + + + 第{{index+1}}周 + + + + + + + {{params.Records[index].RewardScore}} + + {{params.PatientScore}}+{{params.PatientScoreExtra}} + + + + + {{params.PatientScore}} + + + + + + + 可用能量积分兑换礼品 + + 我知道了 + + + + + + + + + + 您已完成本周测评 + 坚持每周评估,敏锐识别症状变化 + + + 我知道了 + + + + + + + + + + 恭喜您完成本周用药记录 + 记录后可生成您的专属健康报告 + + + +{{params.RewardScore}} + 能量 + + + + + + 第{{index+1}}周 + + + + + + + {{params.Records[index].RewardScore}} + + {{params.PatientScore}}+{{params.PatientScoreExtra}} + + + {{params.PatientScore}}+{{params.PatientScoreExtra2}} + + {{params.PatientScore}} + + + + 连续2周完成用药还可获得额外奖励 + 连续4周完成用药还可获得额外奖励 + + + 我知道了 + + + + + + + + + + 恭喜您完成本周用药记录 + 记录后可生成您的专属健康报告 + + + 我知道了 + + + + + + + + + 双通道药店是指可购买医保药品并支持医保支付(报销)的药店 + + 已了解 + + + + + + + + + + 点击开始ADL评分 + 识别症状波动 + + 已有{{params.adlUserNum}}人体验 + + 立即体验 + + + + + + + + 立即体验 + + + + + + + 正在生成您的ADL报告 + 导出可能需要一些时间,请您耐心等待 + 取消 + + + + + 确定 + + + + + + + 以下内容涉及患者个人信息,仅用于{{params.HospitalName}}{{params.Name}}医生进行患者随访管理,请在安全环境下查看,不截图,不转发 + + 确定 + + + + + + + + + + + + + 您已选择 + {{params.ProvinceName}}{{params.CityName ? '—' + params.CityName : ''}} + + 取消 + + + + + + + + + + + diff --git a/src/components/zd-navBar/navBar.js b/src/components/zd-navBar/navBar.js new file mode 100644 index 0000000..14fdecb --- /dev/null +++ b/src/components/zd-navBar/navBar.js @@ -0,0 +1,250 @@ +const app = getApp(); +Component({ + options: { + multipleSlots: true, + addGlobalClass: true, + }, + properties: { + slotLeft:{ + type:Boolean, + value:false, + }, + extClass: { + type: String, + value: "", + }, + background: { + type: String, + value: "transparent", + observer: "_showChange", + }, + backgroundColorTop: { + type: String, + value: "transparent", + observer: "_showChangeBackgroundColorTop", + }, + color: { + type: String, + value: "#000000", + }, + title: { + type: String, + value: "", + }, + back: { + type: Boolean, + value: false, + }, + home: { + type: Boolean, + value: true, + }, + iconTheme: { + type: String, + value: "nuohe", + }, + /* animated: { + type: Boolean, + value: true + }, + show: { + type: Boolean, + value: true, + observer: '_showChange' + }, */ + delta: { + type: Number, + value: 1, + }, + fixed: { + type: Boolean, + value: false, + }, + }, + created: function () { + this.getSystemInfo(); + }, + attached: function () { + this.setStyle(); //设置样式 + }, + data: { + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + isHome: false, + }, + pageLifetimes: { + show: function () { + if (getApp().globalSystemInfo.ios) { + this.getSystemInfo(); + this.setStyle(); //设置样式1 + } + let pages = getCurrentPages(); + this.setData({ + isHome: !pages[pages.length - 2], + }); + }, + hide: function () {}, + }, + methods: { + setStyle: function (life) { + const { statusBarHeight, navBarHeight, capsulePosition, navBarExtendHeight, ios, windowWidth } = + getApp().globalSystemInfo; + const { back, home, title } = this.data; + let rightDistance = windowWidth - capsulePosition.right; //胶囊按钮右侧到屏幕右侧的边距 + let leftWidth = windowWidth - capsulePosition.left; //胶囊按钮左侧到屏幕右侧的边距 + this.setData({ + leftWidth: leftWidth, + }); + + let navigationbarinnerStyle = [ + `color: ${this.data.color}`, + `background: ${this.data.background}`, + `height:${navBarHeight + navBarExtendHeight}px`, + `padding-top:${statusBarHeight}px`, + `padding-right:${leftWidth}px`, + `padding-bottom:${navBarExtendHeight}px`, + ].join(";"); + let navBarLeft = []; + if ((back && !home) || (!back && home)) { + navBarLeft = [`width:${capsulePosition.width}px`, `height:${capsulePosition.height}px`].join(";"); + } else if ((back && home) || title) { + navBarLeft = [ + `width:${capsulePosition.width}px`, + `height:${capsulePosition.height}px`, + `margin-left:${rightDistance}px`, + ].join(";"); + } else { + navBarLeft = [`width:auto`, `margin-left:0px`].join(";"); + } + if (life === "created") { + this.data = { + navigationbarinnerStyle, + navBarLeft, + navBarHeight, + capsulePosition, + navBarExtendHeight, + ios, + }; + } else { + this.setData({ + navigationbarinnerStyle, + navBarLeft, + navBarHeight, + capsulePosition, + navBarExtendHeight, + ios, + }); + } + }, + _showChange: function (value) { + this.setStyle(); + }, + // 返回事件 + back: function () { + let pages = getCurrentPages(); + if (app.globalData.backPage) { + wx.reLaunch({ + url: app.globalData.backPage, + }); + app.globalData.backPage = null; + return; + } + if (!pages[pages.length - 2] && !app.globalData.anyWhere) { + wx.reLaunch({ + url: "/pages/index/index", + }); + return; + } + this.triggerEvent("back", { delta: this.data.delta }); + }, + home: function () { + wx.reLaunch({ + url: "/pages/start/index", + }); + }, + search: function () { + this.triggerEvent("search", {}); + }, + getSystemInfo() { + var app = getApp(); + if (app.globalSystemInfo && !app.globalSystemInfo.ios) { + return app.globalSystemInfo; + } else { + let systemInfo = wx.getSystemInfoSync(); + let ios = !!(systemInfo.system.toLowerCase().search("ios") + 1); + let rect; + try { + rect = wx.getMenuButtonBoundingClientRect ? wx.getMenuButtonBoundingClientRect() : null; + if (rect === null) { + throw "getMenuButtonBoundingClientRect error"; + } + //取值为0的情况 有可能width不为0 top为0的情况 + if (!rect.width || !rect.top || !rect.left || !rect.height) { + throw "getMenuButtonBoundingClientRect error"; + } + } catch (error) { + let gap = ""; //胶囊按钮上下间距 使导航内容居中 + let width = 96; //胶囊的宽度 + if (systemInfo.platform === "android") { + gap = 8; + width = 96; + } else if (systemInfo.platform === "devtools") { + if (ios) { + gap = 5.5; //开发工具中ios手机 + } else { + gap = 7.5; //开发工具中android和其它手机 + } + } else { + gap = 4; + width = 88; + } + if (!systemInfo.statusBarHeight) { + //开启wifi的情况下修复statusBarHeight值获取不到 + systemInfo.statusBarHeight = systemInfo.screenHeight - systemInfo.windowHeight - 20; + } + rect = { + //获取不到胶囊信息就自定义重置一个 + bottom: systemInfo.statusBarHeight + gap + 32, + height: 32, + left: systemInfo.windowWidth - width - 10, + right: systemInfo.windowWidth - 10, + top: systemInfo.statusBarHeight + gap, + width: width, + }; + console.log("error", error); + console.log("rect", rect); + } + + let navBarHeight = ""; + if (!systemInfo.statusBarHeight) { + systemInfo.statusBarHeight = systemInfo.screenHeight - systemInfo.windowHeight - 20; + navBarHeight = (function () { + let gap = rect.top - systemInfo.statusBarHeight; + return 2 * gap + rect.height; + })(); + + systemInfo.statusBarHeight = 0; + systemInfo.navBarExtendHeight = 0; //下方扩展4像素高度 防止下方边距太小 + } else { + navBarHeight = (function () { + let gap = rect.top - systemInfo.statusBarHeight; + return systemInfo.statusBarHeight + 2 * gap + rect.height; + })(); + if (ios) { + systemInfo.navBarExtendHeight = 4; //下方扩展4像素高度 防止下方边距太小 + } else { + systemInfo.navBarExtendHeight = 0; + } + } + systemInfo.navBarHeight = navBarHeight; //导航栏高度不包括statusBarHeight + systemInfo.capsulePosition = rect; //右上角胶囊按钮信息bottom: 58 height: 32 left: 317 right: 404 top: 26 width: 87 目前发现在大多机型都是固定值 为防止不一样所以会使用动态值来计算nav元素大小 + systemInfo.ios = ios; //是否ios + + app.globalSystemInfo = systemInfo; //将信息保存到全局变量中,后边再用就不用重新异步获取了 + + //console.log('systemInfo', systemInfo); + return systemInfo; + } + }, + }, +}); diff --git a/src/components/zd-navBar/navBar.json b/src/components/zd-navBar/navBar.json new file mode 100644 index 0000000..f719411 --- /dev/null +++ b/src/components/zd-navBar/navBar.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/zd-navBar/navBar.scss b/src/components/zd-navBar/navBar.scss new file mode 100644 index 0000000..5a07cfd --- /dev/null +++ b/src/components/zd-navBar/navBar.scss @@ -0,0 +1,185 @@ +page { + --height: 44px; /* 4*2+32 */ + --right: 40px; /* 10+87 */ + --navBarExtendHeight: 4px; + box-sizing: border-box; +} + +.lxy-nav-bar { + view, + text, + scroll-view, + input, + button, + image, + cover-view { + box-sizing: border-box; + } +} + +.lxy-nav-bar_fixed { + position: fixed; + top: 0; + z-index: 1000; +} + +.lxy-nav-bar .ios { + --height: 44px; /* 4*2+32 */ + --right: 40px; /* 10+87 */ + --navBarExtendHeight: 4px; + box-sizing: border-box; +} +.lxy-nav-bar .android { + --height: 48px; /* 8*2+32 */ + --right: 40px; /* 10+87 */ + --navBarExtendHeight: 4px; + box-sizing: border-box; +} +.lxy-nav-bar .devtools { + --height: 42px; /* 5*2+32 */ + --right: 40px; /* 10+87 */ + --navBarExtendHeight: 4px; + box-sizing: border-box; +} +.lxy-nav-bar__inner { + position: fixed; + top: 0; + left: 0; + z-index: 5001; + height: var(--height); + display: flex; + align-items: center; + padding-right: var(--right); + width: 100%; + padding-bottom: var(--navBarExtendHeight); +} +.lxy-nav-bar__inner .lxy-nav-bar__left { + position: relative; + width: var(--right); + height: 32px; + /* padding-left: 10px; */ + display: flex; + align-items: center; +} +.lxy-nav-bar__buttons { + height: 100%; + width: 100%; + display: flex; + align-items: center; + border-radius: 16px; + border: 1rpx solid rgba(204, 204, 204, 0.6); + position: relative; +} +.lxy-nav-bar__buttons.android { + border: 1rpx solid rgba(234, 234, 234, 0.6); +} +.lxy-nav-bar__buttons::after { + position: absolute; + content: ""; + width: 1rpx; + height: 18.4px; + background: rgba(204, 204, 204, 0.6); + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} +.lxy-nav-bar__buttons.android::after { + background: rgba(234, 234, 234, 0.6); +} +.lxy-nav-bar__button { + width: 100%; + height: 100%; + display: flex; + font-size: 12px; + background-repeat: no-repeat; + background-position: center center; + background-size: 1em 2em; +} + +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_goback:active, +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_gohome:active { + opacity: 0.5; +} +.lxy-nav-bar__inner .lxy-nav-bar__center { + font-size: 17px; + line-height: 17px; + text-align: center; + position: relative; + flex: 1; + display: -webkit-box; + display: -webkit-flex; + display: flex; + align-items: center; + justify-content: center; + padding-left: 10px; +} +.lxy-nav-bar__inner .lxy-nav-bar__center .lxy-nav-bar__center-title { + margin-top: -2px; + font-weight: bold; + white-space: nowrap; +} +.lxy-nav-bar__inner .lxy-nav-bar__loading { + font-size: 0; +} +.lxy-nav-bar__inner .lxy-nav-bar__loading .lxy-loading { + margin-left: 0; +} +.lxy-nav-bar__inner .lxy-nav-bar__right { + margin-right: 10px; +} +.lxy-nav-bar__placeholder { + height: var(--height); + background: #f8f8f8; + position: relative; + z-index: 50; +} + +.lxy-nav-bar-search { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 32px; + border-radius: 16px; + position: relative; + background: #f6f6f6; +} + +.lxy-nav-bar-search__input { + height: 100%; + display: flex; + align-items: center; + color: #999; + font-size: 15px; + line-height: 15px; +} +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_goback { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E"); + background-position: 30rpx center; +} +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_goback.nuohe { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E"); +} +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_goback.white { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z' fill='%23ffffff'/%3E%3C/svg%3E"); +} +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_gohome { + background-image: url("data:image/svg+xml,%3Csvg t='1565752242401' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4326' width='48' height='48'%3E%3Cpath d='M931.148 451.25L591.505 97.654c-21.106-21.953-49.313-34.034-79.551-34.034-30.235 0-58.448 12.081-79.554 34.034L92.76 451.25c-35.049 36.498-30.536 68.044-24.742 81.222 4.13 9.35 18.07 35.05 58.231 35.05h49.78v272.016c0 61.756 44.342 119.906 107.357 119.906h144.587v-287.87c0-30.866-4.675-48.062 26.848-48.062h114.268c31.52 0 26.845 17.196 26.845 48.061v287.872h144.588c63.013 0 107.358-58.15 107.358-119.906V567.523h49.782c40.16 0 54.1-25.7 58.229-35.05 5.793-13.18 10.306-44.726-24.743-81.224z m-33.486 60.28h-105.77v328.007c0 30.865-19.877 63.917-51.37 63.917h-88.6V671.572c0-61.761-19.79-104.05-82.832-104.05H454.821c-63.045 0-82.836 42.289-82.836 104.05v231.883h-88.599c-31.495 0-51.37-33.052-51.37-63.917V511.529H126.25c-0.984 0-1.888-3.852-2.708-3.907 1.94-3.388 5.276-11.975 10.825-17.743l339.671-353.35c10.142-10.578 24.467-17.057 38.353-16.924 13.888-0.133 27.342 6.346 37.483 16.923L889.54 489.88c5.549 5.768 8.885 14.355 10.825 17.743-0.818 0.055-1.72 3.907-2.704 3.907z' fill='%23000000' p-id='4327'%3E%3C/path%3E%3C/svg%3E"); + background-size: 22px 22px; +} +.lxy-nav-bar__inner .lxy-nav-bar__left .lxy-nav-bar__btn_gohome.white { + background-image: url("data:image/svg+xml,%3Csvg t='1565752242401' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4326' width='48' height='48'%3E%3Cpath d='M931.148 451.25L591.505 97.654c-21.106-21.953-49.313-34.034-79.551-34.034-30.235 0-58.448 12.081-79.554 34.034L92.76 451.25c-35.049 36.498-30.536 68.044-24.742 81.222 4.13 9.35 18.07 35.05 58.231 35.05h49.78v272.016c0 61.756 44.342 119.906 107.357 119.906h144.587v-287.87c0-30.866-4.675-48.062 26.848-48.062h114.268c31.52 0 26.845 17.196 26.845 48.061v287.872h144.588c63.013 0 107.358-58.15 107.358-119.906V567.523h49.782c40.16 0 54.1-25.7 58.229-35.05 5.793-13.18 10.306-44.726-24.743-81.224z m-33.486 60.28h-105.77v328.007c0 30.865-19.877 63.917-51.37 63.917h-88.6V671.572c0-61.761-19.79-104.05-82.832-104.05H454.821c-63.045 0-82.836 42.289-82.836 104.05v231.883h-88.599c-31.495 0-51.37-33.052-51.37-63.917V511.529H126.25c-0.984 0-1.888-3.852-2.708-3.907 1.94-3.388 5.276-11.975 10.825-17.743l339.671-353.35c10.142-10.578 24.467-17.057 38.353-16.924 13.888-0.133 27.342 6.346 37.483 16.923L889.54 489.88c5.549 5.768 8.885 14.355 10.825 17.743-0.818 0.055-1.72 3.907-2.704 3.907z' fill='%23ffffff' p-id='4327'%3E%3C/path%3E%3C/svg%3E"); + background-size: 22px 22px; +} +.lxy-nav-bar-search__icon { + width: 22px; + height: 22px; + display: flex; + align-items: center; + justify-content: center; + background-image: url("data:image/svg+xml,%3Csvg t='1565691512239' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1240' width='48' height='48'%3E%3Cpath d='M819.2 798.254545L674.909091 653.963636c46.545455-48.872727 74.472727-114.036364 74.472727-186.181818 0-151.272727-123.345455-274.618182-274.618182-274.618182-151.272727 0-274.618182 123.345455-274.618181 274.618182 0 151.272727 123.345455 274.618182 274.618181 274.618182 65.163636 0 128-23.272727 174.545455-62.836364l144.290909 144.290909c2.327273 2.327273 6.981818 4.654545 11.636364 4.654546s9.309091-2.327273 11.636363-4.654546c6.981818-6.981818 6.981818-18.618182 2.327273-25.6zM235.054545 467.781818c0-132.654545 107.054545-239.709091 239.709091-239.709091 132.654545 0 239.709091 107.054545 239.709091 239.709091 0 132.654545-107.054545 239.709091-239.709091 239.709091-132.654545 0-239.709091-107.054545-239.709091-239.709091z' fill='%23999999' p-id='1241'%3E%3C/path%3E%3C/svg%3E"); + background-repeat: no-repeat; + background-size: cover; +} diff --git a/src/components/zd-navBar/navBar.wxml b/src/components/zd-navBar/navBar.wxml new file mode 100644 index 0000000..6010110 --- /dev/null +++ b/src/components/zd-navBar/navBar.wxml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + {{title}} + + + + + + + + + + diff --git a/src/images/za-images/1.5/adl-add.png b/src/images/za-images/1.5/adl-add.png new file mode 100644 index 0000000..43b9d64 Binary files /dev/null and b/src/images/za-images/1.5/adl-add.png differ diff --git a/src/images/za-images/1.5/adl-alert-test.png b/src/images/za-images/1.5/adl-alert-test.png new file mode 100644 index 0000000..23bd2fe Binary files /dev/null and b/src/images/za-images/1.5/adl-alert-test.png differ diff --git a/src/images/za-images/1.5/adl-alert.png b/src/images/za-images/1.5/adl-alert.png new file mode 100644 index 0000000..edabd9a Binary files /dev/null and b/src/images/za-images/1.5/adl-alert.png differ diff --git a/src/images/za-images/1.5/adl-bg-active.png b/src/images/za-images/1.5/adl-bg-active.png new file mode 100644 index 0000000..5a28079 Binary files /dev/null and b/src/images/za-images/1.5/adl-bg-active.png differ diff --git a/src/images/za-images/1.5/adl-bg.png b/src/images/za-images/1.5/adl-bg.png new file mode 100644 index 0000000..eb84136 Binary files /dev/null and b/src/images/za-images/1.5/adl-bg.png differ diff --git a/src/images/za-images/1.5/arrow-right.png b/src/images/za-images/1.5/arrow-right.png new file mode 100644 index 0000000..055f63d Binary files /dev/null and b/src/images/za-images/1.5/arrow-right.png differ diff --git a/src/images/za-images/1.5/btn-drug.png b/src/images/za-images/1.5/btn-drug.png new file mode 100644 index 0000000..3184f76 Binary files /dev/null and b/src/images/za-images/1.5/btn-drug.png differ diff --git a/src/images/za-images/1.5/certIcon-2.png b/src/images/za-images/1.5/certIcon-2.png new file mode 100644 index 0000000..25d995f Binary files /dev/null and b/src/images/za-images/1.5/certIcon-2.png differ diff --git a/src/images/za-images/1.5/certIcon.png b/src/images/za-images/1.5/certIcon.png new file mode 100644 index 0000000..d32e02d Binary files /dev/null and b/src/images/za-images/1.5/certIcon.png differ diff --git a/src/images/za-images/1.5/certIcon1-bg.png b/src/images/za-images/1.5/certIcon1-bg.png new file mode 100644 index 0000000..58687d2 Binary files /dev/null and b/src/images/za-images/1.5/certIcon1-bg.png differ diff --git a/src/images/za-images/1.5/certIcon1.png b/src/images/za-images/1.5/certIcon1.png new file mode 100644 index 0000000..8ef649e Binary files /dev/null and b/src/images/za-images/1.5/certIcon1.png differ diff --git a/src/images/za-images/1.5/certIcon2-bg.png b/src/images/za-images/1.5/certIcon2-bg.png new file mode 100644 index 0000000..eb82013 Binary files /dev/null and b/src/images/za-images/1.5/certIcon2-bg.png differ diff --git a/src/images/za-images/1.5/certIcon2.png b/src/images/za-images/1.5/certIcon2.png new file mode 100644 index 0000000..c7e922f Binary files /dev/null and b/src/images/za-images/1.5/certIcon2.png differ diff --git a/src/images/za-images/1.5/d1.png b/src/images/za-images/1.5/d1.png new file mode 100644 index 0000000..b9ede5b Binary files /dev/null and b/src/images/za-images/1.5/d1.png differ diff --git a/src/images/za-images/1.5/d2.png b/src/images/za-images/1.5/d2.png new file mode 100644 index 0000000..099a271 Binary files /dev/null and b/src/images/za-images/1.5/d2.png differ diff --git a/src/images/za-images/1.5/d3.png b/src/images/za-images/1.5/d3.png new file mode 100644 index 0000000..f447962 Binary files /dev/null and b/src/images/za-images/1.5/d3.png differ diff --git a/src/images/za-images/1.5/drug-icon.png b/src/images/za-images/1.5/drug-icon.png new file mode 100644 index 0000000..809cd38 Binary files /dev/null and b/src/images/za-images/1.5/drug-icon.png differ diff --git a/src/images/za-images/1.5/drug-record-bg.png b/src/images/za-images/1.5/drug-record-bg.png new file mode 100644 index 0000000..a78005a Binary files /dev/null and b/src/images/za-images/1.5/drug-record-bg.png differ diff --git a/src/images/za-images/1.5/drug-reocrd-upload.png b/src/images/za-images/1.5/drug-reocrd-upload.png new file mode 100644 index 0000000..484e1e1 Binary files /dev/null and b/src/images/za-images/1.5/drug-reocrd-upload.png differ diff --git a/src/images/za-images/1.5/drugs.png b/src/images/za-images/1.5/drugs.png new file mode 100644 index 0000000..a5fa3c6 Binary files /dev/null and b/src/images/za-images/1.5/drugs.png differ diff --git a/src/images/za-images/1.5/hoem-question.png b/src/images/za-images/1.5/hoem-question.png new file mode 100644 index 0000000..a0d9a5b Binary files /dev/null and b/src/images/za-images/1.5/hoem-question.png differ diff --git a/src/images/za-images/1.5/home-adl.png b/src/images/za-images/1.5/home-adl.png new file mode 100644 index 0000000..e0438bc Binary files /dev/null and b/src/images/za-images/1.5/home-adl.png differ diff --git a/src/images/za-images/1.5/hos-icon1.png b/src/images/za-images/1.5/hos-icon1.png new file mode 100644 index 0000000..a2d0452 Binary files /dev/null and b/src/images/za-images/1.5/hos-icon1.png differ diff --git a/src/images/za-images/1.5/hos-title.png b/src/images/za-images/1.5/hos-title.png new file mode 100644 index 0000000..d0b6698 Binary files /dev/null and b/src/images/za-images/1.5/hos-title.png differ diff --git a/src/images/za-images/1.5/hostipal.png b/src/images/za-images/1.5/hostipal.png new file mode 100644 index 0000000..054849d Binary files /dev/null and b/src/images/za-images/1.5/hostipal.png differ diff --git a/src/images/za-images/1.5/live-play.png b/src/images/za-images/1.5/live-play.png new file mode 100644 index 0000000..f79a300 Binary files /dev/null and b/src/images/za-images/1.5/live-play.png differ diff --git a/src/images/za-images/1.5/my-common-icon1.png b/src/images/za-images/1.5/my-common-icon1.png new file mode 100644 index 0000000..f40dd95 Binary files /dev/null and b/src/images/za-images/1.5/my-common-icon1.png differ diff --git a/src/images/za-images/1.5/my-common-icon2.png b/src/images/za-images/1.5/my-common-icon2.png new file mode 100644 index 0000000..e7606df Binary files /dev/null and b/src/images/za-images/1.5/my-common-icon2.png differ diff --git a/src/images/za-images/1.5/my-list-icon1.png b/src/images/za-images/1.5/my-list-icon1.png new file mode 100644 index 0000000..9d8b8be Binary files /dev/null and b/src/images/za-images/1.5/my-list-icon1.png differ diff --git a/src/images/za-images/1.5/my-list-icon2.png b/src/images/za-images/1.5/my-list-icon2.png new file mode 100644 index 0000000..7eb3bf1 Binary files /dev/null and b/src/images/za-images/1.5/my-list-icon2.png differ diff --git a/src/images/za-images/1.5/my-list-icon3.png b/src/images/za-images/1.5/my-list-icon3.png new file mode 100644 index 0000000..84f540d Binary files /dev/null and b/src/images/za-images/1.5/my-list-icon3.png differ diff --git a/src/images/za-images/1.5/my-list-icon4.png b/src/images/za-images/1.5/my-list-icon4.png new file mode 100644 index 0000000..88b2e97 Binary files /dev/null and b/src/images/za-images/1.5/my-list-icon4.png differ diff --git a/src/images/za-images/1.5/my-list-icon5.png b/src/images/za-images/1.5/my-list-icon5.png new file mode 100644 index 0000000..3d200fc Binary files /dev/null and b/src/images/za-images/1.5/my-list-icon5.png differ diff --git a/src/images/za-images/1.5/n-site.png b/src/images/za-images/1.5/n-site.png new file mode 100644 index 0000000..f2fe6e4 Binary files /dev/null and b/src/images/za-images/1.5/n-site.png differ diff --git a/src/images/za-images/1.5/page-title.png b/src/images/za-images/1.5/page-title.png new file mode 100644 index 0000000..ab9e022 Binary files /dev/null and b/src/images/za-images/1.5/page-title.png differ diff --git a/src/images/za-images/1.5/phone.png b/src/images/za-images/1.5/phone.png new file mode 100644 index 0000000..33c4f55 Binary files /dev/null and b/src/images/za-images/1.5/phone.png differ diff --git a/src/images/za-images/1.5/search.png b/src/images/za-images/1.5/search.png new file mode 100644 index 0000000..9979385 Binary files /dev/null and b/src/images/za-images/1.5/search.png differ diff --git a/src/images/za-images/1.5/server-icon1.png b/src/images/za-images/1.5/server-icon1.png new file mode 100644 index 0000000..a67ae78 Binary files /dev/null and b/src/images/za-images/1.5/server-icon1.png differ diff --git a/src/images/za-images/1.5/server-icon2.png b/src/images/za-images/1.5/server-icon2.png new file mode 100644 index 0000000..7f008f4 Binary files /dev/null and b/src/images/za-images/1.5/server-icon2.png differ diff --git a/src/images/za-images/1.5/server-icon3.png b/src/images/za-images/1.5/server-icon3.png new file mode 100644 index 0000000..79ac1a8 Binary files /dev/null and b/src/images/za-images/1.5/server-icon3.png differ diff --git a/src/images/za-images/1.5/server-icon4.png b/src/images/za-images/1.5/server-icon4.png new file mode 100644 index 0000000..2d4da12 Binary files /dev/null and b/src/images/za-images/1.5/server-icon4.png differ diff --git a/src/images/za-images/1.5/site-circle.png b/src/images/za-images/1.5/site-circle.png new file mode 100644 index 0000000..3eb8b57 Binary files /dev/null and b/src/images/za-images/1.5/site-circle.png differ diff --git a/src/images/za-images/1.5/site.png b/src/images/za-images/1.5/site.png new file mode 100644 index 0000000..4a21c5c Binary files /dev/null and b/src/images/za-images/1.5/site.png differ diff --git a/src/images/za-images/1.5/story-bg.png b/src/images/za-images/1.5/story-bg.png new file mode 100644 index 0000000..e9dd236 Binary files /dev/null and b/src/images/za-images/1.5/story-bg.png differ diff --git a/src/images/za-images/1.5/story-share.png b/src/images/za-images/1.5/story-share.png new file mode 100644 index 0000000..72d6a04 Binary files /dev/null and b/src/images/za-images/1.5/story-share.png differ diff --git a/src/images/za-images/1.5/vip-toast.png b/src/images/za-images/1.5/vip-toast.png new file mode 100644 index 0000000..d68f767 Binary files /dev/null and b/src/images/za-images/1.5/vip-toast.png differ diff --git a/src/images/za-images/1.5/warn.png b/src/images/za-images/1.5/warn.png new file mode 100644 index 0000000..dbc8375 Binary files /dev/null and b/src/images/za-images/1.5/warn.png differ diff --git a/src/images/za-images/1/1.png b/src/images/za-images/1/1.png new file mode 100644 index 0000000..7ba80cc Binary files /dev/null and b/src/images/za-images/1/1.png differ diff --git a/src/images/za-images/1/2.png b/src/images/za-images/1/2.png new file mode 100644 index 0000000..234e9ea Binary files /dev/null and b/src/images/za-images/1/2.png differ diff --git a/src/images/za-images/1/3.png b/src/images/za-images/1/3.png new file mode 100644 index 0000000..fd31aab Binary files /dev/null and b/src/images/za-images/1/3.png differ diff --git a/src/images/za-images/1/a.png b/src/images/za-images/1/a.png new file mode 100644 index 0000000..55e416f Binary files /dev/null and b/src/images/za-images/1/a.png differ diff --git a/src/images/za-images/1/adl-add.png b/src/images/za-images/1/adl-add.png new file mode 100644 index 0000000..bce0a75 Binary files /dev/null and b/src/images/za-images/1/adl-add.png differ diff --git a/src/images/za-images/1/adl-bg-active.png b/src/images/za-images/1/adl-bg-active.png new file mode 100644 index 0000000..5fd7ca5 Binary files /dev/null and b/src/images/za-images/1/adl-bg-active.png differ diff --git a/src/images/za-images/1/adl-bg.png b/src/images/za-images/1/adl-bg.png new file mode 100644 index 0000000..9f3c227 Binary files /dev/null and b/src/images/za-images/1/adl-bg.png differ diff --git a/src/images/za-images/1/adl-detail-bg.png b/src/images/za-images/1/adl-detail-bg.png new file mode 100644 index 0000000..25df5f4 Binary files /dev/null and b/src/images/za-images/1/adl-detail-bg.png differ diff --git a/src/images/za-images/1/adl-faveicon.png b/src/images/za-images/1/adl-faveicon.png new file mode 100644 index 0000000..4b85c00 Binary files /dev/null and b/src/images/za-images/1/adl-faveicon.png differ diff --git a/src/images/za-images/1/adl-icon1.png b/src/images/za-images/1/adl-icon1.png new file mode 100644 index 0000000..4b91c82 Binary files /dev/null and b/src/images/za-images/1/adl-icon1.png differ diff --git a/src/images/za-images/1/adl-icon2.png b/src/images/za-images/1/adl-icon2.png new file mode 100644 index 0000000..79f6693 Binary files /dev/null and b/src/images/za-images/1/adl-icon2.png differ diff --git a/src/images/za-images/1/adl-icon3.png b/src/images/za-images/1/adl-icon3.png new file mode 100644 index 0000000..cdcdd06 Binary files /dev/null and b/src/images/za-images/1/adl-icon3.png differ diff --git a/src/images/za-images/1/adl-icon4.png b/src/images/za-images/1/adl-icon4.png new file mode 100644 index 0000000..c0dc58b Binary files /dev/null and b/src/images/za-images/1/adl-icon4.png differ diff --git a/src/images/za-images/1/adl-icon5.png b/src/images/za-images/1/adl-icon5.png new file mode 100644 index 0000000..6d19310 Binary files /dev/null and b/src/images/za-images/1/adl-icon5.png differ diff --git a/src/images/za-images/1/adl-icon6.png b/src/images/za-images/1/adl-icon6.png new file mode 100644 index 0000000..08e34ab Binary files /dev/null and b/src/images/za-images/1/adl-icon6.png differ diff --git a/src/images/za-images/1/adl-icon7.png b/src/images/za-images/1/adl-icon7.png new file mode 100644 index 0000000..33b6c93 Binary files /dev/null and b/src/images/za-images/1/adl-icon7.png differ diff --git a/src/images/za-images/1/adl-icon8.png b/src/images/za-images/1/adl-icon8.png new file mode 100644 index 0000000..94bcdef Binary files /dev/null and b/src/images/za-images/1/adl-icon8.png differ diff --git a/src/images/za-images/1/adl-icon9.png b/src/images/za-images/1/adl-icon9.png new file mode 100644 index 0000000..16effd7 Binary files /dev/null and b/src/images/za-images/1/adl-icon9.png differ diff --git a/src/images/za-images/1/adl-result1.png b/src/images/za-images/1/adl-result1.png new file mode 100644 index 0000000..92f8e34 Binary files /dev/null and b/src/images/za-images/1/adl-result1.png differ diff --git a/src/images/za-images/1/adl-result2.png b/src/images/za-images/1/adl-result2.png new file mode 100644 index 0000000..b3e6992 Binary files /dev/null and b/src/images/za-images/1/adl-result2.png differ diff --git a/src/images/za-images/1/adl-result3.png b/src/images/za-images/1/adl-result3.png new file mode 100644 index 0000000..58359bb Binary files /dev/null and b/src/images/za-images/1/adl-result3.png differ diff --git a/src/images/za-images/1/adl-scurt-icon.png b/src/images/za-images/1/adl-scurt-icon.png new file mode 100644 index 0000000..e8fb2b9 Binary files /dev/null and b/src/images/za-images/1/adl-scurt-icon.png differ diff --git a/src/images/za-images/1/adl-scurt.png b/src/images/za-images/1/adl-scurt.png new file mode 100644 index 0000000..6de2feb Binary files /dev/null and b/src/images/za-images/1/adl-scurt.png differ diff --git a/src/images/za-images/1/adl-share-bg.png b/src/images/za-images/1/adl-share-bg.png new file mode 100644 index 0000000..cdecfe3 Binary files /dev/null and b/src/images/za-images/1/adl-share-bg.png differ diff --git a/src/images/za-images/1/adl-test-bg.png b/src/images/za-images/1/adl-test-bg.png new file mode 100644 index 0000000..18c2f23 Binary files /dev/null and b/src/images/za-images/1/adl-test-bg.png differ diff --git a/src/images/za-images/1/arrow-right.png b/src/images/za-images/1/arrow-right.png new file mode 100644 index 0000000..bfbd15f Binary files /dev/null and b/src/images/za-images/1/arrow-right.png differ diff --git a/src/images/za-images/1/audio-pause.png b/src/images/za-images/1/audio-pause.png new file mode 100644 index 0000000..b7920c0 Binary files /dev/null and b/src/images/za-images/1/audio-pause.png differ diff --git a/src/images/za-images/1/audio-play.png b/src/images/za-images/1/audio-play.png new file mode 100644 index 0000000..3958eca Binary files /dev/null and b/src/images/za-images/1/audio-play.png differ diff --git a/src/images/za-images/1/cert-pending.png b/src/images/za-images/1/cert-pending.png new file mode 100644 index 0000000..1e7665a Binary files /dev/null and b/src/images/za-images/1/cert-pending.png differ diff --git a/src/images/za-images/1/cert-reject.png b/src/images/za-images/1/cert-reject.png new file mode 100644 index 0000000..7ca0deb Binary files /dev/null and b/src/images/za-images/1/cert-reject.png differ diff --git a/src/images/za-images/1/cert-reslove.png b/src/images/za-images/1/cert-reslove.png new file mode 100644 index 0000000..04e8cad Binary files /dev/null and b/src/images/za-images/1/cert-reslove.png differ diff --git a/src/images/za-images/1/code.png b/src/images/za-images/1/code.png new file mode 100644 index 0000000..66eac86 Binary files /dev/null and b/src/images/za-images/1/code.png differ diff --git a/src/images/za-images/1/date.png b/src/images/za-images/1/date.png new file mode 100644 index 0000000..f20c539 Binary files /dev/null and b/src/images/za-images/1/date.png differ diff --git a/src/images/za-images/1/default-user.png b/src/images/za-images/1/default-user.png new file mode 100644 index 0000000..83e7b6c Binary files /dev/null and b/src/images/za-images/1/default-user.png differ diff --git a/src/images/za-images/1/del-story.png b/src/images/za-images/1/del-story.png new file mode 100644 index 0000000..fb10b8f Binary files /dev/null and b/src/images/za-images/1/del-story.png differ diff --git a/src/images/za-images/1/download.png b/src/images/za-images/1/download.png new file mode 100644 index 0000000..5de65f8 Binary files /dev/null and b/src/images/za-images/1/download.png differ diff --git a/src/images/za-images/1/enter-switch1-active.png b/src/images/za-images/1/enter-switch1-active.png new file mode 100644 index 0000000..1e235cb Binary files /dev/null and b/src/images/za-images/1/enter-switch1-active.png differ diff --git a/src/images/za-images/1/enter-switch1.png b/src/images/za-images/1/enter-switch1.png new file mode 100644 index 0000000..71b5d8f Binary files /dev/null and b/src/images/za-images/1/enter-switch1.png differ diff --git a/src/images/za-images/1/enter-switch2-active.png b/src/images/za-images/1/enter-switch2-active.png new file mode 100644 index 0000000..4ee4811 Binary files /dev/null and b/src/images/za-images/1/enter-switch2-active.png differ diff --git a/src/images/za-images/1/enter-switch2.png b/src/images/za-images/1/enter-switch2.png new file mode 100644 index 0000000..cf04727 Binary files /dev/null and b/src/images/za-images/1/enter-switch2.png differ diff --git a/src/images/za-images/1/f-warn.png b/src/images/za-images/1/f-warn.png new file mode 100644 index 0000000..3a3b31d Binary files /dev/null and b/src/images/za-images/1/f-warn.png differ diff --git a/src/images/za-images/1/family-fa.png b/src/images/za-images/1/family-fa.png new file mode 100644 index 0000000..5217620 Binary files /dev/null and b/src/images/za-images/1/family-fa.png differ diff --git a/src/images/za-images/1/family-kin.png b/src/images/za-images/1/family-kin.png new file mode 100644 index 0000000..18d6e76 Binary files /dev/null and b/src/images/za-images/1/family-kin.png differ diff --git a/src/images/za-images/1/family-mom.png b/src/images/za-images/1/family-mom.png new file mode 100644 index 0000000..f10294f Binary files /dev/null and b/src/images/za-images/1/family-mom.png differ diff --git a/src/images/za-images/1/family-scan.png b/src/images/za-images/1/family-scan.png new file mode 100644 index 0000000..0c5c040 Binary files /dev/null and b/src/images/za-images/1/family-scan.png differ diff --git a/src/images/za-images/1/family-user.png b/src/images/za-images/1/family-user.png new file mode 100644 index 0000000..faf846a Binary files /dev/null and b/src/images/za-images/1/family-user.png differ diff --git a/src/images/za-images/1/fillscreen.png b/src/images/za-images/1/fillscreen.png new file mode 100644 index 0000000..d79a62e Binary files /dev/null and b/src/images/za-images/1/fillscreen.png differ diff --git a/src/images/za-images/1/firee-audio-bg.png b/src/images/za-images/1/firee-audio-bg.png new file mode 100644 index 0000000..3d22647 Binary files /dev/null and b/src/images/za-images/1/firee-audio-bg.png differ diff --git a/src/images/za-images/1/fixed-share.png b/src/images/za-images/1/fixed-share.png new file mode 100644 index 0000000..90cda4f Binary files /dev/null and b/src/images/za-images/1/fixed-share.png differ diff --git a/src/images/za-images/1/frame.png b/src/images/za-images/1/frame.png new file mode 100644 index 0000000..4ddf1e9 Binary files /dev/null and b/src/images/za-images/1/frame.png differ diff --git a/src/images/za-images/1/home-adl-icon1.png b/src/images/za-images/1/home-adl-icon1.png new file mode 100644 index 0000000..a641c25 Binary files /dev/null and b/src/images/za-images/1/home-adl-icon1.png differ diff --git a/src/images/za-images/1/home-adl-icon2.png b/src/images/za-images/1/home-adl-icon2.png new file mode 100644 index 0000000..c3867c5 Binary files /dev/null and b/src/images/za-images/1/home-adl-icon2.png differ diff --git a/src/images/za-images/1/home-adl-icon3.png b/src/images/za-images/1/home-adl-icon3.png new file mode 100644 index 0000000..c29c859 Binary files /dev/null and b/src/images/za-images/1/home-adl-icon3.png differ diff --git a/src/images/za-images/1/home-adl-icon4.png b/src/images/za-images/1/home-adl-icon4.png new file mode 100644 index 0000000..fe9ef4b Binary files /dev/null and b/src/images/za-images/1/home-adl-icon4.png differ diff --git a/src/images/za-images/1/home-adl.png b/src/images/za-images/1/home-adl.png new file mode 100644 index 0000000..af8c5ac Binary files /dev/null and b/src/images/za-images/1/home-adl.png differ diff --git a/src/images/za-images/1/identity-family-active.png b/src/images/za-images/1/identity-family-active.png new file mode 100644 index 0000000..9db42a7 Binary files /dev/null and b/src/images/za-images/1/identity-family-active.png differ diff --git a/src/images/za-images/1/identity-family.png b/src/images/za-images/1/identity-family.png new file mode 100644 index 0000000..38a8dc8 Binary files /dev/null and b/src/images/za-images/1/identity-family.png differ diff --git a/src/images/za-images/1/identity-user-active.png b/src/images/za-images/1/identity-user-active.png new file mode 100644 index 0000000..4782a51 Binary files /dev/null and b/src/images/za-images/1/identity-user-active.png differ diff --git a/src/images/za-images/1/identity-user.png b/src/images/za-images/1/identity-user.png new file mode 100644 index 0000000..e1db151 Binary files /dev/null and b/src/images/za-images/1/identity-user.png differ diff --git a/src/images/za-images/1/index-bg.png b/src/images/za-images/1/index-bg.png new file mode 100644 index 0000000..388861a Binary files /dev/null and b/src/images/za-images/1/index-bg.png differ diff --git a/src/images/za-images/1/knowle-bg.png b/src/images/za-images/1/knowle-bg.png new file mode 100644 index 0000000..1725ed4 Binary files /dev/null and b/src/images/za-images/1/knowle-bg.png differ diff --git a/src/images/za-images/1/left.png b/src/images/za-images/1/left.png new file mode 100644 index 0000000..967dc03 Binary files /dev/null and b/src/images/za-images/1/left.png differ diff --git a/src/images/za-images/1/live-detail-play.png b/src/images/za-images/1/live-detail-play.png new file mode 100644 index 0000000..bdfa8b9 Binary files /dev/null and b/src/images/za-images/1/live-detail-play.png differ diff --git a/src/images/za-images/1/live-play.png b/src/images/za-images/1/live-play.png new file mode 100644 index 0000000..4cbc663 Binary files /dev/null and b/src/images/za-images/1/live-play.png differ diff --git a/src/images/za-images/1/live-resluct.png b/src/images/za-images/1/live-resluct.png new file mode 100644 index 0000000..2cd04e2 Binary files /dev/null and b/src/images/za-images/1/live-resluct.png differ diff --git a/src/images/za-images/1/live-result-reject.png b/src/images/za-images/1/live-result-reject.png new file mode 100644 index 0000000..ea6998b Binary files /dev/null and b/src/images/za-images/1/live-result-reject.png differ diff --git a/src/images/za-images/1/live-result-success.png b/src/images/za-images/1/live-result-success.png new file mode 100644 index 0000000..8470c8a Binary files /dev/null and b/src/images/za-images/1/live-result-success.png differ diff --git a/src/images/za-images/1/live-result-warn.png b/src/images/za-images/1/live-result-warn.png new file mode 100644 index 0000000..692f272 Binary files /dev/null and b/src/images/za-images/1/live-result-warn.png differ diff --git a/src/images/za-images/1/login-bg.png b/src/images/za-images/1/login-bg.png new file mode 100644 index 0000000..bc2bf39 Binary files /dev/null and b/src/images/za-images/1/login-bg.png differ diff --git a/src/images/za-images/1/login-mask-bg.png b/src/images/za-images/1/login-mask-bg.png new file mode 100644 index 0000000..a76ad9d Binary files /dev/null and b/src/images/za-images/1/login-mask-bg.png differ diff --git a/src/images/za-images/1/login-title.png b/src/images/za-images/1/login-title.png new file mode 100644 index 0000000..86e3946 Binary files /dev/null and b/src/images/za-images/1/login-title.png differ diff --git a/src/images/za-images/1/look-no.png b/src/images/za-images/1/look-no.png new file mode 100644 index 0000000..0185301 Binary files /dev/null and b/src/images/za-images/1/look-no.png differ diff --git a/src/images/za-images/1/look.png b/src/images/za-images/1/look.png new file mode 100644 index 0000000..a860bf2 Binary files /dev/null and b/src/images/za-images/1/look.png differ diff --git a/src/images/za-images/1/look的副本.png b/src/images/za-images/1/look的副本.png new file mode 100644 index 0000000..a860bf2 Binary files /dev/null and b/src/images/za-images/1/look的副本.png differ diff --git a/src/images/za-images/1/man-active.png b/src/images/za-images/1/man-active.png new file mode 100644 index 0000000..6bc2a18 Binary files /dev/null and b/src/images/za-images/1/man-active.png differ diff --git a/src/images/za-images/1/man.png b/src/images/za-images/1/man.png new file mode 100644 index 0000000..7169049 Binary files /dev/null and b/src/images/za-images/1/man.png differ diff --git a/src/images/za-images/1/my-bg.png b/src/images/za-images/1/my-bg.png new file mode 100644 index 0000000..f73fc83 Binary files /dev/null and b/src/images/za-images/1/my-bg.png differ diff --git a/src/images/za-images/1/my-common-icon1.png b/src/images/za-images/1/my-common-icon1.png new file mode 100644 index 0000000..3a01e62 Binary files /dev/null and b/src/images/za-images/1/my-common-icon1.png differ diff --git a/src/images/za-images/1/my-common-icon2.png b/src/images/za-images/1/my-common-icon2.png new file mode 100644 index 0000000..5512519 Binary files /dev/null and b/src/images/za-images/1/my-common-icon2.png differ diff --git a/src/images/za-images/1/my-list-icon1.png b/src/images/za-images/1/my-list-icon1.png new file mode 100644 index 0000000..6fdd063 Binary files /dev/null and b/src/images/za-images/1/my-list-icon1.png differ diff --git a/src/images/za-images/1/my-list-icon2.png b/src/images/za-images/1/my-list-icon2.png new file mode 100644 index 0000000..e1e3c38 Binary files /dev/null and b/src/images/za-images/1/my-list-icon2.png differ diff --git a/src/images/za-images/1/my-list-icon3.png b/src/images/za-images/1/my-list-icon3.png new file mode 100644 index 0000000..a81ae38 Binary files /dev/null and b/src/images/za-images/1/my-list-icon3.png differ diff --git a/src/images/za-images/1/my-list-icon4.png b/src/images/za-images/1/my-list-icon4.png new file mode 100644 index 0000000..0f9ba15 Binary files /dev/null and b/src/images/za-images/1/my-list-icon4.png differ diff --git a/src/images/za-images/1/nav-site.png b/src/images/za-images/1/nav-site.png new file mode 100644 index 0000000..ce44b32 Binary files /dev/null and b/src/images/za-images/1/nav-site.png differ diff --git a/src/images/za-images/1/page-title.png b/src/images/za-images/1/page-title.png new file mode 100644 index 0000000..a35553a Binary files /dev/null and b/src/images/za-images/1/page-title.png differ diff --git a/src/images/za-images/1/popup-soory-enter-bg.png b/src/images/za-images/1/popup-soory-enter-bg.png new file mode 100644 index 0000000..bd18480 Binary files /dev/null and b/src/images/za-images/1/popup-soory-enter-bg.png differ diff --git a/src/images/za-images/1/poster-bg.png b/src/images/za-images/1/poster-bg.png new file mode 100644 index 0000000..ea188ca Binary files /dev/null and b/src/images/za-images/1/poster-bg.png differ diff --git a/src/images/za-images/1/poster.png b/src/images/za-images/1/poster.png new file mode 100644 index 0000000..540b403 Binary files /dev/null and b/src/images/za-images/1/poster.png differ diff --git a/src/images/za-images/1/poster的副本.png b/src/images/za-images/1/poster的副本.png new file mode 100644 index 0000000..540b403 Binary files /dev/null and b/src/images/za-images/1/poster的副本.png differ diff --git a/src/images/za-images/1/privacyAgreement-icon.png b/src/images/za-images/1/privacyAgreement-icon.png new file mode 100644 index 0000000..80ed01a Binary files /dev/null and b/src/images/za-images/1/privacyAgreement-icon.png differ diff --git a/src/images/za-images/1/question-prev.png b/src/images/za-images/1/question-prev.png new file mode 100644 index 0000000..4980a64 Binary files /dev/null and b/src/images/za-images/1/question-prev.png differ diff --git a/src/images/za-images/1/question-true.png b/src/images/za-images/1/question-true.png new file mode 100644 index 0000000..65f4465 Binary files /dev/null and b/src/images/za-images/1/question-true.png differ diff --git a/src/images/za-images/1/right.png b/src/images/za-images/1/right.png new file mode 100644 index 0000000..c14fb2f Binary files /dev/null and b/src/images/za-images/1/right.png differ diff --git a/src/images/za-images/1/save-active-plan.png b/src/images/za-images/1/save-active-plan.png new file mode 100644 index 0000000..2af71c9 Binary files /dev/null and b/src/images/za-images/1/save-active-plan.png differ diff --git a/src/images/za-images/1/save-active.png b/src/images/za-images/1/save-active.png new file mode 100644 index 0000000..8025930 Binary files /dev/null and b/src/images/za-images/1/save-active.png differ diff --git a/src/images/za-images/1/save.png b/src/images/za-images/1/save.png new file mode 100644 index 0000000..6173274 Binary files /dev/null and b/src/images/za-images/1/save.png differ diff --git a/src/images/za-images/1/scan-example.png b/src/images/za-images/1/scan-example.png new file mode 100644 index 0000000..dac390f Binary files /dev/null and b/src/images/za-images/1/scan-example.png differ diff --git a/src/images/za-images/1/search.png b/src/images/za-images/1/search.png new file mode 100644 index 0000000..b2e993c Binary files /dev/null and b/src/images/za-images/1/search.png differ diff --git a/src/images/za-images/1/select-active.png b/src/images/za-images/1/select-active.png new file mode 100644 index 0000000..d5c9d7d Binary files /dev/null and b/src/images/za-images/1/select-active.png differ diff --git a/src/images/za-images/1/select.png b/src/images/za-images/1/select.png new file mode 100644 index 0000000..06ffa29 Binary files /dev/null and b/src/images/za-images/1/select.png differ diff --git a/src/images/za-images/1/server-bg.png b/src/images/za-images/1/server-bg.png new file mode 100644 index 0000000..4804372 Binary files /dev/null and b/src/images/za-images/1/server-bg.png differ diff --git a/src/images/za-images/1/server-icon1.png b/src/images/za-images/1/server-icon1.png new file mode 100644 index 0000000..128b5ed Binary files /dev/null and b/src/images/za-images/1/server-icon1.png differ diff --git a/src/images/za-images/1/server-icon2.png b/src/images/za-images/1/server-icon2.png new file mode 100644 index 0000000..128b5ed Binary files /dev/null and b/src/images/za-images/1/server-icon2.png differ diff --git a/src/images/za-images/1/share-active.png b/src/images/za-images/1/share-active.png new file mode 100644 index 0000000..81e062c Binary files /dev/null and b/src/images/za-images/1/share-active.png differ diff --git a/src/images/za-images/1/share.png b/src/images/za-images/1/share.png new file mode 100644 index 0000000..35ddae7 Binary files /dev/null and b/src/images/za-images/1/share.png differ diff --git a/src/images/za-images/1/site.png b/src/images/za-images/1/site.png new file mode 100644 index 0000000..5a2f7aa Binary files /dev/null and b/src/images/za-images/1/site.png differ diff --git a/src/images/za-images/1/star-active.png b/src/images/za-images/1/star-active.png new file mode 100644 index 0000000..64d0e24 Binary files /dev/null and b/src/images/za-images/1/star-active.png differ diff --git a/src/images/za-images/1/star-detail.png b/src/images/za-images/1/star-detail.png new file mode 100644 index 0000000..a08d7f9 Binary files /dev/null and b/src/images/za-images/1/star-detail.png differ diff --git a/src/images/za-images/1/star.png b/src/images/za-images/1/star.png new file mode 100644 index 0000000..5b8603c Binary files /dev/null and b/src/images/za-images/1/star.png differ diff --git a/src/images/za-images/1/start.gif b/src/images/za-images/1/start.gif new file mode 100644 index 0000000..5d2ce34 Binary files /dev/null and b/src/images/za-images/1/start.gif differ diff --git a/src/images/za-images/1/start.png b/src/images/za-images/1/start.png new file mode 100644 index 0000000..3685663 Binary files /dev/null and b/src/images/za-images/1/start.png differ diff --git a/src/images/za-images/1/story-bg.png b/src/images/za-images/1/story-bg.png new file mode 100644 index 0000000..754cbb3 Binary files /dev/null and b/src/images/za-images/1/story-bg.png differ diff --git a/src/images/za-images/1/story-enter-bg.png b/src/images/za-images/1/story-enter-bg.png new file mode 100644 index 0000000..9a3511f Binary files /dev/null and b/src/images/za-images/1/story-enter-bg.png differ diff --git a/src/images/za-images/1/story-share.png b/src/images/za-images/1/story-share.png new file mode 100644 index 0000000..05d9f08 Binary files /dev/null and b/src/images/za-images/1/story-share.png differ diff --git a/src/images/za-images/1/storyDetail-bg.png b/src/images/za-images/1/storyDetail-bg.png new file mode 100644 index 0000000..8279539 Binary files /dev/null and b/src/images/za-images/1/storyDetail-bg.png differ diff --git a/src/images/za-images/1/storyGuide-bg.png b/src/images/za-images/1/storyGuide-bg.png new file mode 100644 index 0000000..82ff51f Binary files /dev/null and b/src/images/za-images/1/storyGuide-bg.png differ diff --git a/src/images/za-images/1/storyStatus1.png b/src/images/za-images/1/storyStatus1.png new file mode 100644 index 0000000..efb6811 Binary files /dev/null and b/src/images/za-images/1/storyStatus1.png differ diff --git a/src/images/za-images/1/storyStatus2.png b/src/images/za-images/1/storyStatus2.png new file mode 100644 index 0000000..64cf431 Binary files /dev/null and b/src/images/za-images/1/storyStatus2.png differ diff --git a/src/images/za-images/1/storyStatus3.png b/src/images/za-images/1/storyStatus3.png new file mode 100644 index 0000000..8cb3c9b Binary files /dev/null and b/src/images/za-images/1/storyStatus3.png differ diff --git a/src/images/za-images/1/storyStatus4.png b/src/images/za-images/1/storyStatus4.png new file mode 100644 index 0000000..29c9444 Binary files /dev/null and b/src/images/za-images/1/storyStatus4.png differ diff --git a/src/images/za-images/1/succees.png b/src/images/za-images/1/succees.png new file mode 100644 index 0000000..ad9a47a Binary files /dev/null and b/src/images/za-images/1/succees.png differ diff --git a/src/images/za-images/1/telephone.png b/src/images/za-images/1/telephone.png new file mode 100644 index 0000000..b4f1ab4 Binary files /dev/null and b/src/images/za-images/1/telephone.png differ diff --git a/src/images/za-images/1/thePublic-bg.png b/src/images/za-images/1/thePublic-bg.png new file mode 100644 index 0000000..a1ebbd3 Binary files /dev/null and b/src/images/za-images/1/thePublic-bg.png differ diff --git a/src/images/za-images/1/thePublic.png b/src/images/za-images/1/thePublic.png new file mode 100644 index 0000000..de01526 Binary files /dev/null and b/src/images/za-images/1/thePublic.png differ diff --git a/src/images/za-images/1/tip.png b/src/images/za-images/1/tip.png new file mode 100644 index 0000000..c3f5a6f Binary files /dev/null and b/src/images/za-images/1/tip.png differ diff --git a/src/images/za-images/1/toast-story-badge.png b/src/images/za-images/1/toast-story-badge.png new file mode 100644 index 0000000..a177382 Binary files /dev/null and b/src/images/za-images/1/toast-story-badge.png differ diff --git a/src/images/za-images/1/upload-cert.png b/src/images/za-images/1/upload-cert.png new file mode 100644 index 0000000..35d70c2 Binary files /dev/null and b/src/images/za-images/1/upload-cert.png differ diff --git a/src/images/za-images/1/upload-del.png b/src/images/za-images/1/upload-del.png new file mode 100644 index 0000000..f958124 Binary files /dev/null and b/src/images/za-images/1/upload-del.png differ diff --git a/src/images/za-images/1/upload-icon.png b/src/images/za-images/1/upload-icon.png new file mode 100644 index 0000000..4a96192 Binary files /dev/null and b/src/images/za-images/1/upload-icon.png differ diff --git a/src/images/za-images/1/video-play.png b/src/images/za-images/1/video-play.png new file mode 100644 index 0000000..d678f33 Binary files /dev/null and b/src/images/za-images/1/video-play.png differ diff --git a/src/images/za-images/1/view-active.png b/src/images/za-images/1/view-active.png new file mode 100644 index 0000000..ffd0638 Binary files /dev/null and b/src/images/za-images/1/view-active.png differ diff --git a/src/images/za-images/1/view-play.png b/src/images/za-images/1/view-play.png new file mode 100644 index 0000000..d678f33 Binary files /dev/null and b/src/images/za-images/1/view-play.png differ diff --git a/src/images/za-images/1/view.png b/src/images/za-images/1/view.png new file mode 100644 index 0000000..cbdef01 Binary files /dev/null and b/src/images/za-images/1/view.png differ diff --git a/src/images/za-images/1/voice-play.png b/src/images/za-images/1/voice-play.png new file mode 100644 index 0000000..980c05b Binary files /dev/null and b/src/images/za-images/1/voice-play.png differ diff --git a/src/images/za-images/1/voice-stop.png b/src/images/za-images/1/voice-stop.png new file mode 100644 index 0000000..9e3a1dd Binary files /dev/null and b/src/images/za-images/1/voice-stop.png differ diff --git a/src/images/za-images/1/warn.png b/src/images/za-images/1/warn.png new file mode 100644 index 0000000..262b42b Binary files /dev/null and b/src/images/za-images/1/warn.png differ diff --git a/src/images/za-images/1/wechat.png b/src/images/za-images/1/wechat.png new file mode 100644 index 0000000..9c142c2 Binary files /dev/null and b/src/images/za-images/1/wechat.png differ diff --git a/src/images/za-images/1/woman-active.png b/src/images/za-images/1/woman-active.png new file mode 100644 index 0000000..92b97c9 Binary files /dev/null and b/src/images/za-images/1/woman-active.png differ diff --git a/src/images/za-images/1/woman.png b/src/images/za-images/1/woman.png new file mode 100644 index 0000000..99dcbe3 Binary files /dev/null and b/src/images/za-images/1/woman.png differ diff --git a/src/images/za-images/2/adl-close1.png b/src/images/za-images/2/adl-close1.png new file mode 100644 index 0000000..1f9eaee Binary files /dev/null and b/src/images/za-images/2/adl-close1.png differ diff --git a/src/images/za-images/2/adl-close2.png b/src/images/za-images/2/adl-close2.png new file mode 100644 index 0000000..d11f8e6 Binary files /dev/null and b/src/images/za-images/2/adl-close2.png differ diff --git a/src/images/za-images/2/adl-money.png b/src/images/za-images/2/adl-money.png new file mode 100644 index 0000000..a32efc9 Binary files /dev/null and b/src/images/za-images/2/adl-money.png differ diff --git a/src/images/za-images/2/adl-result-btn.gif b/src/images/za-images/2/adl-result-btn.gif new file mode 100644 index 0000000..69b18ae Binary files /dev/null and b/src/images/za-images/2/adl-result-btn.gif differ diff --git a/src/images/za-images/2/big-money.png b/src/images/za-images/2/big-money.png new file mode 100644 index 0000000..1e6104a Binary files /dev/null and b/src/images/za-images/2/big-money.png differ diff --git a/src/images/za-images/2/close.png b/src/images/za-images/2/close.png new file mode 100644 index 0000000..48f39fc Binary files /dev/null and b/src/images/za-images/2/close.png differ diff --git a/src/images/za-images/2/doctor-bg.png b/src/images/za-images/2/doctor-bg.png new file mode 100644 index 0000000..4504cdc Binary files /dev/null and b/src/images/za-images/2/doctor-bg.png differ diff --git a/src/images/za-images/2/doctor-drug-bg.png b/src/images/za-images/2/doctor-drug-bg.png new file mode 100644 index 0000000..8752655 Binary files /dev/null and b/src/images/za-images/2/doctor-drug-bg.png differ diff --git a/src/images/za-images/2/doctor-home-bg.png b/src/images/za-images/2/doctor-home-bg.png new file mode 100644 index 0000000..87d80c7 Binary files /dev/null and b/src/images/za-images/2/doctor-home-bg.png differ diff --git a/src/images/za-images/2/doctor-home-drug-bg.png b/src/images/za-images/2/doctor-home-drug-bg.png new file mode 100644 index 0000000..245a11f Binary files /dev/null and b/src/images/za-images/2/doctor-home-drug-bg.png differ diff --git a/src/images/za-images/2/edit.png b/src/images/za-images/2/edit.png new file mode 100644 index 0000000..ea07315 Binary files /dev/null and b/src/images/za-images/2/edit.png differ diff --git a/src/images/za-images/2/follow.png b/src/images/za-images/2/follow.png new file mode 100644 index 0000000..9f3b638 Binary files /dev/null and b/src/images/za-images/2/follow.png differ diff --git a/src/images/za-images/2/gift-drug.png b/src/images/za-images/2/gift-drug.png new file mode 100644 index 0000000..b467e74 Binary files /dev/null and b/src/images/za-images/2/gift-drug.png differ diff --git a/src/images/za-images/2/gift-list-title.png b/src/images/za-images/2/gift-list-title.png new file mode 100644 index 0000000..889bf66 Binary files /dev/null and b/src/images/za-images/2/gift-list-title.png differ diff --git a/src/images/za-images/2/gift.png b/src/images/za-images/2/gift.png new file mode 100644 index 0000000..dff4385 Binary files /dev/null and b/src/images/za-images/2/gift.png differ diff --git a/src/images/za-images/2/mg.png b/src/images/za-images/2/mg.png new file mode 100644 index 0000000..1374728 Binary files /dev/null and b/src/images/za-images/2/mg.png differ diff --git a/src/images/za-images/2/money.png b/src/images/za-images/2/money.png new file mode 100644 index 0000000..6707a47 Binary files /dev/null and b/src/images/za-images/2/money.png differ diff --git a/src/images/za-images/2/new-label.png b/src/images/za-images/2/new-label.png new file mode 100644 index 0000000..a1a1d11 Binary files /dev/null and b/src/images/za-images/2/new-label.png differ diff --git a/src/images/za-images/2/notice.png b/src/images/za-images/2/notice.png new file mode 100644 index 0000000..f7ec080 Binary files /dev/null and b/src/images/za-images/2/notice.png differ diff --git a/src/images/za-images/2/order-end.png b/src/images/za-images/2/order-end.png new file mode 100644 index 0000000..79f9dcf Binary files /dev/null and b/src/images/za-images/2/order-end.png differ diff --git a/src/images/za-images/2/order-site.png b/src/images/za-images/2/order-site.png new file mode 100644 index 0000000..e7b6977 Binary files /dev/null and b/src/images/za-images/2/order-site.png differ diff --git a/src/images/za-images/2/order-status1.png b/src/images/za-images/2/order-status1.png new file mode 100644 index 0000000..dfe8d09 Binary files /dev/null and b/src/images/za-images/2/order-status1.png differ diff --git a/src/images/za-images/2/popup-dedicated-doctor-bg.png b/src/images/za-images/2/popup-dedicated-doctor-bg.png new file mode 100644 index 0000000..fd486ac Binary files /dev/null and b/src/images/za-images/2/popup-dedicated-doctor-bg.png differ diff --git a/src/images/za-images/2/popup-dedicated-doctor-content-drug.png b/src/images/za-images/2/popup-dedicated-doctor-content-drug.png new file mode 100644 index 0000000..2ede554 Binary files /dev/null and b/src/images/za-images/2/popup-dedicated-doctor-content-drug.png differ diff --git a/src/images/za-images/2/popup-dedicated-doctor-content.png b/src/images/za-images/2/popup-dedicated-doctor-content.png new file mode 100644 index 0000000..c7ce33d Binary files /dev/null and b/src/images/za-images/2/popup-dedicated-doctor-content.png differ diff --git a/src/images/za-images/2/popup-dedicated-doctor-drug-bg.png b/src/images/za-images/2/popup-dedicated-doctor-drug-bg.png new file mode 100644 index 0000000..4a1e146 Binary files /dev/null and b/src/images/za-images/2/popup-dedicated-doctor-drug-bg.png differ diff --git a/src/images/za-images/2/price-detail-banner-bg.png b/src/images/za-images/2/price-detail-banner-bg.png new file mode 100644 index 0000000..6c85355 Binary files /dev/null and b/src/images/za-images/2/price-detail-banner-bg.png differ diff --git a/src/images/za-images/2/progress-bg1.png b/src/images/za-images/2/progress-bg1.png new file mode 100644 index 0000000..a29e6e1 Binary files /dev/null and b/src/images/za-images/2/progress-bg1.png differ diff --git a/src/images/za-images/2/progress-bg2.png b/src/images/za-images/2/progress-bg2.png new file mode 100644 index 0000000..ae25c00 Binary files /dev/null and b/src/images/za-images/2/progress-bg2.png differ diff --git a/src/images/za-images/2/progress-end-bg1.png b/src/images/za-images/2/progress-end-bg1.png new file mode 100644 index 0000000..d6723b4 Binary files /dev/null and b/src/images/za-images/2/progress-end-bg1.png differ diff --git a/src/images/za-images/2/progress-end-bg2.png b/src/images/za-images/2/progress-end-bg2.png new file mode 100644 index 0000000..95eb6e9 Binary files /dev/null and b/src/images/za-images/2/progress-end-bg2.png differ diff --git a/src/images/za-images/2/score-rule-bg.png b/src/images/za-images/2/score-rule-bg.png new file mode 100644 index 0000000..4e5ad1c Binary files /dev/null and b/src/images/za-images/2/score-rule-bg.png differ diff --git a/src/images/za-images/2/score-rule-title1.png b/src/images/za-images/2/score-rule-title1.png new file mode 100644 index 0000000..ece17f7 Binary files /dev/null and b/src/images/za-images/2/score-rule-title1.png differ diff --git a/src/images/za-images/2/score-rule-title2.png b/src/images/za-images/2/score-rule-title2.png new file mode 100644 index 0000000..eebc069 Binary files /dev/null and b/src/images/za-images/2/score-rule-title2.png differ diff --git a/src/images/za-images/2/score-rule-title3.png b/src/images/za-images/2/score-rule-title3.png new file mode 100644 index 0000000..d2ba554 Binary files /dev/null and b/src/images/za-images/2/score-rule-title3.png differ diff --git a/src/images/za-images/2/site.png b/src/images/za-images/2/site.png new file mode 100644 index 0000000..d19c2d0 Binary files /dev/null and b/src/images/za-images/2/site.png differ diff --git a/src/images/za-images/2/story-guide1.png b/src/images/za-images/2/story-guide1.png new file mode 100644 index 0000000..a03ed70 Binary files /dev/null and b/src/images/za-images/2/story-guide1.png differ diff --git a/src/images/za-images/2/story-guide2.png b/src/images/za-images/2/story-guide2.png new file mode 100644 index 0000000..cb1bf9d Binary files /dev/null and b/src/images/za-images/2/story-guide2.png differ diff --git a/src/images/za-images/2/story-guide3.png b/src/images/za-images/2/story-guide3.png new file mode 100644 index 0000000..ed074ad Binary files /dev/null and b/src/images/za-images/2/story-guide3.png differ diff --git a/src/images/za-images/2/true.png b/src/images/za-images/2/true.png new file mode 100644 index 0000000..5a28bee Binary files /dev/null and b/src/images/za-images/2/true.png differ diff --git a/src/images/za-images/3/icon-clock.png b/src/images/za-images/3/icon-clock.png new file mode 100644 index 0000000..dea669a Binary files /dev/null and b/src/images/za-images/3/icon-clock.png differ diff --git a/src/images/za-images/3/icon-edit-white.png b/src/images/za-images/3/icon-edit-white.png new file mode 100644 index 0000000..e6f1149 Binary files /dev/null and b/src/images/za-images/3/icon-edit-white.png differ diff --git a/src/images/za-images/3/icon-send-date.png b/src/images/za-images/3/icon-send-date.png new file mode 100644 index 0000000..d31fae5 Binary files /dev/null and b/src/images/za-images/3/icon-send-date.png differ diff --git a/src/images/za-images/3/icon-user.png b/src/images/za-images/3/icon-user.png new file mode 100644 index 0000000..6b6f48e Binary files /dev/null and b/src/images/za-images/3/icon-user.png differ diff --git a/src/images/za-images/3/order-end.png b/src/images/za-images/3/order-end.png new file mode 100644 index 0000000..2e83433 Binary files /dev/null and b/src/images/za-images/3/order-end.png differ diff --git a/src/images/za-images/3/triangle-down.png b/src/images/za-images/3/triangle-down.png new file mode 100644 index 0000000..5183024 Binary files /dev/null and b/src/images/za-images/3/triangle-down.png differ diff --git a/src/images/za-images/3/userinfo-bg.png b/src/images/za-images/3/userinfo-bg.png new file mode 100644 index 0000000..bf74e21 Binary files /dev/null and b/src/images/za-images/3/userinfo-bg.png differ diff --git a/src/images/za-images/5/card1.png b/src/images/za-images/5/card1.png new file mode 100644 index 0000000..230030f Binary files /dev/null and b/src/images/za-images/5/card1.png differ diff --git a/src/images/za-images/5/close1.png b/src/images/za-images/5/close1.png new file mode 100644 index 0000000..65fc01f Binary files /dev/null and b/src/images/za-images/5/close1.png differ diff --git a/src/images/za-images/5/code.png b/src/images/za-images/5/code.png new file mode 100644 index 0000000..9432646 Binary files /dev/null and b/src/images/za-images/5/code.png differ diff --git a/src/images/za-images/5/d_home_icon1.png b/src/images/za-images/5/d_home_icon1.png new file mode 100644 index 0000000..8d54978 Binary files /dev/null and b/src/images/za-images/5/d_home_icon1.png differ diff --git a/src/images/za-images/5/d_home_icon2.png b/src/images/za-images/5/d_home_icon2.png new file mode 100644 index 0000000..ab6a95e Binary files /dev/null and b/src/images/za-images/5/d_home_icon2.png differ diff --git a/src/images/za-images/5/d_home_icon3.png b/src/images/za-images/5/d_home_icon3.png new file mode 100644 index 0000000..5c65a9b Binary files /dev/null and b/src/images/za-images/5/d_home_icon3.png differ diff --git a/src/images/za-images/5/d_home_icon4.png b/src/images/za-images/5/d_home_icon4.png new file mode 100644 index 0000000..ca8c3ef Binary files /dev/null and b/src/images/za-images/5/d_home_icon4.png differ diff --git a/src/images/za-images/5/doctor.png b/src/images/za-images/5/doctor.png new file mode 100644 index 0000000..b3d181f Binary files /dev/null and b/src/images/za-images/5/doctor.png differ diff --git a/src/images/za-images/5/eye1.png b/src/images/za-images/5/eye1.png new file mode 100644 index 0000000..0fd9436 Binary files /dev/null and b/src/images/za-images/5/eye1.png differ diff --git a/src/images/za-images/5/eye2.png b/src/images/za-images/5/eye2.png new file mode 100644 index 0000000..59ceb60 Binary files /dev/null and b/src/images/za-images/5/eye2.png differ diff --git a/src/images/za-images/5/hostipal.png b/src/images/za-images/5/hostipal.png new file mode 100644 index 0000000..8be6677 Binary files /dev/null and b/src/images/za-images/5/hostipal.png differ diff --git a/src/images/za-images/5/icon-message.png b/src/images/za-images/5/icon-message.png new file mode 100644 index 0000000..67b9023 Binary files /dev/null and b/src/images/za-images/5/icon-message.png differ diff --git a/src/images/za-images/5/icon-referral.png b/src/images/za-images/5/icon-referral.png new file mode 100644 index 0000000..3d76b67 Binary files /dev/null and b/src/images/za-images/5/icon-referral.png differ diff --git a/src/images/za-images/5/logo1.png b/src/images/za-images/5/logo1.png new file mode 100644 index 0000000..7a8acee Binary files /dev/null and b/src/images/za-images/5/logo1.png differ diff --git a/src/images/za-images/5/new.png b/src/images/za-images/5/new.png new file mode 100644 index 0000000..89ec30f Binary files /dev/null and b/src/images/za-images/5/new.png differ diff --git a/src/images/za-images/5/public-bg1.png b/src/images/za-images/5/public-bg1.png new file mode 100644 index 0000000..8757257 Binary files /dev/null and b/src/images/za-images/5/public-bg1.png differ diff --git a/src/images/za-images/5/record-btn.png b/src/images/za-images/5/record-btn.png new file mode 100644 index 0000000..7ad0990 Binary files /dev/null and b/src/images/za-images/5/record-btn.png differ diff --git a/src/images/za-images/5/referral-card.png b/src/images/za-images/5/referral-card.png new file mode 100644 index 0000000..fd89ba0 Binary files /dev/null and b/src/images/za-images/5/referral-card.png differ diff --git a/src/images/za-images/5/referral-toast-bg.png b/src/images/za-images/5/referral-toast-bg.png new file mode 100644 index 0000000..1c96358 Binary files /dev/null and b/src/images/za-images/5/referral-toast-bg.png differ diff --git a/src/images/za-images/5/reg-close.png b/src/images/za-images/5/reg-close.png new file mode 100644 index 0000000..d8880ce Binary files /dev/null and b/src/images/za-images/5/reg-close.png differ diff --git a/src/images/za-images/5/safe-bg.png b/src/images/za-images/5/safe-bg.png new file mode 100644 index 0000000..0d1e011 Binary files /dev/null and b/src/images/za-images/5/safe-bg.png differ diff --git a/src/images/za-images/5/share1.png b/src/images/za-images/5/share1.png new file mode 100644 index 0000000..f03bb55 Binary files /dev/null and b/src/images/za-images/5/share1.png differ diff --git a/src/images/za-images/5/year-bg.png b/src/images/za-images/5/year-bg.png new file mode 100644 index 0000000..6c38503 Binary files /dev/null and b/src/images/za-images/5/year-bg.png differ diff --git a/src/images/za-images/bg1.png b/src/images/za-images/bg1.png new file mode 100644 index 0000000..feff44e Binary files /dev/null and b/src/images/za-images/bg1.png differ diff --git a/src/images/za-images/bg2.png b/src/images/za-images/bg2.png new file mode 100644 index 0000000..eff00bf Binary files /dev/null and b/src/images/za-images/bg2.png differ diff --git a/src/images/za-images/bg3.png b/src/images/za-images/bg3.png new file mode 100644 index 0000000..37a334b Binary files /dev/null and b/src/images/za-images/bg3.png differ diff --git a/src/images/za-images/bg4.png b/src/images/za-images/bg4.png new file mode 100644 index 0000000..c72f4c0 Binary files /dev/null and b/src/images/za-images/bg4.png differ diff --git a/src/images/za-images/bg5.png b/src/images/za-images/bg5.png new file mode 100644 index 0000000..575f1fa Binary files /dev/null and b/src/images/za-images/bg5.png differ diff --git a/src/images/za-images/cutaneous/2-1.png b/src/images/za-images/cutaneous/2-1.png new file mode 100644 index 0000000..dc195e0 Binary files /dev/null and b/src/images/za-images/cutaneous/2-1.png differ diff --git a/src/images/za-images/cutaneous/2-2.png b/src/images/za-images/cutaneous/2-2.png new file mode 100644 index 0000000..ad2dbf9 Binary files /dev/null and b/src/images/za-images/cutaneous/2-2.png differ diff --git a/src/images/za-images/cutaneous/2-3.png b/src/images/za-images/cutaneous/2-3.png new file mode 100644 index 0000000..9e899c0 Binary files /dev/null and b/src/images/za-images/cutaneous/2-3.png differ diff --git a/src/images/za-images/cutaneous/2-4.png b/src/images/za-images/cutaneous/2-4.png new file mode 100644 index 0000000..440acdf Binary files /dev/null and b/src/images/za-images/cutaneous/2-4.png differ diff --git a/src/images/za-images/cutaneous/3-1.png b/src/images/za-images/cutaneous/3-1.png new file mode 100644 index 0000000..6c5797f Binary files /dev/null and b/src/images/za-images/cutaneous/3-1.png differ diff --git a/src/images/za-images/cutaneous/3-2.png b/src/images/za-images/cutaneous/3-2.png new file mode 100644 index 0000000..38e0e92 Binary files /dev/null and b/src/images/za-images/cutaneous/3-2.png differ diff --git a/src/images/za-images/cutaneous/3-3.png b/src/images/za-images/cutaneous/3-3.png new file mode 100644 index 0000000..0139d5a Binary files /dev/null and b/src/images/za-images/cutaneous/3-3.png differ diff --git a/src/images/za-images/cutaneous/3-4.png b/src/images/za-images/cutaneous/3-4.png new file mode 100644 index 0000000..b2029a6 Binary files /dev/null and b/src/images/za-images/cutaneous/3-4.png differ diff --git a/src/images/za-images/cutaneous/3-5.png b/src/images/za-images/cutaneous/3-5.png new file mode 100644 index 0000000..e4b27c3 Binary files /dev/null and b/src/images/za-images/cutaneous/3-5.png differ diff --git a/src/images/za-images/cutaneous/4-1.png b/src/images/za-images/cutaneous/4-1.png new file mode 100644 index 0000000..9911bfa Binary files /dev/null and b/src/images/za-images/cutaneous/4-1.png differ diff --git a/src/images/za-images/cutaneous/4-2.png b/src/images/za-images/cutaneous/4-2.png new file mode 100644 index 0000000..980fc34 Binary files /dev/null and b/src/images/za-images/cutaneous/4-2.png differ diff --git a/src/images/za-images/cutaneous/5-1.png b/src/images/za-images/cutaneous/5-1.png new file mode 100644 index 0000000..3a867ff Binary files /dev/null and b/src/images/za-images/cutaneous/5-1.png differ diff --git a/src/images/za-images/cutaneous/5-2.png b/src/images/za-images/cutaneous/5-2.png new file mode 100644 index 0000000..130ea88 Binary files /dev/null and b/src/images/za-images/cutaneous/5-2.png differ diff --git a/src/images/za-images/cutaneous/5-3.png b/src/images/za-images/cutaneous/5-3.png new file mode 100644 index 0000000..d810ea5 Binary files /dev/null and b/src/images/za-images/cutaneous/5-3.png differ diff --git a/src/images/za-images/cutaneous/5-4.png b/src/images/za-images/cutaneous/5-4.png new file mode 100644 index 0000000..f6ab353 Binary files /dev/null and b/src/images/za-images/cutaneous/5-4.png differ diff --git a/src/images/za-images/cutaneous/5-5.png b/src/images/za-images/cutaneous/5-5.png new file mode 100644 index 0000000..d362baf Binary files /dev/null and b/src/images/za-images/cutaneous/5-5.png differ diff --git a/src/images/za-images/cutaneous/cidp-mask.png b/src/images/za-images/cutaneous/cidp-mask.png new file mode 100644 index 0000000..2386e41 Binary files /dev/null and b/src/images/za-images/cutaneous/cidp-mask.png differ diff --git a/src/images/za-images/cutaneous/home1.png b/src/images/za-images/cutaneous/home1.png new file mode 100644 index 0000000..482afa0 Binary files /dev/null and b/src/images/za-images/cutaneous/home1.png differ diff --git a/src/images/za-images/cutaneous/home2.png b/src/images/za-images/cutaneous/home2.png new file mode 100644 index 0000000..67f882a Binary files /dev/null and b/src/images/za-images/cutaneous/home2.png differ diff --git a/src/images/za-images/cutaneous/home3.png b/src/images/za-images/cutaneous/home3.png new file mode 100644 index 0000000..84df3ba Binary files /dev/null and b/src/images/za-images/cutaneous/home3.png differ diff --git a/src/images/za-images/cutaneous/home4.png b/src/images/za-images/cutaneous/home4.png new file mode 100644 index 0000000..f038a9c Binary files /dev/null and b/src/images/za-images/cutaneous/home4.png differ diff --git a/src/images/za-images/cutaneous/home5.png b/src/images/za-images/cutaneous/home5.png new file mode 100644 index 0000000..29c3ee7 Binary files /dev/null and b/src/images/za-images/cutaneous/home5.png differ diff --git a/src/images/za-images/cutaneous/home6.png b/src/images/za-images/cutaneous/home6.png new file mode 100644 index 0000000..e3f8f6d Binary files /dev/null and b/src/images/za-images/cutaneous/home6.png differ diff --git a/src/images/za-images/cutaneous/video-bg.png b/src/images/za-images/cutaneous/video-bg.png new file mode 100644 index 0000000..0cbf1be Binary files /dev/null and b/src/images/za-images/cutaneous/video-bg.png differ diff --git a/src/images/za-images/cutaneous/video1-1.png b/src/images/za-images/cutaneous/video1-1.png new file mode 100644 index 0000000..9276f67 Binary files /dev/null and b/src/images/za-images/cutaneous/video1-1.png differ diff --git a/src/images/za-images/cutaneous/video2-1.png b/src/images/za-images/cutaneous/video2-1.png new file mode 100644 index 0000000..7637f8f Binary files /dev/null and b/src/images/za-images/cutaneous/video2-1.png differ diff --git a/src/images/za-images/cutaneous/video2-2.png b/src/images/za-images/cutaneous/video2-2.png new file mode 100644 index 0000000..dd8ad62 Binary files /dev/null and b/src/images/za-images/cutaneous/video2-2.png differ diff --git a/src/images/za-images/cutaneous/video2-3.png b/src/images/za-images/cutaneous/video2-3.png new file mode 100644 index 0000000..3cc64dc Binary files /dev/null and b/src/images/za-images/cutaneous/video2-3.png differ diff --git a/src/images/za-images/cutaneous/video2-4.png b/src/images/za-images/cutaneous/video2-4.png new file mode 100644 index 0000000..81aa89b Binary files /dev/null and b/src/images/za-images/cutaneous/video2-4.png differ diff --git a/src/images/za-images/doctor/arrow-right.png b/src/images/za-images/doctor/arrow-right.png new file mode 100644 index 0000000..e4bb4e8 Binary files /dev/null and b/src/images/za-images/doctor/arrow-right.png differ diff --git a/src/images/za-images/doctor/arrow-right1.png b/src/images/za-images/doctor/arrow-right1.png new file mode 100644 index 0000000..e8760fa Binary files /dev/null and b/src/images/za-images/doctor/arrow-right1.png differ diff --git a/src/images/za-images/doctor/audio-left.gif b/src/images/za-images/doctor/audio-left.gif new file mode 100644 index 0000000..121b528 Binary files /dev/null and b/src/images/za-images/doctor/audio-left.gif differ diff --git a/src/images/za-images/doctor/audio-left.png b/src/images/za-images/doctor/audio-left.png new file mode 100644 index 0000000..7eec941 Binary files /dev/null and b/src/images/za-images/doctor/audio-left.png differ diff --git a/src/images/za-images/doctor/audio-right.gif b/src/images/za-images/doctor/audio-right.gif new file mode 100644 index 0000000..dfb7a5a Binary files /dev/null and b/src/images/za-images/doctor/audio-right.gif differ diff --git a/src/images/za-images/doctor/audio-right.png b/src/images/za-images/doctor/audio-right.png new file mode 100644 index 0000000..eabc8c0 Binary files /dev/null and b/src/images/za-images/doctor/audio-right.png differ diff --git a/src/images/za-images/doctor/circle-right.png b/src/images/za-images/doctor/circle-right.png new file mode 100644 index 0000000..2487e4c Binary files /dev/null and b/src/images/za-images/doctor/circle-right.png differ diff --git a/src/images/za-images/doctor/clear.png b/src/images/za-images/doctor/clear.png new file mode 100644 index 0000000..0226ae7 Binary files /dev/null and b/src/images/za-images/doctor/clear.png differ diff --git a/src/images/za-images/doctor/create-task-bg.png b/src/images/za-images/doctor/create-task-bg.png new file mode 100644 index 0000000..a958a3f Binary files /dev/null and b/src/images/za-images/doctor/create-task-bg.png differ diff --git a/src/images/za-images/doctor/custom-export-badge.png b/src/images/za-images/doctor/custom-export-badge.png new file mode 100644 index 0000000..bcdc9eb Binary files /dev/null and b/src/images/za-images/doctor/custom-export-badge.png differ diff --git a/src/images/za-images/doctor/d_interactive-adl-bg.png b/src/images/za-images/doctor/d_interactive-adl-bg.png new file mode 100644 index 0000000..c7d11c1 Binary files /dev/null and b/src/images/za-images/doctor/d_interactive-adl-bg.png differ diff --git a/src/images/za-images/doctor/d_interactivePatient-tab-active1.png b/src/images/za-images/doctor/d_interactivePatient-tab-active1.png new file mode 100644 index 0000000..2907e9a Binary files /dev/null and b/src/images/za-images/doctor/d_interactivePatient-tab-active1.png differ diff --git a/src/images/za-images/doctor/d_interactivePatient-tab-active2.png b/src/images/za-images/doctor/d_interactivePatient-tab-active2.png new file mode 100644 index 0000000..a306039 Binary files /dev/null and b/src/images/za-images/doctor/d_interactivePatient-tab-active2.png differ diff --git a/src/images/za-images/doctor/d_interactivePatient-tab-active3.png b/src/images/za-images/doctor/d_interactivePatient-tab-active3.png new file mode 100644 index 0000000..91f4943 Binary files /dev/null and b/src/images/za-images/doctor/d_interactivePatient-tab-active3.png differ diff --git a/src/images/za-images/doctor/d_interactivePatient-tab-active4.png b/src/images/za-images/doctor/d_interactivePatient-tab-active4.png new file mode 100644 index 0000000..484b8d5 Binary files /dev/null and b/src/images/za-images/doctor/d_interactivePatient-tab-active4.png differ diff --git a/src/images/za-images/doctor/d_interactivePatient-tab1.png b/src/images/za-images/doctor/d_interactivePatient-tab1.png new file mode 100644 index 0000000..189192a Binary files /dev/null and b/src/images/za-images/doctor/d_interactivePatient-tab1.png differ diff --git a/src/images/za-images/doctor/d_interactivePatient-tab2.png b/src/images/za-images/doctor/d_interactivePatient-tab2.png new file mode 100644 index 0000000..71c9e21 Binary files /dev/null and b/src/images/za-images/doctor/d_interactivePatient-tab2.png differ diff --git a/src/images/za-images/doctor/d_interactivePatient-tab3.png b/src/images/za-images/doctor/d_interactivePatient-tab3.png new file mode 100644 index 0000000..d49b2e5 Binary files /dev/null and b/src/images/za-images/doctor/d_interactivePatient-tab3.png differ diff --git a/src/images/za-images/doctor/d_interactivePatient-tab4.png b/src/images/za-images/doctor/d_interactivePatient-tab4.png new file mode 100644 index 0000000..bc97209 Binary files /dev/null and b/src/images/za-images/doctor/d_interactivePatient-tab4.png differ diff --git a/src/images/za-images/doctor/d_interactiveTitle1.png b/src/images/za-images/doctor/d_interactiveTitle1.png new file mode 100644 index 0000000..546d63e Binary files /dev/null and b/src/images/za-images/doctor/d_interactiveTitle1.png differ diff --git a/src/images/za-images/doctor/d_patient-bg.png b/src/images/za-images/doctor/d_patient-bg.png new file mode 100644 index 0000000..86ba202 Binary files /dev/null and b/src/images/za-images/doctor/d_patient-bg.png differ diff --git a/src/images/za-images/doctor/d_patient-detail-bg.png b/src/images/za-images/doctor/d_patient-detail-bg.png new file mode 100644 index 0000000..7ecfb22 Binary files /dev/null and b/src/images/za-images/doctor/d_patient-detail-bg.png differ diff --git a/src/images/za-images/doctor/data-down.png b/src/images/za-images/doctor/data-down.png new file mode 100644 index 0000000..1465559 Binary files /dev/null and b/src/images/za-images/doctor/data-down.png differ diff --git a/src/images/za-images/doctor/doctor_a.jpg b/src/images/za-images/doctor/doctor_a.jpg new file mode 100644 index 0000000..31e544a Binary files /dev/null and b/src/images/za-images/doctor/doctor_a.jpg differ diff --git a/src/images/za-images/doctor/drug-label.png b/src/images/za-images/doctor/drug-label.png new file mode 100644 index 0000000..12f5689 Binary files /dev/null and b/src/images/za-images/doctor/drug-label.png differ diff --git a/src/images/za-images/doctor/export-guide.png b/src/images/za-images/doctor/export-guide.png new file mode 100644 index 0000000..1416051 Binary files /dev/null and b/src/images/za-images/doctor/export-guide.png differ diff --git a/src/images/za-images/doctor/export.gif b/src/images/za-images/doctor/export.gif new file mode 100644 index 0000000..f514555 Binary files /dev/null and b/src/images/za-images/doctor/export.gif differ diff --git a/src/images/za-images/doctor/export.png b/src/images/za-images/doctor/export.png new file mode 100644 index 0000000..2da6799 Binary files /dev/null and b/src/images/za-images/doctor/export.png differ diff --git a/src/images/za-images/doctor/home-bg.png b/src/images/za-images/doctor/home-bg.png new file mode 100644 index 0000000..fbc7ed4 Binary files /dev/null and b/src/images/za-images/doctor/home-bg.png differ diff --git a/src/images/za-images/doctor/home-title.png b/src/images/za-images/doctor/home-title.png new file mode 100644 index 0000000..c3c7659 Binary files /dev/null and b/src/images/za-images/doctor/home-title.png differ diff --git a/src/images/za-images/doctor/icon-adl-none.png b/src/images/za-images/doctor/icon-adl-none.png new file mode 100644 index 0000000..3dc53cf Binary files /dev/null and b/src/images/za-images/doctor/icon-adl-none.png differ diff --git a/src/images/za-images/doctor/icon-circle-down.png b/src/images/za-images/doctor/icon-circle-down.png new file mode 100644 index 0000000..1979a05 Binary files /dev/null and b/src/images/za-images/doctor/icon-circle-down.png differ diff --git a/src/images/za-images/doctor/icon-circle-up.png b/src/images/za-images/doctor/icon-circle-up.png new file mode 100644 index 0000000..f15aff3 Binary files /dev/null and b/src/images/za-images/doctor/icon-circle-up.png differ diff --git a/src/images/za-images/doctor/icon-clear.png b/src/images/za-images/doctor/icon-clear.png new file mode 100644 index 0000000..c526148 Binary files /dev/null and b/src/images/za-images/doctor/icon-clear.png differ diff --git a/src/images/za-images/doctor/icon-create.png b/src/images/za-images/doctor/icon-create.png new file mode 100644 index 0000000..fc09ac9 Binary files /dev/null and b/src/images/za-images/doctor/icon-create.png differ diff --git a/src/images/za-images/doctor/icon-date.png b/src/images/za-images/doctor/icon-date.png new file mode 100644 index 0000000..3a6220c Binary files /dev/null and b/src/images/za-images/doctor/icon-date.png differ diff --git a/src/images/za-images/doctor/icon-down-error.png b/src/images/za-images/doctor/icon-down-error.png new file mode 100644 index 0000000..b3caed9 Binary files /dev/null and b/src/images/za-images/doctor/icon-down-error.png differ diff --git a/src/images/za-images/doctor/icon-down-success.png b/src/images/za-images/doctor/icon-down-success.png new file mode 100644 index 0000000..33d9e99 Binary files /dev/null and b/src/images/za-images/doctor/icon-down-success.png differ diff --git a/src/images/za-images/doctor/icon-down-warn.png b/src/images/za-images/doctor/icon-down-warn.png new file mode 100644 index 0000000..a80866e Binary files /dev/null and b/src/images/za-images/doctor/icon-down-warn.png differ diff --git a/src/images/za-images/doctor/icon-down.png b/src/images/za-images/doctor/icon-down.png new file mode 100644 index 0000000..33d9e99 Binary files /dev/null and b/src/images/za-images/doctor/icon-down.png differ diff --git a/src/images/za-images/doctor/icon-down1.png b/src/images/za-images/doctor/icon-down1.png new file mode 100644 index 0000000..8721683 Binary files /dev/null and b/src/images/za-images/doctor/icon-down1.png differ diff --git a/src/images/za-images/doctor/icon-drug-none.png b/src/images/za-images/doctor/icon-drug-none.png new file mode 100644 index 0000000..67e69be Binary files /dev/null and b/src/images/za-images/doctor/icon-drug-none.png differ diff --git a/src/images/za-images/doctor/icon-edit.png b/src/images/za-images/doctor/icon-edit.png new file mode 100644 index 0000000..ae35a7f Binary files /dev/null and b/src/images/za-images/doctor/icon-edit.png differ diff --git a/src/images/za-images/doctor/icon-error.png b/src/images/za-images/doctor/icon-error.png new file mode 100644 index 0000000..dc105cb Binary files /dev/null and b/src/images/za-images/doctor/icon-error.png differ diff --git a/src/images/za-images/doctor/icon-export.png b/src/images/za-images/doctor/icon-export.png new file mode 100644 index 0000000..c101669 Binary files /dev/null and b/src/images/za-images/doctor/icon-export.png differ diff --git a/src/images/za-images/doctor/icon-man.png b/src/images/za-images/doctor/icon-man.png new file mode 100644 index 0000000..442d40f Binary files /dev/null and b/src/images/za-images/doctor/icon-man.png differ diff --git a/src/images/za-images/doctor/icon-message.png b/src/images/za-images/doctor/icon-message.png new file mode 100644 index 0000000..8b66368 Binary files /dev/null and b/src/images/za-images/doctor/icon-message.png differ diff --git a/src/images/za-images/doctor/icon-phone.png b/src/images/za-images/doctor/icon-phone.png new file mode 100644 index 0000000..a18fa06 Binary files /dev/null and b/src/images/za-images/doctor/icon-phone.png differ diff --git a/src/images/za-images/doctor/icon-question.png b/src/images/za-images/doctor/icon-question.png new file mode 100644 index 0000000..7711338 Binary files /dev/null and b/src/images/za-images/doctor/icon-question.png differ diff --git a/src/images/za-images/doctor/icon-question1.png b/src/images/za-images/doctor/icon-question1.png new file mode 100644 index 0000000..1bb7637 Binary files /dev/null and b/src/images/za-images/doctor/icon-question1.png differ diff --git a/src/images/za-images/doctor/icon-search.png b/src/images/za-images/doctor/icon-search.png new file mode 100644 index 0000000..5d49873 Binary files /dev/null and b/src/images/za-images/doctor/icon-search.png differ diff --git a/src/images/za-images/doctor/icon-select.png b/src/images/za-images/doctor/icon-select.png new file mode 100644 index 0000000..84f937f Binary files /dev/null and b/src/images/za-images/doctor/icon-select.png differ diff --git a/src/images/za-images/doctor/icon-site.png b/src/images/za-images/doctor/icon-site.png new file mode 100644 index 0000000..42b8580 Binary files /dev/null and b/src/images/za-images/doctor/icon-site.png differ diff --git a/src/images/za-images/doctor/icon-success.png b/src/images/za-images/doctor/icon-success.png new file mode 100644 index 0000000..82572dd Binary files /dev/null and b/src/images/za-images/doctor/icon-success.png differ diff --git a/src/images/za-images/doctor/icon-title-lable.png b/src/images/za-images/doctor/icon-title-lable.png new file mode 100644 index 0000000..cf3712a Binary files /dev/null and b/src/images/za-images/doctor/icon-title-lable.png differ diff --git a/src/images/za-images/doctor/icon-up-error.png b/src/images/za-images/doctor/icon-up-error.png new file mode 100644 index 0000000..617a728 Binary files /dev/null and b/src/images/za-images/doctor/icon-up-error.png differ diff --git a/src/images/za-images/doctor/icon-up-success.png b/src/images/za-images/doctor/icon-up-success.png new file mode 100644 index 0000000..efd6daf Binary files /dev/null and b/src/images/za-images/doctor/icon-up-success.png differ diff --git a/src/images/za-images/doctor/icon-up-warn.png b/src/images/za-images/doctor/icon-up-warn.png new file mode 100644 index 0000000..74f5a1f Binary files /dev/null and b/src/images/za-images/doctor/icon-up-warn.png differ diff --git a/src/images/za-images/doctor/icon-up.png b/src/images/za-images/doctor/icon-up.png new file mode 100644 index 0000000..617a728 Binary files /dev/null and b/src/images/za-images/doctor/icon-up.png differ diff --git a/src/images/za-images/doctor/icon-warn.png b/src/images/za-images/doctor/icon-warn.png new file mode 100644 index 0000000..ea96892 Binary files /dev/null and b/src/images/za-images/doctor/icon-warn.png differ diff --git a/src/images/za-images/doctor/icon-woman.png b/src/images/za-images/doctor/icon-woman.png new file mode 100644 index 0000000..9d04c8d Binary files /dev/null and b/src/images/za-images/doctor/icon-woman.png differ diff --git a/src/images/za-images/doctor/invite-bg.png b/src/images/za-images/doctor/invite-bg.png new file mode 100644 index 0000000..d1eff46 Binary files /dev/null and b/src/images/za-images/doctor/invite-bg.png differ diff --git a/src/images/za-images/doctor/invite-container-bg.png b/src/images/za-images/doctor/invite-container-bg.png new file mode 100644 index 0000000..62a436d Binary files /dev/null and b/src/images/za-images/doctor/invite-container-bg.png differ diff --git a/src/images/za-images/doctor/login-bg.png b/src/images/za-images/doctor/login-bg.png new file mode 100644 index 0000000..697cf0a Binary files /dev/null and b/src/images/za-images/doctor/login-bg.png differ diff --git a/src/images/za-images/doctor/login-title.png b/src/images/za-images/doctor/login-title.png new file mode 100644 index 0000000..53585c5 Binary files /dev/null and b/src/images/za-images/doctor/login-title.png differ diff --git a/src/images/za-images/doctor/my-bg.png b/src/images/za-images/doctor/my-bg.png new file mode 100644 index 0000000..fdf3a0a Binary files /dev/null and b/src/images/za-images/doctor/my-bg.png differ diff --git a/src/images/za-images/doctor/my-code.png b/src/images/za-images/doctor/my-code.png new file mode 100644 index 0000000..93f29c9 Binary files /dev/null and b/src/images/za-images/doctor/my-code.png differ diff --git a/src/images/za-images/doctor/my-list-icon1.png b/src/images/za-images/doctor/my-list-icon1.png new file mode 100644 index 0000000..60dcfdc Binary files /dev/null and b/src/images/za-images/doctor/my-list-icon1.png differ diff --git a/src/images/za-images/doctor/my-title1.png b/src/images/za-images/doctor/my-title1.png new file mode 100644 index 0000000..edddc79 Binary files /dev/null and b/src/images/za-images/doctor/my-title1.png differ diff --git a/src/images/za-images/doctor/my-title2.png b/src/images/za-images/doctor/my-title2.png new file mode 100644 index 0000000..cef9a9f Binary files /dev/null and b/src/images/za-images/doctor/my-title2.png differ diff --git a/src/images/za-images/doctor/new.png b/src/images/za-images/doctor/new.png new file mode 100644 index 0000000..839d040 Binary files /dev/null and b/src/images/za-images/doctor/new.png differ diff --git a/src/images/za-images/doctor/tabbar/1-active.png b/src/images/za-images/doctor/tabbar/1-active.png new file mode 100644 index 0000000..16e50a7 Binary files /dev/null and b/src/images/za-images/doctor/tabbar/1-active.png differ diff --git a/src/images/za-images/doctor/tabbar/1.png b/src/images/za-images/doctor/tabbar/1.png new file mode 100644 index 0000000..b3e154e Binary files /dev/null and b/src/images/za-images/doctor/tabbar/1.png differ diff --git a/src/images/za-images/doctor/tabbar/2-active.png b/src/images/za-images/doctor/tabbar/2-active.png new file mode 100644 index 0000000..1b5133c Binary files /dev/null and b/src/images/za-images/doctor/tabbar/2-active.png differ diff --git a/src/images/za-images/doctor/tabbar/2.png b/src/images/za-images/doctor/tabbar/2.png new file mode 100644 index 0000000..0501cc5 Binary files /dev/null and b/src/images/za-images/doctor/tabbar/2.png differ diff --git a/src/images/za-images/doctor/tabbar/3-active.png b/src/images/za-images/doctor/tabbar/3-active.png new file mode 100644 index 0000000..39e416e Binary files /dev/null and b/src/images/za-images/doctor/tabbar/3-active.png differ diff --git a/src/images/za-images/doctor/tabbar/3.png b/src/images/za-images/doctor/tabbar/3.png new file mode 100644 index 0000000..dd45f08 Binary files /dev/null and b/src/images/za-images/doctor/tabbar/3.png differ diff --git a/src/images/za-images/doctor/tabbar/4-active.png b/src/images/za-images/doctor/tabbar/4-active.png new file mode 100644 index 0000000..9e49dba Binary files /dev/null and b/src/images/za-images/doctor/tabbar/4-active.png differ diff --git a/src/images/za-images/doctor/tabbar/4.png b/src/images/za-images/doctor/tabbar/4.png new file mode 100644 index 0000000..ec5a265 Binary files /dev/null and b/src/images/za-images/doctor/tabbar/4.png differ diff --git a/src/images/za-images/doctor/trans-bg.png b/src/images/za-images/doctor/trans-bg.png new file mode 100644 index 0000000..8b3d5c3 Binary files /dev/null and b/src/images/za-images/doctor/trans-bg.png differ diff --git a/src/images/za-images/doctor/triangle-down.png b/src/images/za-images/doctor/triangle-down.png new file mode 100644 index 0000000..1465559 Binary files /dev/null and b/src/images/za-images/doctor/triangle-down.png differ diff --git a/src/images/za-images/doctor/user_default.png b/src/images/za-images/doctor/user_default.png new file mode 100644 index 0000000..e5b9ea5 Binary files /dev/null and b/src/images/za-images/doctor/user_default.png differ diff --git a/src/images/za-images/double-standard/adl-banner.png b/src/images/za-images/double-standard/adl-banner.png new file mode 100644 index 0000000..875976f Binary files /dev/null and b/src/images/za-images/double-standard/adl-banner.png differ diff --git a/src/images/za-images/double-standard/adl-bg.png b/src/images/za-images/double-standard/adl-bg.png new file mode 100644 index 0000000..0742790 Binary files /dev/null and b/src/images/za-images/double-standard/adl-bg.png differ diff --git a/src/images/za-images/double-standard/adl-cure.png b/src/images/za-images/double-standard/adl-cure.png new file mode 100644 index 0000000..64ad280 Binary files /dev/null and b/src/images/za-images/double-standard/adl-cure.png differ diff --git a/src/images/za-images/double-standard/adl-drug.png b/src/images/za-images/double-standard/adl-drug.png new file mode 100644 index 0000000..87d0289 Binary files /dev/null and b/src/images/za-images/double-standard/adl-drug.png differ diff --git a/src/images/za-images/double-standard/adl-play.png b/src/images/za-images/double-standard/adl-play.png new file mode 100644 index 0000000..5049c60 Binary files /dev/null and b/src/images/za-images/double-standard/adl-play.png differ diff --git a/src/images/za-images/double-standard/adl-poster.png b/src/images/za-images/double-standard/adl-poster.png new file mode 100644 index 0000000..d6d5a21 Binary files /dev/null and b/src/images/za-images/double-standard/adl-poster.png differ diff --git a/src/images/za-images/double-standard/adl-question.png b/src/images/za-images/double-standard/adl-question.png new file mode 100644 index 0000000..dc16cab Binary files /dev/null and b/src/images/za-images/double-standard/adl-question.png differ diff --git a/src/images/za-images/double-standard/adl-result-bg1.png b/src/images/za-images/double-standard/adl-result-bg1.png new file mode 100644 index 0000000..915f477 Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-bg1.png differ diff --git a/src/images/za-images/double-standard/adl-result-bg2.png b/src/images/za-images/double-standard/adl-result-bg2.png new file mode 100644 index 0000000..ce549a5 Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-bg2.png differ diff --git a/src/images/za-images/double-standard/adl-result-bg3.png b/src/images/za-images/double-standard/adl-result-bg3.png new file mode 100644 index 0000000..3ea0385 Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-bg3.png differ diff --git a/src/images/za-images/double-standard/adl-result-icon1.png b/src/images/za-images/double-standard/adl-result-icon1.png new file mode 100644 index 0000000..faa6d6d Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-icon1.png differ diff --git a/src/images/za-images/double-standard/adl-result-icon2.png b/src/images/za-images/double-standard/adl-result-icon2.png new file mode 100644 index 0000000..7e0c42e Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-icon2.png differ diff --git a/src/images/za-images/double-standard/adl-result-preple1.png b/src/images/za-images/double-standard/adl-result-preple1.png new file mode 100644 index 0000000..33c2d8b Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-preple1.png differ diff --git a/src/images/za-images/double-standard/adl-result-preple2.png b/src/images/za-images/double-standard/adl-result-preple2.png new file mode 100644 index 0000000..d5318ff Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-preple2.png differ diff --git a/src/images/za-images/double-standard/adl-result-preple3.png b/src/images/za-images/double-standard/adl-result-preple3.png new file mode 100644 index 0000000..23a45ff Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-preple3.png differ diff --git a/src/images/za-images/double-standard/adl-result-status1.png b/src/images/za-images/double-standard/adl-result-status1.png new file mode 100644 index 0000000..eab687d Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-status1.png differ diff --git a/src/images/za-images/double-standard/adl-result-status2.png b/src/images/za-images/double-standard/adl-result-status2.png new file mode 100644 index 0000000..f316c5a Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-status2.png differ diff --git a/src/images/za-images/double-standard/adl-result-status3.png b/src/images/za-images/double-standard/adl-result-status3.png new file mode 100644 index 0000000..35f445b Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-status3.png differ diff --git a/src/images/za-images/double-standard/adl-result-status4.png b/src/images/za-images/double-standard/adl-result-status4.png new file mode 100644 index 0000000..201936b Binary files /dev/null and b/src/images/za-images/double-standard/adl-result-status4.png differ diff --git a/src/images/za-images/double-standard/adl-rule-icon1.png b/src/images/za-images/double-standard/adl-rule-icon1.png new file mode 100644 index 0000000..7ce5e41 Binary files /dev/null and b/src/images/za-images/double-standard/adl-rule-icon1.png differ diff --git a/src/images/za-images/double-standard/adl-rule-icon2.png b/src/images/za-images/double-standard/adl-rule-icon2.png new file mode 100644 index 0000000..04d18b5 Binary files /dev/null and b/src/images/za-images/double-standard/adl-rule-icon2.png differ diff --git a/src/images/za-images/double-standard/adl-share.png b/src/images/za-images/double-standard/adl-share.png new file mode 100644 index 0000000..37ce0ab Binary files /dev/null and b/src/images/za-images/double-standard/adl-share.png differ diff --git a/src/images/za-images/double-standard/adl-success.png b/src/images/za-images/double-standard/adl-success.png new file mode 100644 index 0000000..551c6a7 Binary files /dev/null and b/src/images/za-images/double-standard/adl-success.png differ diff --git a/src/images/za-images/double-standard/double-standards-badge-drug.png b/src/images/za-images/double-standard/double-standards-badge-drug.png new file mode 100644 index 0000000..3b604bc Binary files /dev/null and b/src/images/za-images/double-standard/double-standards-badge-drug.png differ diff --git a/src/images/za-images/double-standard/double-standards-badge.png b/src/images/za-images/double-standard/double-standards-badge.png new file mode 100644 index 0000000..3d089d9 Binary files /dev/null and b/src/images/za-images/double-standard/double-standards-badge.png differ diff --git a/src/images/za-images/double-standard/home-adl-badge.png b/src/images/za-images/double-standard/home-adl-badge.png new file mode 100644 index 0000000..37ee723 Binary files /dev/null and b/src/images/za-images/double-standard/home-adl-badge.png differ diff --git a/src/images/za-images/double-standard/home-adl-bg.png b/src/images/za-images/double-standard/home-adl-bg.png new file mode 100644 index 0000000..0adf9af Binary files /dev/null and b/src/images/za-images/double-standard/home-adl-bg.png differ diff --git a/src/images/za-images/double-standard/home-adl-drug-badge.png b/src/images/za-images/double-standard/home-adl-drug-badge.png new file mode 100644 index 0000000..37888cc Binary files /dev/null and b/src/images/za-images/double-standard/home-adl-drug-badge.png differ diff --git a/src/images/za-images/double-standard/home-adl-drug-bg.png b/src/images/za-images/double-standard/home-adl-drug-bg.png new file mode 100644 index 0000000..a38ca5d Binary files /dev/null and b/src/images/za-images/double-standard/home-adl-drug-bg.png differ diff --git a/src/images/za-images/double-standard/home-adl-drug-new.png b/src/images/za-images/double-standard/home-adl-drug-new.png new file mode 100644 index 0000000..b23e031 Binary files /dev/null and b/src/images/za-images/double-standard/home-adl-drug-new.png differ diff --git a/src/images/za-images/double-standard/home-adl-new.png b/src/images/za-images/double-standard/home-adl-new.png new file mode 100644 index 0000000..a62b199 Binary files /dev/null and b/src/images/za-images/double-standard/home-adl-new.png differ diff --git a/src/images/za-images/double-standard/home-adl-title-drug.png b/src/images/za-images/double-standard/home-adl-title-drug.png new file mode 100644 index 0000000..58a3703 Binary files /dev/null and b/src/images/za-images/double-standard/home-adl-title-drug.png differ diff --git a/src/images/za-images/double-standard/home-adl-title.png b/src/images/za-images/double-standard/home-adl-title.png new file mode 100644 index 0000000..8bd7be9 Binary files /dev/null and b/src/images/za-images/double-standard/home-adl-title.png differ diff --git a/src/images/za-images/double-standard/home-new.png b/src/images/za-images/double-standard/home-new.png new file mode 100644 index 0000000..f3b5141 Binary files /dev/null and b/src/images/za-images/double-standard/home-new.png differ diff --git a/src/images/za-images/double-standard/share-badge.png b/src/images/za-images/double-standard/share-badge.png new file mode 100644 index 0000000..3d52822 Binary files /dev/null and b/src/images/za-images/double-standard/share-badge.png differ diff --git a/src/images/za-images/icon1.png b/src/images/za-images/icon1.png new file mode 100644 index 0000000..371c6df Binary files /dev/null and b/src/images/za-images/icon1.png differ diff --git a/src/images/za-images/icon10.png b/src/images/za-images/icon10.png new file mode 100644 index 0000000..498d588 Binary files /dev/null and b/src/images/za-images/icon10.png differ diff --git a/src/images/za-images/icon11.png b/src/images/za-images/icon11.png new file mode 100644 index 0000000..da65e0b Binary files /dev/null and b/src/images/za-images/icon11.png differ diff --git a/src/images/za-images/icon12.png b/src/images/za-images/icon12.png new file mode 100644 index 0000000..18cf17d Binary files /dev/null and b/src/images/za-images/icon12.png differ diff --git a/src/images/za-images/icon13.png b/src/images/za-images/icon13.png new file mode 100644 index 0000000..df8353b Binary files /dev/null and b/src/images/za-images/icon13.png differ diff --git a/src/images/za-images/icon14.png b/src/images/za-images/icon14.png new file mode 100644 index 0000000..e1ead24 Binary files /dev/null and b/src/images/za-images/icon14.png differ diff --git a/src/images/za-images/icon15.png b/src/images/za-images/icon15.png new file mode 100644 index 0000000..96d4b7d Binary files /dev/null and b/src/images/za-images/icon15.png differ diff --git a/src/images/za-images/icon16.png b/src/images/za-images/icon16.png new file mode 100644 index 0000000..fc4d6f1 Binary files /dev/null and b/src/images/za-images/icon16.png differ diff --git a/src/images/za-images/icon17.png b/src/images/za-images/icon17.png new file mode 100644 index 0000000..3bed378 Binary files /dev/null and b/src/images/za-images/icon17.png differ diff --git a/src/images/za-images/icon18.png b/src/images/za-images/icon18.png new file mode 100644 index 0000000..ef338b5 Binary files /dev/null and b/src/images/za-images/icon18.png differ diff --git a/src/images/za-images/icon19.png b/src/images/za-images/icon19.png new file mode 100644 index 0000000..f56fdfa Binary files /dev/null and b/src/images/za-images/icon19.png differ diff --git a/src/images/za-images/icon2.png b/src/images/za-images/icon2.png new file mode 100644 index 0000000..d122210 Binary files /dev/null and b/src/images/za-images/icon2.png differ diff --git a/src/images/za-images/icon20.png b/src/images/za-images/icon20.png new file mode 100644 index 0000000..1756d0c Binary files /dev/null and b/src/images/za-images/icon20.png differ diff --git a/src/images/za-images/icon3.png b/src/images/za-images/icon3.png new file mode 100644 index 0000000..79d5333 Binary files /dev/null and b/src/images/za-images/icon3.png differ diff --git a/src/images/za-images/icon4.png b/src/images/za-images/icon4.png new file mode 100644 index 0000000..43a6dc4 Binary files /dev/null and b/src/images/za-images/icon4.png differ diff --git a/src/images/za-images/icon5.png b/src/images/za-images/icon5.png new file mode 100644 index 0000000..a67e680 Binary files /dev/null and b/src/images/za-images/icon5.png differ diff --git a/src/images/za-images/icon6.png b/src/images/za-images/icon6.png new file mode 100644 index 0000000..66d1325 Binary files /dev/null and b/src/images/za-images/icon6.png differ diff --git a/src/images/za-images/icon7.png b/src/images/za-images/icon7.png new file mode 100644 index 0000000..776807b Binary files /dev/null and b/src/images/za-images/icon7.png differ diff --git a/src/images/za-images/icon8.png b/src/images/za-images/icon8.png new file mode 100644 index 0000000..778d0e5 Binary files /dev/null and b/src/images/za-images/icon8.png differ diff --git a/src/images/za-images/icon9.png b/src/images/za-images/icon9.png new file mode 100644 index 0000000..f452f8b Binary files /dev/null and b/src/images/za-images/icon9.png differ diff --git a/src/images/za-images/infusionCenter.png b/src/images/za-images/infusionCenter.png new file mode 100644 index 0000000..4e6d251 Binary files /dev/null and b/src/images/za-images/infusionCenter.png differ diff --git a/src/images/za-images/live-banner.png b/src/images/za-images/live-banner.png new file mode 100644 index 0000000..0fef860 Binary files /dev/null and b/src/images/za-images/live-banner.png differ diff --git a/src/images/za-images/none.png b/src/images/za-images/none.png new file mode 100644 index 0000000..e0c650f Binary files /dev/null and b/src/images/za-images/none.png differ diff --git a/src/images/za-images/nrdl/2-1.png b/src/images/za-images/nrdl/2-1.png new file mode 100644 index 0000000..db0d8a8 Binary files /dev/null and b/src/images/za-images/nrdl/2-1.png differ diff --git a/src/images/za-images/nrdl/2-10.png b/src/images/za-images/nrdl/2-10.png new file mode 100644 index 0000000..950c5e2 Binary files /dev/null and b/src/images/za-images/nrdl/2-10.png differ diff --git a/src/images/za-images/nrdl/2-11.png b/src/images/za-images/nrdl/2-11.png new file mode 100644 index 0000000..fce0269 Binary files /dev/null and b/src/images/za-images/nrdl/2-11.png differ diff --git a/src/images/za-images/nrdl/2-2.png b/src/images/za-images/nrdl/2-2.png new file mode 100644 index 0000000..d807ea5 Binary files /dev/null and b/src/images/za-images/nrdl/2-2.png differ diff --git a/src/images/za-images/nrdl/2-3.png b/src/images/za-images/nrdl/2-3.png new file mode 100644 index 0000000..d5d2639 Binary files /dev/null and b/src/images/za-images/nrdl/2-3.png differ diff --git a/src/images/za-images/nrdl/2-4.png b/src/images/za-images/nrdl/2-4.png new file mode 100644 index 0000000..f209bab Binary files /dev/null and b/src/images/za-images/nrdl/2-4.png differ diff --git a/src/images/za-images/nrdl/2-5.png b/src/images/za-images/nrdl/2-5.png new file mode 100644 index 0000000..99939e1 Binary files /dev/null and b/src/images/za-images/nrdl/2-5.png differ diff --git a/src/images/za-images/nrdl/2-6.png b/src/images/za-images/nrdl/2-6.png new file mode 100644 index 0000000..787f1cf Binary files /dev/null and b/src/images/za-images/nrdl/2-6.png differ diff --git a/src/images/za-images/nrdl/2-7.png b/src/images/za-images/nrdl/2-7.png new file mode 100644 index 0000000..07a25fd Binary files /dev/null and b/src/images/za-images/nrdl/2-7.png differ diff --git a/src/images/za-images/nrdl/2-8.png b/src/images/za-images/nrdl/2-8.png new file mode 100644 index 0000000..0abd926 Binary files /dev/null and b/src/images/za-images/nrdl/2-8.png differ diff --git a/src/images/za-images/nrdl/2-9.png b/src/images/za-images/nrdl/2-9.png new file mode 100644 index 0000000..7913f5d Binary files /dev/null and b/src/images/za-images/nrdl/2-9.png differ diff --git a/src/images/za-images/nrdl/2-bf.png b/src/images/za-images/nrdl/2-bf.png new file mode 100644 index 0000000..451a3ec Binary files /dev/null and b/src/images/za-images/nrdl/2-bf.png differ diff --git a/src/images/za-images/nrdl/2.png b/src/images/za-images/nrdl/2.png new file mode 100644 index 0000000..5d75b8d Binary files /dev/null and b/src/images/za-images/nrdl/2.png differ diff --git a/src/images/za-images/nrdl/3.png b/src/images/za-images/nrdl/3.png new file mode 100644 index 0000000..991d081 Binary files /dev/null and b/src/images/za-images/nrdl/3.png differ diff --git a/src/images/za-images/nrdl/4.png b/src/images/za-images/nrdl/4.png new file mode 100644 index 0000000..2162639 Binary files /dev/null and b/src/images/za-images/nrdl/4.png differ diff --git a/src/images/za-images/nrdl/5-1.png b/src/images/za-images/nrdl/5-1.png new file mode 100644 index 0000000..102c43d Binary files /dev/null and b/src/images/za-images/nrdl/5-1.png differ diff --git a/src/images/za-images/nrdl/5-2.png b/src/images/za-images/nrdl/5-2.png new file mode 100644 index 0000000..30872ec Binary files /dev/null and b/src/images/za-images/nrdl/5-2.png differ diff --git a/src/images/za-images/nrdl/5-3.png b/src/images/za-images/nrdl/5-3.png new file mode 100644 index 0000000..99622d5 Binary files /dev/null and b/src/images/za-images/nrdl/5-3.png differ diff --git a/src/images/za-images/nrdl/5-4.png b/src/images/za-images/nrdl/5-4.png new file mode 100644 index 0000000..4cbbdc2 Binary files /dev/null and b/src/images/za-images/nrdl/5-4.png differ diff --git a/src/images/za-images/nrdl/5-5.png b/src/images/za-images/nrdl/5-5.png new file mode 100644 index 0000000..3f2fc5a Binary files /dev/null and b/src/images/za-images/nrdl/5-5.png differ diff --git a/src/images/za-images/nrdl/5.png b/src/images/za-images/nrdl/5.png new file mode 100644 index 0000000..e5ca55e Binary files /dev/null and b/src/images/za-images/nrdl/5.png differ diff --git a/src/images/za-images/nrdl/cooperate-1.png b/src/images/za-images/nrdl/cooperate-1.png new file mode 100644 index 0000000..7ef7fcc Binary files /dev/null and b/src/images/za-images/nrdl/cooperate-1.png differ diff --git a/src/images/za-images/nrdl/cooperate.png b/src/images/za-images/nrdl/cooperate.png new file mode 100644 index 0000000..80377e6 Binary files /dev/null and b/src/images/za-images/nrdl/cooperate.png differ diff --git a/src/images/za-images/nrdl/drug.png b/src/images/za-images/nrdl/drug.png new file mode 100644 index 0000000..179bf38 Binary files /dev/null and b/src/images/za-images/nrdl/drug.png differ diff --git a/src/images/za-images/nrdl/dtp-default.png b/src/images/za-images/nrdl/dtp-default.png new file mode 100644 index 0000000..655910c Binary files /dev/null and b/src/images/za-images/nrdl/dtp-default.png differ diff --git a/src/images/za-images/nrdl/dtp-durg.png b/src/images/za-images/nrdl/dtp-durg.png new file mode 100644 index 0000000..263a5e3 Binary files /dev/null and b/src/images/za-images/nrdl/dtp-durg.png differ diff --git a/src/images/za-images/nrdl/home1.gif b/src/images/za-images/nrdl/home1.gif new file mode 100644 index 0000000..de42720 Binary files /dev/null and b/src/images/za-images/nrdl/home1.gif differ diff --git a/src/images/za-images/nrdl/home1.png b/src/images/za-images/nrdl/home1.png new file mode 100644 index 0000000..1e414eb Binary files /dev/null and b/src/images/za-images/nrdl/home1.png differ diff --git a/src/images/za-images/nrdl/home2.gif b/src/images/za-images/nrdl/home2.gif new file mode 100644 index 0000000..ebcea19 Binary files /dev/null and b/src/images/za-images/nrdl/home2.gif differ diff --git a/src/images/za-images/nrdl/inject-1.png b/src/images/za-images/nrdl/inject-1.png new file mode 100644 index 0000000..8b925fe Binary files /dev/null and b/src/images/za-images/nrdl/inject-1.png differ diff --git a/src/images/za-images/nrdl/inject.png b/src/images/za-images/nrdl/inject.png new file mode 100644 index 0000000..ad4ffdb Binary files /dev/null and b/src/images/za-images/nrdl/inject.png differ diff --git a/src/images/za-images/nrdl/nm-bg1.png b/src/images/za-images/nrdl/nm-bg1.png new file mode 100644 index 0000000..79f0c23 Binary files /dev/null and b/src/images/za-images/nrdl/nm-bg1.png differ diff --git a/src/images/za-images/nrdl/nm-bg2.png b/src/images/za-images/nrdl/nm-bg2.png new file mode 100644 index 0000000..d22aac8 Binary files /dev/null and b/src/images/za-images/nrdl/nm-bg2.png differ diff --git a/src/images/za-images/nrdl/nm-bg3.png b/src/images/za-images/nrdl/nm-bg3.png new file mode 100644 index 0000000..1109218 Binary files /dev/null and b/src/images/za-images/nrdl/nm-bg3.png differ diff --git a/src/images/za-images/nrdl/nm-bg4.png b/src/images/za-images/nrdl/nm-bg4.png new file mode 100644 index 0000000..34dcc12 Binary files /dev/null and b/src/images/za-images/nrdl/nm-bg4.png differ diff --git a/src/images/za-images/nrdl/nm1-label.png b/src/images/za-images/nrdl/nm1-label.png new file mode 100644 index 0000000..069e4a0 Binary files /dev/null and b/src/images/za-images/nrdl/nm1-label.png differ diff --git a/src/images/za-images/nrdl/nrdl-bg.png b/src/images/za-images/nrdl/nrdl-bg.png new file mode 100644 index 0000000..d890aab Binary files /dev/null and b/src/images/za-images/nrdl/nrdl-bg.png differ diff --git a/src/images/za-images/nrdl/nrdl-follow-badge.png b/src/images/za-images/nrdl/nrdl-follow-badge.png new file mode 100644 index 0000000..d7f9daa Binary files /dev/null and b/src/images/za-images/nrdl/nrdl-follow-badge.png differ diff --git a/src/images/za-images/nrdl/nrdl-table-bg.png b/src/images/za-images/nrdl/nrdl-table-bg.png new file mode 100644 index 0000000..065a3c8 Binary files /dev/null and b/src/images/za-images/nrdl/nrdl-table-bg.png differ diff --git a/src/images/za-images/nrdl/nrdl-table.png b/src/images/za-images/nrdl/nrdl-table.png new file mode 100644 index 0000000..36c3a4c Binary files /dev/null and b/src/images/za-images/nrdl/nrdl-table.png differ diff --git a/src/images/za-images/nrdl/nrdl-user.png b/src/images/za-images/nrdl/nrdl-user.png new file mode 100644 index 0000000..9caac49 Binary files /dev/null and b/src/images/za-images/nrdl/nrdl-user.png differ diff --git a/src/images/za-images/nrdl/phone.png b/src/images/za-images/nrdl/phone.png new file mode 100644 index 0000000..77ea5e0 Binary files /dev/null and b/src/images/za-images/nrdl/phone.png differ diff --git a/src/images/za-images/nrdl/popup-dtp-bg.png b/src/images/za-images/nrdl/popup-dtp-bg.png new file mode 100644 index 0000000..01b689d Binary files /dev/null and b/src/images/za-images/nrdl/popup-dtp-bg.png differ diff --git a/src/images/za-images/nrdl/popup-dtp-title.png b/src/images/za-images/nrdl/popup-dtp-title.png new file mode 100644 index 0000000..63b10b2 Binary files /dev/null and b/src/images/za-images/nrdl/popup-dtp-title.png differ diff --git a/src/images/za-images/nrdl/qa1.png b/src/images/za-images/nrdl/qa1.png new file mode 100644 index 0000000..3aaa065 Binary files /dev/null and b/src/images/za-images/nrdl/qa1.png differ diff --git a/src/images/za-images/nrdl/qa2.png b/src/images/za-images/nrdl/qa2.png new file mode 100644 index 0000000..1bf0ea3 Binary files /dev/null and b/src/images/za-images/nrdl/qa2.png differ diff --git a/src/images/za-images/nrdl/qa3.png b/src/images/za-images/nrdl/qa3.png new file mode 100644 index 0000000..ecfa3c3 Binary files /dev/null and b/src/images/za-images/nrdl/qa3.png differ diff --git a/src/images/za-images/nrdl/qa4.png b/src/images/za-images/nrdl/qa4.png new file mode 100644 index 0000000..e42de55 Binary files /dev/null and b/src/images/za-images/nrdl/qa4.png differ diff --git a/src/images/za-images/nrdl/site.png b/src/images/za-images/nrdl/site.png new file mode 100644 index 0000000..d667fe9 Binary files /dev/null and b/src/images/za-images/nrdl/site.png differ diff --git a/src/images/za-images/nrdl/true.png b/src/images/za-images/nrdl/true.png new file mode 100644 index 0000000..c441fd3 Binary files /dev/null and b/src/images/za-images/nrdl/true.png differ diff --git a/src/images/za-images/star/icon1.png b/src/images/za-images/star/icon1.png new file mode 100644 index 0000000..189a7f8 Binary files /dev/null and b/src/images/za-images/star/icon1.png differ diff --git a/src/images/za-images/star/icon2.png b/src/images/za-images/star/icon2.png new file mode 100644 index 0000000..781e39f Binary files /dev/null and b/src/images/za-images/star/icon2.png differ diff --git a/src/images/za-images/star/icon3.png b/src/images/za-images/star/icon3.png new file mode 100644 index 0000000..f76ad07 Binary files /dev/null and b/src/images/za-images/star/icon3.png differ diff --git a/src/images/za-images/star/icon4.png b/src/images/za-images/star/icon4.png new file mode 100644 index 0000000..982cce8 Binary files /dev/null and b/src/images/za-images/star/icon4.png differ diff --git a/src/images/za-images/star/icon5.png b/src/images/za-images/star/icon5.png new file mode 100644 index 0000000..14a888a Binary files /dev/null and b/src/images/za-images/star/icon5.png differ diff --git a/src/images/za-images/star/icon6.png b/src/images/za-images/star/icon6.png new file mode 100644 index 0000000..fa87826 Binary files /dev/null and b/src/images/za-images/star/icon6.png differ diff --git a/src/images/za-images/star/icon7.png b/src/images/za-images/star/icon7.png new file mode 100644 index 0000000..c8f642d Binary files /dev/null and b/src/images/za-images/star/icon7.png differ diff --git a/src/images/za-images/star/icon8.png b/src/images/za-images/star/icon8.png new file mode 100644 index 0000000..d96c4eb Binary files /dev/null and b/src/images/za-images/star/icon8.png differ diff --git a/src/images/za-images/tabbar/class-active.png b/src/images/za-images/tabbar/class-active.png new file mode 100644 index 0000000..55b3644 Binary files /dev/null and b/src/images/za-images/tabbar/class-active.png differ diff --git a/src/images/za-images/tabbar/class.png b/src/images/za-images/tabbar/class.png new file mode 100644 index 0000000..1c8327b Binary files /dev/null and b/src/images/za-images/tabbar/class.png differ diff --git a/src/images/za-images/tabbar/drug-class-active.png b/src/images/za-images/tabbar/drug-class-active.png new file mode 100644 index 0000000..5d44b7b Binary files /dev/null and b/src/images/za-images/tabbar/drug-class-active.png differ diff --git a/src/images/za-images/tabbar/drug-gift-active.png b/src/images/za-images/tabbar/drug-gift-active.png new file mode 100644 index 0000000..69497d3 Binary files /dev/null and b/src/images/za-images/tabbar/drug-gift-active.png differ diff --git a/src/images/za-images/tabbar/drug-home-active.png b/src/images/za-images/tabbar/drug-home-active.png new file mode 100644 index 0000000..8f2bff7 Binary files /dev/null and b/src/images/za-images/tabbar/drug-home-active.png differ diff --git a/src/images/za-images/tabbar/drug-my-active.png b/src/images/za-images/tabbar/drug-my-active.png new file mode 100644 index 0000000..0eda22c Binary files /dev/null and b/src/images/za-images/tabbar/drug-my-active.png differ diff --git a/src/images/za-images/tabbar/drug-story-active.png b/src/images/za-images/tabbar/drug-story-active.png new file mode 100644 index 0000000..ed11c40 Binary files /dev/null and b/src/images/za-images/tabbar/drug-story-active.png differ diff --git a/src/images/za-images/tabbar/gift-active.png b/src/images/za-images/tabbar/gift-active.png new file mode 100644 index 0000000..668cd09 Binary files /dev/null and b/src/images/za-images/tabbar/gift-active.png differ diff --git a/src/images/za-images/tabbar/gift.png b/src/images/za-images/tabbar/gift.png new file mode 100644 index 0000000..4c90439 Binary files /dev/null and b/src/images/za-images/tabbar/gift.png differ diff --git a/src/images/za-images/tabbar/home-active.png b/src/images/za-images/tabbar/home-active.png new file mode 100644 index 0000000..72df9b1 Binary files /dev/null and b/src/images/za-images/tabbar/home-active.png differ diff --git a/src/images/za-images/tabbar/home.png b/src/images/za-images/tabbar/home.png new file mode 100644 index 0000000..3333f34 Binary files /dev/null and b/src/images/za-images/tabbar/home.png differ diff --git a/src/images/za-images/tabbar/my-active.png b/src/images/za-images/tabbar/my-active.png new file mode 100644 index 0000000..db6d2d3 Binary files /dev/null and b/src/images/za-images/tabbar/my-active.png differ diff --git a/src/images/za-images/tabbar/my.png b/src/images/za-images/tabbar/my.png new file mode 100644 index 0000000..e7ffb58 Binary files /dev/null and b/src/images/za-images/tabbar/my.png differ diff --git a/src/images/za-images/tabbar/story-active.png b/src/images/za-images/tabbar/story-active.png new file mode 100644 index 0000000..47d0c0a Binary files /dev/null and b/src/images/za-images/tabbar/story-active.png differ diff --git a/src/images/za-images/tabbar/story.png b/src/images/za-images/tabbar/story.png new file mode 100644 index 0000000..a028932 Binary files /dev/null and b/src/images/za-images/tabbar/story.png differ diff --git a/src/patient/pages/adl/index.json b/src/patient/pages/adl/index.json new file mode 100644 index 0000000..18e7f7f --- /dev/null +++ b/src/patient/pages/adl/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "free-audio": "/components/freeAudio/index" + } +} diff --git a/src/patient/pages/adl/index.scss b/src/patient/pages/adl/index.scss new file mode 100644 index 0000000..95615b2 --- /dev/null +++ b/src/patient/pages/adl/index.scss @@ -0,0 +1,223 @@ +.page { + background-color: #fafafa; + .page-container { + padding: 20rpx 50rpx 40rpx; + .title { + font-size: 45rpx; + color: #e04775; + font-weight: bold; + line-height: 60rpx; + } + .sub-title { + font-size: 34rpx; + color: #484848; + line-height: 60rpx; + font-weight: bold; + } + .banner { + margin-top: 10rpx; + width: 100%; + height: 246rpx; + } + .rule { + position: relative; + z-index: 1; + margin-top: 20rpx; + border-radius: 24rpx; + background-color: #fff; + border: 1rpx solid rgba(39, 58, 101, 0.1); + .r-header { + padding-left: 30rpx; + width: 670rpx; + height: 69rpx; + display: flex; + align-items: center; + font-size: 32rpx; + color: #ffffff; + background: linear-gradient(278deg, rgba(242, 125, 173, 0) 0%, #e04775 100%); + border-radius: 24rpx 24rpx 0rpx 0rpx; + } + .r-container { + .row { + padding: 22rpx; + display: flex; + .icon { + width: 62rpx; + height: 62rpx; + } + .wrap { + padding-left: 7rpx; + .w-title { + font-size: 30rpx; + color: #cf5375; + font-weight: bold; + } + .w-content { + font-size: 24rpx; + color: #999999; + .blod { + color: #484848; + } + } + } + } + .line { + margin: 0 auto; + width: 610rpx; + height: 1rpx; + background-color: #e0e3e9; + opacity: 0.8; + } + } + } + .page-tip { + margin-top: -20rpx; + padding: 30rpx 10rpx 10rpx; + text-align: center; + font-size: 28rpx; + color: rgba(161, 85, 10, 1); + background: linear-gradient(90deg, #fff4cf 0%, rgba(255, 244, 207, 0.76) 100%); + border-radius: 0 0 24rpx 24rpx; + } + .question { + padding: 25rpx; + margin-top: 20rpx; + border-radius: 24rpx; + border: 1px solid rgba(39, 58, 101, 0.1); + background-color: #fff; + .poster { + position: relative; + width: 100%; + height: 348rpx; + border-radius: 24rpx; + } + .play { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 80rpx; + height: 80rpx; + } + .q-title { + margin-top: 24rpx; + text-align: center; + font-size: 28rpx; + color: #464646; + } + } + .module { + padding: 17rpx; + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 15rpx; + background-color: rgba(255, 255, 255, 0.9); + border-radius: 24rpx; + border: 1px solid #d5dce1; + .item { + text-align: center; + .icon { + width: 96rpx; + height: 96rpx; + } + .name { + font-size: 24rpx; + color: #aaaaaa; + } + } + } + .container { + margin-top: 40rpx; + padding: 49rpx 32rpx; + background-color: rgba(255, 255, 255, 0.9); + border: 1px solid #d5dce1; + border-radius: 24rpx; + .content { + margin-top: 33rpx; + padding-left: 40rpx; + font-size: 24rpx; + color: #aaaaaa; + } + } + .footer { + padding-top: 40rpx; + display: flex; + .share { + width: 176rpx; + height: 80rpx; + font-size: 34rpx; + font-weight: bold; + color: #cf5375; + border-radius: 24rpx 24rpx 24rpx 24rpx; + opacity: 1; + border: 2rpx solid #e04775; + text-align: center; + box-sizing: border-box; + line-height: 78rpx; + background-color: transparent; + margin: 0; + margin-right: 32rpx; + &::after { + border: none; + outline: none; + } + } + .test { + position: relative; + flex: 1; + height: 80rpx; + font-size: 34rpx; + color: #ffffff; + text-align: center; + line-height: 80rpx; + background: #cf5375; + border-radius: 24rpx 24rpx 24rpx 24rpx; + .money { + padding: 0 20rpx; + position: absolute; + top: -5rpx; + left: 50%; + transform: translate(-50%, -100%); + background-color: #ffefd0; + font-size: 24rpx; + color: #f5ad1d; + line-height: 50rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: 12rpx; + .icon { + margin-right: 10rpx; + width: 34rpx; + height: 36rpx; + } + &::after { + position: absolute; + bottom: 0; + left: 50%; + transform: translate(-50%, 100%); + content: ''; + width: 0; + height: 0; + border-style: solid; + border-width: 10rpx 10rpx 0 10rpx; + border-color: #ffefd0 transparent transparent transparent; + } + } + } + } + .footer-tip { + margin-top: 40rpx; + text-align: center; + font-size: 24rpx; + color: #aaaaaa; + } + } +} + +.video { + position: relative; + width: 100%; + height: 0; + border-radius: 24rpx; +} diff --git a/src/patient/pages/adl/index.ts b/src/patient/pages/adl/index.ts new file mode 100644 index 0000000..775b104 --- /dev/null +++ b/src/patient/pages/adl/index.ts @@ -0,0 +1,110 @@ +const app = getApp() + +Page({ + data: { + pageShow: false, + audio: { + url: 'https://voice-hb.oss-cn-beijing.aliyuncs.com/zaiding/voice_1690445548-5.mp3', + size: 50, + }, + userInfo: {}, + + m_d: '', + nrdl: '', + + rewardScore: undefined, + + bottom: wx.getMenuButtonBoundingClientRect().bottom, + }, + videoContext: null as WechatMiniprogram.VideoContext | null, + async onLoad(options) { + await this.handleScene(options) + + this.videoContext = wx.createVideoContext('video') + + this.setData({ + m_d: options.m_d, + nrdl: options.nrdl, + }) + app.waitLogin({ isReg: false }).then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTASSESSMENTSTART' }) + app.getUserInfo(this, true) + this.getAdlScore() + if (options.adlPushId) { + wx.ajax({ + method: 'POST', + url: '?r=xd/push-click/adl-push-click', + data: { adlPushId: options.adlPushId }, + }) + } + if (options.es === '201502') { + app.globalData.IsAliQiWei = 1 + app.zdMpBehavior({ PageName: 'JUMP_INSURANCE_ADL_PAGE' }) + } + }) + }, + // 拦截通过小程序码进入的场景 + handleScene(options: any) { + return new Promise((resolve) => { + console.log(options) + const { scene, ...reset } = wx.getLaunchOptionsSync() + console.log(scene) + console.log(reset) + if ( + [1047, 1048, 1049, 1089].includes(scene) && + options.scene?.includes('doctorId') && + options.scene?.includes('inviteChan') + ) { + app.permissionVerification(3, 15, `/pages/index/index`).then(() => { + wx.reLaunch({ + url: '/pages/index/index', + }) + }) + } else { + resolve(true) + } + }) + }, + getAdlScore() { + wx.ajax({ + method: 'GET', + url: '?r=xd/adl/get-score', + data: {}, + }).then((res) => { + this.setData({ + rewardScore: res.rewardScore, + }) + }) + }, + handlePlay() { + this.videoContext?.play() + this.videoContext?.requestFullScreen({}) + }, + handleFullScreen(e) { + if (!e.detail.fullScreen) { + this.videoContext?.pause() + this.videoContext?.seek(0) + } + }, + handleShare() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTSTARTSHARE' }) + wx.navigateTo({ + url: '/pages/adlShare/index', + }) + }, + handleTest() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTSTART' }) + wx.navigateTo({ + url: `/pages/adlTest/index?m_d=${this.data.m_d}&nrdl=${this.data.nrdl}`, + }) + }, + handleBack() { + wx.navigateBack() + }, + onShareAppMessage() { + return { + title: 'MG-ADL测评表:评估重症肌无力患者症状对生活质量的影响', + path: '/pages/adl/index', + } + }, +}) diff --git a/src/patient/pages/adl/index.wxml b/src/patient/pages/adl/index.wxml new file mode 100644 index 0000000..889659e --- /dev/null +++ b/src/patient/pages/adl/index.wxml @@ -0,0 +1,74 @@ + + + + 国际权威机构建议 + 重症肌无力治疗追求“双达标” + + + 什么是“双达标” + + + + + 疗效达标 + + MG-ADL评分为0或1 + 疾病症状达到最小症状表达 + + + + + + + + 安全性达标 + + 治疗相关副作用≤1级 + 如口服泼尼松当量≤5mg/天 + + + + + + ADL测评可以如实反馈您过去1周的整体平均状况 + + + + + + + + + + + + +{{rewardScore}}能量 + + 开始评测 + + + + 建议您至少每周更新1次测评 + 您提交的测评信息仅用于生成您的健康记录和报告 + + + + + diff --git a/src/patient/pages/adlResult/index.json b/src/patient/pages/adlResult/index.json new file mode 100644 index 0000000..ffde765 --- /dev/null +++ b/src/patient/pages/adlResult/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-transition": "@vant/weapp/transition/index", + "toast": "/components/toast/index" + } +} diff --git a/src/patient/pages/adlResult/index.scss b/src/patient/pages/adlResult/index.scss new file mode 100644 index 0000000..ff0f0bf --- /dev/null +++ b/src/patient/pages/adlResult/index.scss @@ -0,0 +1,614 @@ +.page { + background-color: #fafafa; + min-height: 100vh; + padding-bottom: 240rpx; + .page-container { + .card-status { + position: relative; + margin: 0 6rpx; + height: 316rpx; + .card-icon { + position: absolute; + top: 71rpx; + left: 45rpx; + width: 217rpx; + height: 198rpx; + &.card-icon2 { + width: 197rpx; + height: 199rpx; + } + &.card-icon3 { + width: 197rpx; + height: 199rpx; + } + } + .content { + position: absolute; + top: 90rpx; + right: 76rpx; + .row { + display: flex; + align-items: center; + .name { + margin-right: 33rpx; + width: 5em; + font-size: 32rpx; + color: #333333; + } + .ststus { + padding: 0 0 0 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 28rpx; + width: 170rpx; + height: 45rpx; + color: #fff; + background-color: #24d8c8; + font-weight: bold; + border-radius: 27rpx; + box-sizing: border-box; + .icon { + width: 52rpx; + height: 52rpx; + } + &.status-warn { + color: #cf5375; + background: #f0ccd6; + } + } + } + .line { + margin: 24rpx 0; + width: 365rpx; + height: 1px; + background-color: rgba(255, 255, 255, 0.85); + } + } + } + .pass-line { + margin: 0 40rpx; + display: flex; + align-items: center; + .icon { + width: 180rpx; + height: 180rpx; + } + .content { + padding-left: 16rpx; + .row { + margin-bottom: 20rpx; + line-height: 45rpx; + font-size: 32rpx; + color: #ffffff; + .name { + display: inline-block; + width: 6em; + } + } + } + } + .doctor { + margin: 0 40rpx 40rpx; + padding: 72rpx 32rpx 32rpx; + height: 240rpx; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: space-between; + .avatar { + width: 96rpx; + height: 96rpx; + .a-img { + width: 100%; + height: 100%; + border-radius: 50%; + } + } + .wrap { + padding: 0 16rpx; + flex: 1; + .name-wrap { + display: flex; + .name { + position: relative; + font-size: 36rpx; + color: rgba(51, 51, 51, 1); + font-weight: bold; + .n-content { + max-width: 8em; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .bubble { + position: absolute; + top: -10rpx; + right: 0; + padding: 0 5rpx; + transform: translateX(100%); + min-width: 32rpx; + height: 32rpx; + box-sizing: border-box; + text-align: center; + line-height: 28rpx; + font-size: 22rpx; + color: rgba(255, 255, 255, 1); + background: #cf5375; + border: 2rpx solid #ffffff; + border-radius: 32rpx 32rpx 32rpx 0; + } + } + } + .content { + margin-top: 5rpx; + font-size: 24rpx; + color: rgba(207, 83, 117, 1); + } + } + .btn { + width: 158rpx; + height: 56rpx; + font-size: 28rpx; + color: rgba(207, 83, 117, 1); + background: linear-gradient(136deg, #e9f0ff 0%, #fee4ed 100%); + border-radius: 420rpx 420rpx 420rpx 420rpx; + display: flex; + align-items: center; + justify-content: center; + } + } + .banner { + position: relative; + margin: 0 40rpx 0; + background-color: #fff; + border: 1px solid #dfe2e7; + border-radius: 24rpx; + box-shadow: 0rpx 4rpx 32rpx 10rpx rgba(207, 83, 116, 0.2); + min-height: 323rpx; + line-height: 1; + .status-icon { + position: absolute; + top: 165rpx; + right: -10rpx; + width: 124rpx; + height: 124rpx; + } + .b-header { + display: flex; + padding: 19rpx 20rpx 0rpx 182rpx; + .num { + flex-shrink: 0; + display: flex; + align-items: baseline; + font-size: 104rpx; + color: #ffffff; + font-weight: bold; + text-shadow: 8px 8px 16px rgba(143, 217, 226, 0.1); + background: linear-gradient(180deg, #ffffff 0%, #ffffff 50%, rgba(255, 255, 255, 0.5) 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + .sub { + font-size: 24rpx; + color: #ffffff; + } + } + .verline { + margin: 10rpx 40rpx 0; + height: 76rpx; + border-right: 2rpx dotted #ffffff; + } + .num-detail { + flex: 1; + display: flex; + .n-item { + flex: 1; + &.active { + .box { + background-color: #cf5375; + } + } + .box { + margin: 0 auto; + width: 45rpx; + height: 45rpx; + text-align: center; + line-height: 45rpx; + background-color: #333333; + border-radius: 12rpx; + color: #ffffff; + font-size: 32rpx; + } + .name { + text-align: center; + font-size: 24rpx; + line-height: 48rpx; + color: #333333; + } + } + } + } + .b-tip { + padding: 4rpx 50rpx; + text-align: center; + font-size: 22rpx; + color: #ffffff; + line-height: 36rpx; + background: linear-gradient(90deg, #e04775 0%, #e04775 20%, #5eaeaf 100%); + display: flex; + justify-content: space-between; + } + .b-body { + padding: 16rpx 120rpx 16rpx 54rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + min-height: 124rpx; + .line { + font-size: 24rpx; + color: #666666; + line-height: 36rpx; + .red { + color: #cf5375; + } + .green { + color: #25d9c8; + } + } + } + .b-container { + padding: 16rpx 23rpx; + .c-header { + display: flex; + justify-content: flex-end; + font-size: 24rpx; + color: #cccccc; + } + .swiper { + margin: 19rpx 24rpx; + .scurt { + width: 100%; + border: 1px solid rgba(0, 0, 0, 0.1); + box-sizing: border-box; + .s-header { + display: flex; + height: 40rpx; + margin-bottom: -1px; + border-bottom: 1rpx solid rgba(0, 0, 0, 0.1); + .none { + flex-shrink: 0; + width: 226rpx; + background-color: rgba(228, 228, 228, 1); + } + .bar { + flex: 1; + display: flex; + .num { + flex: 1; + text-align: center; + font-size: 24rpx; + color: #fff; + line-height: 40rpx; + } + } + } + .s-body { + display: flex; + .s-aside { + width: 28rpx; + background-color: rgba(102, 102, 102, 0.15); + flex-shrink: 0; + .sa-item { + display: flex; + text-align: center; + justify-content: center; + align-items: center; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + line-height: 1; + overflow: hidden; + &:not(:last-of-type) { + margin-bottom: -1px; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + } + } + .sa-item1 { + height: 158rpx; + } + .sa-item2 { + height: 54rpx; + } + .sa-item3 { + height: 106rpx; + } + .sa-item4 { + height: 108rpx; + } + } + .s-container { + flex: 1; + .sc-row { + display: flex; + height: 54rpx; + overflow: hidden; + .sc-title { + width: 198rpx; + font-size: 18rpx; + color: rgba(102, 102, 102, 1); + text-align: center; + line-height: 53rpx; + } + .sc-col { + margin-left: -1px; + border-left: 1px solid rgba(0, 0, 0, 0.1); + flex: 1; + text-align: center; + .icon { + margin-top: 11rpx; + width: 32rpx; + height: 32rpx; + } + } + } + .sc-row:not(:last-of-type) { + margin-bottom: -1px; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + } + .sc-row:nth-of-type(2n-1) { + background-color: rgba(217, 217, 217, 0.2); + } + } + } + } + .scurt-detail { + width: 100%; + .scurt-detail-img { + width: 100%; + } + } + } + // .detail { + // margin: 19rpx 24rpx; + // border: 1rpx solid rgba(0, 0, 0, 0.1); + // .d-header { + // display: flex; + // height: 40rpx; + // border-bottom: 1rpx solid rgba(0, 0, 0, 0.1); + // .none { + // flex-shrink: 0; + // width: 125rpx; + // background-color: rgba(228, 228, 228, 1); + // } + // .bar { + // flex: 1; + // display: flex; + // .num-normal { + // width: 64rpx; + // text-align: center; + // font-size: 24rpx; + // color: #fff; + // line-height: 40rpx; + // } + // .num { + // flex: 1; + // text-align: center; + // font-size: 24rpx; + // color: #fff; + // line-height: 40rpx; + // } + // } + // } + // .d-body { + // display: flex; + // .d-aside { + // width: 28rpx; + // background-color: rgba(102, 102, 102, 0.15); + // flex-shrink: 0; + // .da-item { + // display: flex; + // text-align: center; + // justify-content: center; + // align-items: center; + // font-size: 18rpx; + // color: rgba(102, 102, 102, 1); + // line-height: 1; + // border-bottom: 1rpx solid rgba(0, 0, 0, 0.1); + // } + // .da-item1 { + // height: 293rpx; + // } + // .da-item2 { + // height: 96rpx; + // } + // .da-item3 { + // height: 194rpx; + // } + // .da-item4 { + // height: 194rpx; + // } + // } + // .d-container { + // flex: 1; + // .dc-row { + // display: flex; + // height: 96rpx; + // border-bottom: 1rpx solid rgba(0, 0, 0, 0.1); + // line-height: 24rpx; + // .dc-title { + // padding: 12rpx; + // width: 97rpx; + // font-size: 18rpx; + // color: rgba(102, 102, 102, 1); + // box-sizing: border-box; + // } + // .dc-sub-title { + // border-left: 1rpx solid rgba(0, 0, 0, 0.1); + // width: 64rpx; + // text-align: center; + // font-size: 18rpx; + // color: rgba(102, 102, 102, 1); + // padding: 12rpx; + // box-sizing: border-box; + // } + // .dc-col { + // padding: 0 12rpx; + // border-left: 1rpx solid rgba(0, 0, 0, 0.1); + // flex: 1; + // font-size: 18rpx; + // color: rgba(102, 102, 102, 1); + // } + // } + // .dc-row:nth-of-type(2n-1) { + // background-color: rgba(217, 217, 217, 0.2); + // } + // } + // } + // } + } + } + .hormone { + position: relative; + margin: 40rpx; + background-color: #fff; + border: 1px solid #dfe2e7; + border-radius: 24rpx; + box-shadow: 0rpx 4rpx 32rpx 10rpx rgba(207, 83, 116, 0.2); + .status-icon { + position: absolute; + top: 100rpx; + right: -10rpx; + width: 124rpx; + height: 124rpx; + &.status-icon-max { + width: 162rpx; + } + } + .h-header { + padding: 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + background: linear-gradient(95deg, #26dac9 7%, rgba(143, 217, 226, 0) 100%); + box-shadow: 8rpx 8rpx 17rpx 0rpx rgba(143, 217, 226, 0.1); + border-radius: 24rpx 24rpx 0 0; + .title { + font-size: 30rpx; + color: #ffffff; + } + .content { + font-size: 22rpx; + color: #787878; + .red { + color: #e04775; + } + } + } + .h-container { + padding: 25rpx 25rpx 50rpx; + font-size: 24rpx; + color: #666666; + } + } + .no-solve { + margin: 40rpx auto 0; + font-size: 24rpx; + color: #666666; + width: 404rpx; + height: 48rpx; + text-align: center; + line-height: 48rpx; + border-radius: 24rpx; + background: #eeeeee; + } + .footer { + margin: 46rpx 40rpx; + display: flex; + .share { + width: 176rpx; + height: 80rpx; + font-size: 34rpx; + font-weight: bold; + color: #cf5375; + border-radius: 24rpx 24rpx 24rpx 24rpx; + opacity: 1; + border: 2rpx solid #e04775; + text-align: center; + box-sizing: border-box; + line-height: 78rpx; + background-color: transparent; + margin: 0; + margin-right: 32rpx; + &::after { + border: none; + outline: none; + } + } + .test { + flex: 1; + height: 80rpx; + font-size: 30rpx; + color: #ffffff; + text-align: center; + line-height: 80rpx; + background: #cf5375; + border-radius: 24rpx 24rpx 24rpx 24rpx; + } + } + } +} + +.code-wrap { + .code-boder { + margin: 0 auto; + padding: 18rpx; + width: 352rpx; + height: 352rpx; + box-sizing: border-box; + .code { + width: 100%; + height: 100%; + } + } + .code-tip { + margin-top: 24rpx; + padding-bottom: 80rpx; + text-align: center; + font-size: 28rpx; + color: rgba(102, 102, 102, 1); + } +} + +.navback { + padding: 32rpx; + position: fixed; + bottom: 0; + left: 0; + width: 100%; + font-size: 40rpx; + color: #ffffff; + font-weight: bold; + text-align: center; + background: #cf5375; + box-sizing: border-box; + box-shadow: 0rpx 4rpx 36rpx 0rpx rgba(0, 0, 0, 0.27); + border-radius: 24rpx 24rpx 0rpx 0rpx; + .sub { + font-size: 24rpx; + } +} + +.shangbao-footer { + padding: 26rpx 0; + position: fixed; + bottom: 0; + left: 0; + width: 100%; + background-color: #fff; + display: flex; + justify-content: center; + box-shadow: 0rpx -32rpx 32rpx 0rpx rgba(0, 0, 0, 0.09); + border-radius: 24rpx 24rpx 0 0; + .btn { + width: 670rpx; + height: 157rpx; + } +} diff --git a/src/patient/pages/adlResult/index.ts b/src/patient/pages/adlResult/index.ts new file mode 100644 index 0000000..2dab77a --- /dev/null +++ b/src/patient/pages/adlResult/index.ts @@ -0,0 +1,272 @@ +import dayjs from 'dayjs' +const app = getApp() + +Page({ + data: { + id: '', + reset: '', + qrcode: '', + detail: {}, + scurt: 0, + noFinish: false, + grade: 1, + tableData: [ + { + title: '说话', + key: 'TalkingScore', + }, + { + title: '咀嚼', + key: 'ChewScore', + }, + { + title: '吞咽', + key: 'SwallowScore', + }, + { + title: '呼吸', + key: 'BreathScore', + }, + { + title: '刷牙梳头能力受损', + key: 'BrushTeethAndCombHairScore', + }, + { + title: '从椅子上起身能力受损', + key: 'GetUpFromChairScore', + }, + { + title: '复视/重影', + key: 'DoubleVisionScore', + }, + { + title: '眼睑下垂', + key: 'DroopyEyelidsScore', + }, + ], + LastCreateDate: '', + dateDiff: '', + + m_d: '', + nrdl: '', + sendWeiYi: false, + + toastShow: false, + // toastType: 'adlProgresss', + // toastType: "adlProgresssEnd", + toastType: 'adlLevelUp', + toastParams: { + // ContinuousTimes: 2, + // RewardScore: "500", + // Records: [ + // { Id: "6", ContinuousTimes: "2", RewardScore: "500" }, + // { Id: "3", ContinuousTimes: "1", RewardScore: "500" }, + // ], + // PatientScore: "500", + // PatientScoreExtra: "200", + // PatientScoreExtra2: "500", + } as any, + unreadCount: 0, + }, + onLoad(options) { + console.log(options) + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + this.setData({ + id: options.id, + reset: options.reset, + m_d: options.m_d, + nrdl: options.nrdl, + sendWeiYi: options.wy === '1', + idafa: options.idafa === '1', + }) + app.waitLogin({ loginPage: true }).then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTASSESSMENTRESULTS' }) + app.getUserInfo(this, false) + this.getUnreadCount() + this.getDetail() + this.getQrCode() + if (options.nrdl === '1') { + this.getOpenPatientList() + } + + const pages = getCurrentPages() //获取当前页面js里面的pages里的所有信息。 + const prevPage = pages[pages.length - 2] + const adlResultInfo = wx.getStorageSync('adlResultInfo') + console.log(options.idafa === '1') + if (options.idafa === '1') { + this.setData({ + toastShow: true, + toastType: 'adlLevelUp', + toastParams: {}, + }) + } else if (adlResultInfo && prevPage.route == 'pages/adl/index' && !Array.isArray(adlResultInfo)) { + this.setData({ + toastShow: true, + toastType: 'adlProgresss', + toastParams: { + ...adlResultInfo, + Records: adlResultInfo.Records?.reverse(), + }, + }) + wx.removeStorageSync('adlResultInfo') + } + }) + }, + getQrCode() { + wx.ajax({ + method: 'GET', + url: '?r=xd/adl/qrcode', + data: {}, + }).then((res) => { + this.setData({ + qrcode: res.src, + }) + }) + }, + getUnreadCount() { + wx.ajax({ + method: 'GET', + url: '?r=xd/message-interact/get-unread-count', + data: {}, + }).then((res) => { + this.setData({ + unreadCount: res, + }) + }) + }, + getDetail() { + const { id } = this.data + wx.ajax({ + method: 'GET', + url: '?r=xd/adl/view', + data: { + Id: id, + }, + }).then((res) => { + let grade = 1 + if (res.TotalScore < 5) { + grade = 1 + } else if (res.TotalScore >= 5 && res.TotalScore < 15) { + grade = 2 + } else { + grade = 3 + } + this.setData({ + detail: res, + grade, + LastCreateDate: dayjs(res.LastCreateTime).format('MM月DD日'), + dateDiff: dayjs(res.CreateTime).from(res.LastCreateTime).replace(' ', ''), + }) + }) + }, + getOpenPatientList() { + wx.ajax({ + method: 'GET', + url: '?r=xd/nrdl/open-patient-list', + data: {}, + }).then((res) => { + this.setData({ + patientInfo: res, + }) + }) + }, + handleDetail() { + const { scurt, noFinish } = this.data + if (noFinish) return + this.setData({ + scurt: (scurt + 1) % 2, + noFinish: true, + }) + }, + handleDetailFinish() { + this.setData({ + noFinish: false, + }) + }, + handleReset() { + const id = this.data.id + wx.showModal({ + title: '确认重新测试?', + content: '重新测试后,此次评测结果将自动删除', + confirmColor: '#cf5375', + success(res) { + if (res.confirm) { + wx.ajax({ + method: 'POST', + url: '?r=xd/adl/delete', + data: { + Id: id, + }, + }).then(() => { + wx.redirectTo({ + url: '/pages/adlTest/index', + }) + }) + } + }, + }) + }, + handleSave() { + app.permissionVerification(3, 2, ``).then(() => {}) + }, + handleMyHealth() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTRESULTGETNOTES' }) + wx.navigateTo({ + url: '/gift/pages/myHealthRecord/index', + }) + }, + handleShare() { + wx.navigateTo({ + url: '/pages/adlShare/index', + }) + }, + handleToastOk() { + if (this.data.toastType === 'adlLevelUp') { + wx.navigateTo({ + url: '/pages/webview/index', + }) + } + this.handleToastCancel() + }, + handleToastCancel() { + this.setData({ + toastShow: false, + }) + }, + handleBack() { + wx.navigateBack() + }, + routerTo(e) { + const { url } = e.currentTarget.dataset + if (url === '/pages/interactivePatient/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTRESULTDOCTORCARD' }) + } + if (url === '/pages/webview/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTRESULTAPPLYINSURANCE' }) + } + wx.navigateTo({ + url, + }) + }, + hanldeCodeLong() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTRESULTQRCODELONGPRESS' }) + }, + onShareAppMessage() { + return { + title: 'MG-ADL测评表:评估重症肌无力患者症状对生活质量的影响', + path: '/pages/adl/index', + } + }, +}) diff --git a/src/patient/pages/adlResult/index.wxml b/src/patient/pages/adlResult/index.wxml new file mode 100644 index 0000000..c5ebb1b --- /dev/null +++ b/src/patient/pages/adlResult/index.wxml @@ -0,0 +1,371 @@ + + + + + + + + ADL评分 + + 已达标 + + + + + + + 激素日用量 + + 已达标 + + + + + + + + + + + ADL评分 + + 已达标 + + + + 待达标 + + + + + + + 激素日用量 + + 已达标 + + + + 待达标 + + + + + + + + + + + ADL评分 + + 待达标 + + + + + + + 激素日用量 + + 待达标 + + + + + + + + + + + + + + + {{userInfo.ExclusiveDoctorName}} + {{unreadCount}} + + + + 您的ADL评分≥5分,且较上次增加了2分以上 + ,激素用量超过了20mg, + 建议定期复诊 + + + 您的ADL较上次增加了2分以上 + ,激素用量超过了20mg, + 建议定期复诊 + + + 您的ADL评分≥5分 + ,激素用量超过了20mg, + 建议定期复诊 + + 您的激素用量超过了20mg,建议定期复诊 + + + {{unreadCount ? '去看看':'去咨询'}} + + + + + + + + + + 激素用量 + + 本次激素用量为 + {{detail.SteroidDailyDose}}mg + /天 + + + 恭喜达标,您的激素用量已少于95% 的患友 + 距离达标还需努力,请遵医嘱规律治疗 + + 坚持每周测评,敏锐识别症状变化 + + 保存测评结果 + 点击获取我的双达标笔记 + + + + + + + + 扫码关注公众号 + + 开启每周ADL测评提醒 + + + + + + + + + + 立即查看医保报销详细解读 + + {{patientInfo.PatientNum}}人正在关注 + + + diff --git a/src/patient/pages/adlShare/index.json b/src/patient/pages/adlShare/index.json new file mode 100644 index 0000000..c3f20c0 --- /dev/null +++ b/src/patient/pages/adlShare/index.json @@ -0,0 +1,8 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "free-audio": "/components/freeAudio/index", + "customPoster": "/components/customPoster/index" + } +} diff --git a/src/patient/pages/adlShare/index.scss b/src/patient/pages/adlShare/index.scss new file mode 100644 index 0000000..db1a942 --- /dev/null +++ b/src/patient/pages/adlShare/index.scss @@ -0,0 +1,35 @@ +.page { + background-color: #fafafa; + min-height: 100vh; + .page-container { + position: relative; + .poster { + display: block; + width: 100%; + } + .download { + position: absolute; + top: 1450rpx; + left: 50%; + transform: translateX(-50%); + width: 482rpx; + height: 80rpx; + background: #cf5375; + border-radius: 40rpx; + text-align: center; + font-size: 28rpx; + color: #FFFFFF; + line-height: 80rpx; + .icon { + width: 48rpx; + height: 48rpx; + vertical-align: middle; + } + } + } +} + +.poster { + display: block; + width: 100%; +} diff --git a/src/patient/pages/adlShare/index.ts b/src/patient/pages/adlShare/index.ts new file mode 100644 index 0000000..152390d --- /dev/null +++ b/src/patient/pages/adlShare/index.ts @@ -0,0 +1,134 @@ +const app = getApp() + +Page({ + data: { + poster: '', + params: {}, + userInfo: {} as any, + posterUrl: '', + }, + onLoad() { + const SystemInfo = app.globalSystemInfo + wx.showLoading({ + title: '加载中', + }) + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + app.waitLogin({ loginPage: true }).then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTPOSTER' }) + app.getUserInfo(this, true, () => { + this.getPoster() + }) + }) + }, + getPoster() { + wx.ajax({ + method: 'POST', + url: '?r=poster/prepare', + data: { + posterId: 'adl2-invite', + userId: this.data.userInfo.UserId, + }, + }).then((res) => { + this.setData({ + params: res, + }) + }) + }, + handlePosterFinish(e) { + this.setData({ + posterUrl: e.detail, + }) + wx.hideLoading() + }, + handleDownload() { + const that = this + app.zdMpBehavior({ PageName: 'BTN_PATIENTPOSTERDOWNLOAD' }) + wx.getSetting({ + success(res) { + console.log(res) + if ( + res.authSetting['scope.writePhotosAlbum'] != undefined && + res.authSetting['scope.writePhotosAlbum'] == true + ) { + //获取当前位置 + that.saveImage() + } else if (res.authSetting['scope.writePhotosAlbum'] == undefined) { + //获取当前位置 + that.saveImage() + } else { + wx.showModal({ + title: '请求授权相册权限', + content: '需要保存海报到相册,请确认授权', + confirmColor: '#cf5375', + success (res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: '拒绝授权', + icon: 'none', + duration: 1000, + }) + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success (res) { + if (res.authSetting['scope.writePhotosAlbum'] == true) { + // wx.showToast({ + // title: '授权成功', + // icon: 'success', + // duration: 1000 + // }) + //再次授权,调用wx.getLocation的API + that.saveImage() + } else { + // wx.showToast({ + // title: '授权失败', + // icon: 'none', + // duration: 1000 + // }) + } + }, + }) + } + }, + }) + } + }, + }) + }, + saveImage() { + wx.showLoading({ + title: '加载中', + }) + wx.saveImageToPhotosAlbum({ + filePath: this.data.posterUrl, + success: () => { + wx.hideLoading() + wx.showToast({ + title: '保存成功,请到相册中查看', + }) + }, + fail: () => { + wx.hideLoading() + wx.showToast({ + icon: 'none', + title: '保存失败,请稍后重试', + }) + }, + }) + }, + handleBack() { + wx.navigateBack() + }, + onShareAppMessage() { + return { + title: 'MG-ADL测评表:重症肌无力患者评估表', + path: '/pages/adl/index', + } + }, +}) diff --git a/src/patient/pages/adlShare/index.wxml b/src/patient/pages/adlShare/index.wxml new file mode 100644 index 0000000..9d1e1d4 --- /dev/null +++ b/src/patient/pages/adlShare/index.wxml @@ -0,0 +1,14 @@ + + + + + + + 点击下载海报到本地 + + + + + + + diff --git a/src/patient/pages/adlTest/index.json b/src/patient/pages/adlTest/index.json new file mode 100644 index 0000000..667f871 --- /dev/null +++ b/src/patient/pages/adlTest/index.json @@ -0,0 +1,11 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "free-audio": "/components/freeAudio/index", + "van-transition": "@vant/weapp/transition/index", + "customTable": "/components/customTable/index", + "van-icon": "@vant/weapp/icon/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/patient/pages/adlTest/index.scss b/src/patient/pages/adlTest/index.scss new file mode 100644 index 0000000..fc30f97 --- /dev/null +++ b/src/patient/pages/adlTest/index.scss @@ -0,0 +1,334 @@ +.page { + background-color: #fafafa; + min-height: 100vh; + .page-container { + margin-top: 40rpx; + .nav { + margin: 0rpx 40rpx; + padding: 16rpx 23rpx; + background-color: #fff; + border: 1px solid #dfe2e7; + border-radius: 24rpx; + box-shadow: 0rpx 4rpx 32rpx 10rpx #f2dee3; + .nav-title { + text-align: center; + font-size: 28rpx; + color: #999999; + } + .nav-wrap { + display: flex; + .nav-item { + flex: 1; + margin: 0 10rpx; + height: 6rpx; + background: #cf5375; + opacity: 0.3; + border-radius: 0rpx 0rpx 0rpx 0rpx; + &.active { + opacity: 1; + } + } + } + } + .custom-class { + position: absolute; + width: 100%; + } + .van-enter-active-class, + .van-leave-active-class { + transition-property: background-color, transform; + } + + .van-enter-class { + transform: translateX(1000rpx); + opacity: 0; + } + .van-leave-to-class { + transform: translateX(-1000rpx); + opacity: 0; + } + .swiper { + height: 1400rpx; + } + .container { + padding: 64rpx 48rpx; + margin: 21rpx 40rpx 0; + width: calc(100% - 172rpx); + background-color: #fff; + border: 1px solid #dfe2e7; + border-radius: 24rpx; + box-shadow: 0rpx 4rpx 32rpx 10rpx #f2dee3; + .c-icon { + display: block; + margin: 0 auto; + width: 144rpx; + height: 144rpx; + } + .title { + margin-top: 44rpx; + font-size: 48rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .en-title { + margin-top: 10rpx; + font-size: 24rpx; + color: #cccccc; + text-align: center; + } + .question { + margin-top: 76rpx; + .question-item { + margin-bottom: 40rpx; + padding: 24rpx 32rpx; + display: flex; + align-items: center; + border-radius: 24rpx; + background-color: #f2f2f2; + .label { + flex-shrink: 0; + margin-right: 24rpx; + width: 40rpx; + height: 40rpx; + border-radius: 50%; + background: rgba(77, 77, 77, 0.07); + .icon { + margin: 11rpx 0 0 7rpx; + display: none; + width: 26rpx; + height: 21rpx; + } + } + .content { + font-size: 32rpx; + color: #666666; + font-weight: bold; + line-height: 48rpx; + } + &.active { + background-color: #cf5375; + .label { + background-color: #ffffff; + .icon { + display: block; + } + } + .content { + color: #fefefe; + } + } + } + } + } + .intense-dose { + padding: 64rpx 48rpx; + margin: 21rpx 40rpx 0; + width: calc(100% - 172rpx); + background-color: #fff; + border: 1px solid #dfe2e7; + border-radius: 24rpx; + box-shadow: 0rpx 4rpx 32rpx 10rpx #f2dee3; + .c-icon { + display: block; + margin: 0 auto; + width: 144rpx; + height: 144rpx; + } + .title { + margin-top: 44rpx; + font-size: 48rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .en-title { + margin-top: 10rpx; + font-size: 24rpx; + color: #cccccc; + text-align: center; + } + .tip { + margin: 28rpx auto 0; + font-size: 28rpx; + color: #333333; + width: 502rpx; + height: 74rpx; + display: flex; + align-items: center; + justify-content: center; + background: #f2f2f2; + border-radius: 38rpx; + } + .wrap { + margin-top: 40rpx; + .w-title { + font-size: 32rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .w-num { + margin-top: 20rpx; + text-align: center; + font-size: 72rpx; + color: #333333; + font-weight: bold; + .sub { + font-size: 36rpx; + } + } + } + .select { + margin-top: 30rpx; + display: flex; + gap: 14rpx; + .item { + position: relative; + flex-shrink: 0; + padding: 20rpx 10rpx 8rpx; + width: 64rpx; + text-align: center; + background: #f2f2f2; + border-radius: 16rpx; + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + .i-icon { + width: 48rpx; + height: 48rpx; + } + .input { + font-size: 16rpx; + line-height: 24rpx; + height: 48rpx; + overflow: hidden; + color: #cccccc; + } + .name { + font-size: 28rpx; + color: #666666; + } + .i-active { + position: absolute; + right: -14rpx; + top: -14rpx; + width: 28rpx; + height: 28rpx; + background-color: #e04775; + border-radius: 50%; + color: #fff; + font-size: 20rpx; + } + } + } + .s-tip { + margin-top: 30rpx; + font-size: 22rpx; + color: #cccccc; + } + } + .footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + padding: 20rpx 40rpx calc(env(safe-area-inset-bottom) + 20rpx); + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: center; + background-color: #fff; + box-shadow: 0 -10rpx 10rpx #faf1f3; + .prev { + margin: 0 45rpx; + display: flex; + align-content: inherit; + justify-content: center; + .icon { + margin-right: 20rpx; + width: 56rpx; + height: 56rpx; + vertical-align: middle; + } + .name { + font-size: 30rpx; + line-height: 50rpx; + color: #cf5375; + font-weight: bold; + } + } + .submit { + flex: 1; + height: 80rpx; + background: #cf5375; + border-radius: 24rpx 24rpx 24rpx 24rpx; + text-align: center; + line-height: 80rpx; + font-size: 34rpx; + color: #ffffff; + font-weight: bold; + } + } + } +} + +.popup { + padding: 44rpx 40rpx; + .p-title { + font-size: 32rpx; + color: #333333; + font-weight: bold; + } + .input-wrap { + margin-top: 28rpx; + padding: 0 20rpx; + display: flex; + align-items: center; + border-radius: 24rpx; + border: 1rpx solid #d7d7d7; + .input { + flex: 1; + height: 84rpx; + font-size: 28rpx; + } + .sub { + flex-shrink: 0; + font-size: 28rpx; + color: #cccccc; + } + } + .p-footer { + margin-top: 38rpx; + padding: 0 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + .cancel { + width: 294rpx; + height: 80rpx; + font-size: 34rpx; + color: #cf5375; + display: flex; + align-items: center; + justify-content: center; + font-weight: bold; + border-radius: 24rpx; + border: 2rpx solid #cf5375; + } + .sure { + width: 294rpx; + height: 80rpx; + font-size: 34rpx; + color: #fff; + display: flex; + align-items: center; + justify-content: center; + font-weight: bold; + border-radius: 24rpx; + border: 2rpx solid #CF5375; + background-color: #CF5375; + } + } +} diff --git a/src/patient/pages/adlTest/index.ts b/src/patient/pages/adlTest/index.ts new file mode 100644 index 0000000..f98095b --- /dev/null +++ b/src/patient/pages/adlTest/index.ts @@ -0,0 +1,412 @@ +const app = getApp() + +Page({ + data: { + nav: 0, + showSubmit: false, + popupShow: false, + popupFocus: false, + SteroidDailyDose: 0, + popupHormone: '', + question: [ + { + title: '第一题:说话', + key: 'TalkingScore', + type: 'question', + icon: '1', + list: [ + { + id: '1', + title: '正常', + }, + { + id: '2', + title: '间或有点含糊或有鼻音', + }, + { + id: '3', + title: '经常含糊不清或者有鼻音,但是别人还能听懂', + }, + { + id: '4', + title: '别人听不太懂', + }, + ], + }, + { + title: '第二题:咀嚼', + key: 'ChewScore', + type: 'question', + icon: '2', + list: [ + { + id: '1', + title: '正常', + }, + { + id: '2', + title: '咀嚼固体食物会感到疲劳', + }, + { + id: '3', + title: '咀嚼松软食物会感到疲劳', + }, + { + id: '4', + title: '使用喂食管进食,如鼻胃管胃肠管等', + }, + ], + }, + { + title: '第三题:吞咽', + key: 'SwallowScore', + type: 'question', + icon: '4', + list: [ + { + id: '1', + title: '正常', + }, + { + id: '2', + title: '偶尔会噎到', + }, + { + id: '3', + title: '经常会噎到,因而需要改变饮食习惯', + }, + { + id: '4', + title: '使用喂食管进食,如鼻胃管胃肠管等', + }, + ], + }, + { + title: '第四题:呼吸', + key: 'BreathScore', + type: 'question', + icon: '5', + list: [ + { + id: '1', + title: '正常', + }, + { + id: '2', + title: '劳累后感到气促或呼吸不畅', + }, + { + id: '3', + title: '静止时感到气促或呼吸不畅', + }, + { + id: '4', + title: '依赖呼吸机', + }, + ], + }, + { + title: '第五题 刷牙或梳头的能力受损', + key: 'BrushTeethAndCombHairScore', + type: 'question', + icon: '6', + list: [ + { + id: '1', + title: '正常', + }, + { + id: '2', + title: '需要多费些力气但是不需要停下来', + }, + { + id: '3', + title: '需要停下来休息才能完成', + }, + { + id: '4', + title: '无法自己完成', + }, + ], + }, + { + title: '第六题 从椅子上起身能力受损', + key: 'GetUpFromChairScore', + type: 'question', + icon: '3', + list: [ + { + id: '1', + title: '正常', + }, + { + id: '2', + title: '轻度受损,有时需要用手帮忙', + }, + { + id: '3', + title: '中度受损,总是需要用手帮忙', + }, + { + id: '4', + title: '严重受损,需要他人帮助', + }, + ], + }, + { + title: '第七题:复视/重影', + key: 'DoubleVisionScore', + type: 'question', + icon: '7', + list: [ + { + id: '1', + title: '正常', + }, + { + id: '2', + title: '有,但不是每天', + }, + { + id: '3', + title: '每天,但不是持续一整天', + }, + { + id: '4', + title: '持续有', + }, + ], + }, + { + title: '第八题:眼睑下垂', + key: 'DroopyEyelidsScore', + type: 'question', + icon: '8', + list: [ + { + id: '1', + title: '正常', + }, + { + id: '2', + title: '有,但不是每天', + }, + { + id: '3', + title: '每天,但不是持续一整天', + }, + { + id: '4', + title: '持续有', + }, + ], + }, + { + title: '第九题:激素用量', + key: 'SteroidDailyDose', + type: 'intenseDose', + icon: '9', + }, + ] as { + title: string + key: string + icon: string + type: string + list: { + id: string + title: string + active?: boolean + }[] + }[], + params: {}, + + m_d: '', + nrdl: '', + + focus: false, + }, + onLoad(options) { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + this.setData({ + m_d: options.m_d, + nrdl: options.nrdl, + }) + + app.waitLogin({ isReg: false }).then(() => { + this.handleMp(this.data.nav) + }) + }, + handleSelect(e) { + const { index } = e.currentTarget.dataset + const { nav, question } = this.data + const questionItem = question[nav] + questionItem.list = questionItem.list.map((item, i) => { + if (index == i) { + item.active = true + } else { + item.active = false + } + return item + }) + this.setData({ + [`question[${nav}]`]: questionItem, + }) + setTimeout(() => { + this.setData({ + nav: nav == 8 ? 8 : nav + 1, + showSubmit: nav == 8, + }) + this.handleMp(this.data.nav) + }, 500) + }, + stopTouchMove() { + return false + }, + bindtransition() { + this.setData({ + nav: this.data.nav, + }) + }, + handlePrev() { + const { nav } = this.data + this.setData({ + nav: nav - 1, + }) + }, + handleSubmit() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTQ9COMPLETE' }) + wx.showLoading({ + title: '提交中', + }) + const { question } = this.data + const params = {} + question.forEach((item) => { + if (item.type === 'intenseDose') { + params[item.key] = this.data[item.key] + } else { + params[item.key] = item.list.findIndex((subItem) => subItem.active) + } + }) + this.setData({ + params, + }) + }, + handleFinish(e) { + const that = this + const url = `${app.globalData.upFileUrl}?r=file-service/upload-img` + wx.uploadFile({ + filePath: e.detail, + name: 'file', + url, + success(res) { + const data = JSON.parse(res.data) + that.submitCreate(data.data.Url) + }, + }) + }, + handleHorSelect(e) { + const { id } = e.currentTarget.dataset + const { SteroidDailyDose } = this.data + if (!id) { + this.setData({ + popupHormone: SteroidDailyDose > 0 ? SteroidDailyDose : '', + popupShow: true, + }) + setTimeout(() => { + this.setData({ + popupFocus: true, + }) + }, 300) + return + } + this.setData({ + SteroidDailyDose: id * 1, + showSubmit: Boolean(id), + }) + }, + handlePopupCancel() { + this.setData({ + popupShow: false, + popupFocus: false, + }) + }, + handlePopupSure() { + // if (!Number(this.data.popupHormone)) { + // wx.showToast({ + // icon: "none", + // title: "请输入激素用量", + // }); + // return; + // } + this.setData({ + SteroidDailyDose: Number(this.data.popupHormone), + showSubmit: true, + }) + this.handlePopupCancel() + }, + submitCreate(Url) { + const params = this.data.params + wx.ajax({ + method: 'POST', + url: '?r=xd/adl/create', + data: params, + }).then((res) => { + this.updateAdlImg(res.Id, Url, res) + }) + }, + updateAdlImg(id, Url, params) { + const { m_d, nrdl } = this.data + wx.ajax({ + method: 'POST', + url: '?r=xd/adl/update-img', + data: { + Id: id, + ImgUrl: Url, + }, + }).then(() => { + wx.hideLoading() + wx.setStorageSync('adlResultInfo', params.ScoreInfo) + wx.redirectTo({ + url: `/pages/adlResult/index?id=${id}&reset=1&m_d=${m_d}&nrdl=${nrdl}&wy=${Number(params.sendWeiYi)}&idafa=${Number(params.inviteDoctorAndFirstAdl)}`, + }) + }) + }, + handleInput(e) { + if (e.detail.value) { + this.setData({ + // eslint-disable-next-line regexp/optimal-quantifier-concatenation + popupHormone: e.detail.value.replace(/^(-)?(\d{0,3})(\.\d?)?.*$/, '$1$2$3'), + }) + } + }, + handleBack() { + wx.navigateBack() + }, + onShareAppMessage() { + return { + title: 'MG-ADL测评表:评估重症肌无力患者症状对生活质量的影响', + path: '/pages/adl/index', + } + }, + + handleMp(index) { + const PageName = { + 0: 'PG_PATIENTASSESSMENTQ1', + 1: 'PG_PATIENTASSESSMENTQ2', + 2: 'PG_PATIENTASSESSMENTQ3', + 3: 'PG_PATIENTASSESSMENTQ4', + 4: 'PG_PATIENTASSESSMENTQ5', + 5: 'PG_PATIENTASSESSMENTQ6', + 6: 'PG_PATIENTASSESSMENTQ7', + 7: 'PG_PATIENTASSESSMENTQ8', + 8: 'PG_PATIENTASSESSMENTQ9', + }[index] + app.zdMpBehavior({ PageName }) + }, +}) diff --git a/src/patient/pages/adlTest/index.wxml b/src/patient/pages/adlTest/index.wxml new file mode 100644 index 0000000..844901a --- /dev/null +++ b/src/patient/pages/adlTest/index.wxml @@ -0,0 +1,101 @@ + + + + + 测评{{nav+1}}/9 + + + + + + + + + + {{questionItem.title}} + Please answer the question below + + + + + + {{item.title}} + + + + + + {{questionItem.title}} + Please answer the question below + + 请选择您最近每天的激素用量 + + {{SteroidDailyDose}} + mg + + + + + + {{item+1}}片 + + + + {{SteroidDailyDose || '请输入其它毫克'}} + 其它 + + + + + + + 说明:此处按醋酸泼尼松片用量计算,每片为5mg + 若其它激素药物根据规格做等量换算,如5mg醋酸泼尼松 =4mg 甲泼尼龙* + + + + + + + + 上一题 + + 完成 + + + + + + + + + 请输入当天的激素用量 + + + mg/天 + + + 取消 + 确认 + + + diff --git a/src/patient/pages/cancellation/index.json b/src/patient/pages/cancellation/index.json new file mode 100644 index 0000000..c70e319 --- /dev/null +++ b/src/patient/pages/cancellation/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar" + } +} diff --git a/src/patient/pages/cancellation/index.scss b/src/patient/pages/cancellation/index.scss new file mode 100644 index 0000000..2e5974d --- /dev/null +++ b/src/patient/pages/cancellation/index.scss @@ -0,0 +1,48 @@ +page { + background-color: #afb7cb; +} +.page { + height: 100vh; + display: flex; + flex-direction: column; + .container { + padding: 76rpx 48rpx 58rpx; + flex: 1; + margin-top: 160rpx; + box-sizing: border-box; + border-radius: 48rpx 48rpx 0 0; + background-color: #fff; + text-align: center; + display: flex; + flex-direction: column; + justify-content: space-between; + .icon { + width: 256rpx; + height: 256rpx; + } + .title { + margin-top: 51rpx; + font-size: 48rpx; + color: #495069; + font-weight: bold; + } + .tip { + text-align: left; + margin-top: 44rpx; + font-size: 30rpx; + line-height: 53rpx; + color: #aeb7cd; + } + .footer { + .rescan { + width: 100%; + height: 80rpx; + text-align: center; + color: #fff; + line-height: 80rpx; + background: #B8BFD1; + border-radius: 42rpx; + } + } + } +} diff --git a/src/patient/pages/cancellation/index.ts b/src/patient/pages/cancellation/index.ts new file mode 100644 index 0000000..28b6f87 --- /dev/null +++ b/src/patient/pages/cancellation/index.ts @@ -0,0 +1,45 @@ +const app = getApp(); + +Page({ + data: { + durgInfo: {}, + }, + onLoad() { + const _this = this; + const eventChannel = this.getOpenerEventChannel(); + eventChannel.on("durgInfo", function (data) { + console.log(data); + _this.setData({ + durgInfo: data, + }); + }); + }, + handleBack() { + wx.navigateBack(); + }, + handleCancellation() { + wx.showModal({ + title: "确认注销", + content: "", + confirmColor: "#cf5375", + success(res) { + if (res.confirm) { + wx.ajax({ + method: "GET", + url: "?r=xd/account/cancellation", + data: {}, + loading: true, + }).then(() => { + app.globalData.backPage = ""; + app.globalData.loginState = ""; + app.globalData.userInfo = {}; + app.startLogin(); + wx.reLaunch({ + url: "/pages/login/index", + }); + }); + } + }, + }); + }, +}); diff --git a/src/patient/pages/cancellation/index.wxml b/src/patient/pages/cancellation/index.wxml new file mode 100644 index 0000000..22fb617 --- /dev/null +++ b/src/patient/pages/cancellation/index.wxml @@ -0,0 +1,19 @@ + + + + + + 确认注销 + + + diff --git a/src/patient/pages/certPending/index.json b/src/patient/pages/certPending/index.json new file mode 100644 index 0000000..b1d4a9a --- /dev/null +++ b/src/patient/pages/certPending/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "disableSwipeBack": true, + "usingComponents": { + "pageNavbar": "/components/pageNavbar/index", + "van-icon": "@vant/weapp/icon/index", + "van-divider": "@vant/weapp/divider/index" + } +} diff --git a/src/patient/pages/certPending/index.scss b/src/patient/pages/certPending/index.scss new file mode 100644 index 0000000..200d11d --- /dev/null +++ b/src/patient/pages/certPending/index.scss @@ -0,0 +1,100 @@ +.page { + position: relative; + box-sizing: border-box; + background-color: #fff; + .bg { + width: 100%; + } + .page-container { + padding-bottom: 80rpx; + position: absolute; + width: 100%; + top: 0; + left: 0; + display: flex; + flex-direction: column; + .navbar { + flex-shrink: 0; + padding: 0 20rpx 0; + display: flex; + align-items: center; + font-size: 40rpx; + color: #cf5375; + font-style: italic; + font-weight: bold; + .icon { + margin-right: 9rpx; + width: 42rpx; + height: 46rpx; + } + } + .page-title { + margin-top: 86rpx; + font-size: 48rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .sub-title { + margin-top: 32rpx; + font-size: 28rpx; + color: #aaaaaa; + text-align: center; + } + .content { + margin: 40rpx auto 0; + width: 654rpx; + box-sizing: border-box; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border: 2rpx solid rgba(224, 71, 117, 0.25); + border-radius: 24rpx; + padding-bottom: 60rpx; + .c-header { + border-radius: 24rpx 24rpx 0 0; + background-color: #666666; + padding: 18rpx 20rpx; + text-align: center; + font-size: 28rpx; + color: #fff; + line-height: 42rpx; + } + .code { + margin: 125rpx auto 0; + display: block; + width: 300rpx; + height: 300rpx; + } + .tip{ + margin-top: 87rpx; + font-size: 28rpx; + color: #666666; + text-align: center; + line-height: 48rpx; + } + } + .footer { + flex-shrink: 0; + margin: 81rpx 48rpx 0; + box-sizing: border-box; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 30rpx; + } + .next { + flex: 1; + text-align: center; + height: 88rpx; + line-height: 88rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + background-color: #e04775; + color: #fff; + } + } + } +} diff --git a/src/patient/pages/certPending/index.ts b/src/patient/pages/certPending/index.ts new file mode 100644 index 0000000..74dc5b4 --- /dev/null +++ b/src/patient/pages/certPending/index.ts @@ -0,0 +1,33 @@ +const app = getApp(); + +Page({ + data: {}, + onLoad() { + this.getCode(); + }, + handleVisitors() { + app.globalData.anyWhere = true; + let backPage = app.globalData.backPage; + app.globalData.backPage = ""; + if (backPage && !backPage.includes("liveResult")) { + backPage = ""; + } + wx.reLaunch({ + url: backPage || "/pages/index/index", + }); + }, + getCode() { + wx.ajax({ + method: "GET", + url: "?r=xd/common/get-channel-wx-code", + data: { + ChannelType: "11", + Id: "", + }, + }).then((res) => { + this.setData({ + qrCode: res, + }); + }); + }, +}); diff --git a/src/patient/pages/certPending/index.wxml b/src/patient/pages/certPending/index.wxml new file mode 100644 index 0000000..dd49d1a --- /dev/null +++ b/src/patient/pages/certPending/index.wxml @@ -0,0 +1,22 @@ + + + + + 提交成功,审核中 + 诊断证明审核通过后,即可享受平台全部服务 + + + 人工审核周期24小时~48小时 + + + + + 关注"gMG给力加油站"公众号 获取审核进度 + 还可以了解更多重症肌无力专业知识 + + + + 随便看看 + + + diff --git a/src/patient/pages/certReslove/index.json b/src/patient/pages/certReslove/index.json new file mode 100644 index 0000000..b1d4a9a --- /dev/null +++ b/src/patient/pages/certReslove/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "disableSwipeBack": true, + "usingComponents": { + "pageNavbar": "/components/pageNavbar/index", + "van-icon": "@vant/weapp/icon/index", + "van-divider": "@vant/weapp/divider/index" + } +} diff --git a/src/patient/pages/certReslove/index.scss b/src/patient/pages/certReslove/index.scss new file mode 100644 index 0000000..2e62750 --- /dev/null +++ b/src/patient/pages/certReslove/index.scss @@ -0,0 +1,90 @@ +.page { + position: relative; + box-sizing: border-box; + background-color: #fff; + .bg { + width: 100%; + height: 100vh; + } + .page-container { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100vh; + display: flex; + flex-direction: column; + .navbar { + flex-shrink: 0; + padding: 0 20rpx 0; + display: flex; + align-items: center; + .icon { + font-size: 40rpx; + margin-right: 40rpx; + } + .num { + width: 64rpx; + height: 64rpx; + border-radius: 50%; + border: 3rpx solid #e04876; + text-align: center; + line-height: 64rpx; + margin-right: 24rpx; + font-size: 40rpx; + color: #e04876; + font-weight: bold; + &.active { + background-color: #e04876; + color: #fff; + } + } + } + .page-icon { + margin: 240rpx auto 0; + display: block; + width: 280rpx; + height: 280rpx; + border-radius: 50%; + } + .page-title { + margin-top: 64rpx; + font-size: 56rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .sub-title { + margin-top: 32rpx; + font-size: 32rpx; + color: #aaaaaa; + text-align: center; + } + .footer { + position: absolute; + left: 64rpx; + bottom: 62rpx; + flex-shrink: 0; + width: 622rpx; + box-sizing: border-box; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 30rpx; + } + .next { + flex: 1; + text-align: center; + height: 88rpx; + line-height: 88rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + background-color: #e04775; + color: #fff; + } + } + } +} diff --git a/src/patient/pages/certReslove/index.ts b/src/patient/pages/certReslove/index.ts new file mode 100644 index 0000000..cb9a684 --- /dev/null +++ b/src/patient/pages/certReslove/index.ts @@ -0,0 +1,48 @@ +const app = getApp(); +let timer = null as null | number; + +Page({ + data: { + message: "3秒后自动进入", + drug: false, + }, + onLoad(options) { + this.setData({ + drug: Boolean(options.drug), + }); + }, + onReady() { + setTimeout(() => { + let time = 3; + timer = setInterval(() => { + time--; + this.setData({ + message: time + "秒后自动进入", + }); + if (time === 0) { + clearInterval(timer as number); + timer = null; + this.setData({ + message: "1秒后自动进入", + }); + this.handleSubmit(); + } + }, 1000); + }, 1000); + }, + handleSubmit() { + if (this.data.message != "1秒后自动进入") return; + if (app.globalData.backPage) { + wx.reLaunch({ + url: app.globalData.backPage, + }); + app.globalData.backPage = null; + return; + } + const backPage = app.globalData.backPage; + app.globalData.backPage = ""; + wx.reLaunch({ + url: backPage || "/pages/index/index", + }); + }, +}); diff --git a/src/patient/pages/certReslove/index.wxml b/src/patient/pages/certReslove/index.wxml new file mode 100644 index 0000000..9540ef1 --- /dev/null +++ b/src/patient/pages/certReslove/index.wxml @@ -0,0 +1,13 @@ + + + + + + + + + + {{message}} + + + diff --git a/src/patient/pages/changePhone/index.json b/src/patient/pages/changePhone/index.json new file mode 100644 index 0000000..70c331f --- /dev/null +++ b/src/patient/pages/changePhone/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "navBar": "/components/zd-navBar/navBar" + } +} diff --git a/src/patient/pages/changePhone/index.scss b/src/patient/pages/changePhone/index.scss new file mode 100644 index 0000000..a1a92de --- /dev/null +++ b/src/patient/pages/changePhone/index.scss @@ -0,0 +1,110 @@ +pgae { +} +.page { + position: relative; + height: 100vh; + background-color: #fafafa; + .bg { + width: 100%; + } + .container { + position: absolute; + left: 0; + top: 233rpx; + width: 100%; + .frame { + display: block; + margin: 0 auto; + width: 220rpx; + height: 220rpx; + } + .title { + display: block; + margin: 86rpx auto 0; + width: 430rpx; + height: 50rpx; + } + .sub-title { + margin-top: 95rpx; + font-size: 24rpx; + color: #999999; + display: flex; + align-items: center; + justify-content: center; + .link { + color: #e04775; + } + } + .form { + margin-top: 32rpx; + padding: 0 64rpx; + .row { + margin-bottom: 40rpx; + display: flex; + .input { + flex: 1; + padding: 24rpx 32rpx; + height: 40rpx; + font-size: 28rpx; + color: #999999; + background: #f2f2f2; + border: 1rpx solid #cccccc; + border-radius: 24rpx; + } + .code { + margin-left: 24rpx; + flex-shrink: 0; + width: 212rpx; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 28rpx; + color: #e04775; + display: flex; + align-items: center; + justify-content: center; + } + .submit { + width: 622rpx; + height: 88rpx; + background: #e04775; + border-radius: 24rpx; + font-size: 34rpx; + color: #ffffff; + font-weight: bold; + text-align: center; + line-height: 88rpx; + } + } + } + .divider { + margin: 48rpx auto 0; + width: 300rpx; + } + .ohter { + margin-top: 48rpx; + display: flex; + justify-content: center; + .col { + margin: 0 48rpx; + padding: 0 20rpx; + height: 48rpx; + border-radius: 24rpx; + background: #eeeeee; + font-size: 24rpx; + color: #666666; + display: flex; + align-items: center; + justify-content: center; + &::after { + border: none; + outline: none; + } + .icon { + margin-right: 12rpx; + width: 48rpx; + height: 48rpx; + } + } + } + } +} diff --git a/src/patient/pages/changePhone/index.ts b/src/patient/pages/changePhone/index.ts new file mode 100644 index 0000000..04ba1cb --- /dev/null +++ b/src/patient/pages/changePhone/index.ts @@ -0,0 +1,78 @@ +const app = getApp(); +let timer = null as null | number; + +Page({ + data: { + mobile: "", + code: "", + + codeText: "发送验证码", + }, + onLoad() {}, + getCode() { + if (timer) return; + const mobile = this.data.mobile; + if (!mobile) { + wx.showToast({ + title: "手机号不能为空", + icon: "none", + }); + return; + } + // 验证手机号 + if (!/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/.test(mobile)) { + wx.showToast({ + title: "手机号格式不正确", + icon: "none", + }); + return; + } + wx.ajax({ + method: "POST", + url: "?r=xd/login/send-verify-code", + data: { + mobile, + }, + }).then((res) => { + console.log(res); + wx.showToast({ + icon: "none", + title: "验证码已发送~", + }); + let time = 60; + timer = setInterval(() => { + time--; + this.setData({ + codeText: time + "s后重新发送", + }); + if (time <= 0) { + clearInterval(timer as number); + timer = null; + this.setData({ + codeText: "发送验证码", + }); + } + }, 1000); + }); + }, + handleSubmit() { + const { mobile, code } = this.data; + const { registrationSource, registChannel, regBusinessId } = app.globalData; + wx.ajax({ + method: "POST", + url: "?r=xd/account/update-telephone", + data: { + mobile, + code, + registrationSource, + registChannel, + regBusinessId, + }, + }).then((_res) => { + wx.navigateBack(); + }); + }, + handleBack() { + wx.navigateBack(); + }, +}); diff --git a/src/patient/pages/changePhone/index.wxml b/src/patient/pages/changePhone/index.wxml new file mode 100644 index 0000000..14353f0 --- /dev/null +++ b/src/patient/pages/changePhone/index.wxml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + {{codeText}} + + + 修改手机号 + + + + diff --git a/src/patient/pages/changeUser/index.json b/src/patient/pages/changeUser/index.json new file mode 100644 index 0000000..70c331f --- /dev/null +++ b/src/patient/pages/changeUser/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "navBar": "/components/zd-navBar/navBar" + } +} diff --git a/src/patient/pages/changeUser/index.scss b/src/patient/pages/changeUser/index.scss new file mode 100644 index 0000000..a1a92de --- /dev/null +++ b/src/patient/pages/changeUser/index.scss @@ -0,0 +1,110 @@ +pgae { +} +.page { + position: relative; + height: 100vh; + background-color: #fafafa; + .bg { + width: 100%; + } + .container { + position: absolute; + left: 0; + top: 233rpx; + width: 100%; + .frame { + display: block; + margin: 0 auto; + width: 220rpx; + height: 220rpx; + } + .title { + display: block; + margin: 86rpx auto 0; + width: 430rpx; + height: 50rpx; + } + .sub-title { + margin-top: 95rpx; + font-size: 24rpx; + color: #999999; + display: flex; + align-items: center; + justify-content: center; + .link { + color: #e04775; + } + } + .form { + margin-top: 32rpx; + padding: 0 64rpx; + .row { + margin-bottom: 40rpx; + display: flex; + .input { + flex: 1; + padding: 24rpx 32rpx; + height: 40rpx; + font-size: 28rpx; + color: #999999; + background: #f2f2f2; + border: 1rpx solid #cccccc; + border-radius: 24rpx; + } + .code { + margin-left: 24rpx; + flex-shrink: 0; + width: 212rpx; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 28rpx; + color: #e04775; + display: flex; + align-items: center; + justify-content: center; + } + .submit { + width: 622rpx; + height: 88rpx; + background: #e04775; + border-radius: 24rpx; + font-size: 34rpx; + color: #ffffff; + font-weight: bold; + text-align: center; + line-height: 88rpx; + } + } + } + .divider { + margin: 48rpx auto 0; + width: 300rpx; + } + .ohter { + margin-top: 48rpx; + display: flex; + justify-content: center; + .col { + margin: 0 48rpx; + padding: 0 20rpx; + height: 48rpx; + border-radius: 24rpx; + background: #eeeeee; + font-size: 24rpx; + color: #666666; + display: flex; + align-items: center; + justify-content: center; + &::after { + border: none; + outline: none; + } + .icon { + margin-right: 12rpx; + width: 48rpx; + height: 48rpx; + } + } + } + } +} diff --git a/src/patient/pages/changeUser/index.ts b/src/patient/pages/changeUser/index.ts new file mode 100644 index 0000000..5d8c51a --- /dev/null +++ b/src/patient/pages/changeUser/index.ts @@ -0,0 +1,89 @@ +const app = getApp(); +let timer = null as null | number; + +Page({ + data: { + mobile: "", + code: "", + + codeText: "发送验证码", + }, + onLoad() {}, + getCode() { + if (timer) return; + const mobile = this.data.mobile; + if (!mobile) { + wx.showToast({ + title: "手机号不能为空", + icon: "none", + }); + return; + } + // 验证手机号 + if (!/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/.test(mobile)) { + wx.showToast({ + title: "手机号格式不正确", + icon: "none", + }); + return; + } + wx.ajax({ + method: "POST", + url: "?r=xd/login/send-verify-code", + data: { + mobile, + }, + }).then((res) => { + console.log(res); + wx.showToast({ + icon: "none", + title: "验证码已发送~", + }); + let time = 60; + timer = setInterval(() => { + time--; + this.setData({ + codeText: time + "s后重新发送", + }); + if (time <= 0) { + clearInterval(timer as number); + timer = null; + this.setData({ + codeText: "发送验证码", + }); + } + }, 1000); + }); + }, + handleSubmit() { + const { mobile, code } = this.data; + const { registrationSource, registChannel, regBusinessId } = app.globalData; + wx.ajax({ + method: "POST", + url: "?r=xd/login/change-user-login", + data: { + mobile, + code, + registrationSource, + registChannel, + regBusinessId, + }, + }) + .then((res) => { + console.log(res); + wx.reLaunch({ + url: "/pages/index/index", + }); + }) + .catch((err) => { + wx.showToast({ + title: err.data.msg, + icon: "none", + duration: 3000, + }); + }); + }, + handleBack() { + wx.navigateBack(); + }, +}); diff --git a/src/patient/pages/changeUser/index.wxml b/src/patient/pages/changeUser/index.wxml new file mode 100644 index 0000000..b18e85d --- /dev/null +++ b/src/patient/pages/changeUser/index.wxml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + {{codeText}} + + + 切换账号 + + + + diff --git a/src/patient/pages/comIns/index.json b/src/patient/pages/comIns/index.json new file mode 100644 index 0000000..0ac661c --- /dev/null +++ b/src/patient/pages/comIns/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "商保项目申请", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "toast": "/components/toast/index" + } +} diff --git a/src/patient/pages/comIns/index.scss b/src/patient/pages/comIns/index.scss new file mode 100644 index 0000000..81393d4 --- /dev/null +++ b/src/patient/pages/comIns/index.scss @@ -0,0 +1,20 @@ +.page { + min-height: 100vh; + .submit { + position: fixed; + bottom: 62rpx; + left: 0; + margin: 0 64rpx; + text-align: center; + height: 88rpx; + width: calc(100% - 128rpx); + line-height: 88rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + background-color: #e04775; + color: #fff; + } +} diff --git a/src/patient/pages/comIns/index.ts b/src/patient/pages/comIns/index.ts new file mode 100644 index 0000000..0f37e00 --- /dev/null +++ b/src/patient/pages/comIns/index.ts @@ -0,0 +1,12 @@ +const _app = getApp(); + +Page({ + data: { + toastShow: true, + // toastType: "aldAlert", + // toastType: "aldAlertTest", + toastType: "vipScan", + toastParams: {}, + }, + onLoad() {}, +}); diff --git a/src/patient/pages/comIns/index.wxml b/src/patient/pages/comIns/index.wxml new file mode 100644 index 0000000..455bc95 --- /dev/null +++ b/src/patient/pages/comIns/index.wxml @@ -0,0 +1,18 @@ + + + + 申请项目 + + + + + diff --git a/src/patient/pages/doctor/index.json b/src/patient/pages/doctor/index.json new file mode 100644 index 0000000..7028967 --- /dev/null +++ b/src/patient/pages/doctor/index.json @@ -0,0 +1,13 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index", + "timeOut": "/components/timeOut/index", + "toast": "/components/toast/index", + "siteShare": "./siteShare/index", + "pickerArea":"/components/pickerArea/index" + } +} diff --git a/src/patient/pages/doctor/index.scss b/src/patient/pages/doctor/index.scss new file mode 100644 index 0000000..6946b20 --- /dev/null +++ b/src/patient/pages/doctor/index.scss @@ -0,0 +1,447 @@ +page { + background-color: #fafafa; +} + +.page { + padding-bottom: 200rpx; + .page-header { + margin-bottom: 30rpx; + padding: 40rpx 32rpx 0; + background-color: #fff; + .site-line { + padding: 30rpx 0 0; + display: flex; + align-items: center; + justify-content: space-between; + .area { + display: flex; + align-items: center; + gap: 14rpx; + .icon { + flex-shrink: 0; + width: 34rpx; + height: 36rpx; + } + .name { + font-size: 32rpx; + color: rgba(46, 45, 45, 1); + } + .triangle { + width: 0; + height: 0; + border-style: solid; + border-width: 10rpx 10rpx 0 10rpx; + border-color: rgba(72, 72, 72, 1) transparent transparent transparent; + } + } + .btn { + width: 172rpx; + height: 60rpx; + font-size: 32rpx; + color: rgba(46, 45, 45, 0.6); + display: flex; + align-items: center; + justify-content: center; + } + } + .search { + margin-top: 28rpx; + padding: 16rpx 32rpx; + display: flex; + align-items: center; + background: rgba(247, 248, 249, 1); + border-radius: 38rpx; + .icon { + flex-shrink: 0; + width: 40rpx; + height: 40rpx; + } + .input { + flex: 1; + padding-left: 10rpx; + font-size: 28rpx; + } + .place-input { + color: rgba(168, 168, 168, 1); + } + } + .tabs { + margin-top: 10rpx; + .van-tabs__scroll { + background-color: transparent; + } + .tab-class { + font-size: 32rpx; + &.tab-active-class { + font-weight: bold; + } + } + .van-tabs__line { + width: 34rpx !important; + height: 8rpx; + background: #e04775; + border-radius: 4rpx; + } + } + } + + .map { + margin: 0 30rpx; + .map-item { + position: relative; + margin-bottom: 32rpx; + padding: 32rpx; + display: flex; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + .follow { + position: absolute; + top: 0; + right: 0; + width: 112rpx; + height: 42rpx; + background: #e04775; + border-radius: 0rpx 24rpx 0rpx 24rpx; + border: 2rpx solid #ebecee; + font-size: 24rpx; + color: #ffffff; + text-align: center; + line-height: 42rpx; + } + .hosttipat-img { + margin-right: 16rpx; + flex-shrink: 0; + width: 136rpx; + height: 136rpx; + border-radius: 24rpx; + border: 2rpx solid rgba(151, 151, 151, 0.21); + overflow: hidden; + .img { + width: 100%; + height: 100%; + } + } + .wrap { + flex: 1; + .title { + display: flex; + align-items: center; + .name { + font-size: 32rpx; + color: #484848; + word-break: break-all; + line-height: 48rpx; + } + .tag { + flex-shrink: 0; + display: inline-block; + vertical-align: middle; + margin-left: 12rpx; + padding: 6rpx 12rpx; + font-size: 22rpx; + line-height: 1; + color: #ffffff; + background: #ffc137; + border-radius: 8rpx; + } + } + .content { + margin-top: 16rpx; + .inner { + flex: 1; + display: flex; + justify-content: space-between; + .site { + flex: 1; + font-size: 24rpx; + color: #9b9ea6; + } + .site-num { + flex-shrink: 0; + font-size: 24rpx; + color: #9b9ea6; + } + .icon { + flex-shrink: 0; + margin-left: 14rpx; + width: 36rpx; + height: 36rpx; + } + } + .tag { + margin-top: 16rpx; + margin-right: 22rpx; + display: inline-block; + padding: 4rpx 16rpx 6rpx 16rpx; + line-height: 1; + font-size: 22rpx; + color: #e04775; + border-radius: 8rpx; + border: 1rpx solid #e04775; + } + .drug { + vertical-align: middle; + padding-right: 8rpx; + display: inline-block; + font-size: 22rpx; + color: #e04775; + line-height: 1; + border-radius: 8rpx; + background-color: #f5dfe6; + .drug-icon { + border-radius: 8rpx; + vertical-align: middle; + padding: 8rpx 10rpx; + width: 16rpx; + height: 20rpx; + background-color: #e04775; + } + } + } + } + } + } + + .dtp { + padding: 32rpx 30rpx 0; + .dtp-item { + margin-bottom: 24rpx; + padding: 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + display: flex; + .photo { + flex-shrink: 0; + &-img { + width: 136rpx; + height: 136rpx; + border-radius: 24rpx; + } + } + .wrap { + flex: 1; + padding-left: 16rpx; + .title { + font-size: 32rpx; + color: #484848; + font-weight: bold; + } + .tags { + margin-top: 16rpx; + display: flex; + .tag { + margin-right: 16rpx; + padding-right: 8rpx; + font-size: 22rpx; + color: #e04775; + line-height: 1; + border-radius: 8rpx; + background-color: #f5dfe6; + display: flex; + align-items: center; + .icon { + margin-right: 8rpx; + padding: 4rpx; + width: 24rpx; + max-height: 24rpx; + background-color: #e04775; + border-radius: 8rpx; + } + } + } + .content { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + .inner { + .site { + font-size: 24rpx; + color: #9e9e9e; + } + .tel { + font-size: 24rpx; + color: #9b9ea6; + } + } + .phone { + margin-left: 20rpx; + flex-shrink: 0; + width: 48rpx; + height: 48rpx; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + background-color: #fff; + box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.1); + &-img { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + } + + .module { + margin-top: 64rpx; + padding: 0 30rpx; + .card { + margin-bottom: 32rpx; + padding: 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + .c-header { + display: flex; + .avatar { + margin-right: 18rpx; + flex-shrink: 0; + width: 140rpx; + height: 140rpx; + border-radius: 16rpx; + } + .wrap { + position: relative; + padding-right: 120rpx; + flex: 1; + .name { + font-size: 44rpx; + color: #484848; + } + .title { + .name { + margin-left: 12rpx; + font-size: 28rpx; + color: #484848; + word-break: break-all; + line-height: 42rpx; + } + .tag { + flex-shrink: 0; + display: inline-block; + vertical-align: middle; + padding: 4rpx 12rpx; + font-size: 22rpx; + line-height: 1; + color: #ffffff; + background: #ffc137; + border-radius: 8rpx; + } + } + .w-content { + margin-top: 16rpx; + .inner { + flex: 1; + display: flex; + justify-content: space-between; + .site { + flex: 1; + font-size: 24rpx; + color: #9b9ea6; + } + .site-box { + position: absolute; + right: 0; + top: 70rpx; + text-align: center; + .site-num { + flex-shrink: 0; + font-size: 24rpx; + color: #9b9ea6; + } + .icon { + flex-shrink: 0; + margin-left: 14rpx; + width: 36rpx; + height: 36rpx; + } + } + } + } + } + } + .content { + margin-top: 6rpx; + padding-left: 158rpx; + .row { + margin-top: 16rpx; + display: flex; + align-items: flex-start; + flex-wrap: wrap; + // .tag { + // margin-right: 16rpx; + // flex-shrink: 0; + // padding: 8rpx 16rpx; + // font-size: 24rpx; + // color: #e04775; + // line-height: 1; + // background: #fcf2f6; + // border-radius: 8rpx; + // border: 2rpx solid #e04775; + // } + .p { + font-size: 24rpx; + line-height: 38rpx; + color: #9da0a8; + &.ellipsis { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + } + .tag { + margin-right: 16rpx; + margin-bottom: 10rpx; + width: 120rpx; + height: 32rpx; + background: #ffe6ee; + border-radius: 8rpx; + display: flex; + .week { + flex: 1; + font-size: 20rpx; + line-height: 32rpx; + color: #ffffff; + background-color: #e66c8e; + text-align: center; + border-radius: 8rpx 0 8rpx 8rpx; + } + .value { + flex: 1; + font-size: 20rpx; + color: #e04775; + text-align: center; + line-height: 32rpx; + } + } + .week-name { + flex: 1; + padding: 20rpx 24rpx; + background-color: rgba(253, 244, 247, 1); + border-radius: 16rpx; + font-size: 24rpx; + color: rgba(157, 160, 168, 1); + line-height: 40rpx; + .label { + margin-right: 12rpx; + display: inline-block; + font-size: 20rpx; + color: rgba(255, 255, 255, 1); + line-height: 32rpx; + padding: 0 8rpx; + background: #e04775; + border-radius: 8rpx 8rpx 8rpx 8rpx; + } + } + } + } + } + } +} diff --git a/src/patient/pages/doctor/index.ts b/src/patient/pages/doctor/index.ts new file mode 100644 index 0000000..52ec5bf --- /dev/null +++ b/src/patient/pages/doctor/index.ts @@ -0,0 +1,435 @@ +const app = getApp() + +Page({ + data: { + tabActive: 0, + LNG: '' as number | string, + LAT: '' as number | string, + HosList: [], + DoctortList: [], + dtpList: [], + pagination: { + page: 1, + pages: 1, + count: 0, + }, + ProvinceName: '', + ProvinceId: '', + CityName: '', + CityId: '', + Name: '', + + bottom: 0, + + asideOut: false, + timeToast: false, + timeToastType: '17', + timeToastParams: { + rewardScore: 0, + }, + areaShow: false, + + toastShow: false, + // toastType: 'dtpDrug',// TODO:已销毁 + toastType: 'siteConform', + toastParams: {} as any, + + es: '', + + locationName: '重新定位', + }, + onLoad(options) { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + app.waitLogin().then((_res) => { + if (options.es === '201504') { + app.globalData.IsAliQiWei = 1 + app.zdMpBehavior({ PageName: 'PG_PATIENTVISITMAP_PAGE' }) + this.setData({ + es: options.es, + }) + } + + if (options.active && ['1', '2'].includes(options.active)) { + this.setData({ + tabActive: Number(options.active), + }) + } else { + app.zdMpBehavior({ PageName: 'PG_PATIENTVISITMAPLIST' }) + } + if (options.pid) { + this.setData({ + ProvinceName: options.pn || '', + ProvinceId: options.pid || '', + CityName: options.cn || '', + CityId: options.cid || '', + }) + this.getList() + } else { + this.handleToggleSite() + } + }) + }, + handleToggleSite() { + const that = this + if (!this.data.LNG) { + wx.getSetting({ + success(res) { + if ( + res.authSetting['scope.userFuzzyLocation'] != undefined && + res.authSetting['scope.userFuzzyLocation'] == true + ) { + //获取当前位置 + that.getFuzzyLocation() + } else if (res.authSetting['scope.userFuzzyLocation'] == undefined) { + //获取当前位置 + that.getFuzzyLocation() + } else { + wx.showModal({ + title: '请求授权当前位置', + content: '需要获取您的地理位置,请确认授权', + confirmColor: '#cf5375', + success(res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: '拒绝授权', + icon: 'none', + duration: 1000, + }) + that.getList() + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success(res) { + if (res.authSetting['scope.userFuzzyLocation'] == true) { + wx.showToast({ + title: '授权成功', + icon: 'success', + duration: 1000, + }) + //再次授权,调用wx.getLocation的API + that.getFuzzyLocation() + } else { + wx.showToast({ + title: '授权失败', + icon: 'none', + duration: 1000, + }) + that.getList() + } + }, + }) + } + }, + }) + } + }, + }) + } else { + that.setData({ + LNG: '', + LAT: '', + }) + this.getLocationInfo() + } + }, + getFuzzyLocation() { + const that = this + wx.getFuzzyLocation({ + success(res) { + that.setData({ + LNG: res.longitude, + LAT: res.latitude, + }) + that.getLocationInfo() + }, + fail() { + that.getList() + }, + }) + }, + handleTapSite() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTVISITMAPCHANGEAREA' }) + }, + handleChangeSite(e: WechatMiniprogram.CustomEvent) { + const detail = e.detail + this.setData({ + ProvinceId: detail.ProvinceId, + ProvinceName: detail.ProvinceName, + CityId: detail.CityId, + CityName: detail.CityName, + }) + this.getList() + }, + onChange(e: WechatMiniprogram.CustomEvent) { + const index = e.detail.index + if (index == 0) { + app.zdMpBehavior({ PageName: 'PG_PATIENTVISITMAPLIST' }) + } else if (index == 1) { + app.zdMpBehavior({ PageName: 'PG_PATIENTVISITMAPDUALCHANNELPHARMACY' }) + } else if (index == 2) { + app.zdMpBehavior({ PageName: 'PG_PATIENTVISITMAPDOCTORS' }) + } + this.setData({ + tabActive: index, + }) + wx.pageScrollTo({ + scrollTop: 0, + }) + this.getList() + }, + handleBlur() { + this.getList() + }, + getLocationInfo() { + wx.ajax({ + method: 'GET', + url: '?r=xd/hospital/location-info', + data: { + lng: this.data.LNG, + lat: this.data.LAT, + }, + }).then((res) => { + this.setData({ + ProvinceId: res.ProvinceId, + ProvinceName: res.ProvinceName, + CityId: res.CityId, + CityName: res.CityName, + }) + this.getList() + }) + }, + getList() { + const { tabActive, toastShow, toastType } = this.data + if (tabActive != 1 && toastShow && toastType == 'dtpDrug') { + this.hideDtpAlert() + } + if (tabActive == 0) { + this.getHosList() + } else if (tabActive == 1) { + this.getDtpList() + } else if (tabActive == 2) { + this.getDoctorList() + } + }, + getHosList() { + const { Name, LNG, LAT, ProvinceId, CityId } = this.data + wx.ajax({ + method: 'GET', + url: '?r=xd/hospital/list', + data: { + lng: LNG, + lat: LAT, + ProvinceId: Name ? '' : ProvinceId, + CityId: Name ? '' : CityId, + Name, + }, + }).then((res) => { + if (res.CanGetScore) { + this.handleTimeOut() + } + this.setData({ + HosList: Array.isArray(res) ? res : res.list, + locationName: '重新定位', + }) + }) + }, + getDoctorList() { + const { Name, LNG, LAT, ProvinceId, CityId } = this.data + wx.ajax({ + method: 'GET', + url: '?r=xd/doctor/list', + data: { + lng: LNG, + lat: LAT, + ProvinceId: Name ? '' : ProvinceId, + CityId: Name ? '' : CityId, + Name, + }, + }).then((res) => { + this.setData({ + locationName: '重新定位', + DoctortList: res.map((item: { Clinic: string }) => { + let weekName = '' + if (item.ClinicType == 2) { + weekName = item.Clinic + } else { + weekName = (JSON.parse(item.Clinic) ? JSON.parse(item.Clinic) : []).map( + (subItem: { weekday: string | number; timeType: string | number }) => { + const week = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] + const timeDay = { 1: '上午', 2: '下午' } + return { week: week[Number(subItem.weekday) - 1], timeDay: timeDay[subItem.timeType] } + }, + ) + } + return { + weekName, + ...item, + } + }), + }) + }) + }, + getDtpList() { + const { Name, LNG, LAT, ProvinceId, CityId } = this.data + wx.ajax({ + method: 'GET', + url: '?r=xd/dtp-pharmacy/list', + data: { + lng: LNG, + lat: LAT, + ProvinceId: Name ? '' : ProvinceId, + CityId: Name ? '' : CityId, + Name, + }, + }).then((res) => { + this.setData({ + dtpList: res.list, + locationName: '重新定位', + }) + }) + }, + // getDtpAlert() { + // wx.ajax({ + // method: 'GET', + // url: '?r=xd/popup/info', + // data: { Type: 3 }, + // }).then((res) => { + // if (res.showAlert) { + // this.setData({ + // toastShow: true, + // toastType: 'dtpDrug', + // }) + // } + // }) + // }, + hideDtpAlert() { + wx.ajax({ + method: 'POST', + url: '?r=xd/popup/close-popup', + data: { Type: 3 }, + }).then((_res) => {}) + }, + handleDetail(e: WechatMiniprogram.CustomEvent) { + const { url } = e.currentTarget.dataset + const { tabActive } = this.data + if (tabActive == 0) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTVISITMAPLIST' }) + } else if (tabActive == 1) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTVISITMAPDUALCHANNELPHARMACY' }) + } else if (tabActive == 2) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTVISITMAPDOCTORS' }) + } + wx.navigateTo({ + url, + }) + }, + handleOpenMap(e: WechatMiniprogram.CustomEvent) { + const { lat, lng, name, address } = e.currentTarget.dataset + wx.openLocation({ + latitude: lat * 1, + longitude: lng * 1, + name, + address, + }) + }, + handleBack() { + wx.navigateBack() + }, + onPageScroll() {}, + handleToastOk() { + this.handleToastCancel() + }, + handleToastCancel() { + this.hideDtpAlert() + this.setData({ + toastShow: false, + }) + }, + handleDtpPhone(e: any) { + const { tel } = e.currentTarget.dataset + if (!tel) { + wx.showToast({ + icon: 'none', + title: '电话暂未开通', + }) + return + } + wx.makePhoneCall({ + phoneNumber: tel, + }) + }, + + handleTimeOut() { + this.setData({ + asideOut: false, + }) + wx.ajax({ + method: 'POST', + url: '?r=xd/score/send-score', + data: { + Type: this.data.timeToastType, + Id: 0, + }, + }).then((res) => { + if (!Array.isArray(res)) { + this.setData({ + timeToast: true, + timeToastParams: { + rewardScore: res.rewardScore, + }, + }) + setTimeout(() => { + this.setData({ + timeToast: false, + }) + }, 3000) + } + }) + }, + handleSiteShare(e) { + this.setData({ + toastShow: true, + toastType: 'siteConform', + toastParams: e.detail, + }) + }, + handleDefultLocation() { + if (this.data.locationName === '定位中') return + this.setData({ + locationName: '定位中', + }) + this.handleToggleSite() + }, + handleSiteShareShow(e) { + this.setData({ + areaShow: e.detail, + }) + }, + onShareAppMessage(e: any) { + let path = `/pages/doctor/index?active=${this.data.tabActive}&es=${this.data.es}` + const { toastType, toastParams } = this.data + if (toastType === 'siteConform' && e.from === 'button') { + path = `${path}&pid=${toastParams.ProvinceId}&cid=${toastParams.CityId}&pn=${toastParams.ProvinceName}&cn=${toastParams.CityName}` + this.setData({ + ProvinceId: toastParams.ProvinceId, + ProvinceName: toastParams.ProvinceName, + CityId: toastParams.CityId, + CityName: toastParams.CityName, + }) + this.getList() + } + + return { + title: '【就诊地图】帮您快速找到医生和医院', + imageUrl: `${app.globalData.imageUrl}5/share1.png?t=${app.globalData.Timestamp}`, + path, + } + }, +}) diff --git a/src/patient/pages/doctor/index.wxml b/src/patient/pages/doctor/index.wxml new file mode 100644 index 0000000..36f2332 --- /dev/null +++ b/src/patient/pages/doctor/index.wxml @@ -0,0 +1,224 @@ + + + + + + + + + + {{ProvinceName}}{{ProvinceName == CityName ? '' : CityName}} + 请选择省市 + + + + {{locationName}} + + + + + + + + + + + + + + + + + + + + + + + {{item.Name}} + + {{item.HospitalClassificationName}}{{item.HospitalLevelName}} + + + + + {{item.ProvinceName}}{{item.CityName}}{{item.CountyName}}{{item.Address}} + {{item.dist}} + + + {{item.DoctorNum}}名医生 + + + 院内有药 + + + + + + + + + + + + + + + {{item.Name}} + + + + 自有输注中心 + + + + 合作输注中心 + + + + + {{item.ProvinceName}}{{item.CityName}}{{item.CountyName}}{{item.Address}} + {{item.Telephone}} + + + + + + + + + + + + + + + + {{item.Name}} + + + {{item.hospital.HospitalClassificationName}}{{item.hospital.HospitalLevelName}} + + {{item.hospital.Name}} + + + + + {{item.hospital.ProvinceName}}{{item.hospital.CityName}}{{item.hospital.CountyName}}{{item.hospital.Address}} + + + + {{item.hospital.dist}} + + + + + + + + + {{item.Introduce}} + + + + + 出诊时间{{item.weekName}} + + + + {{wItem.week}} + {{wItem.timeDay}} + + + + + + + + + + + + + + diff --git a/src/patient/pages/doctor/siteShare/index.json b/src/patient/pages/doctor/siteShare/index.json new file mode 100644 index 0000000..cf286db --- /dev/null +++ b/src/patient/pages/doctor/siteShare/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "@vant/weapp/popup/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/patient/pages/doctor/siteShare/index.scss b/src/patient/pages/doctor/siteShare/index.scss new file mode 100644 index 0000000..6ebb4c0 --- /dev/null +++ b/src/patient/pages/doctor/siteShare/index.scss @@ -0,0 +1,135 @@ +.aside-share { + position: fixed; + right: 10rpx; + bottom: 120rpx; + width: 152rpx; + height: 170rpx; +} + +.popup { + position: relative; + background-color: #fff; + .close { + position: absolute; + top: 52rpx; + right: 32rpx; + color: rgba(72, 72, 72, 1); + font-size: 34rpx; + } + .site { + position: absolute; + top: 52rpx; + left: 32rpx; + width: 34rpx; + height: 36rpx; + } + .p-header { + padding: 46rpx 30rpx 0; + .title { + text-align: center; + font-size: 36rpx; + color: rgba(72, 72, 72, 1); + font-weight: bold; + } + .tip { + text-align: center; + margin-top: 16rpx; + font-size: 32rpx; + color: rgba(72, 72, 72, 1); + } + .area { + margin-top: 48rpx; + display: flex; + align-items: center; + justify-content: space-between; + gap: 14rpx; + .item { + flex: 1; + padding: 18rpx 30rpx; + box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 0, 0, 0.11); + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 2rpx solid #e04775; + display: flex; + align-items: center; + justify-content: space-between; + .content { + font-size: 32rpx; + color: rgba(72, 72, 72, 1); + max-width: 5em; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .icon { + width: 32rpx; + height: 32rpx; + } + } + .picker { + flex: 1; + } + .btn { + width: 126rpx; + height: 76rpx; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + display: flex; + align-items: center; + justify-content: center; + background: #e04775; + border-radius: 12rpx 12rpx 12rpx 12rpx; + } + } + } + .select { + margin-top: 44rpx; + padding: 0 30rpx 0; + display: grid; + grid-template-columns: repeat(auto-fit, 68rpx); + gap: 26rpx 20rpx; + .s-item { + width: 68rpx; + height: 68rpx; + text-align: center; + line-height: 68rpx; + font-size: 28rpx; + color: rgba(158, 158, 158, 1); + border-radius: 50%; + background: #f7f8f9; + &.active { + color: #fff; + background-color: rgba(224, 71, 117, 1); + } + } + } + .scroll { + padding: 0 30rpx; + height: 45vh; + box-sizing: border-box; + .item { + padding: 32rpx 0; + font-size: 28rpx; + color: rgba(72, 72, 72, 1); + border-bottom: 2px solid #fbfbfb; + display: flex; + align-items: center; + justify-content: space-between; + .word { + margin-right: 24rpx; + display: inline-block; + width: 1em; + color: rgba(158, 158, 158, 1); + } + .icon { + width: 36rpx; + height: 36rpx; + } + &.active { + color: rgba(224, 71, 117, 1); + .word { + color: rgba(224, 71, 117, 1); + } + } + } + } +} diff --git a/src/patient/pages/doctor/siteShare/index.ts b/src/patient/pages/doctor/siteShare/index.ts new file mode 100644 index 0000000..21517b8 --- /dev/null +++ b/src/patient/pages/doctor/siteShare/index.ts @@ -0,0 +1,313 @@ +const app = getApp() + +Component({ + properties: { + // 省份名称 + pname: { + type: String, + value: '', + }, + // 省份ID + pid: { + type: String, + value: '', + }, + // 城市名称 + cname: { + type: String, + value: '', + }, + // 城市ID + cid: { + type: String, + value: '', + }, + }, + observers: { + show(newVal: boolean) { + this.triggerEvent('show', newVal) + }, + }, + data: { + show: false, + word: '', + imageUrl: app.globalData.imageUrl, + Timestamp: app.globalData.Timestamp, + + active: 0, + ProvinceName: '', + ProvinceId: '', + CityName: '', + CityId: '', + proList: { + A: [ + { + name: '安徽省', + code: '340000', + }, + { + name: '澳门特别行政区', + code: '820000', + }, + ], + B: [ + { + name: '北京市', + code: '110000', + }, + ], + C: [ + { + name: '重庆市', + code: '500000', + }, + ], + F: [ + { + name: '福建省', + code: '350000', + }, + ], + G: [ + { + name: '甘肃省', + code: '620000', + }, + { + name: '广东省', + code: '440000', + }, + { + name: '广西壮族自治区', + code: '450000', + }, + { + name: '贵州省', + code: '520000', + }, + ], + H: [ + { + name: '海南省', + code: '460000', + }, + { + name: '河北省', + code: '130000', + }, + { + name: '河南省', + code: '410000', + }, + { + name: '黑龙江省', + code: '230000', + }, + { + name: '湖北省', + code: '420000', + }, + { + name: '湖南省', + code: '430000', + }, + ], + J: [ + { + name: '吉林省', + code: '220000', + }, + { + name: '江苏省', + code: '320000', + }, + { + name: '江西省', + code: '360000', + }, + ], + L: [ + { + name: '辽宁省', + code: '210000', + }, + ], + N: [ + { + name: '宁夏回族自治区', + code: '640000', + }, + { + name: '内蒙古自治区', + code: '150000', + }, + ], + Q: [ + { + name: '青海省', + code: '630000', + }, + ], + S: [ + { + name: '山东省', + code: '370000', + }, + { + name: '山西省', + code: '140000', + }, + { + name: '陕西省', + code: '610000', + }, + { + name: '上海市', + code: '310000', + }, + { + name: '四川省', + code: '510000', + }, + ], + T: [ + { + name: '天津市', + code: '120000', + }, + { + name: '台湾省', + code: '710000', + }, + ], + X: [ + { + name: '西藏自治区', + code: '540000', + }, + { + name: '新疆维吾尔自治区', + code: '650000', + }, + { + name: '香港特别行政区', + code: '810000', + }, + ], + Y: [ + { + name: '云南省', + code: '530000', + }, + ], + Z: [ + { + name: '浙江省', + code: '330000', + }, + ], + }, + area: [] as any, + range: [], + + scrollIntoView0: '', + scrollIntoView1: '', + }, + methods: { + handleShow() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTVISITMAPDIRECTSHARE' }) + this.setData({ + show: true, + ProvinceName: this.data.pname || '', + ProvinceId: this.data.pid || '', + CityName: this.data.cname || '', + CityId: this.data.cid || '', + + scrollIntoView0: this.data.pid || '', + scrollIntoView1: this.data.cid || '', + }) + this.getArea() + }, + getArea() { + wx.ajax({ + method: 'GET', + url: '/js/area.json', + isJSON: true, + }).then((res) => { + this.setData({ + area: res, + }) + this.getRangeList() + }) + }, + handleItem(e: any) { + const { code, name } = e.currentTarget.dataset + this.setData({ + ProvinceId: code, + ProvinceName: name, + CityId: '', + CityName: '', + }) + this.getRangeList() + }, + handleChangeCity(e: any) { + const { code, name } = e.currentTarget.dataset + this.setData({ + CityId: code, + CityName: name, + }) + }, + handleShare() { + this.setData({ + show: false, + }) + this.triggerEvent('ok', { + ProvinceName: this.data.ProvinceName, + ProvinceId: this.data.ProvinceId, + CityName: this.data.CityName, + CityId: this.data.CityId, + }) + }, + handleSelect(e) { + const { id } = e.currentTarget.dataset + this.setData({ + word: id, + scrollIntoView0: id, + }) + }, + getRangeList() { + const { area, ProvinceId } = this.data + if (!ProvinceId) return + const range = area.filter((item: any) => item.value == ProvinceId)[0].children + this.setData({ + range, + active: 1, + scrollIntoView0: '', + scrollIntoView1: `id${this.data.CityId}`, + }) + }, + handleProvince() { + this.setData({ + active: 0, + scrollIntoView0: this.data.word || `id${this.data.ProvinceId}`, + scrollIntoView1: '', + }) + }, + handleCity() { + const { ProvinceId } = this.data + if (!ProvinceId) { + wx.showToast({ + title: '请先选择省份', + icon: 'none', + }) + return + } + this.getRangeList() + }, + handleClose() { + this.setData({ + show: false, + }) + }, + }, +}) diff --git a/src/patient/pages/doctor/siteShare/index.wxml b/src/patient/pages/doctor/siteShare/index.wxml new file mode 100644 index 0000000..ba130ae --- /dev/null +++ b/src/patient/pages/doctor/siteShare/index.wxml @@ -0,0 +1,87 @@ + + + + + + + 选择地区后分享给好友 + 好友可直接查看分享地区的医院或药店 + + + {{ProvinceName || '请选择省份'}} + + + + {{CityName || '请选择城市'}} + + + 分享 + + + + + + {{item.label}} + + + + + + + + {{index}} + + + + + + + + + {{index===0 ? key : ''}} + {{item.name}} + + + + + + + + + diff --git a/src/patient/pages/doctorDetail/index.json b/src/patient/pages/doctorDetail/index.json new file mode 100644 index 0000000..70c331f --- /dev/null +++ b/src/patient/pages/doctorDetail/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "navBar": "/components/zd-navBar/navBar" + } +} diff --git a/src/patient/pages/doctorDetail/index.scss b/src/patient/pages/doctorDetail/index.scss new file mode 100644 index 0000000..0d5f2ac --- /dev/null +++ b/src/patient/pages/doctorDetail/index.scss @@ -0,0 +1,144 @@ +page { + background: #f2f4f5; + padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); +} +.page { + min-height: 100vh; + .container { + margin: 160rpx 30rpx 0; + padding: 0 30rpx 40rpx; + background: #fff linear-gradient(to top, #ffffff 0%, #e8f0f1 100%) no-repeat top center/100% 200rpx; + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .avatar { + margin-top: -50rpx; + width: 128rpx; + height: 128rpx; + .avatar-user { + width: 100%; + height: 100%; + border-radius: 50%; + } + } + .name { + margin: -55rpx 0 0 150rpx; + font-size: 40rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + line-height: 1; + } + .card { + margin-top: 52rpx; + padding: 32rpx; + background: #ffffff; + box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(40, 48, 49, 0.04); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #f8f9f9; + .content { + display: flex; + gap: 8rpx; + align-items: start; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + line-height: 1; + .tag { + flex-shrink: 0; + padding: 4rpx 12rpx; + font-size: 22rpx; + color: rgba(229, 154, 41, 1); + border-radius: 8rpx; + background-color: rgba(229, 154, 41, 0.29); + } + } + .c-row { + margin-top: 32rpx; + display: flex; + gap: 12rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + line-height: 1; + .icon { + flex-shrink: 0; + width: 32rpx; + height: 32rpx; + } + .site-num { + margin-top: 10rpx; + flex-shrink: 0; + font-size: 24rpx; + color: #9b9ea6; + } + } + } + .row { + margin-top: 32rpx; + .r-title { + width: 128rpx; + height: 32rpx; + } + .r-content { + margin-top: 16rpx; + font-size: 28rpx; + color: rgba(154, 161, 163, 1); + } + } + } + .invite { + padding: 36rpx 30rpx 36rpx 168rpx; + margin: 24rpx 30rpx 0; + display: flex; + align-items: center; + justify-content: space-between; + border-radius: 24rpx; + border: 2rpx solid #ffffff; + .wrap { + .title { + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + } + .content { + font-size: 28rpx; + color: rgba(154, 161, 163, 1); + } + } + .btn { + width: 198rpx; + height: 64rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + background: #62bed0; + border-radius: 136rpx 136rpx 136rpx 136rpx; + } + } + .list { + margin: 24rpx 30rpx 0; + .list-item { + padding: 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + background: #ffffff; + border-radius: 24rpx 24rpx 24rpx 24rpx; + .left { + display: flex; + gap: 20rpx; + align-items: center; + .icon { + width: 48rpx; + height: 48rpx; + } + .name { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + } + .more { + color: #d4d9da; + font-size: 32rpx; + } + } + } +} diff --git a/src/patient/pages/doctorDetail/index.ts b/src/patient/pages/doctorDetail/index.ts new file mode 100644 index 0000000..115e7cf --- /dev/null +++ b/src/patient/pages/doctorDetail/index.ts @@ -0,0 +1,150 @@ +const app = getApp() + +Page({ + data: { + id: '', + detail: {} as any, + LNG: '' as number | string, + LAT: '' as number | string, + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }, + onLoad(options) { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { top, bottom } = SystemInfo.capsulePosition + this.setData({ + top, + bottom, + }) + } + app.waitLogin().then((_res) => { + this.setData({ + id: options.id, + }) + this.handleToggleSite() + }) + }, + handleToggleSite() { + const that = this + if (!this.data.LNG) { + wx.getSetting({ + success(res) { + if ( + res.authSetting['scope.userFuzzyLocation'] != undefined && + res.authSetting['scope.userFuzzyLocation'] == true + ) { + //获取当前位置 + that.getFuzzyLocation() + } else if (res.authSetting['scope.userFuzzyLocation'] == undefined) { + //获取当前位置 + that.getFuzzyLocation() + } else { + wx.showModal({ + title: '请求授权当前位置', + content: '需要获取您的地理位置,请确认授权', + confirmColor: '#cf5375', + success(res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: '拒绝授权', + icon: 'none', + duration: 1000, + }) + that.getFuzzyLocation() + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success(res) { + if (res.authSetting['scope.userFuzzyLocation'] == true) { + that.getFuzzyLocation() + } else { + that.getFuzzyLocation() + } + }, + }) + } + }, + }) + } + }, + }) + } else { + that.setData({ + LNG: '', + LAT: '', + }) + this.getDetail() + } + }, + getFuzzyLocation() { + const that = this + wx.getFuzzyLocation({ + success(res) { + that.setData({ + LNG: res.longitude, + LAT: res.latitude, + }) + that.getDetail() + }, + fail(_err) { + that.getDetail() + }, + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=xd/doctor/detail', + data: { + Id: this.data.id, + lng: this.data.LNG, + lat: this.data.LAT, + }, + }).then((res) => { + let weekName = '' + if (res.ClinicType == 2) { + weekName = res.Clinic + } else { + weekName = (res.Clinic ? res.Clinic : []) + .map((subItem: { weekday: string | number; timeType: string | number }) => { + const week = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] + const timeDay = { 1: '上午', 2: '下午' } + return `${week[Number(subItem.weekday) - 1]}${timeDay[subItem.timeType]}` + }) + .join(',') + } + this.setData({ + detail: { + ...res, + weekName, + }, + }) + }) + }, + handlePhone() { + const { detail } = this.data + wx.makePhoneCall({ + phoneNumber: detail.Telephone, + }) + }, + handleOpenMap() { + const { + detail: { hospital }, + } = this.data + wx.openLocation({ + latitude: hospital.LAT, + longitude: hospital.LNG, + name: hospital.Name, + address: `${hospital.ProvinceName}${hospital.CityName}${hospital.AreaName}${hospital.Address}`, + }) + }, + handleBack() { + wx.navigateBack() + }, + onPageScroll() {}, +}) diff --git a/src/patient/pages/doctorDetail/index.wxml b/src/patient/pages/doctorDetail/index.wxml new file mode 100644 index 0000000..579d230 --- /dev/null +++ b/src/patient/pages/doctorDetail/index.wxml @@ -0,0 +1,43 @@ + + + + + + + {{detail.Name}} + + + {{detail.hospital.Name}} + + {{detail.hospital.HospitalClassificationName}}{{detail.hospital.HospitalLevelName}} + + + + + + {{detail.hospital.ProvinceName}}{{detail.hospital.CityName}}{{detail.hospital.CountyName}}{{detail.hospital.Address}} + {{detail.hospital.dist}} + + + + + {{ detail.Telephone }} + + + + + {{detail.Introduce}} + + + + {{detail.weekName}} + + + diff --git a/src/patient/pages/doctorDetailBak/index.json b/src/patient/pages/doctorDetailBak/index.json new file mode 100644 index 0000000..4ae25c9 --- /dev/null +++ b/src/patient/pages/doctorDetailBak/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index" + } +} diff --git a/src/patient/pages/doctorDetailBak/index.scss b/src/patient/pages/doctorDetailBak/index.scss new file mode 100644 index 0000000..19c7bb2 --- /dev/null +++ b/src/patient/pages/doctorDetailBak/index.scss @@ -0,0 +1,116 @@ +.page { + background-color: #fafafa; + + .card { + margin: 32rpx 30rpx 32rpx; + padding: 0 32rpx 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + .c-header { + display: flex; + .avatar { + margin-top: -60rpx; + margin-right: 18rpx; + flex-shrink: 0; + width: 140rpx; + height: 140rpx; + border-radius: 50%; + } + .wrap { + padding: 20rpx 0 0; + .name { + font-size: 44rpx; + color: #484848; + } + } + } + .hostipal { + margin-top: 32rpx; + padding: 32rpx; + background-color: #f7f6f6; + border-radius: 20rpx; + .title { + display: flex; + align-items: center; + .name { + font-size: 28rpx; + color: #484848; + word-break: break-all; + line-height: 42rpx; + } + .tag { + flex-shrink: 0; + display: inline-block; + margin-left: 12rpx; + padding: 6rpx 12rpx; + font-size: 22rpx; + line-height: 1; + color: #ffffff; + background: #ffc137; + border-radius: 8rpx; + } + } + .content { + margin-top: 16rpx; + display: flex; + align-items: center; + .inner { + flex: 1; + .site { + flex: 1; + font-size: 24rpx; + color: #9b9ea6; + } + .site-num { + flex-shrink: 0; + font-size: 24rpx; + color: #9b9ea6; + } + } + .options { + flex-shrink: 0; + .icon { + padding: 8rpx; + flex-shrink: 0; + margin-left: 14rpx; + width: 30rpx; + height: 30rpx; + background: #ffffff; + border-radius: 50%; + box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.08); + } + } + } + } + .content { + margin-top: 32rpx; + .row { + margin-top: 16rpx; + display: flex; + align-items: flex-start; + .tag { + margin-right: 16rpx; + flex-shrink: 0; + padding: 8rpx 16rpx; + font-size: 24rpx; + color: #e04775; + line-height: 1; + background: #FCF2F6; + border-radius: 8rpx; + border: 2rpx solid #e04775; + } + .p { + font-size: 28rpx; + color: #484848; + &.ellipsis { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + } + } + } + } +} diff --git a/src/patient/pages/doctorDetailBak/index.ts b/src/patient/pages/doctorDetailBak/index.ts new file mode 100644 index 0000000..d684e45 --- /dev/null +++ b/src/patient/pages/doctorDetailBak/index.ts @@ -0,0 +1,144 @@ +const app = getApp(); + +Page({ + data: { + id: "", + detail: {} as any, + LNG: "" as number | string, + LAT: "" as number | string, + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }, + onLoad(options) { + app.waitLogin().then((_res) => { + this.setData({ + id: options.id, + }); + this.handleToggleSite(); + }); + }, + handleToggleSite() { + const that = this; + if (!this.data.LNG) { + wx.getSetting({ + success(res) { + if ( + res.authSetting["scope.userFuzzyLocation"] != undefined && + res.authSetting["scope.userFuzzyLocation"] == true + ) { + //获取当前位置 + that.getFuzzyLocation(); + } else if (res.authSetting["scope.userFuzzyLocation"] == undefined) { + //获取当前位置 + that.getFuzzyLocation(); + } else { + wx.showModal({ + title: "请求授权当前位置", + content: "需要获取您的地理位置,请确认授权", + confirmColor: "#cf5375", + success: function (res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: "拒绝授权", + icon: "none", + duration: 1000, + }); + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success: function (res) { + if (res.authSetting["scope.userFuzzyLocation"] == true) { + // wx.showToast({ + // title: '授权成功', + // icon: 'success', + // duration: 1000 + // }) + //再次授权,调用wx.getLocation的API + that.getFuzzyLocation(); + } else { + // wx.showToast({ + // title: '授权失败', + // icon: 'none', + // duration: 1000 + // }) + } + }, + }); + } + }, + }); + } + }, + }); + } else { + that.setData({ + LNG: "", + LAT: "", + }); + this.getDetail(); + } + }, + getFuzzyLocation() { + const that = this; + wx.getFuzzyLocation({ + success(res) { + console.log(res); + that.setData({ + LNG: res.longitude, + LAT: res.latitude, + }); + that.getDetail(); + }, + fail(err) { + console.log(err); + }, + }); + }, + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=xd/doctor/detail", + data: { + Id: this.data.id, + lng: this.data.LNG, + lat: this.data.LAT, + }, + }).then((res) => { + this.setData({ + detail: { + ...res, + weekName: (res.Clinic ? res.Clinic : []).map((subItem: { weekday: string | number; timeType: string | number }) => { + const week = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]; + const timeDay = { 1: "上午", 2: "下午" }; + return `${week[Number(subItem.weekday)-1]}${timeDay[subItem.timeType]}`; + }).join(","), + }, + }); + }); + }, + handlePhone() { + const { detail } = this.data; + wx.makePhoneCall({ + phoneNumber: detail.Telephone, + }); + }, + handleOpenMap() { + const { + detail: { hospital }, + } = this.data; + wx.openLocation({ + latitude: hospital.LAT, + longitude: hospital.LNG, + name: hospital.Name, + address:`${hospital.ProvinceName}${hospital.CityName}${hospital.AreaName}${hospital.Address}` + }); + }, + handleBack() { + wx.navigateBack(); + }, + onPageScroll() {}, +}); diff --git a/src/patient/pages/doctorDetailBak/index.wxml b/src/patient/pages/doctorDetailBak/index.wxml new file mode 100644 index 0000000..26443d8 --- /dev/null +++ b/src/patient/pages/doctorDetailBak/index.wxml @@ -0,0 +1,45 @@ + + + + + + + + {{detail.Name}} + + + + + {{detail.hospital.Name}} + + {{detail.hospital.HospitalClassificationName}}{{detail.hospital.HospitalLevelName}} + + + + + + {{detail.hospital.ProvinceName}}{{detail.hospital.CityName}}{{detail.hospital.CountyName}}{{detail.hospital.Address}} + + {{detail.hospital.dist}} + + + + + + + + + + 医生简介 + {{detail.Introduce}} + + + 出诊时间 + {{detail.weekName}} + + + + diff --git a/src/patient/pages/drugRecord/index.json b/src/patient/pages/drugRecord/index.json new file mode 100644 index 0000000..e734160 --- /dev/null +++ b/src/patient/pages/drugRecord/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "用药记录", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "uploadFile": "/components/uploadFile/index", + "toast": "/components/toast/index" + } +} diff --git a/src/patient/pages/drugRecord/index.scss b/src/patient/pages/drugRecord/index.scss new file mode 100644 index 0000000..7b3d47d --- /dev/null +++ b/src/patient/pages/drugRecord/index.scss @@ -0,0 +1,147 @@ +.page { + .page-container { + padding-bottom: 80rpx; + .page-title { + text-align: center; + font-size: 56rpx; + color: #333333; + font-weight: bold; + } + .page-sub-title { + margin-top: 16rpx; + text-align: center; + font-size: 28rpx; + color: #aaaaaa; + } + .container { + margin: 32rpx 48rpx; + padding: 50rpx 64rpx; + background: #f6f6f6; + border-radius: 24rpx; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border: 2rpx solid rgba(224, 71, 117, 0.25); + .tip { + margin-bottom: 28rpx; + position: relative; + text-align: center; + font-size: 24rpx; + color: #aaaaaa; + &::before { + position: absolute; + left: 0; + top: 16rpx; + content: ""; + width: 153rpx; + height: 0rpx; + border: 2rpx solid #dddddd; + } + &::after { + position: absolute; + right: 0; + top: 16rpx; + content: ""; + width: 153rpx; + height: 0rpx; + border: 2rpx solid #dddddd; + } + } + .row { + margin-bottom: 56rpx; + .r-title { + font-size: 28rpx; + color: #0b184f; + font-weight: bold; + .required { + color: #25d9c8; + } + } + .date { + margin-top: 16rpx; + background: #f2f2f2; + border-radius: 24rpx; + border: 1rpx solid #cccccc; + .picker-content { + padding: 24rpx 27rpx; + display: flex; + .input { + flex: 1; + } + .more { + color: #cccccc; + } + } + } + .select { + margin-top: 16rpx; + display: flex; + .box { + margin-right: 16rpx; + flex-shrink: 0; + width: 88rpx; + height: 88rpx; + text-align: center; + line-height: 88rpx; + font-size: 36rpx; + color: #24d8c8; + border-radius: 12rpx; + box-sizing: border-box; + border: 1rpx solid #25d9c8; + &.active { + background-color: #24d8c8; + color: #fff; + } + } + .input { + height: 88rpx; + font-size: 36rpx; + color: #999999; + background: #f2f2f2; + border-radius: 12rpx; + text-align: center; + border: 1rpx solid #cccccc; + } + } + .upload { + margin-top: 16rpx; + .upload-container { + padding: 22rpx 20rpx; + text-align: center; + background: rgba(36, 216, 200, 0.05); + border-radius: 24rpx; + border: 1rpx dashed #24d8c8; + .icon { + width: 78rpx; + height: 84rpx; + } + .name { + margin-top: 8rpx; + font-size: 22rpx; + color: #999999; + } + } + } + .textarea { + margin-top: 16rpx; + padding: 26rpx; + width: 100%; + height: 238rpx; + background: #f2f2f2; + border-radius: 24rpx; + box-sizing: border-box; + border: 1rpx solid #cccccc; + } + } + } + .btn { + margin: 34rpx 64rpx; + height: 88rpx; + background: #24d8c8; + border-radius: 24rpx; + text-align: center; + line-height: 88rpx; + font-size: 34rpx; + color: #FFFFFF; + font-weight: bold; + } + } +} diff --git a/src/patient/pages/drugRecord/index.ts b/src/patient/pages/drugRecord/index.ts new file mode 100644 index 0000000..c778a11 --- /dev/null +++ b/src/patient/pages/drugRecord/index.ts @@ -0,0 +1,124 @@ +const app = getApp() +const dayjs = require('dayjs') + +Page({ + data: { + id: '', + disabled: false, + + bottom: 0, + InjectionDate: '', + InjectionBottles: '', + Remark: '', + fileList: [], + + startDate: '2023-06-01', + endDate: dayjs().format('YYYY-MM-DD'), + + toastShow: false, + toastType: 'adlProgresss', + toastParams: {} as any, + }, + onLoad(options) { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + this.setData({ + id: options.id, + disabled: Boolean(options.id), + }) + if (options.id) { + app.waitLogin().then((res) => { + this.getDetail() + }) + } + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=xd/medication/view', + data: { + Id: this.data.id, + }, + }).then((res) => { + this.setData({ + InjectionDate: res.InjectionDate, + InjectionBottles: res.InjectionBottles, + Remark: res.Remark, + }) + }) + }, + handleSelect(e) { + const { value } = e.currentTarget.dataset + this.setData({ + InjectionBottles: value, + }) + }, + handleSubmit() { + const that = this + const { id, InjectionDate, InjectionBottles, Remark } = this.data + let toast = '' + if (!InjectionBottles) { + toast = '请选择此次注射瓶数' + } + if (!InjectionDate) { + toast = '请选择注射日期' + } + if (toast) { + wx.showToast({ + icon: 'none', + title: toast, + }) + return + } + const url = id ? '?r=xd/medication/update' : '?r=xd/medication/add' + wx.ajax({ + method: 'POST', + url, + data: { + Id: id, + InjectionDate, + InjectionBottles, + Remark, + }, + }).then((res) => { + if (res.ScoreInfo) { + this.setData({ + toastShow: true, + toastType: Array.isArray(res.ScoreInfo) ? 'drugProgresssEnd' : 'drugProgresss', + toastParams: { + ...res.ScoreInfo, + Records: res.ScoreInfo.Records?.reverse(), + }, + }) + wx.removeStorageSync('adlResultInfo') + } else { + wx.showToast({ + title: '提交成功', + icon: 'none', + success() { + setTimeout(() => { + that.handleBack() + }, 2000) + }, + }) + } + }) + }, + handleToastOk() { + this.handleToastCancel() + }, + handleToastCancel() { + this.setData({ + toastShow: false, + }) + this.handleBack() + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/patient/pages/drugRecord/index.wxml b/src/patient/pages/drugRecord/index.wxml new file mode 100644 index 0000000..d9d859f --- /dev/null +++ b/src/patient/pages/drugRecord/index.wxml @@ -0,0 +1,59 @@ + + + + {{disabled ? '编辑':'录入'}}信息 + 记录您的每次注射 生成您的专属健康档案 + + 请填入以下信息 + + + * + 注射日期 + + + + + + + + + + + + + * + 此次注射瓶数 + + + 1 + 2 + 3 + 4 + + + + + 其它备注 + + + + 提交记录 + + + + diff --git a/src/patient/pages/enterInfo/index.json b/src/patient/pages/enterInfo/index.json new file mode 100644 index 0000000..ffc6647 --- /dev/null +++ b/src/patient/pages/enterInfo/index.json @@ -0,0 +1,12 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "disableSwipeBack": true, + "usingComponents": { + "loginNavbar": "/components/loginNavbar/index", + "pageNavbar": "/components/pageNavbar/index", + "van-icon": "@vant/weapp/icon/index", + "van-divider": "@vant/weapp/divider/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/patient/pages/enterInfo/index.scss b/src/patient/pages/enterInfo/index.scss new file mode 100644 index 0000000..78ad38d --- /dev/null +++ b/src/patient/pages/enterInfo/index.scss @@ -0,0 +1,230 @@ +.page { + min-height: 100vh; + position: relative; + box-sizing: border-box; + background-color: #fff; + .bg { + width: 100%; + } + .page-container { + padding-bottom: 180rpx; + position: absolute; + width: 100%; + top: 0; + left: 0; + display: flex; + flex-direction: column; + .navbar { + flex-shrink: 0; + } + .title { + margin-top: 86rpx; + font-size: 56rpx; + color: #333333; + font-weight: bold; + text-align: center; + } + .content { + margin: 86rpx auto 0; + padding: 40rpx 64rpx 0; + width: 654rpx; + box-sizing: border-box; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border: 2rpx solid rgba(224, 71, 117, 0.25); + border-radius: 24rpx; + .switch { + margin-bottom: 40rpx; + display: flex; + gap: 22rpx; + justify-content: space-between; + .item { + padding: 19rpx 19rpx 16rpx; + flex: 1; + background: #f2f2f2; + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 1px solid #d2d2d2; + text-align: center; + .icon { + width: 152rpx; + height: 90rpx; + } + .name { + margin-top: 12rpx; + font-size: 28rpx; + color: #999999; + line-height: 32rpx; + } + &.active { + background-color: #ffffff; + border-color: #cf5375; + .name { + color: #cf5375; + } + } + } + } + .divider { + font-size: 24rpx; + color: #aaaaaa; + } + .row { + margin-bottom: 40rpx; + display: flex; + flex-wrap: wrap; + justify-content: space-between; + &.row-age { + display: grid; + grid-template-columns: repeat(3, 1fr); + } + .picker { + flex: 1; + padding: 24rpx 32rpx; + font-size: 28rpx; + color: #999999; + background: #f2f2f2; + border: 2rpx solid #cccccc; + border-radius: 24rpx; + .select { + display: flex; + justify-content: space-between; + align-items: center; + .icons { + display: flex; + align-items: center; + .required { + width: 12rpx; + height: 12rpx; + border-radius: 50%; + background: #e04775; + margin-right: 20rpx; + } + } + .select-content { + } + } + } + .input { + flex: 1; + padding: 24rpx 32rpx; + height: 40rpx; + font-size: 32rpx; + color: #333; + background: #f2f2f2; + border: 2rpx solid #cccccc; + border-radius: 24rpx; + } + .item { + padding: 12rpx 24rpx; + opacity: 1; + border: 2rpx solid #cccccc; + font-size: 28rpx; + color: #999999; + display: flex; + align-items: center; + justify-content: center; + border-radius: 12rpx; + background: linear-gradient(90deg, #fff 0%, #f9f9f9 100%); + .icon { + width: 64rpx; + height: 64rpx; + } + &.active { + color: #e04775; + background: linear-gradient(90deg, #fff 0%, #f9f9f9 100%); + border-color: #e04775; + } + } + .input-required { + display: flex; + justify-content: space-between; + align-items: center; + &::after { + margin-right: 60rpx; + content: ''; + width: 12rpx; + height: 12rpx; + border-radius: 50%; + background: #e04775; + } + } + .age-item { + margin-bottom: 24rpx; + width: 160rpx; + height: 88rpx; + white-space: nowrap; + font-size: 28rpx; + color: #999999; + display: flex; + align-items: center; + justify-content: center; + border-radius: 12rpx; + box-sizing: border-box; + border: 2rpx solid #d2d2d2; + &.active { + color: #e04775; + border-color: #e04775; + } + } + } + .tip { + margin-top: -26rpx; + font-size: 24rpx; + line-height: 40rpx; + color: #cf5375; + } + } + } + .footer { + position: fixed; + left: 0; + bottom: 40rpx; + width: calc(100% - 96rpx); + flex-shrink: 0; + margin: 0 48rpx; + box-sizing: border-box; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 30rpx; + } + .next { + flex: 1; + text-align: center; + height: 88rpx; + line-height: 88rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + background-color: #e04775; + color: #fff; + } + } +} + +.popup { + .popup-title { + display: flex; + justify-content: space-between; + padding: 20rpx 40rpx; + font-size: 32rpx; + .clsoe { + color: #7f7f7f; + } + .sure { + color: #22c065; + } + } + .popup-picker { + .picker-col { + padding: 10rpx 30rpx; + font-size: 28rpx; + line-height: 40rpx; + box-sizing: border-box; + display: flex; + align-items: center; + } + } +} diff --git a/src/patient/pages/enterInfo/index.ts b/src/patient/pages/enterInfo/index.ts new file mode 100644 index 0000000..25e91c8 --- /dev/null +++ b/src/patient/pages/enterInfo/index.ts @@ -0,0 +1,153 @@ +import dayjs from 'dayjs' +const app = getApp() + +Page({ + data: { + relationType: '1', + name: '', + gender: '', + birth: '', + ageRange: '', + diagnosisTime: '', + diagnoseType: '', + + diagnoseTypeShow: false, + DiagnoseType: app.globalData.DiagnoseType, + diagnoseTypeIndex: '', + diagnoseTypeName: '', + selectDiagnoseTypeIndex: '0', + + currentDate: dayjs().format('YYYY-MM'), + submiting: false, + + proces: '0', + }, + onLoad(options) { + this.setData({ + pagePath: options.page, + proces: options.proces, + }) + app.waitLogin({ isReg: false, loginPage: true }).then(() => { + app.getUserInfo(this, true, (userInfo) => { + this.setData({ + relationType: userInfo.RelationType || '1', + name: userInfo.PatientName, + gender: userInfo.Gender, + ageRange: userInfo.AgeRange, + }) + }) + app.zdMpBehavior({ PageName: 'PG_PATIENTINFOENTRY' }) + }) + }, + handleRelationType(e: WechatMiniprogram.CustomEvent) { + const { id } = e.currentTarget.dataset + this.setData({ + relationType: id, + }) + }, + handleGender(e: WechatMiniprogram.CustomEvent) { + const { id } = e.currentTarget.dataset + this.setData({ + gender: id, + }) + }, + handleSelectAge(e: WechatMiniprogram.CustomEvent) { + const { id } = e.currentTarget.dataset + this.setData({ + ageRange: id, + }) + }, + bindChangeDate(e: WechatMiniprogram.CustomEvent) { + const { key } = e.currentTarget.dataset + this.setData({ + [key]: e.detail.value, + }) + }, + handleDiagnoseTypeSave() { + const rangeIndex = this.data.selectDiagnoseTypeIndex + const { DiagnoseType } = this.data + const { id, name } = DiagnoseType[rangeIndex] + this.setData({ + diagnoseTypeIndex: rangeIndex, + diagnoseTypeName: name, + diagnoseType: id, + }) + this.handleDiagnoseTypeShow() + }, + handleDiagnoseTypeShow() { + this.setData({ + diagnoseTypeShow: !this.data.diagnoseTypeShow, + }) + }, + bindChange(e: WechatMiniprogram.CustomEvent) { + const rangeIndex = e.detail.value[0] + this.setData({ + selectDiagnoseTypeIndex: rangeIndex, + }) + }, + handleSubmit() { + if (this.data.submiting) return + app.zdMpBehavior({ PageName: 'BTN_PATIENTINFONEXT' }) + const { name, gender, ageRange, relationType } = this.data + const { registrationSource, registChannel, regBusinessId, WorkerId, IsAliQiWei } = app.globalData + const { doctorId, inviteChan } = app.globalData.scene + let toast = '' + // if (!diagnosisTime) toast = "确诊时间不能为空"; + // if (!birth) toast = "出生日期不能为空"; + if (!gender) toast = '请选择性别' + if (!ageRange) toast = '请选择年龄范围' + if (!name) toast = '姓名不能为空' + if (toast) { + wx.showToast({ title: toast, icon: 'none' }) + return + } + + const backPage = app.globalData.backPage + const navUrl = + typeof backPage === 'string' && backPage.includes('liveResult') ? backPage : '/pages/certReslove/index' + + this.setData({ + submiting: true, + }) + wx.ajax({ + method: 'POST', + url: '?r=xd/account/reg', + data: { + name, + gender, + ageRange, + // birth, + // diagnoseType, + // diagnosisTime, + relationType, + registrationSource, + registChannel, + regBusinessId, + WorkerId, + inviteDoctorId: doctorId, + inviteChannel: inviteChan, + IsAliQiWei, + }, + }) + .then((_res) => { + app.getUserInfo(this, true, () => { + wx.reLaunch({ + url: navUrl, + }) + this.setData({ + submiting: false, + }) + }) + }) + .catch(() => { + this.setData({ + submiting: false, + }) + }) + }, + handleBack() { + wx.navigateBack() + }, +}) + +export {} diff --git a/src/patient/pages/enterInfo/index.wxml b/src/patient/pages/enterInfo/index.wxml new file mode 100644 index 0000000..1cbf934 --- /dev/null +++ b/src/patient/pages/enterInfo/index.wxml @@ -0,0 +1,170 @@ + + + + + 录入信息 + + + 选择身份 + + + + + + + + 患者本人 + + + + + 患者亲友 + + + + + + 请您输入真实姓名,便于医生识别随访 + + 患者性别 + + + + + 女性用户 + + + + 男性用户 + + + + 患者年龄范围 + + + 18岁以下 + 18岁-44岁 + 45岁-59岁 + 60岁-74岁 + 75岁以上 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 立即进入 + + + + + + 关闭 + 保存 + + + + {{item.name}} + + + diff --git a/src/patient/pages/family/index.json b/src/patient/pages/family/index.json new file mode 100644 index 0000000..91c915e --- /dev/null +++ b/src/patient/pages/family/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "录入出血信息", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-loading": "@vant/weapp/loading/index", + "van-image": "@vant/weapp/image/index" + } +} diff --git a/src/patient/pages/family/index.scss b/src/patient/pages/family/index.scss new file mode 100644 index 0000000..47364ca --- /dev/null +++ b/src/patient/pages/family/index.scss @@ -0,0 +1,69 @@ +page { + background-color: #f9f9f9; +} +.page { + padding-bottom: 80rpx; + position: relative; + .bg { + width: 100%; + } + .page-container { + position: absolute; + top: 120px; + padding: 34rpx 60rpx; + .container { + padding: 0 40rpx 56rpx; + text-align: center; + background: #ffffff; + box-shadow: 0rpx 16rpx 32rpx 0rpx rgba(174, 181, 200, 0.25); + border-radius: 24rpx; + .author { + width: 164rpx; + height: 164rpx; + border-radius: 50%; + margin-top: -82rpx; + } + .name { + margin-top: 16rpx; + font-size: 32rpx; + color: #cf5375; + font-weight: bold; + } + .title { + margin-top: 47rpx; + font-size: 36rpx; + color: #cf5375; + font-weight: bold; + } + .content { + margin-top: 24rpx; + font-size: 28rpx; + color: #afb7cb; + } + .code { + margin-top: 20rpx; + width: 250rpx; + height: 250rpx; + border-radius: 50%; + } + .tip { + margin-top: 12rpx; + font-size: 28rxp; + color: #afb7cb; + } + } + .link { + margin-top: 64rpx; + font-size: 32rpx; + color: #cf5375; + text-align: center; + font-weight: bold; + } + .num { + margin-top: 15rpx; + text-align: center; + font-size: 28rpx; + color: #aeb7cb; + } + } +} diff --git a/src/patient/pages/family/index.ts b/src/patient/pages/family/index.ts new file mode 100644 index 0000000..03029d4 --- /dev/null +++ b/src/patient/pages/family/index.ts @@ -0,0 +1,59 @@ +const app = getApp() + +interface IMpInfo { + BindNum: number + LeftBindNum: number + PatientId: number + PatientName: string + RelationType: number + UserId: string + Avatar: string + qrCodeLoad: false +} + +Page({ + data: { + types: ['运动出血', '外伤', '疾病', '疾病', '自发出血'], + mpInfo: {} as IMpInfo, + qrCode: '', + }, + onLoad() { + app.waitLogin().then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTMYRELATIVES' }) + this.getMpInfo() + }) + }, + getMpInfo() { + wx.ajax({ + method: 'GET', + url: '?r=xd/account/mp-info', + }).then((res: IMpInfo) => { + this.setData({ + mpInfo: res, + }) + this.getQrCode() + }) + }, + getQrCode() { + this.setData({ + qrCode: `${app.globalData.url}?r=xd/account/mp-img&PatientId=${this.data.mpInfo.PatientId}&loginState=${app.globalData.loginState}`, + }) + }, + handleQrCodeLoad() { + this.setData({ + qrCodeLoad: true, + }) + }, + routerTo(e) { + const { url } = e.currentTarget.dataset + if (url === '/pages/familyList/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTFAMILYMEMBERSVIEW' }) + } + wx.navigateTo({ + url, + }) + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/patient/pages/family/index.wxml b/src/patient/pages/family/index.wxml new file mode 100644 index 0000000..db84488 --- /dev/null +++ b/src/patient/pages/family/index.wxml @@ -0,0 +1,24 @@ + + + + + + + + + 我是ID:{{mpInfo.PatientId}} + 我是ID:{{mpInfo.PatientId}}亲友 + 邀请你和我绑定亲友号 + 扫码绑定亲友号后,多个亲友号的ADL测评都将展示{{mpInfo.PatientName}}的健康数据 + + + + 请使用微信扫一扫绑定 + + + 查看我的家庭成员 + + + 还能绑定{{mpInfo.LeftBindNum || 0}}个人 + + diff --git a/src/patient/pages/familyList/index.json b/src/patient/pages/familyList/index.json new file mode 100644 index 0000000..5bdfdc9 --- /dev/null +++ b/src/patient/pages/familyList/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "录入出血信息", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "toast":"/components/toast/index" + } +} diff --git a/src/patient/pages/familyList/index.scss b/src/patient/pages/familyList/index.scss new file mode 100644 index 0000000..e87cd87 --- /dev/null +++ b/src/patient/pages/familyList/index.scss @@ -0,0 +1,77 @@ +page { + background-color: #f9f9f9; +} +.page { + position: relative; + padding-bottom: 80rpx; + .bg { + width: 100%; + } + .page-container { + position: absolute; + top: 180rpx; + padding: 34rpx 40rpx; + width: 100%; + box-sizing: border-box; + .card { + position: relative; + margin-bottom: 32rpx; + padding: 40rpx 0 0 18rpx; + border-radius: 12rpx; + border: 2rpx solid #f2f2f2; + box-shadow: 0 10rpx 10rpx #f2f2f2; + background-color: #fff; + display: flex; + align-items: flex-end; + box-sizing: border-box; + .author { + width: 150rpx; + flex-shrink: 0; + } + .inner { + padding: 0 20rpx 48rpx 20rpx; + .title { + display: flex; + align-items: center; + font-size: 36rpx; + color: #cf5375; + &.active { + padding-right: 80rpx; + } + > view, + > image { + margin-right: 40rpx; + } + font-weight: bold; + .label { + flex-shrink: 0; + font-weight: normal; + width: 80rpx; + height: 40rpx; + background: #f7e6e6; + border-radius: 8rpx; + font-size: 24rpx; + color: #eb8480; + text-align: center; + line-height: 40rpx; + } + } + .date { + margin-top: 20rpx; + font-size: 28rpx; + color: #afb7cb; + } + } + .cancel { + position: absolute; + right: 0; + top: 32rpx; + padding: 2rpx 36rpx; + font-size: 24rpx; + color: #ffffff; + background: linear-gradient(90deg, #cf5375 0%, #cf5375 100%); + border-radius: 200rpx 0rpx 0rpx 200rpx; + } + } + } +} diff --git a/src/patient/pages/familyList/index.ts b/src/patient/pages/familyList/index.ts new file mode 100644 index 0000000..9b207fe --- /dev/null +++ b/src/patient/pages/familyList/index.ts @@ -0,0 +1,79 @@ +const app = getApp(); + +Page({ + data: { + toastShow: false, + toastType: "", + // toastShow:true, + // toastType:"familyUnbind", + familyList: [], + userInfo: {}, + UserId: "", + }, + onLoad() { + app.waitLogin().then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTMYRELATIVESLIST' }) + this.getFamilyList(); + app.getUserInfo(this); + }); + }, + getFamilyList(loading = true) { + wx.ajax({ + method: "GET", + url: "?r=xd/account/relatives", + data: {}, + loading, + }).then((res) => { + this.setData({ + familyList: res, + }); + }); + }, + handleUnbind(e) { + const { id } = e.currentTarget.dataset; + this.setData({ + UserId: id, + toastShow: true, + toastType: "familyUnbind", + }); + }, + handleUnbinOk() { + const { UserId } = this.data; + this.handleUnbindCancel(); + wx.ajax({ + method: "POST", + url: "?r=xd/account/unbind-user", + data: { + UserId, + }, + loading: true, + }).then(() => { + wx.showToast({ + icon: "none", + title: "解绑成功", + success: () => { + app.getUserInfo(this, true, (_userInfo) => { + app.waitLogin().then(() => { + this.getFamilyList(false); + }); + }); + }, + }); + }); + }, + handleUnbindCancel() { + this.setData({ + toastShow: false, + toastType: "", + }); + }, + handleBack() { + wx.navigateBack({ + fail() { + wx.reLaunch({ + url: "/pages/index/index", + }); + }, + }); + }, +}); diff --git a/src/patient/pages/familyList/index.wxml b/src/patient/pages/familyList/index.wxml new file mode 100644 index 0000000..65e344c --- /dev/null +++ b/src/patient/pages/familyList/index.wxml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + ID:{{userInfo.PatientId}} + ID:{{userInfo.PatientId}}亲友 + 本人 + + 绑定时间:{{card.BindPatientTime}} + + + 解绑 + + + + + + + + diff --git a/src/patient/pages/familyScan/index.json b/src/patient/pages/familyScan/index.json new file mode 100644 index 0000000..ff5c4ee --- /dev/null +++ b/src/patient/pages/familyScan/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "录入出血信息", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/patient/pages/familyScan/index.scss b/src/patient/pages/familyScan/index.scss new file mode 100644 index 0000000..9e139c3 --- /dev/null +++ b/src/patient/pages/familyScan/index.scss @@ -0,0 +1,210 @@ +.page { + padding-bottom: 80rpx; + box-sizing: border-box; + position: relative; + height: 100vh; + .bg { + width: 100%; + height: 100vh; + filter: blur(5rpx); + } + .banner { + position: absolute; + top: 0; + left: 0; + padding: 223rpx 69rpx 64rpx; + .center { + display: flex; + align-items: flex-end; + justify-content: space-between; + > view:not(:last-of-type), + > image { + margin-right: 42rpx; + } + .icon { + width: 127rpx; + height: 142rpx; + } + .content { + .title { + font-size: 48rpx; + color: #ffffff; + font-weight: bold; + white-space: nowrap; + } + .en-title { + margin-top: 20rpx; + font-size: 36rpx; + color: #fff; + } + } + } + } + + .page-container { + position: absolute; + width: 100vw; + bottom: 0; + left: 0; + z-index: 1; + height: 76vh; + padding: 86rpx 60rpx; + box-sizing: border-box; + border-radius: 48rpx 48rpx 0 0; + box-shadow: 0 -10rpx 20rpx #afb7cb; + background-color: #fff; + .error { + text-align: center; + .icon { + width: 256rpx; + height: 256rpx; + } + .beyond { + margin-top: 66rpx; + font-size: 32rpx; + color: #495069; + font-weight: bold; + } + .repeat { + @extend .beyond; + } + .unbind { + margin-top: 32rpx; + padding: 0 60rpx; + .tip { + font-size: 36rpx; + font-weight: bold; + color: #E04775; + } + .content { + margin-top: 30rpx; + font-size: 32rpx; + color: #afb7cb; + line-height: 1.5; + .blob { + font-weight: bold; + } + } + .sure { + margin-top: 60rpx; + font-size: 36rpx; + color: #E04775; + font-weight: bold; + } + } + } + .identity-wrapper { + .title { + font-size: 36rpx; + color: #495069; + text-align: center; + font-weight: bold; + } + .identity { + margin-top: 39rpx; + display: flex; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 24rpx; + } + .item { + padding: 42rpx; + flex: 1; + text-align: center; + border-radius: 12rpx; + background-color: #f9f7fa; + .icon { + width: 122rpx; + height: 106rpx; + } + .icon-active { + display: none; + width: 122rpx; + height: 106rpx; + } + .name { + margin-top: 14rpx; + font-size: 32rpx; + color: #afb7cb; + } + } + .active { + .name { + color: #E04775; + } + .icon { + display: none; + } + .icon-active { + display: inline-block; + } + } + } + .title-second { + margin-top: 84rpx; + } + .relation { + margin-top: 37rpx; + display: flex; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 18rpx; + } + .item { + flex: 1; + padding: 51rpx 6rpx; + text-align: center; + border-radius: 12rpx; + font-size: 28rpx; + color: #E04775; + font-weight: bold; + background-color: #f9f7fa; + } + .active { + color: #fff; + background-color: #E04775; + } + } + } + .footer { + position: fixed; + left: 0; + padding: 0 48rpx; + bottom: 78rpx; + width: 100%; + box-sizing: border-box; + margin-top: 88rpx; + display: flex; + align-items: center; + justify-content: space-between; + > view:not(:last-of-type), + > button:not(:last-of-type), + > image { + margin-right: 30rpx; + } + + .cancel, + .submit { + flex: 1; + font-size: 36rpx; + font-weight: bold; + height: 80rpx; + text-align: center; + line-height: 80rpx; + border-radius: 40rpx; + } + + .cancel { + color: #fff; + background-color: #afb7cb; + } + + .submit { + color: #fff; + background-color: #E04775; + } + } + } +} diff --git a/src/patient/pages/familyScan/index.ts b/src/patient/pages/familyScan/index.ts new file mode 100644 index 0000000..29aa426 --- /dev/null +++ b/src/patient/pages/familyScan/index.ts @@ -0,0 +1,111 @@ +const app = getApp(); +import { parseScene } from "@/utils/util"; + +Page({ + data: { + PatientId: "", + RelationType: "", + resetBind: false, + reload: false, + mpPatientInfo: {}, + ignoreAgreement: {}, + userInfo: {} as any, + }, + onLoad(options) { + this.setData({ + ignoreAgreement: options.ignoreAgreement, + }); + }, + onShow() { + // const options = wx.getEnterOptionsSync(); + const scene = app.globalData.scene; + if (scene?.pId) { + this.setData({ + PatientId: scene.pId, + }); + } + app.waitLogin({ isReg: false }).then(() => { + app.getUserInfo(this, true, () => { + this.getMpPatientInfo(); + }); + }); + }, + getMpPatientInfo() { + const { UserType } = this.data.userInfo; + wx.ajax({ + method: "GET", + url: "?r=xd/account/mp-patient-info", + data: { + PatientId: this.data.PatientId, + }, + loading: true, + }).then((res) => { + let RelationType = res.HasSelf == 1 ? "2" : ""; + if (!res.PatientId) { + if (!this.data.ignoreAgreement) { + if (UserType >= 2) { + wx.navigateTo({ + url: `/pages/privacyAgreement/index?page=/pages/familyScan/index`, + }); + } else { + wx.navigateTo({ + url: `/pages/login/index?page=/pages/familyScan/index`, + }); + } + } + } + this.setData({ + mpPatientInfo: res, + RelationType: res.HasSelf ? "2" : RelationType, + reload: true, + }); + }); + }, + handleHome() { + wx.reLaunch({ + url: "/pages/index/index", + }); + }, + handleResetBind() { + this.setData({ + resetBind: true, + }); + }, + handleSwitchRType(e) { + const { type } = e.currentTarget.dataset; + this.setData({ + RelationType: type, + }); + }, + handleSubmit() { + const { PatientId, RelationType } = this.data; + if (!RelationType) { + wx.showToast({ + title: "请选择身份", + icon: "none", + }); + return; + } + + // wx.reLaunch({ + // url: "/pages/login/index", + // }); + + // return; + wx.ajax({ + method: "POST", + url: "?r=xd/account/bind-patient", + data: { + PatientId, + RelationType, + }, + loading: true, + }).then(() => { + app.getUserInfo(this, true, (userInfo) => { + wx.reLaunch({ + url: "/pages/index/index", + }); + }); + }); + }, +}); diff --git a/src/patient/pages/familyScan/index.wxml b/src/patient/pages/familyScan/index.wxml new file mode 100644 index 0000000..e83489e --- /dev/null +++ b/src/patient/pages/familyScan/index.wxml @@ -0,0 +1,85 @@ + + + + + + + + + + 当前患者账号已注销,该邀请码已失效, + + 请您重新注册账号。 + + 关闭 + + + + 您已加入ID:{{mpPatientInfo.ToBindPatientId}}的亲友号 + + 无需重复加入 + + 关闭 + + + + 当前ID:{{mpPatientInfo.ToBindPatientId}}的亲友号已绑定3个用户 + + 无法继续绑定 + + 关闭 + + + + 注意 + + 您正在扫码绑定新的患者! + 您当前已有账号: + ID:{{mpPatientInfo.PatientId}} + ID:{{mpPatientInfo.PatientId}}亲友 + + 若绑定新的患者,ID:{{mpPatientInfo.PatientId}}的记录数据(ADL测评和用药数据)您将无法管理和查看 + + 是否继续绑定? + + + + + + + + 请选择您的身份? + + + + + 本人 + + + + + 亲友 + + + + 完成 + + + + diff --git a/src/patient/pages/getUserInfo/index.json b/src/patient/pages/getUserInfo/index.json new file mode 100644 index 0000000..7c5e2d3 --- /dev/null +++ b/src/patient/pages/getUserInfo/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "我的故事", + "navigationStyle": "custom", + "disableScroll": true, + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "text-expandsion": "/components/text-expandsion/index", + "freeAudio": "/components/freeAudio/index" + } +} diff --git a/src/patient/pages/getUserInfo/index.scss b/src/patient/pages/getUserInfo/index.scss new file mode 100644 index 0000000..5d9962a --- /dev/null +++ b/src/patient/pages/getUserInfo/index.scss @@ -0,0 +1,55 @@ +page { + min-height: 100vh; + background: linear-gradient(180deg, rgba(253, 253, 253, 0.49) 0%, #fafafa 100%); + background-color: #fff; +} +.page { + width: 100%; + height: 100vh; + overflow: hidden; + background-color: #fafafa; + .page-container { + margin-top: 100rpx; + padding: 0 104rpx; + background: #fff; + height: 100vh; + border-radius: 32rpx 32rpx 0 0; + .avatar-wrapper { + width: 280rpx; + height: 280rpx; + background-color: transparent; + outline: none; + padding: 0; + overflow: visible; + &::after { + border: none; + } + .avatar { + display: block; + transform: translateY(-50%); + width: 280rpx; + height: 280rpx; + border-radius: 50%; + } + } + .tip { + margin-top: -90rpx; + text-align: center; + font-size: 36rpx; + color: #aeb6cd; + } + + .container { + display: flex; + } + .submit { + width: 100%; + text-align: center; + line-height: 84rpx; + height: 84rpx; + background-color: #023eba; + border-radius: 100rpx; + color: #fff; + } + } +} diff --git a/src/patient/pages/getUserInfo/index.ts b/src/patient/pages/getUserInfo/index.ts new file mode 100644 index 0000000..2447d76 --- /dev/null +++ b/src/patient/pages/getUserInfo/index.ts @@ -0,0 +1,77 @@ +const app = getApp(); + +Page({ + data: { + list: [], + userInfo: { + avatarUrl: "", + }, + }, + onLoad() { + const SystemInfo = app.globalSystemInfo; + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition; + this.setData({ + bottom: bottom, + }); + } + }, + onShow() { + app.waitLogin().then((_res) => { + app.getUserInfo(this, true); + }); + }, + onChooseAvatar(e) { + const { avatarUrl } = e.detail; + const that = this; + let url = `${app.globalData.upFileUrl}?r=file-service/upload-img`; + wx.showLoading({ + title: "上传中", + }); + wx.uploadFile({ + url: url, + filePath: avatarUrl, + name: "file", + success(res) { + let data = JSON.parse(res.data); + let avatarUrl = data.data.Url; + wx.ajax({ + method: "POST", + url: "?r=xd/account/update-user-img", + data: { + UserImg: decodeURI(avatarUrl), + }, + }) + .then(() => { + wx.hideLoading(); + wx.showToast({ + title: "头像更新成功!", + icon: "none", + }); + that.setData({ + ["userInfo.UserImg"]: avatarUrl, + }); + }) + .catch(() => { + wx.hideLoading(); + }); + }, + fail() { + wx.hideLoading(); + }, + }); + }, + routerTo(e) { + const { url } = e.currentTarget.dataset; + wx.navigateTo({ + url, + }); + }, + handleSubmit() { + console.log(this.data.userInfo); + }, + handleBack() { + wx.navigateBack(); + app.getUserInfo(this, true); + }, +}); diff --git a/src/patient/pages/getUserInfo/index.wxml b/src/patient/pages/getUserInfo/index.wxml new file mode 100644 index 0000000..200b269 --- /dev/null +++ b/src/patient/pages/getUserInfo/index.wxml @@ -0,0 +1,12 @@ + + + + + 点击配置头像 + + diff --git a/src/patient/pages/hospital/index.json b/src/patient/pages/hospital/index.json new file mode 100644 index 0000000..9cae1dd --- /dev/null +++ b/src/patient/pages/hospital/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "timeOut": "/components/timeOut/index" + } +} diff --git a/src/patient/pages/hospital/index.scss b/src/patient/pages/hospital/index.scss new file mode 100644 index 0000000..058b5e4 --- /dev/null +++ b/src/patient/pages/hospital/index.scss @@ -0,0 +1,196 @@ +.scroll-view{ + height: 100vh; +} +.page { + background-color: #fafafa; + .banner { + padding: 44rpx 30rpx 0; + display: flex; + align-items: center; + .hosttipat-img { + flex-shrink: 0; + width: 180rpx; + height: 180rpx; + border-radius: 24rpx; + border: 2rpx solid rgba(151, 151, 151, 0.21); + overflow: hidden; + .img { + width: 100%; + height: 100%; + } + } + .wrap { + margin-left: 24rpx; + flex: 1; + .title { + display: flex; + align-items: center; + .name { + font-size: 36rpx; + color: #484848; + word-break: break-all; + } + .tag { + flex-shrink: 0; + margin-left: 12rpx; + padding: 6rpx 12rpx; + font-size: 22rpx; + line-height: 1; + color: #ffffff; + background: #ffc137; + border-radius: 8rpx; + } + } + .content { + margin-top: 28rpx; + display: flex; + align-items: center; + justify-content: space-between; + .inner { + .site { + font-size: 24rpx; + color: #9b9ea6; + } + .site-num { + font-size: 24rpx; + color: #9b9ea6; + } + } + .options { + flex-shrink: 0; + .icon { + margin-left: 44rpx; + width: 30rpx; + height: 30rpx; + background-color: #edeeef; + border-radius: 50%; + padding: 6rpx; + } + } + } + } + } + .module { + margin-top: 64rpx; + padding: 0 30rpx; + .module-container { + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border: 1rpx solid #ebecee; + border-radius: 24rpx; + .m-title { + position: relative; + margin-bottom: 48rpx; + height: 88rpx; + background-color: #fff; + background: #ffeff4; + box-shadow: inset 0rpx 2rpx 12rpx 0rpx rgba(255, 255, 255, 0); + border-radius: 24rpx 24rpx 0rpx 0rpx; + border: 1rpx solid #efeff1; + display: flex; + align-items: center; + justify-content: center; + .m-title-img { + width: 166rpx; + height: 42rpx; + } + .m-icon1 { + position: absolute; + top: -20rpx; + left: 64rpx; + width: 20rpx; + height: 64rpx; + } + .m-icon2 { + position: absolute; + top: -20rpx; + right: 64rpx; + width: 20rpx; + height: 64rpx; + } + } + } + .new-card { + margin-bottom: 16rpx; + padding: 32rpx; + display: flex; + .avatar { + flex-shrink: 0; + width: 172rpx; + height: 172rpx; + border-radius: 24rpx; + } + .content { + flex: 1; + padding-left: 20rpx; + .name { + font-size: 32rpx; + color: #484848; + font-weight: bold; + } + .p { + margin-top: 8rpx; + font-size: 24rpx; + color: #9da0a8; + &.ellipsis { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + } + .row { + margin-top: 16rpx; + display: flex; + flex-wrap: wrap; + .tag { + margin-right: 16rpx; + margin-bottom: 10rpx; + width: 120rpx; + height: 32rpx; + background: #ffe6ee; + border-radius: 8rpx; + display: flex; + .week { + flex: 1; + font-size: 20rpx; + line-height: 32rpx; + color: #ffffff; + background-color: #e66c8e; + text-align: center; + border-radius: 8rpx 0 8rpx 8rpx; + } + .value { + flex: 1; + font-size: 20rpx; + color: #e04775; + text-align: center; + line-height: 32rpx; + } + } + .week-name { + flex: 1; + padding: 20rpx 24rpx; + background-color: rgba(253, 244, 247, 1); + border-radius: 16rpx; + font-size: 24rpx; + color: rgba(157, 160, 168, 1); + line-height: 40rpx; + .label { + margin-right: 12rpx; + display: inline-block; + font-size: 20rpx; + color: rgba(255, 255, 255, 1); + line-height: 32rpx; + padding: 0 8rpx; + background: #e04775; + border-radius: 8rpx 8rpx 8rpx 8rpx; + } + } + } + } + } + } +} diff --git a/src/patient/pages/hospital/index.ts b/src/patient/pages/hospital/index.ts new file mode 100644 index 0000000..0189cf5 --- /dev/null +++ b/src/patient/pages/hospital/index.ts @@ -0,0 +1,197 @@ +const app = getApp() + +Page({ + data: { + id: '', + detail: {} as any, + LNG: '' as number | string, + LAT: '' as number | string, + pagination: { + page: 1, + pages: 1, + count: 0, + }, + + asideOut: false, + timeToast: false, + timeToastType: '18', + timeToastParams: { + rewardScore: 0, + }, + }, + onLoad(options) { + app.waitLogin().then((_res) => { + this.setData({ + id: options.id, + }) + this.handleToggleSite() + }) + }, + handleToggleSite() { + const that = this + if (!this.data.LNG) { + wx.getSetting({ + success(res) { + if ( + res.authSetting['scope.userFuzzyLocation'] != undefined && + res.authSetting['scope.userFuzzyLocation'] == true + ) { + //获取当前位置 + that.getFuzzyLocation() + } else if (res.authSetting['scope.userFuzzyLocation'] == undefined) { + //获取当前位置 + that.getFuzzyLocation() + } else { + wx.showModal({ + title: '请求授权当前位置', + content: '需要获取您的地理位置,请确认授权', + confirmColor: '#cf5375', + success(res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: '拒绝授权', + icon: 'none', + duration: 1000, + }) + that.getDetail() + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success(res) { + if (res.authSetting['scope.userFuzzyLocation'] == true) { + wx.showToast({ + title: '授权成功', + icon: 'success', + duration: 1000 + }) + // 再次授权,调用wx.getLocation的API + that.getFuzzyLocation() + } else { + wx.showToast({ + title: '授权失败', + icon: 'none', + duration: 1000 + }) + that.getDetail() + } + }, + }) + } + }, + }) + } + }, + }) + } else { + that.setData({ + LNG: '', + LAT: '', + }) + this.getDetail() + } + }, + getFuzzyLocation() { + const that = this + wx.getFuzzyLocation({ + success(res) { + console.log(res) + that.setData({ + LNG: res.longitude, + LAT: res.latitude, + }) + that.getDetail() + }, + fail() { + that.getDetail() + }, + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=xd/hospital/detail', + data: { + Id: this.data.id, + lng: this.data.LNG, + lat: this.data.LAT, + }, + }).then((res) => { + if (res.CanGetScore) { + this.handleTimeOut(res.Id) + } + this.setData({ + detail: { + ...res, + doctors: res.doctors.map((item: any) => { + let weekName = '' + if (item.ClinicType == 2) { + weekName = item.Clinic + } else { + weekName = (JSON.parse(item.Clinic) ? JSON.parse(item.Clinic) : []).map( + (subItem: { weekday: string | number; timeType: string | number }) => { + const week = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] + const timeDay = { 1: '上午', 2: '下午' } + return { week: week[Number(subItem.weekday) - 1], timeDay: timeDay[subItem.timeType] } + }, + ) + } + return { + weekName, + ...item, + } + }), + }, + }) + }) + }, + handlePhone() { + const { detail } = this.data + wx.makePhoneCall({ + phoneNumber: detail.Telephone, + }) + }, + handleOpenMap() { + const { detail } = this.data + wx.openLocation({ + latitude: detail.LAT, + longitude: detail.LNG, + name: detail.Name, + address: `${detail.ProvinceName}${detail.CityName}${detail.CountyName}${detail.Address}`, + }) + }, + handleTimeOut(Id) { + wx.ajax({ + method: 'POST', + url: '?r=xd/score/send-score', + data: { + Type: this.data.timeToastType, + Id, + }, + }).then((res) => { + if (!Array.isArray(res)) { + this.setData({ + timeToast: true, + timeToastParams: { + rewardScore: res.rewardScore, + }, + }) + setTimeout(() => { + this.setData({ + timeToast: false, + }) + }, 3000) + } + }) + }, + routerTo(e) { + const { url } = e.currentTarget.dataset + wx.navigateTo({ + url, + }) + }, + handleBack() { + wx.navigateBack() + }, + onPageScroll() {}, +}) diff --git a/src/patient/pages/hospital/index.wxml b/src/patient/pages/hospital/index.wxml new file mode 100644 index 0000000..afc2d24 --- /dev/null +++ b/src/patient/pages/hospital/index.wxml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + {{item.Name}} + {{item.Introduce}} + + + + 出诊时间{{item.weekName}} + + + + {{wItem.week}} + {{wItem.timeDay}} + + + + + + + + + + + + diff --git a/src/patient/pages/index/index.json b/src/patient/pages/index/index.json new file mode 100644 index 0000000..9ccd05a --- /dev/null +++ b/src/patient/pages/index/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "pageNavbar": "/components/pageNavbar/index", + "van-icon": "@vant/weapp/icon/index", + "toast": "/components/toast/index", + "referralFrom": "/components/referralFrom/index" + } +} diff --git a/src/patient/pages/index/index.scss b/src/patient/pages/index/index.scss new file mode 100644 index 0000000..0d3d735 --- /dev/null +++ b/src/patient/pages/index/index.scss @@ -0,0 +1,1269 @@ +$page-margin: 40rpx; +page { + background-color: #fafafa; +} + +.page { + position: relative; + min-height: 100vh; + .bg { + margin-top: 96rpx; + width: 100%; + } + .drug-bg { + width: 100%; + } + .page-container { + position: absolute; + left: 0; + top: 0; + width: 100%; + box-sizing: border-box; + padding-bottom: 180rpx; + .user { + margin: 53rpx $page-margin 0; + display: flex; + align-items: center; + .avatar { + width: 87rpx; + height: 87rpx; + border-radius: 50%; + } + .content { + margin-left: 33rpx; + .name { + font-size: 32rpx; + color: #333333; + font-weight: bold; + line-height: 48rpx; + } + .info { + font-size: 24rpx; + color: #999999; + line-height: 48rpx; + .num { + font-size: 32rpx; + color: #333333; + font-weight: bold; + } + } + } + } + .referral { + margin: $page-margin $page-margin 0; + .referral-img { + margin-left: -20rpx; + width: calc(100% + 20rpx); + height: 234rpx; + } + } + .doctor { + margin: $page-margin $page-margin 0; + padding: 70rpx 10rpx 10rpx; + border-radius: 24rpx; + .container { + padding: 27rpx 0 27rpx 27rpx; + display: flex; + justify-content: space-between; + background: rgba(255, 255, 255, 0.95); + border-radius: 21rpx; + .avatar { + width: 104rpx; + height: 104rpx; + .a-img { + width: 100%; + height: 100%; + border-radius: 50%; + border: 3rpx solid #fff; + box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(52, 44, 46, 0.17); + } + } + .wrap { + padding: 6rpx 16rpx 0; + flex: 1; + .name-wrap { + display: flex; + .name { + position: relative; + font-size: 36rpx; + color: rgba(51, 51, 51, 1); + font-weight: bold; + display: flex; + align-items: center; + line-height: 40rpx; + .n-content { + max-width: 8em; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .bubble { + margin-left: 8rpx; + padding: 0 14rpx; + height: 30rpx; + line-height: 30rpx; + box-sizing: border-box; + text-align: center; + font-size: 22rpx; + color: rgba(255, 255, 255, 1); + background: #ee951b; + border-radius: 32rpx; + position: relative; + &::after { + position: absolute; + left: 14rpx; + bottom: -8rpx; + content: ''; + width: 0; + height: 0; + border-style: solid; + border-width: 13rpx 13rpx 0 0; + border-color: #ee951b transparent transparent transparent; + } + } + } + .icon { + margin-left: 4rpx; + margin-top: -20rpx; + display: inline-block; + width: 36rpx; + height: 24rpx; + } + } + .content { + margin-top: 16rpx; + font-size: 26rpx; + line-height: 38rpx; + color: rgba(51, 51, 51, 1); + } + .hostipal { + margin-top: 16rpx; + font-size: 28rpx; + color: #999999; + line-height: 36rpx; + overflow: hidden; + .h-content { + margin-right: 16rpx; + display: inline; + } + .tag { + display: inline-block; + padding: 4rpx 12rpx; + font-size: 22rpx; + line-height: 1; + color: #ffffff; + background: #ee951b; + line-height: 24rpx; + border-radius: 8rpx 8rpx 8rpx 8rpx; + } + } + } + .btn { + align-self: center; + width: 151rpx; + height: 44rpx; + font-size: 28rpx; + color: #cf5375; + background: linear-gradient(136deg, #ebeffe 0%, #fce3ec 100%), #ffffff; + border-radius: 420rpx 0 0 420rpx; + display: flex; + align-items: center; + justify-content: center; + } + } + &.doctor-drugs { + .container { + .btn { + color: #ffffff; + background: rgba(37, 217, 200, 1); + } + } + } + } + .banner { + margin: $page-margin; + .swiper { + width: 100%; + height: 280rpx; + .swiper-item { + display: block; + width: 100%; + height: 240rpx; + box-sizing: border-box; + border-radius: 20rpx; + .swiper-item-img { + width: 100%; + height: 100%; + } + } + + .wx-swiper-dot-active { + width: 30rpx !important; + } + + .wx-swiper-dot { + width: 9rpx; + height: 6rpx; + border-radius: 2rpx; + } + } + } + .adl { + position: relative; + margin: $page-margin; + .adl-bg { + width: 100%; + height: 240rpx; + } + .adl-container { + padding: 63rpx 40rpx 24rpx; + width: 100%; + box-sizing: border-box; + position: absolute; + top: 0; + left: 0; + .other { + .new { + position: absolute; + left: -22rpx; + top: 9rpx; + .icon { + width: 123rpx; + height: 59rpx; + } + .new-text { + position: absolute; + width: 68rpx; + height: 26rpx; + top: 13rpx; + left: 18rpx; + } + } + .adl-title { + width: 334rpx; + height: 86rpx; + } + .title { + font-size: 44rpx; + font-weight: bold; + color: #fff; + line-height: 48rpx; + .blod { + // font-size: 50rpx; + } + } + .num { + font-size: 25rpx; + line-height: 36rpx; + color: #fff; + } + .status { + margin-top: 18rpx; + padding: 0 25rpx; + display: inline-block; + font-size: 22rpx; + color: #e04775; + background-color: #fff; + border-radius: 17rpx; + } + .btn { + margin-top: 10rpx; + width: 206rpx; + height: 54rpx; + border-radius: 30rpx; + text-align: center; + line-height: 54rpx; + background: #ffffff linear-gradient(136deg, #e6edfe 0%, #fee0ea 100%); + opacity: 1; + margin-right: 20rpx; + font-size: 28rpx; + color: #cf5375; + font-weight: bold; + .icon { + width: 21rpx; + height: 21rpx; + margin-left: 9rpx; + } + } + .o-aside { + position: absolute; + top: 7rpx; + right: 0; + .badge { + width: 302rpx; + height: 233rpx; + } + } + } + } + &.adl-drugs { + .adl-container { + .other { + .title { + color: #fff; + } + .num { + color: #fff; + } + .status { + color: #24d8c8; + } + .btn { + width: 206rpx; + height: 54rpx; + background: #ffffff; + font-size: 28rpx; + color: #25d9c8; + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; + border-radius: 32rpx 32rpx 32rpx 32rpx; + .icon { + width: 21rpx; + height: 21rpx; + } + } + .o-aside { + .box { + .change { + color: #ffffff; + } + .center { + background: linear-gradient(163deg, #fcfcfc 70%, #2fdbca 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + .b-line { + background: linear-gradient(61deg, #ffffff 30%, #f08f35 49%, #e55273 100%); + &::after { + border-color: transparent transparent #fff transparent; + } + } + } + } + } + } + } + } + .drug-record { + position: relative; + margin: $page-margin $page-margin 64rpx; + padding: 24rpx 40rpx; + border-radius: 24rpx; + background: linear-gradient(to bottom, #25d9c8 0%, #a8ede6 100%); + .d-header { + display: flex; + justify-content: space-between; + align-items: center; + .status { + display: flex; + align-items: center; + .name { + margin-right: 10rpx; + font-size: 28rpx; + color: #fff; + font-weight: bold; + } + .icons { + display: flex; + align-items: center; + .icon { + margin-right: 14rpx; + width: 32rpx; + height: 32rpx; + } + } + } + .more { + font-size: 24rpx; + color: #ffffff; + } + } + .d-line { + margin: 31rpx 0 25rpx; + width: 26rpx; + height: 4rpx; + background: #ffffff; + border-radius: 0rpx 0rpx 0rpx 0rpx; + } + .date { + .d-name { + font-size: 24rpx; + color: #ffffff; + } + .d-str { + display: flex; + align-items: center; + font-size: 28rpx; + color: #ffffff; + font-weight: bold; + .week { + font-weight: bold; + margin-left: 10rpx; + font-size: 20rpx; + color: #26dac9; + width: 55rpx; + height: 24rpx; + line-height: 24rpx; + text-align: center; + border-radius: 6rpx 6rpx 6rpx 6rpx; + background: #ffffff; + } + } + } + .d-card { + min-width: 300rpx; + padding: 15rpx 24rpx 23rpx; + position: absolute; + top: 95rpx; + right: 32rpx; + box-shadow: 8rpx 16rpx 24rpx 0 #dfdfdf; + background-color: #fff; + border-radius: 24rpx; + .dc-header { + display: flex; + align-items: center; + font-size: 24rpx; + color: #12245c; + font-weight: bold; + .over-date { + margin-left: 17rpx; + font-size: 20rpx; + color: #bec3d1; + } + } + .dc-content { + margin-top: 13rpx; + display: flex; + align-items: flex-end; + justify-content: space-between; + .c-l { + display: flex; + align-items: flex-end; + .box { + padding: 0 20rpx; + height: 59rpx; + font-size: 48rpx; + color: #ffffff; + text-align: center; + line-height: 59rpx; + background-color: #12245c; + border-radius: 6rpx 6rpx 6rpx 6rpx; + opacity: 1; + font-weight: bold; + } + .sub { + margin-left: 10rpx; + font-size: 24rpx; + color: #12245c; + } + &.today { + .box { + padding: 5rpx 8rpx; + font-size: 32rpx; + background: linear-gradient(91deg, #12245c 0%, rgba(18, 36, 92, 0.52) 100%); + } + } + } + .more { + font-size: 24rpx; + color: #25d9c8; + } + } + } + .d-noraml { + display: flex; + justify-content: space-between; + align-items: center; + .n-left { + // padding: 40rpx 0; + flex-shrink: 0; + margin-right: 40rpx; + .title { + font-size: 28rpx; + color: #ffffff; + line-height: 48rpx; + font-weight: bold; + } + .btn { + margin-top: 46rpx; + width: 206rpx; + height: 54rpx; + background: #ffffff; + font-size: 28rpx; + color: #25d9c8; + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; + border-radius: 32rpx 32rpx 32rpx 32rpx; + .icon { + width: 21rpx; + height: 21rpx; + } + } + } + .n-right { + flex: 1; + display: flex; + justify-content: space-between; + .item { + .icon { + margin: 0 auto; + width: 64rpx; + height: 64rpx; + background: linear-gradient(120deg, #a7ede6 0%, #3cd9ca 100%); + border-radius: 12rpx 12rpx 12rpx 12rpx; + display: flex; + align-items: center; + justify-content: center; + image { + width: 48rpx; + height: 48rpx; + } + } + .name { + margin: 4rpx; + font-size: 20rpx; + color: #ffffff; + } + } + } + } + } + .live { + margin: $page-margin 0; + .header { + margin: 0 $page-margin; + display: flex; + align-items: center; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #474747; + font-weight: bold; + } + .more { + font-size: 24rpx; + color: #cccccc; + } + } + .live-container { + margin-top: 24rpx; + margin-left: $page-margin; + overflow-x: auto; + overflow-y: hidden; + &::-webkit-scrollbar { + display: none; + } + .scroll { + display: flex; + flex-wrap: nowrap; + .live-item { + flex-shrink: 0; + width: 670rpx; + height: 331rpx; + margin-right: 30rpx; + .live-img { + width: 100%; + height: 100%; + border-radius: 24rpx; + } + } + } + } + } + .live-up { + margin: $page-margin 0; + .header { + margin: 0 $page-margin; + display: flex; + align-items: center; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #474747; + font-weight: bold; + } + .more { + font-size: 24rpx; + color: #cccccc; + } + } + .live-container { + margin-top: 24rpx; + margin-left: $page-margin; + overflow-x: auto; + overflow-y: hidden; + &::-webkit-scrollbar { + display: none; + } + .scroll { + display: flex; + flex-wrap: nowrap; + .live-item { + flex-shrink: 0; + width: 670rpx; + height: 331rpx; + margin-right: 30rpx; + .live-img { + width: 100%; + height: 100%; + border-radius: 24rpx; + } + } + .item { + margin-right: 30rpx; + flex-shrink: 0; + width: 418rpx; + border-radius: 24rpx; + border: 1px solid #d6d9e1; + .photo-wrap { + position: relative; + width: 100%; + height: 235rpx; + border-radius: 24rpx 24rpx 0 0; + .photo { + width: 100%; + height: 100%; + border-radius: 24rpx 24rpx 0 0; + } + .status { + position: absolute; + left: 0; + top: 0; + padding: 5rpx 18rpx; + background: #ffffff linear-gradient(136deg, #e7eeff 0%, #fde0ea 100%); + border-radius: 24rpx 0 24rpx 0; + display: flex; + align-items: center; + font-size: 24rpx; + color: #cf5375; + .dot { + margin-right: 10rpx; + width: 10rpx; + height: 10rpx; + border-radius: 50%; + background: #cf5375; + } + &.bad { + color: #484848; + background: #e6e6e6; + .dot { + display: none; + } + } + } + .date { + padding: 18rpx 18rpx 8rpx; + position: absolute; + left: 40rpx; + bottom: 0; + background: #e04775; + border-radius: 11rpx 11rpx 0rpx 0rpx; + text-align: center; + .d-title { + font-size: 22rpx; + color: #ffffff; + font-weight: bold; + .icon { + margin-right: -10rpx; + } + } + .ymd { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + border-bottom: 2rpx solid rgba(255, 255, 255, 0.34); + } + .hm { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + } + } + } + .content { + padding: 24rpx 28rpx; + display: flex; + align-items: center; + border-radius: 0 0 24rpx 24rpx; + background-color: #fff; + .name { + max-width: 4em; + font-size: 28rpx; + color: #666666; + font-weight: bold; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .labels { + margin-left: 10rpx; + flex: 1; + .label { + display: block; + font-size: 24rpx; + color: #cccccc; + max-width: 4em; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .label:not(:first-of-type) { + display: none; + } + } + .btn { + flex-shrink: 0; + padding: 0 13rpx; + height: 48rpx; + line-height: 48rpx; + font-size: 28rpx; + font-weight: bold; + color: #cf5375; + border-radius: 24rpx; + background: #ffffff linear-gradient(136deg, #e7eefe 0%, #fee0ea 100%); + display: flex; + align-items: center; + justify-content: center; + .icon { + width: 40rpx; + height: 40rpx; + } + } + } + } + } + &.live-container-drugs { + .scroll { + .item { + .content { + .btn { + .icon { + margin-right: 10rpx; + width: 24rpx; + height: 24rpx; + } + background: #25d9c8; + color: #fff; + } + } + } + } + } + } + } + .live-up-new { + margin: 0 40rpx; + .l-banner { + width: 100%; + height: 834rpx; + border-radius: 24rpx; + .live-img { + width: 100%; + height: 100%; + object-fit: cover; + } + } + .item { + margin-top: 24rpx; + padding: 24rpx; + background: #ffffff; + border-radius: 24rpx; + display: flex; + .photo-wrap { + flex-shrink: 0; + width: 182rpx; + height: 182rpx; + position: relative; + .photo { + width: 100%; + height: 100%; + border-radius: 24rpx; + } + .status { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 40rpx; + font-size: 24rpx; + color: #fff; + display: flex; + align-items: center; + justify-content: center; + gap: 10rpx; + background-color: rgba(0, 0, 0, 0.46); + border-radius: 0 0 24rpx 24rpx; + .icon { + width: 20rpx; + height: 20rpx; + } + &.active { + background-color: rgba(207, 83, 117, 1); + } + } + } + .content { + flex: 1; + padding-left: 24rpx; + display: flex; + flex-direction: column; + justify-content: space-between; + .name { + font-size: 32rpx; + color: rgba(72, 72, 72, 1); + font-weight: bold; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .labels { + margin-top: 16rpx; + max-width: 56vw; + font-size: 28rpx; + color: rgba(173, 173, 173, 1); + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } + .c-footer { + margin-top: 20rpx; + display: flex; + align-items: center; + justify-content: space-between; + gap: 20rpx; + padding: 0 0 0 16rpx; + background-color: rgba(250, 250, 250, 1); + border-radius: 48rpx; + .date { + font-size: 24rpx; + color: rgba(72, 72, 72, 1); + } + .btn { + width: 128rpx; + height: 48rpx; + display: flex; + align-items: center; + justify-content: center; + gap: 8rpx; + background-color: rgba(207, 83, 117, 1); + border-radius: 24rpx; + font-size: 24rpx; + color: rgba(255, 255, 255, 1); + .icon { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + } + .story { + margin: $page-margin 0; + .header { + margin: 0 $page-margin; + display: flex; + align-items: center; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #474747; + font-weight: bold; + } + .more { + font-size: 24rpx; + color: #cccccc; + } + } + .story-container { + position: relative; + margin-top: 24rpx; + overflow-x: auto; + overflow-y: hidden; + &::-webkit-scrollbar { + display: none; + } + &::after { + position: sticky; + left: 0; + bottom: 0; + margin-top: -253rpx; + display: block; + content: ''; + width: 100vw; + height: 253rpx; + background: #cf5375; + } + &.story-container-drugs { + &::after { + display: none; + } + } + .scroll { + position: relative; + display: flex; + flex-wrap: nowrap; + padding-left: $page-margin; + padding-bottom: 55rpx; + .story-item { + position: relative; + z-index: 1; + flex-shrink: 0; + width: 281rpx; + height: 375rpx; + margin-right: 40rpx; + .story-img { + width: 100%; + height: 100%; + border-radius: 24rpx; + } + .story-content { + position: absolute; + left: 0; + bottom: 0; + padding: 40rpx 29rpx 26rpx; + box-sizing: border-box; + width: 100%; + font-size: 24rpx; + line-height: 32rpx; + color: #273a65; + font-weight: bold; + background: linear-gradient(180deg, rgba(236, 236, 236, 0) 0%, rgba(236, 236, 236, 1) 100%); + border-radius: 0 0 24rpx 24rpx; + } + } + } + } + } + .server { + margin: $page-margin; + .header { + display: flex; + align-items: center; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #474747; + font-weight: bold; + } + .more { + font-size: 24rpx; + color: #cccccc; + } + } + .server-container { + margin-top: 24rpx; + .two { + display: flex; + justify-content: space-between; + .item { + position: relative; + flex: 1; + height: 163rpx; + display: flex; + justify-content: flex-end; + .item-bg { + width: 100%; + height: 100%; + border-radius: 24rpx; + border: 1px solid #d7dae1; + } + .item-container { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border: 2px solid #d7dae1; + padding: 28rpx 31rpx; + box-sizing: border-box; + border-radius: 24rpx; + .title { + font-size: 28rpx; + font-weight: bold; + color: #666666; + } + .line { + margin-top: 20rpx; + width: 25rpx; + height: 4rpx; + background-color: #666666; + } + .en { + margin-top: 20rpx; + font-size: 20rpx; + color: #666666; + } + .icon { + position: absolute; + bottom: 0; + right: 0; + border-radius: 0 0 24rpx 0; + width: 106rpx; + height: 107rpx; + } + } + } + .item:not(:first-of-type) { + margin-left: 30rpx; + } + } + .four { + margin-top: 24rpx; + padding: 22rpx 30rpx; + border-radius: 24rpx; + background-color: #fff; + display: flex; + align-items: center; + border: 1px solid #d5d8e0; + .item { + flex: 1; + text-align: center; + .icon { + width: 95rpx; + height: 95rpx; + } + .name { + font-size: 24rpx; + color: #666666; + } + } + } + } + } + .book { + margin: $page-margin; + .header { + display: flex; + align-items: center; + justify-content: space-between; + .title { + font-size: 32rpx; + color: #474747; + font-weight: bold; + } + .more { + font-size: 24rpx; + color: #cccccc; + } + } + .swiper { + margin: 0 -40rpx; + height: 700rpx; + .swiper-item { + padding: 32rpx 40rpx; + box-sizing: border-box; + .book-list { + padding: 0 32rpx; + border-radius: 32rpx; + box-shadow: 0 0 32rpx 1rpx rgba(0, 0, 0, 0.08); + + .card { + padding: 32rpx 0; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 24rpx; + } + + .cover { + flex-shrink: 0; + width: 210rpx; + height: 140rpx; + position: relative; + + .photo { + width: 100%; + height: 100%; + border-radius: 8rpx; + } + + .label { + position: absolute; + top: 12rpx; + left: 0; + font-size: 16rpx; + color: #fff; + padding: 4rpx 10rpx; + background-color: #293b61; + } + } + + .content { + font-size: 28rpx; + color: #666666; + font-weight: bold; + .title { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + } + } + } + + .card:not(:last-of-type) { + border-bottom: 1rpx solid rgba(152, 175, 225, 0.5); + } + } + } + + .wx-swiper-dot-active { + width: 30rpx !important; + } + + .wx-swiper-dot { + width: 9rpx; + height: 6rpx; + border-radius: 2rpx; + } + } + } + } + .reg { + position: fixed; + left: 64rpx; + bottom: calc(env(safe-area-inset-bottom) + 120rpx); + width: 622rpx; + background-color: rgba(39, 58, 101, 0.8); + box-shadow: 0 8rpx 24rpx rgba(92, 144, 220, 0.25); + height: 84rpx; + line-height: 84rpx; + border-radius: 24rpx; + font-size: 30rpx; + color: #ffffff; + text-align: center; + .blod { + font-weight: bold; + } + .reg-close { + position: absolute; + right: -10rpx; + top: -10rpx; + width: 40rpx; + height: 40rpx; + } + } + .reg-audit { + position: fixed; + left: 34rpx; + bottom: calc(env(safe-area-inset-bottom) + 120rpx); + width: 682rpx; + background-color: rgba(39, 58, 101, 0.8); + box-shadow: 0 8rpx 24rpx rgba(92, 144, 220, 0.25); + height: 84rpx; + line-height: 84rpx; + border-radius: 24rpx; + font-size: 30rpx; + color: #ffffff; + text-align: center; + .blod { + font-weight: bold; + } + } + .public { + position: fixed; + left: 30rpx; + bottom: calc(env(safe-area-inset-bottom) + 120rpx); + width: 690rpx; + height: 152rpx; + box-shadow: 0rpx 2rpx 16rpx 0rpx #390f1b2d; + border-radius: 24rpx; + background: linear-gradient(346deg, #ffffff 0%, #ffe2eb 100%); + border: 2rpx solid #ffffff; + display: flex; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + padding: 0 48rpx 0 32rpx; + .logo { + flex-shrink: 0; + width: 88rpx; + height: 88rpx; + } + .wrap { + padding: 0 24rpx; + flex: 1; + .title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .content { + margin-top: 4rpx; + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + } + } + .btn { + width: 158rpx; + height: 64rpx; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + display: flex; + align-items: center; + justify-content: center; + background: #cf5375; + border-radius: 12rpx 12rpx 12rpx 12rpx; + } + .close { + position: absolute; + top: 0; + right: 0; + width: 48rpx; + height: 48rpx; + } + } +} + +.slidearea { + width: 30rpx; + position: fixed; + right: 0; + top: 0; + height: calc(100vh - env(safe-area-inset-bottom) - 120rpx); + // background-color: #000; + z-index: 10; + .mview { + position: relative; + width: 30rpx; + height: 30rpx; + .slidebar { + position: absolute; + top: 15rpx; + left: 40rpx; + transform: translate(-100%, -50%); + padding: 20rpx; + width: 346rpx; + height: 234rpx; + white-space: nowrap; + } + } +} + +.question { + position: fixed; + z-index: 10; + width: 154rpx; + height: 136rpx; + right: 28rpx; + bottom: 242rpx; + &-img { + width: 100%; + height: 100%; + } +} + +.official-account { + position: fixed; + bottom: 180rpx; + left: 20rpx; + width: calc(100% - 40rpx); +} diff --git a/src/patient/pages/index/index.ts b/src/patient/pages/index/index.ts new file mode 100644 index 0000000..9b04bee --- /dev/null +++ b/src/patient/pages/index/index.ts @@ -0,0 +1,610 @@ +import dayjs from 'dayjs'; +const app = getApp(); +const licia = require('miniprogram-licia'); + +Page({ + data: { + today: dayjs().format('YYYY年MM月DD日 dddd'), + + configList: [], + infoList: [], + storyList: [], + userInfo: {} as any, + anyWhere: false, + regGuide: true, + + adlList: [], + adlNum: '', + adlNewRecord: {} as any, + + liveList: [], + liveStatus: app.globalData.liveStatus, + + liveDownList: [], + + detail: {}, + + referralFromShow: false, + publicCard: false, + + // toastShow: true, + // toastType: "doubleStandards", + // toastType: "vipScan", + // toastType: "healthCare", + // toastType: "aldAlert", + // toastType:"dedicatedDoctor", + // toastType: 'referral-toast', + // toastType: 'public-toast', + + toastShow: false, + toastType: '', + toastParams: {} as any, + + sliderTop: 0, + + unreadCount: 0, + + options: {} as any, + }, + onLoad(options) { + const systemInfo = wx.getSystemInfoSync(); + + app.getTheme().then((res) => { + this.setData({ + theme: res, + }); + }); + + this.setData({ + sliderTop: systemInfo.screenHeight - 160, + options, + }); + }, + onShow() { + app.waitLogin({}).then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTHOME' }); + this.setData({ + anyWhere: app.globalData.anyWhere, + }); + if (this.data.options.es === '201501') { + app.globalData.IsAliQiWei = 1; + app.zdMpBehavior({ PageName: 'JUMP_PATIENT_HOME_INDEX' }); + this.setData({ + options: {}, + }); + } + app.getUserInfo(this, true, (userInfo) => { + this.setData({ + userInfo, + publicCard: userInfo.isShowFollowGuide == 1, + }); + this.getPopup(); + this.getConfig(userInfo); + this.getSystemConfig(); + if (userInfo.ExclusiveDoctorId > 0) { + this.getUnreadCount(); + } + + if (userInfo.UserType == 4) { + this.getLastRecord(); + } + }); + }); + }, + getUnreadCount() { + wx.ajax({ + method: 'GET', + url: '?r=xd/message-interact/get-unread-count', + data: {}, + }).then((res) => { + this.setData({ + unreadCount: res, + }); + }); + }, + getSystemConfig() { + wx.ajax({ + method: 'GET', + url: '?r=xd/common/get-config', + data: {}, + }).then((res) => { + this.setData({ + systemConfig: res, + }); + }); + }, + getLastRecord() { + wx.ajax({ + method: 'GET', + url: '?r=xd/medication/last-record', + }).then((res) => { + this.setData({ + detail: { + weekName: dayjs(res.InjectionDate).format('ddd'), + days: dayjs().diff(res.InjectionDate, 'day'), + ...res, + }, + }); + }); + }, + getConfig(userInfo: any) { + let UserType = userInfo.UserType; + if (UserType <= 2) { + UserType = 1; + } + wx.ajax({ + method: 'GET', + url: `?r=xd/mini-conf/get-config`, + data: { userType: UserType }, + }).then((res) => { + res = res.map((item: any) => { + if (item.code == 'spread1' || item.code == 'spread2' || item.code == 'serviceConf') { + item.subList = item.subList.filter((subItem) => { + return subItem.showStatus == 1; + }); + } + // if (item.name === 'BANNER-MINIDOVTOR') { + // item.subList = item.subList + // .filter((subItem: any) => { + // return subItem.linkUrl !== 'MINIDOCTOR' || userInfo.EntryThreePeriod === 1 + // }) + // .filter((subItem: any) => { + // return subItem.linkUrl !== 'MINIDOCTOR-1.0' || userInfo.EntryTwoPeriod === 1 + // }) + // } + return item; + }); + this.setData({ + configList: res, + }); + res.forEach((item) => { + if (item.code == 'article') { + this.getInfoList(item.configId); + } + if (item.code == 'story') { + this.getStoryList(item.configId); + } + if (item.code == 'adl') { + this.getAdl(); + } + if (item.code == 'activity2') { + this.getActivity(item.configId, item.showNum, 'liveList'); + } + if (item.code == 'activity1') { + this.getActivity(item.configId, item.showNum, 'liveDownList'); + } + }); + }); + }, + async getPopup() { + const data5 = await wx.ajax({ + method: 'GET', + url: '?r=xd/popup/info', + data: { + Type: 5, + }, + }); + if (data5.showAlert) { + this.setData({ + toastShow: data5.showAlert, + toastType: 'doubleStandards', + toastParams: data5, + }); + + return; + } + + const data4 = await wx.ajax({ + method: 'GET', + url: '?r=xd/popup/info', + data: { + Type: 4, + }, + }); + if (data4.showAlert) { + this.setData({ + toastShow: data4.showAlert, + toastType: 'vipScan', + toastParams: {}, + }); + return; + } + + const data1 = await wx.ajax({ + method: 'GET', + url: '?r=xd/popup/info', + data: { Type: 1 }, + }); + if (!Array.isArray(data1)) { + this.setData({ + toastShow: true, + toastType: 'healthCare', + toastParams: data1, + }); + return; + } + + const data2 = await wx.ajax({ + method: 'GET', + url: '?r=xd/popup/info', + data: { + Type: 2, + }, + }); + if (data2.showAlert && this.data.userInfo.UserType == 4) { + this.setData({ + toastShow: data2.showAlert, + toastType: 'aldAlert', + toastParams: { + id: data2.articleId, + }, + }); + } + + const data3 = await wx.ajax({ + method: 'GET', + url: '?r=xd/popup/info', + data: { + Type: 6, + }, + }); + if (data3.showAlert) { + this.setData({ + toastShow: data3.showAlert, + toastType: 'dedicatedDoctor', + toastParams: {}, + }); + } + + const data6 = await wx.ajax({ + method: 'GET', + url: '?r=xd/re-visit/get-popup-show-status', + }); + if (data6.showStatus === 1) { + this.setData({ + toastShow: true, + toastType: 'referral-toast', + toastParams: {}, + }); + } + }, + setPopupInfo() { + wx.ajax({ + method: 'POST', + url: '?r=xd/popup/update-click-status', + data: { + Type: 1, + Id: this.data.toastParams.Id, + }, + }).then((_res) => {}); + }, + setBannerClick() { + wx.ajax({ + method: 'POST', + url: '?r=xd/nrdl/add-banner-click-record', + data: {}, + }); + }, + getInfoList(configId: string) { + wx.ajax({ + method: 'GET', + url: '?r=xd/pic-text/index-list', + data: { + count: 0, + ConfigId: configId, + }, + }).then((res) => { + this.setData({ + infoList: licia.chunk(res.list, 3), + }); + }); + }, + getStoryList(configId: string) { + wx.ajax({ + method: 'GET', + url: '?r=xd/story/index-list', + data: { + count: 0, + ConfigId: configId, + }, + }).then((res) => { + this.setData({ + storyList: res.list, + }); + }); + }, + getAdl() { + wx.ajax({ + method: 'GET', + url: '?r=xd/adl/index', + data: {}, + }).then((res) => { + const newRecord = res.newRecord; + this.setData({ + adlList: res.list, + adlNum: res.count, + adlNewRecord: { + days: dayjs().diff(newRecord.CreateTime, 'day'), + ...newRecord, + newCreateTime: dayjs(newRecord.CreateTime).format('YYYY-MM-DD'), + }, + }); + }); + }, + getActivity(ConfigId: string, count: number, key: string) { + wx.ajax({ + method: 'GET', + url: '?r=xd/activity/index-list', + data: { ConfigId, count }, + }).then((res) => { + this.setData({ + [key]: res.list.map((item) => { + item.EndTimeValue = dayjs(item.EndTime).valueOf(); + item.BeginTimeValue = dayjs(item.BeginTime).valueOf(); + item.SignUpDeadlineValue = dayjs(item.SignUpDeadline).valueOf(); + item.BeginDate = dayjs(item.BeginTime).format('YYYY-MM-DD'); + item.EndDate = dayjs(item.EndTime).format('YYYY-MM-DD'); + item.isDay = item.BeginDate == item.EndDate; + item.BeginHm = dayjs(item.BeginTime).format('HH:mm'); + item.EndHm = dayjs(item.EndTime).format('HH:mm'); + item.BeginTime = dayjs(item.BeginTime).format('YYYY-MM-DD HH:mm'); + item.EndTime = dayjs(item.EndTime).format('YYYY-MM-DD HH:mm'); + return item; + }), + }); + }); + }, + routerTo(e) { + let { url, active, code } = e.currentTarget.dataset; + if (!url) return; + if (code === 'adl') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMEADLMODULE' }); + } + if (code === 'drugs') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMEMEDICATIONMODULE' }); + } + if (code === 'story' && url === '/pages/story/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMESTORIESVIEWALL' }); + } + if (code === 'story' && url.includes('/pages/publishStoryDetail/index')) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMESTORYCLICK' }); + } + if (code === 'activity2' && url === '/pages/live/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMEONLINEACTIVITIESVIEWALL' }); + } + if (code === 'activity2' && url === '/pages/live/index?index=0') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMEONLINEACTIVITIESMONTHLYPOSTER' }); + } + if (code === 'activity2' && url.includes('/pages/liveDetail/index')) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMEONLINEACTIVITIESCARD' }); + } + if (code === 'activity1' && url === '/pages/live/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMEOFFLINEACTIVITIESVIEWALL' }); + } + if (code === 'activity1' && url.includes('/pages/liveDetail/index')) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMEOFFLINEACTIVITIESCARD' }); + } + if (code === 'article' && url === '/pages/repository/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMERECOMMENDEDREADINGVIEWALL' }); + } + if (code === 'article' && url.includes('/pages/repositoryDetail/index')) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMERECOMMENDEDREADINGARTICLE' }); + } + if (code === 'serviceConf') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMESERVICE' }); + } + if (url === '/pages/interactivePatient/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTHOMEDOCTORCARD' }); + } + + if (url === 'NRDL') { + this.setBannerClick(); + this.handleNRDL(); + return; + } + + if (url.includes('loginState')) { + url = url + encodeURIComponent(app.globalData.loginState); + app.permissionVerification(2, 11, `/pages/repository/index`).then(() => { + wx.navigateTo({ + url, + }); + }); + return; + } + + wx.navigateTo({ + url, + fail() { + app.globalData.active = active; + wx.switchTab({ + url, + }); + }, + }); + }, + handleReg() { + app.permissionVerification(3, 0, ''); + }, + handleMiniDoctor(e) { + const { link } = e.currentTarget.dataset; + let period = ''; + if (link === 'MINIDOCTOR-1.0') { + period = '2'; + } + wx.navigateTo({ + url: `/pages/webview/index?period=${period}`, + }); + }, + handleQuestion() { + app.permissionVerification(2, 11, `/pages/repository/index`).then(() => { + const webviewUrl = encodeURIComponent( + `${app.globalData.url}/zdcare/#/info?loginState=${app.globalData.loginState}`, + ); + wx.navigateTo({ + url: `/pages/webview/index?url=${webviewUrl}`, + }); + }); + }, + handleSlider() { + wx.ajax({ + method: 'POST', + url: '?r=xd/nrdl/add-slide-click-record', + data: {}, + }); + this.handleNRDL(); + }, + handleNRDL() { + app.permissionVerification(3, 12, `/pages/index/index`).then(() => { + wx.navigateTo({ + url: `/pages/nrdl/index`, + }); + // if (this.data.userInfo.has7DayAdl === 1) { + // wx.navigateTo({ + // url: `/pages/nrdl/index`, + // }); + // } else { + // this.setData({ + // toastShow: true, + // toastType: "ndrlAldAlert", + // }); + // } + }); + }, + routerVipTo() { + const { MedicineAuditSwitch, UseDrugsAuditStatus, isFollow } = this.data.userInfo; + if (MedicineAuditSwitch === '0') { + wx.navigateTo({ + url: '/pages/vipLogin/index', + }); + } else if (MedicineAuditSwitch === '1') { + const pendPath = { + 0: '/gift/pages/vipPending/index', + 1: '/gift/pages/vipStartPending/index', + }[isFollow]; + const url = { + 1: pendPath, + 2: '/gift/pages/vipReject/index', + }[UseDrugsAuditStatus]; + wx.navigateTo({ + url: url || '/gift/pages/vipCert/index', + }); + } else { + wx.showToast({ + icon: 'none', + title: '工程师正在努力建设中,敬请期待!', + }); + } + }, + handleToastOk() { + const { toastType } = this.data; + if (toastType === 'vipScan') { + this.routerVipTo(); + this.handleToastCancel(); + } else if (toastType === 'aldAlert') { + wx.navigateTo({ + url: '/pages/adl/index', + }); + this.handleToastCancel(); + } else if (toastType === 'healthCare') { + this.setPopupInfo(); + this.handleNRDL(); + this.handleToastCancel(); + } else if (toastType === 'ndrlAldAlert') { + wx.navigateTo({ + url: '/pages/adl/index?nrdl=1', + }); + this.handleToastCancel(); + } else if (toastType === 'doubleStandards') { + wx.navigateTo({ + url: '/pages/adl/index', + }); + this.handleToastCancel(); + } else if (toastType === 'dedicatedDoctor') { + wx.ajax({ + method: 'POST', + url: '?r=xd/popup/close-popup', + data: { + Type: 6, + }, + }).then((_res) => { + wx.navigateTo({ + url: '/pages/interactivePatient/index', + }); + }); + this.handleToastCancel(null, false); + } else if (toastType === 'referral-toast') { + this.setData({ + referralFromShow: true, + }); + wx.ajax({ + method: 'POST', + url: '?r=xd/re-visit/update-popup-show-status', + data: {}, + }); + this.handleToastCancel(null, false); + } + }, + handleToastCancel(_e = null, sure = true) { + const { toastType } = this.data; + if (toastType === 'doubleStandards' && sure) { + wx.ajax({ + method: 'POST', + url: '?r=xd/popup/close-popup', + data: { + Type: 5, + }, + }); + } else if (toastType === 'dedicatedDoctor' && sure) { + wx.ajax({ + method: 'POST', + url: '?r=xd/popup/close-popup', + data: { + Type: 6, + }, + }); + } else if (toastType === 'referral-toast') { + wx.ajax({ + method: 'POST', + url: '?r=xd/re-visit/update-popup-show-status', + data: {}, + }); + } + this.setData({ + toastShow: false, + toastType: '', + toastParams: '', + }); + }, + handlePublic() { + this.setData({ + toastShow: true, + toastType: 'public-toast', + toastParams: {}, + }); + this.handlePublicClose(); + }, + handlePublicClose() { + this.setData({ + publicCard: false, + }); + wx.ajax({ + method: 'POST', + url: '?r=xd/account/add-user-subscribe-guide-record', + data: {}, + }); + }, + handleMp(e: any) { + const { code } = e.currentTarget.dataset; + const PageName = { + spread1: 'BTN_PATIENTHOMEBANNER1', + spread2: 'BTN_PATIENTHOMEBANNER2', + }[code]; + app.zdMpBehavior({ PageName }); + }, + handleRegClose() { + this.setData({ + regGuide: false, + }); + }, +}); diff --git a/src/patient/pages/index/index.wxml b/src/patient/pages/index/index.wxml new file mode 100644 index 0000000..cca1c8d --- /dev/null +++ b/src/patient/pages/index/index.wxml @@ -0,0 +1,503 @@ + + + + + + + + + {{today}} + + 今天是重症肌无力加油站陪伴你的第 + {{userInfo.JoinDays}} + 天 + + + + + + + + + + + + + + + {{userInfo.ExclusiveDoctorName}} + + + + 医生给您留言了,记得查看! + + {{userInfo.ExclusiveDoctorHospitalName}} + + {{userInfo.ExclusiveDoctorHospitalClassificationName}}{{userInfo.ExclusiveDoctorHospitalLevelName}} + + + + + {{unreadCount ? '去看看':'去咨询'}} + + + + + + + + + + + + + + + 最近一次测评 {{adlNewRecord.newCreateTime}} + + + 立即自测 + + + + + + + + + + + + + + + + + 连续治疗 {{detail.Times}} 次 + + + 查看健康档案 + + + + + + 上次治疗日期 + + {{detail.InjectionDate}} + {{detail.weekName}} + + + + 距离上次用药 + + + 今天治疗 + + + {{detail.days}} + + + + 更新记录 + + + + + + + + + 展示您的注射信息 + 开启您的专属服务 + + + 开始记录 + + + + + + + + + ADL提醒 + + + + + + 随访服务 + + + + + + 健康报告 + + + + + + + {{card.name}} + + 查看全部 + + + + + + + + + + + + + + + {{card.name}} + + 查看全部 + + + + + + + + + + + + + + {{liveStatus[item.Status]}} + + + + + + + + + + + + + + + + + + {{item.MasterName}} + + + {{item.MasterTitle}} + + + + {{item.Status==2?'参会':'查看'}} + + + + + + + + + + + + + + + + {{liveStatus[item.Status]}} + + + + + + + + + + + + + + + + + + {{item.Name}} + + {{item.doctorName}}{{item.hospitalName ? ' | ' + item.hospitalName : ''}} + + + {{item.BeginTime}} + + + {{item.Status==2?'参会':'查看'}} + + + + + + + + {{card.name}} + + 查看全部 + + + + + + + + {{item.Title}} + + + + + + + {{card.name}} + + + + + + + + + + + + + + + + + + + + + {{item.title}} + + + + + + + + {{card.name}} + + 查看全部 + + + + + + + + + + + {{item.CateName}} + + + {{item.Title}} + + + + + + + + + + + 注册 + 后享受全面重症肌无力患者服务 + + + + + 您的认证正在审核中,审核通过后获取全部服务 + + + + + + + 关注公众号 + 重要提醒不丢失~ + + 去关注 + + + + + + + + + + + + + + + + + + diff --git a/src/patient/pages/infusionCenter/index.json b/src/patient/pages/infusionCenter/index.json new file mode 100644 index 0000000..d1465a7 --- /dev/null +++ b/src/patient/pages/infusionCenter/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "输注中心", + "usingComponents": {} +} diff --git a/src/patient/pages/infusionCenter/index.scss b/src/patient/pages/infusionCenter/index.scss new file mode 100644 index 0000000..6532daa --- /dev/null +++ b/src/patient/pages/infusionCenter/index.scss @@ -0,0 +1,9 @@ +.page { + display: block; + width: 100%; +} +.page-title { + margin-top: -120rpx; + text-align: center; + color: #fea8b7; +} diff --git a/src/patient/pages/infusionCenter/index.ts b/src/patient/pages/infusionCenter/index.ts new file mode 100644 index 0000000..82ac822 --- /dev/null +++ b/src/patient/pages/infusionCenter/index.ts @@ -0,0 +1,6 @@ +const _app = getApp(); + +Page({ + data: {}, + onLoad() { }, +}) diff --git a/src/patient/pages/infusionCenter/index.wxml b/src/patient/pages/infusionCenter/index.wxml new file mode 100644 index 0000000..745d42d --- /dev/null +++ b/src/patient/pages/infusionCenter/index.wxml @@ -0,0 +1,2 @@ + +即将上线,敬请期待! diff --git a/src/patient/pages/interactivePatient/index.json b/src/patient/pages/interactivePatient/index.json new file mode 100644 index 0000000..a3970b4 --- /dev/null +++ b/src/patient/pages/interactivePatient/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "互动", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "van-loading": "@vant/weapp/loading/index", + "referralFrom": "/components/referralFrom/index" + } +} diff --git a/src/patient/pages/interactivePatient/index.scss b/src/patient/pages/interactivePatient/index.scss new file mode 100644 index 0000000..3718ca0 --- /dev/null +++ b/src/patient/pages/interactivePatient/index.scss @@ -0,0 +1,561 @@ +page { + background-color: rgba(242, 244, 245, 1); +} +.page { + height: 100vh; + overflow: hidden; + display: flex; + flex-direction: column; + justify-content: space-between; + .page-header { + flex-shrink: 0; + padding: 30rpx; + display: flex; + align-items: center; + justify-content: space-between; + border-radius: 0 0 24rpx 24rpx; + background-color: #fff; + .avatar { + width: 104rpx; + height: 104rpx; + border-radius: 50%; + } + .wrap { + flex: 1; + padding: 0 20rpx; + .name { + font-size: 40rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .content { + margin-top: 8rpx; + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + display: flex; + gap: 8rpx; + align-items: start; + .tag { + margin-top: 7rpx; + padding: 0 10rpx; + flex-shrink: 0; + height: 28rpx; + font-size: 22rpx; + color: rgba(229, 154, 41, 1); + line-height: 1; + text-align: center; + line-height: 28rpx; + background: rgba(229, 154, 41, 0.29); + border-radius: 8rpx 8rpx 8rpx 8rpx; + } + } + } + .more { + color: #d4d9da; + } + } + .page-container { + flex: 1; + overflow: hidden; + .scroll-view { + height: 100%; + .date { + padding-top: 20rpx; + font-size: 28rpx; + color: rgba(173, 179, 180, 1); + text-align: center; + } + .doctor { + padding: 15rpx 30rpx; + display: flex; + .avatar { + padding-right: 16rpx; + flex-shrink: 0; + .a-img { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + } + } + .d-container { + flex: 1; + margin-right: 74rpx; + display: flex; + flex-direction: column; + align-items: start; + .guide { + margin-bottom: 32rpx; + padding: 32rpx 30rpx; + border-radius: 0 32rpx 32rpx; + background: linear-gradient(13deg, #ffffff 8%, #e8f0f1 100%); + border: 2rpx solid #ffffff; + .title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .sub-title { + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + margin-bottom: 30rpx; + } + .list { + .l-item { + display: flex; + align-items: center; + gap: 16rpx; + margin-bottom: 30rpx; + .order { + flex-shrink: 0; + width: 28rpx; + height: 28rpx; + font-size: 24rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 1); + border-radius: 6rpx; + background: #67baca; + } + .content { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + } + } + .tip { + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + display: flex; + align-items: center; + .icon { + width: 44rpx; + height: 44rpx; + } + } + } + .message { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background-color: #fff; + border-radius: 0 32rpx 32rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + white-space: pre-line; + } + .week { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background-color: #fff; + border-radius: 0 32rpx 32rpx; + .w-title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + .w-container { + margin-top: 24rpx; + .w-content { + padding: 32rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + line-height: 48rpx; + border-radius: 24rpx; + background-color: rgba(247, 248, 249, 1); + } + .row { + display: flex; + .label { + width: 156rpx; + height: 76rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + color: rgba(255, 255, 255, 1); + background-color: rgba(103, 186, 202, 1); + } + .content { + width: 156rpx; + height: 76rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + background-color: rgba(242, 244, 245, 1); + } + &:first-of-type { + .label { + border-radius: 24rpx 0 0 0; + } + .content { + border-radius: 0 24rpx 0 0; + } + } + &:last-of-type { + .label { + border-radius: 0 0 0 24rpx; + } + .content { + border-radius: 0 0 24rpx 0; + } + } + &:not(:last-of-type) { + border-bottom: 2rpx solid #fff; + } + } + } + } + .adl { + margin-bottom: 32rpx; + padding: 32rpx 156rpx 34rpx 30rpx; + border-radius: 0 32rpx 32rpx; + background: linear-gradient(141deg, #edfcff 0%, #d4f3f9 100%); + border: 2rpx solid #fff; + .title { + width: 324rpx; + height: 40rpx; + } + .sub-title { + margin-top: 18rpx; + line-height: 1; + font-size: 28rpx; + color: rgba(255, 255, 255, 0.8); + } + .btn { + margin-top: 20rpx; + width: 220rpx; + height: 56rpx; + text-align: center; + line-height: 56rpx; + font-size: 28rpx; + color: #e04775; + background: #ffffff; + border-radius: 102rpx 102rpx 102rpx 102rpx; + } + .tip { + margin-top: 10rpx; + font-size: 24rpx; + color: #fff; + } + } + .audio { + margin-bottom: 32rpx; + padding: 22rpx 24rpx; + border-radius: 0 32rpx 32rpx; + background-color: #fff; + min-width: 218rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + display: flex; + align-items: center; + gap: 12rpx; + box-sizing: border-box; + .icon { + width: 32rpx; + height: 40rpx; + } + } + .info { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background-color: #fff; + border-radius: 0 32rpx 32rpx 32rpx; + .content { + font-size: 28rpx; + color: #283031; + } + .btn { + margin-top: 24rpx; + padding: 22rpx; + font-size: 32rpx; + color: #283031; + line-height: 40rpx; + text-align: center; + background: #67baca; + color: #ffffff; + border-radius: 104rpx 104rpx 104rpx 104rpx; + border: 1rpx solid #f8f9f9; + } + } + .referral { + margin-bottom: 32rpx; + width: 502rpx; + height: 262rpx; + background: linear-gradient(223deg, #59b0c2 0%, #94e2f1 100%); + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.07); + border-radius: 24rpx 24rpx 24rpx 24rpx; + .r-header { + padding: 20rpx 24rpx 0 32rpx; + display: flex; + .title { + font-size: 32rpx; + color: #ffffff; + line-height: 48rpx; + } + .icon { + flex-shrink: 0; + width: 138rpx; + height: 122rpx; + } + } + .r-footer { + padding: 32rpx; + background: linear-gradient(11deg, #ffffff 8%, rgba(255, 255, 255, 0.79) 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .btn { + width: 438rpx; + height: 64rpx; + font-size: 32rpx; + color: #fff; + text-align: center; + line-height: 64rpx; + background: #67baca; + border-radius: 104rpx 104rpx 104rpx 104rpx; + } + } + } + } + } + .patient { + padding: 15rpx 30rpx; + display: flex; + justify-content: flex-end; + .avatar { + padding-left: 16rpx; + flex-shrink: 0; + .a-img { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + } + } + .p-container { + flex: 1; + margin-left: 74rpx; + display: flex; + flex-direction: column; + align-items: flex-end; + .guide { + margin-bottom: 32rpx; + padding: 32rpx 30rpx; + border-radius: 32rpx 0 32rpx 32rpx; + background: linear-gradient(13deg, #ffffff 8%, #e8f0f1 100%); + border: 2rpx solid #ffffff; + .title { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + .sub-title { + font-size: 28rpx; + color: rgba(154, 161, 162, 1); + margin-bottom: 30rpx; + } + .list { + .l-item { + display: flex; + align-items: center; + gap: 16rpx; + margin-bottom: 30rpx; + .order { + flex-shrink: 0; + width: 28rpx; + height: 28rpx; + font-size: 24rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 1); + border-radius: 6rpx; + background: #67baca; + } + .content { + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + } + } + .tip { + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + display: flex; + align-items: center; + .icon { + width: 44rpx; + height: 44rpx; + } + } + } + .message { + margin-bottom: 32rpx; + padding: 26rpx 32rpx; + background: #67baca; + border-radius: 32rpx 0 32rpx 32rpx; + font-size: 32rpx; + color: #fff; + white-space: pre-line; + } + .referral-replay { + margin-bottom: 32rpx; + padding: 18rpx 32rpx; + border-radius: 32rpx; + background-color: #fff; + .title { + font-size: 32rpx; + color: #283031; + line-height: 48rpx; + } + .sub-title { + margin-top: 32rpx; + font-size: 32rpx; + color: #67baca; + font-weight: bold; + display: flex; + align-items: center; + &::before { + margin-right: 8rpx; + content: ''; + width: 6rpx; + height: 32rpx; + background-color: #67baca; + border-radius: 84rpx; + } + } + .r-list { + margin-top: 12rpx; + .item { + padding: 24rpx 0; + font-size: 32rpx; + color: #283031; + line-height: 36rpx; + border-bottom: 1px solid #eaeced; + &:last-of-type { + border: none; + } + } + } + } + } + } + .place { + height: 10vh; + } + } + } + .page-footer { + position: relative; + flex-shrink: 0; + padding: 18rpx 30rpx calc(env(safe-area-inset-bottom) + 30rpx); + border-radius: 24rpx 24rpx 0 0; + background-color: #fff; + transition: all 0.3s; + height: calc(124rpx + env(safe-area-inset-bottom)); + box-sizing: border-box; + .unread { + position: absolute; + top: -80rpx; + left: 50%; + transform: translateX(-50%); + padding: 12rpx 32rpx; + border-radius: 138rpx; + font-size: 24rpx; + color: rgba(103, 113, 114, 1); + background-color: #fff; + } + &.expend { + height: 50vh; + } + .line { + margin: 0 auto; + width: 52rpx; + height: 6rpx; + background: #f2f4f5; + border-radius: 48rpx 48rpx 48rpx 48rpx; + } + .title { + margin-top: 26rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + display: flex; + align-items: center; + justify-content: center; + .icon { + width: 36rpx; + height: 36rpx; + } + } + .tabs { + padding: 24rpx 0; + display: flex; + align-items: center; + gap: 22rpx; + overflow-x: auto; + &::-webkit-scrollbar { + display: none; + } + .tab { + flex-shrink: 0; + padding: 13rpx 22rpx; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + border-radius: 129rpx; + background-color: rgba(242, 244, 245, 1); + display: flex; + align-items: center; + gap: 8rpx; + line-height: 1; + .icon { + width: 32rpx; + height: 32rpx; + } + .icon-active { + width: 32rpx; + height: 32rpx; + display: none; + } + &.active { + color: #fff; + background-color: rgba(103, 186, 202, 1); + .icon { + display: none; + } + .icon-active { + display: block; + } + } + } + } + .list { + max-height: 35vh; + overflow-y: auto; + .l-item { + padding: 20rpx 0; + display: flex; + justify-content: space-between; + align-items: center; + .order { + width: 28rpx; + height: 28rpx; + font-size: 24rpx; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 1); + border-radius: 6rpx; + background: #67baca; + } + .content { + padding: 0 16rpx; + flex: 1; + font-size: 32rpx; + color: rgba(40, 48, 49, 1); + } + .icon { + color: rgba(40, 48, 49, 1); + } + } + } + } +} diff --git a/src/patient/pages/interactivePatient/index.ts b/src/patient/pages/interactivePatient/index.ts new file mode 100644 index 0000000..b5271ac --- /dev/null +++ b/src/patient/pages/interactivePatient/index.ts @@ -0,0 +1,365 @@ +import dayjs from 'dayjs' + +const app = getApp() + +interface IMessageItem { + msgId: string + msgContentType: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' // 1:文本 2: 出诊时间 3: adl卡片 4: 语音 5: 欢迎语 6:补充真实姓名 7: 提醒完善信息 8: 复诊卡片 9:患者恢复复诊消息 + msgContent: any + msgVisitTime: string + msgFromType: '1' | '2' // 1: 患者 2: 医生 + isPlay?: boolean + welcomeMsg?: { + hotQuestion: Item[] + } + msgCreateTime: string // 消息创建时间 + msgCreateTimeName?: string // 消息创建时间 + showTime?: boolean + ReVisitInfo?: any +} + +interface Item { + questionId: string + question: string +} + +Page({ + data: { + expend: false, + scrollTop: 0, + scrollIntoView: '', + doctorDetail: {} as any, + + questionActive: 0, + questionList: [] as any, + questionActiveList: [] as Item[], + + isLoad: false, + isFinish: false, + messageList: [] as IMessageItem[], + nextMsgId: '', + unReadCount: 0, + firstNotReadMsgId: 0, + isVisitAdl: 2, + adlMsgId: 0, + + week: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], + timeDay: { 1: '上午', 2: '下午' }, + + userInfo: {}, + }, + innerAudioContext: null as WechatMiniprogram.InnerAudioContext | null, + onLoad(options) { + this.innerAudioContext = wx.createInnerAudioContext({ + useWebAudioImplement: true, + }) + app.waitLogin({}).then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTINTERACTIONDETAILS' }) + this.getDoctorDetail() + this.getQuestionList() + this.getMessageList() + app.getUserInfo(this, true, (userInfo) => { + this.setData({ + userInfo, + }) + }) + if (options.adlPushId) { + wx.ajax({ + method: 'POST', + url: '?r=xd/push-click/adl-push-click', + data: { adlPushId: options.adlPushId }, + }) + } + if (options.taskPushId) { + wx.ajax({ + method: 'POST', + url: '?r=xd/push-click/task-push-click', + data: { taskPushId: options.taskPushId }, + }) + } + }) + }, + onUnload() { + if (this.innerAudioContext) { + this.innerAudioContext.stop() + } + }, + handleView(index = -1) { + this.setData({ + scrollIntoView: index > -1 ? `view${index}` : `place`, + }) + }, + getDoctorDetail() { + wx.ajax({ + method: 'GET', + url: '?r=xd/message-interact/get-bind-doctor-info', + data: {}, + }).then((res) => { + this.setData({ + doctorDetail: { + ...res, + }, + }) + }) + }, + getQuestionList() { + wx.ajax({ + method: 'GET', + url: '?r=xd/message-interact/get-question-list', + data: {}, + }).then((res) => { + this.setData({ + questionList: res, + questionActiveList: res[0].questionList, + }) + }) + }, + getMessageList() { + if (this.data.isLoad || this.data.isFinish) return + this.setData({ + isLoad: true, + }) + const nextMsgId = this.data.nextMsgId + wx.ajax({ + method: 'GET', + url: '?r=xd/message-interact/patient-get-message-list', + data: { + nextMsgId, + }, + }).then((res) => { + res.messageList.map((item) => { + if (item.msgContentType === '4') { + item.msgContent = JSON.parse(item.msgContent) + } + if (item.msgContentType === '2') { + item.msgVisitTime = item.msgVisitTimeType == 2 ? item.msgVisitTime : JSON.parse(item.msgVisitTime) + } + if (item.msgContentType === '5') { + item.welcomeMsg = JSON.parse(item.welcomeMsg) + } + if (item.msgContentType === '9') { + item.ReVisitInfo = JSON.parse(item.ReVisitInfo) + item.ReVisitInfo.visitDateName = dayjs(item.ReVisitInfo.visitDate).format('YYYY年M月DD日') + } + + return item + }) + this.setData({ + messageList: [...res.messageList.reverse(), ...this.data.messageList], + nextMsgId: res.nextMsgId, + unReadCount: res.unReadCount, + firstNotReadMsgId: res.firstNotReadMsgId, + isVisitAdl: res.isVisitAdl, + adlMsgId: res.adlMsgId, + isLoad: false, + isFinish: nextMsgId === res.nextMsgId, + }) + this.filterCreateTime() + if (!nextMsgId) { + this.handleView() + } + }) + }, + scrolltoupper(e) { + if (e.detail.direction === 'top') { + this.getMessageList() + } + }, + handleHot(e) { + const { index, mindex } = e.currentTarget.dataset + const { messageList } = this.data + const hotList = messageList[mindex].welcomeMsg?.hotQuestion + const hot = hotList?.[index] + this.setData({ + messageList: [ + ...messageList, + { + msgId: '', + msgContentType: '1', + msgContent: hot?.question, + msgVisitTime: '', + msgFromType: '1', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ], + }) + this.handleView() + this.sendQuestion(hot?.questionId) + }, + handleQuestion(e) { + const { index } = e.currentTarget.dataset + const { questionActiveList, messageList } = this.data + const question = questionActiveList[index] + this.setData({ + messageList: [ + ...messageList, + { + msgId: '', + msgContentType: '1', + msgContent: question.question, + msgVisitTime: '', + msgFromType: '1', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ], + }) + this.sendQuestion(question.questionId) + }, + sendQuestion(questionId) { + wx.ajax({ + method: 'POST', + url: '?r=xd/message-interact/send-question-message', + data: { + questionId, + }, + }).then((res) => { + this.setData({ + messageList: [ + ...this.data.messageList, + { + msgId: '', + msgContentType: '1', + msgContent: res, + msgVisitTime: '', + msgFromType: '2', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ], + }) + this.filterCreateTime() + this.handleView() + }) + }, + formatTime(date: string) { + let msgCreateTimeName = '' + if (dayjs().format('YYYY-MM-DD') === dayjs(date).format('YYYY-MM-DD')) { + msgCreateTimeName = dayjs(date).format('HH:mm') + } else if (dayjs().format('YYYY-MM-DD') === dayjs(date).add(1, 'day').format('YYYY-MM-DD')) { + msgCreateTimeName = `昨天 ${dayjs(date).format('HH:mm')}` + } else if (dayjs().diff(date, 'day') < 7) { + msgCreateTimeName = dayjs(date).format(`dddd HH:mm`) + } else { + msgCreateTimeName = dayjs(date).format('YYYY-MM-DD HH:mm') + } + return msgCreateTimeName + }, + filterCreateTime() { + const gapTime = 5 * 60 * 1000 + const { messageList } = this.data + + let preTime = 0 + messageList.forEach((item, index) => { + if (index === 0) { + item.showTime = true + preTime = dayjs(item.msgCreateTime).valueOf() + item.msgCreateTimeName = this.formatTime(item.msgCreateTime) + } else { + const curTime = dayjs(item.msgCreateTime).valueOf() + if (curTime - preTime > gapTime) { + item.showTime = true + item.msgCreateTimeName = this.formatTime(item.msgCreateTime) + preTime = dayjs(item.msgCreateTime).valueOf() + } + } + }) + this.setData({ + messageList, + }) + }, + handleQuestionTab(e) { + const { index } = e.currentTarget.dataset + this.setData({ + questionActive: index, + questionActiveList: this.data.questionList[index].questionList, + }) + }, + handleDoctorDetail() { + const { doctorId } = this.data.doctorDetail + wx.navigateTo({ + url: `/pages/doctorDetail/index?id=${doctorId}`, + }) + }, + handleRead() { + const { firstNotReadMsgId, messageList } = this.data + const index = messageList.findIndex((item) => `${item.msgId}` === `${firstNotReadMsgId}`) + this.handleView(index) + this.setData({ + unReadCount: 0, + }) + }, + handleFooter() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTINTERACTIONCHOOSEQUESTION' }) + this.setData({ + expend: !this.data.expend, + }) + if (this.data.expend) { + setTimeout(() => { + this.handleView() + }, 300) + } + }, + handleAdl() { + wx.navigateTo({ + url: '/pages/adl/index', + }) + }, + handleAudio(e) { + const { index } = e.currentTarget.dataset + const { messageList } = this.data + const messageItem = messageList[index] + const { url } = messageItem.msgContent[0] + if (this.innerAudioContext) { + if (messageItem.isPlay) { + this.innerAudioContext.stop() + messageItem.isPlay = false + this.setData({ + messageList, + }) + return + } + this.innerAudioContext.stop() + this.innerAudioContext.src = url + this.innerAudioContext.play() + messageItem.isPlay = true + this.innerAudioContext.onEnded(() => { + messageItem.isPlay = false + this.setData({ + messageList, + }) + }) + this.setData({ + messageList, + }) + } + }, + handleFillUserInfo() { + wx.navigateTo({ + url: '/pages/personalInformation/index', + }) + }, + handleReferral() { + this.setData({ + referralFromShow: true, + }) + }, + handleReferralReplay(e) { + const params = e.detail + this.setData({ + messageList: [ + ...this.data.messageList, + { + msgId: '', + msgContentType: '9', + msgVisitTime: '', + msgContent: '', + msgFromType: '1', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + ReVisitInfo: { + ...params, + visitDateName: dayjs(params.visitDate).format('YYYY年M月DD日'), + }, + }, + ], + }) + }, +}) diff --git a/src/patient/pages/interactivePatient/index.wxml b/src/patient/pages/interactivePatient/index.wxml new file mode 100644 index 0000000..4b7b09c --- /dev/null +++ b/src/patient/pages/interactivePatient/index.wxml @@ -0,0 +1,189 @@ + + + + + + + {{doctorDetail.doctorName}} + + {{doctorDetail.hospitalName}} + {{doctorDetail.hospitalClassificationName}}{{doctorDetail.hospitalLevelName}} + + + + + + + + + {{message.msgCreateTimeName}} + + + + + + + {{message.welcomeMsg.title}} + {{message.welcomeMsg.questionDes}} + + + {{index+1}} + {{item.question}} + + + + {{message.welcomeMsg.guideClick}} + + + + {{message.msgContent}} + + 以下是我的出诊时间 + + {{message.msgVisitTime}} + + + {{week[item.weekday-1]}} + {{timeDay[item.timeType]}} + + + + + + + ADL+激素双达标 + 点击进入ADL + 建议您定期做ADL测评 + + + + + {{message.msgContent[0].duration}}'' + + + {{message.msgContent}} + 提交您的真实姓名 + + + {{message.msgContent}} + 完善个人信息 + + + + 您最近有按照医生的 提醒,定期复诊吗? + + + + 已复诊 + + + + + + + {{message.msgContent}} + + 我最近一次复诊时间是{{message.ReVisitInfo.visitDateName}} + 我的方案是 + + 1.激素 + 2.传统免疫抑制剂(如他克莫司、吗 替麦考酚酯等) + 3.静脉输注丙种球蛋白 + 4.血浆置换 + 5.B细胞抑制剂(如:利妥昔单抗、泰 它西普、伊奈利珠单抗) + 6.FcRn拮抗剂(如:艾加莫德) + 7.C5补体抑制剂(如:依库珠单抗) + 8.中药或中成药 + 9.其他 + + + + + + + + + + + + + + 您有{{unReadCount}}条新消息 + + + + + + 请选择您要咨询的问题 + + + + + + {{item.typeName}} + + + + + {{index+1}} + {{item.question}} + + + + + + + + diff --git a/src/patient/pages/live/index.json b/src/patient/pages/live/index.json new file mode 100644 index 0000000..d14232c --- /dev/null +++ b/src/patient/pages/live/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#fafafa", + "usingComponents": { + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/patient/pages/live/index.scss b/src/patient/pages/live/index.scss new file mode 100644 index 0000000..ee42f52 --- /dev/null +++ b/src/patient/pages/live/index.scss @@ -0,0 +1,405 @@ +.page { + padding-bottom: 120rpx; + background-color: #fafafa; + position: relative; + .tab { + font-size: 32rpx; + color: #9e9e9e; + background-color: #fafafa; + &.tab-active { + font-size: 36rpx; + color: #484848; + } + } + .search { + margin: 32rpx 30rpx 0; + padding: 18rpx 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 38rpx; + border: 2rpx solid #ebecee; + display: flex; + align-items: center; + .icon { + width: 40rpx; + height: 40rpx; + } + .input { + flex: 1; + margin-left: 20rpx; + font-size: 28rpx; + } + .placeholder-input { + color: #a8a8a8; + } + .clear { + color: #ccc; + } + } + .sticky { + position: sticky; + top: 0rpx; + left: 0; + z-index: 20; + padding-bottom: 10rpx; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + background-color: #fafafa; + .tags { + margin-top: 20rpx; + padding-top: 28rpx; + position: relative; + overflow-y: hidden; + overflow-x: auto; + padding-bottom: 8rpx; + &::-webkit-scrollbar { + display: none; + } + .scroll { + padding-left: 30rpx; + display: flex; + flex-wrap: nowrap; + .tag { + margin-right: 16rpx; + flex-shrink: 0; + font-size: 28rpx; + color: #484848; + background-color: #f2f2f2; + border-radius: 24rpx; + padding: 10rpx 24rpx; + line-height: 1; + &.active { + position: relative; + color: #fff; + background-color: var(--name); + } + } + .site { + flex-shrink: 0; + margin-left: auto; + position: sticky; + top: 0; + right: 0; + display: flex; + align-items: center; + justify-content: center; + width: 164rpx; + white-space: nowrap; + font-size: 24rpx; + color: #484848; + background-color: #fafafa; + box-shadow: -12rpx 2rpx 10rpx -12rpx rgba(0, 0, 0, 0.5); + .icon { + margin-right: 8rpx; + width: 32rpx; + height: 32rpx; + } + } + } + } + } + .info-list { + margin: 32rpx 30rpx; + .list-item { + margin-bottom: 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + + .photo-wrap { + position: relative; + .photo { + border-radius: 24rpx 24rpx 0 0; + display: block; + width: 100%; + height: 388rpx; + } + .status { + padding: 6rpx 32rpx; + position: absolute; + top: 0; + left: 0; + display: flex; + align-items: center; + background: linear-gradient(90deg, #e5e9f5 0%, #fde4ec 100%); + border-radius: 24rpx 0rpx 24rpx 0rpx; + font-size: 28rpx; + color: var(--name); + .dot { + margin-right: 8rpx; + width: 13rpx; + height: 13rpx; + border-radius: 50%; + background-color: var(--name); + } + &.bad { + color: #484848; + background: #e6e6e6; + .dot { + display: none; + } + } + } + .money { + padding: 0 16rpx 0 0; + position: absolute; + right: 16rpx; + bottom: 16rpx; + background-color: #ffedca; + font-size: 24rpx; + color: #f5ad1d; + line-height: 30rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: 36rpx; + .icon { + margin-right: 5rpx; + width: 38rpx; + height: 36rpx; + } + } + .date { + padding: 18rpx 18rpx 8rpx; + position: absolute; + left: 40rpx; + bottom: 0; + background: var(--name); + border-radius: 11rpx 11rpx 0rpx 0rpx; + text-align: center; + .d-title { + font-size: 22rpx; + color: #ffffff; + font-weight: bold; + .icon { + margin-right: -10rpx; + } + } + .ymd { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + border-bottom: 2rpx solid rgba(255, 255, 255, 0.34); + } + .hm { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + } + } + } + .inner { + padding: 32rpx 34rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + .title { + font-size: 32rpx; + color: #252525; + font-weight: bold; + } + .content { + margin-top: 20rpx; + display: flex; + justify-content: space-between; + align-items: flex-start; + .labels { + display: flex; + align-items: center; + flex-wrap: wrap; + .label { + margin-right: 16rpx; + margin-bottom: 16rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: var(--name); + border-radius: 18rpx; + background-color: var(--tag-bg); + word-break: break-all; + } + } + .people { + flex-shrink: 0; + color: #9e9e9e; + font-size: 22rpx; + } + } + .footer { + margin-top: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .site { + font-size: 22rpx; + color: #bebebe; + } + .btn { + margin-left: 10rpx; + flex-shrink: 0; + padding: 4rpx 36rpx; + font-size: 28rpx; + color: #ffffff; + background: var(--name); + border-radius: 24rpx; + &.active { + color: #484848; + background-color: #e7e7e7; + } + .icon { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + } + + .video-list { + margin: 32rpx 30rpx; + .list-item { + margin-bottom: 32rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + + .photo-wrap { + position: relative; + .photo { + border-radius: 24rpx 24rpx 0 0; + display: block; + width: 100%; + height: 388rpx; + } + .status { + padding: 6rpx 32rpx; + position: absolute; + top: 0; + left: 0; + display: flex; + align-items: center; + background: linear-gradient(90deg, #e5e9f5 0%, #fde4ec 100%); + border-radius: 24rpx 0rpx 24rpx 0rpx; + font-size: 28rpx; + color: var(--name); + .dot { + margin-right: 8rpx; + width: 13rpx; + height: 13rpx; + border-radius: 50%; + background-color: var(--name); + } + &.bad { + color: #484848; + background: #e6e6e6; + .dot { + display: none; + } + } + } + .date { + padding: 18rpx 18rpx 8rpx; + position: absolute; + left: 40rpx; + bottom: 0; + background: var(--name); + border-radius: 11rpx 11rpx 0rpx 0rpx; + text-align: center; + .d-title { + font-size: 22rpx; + color: #ffffff; + font-weight: bold; + } + .ymd { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + border-bottom: 2rpx solid rgba(255, 255, 255, 0.34); + } + .hm { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + } + } + .money { + padding: 0 16rpx 0 0; + position: absolute; + right: 16rpx; + bottom: 16rpx; + background-color: #ffedca; + font-size: 24rpx; + color: #f5ad1d; + line-height: 30rpx; + display: flex; + align-items: center; + justify-content: center; + border-radius: 36rpx; + .icon { + margin-right: 5rpx; + width: 38rpx; + height: 36rpx; + } + } + } + .inner { + padding: 32rpx 34rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + .title { + font-size: 32rpx; + color: #252525; + font-weight: bold; + } + .content { + margin-top: 20rpx; + display: flex; + justify-content: space-between; + align-items: flex-start; + .labels { + display: flex; + align-items: center; + flex-wrap: wrap; + .label { + margin-right: 16rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: var(--name); + border-radius: 18rpx; + background-color: var(--tag-bg); + word-break: break-all; + } + } + .people { + color: #9e9e9e; + flex-shrink: 0; + font-size: 22rpx; + } + } + .footer { + margin-top: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .site { + font-size: 22rpx; + color: #bebebe; + } + .btn { + margin-left: 10rpx; + flex-shrink: 0; + padding: 4rpx 36rpx; + font-size: 28rpx; + color: #ffffff; + background: var(--name); + border-radius: 24rpx; + &.active { + color: #484848; + background-color: #e7e7e7; + } + } + } + } + } + } +} diff --git a/src/patient/pages/live/index.ts b/src/patient/pages/live/index.ts new file mode 100644 index 0000000..e3efd3f --- /dev/null +++ b/src/patient/pages/live/index.ts @@ -0,0 +1,255 @@ +import dayjs from 'dayjs' +const app = getApp() +let live_time: null | number = null + +Page({ + data: { + active: 0, + CateId: '', + Search: '', + LNG: '' as string | number, + LAT: '' as string | number, + online_open_status: 0, // 线上 + offline_open_status: 0, // 线下 + cateList: [], + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + liveStatus: app.globalData.liveStatus, + activityStatus: app.globalData.activityStatus, + userInfo: {}, + }, + onLoad() { + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + + this.setData({ + dateValue: dayjs().valueOf(), + }) + if (live_time) { + clearInterval(live_time) + } + live_time = setInterval(() => { + this.setData({ + dateValue: dayjs().valueOf(), + }) + }, 1000) + }, + onShow() { + if (app.globalData.active) { + this.setData({ + active: Number(app.globalData.active), + }) + app.globalData.active = '' + } + app.waitLogin().then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTWEDNESDAYLECTURELIST' }) + this.getConfig() + app.getUserInfo(this, true) + }) + }, + tabChange(e) { + this.setData({ + active: e.detail.index, + LNG: '', + LAT: '', + }) + if (e.detail.index == 0) { + app.zdMpBehavior({ PageName: 'PG_PATIENTWEDNESDAYLECTURELIST' }) + } else if (e.detail.index == 1) { + app.zdMpBehavior({ PageName: 'PG_PATIENTWEDNESDAYACTIVITYLIST' }) + } + this.getList() + }, + getConfig() { + wx.ajax({ + method: 'GET', + url: '?r=xd/common/get-config', + data: {}, + }).then((res) => { + let active = this.data.active + if (res.online_open_status == 0) { + active = 1 + } + this.setData({ + online_open_status: res.online_open_status, + offline_open_status: res.offline_open_status, + active, + }) + this.getList() + this.getCateList() + }) + }, + getCateList() { + wx.ajax({ + method: 'GET', + url: '?r=xd/activity/cate-list', + data: {}, + }).then((res) => { + this.setData({ + cateList: res, + }) + }) + }, + handleClear() { + this.setData({ + Search: '', + }) + this.handleSearch() + }, + handleSearch() { + this.getList() + }, + handleToggleSite() { + const that = this + if (!this.data.LNG) { + wx.getSetting({ + success(res) { + if ( + res.authSetting['scope.userFuzzyLocation'] != undefined && + res.authSetting['scope.userFuzzyLocation'] == true + ) { + //获取当前位置 + that.getFuzzyLocation() + } else if (res.authSetting['scope.userFuzzyLocation'] == undefined) { + //获取当前位置 + that.getFuzzyLocation() + } else { + wx.showModal({ + title: '请求授权当前位置', + content: '需要获取您的地理位置,请确认授权', + confirmColor: '#cf5375', + success (res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: '拒绝授权', + icon: 'none', + duration: 1000, + }) + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success (res) { + if (res.authSetting['scope.userFuzzyLocation'] == true) { + // wx.showToast({ + // title: '授权成功', + // icon: 'success', + // duration: 1000 + // }) + //再次授权,调用wx.getLocation的API + that.getFuzzyLocation() + } else { + // wx.showToast({ + // title: '授权失败', + // icon: 'none', + // duration: 1000 + // }) + } + }, + }) + } + }, + }) + } + }, + }) + } else { + that.setData({ + LNG: '', + LAT: '', + }) + that.getList() + } + }, + getFuzzyLocation() { + const that = this + wx.getFuzzyLocation({ + success(res) { + that.setData({ + LNG: res.longitude, + LAT: res.latitude, + }) + that.getList() + }, + fail(err) { + console.log(err) + }, + }) + }, + handleCate(e: WechatMiniprogram.CustomEvent) { + const { id } = e.currentTarget.dataset + this.setData({ + CateId: id, + }) + this.getList() + }, + getList(newPage = 1) { + const { active } = this.data + const { CateId, Search, LNG, LAT } = this.data + wx.ajax({ + method: 'GET', + url: '?r=xd/activity/list', + data: { + Type: Number(active || 0) + 1, + CateId, + Search, + LNG: LNG || undefined, + LAT: LAT || undefined, + page: newPage, + }, + }).then((res) => { + res.list = res.list.map((item) => { + item.EndTimeValue = dayjs(item.EndTime).valueOf() + item.BeginTimeValue = dayjs(item.BeginTime).valueOf() + item.SignUpDeadlineValue = dayjs(item.SignUpDeadline).valueOf() + item.BeginDate = dayjs(item.BeginTime).format('YYYY-MM-DD') + item.EndDate = dayjs(item.EndTime).format('YYYY-MM-DD') + item.isDay = item.BeginDate == item.EndDate + item.BeginHm = dayjs(item.BeginTime).format('HH:mm') + item.EndHm = dayjs(item.EndTime).format('HH:mm') + item.BeginTime = dayjs(item.BeginTime).format('YYYY-MM-DD HH:mm') + item.EndTime = dayjs(item.EndTime).format('YYYY-MM-DD HH:mm') + return item + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + handleDetail(e) { + const { id } = e.currentTarget.dataset + if (this.data.active == 0) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTWEDNESDAYTALKMEETINGLIST' }) + } else if (this.data.active == 1) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTWEDNESDAYTALKACTIVITYLIST' }) + } + wx.navigateTo({ + url: `/pages/liveDetail/index?id=${id}`, + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + onShareAppMessage() { + return { + title: '周三大咖说', + path: 'pages/live/index', + } + }, +}) diff --git a/src/patient/pages/live/index.wxml b/src/patient/pages/live/index.wxml new file mode 100644 index 0000000..6d6cbd0 --- /dev/null +++ b/src/patient/pages/live/index.wxml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + 全部 + + {{item.CateName}} + + + + + 距离最近 + + + + + + + + + + + {{liveStatus[item.Status]}} + + + + {{item.Name}} + + + {{label}} + + {{item.SignUpPeopleNum}}人已报名 + + + {{item.MasterName}} {{item.MasterTitle}} + 已取消 + 已删除 + 看回放 + 回放生成中 + + + 审核中 + + 参会 + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + + + + + + + + + {{activityStatus[item.Status]}} + + + + + + + + + + + + + + + + + + {{item.Name}} + + + {{label}} + + {{item.SignUpPeopleNum}}人已报名 + + + + {{item.Location}} + {{item.Distance}} + + 已结束 + 已取消 + 已删除 + + + 审核中 + + 已报名 + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + + + + diff --git a/src/patient/pages/liveDetail/index.json b/src/patient/pages/liveDetail/index.json new file mode 100644 index 0000000..f4d591b --- /dev/null +++ b/src/patient/pages/liveDetail/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "活动详情", + "navigationBarBackgroundColor": "#EEF0F3", + "usingComponents": { + "mp-html": "mp-html", + "customPoster": "/components/customPoster/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/patient/pages/liveDetail/index.scss b/src/patient/pages/liveDetail/index.scss new file mode 100644 index 0000000..b44769f --- /dev/null +++ b/src/patient/pages/liveDetail/index.scss @@ -0,0 +1,221 @@ +page { + background-color: #eef0f3; +} + +.page { + min-height: 100vh; + .banner { + width: 100%; + height: 422rpx; + } + .page-container { + padding: 18rpx 30rpx 160rpx; + .title { + font-size: 40rpx; + color: #333333; + line-height: 64rpx; + font-weight: bold; + } + .stat { + margin-top: 20rpx; + display: flex; + .s-item { + display: flex; + align-items: center; + font-size: 24rpx; + color: #1e1f21; + margin-right: 48rpx; + .icon { + width: 36rpx; + height: 36rpx; + margin-right: 12rpx; + } + } + } + .module { + margin-top: 30rpx; + padding: 34rpx 32rpx; + border-radius: 24rpx; + border: 2rpx solid #ebecee; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + background-color: #fff; + > view:nth-of-type(2) { + margin-top: 30rpx; + } + .info { + display: flex; + align-items: center; + font-size: 28rpx; + color: #636466; + .icon { + margin-right: 12rpx; + width: 32rpx; + height: 32rpx; + } + } + .site { + display: flex; + justify-content: space-between; + .wrap { + font-size: 28rpx; + color: #636466; + display: flex; + .icon { + flex-shrink: 0; + margin-right: 12rpx; + width: 32rpx; + height: 32rpx; + vertical-align: middle; + } + } + .nav-site { + margin-left: 10rpx; + flex-shrink: 0; + width: 36rpx; + height: 36rpx; + } + } + } + .screen { + position: relative; + margin-top: 30rpx; + padding: 32rpx 32rpx 0; + background: linear-gradient(360deg, #ffffff 0%, #f6f7f7 100%); + border-radius: 24rpx; + box-sizing: border-box; + .screen-list { + max-height: 200rpx; + .s-item { + display: flex; + align-items: center; + font-size: 28rpx; + .avatar { + margin-right: 20rpx; + width: 68rpx; + height: 68rpx; + border-radius: 50%; + } + .name { + margin-right: 20rpx; + color: #1e1f21; + } + .action { + margin-right: 20rpx; + color: #9b9fa4; + } + .date { + color: #e04775; + } + } + } + &::after { + position: absolute; + bottom: 0; + left: 0; + content: ''; + width: 100%; + height: 32rpx; + background: linear-gradient(180deg, rgba(251, 252, 252, 0.49) 0%, #fcfdfd 100%); + } + } + .content { + margin-top: 24rpx; + .c-title { + font-size: 36rpx; + color: #333333; + font-weight: bold; + margin-bottom: 32rpx; + } + .c-img { + width: 100%; + } + } + } + .footer { + padding: 16rpx 30rpx calc(30rpx + env(safe-area-inset-bottom)); + position: fixed; + bottom: 0; + left: 0; + width: 100%; + box-sizing: border-box; + display: flex; + background-color: #fff; + box-shadow: 0rpx 8rpx 48rpx 0rpx rgba(0, 0, 0, 0.19); + .inner { + flex: 1; + display: flex; + .i-item { + text-align: center; + .num { + font-size: 36rpx; + color: #1e1f21; + } + .name { + font-size: 22rpx; + color: #a8acb0; + } + } + .vertical { + margin: 0 38rpx; + width: 2rpx; + height: 64rpx; + opacity: 0.19; + background: linear-gradient(180deg, rgba(200, 200, 200, 0), rgba(173, 173, 173, 1), rgba(151, 151, 151, 0)); + } + } + .btn { + width: 346rpx; + height: 88rpx; + background: #e04775; + border-radius: 44rpx; + text-align: center; + line-height: 88rpx; + font-size: 32rpx; + color: #ffffff; + &.active { + color: #484848; + background-color: #e7e7e7; + } + } + } + .video { + width: 0; + height: 0; + position: relative; + .play { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 95rpx; + height: 95rpx; + } + } +} + +.fixed-share { + position: fixed; + right: 14rpx; + bottom: 264rpx; + width: 104rpx; + height: 104rpx; +} + +.custom-popup { + background-color: transparent !important; +} +.p-share { + width: 622rpx; + .photo { + display: block; + width: 100%; + height: 964rpx; + border-radius: 24rpx; + } + .tip { + margin: 34rpx auto; + font-size: 28rpx; + color: #ffffff; + text-align: center; + } +} diff --git a/src/patient/pages/liveDetail/index.ts b/src/patient/pages/liveDetail/index.ts new file mode 100644 index 0000000..3eae2a4 --- /dev/null +++ b/src/patient/pages/liveDetail/index.ts @@ -0,0 +1,303 @@ +import dayjs from 'dayjs' +const app = getApp() +let live_time: null | number = null + +Page({ + data: { + id: '', + shareShow: false, + detail: {} as any, + userInfo: {} as any, + posterUrl: '', + params: {}, + play: false, + }, + videoContext: {} as WechatMiniprogram.VideoContext, + onLoad(options) { + const scene = app.globalData.scene + this.setData({ + id: options.id || scene.id, + }) + if (live_time) { + clearInterval(live_time) + } + this.setData({ + dateValue: dayjs().valueOf(), + }) + live_time = setInterval(() => { + this.setData({ + dateValue: dayjs().valueOf(), + }) + }, 1000) + }, + onShow() { + app.waitLogin({ isReg: false }).then(() => { + this.getDetail() + this.setView() + app.getUserInfo(this, true, () => { + this.getPosterParams() + }) + }) + }, + onReady() { + this.videoContext = wx.createVideoContext('video') + }, + getPosterParams() { + wx.ajax({ + method: 'POST', + url: '?r=poster/prepare', + data: { + posterId: 'activity-invite', + activityId: this.data.id, + userId: this.data.userInfo.UserId, + }, + }).then((res) => { + this.setData({ + params: res, + }) + }) + }, + setView() { + wx.ajax({ + method: 'POST', + url: '?r=xd/activity/view', + data: { + Id: this.data.id, + }, + }).then((res) => { + console.log('res: ', res) + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=xd/activity/detail', + data: { + Id: this.data.id, + }, + }).then((res) => { + if (res.ReplayVideoUrl) { + this.videoContext = wx.createVideoContext('video') + } + if (res.Type == 1) { + app.zdMpBehavior({ PageName: 'PG_PATIENTLECTUREDETAILS' }) + wx.setNavigationBarTitle({ + title: '会议详情', + }) + } else { + app.zdMpBehavior({ PageName: 'PG_PATIENTACTIVITYDETAILS' }) + wx.setNavigationBarTitle({ + title: '活动详情', + }) + } + this.setData({ + detail: { + ...res, + EndTimeValue: dayjs(res.EndTime).valueOf(), + BeginTimeValue: dayjs(res.BeginTime).valueOf(), + SignUpDeadlineValue: dayjs(res.SignUpDeadline).valueOf(), + DetailJson: res.DetailJson ? JSON.parse(res.DetailJson) : [], + SignUpRecord: res.SignUpRecord.map((item) => { + item.date = dayjs().from(item.CreateTime) + item.UserId = '******'.slice(0, 6 - String(item.UserId).length) + item.UserId + return item + }), + BeginTime: dayjs(res.BeginTime).format('YYYY-MM-DD HH:mm'), + }, + }) + }) + }, + handleReplay() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTMEETINGDETAILREPLAY' }) + this.videoContext.requestFullScreen({}) + this.videoContext.seek(0) + this.videoContext.play() + }, + handleFullscreenExit() { + this.videoContext.pause() + }, + handleLive() { + const { Type } = this.data.detail + app + .permissionVerification(3, Type == 1 ? 1 : 10, `/pages/liveDetail/index?id=${this.data.id}`, this.data.id) + .then(() => { + const { TencentMeetingCode } = this.data.detail + wx.navigateToMiniProgram({ + appId: 'wx33fd6cdc62520063', // 要跳转的微信小程序appid + // path: `pages/sub-preMeeting/join-meeting/join-meeting?m=${TencentMeetingCode}`, // 要跳转到的页面路径 + // path:`pages/index/index?chn=${channel}&code=${TencentMeetingCode}&pwd=${password}&nm={nickname}` + path: `pages/index/index?code=${TencentMeetingCode}`, + }) + }) + }, + // handleLiveTest() { + // wx.navigateToMiniProgram({ + // appId: 'wx33fd6cdc62520063', // 要跳转的微信小程序appid + // path: `pages/index/index?code=521826426`, + // }) + // }, + handleResult() { + wx.navigateTo({ + url: `/pages/liveResult/index?id=${this.data.id}`, + }) + }, + handleSignUp() { + const { Type } = this.data.detail + const { UserType } = this.data.userInfo + + if (Type == 1) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTMEETINGDETAILSIGNUP' }) + } else if (Type == 2) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTACTIVITYDETAILSIGNUP' }) + } + + wx.ajax({ + method: 'POST', + url: '?r=xd/activity/sign-up', + data: { + Id: this.data.id, + PreUserIdentity: UserType, + }, + }).then((res) => { + app + .permissionVerification( + 3, + Type == 1 ? 1 : 10, + `/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, + this.data.id, + ) + .then(() => { + wx.navigateTo({ + url: `/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, + }) + }) + }) + }, + handleShare() { + this.setData({ + shareShow: true, + }) + this.saveShare() + }, + saveShare() { + const { UserType } = this.data.userInfo + wx.ajax({ + method: 'POST', + url: '?r=xd/activity/share', + data: { Id: this.data.id, PreUserIdentity: UserType }, + }).then((res) => { + this.getDetail() + }) + }, + handleMap() { + const { LocationLAT, LocationLNG, Location } = this.data.detail + wx.openLocation({ + latitude: LocationLAT * 1, + longitude: LocationLNG * 1, + name: Location, + fail(err) { + console.log(err) + }, + }) + }, + handleShareClose() { + this.setData({ + shareShow: false, + }) + }, + handlePosterFinish(e) { + this.setData({ + posterUrl: e.detail, + }) + }, + handleDownload() { + const that = this + wx.getSetting({ + success(res) { + console.log(res) + if ( + res.authSetting['scope.writePhotosAlbum'] != undefined && + res.authSetting['scope.writePhotosAlbum'] == true + ) { + that.saveImage() + } else if (res.authSetting['scope.writePhotosAlbum'] == undefined) { + //获取当前位置 + that.saveImage() + } else { + wx.showModal({ + title: '请求授权相册权限', + content: '需要保存海报到相册,请确认授权', + confirmColor: '#cf5375', + success(res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: '拒绝授权', + icon: 'none', + duration: 1000, + }) + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success(res) { + if (res.authSetting['scope.writePhotosAlbum'] == true) { + that.saveImage() + } else { + wx.showToast({ + title: '授权失败', + icon: 'none', + duration: 1000, + }) + } + }, + }) + } + }, + }) + } + }, + }) + }, + saveImage() { + wx.showLoading({ + title: '加载中', + }) + wx.saveImageToPhotosAlbum({ + filePath: this.data.posterUrl, + success: () => { + wx.hideLoading() + wx.showToast({ + title: '保存成功,请到相册中查看', + }) + }, + fail: () => { + wx.hideLoading() + wx.showToast({ + icon: 'none', + title: '保存失败,请稍后重试', + }) + }, + }) + }, + handleVideoPlay() { + this.setData({ + play: true, + }) + }, + handleVideoPause() { + this.setData({ + play: false, + }) + }, + handlePlayVideo() { + this.videoContext.play() + }, + onShareAppMessage() { + this.saveShare() + return { + title: `【会议报名】${this.data.detail.Name}`, + path: `/pages/liveDetail/index?id=${this.data.id}`, + // imageUrl: this.data.detail.IntroductionUrl, + } + }, +}) diff --git a/src/patient/pages/liveDetail/index.wxml b/src/patient/pages/liveDetail/index.wxml new file mode 100644 index 0000000..6f894d1 --- /dev/null +++ b/src/patient/pages/liveDetail/index.wxml @@ -0,0 +1,170 @@ + + + + {{detail.Name}} + + + + {{detail.ActivityBasicNum * 1 + detail.OpenNum * 1}}次 + + + + {{detail.ShareNum}}次 + + + + + + {{detail.BeginTime}} + + + + + {{detail.Location}} + + + + + + + + + {{item.UserId || '***'}} + 报名了活动 + {{item.date}} + + + + + 详情介绍 + + + + + + + {{detail.SignUpPeopleNum}}人 + 已报名 + + + + + {{detail.LimitPeopleNum}}人 + 限额 + + + + + 已取消 + 已删除 + 看回放 + 回放生成中 + + + 审核中 + + 参会 + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + 已结束 + 已取消 + 已删除 + + + 审核中 + + + 已报名 + + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + + + + + + + + + + 点击下载到手机 + + + diff --git a/src/patient/pages/liveResult/index.json b/src/patient/pages/liveResult/index.json new file mode 100644 index 0000000..94a8517 --- /dev/null +++ b/src/patient/pages/liveResult/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "", + "usingComponents": {} +} diff --git a/src/patient/pages/liveResult/index.scss b/src/patient/pages/liveResult/index.scss new file mode 100644 index 0000000..e872d3e --- /dev/null +++ b/src/patient/pages/liveResult/index.scss @@ -0,0 +1,164 @@ +page { + background: linear-gradient(180deg, #f9f9f9 0%, #f9f9f9 100%); +} +.page { + min-height: 100vh; + padding: 74rpx 0 120rpx; + .badge { + margin: 0 auto; + display: block; + width: 166rpx; + height: 166rpx; + border-radius: 50%; + } + .status { + margin-top: 32rpx; + font-size: 40rpx; + color: #e04775; + font-weight: bold; + text-align: center; + &.green { + color: #24d8c8; + } + } + .nostatus { + margin-top: 32rpx; + font-size: 40rpx; + color: #24d8c8; + font-weight: bold; + text-align: center; + } + .tip { + margin-top: 16rpx; + font-size: 32rpx; + color: #333333; + text-align: center; + } + .price { + margin: 10rpx auto 0; + font-size: 56rpx; + color: #f5ad1d; + display: flex; + justify-content: center; + align-items: baseline; + font-weight: bold; + .sub { + font-size: 36rpx; + color: #484848; + } + } + .container { + position: relative; + margin: 86rpx 40rpx 0; + width: calc(100% - 80rpx); + &::before { + content: ""; + position: absolute; + width: 100%; + height: 34rpx; + background-color: #e04775; + border-radius: 18rpx; + } + + .c-content { + padding: 42rpx; + position: relative; + top: 20rpx; + left: 20rpx; + width: calc(100% - 40rpx); + background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 3%, #ffffff 100%); + box-shadow: 0rpx 4rpx 40rpx 0rpx rgba(0, 0, 0, 0.06); + box-sizing: border-box; + .video { + display: block; + margin: 0 auto; + width: 403rpx; + height: 714rpx; + border-radius: 24rpx; + } + .c-title { + margin-top: 24rpx; + font-size: 36rpx; + color: #333333; + line-height: 1.4; + text-align: center; + white-space: pre-line; + font-weight: bold; + } + .date { + margin-top: 32rpx; + font-size: 28rpx; + color: #636466; + display: flex; + align-items: center; + justify-content: center; + text-align: center; + line-height: 1; + .icon { + margin-right: 10rpx; + width: 32rpx; + height: 32rpx; + } + } + .site { + margin-top: 30rpx; + font-size: 28rpx; + color: #636466; + line-height: 1; + text-align: center; + } + .code { + margin: 48rpx auto 0; + display: block; + width: 258rpx; + height: 258rpx; + } + .c-tip { + margin-top: 16rpx; + font-size: 28rpx; + color: #333333; + text-align: center; + } + &::after { + position: absolute; + left: 0; + bottom: -70rpx; + content: ""; + width: 100%; + height: 75rpx; + border-bottom: none; + // background: radial-gradient(circle at 50% 50%, #f9f9f9 0, #f9f9f9 50%, transparent 0); + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABNgAAAB8CAYAAAC7dA2XAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAE2KADAAQAAAABAAAAfAAAAABi5d06AAA1XUlEQVR4Ae2dDbhsV1nfZ/bsmTPn8+YafEAKhUKkTf2ohJAI2lakaNUCIlaKRXxilCA+ooWnKGCRL0G0YBVLhCCUinw0oNgAtqaQgCkiKUlBApiQ0EjIB7m5ubnnnHvP50z/756771l7zZ4z58zn2rN/63nuPWv251q/d+213vWud61VvffY8XbFCQ8696jziygEIAABCEAAAhCAAAQgAAEIQAACEIAABCDgEjh23/3uz0rk/qpWq+5P4hCAAAQgAAEIQAACEIAABCAAAQhAAAIQgEAfAhkDW7udcWbrcyunIQABCEAAAhCAAAQgAAEIQAACEIAABCBQTgLmqJY6q0VppJwoyDUEIAABCEAAAhCAAAQgAAEIQAACEIAABA5PwBzVUme1KI3YYzC2HR4md0AAAhCAAAQgAAEIQAACEIAABCAAAQiUmwBTRMstf3IPAQhAAAIQgAAEIAABCEAAAhCAAAQgMCSBjIFtyGdxOwQgAAEIQAACEIAABCAAAQhAAAIQgAAESkHAXYMtLkWOySQEIAABCEAAAhCAAAQgAAEIQAACEIAABEZIwF12jU0ORgiWR0EAAhCAAAQgAAEIQAACEIAABCAAAQiUj0Bmk4PyZZ8cQwACEIAABCAAAQhAAAIQgAAEIAABCEBgOAJ4sA3Hj7shAAEIQAACEIAABCAAAQhAAAIQgAAESkzA1mLDg63EBYCsQwACEIAABCAAAQhAAAIQgAAEIAABCAxHwNZiYxfR4RhyNwQgAAEIQAACEIAABCAAAQhAAAIQgEDJCWBgK3kBIPsQgAAEIAABCEAAAhCAAAQgAAEIQAACwxHAwDYcP+6GAAQgAAEIQAACEIAABCAAAQhAAAIQKDkBDGwlLwBkHwIQgAAEIAABCEAAAhCAAAQgAAEIQGA4AhjYhuPH3RCAAAQgAAEIQAACEIAABCAAAQhAAAIlJ5AY2Gw7UftHgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABPYn4NvRYrvcthMlQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAv0J+LY0poj2Z8YVEIAABCAAAQhAAAIQgAAEIAABCEAAAhDIEHBnhCYebJmz/IAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAT2JeB6sUX+nNF97+QkBCAAAQhAAAIQgAAEIAABCEAAAhCAAARKTsDfySByrW0lZ0P2IQABCEAAAhCAAAQgAAEIQAACEIAABCDQl4C/mwFrsPVFxgUQgAAEIAABCEAAAhCAAAQgAAEIQAACEOhNAANbbzacgQAEIAABCEAAAhCAAAQgAAEIQAACEIBAXwIY2Poi4gIIQAACEIAABCAAAQhAAAIQgAAEIAABCGQJsItolge/IAABCEAAAhCAAAQgAAEIQAACEIAABCBwKALuvgaJB5trcTvUk7gYAhCAAAQgAAEIQAACEIAABCAAAQhAAAIlI2C2NDfE9sO1uLkniUMAAhCAAAQgAAEIQAACEIAABCAAAQhAAAJZAr4tjTXYsnz4BQEIQAACEIAABCAAAQhAAAIQgAAEIACBQxHIGNh897ZDPYmLIQABCEAAAhCAAAQgAAEIQAACEIAABCBQQgIZA5vv3lZCHmQZAhCAAAQgAAEIQAACEIAABCAAAQhAAAIHJmAOaxkDGx5sB2bHhRCAAAQgAAEIQAACEIAABCAAAQhAAAIQSPY2yBjY8GCjVEAAAhCAAAQgAAEIQAACEIAABCAAAQhAoD8Bc1RLndWSXUT738IVEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAQErAdVTLeLClF/AXAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQOBiBxMDmurQd7DauggAEIAABCEAAAhCAAAQgAAEIQAACEIAABIxAMkXUdWkDCwQgAAEIQAACEIAABCAAAQhAAAIQgAAEIHAwAua4xhTRg7HiKghAAAIQgAAEIAABCEAAAhCAAAQgAAEIdBEwxzUMbF1YOAABCEAAAhCAAAQgAAEIQAACEIAABCAAgYMTwMB2cFZcCQEIQAACEIAABCAAAQhAAAIQgAAEIACBLgIY2LqQcAACEIAABCAAAQhAAAIQgAAEIAABCEAAAr0J2LprbkgMbHbMO+5eQxwCEIAABCAAAQhAAAIQgAAEIAABCEAAAhA4Q8DfMPTMLqLwgQAEIAABCEAAAhCAAAQgAAEIQAACEIAABAYhwBTRQahxDwQgAAEIQAACEIAABCAAAQhAAAIQgAAEzhDAwEZRgAAEIAABCEAAAhCAAAQgAAEIQAACEIDAEATOrMFW1Rps2cXZhngmt0IAAhCAAAQgAAEIQAACEIAABCAAAQhAoDQEzqzB1i5NhskoBCAAAQhAAAIQgAAEIAABCEAAAhCAAARGSYApoqOkybMgAAEIQAACEIAABCAAAQhAAAIQgAAESkcAA1vpRE6GIQABCEAAAhCAAAQgAAEIQAACEIAABEZJAAPbKGnyLAhAAAIQgAAEIAABCEAAAhCAAAQgAIFSEbB9DTIGNjY6KJX8ySwEIAABCEAAAhCAAAQgAAEIQAACEIDAkATa7XbWwGYHCBCAAAQgAAEIQAACEIAABCAAAQhAAAIQgMDBCWQ82A5+G1dCAAIQgAAEIAABCEAAAhCAAAQgAAEIQKC8BGwmaDobNHYxpAfdY8QhAAEIQAACEIAABCAAAQhAAAIQgAAEIACBLAF3JmjGg809kb2FXxCAAAQgAAEIQAACEIAABCAAAQhAAAIQgEAegYyBLe8CjkEAAhCAAAQgAAEIQAACEIAABCAAAQhAAAK9CWBg682GMxCAAAQgAAEIQAACEIAABCAAAQhAAAIQ6EsAA1tfRFwAAQhAAAIQgAAEIAABCEAAAhCAAAQgAIHeBCI2NugNhzMQgAAEIAABCEAAAhCAAAQgAAEIQAACEOhHIGJjg36IOA8BCEAAAhCAAAQgAAEIQAACEIAABCAAgd4Ekimi5sWGJ1tvSJyBAAQgAAEIQAACEIAABCAAAQhAAAIQgEAvArGdwIutFx6OQwACEIAABCAAAQhAAAIQgAAEIAABCECgm0DqrGZ2tcTAll4iRzYCBCAAAQhAAAIQgAAEIAABCEAAAhCAAAQg0IeA67CWGNhci1ufezkNAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIOASYIurAIAoBCEAAAhCAAAQgAAEIQAACEIAABCAAgcMSSDY5OOxNXA8BCEAAAhCAAAQgAAEIQAACEIAABCAAAQh0CLCLKCUBAhCAAAQgAAEIQAACEIAABCAAAQhAAAIDErCl15giOiA8boMABCAAAQhAAAIQgAAEIAABCEAAAhCAgG12wBRRygEEIAABCEAAAhCAAAQgAAEIQAACEIAABIYgwBTRIeBxKwQgAAEIQAACEIAABCAAAQhAAAIQgAAEmCJKGYAABCAAAQhAAAIQgAAEIAABCEAAAhCAwBAEmCI6BDxuhQAEIAABCEAAAhCAAAQgAAEIQAACEIAABjbKAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEBiRgu4hiYBsQHrdBAAIQgAAEIAABCEAAAhCAAAQgAAEIQIBdRCkDEIAABCAAAQhAAAIQgAAEIAABCEAAAhAYkgAebEMC5HYIQAACEIAABCAAAQhAAAIQgAAEIACBchGwaaFuyBjY/JPuhcQhAAEIQAACEIAABCAAAQhAAAIQgAAEIACBSsWmhbohY2DzT7oXEocABCAAAQhAAAIQgAAEIAABCEAAAhCAAAS6CWQMbN2nOQIBCEAAAhCAAAQgAAEIQAACEIAABCAAAQjsRwAD2350OAcBCEAAAhCAAAQgAAEIQAACEIAABCAAgT4EMgY21mDrQ4vTEIAABCAAAQhAAAIQgAAEIAABCEAAAhDwCGQMbKzB5tHhJwQgAAEIQAACEIAABCAAAQhAAAIQgAAE+hDIGNj6XMtpCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAwCOAgc0Dwk8IQAACEIAABCAAAQhAAAIQgAAEIAABCByUgC25hoHtoLS4DgIQgAAEIAABCEAAAhCAAAQgAAEIQAACHgFbcg0DmweFnxCAAAQgAAEIQAACEIAABCAAAQhAAAIQOAwBDGyHocW1EIAABCAAAQhAAAIQgAAEIAABCEAAAhDwCMTeb34OSMDcAbd3diq7O7uV3Varsru7W2m12hU7nv6zObnpvyiqVmpRrRLVokpcq1Xq9Tg5N+Drue0QBM7KaVdyakle+pvKyP52ZFQ5K6ua5NP5J1nFseSGXfoQuAe+1L6hHfue9NdkZLLak1MliZ/9nmy+u76lRE6STxzXElkN/HJuPDABq+d2drbPyEhyksxaTr2390116r/I5CNZRcl3FVXq+qZMjoTxEjA52Pe0s7uTtE0Wb6mt2vum0rrP5GT1n31PnfbJviv7pkx2hPETSOu9naTuk5zOtFHpd5XIp3JGnzijS9QkH2ub7K/pFITxE7DvZ3tbep/JKdH77Huyf532ya/7UvkkdaDkZHUfYfwETA6JnM7o5gfVz63+s7oP/Xz8MkrfsKN+VKf+O6R+bnqF+lHo5ynJ8f49q58739SeLoF+Pl76B3+66Qw7aqNMl2idaaf62iYS3dz0COtLoZ8fnHb2yuq9x45LFdgLDzr36N4PYvsSsEZga2ursmWFV43CsMEKsjXkjXo9+Tvs87i/Q8CU4M2tbSlY9m8n6VAOw8Ya8LrJqGGyaiSd0WGex70dAtY4byVy2tE3tZ10/odhY0ab9HtqNBoyDmDEGYane699R4msZFizenDYYHKyzmZjroFxYFiYzv2mBKd1n8nJvrFhgnU2GyarRj1pp4Z5FvfuETC5bG5uJe3Ttr4pU4CHCWbASb4ptVNzkhUG7GFoZu+1es/ap9Swlj17uF8mF9P77JuyNsoMOoTREBi9fm51n+l9+ieZEUZDAP18NBzH/ZRUP0/rPpPbMMHqvrSvi34+DMnue8ein6vuM3nZQCshn8Cx++7PnMDAlsHR/4dVKhtShLf0zyzC4wrWkZlTZ7Opf3gNHJ6y9SPN+GmyMsPauII1EqmcTFEmHJ6ANQabm5uJIWBYA8B+b29IMZ5TJ8bkRTg8AfMiTOSkb8q8NcYVrAE3OTWbcxgGBoCcGmsSg80IBn56JcHaJWuf7Huy9opweAJmrDE5bW1vJV5Ph39C/zuSjozVfZKTKciEwxMwY82m9Amr/4Y1fu73djOKpm2UyY1wOAKJsUbfk+l9NrgwroB+PhzZSevnVvdhFB1MZhPVz02fkO5HODyBRD+3Pu+GtVHo54cnOPwdGNgGZGgF9vTpjaThHqcRIC95zbm5yvx8k9HNPDjeMZONKVcmq3FWMt5rk5+mHJuc6MTk0ek+Zp3LU5LTKLw/u5/e+4h5IJqczIBD6E/AOiomJzMETDJYB9NkNK9/DDL0J291n9V7p6VgTbqNMqV4fn4u8cbpn1KusG/JvqlxGgHyKNvU0fmFJp2YPDg5x6xtMjlZWzXJYN7W881OG4WhrT/5qernSRuFft5fSp1pg9PUzxfm55kddBBB6Rr08wOCmvJl6OdTFoDzegxsDoyDRK2jcurU6aTT0u96jWptysX/q+oX3qwVoW5QP/7/6J479e/uhYWF+9bX123+7bfo30NareoFlUrrQsUfI0+4R8n6PK/4vsE6m9ZAMNUtH5NZ7k0Z7mdYU2e9pfXv7ohq1a9IVp+vtKNPq99xuxTZe5rN5l0nTpxoyhvtoZVK/GDJ6Px2tX2xllU5v9XafbTk9E39Oq82Ura4uIArbb6Ykqk16/qm+hnWrGOhDuGxahTdWo2qN1Xblc9UKtGX2+3ont3dU3efc845W/Io+BbJ+8H6nh6ptW++W/++U2M35+3u7Oh4e9/5Nma0WVyYx6Oth5zsOzI5HcSwpnpvXWuq3VarRl+uVtuf1SNv1L9v6Fu5c2lp6cTp06e/WfGH6NhD9diLtC7EY6Vuf6u+p0dKQdh3yNLKQafua+LRliMr8wY4vSHDmuq+fnWTjMs7Wqvwdv1V3RfdKFn9tR75dTG+e35+/p7V1dUVxR+if2qnou/cbbcurLbb5+/sttRG7S7nvD5zyLxEFxcWGAzKUNn7YZ2W9VOnZFjbf4RZ/Nvy5LwnqlobFf2NyanVqt3aaFTvmZubu+v48UpUX9x8SHW7/RA1Z+fpm7pY5eDbW+3d8+RtZd/avu5P5oGzuDjPYNCeaDIx67SsrZ8+kPe75PRAVK3dqubkS/pmPiPZ3dRu79wjGdy9vLy8trGx8WCr+/TIh7errYvbu+1/opV5z1MZ+PuqY/d1/dSzpPM1kwGhTAL5kRCw+m5s+nm1cmGl3Tq4fq6B8AXpE+jn+YVz3Pp5u9V6tPpS6Of5+A981DzWBtLPq9LPW+jnBwY95IVj18/b0s9b6OeHERMGtkPQso6lVTRWkHsFeSvdpY76h6QA/4E6kp/vdV2/4yc3Nh4ji8PzWzvtH9ci1A83xSEvmMJlRgG8b/bo2PSN9fVTySYTe0ezMXUo1rVg49UyBLxjcXHxquzZg/+6//77z9H6a5futivP1sKRj1XZ6GnEMS8pU45NZoTO6KV9T6Zo9Qr6lnbVYbk+qkbvXlpaeJfYrfW6dr/j+n6itbXTz5TB7ad3WrtP1sL7zV7Xm+fhkgyi1ukkdAiYF5R1XParh+px7bZqLbqyXqtdLuPM7YOy08DD41XFPk+d2qdrA5Jv7vUcM4gumVGAKQRnEZkyvKa6zwwCvYIGC+6XQe3D1Wrt7cvL85/sdV2/45KTjNaVy1rt1rP03n+ospFbsVl9l9Z9/Z5ZlvM2pdraqP08oVT/bGmDgr+sVWvvWlxsvlccB1rYVXJpnjp16jm7rfZz1EZ9j97dc+0Cmzpl+oR9W4ROG2WDdGas7hUkl7bWTLtJxrT3Viq7b1tZWTnW69p+x9fWNp4iY9yl0mF+SMaBlV7X27R5G7RjmtseoYPo52rb79Zg6p+ORD/fkn7eQj/fk8DBYgfTz6P1OK5frSUIR6Cfz10q4/VPqh/1Xfvq5+awoLrP2ivCGf1cgwobmgbfK5h+Lr3veg36jE4/35F+3tpPP68neh/6+Z5UDqqf12rxlbVadTT6eUv6+Tb6+Z4UumMY2LqZdB2xTuXq2npPZViVzI6MLB+utOOXrqzMfbnrAUMekLfHI9QovX57Z/eZ6jjleneYUWB5abH0irEpw2YIyAvWcEohvTGOo1fJqPZnedcMc8w6Mmtrp14qGb1AhoEH5T3LOi4mJ5NXmYMtjLqmb6rX+jVmqFZD8GbJ6bcH7Vjux1dyerY8EF+mDUm+3b7vvGAdTTMMlDnYYMLq6npPY7UMABsy2LynVq38mmR116hZra2tSSmu/Ia+px9UWnItnmYUMINomRVjK8LmCdXLWC3Pp5YW4/6kBhVeLu/pT41aTg888MA3RVH8KsnpEtV/i3nPN4V4ZXmx9IZrmxJlxrVe9Y68/m6Rofq3VhYX357HcZhjeqcNNPzCbmvnxVKOH5H3LPuONJhR+mmjZghYXVvr6V1onmoy1lyxvLz4KjEbaOAnj396THJ6suq8V2s9vidIbrm9fmufrJ0qc7DvCP28GCWgj37ersf1G6tx9dWq+9DPpyjSEPRzGdlerjbq23q1kzbAYMuFlDmYfn5S+nmv2T9qnzbiBvr5tMoIBrY+5K3gWgG2guwHeT9tx7X4PVKwXiAF65R/ftS/VdHEMgz8jjoxP6dOTFfN0jHeaFSzhAsXm6HGDDbWMPhBstEIc+OvKpXaJSsrzZv98+P4LcPAT2sa1RvUQGhaaXewkTLzZitj2E/JUtn9Wq1ee9HywsIHJsHGDDhy9vlD7dR3QV5DblPczCCqMjSJ5AT1DvOusY5LHhfVfaf0TckAOv8ysemuHEeck/vua680GutXyCD6zDxDmxlvVA+XcsdRm15ohgAzCPhB05Na8gT4aFRtX6rpad/wz4/j98mT6y+TAedXlZ6uKaT2HZkx1IyiZQv2HZlhzQxseUF1zRc1Cf6ylZX56/LOj/qY6r4f2N1t/2e1meflPds6L9aJKWMwQ7UZrPPGXswDVHrfK5eXF35vEmzkffjw7e3dd0rv+36Voa6GqMyDq6af2wBQ3iY7iX5el36+GJJ+Xs7BVS0B0dHPc9YuPKufN6SfN8PQz8s8uGoOCqaj5wUZQO+QrvXvVPdNTj9vV96+vbX9uDw9FP28p35+Oq7Hv6e6b2L6edxYu2Jne7e3fq5+lHlelylgYNtH2uZybh1MP1hfW9OSrt3eWnz6uedWT/rnx/1bFU1THar3b23tPDVP4bK1VGxB3LIEGRsrD5xcyzWCymvj6/Va9HR519g6UBMP6sT8iowCr1EnuGu7NlsIfCkx3kw8WVN5oTWQpgznGUHVaG/WG/GL1CC8ZRqJWz19+p/tbm5/QJ2YrimJHc+bpVKtI9XLCGrK8Fyj/j6V2+cqPtCUtWHke/LkyQe1K9GHtSPwxf5zzHhjxlBTusoSZMDXANBarhFUdd8XGnHth+Wx9rVp8NC3frm8b56Xt/ahtU/WTpUldEaa842g5gmlKYY/pTZq4KUKhuEoT6mflJzelud5aFMQV1aWSjXAoEHM3GlRyXSoRvymlaWllwzDe9B7bdmQ9ta26r7tb/WfYet8rSwvlWpTkX3183r92u3tpSD1cxtgKNOSLvvq57H083qg+nniGW+Dq/7XNpu/99PPtfbxpjyhpqefr0o/3+2ln0dqo5YrtllZWcJ++rn0vvetoJ8HURQwsPUQg625YetD+UGd7fVGfe4ZS0vNq/1zk/6tkc2LN7e2/1yeArZZQiaYd5R5Sc16SDwMzbjmDTV3DAGNV8ur5ZXTZmDrtNVq9f+5ubV1kZ8WG302xdiMA7McrPE2I2ieK7MMNtcsLy/9KzEYuxdoP8YyXP/O5ub2L/mGa/MOPaKOphnbZj1YvZe35pDK6j21qPov5An1hWkz0PpfP7q5ufPevLU6zGjdLIGHlOqTxCvAq/rMELwtg81lWgP0ndOWky1voDZKnd2dR/ppsd2wbSrirAfzMDy5uto11dDq/MZc/b9qUOESxcfuBbofZ9V38erq2pWS1Y/611mdZ3Wf1YGzHOw7Mk9Q89z1g4z2X1Ld9yR9U/f45yb9e3X11AtlEH2T78lr5cm8eMuwa7mtOWTeoH4ITz/fkX6+g37uNVIqqxqoC0c/j6Sfa9AuRz+vJ8sa2Lc1y8H085PSzzXA3JVNeZtfo4FL9PMuMtM5YPWe1X9+CEk/Pyn9fKfk+rnJBwObX0r1u5d12KavVSut7zpy5MjxnNumckgVY1MeDDdIKTzfT8CsT/Ho5b0hJWtL09d+eGlp/mM+k2n+No+Oza3N53u6RuI2e0QjMLPaiNv03QdOWgczO4XN8qtO9m+qk/3SacrFf3fHeLN9pb8YuKXXOpqaIuTfMjO/e3lvyGP3eq2f9UQx6NbAppR7W2Rf61J+TvVAl9fhrK/P0ct7I1kXqjl30aSm2hxU9A+srv3F1ubWU/zrzdvQBhhmNfTy3pCxqtWcq18mr7WRr7M2DEt5XL94Y3P7t/0BBvMOWDkyu14CSQdTnqCmU/hBu7R+QHXfv/aPT/O36r7Hyhh6nYy3XRZq+55m2Yu3p34eSz+vop9Ps1y670Y/d2mEG0+8q23wG/08XCGdSZnNqDPdzw/o5z6RMH77BrbZHqI8APNk6+gczzV52XxSnetHhmRcs+yow7sh48w/lhL4IT976c4i/vFZ+G3rDeVNjZLx4775ZuMxoRnXjLlGl39+rjH3fFsXyZXBXl7co7MRTzsuvnHNptuIxb8Jzbhm1NXp/VAcz3+H3OIz07/38pIR32wISrlY77Fj1Fyz8U7VfReFZFw7I6e7VPc9VMb0G3wh2ChfniLiX1fE3+Zhk7d0gTrVt5xzZOVhoRnXjPGR5aUf0LRQ27Akg9zyYkbdWQzWcclbukAehqfVRn1PaMY1k4E8tN7YnJv/QRukcmVia1yZh4PVgbMY7HvyjWsqq+25+bmXh2ZcM/4qOzdqw5JHaDrQHb488vLiX1PU3/vq50cC1s8b9Xz9vMdaV0WVT5ruPZ02W19oynnY+nmznPq5b1wrtn6eHchPy2TR/9rMkjzv6uD187lG1/JMs6yf71fOSm1gS6bceG7n1iGQl82bNcf7nysebM9aSuAzmvNzrzCl0BWwjfb12lnOva5I8XQ9G1/ZtzWHzjmy/LD5+fnbQ82PjGxvlWfhP7XdXdw0mnJvmzTMWrA11/xpoTaNY64RX6CFUt8fan5tN+BWa+Xhmm5zm5tG88az6V5WBmcp2JTQ0xuZImnG+3ZzrvlCrTn0M6HmVWncOXJk6XGabvJHfho7Hc3u6V7+dUX6bd9SnnFN+f+ojI2PEY+R72Y4Kj4ypr9E5enfmvLuPnNj0xaU716Owb2maPHEGC+DlF9PaBrH3Zq++w+0Lt6nQ82TLX8hA+A/kjdkxlM/9cbz291Q83HQdK1J5/M7LjbNWgyeqt0MX3fQ50z6upWVlWMyXD9Cg7//2313Uvbkjed3mt1rihhPjPFF1c9XlvP1c9V7Vv/NUthPPz8Sun6+uPjWuunn2h3dlcls6+eZ5tiWQVkrin6u9jRHP+9ud11ZFjGe6OfS0d22tzD6+fLShWXRz/uVrUhC63fNTJ43ZcRG0t38W1zW4efLKPLCImRaa7m8RiOuP24fnpteUyDz5ta71xQlniqPfselMde4+pyV5e9Q3jMNY4j5UufqU3Nz8aPUkK266TMDr+3gMyvBRin8DQ3Mw1DTrB8mT4nPh55P28BECuGj1Th8xk1rZ02l2TGGWsfFDPEW0vrPvCw1he0pMoK+2c17qHEtxP5c1dUv89NnO0CbvGYhdDou3btGNZuN31X+f6QIeZRn8XtUrh4vA0ZmLp4pkLPkcWhGUN/AIQ/Dm2UEfXgI63j1KysapPqqvCH/nu0a515rBl7TJ2YlmJe/lbu03rO/apc3tYbtt8lL7COh51PpbWnw93vVRr3bTavpSasz5HFoHlH+wILJSvkuvn6ufgf6uVt6pxtfMf28Hj9KMxi69fMzetJ0Uziat1tfw/Rz+47snwUtg2T6ubVRhdDP1UY9WtMju/RzG9iflWD6uT8A2Vliool+XjAhR66FtGBpHzi5iTKiD9L+uvlX4325jFZvHfjBU7hxeWHhT9TR/HX/1VbhuHnzzxflt1U0pmy5QaMYX7UpSO6x0ONS3u9q1Gvf63tzmKHDn6oSel7y0meNgr8Qp3kFWOf66NGjJ/LuCfWYDOxPsAVE3fRZR9Nv9NzzRYmb0cY8J9O6If0rg/UvSsn6WFHyYemUp93rtbnBf3PTbPnxO2bu+SLFV9UR8wcWtADxtctLS79cpHzY9Lb6XONZUuq7BoL8qeRFyleaVjMWWv3nBpturrWxHqs8ZwyL7jWhxZXWjShqP9amtLppM4PULHjFmx6hjaJ8va9djxs/1Gw2b3HzHHpcBvafkrf1jW46bVrvLEy/TuvwtG1K85jo55oRkP4uwl/08yJIKZmCfVc9Tz9X/2NbRqmih2Qw/4yx0L4r+2f6uTzXCqefa/ZWl35uButZ0s/98qbNkaSfh7XGuJ9G//es6+d+fvN+l3KKqH2IvmJviwaqY/2CPEihH0s82TRlyE2ndcyK3tG0RsFX7NUorLdbuxe4eS1K3EaJ1KBdmo4epek2Ofm7oqbnivA3r6xZZ1pTWZ5pnhFFyIObRqW9pWldjzPPBvd40pEuuLKVV9bMG0J1yFvcvBYlrt1on6WO5t+66U2MoVpfrsihY3jPKvbK553a3evJRcyXdTSlJL7RTfteR9o9Wqx4nuHdBlHiuPkE1SOFc/2yaYgyWn+/v25ons5UJEn1Kmsqky9dXp6/pkh5SdMqI9t3a42rzLTePJ0pvb4of/PKGvp5eNLLK2uzqZ/bQFdmbCg8YeyTos6garYpmlX9vOjGUPTzfQpyAU+VzsBmH6BvtJGSckxW8ScWUH5nk2xThuR1k1mLzEbVizoNxxRim3LoBnOTldHmSUXziHLzICPbuxqN+G3uMWsA/by650OP2xQik5cb1En7TXmuXOUeK1Jc03q/3qjPPdUUETfd5iHg59U9H3Lc6j3fW1LT2G4yb4iQ090vbUr/hf70DltfzowfRQw2+ONPHY+0hmOtVr3AjL9FzJOlWSOa/17191+66TevIn8tQPd86HHfY0jy0TS2uecuL899MfS090qfrRenui/jJWl1np/XXveHePzUqY2uQdW5ufp/V5l8Q4jpPUiaVNa2NF38IvNEca83A5XpFEUM6OfFkNos6+cacOzWz+X5WtRQJv3cvP7Rz8MqqbOmnx+GbukMbGueZ4O8VLakaF0oZaWYvTFH2tVK+wLlJ9MSmLJVxAqnoyRmbBsVjTa/QEab650sFzK6srx8mabkZXZaMUNoEdflMCOuPz1KneiPLy0tdq2PVTRh2eLfjWbj19x0W8fFPNmKFsxD0r4pN2hR8wc0je0i91gR46q71+I4eqI//bqoa0fZ7q5uUP7a2jn1X8o4n5m27F5TlLg8Dr9Pnnh3uem178mmtxUt2JR4f901dc5+39adK1pe/PTaWoxqo97nHrf2qYgLtJvB2jfiqgzepnb46W7+ihjX1NZb40b9J6yOSNPfMX5k65D0XOh/u/VzTWObKf08ml39vD4b+rlmMl3m71SOfh5ezYF+Hp5M8lI0a/p5Xh57HSuVgS1R5KVsuUEV6aUh70LpprVf/MiRI8eVn6edWb8yubyIBgHzavC9DG1Tg6Ktj7efvFaWFp+okeeMFlw0LzZzWlv3RvbMaKNO9FP2y3uRztmucv6iqtZZK9pC+uYR5RraO0ab+En6m1H4iyQbN63Ly8tfkHHjV9xjefWIez7EeGKw9qYha2DhP2ka2ydCTO9h06Ty1tJaNxebN3J6b8cgUKxiaO2q72WoaeVfUefsF9N8Ff2v1jl9dlyPM8ZQvx4pQh67jDaRbbjRenwR0n6QNKqN+pAMhn/sXmvT94o2XSpfP5/7mdnSz+e69PN0wyFXfiHH89rVRD8v2Pp4+zFeWVl8Avr5foTCODcz+rkGVdHPwyhTo0xFaQxsVnj9hkzTo76o0ebMbkyjhDuNZ9lCiFK2rnPfbSPtRZoycOp0xu6ULMYpg9SPuXkqelwdzS3t2PYiNx+muBRpSq95M/iGprhW/1nrRLv5Knq8FlWe5npHmWHRL6Mh59Fk1GWwrtc/bIvPh5zuw6ZtaWnhjfqm/s69z6/z3XMhxnO8DI9rGlumnggx3YdJk6Ygfk1t1Dvce8ywaPVfUcLp05tdCnEUzRXeI8rnr931bJfys4dtLSJ/M5uzJwOMmJHJNzRp57w32GBkgMkdOEky7F6i2QuZrfTWNS22KKHM+rm1zcXWz2tb6OfhfWmbefp5A/08NEkl+rlk5QbpR+jnLpCCxktjYLNGzLcQayrb0woqtz7Jbj9DBoGzU14t30VRim06hz/lsN6ov0ZK/lqfTBfutJTiP1BFepub8CJNP9zwpkrqe/qcphZ9wM3PLMRtap7kdLmbFzOEFmVamz89yjZvUNn7CTc/sxKv16MfyxoEZFz0lJdQ82r1XtfmO/X4uaGmd5h0yRh6mcrhqvuMohitrT31y5S8XD9Y5HXXXDm4cRlDP6WByI+7x6zed3Up91xocd/ArvV271Xdl5n2H1qaB0mP6rwd7VKe8Z60NSj9NTcHefYk7kE/z3awJ8F8kHfk6+fxa2dVP9e61oXVz/2+RKKfL6CfD1Lux3lPCfXzs8sZ2MCCr0uNk/Wkn10KA5t5nPgGJk3nuMbWr5g08Em8z3YCU/4yhg5fgZlEOgZ5h68QWyfMdkkd5FlFuCeK4p9102lr+vgGRvd8KHHfwGRGDe08N5PGAGMug8AvmWHK5e8bGN1zocStAbORTDeok3mF5FUc9wY38X3i8sr7rLzYbnAv8xVN91xIcb/uM+O78vORkNI4qrSo/Gmn3tpr3eflGRjd86HErTy5Bibzbl1eWrgklPSNOh21qPocyWtPKU4MjFujfs3In5dnYIrj+otH/qJAHqiBoHfKIHC3mxy/TnHPhRLP1c8bdfTzUATkpMMvT7Oun9eiOvq5I/9Qo3n6eRH0vpLq55mZM0WQ06DlvhQGti2tR+G6YJuyKEUkU3EOCjDU+3Z2tn/eX+dmQ143IQdbiN2fIiljwO+GnOZh06a1la7xd381Y2jowTdYKw83ScH/fOjpHjR9ZhBQWfwv7v32PbkdbfdcKPFOGvdSYzvOSRmZ2U6m5TSOq8/by3Elmca85a1r5p4PIW7TI/1dT7VxQ2YnxxDSOco0qL74LZXHzLS2ItR9fjuqNeU+ovph5jysU1nLyHuXBuyuS3/b3w2tQxl68NuoOI6PawmNPwo93cOkrx7XXuHeb9Nj/WUc3PMhxHP187iGfh6CcJw0lFc/zy47UYQ2yq/7yqifW18S/dz5gAOJFlE/HxRdKQxstuCrG+ThcKMWTv2qe2zW4kePHj0R12v/y82Xb7xyz4UQ9z1tzGNIxoBfDyFt40xDLYozi7ObMcA1CI/z3YM82xR23xgQVeNfGORZRbpHZfGXs2uxtYP3NvS/+Vocf1DGgGyFWCQhHCCt5sUmg8At7qU+B/dcCHG/7pNCfLfycVUIaRtnGrSI/tvc5/tttXsuhLhfN9tgnVYo+7kQ0jbWNCRr9+y9Ia8N2Ds7/Zh1rHxP8HocvWH6KRtvClRnXBHXaifdt4T+Tfnp05IgN5RBP1cbVSj9fMsboC+Pfl57ifs9ddqAsw697qkg4nl1M/p5EKLpSoSvl2oQH/28i1JxD8y8gc0W5fUVrage/UZxRXbwlMdR9DL3ajOK+Gv8uOenHd/c3M4kQYrix8xzKHNwBn9o3bL3+zsWbWo9plCDrxBr59ATs7LL4X7MVRY3lNfr3Wv8BtI9N+24/73bWuWNuPar007XJN4fRbWM56u1ASGPZnZ9U7V4pj1t0jKg6f+vMCNV+juvvU7PhfDX/96lEN+sHWy/EULaxpmGlWbzZm1gc4f7Dt+Tzz037bj/vdvAiIxP/3Ha6ZrE+2v12gfd9/jGe/fctON533tUi1437XRN4v1aUqNQ+rn/vZdbPw93jLJLlyiRfi4P3s+4367fXrvnph3P08/Vv0A/n7ZgRvj+mTewmfu5G2pRbWN5YeFP3GOzGjdPDn2w97v5C9VwYx5bvldUrVZ9pZv2WY7Htexopj9aGFLe/UarFtf+LKT0jTMtsaf822hmqIYb/1tXB/nr8gy4fZx8Qnm2vA0vV6c6s9GLySrEYAuRW0czDWZw2tycf236e5b/Kq9r8tb7kptHv4Pgnpt2vGuwLqq9ZdppmtT7NWU5Y/T1WUwqHQd5j1+GbGBEZW3mB+uMjQZW/4PyehZTx6MlzB160c9j9POzJTXcCPp5uLJxUyZHhde7v9HPXRrhxIuknw9DbeYNbNZ5MWUjVTi0XsonhgFWtHtl/LjKzb9vxAolP1uSkxukED8gA2HGW8g9P2txGRNf5eZpW96GIRpuzBDqe0GaQu+mfZbjKpNX6ZvKLEAU6k5t6beefv9RXH3fLMvGzZvy3NJUo8/asTT/ocrJ1klyg7yibjn33Gpmmpd7ftbiUbX2VjdP4copWyebV5TW9Pp9N+2zHF9cXHidvqWzluBkUEyb8oQYUr3P0mbfv8rYm0JM5zjSpJ1fv6426k7LtwX769cx43jvIM/0v/Xy6edRZhmAUOWEfl48/Tz9/kunn8uJJq337K9fxwxST43jHv9bL5t+rjVRE/08ZRuqnNL0DfJ39g1sOx0Pk9RYUa3W/ngQUIW9p1a7wvKe5t8Kse3aFFrwKxut75D5+EJL76jTY96GynPG3TLECsdPk9K8JoX+a6PmEfLzatXaF930+WXXPTetuH3vqazS778Rx5dPKz3TeG9Uaf+pvTfNf4hysvSlcrK4BRlu/qITK8f/MlK9I+0MWI47RvzwnI1s0MMNGi2/XekOL6FuIkcYV17XNPCVmQ674w2MjfB1Az/KNgxJv3l7iOxLLZWxzLTJgR9ekBvVqf6kMbBgf/2yG0o2tqWfu6GM+rmb/07ZdY+EEffbTvRztdteexCCpFxdwr77UurntY5+ntZ/ftkNQU6WNvvW3VA2/bwWVRL9PGUQopzStA36d6YNbOZp40+9WVxsvn9QWEW8b2V+/rqaN1Uq9WwJKT9uw2Dpks9hKabxujJQh+0W93eQDbinVMh1fmZ3DnVl4ca1dspH3d9+2XXPTSvuT4e0Nf6azeat00rPNN4rQ80fuu+1qVJmvAkp5HV+5SSUSXdI6R1HWsxwo47AcffZfsfbPTetuG9Mimq1a6eVlmm9V3XfX7vvDrKN8jxCtYmQeXOF9eG7EMcQl5wy03lDbKPQzysV9PMxFP4xPVLLg9zsPjrEb8qvj9HPwzeEWplCP68ku12Hpp+73/sg8Zk2sPkWYo2+HpOilfESGgRa0e7RorG3u2n2p/i556YRt06m+2HZzAbN0X7XNNIyzXdG1ejj7vtDk5Olzf+mqrXKn7tpLkNcaxG93c3nToDTpMyY5AYtSJxRDt1zsxpfWVk5JsPNqpu/0GTly0mK1vbS0tL/ddNchrjaqBvdfPpc3HPTiu/sZj3Yqu3o3dNKy7Teq93ornTfHeJgnf+N65v6KzfNZYjLI/6jMrKdbQRMxwrtm/J1Cenn96KfS8fy6plpl1f0844EqtXoGlcW6OcujXDiXfq55ykWQkr9Ngr9vCMVn0sIshomDTNtYNv1vBVUQf6/YWAV9V4ZbjKd69AKsd9QaQfATfNqKCrvgdNdq17r3utzcc9NK+6nqVatXj2ttEzrvbZRgK2/5L4/tM6LLyf5hP6Nm96yxOW9e6eb19DlVI2iY256yxKvVaMb3LzuBqYUdzqZe2srqH3SIFDzE26ayxBvtbb/h5vP0L4nS5ufJskq43Xnpn+W42qjMus47rYyTdbUs56jn2cGgqeewAklwNfP/fI7oWT0fI2vS6Cfd1D5XHoCnOAJP03o56mszo41TFAavV/lywn9PEw59Zbgwc7MtoHN8yypRpXMbmUHQ1T8q6Rofc7NRXgNeLbyq0bV+9z0liXe2t6+1s1raHKyTqb9S4N1MmVsKs1GFGm+7a+8A7KdF6+uca+dRtwvO6oDSrWmYcpcZfQradz+dis27tnJx/30qLP1d5NPxfTfqGmxn3JT4XNxz00j7g9KSU4bKlvZhmsaCZvwO80rtHtwITDDjVcXq2xdO2FMQbxOcrrLTYjfJrjnphH3v3H0844UQpPTjucNj34eppzQz/dqMfTzPRYhx0LXz4dlF/sPOHZfZtdo/3Shf2tKR0k7me1Pu4KzxQRDlnNUrZayk3nkyJHj9x0/oYHdVi2VV9hyKmcn02TT6bzsHk3ldHI1bIdLdTJL523TkVPV1gj8kVROGxubFfsXalAn829DTds407W1tXWt+3zzbgm57qvWqpk149y0z3rcOi8Sz9m67/4TmbGGoLJvg0C2gVBQiZpQYrSO7a161fnp69bXT1XsX6gB/bwjGfTzMEso+nmYcslLFfp5HpXwjkmXKJR+fliCM+3B5sOIonYpXdBlsDFFqzBBimEpPdhMQOoPFGaNQBkDThemUI04odVK5cSIHznWx21sLBSqDhgVjHa1cseonjWJ50SV7JTWSbwzhHccPXr0hIwhe+6xISRqnzRoEOiBfU7P9KlqJQp7NMGhrzIVlnudk7axR6PqPWN/xwhfgH4+QphjfBT6+RjhjvDR6OcjhDnmR6GfjxnwlB5fKgOblK17p8R5qq+V6/DdU03AIV8uI1O4Q+KHzMthL1cZLY6BrVoN1xXosOAPeb3klFk8/5C3T/zyc8/NTmmdeAKm9cJW4er8Eg8uFMfApqGQ9WkV6Wm/V+1zYQZWVE9nd6aYNryJvr9dqEEg9POJFo6BX4Z+PjC6id6o7wn9fKLEB38Z+vng7EK+s1QGNrmNFmpEb1QFx9ZNGdWzJvOcaqEUw1EyKVijuDHKvBfsWYXxYFGZKoxn0OjLQPUbo3/m+J7YqrZLO/VQ5bQwxpBqpV1aA5tKf7jzDLs/zcKUqe6kD3mkWqxpzOjnQ8p7YreXWj8vzAC4igP6+cS+icFfhH4+OLvQ7/z/h9g5JEdFJDcAAAAASUVORK5CYII="); + background-size: 101% 100%; + // background-repeat: repeat-x; + // background-color: white; + // background-size: 30px 30px; + background-position: -1px 0; + } + } + } + .footer { + padding-top: 106rpx; + .btn { + margin: 0 auto 24rpx; + width: 440rpx; + height: 96rpx; + background: #e04775; + border-radius: 48rpx; + line-height: 96rpx; + text-align: center; + font-size: 32rpx; + color: #ffffff; + box-sizing: border-box; + } + .btn1 { + border: 2rpx solid #e04775; + background-color: transparent; + color: #e04775; + } + .btn2 { + background-color: transparent; + color: #e04775; + } + } +} diff --git a/src/patient/pages/liveResult/index.ts b/src/patient/pages/liveResult/index.ts new file mode 100644 index 0000000..456696d --- /dev/null +++ b/src/patient/pages/liveResult/index.ts @@ -0,0 +1,100 @@ +const app = getApp(); +import dayjs from "dayjs"; +let live_time: null | number = null; + +Page({ + data: { + id: "", + detail: {} as any, + liveDetail: {} as any, + userInfo: {}, + codeUrl: "", + dateValue: "" as string | number, + rewardScore: 0 as number | undefined, + }, + onLoad(options) { + this.setData({ + id: options.id, + rewardScore: options.rewardScore, + }); + if (live_time) { + clearInterval(live_time); + } + this.setData({ + dateValue: dayjs().valueOf(), + }); + live_time = setInterval(() => { + this.setData({ + dateValue: dayjs().valueOf(), + }); + }, 1000); + app.waitLogin().then((_res) => { + this.getLiveDetail(); + this.getDetail(); + this.getCode(); + app.getUserInfo(this, true); + }); + }, + getDetail() { + wx.ajax({ + method: "GET", + url: "?r=xd/activity/sign-up-detail", + data: { + Id: this.data.id, + }, + }).then((res) => { + res.BeginTime = dayjs(res.BeginTime).format("YYYY-MM-DD HH:mm"); + res.BeginTimeValue = dayjs(res.BeginTime).valueOf(); + this.setData({ + detail: res, + }); + }); + }, + getLiveDetail() { + wx.ajax({ + method: "GET", + url: "?r=xd/activity/detail", + data: { + Id: this.data.id, + }, + }).then((res) => { + this.setData({ + liveDetail: res, + }); + }); + }, + handleLive() { + const { TencentMeetingCode } = this.data.detail; + wx.navigateToMiniProgram({ + appId: "wx33fd6cdc62520063", // 要跳转的微信小程序appid + path: `pages/index/index?code=${TencentMeetingCode}`, + }); + }, + getCode() { + const { registChannel } = app.globalData; + wx.ajax({ + method: "GET", + url: "?r=xd/common/get-channel-wx-code", + data: { + Id: this.data.id, + ChannelType: registChannel, + }, + }).then((res) => { + this.setData({ + codeUrl: res, + }); + }); + }, + handleHome() { + wx.reLaunch({ + url: "/pages/index/index", + }); + }, + onShareAppMessage() { + return { + title: this.data.detail.ActivityName, + path: `/pages/liveDetail/index?id=${this.data.detail.ActivityId}`, + imageUrl: `${this.data.liveDetail.IntroductionUrl}`, + }; + }, +}); diff --git a/src/patient/pages/liveResult/index.wxml b/src/patient/pages/liveResult/index.wxml new file mode 100644 index 0000000..70b2f55 --- /dev/null +++ b/src/patient/pages/liveResult/index.wxml @@ -0,0 +1,61 @@ + + + + 资料审核中 + 资料审核通过后可参与活动 + + + + + 报名成功 + 您已成功报名大咖秀 + + +{{rewardScore}} + 能量 + + + + + + + + + + + + {{detail.ActivityName}} + + + {{detail.BeginTime}} + + 地点:{{detail.Location}} + + + 关注"gMG给力加油站"公众号获取活动通知 + + + + + + + 随便看看 + + + + + 进入会议间 + + + + + 立即进入会议间 + + + + + + diff --git a/src/patient/pages/login/index.json b/src/patient/pages/login/index.json new file mode 100644 index 0000000..a8915fd --- /dev/null +++ b/src/patient/pages/login/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "van-divider": "@vant/weapp/divider/index" + } +} diff --git a/src/patient/pages/login/index.scss b/src/patient/pages/login/index.scss new file mode 100644 index 0000000..4257c78 --- /dev/null +++ b/src/patient/pages/login/index.scss @@ -0,0 +1,139 @@ +pgae { +} +.page { + padding-bottom: 80rpx; + position: relative; + height: 100vh; + background-color: #fafafa; + .bg { + width: 100%; + } + .container { + position: absolute; + left: 0; + top: 300rpx; + width: 100%; + .frame { + display: block; + margin: 0 auto; + width: 124rpx; + height: 145rpx; + } + .title { + display: block; + margin: 32rpx auto 0; + width: 430rpx; + height: 50rpx; + } + .content { + padding: 32rpx 50rpx 0; + font-size: 32rpx; + color: rgba(102, 102, 102, 1); + line-height: 64rpx; + .link { + color: rgba(207, 83, 117, 1); + } + } + .form { + margin-top: 32rpx; + padding: 0 64rpx; + .row { + margin-bottom: 40rpx; + display: flex; + .input { + flex: 1; + padding: 24rpx 32rpx; + height: 40rpx; + font-size: 28rpx; + color: #999999; + background: #f2f2f2; + border: 1rpx solid #cccccc; + border-radius: 24rpx; + } + .code { + margin-left: 24rpx; + flex-shrink: 0; + width: 212rpx; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 28rpx; + color: #e04775; + display: flex; + align-items: center; + justify-content: center; + } + .submit { + width: 622rpx; + height: 88rpx; + background: #e04775; + border-radius: 24rpx; + font-size: 34rpx; + color: #ffffff; + font-weight: bold; + text-align: center; + line-height: 88rpx; + } + } + } + .phone-btn { + margin: 48rpx 50rpx 0; + height: 88rpx; + line-height: 88rpx; + text-align: center; + font-size: 34rpx; + color: #ffffff; + background: #cf5375; + border-radius: 24rpx 24rpx 24rpx 24rpx; + &::after { + border: none; + outline: none; + } + } + .divider { + margin: 48rpx auto 0; + width: 300rpx; + } + .other { + margin-top: 48rpx; + display: flex; + justify-content: center; + align-items: center; + .col { + font-size: 32rpx; + color: rgba(153, 153, 153, 1); + display: flex; + align-items: center; + justify-content: center; + } + .line { + flex-shrink: 0; + margin: 0 50rpx; + width: 1rpx; + height: 36rpx; + background-color: rgba(221, 221, 221, 1); + } + } + .argument { + margin-top: 76rpx; + padding: 0 50rpx; + .a-col { + margin-bottom: 20rpx; + display: flex; + gap: 12rpx; + + .icon { + flex-shrink: 0; + width: 36rpx; + height: 36rpx; + } + .a-content { + font-size: 28rpx; + color: rgba(102, 102, 102, 1); + .link { + color: rgba(207, 83, 117, 1); + } + } + } + } + } +} diff --git a/src/patient/pages/login/index.ts b/src/patient/pages/login/index.ts new file mode 100644 index 0000000..7640856 --- /dev/null +++ b/src/patient/pages/login/index.ts @@ -0,0 +1,175 @@ +const app = getApp(); +let timer = null as null | number; + +Page({ + data: { + mobile: '', + code: '', + + check1: false, + check2: false, + + codeText: '发送验证码', + page: '', + }, + onLoad(options: any) { + this.setData({ + page: options.page, + }); + app.waitLogin({ isReg: false, loginPage: true }).then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTLOGIN' }); + }); + }, + getCode() { + if (timer) return; + const mobile = this.data.mobile; + if (!mobile) { + wx.showToast({ + title: '手机号不能为空', + icon: 'none', + }); + return; + } + // 验证手机号 + if (!/^1[3-9,]\d{9}$/.test(mobile)) { + wx.showToast({ + title: '手机号格式不正确', + icon: 'none', + }); + return; + } + wx.ajax({ + method: 'POST', + url: '?r=xd/login/send-verify-code', + data: { + mobile, + }, + }).then((_res) => { + wx.showToast({ + icon: 'none', + title: '验证码已发送~', + }); + let time = 60; + timer = setInterval(() => { + time--; + this.setData({ + codeText: `${time}s后重新发送`, + }); + if (time <= 0) { + clearInterval(timer as number); + timer = null; + this.setData({ + codeText: '发送验证码', + }); + } + }, 1000); + }); + }, + handleSubmit() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTLOGIN' }); + const { mobile, code } = this.data; + const { registrationSource, registChannel, regBusinessId } = app.globalData; + wx.ajax({ + method: 'POST', + url: '?r=xd/login/reg-login', + data: { + mobile, + code, + registrationSource, + registChannel, + regBusinessId, + }, + }).then((_res) => { + this.submitCallback(); + }); + }, + handleWxSubmit(e: WechatMiniprogram.CustomEvent) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTQUICKPATIENTLOGIN' }); + const { iv, encryptedData } = e.detail; + const { registrationSource, registChannel, regBusinessId } = app.globalData; + if (iv && encryptedData) { + wx.ajax({ + method: 'POST', + url: '?r=xd/login/wx-reg-login', + data: { + iv: encodeURIComponent(iv), + encryptedData: encodeURIComponent(encryptedData), + registrationSource, + registChannel, + regBusinessId, + }, + }).then((_res) => { + this.submitCallback(); + }); + } + }, + handleWxCheck() { + wx.showToast({ + icon: 'none', + title: '请先同意隐私政策', + }); + }, + submitCallback() { + const { page } = this.data; + app.globalData.loginType = 1; + app.globalData.isLogin = true; + app.getUserInfo(this, true, (userInfo) => { + // 1-空白用户,2-注册用户,3-疾病患者,4-用药患者 + const { PatientId, AuditStatus, UserType } = userInfo; + const backPage = app.globalData.backPage; + let urlKey = ''; + if (UserType >= 3) { + urlKey = 'home'; + } else if (!PatientId) { + urlKey = 'agreement'; + } else if (AuditStatus == 1 && typeof backPage === 'string' && backPage.includes('liveResult')) { + urlKey = 'home'; + } else if ([0, 2].includes(AuditStatus)) { + urlKey = 'enterInfo'; + } + const navUrl = { + home: backPage || '/pages/index/index', + agreement: `/pages/enterInfo/index`, + enterInfo: '/pages/enterInfo/index', + }[urlKey]; + + if (['agreement', 'enterInfo'].includes(urlKey)) { + wx.navigateTo({ + url: navUrl, + }); + } else { + wx.reLaunch({ + url: navUrl, + }); + } + }); + }, + handleVisitors() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTLOOKAROUND' }); + app.globalData.anyWhere = true; + app.globalData.first = true; + app.globalData.loginType = 1; + wx.reLaunch({ + url: '/pages/index/index', + }); + }, + handleDoctor() { + wx.reLaunch({ + url: '/doctor/pages/d_login/index', + }); + }, + handleLink(e: any) { + const { url } = e.currentTarget.dataset; + wx.navigateTo({ + url, + }); + }, + handleCheck(e: any) { + const { key } = e.currentTarget.dataset; + this.setData({ + [key]: !this.data[key], + }); + }, +}); + +export {}; diff --git a/src/patient/pages/login/index.wxml b/src/patient/pages/login/index.wxml new file mode 100644 index 0000000..f12507e --- /dev/null +++ b/src/patient/pages/login/index.wxml @@ -0,0 +1,90 @@ + + + + + + + + 在您加入gMG 给力加油站平台之前,请您阅读并充分理解 + 《个人信息及隐私保护政策》 + ,了解您的权益及相关数据处理方法,我们将严格按照法律法规及 + 《个人信息及隐私保护政策》 + 的相关规定保证您的个人信息不受侵犯。 + + + + + + + + + + + + + + + + + + + + + 我已阅读并同意 + 《个人信息及隐私协议政策》 + + + + + + + 我特此同意依照此 + 《个人信息及隐私保护政策》 + 规定收集我的个人敏感信息 + + + + + + 随便看看 + + + + + 我是医生 + + + + + diff --git a/src/patient/pages/my/index.json b/src/patient/pages/my/index.json new file mode 100644 index 0000000..5f2a94d --- /dev/null +++ b/src/patient/pages/my/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "个人中心", + "navigationStyle": "custom", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "navBar": "/components/zd-navBar/navBar", + "van-switch": "@vant/weapp/switch/index" + } +} diff --git a/src/patient/pages/my/index.scss b/src/patient/pages/my/index.scss new file mode 100644 index 0000000..77593bc --- /dev/null +++ b/src/patient/pages/my/index.scss @@ -0,0 +1,203 @@ +page { + background-color: #fcfcfc; +} +.page { + .bg { + width: 100%; + height: 902rpx; + } + + .page-container { + position: absolute; + left: 0; + top: 0; + width: 100%; + padding: 0 40rpx; + box-sizing: border-box; + padding-bottom: 200rpx; + + .banner { + padding: 24rpx; + border-radius: 24rpx; + background: rgba(255, 255, 255, 0.13); + border: 2rpx solid rgba(235, 236, 238, 0.51); + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + .user { + display: flex; + align-items: center; + justify-content: space-between; + .avatar { + flex-shrink: 0; + width: 116rpx; + height: 116rpx; + border-radius: 50%; + border: 4rpx solid #fff; + } + .inner { + flex: 1; + padding-left: 16rpx; + .name { + font-size: 40rpx; + font-weight: bold; + color: var(--name); + } + + .tip { + margin-top: 16rpx; + font-size: 24rpx; + color: #9e9e9e; + + .day { + font-size: 36rpx; + color: var(--name); + font-weight: bold; + } + } + } + } + .options { + margin-top: 32rpx; + padding: 30rpx 22rpx; + display: flex; + align-items: center; + justify-content: space-between; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 1rpx solid rgba(222, 222, 222, 0.6); + .ver-line { + margin: 0 26rpx; + flex-shrink: 0; + width: 2rpx; + height: 60rpx; + background-color: rgba(221, 221, 221, 0.6); + } + .option { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + .icon { + margin-right: 16rpx; + width: 50rpx; + height: 50rpx; + } + .wrap { + .title { + font-size: 28rpx; + color: #484848; + font-weight: bold; + .sub { + font-size: 20rpx; + } + } + .content { + margin-top: 4rpx; + font-size: 20rpx; + color: var(--name); + display: flex; + align-items: center; + justify-content: center; + &.gift { + color: #c2c2c2; + } + + .line { + margin: 0 10rpx; + width: 2rpx; + height: 16rpx; + background-color: var(--name); + } + } + } + } + } + .notice { + margin-top: 24rpx; + height: 44rpx; + background: linear-gradient(90deg, rgba(241, 241, 241, 0) 0%, #f1f1f1 52%, rgba(241, 241, 241, 0) 100%); + border-radius: 16rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 24rpx; + color: #3f3f3f; + .icon { + margin-right: 6rpx; + width: 30rpx; + height: 24rpx; + } + } + } + .common-operations { + margin-top: 32rpx; + display: flex; + .item { + flex: 1; + padding: 30rpx; + display: flex; + align-items: center; + justify-content: center; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid rgba(235, 236, 238, 0.51); + .icon { + width: 64rpx; + height: 64rpx; + margin-right: 16rpx; + } + .name { + font-size: 32rpx; + color: #474747; + } + } + .item:first-of-type { + margin-right: 30rpx; + } + } + .options-list { + margin-top: 32rpx; + padding: 16rpx 28rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid rgba(235, 236, 238, 0.51); + .row { + padding: 30rpx 0; + display: flex; + align-items: center; + justify-content: space-between; + .col { + font-size: 32rpx; + color: #484848; + display: flex; + align-items: center; + > view:not(:last-of-type), + > image { + margin-right: 16rpx; + } + .icon { + width: 36rpx; + height: 36rpx; + } + .icon { + width: 40rpx; + height: 36rpx; + } + } + .more { + font-size: 30rpx; + color: #e7e8e9; + font-weight: bold; + } + } + } + } + .switch-doctor { + margin-top: 80rpx; + text-align: center; + font-size: 32rpx; + color: #484848; + } +} diff --git a/src/patient/pages/my/index.ts b/src/patient/pages/my/index.ts new file mode 100644 index 0000000..8d8cde0 --- /dev/null +++ b/src/patient/pages/my/index.ts @@ -0,0 +1,138 @@ +import dayjs from 'dayjs' +const app = getApp() + +Page({ + data: { + today: dayjs().format('YYYY年MM月DD日 dddd'), + userInfo: {} as any, + RegDay: 0, + RegDaysName: '', + integral: 0, + selfScore: { + expire: {}, + }, + + adlNewRecord: {} as any, + }, + onLoad() { + app.getTheme().then((res) => { + this.setData({ + theme: res, + }) + }) + + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + wx.hideShareMenu() + }, + onShow() { + app.waitLogin().then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTMY' }) + app.getUserInfo(this, true, () => {}) + this.getScore() + }) + }, + getScore() { + wx.ajax({ + method: 'GET', + url: '?r=xd/patient-score/get-self-score', + data: {}, + }).then((res) => { + this.setData({ + selfScore: res, + }) + }) + }, + handleMyHealthRecord(e) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTMYPAGEHEALTHRECORD' }) + const { url } = e.currentTarget.dataset + app.permissionVerification(3, 0, url).then(() => { + wx.navigateTo({ + url, + }) + }) + }, + handleFamily(e) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTMYPAGEFAMILYMEMBERS' }) + const { url } = e.currentTarget.dataset + app.permissionVerification(3, 0, url).then(() => { + wx.navigateTo({ + url, + }) + }) + }, + handleAdlChaneg(e) { + if (!e.detail) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTMYPAGECLOSEADLREMINDER' }) + } + wx.ajax({ + method: 'POST', + url: '?r=xd/account/update-adl-notify-switch', + data: { + AdlNotifySwitch: e.detail ? 1 : 2, + }, + }).then(() => { + app.getUserInfo(this, true) + }) + }, + routerTo(e) { + const { url } = e.currentTarget.dataset + if (!url) { + wx.showToast({ + icon: 'none', + title: '工程师正在努力建设中,敬请期待!', + }) + } + if (url === '/pages/mySave/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTMYPAGEFAVORITES' }) + } + if (url === '/pages/myLive/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTMYPAGESIGNEDUPMEETINGS' }) + } + if (url === '/pages/personalInformation/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTMYPAGEPERSONALINFO' }) + } + if (url === '/pages/storyList/index') { + app.zdMpBehavior({ PageName: 'BTN_PATIENTMYPAGEMYSTORIES' }) + } + wx.navigateTo({ + url, + }) + }, + routerVipTo() { + const { MedicineAuditSwitch, UseDrugsAuditStatus, isFollow } = this.data.userInfo + if (MedicineAuditSwitch === '0') { + wx.navigateTo({ + url: '/pages/vipLogin/index', + }) + } else if (MedicineAuditSwitch === '1') { + const pendPath = { + 0: '/gift/pages/vipPending/index', + 1: '/gift/pages/vipStartPending/index', + }[isFollow] + const url = { + 1: pendPath, + 2: '/gift/pages/vipReject/index', + }[UseDrugsAuditStatus] + wx.navigateTo({ + url: url || '/gift/pages/vipCert/index', + }) + } else { + wx.showToast({ + icon: 'none', + title: '工程师正在努力建设中,敬请期待!', + }) + } + }, + + handleMiniDoctor() { + wx.navigateTo({ + url: '/pages/webview/index', + }) + }, +}) diff --git a/src/patient/pages/my/index.wxml b/src/patient/pages/my/index.wxml new file mode 100644 index 0000000..a22c751 --- /dev/null +++ b/src/patient/pages/my/index.wxml @@ -0,0 +1,150 @@ + + + + + + + + + 健康档案 + + + + 我的收藏 + + + + + + + 我报名的会议 + + + + + + + + + 我的亲友 + + + + + + + + + 个人信息 + + + + + + + + + 我的故事 + + + + + + + + + + + + + + + + + + ADL提醒 + + + + + + + + diff --git a/src/patient/pages/myLive/index.json b/src/patient/pages/myLive/index.json new file mode 100644 index 0000000..9c015df --- /dev/null +++ b/src/patient/pages/myLive/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "我报名的活动", + "usingComponents": { + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/patient/pages/myLive/index.scss b/src/patient/pages/myLive/index.scss new file mode 100644 index 0000000..fa917d4 --- /dev/null +++ b/src/patient/pages/myLive/index.scss @@ -0,0 +1,318 @@ +.page { + padding-bottom: 120rpx; + .sticky { + position: sticky; + top: 0; + left: 0; + z-index: 20; + background-color: #fff; + padding-bottom: 10rpx; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + .tab { + font-size: 32rpx; + color: #9e9e9e; + } + .tab-active { + font-size: 36rpx; + color: #484848; + } + } + + .allin-list { + margin: 32rpx 30rpx; + .on-list-item { + margin-bottom: 20rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + + .photo-wrap { + position: relative; + .photo { + border-radius: 24rpx 24rpx 0 0; + display: block; + width: 100%; + height: 388rpx; + } + .status { + padding: 6rpx 32rpx; + position: absolute; + top: 0; + left: 0; + display: flex; + align-items: center; + background: linear-gradient(90deg, #e5e9f5 0%, #fde4ec 100%); + border-radius: 24rpx 0rpx 24rpx 0rpx; + font-size: 28rpx; + color: #e04775; + .dot { + margin-right: 8rpx; + width: 13rpx; + height: 13rpx; + border-radius: 50%; + background-color: #e04775; + } + &.bad { + color: #484848; + background: #e6e6e6; + .dot { + display: none; + } + } + } + .date { + padding: 18rpx 18rpx 8rpx; + position: absolute; + left: 40rpx; + bottom: 0; + background: #e04775; + border-radius: 11rpx 11rpx 0rpx 0rpx; + text-align: center; + .d-title { + font-size: 22rpx; + color: #ffffff; + font-weight: bold; + } + .ymd { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + border-bottom: 2rpx solid rgba(255, 255, 255, 0.34); + } + .hm { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + } + } + } + .inner { + padding: 32rpx 34rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + .tag { + margin-bottom: 16rpx; + width: 112rpx; + height: 36rpx; + font-size: 22rpx; + color: #ffffff; + line-height: 36rpx; + text-align: center; + background: #ffc137; + border-radius: 8rpx; + } + .title { + font-size: 32rpx; + color: #252525; + font-weight: bold; + .t-tag { + display: inline-block; + width: 112rpx; + height: 36rpx; + font-size: 22rpx; + color: #ffffff; + line-height: 36rpx; + text-align: center; + background: #e04775; + border-radius: 8rpx; + margin-right: 1em; + } + } + .content { + margin-top: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; + .labels { + display: flex; + align-items: center; + flex-wrap: wrap; + .label { + margin-right: 16rpx; + margin-bottom: 16rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: #e04775; + border-radius: 18rpx; + background-color: rgba(224, 71, 117, 0.13); + word-break: break-all; + } + } + .people { + color: #9e9e9e; + font-size: 22rpx; + } + } + .footer { + margin-top: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .site { + font-size: 22rpx; + color: #bebebe; + } + .btn { + margin-left: 10rpx; + flex-shrink: 0; + padding: 4rpx 36rpx; + font-size: 28rpx; + color: #ffffff; + background: #e04775; + border-radius: 24rpx; + &.active { + color: #484848; + background-color: #e7e7e7; + } + .icon { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + .off-list-item { + margin-bottom: 20rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + + .photo-wrap { + position: relative; + .photo { + border-radius: 24rpx 24rpx 0 0; + display: block; + width: 100%; + height: 388rpx; + } + .status { + padding: 6rpx 32rpx; + position: absolute; + top: 0; + left: 0; + display: flex; + align-items: center; + background: linear-gradient(90deg, #e5e9f5 0%, #fde4ec 100%); + border-radius: 24rpx 0rpx 24rpx 0rpx; + font-size: 28rpx; + color: #e04775; + .dot { + margin-right: 8rpx; + width: 13rpx; + height: 13rpx; + border-radius: 50%; + background-color: #e04775; + } + &.bad { + color: #484848; + background: #e6e6e6; + .dot { + display: none; + } + } + } + .date { + padding: 18rpx 18rpx 8rpx; + position: absolute; + left: 40rpx; + bottom: 0; + background: #e04775; + border-radius: 11rpx 11rpx 0rpx 0rpx; + text-align: center; + .d-title { + font-size: 22rpx; + color: #ffffff; + font-weight: bold; + } + .ymd { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + border-bottom: 2rpx solid rgba(255, 255, 255, 0.34); + } + .hm { + font-size: 18rpx; + color: #fff; + line-height: 28rpx; + } + } + } + .inner { + padding: 32rpx 34rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + .tag { + margin-bottom: 16rpx; + width: 112rpx; + height: 36rpx; + font-size: 22rpx; + color: #ffffff; + line-height: 36rpx; + text-align: center; + background: #ffc137; + border-radius: 8rpx; + } + .title { + font-size: 32rpx; + color: #252525; + font-weight: bold; + } + .content { + margin-top: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; + .labels { + display: flex; + align-items: center; + flex-wrap: wrap; + .label { + margin-right: 16rpx; + margin-bottom: 16rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: #e04775; + border-radius: 18rpx; + background-color: rgba(224, 71, 117, 0.13); + word-break: break-all; + } + } + .people { + color: #9e9e9e; + font-size: 22rpx; + } + } + .footer { + margin-top: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + .site { + font-size: 22rpx; + color: #bebebe; + } + .btn { + margin-left: 10rpx; + flex-shrink: 0; + padding: 4rpx 36rpx; + font-size: 28rpx; + color: #ffffff; + background: #e04775; + border-radius: 24rpx; + &.active { + color: #484848; + background-color: #e7e7e7; + } + .icon { + width: 24rpx; + height: 24rpx; + } + } + } + } + } + } +} diff --git a/src/patient/pages/myLive/index.ts b/src/patient/pages/myLive/index.ts new file mode 100644 index 0000000..b1998c6 --- /dev/null +++ b/src/patient/pages/myLive/index.ts @@ -0,0 +1,126 @@ +import dayjs from 'dayjs' +const app = getApp() +let live_time: null | number = null + +Page({ + data: { + active: 0, + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + online_open_status: 1, // 线上 + offline_open_status: 1, // 线下 + liveStatus: app.globalData.liveStatus, + activityStatus: app.globalData.activityStatus, + userInfo: {}, + }, + onLoad() { + this.setData({ + dateValue: dayjs().valueOf(), + }) + if (live_time) { + clearInterval(live_time) + } + live_time = setInterval(() => { + this.setData({ + dateValue: dayjs().valueOf(), + }) + }, 1000) + app.waitLogin().then(() => { + this.getConfig() + app.getUserInfo(this, true) + }) + }, + getConfig() { + wx.ajax({ + method: 'GET', + url: '?r=xd/common/get-config', + data: {}, + }).then((res) => { + let active = 0 + if (res.online_open_status == 0) { + active = 1 + } + this.setData({ + online_open_status: res.online_open_status, + offline_open_status: res.offline_open_status, + active, + }) + this.getList() + }) + }, + getList(newPage = 1) { + const { active } = this.data + if (newPage == 1 && active == 0) { + app.zdMpBehavior({ PageName: 'PG_PATIENTMYEVENTS_ALL' }) + } + if (newPage == 1 && active == 1) { + app.zdMpBehavior({ PageName: 'PG_PATIENTMYEVENTS_ONLINE' }) + } + if (newPage == 1 && active == 2) { + app.zdMpBehavior({ PageName: 'PG_PATIENTMYEVENTS_OFFLINE' }) + } + wx.ajax({ + method: 'GET', + url: '?r=xd/activity/sign-up-list', + data: { + Type: Number(active) == 0 ? '' : Number(active), + page: newPage, + }, + }).then((res) => { + res.list = res.list.map((item) => { + item.EndTimeValue = dayjs(item.EndTime).valueOf() + item.BeginTimeValue = dayjs(item.BeginTime).valueOf() + item.SignUpDeadlineValue = dayjs(item.SignUpDeadline).valueOf() + item.BeginDate = dayjs(item.BeginTime).format('YYYY-MM-DD') + item.EndDate = dayjs(item.EndTime).format('YYYY-MM-DD') + item.isDay = item.BeginDate == item.EndDate + item.BeginHm = dayjs(item.BeginTime).format('HH:mm') + item.EndHm = dayjs(item.EndTime).format('HH:mm') + item.BeginTime = dayjs(item.BeginTime).format('YYYY-MM-DD HH:mm') + item.EndTime = dayjs(item.EndTime).format('YYYY-MM-DD HH:mm') + return item + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + tabChange(e) { + this.setData({ + active: e.detail.index, + }) + this.getList() + }, + handleDetail(e) { + const { id } = e.currentTarget.dataset + const {active} = this.data + if (active == 0) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTSIGNEDUPACTIVITIESALLLIST' }) + } + if (active == 1) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTSIGNEDUPACTIVITIESONLINELIST' }) + } + if (active == 2) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTSIGNEDUPACTIVITIESOFFLINELIST' }) + } + wx.navigateTo({ + url: `/pages/liveDetail/index?id=${id}`, + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, +}) diff --git a/src/patient/pages/myLive/index.wxml b/src/patient/pages/myLive/index.wxml new file mode 100644 index 0000000..f948fdf --- /dev/null +++ b/src/patient/pages/myLive/index.wxml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + {{liveStatus[item.Status]}} + + + + + + + + + + + + + + + + + + 线上活动 + {{item.Name}} + + + {{label}} + + {{item.SignUpPeopleNum}}人已报名 + + + {{item.MasterName}} {{item.MasterTitle}} + 已取消 + 已删除 + 看回放 + 回放生成中 + + + 审核中 + + 参会 + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + + + + + + + {{activityStatus[item.Status]}} + + + + + + + + + + + + + + + + + + 线下活动 + {{item.Name}} + + + {{label}} + + {{item.SignUpPeopleNum}}人已报名 + + + + {{item.Location}} + {{item.Distance}} + + 已结束 + 已取消 + 已删除 + + + 审核中 + + 已报名 + 已报名 + + + + 已满额 + + + + + + + 已满额 + + 报名已截止 + 报名 + + + + + + + + diff --git a/src/patient/pages/mySave/index.json b/src/patient/pages/mySave/index.json new file mode 100644 index 0000000..38dbe75 --- /dev/null +++ b/src/patient/pages/mySave/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "我的收藏", + "usingComponents": { + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index", + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/patient/pages/mySave/index.scss b/src/patient/pages/mySave/index.scss new file mode 100644 index 0000000..e176836 --- /dev/null +++ b/src/patient/pages/mySave/index.scss @@ -0,0 +1,295 @@ +.page { + padding-bottom: 120rpx; + .sticky { + position: sticky; + top: 0; + left: 0; + z-index: 20; + background-color: #fff; + padding-bottom: 10rpx; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + .tab { + font-size: 32rpx; + color: #9e9e9e; + } + .tab-active { + font-size: 36rpx; + color: #484848; + } + } + + .info-list { + margin: 32rpx 30rpx; + padding: 24rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + .list-item { + display: flex; + margin-bottom: 22rpx; + .photo { + width: 232rpx; + height: 184rpx; + flex-shrink: 0; + border-radius: 16rpx; + border: 1rpx solid #ebecee; + margin-right: 16rpx; + } + .inner { + flex: 1; + padding-bottom: 20rpx; + border-bottom: 1rpx solid rgba(182, 183, 186, 0.21); + .title { + font-size: 28rpx; + color: #252525; + font-weight: bold; + line-height: 42rpx; + } + .date { + margin-top: 10rpx; + color: #9e9e9e; + font-size: 22rpx; + } + .labels { + margin-top: 16rpx; + display: flex; + flex-wrap: wrap; + align-items: center; + .label { + margin-right: 16rpx; + margin-bottom: 10rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: #e04775; + word-break: break-all; + border-radius: 18rpx; + background-color: rgba(224, 71, 117, 0.13); + } + } + .footer { + margin-top: 10rpx; + display: flex; + justify-content: flex-end; + .f-item { + display: flex; + align-items: center; + font-size: 22rpx; + color: #b6b7ba; + .icon { + margin-right: 8rpx; + width: 32rpx; + height: 32rpx; + } + &.active { + color: #e04775; + } + &::after { + margin: 18rpx; + content: ""; + width: 2rpx; + height: 20rpx; + background-color: #f3f3f4; + } + } + .share { + padding: 0; + background-color: transparent; + margin: 0; + &::after { + border: none; + outline: none; + } + } + } + } + } + } + + .video-list { + margin: 32rpx 30rpx; + .list-item { + margin-bottom: 20rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + .photo { + position: relative; + border-radius: 24rpx 24rpx 0 0; + display: block; + width: 100%; + height: 388rpx; + overflow: hidden; + .video { + border-radius: inherit; + width: 100%; + height: 100%; + } + .poster { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: inherit; + } + .play { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + width: 104rpx; + height: 104rpx; + } + } + .inner { + padding: 32rpx 34rpx 28rpx; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; + .title { + font-size: 32rpx; + color: #252525; + font-weight: bold; + } + .content { + margin-top: 22rpx; + padding-bottom: 24rpx; + display: flex; + justify-content: space-between; + align-items: center; + border-bottom: 1rpx solid #ebecee; + .labels { + display: flex; + flex-wrap: wrap; + align-items: center; + .label { + margin-right: 16rpx; + margin-bottom: 10rpx; + padding: 2rpx 20rpx; + font-size: 22rpx; + color: #e04775; + word-break: break-all; + border-radius: 18rpx; + background-color: rgba(224, 71, 117, 0.13); + } + } + .date { + color: #9e9e9e; + font-size: 22rpx; + } + } + .footer { + margin-top: 28rpx; + display: flex; + justify-content: space-around; + .f-item { + display: flex; + align-items: center; + font-size: 22rpx; + color: #b6b7ba; + .icon { + margin-right: 8rpx; + width: 32rpx; + height: 32rpx; + } + &.active { + color: #e04775; + } + &::after { + margin: 18rpx; + content: ""; + width: 2rpx; + height: 20rpx; + background-color: #f3f3f4; + } + } + .share { + padding: 0; + background-color: transparent; + margin: 0; + &::after { + border: none; + outline: none; + } + } + } + } + } + } + + .question-list { + margin: 32rpx 30rpx; + .row { + padding: 38rpx 32rpx; + display: flex; + background: #ffffff; + box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0, 0, 0, 0.05); + border-radius: 24rpx; + border: 2rpx solid #ebecee; + margin-bottom: 16rpx; + .num { + padding: 0 15rpx; + font-size: 28rpx; + color: #cf5375; + flex-shrink: 0; + height: 40rpx; + background: #ffffff linear-gradient(136deg, #e8ebfd 0%, #fde0ea 100%); + border-radius: 8rpx; + text-align: center; + line-height: 40rpx; + } + .wrap { + flex: 1; + color: #252525; + padding-left: 16rpx; + display: flex; + align-items: center; + justify-content: space-between; + .content { + flex: 1; + .c-title { + font-size: 28rpx; + color: #252525; + font-weight: bold; + } + .footer { + margin-top: 28rpx; + display: flex; + justify-content: flex-end; + .f-item { + display: flex; + align-items: center; + font-size: 22rpx; + color: #b6b7ba; + .icon { + margin-right: 8rpx; + width: 32rpx; + height: 32rpx; + } + &.active { + color: #e04775; + } + &:not(:last-of-type)::after { + margin: 18rpx; + content: ""; + width: 2rpx; + height: 20rpx; + background-color: #f3f3f4; + } + } + .share { + padding: 0; + background-color: transparent; + margin: 0; + &::after { + border: none; + outline: none; + } + } + } + } + } + } + } +} diff --git a/src/patient/pages/mySave/index.ts b/src/patient/pages/mySave/index.ts new file mode 100644 index 0000000..428558e --- /dev/null +++ b/src/patient/pages/mySave/index.ts @@ -0,0 +1,345 @@ +const app = getApp() +const licia = require('miniprogram-licia') + +Page({ + data: { + active: 0, + list: [] as any, + HistoryId: '', + pagination: { + page: 1, + pages: 1, + count: 1, + }, + picTextStatus: 0, + videoStatus: 0, + config: {} as any, + }, + onLoad() { + app.waitLogin().then(() => { + wx.ajax({ + method: 'GET', + url: '?r=xd/common/get-config', + }).then((res) => { + this.setData({ + config: res, + }) + this.getConfig() + }) + }) + }, + getConfig() { + wx.ajax({ + method: 'GET', + url: '?r=xd/common/get-config', + data: {}, + }).then((res) => { + this.setData({ + picTextStatus: res.picTextStatus, + videoStatus: res.videoStatus, + active: res.picTextStatus == 0 ? 1 : 0, + }) + this.getList() + }) + }, + getList() { + const { active, pagination } = this.data + if (active == 0) { + this.getInfoList() + } else if (active == 1) { + this.getVideoList() + } else if (active == 2) { + this.getQuestionList() + } + + if (active == 0 && pagination.page == 1) { + app.zdMpBehavior({ PageName: 'PG_PATIENTMYFAVORITES_KNOWLEDGEBASE' }) + } + if (active == 1 && pagination.page == 1) { + app.zdMpBehavior({ PageName: 'PG_PATIENTMYFAVORITES_VIDEOCLASS' }) + } + if (active == 2 && pagination.page == 1) { + app.zdMpBehavior({ PageName: 'PG_PATIENTMYFAVORITES_HEALTHQA' }) + } + }, + getInfoList(newPage = 1) { + wx.ajax({ + method: 'GET', + url: '?r=xd/pic-text/collection-list', + data: { + page: newPage, + }, + loading: true, + }).then((res) => { + res.list = res.list.map((item) => { + return item + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + getVideoList(newPage = 1) { + wx.ajax({ + method: 'GET', + url: '?r=xd/video/collection-list', + data: { + page: newPage, + }, + loading: true, + }).then((res) => { + res.list = res.list.map((item) => { + return item + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + getQuestionList(newPage = 1) { + wx.ajax({ + method: 'GET', + url: '?r=xd/health-question/collection-list', + data: { + page: newPage, + }, + loading: true, + }).then((res) => { + res.list = res.list.map((item) => { + return item + }) + const list = res.page == 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + handleStar(e) { + const { id, index } = e.currentTarget.dataset + wx.ajax({ + method: 'POST', + url: '?r=xd/pic-text/compliment', + data: { + ContentId: id, + }, + loading: true, + }).then(() => { + this.setData({ + [`list[${index}].IsCompliment`]: 1, + [`list[${index}].ComplimentNum`]: Number(this.data.list[index].ComplimentNum) + 1, + }) + }) + }, + handleVideoStar(e: WechatMiniprogram.CustomEvent) { + const { id, index } = e.currentTarget.dataset + wx.ajax({ + method: 'POST', + url: '?r=xd/video/compliment', + data: { + ContentId: id, + }, + loading: true, + }).then(() => { + this.setData({ + [`list[${index}].ComplimentNum`]: Number(this.data.list[index].ComplimentNum) + 1, + [`list[${index}].IsCompliment`]: 1, + }) + }) + }, + handleVideoPlay(e: WechatMiniprogram.CustomEvent) { + const { id, index } = e.currentTarget.dataset + const { list } = this.data + list.map((item: any, i) => { + if (item.play && i != index) { + const ctx = wx.createVideoContext(`video${i}`) + ctx.pause() + this.setData({ + [`list[${index}].play`]: false, + }) + } + }) + this.setData({ + [`list[${index}].play`]: true, + }) + wx.ajax({ + method: 'POST', + url: '?r=xd/video/view', + data: { + ContentId: id, + }, + }).then((res) => { + this.setData({ + HistoryId: res.HistoryId, + }) + }) + }, + handleVideo(e: WechatMiniprogram.CustomEvent) { + const { index } = e.currentTarget.dataset + const context = wx.createVideoContext(`video${index}`) + context.play() + }, + handleVideoTime: licia.throttle(function (e: WechatMiniprogram.CustomEvent) { + wx.ajax({ + method: 'GET', + url: '?r=xd/video/watch-duration', + data: { + HistoryId: this.data.HistoryId, + WatchDuration: e.detail.currentTime, + }, + }).then((res) => { + console.log('res: ', res) + }) + }, 5000), + handleVideoPause(e: WechatMiniprogram.CustomEvent) { + console.log(e) + }, + handleDetail(e: WechatMiniprogram.CustomEvent) { + const { id } = e.currentTarget.dataset + if (this.data.config.picTextEbookStatus == 1) { + const webviewUrl = encodeURIComponent( + `${app.globalData.url}/zdcare/#/book?loginState=${app.globalData.loginState}&Id=${id}`, + ) + wx.navigateTo({ + url: `/pages/webview/index?url=${webviewUrl}`, + }) + } else { + wx.navigateTo({ + url: `/pages/repositoryDetail/index?id=${id}`, + }) + } + }, + handleQuestionDetail(e) { + const { id } = e.currentTarget.dataset + const webviewUrl = encodeURIComponent( + `${app.globalData.url}/zdcare/#/info-detail?loginState=${app.globalData.loginState}&Id=${id}`, + ) + wx.navigateTo({ + url: `/pages/webview/index?url=${webviewUrl}`, + }) + }, + handleVideoToggleSave(e: WechatMiniprogram.CustomEvent) { + const { id, collect, index } = e.currentTarget.dataset + if (collect == 1) { + wx.ajax({ + method: 'POST', + url: '?r=xd/video/cancel-collection', + data: { + ContentId: id, + }, + loading: true, + }).then(() => { + wx.showToast({ + title: '取消收藏', + icon: 'none', + }) + this.setData({ + [`list[${index}].IsCollect`]: 0, + [`list[${index}].CollectionPeopleNum`]: Number(this.data.list[index].CollectionPeopleNum) - 1, + }) + }) + } else { + wx.ajax({ + method: 'POST', + url: '?r=xd/video/collection', + data: { + ContentId: id, + }, + loading: true, + }).then(() => { + wx.showToast({ + title: '收藏成功', + icon: 'none', + }) + this.setData({ + [`list[${index}].IsCollect`]: 1, + [`list[${index}].CollectionPeopleNum`]: Number(this.data.list[index].CollectionPeopleNum) + 1, + }) + }) + } + }, + onReachBottom() { + const { page, pages } = this.data.pagination + const { active } = this.data + if (pages > page) { + if (active == 0) { + this.getInfoList(page + 1) + } else { + this.getVideoList(page + 1) + } + } + }, + tabChange(e) { + this.setData({ + active: e.detail.index, + CateId: '', + Search: '', + list: [], + pagination: { + page: 1, + pages: 1, + count: 1, + }, + }) + this.getList() + }, + onShareAppMessage(e: any) { + if (e.from === 'button') { + const { id, index, type } = e.target.dataset + const { list } = this.data + const { Title, TitlePicLink, ImageUrl } = list[index] + if (type == 'info') { + wx.ajax({ + method: 'POST', + url: '?r=xd/pic-text/share', + data: { ContentId: id }, + }).then(() => { + this.setData({ + [`list[${index}].ShareNum`]: Number(this.data.list[index].ShareNum) + 1, + }) + }) + return { + title: Title, + path: `/pages/repositoryDetail/index?id=${id}`, + imageUrl: TitlePicLink, + } + } else { + wx.ajax({ + method: 'POST', + url: '?r=xd/video/share', + data: { ContentId: id }, + }).then(() => { + this.setData({ + [`list[${index}].ShareNum`]: Number(this.data.list[index].ShareNum) + 1, + }) + }) + return { + title: Title, + path: `/pages/repository/index?id=${id}&active=1&title=${Title}`, + imageUrl: ImageUrl, + } + } + } else { + return { + title: '知识库', + path: '/pages/repository/index', + } + } + }, +}) diff --git a/src/patient/pages/mySave/index.wxml b/src/patient/pages/mySave/index.wxml new file mode 100644 index 0000000..ad4452b --- /dev/null +++ b/src/patient/pages/mySave/index.wxml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + {{item.Title}} + {{item.UpdatedAt}} + + {{label}} + + + + + {{~~item.OpenNum + ~~item.BasicNum}} + + + + + {{item.ComplimentNum}} + + + + + + + + + + + + + + + + + {{item.Title}} + + + {{label}} + + {{item.UpdatedAt}} + + + + + {{~~item.OpenNum + ~~item.BasicNum}} + + + + + + {{item.ComplimentNum}} + + + + + {{item.CollectionPeopleNum}} + + + + + + + + + {{item.CateName}} + + + {{ item.Title }} + + + + {{~~item.OpenNum + ~~item.BasicNum}} + + + + + + {{item.ComplimentNum}} + + + + + + + + + + + + + + + + + + + diff --git a/src/patient/pages/nrdl/index.json b/src/patient/pages/nrdl/index.json new file mode 100644 index 0000000..abeb98f --- /dev/null +++ b/src/patient/pages/nrdl/index.json @@ -0,0 +1,13 @@ +{ + "navigationBarTitleText": "艾加莫德医保报销全知道", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "van-divider": "@vant/weapp/divider/index", + "van-cascader": "@vant/weapp/cascader/index", + "van-popup": "@vant/weapp/popup/index", + "van-icon": "@vant/weapp/icon/index", + "toast": "/components/toast/index", + "timeOut": "/components/timeOut/index" + } +} diff --git a/src/patient/pages/nrdl/index.scss b/src/patient/pages/nrdl/index.scss new file mode 100644 index 0000000..0dd8e48 --- /dev/null +++ b/src/patient/pages/nrdl/index.scss @@ -0,0 +1,286 @@ +page { + background-color: #fafafa; + padding-bottom: 80rpx; +} +.page { + .tip { + margin: 708rpx 40rpx 0; + padding: 62rpx 40rpx 38rpx; + background: linear-gradient(180deg, #ffe0ea 0%, #fff 60%, #ffffff 100%); + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border-radius: 24rpx; + border: 2rpx solid rgba(224, 71, 117, 0.25); + .title { + font-size: 36rpx; + color: #14265d; + font-weight: bold; + &.mt { + margin-top: 44rpx; + } + } + .faild { + margin-top: 16rpx; + padding: 0 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + height: 88rpx; + background: #ffffff; + border-radius: 24rpx; + border: 1rpx solid rgba(224, 71, 117, 0.25); + .input { + flex: 1; + font-size: 32rpx; + } + .placeholder-input { + font-size: 32rpx; + color: #b0b0b0; + } + .btn { + font-size: 32rpx; + color: #cd355f; + } + } + .submit { + position: relative; + margin-top: 66rpx; + height: 96rpx; + text-align: center; + line-height: 96rpx; + font-size: 40rpx; + color: #ffffff; + background: linear-gradient(138deg, #cf5375 0%, #cd355f 100%); + border-radius: 24rpx; + border: 1rpx solid rgba(224, 71, 117, 0.25); + } + .num { + margin-top: 24rpx; + font-size: 32rpx; + color: #ce3962; + text-align: center; + } + .swiper { + margin: 10rpx auto 0; + height: 48rpx; + text-align: center; + .siper-item { + font-size: 30rpx; + color: #666666; + line-height: 87rpx; + display: flex; + align-items: center; + justify-content: center; + } + } + } + .policy { + position: relative; + margin: 38px 40rpx 0; + padding: 68rpx 40rpx; + background: #ffffff; + border-radius: 24rpx; + border: 2rpx solid rgba(224, 71, 117, 0.25); + &-title { + position: absolute; + top: 0; + left: 50%; + transform: translate(-50%, -50%); + font-size: 40rpx; + color: #ffffff; + width: 318rpx; + height: 72rpx; + text-align: center; + line-height: 72rpx; + background: linear-gradient(138deg, #cf5375 0%, #cd355f 100%); + border-radius: 36rpx; + } + &-card { + margin-bottom: 32rpx; + padding: 34rpx 30rpx 0; + border-radius: 24rpx; + background: linear-gradient(180deg, #F5E0E6 0%, #ffffff 100%); + background-size: 100% 100rpx; + background-repeat: no-repeat; + border: 2rpx solid #f4cbd8; + .pc-title { + padding-bottom: 20rpx; + display: flex; + justify-content: space-between; + .name { + font-size: 36rpx; + color: #15275e; + font-weight: bold; + } + .status { + padding: 6rpx 24rpx; + font-size: 30rpx; + line-height: 44rpx; + border-radius: 28rpx; + color: #e04775; + background-color: #f5d7df; + &.active { + color: #ffffff; + background-color: #cd3861; + } + } + } + .none { + padding: 30rpx 0; + font-size: 32rpx; + color: #b0b0b0; + border-top: 1px solid #eeeeee; + } + .row { + margin-top: 24rpx; + .name { + flex-shrink: 0; + font-size: 32rpx; + color: #b0b0b0; + } + .content { + font-size: 32rpx; + color: #15275e; + line-height: 44rpx; + padding-bottom: 32rpx; + } + &:not(:last-of-type) { + border-bottom: 1px solid #efefef; + } + } + .row1 { + display: flex; + justify-content: space-between; + } + .row2 { + .content { + margin-top: 16rpx; + } + } + } + .statement { + margin-top: 32rpx; + &-title { + font-size: 36rpx; + color: #15275e; + font-weight: bold; + } + &-content { + font-size: 32rpx; + color: #b4b4b4; + } + } + &-btn { + margin-top: 32rpx; + width: 590rpx; + height: 84rpx; + font-size: 36rpx; + color: #ffffff; + line-height: 84rpx; + text-align: center; + background: linear-gradient(138deg, #cf5375 0%, #cd355f 100%); + border-radius: 24rpx; + border: 1rpx solid rgba(224, 71, 117, 0.25); + } + } + .module1 { + margin: 32px 40rpx 0; + height: 249rpx; + position: relative; + .money { + position: absolute; + top: 0; + top: 0; + } + .label { + margin-top: 35rpx; + width: 243rpx; + height: 50rpx; + } + .title { + margin-top: 8rpx; + padding-left: 47rpx; + font-size: 40rpx; + font-weight: bold; + color: #12245c; + line-height: 54rpx; + } + .content { + padding-left: 47rpx; + font-size: 40rpx; + color: #12245c; + line-height: 54rpx; + } + } + .module2 { + margin: 24rpx 40rpx 0; + width: calc(100% - 80rpx); + height: 248rpx; + position: relative; + .content { + margin-top: 8rpx; + padding-left: 47rpx; + font-size: 40rpx; + color: #12245c; + line-height: 54rpx; + } + .title { + padding-top: 58rpx; + padding-left: 47rpx; + font-size: 40rpx; + font-weight: bold; + color: #12245c; + line-height: 54rpx; + } + } + .container { + margin: 69rpx 40rpx 0; + padding: 73rpx 43rpx 54rpx; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border-radius: 24rpx 24rpx 24rpx 24rpx; + .c-title { + margin: -100rpx auto 0; + font-size: 40rpx; + color: #ffffff; + font-weight: bold; + width: 319rpx; + height: 72rpx; + text-align: center; + line-height: 72rpx; + background: linear-gradient(138deg, #cf5375 0%, #cd355f 100%); + border-radius: 36rpx 36rpx 36rpx 36rpx; + } + .module3 { + margin-top: 38rpx; + height: 243rpx; + position: relative; + } + .more { + margin: 48rpx auto 0; + width: 400rpx; + font-size: 32rpx; + color: #666666; + text-align: center; + } + .video1 { + margin: 38rpx auto 0; + display: block; + width: 100%; + height: 331rpx; + object-fit: cover; + border-radius: 24rpx; + } + .video2 { + margin: 38rpx auto 0; + display: block; + width: 100%; + height: 251rpx; + object-fit: cover; + border-radius: 24rpx; + } + } + .img { + display: block; + width: 100%; + } +} diff --git a/src/patient/pages/nrdl/index.ts b/src/patient/pages/nrdl/index.ts new file mode 100644 index 0000000..869df00 --- /dev/null +++ b/src/patient/pages/nrdl/index.ts @@ -0,0 +1,446 @@ +const app = getApp(); +import dayjs from "dayjs"; + +Page({ + data: { + NrdlOnePicSwitch: 0, + NrdlCityListSwitch: 0, + NrdlQASwitch: 0, + NrdlOnePicAJMDSwitch: 0, + showProgress: false, + video1Height: null as null | string, + video2Height: null as null | string, + + nrdlDetail: {}, + + cascaderShow: false, + options: [], + areaValue: [], + cascaderName: "", + cascaderValue: "", + fieldNames: { text: "label", value: "value", children: "children" }, + + hosList: [] as { HospitalName: string; HospitalId: string }[], + hosName: "", + hosIndex: "", + hosValue: "", + + OtherHospitalName: "", + + toastShow: false, + toastType: "popupNdrlFollow", + toastParams: {} as any, + + LAT: "", + LNG: "", + + follow: false, + + asideOut: false, + asideType: "11", + + score: [], + + medicalInsurancePolicy: null, + + timeToastType: "19", + }, + onLoad() { + const SystemInfo = app.globalSystemInfo; + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition; + this.setData({ + bottom: bottom, + }); + } + app.waitLogin().then((_res) => { + app.zdMpBehavior({ PageName: 'PG_PATIENTNRDL' }) + this.addOpenRecord(); + this.getConfig(); + this.getCode(); + this.getArea(); + this.getNrdlDetail(); + this.getAdlScore(); + }); + }, + getAdlScore() { + wx.ajax({ + method: "GET", + url: "?r=xd/nrdl/get-score", + data: {}, + }).then((res) => { + this.setData({ + score: res, + }); + }); + }, + getConfig() { + wx.ajax({ + method: "GET", + url: "?r=xd/common/get-config", + data: {}, + }).then((res) => { + this.setData({ + NrdlOnePicSwitch: res.NrdlOnePicSwitch, + NrdlCityListSwitch: res.NrdlCityListSwitch, + NrdlQASwitch: res.NrdlQASwitch, + NrdlOnePicAJMDSwitch: res.NrdlOnePicAJMDSwitch, + }); + }); + }, + addOpenRecord() { + wx.ajax({ + method: "POST", + url: "?r=xd/nrdl/add-open-record&OpenType=1", + data: {}, + }).then((res) => { + if (res.CanGetScore) { + this.setData({ + asideOut: true, + }); + } + }); + }, + handleDetail(e) { + const { id } = e.currentTarget.dataset; + if (id == 3) { + wx.navigateTo({ + url: "/pages/nrdlTable/index", + }); + return; + } + wx.navigateTo({ + url: `/pages/nrdlDetail/index?id=${id}`, + }); + }, + getCode() { + wx.ajax({ + method: "GET", + url: "?r=xd/common/get-channel-wx-code", + data: { ChannelType: 12 }, + }).then((res) => { + this.setData({ + ["toastParams.code"]: res, + }); + }); + }, + getNrdlDetail() { + wx.ajax({ + method: "GET", + url: "?r=xd/nrdl-hospital/detail", + data: {}, + }).then((res) => { + res.last10Records = res.last10Records.map((item) => { + return { + ...item, + telephone: item.Telephone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2"), + timeNow: dayjs(item.CreateTime).fromNow().replace(" ", ""), + }; + }); + this.setData({ + nrdlDetail: res, + ["toastParams.follow"]: res.isFollow, + }); + const newRecord = res.newRecord; + if (!Array.isArray(newRecord) && newRecord) { + this.setData({ + areaValue: [newRecord.ProvinceId, newRecord.CityId], + cascaderName: `${newRecord.ProvinceName}/${newRecord.CityName}`, + cascaderValue: newRecord.CityId, + hosName: + { + "0": "暂无选定医院", + "-1": "其它医院", + }[newRecord.HospitalId] || newRecord.HospitalName, + hosValue: newRecord.HospitalId, + OtherHospitalName: newRecord.OtherHospitalName, + follow: true, + }); + this.getHospitalList(); + } + const medicalInsurancePolicy = res.medicalInsurancePolicy; + this.setData({ + medicalInsurancePolicy, + }); + }); + }, + handlePlay(e) { + const { id, width, height } = e.currentTarget.dataset; + let query = wx.createSelectorQuery(); + query + .select(`#${id}`) + .boundingClientRect((rect) => { + let videoWidth = rect.width; + let videoHeight = videoWidth * (height / width); + if (id === "video1") { + this.setData({ + video1Height: videoHeight + "px", + }); + } + if (id === "video2") { + this.setData({ + video2Height: videoHeight + "px", + }); + } + }) + .exec(); + }, + getArea() { + wx.ajax({ + method: "GET", + url: "/js/area.json", + isJSON: true, + }).then((res) => { + this.setData({ + options: res.map((item) => { + return { + ...item, + children: item.children.map((item2) => { + return { + label: item2.label, + value: item2.value, + }; + }), + }; + }), + }); + }); + }, + handleGetSite() { + const that = this; + wx.getSetting({ + success(res) { + if ( + res.authSetting["scope.userFuzzyLocation"] != undefined && + res.authSetting["scope.userFuzzyLocation"] == true + ) { + //获取当前位置 + that.getFuzzyLocation(); + } else if (res.authSetting["scope.userFuzzyLocation"] == undefined) { + //获取当前位置 + that.getFuzzyLocation(); + } else { + wx.showModal({ + title: "请求授权当前位置", + content: "需要获取您的地理位置,请确认授权", + confirmColor: "#cf5375", + success: function (res) { + if (res.cancel) { + //取消授权 + wx.showToast({ + title: "拒绝授权", + icon: "none", + duration: 1000, + }); + } else if (res.confirm) { + //确定授权,通过wx.openSetting发起授权请求 + wx.openSetting({ + success: function (res) { + if (res.authSetting["scope.userFuzzyLocation"] == true) { + //再次授权,调用wx.getLocation的API + that.getFuzzyLocation(); + } else { + wx.showToast({ + title: "授权失败", + icon: "none", + duration: 1000, + }); + } + }, + }); + } + }, + }); + } + }, + }); + }, + getFuzzyLocation() { + const that = this; + wx.getFuzzyLocation({ + success(res) { + that.setData({ + LNG: res.longitude, + LAT: res.latitude, + }); + that.getLocationInfo(); + }, + fail(err) { + console.log(err); + }, + }); + }, + handleCascader() { + this.setData({ + cascaderShow: true, + }); + }, + onFinish(e) { + console.log(e); + const selectedOptions = e.detail.selectedOptions; + this.setData({ + cascaderName: `${selectedOptions[0].label}/${selectedOptions[1].label}`, + cascaderValue: e.detail.value, + areaValue: [selectedOptions[0].value, selectedOptions[1].value], + hosName: "", + hosIndex: "", + hosValue: "", + follow: false, + }); + this.getHospitalList(); + this.onClose(); + }, + onClose() { + this.setData({ + cascaderShow: false, + }); + }, + handleToggleSite() { + const that = this; + if (!this.data.LNG) { + } else { + that.setData({ + LNG: "", + LAT: "", + }); + this.getLocationInfo(); + } + }, + getLocationInfo() { + wx.ajax({ + method: "GET", + url: "?r=xd/nrdl-hospital/location-info", + data: { + lat: this.data.LAT, + lng: this.data.LNG, + }, + loading: true, + }).then((res) => { + this.setData({ + cascaderName: `${res.ProvinceName}/${res.CityName}`, + cascaderValue: res.CityId, + areaValue: [res.ProvinceId, res.CityId], + hosIndex: "", + hosValue: "", + hosName: "", + follow: false, + }); + this.getHospitalList(); + }); + }, + getHospitalList() { + const areaValue = this.data.areaValue; + wx.ajax({ + method: "GET", + url: "?r=xd/nrdl-hospital/list", + data: { + ProvinceId: areaValue[0], + CityId: areaValue[1], + }, + }).then((res) => { + this.setData({ + hosList: [ + { + HospitalName: "暂无选定医院", + HospitalId: "0", + }, + ...res, + { + HospitalName: "其它医院", + HospitalId: "-1", + }, + ], + }); + }); + }, + handleChangeHos(e) { + const index = e.detail.value; + const hos = this.data.hosList[index]; + this.setData({ + hosIndex: index, + hosName: hos.HospitalName, + hosValue: hos.HospitalId, + follow: false, + }); + if (hos.HospitalId !== "-1") { + this.setData({ + OtherHospitalName: "", + }); + } + }, + handleToastCancel() { + this.setData({ + toastShow: false, + }); + }, + handleSubmit() { + const { areaValue, cascaderName, hosName, hosValue, OtherHospitalName } = this.data; + let title = ""; + if (!areaValue.length) { + title = "请选择地区"; + } + if (!hosName) { + title = "请选择医院"; + } + if (title) { + wx.showToast({ + title, + icon: "none", + }); + return; + } + wx.ajax({ + method: "POST", + url: "?r=xd/nrdl-hospital/add", + data: { + ProvinceId: areaValue[0], //省Id + ProvinceName: cascaderName.split("/")[0], //省份名 + CityId: areaValue[1], //城市Id + CityName: cascaderName.split("/")[1], //城市名 + HospitalId: hosValue || undefined, //医院id 为空时填0 + HospitalName: hosName || undefined, //医院名 为空时,空字符串 + OtherHospitalName: OtherHospitalName, + }, + }).then((res) => { + this.setData({ + follow: true, + }); + if (res.rewardScore > 0) { + this.setData({ + timeToast: true, + timeToastParams: { + rewardScore: res.rewardScore, + }, + }); + setTimeout(() => { + this.setData({ + timeToast: false, + }); + }, 3000); + } + this.getAdlScore(); + this.getNrdlDetail(); + }); + }, + handleHos() { + wx.navigateTo({ + url: "/pages/doctor/index", + }); + this.handleDtpRecord(); + }, + handleDtpRecord() { + wx.ajax({ + method: "POST", + url: "?r=xd/nrdl/add-dtp-pharmacy-click-record", + data: {}, + }).then((res) => { + console.log("res: ", res); + }); + }, + handleBack() { + wx.navigateBack(); + }, + catchtouchmove() { + return false; + }, +}); diff --git a/src/patient/pages/nrdl/index.wxml b/src/patient/pages/nrdl/index.wxml new file mode 100644 index 0000000..807e95a --- /dev/null +++ b/src/patient/pages/nrdl/index.wxml @@ -0,0 +1,248 @@ + + + + 我的医保所在地 + + + 一键获取 + + 我计划就诊的医院 + + + + + + + + + 其它医院 + + + + + 已关注 + 抢先关注 + 已有{{nrdlDetail.totalPatientNum}}人抢先关注 + + + {{item.telephone}} {{item.timeNow}}关注 + + + + + + 医保政策 + + + 住院报销政策 + 本地已执行 + 本地待执行 + + + 可报销日期 + {{medicalInsurancePolicy.HospitalizationPolicyReimbursementDate}} + + + + + 门诊报销政策 + + 本地已执行 + + 本地待执行 + + + 可报销日期 + {{medicalInsurancePolicy.OutpatientPolicyReimbursementDate}} + + + 落地政策 + {{medicalInsurancePolicy.OutpatientPolicy}} + + + {{medicalInsurancePolicy.OutpatientPolicy}} + {{medicalInsurancePolicy.OutpatientPolicyIntroduction}} + + + 备注说明 + {{medicalInsurancePolicy.OutpatientPolicyRemark}} + + + + + 双通道药店政策 + 本地已执行 + 本地待执行 + + + 可报销日期 + {{medicalInsurancePolicy.DTPReimbursementDate}} + + + 双通道药店 + {{medicalInsurancePolicy.DTPIntroduction}} + + + 备注说明 + {{medicalInsurancePolicy.DTPRemark}} + + + + 免责声明 + 各地医保报销比例和具体政策请以当地执行为准 + + 我想详细了解就诊医院和药店 + + + 医保政策 + + + 住院政策 + + 暂无相关政策 + + + + 门诊政策 + + 暂无相关政策 + + + + 双通道药店政策 + + 暂无相关政策 + + + 免责声明 + 各地医保报销比例和具体政策请以当地执行为准 + + 我想详细了解就诊医院和药店 + + + + + 艾加莫德医保报销 + 你要知道的事 + + + 城市惠民保 + 自付费用报销list + + + 关于艾加莫德 + + + + + 有力人生,患者心声 + + + + + + + + + + + + + + diff --git a/src/patient/pages/nrdlDetail/index.json b/src/patient/pages/nrdlDetail/index.json new file mode 100644 index 0000000..9cae1dd --- /dev/null +++ b/src/patient/pages/nrdlDetail/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "timeOut": "/components/timeOut/index" + } +} diff --git a/src/patient/pages/nrdlDetail/index.scss b/src/patient/pages/nrdlDetail/index.scss new file mode 100644 index 0000000..69cd03b --- /dev/null +++ b/src/patient/pages/nrdlDetail/index.scss @@ -0,0 +1,10 @@ +page { + background-color: #fafafa; +} +.img { + width: 100%; + display: block; + &.hide { + opacity: 0; + } +} diff --git a/src/patient/pages/nrdlDetail/index.ts b/src/patient/pages/nrdlDetail/index.ts new file mode 100644 index 0000000..0712c2a --- /dev/null +++ b/src/patient/pages/nrdlDetail/index.ts @@ -0,0 +1,94 @@ +const app = getApp() + +Page({ + data: { + id: '', + NrdlCityListSwitch: '0', + isLoad: false, + + asideOut: false, + timeToast: false, + asideType: '11', + }, + onLoad(options) { + this.setData({ + id: options.id, + asideType: { + 2: '12', + 3: '13', + 4: '14', + 5: '15', + }[options.id as string], + }) + const titles = { + 2: '一图读懂报销热点问题', + 3: '报销城市一览', + 4: '艾加莫德常见问题答疑', + 5: '一图读懂艾加莫德', + } + if (options.id) { + wx.setNavigationBarTitle({ + title: titles[options.id], + }) + } + app.waitLogin().then((_res) => { + if (options.id == '2') { + app.zdMpBehavior({ PageName: 'PG_PATIENTIGAMODREIMBURSEMENT' }) + } + if (options.id == '4') { + app.zdMpBehavior({ PageName: 'PG_PATIENTIGAMODFAQ' }) + } + if (options.id == '5') { + app.zdMpBehavior({ PageName: 'PG_PATIENTIGAMODINFO' }) + } + this.addOpenRecord() + this.getConfig() + }) + }, + addOpenRecord() { + wx.ajax({ + method: 'POST', + url: `?r=xd/nrdl/add-open-record&OpenType=${this.data.id}`, + data: {}, + }).then((res) => { + if (res.CanGetScore) { + this.setData({ + asideOut: true, + }) + } + }) + }, + getConfig() { + wx.ajax({ + method: 'GET', + url: '?r=xd/common/get-config', + data: {}, + }).then((res) => { + this.setData({ + NrdlCityListSwitch: res.NrdlCityListSwitch, + }) + }) + }, + handleSwitch() { + if (this.data.id == '2') { + if (this.data.NrdlCityListSwitch == '1') { + wx.navigateTo({ + url: '/pages/nrdlTable/index', + }) + } else { + wx.showToast({ + icon: 'none', + title: '敬请期待', + }) + } + } + }, + bindload() { + this.setData({ + isLoad: true, + }) + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/patient/pages/nrdlDetail/index.wxml b/src/patient/pages/nrdlDetail/index.wxml new file mode 100644 index 0000000..6c3b630 --- /dev/null +++ b/src/patient/pages/nrdlDetail/index.wxml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/src/patient/pages/nrdlTable/index.json b/src/patient/pages/nrdlTable/index.json new file mode 100644 index 0000000..a39a537 --- /dev/null +++ b/src/patient/pages/nrdlTable/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "城市惠民保自付费用报销list", + "usingComponents": { + "timeOut": "/components/timeOut/index" + } +} diff --git a/src/patient/pages/nrdlTable/index.scss b/src/patient/pages/nrdlTable/index.scss new file mode 100644 index 0000000..67be038 --- /dev/null +++ b/src/patient/pages/nrdlTable/index.scss @@ -0,0 +1,63 @@ +.page { + padding: 478rpx 20rpx 20rpx; + border-color:#fff; + .table { + border-collapse: collapse; + border-top: 1px solid #ece9ea; + border-left: 1px solid #ece9ea; + border-bottom: 1px solid #ece9ea; + border-radius: 20rpx 20rpx 0 0; + .t-header { + display: flex; + border-collapse: collapse; + background-color: #e5829f; + color: #fff !important; + border-radius: 20rpx 20rpx 0 0; + .item7 { + border-right: 0 20rpx 0 0; + } + } + .t-body { + .row { + display: flex; + border-collapse: collapse; + background-color: #fbf0f4; + } + .row:nth-of-type(2n) { + background-color: #f6e0e8; + .item { + border-right: 1px solid #fff7fa; + } + } + } + .item { + padding: 20rpx 5rpx; + font-size: 20rpx; + border-right: 1px solid #f0d5dd; + display: flex; + align-items: center; + justify-content: center; + } + .item1 { + width: 5%; + } + .item2 { + width: 10%; + } + .item3 { + width: 15%; + } + .item4 { + width: 20%; + } + .item5 { + width: 20%; + } + .item6 { + width: 20%; + } + .item7 { + width: 20%; + } + } +} diff --git a/src/patient/pages/nrdlTable/index.ts b/src/patient/pages/nrdlTable/index.ts new file mode 100644 index 0000000..90c0622 --- /dev/null +++ b/src/patient/pages/nrdlTable/index.ts @@ -0,0 +1,876 @@ +const app = getApp(); + +Page({ + data: { + list: [ + { + index: 2, + provide: "江苏", + city: "南京", + name: "南京宁惠保", + date1: "2023.9.19-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院、门特、", + }, + { + index: 2, + provide: "江苏", + city: "南京", + name: "南京宁惠保", + date1: "2023.9.19-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "国谈药(住院)", + }, + { + index: 3, + provide: "江苏", + city: "苏州", + name: "苏惠保", + date1: "2023.10.18-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门诊", + }, + { + index: 4, + provide: "江苏", + city: "徐州", + name: "惠徐保", + date1: "2023.10.24-2024.1.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 5, + provide: "江苏", + city: "镇江", + name: "镇江惠民保", + date1: "2023.10.30-2023.12.28", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 6, + provide: "江苏", + city: "无锡", + name: "医惠锡城升级版", + date1: "2023.10.18-2023.12.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 7, + provide: "浙江", + city: "杭州", + name: "西湖益联保", + date1: "2023.11.8-2024.1.20", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 8, + provide: "浙江", + city: "嘉兴", + name: "嘉兴大病无忧", + date1: "2023.11.6-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "通赔", + }, + { + index: 9, + provide: "浙江", + city: "衢州", + name: "惠衢保", + date1: "2023.10.19-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 10, + provide: "浙江", + city: "绍兴", + name: "越惠保", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 11, + provide: "浙江", + city: "丽水", + name: "浙丽保", + date1: "2023.11.29-2024.1.31", + date2: "2024.1.1-2024.12.31", + content: "通赔", + }, + { + index: 12, + provide: "浙江", + city: "温州", + name: "温州益康保", + date1: "2023.9.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 13, + provide: "浙江", + city: "湖州", + name: "南太湖健康保", + date1: "2023.11.10-2024.1.20", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 14, + provide: "浙江", + city: "台州", + name: "台州利民保", + date1: "2023.10.11-2024.1.10", + date2: "2024.1.1-2024.12.31", + content: "通赔", + }, + { + index: 15, + provide: "浙江", + city: "舟山", + name: "舟惠保", + date1: "2023.11.17-2024.2.29", + date2: "2024.1.1-2024.12.31", + content: "通赔", + }, + { + index: 16, + provide: "广东", + city: "广州", + name: "穗岁康", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 16, + provide: "广东", + city: "广州", + name: "穗岁康", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特、门急诊", + }, + { + index: 17, + provide: "广东", + city: "广州", + name: "广州惠民保", + date1: "2023.11.15-2024.1.15", + date2: "2024.1.1-2024.12.31", + content: "基础版:住院", + }, + { + index: 17, + provide: "广东", + city: "广州", + name: "广州惠民保", + date1: "2023.11.15-2024.1.15", + date2: "2024.1.1-2024.12.31", + content: "升级版:住院和门特", + }, + { + index: 18, + provide: "广东", + city: "珠海", + name: "大爱无疆", + date1: "2023.1.1起-2023.12.30", + date2: "投保生效日-2023.12.31", + content: "住院和门特", + }, + { + index: 19, + provide: "广东", + city: "珠海", + name: "大爱无疆", + date1: "2023.1.1起-2023.12.30", + date2: "投保生效日-2023.12.31", + content: "住院", + }, + { + index: 20, + provide: "广东", + city: "珠海", + name: "大爱无疆", + date1: "2023.1.1起-2023.12.30", + date2: "投保生效日-2023.12.31", + content: "国谈药品", + }, + { + index: 19, + provide: "广东", + city: "深圳", + name: "深圳专属医疗险", + date1: "全年可投保,等待期30日", + date2: "1年期或6年期", + content: "国谈药品", + }, + { + index: 20, + provide: "广东", + city: "梅州", + name: "梅州惠民保", + date1: "2023.10.18-2023.12.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 21, + provide: "广东", + city: "河源", + name: "河源市民保", + date1: "2023.11.21-2023.12.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 22, + provide: "广东", + city: "茂名", + name: "茂名市民保", + date1: "2023.10.11-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 23, + provide: "广东", + city: "潮州", + name: "益安保", + date1: "2023.11.16-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 24, + provide: "广东", + city: "云浮", + name: "云浮云福保", + date1: "2023.11.22-2024.1.10", + date2: "2024.1.1-2024.12.31", + content: "基础版:住院", + }, + { + index: 24, + provide: "广东", + city: "云浮", + name: "云浮云福保", + date1: "2023.11.22-2024.1.10", + date2: "2024.1.1-2024.12.31", + content: "升级版:住院和门特", + }, + { + index: 25, + provide: "广东", + city: "惠州", + name: "惠州惠医保", + date1: "2023.11.13-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 26, + provide: "广东", + city: "汕尾", + name: "善美保", + date1: "2023.10.11-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 27, + provide: "广东", + city: "肇庆", + name: "肇福保", + date1: "2023.11.16-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 28, + provide: "广东", + city: "肇庆", + name: "肇福保", + date1: "2023.11.16-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 28, + provide: "广东", + city: "阳江", + name: "阳江市惠民保", + date1: "2023.11.14-2023.12.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 29, + provide: "广东", + city: "清远", + name: "清远惠民保", + date1: "2023.11.12-2024.1.12", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 30, + provide: "广东", + city: "中山", + name: "中山博爱康", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 31, + provide: "山东", + city: "济南", + name: "齐鲁保", + date1: "2023.10.10-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 32, + provide: "山东", + city: "潍坊", + name: "潍坊惠民保", + date1: "2023.11.15-2024.1.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 33, + provide: "山东", + city: "烟台", + name: "烟台市民健康保", + date1: "2023.10.26-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 34, + provide: "山东", + city: "全省", + name: "山东新民保", + date1: "2023.11.1-2023.12.30", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 35, + provide: "山东", + city: "菏泽", + name: "惠荷保", + date1: "2023.11.9-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 36, + provide: "山东", + city: "德州", + name: "德州惠民保", + date1: "2023.11.15-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 37, + provide: "山东", + city: "日照", + name: "日照暖心保", + date1: "2023.11.16-2024.1.31", + date2: "2023.12.1-2024.11.30", + content: "住院和门特慢", + }, + { + index: 38, + provide: "山东", + city: "枣庄", + name: "枣惠保", + date1: "2023.11.17-2024.1.15", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 39, + provide: "山东", + city: "聊城", + name: "聊惠保", + date1: "2023.11.15-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 40, + provide: "四川", + city: "德阳", + name: "德e保", + date1: "2023.11.8-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院、门特、单行支付药品", + }, + { + index: 41, + provide: "四川", + city: "宜宾", + name: "惠宜保", + date1: "2023.11.15-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院、门特、国家谈判药品、单行支付药品、高值药品", + }, + { + index: 42, + provide: "四川", + city: "广安", + name: "广安e惠保", + date1: "2023.11.10-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和", + }, + { + index: 42, + provide: "四川", + city: "广安", + name: "广安e惠保", + date1: "2023.11.10-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "参照住院报销的门诊费用", + }, + { + index: 43, + provide: "四川", + city: "雅安", + name: "惠雅保", + date1: "2023.12.8-2024.2.24", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 44, + provide: "四川", + city: "攀枝花", + name: "花城保", + date1: "2023.11.28-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和一类门诊", + }, + { + index: 45, + provide: "四川", + city: "巴中", + name: "巴惠保", + date1: "2023.11.8-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 46, + provide: "四川", + city: "乐山", + name: "乐山惠嘉保", + date1: "2023.12.18-2024.2.29", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 47, + provide: "重庆市", + city: "重庆", + name: "重庆渝快保", + date1: "2023.10.26-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 48, + provide: "湖北", + city: "黄冈", + name: "黄惠保", + date1: "2023.9.6-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 49, + provide: "湖北", + city: "宜昌", + name: "宜昌市民保", + date1: "2023.11.8-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 50, + provide: "湖北", + city: "咸宁", + name: "咸惠保", + date1: "2023.1.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 51, + provide: "湖北", + city: "荆门", + name: "惠荆保", + date1: "2023.9.19-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 52, + provide: "湖北", + city: "鄂州", + name: "鄂州惠民保", + date1: "2023.10.17-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 53, + provide: "湖北", + city: "荆州", + name: "荆州惠民保", + date1: "2023.10.23-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 54, + provide: "湖北", + city: "襄阳", + name: "襄阳惠民保", + date1: "2023.11.8-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 55, + provide: "湖北", + city: "黄石", + name: "黄石石惠保", + date1: "2023.12.18-2024.3.31", + date2: "2024.1.1-2024.12.31", + content: "住院、门特慢、单独支付药品", + }, + { + index: 56, + provide: "广西", + city: "全省", + name: "桂民保", + date1: "2023.12.1-2024.1.31", + date2: "2024.1.18-2025.1.17", + content: "住院", + }, + { + index: 57, + provide: "广西", + city: "桂林", + name: "惠桂保", + date1: "长期投保", + date2: "次月1日起一年", + content: "住院", + }, + { + index: 58, + provide: "广西", + city: "桂林", + name: "桂林惠民保", + date1: "2023.11.15-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 59, + provide: "广西", + city: "钦州", + name: "钦州钦惠保", + date1: "2023.12.20-", + date2: "2023.12.31-2024.12.30", + content: "住院", + }, + { + index: 60, + provide: "广西", + city: "柳州", + name: "柳州惠民保", + date1: "2023.11.29-2024.1.15", + date2: "2024.1.16-2025.1.15", + content: "住院", + }, + { + index: 61, + provide: "福建", + city: "莆田", + name: "莆仙保", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 62, + provide: "福建", + city: "三明", + name: "三明普惠医联保", + date1: "2023.9.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 63, + provide: "福建", + city: "三明", + name: "三明普惠医联保", + date1: "2023.9.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 64, + provide: "福建", + city: "三明", + name: "三明普惠医联保", + date1: "2023.9.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "门特", + }, + { + index: 63, + provide: "辽宁", + city: "全省", + name: "惠辽保", + date1: "2023.12.28-2024.12.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 64, + provide: "辽宁", + city: "丹东", + name: "丹惠保", + date1: "2023.12.12-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 65, + provide: "辽宁", + city: "大连", + name: "大连工惠保", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 66, + provide: "河北", + city: "全省", + name: "冀惠保", + date1: "一期:2023.11.10-2024.1.10", + date2: "一期:2024.1.11-2025.1.10", + content: "住院", + }, + { + index: 66, + provide: "河北", + city: "全省", + name: "冀惠保", + date1: "二期:2024.1.11-2024.2.29", + date2: "二期:2024.3.1-2025.2.28", + content: "住院", + }, + { + index: 67, + provide: "河北", + city: "唐山", + name: "惠唐保", + date1: "2023.11.13-2023.1.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 68, + provide: "河北", + city: "张家口", + name: "张家口家惠保", + date1: "2023.12.10-2024.2.15", + date2: "2024.2.16-2025.2.15", + content: "住院", + }, + { + index: 69, + provide: "江西", + city: "抚州", + name: "抚惠保", + date1: "2023.12.20-2024.2.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 70, + provide: "江西", + city: "赣州", + name: "赣州惠民保", + date1: "2023.12.12-2024.1.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门慢", + }, + { + index: 71, + provide: "河南", + city: "郑州", + name: "郑州医惠保", + date1: "2023.12.20-2024.3.20", + date2: "2024.3.21-2025.3.20", + content: "住院和门特", + }, + { + index: 72, + provide: "河南", + city: "安阳", + name: "安阳惠民保", + date1: "2023.10.16-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 73, + provide: "河南", + city: "鹤壁", + name: "惠鹤保", + date1: "2023.11.13-2024.2.29", + date2: "2024.3.1-2025.2.28", + content: "住院", + }, + { + index: 74, + provide: "海南", + city: "全省", + name: "惠琼保", + date1: "2023.11.29-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 75, + provide: "海南", + city: "全省", + name: "惠琼保", + date1: "2023.11.29-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 75, + provide: "安徽", + city: "全省", + name: "安徽惠民保", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 76, + provide: "黑龙江", + city: "全省", + name: "龙江惠民保", + date1: "2023.11.8-2023.12.28", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + { + index: 77, + provide: "北京", + city: "北京", + name: "北京普惠健康保", + date1: "2023.11.1-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门诊", + }, + { + index: 78, + provide: "陕西", + city: "全省", + name: "惠秦保", + date1: "2023.6.25-2023.12.31", + date2: "一期:2023.6.30-2023.12.30", + content: "住院和门特", + }, + { + index: 78, + provide: "陕西", + city: "全省", + name: "惠秦保", + date1: "2023.6.25-2023.12.31", + date2: "二期:2024.1.1-2024.12.31", + content: "住院和门特", + }, + { + index: 79, + provide: "宁夏", + city: "全省", + name: "平安宁康保", + date1: "2023.12.5-2023.12.30", + date2: "2023.12.31-2024.12.30", + content: "住院和门特慢", + }, + { + index: 80, + provide: "甘肃", + city: "兰州", + name: "金城·惠医保", + date1: "2023.10.26-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "住院和门特慢", + }, + { + index: 81, + provide: "新疆", + city: "阿克苏", + name: "阿克苏惠民保", + date1: "2023.10.12-2023.12.31", + date2: "2024.1.1-2024.12.31", + content: "通赔", + }, + { + index: 82, + provide: "青海", + city: "全省", + name: "青海健康保", + date1: "2023.12.5-2024.2.29", + date2: "2024.1.1-2024.12.31", + content: "住院", + }, + ], + + asideOut: false, + asideType: "13", + }, + onLoad() { + app.waitLogin().then((_res) => { + app.zdMpBehavior({ PageName: 'PG_PATIENTCITYHEALTHINSURANCE' }) + this.addOpenRecord(); + }); + }, + addOpenRecord() { + wx.ajax({ + method: "POST", + url: `?r=xd/nrdl/add-open-record&OpenType=${3}`, + data: {}, + }).then((res) => { + if (res.CanGetScore) { + this.setData({ + asideOut: true, + }); + } + }); + }, +}); diff --git a/src/patient/pages/nrdlTable/index.wxml b/src/patient/pages/nrdlTable/index.wxml new file mode 100644 index 0000000..7cd7f29 --- /dev/null +++ b/src/patient/pages/nrdlTable/index.wxml @@ -0,0 +1,29 @@ + + + + 编号 + 省份 + 城市 + 惠民保名称 + 投保时间 + 报销时间 + 医院内可自付报销范围 + + + + {{index+1}} + {{item.provide}} + {{item.city}} + {{item.name}} + {{item.date1}} + {{item.date1}} + {{item.content}} + + + + + + diff --git a/src/patient/pages/personalInformation/index.json b/src/patient/pages/personalInformation/index.json new file mode 100644 index 0000000..1eca765 --- /dev/null +++ b/src/patient/pages/personalInformation/index.json @@ -0,0 +1,11 @@ +{ + "navigationBarTitleText": "治疗记录", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "van-icon": "@vant/weapp/icon/index", + "van-toast": "@vant/weapp/toast/index", + "van-popup": "@vant/weapp/popup/index", + "van-switch": "@vant/weapp/switch/index" + } +} diff --git a/src/patient/pages/personalInformation/index.scss b/src/patient/pages/personalInformation/index.scss new file mode 100644 index 0000000..efbdb7f --- /dev/null +++ b/src/patient/pages/personalInformation/index.scss @@ -0,0 +1,359 @@ +.page { + padding-bottom: 200rpx; + .page-container { + width: 100%; + padding: 30rpx 38rpx; + box-sizing: border-box; + + .banner-new { + padding: 38rpx 30rpx; + background-color: #fff; + border-radius: 24rpx; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + .row { + margin-top: 48rpx; + &:first-of-type { + margin-top: 0; + } + .row-header { + display: flex; + align-items: center; + justify-content: space-between; + .label { + font-size: 32rpx; + color: #283031; + font-weight: bold; + } + .change-phone { + font-size: 32rpx; + color: #cf5375; + } + } + .row-content { + padding-top: 24rpx; + .input { + padding: 24rpx 28rpx; + background-color: #f2f2f2; + border: 1px solid #ccc; + border-radius: 12rpx; + color: #283031; + line-height: 40rpx; + } + .place-input { + color: #999999; + } + .radio-btns { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 22rpx; + .btn { + padding: 24rpx; + font-size: 32rpx; + color: #999999; + text-align: center; + line-height: 40rpx; + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 1px solid #cccccc; + &.active { + color: #e04775; + border-color: #e04775; + } + } + } + .r-picker { + display: block; + .r-picker-content { + padding: 24rpx 28rpx; + background: #f2f2f2; + border-radius: 12rpx 12rpx 12rpx 12rpx; + border: 1rpx solid #cccccc; + display: flex; + align-items: center; + justify-content: space-between; + .value { + font-size: 32rpx; + color: #283031; + line-height: 40rpx; + &:empty { + &::after { + content: attr(data-place); + color: #999999; + font-size: 32rpx; + } + } + } + .triangle { + width: 48rpx; + height: 48rpx; + } + } + } + } + } + .protocol { + margin-top: 48rpx; + display: flex; + align-items: center; + justify-content: space-between; + .wrap { + line-height: 1; + .name { + font-size: 32rpx; + color: #283031; + font-weight: bold; + } + .book { + margin-top: 16rpx; + font-size: 28rpx; + color: #cf5375; + } + } + } + } + + // .footer-new { + // position: fixed; + // left: 0; + // bottom: 80rpx; + // z-index: 10; + // width: 100%; + // padding: 0 30rpx; + // box-sizing: border-box; + // display: grid; + // grid-template-columns: repeat(auto-fit, minmax(200rpx, 1fr)); + // gap: 20rpx; + // .btn1 { + // height: 88rpx; + // text-align: center; + // line-height: 88rpx; + // background: #dddddd; + // font-size: 34rpx; + // font-weight: bold; + // color: #283031; + // border-radius: 24rpx 24rpx 24rpx 24rpx; + // } + // .btn2 { + // height: 88rpx; + // text-align: center; + // line-height: 88rpx; + // background: #dddddd; + // font-size: 34rpx; + // font-weight: bold; + // color: #283031; + // border-radius: 24rpx 24rpx 24rpx 24rpx; + // } + // .btn3 { + // height: 88rpx; + // text-align: center; + // line-height: 88rpx; + // background: #dddddd; + // font-size: 34rpx; + // font-weight: bold; + // color: #283031; + // border-radius: 24rpx 24rpx 24rpx 24rpx; + // } + // } + + .cancellation { + margin-top: 45rpx; + height: 80rpx; + text-align: center; + line-height: 80rpx; + font-size: 32rpx; + color: #fff; + background: #b8bfd1; + border-radius: 100rpx 100rpx 100rpx 100rpx; + } + } + + .picker { + font-size: 28rpx; + color: #023eba; + max-width: 50vw; + } + + .call { + text-align: center; + margin: 0 auto; + width: 560rpx; + height: 80rpx; + line-height: 80rpx; + background: #023eba; + border-radius: 100px 100px 100px 100px; + font-size: 34rpx; + font-family: + Source Han Sans CN-Bold, + Source Han Sans CN; + font-weight: bold; + color: #ffffff; + } + + .order-shop { + position: fixed; + left: 0; + top: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.25); + z-index: 666; + } + + .order-shop-worker { + position: fixed; + display: flex; + justify-content: center; + align-items: center; + left: 0; + top: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.25); + z-index: 3; + } + + .order-shop-box { + position: fixed; + left: 0; + bottom: 0; + width: 100vw; + max-height: 80vh; + background: #ffffff; + box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.5); + border-radius: 32rpx 32rpx 0px 0px; + padding: 48rpx 0 60rpx; + } + + .order-shop-worker-box { + width: 646rpx; + padding: 48rpx 40rpx 64rpx; + background: #ffffff; + border-radius: 32rpx; + } + + .order-shop-title { + text-align: center; + font-size: 36rpx; + font-family: + PingFangSC-Medium, + PingFang SC; + font-weight: bold; + color: #222222; + line-height: 50rpx; + } + + .order-search { + box-sizing: border-box; + width: 690rpx; + height: 84rpx; + line-height: 84rpx; + background: #f8f8f8; + border-radius: 42rpx; + margin: 32rpx auto; + padding-left: 74rpx; + background-position: 30rpx center; + background-repeat: no-repeat; + background-size: 36rpx; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABMCAYAAAD6BTBNAAAAAXNSR0IArs4c6QAADFpJREFUeF7dnHmQHFUdx7+/N5OQhBw7vRuRwyMWGBQEJcEQIEn3LJBjpjcgJlwhqIVFyRUxSBQoDAhBBCmQq8pSUIggCwps9+bA7PQkYQkoMRaHBIyCFBggOz2bc2N2p39Wz+6GHP36mJk9+6+per/3e7/3mXf+3u89Qh99VapVFaNd4wtwxgumsQCNhHBGEdNwZuwCYTvAO5jxUQziLaeN3rZfnrWtj8yVFku9ZBAlVPM4QZx0CBoxJgM4LFrZxABvBqiZCVaMY5kWa+Zb0XRUXrpHAVarxrEO0cUEngfgs5U2n4FNBHqsILB0a1P635XWH0ZfDwBkqk6aZzPjOgCnhDGiAjLMwGpicYedTa2ogL7QKioIkCmhmRcQcD2A40JbUGFBBtYLiJ/mrNRzFVbtqa4iAKs040QBPAjg1N4wOlQZTH9uj9GV25tSb4eSL1GoPIDqI8MUGrsE4KsAxEu0oceyMfA/IvzMdkbeiqzW0RMFlQxw7FTjmI4Y6gn4aumGuTMrPgTzJgZa3aULgdoAZwQTuUuaBIiPAeNTpZfh5qRmsDjfzs56vzw9B+cuCaBSu+ybKBQeBmFUNINoN8DNBMowIYtDxOv28uC13ZjTzQQNcU4QHFOZOAnwZAKGRCmbgRYCzbOt9Moo+YJkIwNUVGMBCHcDEEHKP0mnZgYeZW6vb82e0xo+n7fkyCnLxh4SL1zggOYTeEJYfQxqF+BLc5b+aNg8QXKRACY0YwkBPw5S2pXOzMIUhNtyVurlkHkii1VNMzUh+AYAtaEyM9wF+XV2tu6uUPIBQqEBRoHHwN8ECpfnrLN7DNyB9aqpNTWH+QEwvhQSzELb0t2eVNYXCmBXt70nREltRLQol0k9AJATQr6yIhNeGVI9+sMfOuDFIcZIhwRdkmtKLy3HiECAxQnDKTwZYszbyMI5L980+9VyDKpEXqXWmAyHngD4c376GGgXTLNy2fSqUsv1BeguVQoC64NnW14R491ztmTn7ijVkErnGz19hRLf09EA8GkBuj8We5yvtTTP/m8pNsgBqo8MS1DNuqB1HhEtzW394DtYf1l7KQb0aJ7JLw5PDM/VEyPtVw4Bq3M1bbV4am4hqj1SgIpm3g3wNb4Fu/AyqflAcUHcPz/Viiu081mAU/7dmW7IW+klUSvhCbBrb/uK//aMV9jbNtf1y5Z3IIUJxghlDFah0w8p+3YVCnz81jV170SB6AGQSdHMFwIcAxtj3HZyfxrzgio9SjVqhhA2ADhKJksMI5fV64J07Zt+EMCEZlxIwO99lLRxTEzKr0q9FqWg/iCbUJefDuqwyM/xQZhuZ/Tnw9p7AMBi63PBSP15RHR1LpO+L2wB/U1O0cybAb5JahdjrZ3Vp4a1ez+A1UnjHGb8SZbZ3WHkrfTJfbJIDlujILnO1cVrBBwtraegqfmm9NogVW76fgAVreElgCZJMjKhMLk3t2dhKlCKTEIzZhHQ6JO30bZ036VPd969AN0DICa8Kf1XGEY+4gBbSuV6K4+iGi+CpLNyR4zFZ7ZkUx8G2bMXYJCzgCBO6UmvSpChlU5PaGaKwKaP3lDOhm6ApGjGu/KjR2q2rfTpla5EX+tTNMPtccd62cGMDfmsflKQjUWACdU8noilyxIGXZa30r8KUjbQ0qs183oG3yYb80XHniNb1p672a9eRYDVmnE1A/d6C9Juh9sPr4Qnub8BTpxhfJYKcHcent51Bi7KW/rjgQATSeMZYpwtEWyyLf2M/lb5StmjaMbfAZzoqY/wazujfzcQoKIZ7mzjGatCoBtyJWyyK1XBntYT4DR5w7b0430BulFSgnbkpUJEp9mZ9Is9XZG+0l+jmXUO2DOKwT1Xzte0Hern5qJqrXESw3lJMv4xhomqMEePfQWg3HLH1JpfiDn8L5meAsWO3pqZJU2nKs2YL4DfSRRsti39iHKN7N/5WSha406Ah3kuZ4BU3tKXyepAimouBLH3EV/EjXX/BiW3Tkma/wCz52mew/St1mxa1sBAimosBuEnnvQH2fZNhtBvW8eMq/JZ/X55C0yad4F5oaT5Pp639IsGassKa7eiGW64x1kSBtfnLf12KcBqzXyAwZd7C/BvbKvu0rCGDFS5hGY+S+DZkon0FttKe/ZQV94dA+8E8bUSgE/YVt2FAxVMWLsV1XwexGd6D2P0o3w2fYe8C2vmTQDf7JmZYOYzuh7WkIEqp2jGOlk4MoOuyFtpN3jU83O9MD8A8AtJ8qD0whxYV0UzNgIY78XAAS5p9YnmooRqXEQE7/gQwsd2Ro94HWGAtUPViidox04Chkoa0Qy/mEKqURsnOuT8VVbtQjspW19Iy7d6A4zXgeaOnmocE49BGkftcHxca3am6yuVdOFJy0ZjhNMKsOchuwNWW6261QOck9R8RWs4F6CnJQK7bWv9ocBiaaRZEZqiGR8A8N6ysVhsZ1Oek8xggJpImvcR85WSurxqW7q3q6srQxdAsx7gOZ4zMWhN3kpPGwywvOqgaOYbAH/ZK42IHspl0pI1cmeOTpd+0vweMXtO1W4MXXtH7Mgda2dtGWwQu8Y/976dd5CVQ3Pt1emn/OpdzFijLR/voMOdyr0HSmBBztJ/OdgABkQpOO2Mw7Zn9ZZAgMVWqBn/lJ3WM2h93kpPHFwAFwtFnbAJhHGSer1kW7pfNNcnXbhzIpHvSNx0x6Fk6+q0NVggKklzDpjrZfUJ2oF059vb97s8s5uk4wEwqA6XFM3cALDnLSsG9nSI9iO2N30jF9Rg9hs8E5rhhn6pskxCULKlaeC3wqDWB8LTdkb3XJUcyGb/4CK1cQbIWS6lTnjT3nr4iVg/sf/FQwc1la70sao1skA73wRYEmhJLJi+3pJNuRG6gZ9XgOUrBEivTw30Y84Qsd8rbUufEUiuS+AggNVa42yG86x8cEU7CUyzm3TXBTSgvkSyYSYxuQFFknt+xMw8NZ/V3RDnUJ/nAtLPwdiplf7TMTR+0raVM+xQpfQDIUVddhRTYQMBNXJz6AnbSkdyIHsCHFXb+MW447xKwCE+hTXbu5Uzse7Utn7Ax9eEKvWZKiHia8D4io/gNtEx5NiWtTN8g4l8J5F9E5WksRjsfVrXLceux9oZeU5P3QavyB8zuX64Mnz4SjCm+OkrNfbb56ZS8YJKNviqFDXa23gu1uu7KlLhCirpankNQfDcIhl4KG/pV3T+DP/53pULN24Ul97r2h3UBe0bw5tVvqRrO0RhWUC33a8gBj2Yt9Kuays0xODbmpo5nQGDwEFX7N9njl+Qz84MPYOVj8lbgzvbgulR/wnDO29UiIEA3WKqNWM+M34Lkrh9umxhoINAS2zecjuy397dU4BkersWybcAvCDE9VypeVEghgLolqSoDdeC6M4wUNwnmQAs8AvKCaMnikzn9sx9y0G2w4iize3D4bpzaIBFiJ1HoC7EcA9OMNYx0W15K+13JyNazfaTXiyU5MRzwe5rSd6OgQOVd/YSZGShHPvKh4EYCWCxO9ea8xyHHw5xpX5fWza6j4Q5MV6aX6W/VwaxYtZOTzLNA/PFPv48r2J2CcL5LRndTGjm/SQNafkkaxDEyACLEFXzDCZ2LyRGfRDHPd16DaCMALLtAq9vbUq963t1TLXio50d4+IxPoFJqMRw341xQ9Gi2v4emM+zs3XdwaTuW19lQ4xqxN6/pua0547goeJxBso8cKLdILwDh4svFzG4jViMALH7qE+CgXHyQ+9wbZkIZvuQIZd4bD3LhlgywKLpc+pjiZYRiwjFd1tGhKtOr0ptI6Ibc5m0G98nW9uVBbE8gF0sxkxtGBcXdC8T+kkgUvEJgj+IjvjCkHvbkiFWBGB3m1KSxllwcCPIf9/Zc22w+Ezo88y4NYpLqsuekiBWFGA3mEStOYUcXgRgem88i+eeYRChQTjijrCeZMmfGBoiiO6xM+lregRgt3Fj1cZPF8i5kBnziIrP5FWyPHdG/wuDHusQe54McwAUsuWHhuiQmFbJCvnaVzPlj4cX4kM1Imju6xkMHO3vbzxInbs1fJuImrkAq53Y6kHnRViId/YawINwzKmPjcmN/LzgwnhmGkvgURBiJDF3viPtviFN2C5AHzkce6s1+/J7flFSIVtXFLEwEPsQYJSq9J2sL8Re7cJ9x6DskklJmneD+fv7aiKIn+es1KK+68Jl16t3FVQlG6cKdooPUTgkzNZMao37+/+7SsIz/Eyb1AAAAABJRU5ErkJggg==); + } + + .search-input { + font-size: 28rpx; + line-height: 84rpx; + height: 84rpx; + padding-right: 30rpx; + } + + .search-cell-box { + max-height: 550rpx; + } + + .search-cell { + display: flex; + justify-content: space-between; + padding: 0 60rpx; + color: #aeb6cd; + } + + .shop-text { + padding: 20rpx 0; + text-align: center; + line-height: 40rpx; + // border-bottom: 2rpx solid #f8f8f8; + flex: 1; + font-size: 32rpx; + font-family: + Alibaba PuHuiTi-Medium, + Alibaba PuHuiTi; + font-weight: 500; + } + + .search-cell-active { + border-bottom: none; + color: #364e9e; + font-size: 32rpx; + font-family: + Alibaba PuHuiTi-Medium, + Alibaba PuHuiTi; + font-weight: 500; + color: #364e9e; + } + + .fl1 { + display: flex; + justify-content: space-between; + padding: 0 30rpx; + } + + .closeShop { + color: #aeb6cd; + font-size: 28rpx; + margin-left: auto; + } + + .clickShop { + color: #364e9e; + font-size: 28rpx; + } + + .empty-image { + margin: 0 auto; + width: 100%; + padding-top: 450rpx; + text-align: center; + background-position: center 100rpx; + background-size: 300rpx; + background-repeat: no-repeat; + background-image: url(https://m.zd.hbraas.com/zd/none.png?t={{Timestamp}}); + } + + .moretext { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } +} + +.popup { + .popup-title { + display: flex; + justify-content: space-between; + padding: 20rpx 40rpx; + font-size: 32rpx; + .clsoe { + color: #7f7f7f; + } + .sure { + color: #22c065; + } + } + .popup-picker { + .picker-col { + padding: 10rpx 30rpx; + font-size: 28rpx; + line-height: 40rpx; + box-sizing: border-box; + display: flex; + align-items: center; + } + } +} diff --git a/src/patient/pages/personalInformation/index.ts b/src/patient/pages/personalInformation/index.ts new file mode 100644 index 0000000..b89c611 --- /dev/null +++ b/src/patient/pages/personalInformation/index.ts @@ -0,0 +1,379 @@ +import dayjs from 'dayjs' +const app = getApp() +const licia = require('miniprogram-licia') + +Page({ + data: { + isEdit: false, + area: [] as string[][], + city: [] as string[][], + userInfo: {} as any, + areaValue: '', + bron: '', + age: '', + ageStart: '1930-01-01', + ageEnd: '', + + rtValue: '0', + RTList: [ + { id: 1, value: '本人' }, + { id: 2, value: '亲友' }, + ], + + genderValue: '0', + GenderList: [ + { + id: 1, + value: '男', + }, + { + id: 2, + value: '女', + }, + ], + + ageRangeValue: '0', + ageRangeList: [ + { + id: 5, + value: '18岁以下', + }, + { + id: 1, + value: '18岁-44岁', + }, + { + id: 2, + value: '45岁-59岁', + }, + { + id: 3, + value: '60岁-74岁', + }, + { + id: 4, + value: '75岁以上', + }, + ], + + taskValue: 0, + TaskList: [ + { + id: 1, + value: '接受随访', + }, + { + id: 2, + value: '不接受随访', + }, + ], + + antibodyTypeRangeList: [ + { + id: '1', + value: 'AchR', + }, + { + id: '2', + value: 'MuSK', + }, + { + id: '3', + value: 'LRP4', + }, + { + id: '4', + value: 'RyR', + }, + ], + thyroidAbnormalRangeList: [ + { + id: '1', + value: '是', + }, + { + id: '2', + value: '否', + }, + ], + previousConvulsionRangeList: [ + { + id: '1', + value: '是', + }, + { + id: '2', + value: '否', + }, + ], + traditionalImmunosuppressantRangeList: [ + { + id: '1', + value: '他克莫司', + }, + { + id: '2', + value: '硫唑嘌呤', + }, + { + id: '3', + value: '吗替麦考酚酯', + }, + { + id: '4', + value: '其它', + }, + ], + medicalInsuranceTypeRangeList: [ + { + id: '1', + value: '城市职工', + }, + { + id: '2', + value: '城市居民', + }, + { + id: '3', + value: '新农合', + }, + ], + + DiagnosisTime: '', + + selectDiagnoseTypeIndex: '0', + diagnoseTypeShow: false, + diagnoseTypeValue: '0', + DTList: app.globalData.DiagnoseType.map((item) => { + return { + id: item.id, + value: item.name, + } + }), + }, + onShow() { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + const ageEnd = licia.dateFormat(new Date(), 'yyyy-mm-dd') + + this.setData({ + ageEnd, + }) + + app.waitLogin().then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTPERSONALINFO' }) + const that = this + app.getUserInfo(that, true, that.formatUserInfo.bind(that)) + }) + }, + + formatUserInfo(res) { + this.formatBorn(res.Birth) + this.handleChaneDiagnosisTime({ detail: { value: res.DiagnosisTime } }, false) + const diagnoseTypeValue = this.data.DTList.findIndex((item) => item.id == res.DiagnoseType) + this.handleChangeDiagnoseType({ detail: { value: [diagnoseTypeValue] } }) + this.handleDiagnoseTypeSave(false) + // this.handleTapRT(); + }, + formatBorn(Birth) { + let bron = '' + let age = '' + const date = new Date() + const year = date.getFullYear() + const month = date.getMonth() + 1 + if (!Birth) { + bron = `${Birth}年` + age = '岁' + } else if (Birth && Birth.split('-').length > 1) { + bron = `${Birth.split('-')[0]}年${Birth.split('-')[1]}月` + age = + month - Birth.split('-')[1] >= 0 + ? `${year - Birth.split('-')[0]}岁${month - Birth.split('-')[1]}个月` + : `${year - Birth.split('-')[0] - 1}岁${12 - Birth.split('-')[1] + month}个月` + } else { + bron = `${Birth}年` + age = `${year - Birth}岁` + } + age = age.replace('岁0个月', '岁') + this.setData({ + bron, + age, + 'userInfo.Birth': Birth, + 'userInfo.AgeYear': Number(dayjs().format('YYYY')) - Birth.split('-')[0], + }) + }, + + handleChaneAge(e) { + const Birth = e.detail.value + this.formatBorn(Birth) + this.updateUserInfo() + }, + handleChaneDiagnosisTime(e, update = true) { + const DiagnosisTime = e.detail.value + this.setData({ + DiagnosisTime: dayjs(DiagnosisTime).format('YYYY年MM月'), + 'userInfo.DiagnosisTime': DiagnosisTime, + }) + this.updateUserInfo(update) + }, + + handleInput(e) { + const { key } = e.currentTarget.dataset + this.setData({ + [`userInfo.${key}`]: e.detail.value, + }) + }, + handleChangeRT(e, update = true) { + const value = e.detail.value + const id = this.data.RTList.filter((_item, index) => index == value)[0]?.id + this.setData({ + rtValue: value, + 'userInfo.RelationType': id, + }) + this.updateUserInfo(update) + }, + handleChangeGender(e, update = true) { + const value = e.detail.value + const id = this.data.GenderList.filter((_item, index) => index == value)[0]?.id + this.setData({ + genderValue: value, + 'userInfo.Gender': id, + }) + this.updateUserInfo(update) + }, + handleChangeTask(e, update = true) { + const value = e.detail ? 0 : 1 + const id = this.data.TaskList.filter((_item, index) => index == value)[0]?.id + this.setData({ + taskValue: value, + 'userInfo.PatientCanFollowUp': id, + }) + this.updateUserInfo(update) + }, + handleChangeAgeRange(e, update = true) { + const value = e.detail.value + const id = this.data.ageRangeList.filter((_item, index) => index == value)[0]?.id + this.setData({ + ageRangeValue: value, + 'userInfo.AgeRange': id, + }) + this.updateUserInfo(update) + }, + handleDiagnoseTypeSave(update = true) { + const rangeIndex = this.data.selectDiagnoseTypeIndex + const id = this.data.DTList.filter((_item, index) => index == rangeIndex)[0]?.id + this.setData({ + diagnoseTypeValue: rangeIndex, + 'userInfo.DiagnoseType': id, + }) + if (update) { + this.handleDiagnoseTypeShow() + } + + this.updateUserInfo(update) + }, + handleRadio(e) { + const { id, key } = e.currentTarget.dataset + this.setData({ + [`userInfo.${key}`]: id, + }) + this.updateUserInfo(true) + }, + handleDiagnoseTypeShow() { + this.setData({ + diagnoseTypeShow: !this.data.diagnoseTypeShow, + }) + }, + handleChangeDiagnoseType(e) { + const value = e.detail.value[0] + this.setData({ + selectDiagnoseTypeIndex: value, + }) + }, + handleRedioSelect(e) { + const { key, id } = e.currentTarget.dataset + this.setData({ + [`userInfo.${key}`]: id, + }) + this.updateUserInfo() + }, + updateUserInfo(update = true) { + if (!update) return + const { PatientName, RelationType, Gender, Birth, DiagnosisTime, DiagnoseType, ...userInfo } = this.data.userInfo + wx.ajax({ + method: 'POST', + url: '?r=xd/account/update-info', + data: { + name: PatientName, + relationType: RelationType, + gender: Gender, + birth: Birth, + diagnosisTime: DiagnosisTime, + diagnoseType: DiagnoseType, + ageRange: userInfo.AgeRange, + patientCanFollowUp: userInfo.PatientCanFollowUp, + antibodyType: userInfo.AntibodyType, + thyroidAbnormal: userInfo.ThyroidAbnormal, + previousConvulsion: userInfo.PreviousConvulsion, + traditionalImmunosuppressant: userInfo.TraditionalImmunosuppressant, + medicalInsuranceType: userInfo.MedicalInsuranceType, + ...userInfo, + }, + }) + .then((_res) => { + wx.showToast({ + title: '修改成功', + icon: 'none', + }) + app.getUserInfo(this, true, this.formatUserInfo.bind(this)) + }) + .catch((err) => { + wx.showToast({ + title: err.data.msg, + icon: 'none', + }) + app.getUserInfo(this, true, this.formatUserInfo.bind(this)) + }) + }, + + handleChangeTel() { + app.zdMpBehavior({ PageName: 'PG_PATIENTPERSONALINFO_CHANGEPHONECLICK' }) + wx.navigateTo({ + url: '/pages/changePhone/index', + }) + }, + handleChangeUser() { + wx.navigateTo({ + url: '/pages/changeUser/index', + }) + }, + handleLogout() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTPERSONALINFOLOGOUT' }) + wx.navigateTo({ + url: '/pages/cancellation/index', + }) + }, + handleBack() { + wx.navigateBack() + }, + routerTo(e) { + const { url } = e.currentTarget.dataset + if (url.includes('/doctor/pages/d_login/index')) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTPERSONALINFOSWITCHDOCTORPORTAL' }) + } + wx.navigateTo({ + url, + }) + }, + redirectTo(e) { + const { url } = e.currentTarget.dataset + wx.redirectTo({ + url, + }) + }, +}) diff --git a/src/patient/pages/personalInformation/index.wxml b/src/patient/pages/personalInformation/index.wxml new file mode 100644 index 0000000..aef310c --- /dev/null +++ b/src/patient/pages/personalInformation/index.wxml @@ -0,0 +1,284 @@ + + + + + + + + + + 切换账号 + 切换医生端 + 注销 + + + + + + 关闭 + 保存 + + + + {{item.value}} + + + diff --git a/src/patient/pages/privacyAgreement/index.json b/src/patient/pages/privacyAgreement/index.json new file mode 100644 index 0000000..00d5911 --- /dev/null +++ b/src/patient/pages/privacyAgreement/index.json @@ -0,0 +1,10 @@ +{ + "navigationBarTitleText": "", + "navigationStyle": "custom", + "disableScroll": true, + "usingComponents": { + "mp-html": "mp-html", + "loginNavbar": "/components/loginNavbar/index", + "navBar": "/components/zd-navBar/navBar" + } +} diff --git a/src/patient/pages/privacyAgreement/index.scss b/src/patient/pages/privacyAgreement/index.scss new file mode 100644 index 0000000..43ec917 --- /dev/null +++ b/src/patient/pages/privacyAgreement/index.scss @@ -0,0 +1,74 @@ +.page { + position: relative; + box-sizing: border-box; + background-color: #fff; + height: 100vh; + overflow: hidden; + .bg { + width: 100%; + } + .page-container { + position: absolute; + width: 100%; + top: 0; + left: 0; + display: flex; + flex-direction: column; + height: 100vh; + padding-bottom: 80rpx; + box-sizing: border-box; + .navbar { + flex-shrink: 0; + } + .content { + position: relative; + flex: 1; + margin: 80rpx auto 0; + overflow-y: auto; + overflow-x: hidden; + padding: 40rpx 48rpx; + width: 654rpx; + font-size: 28rpx; + color: #666666; + box-sizing: border-box; + background: #ffffff; + box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.09); + border: 2rpx solid rgba(224, 71, 117, 0.25); + border-radius: 24rpx; + .mask { + position: sticky; + bottom: -40rpx; + left: 0; + width: 100%; + height: 250rpx; + background: linear-gradient(rgba(255, 255, 255, 0.3), #fff); + } + } + .footer { + flex-shrink: 0; + margin: 81rpx 48rpx 0; + box-sizing: border-box; + display: flex; + > view:not(:last-of-type), + > image { + margin-right: 30rpx; + } + .btn { + flex: 1; + text-align: center; + height: 80rpx; + line-height: 80rpx; + text-align: center; + border: 2rpx solid #e04775; + border-radius: 24rpx; + font-size: 34rpx; + font-weight: bold; + color: #e04775; + } + .sure { + background-color: #e04775; + color: #fff; + } + } + } +} diff --git a/src/patient/pages/privacyAgreement/index.ts b/src/patient/pages/privacyAgreement/index.ts new file mode 100644 index 0000000..a8e3cba --- /dev/null +++ b/src/patient/pages/privacyAgreement/index.ts @@ -0,0 +1,39 @@ +const app = getApp() + +Page({ + data: { + durgInfo: {}, + pagePath: '', + id: '', + Content: `

知情同意书


【重症肌无力患者支持“gMG给力加油站”项目】(以下简称“我们”)深知个人信息对您的重要性,并会尽全力保护您的个人信息安全可靠。我们致力于维持您对我们的信任,恪守以下原则,保护您的个人信息:权责一致原则、目的明确原则、选择同意原则、最少用原则、确保安全原则、公开透明原则等。同时,我们承诺,我们将按照业界成熟的安全标准,采取相应的安全保护措施来保护您的个人信息

    请在使用我们的产品(或服务)前,仔细阅读并立即本《知情同意书》。



    一、我们如何收集和使用您的个人信息

    个人信息是指以电子或者其它方式记录的能够单独或者与其它信息结合识别特定自然人身份或者反映特定自然人活动情况的各种信息。

    我们仅会处于以下目的,收集和使用您的个人信息

     1、注册成为用户:为完成创建账号,你需提供以下信息:

    你的姓名、手机号码,年龄,性别,重症肌无力疾病确诊证明材料。您提供的上述信息,将在您使用本服务期间持续授权我们使用。在您注销账号时,我们将停止使用并删除上述信息。

     2、个性化推荐疾病知识及服务:为了给您提供个性化的疾病知识及推荐服务,我们将记录您在使用本服务期间的就诊记录、预约信息、内容的浏览记录等。在您注销账号时,我们将停止使用并删除上述信息。

      3,用药患者支持模块的注册将需要提供,你的姓名,手机号,年龄 性别 用药处方信息的证明材料,您提供的上述信息,将在您使用本服务期间持续授权我们使用。在您注销账号时,我们将停止使用并删除上述信息。

     4、中心内部数据分析和研究:我们收集数据是根据您与我们的互动和您做出的选择,包括隐私设置以及IP地址、设备型号等;我们要将信息用于本文未载明的其它用途时,会事先征求您的同意。



    二、我们如何共享、转让、披露您的个人信息

    (一)共享

    我们不会向其它任何公司、组织和个人分享您的个人信息,但以下情况除外:

     1、在获取明确同意的情况下共享:获得您的明确同意后,我们会与其它方共享您的个人信息。

     2、我们可能会根据法律法规规定,或按照政府主管部门的强制性要求耱,共享您的个人信息。

     3、与您所绑定的医生共享:您的个人信息可能会与分享给您加入的医生作为科研和分析使用。我们只会共享必要的个人信息,且受本文所声明目的的约束。如要改变个人信息的处理目的,将再次征求您的同意。

     4、涉及到用药不良事件时,在符合适用的法律法规前提下,您的相关信息和资料会披露给药品捐赠方药品上市许可持有人或其在中国的代理人的药品不良反应监管部门,其可能会就此进行跟进和随访,将该等信息录入到药品捐赠方的其药品不良事件数据库并按照相关法律规定上报给相关法律部门。

     5、与授权合作伙伴共享:仅为实现本文中声明的目的,我们的某些服务将由授权合作伙伴提供  。我们可能会与合作伙伴共享您的个人信息,已提供更好的客户服务和用户体验。

    例如,我们聘请来提供患者随访服务的公司可能需要采集利和访问您的个人数据。在这种情况下,这些公司必须遵守我的数据隐私和安全要求。我们仅会出于合法、正当、必要、特定、明确的目的共享您的个人信息,并且只会共享提供服务所必要的个人信息。

    对我们与之共享个人信息的公司、组织和个人,我们会与其签暑严格的保密协定,要求他们按照我们的说明、本文以及其它任何相关的保密和安全措施来处理个人信息。

    (二)转让

    我们不会将您的个人信息转让给任何公司、组织和个人,但以下情况除外:

    在获得明确同意的情况下转让:获得您的明确同意后,我们会向其它方转让你的个人信息;

    (三)公开披露

    我们仅会在以下情况下,公开披露您的个人信息:

     1、获得您明确同意后;

     2、基于法律的披露:在法律、法律程序、诉讼或政府主管部门强制性要求下,我们可能会公开披露您的个人信息。



    三、您的权利

    按照中国相关的法律、法规、标准,以及其它国家、地区的通行做法,我们保障您对自己的个人信息行使以下权利:

    (一)访问您的个人信息

    如果您想访问您的信息,可以通过以下方式自行访问:

    账户信息——如果您希望访问或编辑您的账户中的个人信息,可以在小程序的个人中心中进行浏览或编辑。。

    (二)删除您的个人信息

    在以下情形中,您可以向我们提出删除个人信息的请求:

     1、如果我们处理个人信息的行为违反法律法规;

     2、如果我们收集、使用您的个人信息,却未征得您的统一;

     3、如果我们处理个人信息的行为违反了与您的约定;

     4、如果您不再使用我们的产品或服务,或您注销了账号;

     5、如果我们不再为您提供产品或服务。

    若我们决定响应您的删除请求,我们还将同时通知从我们获得您的个人信息的实体,要求其及时删除,除非法律法规另有规定,或这些实体获得您的独立授权。

    当您从我们服务中删除信息后,我们会在备份更新时删除这些信息。

     (三)改变您授权同意的范围

    对于额外手机的个人信息的收集和使用,您可以随时给予或收回您的授权同意。

    您可以随时使用我们的在线客服功能。我们将在30天内回复您的请求。

     (四)个人信息主体注销账户

    您可以随时使用我们的在线客服功能。我们将在30天内回复您的请求。

    在注销账户之后,我们将停止为您提供产品或服务,并依据您的请求,删除您的个人信息,法律法规另有规定的除外。

     (五)响应您的上述请求

    为保障安全,您可能需要提供书面请求,或以其它方式证明您的身份。我们可能会先要求您验证自己的身份,然后再处理您的请求。

`, + }, + onLoad(options) { + this.setData({ + pagePath: options.page, + id: options.id, + }) + app.waitLogin({ isReg: false, loginPage: true }).then(() => { + app.zdMpBehavior({ PageName: 'PG_PATIENTINFORMEDCONSENT' }) + }) + }, + handleBack() { + app.zdMpBehavior({ PageName: 'BTN_PATIENTCONSENTDISAGREE' }) + wx.navigateBack() + }, + handleSure(e) { + app.zdMpBehavior({ PageName: 'BTN_PATIENTCONSENTAGREE' }) + const { replace } = e.currentTarget.dataset + const { pagePath, id } = this.data + if (replace) { + wx.redirectTo({ + url: `${pagePath}?ignoreAgreement=1` + `&id=${id}`, + }) + } else { + wx.navigateTo({ + url: `${pagePath}?page=/pages/enterInfo/index&ignoreAgreement=1&id=${id}&proces=1`, + }) + } + }, +}) + +export {} diff --git a/src/patient/pages/privacyAgreement/index.wxml b/src/patient/pages/privacyAgreement/index.wxml new file mode 100644 index 0000000..9cc72de --- /dev/null +++ b/src/patient/pages/privacyAgreement/index.wxml @@ -0,0 +1,17 @@ + + + + + + + + + + 不同意 + 同意 + + + 关闭 + + + diff --git a/src/patient/pages/publishStoryDetail/index.json b/src/patient/pages/publishStoryDetail/index.json new file mode 100644 index 0000000..0866be0 --- /dev/null +++ b/src/patient/pages/publishStoryDetail/index.json @@ -0,0 +1,12 @@ +{ + "navigationBarTitleText": "患者故事", + "navigationStyle": "custom", + "usingComponents": { + "navBar": "/components/zd-navBar/navBar", + "star": "/components/star/index", + "van-icon": "@vant/weapp/icon/index", + "mp-html": "mp-html", + "free-audio":"/components/freeAudio/index", + "timeOut": "/components/timeOut/index" + } +} diff --git a/src/patient/pages/publishStoryDetail/index.scss b/src/patient/pages/publishStoryDetail/index.scss new file mode 100644 index 0000000..5eee3c2 --- /dev/null +++ b/src/patient/pages/publishStoryDetail/index.scss @@ -0,0 +1,113 @@ +.page { + .banner-img { + width: 100%; + height: 192rpx; + } + .page-container { + box-sizing: border-box; + margin-top: -20rpx; + padding: 0 50rpx 200rpx; + + .banner { + .title { + margin-top: 34rpx; + font-size: 44rpx; + color: #484848; + font-weight: bold; + word-break: break-all; + } + .banner-footer { + margin-top: 16rpx; + display: flex; + align-items: center; + justify-content: space-between; + .time { + font-size: 36rpx; + color: #b6b7ba; + } + .date { + @extend .time; + } + } + } + .container { + .audio { + margin-top: 32rpx; + padding-bottom: 20rpx; + } + .mp-html { + margin-top: 32rpx; + } + } + } + .animate { + position: fixed; + z-index: 1; + left:1000000px; + bottom: calc(env(safe-area-inset-bottom) + 80rpx); + transform: translateX(-50%); + width: 200rpx; + height: 400rpx; + &.active { + left: 50%; + } + } + .footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + padding: 26rpx 50rpx calc(env(safe-area-inset-bottom) + 26rpx); + display: flex; + justify-content: space-between; + align-items: center; + box-sizing: border-box; + box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 0, 0, 0.26); + background-color: #fff; + .f-item { + display: flex; + align-items: center; + font-size: 30rpx; + color: #e04775; + margin: 0; + padding: 0; + background: transparent; + &::after { + display: none; + outline: none; + } + .icon { + margin-right: 6rpx; + width: 44rpx; + height: 44rpx; + } + .icon-active { + @extend .icon; + display: none; + } + &.active { + color: #e04775; + .icon { + display: none; + } + .icon-active { + display: block; + } + } + } + .button { + margin: 0; + padding: 0; + background-color: transparent; + &::after { + border: none; + outline: none; + } + } + .vertical { + width: 3rpx; + height: 28rpx; + background-color: #f3f3f4; + } + } +} diff --git a/src/patient/pages/publishStoryDetail/index.ts b/src/patient/pages/publishStoryDetail/index.ts new file mode 100644 index 0000000..36dc9d1 --- /dev/null +++ b/src/patient/pages/publishStoryDetail/index.ts @@ -0,0 +1,198 @@ +const app = getApp() + +Page({ + data: { + id: '', + CateId: '', + index: 0 as string | number, + detail: {} as any, + + alertPending: false, + starShow: false, + + asideOut: false, + asideType: '2', + timeToast: false, + timeToastType: '', + timeToastParams: { + rewardScore: 0, + }, + + starLock: false, + shareLock: false, + sendShare: false, + }, + + onLoad(options) { + console.log('options: ', options) + const { id } = options + this.setData({ + id, + }) + app.waitLogin().then(() => { + this.getInfoDetail(id) + this.handleView(id) + }) + this.handleTimeOut() + }, + onShow() { + app.zdMpBehavior({ PageName: 'PG_PATIENTSTORYDETAILS' }) + if (this.data.sendShare) { + this.setData({ + sendShare: false, + timeToastType: '4', + }) + this.handleTimeOut() + } + }, + getInfoDetail(id, star = false) { + wx.ajax({ + method: 'GET', + url: '?r=xd/story/story-info', + data: { + Id: id, + }, + }).then(async (res) => { + res.Content = await this.formatVideo(res.Content) + let asideOut = false + if (res.CanGetScore) { + asideOut = true + } + this.setData({ + detail: res, + }) + if (!star) { + this.setData({ + asideOut, + }) + } + }) + }, + formatVideo(Content) { + return new Promise((reslove) => { + const query = wx.createSelectorQuery() + query + .select('#mp-html') + .boundingClientRect((rect) => { + const mpWidth = rect.width + const reg = /]*)width="(.*?)".*?height="(.*?)".*?>/g + Content = Content.replace(reg, (match, otherAttributes, width, height) => { + if (!isNaN(Number(width)) && !isNaN(Number(height))) { + return `