Browse Source

1v1沟通开发

dev
kola-web 2 days ago
parent
commit
d82dfef32f
  1. BIN
      src/images/bg26.png
  2. 29
      src/patient/pages/doctor/index.ts
  3. 8
      src/patient/pages/doctor/index.wxml
  4. 10
      src/patient/pages/index/index.scss
  5. 6
      src/patient/pages/index/index.wxml
  6. 12
      src/patient/pages/liveDetail/index.ts
  7. 2
      src/patient/pages/liveDetail/index.wxml
  8. 2
      src/patient/pages/liveResult/index.ts
  9. 1
      src/patient/pages/repositoryDetail/index.ts
  10. 87
      src/utils/util.ts

BIN
src/images/bg26.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

29
src/patient/pages/doctor/index.ts

@ -1,3 +1,5 @@
import { parseUrlArgsToArray } from '@/utils/util'
const app = getApp<IAppOption>() const app = getApp<IAppOption>()
Page({ Page({
@ -31,13 +33,14 @@ Page({
areaShow: false, areaShow: false,
toastShow: false, toastShow: false,
// toastType: 'dtpDrug',// TODO:已销毁 // toastType: 'dtpDrug',
toastType: 'siteConform', toastType: 'siteConform',
toastParams: {} as any, toastParams: {} as any,
es: '', es: '',
locationName: '重新定位', locationName: '重新定位',
atvs: {},
}, },
onLoad(options) { onLoad(options) {
const SystemInfo = app.globalSystemInfo const SystemInfo = app.globalSystemInfo
@ -48,7 +51,29 @@ Page({
}) })
} }
app.waitLogin({ type: [0, 1] }).then(() => { 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({ this.setData({
tabActive: Number(options.active), tabActive: Number(options.active),
}) })

8
src/patient/pages/doctor/index.wxml

@ -34,7 +34,7 @@
bind:blur="handleBlur" bind:blur="handleBlur"
/> />
</view> </view>
<view class="tabs" style="top:{{bottom}}px;"> <view class="tabs" style="top:{{bottom}}px;" wx:if="{{atvs.length>2}}">
<van-tabs <van-tabs
active="{{ tabActive }}" active="{{ tabActive }}"
title-active-color="#211D2E" title-active-color="#211D2E"
@ -44,9 +44,9 @@
tab-active-class="tab-active-class" tab-active-class="tab-active-class"
bind:change="onChange" bind:change="onChange"
> >
<van-tab title="查询医院"></van-tab> <van-tab wx:if="{{atvs[0]}}" title="查询医院"></van-tab>
<van-tab title="查询药房"></van-tab> <van-tab wx:if="{{atvs[1]}}" title="查询药房"></van-tab>
<van-tab title="输注中心"></van-tab> <van-tab wx:if="{{atvs[2]}}" title="输注中心"></van-tab>
</van-tabs> </van-tabs>
</view> </view>
</view> </view>

10
src/patient/pages/index/index.scss

@ -470,6 +470,12 @@ page {
font-weight: bold; font-weight: bold;
line-height: 40rpx; line-height: 40rpx;
} }
.one-card {
margin-top: -20rpx;
display: block;
width: 100%;
height: 214rpx;
}
.list { .list {
margin-top: 24rpx; margin-top: 24rpx;
padding: 32rpx; padding: 32rpx;
@ -477,7 +483,7 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 20rpx; gap: 20rpx;
background: linear-gradient( 183deg, #F7F1FF 0%, #FFFFFF 100%); background: linear-gradient(183deg, #f7f1ff 0%, #ffffff 100%);
.item { .item {
flex: 1; flex: 1;
text-align: center; text-align: center;
@ -489,7 +495,7 @@ page {
.name { .name {
margin-top: 8rpx; margin-top: 8rpx;
font-size: 32rpx; font-size: 32rpx;
color: #211D2E; color: #211d2e;
} }
} }
} }

6
src/patient/pages/index/index.wxml

@ -208,8 +208,10 @@
</swiper> </swiper>
</view> </view>
<view class="new-server" wx:if="{{card.code == 'serviceConf' && card.showStatus == 1}}"> <view class="new-server" wx:if="{{card.code == 'serviceConf' && card.showStatus == 1}}">
<view class="title">就诊地图</view> <view class="title" wx:if="{{card.name}}">{{card.name}}</view>
<view class="list"> <image class="one-card" wx:if="{{card.subList.length==1}}" src="/images/bg26.png">
</image>
<view class="list" wx:else>
<block wx:for="{{card.subList}}" wx:key="index"> <block wx:for="{{card.subList}}" wx:key="index">
<view class="item" bind:tap="routerTo" data-url="{{item.linkUrl}}" data-code="{{card.code}}"> <view class="item" bind:tap="routerTo" data-url="{{item.linkUrl}}" data-code="{{card.code}}">
<image class="icon" src="{{item.img}}"></image> <image class="icon" src="{{item.img}}"></image>

12
src/patient/pages/liveDetail/index.ts

@ -219,7 +219,7 @@ Page({
url: `/patient/pages/liveResult/index?id=${this.data.id}`, url: `/patient/pages/liveResult/index?id=${this.data.id}`,
}) })
}, },
handleSignUp() { handleSignUp(entry) {
app.mpBehavior({ PageName: 'BTN_PatientLiveSign' }) app.mpBehavior({ PageName: 'BTN_PatientLiveSign' })
const { Type } = this.data.detail const { Type } = this.data.detail
const { UserType } = this.data.zdUserInfo const { UserType } = this.data.zdUserInfo
@ -238,14 +238,19 @@ Page({
.zdPermissionVerification( .zdPermissionVerification(
3, 3,
Type == 1 ? 1 : 10, 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, this.data.id,
) )
.then(() => { .then(() => {
if (entry === true) {
this.handleLive()
}
else {
this.handleSignUpCallback() this.handleSignUpCallback()
wx.navigateTo({ wx.navigateTo({
url: `/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, url: `/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`,
}) })
}
}) })
.catch(() => { .catch(() => {
app.globalData.liveSubscribe = { app.globalData.liveSubscribe = {
@ -271,6 +276,9 @@ Page({
}, },
}) })
}, },
handleSignUpLive() {
this.handleSignUp(true)
},
postSubscribe(subscribe) { postSubscribe(subscribe) {
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',

2
src/patient/pages/liveDetail/index.wxml

@ -125,7 +125,6 @@
<view class="btn active" wx:if="{{detail.SignUpStatus==1}}" bind:tap="handleResult">审核中</view> <view class="btn active" wx:if="{{detail.SignUpStatus==1}}" bind:tap="handleResult">审核中</view>
<block wx:elif="{{detail.SignUpStatus==2}}"> <block wx:elif="{{detail.SignUpStatus==2}}">
<view class="btn" wx:if="{{detail.BeginTimeValue * 1 < dateValue * 1}}" bind:tap="handleLive">点此参加</view> <view class="btn" wx:if="{{detail.BeginTimeValue * 1 < dateValue * 1}}" bind:tap="handleLive">点此参加</view>
<!-- <view class="btn" wx:else bind:tap="handleResult">已报名,查看活动码</view> -->
<view class="btn-wrap" wx:else> <view class="btn-wrap" wx:else>
<view class="office" bind:tap="handleOffice"> <view class="office" bind:tap="handleOffice">
<image class="icon" src="{{imageUrl}}icon75.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon75.png?t={{Timestamp}}"></image>
@ -152,6 +151,7 @@
已满额 已满额
</view> </view>
<view class="btn active" wx:elif="{{detail.SignUpDeadlineValue * 1 < dateValue * 1}}">报名已截止</view> <view class="btn active" wx:elif="{{detail.SignUpDeadlineValue * 1 < dateValue * 1}}">报名已截止</view>
<view class="btn" wx:elif="{{detail.BeginTimeValue * 1 < dateValue * 1}}" bind:tap="handleSignUpLive">点此参加</view>
<view class="btn" wx:else bind:tap="handleSignUp">报名</view> <view class="btn" wx:else bind:tap="handleSignUp">报名</view>
</block> </block>
</view> </view>

2
src/patient/pages/liveResult/index.ts

@ -1,4 +1,5 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
const app = getApp<IAppOption>() const app = getApp<IAppOption>()
let live_time: null | number = null let live_time: null | number = null
@ -17,6 +18,7 @@ Page({
this.setData({ this.setData({
id: options.id, id: options.id,
rewardScore: options.rewardScore, rewardScore: options.rewardScore,
entry: options.entry,
}) })
if (live_time) { if (live_time) {
clearInterval(live_time) clearInterval(live_time)

1
src/patient/pages/repositoryDetail/index.ts

@ -24,7 +24,6 @@ Page({
shareLock: false, shareLock: false,
sendShare: false, sendShare: false,
// TODO:后期需补充逻辑,根据获取积分情况控制显隐
showTip: false, showTip: false,
}, },

87
src/utils/util.ts

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

Loading…
Cancel
Save