diff --git a/src/images/bg26.png b/src/images/bg26.png new file mode 100644 index 0000000..14bacdc Binary files /dev/null and b/src/images/bg26.png differ diff --git a/src/patient/pages/doctor/index.ts b/src/patient/pages/doctor/index.ts index f37649c..26caf66 100644 --- a/src/patient/pages/doctor/index.ts +++ b/src/patient/pages/doctor/index.ts @@ -1,3 +1,5 @@ +import { parseUrlArgsToArray } from '@/utils/util' + const app = getApp() Page({ @@ -31,13 +33,14 @@ Page({ areaShow: false, toastShow: false, - // toastType: 'dtpDrug',// TODO:已销毁 + // toastType: 'dtpDrug', toastType: 'siteConform', toastParams: {} as any, es: '', locationName: '重新定位', + atvs: {}, }, onLoad(options) { const SystemInfo = app.globalSystemInfo @@ -48,7 +51,29 @@ Page({ }) } app.waitLogin({ type: [0, 1] }).then(() => { - if (options.active && ['1', '2'].includes(options.active)) { + this.getConfig(options) + }) + }, + getConfig(options) { + wx.ajax({ + method: 'GET', + url: '?r=zd/mini-conf/get-config', + data: { + userType: 3, + code: 'serviceConf', + }, + }).then((res) => { + const atvs = { length: 0 } + res[0].subList + .filter(item => item.showStatus == 1) + .forEach((item) => { + atvs[parseUrlArgsToArray(item.linkUrl).active || '0'] = true + }) + atvs.length = Object.keys(atvs).length + this.setData({ + atvs, + }) + if (options.active && ['1', '2'].includes(options.active) && Object.keys(atvs).includes(options.active)) { this.setData({ tabActive: Number(options.active), }) diff --git a/src/patient/pages/doctor/index.wxml b/src/patient/pages/doctor/index.wxml index 71ef359..5b794ac 100644 --- a/src/patient/pages/doctor/index.wxml +++ b/src/patient/pages/doctor/index.wxml @@ -34,7 +34,7 @@ bind:blur="handleBlur" /> - + - - - + + + diff --git a/src/patient/pages/index/index.scss b/src/patient/pages/index/index.scss index d1d5118..f131725 100644 --- a/src/patient/pages/index/index.scss +++ b/src/patient/pages/index/index.scss @@ -470,6 +470,12 @@ page { font-weight: bold; line-height: 40rpx; } + .one-card { + margin-top: -20rpx; + display: block; + width: 100%; + height: 214rpx; + } .list { margin-top: 24rpx; padding: 32rpx; @@ -477,7 +483,7 @@ page { display: flex; align-items: center; gap: 20rpx; - background: linear-gradient( 183deg, #F7F1FF 0%, #FFFFFF 100%); + background: linear-gradient(183deg, #f7f1ff 0%, #ffffff 100%); .item { flex: 1; text-align: center; @@ -489,7 +495,7 @@ page { .name { margin-top: 8rpx; font-size: 32rpx; - color: #211D2E; + color: #211d2e; } } } diff --git a/src/patient/pages/index/index.wxml b/src/patient/pages/index/index.wxml index f6a5681..bd000e6 100644 --- a/src/patient/pages/index/index.wxml +++ b/src/patient/pages/index/index.wxml @@ -208,8 +208,10 @@ - 就诊地图 - + {{card.name}} + + + diff --git a/src/patient/pages/liveDetail/index.ts b/src/patient/pages/liveDetail/index.ts index a9dc71a..464ce53 100644 --- a/src/patient/pages/liveDetail/index.ts +++ b/src/patient/pages/liveDetail/index.ts @@ -219,7 +219,7 @@ Page({ url: `/patient/pages/liveResult/index?id=${this.data.id}`, }) }, - handleSignUp() { + handleSignUp(entry) { app.mpBehavior({ PageName: 'BTN_PatientLiveSign' }) const { Type } = this.data.detail const { UserType } = this.data.zdUserInfo @@ -238,14 +238,19 @@ Page({ .zdPermissionVerification( 3, Type == 1 ? 1 : 10, - `/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, + `/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}&entry=1`, this.data.id, ) .then(() => { - this.handleSignUpCallback() - wx.navigateTo({ - url: `/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, - }) + if (entry === true) { + this.handleLive() + } + else { + this.handleSignUpCallback() + wx.navigateTo({ + url: `/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, + }) + } }) .catch(() => { app.globalData.liveSubscribe = { @@ -271,6 +276,9 @@ Page({ }, }) }, + handleSignUpLive() { + this.handleSignUp(true) + }, postSubscribe(subscribe) { wx.ajax({ method: 'POST', diff --git a/src/patient/pages/liveDetail/index.wxml b/src/patient/pages/liveDetail/index.wxml index 7880ec9..d648e63 100644 --- a/src/patient/pages/liveDetail/index.wxml +++ b/src/patient/pages/liveDetail/index.wxml @@ -125,7 +125,6 @@ 审核中 点此参加 - @@ -152,6 +151,7 @@ 已满额 报名已截止 + 点此参加 报名 diff --git a/src/patient/pages/liveResult/index.ts b/src/patient/pages/liveResult/index.ts index edceb69..00db503 100644 --- a/src/patient/pages/liveResult/index.ts +++ b/src/patient/pages/liveResult/index.ts @@ -1,4 +1,5 @@ import dayjs from 'dayjs' + const app = getApp() let live_time: null | number = null @@ -17,6 +18,7 @@ Page({ this.setData({ id: options.id, rewardScore: options.rewardScore, + entry: options.entry, }) if (live_time) { clearInterval(live_time) diff --git a/src/patient/pages/repositoryDetail/index.ts b/src/patient/pages/repositoryDetail/index.ts index e2d2447..32d5366 100644 --- a/src/patient/pages/repositoryDetail/index.ts +++ b/src/patient/pages/repositoryDetail/index.ts @@ -24,7 +24,6 @@ Page({ shareLock: false, sendShare: false, - // TODO:后期需补充逻辑,根据获取积分情况控制显隐 showTip: false, }, diff --git a/src/utils/util.ts b/src/utils/util.ts index fc0ca95..3f2a880 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -1,64 +1,65 @@ -export const formatTime = (date: Date) => { - const year = date.getFullYear(); - const month = date.getMonth() + 1; - const day = date.getDate(); - const hour = date.getHours(); - const minute = date.getMinutes(); - const second = date.getSeconds(); +export function formatTime(date: Date) { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() - return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`; -}; + return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}` +} -export const formatNumber = (n: number) => { - const s = n.toString(); - return s[1] ? s : `0${s}`; -}; +export function formatNumber(n: number) { + const s = n.toString() + return s[1] ? s : `0${s}` +} /** * 获取当前页面路径 * @returns string */ -export const getCurrentPageUrl = function () { - const pages = getCurrentPages(); - const currentPage = pages[pages.length - 1]; - const url = `/${currentPage.route}`; - return url; -}; +export function getCurrentPageUrl() { + const pages = getCurrentPages() + const currentPage = pages[pages.length - 1] + const url = `/${currentPage.route}` + return url +} /** * 获取当前页面路径 & 参数 * @returns string */ -export const getCurrentPageUrlWithArgs = function () { - const pages = getCurrentPages(); - const currentPage = pages[pages.length - 1]; - const url = currentPage.route; - const options = currentPage.options; - let urlWithArgs = `/${url}?`; +export function getCurrentPageUrlWithArgs() { + const pages = getCurrentPages() + const currentPage = pages[pages.length - 1] + const url = currentPage.route + const options = currentPage.options + let urlWithArgs = `/${url}?` for (const key in options) { - const value = options[key]; - urlWithArgs += `${key}=${value}&`; + const value = options[key] + urlWithArgs += `${key}=${value}&` } - urlWithArgs = urlWithArgs.substring(0, urlWithArgs.length - 1); - return urlWithArgs; -}; + urlWithArgs = urlWithArgs.substring(0, urlWithArgs.length - 1) + return urlWithArgs +} -const parseUrlArgsToArray = (urlArgs) => { - urlArgs = urlArgs.split('&'); - const results = {}; +export function parseUrlArgsToArray(urlArgs): any { + urlArgs = urlArgs.split('&') + const results = {} urlArgs.forEach((arg) => { - arg = arg.split('='); + arg = arg.split('=') if (arg[0] && arg[1]) { - results[arg[0]] = arg[1]; + results[arg[0]] = arg[1] } - }); - return results; -}; + }) + return results +} -export const parseScene = (scene) => { +export function parseScene(scene) { if (scene) { - return parseUrlArgsToArray(decodeURIComponent(scene)); - } else { - return null; + return parseUrlArgsToArray(decodeURIComponent(scene)) } -}; + else { + return null + } +}