Compare commits
No commits in common. 'master' and 'demo-md' have entirely different histories.
@ -1,12 +0,0 @@ |
|||||||
# EditorConfig is awesome: https://EditorConfig.org |
|
||||||
|
|
||||||
# top-most EditorConfig file |
|
||||||
root = true |
|
||||||
|
|
||||||
[*] |
|
||||||
indent_style = space |
|
||||||
indent_size = 2 |
|
||||||
end_of_line = lf |
|
||||||
charset = utf-8 |
|
||||||
trim_trailing_whitespace = true |
|
||||||
insert_final_newline = true |
|
@ -1,5 +1,2 @@ |
|||||||
.svn |
|
||||||
.vscode |
|
||||||
node_modules |
node_modules |
||||||
.idea |
src/images/.svn |
||||||
.DS_Store |
|
||||||
|
@ -1,11 +0,0 @@ |
|||||||
## global color |
|
||||||
|
|
||||||
<!--图片文件夹svn地址--> |
|
||||||
svn://39.106.86.127:28386/projects/wutian_xueyoubing_b/proj_src/shop/frontend/web/GeneB |
|
||||||
|
|
||||||
(/images/)(\S*(?=["|'])) |
|
||||||
{{imageUrl}}$2?t={{Timestamp}} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567 |
|
@ -1,11 +0,0 @@ |
|||||||
{ |
|
||||||
"plugins": [ |
|
||||||
[ |
|
||||||
"@babel/plugin-transform-react-jsx", |
|
||||||
{ |
|
||||||
"runtime": "automatic", |
|
||||||
"importSource": "@antv/f2" |
|
||||||
} |
|
||||||
] |
|
||||||
] |
|
||||||
} |
|
@ -1,5 +0,0 @@ |
|||||||
cd ./src/images/ |
|
||||||
svn add . --no-ignore --force |
|
||||||
svn ci -m "版本更新" |
|
||||||
cd .. |
|
||||||
cd .. |
|
@ -1,5 +0,0 @@ |
|||||||
#!/bin/bash |
|
||||||
cd ./src/images/ || exit |
|
||||||
svn add . --no-ignore --force |
|
||||||
svn ci -m "版本更新" |
|
||||||
exit |
|
@ -1,29 +0,0 @@ |
|||||||
// 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', |
|
||||||
eqeqeq: 'off', |
|
||||||
}, |
|
||||||
}, |
|
||||||
prettierConfig, |
|
||||||
) |
|
@ -1,134 +1,42 @@ |
|||||||
{ |
{ |
||||||
"projectname": "GeneB-miniprogram", |
"libVersion": "2.32.3", |
||||||
|
"projectname": "GeneB-miniprogram-demo", |
||||||
"setting": { |
"setting": { |
||||||
"compileHotReLoad": true, |
|
||||||
"urlCheck": true, |
"urlCheck": true, |
||||||
"coverView": true, |
"coverView": false, |
||||||
"lazyloadPlaceholderEnable": false, |
"lazyloadPlaceholderEnable": false, |
||||||
"skylineRenderEnable": false, |
"skylineRenderEnable": true, |
||||||
"preloadBackgroundData": false, |
"preloadBackgroundData": false, |
||||||
"autoAudits": false, |
"autoAudits": false, |
||||||
"useApiHook": true, |
"useApiHook": true, |
||||||
"useApiHostProcess": true, |
"useApiHostProcess": true, |
||||||
"showShadowRootInWxmlPanel": true, |
"showShadowRootInWxmlPanel": false, |
||||||
"useStaticServer": true, |
"useStaticServer": false, |
||||||
"useLanDebug": false, |
"useLanDebug": false, |
||||||
"showES6CompileOption": false, |
"showES6CompileOption": false, |
||||||
|
"compileHotReLoad": true, |
||||||
|
"bigPackageSizeSupport": false, |
||||||
"checkInvalidKey": true, |
"checkInvalidKey": true, |
||||||
"ignoreDevUnusedFiles": true, |
"ignoreDevUnusedFiles": true |
||||||
"bigPackageSizeSupport": false |
|
||||||
}, |
}, |
||||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", |
|
||||||
"condition": { |
"condition": { |
||||||
"miniprogram": { |
"miniprogram": { |
||||||
"list": [ |
"list": [ |
||||||
{ |
{ |
||||||
"name": "患者-问医生", |
"name": "pages/6/index", |
||||||
"pathName": "patient/pages/askPatient/index", |
"pathName": "pages/6/index", |
||||||
"query": "", |
"query": "", |
||||||
"scene": null, |
"scene": null, |
||||||
"launchMode": "default" |
"launchMode": "default" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"name": "知识夸详情-文章", |
|
||||||
"pathName": "pages/knowledgeDetail/index", |
|
||||||
"query": "id=15", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "知识库详情-视频", |
|
||||||
"pathName": "pages/knowledgeDetailVideo/index", |
|
||||||
"query": "id=3", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "患者-首页", |
"name": "患者-首页", |
||||||
"pathName": "patient/pages/home/index", |
"pathName": "pages/1/index", |
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "患者-录入个人信息", |
|
||||||
"pathName": "patient/pages/entryInfo/index", |
|
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "患者-登录", |
|
||||||
"pathName": "patient/pages/login/index", |
|
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "患者-协议", |
|
||||||
"pathName": "patient/pages/protocol/index", |
|
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "test", |
|
||||||
"pathName": "pages/test/index", |
|
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "我的", |
|
||||||
"pathName": "pages/my/index", |
|
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "大家都在问", |
|
||||||
"pathName": "pages/ask/index", |
|
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "知识库", |
|
||||||
"pathName": "pages/knowledge/index", |
|
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "基因疗法申请-结果页", |
|
||||||
"pathName": "pages/applyFromResult/index", |
|
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "基因疗法申请", |
|
||||||
"pathName": "pages/applyFrom/index", |
|
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "首页", |
|
||||||
"pathName": "pages/index/index", |
|
||||||
"query": "", |
|
||||||
"launchMode": "default", |
|
||||||
"scene": null |
|
||||||
}, |
|
||||||
{ |
|
||||||
"name": "登录", |
|
||||||
"pathName": "pages/login/index", |
|
||||||
"query": "", |
"query": "", |
||||||
"launchMode": "default", |
"launchMode": "default", |
||||||
"scene": null |
"scene": null |
||||||
} |
} |
||||||
] |
] |
||||||
} |
} |
||||||
}, |
} |
||||||
"libVersion": "3.5.8" |
|
||||||
} |
} |
@ -1,82 +0,0 @@ |
|||||||
interface IGlobalParams { |
|
||||||
gUrl: string |
|
||||||
version: string |
|
||||||
} |
|
||||||
|
|
||||||
export const request = function ( |
|
||||||
{ gUrl, version }: IGlobalParams, |
|
||||||
{ |
|
||||||
url, |
|
||||||
method, |
|
||||||
data, |
|
||||||
header, |
|
||||||
showMsg = true, |
|
||||||
loading = false, |
|
||||||
loadingText = '加载中...', |
|
||||||
isJSON = false, |
|
||||||
...options |
|
||||||
}: IAgaxParams, |
|
||||||
): Promise<any> { |
|
||||||
return new Promise((resolve, reject) => { |
|
||||||
if (loading) { |
|
||||||
wx.showLoading({ |
|
||||||
title: loadingText, |
|
||||||
mask: true, |
|
||||||
}) |
|
||||||
} |
|
||||||
wx.request({ |
|
||||||
header: { |
|
||||||
loginState: getApp().globalData.loginState, |
|
||||||
...header, |
|
||||||
}, |
|
||||||
url: gUrl + url, |
|
||||||
method, |
|
||||||
data: { |
|
||||||
loginState: getApp().globalData.loginState, |
|
||||||
...(data as object), |
|
||||||
}, |
|
||||||
...options, |
|
||||||
success(res: any) { |
|
||||||
const { code, data } = res.data |
|
||||||
if (isJSON) { |
|
||||||
resolve(res.data) |
|
||||||
} else if (code === 0) { |
|
||||||
resolve(data) |
|
||||||
} else if (showMsg) { |
|
||||||
const msg = errPicker(res.data) |
|
||||||
if (loading) { |
|
||||||
setTimeout(() => { |
|
||||||
wx.showToast({ |
|
||||||
title: msg, |
|
||||||
icon: 'none', |
|
||||||
}) |
|
||||||
}, 30) |
|
||||||
} else { |
|
||||||
wx.showToast({ |
|
||||||
title: msg, |
|
||||||
icon: 'none', |
|
||||||
}) |
|
||||||
reject(res) |
|
||||||
} |
|
||||||
} else { |
|
||||||
reject(res) |
|
||||||
} |
|
||||||
}, |
|
||||||
fail(err) { |
|
||||||
reject(err) |
|
||||||
}, |
|
||||||
complete() { |
|
||||||
if (loading) { |
|
||||||
wx.hideLoading() |
|
||||||
} |
|
||||||
}, |
|
||||||
}) |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
function errPicker(err) { |
|
||||||
if (typeof err === 'string') { |
|
||||||
return err |
|
||||||
} |
|
||||||
return err.data || err.msg || err.errMsg || (err.detail && err.detail.errMsg) || '未知错误' |
|
||||||
} |
|
@ -1,68 +1,60 @@ |
|||||||
{ |
{ |
||||||
"$schema": "https://dldir1.qq.com/WechatWebDev/editor-extension/wx-json/app.schema.json", |
|
||||||
"pages": [ |
"pages": [ |
||||||
"pages/start/index", |
"pages/start/index", |
||||||
"pages/login/index", |
"pages/1/index", |
||||||
"pages/index/index", |
"pages/2/index", |
||||||
"pages/my/index", |
"pages/3/index", |
||||||
"pages/applyFrom/index", |
"pages/4/index", |
||||||
"pages/applyFromResult/index", |
"pages/5/index", |
||||||
"pages/knowledge/index", |
"pages/6/index", |
||||||
"pages/knowledgeDetail/index", |
"pages/7/index", |
||||||
"pages/knowledgeDetailVideo/index", |
"pages/8/index", |
||||||
"pages/ask/index" |
"pages/9/index", |
||||||
|
"pages/10/index", |
||||||
|
"pages/11/index", |
||||||
|
"pages/12/index", |
||||||
|
"pages/13/index", |
||||||
|
"pages/14/index", |
||||||
|
"pages/15/index", |
||||||
|
"pages/16/index", |
||||||
|
"pages/17/index", |
||||||
|
"pages/18/index", |
||||||
|
"pages/19/index", |
||||||
|
"pages/20/index", |
||||||
|
"pages/21/index", |
||||||
|
"pages/22/index", |
||||||
|
"pages/23/index", |
||||||
|
"pages/24/index", |
||||||
|
"pages/25/index", |
||||||
|
"pages/26/index", |
||||||
|
"pages/27/index", |
||||||
|
"pages/28/index", |
||||||
|
"pages/29/index", |
||||||
|
"pages/30/index", |
||||||
|
"pages/31/index" |
||||||
], |
], |
||||||
"subPackages": [ |
|
||||||
{ |
|
||||||
"root": "patient", |
|
||||||
"pages": [ |
|
||||||
"pages/protocol/index", |
|
||||||
"pages/login/index", |
|
||||||
"pages/entryInfo/index", |
|
||||||
"pages/home/index", |
|
||||||
"pages/askPatient/index" |
|
||||||
] |
|
||||||
}, |
|
||||||
{ |
|
||||||
"root": "doc", |
|
||||||
"pages": ["pages/doc1/index"] |
|
||||||
} |
|
||||||
], |
|
||||||
"tabBar": { |
|
||||||
"custom": true, |
|
||||||
"list": [ |
|
||||||
{ |
|
||||||
"pagePath": "pages/index/index", |
|
||||||
"text": "首页" |
|
||||||
}, |
|
||||||
{ |
|
||||||
"pagePath": "pages/knowledge/index", |
|
||||||
"text": "知识库" |
|
||||||
}, |
|
||||||
{ |
|
||||||
"pagePath": "pages/my/index", |
|
||||||
"text": "我的" |
|
||||||
} |
|
||||||
] |
|
||||||
}, |
|
||||||
"window": { |
"window": { |
||||||
"backgroundTextStyle": "light", |
"navigationBarTextStyle": "black", |
||||||
"navigationBarBackgroundColor": "#fff", |
"navigationStyle": "custom" |
||||||
"navigationBarTitleText": "Weixin", |
|
||||||
"navigationBarTextStyle": "black" |
|
||||||
}, |
}, |
||||||
"sitemapLocation": "sitemap.json", |
|
||||||
"resolveAlias": { |
"resolveAlias": { |
||||||
"@/*": "/*" |
"@/*": "/*" |
||||||
}, |
}, |
||||||
"usingComponents": { |
"style": "v2", |
||||||
"pagination": "/components/pagination/index", |
"rendererOptions": { |
||||||
"van-icon": "@vant/weapp/icon/index" |
"skyline": { |
||||||
}, |
"defaultDisplayBlock": true, |
||||||
"requiredPrivateInfos": [], |
"defaultContentBox": true, |
||||||
"permission": { |
"tagNameStyleIsolation": "legacy", |
||||||
"scope.userFuzzyLocation": { |
"disableABTest": true, |
||||||
"desc": "获取您的当前位置,用于模糊匹配您附近的活动" |
"sdkVersionBegin": "3.0.0", |
||||||
|
"sdkVersionEnd": "15.255.255" |
||||||
} |
} |
||||||
|
}, |
||||||
|
"componentFramework": "glass-easel", |
||||||
|
"sitemapLocation": "sitemap.json", |
||||||
|
"lazyCodeLoading": "requiredComponents", |
||||||
|
"usingComponents": { |
||||||
|
"navigation-bar": "/components/navigation-bar/navigation-bar" |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,35 +1,10 @@ |
|||||||
.clearfix:after { |
/**app.wxss**/ |
||||||
content: '020'; |
.container { |
||||||
display: block; |
height: 100%; |
||||||
height: 0; |
display: flex; |
||||||
clear: both; |
flex-direction: column; |
||||||
visibility: hidden; |
align-items: center; |
||||||
} |
justify-content: space-between; |
||||||
|
padding: 200rpx 0; |
||||||
.clearfix { |
box-sizing: border-box; |
||||||
/* 触发 hasLayout */ |
} |
||||||
zoom: 1; |
|
||||||
} |
|
||||||
|
|
||||||
.scroll::-webkit-scrollbar { |
|
||||||
width: 0; |
|
||||||
height: 0; |
|
||||||
color: transparent; |
|
||||||
} |
|
||||||
|
|
||||||
.extend-via-pseudo-elem { |
|
||||||
position: relative; |
|
||||||
overflow: visible; |
|
||||||
&::before { |
|
||||||
content: ''; |
|
||||||
position: absolute; |
|
||||||
top: -20rpx; |
|
||||||
right: -20rpx; |
|
||||||
bottom: -20rpx; |
|
||||||
left: -20rpx; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
view { |
|
||||||
word-break: break-all; |
|
||||||
} |
|
||||||
|
@ -1,173 +1,11 @@ |
|||||||
/* eslint-disable */ |
|
||||||
// app.ts
|
// app.ts
|
||||||
import { request } from './api/request' |
import page from "@/utils/page"; |
||||||
import { parseScene } from './utils/util' |
|
||||||
const licia = require('miniprogram-licia') |
|
||||||
|
|
||||||
const dayjs = require('dayjs') |
|
||||||
require('/utils/dayjs/day-zh-cn.js') |
|
||||||
const relativeTime = require('/utils/dayjs/relativeTime.js') |
|
||||||
dayjs.locale('zh-cn') // 全局使用
|
|
||||||
dayjs.extend(relativeTime) |
|
||||||
|
|
||||||
// page
|
|
||||||
import page from '@/utils/page' |
|
||||||
|
|
||||||
App<IAppOption>({ |
App<IAppOption>({ |
||||||
globalData: { |
globalData: { |
||||||
// dev
|
imageUrl: "https://m.wtx.hbraas.com/demo/web/images/", |
||||||
// appid:wxa4ece062e60e93a5
|
|
||||||
// url: 'https://m.wtx.hbraas.com',
|
|
||||||
// upFileUrl: 'https://m.wtx.hbraas.com/',
|
|
||||||
// imageUrl: 'https://m.wtx.hbraas.com/GeneB/',
|
|
||||||
|
|
||||||
// pro
|
|
||||||
// appid:wx96104303877e3fd9
|
|
||||||
url: 'https://m.gene.hbsaas.com', |
|
||||||
upFileUrl: 'https://m.gene.hbsaas.com/', |
|
||||||
imageUrl: 'https://m.gene.hbsaas.com/GeneB/', |
|
||||||
Timestamp: new Date().getTime(), |
|
||||||
|
|
||||||
scene: {}, |
|
||||||
|
|
||||||
loginState: '', |
|
||||||
isLogin: 0, // 0 未登录 1 已登录
|
|
||||||
isReg: 0, |
|
||||||
userId: '', |
|
||||||
guestPrivacyAgree: false, |
|
||||||
|
|
||||||
// anyWhere: true,
|
|
||||||
anyWhere: false, |
|
||||||
|
|
||||||
userInfo: {}, |
|
||||||
}, |
}, |
||||||
onLaunch() { |
onLaunch() { |
||||||
this.autoUpdate() |
Page = page as WechatMiniprogram.Page.Constructor; |
||||||
|
|
||||||
Page = page as WechatMiniprogram.Page.Constructor |
|
||||||
|
|
||||||
wx.ajax = licia.curry(request)({ gUrl: this.globalData.url }) |
|
||||||
|
|
||||||
wx.setInnerAudioOption({ |
|
||||||
obeyMuteSwitch: false, |
|
||||||
mixWithOther: false, |
|
||||||
}) |
|
||||||
}, |
|
||||||
onShow(options) { |
|
||||||
if (options.query.scene) { |
|
||||||
this.globalData.scene = parseScene(options.query.scene) as { workerId: string } |
|
||||||
} |
|
||||||
this.startLogin() |
|
||||||
}, |
|
||||||
startLogin() { |
|
||||||
wx.login({ |
|
||||||
success: (res) => { |
|
||||||
wx.ajax({ |
|
||||||
method: 'GET', |
|
||||||
url: '?r=wtx/user/init-login', |
|
||||||
data: { |
|
||||||
code: res.code, |
|
||||||
}, |
|
||||||
}).then((res) => { |
|
||||||
this.globalData.loginState = res.loginState |
|
||||||
this.globalData.isReg = res.isReg |
|
||||||
this.globalData.isLogin = res.isLogin |
|
||||||
this.globalData.userId = res.userId |
|
||||||
this.globalData.guestPrivacyAgree = res.guestPrivacyAgree |
|
||||||
}) |
|
||||||
}, |
|
||||||
}) |
|
||||||
}, |
|
||||||
waitLogin() { |
|
||||||
let time: number |
|
||||||
return new Promise((resolve: (value?) => void) => { |
|
||||||
if (this.globalData.loginState) { |
|
||||||
resolve() |
|
||||||
return |
|
||||||
} |
|
||||||
time = setInterval(() => { |
|
||||||
if (this.globalData.loginState) { |
|
||||||
clearInterval(time) |
|
||||||
resolve() |
|
||||||
} |
|
||||||
}, 500) |
|
||||||
}) |
|
||||||
}, |
|
||||||
mpBehavior(data: { PageName: string }) { |
|
||||||
wx.ajax({ |
|
||||||
method: 'POST', |
|
||||||
url: '?r=wtx/mp-behavior/add', |
|
||||||
data: data, |
|
||||||
loading: false, |
|
||||||
showMsg: false, |
|
||||||
}).then((res) => { |
|
||||||
console.log('res: ', res) |
|
||||||
}) |
|
||||||
}, |
|
||||||
|
|
||||||
getUserInfo() { |
|
||||||
return wx.ajax({ |
|
||||||
method: 'GET', |
|
||||||
url: '?r=wtx/user/userinfo', |
|
||||||
}) |
|
||||||
}, |
|
||||||
autoUpdate: function () { |
|
||||||
var self = this |
|
||||||
// 获取小程序更新机制兼容
|
|
||||||
if (wx.canIUse('getUpdateManager')) { |
|
||||||
const updateManager = wx.getUpdateManager() |
|
||||||
//1. 检查小程序是否有新版本发布
|
|
||||||
updateManager.onCheckForUpdate(function (res) { |
|
||||||
// 请求完新版本信息的回调
|
|
||||||
if (res.hasUpdate) { |
|
||||||
//检测到新版本,需要更新,给出提示
|
|
||||||
wx.showModal({ |
|
||||||
title: '更新提示', |
|
||||||
content: '检测到新版本,是否下载新版本并重启小程序?', |
|
||||||
success: function (res) { |
|
||||||
if (res.confirm) { |
|
||||||
//2. 用户确定下载更新小程序,小程序下载及更新静默进行
|
|
||||||
self.downLoadAndUpdate(updateManager) |
|
||||||
} else if (res.cancel) { |
|
||||||
//用户点击取消按钮的处理,如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了
|
|
||||||
wx.showModal({ |
|
||||||
title: '温馨提示~', |
|
||||||
content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~', |
|
||||||
showCancel: false, //隐藏取消按钮
|
|
||||||
confirmText: '确定更新', //只保留确定更新按钮
|
|
||||||
success: function (res) { |
|
||||||
if (res.confirm) { |
|
||||||
//下载新版本,并重新应用
|
|
||||||
self.downLoadAndUpdate(updateManager) |
|
||||||
} |
|
||||||
}, |
|
||||||
}) |
|
||||||
} |
|
||||||
}, |
|
||||||
}) |
|
||||||
} |
|
||||||
}) |
|
||||||
} else { |
|
||||||
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
|
|
||||||
wx.showModal({ |
|
||||||
title: '提示', |
|
||||||
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。', |
|
||||||
}) |
|
||||||
} |
|
||||||
}, |
|
||||||
downLoadAndUpdate: function (updateManager) { |
|
||||||
//静默下载更新小程序新版本
|
|
||||||
updateManager.onUpdateReady(function () { |
|
||||||
wx.hideLoading() |
|
||||||
//新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
||||||
updateManager.applyUpdate() |
|
||||||
}) |
|
||||||
updateManager.onUpdateFailed(function () { |
|
||||||
// 新的版本下载失败
|
|
||||||
wx.showModal({ |
|
||||||
title: '新版本更新失败', |
|
||||||
content: '您可删除当前小程序,重新打开尝试', |
|
||||||
}) |
|
||||||
}) |
|
||||||
}, |
}, |
||||||
}) |
}); |
||||||
|
@ -1,6 +0,0 @@ |
|||||||
{ |
|
||||||
"component": true, |
|
||||||
"usingComponents": { |
|
||||||
"van-popup": "@vant/weapp/popup/index" |
|
||||||
} |
|
||||||
} |
|
@ -1,60 +0,0 @@ |
|||||||
.login1 { |
|
||||||
.logo { |
|
||||||
position: relative; |
|
||||||
z-index: 1; |
|
||||||
display: block; |
|
||||||
margin: 0 auto -82rpx; |
|
||||||
width: 164rpx; |
|
||||||
height: 164rpx; |
|
||||||
} |
|
||||||
.container { |
|
||||||
width: 100%; |
|
||||||
box-sizing: border-box; |
|
||||||
border-radius: 32rpx 0; |
|
||||||
padding: 136rpx 60rpx calc(env(safe-area-inset-bottom) + 64rpx); |
|
||||||
background: linear-gradient(6deg, #ffffff 0%, #ffe6e4 100%); |
|
||||||
.title { |
|
||||||
text-align: center; |
|
||||||
color: rgba(1, 1, 5, 1); |
|
||||||
font-size: 40rpx; |
|
||||||
font-weight: bold; |
|
||||||
} |
|
||||||
.content { |
|
||||||
margin-top: 16rpx; |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(1, 1, 5, 1); |
|
||||||
text-align: center; |
|
||||||
} |
|
||||||
.btn { |
|
||||||
margin-top: 64rpx; |
|
||||||
height: 88rpx; |
|
||||||
background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); |
|
||||||
border-radius: 84rpx; |
|
||||||
border: none; |
|
||||||
outline: none; |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(247, 247, 247, 1); |
|
||||||
display: flex; |
|
||||||
align-items: center; |
|
||||||
justify-content: center; |
|
||||||
&::after { |
|
||||||
border: none; |
|
||||||
} |
|
||||||
} |
|
||||||
.check { |
|
||||||
margin-top: 40rpx; |
|
||||||
display: flex; |
|
||||||
align-items: center; |
|
||||||
.checkbox { |
|
||||||
transform: scale(0.8); |
|
||||||
} |
|
||||||
.check-content { |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(1, 1, 5, 0.3); |
|
||||||
.link { |
|
||||||
color: rgba(242, 58, 47, 1); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,28 +0,0 @@ |
|||||||
const app = getApp<IAppOption>() |
|
||||||
|
|
||||||
Component({ |
|
||||||
properties: { |
|
||||||
show: { |
|
||||||
type: Boolean, |
|
||||||
value: false, |
|
||||||
}, |
|
||||||
}, |
|
||||||
data: { |
|
||||||
imageUrl: app.globalData.imageUrl, |
|
||||||
Timestamp:app.globalData.Timestamp |
|
||||||
}, |
|
||||||
methods: { |
|
||||||
handleOk() { |
|
||||||
this.setData({ |
|
||||||
show: false, |
|
||||||
}) |
|
||||||
this.triggerEvent('ok') |
|
||||||
}, |
|
||||||
handleCancel() { |
|
||||||
this.setData({ |
|
||||||
show: false, |
|
||||||
}) |
|
||||||
this.triggerEvent('cancel') |
|
||||||
}, |
|
||||||
}, |
|
||||||
}) |
|
@ -1,25 +0,0 @@ |
|||||||
<van-popup |
|
||||||
bind:click-overlay="handleCancel" |
|
||||||
round |
|
||||||
z-index="{{100000}}" |
|
||||||
show="{{ show }}" |
|
||||||
position="bottom" |
|
||||||
safe-area-inset-bottom="{{false}}" |
|
||||||
custom-style="background:transparent;" |
|
||||||
> |
|
||||||
<view class="login1"> |
|
||||||
<image class="logo" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image> |
|
||||||
<view class="container"> |
|
||||||
<view class="title">立即授权</view> |
|
||||||
<view class="content">解锁更多基因治疗知识</view> |
|
||||||
<button class="btn">手机号快速授权</button> |
|
||||||
<view class="check"> |
|
||||||
<checkbox class="checkbox" color="#ee5a4a"></checkbox> |
|
||||||
<view class="check-content"> |
|
||||||
我已阅读并同意 |
|
||||||
<text class="link">《个人信息及隐私政策》</text> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
</van-popup> |
|
@ -1,6 +0,0 @@ |
|||||||
{ |
|
||||||
"component": true, |
|
||||||
"usingComponents": { |
|
||||||
"van-nav-bar": "@vant/weapp/nav-bar/index" |
|
||||||
} |
|
||||||
} |
|
@ -1,50 +0,0 @@ |
|||||||
const app = getApp<IAppOption>() |
|
||||||
|
|
||||||
Component({ |
|
||||||
options: { |
|
||||||
multipleSlots: true, // 在组件定义时的选项中启用多slot支持
|
|
||||||
}, |
|
||||||
properties: { |
|
||||||
title: String, |
|
||||||
fixed: Boolean, |
|
||||||
placeholder: Boolean, |
|
||||||
leftText: String, |
|
||||||
rightText: String, |
|
||||||
customStyle: String, |
|
||||||
leftArrow: Boolean, |
|
||||||
border: { |
|
||||||
type: Boolean, |
|
||||||
value: false, |
|
||||||
}, |
|
||||||
zIndex: { |
|
||||||
type: Number, |
|
||||||
value: 1, |
|
||||||
}, |
|
||||||
|
|
||||||
back: { |
|
||||||
type: Boolean, |
|
||||||
value: true, |
|
||||||
}, |
|
||||||
}, |
|
||||||
|
|
||||||
/** |
|
||||||
* 组件的初始数据 |
|
||||||
*/ |
|
||||||
data: { |
|
||||||
imageUrl: app.globalData.imageUrl, |
|
||||||
Timestamp:app.globalData.Timestamp |
|
||||||
}, |
|
||||||
|
|
||||||
/** |
|
||||||
* 组件的方法列表 |
|
||||||
*/ |
|
||||||
methods: { |
|
||||||
onClickLeft() { |
|
||||||
if(this.data.back) |
|
||||||
this.triggerEvent('clickLeft', {}, {}) |
|
||||||
}, |
|
||||||
onClickRight() { |
|
||||||
this.triggerEvent('clickRight', {}, {}) |
|
||||||
}, |
|
||||||
}, |
|
||||||
}) |
|
@ -1,17 +0,0 @@ |
|||||||
<van-nav-bar |
|
||||||
title="{{title}}" |
|
||||||
fixed="{{fixed}}" |
|
||||||
placeholder="{{placeholder}}" |
|
||||||
leftText="{{leftText}}" |
|
||||||
rightText="{{rightText}}" |
|
||||||
customStyle="{{customStyle}}" |
|
||||||
leftArrow="{{leftArrow}}" |
|
||||||
border="{{border}}" |
|
||||||
zIndex="{{zIndex}}" |
|
||||||
bind:click-left="onClickLeft" |
|
||||||
bind:click-right="onClickRight" |
|
||||||
> |
|
||||||
<slot name="left" slot="left"></slot> |
|
||||||
<slot name="title" slot="title"></slot> |
|
||||||
<slot name="right" slot="right"></slot> |
|
||||||
</van-nav-bar> |
|
@ -0,0 +1,5 @@ |
|||||||
|
{ |
||||||
|
"component": true, |
||||||
|
"styleIsolation": "apply-shared", |
||||||
|
"usingComponents": {} |
||||||
|
} |
@ -0,0 +1,104 @@ |
|||||||
|
.weui-navigation-bar { |
||||||
|
--weui-FG-0: rgba(0, 0, 0, 0.9); |
||||||
|
--height: 44px; |
||||||
|
--left: 16px; |
||||||
|
} |
||||||
|
.weui-navigation-bar .android { |
||||||
|
--height: 48px; |
||||||
|
} |
||||||
|
|
||||||
|
.weui-navigation-bar { |
||||||
|
position: fixed; |
||||||
|
top: 0; |
||||||
|
left: 0; |
||||||
|
z-index: 2; |
||||||
|
overflow: hidden; |
||||||
|
color: var(--weui-FG-0); |
||||||
|
flex: none; |
||||||
|
} |
||||||
|
|
||||||
|
.weui-navigation-bar__inner { |
||||||
|
position: relative; |
||||||
|
top: 0; |
||||||
|
left: 0; |
||||||
|
height: calc(var(--height) + env(safe-area-inset-top)); |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
padding-top: env(safe-area-inset-top); |
||||||
|
width: 100%; |
||||||
|
box-sizing: border-box; |
||||||
|
} |
||||||
|
|
||||||
|
.weui-navigation-bar__left { |
||||||
|
position: relative; |
||||||
|
padding-left: var(--left); |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
align-items: flex-start; |
||||||
|
height: 100%; |
||||||
|
box-sizing: border-box; |
||||||
|
} |
||||||
|
|
||||||
|
.weui-navigation-bar__btn_goback_wrapper { |
||||||
|
padding: 11px 18px 11px 16px; |
||||||
|
margin: -11px -18px -11px -16px; |
||||||
|
} |
||||||
|
|
||||||
|
.weui-navigation-bar__btn_goback_wrapper.weui-active { |
||||||
|
opacity: 0.5; |
||||||
|
} |
||||||
|
|
||||||
|
.weui-navigation-bar__btn_goback { |
||||||
|
font-size: 12px; |
||||||
|
width: 12px; |
||||||
|
height: 24px; |
||||||
|
-webkit-mask: 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") |
||||||
|
no-repeat 50% 50%; |
||||||
|
mask: 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") |
||||||
|
no-repeat 50% 50%; |
||||||
|
-webkit-mask-size: cover; |
||||||
|
mask-size: cover; |
||||||
|
background-color: var(--weui-FG-0); |
||||||
|
} |
||||||
|
|
||||||
|
.weui-navigation-bar__center { |
||||||
|
font-size: 17px; |
||||||
|
text-align: center; |
||||||
|
position: relative; |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
font-weight: bold; |
||||||
|
flex: 1; |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
.weui-navigation-bar__loading { |
||||||
|
margin-right: 4px; |
||||||
|
align-items: center; |
||||||
|
} |
||||||
|
|
||||||
|
.weui-loading { |
||||||
|
font-size: 16px; |
||||||
|
width: 16px; |
||||||
|
height: 16px; |
||||||
|
display: block; |
||||||
|
background: transparent |
||||||
|
url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='80px' height='80px' viewBox='0 0 80 80' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient x1='94.0869141%25' y1='0%25' x2='94.0869141%25' y2='90.559082%25' id='linearGradient-1'%3E%3Cstop stop-color='%23606060' stop-opacity='0' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23606060' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.7746033,7 7,21.7746033 7,40 C7,58.2253967 21.7746033,73 40,73 L40,80 C17.90861,80 0,62.09139 0,40 C0,17.90861 17.90861,0 40,0 Z' fill='url(%23linearGradient-2)'%3E%3C/path%3E%3Ccircle id='Oval' fill='%23606060' cx='40.5' cy='3.5' r='3.5'%3E%3C/circle%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A") |
||||||
|
no-repeat; |
||||||
|
background-size: 100%; |
||||||
|
margin-left: 0; |
||||||
|
animation: loading linear infinite 1s; |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes loading { |
||||||
|
from { |
||||||
|
transform: rotate(0); |
||||||
|
} |
||||||
|
to { |
||||||
|
transform: rotate(360deg); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,105 @@ |
|||||||
|
Component({ |
||||||
|
options: { |
||||||
|
multipleSlots: true // 在组件定义时的选项中启用多slot支持
|
||||||
|
}, |
||||||
|
/** |
||||||
|
* 组件的属性列表 |
||||||
|
*/ |
||||||
|
properties: { |
||||||
|
extClass: { |
||||||
|
type: String, |
||||||
|
value: '' |
||||||
|
}, |
||||||
|
title: { |
||||||
|
type: String, |
||||||
|
value: '' |
||||||
|
}, |
||||||
|
background: { |
||||||
|
type: String, |
||||||
|
value: '' |
||||||
|
}, |
||||||
|
color: { |
||||||
|
type: String, |
||||||
|
value: '' |
||||||
|
}, |
||||||
|
back: { |
||||||
|
type: Boolean, |
||||||
|
value: true |
||||||
|
}, |
||||||
|
loading: { |
||||||
|
type: Boolean, |
||||||
|
value: false |
||||||
|
}, |
||||||
|
homeButton: { |
||||||
|
type: Boolean, |
||||||
|
value: false, |
||||||
|
}, |
||||||
|
animated: { |
||||||
|
// 显示隐藏的时候opacity动画效果
|
||||||
|
type: Boolean, |
||||||
|
value: true |
||||||
|
}, |
||||||
|
show: { |
||||||
|
// 显示隐藏导航,隐藏的时候navigation-bar的高度占位还在
|
||||||
|
type: Boolean, |
||||||
|
value: true, |
||||||
|
observer: '_showChange' |
||||||
|
}, |
||||||
|
// back为true的时候,返回的页面深度
|
||||||
|
delta: { |
||||||
|
type: Number, |
||||||
|
value: 1 |
||||||
|
}, |
||||||
|
}, |
||||||
|
/** |
||||||
|
* 组件的初始数据 |
||||||
|
*/ |
||||||
|
data: { |
||||||
|
displayStyle: '' |
||||||
|
}, |
||||||
|
lifetimes: { |
||||||
|
attached() { |
||||||
|
const rect = wx.getMenuButtonBoundingClientRect() |
||||||
|
wx.getSystemInfo({ |
||||||
|
success: (res) => { |
||||||
|
const isAndroid = res.platform === 'android' |
||||||
|
const isDevtools = res.platform === 'devtools' |
||||||
|
this.setData({ |
||||||
|
ios: !isAndroid, |
||||||
|
innerPaddingRight: `padding-right: ${res.windowWidth - rect.left}px`, |
||||||
|
leftWidth: `width: ${res.windowWidth - rect.left }px`, |
||||||
|
safeAreaTop: isDevtools || isAndroid ? `height: calc(var(--height) + ${res.safeArea.top}px); padding-top: ${res.safeArea.top}px` : `` |
||||||
|
}) |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
}, |
||||||
|
/** |
||||||
|
* 组件的方法列表 |
||||||
|
*/ |
||||||
|
methods: { |
||||||
|
_showChange(show: boolean) { |
||||||
|
const animated = this.data.animated |
||||||
|
let displayStyle = '' |
||||||
|
if (animated) { |
||||||
|
displayStyle = `opacity: ${ |
||||||
|
show ? '1' : '0' |
||||||
|
};transition:opacity 0.5s;` |
||||||
|
} else { |
||||||
|
displayStyle = `display: ${show ? '' : 'none'}` |
||||||
|
} |
||||||
|
this.setData({ |
||||||
|
displayStyle |
||||||
|
}) |
||||||
|
}, |
||||||
|
back() { |
||||||
|
const data = this.data |
||||||
|
if (data.delta) { |
||||||
|
wx.navigateBack({ |
||||||
|
delta: data.delta |
||||||
|
}) |
||||||
|
} |
||||||
|
this.triggerEvent('back', { delta: data.delta }, {}) |
||||||
|
} |
||||||
|
}, |
||||||
|
}) |
@ -0,0 +1,64 @@ |
|||||||
|
<view class="weui-navigation-bar {{extClass}}"> |
||||||
|
<view class="weui-navigation-bar__inner {{ios ? 'ios' : 'android'}}" style="color: {{color}}; background: {{background}}; {{displayStyle}}; {{innerPaddingRight}}; {{safeAreaTop}};"> |
||||||
|
|
||||||
|
<!-- 左侧按钮 --> |
||||||
|
<view class='weui-navigation-bar__left' style="{{leftWidth}};"> |
||||||
|
<block wx:if="{{back || homeButton}}"> |
||||||
|
<!-- 返回上一页 --> |
||||||
|
<block wx:if="{{back}}"> |
||||||
|
<view class="weui-navigation-bar__buttons weui-navigation-bar__buttons_goback"> |
||||||
|
<view |
||||||
|
bindtap="back" |
||||||
|
class="weui-navigation-bar__btn_goback_wrapper" |
||||||
|
hover-class="weui-active" |
||||||
|
hover-stay-time="100" |
||||||
|
aria-role="button" |
||||||
|
aria-label="返回" |
||||||
|
> |
||||||
|
<view class="weui-navigation-bar__button weui-navigation-bar__btn_goback"></view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</block> |
||||||
|
<!-- 返回首页 --> |
||||||
|
<block wx:if="{{homeButton}}"> |
||||||
|
<view class="weui-navigation-bar__buttons weui-navigation-bar__buttons_home"> |
||||||
|
<view |
||||||
|
bindtap="home" |
||||||
|
class="weui-navigation-bar__btn_home_wrapper" |
||||||
|
hover-class="weui-active" |
||||||
|
aria-role="button" |
||||||
|
aria-label="首页" |
||||||
|
> |
||||||
|
<view class="weui-navigation-bar__button weui-navigation-bar__btn_home"></view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</block> |
||||||
|
</block> |
||||||
|
<block wx:else> |
||||||
|
<slot name="left"></slot> |
||||||
|
</block> |
||||||
|
</view> |
||||||
|
|
||||||
|
<!-- 标题 --> |
||||||
|
<view class='weui-navigation-bar__center'> |
||||||
|
<view wx:if="{{loading}}" class="weui-navigation-bar__loading" aria-role="alert"> |
||||||
|
<view |
||||||
|
class="weui-loading" |
||||||
|
aria-role="img" |
||||||
|
aria-label="加载中" |
||||||
|
></view> |
||||||
|
</view> |
||||||
|
<block wx:if="{{title}}"> |
||||||
|
<text>{{title}}</text> |
||||||
|
</block> |
||||||
|
<block wx:else> |
||||||
|
<slot name="center"></slot> |
||||||
|
</block> |
||||||
|
</view> |
||||||
|
|
||||||
|
<!-- 右侧留空 --> |
||||||
|
<view class='weui-navigation-bar__right'> |
||||||
|
<slot name="right"></slot> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
@ -1,21 +0,0 @@ |
|||||||
const app = getApp(); |
|
||||||
|
|
||||||
Component({ |
|
||||||
properties: { |
|
||||||
pagination: { |
|
||||||
type: Object, |
|
||||||
value() { |
|
||||||
return {}; |
|
||||||
}, |
|
||||||
}, |
|
||||||
}, |
|
||||||
data: { |
|
||||||
imageUrl: app.globalData.imageUrl, |
|
||||||
Timestamp:app.globalData.Timestamp |
|
||||||
}, |
|
||||||
methods: { |
|
||||||
handleTouchmove() { |
|
||||||
return false; |
|
||||||
}, |
|
||||||
}, |
|
||||||
}); |
|
@ -1,6 +0,0 @@ |
|||||||
{ |
|
||||||
"component": true, |
|
||||||
"usingComponents": { |
|
||||||
"van-divider": "@vant/weapp/divider/index" |
|
||||||
} |
|
||||||
} |
|
@ -1,6 +0,0 @@ |
|||||||
/* components/pagination/index.wxss */ |
|
||||||
.none { |
|
||||||
display: block; |
|
||||||
margin: 30rpx auto; |
|
||||||
width: 80%; |
|
||||||
} |
|
@ -1,6 +0,0 @@ |
|||||||
<image class="none" src="{{imageUrl}}none.png" wx:if="{{pagination.count==0}}"></image> |
|
||||||
<van-divider contentPosition="center" wx:elif="{{pagination.page<pagination.pages}}"> |
|
||||||
<van-loading /> |
|
||||||
加载中... |
|
||||||
</van-divider> |
|
||||||
<van-divider contentPosition="center" wx:elif="{{pagination.page>=pagination.pages}}">没有更多了</van-divider> |
|
@ -1,7 +0,0 @@ |
|||||||
{ |
|
||||||
"component": true, |
|
||||||
"usingComponents": { |
|
||||||
"van-popup": "@vant/weapp/popup/index", |
|
||||||
"van-cascader": "@vant/weapp/cascader/index" |
|
||||||
} |
|
||||||
} |
|
@ -1,76 +0,0 @@ |
|||||||
const app = getApp<IAppOption>() |
|
||||||
|
|
||||||
Component({ |
|
||||||
properties: { |
|
||||||
level: { |
|
||||||
type: Number, |
|
||||||
value: 3, |
|
||||||
}, |
|
||||||
value: { |
|
||||||
type: String, |
|
||||||
value: '', |
|
||||||
}, |
|
||||||
}, |
|
||||||
|
|
||||||
data: { |
|
||||||
imageUrl: app.globalData.imageUrl, |
|
||||||
Timestamp:app.globalData.Timestamp, |
|
||||||
|
|
||||||
show: false, |
|
||||||
options: [], |
|
||||||
fieldNames: { |
|
||||||
text: 'label', |
|
||||||
value: 'value', |
|
||||||
children: 'children', |
|
||||||
}, |
|
||||||
}, |
|
||||||
lifetimes: { |
|
||||||
attached() { |
|
||||||
this.getArea() |
|
||||||
}, |
|
||||||
}, |
|
||||||
methods: { |
|
||||||
handleShow() { |
|
||||||
this.setData({ |
|
||||||
show: true, |
|
||||||
}) |
|
||||||
}, |
|
||||||
getArea() { |
|
||||||
const { level } = this.data |
|
||||||
wx.ajax({ |
|
||||||
method: 'GET', |
|
||||||
url: '/js/area.json', |
|
||||||
data: {}, |
|
||||||
isJSON: true, |
|
||||||
}).then((res) => { |
|
||||||
if (level === 1) { |
|
||||||
res.forEach((item: any) => { |
|
||||||
delete item.children |
|
||||||
}) |
|
||||||
} |
|
||||||
if (level === 2) { |
|
||||||
res.forEach((item: any) => { |
|
||||||
item.children.forEach((child: any) => { |
|
||||||
delete child.children |
|
||||||
}) |
|
||||||
}) |
|
||||||
} |
|
||||||
this.setData({ |
|
||||||
options: res, |
|
||||||
}) |
|
||||||
}) |
|
||||||
}, |
|
||||||
onFinish(e) { |
|
||||||
this.triggerEvent('change', e.detail.selectedOptions) |
|
||||||
this.setData({ |
|
||||||
show: false, |
|
||||||
}) |
|
||||||
}, |
|
||||||
onClose() { |
|
||||||
this.setData({ |
|
||||||
show: false, |
|
||||||
}) |
|
||||||
this.triggerEvent('cancel') |
|
||||||
}, |
|
||||||
}, |
|
||||||
}) |
|
@ -1,13 +0,0 @@ |
|||||||
<van-popup show="{{ show }}" round position="bottom"> |
|
||||||
<van-cascader |
|
||||||
wx:if="{{ show }}" |
|
||||||
value="{{ value }}" |
|
||||||
title="请选择所在地区" |
|
||||||
fieldNames="{{fieldNames}}" |
|
||||||
options="{{ options }}" |
|
||||||
bind:close="onClose" |
|
||||||
bind:finish="onFinish" |
|
||||||
/> |
|
||||||
</van-popup> |
|
||||||
|
|
||||||
<slot bind:tap="handleShow"></slot> |
|
@ -1,6 +0,0 @@ |
|||||||
{ |
|
||||||
"component": true, |
|
||||||
"usingComponents": { |
|
||||||
"van-popup": "@vant/weapp/popup/index" |
|
||||||
} |
|
||||||
} |
|
@ -1,257 +0,0 @@ |
|||||||
.popup1 { |
|
||||||
padding: 84rpx 60rpx; |
|
||||||
background: linear-gradient(6deg, #ffffff 0%, #ffe6e4 100%); |
|
||||||
.logo { |
|
||||||
display: block; |
|
||||||
margin: 0 auto; |
|
||||||
width: 164rpx; |
|
||||||
height: 164rpx; |
|
||||||
} |
|
||||||
.title { |
|
||||||
margin-top: 32rpx; |
|
||||||
font-size: 48rpx; |
|
||||||
color: #f23a2f; |
|
||||||
font-weight: bold; |
|
||||||
text-align: center; |
|
||||||
} |
|
||||||
.content { |
|
||||||
margin-top: 30rpx; |
|
||||||
font-size: 32rpx; |
|
||||||
color: #010105; |
|
||||||
line-height: 52rpx; |
|
||||||
} |
|
||||||
.check { |
|
||||||
margin-top: 64rpx; |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(1, 1, 5, 0.3); |
|
||||||
display: flex; |
|
||||||
.checkbox { |
|
||||||
transform: scale(0.8); |
|
||||||
} |
|
||||||
.c-content { |
|
||||||
padding-top: 5rpx; |
|
||||||
line-height: 48rpx; |
|
||||||
} |
|
||||||
} |
|
||||||
.link { |
|
||||||
color: #f23a2f; |
|
||||||
} |
|
||||||
.btn1 { |
|
||||||
margin-top: 40rpx; |
|
||||||
height: 88rpx; |
|
||||||
border-radius: 84rpx; |
|
||||||
font-size: 32rpx; |
|
||||||
color: #ffffff; |
|
||||||
text-align: center; |
|
||||||
line-height: 88rpx; |
|
||||||
background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); |
|
||||||
} |
|
||||||
.btn2 { |
|
||||||
margin-top: 20rpx; |
|
||||||
height: 88rpx; |
|
||||||
text-align: center; |
|
||||||
line-height: 88rpx; |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(1, 1, 5, 0.4); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.popup2 { |
|
||||||
padding: 36rpx 34rpx 58rpx; |
|
||||||
background-color: #fff; |
|
||||||
.photo { |
|
||||||
width: 492rpx; |
|
||||||
height: 492rpx; |
|
||||||
} |
|
||||||
.content { |
|
||||||
font-size: 40rpx; |
|
||||||
color: rgba(0, 0, 0, 1); |
|
||||||
text-align: center; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.popup3 { |
|
||||||
.icon { |
|
||||||
position: relative; |
|
||||||
z-index: 1; |
|
||||||
margin: 0 auto; |
|
||||||
display: block; |
|
||||||
width: 144rpx; |
|
||||||
height: 144rpx; |
|
||||||
} |
|
||||||
.container { |
|
||||||
margin-top: -94rpx; |
|
||||||
padding: 124rpx 32rpx 32rpx; |
|
||||||
width: 604rpx; |
|
||||||
background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); |
|
||||||
border-radius: 24rpx 24rpx 24rpx 24rpx; |
|
||||||
box-sizing: border-box; |
|
||||||
.title { |
|
||||||
display: block; |
|
||||||
margin: 0 auto; |
|
||||||
width: 146rpx; |
|
||||||
height: 40rpx; |
|
||||||
} |
|
||||||
.card { |
|
||||||
position: relative; |
|
||||||
margin-top: 32rpx; |
|
||||||
padding: 32rpx; |
|
||||||
background: #ffffff; |
|
||||||
display: flex; |
|
||||||
gap: 16rpx; |
|
||||||
justify-content: space-between; |
|
||||||
box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0, 0, 0, 0.05); |
|
||||||
border-radius: 24rpx 24rpx 24rpx 24rpx; |
|
||||||
&::after { |
|
||||||
position: absolute; |
|
||||||
bottom: -24rpx; |
|
||||||
left: 32rpx; |
|
||||||
content: ''; |
|
||||||
width: 476rpx; |
|
||||||
height: 24rpx; |
|
||||||
background: #ffebea; |
|
||||||
border-radius: 0 0 24rpx 24rpx; |
|
||||||
} |
|
||||||
.avatar { |
|
||||||
flex-shrink: 0; |
|
||||||
width: 92rpx; |
|
||||||
height: 92rpx; |
|
||||||
border-radius: 50%; |
|
||||||
} |
|
||||||
.wrap { |
|
||||||
flex: 1; |
|
||||||
.name { |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(1, 1, 5, 1); |
|
||||||
font-weight: bold; |
|
||||||
} |
|
||||||
.hostipal { |
|
||||||
margin-top: 16rpx; |
|
||||||
line-height: 28rpx; |
|
||||||
.content { |
|
||||||
margin-right: 8rpx; |
|
||||||
display: inline-block; |
|
||||||
font-size: 28rpx; |
|
||||||
color: rgba(161, 164, 172, 1); |
|
||||||
} |
|
||||||
.tag { |
|
||||||
display: inline-block; |
|
||||||
font-size: 20rpx; |
|
||||||
color: rgba(255, 255, 255, 1); |
|
||||||
padding: 0 8rpx; |
|
||||||
background-color: rgba(255, 186, 1, 1); |
|
||||||
border-radius: 6rpx; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
.btn { |
|
||||||
margin-top: 66rpx; |
|
||||||
height: 88rpx; |
|
||||||
line-height: 88rpx; |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(255, 255, 255, 1); |
|
||||||
text-align: center; |
|
||||||
background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); |
|
||||||
border-radius: 84rpx 84rpx 84rpx 84rpx; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.popup4 { |
|
||||||
.icon { |
|
||||||
position: relative; |
|
||||||
z-index: 1; |
|
||||||
margin: 0 auto; |
|
||||||
display: block; |
|
||||||
width: 144rpx; |
|
||||||
height: 144rpx; |
|
||||||
} |
|
||||||
.container { |
|
||||||
margin-top: -94rpx; |
|
||||||
padding: 124rpx 32rpx 32rpx; |
|
||||||
width: 604rpx; |
|
||||||
background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); |
|
||||||
border-radius: 24rpx 24rpx 24rpx 24rpx; |
|
||||||
box-sizing: border-box; |
|
||||||
.title { |
|
||||||
display: block; |
|
||||||
margin: 0 auto; |
|
||||||
width: 146rpx; |
|
||||||
height: 40rpx; |
|
||||||
} |
|
||||||
.content { |
|
||||||
margin-top: 16rpx; |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(161, 164, 172, 1); |
|
||||||
text-align: center; |
|
||||||
} |
|
||||||
.btn { |
|
||||||
margin-top: 32rpx; |
|
||||||
height: 88rpx; |
|
||||||
line-height: 88rpx; |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(255, 255, 255, 1); |
|
||||||
text-align: center; |
|
||||||
background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); |
|
||||||
border-radius: 84rpx 84rpx 84rpx 84rpx; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.popup5 { |
|
||||||
.container { |
|
||||||
padding: 36rpx 32rpx 32rpx; |
|
||||||
width: 604rpx; |
|
||||||
background: linear-gradient(4deg, #f7f7fa 19%, #ffe8e4 100%); |
|
||||||
border-radius: 24rpx 24rpx 24rpx 24rpx; |
|
||||||
box-sizing: border-box; |
|
||||||
.title { |
|
||||||
display: block; |
|
||||||
margin: 0 auto; |
|
||||||
width: 242rpx; |
|
||||||
height: 38rpx; |
|
||||||
} |
|
||||||
.row { |
|
||||||
margin-top: 32rpx; |
|
||||||
padding: 26rpx 32rpx; |
|
||||||
display: flex; |
|
||||||
gap: 22rpx; |
|
||||||
align-items: center; |
|
||||||
background: #ffffff; |
|
||||||
border-radius: 16rpx 16rpx 16rpx 16rpx; |
|
||||||
&:last-of-type { |
|
||||||
margin-top: 24rpx; |
|
||||||
} |
|
||||||
.avatar { |
|
||||||
flex-shrink: 0; |
|
||||||
width: 96rpx; |
|
||||||
height: 103rpx; |
|
||||||
} |
|
||||||
.wrap { |
|
||||||
flex: 1; |
|
||||||
line-height: 44rpx; |
|
||||||
.name { |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(1, 1, 5, 1); |
|
||||||
font-weight: bold; |
|
||||||
} |
|
||||||
.content { |
|
||||||
font-size: 32rpx; |
|
||||||
color: rgba(161, 164, 172, 1); |
|
||||||
} |
|
||||||
} |
|
||||||
.icon { |
|
||||||
width: 40rpx; |
|
||||||
height: 40rpx; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.close { |
|
||||||
margin: 32rpx auto 0; |
|
||||||
display: block; |
|
||||||
width: 64rpx; |
|
||||||
height: 64rpx; |
|
||||||
} |
|
@ -1,51 +0,0 @@ |
|||||||
const app = getApp<IAppOption>() |
|
||||||
|
|
||||||
Component({ |
|
||||||
properties: { |
|
||||||
show: { |
|
||||||
type: Boolean, |
|
||||||
value: false, |
|
||||||
}, |
|
||||||
type: String, |
|
||||||
params: { |
|
||||||
type: Object, |
|
||||||
value() { |
|
||||||
return {} |
|
||||||
}, |
|
||||||
}, |
|
||||||
}, |
|
||||||
|
|
||||||
data: { |
|
||||||
popup1Check1: false, |
|
||||||
|
|
||||||
imageUrl: app.globalData.imageUrl, |
|
||||||
Timestamp: app.globalData.Timestamp, |
|
||||||
}, |
|
||||||
methods: { |
|
||||||
handleOk() { |
|
||||||
const { type } = this.data |
|
||||||
if (type === 'argument' && !this.data.popup1Check1) { |
|
||||||
wx.showToast({ |
|
||||||
title: '请同意隐私政策', |
|
||||||
icon: 'none', |
|
||||||
}) |
|
||||||
return |
|
||||||
} |
|
||||||
this.triggerEvent('ok') |
|
||||||
}, |
|
||||||
handleCancel() { |
|
||||||
this.triggerEvent('cancel') |
|
||||||
}, |
|
||||||
routerTo(e: any) { |
|
||||||
const { url } = e.currentTarget.dataset |
|
||||||
wx.navigateTo({ |
|
||||||
url, |
|
||||||
}) |
|
||||||
}, |
|
||||||
handlePopup1Check1() { |
|
||||||
if (this.data.popup1Check1) { |
|
||||||
app.mpBehavior({ PageName: 'BTN_PATIENTPRIVACY' }) |
|
||||||
} |
|
||||||
}, |
|
||||||
}, |
|
||||||
}) |
|
@ -1,93 +0,0 @@ |
|||||||
<van-popup |
|
||||||
bind:click-overlay="handleCancel" |
|
||||||
round |
|
||||||
z-index="{{100000}}" |
|
||||||
show="{{ show }}" |
|
||||||
custom-style="background:transparent;" |
|
||||||
position="{{params.position || 'center'}}" |
|
||||||
safe-area-inset-bottom="{{false}}" |
|
||||||
root-portal |
|
||||||
> |
|
||||||
<view class="popup1" wx:if="{{type==='argument'}}"> |
|
||||||
<image class="logo" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image> |
|
||||||
<view class="title">欢迎加入“愈见守护”</view> |
|
||||||
<view class="content"> |
|
||||||
亲爱的用户,为了更好地向您提供平台服务保护您的权益,我们完善了 |
|
||||||
<text class="link" bind:tap="routerTo" data-url="/doc/pages/doc1/index">《个人信息及隐私政策》</text> |
|
||||||
,请您仔细阅读。一旦您开始使用,即表示您已充分理解并同意协议内容。 |
|
||||||
</view> |
|
||||||
<view class="check"> |
|
||||||
<checkbox |
|
||||||
class="checkbox" |
|
||||||
model:checked="{{popup1Check1}}" |
|
||||||
bind:tap="handlePopup1Check1" |
|
||||||
color="#f23a2f" |
|
||||||
></checkbox> |
|
||||||
<view class="c-content"> |
|
||||||
我特此同意 |
|
||||||
<text class="link" bind:tap="routerTo" data-url="/doc/pages/doc1/index">《个人信息及隐私政策》</text> |
|
||||||
规定收集我的相关敏感个人信息 |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<view class="btn1" bind:tap="handleOk">同意并继续</view> |
|
||||||
<view class="btn2" bind:tap="handleCancel">不同意</view> |
|
||||||
</view> |
|
||||||
|
|
||||||
<view class="popup2" wx:elif="{{type==='stayTuned'}}"> |
|
||||||
<image class="photo" src="{{imageUrl}}stayTuned.png?t={{Timestamp}}"></image> |
|
||||||
<view class="content"> |
|
||||||
<view>努力建设中</view> |
|
||||||
<view>敬请期待</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<view class="popup3" wx:elif="{{type==='bindDoctor'}}"> |
|
||||||
<image class="icon" src="/images/icon23.png"></image> |
|
||||||
<view class="container"> |
|
||||||
<image class="title" src="/images/title1.png"></image> |
|
||||||
<view class="card"> |
|
||||||
<image |
|
||||||
class="avatar" |
|
||||||
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567" |
|
||||||
></image> |
|
||||||
<view class="wrap"> |
|
||||||
<view class="name">王青</view> |
|
||||||
<view class="hostipal"> |
|
||||||
<view class="content">北京积水潭医院龙泽院区</view> |
|
||||||
<view class="tag">三甲</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<view class="btn">确定</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<view class="popup4" wx:elif="{{type==='bindDoctorReject'}}"> |
|
||||||
<image class="icon" src="/images/icon24.png"></image> |
|
||||||
<view class="container"> |
|
||||||
<image class="title" src="/images/title2.png"></image> |
|
||||||
<view class="content">请检查网络后重试</view> |
|
||||||
<view class="btn">重新扫码</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<view class="popup5" wx:elif="{{type==='selectIdentity'}}"> |
|
||||||
<view class="container"> |
|
||||||
<image class="title" src="/images/title3.png"></image> |
|
||||||
<view class="row"> |
|
||||||
<image class="avatar" src="/images/icon26.png"></image> |
|
||||||
<view class="wrap"> |
|
||||||
<view class="name">还未开启基因治疗</view> |
|
||||||
<view class="content">随便看看</view> |
|
||||||
</view> |
|
||||||
<image class="icon" src="/images/icon12.png"></image> |
|
||||||
</view> |
|
||||||
<view class="row"> |
|
||||||
<image class="avatar" src="/images/icon27.png"></image> |
|
||||||
<view class="wrap"> |
|
||||||
<view class="name">还未开启基因治疗</view> |
|
||||||
<view class="content">随便看看</view> |
|
||||||
</view> |
|
||||||
<image class="icon" src="/images/icon12.png"></image> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<image wx:if="{{params.position === 'cenetr'}}" class="close" src="/images/icon25.png" bind:tap="handleCancel"></image> |
|
||||||
</van-popup> |
|
@ -1,204 +0,0 @@ |
|||||||
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<Promise<any>>; |
|
||||||
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) |
|
||||||
); |
|
||||||
}, |
|
||||||
}, |
|
||||||
}); |
|
@ -1 +0,0 @@ |
|||||||
<canvas id="thumsCanvas" type="2d" width="200" height="400" style="width: 100px; height: 200px"></canvas> |
|
@ -1,7 +0,0 @@ |
|||||||
{ |
|
||||||
"component": true, |
|
||||||
"usingComponents": { |
|
||||||
"van-tabbar": "@vant/weapp/tabbar/index", |
|
||||||
"van-tabbar-item": "@vant/weapp/tabbar-item/index" |
|
||||||
} |
|
||||||
} |
|
@ -1,19 +0,0 @@ |
|||||||
/* custom-tab-bar/index.wxss */ |
|
||||||
|
|
||||||
|
|
||||||
.tab-item { |
|
||||||
.icon { |
|
||||||
width: 50rpx; |
|
||||||
height: 50rpx; |
|
||||||
} |
|
||||||
.name { |
|
||||||
font-size: 24rpx; |
|
||||||
color: #010105; |
|
||||||
&.active{ |
|
||||||
color: #F23A2F; |
|
||||||
} |
|
||||||
&.drug-active{ |
|
||||||
color: #25D9C8; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,55 +0,0 @@ |
|||||||
import { getCurrentPageUrl } from '@/utils/util' |
|
||||||
const app = getApp() |
|
||||||
|
|
||||||
Component({ |
|
||||||
properties: {}, |
|
||||||
data: { |
|
||||||
imageUrl: app.globalData.imageUrl, |
|
||||||
Timestamp: app.globalData.Timestamp, |
|
||||||
|
|
||||||
isChild: 0, |
|
||||||
active: 0, |
|
||||||
list: [ |
|
||||||
{ |
|
||||||
pagePath: '/pages/index/index', |
|
||||||
text: '首页', |
|
||||||
icon: 'tabbar1-1', |
|
||||||
iconActive: 'tabbar1-1-active', |
|
||||||
}, |
|
||||||
{ |
|
||||||
pagePath: '/pages/knowledge/index', |
|
||||||
text: '知识库', |
|
||||||
icon: 'tabbar1-2', |
|
||||||
iconActive: 'tabbar1-2-active', |
|
||||||
}, |
|
||||||
{ |
|
||||||
pagePath: '/pages/my/index', |
|
||||||
text: '我的', |
|
||||||
icon: 'tabbar1-3', |
|
||||||
iconActive: 'tabbar1-3-active', |
|
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
observers: {}, |
|
||||||
lifetimes: { |
|
||||||
ready() { |
|
||||||
const pagePath = getCurrentPageUrl() |
|
||||||
const active = this.data.list.findIndex((item) => item.pagePath === pagePath) |
|
||||||
this.setData({ |
|
||||||
active, |
|
||||||
anyWhere: app.globalData.anyWhere, |
|
||||||
}) |
|
||||||
}, |
|
||||||
}, |
|
||||||
methods: { |
|
||||||
onChange() {}, |
|
||||||
handleNav(e) { |
|
||||||
const { index } = e.currentTarget.dataset |
|
||||||
const { list } = this.data |
|
||||||
const pagePath = list[index].pagePath |
|
||||||
wx.switchTab({ |
|
||||||
url: pagePath, |
|
||||||
}) |
|
||||||
}, |
|
||||||
}, |
|
||||||
}) |
|
@ -1,14 +0,0 @@ |
|||||||
<van-tabbar active="{{ active }}" active-color="#F23A2F" bind:change="onChange" inactive-color="#010105"> |
|
||||||
<block wx:for="{{list}}" wx:key="*this"> |
|
||||||
<van-tabbar-item |
|
||||||
class="tab-item" |
|
||||||
wx:if="{{ index != 3 || !anyWhere}}" |
|
||||||
bind:tap="handleNav" |
|
||||||
data-index="{{index}}" |
|
||||||
icon="{{imageUrl}}/tabbar/{{active==index ? item.iconActive : item.icon}}.png?r={{Timestamp}}" |
|
||||||
> |
|
||||||
<view class="name {{index==active && 'active'}}">{{item.text}}</view> |
|
||||||
<view class="hot"></view> |
|
||||||
</van-tabbar-item> |
|
||||||
</block> |
|
||||||
</van-tabbar> |
|
@ -1,6 +0,0 @@ |
|||||||
{ |
|
||||||
"navigationBarTitleText": "个人信息及隐私政策", |
|
||||||
"usingComponents": { |
|
||||||
"mp-html": "mp-html" |
|
||||||
} |
|
||||||
} |
|
@ -1,3 +0,0 @@ |
|||||||
<view class="page"> |
|
||||||
<mp-html content="{{doc}}"></mp-html> |
|
||||||
</view> |
|
After Width: | Height: | Size: 6.3 MiB |
After Width: | Height: | Size: 720 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 194 KiB |
After Width: | Height: | Size: 167 KiB |
After Width: | Height: | Size: 365 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 823 KiB |
After Width: | Height: | Size: 328 KiB |
After Width: | Height: | Size: 516 KiB |
After Width: | Height: | Size: 277 KiB |
After Width: | Height: | Size: 646 KiB |
After Width: | Height: | Size: 473 KiB |
After Width: | Height: | Size: 128 KiB |
After Width: | Height: | Size: 118 KiB |
After Width: | Height: | Size: 122 KiB |
After Width: | Height: | Size: 121 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 128 KiB |
After Width: | Height: | Size: 402 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 101 KiB |
After Width: | Height: | Size: 121 KiB |
After Width: | Height: | Size: 128 KiB |
After Width: | Height: | Size: 122 KiB |
After Width: | Height: | Size: 156 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 178 KiB |
After Width: | Height: | Size: 133 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 438 KiB |
After Width: | Height: | Size: 131 KiB |
After Width: | Height: | Size: 135 KiB |
After Width: | Height: | Size: 134 KiB |
After Width: | Height: | Size: 350 KiB |
After Width: | Height: | Size: 443 KiB |
After Width: | Height: | Size: 154 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 427 KiB |
After Width: | Height: | Size: 348 KiB |
After Width: | Height: | Size: 260 KiB |
After Width: | Height: | Size: 408 KiB |
After Width: | Height: | Size: 411 KiB |
After Width: | Height: | Size: 317 KiB |
After Width: | Height: | Size: 238 KiB |
After Width: | Height: | Size: 213 KiB |
After Width: | Height: | Size: 246 KiB |