Compare commits
No commits in common. 'master' and 'lightspot' have entirely different histories.
@ -1,28 +0,0 @@ |
|||||||
import antfu from '@antfu/eslint-config' |
|
||||||
|
|
||||||
export default antfu({ |
|
||||||
env: { |
|
||||||
es6: true, |
|
||||||
}, |
|
||||||
parserOptions: { project: ['./tsconfig.json'] }, |
|
||||||
globals: { |
|
||||||
wx: true, |
|
||||||
App: true, |
|
||||||
Page: true, |
|
||||||
getCurrentPages: true, |
|
||||||
getApp: true, |
|
||||||
Component: true, |
|
||||||
requirePlugin: true, |
|
||||||
requireMiniProgram: true, |
|
||||||
}, |
|
||||||
rules: { |
|
||||||
'eslint-comments/no-unlimited-disable': 'off', |
|
||||||
'ts/no-require-imports': 'off', |
|
||||||
eqeqeq: 'off', |
|
||||||
}, |
|
||||||
formatters: { |
|
||||||
css: 'prettier', |
|
||||||
html: 'prettier', |
|
||||||
markdown: 'prettier', |
|
||||||
}, |
|
||||||
}) |
|
||||||
@ -0,0 +1,28 @@ |
|||||||
|
// eslint.config.mjs
|
||||||
|
import antfu from '@antfu/eslint-config' |
||||||
|
import prettierConfig from 'eslint-config-prettier' |
||||||
|
|
||||||
|
export default antfu( |
||||||
|
{ |
||||||
|
env: { |
||||||
|
es6: true, |
||||||
|
}, |
||||||
|
stylistic: false, |
||||||
|
parserOptions: { project: ['./tsconfig.json'] }, |
||||||
|
globals: { |
||||||
|
wx: true, |
||||||
|
App: true, |
||||||
|
Page: true, |
||||||
|
getCurrentPages: true, |
||||||
|
getApp: true, |
||||||
|
Component: true, |
||||||
|
requirePlugin: true, |
||||||
|
requireMiniProgram: true, |
||||||
|
}, |
||||||
|
rules: { |
||||||
|
'eslint-comments/no-unlimited-disable': 'off', |
||||||
|
'ts/no-require-imports': 'off', |
||||||
|
}, |
||||||
|
}, |
||||||
|
prettierConfig, |
||||||
|
) |
||||||
@ -1,101 +1,101 @@ |
|||||||
import Wxml2Canvas from "./wxml2canvas/index.js"; // 根据具体路径修改,node_modules会被忽略
|
import Wxml2Canvas from "./wxml2canvas/index.js"; // 根据具体路径修改,node_modules会被忽略
|
||||||
|
|
||||||
Component({ |
Component({ |
||||||
properties: { |
properties: { |
||||||
params: { |
params: { |
||||||
type: Object, |
type: Object, |
||||||
observer(newVal, _olVal) { |
observer(newVal, _olVal) { |
||||||
if (Object.keys(newVal).length > 0) { |
if (Object.keys(newVal).length > 0) { |
||||||
this.paramsFormat(newVal); |
this.paramsFormat(newVal); |
||||||
this.setData({ |
this.setData({ |
||||||
width: newVal.body.width, |
width: newVal.body.width, |
||||||
height: newVal.body.height, |
height: newVal.body.height, |
||||||
bgImg: newVal.body.bgImg, |
bgImg: newVal.body.bgImg, |
||||||
elementsMp: newVal.elements, |
elementsMp: newVal.elements, |
||||||
}); |
}); |
||||||
this.drawImage(); |
this.drawImage1(); |
||||||
} |
} |
||||||
}, |
}, |
||||||
}, |
}, |
||||||
}, |
}, |
||||||
data: { |
data: { |
||||||
imgUrl: "", |
imgUrl: "", |
||||||
width: "", |
width: "", |
||||||
height: "", |
height: "", |
||||||
imgheight: "", |
imgheight: "", |
||||||
bgImg: "", |
bgImg: "", |
||||||
elementsMp: [], |
elementsMp: [], |
||||||
}, |
}, |
||||||
lifetimes: { |
lifetimes: { |
||||||
attached() {}, |
attached() {}, |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
paramsFormat(params) { |
paramsFormat(params) { |
||||||
params.elements.forEach((item) => { |
params.elements.forEach((item) => { |
||||||
if (item.type === 0) { |
if (item.type === 0) { |
||||||
// 图片居中
|
// 图片居中
|
||||||
if (item.halign === "center") { |
if (item.halign === "center") { |
||||||
item.left = (params.body.width - item.width) / 2; |
item.left = (params.body.width - item.width) / 2; |
||||||
} |
} |
||||||
} else { |
} else { |
||||||
item.text = item.text.replace(/[\r\n]/g, ""); |
item.text = item.text.replace(/[\r\n]/g, ""); |
||||||
// 文字居中(使文字标签宽度等于画布宽度,文字加上居中的className)
|
// 文字居中(使文字标签宽度等于画布宽度,文字加上居中的className)
|
||||||
if (item.halign === "center") { |
if (item.halign === "center") { |
||||||
item.width = item.width || params.body.width; |
item.width = item.width || params.body.width; |
||||||
item.left = (params.body.width - item.width) / 2; |
item.left = (params.body.width - item.width) / 2; |
||||||
} |
} |
||||||
if (item.halign === "right") { |
if (item.halign === "right") { |
||||||
item.width = params.body.width; |
item.width = params.body.width; |
||||||
} |
} |
||||||
if (item.id === "shareText" && item.text.length > 30) { |
if (item.id === "shareText" && item.text.length > 30) { |
||||||
item.text = item.text.slice(0, 30) + "..."; |
item.text = item.text.slice(0, 30) + "..."; |
||||||
} |
} |
||||||
if (item.id === "note-title" && item.text.length > 28) { |
if (item.id === "note-title" && item.text.length > 28) { |
||||||
item.text = item.text.slice(0, 28) + "..."; |
item.text = item.text.slice(0, 28) + "..."; |
||||||
} |
} |
||||||
if (item.id === "note-content" && item.text.length > 90) { |
if (item.id === "note-content" && item.text.length > 90) { |
||||||
item.text = item.text.slice(0, 90) + "..."; |
item.text = item.text.slice(0, 90) + "..."; |
||||||
} |
} |
||||||
let len = params.elements.some((x) => x.id === "note-title" && x.text.length); |
let len = params.elements.some((x) => x.id === "note-title" && x.text.length); |
||||||
if (len && item.id === "note-summary" && item.text.length > 62) { |
if (len && item.id === "note-summary" && item.text.length > 62) { |
||||||
item.text = item.text.slice(0, 62) + "..."; |
item.text = item.text.slice(0, 62) + "..."; |
||||||
} else if (item.id === "note-summary" && item.text.length > 76) { |
} else if (item.id === "note-summary" && item.text.length > 76) { |
||||||
item.text = item.text.slice(0, 76) + "..."; |
item.text = item.text.slice(0, 76) + "..."; |
||||||
} |
} |
||||||
} |
} |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
drawImage() { |
drawImage1() { |
||||||
let self = this; |
let self = this; |
||||||
this.drawImage1 = new Wxml2Canvas({ |
this.drawImage1 = new Wxml2Canvas({ |
||||||
obj: self, |
obj: self, |
||||||
width: this.data.width, // 宽, 以iphone6为基准,传具体数值,其它机型自动适配
|
width: this.data.width, // 宽, 以iphone6为基准,传具体数值,其它机型自动适配
|
||||||
height: this.data.height, // 高
|
height: this.data.height, // 高
|
||||||
element: "canvas1", |
element: "canvas1", |
||||||
background: "transparent", |
background: "transparent", |
||||||
progress(percent) {}, |
progress(percent) {}, |
||||||
finish(url) { |
finish(url) { |
||||||
self.setData({ |
self.setData({ |
||||||
imgUrl: url, |
imgUrl: url, |
||||||
}); |
}); |
||||||
self.triggerEvent("finish", url); |
self.triggerEvent("finish", url); |
||||||
}, |
}, |
||||||
error(res) {}, |
error(res) {}, |
||||||
}); |
}); |
||||||
|
|
||||||
let data = { |
let data = { |
||||||
list: [ |
list: [ |
||||||
{ |
{ |
||||||
type: "wxml", |
type: "wxml", |
||||||
class: "#canvas-bill-body-mp .draw_canvas", |
class: "#canvas-bill-body-mp .draw_canvas", |
||||||
limit: "#canvas-bill-body-mp", |
limit: "#canvas-bill-body-mp", |
||||||
x: 0, |
x: 0, |
||||||
y: 0, |
y: 0, |
||||||
}, |
}, |
||||||
], |
], |
||||||
}; |
}; |
||||||
|
|
||||||
this.drawImage1.draw(data); |
this.drawImage1.draw(data); |
||||||
}, |
}, |
||||||
}, |
}, |
||||||
}); |
}); |
||||||
|
|||||||
@ -1,5 +1,4 @@ |
|||||||
{ |
{ |
||||||
"navigationBarTitleText": "药房", |
"navigationBarTitleText": "双通道药房", |
||||||
"navigationStyle": "default", |
"usingComponents": {} |
||||||
"usingComponents": {} |
} |
||||||
} |
|
||||||
|
|||||||
@ -1,98 +1,128 @@ |
|||||||
.page { |
.page { |
||||||
position: relative; |
position: relative; |
||||||
.banner { |
.banner { |
||||||
width: 100%; |
width: 100%; |
||||||
min-height: 374rpx; |
min-height: 344rpx; |
||||||
} |
} |
||||||
.container { |
.container { |
||||||
padding: 48rpx 40rpx; |
padding: 48rpx 40rpx; |
||||||
position: absolute; |
position: absolute; |
||||||
top: 348rpx; |
top: 316rpx; |
||||||
left: 0; |
left: 0; |
||||||
width: 100%; |
width: 100%; |
||||||
min-height: 100vh; |
min-height: 100vh; |
||||||
border-radius: 24rpx 24rpx 0 0; |
border-radius: 24rpx 24rpx 0 0; |
||||||
background-color: #ffffff; |
background-color: #fafafa; |
||||||
box-sizing: border-box; |
box-sizing: border-box; |
||||||
.title { |
.title { |
||||||
font-size: 36rpx; |
font-size: 36rpx; |
||||||
color: #211d2e; |
color: #484848; |
||||||
font-weight: bold; |
font-weight: bold; |
||||||
} |
} |
||||||
.content { |
.tags { |
||||||
margin-top: 32rpx; |
margin-top: 16rpx; |
||||||
margin-bottom: 20rpx; |
display: flex; |
||||||
display: flex; |
.tag { |
||||||
justify-content: space-between; |
margin-right: 16rpx; |
||||||
.inner { |
padding-right: 8rpx; |
||||||
.site { |
font-size: 22rpx; |
||||||
font-size: 32rpx; |
color: #e04775; |
||||||
color: #211d2e; |
line-height: 1; |
||||||
} |
border-radius: 8rpx; |
||||||
.tel { |
background-color: #f5dfe6; |
||||||
font-size: 32rpx; |
display: flex; |
||||||
color: #211d2e; |
align-items: center; |
||||||
} |
.icon { |
||||||
} |
margin-right: 8rpx; |
||||||
} |
padding: 4rpx; |
||||||
.options { |
width: 24rpx; |
||||||
margin-top: 40rpx; |
max-height: 24rpx; |
||||||
display: flex; |
background-color: #e04775; |
||||||
align-items: center; |
border-radius: 8rpx; |
||||||
justify-content: center; |
} |
||||||
gap: 30rpx; |
} |
||||||
.phone { |
} |
||||||
flex: 1; |
.content { |
||||||
line-height: 70rpx; |
margin-top: 32rpx; |
||||||
font-size: 32rpx; |
margin-bottom: 20rpx; |
||||||
color: #b982ff; |
display: flex; |
||||||
border-radius: 60rpx 60rpx 60rpx 60rpx; |
justify-content: space-between; |
||||||
border: 1px solid #b982ff; |
.inner { |
||||||
display: flex; |
.site { |
||||||
align-items: center; |
font-size: 28rpx; |
||||||
justify-content: center; |
color: #9e9e9e; |
||||||
.icon { |
} |
||||||
margin-right: 8rpx; |
.tel { |
||||||
display: inline-block; |
font-size: 28rpx; |
||||||
width: 36rpx; |
color: #9b9ea6; |
||||||
height: 36rpx; |
} |
||||||
} |
} |
||||||
} |
.options { |
||||||
.site { |
flex-shrink: 0; |
||||||
flex: 1; |
display: flex; |
||||||
line-height: 76rpx; |
.option { |
||||||
font-size: 32rpx; |
margin-left: 30rpx; |
||||||
color: #ffffff; |
.phone { |
||||||
border-radius: 60rpx; |
width: 48rpx; |
||||||
background: linear-gradient(197deg, #ffbcf9 0%, #b982ff 100%); |
height: 48rpx; |
||||||
display: flex; |
border-radius: 50%; |
||||||
align-items: center; |
display: flex; |
||||||
justify-content: center; |
align-items: center; |
||||||
.icon { |
justify-content: center; |
||||||
margin-right: 8rpx; |
background-color: #fff; |
||||||
display: inline-block; |
box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.1); |
||||||
width: 32rpx; |
&-img { |
||||||
height: 32rpx; |
width: 24rpx; |
||||||
} |
height: 24rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
|
.name { |
||||||
.remark { |
margin-top: 8rpx; |
||||||
margin-top: 56rpx; |
font-size: 24rpx; |
||||||
padding: 32rpx; |
color: #484848; |
||||||
border-radius: 24rpx; |
} |
||||||
background-color: #fafafa; |
} |
||||||
.r-title { |
} |
||||||
font-size: 32rpx; |
} |
||||||
color: #211d2e; |
|
||||||
font-weight: bold; |
.card { |
||||||
} |
margin-bottom: 16rpx; |
||||||
.r-content { |
padding: 32rpx 30rpx; |
||||||
margin-top: 20rpx; |
border-radius: 24rpx; |
||||||
font-size: 28rpx; |
background-color: #fff; |
||||||
color: #69686e; |
.c-title { |
||||||
word-break: break-all; |
font-size: 32rpx; |
||||||
} |
font-weight: bold; |
||||||
} |
color: #484848; |
||||||
} |
display: flex; |
||||||
} |
align-items: center; |
||||||
|
.c-icon { |
||||||
|
margin-right: 16rpx; |
||||||
|
width: 36rpx; |
||||||
|
height: 36rpx; |
||||||
|
} |
||||||
|
} |
||||||
|
.c-content{ |
||||||
|
margin-top: 24rpx; |
||||||
|
font-size: 28rpx; |
||||||
|
color: #9E9E9E; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.remark{ |
||||||
|
padding: 32rpx; |
||||||
|
border-radius: 24rpx; |
||||||
|
background-color: #fff; |
||||||
|
.r-title{ |
||||||
|
font-size: 32rpx; |
||||||
|
color: #484848; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
.r-content{ |
||||||
|
margin-top: 20rpx; |
||||||
|
font-size: 28rpx; |
||||||
|
color: #9E9E9E; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|||||||
@ -1,140 +1,52 @@ |
|||||||
const app = getApp<IAppOption>() |
const app = getApp<IAppOption>(); |
||||||
|
|
||||||
Page({ |
Page({ |
||||||
data: { |
data: { |
||||||
id: '', |
id: "", |
||||||
detail: {} as any, |
detail: {} as any, |
||||||
|
}, |
||||||
LNG: '' as number | string, |
onLoad(options) { |
||||||
LAT: '' as number | string, |
this.setData({ |
||||||
}, |
id: options.id, |
||||||
onLoad(options) { |
}); |
||||||
this.setData({ |
app.waitLogin().then(() => { |
||||||
id: options.id, |
this.getDetail(); |
||||||
}) |
}); |
||||||
app.waitLogin({ type: [0, 1] }).then(() => { |
}, |
||||||
this.handleToggleSite() |
|
||||||
}) |
getDetail() { |
||||||
}, |
wx.ajax({ |
||||||
handleToggleSite() { |
method: "GET", |
||||||
if (!this.data.LNG) { |
url: "?r=zd/dtp-pharmacy/detail", |
||||||
wx.getSetting({ |
data: { |
||||||
success: (res) => { |
Id: this.data.id, |
||||||
if ( |
}, |
||||||
res.authSetting['scope.userFuzzyLocation'] != undefined |
}).then((res) => { |
||||||
&& res.authSetting['scope.userFuzzyLocation'] == true |
this.setData({ |
||||||
) { |
detail: res, |
||||||
// 获取当前位置
|
}); |
||||||
this.getFuzzyLocation() |
}); |
||||||
} |
}, |
||||||
else if (res.authSetting['scope.userFuzzyLocation'] == undefined) { |
handleSite() { |
||||||
// 获取当前位置
|
const { LNG, LAT, ProvinceName, CityName, CountyName, Address, Name } = this.data.detail; |
||||||
this.getFuzzyLocation() |
wx.openLocation({ |
||||||
} |
latitude: LAT, |
||||||
else { |
longitude: LNG, |
||||||
wx.showModal({ |
name: Name, |
||||||
title: '请求授权当前位置', |
address: `${ProvinceName}${CityName}${CountyName}${Address}`, |
||||||
content: '需要获取您的地理位置,请确认授权', |
}); |
||||||
confirmColor: '#8c75d0', |
}, |
||||||
success: (res) => { |
handlePhone() { |
||||||
if (res.cancel) { |
const tel = this.data.detail.Telephone; |
||||||
// 取消授权
|
if (!tel) { |
||||||
wx.showToast({ |
wx.showToast({ |
||||||
title: '拒绝授权', |
icon: "none", |
||||||
icon: 'none', |
title: "电话暂未开通", |
||||||
duration: 1000, |
}); |
||||||
}) |
return; |
||||||
this.getDetail() |
} |
||||||
} |
wx.makePhoneCall({ |
||||||
else if (res.confirm) { |
phoneNumber: tel, |
||||||
// 确定授权,通过wx.openSetting发起授权请求
|
}); |
||||||
wx.openSetting({ |
}, |
||||||
success: (res) => { |
}); |
||||||
if (res.authSetting['scope.userFuzzyLocation'] == true) { |
|
||||||
wx.showToast({ |
|
||||||
title: '授权成功', |
|
||||||
icon: 'success', |
|
||||||
duration: 1000, |
|
||||||
}) |
|
||||||
// 再次授权,调用wx.getLocation的API
|
|
||||||
this.getFuzzyLocation() |
|
||||||
} |
|
||||||
else { |
|
||||||
wx.showToast({ |
|
||||||
title: '授权失败', |
|
||||||
icon: 'none', |
|
||||||
duration: 1000, |
|
||||||
}) |
|
||||||
this.getDetail() |
|
||||||
} |
|
||||||
}, |
|
||||||
}) |
|
||||||
} |
|
||||||
}, |
|
||||||
}) |
|
||||||
} |
|
||||||
}, |
|
||||||
}) |
|
||||||
} |
|
||||||
else { |
|
||||||
this.setData({ |
|
||||||
LNG: '', |
|
||||||
LAT: '', |
|
||||||
}) |
|
||||||
this.getDetail() |
|
||||||
} |
|
||||||
}, |
|
||||||
getFuzzyLocation() { |
|
||||||
wx.getFuzzyLocation({ |
|
||||||
success: (res) => { |
|
||||||
this.setData({ |
|
||||||
LNG: res.longitude, |
|
||||||
LAT: res.latitude, |
|
||||||
}) |
|
||||||
this.getDetail() |
|
||||||
}, |
|
||||||
fail: () => { |
|
||||||
this.getDetail() |
|
||||||
}, |
|
||||||
}) |
|
||||||
}, |
|
||||||
getDetail() { |
|
||||||
wx.ajax({ |
|
||||||
method: 'GET', |
|
||||||
url: '?r=zd/dtp-pharmacy/detail', |
|
||||||
data: { |
|
||||||
Id: this.data.id, |
|
||||||
lng: this.data.LNG, |
|
||||||
lat: this.data.LAT, |
|
||||||
}, |
|
||||||
}).then((res) => { |
|
||||||
this.setData({ |
|
||||||
detail: res, |
|
||||||
}) |
|
||||||
}) |
|
||||||
}, |
|
||||||
handleSite() { |
|
||||||
const { LNG, LAT, ProvinceName, CityName, CountyName, Address, Name } = this.data.detail |
|
||||||
wx.openLocation({ |
|
||||||
latitude: LAT, |
|
||||||
longitude: LNG, |
|
||||||
name: Name, |
|
||||||
address: `${ProvinceName}${CityName}${CountyName}${Address}`, |
|
||||||
}) |
|
||||||
}, |
|
||||||
handlePhone() { |
|
||||||
const tel = this.data.detail.Telephone |
|
||||||
if (!tel) { |
|
||||||
wx.showToast({ |
|
||||||
icon: 'none', |
|
||||||
title: '电话暂未开通', |
|
||||||
}) |
|
||||||
return |
|
||||||
} |
|
||||||
wx.makePhoneCall({ |
|
||||||
phoneNumber: tel, |
|
||||||
}) |
|
||||||
}, |
|
||||||
}) |
|
||||||
|
|
||||||
export {} |
|
||||||
|
|||||||
@ -1,27 +1,61 @@ |
|||||||
<view class="page"> |
<view class="page"> |
||||||
<!-- <image wx:if="{{detail.ImgUrl}}" class="banner" mode="widthFix" src="{{detail.ImgUrl}}"></image> --> |
<image wx:if="{{detail.ImgUrl}}" class="banner" mode="widthFix" src="{{detail.ImgUrl}}"></image> |
||||||
<image class="banner" mode="widthFix" src="{{imageUrl}}bg34.png?t={{Timestamp}}"></image> |
<image wx:else class="banner" mode="widthFix" src="{{imageUrl}}za-images//nrdl/dtp-durg.png"></image> |
||||||
<view class="container"> |
<view class="container"> |
||||||
<view class="title">{{detail.Name}}</view> |
<view class="title">{{detail.Name}}</view> |
||||||
<view class="content"> |
<view class="tags"> |
||||||
<view class="inner"> |
<view class="tag" wx:if="{{detail.IsOwnInfusionCenter==1}}"> |
||||||
<view class="site">{{detail.ProvinceName}}{{detail.CityName}}{{detail.CountyName}}{{detail.Address}}</view> |
<image class="icon" mode="widthFix" src="{{imageUrl}}za-images//nrdl/inject.png"></image> |
||||||
<view class="tel">{{detail.Telephone}}</view> |
<!-- {{detail.OwnInfusionCenterName}} --> |
||||||
</view> |
自有输注中心 |
||||||
</view> |
</view> |
||||||
<view class="options"> |
<view class="tag" wx:if="{{detail.IsCooperationInfusionCenter==1}}"> |
||||||
<view class="phone" bind:tap="handlePhone"> |
<image class="icon" mode="widthFix" src="{{imageUrl}}za-images//nrdl/cooperate.png"></image> |
||||||
<image class="icon" src="{{imageUrl}}icon95.png?t={{Timestamp}}"></image> |
<!-- {{detail.CooperationInfusionCenterName}} --> |
||||||
电话 |
合作输注中心 |
||||||
</view> |
</view> |
||||||
<view class="site" bind:tap="handleSite" wx:if="{{detail.Address}}"> |
</view> |
||||||
<image class="icon" src="{{imageUrl}}icon96.png?t={{Timestamp}}"></image> |
<view class="content"> |
||||||
地址{{detail.dist}} |
<view class="inner"> |
||||||
</view> |
<view class="site">{{detail.ProvinceName}}{{detail.CityName}}{{detail.CountyName}}{{detail.Address}}</view> |
||||||
</view> |
<view class="tel">{{detail.Telephone}}</view> |
||||||
<view class="remark" wx:if="{{detail.Remark}}"> |
</view> |
||||||
<view class="r-title">备注</view> |
<view class="options"> |
||||||
<view class="r-content">{{detail.Remark}}</view> |
<view class="option" bind:tap="handleSite" wx:if="{{detail.Address}}"> |
||||||
</view> |
<view class="phone"> |
||||||
</view> |
<image class="phone-img" src="{{imageUrl}}za-images//nrdl/site.png"></image> |
||||||
</view> |
</view> |
||||||
|
<view class="name">地址</view> |
||||||
|
</view> |
||||||
|
<view class="option" bind:tap="handlePhone"> |
||||||
|
<view class="phone"> |
||||||
|
<image class="phone-img" src="{{imageUrl}}za-images//nrdl/phone.png"></image> |
||||||
|
</view> |
||||||
|
<view class="name">电话</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<view class="card" wx:if="{{detail.IsOwnInfusionCenter==1}}"> |
||||||
|
<view class="c-title"> |
||||||
|
<image |
||||||
|
class="c-icon" |
||||||
|
src="{{imageUrl}}za-images//nrdl/cooperate-1.png" |
||||||
|
style="width: 32rpx; height: 30rpx; margin-right: 18rpx" |
||||||
|
></image> |
||||||
|
自有输注中心 |
||||||
|
</view> |
||||||
|
<view class="c-content">{{detail.OwnInfusionCenterName}}</view> |
||||||
|
</view> |
||||||
|
<view class="card" wx:if="{{detail.IsCooperationInfusionCenter==1}}"> |
||||||
|
<view class="c-title"> |
||||||
|
<image class="c-icon" src="{{imageUrl}}za-images//nrdl/inject-1.png" style="width: 36rpx; height: 36rpx"></image> |
||||||
|
合作输注中心 |
||||||
|
</view> |
||||||
|
<view class="c-content">{{detail.CooperationInfusionCenterName}}</view> |
||||||
|
</view> |
||||||
|
<view class="remark" wx:if="{{detail.Remark}}"> |
||||||
|
<view class="r-title">备注</view> |
||||||
|
<view class="r-content">{{detail.Remark}}</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
|||||||
|
Before Width: | Height: | Size: 175 KiB After Width: | Height: | Size: 247 KiB |
|
Before Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 495 KiB |
|
Before Width: | Height: | Size: 455 KiB |
|
Before Width: | Height: | Size: 647 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 459 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 694 B |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 753 B |
|
Before Width: | Height: | Size: 558 B |
|
Before Width: | Height: | Size: 945 B |
|
Before Width: | Height: | Size: 616 B |
|
Before Width: | Height: | Size: 877 B |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 283 B |
|
Before Width: | Height: | Size: 696 KiB After Width: | Height: | Size: 634 KiB |
@ -1,54 +1,47 @@ |
|||||||
const app = getApp<IAppOption>() |
const app = getApp<IAppOption>(); |
||||||
|
|
||||||
Page({ |
Page({ |
||||||
data: {}, |
data: {}, |
||||||
onLoad() { |
onLoad() { |
||||||
app.waitLogin().then(() => { |
app.waitLogin().then(() => { |
||||||
const { isLogin, isNewReg, loginType, scene } = app.globalData |
const { isLogin, isNewReg, loginType } = app.globalData; |
||||||
if (isLogin === 0) { |
if (isLogin === 0) { |
||||||
// 未登录用户,扫医生邀请码,重定向到患者登录页
|
|
||||||
if (scene?.doctorId) { |
|
||||||
wx.reLaunch({ |
|
||||||
url: '/patient/pages/login/index', |
|
||||||
}) |
|
||||||
return |
|
||||||
} |
|
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/patient/pages/index/index', |
url: '/patient/pages/index/index', |
||||||
}) |
}); |
||||||
return |
return; |
||||||
} |
} |
||||||
if (loginType === 0) { |
if (loginType === 0) { |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/patient/pages/index/index', |
url: '/patient/pages/index/index', |
||||||
}) |
}); |
||||||
return |
return; |
||||||
} |
} |
||||||
if (loginType === 1) { |
if (loginType === 1) { |
||||||
if (isNewReg === 1) { |
if (isNewReg === 1) { |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/patient/pages/index/index', |
url: '/patient/pages/index/index', |
||||||
}) |
}); |
||||||
return |
return; |
||||||
} |
} |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/patient/pages/enterInfo/index', |
url: '/patient/pages/enterInfo/index', |
||||||
}) |
}); |
||||||
return |
return; |
||||||
} |
} |
||||||
if (loginType === 2) { |
if (loginType === 2) { |
||||||
if (isNewReg === 1) { |
if (isNewReg === 1) { |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/pages/home/index', |
url: '/pages/home/index', |
||||||
}) |
}); |
||||||
return |
return; |
||||||
} |
} |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/pages/login/index', |
url: '/pages/login/index', |
||||||
}) |
}); |
||||||
} |
} |
||||||
}) |
}); |
||||||
}, |
}, |
||||||
}) |
}); |
||||||
|
|
||||||
export {} |
export {}; |
||||||
|
|||||||
@ -1,98 +1,9 @@ |
|||||||
.page { |
.page { |
||||||
position: relative; |
display: block; |
||||||
.banner { |
width: 100%; |
||||||
width: 100%; |
} |
||||||
min-height: 374rpx; |
.page-title { |
||||||
} |
margin-top: -120rpx; |
||||||
.container { |
text-align: center; |
||||||
padding: 48rpx 40rpx; |
color: #fea8b7; |
||||||
position: absolute; |
} |
||||||
top: 348rpx; |
|
||||||
left: 0; |
|
||||||
width: 100%; |
|
||||||
min-height: 100vh; |
|
||||||
border-radius: 24rpx 24rpx 0 0; |
|
||||||
background-color: #fff; |
|
||||||
box-sizing: border-box; |
|
||||||
.title { |
|
||||||
font-size: 36rpx; |
|
||||||
color: #211d2e; |
|
||||||
font-weight: bold; |
|
||||||
} |
|
||||||
.content { |
|
||||||
margin-top: 32rpx; |
|
||||||
margin-bottom: 20rpx; |
|
||||||
display: flex; |
|
||||||
justify-content: space-between; |
|
||||||
.inner { |
|
||||||
.site { |
|
||||||
font-size: 32rpx; |
|
||||||
color: #211D2E; |
|
||||||
} |
|
||||||
.tel { |
|
||||||
font-size: 32rpx; |
|
||||||
color: #211D2E; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
.options { |
|
||||||
margin-top: 40rpx; |
|
||||||
display: flex; |
|
||||||
align-items: center; |
|
||||||
justify-content: center; |
|
||||||
gap: 30rpx; |
|
||||||
.phone { |
|
||||||
flex: 1; |
|
||||||
line-height: 70rpx; |
|
||||||
font-size: 32rpx; |
|
||||||
color: #b982ff; |
|
||||||
border-radius: 60rpx 60rpx 60rpx 60rpx; |
|
||||||
border: 1px solid #b982ff; |
|
||||||
display: flex; |
|
||||||
align-items: center; |
|
||||||
justify-content: center; |
|
||||||
.icon { |
|
||||||
margin-right: 8rpx; |
|
||||||
display: inline-block; |
|
||||||
width: 36rpx; |
|
||||||
height: 36rpx; |
|
||||||
} |
|
||||||
} |
|
||||||
.site { |
|
||||||
flex: 1; |
|
||||||
line-height: 76rpx; |
|
||||||
font-size: 32rpx; |
|
||||||
color: #ffffff; |
|
||||||
border-radius: 60rpx; |
|
||||||
background: linear-gradient(197deg, #ffbcf9 0%, #b982ff 100%); |
|
||||||
display: flex; |
|
||||||
align-items: center; |
|
||||||
justify-content: center; |
|
||||||
.icon { |
|
||||||
margin-right: 8rpx; |
|
||||||
display: inline-block; |
|
||||||
width: 32rpx; |
|
||||||
height: 32rpx; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.remark { |
|
||||||
margin-top: 56rpx; |
|
||||||
padding: 32rpx; |
|
||||||
border-radius: 24rpx; |
|
||||||
background-color: #fafafa; |
|
||||||
.r-title { |
|
||||||
font-size: 32rpx; |
|
||||||
color: #211d2e; |
|
||||||
font-weight: bold; |
|
||||||
} |
|
||||||
.r-content { |
|
||||||
margin-top: 20rpx; |
|
||||||
font-size: 28rpx; |
|
||||||
color: #69686e; |
|
||||||
word-break: break-all; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|||||||
@ -1,139 +1,6 @@ |
|||||||
const app = getApp<IAppOption>() |
const _app = getApp<IAppOption>(); |
||||||
|
|
||||||
Page({ |
Page({ |
||||||
data: { |
data: {}, |
||||||
id: '', |
onLoad() { }, |
||||||
detail: {} as any, |
}) |
||||||
LNG: '' as number | string, |
|
||||||
LAT: '' as number | string, |
|
||||||
}, |
|
||||||
onLoad(options) { |
|
||||||
this.setData({ |
|
||||||
id: options.id, |
|
||||||
}) |
|
||||||
app.waitLogin({ type: [0, 1] }).then(() => { |
|
||||||
this.handleToggleSite() |
|
||||||
}) |
|
||||||
}, |
|
||||||
handleToggleSite() { |
|
||||||
if (!this.data.LNG) { |
|
||||||
wx.getSetting({ |
|
||||||
success: (res) => { |
|
||||||
if ( |
|
||||||
res.authSetting['scope.userFuzzyLocation'] != undefined |
|
||||||
&& res.authSetting['scope.userFuzzyLocation'] == true |
|
||||||
) { |
|
||||||
// 获取当前位置
|
|
||||||
this.getFuzzyLocation() |
|
||||||
} |
|
||||||
else if (res.authSetting['scope.userFuzzyLocation'] == undefined) { |
|
||||||
// 获取当前位置
|
|
||||||
this.getFuzzyLocation() |
|
||||||
} |
|
||||||
else { |
|
||||||
wx.showModal({ |
|
||||||
title: '请求授权当前位置', |
|
||||||
content: '需要获取您的地理位置,请确认授权', |
|
||||||
confirmColor: '#8c75d0', |
|
||||||
success: (res) => { |
|
||||||
if (res.cancel) { |
|
||||||
// 取消授权
|
|
||||||
wx.showToast({ |
|
||||||
title: '拒绝授权', |
|
||||||
icon: 'none', |
|
||||||
duration: 1000, |
|
||||||
}) |
|
||||||
this.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
|
|
||||||
this.getFuzzyLocation() |
|
||||||
} |
|
||||||
else { |
|
||||||
wx.showToast({ |
|
||||||
title: '授权失败', |
|
||||||
icon: 'none', |
|
||||||
duration: 1000, |
|
||||||
}) |
|
||||||
this.getDetail() |
|
||||||
} |
|
||||||
}, |
|
||||||
}) |
|
||||||
} |
|
||||||
}, |
|
||||||
}) |
|
||||||
} |
|
||||||
}, |
|
||||||
}) |
|
||||||
} |
|
||||||
else { |
|
||||||
this.setData({ |
|
||||||
LNG: '', |
|
||||||
LAT: '', |
|
||||||
}) |
|
||||||
this.getDetail() |
|
||||||
} |
|
||||||
}, |
|
||||||
getFuzzyLocation() { |
|
||||||
wx.getFuzzyLocation({ |
|
||||||
success: (res) => { |
|
||||||
this.setData({ |
|
||||||
LNG: res.longitude, |
|
||||||
LAT: res.latitude, |
|
||||||
}) |
|
||||||
this.getDetail() |
|
||||||
}, |
|
||||||
fail: () => { |
|
||||||
this.getDetail() |
|
||||||
}, |
|
||||||
}) |
|
||||||
}, |
|
||||||
getDetail() { |
|
||||||
wx.ajax({ |
|
||||||
method: 'GET', |
|
||||||
url: '?r=xd/infusion-center/detail', |
|
||||||
data: { |
|
||||||
Id: this.data.id, |
|
||||||
lng: this.data.LNG, |
|
||||||
lat: this.data.LAT, |
|
||||||
}, |
|
||||||
}).then((res) => { |
|
||||||
this.setData({ |
|
||||||
detail: res, |
|
||||||
}) |
|
||||||
}) |
|
||||||
}, |
|
||||||
handleSite() { |
|
||||||
const { LNG, LAT, ProvinceName, CityName, CountyName, Address, Name } = this.data.detail |
|
||||||
wx.openLocation({ |
|
||||||
latitude: LAT, |
|
||||||
longitude: LNG, |
|
||||||
name: Name, |
|
||||||
address: `${ProvinceName}${CityName}${CountyName}${Address}`, |
|
||||||
}) |
|
||||||
}, |
|
||||||
handlePhone() { |
|
||||||
const tel = this.data.detail.Telephone |
|
||||||
if (!tel) { |
|
||||||
wx.showToast({ |
|
||||||
icon: 'none', |
|
||||||
title: '电话暂未开通', |
|
||||||
}) |
|
||||||
return |
|
||||||
} |
|
||||||
wx.makePhoneCall({ |
|
||||||
phoneNumber: tel, |
|
||||||
}) |
|
||||||
}, |
|
||||||
}) |
|
||||||
|
|
||||||
export {} |
|
||||||
|
|||||||
@ -1,27 +1,2 @@ |
|||||||
<view class="page"> |
<image class="page" mode="widthFix" src="{{imageUrl}}za-images//infusionCenter.png?t={{Timestamp}}"></image> |
||||||
<!-- <image wx:if="{{detail.ImgUrl}}" class="banner" mode="widthFix" src="{{detail.ImgUrl}}"></image> --> |
<view class="page-title">即将上线,敬请期待!</view> |
||||||
<image class="banner" mode="widthFix" src="{{imageUrl}}bg33.png?t={{Timestamp}}"></image> |
|
||||||
<view class="container"> |
|
||||||
<view class="title">{{detail.Name}}</view> |
|
||||||
<view class="content"> |
|
||||||
<view class="inner"> |
|
||||||
<view class="site">{{detail.ProvinceName}}{{detail.CityName}}{{detail.CountyName}}{{detail.Address}}</view> |
|
||||||
<view class="tel">{{detail.Telephone}}</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<view class="options"> |
|
||||||
<view class="phone" bind:tap="handlePhone"> |
|
||||||
<image class="icon" src="{{imageUrl}}icon95.png?t={{Timestamp}}"></image> |
|
||||||
电话 |
|
||||||
</view> |
|
||||||
<view class="site" bind:tap="handleSite" wx:if="{{detail.Address}}"> |
|
||||||
<image class="icon" src="{{imageUrl}}icon96.png?t={{Timestamp}}"></image> |
|
||||||
地址{{detail.dist}} |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<view class="remark" wx:if="{{detail.Remark}}"> |
|
||||||
<view class="r-title">备注</view> |
|
||||||
<view class="r-content">{{detail.Remark}}</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
|
|||||||
@ -1,65 +1,64 @@ |
|||||||
export function formatTime(date: Date) { |
export const 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 function formatNumber(n: number) { |
export const 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 function getCurrentPageUrl() { |
export const getCurrentPageUrl = function () { |
||||||
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 function getCurrentPageUrlWithArgs() { |
export const getCurrentPageUrlWithArgs = function () { |
||||||
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; |
||||||
} |
}; |
||||||
|
|
||||||
export function parseUrlArgsToArray(urlArgs): any { |
const parseUrlArgsToArray = (urlArgs) => { |
||||||
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 function parseScene(scene) { |
export const parseScene = (scene) => { |
||||||
if (scene) { |
if (scene) { |
||||||
return parseUrlArgsToArray(decodeURIComponent(scene)) |
return parseUrlArgsToArray(decodeURIComponent(scene)); |
||||||
|
} else { |
||||||
|
return null; |
||||||
} |
} |
||||||
else { |
}; |
||||||
return null |
|
||||||
} |
|
||||||
} |
|
||||||
|
|||||||