Compare commits
No commits in common. 'master' and 'lightspot' have entirely different histories.
@ -1,28 +0,0 @@
@@ -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 @@
@@ -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,5 +1,4 @@
@@ -1,5 +1,4 @@
|
||||
{ |
||||
"navigationBarTitleText": "药房", |
||||
"navigationStyle": "default", |
||||
"navigationBarTitleText": "双通道药房", |
||||
"usingComponents": {} |
||||
} |
||||
|
||||
@ -1,140 +1,52 @@
@@ -1,140 +1,52 @@
|
||||
const app = getApp<IAppOption>() |
||||
const app = getApp<IAppOption>(); |
||||
|
||||
Page({ |
||||
data: { |
||||
id: '', |
||||
id: "", |
||||
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() |
||||
}, |
||||
}) |
||||
}); |
||||
app.waitLogin().then(() => { |
||||
this.getDetail(); |
||||
}); |
||||
}, |
||||
|
||||
getDetail() { |
||||
wx.ajax({ |
||||
method: 'GET', |
||||
url: '?r=zd/dtp-pharmacy/detail', |
||||
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 |
||||
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 |
||||
const tel = this.data.detail.Telephone; |
||||
if (!tel) { |
||||
wx.showToast({ |
||||
icon: 'none', |
||||
title: '电话暂未开通', |
||||
}) |
||||
return |
||||
icon: "none", |
||||
title: "电话暂未开通", |
||||
}); |
||||
return; |
||||
} |
||||
wx.makePhoneCall({ |
||||
phoneNumber: tel, |
||||
}) |
||||
}); |
||||
}, |
||||
}) |
||||
|
||||
export {} |
||||
}); |
||||
|
||||
|
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 @@
@@ -1,54 +1,47 @@
|
||||
const app = getApp<IAppOption>() |
||||
const app = getApp<IAppOption>(); |
||||
|
||||
Page({ |
||||
data: {}, |
||||
onLoad() { |
||||
app.waitLogin().then(() => { |
||||
const { isLogin, isNewReg, loginType, scene } = app.globalData |
||||
const { isLogin, isNewReg, loginType } = app.globalData; |
||||
if (isLogin === 0) { |
||||
// 未登录用户,扫医生邀请码,重定向到患者登录页
|
||||
if (scene?.doctorId) { |
||||
wx.reLaunch({ |
||||
url: '/patient/pages/login/index', |
||||
}) |
||||
return |
||||
} |
||||
wx.reLaunch({ |
||||
url: '/patient/pages/index/index', |
||||
}) |
||||
return |
||||
}); |
||||
return; |
||||
} |
||||
if (loginType === 0) { |
||||
wx.reLaunch({ |
||||
url: '/patient/pages/index/index', |
||||
}) |
||||
return |
||||
}); |
||||
return; |
||||
} |
||||
if (loginType === 1) { |
||||
if (isNewReg === 1) { |
||||
wx.reLaunch({ |
||||
url: '/patient/pages/index/index', |
||||
}) |
||||
return |
||||
}); |
||||
return; |
||||
} |
||||
wx.reLaunch({ |
||||
url: '/patient/pages/enterInfo/index', |
||||
}) |
||||
return |
||||
}); |
||||
return; |
||||
} |
||||
if (loginType === 2) { |
||||
if (isNewReg === 1) { |
||||
wx.reLaunch({ |
||||
url: '/pages/home/index', |
||||
}) |
||||
return |
||||
}); |
||||
return; |
||||
} |
||||
wx.reLaunch({ |
||||
url: '/pages/login/index', |
||||
}) |
||||
}); |
||||
} |
||||
}) |
||||
}); |
||||
}, |
||||
}) |
||||
}); |
||||
|
||||
export {} |
||||
export {}; |
||||
|
||||
@ -1,98 +1,9 @@
@@ -1,98 +1,9 @@
|
||||
.page { |
||||
position: relative; |
||||
.banner { |
||||
display: block; |
||||
width: 100%; |
||||
min-height: 374rpx; |
||||
} |
||||
.container { |
||||
padding: 48rpx 40rpx; |
||||
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; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
.page-title { |
||||
margin-top: -120rpx; |
||||
text-align: center; |
||||
color: #fea8b7; |
||||
} |
||||
|
||||
@ -1,27 +1,2 @@
@@ -1,27 +1,2 @@
|
||||
<view class="page"> |
||||
<!-- <image wx:if="{{detail.ImgUrl}}" class="banner" mode="widthFix" src="{{detail.ImgUrl}}"></image> --> |
||||
<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> |
||||
<image class="page" mode="widthFix" src="{{imageUrl}}za-images//infusionCenter.png?t={{Timestamp}}"></image> |
||||
<view class="page-title">即将上线,敬请期待!</view> |
||||
|
||||
@ -1,65 +1,64 @@
@@ -1,65 +1,64 @@
|
||||
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() |
||||
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(); |
||||
|
||||
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) { |
||||
const s = n.toString() |
||||
return s[1] ? s : `0${s}` |
||||
} |
||||
export const formatNumber = (n: number) => { |
||||
const s = n.toString(); |
||||
return s[1] ? s : `0${s}`; |
||||
}; |
||||
|
||||
/** |
||||
* 获取当前页面路径 |
||||
* @returns string |
||||
*/ |
||||
export function getCurrentPageUrl() { |
||||
const pages = getCurrentPages() |
||||
const currentPage = pages[pages.length - 1] |
||||
const url = `/${currentPage.route}` |
||||
return url |
||||
} |
||||
export const getCurrentPageUrl = function () { |
||||
const pages = getCurrentPages(); |
||||
const currentPage = pages[pages.length - 1]; |
||||
const url = `/${currentPage.route}`; |
||||
return url; |
||||
}; |
||||
|
||||
/** |
||||
* 获取当前页面路径 & 参数 |
||||
* @returns string |
||||
*/ |
||||
export function getCurrentPageUrlWithArgs() { |
||||
const pages = getCurrentPages() |
||||
const currentPage = pages[pages.length - 1] |
||||
const url = currentPage.route |
||||
const options = currentPage.options |
||||
let urlWithArgs = `/${url}?` |
||||
export const getCurrentPageUrlWithArgs = function () { |
||||
const pages = getCurrentPages(); |
||||
const currentPage = pages[pages.length - 1]; |
||||
const url = currentPage.route; |
||||
const options = currentPage.options; |
||||
let urlWithArgs = `/${url}?`; |
||||
for (const key in options) { |
||||
const value = options[key] |
||||
urlWithArgs += `${key}=${value}&` |
||||
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; |
||||
}; |
||||
|
||||
export function parseUrlArgsToArray(urlArgs): any { |
||||
urlArgs = urlArgs.split('&') |
||||
const results = {} |
||||
const parseUrlArgsToArray = (urlArgs) => { |
||||
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 function parseScene(scene) { |
||||
export const parseScene = (scene) => { |
||||
if (scene) { |
||||
return parseUrlArgsToArray(decodeURIComponent(scene)) |
||||
return parseUrlArgsToArray(decodeURIComponent(scene)); |
||||
} else { |
||||
return null; |
||||
} |
||||
else { |
||||
return null |
||||
} |
||||
} |
||||
}; |
||||
|
||||