项目搭建
|
@ -0,0 +1,23 @@
|
|||
.DS_Store
|
||||
node_modules/
|
||||
unpackage/
|
||||
dist/
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.project
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
|
@ -0,0 +1,16 @@
|
|||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
import {
|
||||
toast
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
baseUrl: 'https://syjk.yhy.ren/xcx-test/', // 生产
|
||||
|
||||
post(url, param) {
|
||||
return this.ajax('post', url, param)
|
||||
},
|
||||
get(url, param) {
|
||||
return this.ajax('get', url, param)
|
||||
},
|
||||
put(url, param) {
|
||||
return this.ajax('put', url, param)
|
||||
},
|
||||
getUrl(url) {
|
||||
return `${this.baseUrl}${url}`
|
||||
},
|
||||
setHeader(url) {
|
||||
let header = {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'clientType': 'h5'
|
||||
}
|
||||
if (url.indexOf('application') != -1) header['content-type'] = 'application/json'
|
||||
|
||||
return header
|
||||
},
|
||||
setParams(param) {
|
||||
const openId = uni.getStorageSync('openId') || ''
|
||||
const userId = param.userId || uni.getStorageSync('userId') || ''
|
||||
param['openId'] = openId
|
||||
param['token'] = openId
|
||||
param['userId'] = userId
|
||||
return param
|
||||
},
|
||||
setUrlParams(isUrlParam, param, url) {
|
||||
if (!isUrlParam) return ''
|
||||
let str = []
|
||||
for (let i in param) {
|
||||
str.push(i + '=' + param[i])
|
||||
}
|
||||
return `${(url.indexOf('?')!=-1?'&':'?')}${str.join('&')}`
|
||||
|
||||
},
|
||||
ajax(type, url, param = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let requestData = this.setParams(param.data || {})
|
||||
let urlObj = this.setUrlParams(param.isUrlParam, requestData, url)
|
||||
let request = {
|
||||
url: `${this.baseUrl}${url}${urlObj}`,
|
||||
method: type,
|
||||
header: this.setHeader(url),
|
||||
sslVerify: false,
|
||||
dataType: 'json',
|
||||
timeout: 300000,
|
||||
data: requestData,
|
||||
success: (response) => {
|
||||
if (response.data.code == 500) {
|
||||
return toast(response.data.msg)
|
||||
}
|
||||
let is = typeof response === 'object'
|
||||
let data = response.data
|
||||
resolve(is ? data : response)
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err)
|
||||
},
|
||||
}
|
||||
uni.request(request)
|
||||
})
|
||||
|
||||
},
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
import ajax from './config'
|
||||
export default { // 所有接口
|
||||
// 心理评估接口
|
||||
list: (param) => ajax.post('psychology/dict/list', param), // 获取心理主页数据
|
||||
introduInfo: (param) => ajax.post('psychology/paperwork/introduInfo', param), // 心理评估文案表
|
||||
subjectList: (param) => ajax.post('psychology/subject/subjectList', param), // 心里评估题目
|
||||
tempSave: (param) => ajax.post('psychology/paperUserSave/tempSave?application=true', param), // 评估答题暂存
|
||||
pagerUserByCode: (param) => ajax.post('psychology/paperUserSave/pagerUserByCode', param), //根据评估类型查询评估答题试卷
|
||||
savePaper: (param) => ajax.post('psychology/paperUserSave/savePaper?application=true', param), //评估答题保存
|
||||
anewQuery: (param) => ajax.post('psychology/paperUserSave/anewQuery', param), //重新填写
|
||||
queryResult: (param) => ajax.post('psychology/result/queryResult', param), //心理评估结果查看
|
||||
queryDimensionFactors: (param) => ajax.post('psychology/factor/queryDimensionFactors', param), //查询雷达因子
|
||||
queryResultByCode: (param) => ajax.post('psychology/scale/queryResultByCode', param), //心理评估结果等级
|
||||
assessmentReport: (param) => ajax.get('psychology/dict/assessmentReport', param), //心理评估报告
|
||||
assessmentResult: (param) => ajax.get('psychology/dict/assessmentResult', param), //心理评估详情
|
||||
typeList: (param) => ajax.get('diggmindUser/typeList', param), //查询格米分类
|
||||
diggmindUserList: (param) => ajax.post('diggmindUser/list?application=true', param), //根据分类查询列表
|
||||
details: (param) => ajax.get('diggmindUser/details', param), //评估详情
|
||||
startAssessment: (param) => ajax.get('diggmindUser/startAssessment', param), //问卷地址
|
||||
reportAddress: (param) => ajax.get('diggmindUser/reportAddress', param), //报告地址
|
||||
getDiseaseResult: (param) => ajax.get('disease-assess-subject/getDiseaseResult', param), //基础评估结果
|
||||
// 风险评估接口
|
||||
selectDictList: (param) => ajax.get('disease-assess-dict/selectDictList', param), //查询疾病字典
|
||||
getUserExtInfo: (param) => ajax.get('sysUser/userExt/getUserExtInfo', param), // 获取用户扩展信息
|
||||
saveUserExtInfo: (param) => ajax.post('sysUser/userExt/saveUserExtInfo?application=true', param), //修改用户扩展信息
|
||||
selectBasisAssessInfo: (param) => ajax.get('disease-assess-subject/selectBasisAssessInfo', param), //查询题目生成疾病试卷
|
||||
selectPaperList: (param) => ajax.get('disease-assess-subject/selectPaperList', param), //试卷查询
|
||||
basisAssessSaveJson: (param) => ajax.post('disease-assess-subject/basisAssessSaveJson', param), //保存试卷 暂存试卷
|
||||
getDiseaseResult: (param) => ajax.get('disease-assess-subject/getDiseaseResult', param), //评估结果
|
||||
generatePaper: (param) => ajax.get('disease-assess-subject/generatePaper', param), //试卷查询,重新生成试卷
|
||||
getAssessReport: (param) => ajax.get('disease-assess-subject/getAssessReport', param), //评估报告
|
||||
getDiseaseContent: (param) => ajax.get('disease-assess-subject/getDiseaseContent', param), //评估报告内容
|
||||
saveDictList: (param) => ajax.get('disease-paper-save/selectDictList', param), //风险评估报告
|
||||
getUserAssessReport: (param) => ajax.get('disease-paper-save/getUserAssessReport', param), //评估报告查询
|
||||
getFamilyMemberByMemberId: (param) => ajax.get('member/familyMember/getFamilyMemberByMemberId', param), //评估报告查询
|
||||
selectHealthyGuide: (param) => ajax.get('disease-assess-subject/selectHealthyGuide', param), //评估报告
|
||||
selectTaskIntegral: (param) => ajax.get('integral/userIntegralFlow/selectTaskIntegral', param), //查询本次评估预计生成的积分
|
||||
selectFoodsSubjectList: (param) => ajax.get(`disease-plan/selectFoodsSubjectList`, param), // 生成饮食试卷
|
||||
beingGenerated: (param) => ajax.get('dis-day-task/beingGenerated', param),
|
||||
openDayTaskDetail: (param) => ajax.post(`dis-day-task/openDayTaskDetail`, param), // 开启计划
|
||||
selectQuestAll: (param) => ajax.get('psychological/psychological-plan-question/selectQuestAll',
|
||||
param), //获取加入计划的所有问卷题目
|
||||
queryEmotionQuest: (param) => ajax.get('psychological/psychological-plan-question/queryEmotionQuest',
|
||||
param), //查询情绪问卷
|
||||
queryStressManagement: (param) => ajax.get('psychological/psychological-plan-question/queryStressManagement',
|
||||
param), //查询减压问卷
|
||||
selectQuestById: (param) => ajax.get('psychological/psychological-plan-question/selectQuestById',
|
||||
param), //获取每日任务单独问卷题目
|
||||
insertQuestResult: (param) => ajax.post(
|
||||
'psychological/psychological-plan-question/insertQuestResult?application=true', param), //保存问卷
|
||||
getPsychologicalResult: (param) => ajax.get('psychological/psychological-plan-question/getPsychologicalResult',
|
||||
param), //用户心理加入计划评估综合报告
|
||||
getBeliefResult: (param) => ajax.get('psychological/psychological-plan-question/getBeliefResult',
|
||||
param), //用户心理睡眠个人信念和态度量结果
|
||||
getInsomniaResult: (param) => ajax.get('psychological/psychological-plan-question/getInsomniaResult',
|
||||
param), //查询用户心理失眠程度结果
|
||||
getPsychologyInfo: (param) => ajax.get('psychological/psychological-plan-question/getPsychologyInfo',
|
||||
param), // 查询焦虑情绪评估结果或焦虑自评结果 15,16,32问卷类型
|
||||
getEmotionalInfo: (param) => ajax.get('psychological/psychological-plan-question/getEmotionalInfo',
|
||||
param), // 查询情绪智力量表结果
|
||||
// 14天减压
|
||||
getSimpleResponse: (param) => ajax.get('psychological/psychological-plan-question/getSimpleResponse',
|
||||
param), // 查询简易应答量表结果
|
||||
getResultEmotion: (param) => ajax.get('api/psychological/task/getResultEmotion', param),
|
||||
getEmotionManagement: (param) => ajax.get('psychological/psychological-plan-question/getEmotionManagement',
|
||||
param), // 评估结果页面查询
|
||||
getStressManagement: (param) => ajax.get('psychological/psychological-plan-question/getStressManagement',
|
||||
param), // 评估结果页面查询
|
||||
getAssessInfo: (param) => ajax.get('disease-assess-subject/getAssessInfo', param), // 查询评估信息
|
||||
getUserAnalysisReport: (param) => ajax.get('ExaminingReport/getUserAnalysisReport', param), // 查看体检报告集合
|
||||
queryQuestionAll: (param) => ajax.get('/api/questionnaire/queryQuestionAll', param), // 获取问卷列表
|
||||
questSelectQuestById: (param) => ajax.get('/api/questionnaire/selectQuestById', param), // 获取问卷题目
|
||||
saveAnswer: (param) => ajax.post('/api/questionnaire/saveAnswer?application=true', param), // 保存问卷
|
||||
appLogin: (param) => ajax.get('userLogin/login/appLogin', param), // App手机号登陆
|
||||
hasLifestyleAssessment: (param) => ajax.get('dis-day-task/hasLifestyleAssessment', param), //查询生活方式评估状态
|
||||
sendTheVerificationCodeApp: (param) => ajax.get('sysUser/sendTheVerificationCodeApp', param), // 发送手机号验证码
|
||||
selectFoodsInfo: (param) => ajax.get(`doodsInfo/selectFoodsInfo`, param), // 查询食材详情
|
||||
selectDictListByFoodList: (param) => ajax.get('disease-assess-dict/selectDictListByFoodList', param), //查询疾病字典
|
||||
getDiseaseFoodsLevel: (param) => ajax.get(`healthTools/getDiseaseFoodsLevel`, param), //食物榜单
|
||||
getFoodTypes: (param) => ajax.get('healthTools/getFoodTypes', param),
|
||||
selectFoodsList: (param) => ajax.get(`healthTools/selectFoodsList`, param), //食物成分
|
||||
queryEeFoodType: (param) => ajax.get(`zksr.zksrservice.eefood/yh-ee-food-type/queryEeFoodType`, param), //查询ee屏食物类型
|
||||
queryEeFoodInfo: (param) => ajax.get(`zksr.zksrservice.eefood/yh-ee-food-info/queryEeFoodInfo`, param), //查询食物信息
|
||||
queryEeFoodInfoDetails: (param) => ajax.get(`zksr.zksrservice.eefood/yh-ee-food-info/queryEeFoodInfoDetails`, param), //查询食物信息详情
|
||||
|
||||
setSaveActivity: (param) => ajax.post('zksr.zksrservice.autonomous/autonomous-plan-activity/saveActivity?application=true', param), // 保存问卷
|
||||
uploadImg: () => ajax.getUrl('qiniu/uploadImg'), //上传图片
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
import ajax from './config'
|
||||
export default {
|
||||
// 查询事项列表
|
||||
queryUserMattersTypes: (param) => ajax.get(
|
||||
'zksr.zksrservice.autonomous/autonomous-plan-matters-type/queryUserMattersTypes', param),
|
||||
// 查询事项列表
|
||||
queryMatters: (param) => ajax.get('zksr.zksrservice.autonomous/autonomous-plan-matters/queryMatters', param),
|
||||
// 查询热门事项
|
||||
queryMattersHot: (param) => ajax.get('zksr.zksrservice.autonomous/autonomous-plan-matters/queryMattersHot', param),
|
||||
// 保存事项
|
||||
saveMatters: (param) => ajax.post(
|
||||
'zksr.zksrservice.autonomous/autonomous-plan-matters/saveMatters?application=true', param),
|
||||
//保存自主计划
|
||||
saveFollowing: (param) => ajax.post(
|
||||
'zksr.zksrservice.autonomous/autonomous-plan-user-following/saveFollowing?application=true', param),
|
||||
// 保存自主计划用户日记
|
||||
saveDiaryList: (param) => ajax.post(
|
||||
'zksr.zksrservice.autonomous/autonomous-plan-diary/saveDiaryList?application=true', param),
|
||||
// 分页查询自主计划用户日记
|
||||
queryDiaryList: (param) => ajax.get('zksr.zksrservice.autonomous/autonomous-plan-diary/queryDiaryList', param),
|
||||
// 删除自主计划用户日记
|
||||
delDiary: (param) => ajax.post('zksr.zksrservice.autonomous/autonomous-plan-diary/delDiary', param),
|
||||
// 查询事项列表
|
||||
queryMattersName: (param) => ajax.get('zksr.zksrservice.autonomous/autonomous-plan-user-following/queryMattersName',
|
||||
param),
|
||||
//保存意外事件
|
||||
savePlanAccident: (param) => ajax.post(
|
||||
'zksr.zksrservice.autonomous/autonomous-plan-accident/savePlanAccident?application=true', param),
|
||||
// 时间选择
|
||||
timeListNew: (param) => ajax.get('dataDetection/dataDetectionType/timeListNew', param),
|
||||
// 查询周统计
|
||||
queryWeekSummary: (param) => ajax.get('zksr.zksrservice.autonomous/autonomous-plan-user-following/queryWeekSummary',
|
||||
param),
|
||||
// 查询用户计划
|
||||
queryFollowing: (param) => ajax.get('zksr.zksrservice.autonomous/autonomous-plan-user-following/queryFollowing',
|
||||
param),
|
||||
// 修改自主计划
|
||||
updAutonomousPlanTask: (param) => ajax.post(
|
||||
'zksr.zksrservice.autonomous/autonomous-plan-user-following/updAutonomousPlanTask?application=true', param),
|
||||
// 操作任务状态
|
||||
operationalTaskStatus: (param) => ajax.post(
|
||||
'zksr.zksrservice.autonomous/autonomous-plan-user-following/operationalTaskStatus', param),
|
||||
// 删除自主计划
|
||||
delAutonomousPlanTask: (param) => ajax.post(
|
||||
'zksr.zksrservice.autonomous/autonomous-plan-user-following/delAutonomousPlanTask', param),
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
import ajax from './config'
|
||||
export default {
|
||||
// 戒烟首页
|
||||
userSmokingHome: (param) => ajax.get('userSmoking/home', param),
|
||||
//烟瘾来袭
|
||||
smokingCravingAdd: (param) => ajax.post('smokingCraving/add', param),
|
||||
//重置戒烟
|
||||
userSmokingReset: (param) => ajax.post('userSmoking/reset', param),
|
||||
//开始戒烟
|
||||
userSmokingAdd: (param) => ajax.post('userSmoking/add', param),
|
||||
//本人日记列表
|
||||
smokingDiaryList: (param) => ajax.get('smokingDiary/list', param),
|
||||
//日记保存
|
||||
smokingDiaryAdd: (param) => ajax.post('smokingDiary/add', param),
|
||||
// 删除自主计划用户日记
|
||||
smokingDiaryDelete: (param) => ajax.post('smokingDiary/delete', param),
|
||||
//时光穿梭
|
||||
timeTravel: (param) => ajax.get('userSmoking/timeTravel', param),
|
||||
//健康恢复评分
|
||||
healthRecoveryScore: (param) => ajax.get('userSmoking/healthRecoveryScore', param),
|
||||
//尼古丁成瘾评估问卷
|
||||
questionSmokingList: (param) => ajax.get('questionSmoking/list', param),
|
||||
//尼古丁评估提交
|
||||
smokingReportAdd: (param) => ajax.post('smokingReport/add', param),
|
||||
//根据id获得尼古丁评估记录
|
||||
getById: (param) => ajax.get('smokingReport/getById', param),
|
||||
//尼古丁评估列表
|
||||
smokingReportList: (param) => ajax.get('smokingReport/list', param),
|
||||
//烟瘾统计图
|
||||
cartogram: (param) => ajax.get('smokingCraving/cartogram', param),
|
||||
//烟瘾统计图
|
||||
cheatsList: (param) => ajax.get('userSmoking/cheatsList', param),
|
||||
//新增学习记录
|
||||
smokingSecretAdd: (param) => ajax.post('smokingSecret/add', param),
|
||||
//我的戒烟数据
|
||||
smokingCessationData: (param) => ajax.get('userSmoking/smokingCessationData', param),
|
||||
//判断用户是否第一次进入某个页面
|
||||
getUserFirstInto: (param) => ajax.get('sysUser/getUserFirstInto', param),
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
const webpack = require('webpack')
|
||||
const plugins = []
|
||||
|
||||
if (process.env.UNI_OPT_TREESHAKINGNG) {
|
||||
plugins.push(require('@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js'))
|
||||
}
|
||||
|
||||
if (
|
||||
(
|
||||
process.env.UNI_PLATFORM === 'app-plus' &&
|
||||
process.env.UNI_USING_V8
|
||||
) ||
|
||||
(
|
||||
process.env.UNI_PLATFORM === 'h5' &&
|
||||
process.env.UNI_H5_BROWSER === 'builtin'
|
||||
)
|
||||
) {
|
||||
const path = require('path')
|
||||
|
||||
const isWin = /^win/.test(process.platform)
|
||||
|
||||
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
|
||||
|
||||
const input = normalizePath(process.env.UNI_INPUT_DIR)
|
||||
try {
|
||||
plugins.push([
|
||||
require('@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console'),
|
||||
{
|
||||
file (file) {
|
||||
file = normalizePath(file)
|
||||
if (file.indexOf(input) === 0) {
|
||||
return path.relative(input, file)
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
])
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']
|
||||
process.UNI_LIBRARIES.forEach(libraryName => {
|
||||
plugins.push([
|
||||
'import',
|
||||
{
|
||||
'libraryName': libraryName,
|
||||
'customName': (name) => {
|
||||
return `${libraryName}/lib/${name}/${name}`
|
||||
}
|
||||
}
|
||||
])
|
||||
})
|
||||
|
||||
if (process.env.UNI_PLATFORM !== 'h5') {
|
||||
plugins.push('@babel/plugin-transform-runtime')
|
||||
}
|
||||
|
||||
const config = {
|
||||
presets: [
|
||||
[
|
||||
'@vue/app',
|
||||
{
|
||||
modules: webpack.version[0] > 4 ? 'auto' : 'commonjs',
|
||||
useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry'
|
||||
}
|
||||
]
|
||||
],
|
||||
plugins
|
||||
}
|
||||
|
||||
const UNI_H5_TEST = '**/@dcloudio/uni-h5/dist/index.umd.min.js'
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
config.overrides = [{
|
||||
test: UNI_H5_TEST,
|
||||
compact: true,
|
||||
}]
|
||||
} else {
|
||||
config.ignore = [UNI_H5_TEST]
|
||||
}
|
||||
|
||||
module.exports = config
|
|
@ -0,0 +1,203 @@
|
|||
{
|
||||
root: 'D:\\songtao\\risk-assessment',
|
||||
registry: 'https://registry.npmmirror.com',
|
||||
pkgs: [
|
||||
{
|
||||
name: 'node-sass',
|
||||
version: 'latest',
|
||||
type: 'tag',
|
||||
alias: undefined,
|
||||
arg: [Result]
|
||||
}
|
||||
],
|
||||
production: false,
|
||||
cacheStrict: false,
|
||||
cacheDir: 'C:\\Users\\SY\\.npminstall_tarball',
|
||||
env: {
|
||||
npm_config_registry: 'https://registry.npmmirror.com',
|
||||
npm_config_argv: '{"remain":[],"cooked":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\SY\\\\.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com","node-sass","--save"],"original":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\SY\\\\.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com","node-sass","--save"]}',
|
||||
npm_config_user_agent: 'npminstall/7.11.1 npm/? node/v14.18.1 win32 x64',
|
||||
npm_config_cache: 'C:\\Users\\SY\\.npminstall_tarball',
|
||||
NODE: 'D:\\nodejs\\node.exe',
|
||||
npm_node_execpath: 'D:\\nodejs\\node.exe',
|
||||
npm_execpath: 'D:\\node\\nodejs\\node_global\\node_modules\\cnpm\\node_modules\\npminstall\\bin\\install.js',
|
||||
npm_config_userconfig: 'C:\\Users\\SY\\.cnpmrc',
|
||||
npm_config_disturl: 'https://cdn.npmmirror.com/binaries/node',
|
||||
npm_config_r: 'https://registry.npmmirror.com',
|
||||
COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
|
||||
NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
||||
NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
||||
PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
|
||||
CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
|
||||
OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
|
||||
CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
|
||||
ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
|
||||
ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
|
||||
SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
|
||||
SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
|
||||
NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
|
||||
PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
||||
PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
||||
PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
|
||||
SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
|
||||
SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
|
||||
RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
|
||||
RE2_DOWNLOAD_SKIP_PATH: 'true',
|
||||
PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
|
||||
npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
|
||||
npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
|
||||
npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
|
||||
npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
|
||||
npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs',
|
||||
npm_rootpath: 'D:\\songtao\\risk-assessment',
|
||||
INIT_CWD: 'D:\\songtao\\risk-assessment'
|
||||
},
|
||||
binaryMirrors: {
|
||||
ENVS: {
|
||||
COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
|
||||
NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
||||
NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
||||
PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
|
||||
CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
|
||||
OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
|
||||
CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
|
||||
ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
|
||||
ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
|
||||
SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
|
||||
SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
|
||||
NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
|
||||
PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
||||
PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
||||
PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
|
||||
SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
|
||||
SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
|
||||
RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
|
||||
RE2_DOWNLOAD_SKIP_PATH: 'true',
|
||||
PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
|
||||
npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
|
||||
npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
|
||||
npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
|
||||
npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
|
||||
npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs'
|
||||
},
|
||||
'@ali/s2': { host: 'https://cdn.npmmirror.com/binaries/looksgood-s2' },
|
||||
sharp: { replaceHostFiles: [Array], replaceHostMap: [Object] },
|
||||
'@tensorflow/tfjs-node': {
|
||||
replaceHostFiles: [Array],
|
||||
replaceHostRegExpMap: [Object],
|
||||
replaceHostMap: [Object]
|
||||
},
|
||||
cypress: {
|
||||
host: 'https://cdn.npmmirror.com/binaries/cypress',
|
||||
newPlatforms: [Object]
|
||||
},
|
||||
'utf-8-validate': {
|
||||
host: 'https://cdn.npmmirror.com/binaries/utf-8-validate/v{version}'
|
||||
},
|
||||
xprofiler: {
|
||||
remote_path: './xprofiler/v{version}/',
|
||||
host: 'https://cdn.npmmirror.com/binaries'
|
||||
},
|
||||
leveldown: { host: 'https://cdn.npmmirror.com/binaries/leveldown/v{version}' },
|
||||
couchbase: { host: 'https://cdn.npmmirror.com/binaries/couchbase/v{version}' },
|
||||
gl: { host: 'https://cdn.npmmirror.com/binaries/gl/v{version}' },
|
||||
sqlite3: {
|
||||
host: 'https://cdn.npmmirror.com/binaries/sqlite3',
|
||||
remote_path: 'v{version}'
|
||||
},
|
||||
'@journeyapps/sqlcipher': { host: 'https://cdn.npmmirror.com/binaries' },
|
||||
grpc: {
|
||||
host: 'https://cdn.npmmirror.com/binaries',
|
||||
remote_path: '{name}/v{version}'
|
||||
},
|
||||
'grpc-tools': { host: 'https://cdn.npmmirror.com/binaries' },
|
||||
wrtc: {
|
||||
host: 'https://cdn.npmmirror.com/binaries',
|
||||
remote_path: '{name}/v{version}'
|
||||
},
|
||||
fsevents: { host: 'https://cdn.npmmirror.com/binaries/fsevents' },
|
||||
nodejieba: { host: 'https://cdn.npmmirror.com/binaries/nodejieba' },
|
||||
canvas: { host: 'https://cdn.npmmirror.com/binaries/canvas' },
|
||||
'skia-canvas': { host: 'https://cdn.npmmirror.com/binaries/skia-canvas' },
|
||||
'flow-bin': {
|
||||
replaceHost: 'https://github.com/facebook/flow/releases/download/v',
|
||||
host: 'https://cdn.npmmirror.com/binaries/flow/v'
|
||||
},
|
||||
'jpegtran-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/jpegtran-bin'
|
||||
},
|
||||
'cwebp-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/cwebp-bin'
|
||||
},
|
||||
'zopflipng-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/zopflipng-bin'
|
||||
},
|
||||
'optipng-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/optipng-bin'
|
||||
},
|
||||
mozjpeg: {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/mozjpeg-bin'
|
||||
},
|
||||
gifsicle: {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/gifsicle-bin'
|
||||
},
|
||||
'pngquant-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/pngquant-bin',
|
||||
replaceHostMap: [Object]
|
||||
},
|
||||
'pngcrush-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/pngcrush-bin'
|
||||
},
|
||||
'jpeg-recompress-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/jpeg-recompress-bin'
|
||||
},
|
||||
'advpng-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/advpng-bin'
|
||||
},
|
||||
'pngout-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/pngout-bin'
|
||||
},
|
||||
'jpegoptim-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/jpegoptim-bin'
|
||||
},
|
||||
argon2: { host: 'https://cdn.npmmirror.com/binaries/argon2' },
|
||||
'ali-zeromq': { host: 'https://cdn.npmmirror.com/binaries/ali-zeromq' },
|
||||
'ali-usb_ctl': { host: 'https://cdn.npmmirror.com/binaries/ali-usb_ctl' },
|
||||
'gdal-async': { host: 'https://cdn.npmmirror.com/binaries/node-gdal-async' },
|
||||
'libpg-query': { host: 'https://cdn.npmmirror.com/binaries' }
|
||||
},
|
||||
forbiddenLicenses: null,
|
||||
flatten: false,
|
||||
proxy: undefined,
|
||||
prune: false,
|
||||
disableFallbackStore: false,
|
||||
workspacesMap: Map(0) {},
|
||||
enableWorkspace: false,
|
||||
workspaceRoot: 'D:\\songtao\\risk-assessment',
|
||||
isWorkspaceRoot: true,
|
||||
isWorkspacePackage: false,
|
||||
offline: false,
|
||||
strictSSL: true,
|
||||
ignoreScripts: false,
|
||||
foregroundScripts: false,
|
||||
ignoreOptionalDependencies: false,
|
||||
detail: false,
|
||||
forceLinkLatest: false,
|
||||
trace: false,
|
||||
engineStrict: false,
|
||||
registryOnly: false,
|
||||
client: false,
|
||||
autoFixVersion: [Function: autoFixVersion]
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
{
|
||||
"name": "risk-assessment",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "npm run dev:h5",
|
||||
"build": "npm run build:h5",
|
||||
"build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
|
||||
"build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
|
||||
"build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",
|
||||
"build:mp-360": "cross-env NODE_ENV=production UNI_PLATFORM=mp-360 vue-cli-service uni-build",
|
||||
"build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build",
|
||||
"build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build",
|
||||
"build:mp-jd": "cross-env NODE_ENV=production UNI_PLATFORM=mp-jd vue-cli-service uni-build",
|
||||
"build:mp-kuaishou": "cross-env NODE_ENV=production UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build",
|
||||
"build:mp-lark": "cross-env NODE_ENV=production UNI_PLATFORM=mp-lark vue-cli-service uni-build",
|
||||
"build:mp-qq": "cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build",
|
||||
"build:mp-toutiao": "cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build",
|
||||
"build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build",
|
||||
"build:mp-xhs": "cross-env NODE_ENV=production UNI_PLATFORM=mp-xhs vue-cli-service uni-build",
|
||||
"build:quickapp-native": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-native vue-cli-service uni-build",
|
||||
"build:quickapp-webview": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview vue-cli-service uni-build",
|
||||
"build:quickapp-webview-huawei": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build",
|
||||
"build:quickapp-webview-union": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build",
|
||||
"dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",
|
||||
"dev:custom": "cross-env NODE_ENV=development uniapp-cli custom",
|
||||
"dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",
|
||||
"dev:mp-360": "cross-env NODE_ENV=development UNI_PLATFORM=mp-360 vue-cli-service uni-build --watch",
|
||||
"dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch",
|
||||
"dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch",
|
||||
"dev:mp-jd": "cross-env NODE_ENV=development UNI_PLATFORM=mp-jd vue-cli-service uni-build --watch",
|
||||
"dev:mp-kuaishou": "cross-env NODE_ENV=development UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build --watch",
|
||||
"dev:mp-lark": "cross-env NODE_ENV=development UNI_PLATFORM=mp-lark vue-cli-service uni-build --watch",
|
||||
"dev:mp-qq": "cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch",
|
||||
"dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch",
|
||||
"dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch",
|
||||
"dev:mp-xhs": "cross-env NODE_ENV=development UNI_PLATFORM=mp-xhs vue-cli-service uni-build --watch",
|
||||
"dev:quickapp-native": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-native vue-cli-service uni-build --watch",
|
||||
"dev:quickapp-webview": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview vue-cli-service uni-build --watch",
|
||||
"dev:quickapp-webview-huawei": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build --watch",
|
||||
"dev:quickapp-webview-union": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build --watch",
|
||||
"info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js",
|
||||
"serve:quickapp-native": "node node_modules/@dcloudio/uni-quickapp-native/bin/serve.js",
|
||||
"test:android": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=android jest -i",
|
||||
"test:h5": "cross-env UNI_PLATFORM=h5 jest -i",
|
||||
"test:ios": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=ios jest -i",
|
||||
"test:mp-baidu": "cross-env UNI_PLATFORM=mp-baidu jest -i",
|
||||
"test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-app": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-app-plus": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-h5": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-i18n": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-360": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-alipay": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-baidu": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-jd": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-kuaishou": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-lark": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-qq": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-toutiao": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-vue": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-weixin": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-mp-xhs": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-quickapp-native": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-quickapp-webview": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-stacktracey": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-stat": "^2.0.2-3081220230817001",
|
||||
"@vue/shared": "^3.0.0",
|
||||
"autoprefixer": "^8.0.0",
|
||||
"core-js": "^3.8.3",
|
||||
"flyio": "^0.6.2",
|
||||
"less": "^4.2.0",
|
||||
"less-loader": "^11.1.3",
|
||||
"markdown-it-vue": "^1.1.7",
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-loader": "^7.3.3",
|
||||
"vue": ">= 2.6.14 < 2.7",
|
||||
"vue-markdown": "^2.2.4",
|
||||
"vuex": "^3.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@dcloudio/types": "^3.3.2",
|
||||
"@dcloudio/uni-automator": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-cli-i18n": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-cli-shared": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-helper-json": "*",
|
||||
"@dcloudio/uni-migration": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/uni-template-compiler": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/vue-cli-plugin-uni": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/webpack-uni-mp-loader": "^2.0.2-3081220230817001",
|
||||
"@dcloudio/webpack-uni-pages-loader": "^2.0.2-3081220230817001",
|
||||
"@vue/cli-plugin-babel": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"babel-plugin-import": "^1.11.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"jest": "^25.4.0",
|
||||
"node-sass": "^4.14.1",
|
||||
"postcss-comment": "^2.0.0",
|
||||
"sass": "^1.69.2",
|
||||
"sass-loader": "^7.3.1",
|
||||
"vue-template-compiler": ">= 2.6.14 < 2.7"
|
||||
},
|
||||
"browserslist": [
|
||||
"Android >= 4.4",
|
||||
"ios >= 9"
|
||||
],
|
||||
"uni-app": {
|
||||
"scripts": {}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const config = {
|
||||
parser: require('postcss-comment'),
|
||||
plugins: [
|
||||
require('postcss-import')({
|
||||
resolve (id, basedir, importOptions) {
|
||||
if (id.startsWith('~@/')) {
|
||||
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3))
|
||||
} else if (id.startsWith('@/')) {
|
||||
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2))
|
||||
} else if (id.startsWith('/') && !id.startsWith('//')) {
|
||||
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1))
|
||||
}
|
||||
return id
|
||||
}
|
||||
}),
|
||||
require('autoprefixer')({
|
||||
remove: process.env.UNI_PLATFORM !== 'h5'
|
||||
}),
|
||||
require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
|
||||
]
|
||||
}
|
||||
if (webpack.version[0] > 4) {
|
||||
delete config.parser
|
||||
}
|
||||
module.exports = config
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>
|
||||
<%= htmlWebpackPlugin.options.title %>
|
||||
</title>
|
||||
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
</script>
|
||||
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>Please enable JavaScript to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
|
||||
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,11 @@
|
|||
/// <reference types='@dcloudio/types' />
|
||||
import Vue from 'vue'
|
||||
declare module "vue/types/options" {
|
||||
type Hooks = App.AppInstance & Page.PageInstance;
|
||||
interface ComponentOptions<V extends Vue> extends Hooks {
|
||||
/**
|
||||
* 组件类型
|
||||
*/
|
||||
mpType?: string;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
declare module "*.vue" {
|
||||
import Vue from 'vue'
|
||||
export default Vue
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
<script>
|
||||
export default {
|
||||
onLaunch: function(option) {
|
||||
console.log('option',option);
|
||||
uni.setStorageSync('userId', option.query.userId)
|
||||
uni.setStorageSync('openId', option.query.openId)
|
||||
console.log('App Launch')
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../styles/style.css";
|
||||
|
||||
/*每个页面公共css */
|
||||
page {
|
||||
background: #F4F5F7;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/* 取消左右上下滑动样式 */
|
||||
/* #ifdef H5 */
|
||||
::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
-webkit-appearance: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
@keyframes progross1 {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes progross2 {
|
||||
to {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
}
|
||||
|
||||
.uni-searchbar__text-placeholder,
|
||||
.uniui-search {
|
||||
color: #666 !important;
|
||||
}
|
||||
|
||||
.uni-searchbar__box {
|
||||
border: 1px solid #3AAFB8 !important;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
height: 100rpx;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/* 兼容 iOS < 11.2 */
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/* 兼容 iOS >= 11.2 */
|
||||
}
|
||||
|
||||
.btnList {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100vw;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 110rpx;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/* 兼容 iOS < 11.2 */
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
|
||||
/* 兼容 iOS >= 11.2 */
|
||||
.btn {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
background-color: $uni-color;
|
||||
border-radius: 40rpx;
|
||||
flex: 1;
|
||||
margin: 0 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,558 @@
|
|||
<template>
|
||||
<view class="cmd-progress cmd-progress-default" :class="setStatusClass">
|
||||
<block v-if="type == 'circle' || type == 'dashboard'">
|
||||
<view class="cmd-progress cmd-progress-default" :class="setStatusClass">
|
||||
<view class="cmd-progress-inner" :style="setCircleStyle">
|
||||
<!-- 绘制圈 start -->
|
||||
<!-- #ifdef H5 -->
|
||||
<svg viewBox="0 0 100 100" class="cmd-progress-circle">
|
||||
<path :d="setCirclePath" stroke="#f3f3f3" :stroke-linecap="strokeShape" :stroke-width="strokeWidth"
|
||||
fill-opacity="0" class="cmd-progress-circle-trail" :style="setCircleTrailStyle"></path>
|
||||
<path :d="setCirclePath" :stroke-linecap="strokeShape" :stroke-width="strokeWidth" fill-opacity="0" class="cmd-progress-circle-path"
|
||||
:style="setCirclePathStyle"></path>
|
||||
</svg>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef H5 -->
|
||||
<text :style="setCircle"></text>
|
||||
<!-- #endif -->
|
||||
<!-- 绘制圈 end -->
|
||||
<!-- 状态文本 start -->
|
||||
<block v-if="showInfo">
|
||||
<text class="cmd-progress-text" :title="setFormat">
|
||||
<block v-if="status != 'success' && status != 'exception' && setProgress < 100">{{setFormat}}</block>
|
||||
<!-- #ifdef H5 -->
|
||||
<svg v-if="status == 'exception'" viewBox="64 64 896 896" data-icon="close" width="1em" height="1em" fill="currentColor"
|
||||
aria-hidden="true">
|
||||
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path>
|
||||
</svg>
|
||||
<svg v-if="status == 'success' || setProgress == 100" viewBox="64 64 896 896" data-icon="check" width="1em"
|
||||
height="1em" fill="currentColor" aria-hidden="true" :style="{'color': strokeColor ? strokeColor : ''}">
|
||||
<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"></path>
|
||||
</svg>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef H5 -->
|
||||
<text v-if="status == 'exception' || status == 'success' || setProgress == 100" :style="setCircleIcon"></text>
|
||||
<!-- #endif -->
|
||||
</text>
|
||||
</block>
|
||||
<!-- 状态文本 end -->
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<block v-if="type == 'line'">
|
||||
<!-- 进度条 start -->
|
||||
<view class="cmd-progress-outer">
|
||||
<view class="cmd-progress-inner" :style="{'border-radius': strokeShape == 'square' ? 0 : '100px'}">
|
||||
<view class="cmd-progress-bg" :style="setLineStyle"></view>
|
||||
<view v-if="successPercent" class="cmd-progress-success-bg" :style="setLineSuccessStyle"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 进度条 end -->
|
||||
<!-- 进度条是否显示信息 start -->
|
||||
<block v-if="showInfo">
|
||||
<text class="cmd-progress-text" :title="setFormat">
|
||||
<block v-if="status != 'success' && status != 'exception' && setProgress < 100">{{setFormat}}</block>
|
||||
<!-- #ifdef H5 -->
|
||||
<svg v-if="status == 'exception'" viewBox="64 64 896 896" data-icon="close-circle" width="1em" height="1em"
|
||||
fill="currentColor" aria-hidden="true">
|
||||
<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"></path>
|
||||
</svg>
|
||||
<svg v-if="status == 'success' || setProgress == 100" viewBox="64 64 896 896" data-icon="check-circle" width="1em"
|
||||
height="1em" fill="currentColor" aria-hidden="true" :style="{'color': strokeColor ? strokeColor : ''}">
|
||||
<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 0 1-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"></path>
|
||||
</svg>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef H5 -->
|
||||
<text v-if="status == 'exception' || status == 'success' || setProgress == 100" :style="setLineStatusIcon"></text>
|
||||
<!-- #endif -->
|
||||
</text>
|
||||
</block>
|
||||
<!-- 进度条是否显示信息 end -->
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 进度条组件
|
||||
* @description 显示一个操作完成的百分比时,为用户显示该操作的当前进度和状态。
|
||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=259
|
||||
* @property {String} type 进度类型 - 线型:line、圆圈形:circle、仪表盘:dashboard,默认线型:line
|
||||
* @property {Number} percent 进度百分比值 - 显示范围0-100 ,可能数比较大就需要自己转成百分比的值
|
||||
* @property {Number} success-percent 进度已完成的百分几 - 仅支持进度线型:line
|
||||
* @property {String} status 进度状态 - 涌动:active(仅支持线型:line)、正常:normal、完成:success、失败:exception,默认正常:normal
|
||||
* @property {Boolean} show-info 进度状态信息 - 是否显示进度数值或状态图标,默认true
|
||||
* @property {Number} stroke-width 进度线条的宽度 - 建议在条线的宽度范围:1-50,与进度条显示宽度有关,默认8
|
||||
* @property {String} stroke-color 进度线条的颜色 - 渐变色仅支持线型:line
|
||||
* @property {String} stroke-shape 进度线条两端的形状 - 圆:round、方块直角:square,默认圆:round
|
||||
* @property {Number} width 进度画布宽度 - 仅支持圆圈形:circle、仪表盘:dashboard,默认80
|
||||
* @property {String} gap-degree 进度圆形缺口角度 - 可取值 0 ~ 360,仅支持圆圈形:circle、仪表盘:dashboard
|
||||
* @property {String} gap-position 进度圆形缺口位置 - 可取值'top', 'bottom', 'left', 'right',仅支持圆圈形:circle、仪表盘:dashboard
|
||||
* @example <cmd-progress :percent="30"></cmd-progress>
|
||||
*/
|
||||
export default {
|
||||
name: 'cmd-progress',
|
||||
|
||||
props: {
|
||||
/**
|
||||
* 类型默认:line,可选 line circle dashboard
|
||||
*/
|
||||
type: {
|
||||
validator: val => {
|
||||
return ['line', 'circle', 'dashboard'].includes(val);
|
||||
},
|
||||
default: 'line'
|
||||
},
|
||||
/**
|
||||
* 百分比
|
||||
*/
|
||||
percent: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
/**
|
||||
* 已完成的分段百分,仅支持类型line
|
||||
*/
|
||||
successPercent: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
/**
|
||||
* 是否显示进度数值或状态图标
|
||||
*/
|
||||
showInfo: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
/**
|
||||
* 进度状态,可选:normal success exception (active仅支持类型line
|
||||
*/
|
||||
status: {
|
||||
validator: val => {
|
||||
return ['normal', 'success', 'exception', 'active'].includes(val);
|
||||
},
|
||||
default: 'normal'
|
||||
},
|
||||
/**
|
||||
* 条线的宽度1-50,与width有关
|
||||
*/
|
||||
strokeWidth: {
|
||||
type: Number,
|
||||
default: 6
|
||||
},
|
||||
/**
|
||||
* 条线的颜色,渐变色仅支持类型line
|
||||
*/
|
||||
strokeColor: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
/**
|
||||
* 条线两端的形状 可选:'round', 'square'
|
||||
*/
|
||||
strokeShape: {
|
||||
validator: val => {
|
||||
return ['round', 'square'].includes(val);
|
||||
},
|
||||
default: 'round'
|
||||
},
|
||||
/**
|
||||
* 圆形进度条画布宽度,支持类型circle dashboard
|
||||
*/
|
||||
width: {
|
||||
type: Number,
|
||||
default: 80
|
||||
},
|
||||
/**
|
||||
* 圆形进度条缺口角度,可取值 0 ~ 360,支持类型circle dashboard
|
||||
*/
|
||||
gapDegree: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
/**
|
||||
* 圆形进度条缺口位置,可取值'top', 'bottom', 'left', 'right' ,支持类型circle dashboard
|
||||
*/
|
||||
gapPosition: {
|
||||
validator: val => {
|
||||
return ['top', 'bottom', 'left', 'right'].includes(val);
|
||||
},
|
||||
default: 'top'
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
/**
|
||||
* 如果需要自定义格式就在这改
|
||||
*/
|
||||
setFormat() {
|
||||
return `${this.setProgress}%`;
|
||||
},
|
||||
/**
|
||||
* 设置显示进度值,禁止小于0和超过100
|
||||
*/
|
||||
setProgress() {
|
||||
let percent = this.percent;
|
||||
if (!this.percent || this.percent < 0) {
|
||||
percent = 0;
|
||||
} else if (this.percent >= 100) {
|
||||
percent = 100;
|
||||
}
|
||||
return percent;
|
||||
},
|
||||
/**
|
||||
* 进度圈svg大小
|
||||
*/
|
||||
setCircleStyle() {
|
||||
return `width: ${this.width}px;
|
||||
height: ${this.width}px;
|
||||
fontSize: ${this.width * 0.15 + 6}px;`
|
||||
},
|
||||
/**
|
||||
* 圈底色
|
||||
*/
|
||||
setCircleTrailStyle() {
|
||||
const radius = 50 - this.strokeWidth / 2;
|
||||
const len = Math.PI * 2 * radius;
|
||||
const gapDeg = this.gapDegree || (this.type === 'dashboard' && 75);
|
||||
return `stroke-dasharray: ${len - (gapDeg||0)}px, ${len}px;
|
||||
stroke-dashoffset: -${(gapDeg||0) / 2}px;
|
||||
transition: stroke-dashoffset 0.3s ease 0s, stroke-dasharray 0.3s ease 0s, stroke 0.3s;`
|
||||
},
|
||||
/**
|
||||
* 圈进度
|
||||
*/
|
||||
setCirclePathStyle() {
|
||||
const radius = 50 - this.strokeWidth / 2;
|
||||
const len = Math.PI * 2 * radius;
|
||||
const gapDeg = this.gapDegree || (this.type === 'dashboard' && 75);
|
||||
return `stroke: ${this.strokeColor};
|
||||
stroke-dasharray: ${(this.setProgress / 100) * (len - (gapDeg||0))}px, ${len}px;
|
||||
stroke-dashoffset: -${(gapDeg||0) / 2}px;
|
||||
transition: stroke-dashoffset 0.3s ease 0s, stroke-dasharray 0.3s ease 0s, stroke 0.3s, stroke-width 0.06s ease 0.3s;`
|
||||
},
|
||||
/**
|
||||
* 绘制圈
|
||||
*/
|
||||
setCirclePath() {
|
||||
const radius = 50 - this.strokeWidth / 2;
|
||||
let beginPositionX = 0;
|
||||
let beginPositionY = -radius;
|
||||
let endPositionX = 0;
|
||||
let endPositionY = -2 * radius;
|
||||
const gapPos = (this.type === 'dashboard' && 'bottom') || this.gapPosition || 'top';
|
||||
switch (gapPos) {
|
||||
case 'left':
|
||||
beginPositionX = -radius;
|
||||
beginPositionY = 0;
|
||||
endPositionX = 2 * radius;
|
||||
endPositionY = 0;
|
||||
break;
|
||||
case 'right':
|
||||
beginPositionX = radius;
|
||||
beginPositionY = 0;
|
||||
endPositionX = -2 * radius;
|
||||
endPositionY = 0;
|
||||
break;
|
||||
case 'bottom':
|
||||
beginPositionY = radius;
|
||||
endPositionY = 2 * radius;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return `M 50,50 m ${beginPositionX},${beginPositionY} a ${radius},${radius} 0 1 1 ${endPositionX},${-endPositionY} a ${radius},${radius} 0 1 1 ${-endPositionX},${endPositionY}`;
|
||||
},
|
||||
// #ifndef H5
|
||||
/**
|
||||
* 非H5端,绘制进度圈svg转base URL
|
||||
*/
|
||||
setCircle() {
|
||||
const radius = 50 - this.strokeWidth / 2;
|
||||
const len = Math.PI * 2 * radius;
|
||||
const gapDeg = this.gapDegree || (this.type === 'dashboard' && 75);
|
||||
let currentColor = '#108ee9'
|
||||
// 异常进度
|
||||
if (this.status == 'exception') {
|
||||
currentColor = '#f5222d'
|
||||
}
|
||||
// 完成进度
|
||||
if (this.status == 'success' || this.setProgress >= 100 || this.strokeColor) {
|
||||
currentColor = this.strokeColor || '#52c41a'
|
||||
}
|
||||
let svgToBase =
|
||||
`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' class='cmd-progress-circle'%3E%3Cpath d='${this.setCirclePath}' stroke='%23f3f3f3' stroke-linecap='${this.strokeShape}' stroke-width='${this.strokeWidth}' fill-opacity='0' class='cmd-progress-circle-trail' style='stroke-dasharray: ${len - (gapDeg||0)}px, ${len}px;stroke-dashoffset: -${(gapDeg||0) / 2}px;transition: stroke-dashoffset 0.3s ease 0s, stroke-dasharray 0.3s ease 0s, stroke 0.3s;'%3E%3C/path%3E%3Cpath d='${this.setCirclePath}' stroke-linecap='${this.strokeShape}' stroke-width='${this.strokeWidth}' fill-opacity='0' class='cmd-progress-circle-path' style='stroke: ${escape(currentColor)};stroke-dasharray: ${(this.setProgress / 100) * (len - (gapDeg||0))}px, ${len}px;stroke-dashoffset: -${(gapDeg||0) / 2}px;transition: stroke-dashoffset 0.3s ease 0s, stroke-dasharray 0.3s ease 0s, stroke 0.3s, stroke-width 0.06s ease 0.3s;'%3E%3C/path%3E%3C/svg%3E`
|
||||
return `background-image: url("${svgToBase}");
|
||||
background-size: cover;
|
||||
display: inline-block;
|
||||
${this.setCircleStyle}`;
|
||||
},
|
||||
/**
|
||||
* 设置进度圈状态图标
|
||||
*/
|
||||
setCircleIcon() {
|
||||
let currentColor = '#108ee9'
|
||||
let svgToBase = ''
|
||||
// 异常进度
|
||||
if (this.status == 'exception') {
|
||||
currentColor = '#f5222d'
|
||||
svgToBase =
|
||||
`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' data-icon='close' width='1em' height='1em' fill='${escape(currentColor)}' aria-hidden='true'%3E %3Cpath d='M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z'%3E%3C/path%3E %3C/svg%3E`;
|
||||
}
|
||||
// 完成进度
|
||||
if (this.status == 'success' || this.setProgress >= 100) {
|
||||
currentColor = this.strokeColor || '#52c41a'
|
||||
svgToBase =
|
||||
`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' data-icon='check' width='1em' height='1em' fill='${escape(currentColor)}' aria-hidden='true'%3E %3Cpath d='M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z'%3E%3C/path%3E %3C/svg%3E`;
|
||||
}
|
||||
return `background-image: url("${svgToBase}");
|
||||
background-size: cover;
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
height: 1em;`;
|
||||
},
|
||||
// #endif
|
||||
/**
|
||||
* 设置进度条样式
|
||||
*/
|
||||
setLineStyle() {
|
||||
return `width: ${this.setProgress}%;
|
||||
height: ${this.strokeWidth}px;
|
||||
background: ${this.strokeColor};
|
||||
border-radius: ${this.strokeShape === 'square' ? 0 : '100px'};`;
|
||||
},
|
||||
/**
|
||||
* 设置已完成分段进度
|
||||
*/
|
||||
setLineSuccessStyle() {
|
||||
let successPercent = this.successPercent;
|
||||
if (!this.successPercent || this.successPercent < 0 || this.setProgress < this.successPercent) {
|
||||
successPercent = 0;
|
||||
} else if (this.successPercent >= 100) {
|
||||
successPercent = 100;
|
||||
}
|
||||
return `width: ${successPercent}%;
|
||||
height: ${this.strokeWidth}px;
|
||||
border-radius: ${this.strokeShape === 'square' ? 0 : '100px'};`;
|
||||
},
|
||||
// #ifndef H5
|
||||
/**
|
||||
* 设置进度条状态图标
|
||||
*/
|
||||
setLineStatusIcon() {
|
||||
let currentColor = '#108ee9'
|
||||
let svgToBase = ''
|
||||
// 异常进度
|
||||
if (this.status == 'exception') {
|
||||
currentColor = '#f5222d'
|
||||
svgToBase =
|
||||
`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' data-icon='close-circle' width='1em' height='1em' fill='${escape(currentColor)}' aria-hidden='true'%3E %3Cpath d='M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z'%3E%3C/path%3E %3C/svg%3E`;
|
||||
}
|
||||
// 完成进度
|
||||
if (this.status == 'success' || this.setProgress >= 100) {
|
||||
currentColor = this.strokeColor || '#52c41a'
|
||||
svgToBase =
|
||||
`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' data-icon='check-circle' width='1em' height='1em' fill='${escape(currentColor)}' aria-hidden='true'%3E %3Cpath d='M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 0 1-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z'%3E%3C/path%3E %3C/svg%3E`;
|
||||
}
|
||||
return `background-image: url("${svgToBase}");
|
||||
background-size: cover;
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
height: 1em;`;
|
||||
},
|
||||
// #endif
|
||||
/**
|
||||
* 状态样式
|
||||
*/
|
||||
setStatusClass() {
|
||||
let statusClass = [];
|
||||
// 异常进度
|
||||
if (this.status == 'exception') {
|
||||
statusClass.push('cmd-progress-status-exception')
|
||||
}
|
||||
// 完成进度
|
||||
if (this.status == 'success' || this.setProgress >= 100) {
|
||||
statusClass.push('cmd-progress-status-success')
|
||||
}
|
||||
// 活动进度条
|
||||
if (this.status == 'active') {
|
||||
statusClass.push('cmd-progress-status-active')
|
||||
}
|
||||
// 是否显示信息
|
||||
if (this.showInfo) {
|
||||
statusClass.push('cmd-progress-show-info')
|
||||
}
|
||||
// 进度条类型
|
||||
if (this.type === 'line') {
|
||||
statusClass.push('cmd-progress-line')
|
||||
}
|
||||
// 进度圈、仪表盘类型
|
||||
if (this.type === 'circle' || this.type === 'dashboard') {
|
||||
statusClass.push('cmd-progress-circle')
|
||||
}
|
||||
statusClass.push('cmd-progress-status-normal')
|
||||
return statusClass;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.cmd-progress {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.cmd-progress-line {
|
||||
width: 100%;
|
||||
font-size: 28upx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.cmd-progress-outer {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.cmd-progress-show-info .cmd-progress-outer {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.cmd-progress-inner {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 200upx;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.cmd-progress-circle-trail {
|
||||
stroke: #f5f5f5;
|
||||
}
|
||||
|
||||
.cmd-progress-circle-path {
|
||||
stroke: #1890ff;
|
||||
animation: appear 0.3s;
|
||||
}
|
||||
|
||||
.cmd-progress-success-bg,
|
||||
.cmd-progress-bg {
|
||||
background-color: #1890ff;
|
||||
transition: all 0.4s cubic-bezier(0.08, 0.82, 0.17, 1) 0s;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.cmd-progress-success-bg {
|
||||
background-color: #52c41a;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.cmd-progress-text {
|
||||
word-break: normal;
|
||||
width: 60upx;
|
||||
text-align: left;
|
||||
margin-left: 16upx;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.cmd-progress-status-active .cmd-progress-bg:before {
|
||||
content: "";
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
border-radius: 20upx;
|
||||
-webkit-animation: cmd-progress-active 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite;
|
||||
animation: cmd-progress-active 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite;
|
||||
}
|
||||
|
||||
.cmd-progress-status-exception .cmd-progress-bg {
|
||||
background-color: #f5222d;
|
||||
}
|
||||
|
||||
.cmd-progress-status-exception .cmd-progress-text {
|
||||
color: #f5222d;
|
||||
}
|
||||
|
||||
.cmd-progress-status-exception .cmd-progress-circle-path {
|
||||
stroke: #f5222d;
|
||||
}
|
||||
|
||||
.cmd-progress-status-success .cmd-progress-bg {
|
||||
background-color: #52c41a;
|
||||
}
|
||||
|
||||
.cmd-progress-status-success .cmd-progress-text {
|
||||
color: #52c41a;
|
||||
}
|
||||
|
||||
.cmd-progress-status-success .cmd-progress-circle-path {
|
||||
stroke: #52c41a;
|
||||
}
|
||||
|
||||
.cmd-progress-circle .cmd-progress-inner {
|
||||
position: relative;
|
||||
line-height: 1;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.cmd-progress-circle .cmd-progress-text {
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
top: 50%;
|
||||
-webkit-transform: translateY(-50%);
|
||||
transform: translateY(-50%);
|
||||
left: 0;
|
||||
margin: 0;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.cmd-progress-circle .cmd-progress-status-exception .cmd-progress-text {
|
||||
color: #f5222d;
|
||||
}
|
||||
|
||||
.cmd-progress-circle .cmd-progress-status-success .cmd-progress-text {
|
||||
color: #52c41a;
|
||||
}
|
||||
|
||||
@keyframes cmd-progress-active {
|
||||
0% {
|
||||
opacity: 0.1;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
20% {
|
||||
opacity: 0.5;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,531 @@
|
|||
<template>
|
||||
<view class="canvas">
|
||||
<view ref="Content" class="theContent">
|
||||
<slot></slot>
|
||||
</view>
|
||||
<canvas canvas-id="myCanvas" id="myCanvas" @onReady="onCanvasReady"
|
||||
:style="{ width: width + 'px', height: height + 'px' }"></canvas>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!--
|
||||
list参数说明:
|
||||
图片渲染:
|
||||
type: 'image',
|
||||
x: X轴位置,
|
||||
y: Y轴位置,
|
||||
path: 图片路径,
|
||||
width: 图片宽度,
|
||||
height: 图片高度,
|
||||
rotate: 旋转角度
|
||||
mode:'center' 居中自适应
|
||||
shape: 形状,默认无,可选值:circle 圆形 如果是number,则生成圆角矩形
|
||||
area: {x,y,width,height} // 绘制范围,超出该范围会被剪裁掉 该属性与shape暂时无法同时使用,area存在时,shape失效
|
||||
矩形渲染:
|
||||
type: 'square',
|
||||
x: X轴位置,
|
||||
y: Y轴位置,
|
||||
width: 图片宽度,
|
||||
height: 图片高度,
|
||||
rotate: 旋转角度
|
||||
shape: 形状,默认无,可选值:circle 圆形 如果是number,则生成圆角矩形
|
||||
fillStyle:填充的背景样式
|
||||
area: {x,y,width,height} // 绘制范围,超出该范围会被剪裁掉 该属性与shape暂时无法同时使用,area存在时,shape失效
|
||||
文字渲染:
|
||||
type: 'text',
|
||||
x: X轴位置,
|
||||
y: Y轴位置,
|
||||
text: 文本内容,
|
||||
size: 字体大小,
|
||||
textBaseline: 基线 默认top 可选值:'top'、'bottom'、'middle'、'normal'
|
||||
color: 颜色
|
||||
多行文字渲染:
|
||||
type: 'textarea',
|
||||
x: X轴位置,
|
||||
y: Y轴位置,
|
||||
width:换行的宽度
|
||||
height: 高度,溢出会展示“...”
|
||||
lineSpace: 行间距
|
||||
text: 文本内容,
|
||||
size: 字体大小,
|
||||
textBaseline: 基线 默认top 可选值:'top'、'bottom'、'middle'、'normal'
|
||||
color: 颜色
|
||||
-->
|
||||
|
||||
<script>
|
||||
let timer = null;
|
||||
export default {
|
||||
name: "Poster",
|
||||
props: {
|
||||
// 绘制队列
|
||||
list: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
// 海报宽度(默认设备宽度放大两倍) 建议都放大两倍
|
||||
width: {
|
||||
type: [Number, String],
|
||||
default: uni.getSystemInfoSync().windowWidth * 2,
|
||||
},
|
||||
// 海报高度(默认设备高度放大两倍)
|
||||
height: {
|
||||
type: [Number, String],
|
||||
default: uni.getSystemInfoSync().windowHeight * 2,
|
||||
},
|
||||
//背景颜色
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: "rgba(255,255,255)",
|
||||
},
|
||||
},
|
||||
emit: ["on-success", "on-error"],
|
||||
data() {
|
||||
return {
|
||||
posterUrl: "",
|
||||
renderList: [],
|
||||
ctx: null, //画布上下文
|
||||
counter: -1, //计数器
|
||||
drawPathQueue: [], //画图路径队列
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
drawPathQueue(newVal, oldVal) {
|
||||
// 绘制单行文字
|
||||
const fillText = (textOptions) => {
|
||||
this.ctx.setFillStyle(textOptions.color);
|
||||
this.ctx.setFontSize(textOptions.size);
|
||||
this.ctx.setTextBaseline(textOptions.textBaseline || "top");
|
||||
this.ctx.fillText(textOptions.text, textOptions.x, textOptions.y);
|
||||
};
|
||||
// 绘制段落
|
||||
const fillParagraph = (textOptions) => {
|
||||
this.ctx.setFontSize(textOptions.size);
|
||||
let tempOptions = JSON.parse(JSON.stringify(textOptions));
|
||||
// 如果没有指定行间距则设置默认值
|
||||
tempOptions.lineSpace = tempOptions.lineSpace ? tempOptions.lineSpace : 10;
|
||||
// 获取字符串
|
||||
let str = textOptions.text;
|
||||
// 计算指定高度可以输出的最大行数
|
||||
let lineCount = Math.floor((tempOptions.height + tempOptions.lineSpace) / (tempOptions.size +
|
||||
tempOptions.lineSpace));
|
||||
// 初始化单行宽度
|
||||
let lineWidth = 0;
|
||||
let lastSubStrIndex = 0; //每次开始截取的字符串的索引
|
||||
|
||||
// 构建一个打印数组
|
||||
let strArr = str.split("");
|
||||
let drawArr = [];
|
||||
let text = "";
|
||||
while (strArr.length) {
|
||||
let word = strArr.shift();
|
||||
text += word;
|
||||
let textWidth = this.ctx.measureText(text).width;
|
||||
if (textWidth > textOptions.width) {
|
||||
// 因为超出宽度 所以要截取掉最后一个字符
|
||||
text = text.substr(0, text.length - 1);
|
||||
drawArr.push(text);
|
||||
text = "";
|
||||
// 最后一个字还给strArr
|
||||
strArr.unshift(word);
|
||||
} else if (!strArr.length) {
|
||||
drawArr.push(text);
|
||||
}
|
||||
}
|
||||
|
||||
if (drawArr.length > lineCount) {
|
||||
// 超出最大行数
|
||||
drawArr.length = lineCount;
|
||||
let pointWidth = this.ctx.measureText("...").width;
|
||||
let wordWidth = 0;
|
||||
let wordArr = drawArr[drawArr.length - 1].split("");
|
||||
let words = "";
|
||||
while (pointWidth > wordWidth) {
|
||||
words += wordArr.pop();
|
||||
wordWidth = this.ctx.measureText(words).width;
|
||||
}
|
||||
drawArr[drawArr.length - 1] = wordArr.join("") + "...";
|
||||
}
|
||||
// 打印
|
||||
for (let i = 0; i < drawArr.length; i++) {
|
||||
let _h = i > 0 ? tempOptions.size + tempOptions.lineSpace : 0;
|
||||
tempOptions.y = tempOptions.y + _h; // y的位置
|
||||
tempOptions.text = drawArr[i]; // 绘制的文本
|
||||
fillText(tempOptions);
|
||||
}
|
||||
};
|
||||
const roundRect = (x, y, w, h, r) => {
|
||||
// 开始绘制
|
||||
this.ctx.beginPath();
|
||||
// 因为边缘描边存在锯齿,最好指定使用 transparent 填充
|
||||
// 这里是使用 fill 还是 stroke都可以,二选一即可
|
||||
this.ctx.setFillStyle("transparent");
|
||||
// ctx.setStrokeStyle('transparent')
|
||||
// 左上角
|
||||
this.ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5);
|
||||
// border-top
|
||||
this.ctx.moveTo(x + r, y);
|
||||
this.ctx.lineTo(x + w - r, y);
|
||||
this.ctx.lineTo(x + w, y + r);
|
||||
// 右上角
|
||||
this.ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2);
|
||||
|
||||
// border-right
|
||||
this.ctx.lineTo(x + w, y + h - r);
|
||||
this.ctx.lineTo(x + w - r, y + h);
|
||||
// 右下角
|
||||
this.ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5);
|
||||
|
||||
// border-bottom
|
||||
this.ctx.lineTo(x + r, y + h);
|
||||
this.ctx.lineTo(x, y + h - r);
|
||||
// 左下角
|
||||
this.ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI);
|
||||
// border-left
|
||||
this.ctx.lineTo(x, y + r);
|
||||
this.ctx.lineTo(x + r, y);
|
||||
// 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应
|
||||
this.ctx.fill();
|
||||
// ctx.stroke()
|
||||
this.ctx.closePath();
|
||||
// 剪切
|
||||
this.ctx.clip();
|
||||
};
|
||||
// 图片自适应
|
||||
const adaptiveImg = (img, x, y, mode) => {
|
||||
const {
|
||||
imgW: w,
|
||||
imgH: h,
|
||||
width: dWidth,
|
||||
height: dHeight
|
||||
} = img;
|
||||
let dw = dWidth / w; //canvas与图片的宽比
|
||||
let dh = dHeight / h; //canvas与图片的高比
|
||||
// 裁剪图片中间部分
|
||||
if ((w > dWidth && h > dHeight) || (w < dWidth && h < dHeight)) {
|
||||
if (dw > dh) {
|
||||
this.ctx.drawImage(img.path, 0, (h - dHeight / dw) / 2, w, dHeight / dw, x, y, dWidth,
|
||||
dHeight);
|
||||
} else {
|
||||
this.ctx.drawImage(img.path, (w - dWidth / dh) / 2, 0, dWidth / dh, h, x, y, dWidth,
|
||||
dHeight);
|
||||
}
|
||||
} else {
|
||||
// 拉伸图片
|
||||
if (w < dWidth) {
|
||||
this.ctx.drawImage(img.path, 0, (h - dHeight / dw) / 2, w, dHeight / dw, x, y, dWidth,
|
||||
dHeight);
|
||||
} else {
|
||||
this.ctx.drawImage(img.path, (w - dWidth / dh) / 2, 0, dWidth / dh, h, x, y, dWidth,
|
||||
dHeight);
|
||||
}
|
||||
}
|
||||
// 裁剪图片中间部分
|
||||
// this.ctx.drawImage(img.path, sx, sy, sWidth, sHeight, x, y, dWidth, dHeight);
|
||||
// this.ctx.drawImage(img.path, x, y, temp.dWidth, temp.dHeight);
|
||||
};
|
||||
// 绘制背景
|
||||
this.ctx.setFillStyle(this.backgroundColor);
|
||||
this.ctx.fillRect(0, 0, this.width, this.height);
|
||||
/* 所有元素入队则开始绘制 */
|
||||
if (newVal.length === this.renderList.length) {
|
||||
if (newVal.length == 0) {
|
||||
this.$emit("on-error", {
|
||||
msg: "数据为空",
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// console.log('生成的队列:' + JSON.stringify(newVal));
|
||||
for (let i = 0; i < this.drawPathQueue.length; i++) {
|
||||
for (let j = 0; j < this.drawPathQueue.length; j++) {
|
||||
let current = this.drawPathQueue[j];
|
||||
/* 按顺序绘制 */
|
||||
if (current.index === i) {
|
||||
/* 文本绘制 */
|
||||
if (current.type === "text") {
|
||||
fillText(current);
|
||||
this.counter--;
|
||||
}
|
||||
/* 多行文本 */
|
||||
if (current.type === "textarea") {
|
||||
console.log("开始绘制...textarea");
|
||||
fillParagraph(current);
|
||||
this.counter--;
|
||||
}
|
||||
/* 多行文本 */
|
||||
if (current.type === "text") {
|
||||
console.log("开始绘制...square");
|
||||
this.ctx.save(); // 保存上下文,绘制后恢复
|
||||
this.ctx.beginPath(); //开始绘制
|
||||
//画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因
|
||||
// 设置旋转中心
|
||||
let offsetX = current.x + Number(current.width) / 2;
|
||||
let offsetY = current.y + Number(current.height) / 2;
|
||||
this.ctx.translate(offsetX, offsetY);
|
||||
let degrees = current.rotate ? Number(current.rotate) % 360 : 0;
|
||||
this.ctx.rotate((degrees * Math.PI) / 180);
|
||||
this.ctx.fillStyle = current.fillStyle;
|
||||
this.ctx.fillRect(current.x - offsetX, current.y - offsetY, current.width, current
|
||||
.height);
|
||||
this.ctx.closePath();
|
||||
this.ctx.restore(); // 恢复之前保存的上下文
|
||||
this.counter--;
|
||||
}
|
||||
/* 图片绘制 */
|
||||
if (current.type === "image") {
|
||||
console.log("开始绘制...image");
|
||||
if (current.area) {
|
||||
// 绘制绘图区域
|
||||
this.ctx.save();
|
||||
this.ctx.beginPath(); //开始绘制
|
||||
this.ctx.rect(current.area.x, current.area.y, current.area.width, current.area
|
||||
.height);
|
||||
this.ctx.clip();
|
||||
// 设置旋转中心
|
||||
let offsetX = current.x + Number(current.width) / 2;
|
||||
let offsetY = current.y + Number(current.height) / 2;
|
||||
this.ctx.translate(offsetX, offsetY);
|
||||
let degrees = current.rotate ? Number(current.rotate) % 360 : 0;
|
||||
this.ctx.rotate((degrees * Math.PI) / 180);
|
||||
this.ctx.drawImage(current.path, current.x - offsetX, current.y - offsetY,
|
||||
current.width, current.height);
|
||||
this.ctx.closePath();
|
||||
this.ctx.restore(); // 恢复之前保存的上下文
|
||||
} else if (current.shape == "circle") {
|
||||
this.ctx.save(); // 保存上下文,绘制后恢复
|
||||
this.ctx.beginPath(); //开始绘制
|
||||
//先画个圆 前两个参数确定了圆心 (x,y) 坐标 第三个参数是圆的半径 四参数是绘图方向 默认是false,即顺时针
|
||||
let width = current.width / 2 + current.x;
|
||||
let height = current.height / 2 + current.y;
|
||||
let r = current.width / 2;
|
||||
this.ctx.arc(width, height, r, 0, Math.PI * 2);
|
||||
this.ctx.lineTo(current.x, current.y);
|
||||
this.ctx.fill();
|
||||
//画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因
|
||||
this.ctx.clip();
|
||||
// 设置旋转中心
|
||||
let offsetX = current.x + Number(current.width) / 2;
|
||||
let offsetY = current.y + Number(current.height) / 2;
|
||||
this.ctx.translate(offsetX, offsetY);
|
||||
let degrees = current.rotate ? Number(current.rotate) % 360 : 0;
|
||||
this.ctx.rotate((degrees * Math.PI) / 180);
|
||||
current.mode ?
|
||||
adaptiveImg(current, current.x - offsetX, current.y - offsetY, current
|
||||
.mode) :
|
||||
this.ctx.drawImage(current.path, current.x - offsetX, current.y - offsetY,
|
||||
current.width, current.height);
|
||||
this.ctx.closePath();
|
||||
this.ctx.restore(); // 恢复之前保存的上下文
|
||||
} else if (typeof current.shape == "number") {
|
||||
this.ctx.save(); // 保存上下文,绘制后恢复
|
||||
this.ctx.beginPath(); //开始绘制
|
||||
roundRect(current.x, current.y, current.width, current.height, current.shape);
|
||||
//画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因
|
||||
// 设置旋转中心
|
||||
let offsetX = current.x + Number(current.width) / 2;
|
||||
let offsetY = current.y + Number(current.height) / 2;
|
||||
this.ctx.translate(offsetX, offsetY);
|
||||
let degrees = current.rotate ? Number(current.rotate) % 360 : 0;
|
||||
this.ctx.rotate((degrees * Math.PI) / 180);
|
||||
current.mode ?
|
||||
adaptiveImg(current, current.x - offsetX, current.y - offsetY, current
|
||||
.mode) :
|
||||
this.ctx.drawImage(current.path, current.x - offsetX, current.y - offsetY,
|
||||
current.width, current.height);
|
||||
this.ctx.closePath();
|
||||
this.ctx.restore(); // 恢复之前保存的上下文
|
||||
} else {
|
||||
this.ctx.drawImage(current.path, current.x, current.y, current.width, current
|
||||
.height);
|
||||
}
|
||||
this.counter--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
this.$emit("on-error", err);
|
||||
}
|
||||
}
|
||||
},
|
||||
counter(newVal, oldVal) {
|
||||
if (newVal === 0) {
|
||||
this.$nextTick(() => {
|
||||
this.ctx.draw(false, (draw) => {
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: "myCanvas",
|
||||
success: (res) => {
|
||||
// 在H5平台下,tempFilePath 为 base64
|
||||
console.log("图片已保存至本地:", res.tempFilePath);
|
||||
this.posterUrl = res.tempFilePath;
|
||||
this.$emit("on-success", res.tempFilePath);
|
||||
},
|
||||
fail: (error) => {
|
||||
this.$emit("on-error", error);
|
||||
},
|
||||
},
|
||||
this
|
||||
);
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// this.generateImg();
|
||||
// console.log('mounted');
|
||||
},
|
||||
methods: {
|
||||
// #ifdef MP-ALIPAY
|
||||
onCanvasReady() {
|
||||
const query = my.createSelectorQuery();
|
||||
query
|
||||
.select("#myCanvas")
|
||||
.node()
|
||||
.exec((res) => {
|
||||
const canvas = res[0].node;
|
||||
const ctx = canvas.getContext("2d");
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
|
||||
/**
|
||||
* @param {*} elClass 元素名称
|
||||
* @param {*} slot 是否采用slot方式
|
||||
* @param {*} startX X偏移
|
||||
* @param {*} startY Y偏移
|
||||
* @return {*}
|
||||
*/
|
||||
createForElRect(elClass = "Poster", slot = true, startX = 0, startY = 0) {
|
||||
uni
|
||||
.createSelectorQuery()
|
||||
.selectAll("." + elClass)
|
||||
.fields({
|
||||
dataset: true,
|
||||
size: true,
|
||||
rect: true,
|
||||
value: true,
|
||||
scrollOffset: true,
|
||||
properties: ["src", "mode"],
|
||||
computedStyle: ["margin", "padding", "backgroundColor", "fontSize", "color", "fontWeight",
|
||||
"borderRadius"
|
||||
],
|
||||
context: true,
|
||||
},
|
||||
(res) => {
|
||||
let list = [];
|
||||
const sys = uni.getSystemInfoSync();
|
||||
let multiple = sys.windowWidth / this.width;
|
||||
res.forEach((val, index) => {
|
||||
let src = val.src || val.dataset.enode || "";
|
||||
let type = val.src ? "image" : val.dataset.etype || "textarea";
|
||||
let text = val.dataset.enode || "";
|
||||
let size = val.fontSize.replace("px", "") || 13;
|
||||
let shape = val.borderRadius == "50%" ? "circle" : val.borderRadius.replace("px",
|
||||
"") * 2;
|
||||
let x = (startX + val.left - (slot ? sys.screenWidth : 0)) / multiple;
|
||||
let y = (startY + val.top) / multiple;
|
||||
y = (startY + val.top - (slot ? 50 : 0)) / multiple;
|
||||
// #ifdef H5
|
||||
y = (startY + val.top) / multiple;
|
||||
// #endif
|
||||
list.push({
|
||||
type: type,
|
||||
shape,
|
||||
text,
|
||||
mode: "center",
|
||||
x,
|
||||
y,
|
||||
path: src,
|
||||
width: val.width / multiple,
|
||||
height: val.height / multiple,
|
||||
size: size / multiple,
|
||||
color: val.color,
|
||||
});
|
||||
});
|
||||
let canvas = uni.createCanvasContext("myCanvas", this);
|
||||
this.ctx = canvas;
|
||||
this.renderList = [...this.list, ...list];
|
||||
this.generateImg();
|
||||
}
|
||||
)
|
||||
.exec();
|
||||
},
|
||||
create() {
|
||||
let canvas = uni.createCanvasContext("myCanvas", this);
|
||||
this.ctx = canvas;
|
||||
this.renderList = this.list;
|
||||
this.generateImg();
|
||||
},
|
||||
async generateImg() {
|
||||
this.counter = this.renderList.length;
|
||||
this.drawPathQueue = [];
|
||||
const getImgInfo = async (current) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getImageInfo ?
|
||||
uni.getImageInfo({
|
||||
src: current.path,
|
||||
success: (res) => {
|
||||
current.path = res.path;
|
||||
current.imgW = res.width;
|
||||
current.imgH = res.height;
|
||||
// this.drawPathQueue.push(current);
|
||||
resolve(current);
|
||||
},
|
||||
}) :
|
||||
resolve(current);
|
||||
});
|
||||
};
|
||||
const delayedLog = async (v, i) => {
|
||||
let current = this.renderList[i];
|
||||
current.index = i;
|
||||
/* 如果是文本直接放入队列 */
|
||||
if (current.type === "text" || current.type === "textarea" || current.type === "square") {
|
||||
// this.drawPathQueue.push(current);
|
||||
return current;
|
||||
} else {
|
||||
return await getImgInfo(current);
|
||||
/* 图片需获取本地缓存path放入队列 */
|
||||
}
|
||||
};
|
||||
const processArray = async (array) => {
|
||||
// map array to promises
|
||||
const promises = array.map((v, i) => delayedLog(v, i));
|
||||
// wait until all promises are resolved
|
||||
const allData = await Promise.all(promises);
|
||||
return allData;
|
||||
};
|
||||
this.drawPathQueue = await processArray(this.renderList);
|
||||
},
|
||||
saveImg() {
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: "myCanvas",
|
||||
success: (res) => {
|
||||
// 在H5平台下,tempFilePath 为 base64
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
console.log("save success");
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
this
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.canvas {
|
||||
position: fixed;
|
||||
top: 100rpx;
|
||||
left: 750rpx;
|
||||
width: 100vw;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.theContent {}
|
||||
</style>
|
|
@ -0,0 +1,717 @@
|
|||
<template>
|
||||
<view class="date">
|
||||
<view class="head" :style="{'display':hidden?'none':''}">
|
||||
<view class="icon" @click="switch_month_week('prev',true)"><text style="color: #999;"
|
||||
class="iconfont icon-fanhui" /></view>
|
||||
<view class="title">{{nowYear+'年'+nowMonth+'月'}}</view>
|
||||
<view class="icon" @click="switch_month_week('next',true)"><text style="color: #999;"
|
||||
class="iconfont next icon-fanhui" /></view>
|
||||
</view>
|
||||
<view class="date_dl">
|
||||
<view class="dd" v-for="(item,index) in week" :key="index">{{item}}</view>
|
||||
</view>
|
||||
<swiper :style="{height:(retract ? 2 * 50 : 520 ) + 'rpx'}" :current="current" circular @change="change_date">
|
||||
<swiper-item>
|
||||
|
||||
<view class="date_dl" v-show="!retract || index == to_prev_week_index"
|
||||
v-for="(item,index) in week_list_prev_co" :key="index" v-if="index<6">
|
||||
<view class="dd" @click="item_click(vo,index,key)" v-for="(vo,key) in item" :key="key">
|
||||
<view class="num"
|
||||
:class="[vo.today ? 'today' : '',vo.type == 'month' ? 'month' : (retract ? '' : 'disabled')]">
|
||||
{{customDate==currenDate&&vo.today?'今':vo.day}}
|
||||
</view>
|
||||
<view v-show="vo.dot && (vo.type == 'month' || retract)" class="dot"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="open" class="tagWidth">
|
||||
<uni-icons type="bottom" v-if="retract" size="16"></uni-icons>
|
||||
<uni-icons type="top" v-else size="16"></uni-icons>
|
||||
</view>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
|
||||
<view class="date_dl" v-show="!retract || index == to_week_index" v-for="(item,index) in week_list"
|
||||
:key="index" v-if="index<6">
|
||||
<view class="dd" @click="item_click(vo,index,key)" v-for="(vo,key) in item" :key="key">
|
||||
<view class="num"
|
||||
:class="[vo.today ? 'today' : '',vo.type == 'month' ? 'month' : (retract ? '' : 'disabled')]">
|
||||
{{customDate==currenDate&&vo.today?'今':vo.day}}
|
||||
</view>
|
||||
<view v-show="vo.dot && (vo.type == 'month' || retract)" class="dot"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="open" class="tagWidth">
|
||||
<uni-icons type="bottom" v-if="retract" size="16"></uni-icons>
|
||||
<uni-icons type="top" v-else size="16"></uni-icons>
|
||||
</view>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
|
||||
<view class="date_dl" v-show="!retract || index == to_next_week_index"
|
||||
v-for="(item,index) in week_list_next_co" :key="index" v-if="index<6">
|
||||
<view class="dd" @click="item_click(vo,index,key)" v-for="(vo,key) in item" :key="key">
|
||||
<view class="num"
|
||||
:class="[vo.today ? 'today' : '',vo.type == 'month' ? 'month' : (retract ? '' : 'disabled')]">
|
||||
{{customDate==currenDate&&vo.today?'今':vo.day}}
|
||||
</view>
|
||||
<view v-show="vo.dot && (vo.type == 'month' || retract)" class="dot"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="open" class="tagWidth">
|
||||
<uni-icons type="bottom" v-if="retract" size="16"></uni-icons>
|
||||
<uni-icons type="top" v-else size="16"></uni-icons>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
formatTime
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: '',
|
||||
},
|
||||
dot_lists: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
hidden: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
customDate: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dateTime:'',
|
||||
currenDate: formatTime(new Date()).split(' ')[0], //今天的日期
|
||||
debug: false,
|
||||
week: ['日', '一', '二', '三', '四', '五', '六'],
|
||||
week_list: [],
|
||||
week_list_prev: [],
|
||||
week_list_prev_week: [],
|
||||
week_list_next: [],
|
||||
week_list_next_week: [],
|
||||
now_date: '',
|
||||
start_date: '',
|
||||
end_date: '',
|
||||
prev_date: '',
|
||||
next_date: '',
|
||||
nowYear: '',
|
||||
nowMonth: '',
|
||||
nowDay: '',
|
||||
retract: true,
|
||||
to_week_index: 0,
|
||||
to_prev_week_index: 0,
|
||||
to_next_week_index: 0,
|
||||
nowTime: 0,
|
||||
dot_list: [],
|
||||
current: 1,
|
||||
date: '',
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(value) {
|
||||
this.get_date(this.date_parse(value));
|
||||
},
|
||||
|
||||
|
||||
dot_lists: {
|
||||
immediate: true,
|
||||
handler(value) {
|
||||
|
||||
this.dot_list = value;
|
||||
this.set_doc_lists_update()
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
computed: {
|
||||
week_list_prev_co() {
|
||||
return this.retract ? this.week_list_prev_week : this.week_list_prev
|
||||
},
|
||||
week_list_next_co() {
|
||||
return this.retract ? this.week_list_next_week : this.week_list_next
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
change(item, key) {
|
||||
let value = {
|
||||
fulldate: this.date.replace(/-(\d)(?!\d)/g, '-0$1'),
|
||||
item
|
||||
};
|
||||
|
||||
this.$emit('change', value, key)
|
||||
},
|
||||
init() {
|
||||
console.log(this.value)
|
||||
if (this.value) {
|
||||
this.get_date(this.date_parse(this.value));
|
||||
} else {
|
||||
this.get_date();
|
||||
}
|
||||
|
||||
this.doc_list_update();
|
||||
this.update_month();
|
||||
|
||||
},
|
||||
open() {
|
||||
this.retract = !this.retract;
|
||||
this.get_date(this.nowTime);
|
||||
this.set_to_day('week_list_prev')
|
||||
this.set_to_day('week_list_next')
|
||||
|
||||
this.change_week();
|
||||
|
||||
if (this.retract) {
|
||||
this.update_swiper_item('week')
|
||||
} else {
|
||||
this.update_swiper_item('month')
|
||||
}
|
||||
this.set_doc_lists_update();
|
||||
},
|
||||
change_week() {
|
||||
|
||||
if (this.to_week_index < this.week_list.length - 1) {
|
||||
this.to_next_week_index = this.to_week_index + 1;
|
||||
this.week_list_next_week = this.week_list;
|
||||
} else {
|
||||
this.to_next_week_index = 0;
|
||||
this.week_list_next_week = this.week_list_next;
|
||||
}
|
||||
|
||||
if (this.to_week_index == 0) {
|
||||
|
||||
this.update_month();
|
||||
|
||||
// if(){
|
||||
let next_day = this.week_list_prev[this.week_list_prev.length - 1][6].day;
|
||||
|
||||
// }
|
||||
this.to_prev_week_index = this.week_list_prev.length - 1 - Math.ceil(next_day / 7);
|
||||
|
||||
this.week_list_prev_week = JSON.parse(JSON.stringify(this.week_list_prev));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
this.to_prev_week_index = this.to_week_index - 1;
|
||||
this.week_list_prev_week = this.week_list;
|
||||
}
|
||||
|
||||
// if(this.current == 1){
|
||||
|
||||
// }
|
||||
// let to_week_index = this.to_week_index;
|
||||
// if(this.current == 2){
|
||||
// this.to_next_week_index = this.to_week_index;
|
||||
// this.to_week_index = this.to_week_index - 1;
|
||||
// this.to_prev_week_index = this.to_next_week_index + 1;
|
||||
// }else if(this.current == 0){
|
||||
// this.to_next_week_index = this.to_week_index;
|
||||
// this.to_week_index = this.to_week_index - 1;
|
||||
// this.to_prev_week_index = this.to_next_week_index + 1;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
change_date_week(type) {
|
||||
let week_list = this.week_list;
|
||||
let to_week_index = this.to_week_index;
|
||||
if (type == 'prev') {
|
||||
this.to_week_index = this.to_prev_week_index;
|
||||
this.to_prev_week_index = this.to_next_week_index
|
||||
this.to_next_week_index = to_week_index;
|
||||
|
||||
this.week_list = this.week_list_prev_week
|
||||
this.week_list_prev_week = this.week_list_next_week;
|
||||
this.week_list_next_week = week_list;
|
||||
|
||||
|
||||
|
||||
} else if (type == 'next') {
|
||||
this.to_week_index = this.to_next_week_index;
|
||||
this.to_next_week_index = this.to_prev_week_index
|
||||
this.to_prev_week_index = to_week_index;
|
||||
|
||||
this.week_list = this.week_list_next_week
|
||||
this.week_list_next_week = this.week_list_prev_week;
|
||||
this.week_list_prev_week = week_list;
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.set_to_day_all();
|
||||
},
|
||||
change_date_month(type) {
|
||||
let week_list = this.week_list;
|
||||
if (type == 'prev') {
|
||||
this.week_list = this.week_list_prev
|
||||
this.week_list_prev = this.week_list_next;
|
||||
this.week_list_next = week_list;
|
||||
} else if (type == 'next') {
|
||||
this.week_list = this.week_list_next
|
||||
this.week_list_next = this.week_list_prev;
|
||||
this.week_list_prev = week_list;
|
||||
}
|
||||
},
|
||||
change_date(e) {
|
||||
|
||||
|
||||
let primary_current = this.current
|
||||
let current = e.detail.current;
|
||||
|
||||
this.current = current;
|
||||
|
||||
|
||||
|
||||
|
||||
if (primary_current - current == -1 || primary_current - current == 2) {
|
||||
|
||||
if (this.retract) {
|
||||
this.switch_month_week('next')
|
||||
this.change_week()
|
||||
if (primary_current - current == -1 && current != 1) {
|
||||
this.change_date_week('prev')
|
||||
} else if (primary_current - current == 2) {
|
||||
this.change_date_week('next')
|
||||
}
|
||||
} else {
|
||||
this.get_date(this.get_month('next'));
|
||||
this.update_month();
|
||||
if (primary_current - current == -1 && current != 1) {
|
||||
this.change_date_month('prev')
|
||||
} else if (primary_current - current == 2) {
|
||||
this.change_date_month('next')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.retract) {
|
||||
this.switch_month_week('prev')
|
||||
this.change_week()
|
||||
if (primary_current - current == 1 && current != 1) {
|
||||
this.change_date_week('next')
|
||||
} else if (primary_current - current == -2) {
|
||||
this.change_date_week('prev')
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
this.get_date(this.get_month('prev'));
|
||||
this.update_month();
|
||||
if (primary_current - current == 1 && current != 1) {
|
||||
this.change_date_month('next')
|
||||
} else if (primary_current - current == -2) {
|
||||
this.change_date_month('prev')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.set_to_day_all();
|
||||
this.set_doc_lists_update();
|
||||
this.change()
|
||||
},
|
||||
update_month() {
|
||||
this.get_date(this.get_month('prev'), 'prev');
|
||||
this.get_date(this.get_month('next'), 'next');
|
||||
},
|
||||
set_doc_lists_update() {
|
||||
this.doc_list_update('week_list');
|
||||
this.doc_list_update('week_list_prev');
|
||||
this.doc_list_update('week_list_next');
|
||||
this.doc_list_update('week_list_prev_week')
|
||||
this.doc_list_update('week_list_next_week')
|
||||
},
|
||||
doc_list_update(week_list = 'week_list') {
|
||||
let list = [];
|
||||
|
||||
this[week_list].map((item, index) => {
|
||||
list.push(item.map((vo, key) => {
|
||||
if (this.dot_list.indexOf(vo.date) > -1 || this.dot_list.indexOf(vo.date
|
||||
.replace(/-(\d)(?!\d)/g, '-0$1')) > -1) {
|
||||
vo.dot = true;
|
||||
|
||||
} else {
|
||||
vo.dot = false;
|
||||
}
|
||||
return {
|
||||
...vo
|
||||
}
|
||||
}))
|
||||
})
|
||||
this[week_list] = list;
|
||||
},
|
||||
set_to_day(type) {
|
||||
let list = [];
|
||||
|
||||
this[type].map((item, index) => {
|
||||
list.push(item.map((vo, key) => {
|
||||
if (vo.date == `${this.date}`) {
|
||||
vo.today = true;
|
||||
} else {
|
||||
vo.today = false;
|
||||
}
|
||||
return {
|
||||
...vo
|
||||
};
|
||||
}))
|
||||
})
|
||||
this[type] = list;
|
||||
},
|
||||
item_click(item, item_index = -1) {
|
||||
|
||||
if (!this.retract && item.type !== 'month') {
|
||||
return false;
|
||||
}
|
||||
this.date = item.date;;
|
||||
if (item.type == 'month') {
|
||||
this.nowDay = item.day;
|
||||
if (item_index >= 0) this.to_week_index = item_index;
|
||||
|
||||
} else if (this.retract) {
|
||||
this.nowDay = item.day;
|
||||
}
|
||||
|
||||
let now_arr = item.date.split('-')
|
||||
this.nowYear = now_arr[0];
|
||||
this.nowMonth = now_arr[1];
|
||||
this.nowDay = now_arr[2];
|
||||
|
||||
this.set_to_day_all(item_index);
|
||||
|
||||
this.nowTime = this.date_parse(`${item.date}`);
|
||||
|
||||
this.change(item, 3)
|
||||
this.set_doc_lists_update();
|
||||
|
||||
},
|
||||
set_to_day_all(item_index) {
|
||||
this.set_to_day('week_list')
|
||||
this.set_to_day('week_list_prev')
|
||||
this.set_to_day('week_list_next')
|
||||
this.set_to_day('week_list_prev_week')
|
||||
this.set_to_day('week_list_next_week')
|
||||
|
||||
},
|
||||
get_month(type) {
|
||||
let nowMonth = this.nowMonth;
|
||||
let nowYear = this.nowYear;
|
||||
let nowDay = this.nowDay;
|
||||
|
||||
if (type == 'prev') {
|
||||
if (nowMonth == 1) {
|
||||
nowMonth = 12;
|
||||
nowYear = nowYear - 1;
|
||||
} else {
|
||||
nowMonth--;
|
||||
}
|
||||
} else if (type == 'next') {
|
||||
if (nowMonth == 12) {
|
||||
nowMonth = 1;
|
||||
nowYear = nowYear + 1;
|
||||
} else {
|
||||
nowMonth++;
|
||||
}
|
||||
}
|
||||
|
||||
let days = this.get_month_days(nowMonth, nowYear);
|
||||
if (nowDay > days) {
|
||||
nowDay = days;
|
||||
}
|
||||
|
||||
return this.date_parse(`${nowYear}-${nowMonth}-${nowDay}`);
|
||||
},
|
||||
|
||||
date_parse(str) {
|
||||
return Date.parse(str.replace(/-(\d)(?!\d)/g, '-0$1'));
|
||||
},
|
||||
switch_month_week(type = 'next', update_week = false) {
|
||||
if (this.retract) {
|
||||
if (type == 'prev') {
|
||||
this.get_date(this.nowTime - 86400 * 7 * 1000);
|
||||
} else if (type == 'next') {
|
||||
this.get_date(this.nowTime + 86401 * 7 * 1000);
|
||||
}
|
||||
if (update_week) {
|
||||
this.update_swiper_item('week');
|
||||
this.set_doc_lists_update();
|
||||
}
|
||||
} else {
|
||||
this.get_date(this.get_month(type))
|
||||
this.update_swiper_item('month');
|
||||
}
|
||||
this.set_doc_lists_update();
|
||||
|
||||
this.set_to_day_all();
|
||||
|
||||
if (update_week) {
|
||||
this.change(type)
|
||||
}
|
||||
|
||||
},
|
||||
update_swiper_item(type = 'month') {
|
||||
if (type == 'month') {
|
||||
if (this.current == 0) {
|
||||
this.change_date_month('next')
|
||||
} else if (this.current == 2) {
|
||||
this.change_date_month('prev')
|
||||
}
|
||||
} else if (type == 'week') {
|
||||
|
||||
if (this.current == 0) {
|
||||
this.change_date_week('next')
|
||||
} else if (this.current == 2) {
|
||||
this.change_date_week('prev')
|
||||
}
|
||||
}
|
||||
},
|
||||
next() {
|
||||
this.get_date(this.next_date)
|
||||
},
|
||||
get_date(value = this.customDate, type = 'same') {
|
||||
let date = new Date();
|
||||
if (value) {
|
||||
date = new Date(value);
|
||||
}
|
||||
let nowMonth = date.getMonth() + 1,
|
||||
nowYear = date.getFullYear(),
|
||||
nowDay = date.getDate(),
|
||||
nowTime = date.getTime(),
|
||||
nowWeek = date.getDay();
|
||||
|
||||
|
||||
let days = this.get_month_days(nowMonth, nowYear);
|
||||
let start_date = new Date(nowYear, nowMonth - 1, 1);
|
||||
let end_date = new Date(nowYear, nowMonth - 1, days);
|
||||
let prev_date = new Date(start_date.getTime() - 1);
|
||||
let prev_date_days = prev_date.getDate();
|
||||
let next_date = new Date(end_date.getTime() + 86401 * 1000);
|
||||
let next_date_days = next_date.getDate();
|
||||
let start_week = start_date.getDay();
|
||||
let date_arrs = [];
|
||||
|
||||
let week_list = [];
|
||||
let count_days = 35;
|
||||
|
||||
for (let i = prev_date_days - start_week + 1; i <= prev_date_days; i++) {
|
||||
date_arrs.push({
|
||||
day: i,
|
||||
type: 'prev',
|
||||
date: `${prev_date.getFullYear()}-${prev_date.getMonth()+1}-${i}`
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 1; i <= days; i++) {
|
||||
date_arrs.push({
|
||||
day: i,
|
||||
type: 'month',
|
||||
today: i == nowDay ? true : false,
|
||||
date: `${nowYear}-${nowMonth}-${i}`
|
||||
})
|
||||
|
||||
if (i == nowDay && type == 'same') {
|
||||
this.date = `${nowYear}-${nowMonth}-${i}`;
|
||||
}
|
||||
|
||||
}
|
||||
if (this.debug) console.log(value, date, this.date,
|
||||
`${next_date.getFullYear()}-${next_date.getMonth()+1}-${next_date.getDate()}`)
|
||||
let date_arrs_length = date_arrs.length;
|
||||
|
||||
// if(date_arrs_length > 35){
|
||||
count_days = 42;
|
||||
// }
|
||||
for (let i = 1; i <= count_days - date_arrs_length; i++) {
|
||||
date_arrs.push({
|
||||
day: i,
|
||||
type: 'next',
|
||||
date: `${next_date.getFullYear()}-${next_date.getMonth()+1}-${i}`
|
||||
})
|
||||
}
|
||||
|
||||
for (let i = 0; i < date_arrs.length / 7; i++) {
|
||||
let arr = [];
|
||||
for (let j = 0; j < 7; j++) {
|
||||
|
||||
if (date_arrs[i * 7 + j].today) {
|
||||
if (type == 'same') {
|
||||
this.to_week_index = i
|
||||
}
|
||||
}
|
||||
arr.push(date_arrs[i * 7 + j]);
|
||||
}
|
||||
week_list.push(arr);
|
||||
}
|
||||
|
||||
if (type == 'same') {
|
||||
this.week_list = week_list;
|
||||
this.nowYear = nowYear;
|
||||
this.nowMonth = nowMonth;
|
||||
this.nowDay = nowDay;
|
||||
this.nowTime = nowTime;
|
||||
this.start_date = start_date;
|
||||
this.end_date = end_date;
|
||||
this.prev_date = prev_date;
|
||||
this.next_date = next_date;
|
||||
|
||||
|
||||
} else if (type == 'prev') {
|
||||
this.week_list_prev = week_list;
|
||||
} else if (type == 'next') {
|
||||
this.week_list_next = week_list;
|
||||
}
|
||||
|
||||
},
|
||||
get_month_days(nowMonth, nowYear) {
|
||||
let month_arr = [1, 3, 5, 7, 8, 10, 12];
|
||||
let days = 0;
|
||||
if (nowMonth == 2) {
|
||||
if (nowYear % 4 == 0) {
|
||||
days = 29;
|
||||
} else {
|
||||
days = 28;
|
||||
}
|
||||
} else if (month_arr.indexOf(nowMonth) >= 0) {
|
||||
days = 31;
|
||||
} else {
|
||||
days = 30;
|
||||
}
|
||||
return days;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import (less) '../../static/lx-calendar/fonts/iconfont.css';
|
||||
|
||||
@color: #FE8025;
|
||||
@color_disabled: #f1f1f1;
|
||||
@color_standard: #333;
|
||||
@color_border: #f5f5f5;
|
||||
|
||||
.date {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 40rpx;
|
||||
border-bottom: 1rpx solid @color_border;
|
||||
color: @color_standard;
|
||||
|
||||
.title {
|
||||
width: 200rpx;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
color: #112950;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: block;
|
||||
|
||||
.next {
|
||||
transform: rotate(180deg);
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.retract {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 50rpx;
|
||||
;
|
||||
|
||||
.iconfont {
|
||||
transform: rotate(270deg);
|
||||
|
||||
&.retract_icon {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
margin-top: -12rpx;
|
||||
}
|
||||
|
||||
.date_dl {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
|
||||
.dd {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
height: 80rpx;
|
||||
font-size: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
.num {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 35%;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
|
||||
&.disabled {
|
||||
color: @color_disabled;
|
||||
}
|
||||
|
||||
&.month {
|
||||
color: @color_standard;
|
||||
}
|
||||
|
||||
&.today {
|
||||
background: @color;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 50%;
|
||||
background: @color;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 30rpx;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,42 @@
|
|||
<template>
|
||||
<view class="history-false" :style="{'margin-top':marginTop+'%','padding-top':paddingTop+'%'}">
|
||||
<view class="flex-conter">
|
||||
<image src="https://shayu5qny.yhy.ren/selfRegistration/nothing.png"></image>
|
||||
</view>
|
||||
<!-- <view>{{context}}</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
context: {
|
||||
type: String,
|
||||
default: '暂无数据~'
|
||||
},
|
||||
marginTop:{
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
paddingTop:{
|
||||
type: Number,
|
||||
default: 50
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.history-false {
|
||||
image {
|
||||
width: 512rpx;
|
||||
height: 512rpx;
|
||||
}
|
||||
|
||||
view {
|
||||
font-size: 28upx;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,50 @@
|
|||
# 日历组件 lx-calendar可选择周与月支持左右滑动切换
|
||||
|
||||
|
||||
```
|
||||
<template>
|
||||
<view class="content">
|
||||
|
||||
<lxCalendar @change="change"></lxCalendar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import lxCalendar from '../../components/lx-calendar/lx-calendar.vue'
|
||||
export default {
|
||||
components:{
|
||||
lxCalendar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: 'Hello'
|
||||
}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
change(e){
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
|
||||
事件 | 说明
|
||||
---|---
|
||||
change | 日期改变时执行
|
||||
|
||||
参数 | 类型 | 说明
|
||||
---|---|---
|
||||
value | 字符串 | 选中的日期
|
||||
dot_lists | 数组 | 显示点的日期
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import API from '/api/index.js'
|
||||
import SMOKE from '/api/smoke.js'
|
||||
import REGIST from '/api/regist.js'
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$API = API
|
||||
Vue.prototype.$SMOKE = SMOKE
|
||||
Vue.prototype.$REGIST = REGIST
|
||||
App.mpType = 'app'
|
||||
Vue.prototype.$preventClick = function(times = 2000) { // 防抖
|
||||
if (this._CLICK) return true;
|
||||
this._CLICK = true
|
||||
setTimeout(() => this._CLICK = false, times)
|
||||
}
|
||||
const app = new Vue({
|
||||
...App
|
||||
})
|
||||
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
|
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
"name" : "",
|
||||
"appid" : "__UNI__8AEA607",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
/* 5+App特有相关 */
|
||||
"usingComponents" : true,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
"modules" : {},
|
||||
/* 模块配置 */
|
||||
"distribute" : {
|
||||
/* 应用发布信息 */
|
||||
"android" : {
|
||||
/* android打包配置 */
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
"ios" : {},
|
||||
/* ios打包配置 */
|
||||
"sdkConfigs" : {}
|
||||
}
|
||||
},
|
||||
/* SDK配置 */
|
||||
"quickapp" : {},
|
||||
/* 快应用特有相关 */
|
||||
"mp-weixin" : {
|
||||
/* 微信小程序特有相关 */
|
||||
"appid" : "",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-qq" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"h5" : {
|
||||
"router" : {
|
||||
"base" : "test-risk-assessment"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,362 @@
|
|||
{
|
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/detail/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "评估详情页"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/psychological-assessment/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "心理评估"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/psychological-assessment/result/result",
|
||||
"style": {
|
||||
"navigationBarTitleText": "评估报告"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/health-risks/basicReport/basicReport",
|
||||
"style": {
|
||||
"navigationBarTitleText": "生活方式评估报告"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/health-risks/evaluationResults/evaluationResults",
|
||||
"style": {
|
||||
"navigationBarTitleText": "评估报告"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/health-risks/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "评估问卷"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/health-risks/guideDetails/guideDetails",
|
||||
"style": {
|
||||
"navigationBarTitleText": "指南详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/plan-questionnaire/diseaseIndex/diseaseIndex",
|
||||
"style": {
|
||||
"navigationBarTitleText": "问卷"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/plan-questionnaire/psychologicalIndex/psychologicalIndex",
|
||||
"style": {
|
||||
"navigationBarTitleText": "问卷"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/plan-questionnaire/planningReport/planningReport",
|
||||
"style": {
|
||||
"navigationBarTitleText": "评估报告",
|
||||
"onReachBottomDistance": 50
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/plan-questionnaire/moodRequest/moodRequest",
|
||||
"style": {
|
||||
"navigationBarTitleText": "评估报告",
|
||||
"onReachBottomDistance": 50
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
"globalStyle": {
|
||||
"navigationBarTitleText": "鲨鱼云康",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"subPackages": [{
|
||||
"root": "pages/quitSmoking",
|
||||
"pages": [{
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "戒烟圈"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "smokingDiary/smokingDiary",
|
||||
"style": {
|
||||
"navigationBarTitleText": "戒烟日记",
|
||||
"onReachBottomDistance": 50
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "smokingTips/smokingTips",
|
||||
"style": {
|
||||
"navigationBarTitleText": "时光穿梭"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "statistics/statistics",
|
||||
"style": {
|
||||
"navigationBarTitleText": "烟瘾数据统计"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "smokingSituation/smokingSituation",
|
||||
"style": {
|
||||
"navigationBarTitleText": "吸烟情况"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "recoveryScore/recoveryScore",
|
||||
"style": {
|
||||
"navigationBarTitleText": "健康恢复评分"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "result/result",
|
||||
"style": {
|
||||
"navigationBarTitleText": "尼古丁依赖程度"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "content/content",
|
||||
"style": {
|
||||
"navigationBarTitleText": "填写内容"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "evaluationRecord/evaluationRecord",
|
||||
"style": {
|
||||
"navigationBarTitleText": "评估记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "timeTravel/timeTravel",
|
||||
"style": {
|
||||
"navigationBarTitleText": "时光穿梭"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "question/question",
|
||||
"style": {
|
||||
"navigationBarTitleText": "问卷"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "scriptsList/scriptsList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "秘籍"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "scriptsLearn/scriptsLearn",
|
||||
"style": {
|
||||
"navigationBarTitleText": "学习"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "scriptsDetail/scriptsDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "cessationData/cessationData",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的戒烟数据"
|
||||
}
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"root": "pages/selfRegistration",
|
||||
"pages": [{
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "问卷调查"
|
||||
}
|
||||
}, {
|
||||
"path": "templateSelection/templateSelection",
|
||||
"style": {
|
||||
"navigationBarTitleText": "任务选择"
|
||||
}
|
||||
}, {
|
||||
"path": "editTemplate/editTemplate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "编辑任务"
|
||||
}
|
||||
}, {
|
||||
"path": "actionList/actionList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "行动列表"
|
||||
}
|
||||
}, {
|
||||
"path": "planningCycle/planningCycle",
|
||||
"style": {
|
||||
"navigationBarTitleText": "计划周期"
|
||||
}
|
||||
}, {
|
||||
"path": "dailyTasks/dailyTasks",
|
||||
"style": {
|
||||
"navigationBarTitleText": "每日任务"
|
||||
}
|
||||
}, {
|
||||
"path": "planDiary/planDiary",
|
||||
"style": {
|
||||
"navigationBarTitleText": "计划日记",
|
||||
"onReachBottomDistance": 50
|
||||
}
|
||||
}, {
|
||||
"path": "content/content",
|
||||
"style": {
|
||||
"navigationBarTitleText": "填写内容"
|
||||
}
|
||||
}, {
|
||||
"path": "eventRecording/eventRecording",
|
||||
"style": {
|
||||
"navigationBarTitleText": "事件记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "planningReport/planningReport",
|
||||
"style": {
|
||||
"navigationBarTitleText": "计划报告"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/selfRegistration2",
|
||||
"pages": [{
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "问卷调查"
|
||||
}
|
||||
}, {
|
||||
"path": "templateSelection/templateSelection",
|
||||
"style": {
|
||||
"navigationBarTitleText": "任务选择"
|
||||
}
|
||||
}, {
|
||||
"path": "actionList/actionList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "行动列表"
|
||||
}
|
||||
}, {
|
||||
"path": "planningCycle/planningCycle",
|
||||
"style": {
|
||||
"navigationBarTitleText": "计划周期"
|
||||
}
|
||||
}, {
|
||||
"path": "dailyTasks/dailyTasks",
|
||||
"style": {
|
||||
"navigationBarTitleText": "每日任务"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "aplanning/aplanning",
|
||||
"style": {
|
||||
"navigationBarTitleText": "创建自主计划活动"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/agreement",
|
||||
"pages": [{
|
||||
"path": "userAgreement",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户协议"
|
||||
}
|
||||
}, {
|
||||
"path": "privacyPolicy",
|
||||
"style": {
|
||||
"navigationBarTitleText": "隐私政策"
|
||||
}
|
||||
}, {
|
||||
"path": "serviceAgreement",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员服务协议"
|
||||
}
|
||||
}, {
|
||||
"path": "children",
|
||||
"style": {
|
||||
"navigationBarTitleText": "儿童隐私协议"
|
||||
}
|
||||
}, {
|
||||
"path": "web-view",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"root": "pages/reports",
|
||||
"pages": [{
|
||||
"path": "reports",
|
||||
"style": {
|
||||
"navigationBarTitleText": "报告分析"
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
"root": "pages/scanCodeEvaluation",
|
||||
"pages": [{
|
||||
"path": "detail/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "生活方式评估"
|
||||
}
|
||||
},{
|
||||
"path": "health-risks/basicReport/basicReport",
|
||||
"style": {
|
||||
"navigationBarTitleText": "生活方式报告"
|
||||
}
|
||||
},{
|
||||
"path": "health-risks/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "生活方式评估"
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
"root": "pages/hairtailScreen",
|
||||
"pages": [{
|
||||
"path": "bestFood/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "最佳食物"
|
||||
}
|
||||
},{
|
||||
"path": "bestFood/detail/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},{
|
||||
"path": "foodIngredients/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},{
|
||||
"path": "foodIngredients/detail/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},{
|
||||
"path": "exchangePortion/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},{
|
||||
"path": "exchangePortion/detail/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}
|
|
@ -0,0 +1,171 @@
|
|||
<template>
|
||||
<div class="contioner">
|
||||
<h3 class="cneter">鲨鱼云康儿童个人信息保护规则及监护人须知</h3>
|
||||
<p>本政策仅适用于湖南鲨鱼健康有限公司
|
||||
的鲨鱼云康App提供的产品或服务,包括您访问鲨鱼云康App使用平台提供的服务。</p>
|
||||
<p>版本生效日期:2024年01月15日</p>
|
||||
<p>最近更新日期:2024年01月15日</p>
|
||||
<p>湖南鲨鱼健康有限公司(“鲨鱼云康”或“我们”)深知儿童(指未满十四周岁的未成年人,下同)个人信息和隐私安全的重要性。
|
||||
在《鲨鱼云康隐私政策》的基础上,我们希望通过《鲨鱼云康儿童个人信息保护规则及监护人须知》(以下简称“本政策”)说明我们在收集和使用儿童个人信息时对应的处理规则等相关事宜。
|
||||
您作为您孩子的父母或其他监护人 ((1)法定监护人,(2)指定监护人, (3)遗嘱监护人,(4)委托监护人,以下统称为“监护人”),
|
||||
请在您或您孩子使用鲨鱼云康产品及服务(定义详见《鲨鱼云康隐私政策》)前务必仔细阅读并透彻理解本政策,在确认充分理解并同意全部条款后再开始使用或允许您的孩子使用。</p>
|
||||
<p>目录</p>
|
||||
<p>一、我们如何收集和使用儿童个人信息</p>
|
||||
<p>二、我们如何共享、转让、公开披露儿童个人信息</p>
|
||||
<p>三、我们如何储存儿童个人信息</p>
|
||||
<p>四、我们如何保护儿童个人信息</p>
|
||||
<p>五、本政策的修订</p>
|
||||
<p>六、如何联系我们</p>
|
||||
<p>监护人特别说明<p>
|
||||
<p>监护人,是指对无民事行为能力人和限制民
|
||||
事行为能力人的人身、财产和其他一切合法权益
|
||||
负有监护职责的人。您需要理解和配合我们,确
|
||||
保您的孩子在您的同意和指导下使用鲨鱼云康服务
|
||||
和向我们提交个人信息。我们将根据本政策采取
|
||||
特殊措施保护我们获得的您孩子的个人信息。如
|
||||
果您不同意本政策的内容,请您要求您的孩子立
|
||||
即停止访问或使用鲨鱼云康产品及服务。<p>
|
||||
<p>儿童特别说明<p>
|
||||
<p>本政策中的儿童是指年龄不满14周岁的人
|
||||
员,任何儿童参加网上活动都应事先取得监护人
|
||||
的同意。如果您是儿童,请务必通知您的监护人
|
||||
共同阅读本政策,并在您使用鲨鱼云康服务、提交
|
||||
个人信息之前,寻求您的监护人的同意和指导。
|
||||
本政策适用于我们在中华人民共和国境内通
|
||||
过网络从事收集、存储、使用、转移、分享和披
|
||||
露儿童个人信息等活动,包含鲨鱼云康App、鲨鱼云康
|
||||
小程序、鲨鱼云康或鲨鱼云康关联公司物联网家电设
|
||||
备、网站及微信小程序等。本政策为在《鲨鱼云康
|
||||
隐私政策》基础上制定的特别规则,与《鲨鱼云康
|
||||
隐私政策》如有不一致之处,以本规则为准
|
||||
本规则未载明之处,则参照适用《鲨鱼云康隐私政
|
||||
策》。<p>
|
||||
<p>在阅读完本政策后,如对本政策或与本政策
|
||||
相关的事宜有任何问题,可通过本政策“六、如
|
||||
何联系我们”章节所列的反馈渠道联系我们,我
|
||||
们会尽快作出解答。<p>
|
||||
<h3>一、我们如何收集和使用儿童个人信息</h3>
|
||||
<p>(一)我们会严格履行法律法规规定的儿童个人信息保护义务与责任,遵循正当必要、知情同意、目的明确、安全保障、依法利用的原则在征得监护人的同意后收集和使用儿童个人信息:</p>
|
||||
<p>1、为了更好地保护儿童的权益,我们可能向监护
|
||||
人收集更多信息(例如姓名、身份证、户口本或
|
||||
其他监护关系证明),以便进一步验证监护人与
|
||||
儿童的监护关系。</p>
|
||||
<p>2、您在使用鲨鱼云康服务中主动向我们提供您孩子
|
||||
的个人信息,例如您在我们为您提供的评论、社
|
||||
区及其他信息发布功能下分享的您孩子的照片或
|
||||
视频,视为您已经同意我们收集和按照本政策的
|
||||
内容收集和使用您孩子的个人信息。</p>
|
||||
<p>(二)您或您的孩子在使用鲨鱼云康服务过程
|
||||
中,我们为向您或者您的孩子提供鲨鱼云康服务
|
||||
提供个性化展示或推荐以及为您的账户提供安全
|
||||
保障等目的,我们可能还会收集和使用其他儿童
|
||||
个人信息有关具休的使用目的,收集个人信息
|
||||
的范围以及拒绝提供相应信息的后果请您查阅
|
||||
《鲨鱼云康隐私政策》
|
||||
“一、我们如何收集和使用
|
||||
您的个人信息”章节进行详细了解。此外,我们
|
||||
也会通过Cookies、SDK等同类技术自动收集您
|
||||
或您孩子的个人信息,具体请您查阅《鲨鱼云康隐私政策》“五、我们如何使用 Cookie 和同类技
|
||||
术”进行详细了解。如我们需要超出上述范围收
|
||||
集和使用儿童个人信息,我们将再次征得监护人
|
||||
的同意。</p>
|
||||
<p>请您注意,某些情形下我们将无法识别收集
|
||||
和处理的个人信息是否属于儿童个人信息,比如
|
||||
通过计算机信息系统自动留存处理信息且无法识
|
||||
别所留存处理的信息属于儿童个人信息的(如在
|
||||
匿名浏览过程中的浏览记录等)等我们将按照
|
||||
《鲨鱼云康隐私政策》收集和处理用户的个人信
|
||||
息。</p>
|
||||
<p>(三)征得授权同意的例外</p>
|
||||
<p>根据相关法律法规规定,以下情形中收集儿
|
||||
童的信息无需征得儿童监护人的授权同意:</p>
|
||||
<p>(1)与我们履行法律法规规定的义务相关的;</p>
|
||||
<p>(2)与国家安全、国防安全、公共安全、公共卫
|
||||
生、重大公共利益有关的;</p>
|
||||
<p>(3)与犯罪侦查、起诉、审判和判决执行等有关
|
||||
的;</p>
|
||||
<p>(4)出于维护儿童、您或其他个人的生命、财
|
||||
产等重大合法权益但又很难得到您本人同意的;</p>
|
||||
<p>(5)所收集的信息是儿童或监护人自行向社会公
|
||||
众公开的;</p>
|
||||
<p>(6)从合法公开披露的信息中收集信息的,如合
|
||||
法的新闻报道、政府信息公开等渠道;</p>
|
||||
<p>(7)根据与您或您的孩子签订和履行相关协议或
|
||||
其他书面文件所必需的;</p>
|
||||
<p>(8)用于维护鲨鱼云康服务的安全稳定运行所必需的,例如发现、处置鲨鱼云康服务的故障;</p>
|
||||
<p>(9)学术研究机构基于公共利益开展统计或学术
|
||||
研究所必要,且对外提供学术研究或描述的结果
|
||||
时,对结果中所包含的信息进行去标识化处理
|
||||
的;</p>
|
||||
<p>(10)法律法规规定的其他情形。</p>
|
||||
<h3>二、我们如何共享、转让、公开披露您的个人信息</h3>
|
||||
<p>我们承诺对儿童个人信息进行严格保密,仅在符合本政策说明和您明确授权同意的情况下对外共享儿童个人信息。
|
||||
为了提升信息处理效率降低信息处理成本,或提高信息处理准确性,我们可能会委托有能力的我们的关联公司或其他专业机构代表我们来处理儿童个人信息,
|
||||
具体请参见《鲨鱼云康隐私政策》“我们如何共享、转让、公开披露您的信息”部分。</p>
|
||||
<p>(一)如果为了本政策所述目的而需要将儿
|
||||
童个人信息共享至第三方,我们将评估该第三方
|
||||
收集儿童个人信息的合法性、正当性、必要性。</p>
|
||||
<p>(二)我们将要求第三方对儿童个人信息采
|
||||
取保护措施,并且严格遵守相关法律法规与监管
|
||||
要求。我们会要求接收儿童个人信息的第三方遵
|
||||
守严格的保密义务及采取有效的保密措施,禁止
|
||||
其将这些儿童个人信息用于未经儿童及其监护人
|
||||
授权的用途,并要求受托公司依法履行以下业务:</p>
|
||||
<p>1、按照法律、行政法规的规定和我们的要求处理儿童个人信息;</p>
|
||||
<p>2、协助我们回应儿童监护人提出的申请;</p>
|
||||
<p>3、采取措施保障信息安全,并在发生儿童个人信息泄露安全事件时,及时向我们反馈;</p>
|
||||
<p>4、委托关系解除时及时删除儿童个人信息;</p>
|
||||
<p>5、不得转委托;</p>
|
||||
<p>6、其他依法应当履行的儿童个人信息保护义务。</p>
|
||||
<p>(三)另外,我们会按照法律法规的要求征得您的同意,或确认第三方已经征得您同意。</p>
|
||||
<h3>三、我们如何储存儿童个人信息</h3>
|
||||
<p>(一)我们在中华人民共和国境内运营中收集和产生的儿童个人信息,将存储在中国境内。以下情形下,我们会在履行了法律规定的义务后,向境外的组织或个人提供儿童的个人信息:</p>
|
||||
<p>1、适用的法律有明确规定;</p>
|
||||
<p>2、获得您的明确授权;</p>
|
||||
<p>3、您或者您的孩子通过互联网进行跨境交易等个人主动行为。</p>
|
||||
<p>针对以上情形,我们会通过合同等形式确保以不低于本政策规定的程度保护儿童的个人信息。</p>
|
||||
<p>(二)我们会采取合理可行的措施,尽力避免收集和处理无关的儿童的个人信息。我们只会在达成本政策所述目的所需的期限内保留儿童的个人信息,
|
||||
除非法律有强制的留存要求。关于我们如何确定儿童个人信息存储期限请参见《鲨鱼云康隐私政策》“三、我们如何保护您的个人信息”。如我们终止服务或运营,
|
||||
我们将及时停止继续收集儿童个人信息的活动,同时会遵守相关法律法规要求提前向监护人通知,并在终止服务或运营后对儿童的个人信息进行删除或匿名化处理,
|
||||
但法律法规或监管部门另有规定的除外。</p>
|
||||
<h3>四、我们如何保护儿童个人信息</h3>
|
||||
<p>我们非常重视儿童的隐私安全,并采取一切合理可行的措施,保护儿童个人信息:</p>
|
||||
<p>(一)我们会严格控制儿童个人信息的访问权限,对可能接触到儿童个人信息的工作人员采取最小够用授权原则,并采取技术措施对工作人员处理儿童个人信息的行为进行记录和管控,避免违法复制、下载儿童个人信息。</p>
|
||||
<p>(二)我们已制定儿童个人信息安全事件应急预案,会定期组织内部相关人员进行应急响应培训和应急演练,使其掌握岗位职责和应急处置策略和规程。
|
||||
在不幸发生儿童个人信息安全事件后,我们将按照法律法规的要求,及时向儿童及其监护人告知:安全事件的基本情况和可能的影响、
|
||||
我们已采取或将要采取的处置措施、儿童及其监护人可自主防范和降低风险的建议、对儿童及其监护人的补救措施等。我们将及时将事件相关情况以APP推送通知、
|
||||
发送邮件/短消息等方式告知儿童及其监护人。难以逐一告知时,我们会采取合理、有效的方式发布相关警示信息。同时,我们还将按照监管部门要求,
|
||||
主动上报儿童个人信息安全事件的处置情况。若儿童及其监护人的合法权益受损,我们将承担相应的法律责任。</p>
|
||||
<p>(三)如您希望了解更多,请查阅《鲨鱼云康隐私政策》“三、我们如何保护您的个人信息”章节,详细了解我们如何采取了哪些措施保护儿童个人信息。</p>
|
||||
<h3>五、本政策的修订</h3>
|
||||
<p>我们可能会根据鲨鱼云康服务的更新情况及法律法规的相关要求适时修改本政策的条款,该等修改构成本政策的一部分,
|
||||
我们会在专门页面[鲨鱼云康客户端-我的-设置-关于鲨鱼云康-《隐私政策》对应链接中展示最新修改版本。
|
||||
由于鲨鱼云康的用户较多,对于重大变更,我们还会提供更为显著的通知(包括通过网站或客户端首页公示的方式进行通知甚至向您提供弹窗提示),
|
||||
具体详见《鲨鱼云康隐私政策》第八条“本政策如何更新”的规定。</p>
|
||||
<h3>六、如何联系我们</h3>
|
||||
<p>如您和您的孩子对本政策存在任何疑问,或对于儿童个人信息处理存在任何投诉、意见,请通过以下渠道联系我们,
|
||||
我们将在收到问题、意见或建议,并验证监护人和/或儿童身份后的十五天内回复您的请求:</p>
|
||||
<p>电子邮件: 841382055@qq.com</p>
|
||||
<p>电话: 400-833-3131</p>
|
||||
<p>注册地址:湖南省长沙市岳麓区梅溪湖街道泉水路461号长沙健康医疗大数据产业孵化基地3-1栋2楼201</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contioner {
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.cneter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
p {
|
||||
text-indent: 2rem;
|
||||
letter-spacing: 3px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,633 @@
|
|||
<template>
|
||||
<div class="contioner">
|
||||
<h3 class="cneter">鲨鱼云康隐私政策</h3>
|
||||
<p>本政策仅适用于湖南鲨鱼健康有限公司的鲨鱼云康App提供的产品或服务,包括您访问鲨鱼云康App使用平台提供的服务,湖南鲨鱼健康有限公司(“鲨鱼云康”或“湖南鲨鱼健康科技有限公司”)。</p>
|
||||
<p>最近更新日期: 2024年01月15日,版本号为V1.00</p>
|
||||
<p>版本生效日期: 2024年01月15日</p>
|
||||
<p>本政策将帮助您了解以下内容:</p>
|
||||
<p>一、政策声明</p>
|
||||
<p>二、湖南鲨鱼健康科技有限公司如何收集和使用您的个人信息</p>
|
||||
<p>三、湖南鲨鱼健康科技有限公司如何共享、转让、公开披露您的个人信息</p>
|
||||
<p>四、湖南鲨鱼健康科技有限公司如何保护您的个人信息</p>
|
||||
<p>五、湖南鲨鱼健康科技有限公司如何处理儿童的个人信息</p>
|
||||
<p>六、湖南鲨鱼健康科技有限公司如何使用 Cookie 和同类技术</p>
|
||||
<p>七、您的权利</p>
|
||||
<p>八、您的个人信息如何储存及超出储存期限处理办法</p>
|
||||
<p>九、本政策如何更新</p>
|
||||
<p>十、如何联系湖南鲨鱼健康科技有限公司</p>
|
||||
<p>
|
||||
湖南鲨鱼健康科技有限公司深知个人信息对您的重要性,并会尽全力
|
||||
保护您的个人信息安全可靠。湖南鲨鱼健康科技有限公司致力于维持您
|
||||
对湖南鲨鱼健康科技有限公司的信任,恪守以下原则,保护您的个人信
|
||||
息:权责一致原则、目的明确原则、选择同意原
|
||||
则、最少够用原则、确保安全原则、主体参与原
|
||||
则、公开透明原则。同时,鲨鱼云康承诺,湖南鲨鱼健康科技有限公司将按
|
||||
业界成熟的安全标准,采取相应的安全保护措施
|
||||
来保护您的个人信息
|
||||
</p>
|
||||
<h4>
|
||||
请在使用湖南鲨鱼健康科技有限公司的产品 (或服务) 前,仔细阅读
|
||||
并了解本《隐私政策》。并确保您已充分了解且
|
||||
同意湖南鲨鱼健康科技有限公司处理您个人信息的目的、方式和范围。
|
||||
</h4>
|
||||
<h3>一、政策声明</h3>
|
||||
<p>
|
||||
1.1本隐私政策适用于引用或链接本政策的与鲨鱼云康或鲨鱼云康相关联公司家电有关的设备、网站客户端、小程序,即鲨鱼云康App、鲨鱼云康小程序、鲨鱼云康或鲨鱼云康关联公司物联网家电设备、网站及微信小程序等。特别需要提醒你的是,鲨鱼云康App、鲨鱼云康小程序为统一帐号体系,您在两者中任意平台注册帐号,都可通过该帐号登录另一平台并享受相关服务。此外,需要特别说明的是,本协议不适用于第三方向您提供的服务,例如通过鲨鱼云康平台跳转到第三方网站、客户端或程序,您向该第三方服务商提供的个人信息不适用本协议
|
||||
</p>
|
||||
<h3>二、湖南鲨鱼健康科技有限公司如何收集和使用您的个人信息</h3>
|
||||
<p>
|
||||
个人信息是指以电子或者其他方式记录的能够
|
||||
单独或者与其他信息结合识别特定自然人身份或
|
||||
者反映特定自然人活动情况的各种信息。
|
||||
<h4>鲨鱼云康仅
|
||||
会出于本政策所述的以下目的,收集和使用您的
|
||||
个人信息。处理个人信息的目的包括:</h4>
|
||||
</p>
|
||||
<p>1.创建您的鲨鱼云康账号</p>
|
||||
<p>2.能够发现和对设备进行配网</p>
|
||||
<p>3能够控制和使用设备</p>
|
||||
<p>4.进行语音识别与控制</p>
|
||||
<p>5.提供基于地理位置的服务</p>
|
||||
<p>6.处理您的订单</p>
|
||||
<p>7.评估与分析App产品功能与服务情况</p>
|
||||
<p>8.进行通知或推送</p>
|
||||
<p>9.提供App安全保障</p>
|
||||
<p>10.其它鲨鱼云康服务</p>
|
||||
<p>
|
||||
<h4>如果处理个人信息的目的、方式和种类发生变
|
||||
更的,鲨鱼云康将重新取得您的同意。以下罗列某些
|
||||
特殊的个人信息属于个人敏感信息,如实时画面
|
||||
与录像信息,在提供前,您需要谨慎考虑,确保准确。</h4>鲨鱼云康会对敏感信息单独征得您的同意,并按国家要求加强安全保密处理。
|
||||
</p>
|
||||
<span>(一)您向湖南鲨鱼健康科技有限公司提供的信息</span>
|
||||
<p>
|
||||
当您注册鲨鱼云康账户及您在使用鲨鱼云康平台时提供
|
||||
的相关服务时填写及/或提交的信息,包括您的电话号码、电子邮箱。
|
||||
</p>
|
||||
<p>
|
||||
鲨鱼云康将通过鲨鱼云康页面向您展示需要您提交的信息,届时以页面展示为准,如果您不使用某些服务,则无需提供相关信息。对于您明确拒绝使用、关闭或退出的特定业务功能,App在您打开该业务功能或相关系统权限时将会再次询问您是否您是否同意开启相关权限,且App在更新升级后,不会更改原有的系统权限设置。
|
||||
</p>
|
||||
<span>(二)在您使用服务过程中收集的信息</span>
|
||||
<h4>
|
||||
为实现向您提供湖南鲨鱼健康科技有限公司产品及服务的附加功能您可以选择单独同意或不同意湖南鲨鱼健康科技有限公司收集、使用的信息。如您拒绝提供,您将无法正常使用相关附加功能或无法达到湖南鲨鱼健康科技有限公司拟达到的功能效果,不会影响您使用湖南鲨鱼健康科技有限公司的基本功能。
|
||||
</h4>
|
||||
<p>湖南鲨鱼健康科技有限公司收集您使用产品和服务的相关信息包括:</p>
|
||||
<p>
|
||||
2.1湖南鲨鱼健康科技有限公司会在根据您在软件安装及使用汇总授
|
||||
予的具体权限,接收并记录您所使用的智能设备
|
||||
相关信息,包括您的登录账号信息 (帐号、昵
|
||||
称、头像信息)、手机相关信息 (硬件设备标识
|
||||
(imsi、imei、meid、设备硬件序列号、SIM 卡标
|
||||
识、OAID、Mac 地址、Android ID)、手机型号
|
||||
系统版本信息、系统语言、手机所设置的国家或
|
||||
地区、应用商店的版本号、手机屏幕尺寸及分辨
|
||||
率、CPU及显示设备相关信息) 连接智能设备过
|
||||
程中收集的信息:基于您需要链接的智能设备的
|
||||
类型,湖南鲨鱼健康科技有限公司可能会收集: Wi-Fi信息 (SSID
|
||||
BSSID、Wi-Fi的Mac 地址、Wi-Fi 密码) 、设备
|
||||
Mac 地址、设备ID、设备蓝牙 Mac 地址) 、设
|
||||
备唯一标识字符,您对软硬件的使用记录、软硬
|
||||
件故障信息数据,包括您的IP地址、访问日期和
|
||||
时间、语言、软硬件特征信息、地理位置,如您
|
||||
下载或使用鲨鱼云康或其关联公司客户端软件,鲨鱼云康
|
||||
可能会读取与您位置和移动设备相关的信息,包
|
||||
括设备型号、操作系统、设备识别码、分辨率
|
||||
电信运营商。为实现向您提供湖南鲨鱼健康科技有限公司产品及/或服务
|
||||
的必要的功能,您须授权湖南鲨鱼健康科技有限公司手机、使用的必要
|
||||
的信息。如您拒绝提供相应信息,您将无法正常
|
||||
使用湖南鲨鱼健康科技有限公司的产品及/或服务。
|
||||
</p>
|
||||
<p>
|
||||
2.2除上述信息外,湖南鲨鱼健康科技有限公司还可能为了提供服务
|
||||
及改进服务质量、服务个性化的合理需要而收集
|
||||
您的其他信息,包括您与湖南鲨鱼健康科技有限公司的客户服务团队联
|
||||
系时您提供的相关信息,您参与问卷调查活动时
|
||||
向湖南鲨鱼健康科技有限公司提供的问卷答复信息,以及您与鲨鱼云康的关
|
||||
联方、合作伙伴之间互动时湖南鲨鱼健康科技有限公司收集的相关信
|
||||
息。与此同时,
|
||||
<h4>为提高您使用鲨鱼云康平台服务时的
|
||||
安全性,预防钓鱼网站欺诈和木马病毒,湖南鲨鱼健康科技有限公司可
|
||||
能会通过了解或记录一些您的网络使用习惯、您
|
||||
常用的软件信息来判断您账户的风险,并可能会
|
||||
记录一些湖南鲨鱼健康科技有限公司认为有风险的URL。</h4>为实现向您提
|
||||
供湖南鲨鱼健康科技有限公司产品及服务的附加功能,您可选择单独后
|
||||
意或不同意湖南鲨鱼健康科技有限公司收集、使用的信息。如您拒绝提
|
||||
供,您将无法正常使用相关附加功能或无法达到
|
||||
湖南鲨鱼健康科技有限公司拟达到的效果,不会影响您使用湖南鲨鱼健康科技有限公司的基本
|
||||
功能。
|
||||
</p>
|
||||
<p>以下为相关应用场景/业务功能及影响:</p>
|
||||
<p>服务预约:根据用户填写的信息提供相关保养、投诉、咨询、报修、报装、移机服务;</p>
|
||||
<p>附近门店: 根据用户定位判断该地区门店位置;</p>
|
||||
<p>下单:用于生成订单时,显示订单中的物流信息并同步物流配送;</p>
|
||||
<p>库存: 根据用户定位判断该地区商品储货情况。</p>
|
||||
<p>涉及的各项业务功能实际收集的个人信息类型与隐私政策所描述内容一致,且不会超出隐私政策所述范围。</p>
|
||||
<p>2.3针对设备使用过程中的信息收集,包括您
|
||||
设备的硬件、性能、状态、功能信息,包括设备
|
||||
名称、设备ID(DID)
|
||||
、固件版本号、设备安装
|
||||
位置 (如客厅) 、设备时区、存储卡信息 (如存
|
||||
储状态、剩余容量、存储开关、录制模式) 、屏
|
||||
幕信息 (如清晰度、您设置的缩放比例)、清扫
|
||||
信息 (如地图、清扫轨迹、清扫区域、清扫面
|
||||
积、清扫时长、清扫模式、日期和时间) 、轨迹
|
||||
信息 (如录像日期、录像时间、触发事件、录像
|
||||
视频时长、人物行动轨迹)、睡眠信息 (如人数
|
||||
信息、睡眠数据、心率、呼吸、体动敏感隐私生
|
||||
理数据)、电量信息。设备使用过程中收集的信
|
||||
息,您可以通过在App上操作删除设备的方式
|
||||
将对应设备这部分信息进行同步删除。</p>
|
||||
<p>2.3.1设备设置信息:湖南鲨鱼健康科技有限公司可能会收集与设备
|
||||
设置相关的信息,包括人数信息、人员位置信
|
||||
息、以及其他各项您已经同意并授权的身体数据
|
||||
指标信息。为了更好的提供智能家居服务,在设
|
||||
备使用过程中,会根据您的操作习惯在取得您授
|
||||
权的前提下进行设备自动控制。</p>
|
||||
<p>2.3.2网络信息:湖南鲨鱼健康科技有限公司能会在您的设备连接
|
||||
到网络时收集网络相关信息,包括设备当前连接
|
||||
Wi-Fi的模式(局域网模式、远程模式)、设备分
|
||||
配的IP地址、Wi-Fi信号强度、接收的Wi-Fi信号强
|
||||
弱指标 (即设备RSSI) 、MAC地址,以及您主动
|
||||
提供的Wi-Fi名称(SSID)
|
||||
、Wi-Fi密码,NAS网络
|
||||
存储。您的此类信息会加密存放在安全的服务器
|
||||
上,且仅会在您授权同意的范围内使用。</p>
|
||||
<p>2.3.3语音信息:部分设备具有语音控制功
|
||||
能。您可以通过语音与相关设备进行互动,当您
|
||||
激活或唤醒智能设备后,湖南鲨鱼健康科技有限公司会自动接收并记录
|
||||
您与设备交互产生的语音数据,用于识别指令以
|
||||
及转化为文本,从而实现语音识别、语音控制功
|
||||
能,并进行优化。请注意,
|
||||
语音识别系统在识别
|
||||
您的指令时,对声音信息进行采集过程中可能会
|
||||
捕捉到非指令的若干语音信息 (例如聊天、电
|
||||
话),请您尽可能在安静环境下使用,以免发出
|
||||
有控制指令外的其他语音消息。若您不同意湖南鲨鱼健康科技有限公司
|
||||
收集上述信息,您可以选择不唤醒语音设备或禁
|
||||
用语音功能,但禁用后您将无法使用语音识别或
|
||||
控制功能。</p>
|
||||
<p>2.3.4图像及视频信息:如果您使用摄像头或
|
||||
带有内置摄像头的设备,在您添加并开启设备
|
||||
后,摄像头基于对您住所的安全考虑,设备会自
|
||||
动录制视频,在您使用相关功能时,湖南鲨鱼健康科技有限公司会收集
|
||||
您与绑定设备的视频、音频、会话、图像相关信
|
||||
息,请放心,您的数据不会用于其他任何目的。
|
||||
若您不提供此类信息,将无法使用摄像头相关服
|
||||
务功能。</p>
|
||||
<p>2.3.5扫地机器人-清扫信息: 湖南鲨鱼健康科技有限公司可能收集您
|
||||
设备清扫的相关信息,这些信息可能以日志的形
|
||||
式存在。例如,清扫数据: 包括地图、清扫轨
|
||||
迹、清扫区域、清扫面积、清扫时长、清扫模
|
||||
式、日期和时间,您的设备和服务器端只保存最
|
||||
近20条清扫数据。您可以选择通过app删除其中
|
||||
的信息。日志信息还包括:设备的运行状态和异常情况下传感器工作数据或错误信息,
|
||||
这些信息将在服务器中安全地保存至多180天,到期后将自动删除;
|
||||
可清扫区域信息:App端地图手动设置的可清
|
||||
扫区域信息。例如:地图上设置的禁区、虚拟
|
||||
墙、合并/分割房间;
|
||||
房间区域设置信息:针对地图上所划分的各个
|
||||
房间区域设置清扫吸力、拖地水量信息;
|
||||
其他设置信息:勿扰模式、预约、清扫次数和
|
||||
清扫顺序、多地图管理设置,
|
||||
其他信息:选择的语音包、配件寿命剩余可用
|
||||
时长。</p>
|
||||
<p>2.3.6AI微感器-轨迹信息: 设备会根据触发事
|
||||
件录制视频人物轨迹,包括区域有变动、有人移
|
||||
动、智能场景触发。因此湖南鲨鱼健康科技有限公司可能会收集与录像
|
||||
有关的信息,包括录像日期、录像时间、触发事
|
||||
件、录像视频时长、人物行动轨迹。</p>
|
||||
<p>2.3.7睡眠检测仪-睡眠信息: 湖南鲨鱼健康科技有限公司可能会收集与设备设置相关的信息,
|
||||
包括人数信息、睡眠数据、心率、呼吸、体动敏感隐私生理数据,
|
||||
以及其他各项您已经同意并授权的身体数据指标信息。为了更好的提供智能家居服务,
|
||||
在设备使用过程中,会根据您的操作习惯在取得您授权的前提下进行设备自动控制。</p>
|
||||
<p>2.3.8空调-电量信息:湖南鲨鱼健康科技有限公司可能会收集与设备相关的电量信息,这些信息会以报告的形式展示,电量数据为估算值,仅供参考。</p>
|
||||
<p>2.4 鲨鱼云康App可能会调用您的设备权限,以下是调用权限对应的业务功能、
|
||||
湖南鲨鱼健康科技有限公司调用的目的以及调用前向您询问的情况。您可以在设备的设置功能中选择关闭部分或全部权限,
|
||||
从而拒绝湖南鲨鱼健康科技有限公司调用相关权限。</p>
|
||||
<div class="marginTop-lg flex table">
|
||||
<div class="text-center border-right" style="width: 50px;">设备权限</div>
|
||||
<div class="text-center border-right flex-sub">对应业务</div>
|
||||
<div class="flex-sub text-center border-right">调用权限目的</div>
|
||||
<div class="text-center border-right" style="width: 50px;">是否询问</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line text-center" style="width: 50px;">存储</div>
|
||||
<div class="line text-center flex-sub">插件更新;图片信息存储;APP升级</div>
|
||||
<div class="line flex-sub text-center">访问设备上的照片媒体内容和文件</div>
|
||||
<div class="line text-center" style="width: 50px;">是</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line text-center" style="width: 50px;">相机</div>
|
||||
<div class="line text-center flex-sub">添加设备;个人头像;拍照</div>
|
||||
<div class="line flex-sub text-center">使用相机进行扫描二维码进行设备配网、更改个人信息上传头像</div>
|
||||
<div class="line text-center" style="width: 50px;">是</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line text-center" style="width: 50px;">麦克风</div>
|
||||
<div class="line text-center flex-sub">语音控制</div>
|
||||
<div class="line flex-sub text-center">语音控制设备、与带语音的设备进行对话</div>
|
||||
<div class="line text-center" style="width: 50px;">是</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line text-center" style="width: 50px;">位置信息</div>
|
||||
<div class="line text-center flex-sub">定位服务、添加设备</div>
|
||||
<div class="line flex-sub text-center">获取用户位置信息提供服务(如天气服务)、添加设备时用户发现附近WiFi或蓝牙列表</div>
|
||||
<div class="line text-center" style="width: 50px;">是</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line text-center" style="width: 50px;">开启蓝牙</div>
|
||||
<div class="line text-center flex-sub">蓝牙设备配网</div>
|
||||
<div class="line flex-sub text-center">采用蓝牙模块与协议配网的设备进行设备配网</div>
|
||||
<div class="line text-center" style="width: 50px;">是</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line text-center" style="width: 50px;">电话</div>
|
||||
<div class="line text-center flex-sub">拨打电话</div>
|
||||
<div class="line flex-sub text-center">拨打客服电话</div>
|
||||
<div class="line text-center" style="width: 50px;">是</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line text-center" style="width: 50px;">获取应用列表</div>
|
||||
<div class="line text-center flex-sub">第三方登录</div>
|
||||
<div class="line flex-sub text-center">允许App获取手机中已安装的应用信息</div>
|
||||
<div class="line text-center" style="width: 50px;">否</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line text-center" style="width: 50px;">通知</div>
|
||||
<div class="line text-center flex-sub">消息中心</div>
|
||||
<div class="line flex-sub text-center">对系统和设备消息进行通知</div>
|
||||
<div class="line text-center" style="width: 50px;">Android:否 ios:是</div>
|
||||
</div>
|
||||
<p>2.5为识别您的设备ID并预防恶意程序及反作弊、提高服务安全性、保障运营质量及效率,湖南鲨鱼健康科技有限公司会收集您的设备信息
|
||||
(包括设备序列号IMEI、MEID、AndroidID、IMSI、GUID、MAC地址)、您安装的应用信息或运行中的进程信息。</p>
|
||||
<p>2.6您在使用湖南鲨鱼健康科技有限公司的服务时,若您想分享您喜欢的内容至第三方App,湖南鲨鱼健康科技有限公司需要判断是否安装了第三方App,以便为您提供正确的分享功能。湖南鲨鱼健康科技有限公司采用合并链路技术进行技术推送,在启动App初始化后,湖南鲨鱼健康科技有限公司会读取已安装应用列表,当一个设备有多个APP的推送链路同时活跃时,湖南鲨鱼健康科技有限公司会随机合并成一条链路,以达到为您省电省流量的目的,因此需获得应用列表信息。
|
||||
</p>
|
||||
<p>2.7 在您使用App时,会获取方向传感器、陀螺仪设备传感器信息,用于鉴别您是否为真实用户。在您使用录像照相相关功能时,会获取加速度设备传感器信息,用于获取拍摄手机角度</p>
|
||||
<p>2.8桌面小组件功能</p>
|
||||
<p>为向您提供快捷便利的智能设备控制体验,在设备品类支持的情况下,在您点击进入设备扩展程序前,可通过添加相应设备的桌面小组件,便捷查看设备的运行状态(如当前空调是开机或关机状态),本应用须使用自启动能力,将存在一定频率通过系统发送广播唤醒本应用自启动或关联启动行为,该为实现功能及服务所必要。桌面小组件功能由您自行选择是否添加,您添加后也可在手机系统环境下直接移除桌面小组件。在未添加设备桌面小组件情况下,则不会有自启动或关联启动行为。
|
||||
</p>
|
||||
<p>2.9快捷控制功能</p>
|
||||
<p>为向您提供快捷便利的智能设备控制体验,在设备品类支持的情况下,在您点击进入设备扩展程序前,通过鲨鱼云康应用快捷卡片入口,可以实现智能设备控制以及智能设备状态查询的功能。湖南鲨鱼健康科技有限公司会收集以下信息:</p>
|
||||
<p>设备联网状态:以供您查看设备连接状态,根据联网状态展示不同操作界面;</p>
|
||||
<p>设备状态信息:以使您查看设备状态并实现设备控制</p>
|
||||
<p>如果您通过鲨鱼云康平台连接了可检测人体轨迹的设备等,湖南鲨鱼健康科技有限公司还需收集:</p>
|
||||
<p>设备周围环境相关信息:以使您准确的查看设备传感器检测到的周围环境相关信息,例如温度、湿度、PM2.5以及是否有人经过等。</p>
|
||||
<p>(三)湖南鲨鱼健康科技有限公司还可能收集其他无法识别到特定个人的信息 (即不属于个人信息的信息),例如您使用特定服务时产生的统计类数据,如用户的操作行为 (包括点击、页面跳转、浏览时间)
|
||||
、账号下设备信息(包括设备品类、数目、功能使用参数)。收集此类信息的目的在于改善湖南鲨鱼健康科技有限公司向您提供的服务。所收集信息的类别和数量取决于您如何使用湖南鲨鱼健康科技有限公司产品和/或服务。</p>
|
||||
<!-- <p>湖南鲨鱼健康科技有限公司会将此类信息汇总,用于帮助湖南鲨鱼健康科技有限公司向客户提供更有用的信息,了解客户对湖南鲨鱼健康科技有限公司网站、产品和服务中的哪些部分最感兴趣。据此将根据算法自动化决策定向推荐展示个性化的产品和服务同时,客户可登录鲨鱼云康App,在设置功能中关闭个性化推荐功能,选择非定向推送信息模式。就本隐私政策而言,汇总数据被视为非个人信息。如果湖南鲨鱼健康科技有限公司将非个人信息与个人信息结合使用,则在结合使用期间,此类信息将被视为个人信息。
|
||||
</p> -->
|
||||
<p>(四)您充分知晓,以下情形中,湖南鲨鱼健康科技有限公司收集、使用、共享、转让、公开披露您的个人信息或非个人信息无需征得您的同意,且湖南鲨鱼健康科技有限公司可能不会响应您提出的更正/修改、删除、注销、撤回同意、索取信息的请求:</p>
|
||||
<p>4.1与国家安全、国防安全有关的;</p>
|
||||
<p>4.2 与公共安全、公共卫生、重大公共利益有关的;</p>
|
||||
<p>4.3与犯罪侦查、起诉、审判和判决执行有关的;</p>
|
||||
<p>4.4出于维护个人信息主体或其他个人的生命、财产此类重大合法权益但又很难得到本人同意的;</p>
|
||||
<p>4.5所收集的个人信息是个人信息主体自行向社会公众公开的;</p>
|
||||
<p>4.6从合法公开披露的信息中收集的您的个人信息的,如合法的新闻报道、政府信息公开渠道;</p>
|
||||
<p>4.7 根据您的要求签订合同所必需的;</p>
|
||||
<p>4.8用于维护所提供的产品与/或服务的安全稳定运行所必需的,例如发现、处置产品与/或服务的故障;</p>
|
||||
<p>4.9为合法的新闻报道所必需的 (为公共利益实施新闻报道、舆论监督等行为,在合理的范围内处理个人信息);</p>
|
||||
<p>4.10学术研究机构基于公共利益开展统计或学术研究所必要,且对外提供学术研究或描述的结果时,对结果中所包含的个人信息进行去标识化处理的;</p>
|
||||
<p>4.11法律法规规定的其他情形。</p>
|
||||
<p>(五)公测活动</p>
|
||||
<p>为了给您提供良好的用户体验,鲨鱼云康提供了公测活动。您可以自主选择是否参加这些活动。当您选择参加活动时,湖南鲨鱼健康科技有限公司需要收集您主动提供的以下信息,包括但不限于您的手机号码、设备信息:设备标识符(IEMI、IDFA、AndroidID、MAC、OAID相关信息)
|
||||
、设备参数及系统信息(设备类型、设备型号、操作系统及硬件相关信息)、位置信息:设备位置,以在您获得测试资格后联系您、就您的测试体验进行回访等。请您放心,湖南鲨鱼健康科技有限公司会对您的信息采取足够的保护措施严格遵守相关法律法规与监管要求。您的手机号码和地址信息仅用于上述目的,不会用作其他处理目的。
|
||||
</p>
|
||||
<h3>三、湖南鲨鱼健康科技有限公司如何共享、转让、公开披露您的个人信息</h3>
|
||||
<p>(一)共享</p>
|
||||
<p>湖南鲨鱼健康科技有限公司不会与鲨鱼云康以外的任何公司、组织和个人分享您的个人信息,但以下情况除外:</p>
|
||||
<p>1、在获取明确同意的情况下共享:获得您的明确同意后,湖南鲨鱼健康科技有限公司会与其他方共享您的个人信息。</p>
|
||||
<p>2、湖南鲨鱼健康科技有限公司可能会根据法律法规规定,或按政府主管部门的强制性要求,对外共享您的个人信息。</p>
|
||||
<p>3、与湖南鲨鱼健康科技有限公司的关联公司共享:
|
||||
您的个人信息可能会与鲨鱼云康的关联公司共享。湖南鲨鱼健康科技有限公司只会共享必要的个人信息,且受本隐私政策中所声明目的的约束。附属公司如要改变个人信息的处理目的,将再次征求您的授权同意。具体关联公司见下方关联的第三方SDK清单。
|
||||
</p>
|
||||
<p>4、与授权合作伙伴共享:仅为实现本政策中声明的目的,湖南鲨鱼健康科技有限公司的某些服务将由授权合作伙伴提供。湖南鲨鱼健康科技有限公司可能会与合作伙伴共享您的某些个人信息,以提供更好的客户服务和用户体验。例如,在您上网购买湖南鲨鱼健康科技有限公司的产品时,湖南鲨鱼健康科技有限公司必须与物流服务提供商共享您的个人信息才能安排送货或者安排合作伙伴提供服务。湖南鲨鱼健康科技有限公司仅会出于合法、正当、必要、特定、明确的目的共享您的个人信息,并且只会共享提供服务所必要的个人信息。湖南鲨鱼健康科技有限公司的合作伙伴无权将共享的个人信息用于任何其他用途。对湖南鲨鱼健康科技有限公司与之共享个人信息的公司、组织和个人,湖南鲨鱼健康科技有限公司会与其签署严格的保密协定,要求他们按照湖南鲨鱼健康科技有限公司的说明、本隐私政策以及其他任何相关的保密和安全措施来处理个人信息。
|
||||
</p>
|
||||
<p>5、针对第三方SDK使用,湖南鲨鱼健康科技有限公司将基于不同步用户个人数据为前提,授权合作伙伴获取有关业务信息。同时针对第三方的SDK应用程序接口(API),软件工具开发包 (SDK)
|
||||
湖南鲨鱼健康科技有限公司会进行严格的安全监测,并与合作伙伴签订严格的数据保护协定,令其按照湖南鲨鱼健康科技有限公司的委托目的、服务说明本隐私政策以及其它任何相关的保密和安全措施来处理个人信息。</p>
|
||||
<p>目前湖南鲨鱼健康科技有限公司系统产品中存在的第三方SDK披露如下:</p>
|
||||
<div class="marginTop-lg flex table">
|
||||
<div class="flex-sub text-center border-right">第三方SDK</div>
|
||||
<div class="flex-sub text-center border-right">接入目的/第三方名称</div>
|
||||
<div class="flex-sub text-center border-right">获取个人信息</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line flex-sub text-center">极光推送SDK</div>
|
||||
<div class="line flex-sub text-center">
|
||||
<div>
|
||||
极光推送服务为APP赋予消息和通知的推送能力。在集成极光推送SDK后,极光推送SDK会收集使用实现服务所必须的个人信息,通过加密的通道将消息和通知推送给App的终端用户。极光隐私政策链接:
|
||||
<span class="text-decoration"
|
||||
@tap="goWeb('https://docs.jiguang.cn/jpush/client/Android/android_jghgzy')('https://docs.jiguang.cn/jpush/client/Android/android_jghgzy')">https://docs.jiguang.cn/jpush/client/Android/android_jghgzy</span>第三方名称深圳市和讯华谷信息技术有限公司
|
||||
</div>
|
||||
</div>
|
||||
<div class="line flex-sub text-center">
|
||||
设备信息:设备标识符(IEMIIDFA、AndroidIDMAC、OAID相关信息)、应用信息(应用崩溃信息、通知开关状态、软件列表相关信息、获取应用列表)、设备参数及系统信息(设备类型、设备型号、操作系统及硬件相关信息);网络信息:IP地址、WiFi信息、基站信息位置信息:设备位置
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line flex-sub text-center">极光推送SDK-华为厂商通道</div>
|
||||
<div class="line flex-sub text-center">
|
||||
<div>
|
||||
极光推送为了提升送达率解决厂商通道的配额限制和保障消息即时送达等问题,为开发者提供了多种推送策略,开发者在推送管理后台可以选择合适的发送策略,在API端支持开发者以厂商通道为颗粒度制定发送策略。
|
||||
极光隐私政策链接:<span class="text-decoration"
|
||||
@tap="goWeb('https://docs.jiguang.cn/jpush/client/Android/android_jghgzy')">https://docs.jiguang.cn/jpush/client/Android/android_jghgzy</span>第三方名称深圳市和讯华谷信息技术有限公司
|
||||
</div>
|
||||
</div>
|
||||
<div class="line flex-sub text-center">
|
||||
设备信息:设备标识符(IEMIIDFA、AndroidIDMAC、OAID相关信息)、应用信息(应用崩溃信息、通知开关状态、软件列表相关信息、获取应用列表)、设备参数及系统信息(设备类型、设备型号、操作系统及硬件相关信息);网络信息:IP地址、WiFi信息、基站信息位置信息:设备位置
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line flex-sub text-center">极光推送SDK-Vivo厂商通道</div>
|
||||
<div class="line flex-sub text-center">
|
||||
<div>
|
||||
极光推送为了提升送达率解决厂商通道的配额限制和保障消息即时送达等问题,为开发者提供了多种推送策略,开发者在推送管理后台可以选择合适的发送策略,在API端支持开发者以厂商通道为颗粒度制定发送策略。
|
||||
极光隐私政策链接:<span class="text-decoration"
|
||||
@tap="goWeb('https://docs.jiguang.cn/jpush/client/Android/android_jghgzy')">https://docs.jiguang.cn/jpush/client/Android/android_jghgzy</span>第三方名称深圳市和讯华谷信息技术有限公司
|
||||
</div>
|
||||
</div>
|
||||
<div class="line flex-sub text-center">
|
||||
设备信息:设备标识符(IEMIIDFA、AndroidIDMAC、OAID相关信息)、应用信息(应用崩溃信息、通知开关状态、软件列表相关信息、获取应用列表)、设备参数及系统信息(设备类型、设备型号、操作系统及硬件相关信息);网络信息:IP地址、WiFi信息、基站信息位置信息:设备位置
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line flex-sub text-center">极光推送SDK-魅族厂商通道</div>
|
||||
<div class="line flex-sub text-center">
|
||||
<div>
|
||||
极光推送为了提升送达率解决厂商通道的配额限制和保障消息即时送达等问题,为开发者提供了多种推送策略,开发者在推送管理后台可以选择合适的发送策略,在API端支持开发者以厂商通道为颗粒度制定发送策略。
|
||||
极光隐私政策链接:<span class="text-decoration"
|
||||
@tap="goWeb('https://docs.jiguang.cn/jpush/client/Android/android_jghgzy')">https://docs.jiguang.cn/jpush/client/Android/android_jghgzy</span>第三方名称深圳市和讯华谷信息技术有限公司
|
||||
</div>
|
||||
</div>
|
||||
<div class="line flex-sub text-center">
|
||||
设备信息:设备标识符(IEMIIDFA、AndroidIDMAC、OAID相关信息)、应用信息(应用崩溃信息、通知开关状态、软件列表相关信息、获取应用列表)、设备参数及系统信息(设备类型、设备型号、操作系统及硬件相关信息);网络信息:IP地址、WiFi信息、基站信息位置信息:设备位置
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line flex-sub text-center">极光推送SDK-小米厂商通道</div>
|
||||
<div class="line flex-sub text-center">
|
||||
<div>
|
||||
极光推送为了提升送达率解决厂商通道的配额限制和保障消息即时送达等问题,为开发者提供了多种推送策略,开发者在推送管理后台可以选择合适的发送策略,在API端支持开发者以厂商通道为颗粒度制定发送策略。
|
||||
极光隐私政策链接:<span class="text-decoration"
|
||||
@tap="goWeb('https://docs.jiguang.cn/jpush/client/Android/android_jghgzy')">https://docs.jiguang.cn/jpush/client/Android/android_jghgzy</span>第三方名称深圳市和讯华谷信息技术有限公司
|
||||
</div>
|
||||
</div>
|
||||
<div class="line flex-sub text-center">
|
||||
设备信息:设备标识符(IEMIIDFA、AndroidIDMAC、OAID相关信息)、应用信息(应用崩溃信息、通知开关状态、软件列表相关信息、获取应用列表)、设备参数及系统信息(设备类型、设备型号、操作系统及硬件相关信息);网络信息:IP地址、WiFi信息、基站信息位置信息:设备位置
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line flex-sub text-center">极光推送SDK-OPPO厂商通道</div>
|
||||
<div class="line flex-sub text-center">
|
||||
<div>
|
||||
极光推送为了提升送达率解决厂商通道的配额限制和保障消息即时送达等问题,为开发者提供了多种推送策略,开发者在推送管理后台可以选择合适的发送策略,在API端支持开发者以厂商通道为颗粒度制定发送策略。
|
||||
极光隐私政策链接:<span class="text-decoration"
|
||||
@tap="goWeb('https://docs.jiguang.cn/jpush/client/Android/android_jghgzy')">https://docs.jiguang.cn/jpush/client/Android/android_jghgzy</span>第三方名称深圳市和讯华谷信息技术有限公司
|
||||
</div>
|
||||
</div>
|
||||
<div class="line flex-sub text-center">
|
||||
设备信息:设备标识符(IEMIIDFA、AndroidIDMAC、OAID相关信息)、应用信息(应用崩溃信息、通知开关状态、软件列表相关信息、获取应用列表)、设备参数及系统信息(设备类型、设备型号、操作系统及硬件相关信息);网络信息:IP地址、WiFi信息、基站信息位置信息:设备位置
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="line flex-sub text-center">高德定位SDK</div>
|
||||
<div class="line flex-sub text-center">
|
||||
定位SDK是一套简单的LBS服务定位接口,您可以使用这套定位AP获取定位结果。通过定位城市获取相关的天气信息进行显示。隐私政策链接:https://lbs.amap.com/pagesprivacy/第三方名称高德软件有限公司
|
||||
</div>
|
||||
<div class="line flex-sub text-center">
|
||||
手机WiFI信息;位置信息
|
||||
</div>
|
||||
</div>
|
||||
<p>(二) 转让</p>
|
||||
<p>湖南鲨鱼健康科技有限公司不会将您的个人信息转让给任何公司、组织和个人,但以下情况除外:</p>
|
||||
<p>1、在获取明确同意的情况下转让: 获得您的明确同意后,湖南鲨鱼健康科技有限公司会向其他方转让您的个人信息。</p>
|
||||
<p>2、在涉及合并、收购或破产清算时,如涉及到个人信息转让,湖南鲨鱼健康科技有限公司会在要求新的持有您个人信息的公司、组织继续受此隐私政策的约束,否则湖南鲨鱼健康科技有限公司将要求该公司、组织重新向您征求授权同意。</p>
|
||||
<p>(三)公开披露</p>
|
||||
<p>湖南鲨鱼健康科技有限公司仅会在以下情况下,公开披露您的个人信息。</p>
|
||||
<p>1、获得您明确同意后。</p>
|
||||
<p>2、基于法律的披露:在法律、法律程序、诉
|
||||
讼或政府主管部门强制性要求的情况下,湖南鲨鱼健康科技有限公司可
|
||||
能会公开披露您的个人信息。</p>
|
||||
<h3>四、湖南鲨鱼健康科技有限公司如何保护您的个人信息</h3>
|
||||
<p>湖南鲨鱼健康科技有限公司非常重视个人信息安全,并采取一切合理
|
||||
可行的措施,保护您的个人信息。相关技术与措
|
||||
施包括:</p>
|
||||
<p>1.数据安全技术措施</p>
|
||||
<p>湖南鲨鱼健康科技有限公司已使用符合业界标准的安全防护措施保护
|
||||
您提供的个人信息,防止数据遭到未经授权访
|
||||
问、公开披露、使用、修改、损坏或丢失。湖南鲨鱼健康科技有限公司
|
||||
会采取一切合理可行的措施,保护您的个人信
|
||||
息。湖南鲨鱼健康科技有限公司会使用加密技术提高用户信息的安全
|
||||
性,湖南鲨鱼健康科技有限公司会使用受信赖的保护机制防止用户信息
|
||||
遭到恶意代码攻击,例如,在您的浏览器与“服
|
||||
务”之间交换数据(如信用卡信息) 时受SSL加密
|
||||
保护,湖南鲨鱼健康科技有限公司会部署访问控制机制,确保只有授权
|
||||
人员才可访问个人信息;</p>
|
||||
<p>2.其他安全措施</p>
|
||||
<p>2.1 湖南鲨鱼健康科技有限公司会采取一切合理可行的措施,确保未
|
||||
收集无关的个人信息。湖南鲨鱼健康科技有限公司只会在达成本政策所
|
||||
述目的所需的期限内保留您的个人信息,除非需
|
||||
要延长保留期或受到法律的允许。</p>
|
||||
<p>2.2鲨鱼云康智能产品通过建立数据分类分级制
|
||||
度、数据安全管理规范、数据安全开发规范来管
|
||||
理规范个人信息的存储和使用。</p>
|
||||
<p>2.3鲨鱼云康智能产品通过信息接触者保密协
|
||||
议、监控和审计机制来对数据进行全面安全控
|
||||
班。</p>
|
||||
<p>2.4鲨鱼云康智能产品建立数据安全委员会并下
|
||||
设信息保护专职部门、数据安全应急响应组织来
|
||||
推进和保障个人信息安全。</p>
|
||||
<p>2.5加强安全意识。湖南鲨鱼健康科技有限公司还会举办安全和隐私保护培训课程,加强员工对于保护个人信息重要性的认识。</p>
|
||||
<p>2.6湖南鲨鱼健康科技有限公司仅允许有必要知晓这些信息的鲨鱼云康智能产品及鲨鱼云康智能产品关联方的员工、合作伙伴访问个人信息,并为此设置了严格的访问权限控制和监控机制。湖南鲨鱼健康科技有限公司同时要求可能接触到您个人信息的所有人员履行相应的保密义务。如果未能履行这些义务,可能会被追究法律责任或被中止与鲨鱼云康的合作关系。湖南鲨鱼健康科技有限公司同时要求可能接触到您个人信息的所有人员履行相应的保密义务。如果未能履行这些义务,可能会被追究法律责任或被中止与鲨鱼云康的合作关系。
|
||||
</p>
|
||||
<p>3.互联网并非绝对安全的环境,而且电子邮件、即时通讯、及与其他鲨鱼云康App用户的交流方式并未加密,湖南鲨鱼健康科技有限公司强烈建议您不要通过此类方式发送个人信息。请使用复杂密码,协助湖南鲨鱼健康科技有限公司保证您的账号安全。</p>
|
||||
<p>4.互联网环境并非百分之百安全,湖南鲨鱼健康科技有限公司将尽力确保或担保您发送给湖南鲨鱼健康科技有限公司的任何信息的安全性。</p>
|
||||
<p>5.在不幸发生个人信息安全事件后,湖南鲨鱼健康科技有限公司将按照法律法规的要求,及时向您告知:安全事件的基本情况和可能的影响、湖南鲨鱼健康科技有限公司已采取或将要采取的处置措施、您可自主防范和降低风险的建议、对您的补救措施。湖南鲨鱼健康科技有限公司将及时将事件相关情况以邮件、信函、电话、推送通知的方式告知您,难以逐一告知个人信息主体时,湖南鲨鱼健康科技有限公司会采取合理、有效的方式发布公告。同时,湖南鲨鱼健康科技有限公司还将按照监管部门要求,主动上报个人信息安全事件的处置情况。
|
||||
</p>
|
||||
<p>6.为应对个人信息泄露、损毁和丢失此类可能出现的风险,鲨鱼云康智能产品制定了多项制度,明确安全事件、安全漏洞的分类分级标准及相应的处理流程。湖南鲨鱼健康科技有限公司也为安全事件建立了专门的应急响应团队,按照安全事件处置规范要求针对不同安全事件启动安全预案,进行止损、分析、定位、制定补救措施、联合相关部门进行溯源和打击。
|
||||
</p>
|
||||
<h4>7.如果您对湖南鲨鱼健康科技有限公司的个人信息保护有任何疑问可通过本隐私政策最下方约定的联系方式联系湖南鲨鱼健康科技有限公司。您发现自己的个人信息泄密,尤其是您的账户及密码发生泄露,请您立即通过本隐私政策最下方[如何联系湖南鲨鱼健康科技有限公司]约定的联系方式联络湖南鲨鱼健康科技有限公司,以便湖南鲨鱼健康科技有限公司采取相应措施。
|
||||
</h4>
|
||||
<h3>五、湖南鲨鱼健康科技有限公司如何处理儿童的个人信息</h3>
|
||||
<p>湖南鲨鱼健康科技有限公司的产品、网站和服务主要面向成人。如果没有父母或监护人的同意,儿童不得创建自己的用户账户。对于经父母同意而收集儿童个人信息的情况,湖南鲨鱼健康科技有限公司只会在受到法律允许、父母或监护人明确同意或者保护儿童所必要的情况下使用或公开披露此信息。尽管当地法律和习俗对儿童的定义不同,但湖南鲨鱼健康科技有限公司将不满14
|
||||
周岁的任何人均视为儿童。如果湖南鲨鱼健康科技有限公司发现自己在未事先获得可证实的父母同意的情况下收集了儿童的个人信息,则会设法尽快删除相关数据。</p>
|
||||
<p>针对儿童使用鲨鱼云康产品及服务,湖南鲨鱼健康科技有限公司特别制定了<span @tap="goChildren">《鲨鱼云康儿童个人信息保护规则及监护人须知》</span>,请您仔细阅读,并在充分理解并同意后使用湖南鲨鱼健康科技有限公司的产品及服务。</p>
|
||||
<h3>六、湖南鲨鱼健康科技有限公司如何使用 Cookie 和同类技术</h3>
|
||||
<p>(一) Cookie</p>
|
||||
<p>为确保网站正常运转,湖南鲨鱼健康科技有限公司会在您的计算机或移动设备上存储名为Cookie的小数据文件。cookie通常包含标识符、站点名称以及一些号码和字符。借助于
|
||||
Cookie,设备能够存储您的偏好或使用的智能产品数据。湖南鲨鱼健康科技有限公司不会将Cookie用于本政策所述目的(分享/第三方登录)之外的任何用途。您可根据自己的偏好管理或删除
|
||||
Cookie。您可以清除设备上保存的所有Cookie,但如果您这么做,则需要在每一次访问湖南鲨鱼健康科技有限公司的时候更改用户设置。除Cookie外,湖南鲨鱼健康科技有限公司还会在上使用信标和像素标签技术。湖南鲨鱼健康科技有限公司不存在嵌入第三方代码插件收集个人信息的功能。
|
||||
</p>
|
||||
<p>大部分网络浏览器都设有阻止Cookie的功能。但如果您这么做,则需要在每一次访问湖南鲨鱼健康科技有限公司的网站时亲自更改用户设置。</p>
|
||||
<p>(二)网站信标和像素标签</p>
|
||||
<p>除Cookie外,湖南鲨鱼健康科技有限公司还会在网站上使用网站信标和像素标签的其他同类技术。例如,湖南鲨鱼健康科技有限公司向您发送的电子邮件可能含有链接至湖南鲨鱼健康科技有限公司网站内容的点击URL。如果您点击该链接,湖南鲨鱼健康科技有限公司则会跟踪此次点击,帮助湖南鲨鱼健康科技有限公司了解您的产品或服务偏好并改善客户服务。网站信标通常是一种嵌入到网站或电子邮件中的透明图像。借助于电子邮件中的像素标签,湖南鲨鱼健康科技有限公司能够获知电子邮件是否被打开。如果您不希望自己的活动以这种方式被追踪,则可以随时从湖南鲨鱼健康科技有限公司的寄信名单中退订。
|
||||
</p>
|
||||
<p>(三) Do Not Track (请勿追踪)</p>
|
||||
<p>很多网络浏览器均设有 Do Not Track功能该功能可向网站发布 DoNot Track 请求。目前主要互联网标准组织尚未设立相关政策来规定网站应如何应对此类请求。但如果您的浏览器启用了DoNot
|
||||
Track,那么湖南鲨鱼健康科技有限公司的所有网站都会尊重您的选择。</p>
|
||||
<h3>七、您的权利</h3>
|
||||
<p>按照中国相关的法律、法规、标准,以及其他国家、地区的通行做法,湖南鲨鱼健康科技有限公司保障您对自己的个人信息行使以下权利:</p>
|
||||
<p>(一) 访问您的个人信息</p>
|
||||
<p>您有权访问您的个人信息,法律法规规定的例外情况除外。如果您想行使数据访问权,可以通过以下方式自行访问:</p>
|
||||
<p>账户信息--如果您希望访问或编辑您的账户中的个人资料信息和支付信息、更改您的密码、添加安全信息或关闭您的账户,您可以通过访问鲨鱼云康App执行此类操作。如果您无法通过上述链接访问这些个人信息,您可以通过发送电子邮件841382055@qq.com的方式提出访问请求,湖南鲨鱼健康科技有限公司将在15天内回复您的访问请求。
|
||||
</p>
|
||||
<p>对于您在使用湖南鲨鱼健康科技有限公司的产品或服务过程中产生的其他个人信息,只要湖南鲨鱼健康科技有限公司不需要过多投入,湖南鲨鱼健康科技有限公司会向您提供。</p>
|
||||
<p>(二)更正您的个人信息</p>
|
||||
<p>当您发现湖南鲨鱼健康科技有限公司处理的关于您的个人信息有错误时,您有权要求湖南鲨鱼健康科技有限公司做出更正。您可以通过“(一)访问您的个人信息”中罗列的方式提出更正申请。如果您无法通过上述链接更正这些个人信息,您可以随时使用鲨鱼云康App反馈问题给湖南鲨鱼健康科技有限公司,或发送电子邮件至鲨鱼云康。湖南鲨鱼健康科技有限公司将在15天内回复您的更正请求。
|
||||
</p>
|
||||
<p>(三)删除您的个人信息</p>
|
||||
<p>您有权要求湖南鲨鱼健康科技有限公司删除您的个人数据。湖南鲨鱼健康科技有限公司将会根据您的删除请求进行评估,若满足相应规定,湖南鲨鱼健康科技有限公司将会采取包括技术手段在内的相应步骤进行处理。在以下情形中,您可以通过本隐私政策最下方列明的联系方式与湖南鲨鱼健康科技有限公司取得联系,向湖南鲨鱼健康科技有限公司提出删除个人信息的请求:
|
||||
</p>
|
||||
<p>(1)如果湖南鲨鱼健康科技有限公司处理个人信息的行为违反法律法规;</p>
|
||||
<p>(2)如果湖南鲨鱼健康科技有限公司收集、使用您的个人信息,却未征得您的同意;</p>
|
||||
<p>(3)如果湖南鲨鱼健康科技有限公司处理个人信息的行为严重违反了与您的约定;</p>
|
||||
<p>(4)如果您主动注销了帐号;</p>
|
||||
<p>(5)如果永久不需要湖南鲨鱼健康科技有限公司提供产品或服务;</p>
|
||||
<p>(6)如果湖南鲨鱼健康科技有限公司违反与您的约定,公开披露您的个人信息,您有权要求湖南鲨鱼健康科技有限公司立即停止公开披露的行为,并发布通知要求相关接收方删除相应的信息;</p>
|
||||
<p>(7)如果湖南鲨鱼健康科技有限公司决定响应您的删除请求,湖南鲨鱼健康科技有限公司将停止为您提供产品或服务,根据适用法律的要求删除您的个人信息;</p>
|
||||
<p>因为适用的法律和安全技术,湖南鲨鱼健康科技有限公司可能无法立即从备份系统中删除相应的信息,湖南鲨鱼健康科技有限公司将安全地存储您的个人信息并将其与任何进一步处理隔离,直到备份可以清除或实现匿名。但若您提出的要求存在无实质意义/纠缠式重复、损害他人隐私权、极度极端不现实的情况,或者删除个人信息从技术上难以实现、不符合法律法规,在湖南鲨鱼健康科技有限公司评估后认为删除数据可能会导致湖南鲨鱼健康科技有限公司无法出于安全目的合法使用数据,可能也会予以拒绝。
|
||||
</p>
|
||||
<p>(四)获取个人信息副本</p>
|
||||
<p>如您需要您的个人信息副本,可以通过以下方式获取:</p>
|
||||
<p>(1)您可以在鲨鱼云康App中进行个人信息副本导出操作路径为“我的-设置-个人信息导出”。</p>
|
||||
<p>(2)您可以通过本隐私政策最下方列明的联系方式,与湖南鲨鱼健康科技有限公司取得联系获取。</p>
|
||||
<p>(五)改变您授权同意的范围每个业务功能需要一些基本的个人信息才能得以完成(见本政策“第一部分”)。对于额外收集的个人信息的收集和使用,您可以通过以下方式改变或收回您同意湖南鲨鱼健康科技有限公司收集您个人信息的范围
|
||||
<p>每个业务功能需要一些基本的个人信息才能得以完成 (见本政策“第一部分”)
|
||||
。对于额外收集的个人信息的收集和使用,您可以通过以下方式改变或收回您同意湖南鲨鱼健康科技有限公司收集您个人信息的范围1.通过解绑删除家居设备收回部分授权:2.通过App设置中关闭对应功能,收回部分授权;
|
||||
<p>3.通过移动设备设置功能,关闭相应权限包括:存储、相机、麦克风、位置、蓝牙,收回对应个人信息授权;</p>
|
||||
<p>4.通过注销您的账号收回全部个人信息授权;</p>
|
||||
<p>5.除上述方式外,您还可以通过联系湖南鲨鱼健康科技有限公司的个人信息保护专职部门 (见本政策“第九部分”)处理您的个人信息。</p>
|
||||
<p>当您收回同意后,湖南鲨鱼健康科技有限公司将不再处理相应的个人信息。但您收回同意的决定,不会影响此前基于您的授权而开展的个人信息处理。</p>
|
||||
<p>(六) 注销您的账号</p>
|
||||
<p>您可以随时注销您的账号,如有需要,在登录鲨鱼云康App后可进行注销账号操作,在满足注销账号条件下可直接注销账号</p>
|
||||
<p>账号注销途径:</p>
|
||||
<p>1、进入鲨鱼云康App,“我的”中点击右上角设置按钮,进入“账号与安全”--“账号注销”。</p>
|
||||
<p>2、选择账号注销原因,点击“下一步”;</p>
|
||||
<p>3、输入手机号,并获取并输入验证码后,点击“账号注销”,即注销账号成功。</p>
|
||||
<p>关于账号注销,您需要注意的事项如下</p>
|
||||
<p>1、您应确保您拥有该账号的所有权,有权决定该账号的注销事宜,不侵犯任何第三方的合法权益。如因此引发任何争议,由您自行承担责任。</p>
|
||||
<p>2、您理解并同意在注销账号之后,您将无法再使用该账号,无法远程控制您的设备,同时账号个人资料与设备信息将会被清除,且无法恢复。请您在申请注销前自行备份您欲保留的本帐号信息和数据。</p>
|
||||
<p>3、您注销账号的行为并不代表本帐号在注销前的帐号行为和相关责任得以豁免或减轻。如您在使用帐号时有任何违法违规的不当行为,湖南鲨鱼健康科技有限公司将对您帐号注销前的违法及不当行为保有追责的权利。</p>
|
||||
<p>(七) 响应您的上述请求</p>
|
||||
<p>为保障安全,您可能需要提供书面请求,或以其他方式证明您的身份。湖南鲨鱼健康科技有限公司可能会先要求您验证自己的身份,然后再处理您的请求。湖南鲨鱼健康科技有限公司将在15天内做出答复。如您不满意,还可以联系客服投诉。</p>
|
||||
<p>对于您合理的请求,湖南鲨鱼健康科技有限公司原则上不收取费用但对多次重复、超出合理限度的请求,湖南鲨鱼健康科技有限公司将视情收取一定成本费用。对于那些无端重复、需要过多技术手段(例如,需要开发新系统或从根本上改变现行惯例)、给他人合法权益带来风险或者非常不切实际(例如,涉及备份磁带上存放的信息)的请求,湖南鲨鱼健康科技有限公司可能会予以拒绝。
|
||||
</p>
|
||||
<p>在以下情形中,按照法律法规要求,湖南鲨鱼健康科技有限公司将无法响应您的请求:</p>
|
||||
<p>1、与国家安全、国防安全直接相关的。</p>
|
||||
<p>2、与公共安全、公共卫生、重大公共利益直接相关的。</p>
|
||||
<p>3、与犯罪侦查、起诉、审判和判决执行直接相关的。</p>
|
||||
<p>4、有充分证据表明您存在主观恶意或滥用权利的。</p>
|
||||
<p>5、响应您的请求将导致您或其他个人、组织的合法权益受到严重损害的。</p>
|
||||
<p>6、涉及商业秘密的。</p>
|
||||
<h3>八、您的个人信息如何储存及超出储存期限处理办法</h3>
|
||||
<p>湖南鲨鱼健康科技有限公司在中华人民共和国境内收集和产生的个人信息,将存储在中华人民共和国境内。对于您个人信息的存储期限将依照法律最短期限进行处理。</p>
|
||||
<p>除非法律另有明文规定或经您允许,湖南鲨鱼健康科技有限公司只会在本隐私政策所述目的所需的期限内保留您的个人信息。为了保持服务的持续性和用户体验的一致性,个人信息通常不会在单项服务完成后立即删除。湖南鲨鱼健康科技有限公司会参照安全标准,采取相应的安全保护措施来保护您的个人信息。确保做到知情同意、目的明确、安全保障、依法利用的原则来收集、使用、存储和传输您的信息,到期后湖南鲨鱼健康科技有限公司会对个人信息进行删除或匿名化处理,您的个人信息经过匿名化处理后将形成可以使用的流通数据,湖南鲨鱼健康科技有限公司对此数据的保存和使用无需另外征得您的同意。
|
||||
</p>
|
||||
<h3>九、本政策如何更新</h3>
|
||||
<p>湖南鲨鱼健康科技有限公司的隐私政策可能变更。未经您明确同意湖南鲨鱼健康科技有限公司不会削减您按照本隐私政策所应享有的权利。湖南鲨鱼健康科技有限公司会在本页面上发布对本政策所做的任何变更,并重新取得您的同意。对于重大变更,湖南鲨鱼健康科技有限公司还会提供更为显著的通知
|
||||
(包括对于某些服务,湖南鲨鱼健康科技有限公司会通过电子邮件发送通知,说明隐私政策的具体变更内容)</p>
|
||||
<p>本政策所指的重大变更包括:</p>
|
||||
<p>1、湖南鲨鱼健康科技有限公司的服务模式发生重大变化。如处理个人信息的目的、处理的个人信息类型、个人信息的使用方式。</p>
|
||||
<p>2、湖南鲨鱼健康科技有限公司在所有权结构、组织架构方面发生重大变化。如业务调整、破产并购引起的所有者变更。</p>
|
||||
<p>3、个人信息共享、转让或公开披露的主要对象发生变化。</p>
|
||||
<p>4、您参与个人信息处理方面的权利及其行使方式发生重大变化。</p>
|
||||
<p>5、湖南鲨鱼健康科技有限公司负责处理个人信息安全的责任部门联络方式及投诉渠道发生变化时。</p>
|
||||
<p>6、个人信息安全影响评估报告表明存在高风险时。湖南鲨鱼健康科技有限公司还会将本政策的旧版本存档,供您查阅。</p>
|
||||
<h3>十、如何联系湖南鲨鱼健康科技有限公司</h3>
|
||||
<h4>如果您对本隐私政策有任何疑问、意见或建议,您可以通过如下方式与湖南鲨鱼健康科技有限公司取得联系</h4>
|
||||
<h4>联系人:湖南鲨鱼健康有限公司</h4>
|
||||
<h4>电子邮件: 841382055@qq.com</h4>
|
||||
<h4>电话: 400-833-3131</h4>
|
||||
<p>注册地址:湖南省长沙市岳麓区梅溪湖街道泉水路461号长沙健康医疗大数据产业孵化基地3-1栋2楼201</p>
|
||||
<p>湖南鲨鱼健康科技有限公司设立了个人信息保护专职部门,一般情况下,湖南鲨鱼健康科技有限公司将在15天内回复。如果您对湖南鲨鱼健康科技有限公司的回复不满意,特别是湖南鲨鱼健康科技有限公司的个人信息处理行为损害了您的合法权益,您还可以通过上述途径寻求解决方案。</p>
|
||||
<h3>十一、纠纷处理</h3>
|
||||
<p>如果与本公司取得联系后对我们的处理方式不满意,您可选择联系外部机构寻求帮助,包括不限于消费者协会。</p>
|
||||
<p>湖南省消费者协会的投诉电话:0731 8860315</p>
|
||||
<p>湖南省消费者协会地址:湖南省长沙市枫林一路9号工商局内。</p>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goChildren() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/agreement/children'
|
||||
})
|
||||
},
|
||||
goWeb(val) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/agreement/web-view?url=' + val
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.contioner {
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.cneter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
p {
|
||||
text-indent: 2rem;
|
||||
letter-spacing: 3px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
h4 {
|
||||
text-indent: 2rem;
|
||||
letter-spacing: 3px;
|
||||
}
|
||||
|
||||
.line {
|
||||
border-bottom: 1px solid #000;
|
||||
border-right: 1px solid #000;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.line:first-child {
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
.border-right {
|
||||
border-right: 1px solid #000;
|
||||
}
|
||||
|
||||
.table {
|
||||
border-top: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #000;
|
||||
background: #E6EFF1;
|
||||
}
|
||||
|
||||
.marginTop-lg {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flex-sub {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.text-decoration {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,320 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="contoner">
|
||||
<view>【政策说明】</view>
|
||||
<view>
|
||||
湖南鲨鱼健康有限公司(“鲨鱼云康”或“我们”),您的信任对我们非常重要,我们深知个人信息对您的重要性,我们将按法律法规要求,采取相应安全保护措施,尽力保护您的个人信息安全可控。我们致力于维持您对我们的信任,恪守以下原则,保护您的个人信息:权责一致原则、目的明确原则、选择同意原则、最少够用原则、确保安全原则、主体参与原则、公开透明原则等。同时,我们承诺,我们将按业界成熟的安全标准,采取相应的安全保护措施来保护您的个人信息。鉴于此,【鲨鱼健康】服务提供者(以下简称“我们”)制定本《隐私权政策》(下称“本政策/本隐私权政策”)并提醒您:
|
||||
</view>
|
||||
<view>
|
||||
本政策适用于鲨鱼健康提供的所有产品(或)服务。如我们及关联公司(范围详见定义部分)的产品或服务中使用了鲨鱼健康提供的产品或服务(例如使用鲨鱼健康账户登录)但未设独立隐私权政策的,则本政策同样适用于该部分产品或服务。我们及关联公司就其向您提供的产品或服务单独设立有隐私权政策的,则相应产品或服务适用相应隐私权政策。
|
||||
在使用鲨鱼健康各项产品或服务前,请您务必仔细阅读并透彻理解本政策,特别是以粗体/粗体下划线标识的条款,您应仔细阅读,在确认充分理解并同意后再开始使用。如对本政策内容有任何疑问、意见或建议,您可通过鲨鱼健康提供的各种联系方式与我们联系。
|
||||
</view>
|
||||
<view>第一部分 定义</view>
|
||||
<view>1.1 鲨鱼健康:指鲨鱼健康微信小程序。
|
||||
</view>
|
||||
<view>1.2 鲨鱼健康服务提供者:指鲨鱼健康的互联网信息及软件技术服务提供者湖南鲨鱼健康科技有限公司。
|
||||
</view>
|
||||
<view>1.3 关联公司:指湖南鲨鱼健康科技有限公司直接或间接控股或投资的公司。
|
||||
</view>
|
||||
<view>1.4个人信息:指以电子或者其他方式记录的能够单独或者与其他信息结合识别特定自然人身份或者反映特定自然人活动情况的各种信息。
|
||||
</view>
|
||||
<view>1.5个人敏感信息:指包括身份证件号码、个人生物识别信息、银行账号、财产信息、行踪轨迹、交易信息、14岁以下(含)儿童信息等的个人信息(我们将在本隐私权政策中对具体个人敏感信息以粗体进行显著标识)。
|
||||
</view>
|
||||
<view>1.6个人信息删除:指在实现日常业务功能所涉及的系统中去除个人信息的行为,使其保持不可被检索、访问的状态。
|
||||
</view>
|
||||
<view>除另有约定外,本政策所用定义与《鲨鱼健康用户协议》中的定义具有相同的涵义。
|
||||
</view>
|
||||
|
||||
<view>第二部分 隐私权政策</view>
|
||||
<view>一、我们如何收集和使用您的个人信息</view>
|
||||
<view>我们的产品与(或)服务包括一些核心功能。可能会收集、保存和使用下列与您有关的信息才能实现上述这些功能。如果无法收集和使用您的相关信息,您将无法享受我们提供的产品与(或)服务。
|
||||
</view>
|
||||
<view>
|
||||
2.1.1 您在使用我们的服务时主动提供的信息
|
||||
</view>
|
||||
<view>(1)您在注册账户时主动填写的或上传的信息:如您在注册账户时使用的手机号码或授权绑定的微信等,以及您的昵称、头像等信息。</view>
|
||||
<view>
|
||||
(2)您在使用服务时主动上传的信息:如您在鲨鱼健康主动记录的个人及家人的基本信息和健康档案信息(包括姓名、性别、身高、体重、生日、饮食、运动、习惯、血压等),您主动上传(照片、视频等)至鲨鱼健康的互动区以及允许其他注册用户查看并可分享至其他社交软件的动态所包含的信息,进行健康评估时提供的信息等。
|
||||
</view>
|
||||
<view>
|
||||
(3)您在兑换时提供的信息:如您下单时提供的收件人信息。
|
||||
</view>
|
||||
<view>(4)您主动提供给我们的客服、顾问或者参加我们举办的活动时所提交的信息:如您在向客服咨询时提供的信息,您在参加有奖征集等鲨鱼健康已开展或者未来可能开展的活动时主动提交的信息。</view>
|
||||
<view>(5)其他您在使用我们的产品或服务时主动提供的其他信息。</view>
|
||||
<view>2.1.2 您在使用服务时我们主动收集的信息</view>
|
||||
<view>
|
||||
(1)设备信息:我们会根据您在使用中授予的具体权限,接收并记录您所使用的设备相关信息(例如设备名称、设备型号、唯一设备标识符、运营商网络类型等软硬件特征信息)、设备所在位置相关信息(例如IP地址、GPS位置以及能够提供相关信息的WLAN接入点、蓝牙和基站等信息)。
|
||||
</view>
|
||||
<view>
|
||||
(2)日志信息:当您使用我们的客户端或网站提供的产品或服务时,我们会自动收集您对我们服务的详细使用情况,作为有关网络日志保存。例如您的搜索内容、浏览器类型、浏览记录、订单信息、IP地址、访问日期和时间及您访问的网页记录。
|
||||
</view>
|
||||
<view>
|
||||
(3)位置信息:当您使用与位置有关的服务时,我们可能会记录您设备所在的位置信息,以便为您提供相关服务。在您使用服务时,我们可能会通过IP地址、GPS、WiFi或基站等途径获取您的地理位置信息。同时,您也可以随时通过相关功能设置取消。当您取消该授权后,我们将不再收集该信息,也无法再为您提供上述与之对应的服务;但除非您依照法律的规定删除了您的信息,否则您的取消行为不会影响我们基于您之前的授权进行的信息的处理、存储。
|
||||
</view>
|
||||
<view>
|
||||
(4)订单信息:当您准备进行结算时,鲨鱼健康系统会生成您购买该商品的订单,我们将会收集您的订单信息来进行您的身份核验、确定交易、支付结算、完成配送、为您查询订单以及提供客服咨询与售后服务;我们还会使用您的订单信息来判断您的交易是否存在异常以保护您的交易安全。
|
||||
</view>
|
||||
<view>(5)支付信息:当您下单后,您可以选择与鲨鱼健康合作的微信支付通道,所提供的支付服务,支付时我们将收集您的第三方支付账号。</view>
|
||||
<view>(6)你的饮食运动等习惯:您使用食物热量查询、拍照识别、语音识别、运动动作、运动课程查询等与饮食运动相关的功能,或者根据您在客户端浏览记录及停留时间等信息搜集您的习惯。</view>
|
||||
<view>
|
||||
(7)设备中的图片、视频等:经过您的授权,我们的客户端会将您主动上传的视频、图片加密上传到服务器进行存储。拒绝提供该权限仅会使您无法使用上述功能,但不影响鲨鱼健康其他功能与服务的正常使用;除非您依照法律的规定删除了您的信息,否则您的拒绝行为不会影响我们基于您之前的授权进行的信息的存储或处理。
|
||||
</view>
|
||||
<view>
|
||||
(8)手机相机信息:经过您的授权,我们的客户端会在您使用拍照功能上传图片、视频等内容时,可能会获取您的手机相机信息。
|
||||
</view>
|
||||
<view>2.1.3 经过您的授权,我们通过第三方获取到的您的个人信息
|
||||
</view>
|
||||
<view>
|
||||
(1)为了方便用户记录/同步健康数据和步数,我们还提供了同步第三方软件的健康数据的功能,比如微信步数等。
|
||||
</view>
|
||||
<view>(2)出于安全和防欺诈的目的,针对特定账号、金融交易等服务,在您授权的前提下,通过合法来源核实您的信息(如电话号码);</view>
|
||||
<view>
|
||||
(3)经您授权同意后,通过第三方获取到的您的其他信息。
|
||||
</view>
|
||||
<view>2.1.4 我们通过您绑定的智能设备所获取的信息
|
||||
</view>
|
||||
<view>
|
||||
若您已有相关硬件设备(包括智能血压仪、血糖仪、体脂秤等智能设备),希望将硬件产品记录的信息(包括但不限于血糖、体重、体脂率等已同意上传的个人信息及个人身体数据)同步至鲨鱼健康,则可以通过绑定设备或开启蓝牙功能实现。如您拒绝,仅会使您无法使用该功能,但并不影响您正常使用鲨鱼健康的其他功能。同时,您也可以随时通过相关功能设置取消该权限。但当您取消该授权后,我们将不再收集该信息,也无法再为您提供上述与之对应的服务;但除非您依照法律的规定删除了您的信息,否则您的取消行为不会影响我们基于您之前的授权进行的信息的处理、存储。
|
||||
</view>
|
||||
<view>2.1.5 第三方通过软件等方式主动获取的信息
|
||||
</view>
|
||||
<view>
|
||||
为了更好的为您提供服务,在您使用鲨鱼健康的部分功能时,和鲨鱼健康有合作关系的第三方可能会通过SDK接口等方式获取您的部分信息(包括:您的设备平台、设备厂商、设备品牌、设备识别码(如IMEI、MAC、IDFA等)
|
||||
等设备信息、音频录制权限、应用列表信息、网络信息(如IP地址、WIFI信息等)以及位置相关信息等)。</view>
|
||||
<view>4.5 进行其他任何违法以及侵犯其他个人、公司、社会团体、组织的合法权益的行为或者法律、行政法规、规章、条例以及任何具有法律效力之规范所限制或禁止的其他行为。</view>
|
||||
<view>二、我们如何使用您的个人信息:
|
||||
</view>
|
||||
<view>我们严格遵守法律法规的规定及与用户的约定,将收集的信息用于以下用途。若我们超出以下用途使用您的信息,我们将再次向您进行说明,并征得您的同意。</view>
|
||||
<view>2.2.1 向您提供服务,比如向您提供健康评估、食物信息识别及分析、饮食分析、健康方案、您的健康档案管理等。
|
||||
</view>
|
||||
<view>
|
||||
2.2.2 满足您的个性化需求,比如为了将您感兴趣的服务信息通过小程序呈现给您, 或在您搜索时向您展示您可能希望找到的商品,我们可能会收集您的相关信息进行数据分析以形成用户画像,用来实现前述个性化推送功能。
|
||||
</view>
|
||||
<view>
|
||||
2.2.3 为您提供一致的服务,对于从您的各种设备上收集到的信息,我们可能会将它们进行关联。我们可能会将来自某项服务的信息与来自其他服务的信息结合起来,以便为您提供服务、个性化内容和建议。
|
||||
</view>
|
||||
<view>
|
||||
2.2.4 安全保障,比如我们会将您的信息用于身份验证、安全防范、反诈骗监测、存档备份、客户的安全服务等用途。
|
||||
</view>
|
||||
<view>
|
||||
2.2.5 评估、改善我们的促销及推广活动的效果。
|
||||
</view>
|
||||
<view>2.2.6 帮助我们设计新服务、改善我们现有的服务,比如我们将会对数据进行分析、研究和开发与我们产品或服务的使用相关的统计信息。</view>
|
||||
<view>2.2.7 储存并维护与您相关的信息,用于我们的业务运营(例如业务统计)或履行法律义务。</view>
|
||||
<view>2.2.8 其他征得您同意的目的情况。</view>
|
||||
<view>2.2.9 其他不违反任何强制性法律法规的情况。</view>
|
||||
<view>三、我们的承诺
|
||||
</view>
|
||||
<view>
|
||||
2.3.1
|
||||
请您理解,我们向您提供的功能和服务是不断更新和发展的,如果某一功能或服务未在前述说明中且收集了您的信息,我们会通过页面提示、交互流程、网站公告等方式另行向您说明信息收集的内容、范围和目的,以征得您的同意。
|
||||
</view>
|
||||
<view>
|
||||
2.3.2
|
||||
请您注意,在未取得您的授权之前,我们不会主动从鲨鱼健康外的第三方获取您的个人信息。如未来为业务发展需要从第三方间接获取您个人信息,我们会在获取前向您明示您个人信息的来源、类型及使用范围,如鲨鱼健康开展业务需进行的个人信息处理活动超出您原本向第三方提供个人信息时的授权同意范围,我们将在处理您的该等个人信息前,征得您的明示同意;此外,我们也将会严格遵守相关法律法规的规定,并要求第三方保障其提供的信息的合法性。
|
||||
</view>
|
||||
<view>
|
||||
2.3.3在收集到您的个人信息后,我们将通过技术手段及时对数据进行匿名化处理。在不泄露您个人信息的前提下,我们有权对匿名化处理后的用户数据库进行挖掘、分析和利用(包括商业性使用),有权对产品/服务使用情况进行统计并与公众/第三方共享脱敏的统计信息。
|
||||
</view>
|
||||
<view>
|
||||
四、我们如何共享、转让、公开披露您的个人信息
|
||||
</view>
|
||||
<view>
|
||||
2.4.1我们不会向其他任何公司、组织和个人分享您的个人信息,但以下情况除外:
|
||||
</view>
|
||||
<view>
|
||||
(1)在获取明确同意的情况下共享:获得您的明确同意后,我们会与其他方共享您的个人信息。
|
||||
</view>
|
||||
<view>
|
||||
(2)在法定情形下的共享:我们可能会根据法律法规规定、诉讼、争议解决需要,或按行政、司法机关依法提出的要求,对外共享您的个人信息。
|
||||
</view>
|
||||
<view>
|
||||
(3)只有共享您的信息,才能实现我们的产品与/或服务的核心功能或提供您需要的服务。
|
||||
</view>
|
||||
<view>
|
||||
(4)与我们的关联公司共享:您的个人信息可能会与我们关联公司共享。我们只会共享必要的个人信息,且受本隐私协议中所声明目的的约束。关联公司如要改变个人信息的处理目的,将再次征求您的授权同意。
|
||||
</view>
|
||||
<view>
|
||||
(5)与授权合作伙伴共享:仅为实现本隐私协议中声明的目的,我们的某些服务将由授权合作伙伴提供。我们可能会与合作伙伴共享您的某些个人信息,以提供更好的客户服务和用户体验。例如,我们请来提供第三方物流的公司可能需要采集和使用您的收货地址、收货人及联系方式等信息。在这种情况下,这些公司必须遵守我们的数据隐私和安全要求。我们仅会出于合法、正当、必要、特定、明确的目的共享您的个人信息,并且只会共享提供服务所必要的个人信息。
|
||||
</view>
|
||||
<view>
|
||||
(6)商品或技术服务的供应商。我们可能会将您的个人信息共享给支持我们功能的第三方。这些支持包括为我们的供货或提供基础设施技术服务、物流配送服务、支付服务、数据处理等。我们共享这些信息的目的是可以实现我们产品与/或服务的重要功能,比如我们必须与物流服务提供商共享您的订单信息才能安排送货;或者我们需要将您的订单号和订单金额与第三方支付机构共享以实现其确认您的支付指令并完成支付等。
|
||||
</view>
|
||||
<view>
|
||||
(7)第三方商家。我们必须将您的订单信息与交易有关的必要信息与第三方商家共享来实现您向其购买商品或服务的需求,并促使其可以完成后续的售后服务。
|
||||
</view>
|
||||
<view>
|
||||
(8)对我们与之共享个人信息的公司、组织和个人,我们会与其签署严格的保密协定,要求他们按照我们的说明、本隐私协议以及其他任何相关的保密和安全措施来处理个人信息。
|
||||
</view>
|
||||
<view>
|
||||
(9)为了遵守法律、执行或适用我们的使用条件和其他协议,或者为了保护鲨鱼健康、您或其他鲨鱼健康客户的权利及其财产或安全,比如为防止欺诈等违法活动和减少信用风险,而与其他公司和组织交换信息。不过,这并不包括违反本隐私政策中所作的承诺而为获利目的出售、出租、共享或以其它方式披露的个人信息。
|
||||
</view>
|
||||
<view>
|
||||
2.4.2 我们不会将您的个人信息转让给任何公司、组织和个人,但以下情况除外:
|
||||
</view>
|
||||
<view>
|
||||
(1)在获取您明确同意的情况下转让;
|
||||
</view>
|
||||
<view>
|
||||
(2)在涉及合并、收购或破产清算时,如涉及到个人信息转让,我们会在要求新的持有您个人信息的公司、组织继续受此隐私协议的约束,否则我们将要求该公司、组织重新向您征求授权同意。
|
||||
</view>
|
||||
<view>
|
||||
2.4.2我们仅会在以下情况下,公开披露您的个人信息:
|
||||
</view>
|
||||
<view>
|
||||
(1)获得您明确同意或基于您的主动选择,我们可能会公开披露您的个人信息;
|
||||
</view>
|
||||
<view>
|
||||
(2)基于法律的披露:在法律、法律程序、诉讼或政府主管部门强制性要求的情况下,我们可能会公开披露您的个人信息。
|
||||
</view>
|
||||
<view>
|
||||
2.4.3 我们如何保护您的个人信息
|
||||
</view>
|
||||
<view>
|
||||
(1)我们已使用符合业界标准的安全防护措施保护您提供的个人信息,防止数据遭到未经授权访问、公开披露、使用、修改、损坏或丢失。我们会采取一切合理可行的措施,保护您的个人信息。
|
||||
</view>
|
||||
<view>
|
||||
(2)我们会采取一切合理可行的措施,确保未收集无关的个人信息。我们只会在达成本政策所述目的所需的期限内保留您的个人信息,除非需要延长保留期或受到法律的允许。
|
||||
</view>
|
||||
<view>
|
||||
(3)我们将采取措施确保您的信息安全,但请您理解,由于技术的限制以及可能存在的各种恶意手段,在互联网行业,即便竭尽所能加强安全措施,也不可能始终保证信息百分之百的安全。您接入鲨鱼健康所用的系统和通讯网络,有可能因鲨鱼健康可控范围外的因素而出现问题。因此,您应采取积极措施保护个人信息的安全。
|
||||
</view>
|
||||
<view>
|
||||
(4)互联网环境并非百分之百安全,我们将尽力确保或担保您发送给我们的任何信息的安全性。如果我们的物理、技术、或管理防护设施遭到破坏,导致信息被非授权访问、公开披露、篡改、或毁坏,导致您的合法权益受损,我们将承担相应的法律责任。
|
||||
</view>
|
||||
<view>
|
||||
(5)在不幸发生个人信息安全事件后,我们将按照法律法规的要求,及时向您告知:安全事件的基本情况和可能的影响、我们已采取或将要采取的处置措施、您可自主防范和降低风险的建议、对您的补救措施等。我们将及时将事件相关情况以电话、短信、推送通知等方式告知您,难以逐一告知个人信息主体时,我们会采取合理、有效的方式发布公告。同时,我们还将按照监管部门要求,主动上报个人信息安全事件的处置情况。
|
||||
</view>
|
||||
<view>
|
||||
五、您如何管理自己的信息
|
||||
</view>
|
||||
<view>
|
||||
按照中国相关的法律、法规、标准,以及其他国家、地区的通行做法,我们保障您对自己的个人信息行使以下权利:
|
||||
</view>
|
||||
<view>
|
||||
2.5.1 访问您的个人信息:
|
||||
</view>
|
||||
<view>
|
||||
(1)您有权访问您的个人信息,法律法规规定的例外情况除外。如果您想行使数据访问权,可以通过以下方式自行访问:
|
||||
</view>
|
||||
<view>
|
||||
(2)账户信息--您可以通过访问【我的】访问或编辑您的个人资料信息、更改密码等。
|
||||
</view>
|
||||
<view>
|
||||
(3)健康信息--您可以通过访问【健康检测】、【健康评估】,记录、查看、修改管理您的健康信息以及其他数据。
|
||||
</view>
|
||||
<view>
|
||||
(4)日记信息--您可以通过访问【饮食方案】、【运动方案】,查看、新增、修改、删您的订日记信息。
|
||||
</view>
|
||||
<view>
|
||||
(5)如果您无法通过上述链接访问这些个人信息,您可以随时使用【我的-问题反馈】联系。我们将在7天内回复您的访问请求。
|
||||
</view>
|
||||
<view>
|
||||
2.5.2 更正您的个人信息
|
||||
</view>
|
||||
<view>
|
||||
(1)当您发现我们处理的关于您的个人信息有错误时,您有权要求我们做出更正。您可以通过【访问您的个人信息】中罗列的方式提出更正申请。
|
||||
</view>
|
||||
<view>
|
||||
(2)如果您无法通过上述链接访问这些个人信息,您可以随时使用【我的-问题反馈】联系。我们将在7天内回复您的更正请求。
|
||||
</view>
|
||||
<view>
|
||||
2.5.3 删除您的个人信息
|
||||
</view>
|
||||
<view>
|
||||
在以下情形中,您可以向我们提出删除个人信息的请求:
|
||||
</view>
|
||||
<view>
|
||||
(1)如果我们处理个人信息的行为违反法律法规;
|
||||
</view>
|
||||
<view>
|
||||
(2)如果我们收集、使用您的个人信息,却未征得您的同意;
|
||||
</view>
|
||||
<view>
|
||||
(3)如果我们处理个人信息的行为违反了与您的约定;
|
||||
</view>
|
||||
<view>
|
||||
(4)如果您不再使用我们的产品或服务;若我们决定响应您的删除请求,我们还将同时通知从我们获得您的个人信息的实体,要求其及时删除,除非法律法规另有规定,或这些实体获得您的独立授权。当您从我们的服务中删除信息后,我们可能不会立即备份系统中删除相应的信息,但会在备份更新时删除这些信息。
|
||||
</view>
|
||||
<view>
|
||||
2.5.4 改变您授权同意的范围
|
||||
</view>
|
||||
<view>
|
||||
(1)每个业务功能需要一些基本的个人信息才能得以完成。对于额外收集的个人信息的收集和使用,您可以随时给予或收回您的授权同意。您可以通过修改个人设置中的授权项目改变您授权同意的范围
|
||||
</view>
|
||||
<view>
|
||||
(2)当您收回同意后,我们将不再处理相应的个人信息。但您收回同意的决定,不会影响此前基于您的授权而开展的个人信息处理。
|
||||
</view>
|
||||
<view>
|
||||
2.5.5 我们如何处理未成年人的个人信息
|
||||
</view>
|
||||
<view>
|
||||
(1)我们的产品、网站和服务主要面向成人。如果没有父母或监护人的同意,不满18周岁的未成年人不得创建自己的用户账户。如您为未成年人的,建议您请您的父母或监护人仔细阅读本隐私政策,并在征得您的父母或监护人同意的前提下使用我们的服务或向我们提供信息。
|
||||
</view>
|
||||
<view>
|
||||
(2)对于经父母同意而收集未成年人个人信息的情况,我们只会在受到法律允许、父母或监护人明确同意或者保护未成年人所必要的情况下使用或公开披露此信息。
|
||||
</view>
|
||||
<view>
|
||||
(3)如果我们发现自己在未事先获得可证实的父母同意的情况下收集了未成年人的个人信息,则会设法尽快删除相关数据。
|
||||
</view>
|
||||
<view>
|
||||
2.5.6 您的个人信息如何在全球范围转移
|
||||
</view>
|
||||
<view>
|
||||
原则上,我们在中华人民共和国境内收集和产生的个人信息,将存储在中华人民共和国境内,以下情形除外:
|
||||
</view>
|
||||
<view>
|
||||
(1)适用的法律有明确规定;
|
||||
</view>
|
||||
<view>
|
||||
(2)获得您的明确授权;
|
||||
</view>
|
||||
<view>
|
||||
(3)您通过互联网进行跨境交易等个人主动行为。
|
||||
</view>
|
||||
<view>
|
||||
针对以上情形,我们会确保依据本隐私权政策对您的个人信息提供足够的保护。
|
||||
</view>
|
||||
<view>
|
||||
2.5.7 本隐私协议如何更新
|
||||
</view>
|
||||
<view>
|
||||
我们可能适时会对本隐私协议进行调整或变更,本隐私协议的任何更新将以在线公告、系统通知等方式进行变更公告,除法律法规或监管规定另有强制性规定外,经调整或变更的内容一经公布,立即或在公告明确的特定时间自动生效。如您在隐私协议调整或变更后继续使用我们提供的任一服务或访问我们相关网站的,我们相信这代表您已充分阅读、理解并接受修改后的隐私协议并受其约束。如您不同意调整或变更后的隐私协议,请您停止使用我们提供的服务或访问我们相关网站。
|
||||
</view>
|
||||
<view>
|
||||
2.5.8 如何联系我们
|
||||
</view>
|
||||
<view>
|
||||
如果您对本隐私协议有任何疑问、通过以下方式与我们联系:
|
||||
</view>
|
||||
<view>
|
||||
电话:400-833-3131
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.contoner {
|
||||
padding: 20rpx 32rpx;
|
||||
letter-spacing: 6rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,212 @@
|
|||
<template>
|
||||
<div class="contioner">
|
||||
<h3 class="cneter">鲨鱼云康软件许可及用户服务协议</h3>
|
||||
<p>欢迎您使用鲨鱼云康App!本协议仅适用于湖南鲨鱼健康有限公司的鲨鱼云康App提供的产品或服务,
|
||||
包括您访问鲨鱼云康App使用平台提供的服务。</p>
|
||||
<p>最近更新日期:2024年01月15日,版本号为v1.00</p>
|
||||
<p>版本生效日期:2024年01月15日</p>
|
||||
<p>
|
||||
在您接受《鲨鱼云康软件许可及用户服务协议》(以下简称《协议》)之前,
|
||||
请务必认真阅读和理解《协议》中规定的所有权利和限制,如您未满18周岁,
|
||||
请与您的法定监护人一起阅读本服务条款,以确保您以及您的父母或监护人充分理解本服务条款的全部内容。
|
||||
</p>
|
||||
<p>
|
||||
本《协议》是服务用户(“您”或“用户”)与湖南鲨鱼健康有限公司 (“鲨鱼云康册”或“我们”)之间的法律协议。
|
||||
用户一旦注册、登录、使用或以任何方式使用本《协议》所涉及的相关服务的行为将视为对本《协议》的接受,即表示用户享受由《协议》提供的各项权利,
|
||||
并同意接受本《协议》各项条款的约束。如果用户不同意本《协议》中的条款,请不要注册、登录或使用本《协议》相关服务。
|
||||
</p>
|
||||
<p>鲨鱼云康有权修订本协议,更新后的协议条款将公布于软件,自公布之日起生效。用户可重新下载安装本软件。
|
||||
在鲨鱼云康修改本协议条款后,如果用户不接受修改后的条款,请立即停止使用鲨鱼云康提供的鲨鱼云康软件和服务,
|
||||
用户继续使用鲨鱼云康提供的鲨鱼云康软件和服务将被视为已接受了修改后的协议。
|
||||
</p>
|
||||
<h3>一、软件授权范围</h3>
|
||||
<p>1.1鲨鱼云康就鲨鱼云康给予用户一项个人的、不可转让、不可转授权以及非独占性的许可。</p>
|
||||
<p>
|
||||
1.2用户可以为非商业目的在单一台移动终端设备上安装、使用、显示、运行鲨鱼云康。但用户不得为商业运营目的安装、使用、运行鲨鱼云康。如果需要进行商业性的销售、复制和散发,例如软件预装和捆绑,必须获得鲨鱼云康的书面授权和许可。
|
||||
</p>
|
||||
<p>1.3用户不得未经鲨鱼云康许可,将鲨鱼云康安装在未经鲨鱼云康明示许可的其他终端设备上,包括但不限于机顶盒、游戏机、电视机、DVD机等。</p>
|
||||
<p>1.4用户可以为使用鲨鱼云康及服务的目的复制鲨鱼云康的一个副本,仅用作备份。备份副本必须包含原软件中含有的所有著作权信息。</p>
|
||||
<p>1.5除本《协议》明示授权外,鲨鱼云康未授权给用户其他权利,若用户使用其他权利时须另外取得鲨鱼云康的书面同意。</p>
|
||||
<h3>二、软件的获取、安装、升级、卸载</h3>
|
||||
<p>
|
||||
2.1用户应当按照鲨鱼云康的指定网站或指定方式下载安装本软件产品。谨防在非指定网站下载本软件,以免移动终端设备感染能破坏用户数据和获取用户隐私信息的恶意程序。如果用户从未经鲨鱼云康授权的第三方获取本软件或与本软件名称相同的安装程序,鲨鱼云康无法保证该软件能够正常使用,并对因此给您造成的损失不予负责。
|
||||
</p>
|
||||
<p>2.2用户必须选择与所安装终端设备相匹配的本软件版本,否则,由于软件与设备型号不相匹配所导致的任何软件问题、设备问题或损害,均由用户自行承担。</p>
|
||||
<p>
|
||||
2.3为了改善用户体验、完善服务内容,鲨鱼云康有权不时地为您提供本软件替换、修改、功能强化、升级版本,为了保证鲨鱼云康软件及服务的安全性和功能的一致性,鲨鱼云康软件及服务提供者有权不向您特别通知而对软件进行更新,或者对软件的部分功能效果进行改变或限制,也有权为替换、修改、功能强化或升级收取费用,但收费将提前征得您的同意。本软件在升级时,视用户使用的软件版本差异,鲨鱼云康提供给用户自行选择是否需要升级的提示。软件新版本发布后,鲨鱼云康不保证旧版本的鲨鱼云康继续可用。
|
||||
</p>
|
||||
<p>2.4如果您不再需要使用本软件或者需要安装新版软件,您可以自行卸载。</p>
|
||||
<h3>三、软件的使用规范</h3>
|
||||
<p>除非法律允许或已经获得鲨鱼云康软件服务提供者的书面授权,您在软件使用过程中不得从事下列行为:</p>
|
||||
<p>3.1删除本软件及其他副本上一切关于版权的信息,以及修改、删除或避开本软件为保护知识产权而设置的技术措施。</p>
|
||||
<p>3.2对本软件进行反向工程,如反汇编、反编译或者其他试图获得本软件的源代码。</p>
|
||||
<p>3.3通过修改或伪造软件运行中的指令、数据,增加、删减、变动软件的功能或运行效果或者将用于上述用途的软件、方法进行运营或向公众传播,无论这些行为是否为商业目的。</p>
|
||||
<p>3.4使用本软件进行任何危害网络安全的行为,包括但不限于:</p>
|
||||
<p>3.4.1使用未经许可的数据或进入未经许可的服务器/账户;</p>
|
||||
<p>3.4.2未经允许进入公众网络或者他人操作系统并删除、修改、增加存储信息;</p>
|
||||
<p>3.4.3未经许可企图探查、扫描、测试本软件的系统或网络的弱点或其它实施破坏网络安全的行为;</p>
|
||||
<p>3.4.4企图干涉、破坏本软件系统或网站的正常运行,故意传播恶意程序或病毒以及其他破坏干扰正常网络信息服务的行为;</p>
|
||||
<p>3.4.5伪造TCP/IP数据包名称或部分名称;</p>
|
||||
<p>3.4.6用户通过非鲨鱼云康公司开发、授权或认可的第三方兼容软件、系统登录或使用本软件及服务,或制作、发布、传播上述工具;</p>
|
||||
<p>3.4.7未经鲨鱼云康书面同意,用户对软件及其中的信息擅自实施包括但不限于下列行为:使用、出租、出借、复制、修改、链接、转载、汇编、发表、出版,建立镜像站点、擅自借助本软件发展与之有关的衍生产品、作品、服务、插件、外挂、兼容、互联等;
|
||||
</p>
|
||||
<p>3.4.8利用本软件发表、传送、传播、储存违反当地法律法规或侵害他人知识产权、商业秘密等合法权利的内容;</p>
|
||||
<p>3.4.9利用本软件批量发表、传送、传播广告信息及垃圾信息;</p>
|
||||
<p>3.5对鲨鱼云康软件及服务提供者拥有知识产权的内容进行使用、出租、出借、复制、修改、链接、转载、江编、发表、出版、建立镜像站点等。</p>
|
||||
<p>3.6对本软件或者本软件运行过程中释放到任何终端内存中的数据、软件运行过程中客户端与服务器端的交互数据,以及本软件运行所必需的系统数据,进行复制、修改、增加、删除、挂接运行或创作任何衍生作品,形式包括但不限于使用插件、外挂或非鲨鱼云康软件及服务提供者授权的第三方工具服务接入本软件和相关系统。
|
||||
</p>
|
||||
<p>3.7自行或者授权他人、第三方软件对本软件及其组件、模块、数据进行干扰。</p>
|
||||
<p>3.8对鲨鱼云康或者鲨鱼云康运行过程中释放到任何终端设备内存中的数据及鲨鱼云康运行过程中客户端与服务器端的交互数据进行复制、更改、修改、挂接运行或创作任何衍生作品,形式包括但不限于使用插件、外挂或非经授权的第三方工具/服务接入本软件和相关系统。</p>
|
||||
<p>3.9其他以任何不合法的方式、为任何不合法的目的、或以任何与本协议许可使用不一致的方式使用本软件和鲨鱼云康提供的其他服:以及其他未经鲨鱼云康软件及服务提供者书面授权的行为。</p>
|
||||
<h3>四、账号注册及使用</h3>
|
||||
<p>4.1用户资格</p>
|
||||
<p>
|
||||
您确认,在您开始注册使用鲨鱼云康平台服务前、您已经具备中华人民共和国法律规定的与您行为相适应的民事权利能及行为能力。若您不具备前述能力,则您应当获得您法定监护人的同意,且您的法定监护人同意接受本协议并承担由此产生的责任。
|
||||
此外,您还需确保您不是任何国家、国际组织或者地区实施的贸易限制、制裁或其他法律、规限制的对象,否则您可能无法正常注册及使用鲨鱼云康平台服务。
|
||||
</p>
|
||||
<p>4.2账户注册</p>
|
||||
<p>4.2.1当您按照注册页面提示填写信息、阅读并同意本协议并完成全部注册程序后,您可获得鲨鱼云康平台帐号并成为鲨鱼云康平台用户。</p>
|
||||
<p>4.2.2在使用鲨鱼云康平台服务时,您应当按鲨鱼云康平台页面的提示,准确完整地提供您的信息,以便鲨鱼云康软件及服务提供者或其他用户可与您取得有效联系。您保证您提供信息的真实性及有效性。</p>
|
||||
<p>4.2.3您设置的昵称、头像不得违反国家法律法规及鲨鱼云康平合规则的相关规定,否则鲨鱼云康软件服务提供者可回收您的昵称和头像。昵称回收不影响您以邮箱、手机号码登录鲨鱼云康平台。</p>
|
||||
<p>4.3账户使用</p>
|
||||
<p>4.3.1用户一旦注册成功成为用户,用户将拥有一个帐号,用户需要对自己在帐户中的所有活动和事件负全责。如果由于用户的过失导致用户的帐号和密码脱离用户的控制,则由此导致的针对用户、鲨鱼云康或任何第三方造成的损害,用户将承担全部责任。
|
||||
</p>
|
||||
<p>4.3.2您有权使用您设置或确认的密码登录鲨鱼云康平台。您的帐号仅限您本人使用。未经鲨鱼云康软件及服务提供者同意,您不得许可或转让第三方使用帐号。如鲨鱼云康平台判断您的帐号使用可能危及您的账户安全及/或鲨鱼云康平台的信息安全时,鲨鱼云康软件及服务提供者有权拒绝提供相应服务或终止本协议。请您在使用鲨鱼云康账号时,遵守法律法规的要求,不侵犯任何第三人的权益,尤其是字体、图片等知识产权。
|
||||
</p>
|
||||
<p>4.3.3用户有权随时更改密码,用户同意若发现任何安全漏洞或非法使用用户账号的情况,用户应当立即通知鲨鱼云康。</p>
|
||||
<p>4.3.4用户同意在未经适当授权的情况下,在任何时候均不使用其他成员的账户。</p>
|
||||
<p>4.4更新维护</p>
|
||||
<p>4.4.1您应当及时更新您提供的信息。在法律法规的要求下,鲨鱼云康软件及服务提供者有权对您的信息进行检查核实,您应当配合提供最新真实、完整、合法、有效的信息。</p>
|
||||
<p>4.4.2如鲨鱼云康软件及服务提供者按您最后一次提供的信息与您联系未果,您未按鲨鱼云康平台的要求及时提供信息,您提供的信息不真实、不合法、不完整、无效的,您将承担由此产生的责任与后果。鲨鱼云康软件及服务提供者有权向您发出询问或要求整改的通知。
|
||||
</p>
|
||||
<p>4.5账号安全规范</p>
|
||||
<p>4.5.1您的帐号由您自行保管。您需保管好您的帐号及密码,并确保您在每个上网时段结束时退出登录并以正确步骤离开鲨鱼云康平台。</p>
|
||||
<p>4.5.2因您主动泄露帐号密码或因您遭受他人攻击、诈骗等行为导致密码泄露产生的损失及后果,鲨鱼云康软件及服务提供者并不承担责任。您应通过司法、行政等救济途径向侵权行为人追责。</p>
|
||||
<p>4.5.3您应对您帐号项下的所有行为负责,鲨鱼云康软件及服务提供者不对你的行为承担责任。</p>
|
||||
<p>4.5.4如发现任何未经授权的行为或其他可能导致您帐号遭窃、遗失的情形,建议您立即通知鲨鱼云康软件及服务提供者。您理解鲨鱼云康软件及服务提供者对您的任何请求响应需要合理时间。鲨鱼云康软件及服务提供者应您请求而采取的行动可能无法避免或阻止侵害后果的形成或扩大,除自身存在过错外,鲨鱼云康软件及服务提供者不承担任何责任。
|
||||
</p>
|
||||
<p>4.6 隐私保护详见《隐私政策》。</p>
|
||||
<h3>五、服务内容</h3>
|
||||
<p>5.1鲨鱼云康网站网络服务的具体内容由鲨鱼云康根据实际情况提供,包括但不限于鲨鱼云康开放平台、应用商店等企业服务、游戏、论坛等。</p>
|
||||
<p>5.2用户理解并接受,鲨鱼云康仅提供相关的网络服务,除此之外与相关网络服务有关的设备(如个人电脑、手机、及其他与接入互联网或移动互联网有关的装置)及所需的费用(如为接入互联网而支付的电话费及上网费)均应由用户自行负担。
|
||||
</p>
|
||||
<p>5.3用户应输入帐号和密码登录鲨鱼云康帐户。</p>
|
||||
<p>5.4除了鲨鱼云康提供的软件和服务,用户还可以用鲨鱼云康帐号登录使用鲨鱼云康合作伙伴的相关服务。</p>
|
||||
<p>5.5您可通过智能连接服务,在不同场景下使用智能设备。您应理解,智能连接受限于实际场景变化及设备性能的限制,可能无法完全按照您的意愿达到使用目的。如您使用过程中有疑问,请联系鲨鱼云康客服寻求帮助。</p>
|
||||
<p>5.6您可按照平台提供菜谱服务,自行选择烹任方式。食谱内容仅供参考,应结合自身实际做出适于自身条件的选择。</p>
|
||||
<p>5.7您理解并同意,智能服务是鲨鱼云康软件及服务提供者基于现有技术提供的,不能完全避免潜在技术风险导致的服务差异或不足。您应自行评估、判断该等服务对自身的影响,不会就服务目的未达到即要求鲨鱼云康软件及服务提供者承担任何赔偿责任。
|
||||
</p>
|
||||
<h3>六、使用规则</h3>
|
||||
<p>6.1用户在使用本服务时,应当遵守相关的法律法规,包括但不限于《中华人民共和国宪法》、《中华人民共和国刑法》、《中华人民共和国民法通则》、《中华人民共和国合同法》《中华人民共和国著作权法》、《中华人民共和国电信条例》、《互联网信息服务管理办法》、《互联网电子公告服务管理规定》、《中华人民共和国保守国家秘密法》、《中华人民共和国计算机信息系统安全保护条例》、《计算机信息网络国际联网安全保护管理办法》、《全国人民代表大会常务委员会关于维护互联网安全的决定》及其相关的司法解释。
|
||||
</p>
|
||||
<p>6.2用户在使用本服务的过程中,必须遵守以下原则:</p>
|
||||
<p>6.2.1遵守所有与网络服务有关的网络协议规定和程序;</p>
|
||||
<p>6.2.2不得进行任何可能对互联网的正常运转造成不利影响的行为;</p>
|
||||
<p>6.2.3不得为任何非法目的或为任何商业目的而使用本服务;</p>
|
||||
<p>6.2.4不得进行任何不利于鲨鱼云康开放平台的行为;</p>
|
||||
<p>6.2.5不得传输任何骚扰性的、中伤他人的辱骂性的、恐吓性的、庸俗淫秽的或其他任何非法的信息资料;</p>
|
||||
<p>6.3用户有权根据鲨鱼云康用户的规定使用鲨鱼云康账号提供的相关服务。</p>
|
||||
<p>6.4如果用户在使用过程中注册资料发生变更,则用户应当及时更新准确的、详细的注册资料。</p>
|
||||
<p>6.5用户应当对以用户的用户账号进行的任何行为承担法律责任,包括但不限于用户本人/他人利用用户账号和密码所进行的一切行为。如因用户未保管好用户的账号和密码而给鲨鱼云康及其关联公司、第三方造成损失,用户应当进行全额赔偿,并消除影响。
|
||||
</p>
|
||||
<p>6.6用户理解并同意在使用鲨鱼云康账号提供的各项服务时,同意接受鲨鱼云康或第三方提供的各类信息服务。</p>
|
||||
<p>6.7 鲨鱼云康有权根据实际情况中断、变更、终止服务,且鲨鱼云康不需对用户或任何第三方承担任何责任。</p>
|
||||
<p>6.8信息发布规范</p>
|
||||
<p>6.8.1您在使用本软件时不得利用本软件从事以下行为,包括但不限于;
|
||||
<p>6.8.1.1制作、复制、发布、传播、储存违反当地法律法规的内容;</p>
|
||||
<p>6.8.1.2 发布、传送、传播、储存侵害他人名誉权、肖像权、知识产权、商业秘密等合法权利的内容;</p>
|
||||
<p>6.8.1.3虚构事实、隐瞒真相以误导、欺骗他人;</p>
|
||||
<p>6.8.1.4发表、传送、传播广告信息及垃圾信息;</p>
|
||||
<p>6.8.1.5从事其他违反当地法律法规的行为;</p>
|
||||
<p>6.8.2您可使用本软件发表属于您原创或您有权发表的观点看法、数据、文字、信息、用户名、图片、照片、个人信息、音频、视频文件链接等信息内容。您必须保证,您拥有您所上传信息内容的知识产权或已获得合法授权,您使用本软件及服务的任何行为未侵犯任何第三方之合法权益。
|
||||
</p>
|
||||
<p>6.8.3未经鲨鱼云康许可,您不得在本软件中进行任何诸如发布广告、销售商品的商业行为。</p>
|
||||
<h3>七、您理解并同意</h3>
|
||||
<p>7.1
|
||||
本软件同大多数互联网软件一样,可能会受多种因素影响,包括但不限于用户操作原因网络服务质量、社会环境等;也可能会受各种安全问题的侵扰,包括但不限于他人非法利用用户资料,进行现实生活的骚扰;用户下载安装的其他软件或访问的其他网站中可能含有病毒、本马程序或其他恶意程序,威胁您的终端设备信息和数据安全,继而影响本软件的正常使用等。因此,您应加强信息安全及个人信息的保护意识,注意密码保护,以免遭受损失。
|
||||
</p>
|
||||
<p>7.2您将合法地使用本软件,在使用本软件期间将遵守中华人民共和国法律。您承诺不制作发布、使用、传播用于窃取鲨鱼云康帐号及他人个人信息或财产的恶意程序,也不得利用本软件做出其他违反中华人民共和国法律法规的行为。7.3鲨鱼云康会对用户是否涉嫌违反上述使用规范做出认定,并根据认定结果中止、终止对您的使用许可或采取其他依本约定可采取的限制措施。
|
||||
</p>
|
||||
<p>7.4对于用户使用许可软件时发布的涉嫌违法或涉嫌侵犯他人合法权利或违反本协议的信息鲨鱼云康会直接删除。</p>
|
||||
<p>7.5维护软件安全与正常使用是鲨鱼云康软件及服务提供者和您的共同责任,鲨鱼云康将按照行业标准合理审慎地采取必要技术措施保护您的终端设备信息和数据安全,但是您承认和同意鲨鱼云康并不能就此提供完全保证。7.6责任限制:鲨鱼云康软件及服务提供者不对任何间接、特殊、偶发、惩罚或后果性损害负责无论该种责任是如何引起的以及在何种理论下触发的。前述责任包括但不限于合同责任或侵权责任,或者并非鲨鱼云康软件及服务提供者已知晓或应该知晓的可能损害
|
||||
</p>
|
||||
<h3>八、禁止行为</h3>
|
||||
<p>用户不得利用鲨鱼云康账号发布或传播敏感信息和违反中华人民共和国法律法规、政策的信息,包括但不限于下列信息:</p>
|
||||
<p>8.1违反宪法确定的基本原则的;</p>
|
||||
<p>8.2危害中华人民共和国统一、主权和领土完整的;</p>
|
||||
<p>8.3 泄露中华人民共和国秘密、危害中华人民共和国安全或者损害中华人民共和国荣誉和利益的;</p>
|
||||
<p>8.4 煽动民族仇恨、民族歧视,破坏民族团结,或者侵害民族风俗、习惯的;</p>
|
||||
<p>8.5宣扬邪教、迷信的;</p>
|
||||
<p>8.6 散布谣言,扰乱社会秩序,破坏社会稳定的;</p>
|
||||
<p>8.7 宣扬淫秽、赌博、暴力或者教唆犯罪的;
|
||||
<p>8.8侮辱或者诽谤他人,侵害他人合法权益的;</p>
|
||||
<p>8.9危害社会公德或者民族优秀文化传统的;</p>
|
||||
<p>8.10有法律、行政法规和中华人民共和国规定禁止的其他内容的。</p>
|
||||
<p>8.10 有法律、行政法规和中华人民共和国规定禁止的其他内容的。</p>
|
||||
<h3>九、服务变更、中断或终止</h3>
|
||||
<p>9.1鉴于网络服务的特殊性,用户同意鲨鱼云康有权根据业务发展情况随时变更、中断或终止部分或全部的网络服务而无需通知用户,也无需对任何用户或任何第三方承担任何责任。</p>
|
||||
<p>9.2用户理解,鲨鱼云康需要定期或不定期地对提供网络服务的平台(如互联网网站、移动网络等)或相关的设备进行检修或者维护,如因此类情况而造成网络服务在合理时间内的中断,鲨鱼云康无需为此承担任何责任,但鲨鱼云康应尽可能事先进行通告。
|
||||
</p>
|
||||
<p>9.3如发生下列任何一种情形,鲨鱼云康有权随时中断或终止向用户提供本《协议》项下的网络服务(包括收费网络服务)而无需对用户或任何第三方承担任何责任:</p>
|
||||
<p>9.3.1用户提供的个人资料不真实;</p>
|
||||
<p>9.3.2用户违反本《协议》中规定的使用规则。</p>
|
||||
<p>9.4鲨鱼云康有权在必要时修改本协议条款,协议条款一旦发生变动,将会在相关页面上公布修改后的协议条款。如果不同意所改动的内容,用户应主动取消此项服务。如果用户继续使用服务,则视为接受协议条款的变动。若用户不接受更新后的条款,将无法接受鲨鱼云康提供的服务。
|
||||
</p>
|
||||
<p>9.5鲨鱼云康和合作公司有权按需要修改或变更所提供的收费服务、收费标准、收费方式、服务费及服务条款。鲨鱼云康和合作公司将尽最大努力通过电邮或其他方式通知用户有关的修改或变更。</p>
|
||||
<h3>十、知识产权</h3>
|
||||
<p>10.1鲨鱼云康提供的网络服务中包含的任何文本、图片、图形、音频和/或视频资料均受版权商标和/或其它财产所有权法律的保护,未经相关权利人同意,上述资料均不得用于任何商业或非商业目的自行或许可任何第三方实施、利用、转让上述知识产权,鲨鱼云康保留追究上述行为法律责任的权利。
|
||||
</p>
|
||||
<p>10.2鲨鱼云康为提供网络服务而使用的任何软件(包括但不限于软件中所含的任何图像、照片、动画、录像、录音、音乐、文字和附加程序、随附的帮助材料)的一切权利均属于该软件的著作权人,均受您所在当地法律法规和相应的国际条约保护,鲨鱼云康享有上述知识产权。未经该软件的著作权人许可,用户不得对该软件进行反向工程
|
||||
(reverseengineer) 、反向编译(decompile)或反汇编 (disassemble)等违法操作。</p>
|
||||
<h3>十一、免责声明</h3>
|
||||
<p>11.1用户确认,其知悉本软件所有功能及智能管家为实现本软件各功能所进行的必要操作,其根据自身需求自愿选择使用本软件及相关服务因使用本软件及相关服务所存在的风险和一切后果将完全由其自己承担,本公司不承担任何责任。
|
||||
</p>
|
||||
<p>11.2用户必须自行配备移动终端设备上网和使用电信增值业务所需的设备,自行负担个人移动终端设备上网或第三方(包括但不限于电信或移动通信提供商)收取的通讯费、信息费等有关费用。如涉及电信增值服务的,我们建议用户与用户的电信增值服务提供商确认相关的费用问题。
|
||||
</p>
|
||||
<p>11.3用户因第三方如通讯线路故障、技术问题、网络、移动终端设备故障、系统不稳定性及其他各种不可抗力原因而遭受的一切损失,鲨鱼云康及合作单位不承担责任。</p>
|
||||
<p>11.4本软件经过详细的测试,但不能保证与所有的软硬件系统完全兼容,不能保证本软件完全没有错误。如果出现不兼容及软件错误的情况,用户可拨打技术支持电话,获得技术支持如果无法解决兼容性问题,用户可以删除本软件。
|
||||
</p>
|
||||
<p>11.5本软件同大多数互联网软件一样,受包括但不限于用户原因、网络服务质量、社会环境等因素的差异影响,可能受到各种安全问题的侵扰,如他人利用用户的资料,造成现实生活中的骚扰,用户下载安装的其它软件或访问的其他网站中含有“特洛伊木马”等病毒,威胁到用户的终端设备信息和数据的安全,继而影响本软件的正常使用等等。用户应加强信息安全及使用者资料的保护意识,要注意加强密码保护,以免遭致损失和骚扰。
|
||||
</p>
|
||||
<p>11.6因用户使用本软件或要求鲨鱼云康提供特定服务时,本软件可能会调用第三方系统或第三方软件支持用户的使用或访问,使用或访问的结果由该第三方提供,鲨鱼云康不保证通过第三方系统或第三方软件支持实现的结果的安全性、准确性、有效性及其他不确定的风险,由此若引发的任何争议及损害,鲨鱼云康不承担任何责任。
|
||||
</p>
|
||||
<p>11.7 为了保障公司业务发展和调整的自主权,鲨鱼云康公司拥有随时修改或中断服务而不需通知用户的权利,鲨鱼云康行使修改或中断服务的权利不需对用户或任何第三方负责。</p>
|
||||
<p>11.8除法律法规有明确规定外,我们将尽最大努力确保软件及其所涉及的技术及信息安全有效、准确、可靠,但受限于现有技术,请用户理解鲨鱼云康不能对此进行担保。</p>
|
||||
<p>11.9由于用户因下述任一情况所引起或与此有关的人身伤害或附带的、间接的经济损害赔偿,包括但不限于利润损失、资料损失、业务中断的损害赔偿或其他商业损害赔偿或损失,需由用户自行承担:</p>
|
||||
<p>11.9.1使用或未能使用许可软件;</p>
|
||||
<p>11.9.2第三方未经许可的使用软件或更改用户的数据;</p>
|
||||
<p>11.9.3用户使用软件进行的行为产生的费用及损失;</p>
|
||||
<p>11.9.4用户对软件的误解;</p>
|
||||
<p>11.9.5非因鲨鱼云康的原因引起的与软件有关的其他损失。</p>
|
||||
<p>11.10用户与其他使用软件的用户之间通过软件进行的行为,因用户受误导或欺骗而导致或可能导致的任何人身或经济上的伤害或损失,均由过错方依法承担所有责任。</p>
|
||||
<p>11.11用户使用鲨鱼云康的特定功能时,包括但不限于与其他成员共享家庭或设备的功能,由此产生的不良后果或经济损失鲨鱼云康将不承担责任。</p>
|
||||
<p>11.12为了改善用户体验、完善服务内容,鲨鱼云康将不断努力开发新的功能,并为用户不时提供软件更新
|
||||
(这些更新可能会采取软件替换、修改、功能强化、版本升级等形式)。因此,服务的现有功能随时可能因版本不同或鲨鱼云康的单方判断而被增加或修改,或因定期、不定期的维护而暂缓提供,鲨鱼云康也有权随时调整软件的名称、功能、展现形式等。
|
||||
</p>
|
||||
<h3>十二、法律及争议解决</h3>
|
||||
<p>12.1本协议适用中华人民共和国法律。</p>
|
||||
<p>12.2因本协议引起的或与本协议有关的任何争议,各方应友好协商解决,协商不成的,任何一方均应将有关争议提交至鲨鱼云康所在地有管辖权的人民法院管辖。</p>
|
||||
<h3>十三、其他条款</h3>
|
||||
<p>13.1本协议生效时间为2024年01月15日。</p>
|
||||
<p>13.2本协议所有条款的标题仅为阅读方便本身并无实际涵义,不能作为本协议涵义解释的依据。</p>
|
||||
<p>13.3如果本协议中的任何条款无论因何种原因完全或部分无效或不具有执行力,或违反任何适用的法律,则该条款被视为删除,但本协议的其余条款仍应有效并且有约束力。</p>
|
||||
<p>13.4鲨鱼云康有权随时根据有关法律、法规的变化以及公司经营状况和经营策略的调整等修改本协议,用户会在登录时收到确认信息,信息会告知用户如果继续使用产品将被视为用户接受修订后的协议。用户也可随时通过鲨鱼云康网站浏览最新服务协议条款。当发生有关争议时,以最新的协议文本为准。如果不同意鲨鱼云康对本协议相关条款所做的修改,用户有权停止使用网络服务。如果用户继续使用网络服务,则视为用户接受鲨鱼云康对本协议相关条款所做的修改。
|
||||
</p>
|
||||
<p>13.5鲨鱼云康在法律允许最大范围对本协议拥有解释权与修改权。</p>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.contioner {
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.cneter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
p {
|
||||
text-indent: 2rem;
|
||||
letter-spacing: 3px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,19 @@
|
|||
<template>
|
||||
<web-view :src="url"></web-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
url:''
|
||||
}
|
||||
},
|
||||
onLoad(opt){
|
||||
this.url=opt.url
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,253 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- 背景图片 -->
|
||||
<image src="https://shayu5qny.yhy.ren/revision/earnPointsBg.png" class="earnPointsBg"></image>
|
||||
<view class="contioner bg-video">
|
||||
<view class="flex">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="color">
|
||||
<view class="introduce text-df">
|
||||
欢迎使用线上健康评估工具,让我们一起探索您的健康需求吧!
|
||||
</view>
|
||||
<view class="evaluation">
|
||||
<view class="text-bold color">测评介绍</view>
|
||||
<view class="flex-align" style="color: #3F4040;margin-left: 12rpx;">
|
||||
<view class="text-center">
|
||||
<image src="https://shayu5qny.yhy.ren/intralTime.png" class="intralTime"></image>
|
||||
<view><text class="text-bold text-xl">{{times}}</text><text class="text-sm">分钟</text>
|
||||
</view>
|
||||
<view class="grey text-sm margin-top-xs">简单快速</view>
|
||||
</view>
|
||||
<view class="text-center">
|
||||
<image src="https://shayu5qny.yhy.ren/questions.png" class="intralTime"></image>
|
||||
<view><text class="text-bold text-xl">{{questionCount}}</text><text
|
||||
class="text-sm">题</text></view>
|
||||
<view class="grey text-sm margin-top-xs">专业量表</view>
|
||||
</view>
|
||||
<view class="text-center">
|
||||
<image src="https://shayu5qny.yhy.ren/peoples.png" class="intralTime"></image>
|
||||
<view><text class="text-bold text-xl">{{assessCount}}</text><text
|
||||
class="text-sm">人</text></view>
|
||||
<view class="grey text-sm margin-top-xs">已完成测评</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex" style="margin-top: 80rpx;">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="card">
|
||||
<block v-if="shuju.diseases!='95'">
|
||||
<view class="text-df grey">{{illustrate}}</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="text-bold color">说明:</view>
|
||||
<view class="text-df grey marginTop-sm">1、填写本问卷,您将获得您的专属健康报告及生活方式改善建议。</view>
|
||||
<view class="text-df grey margin-top-xs">2、本问卷测试结果仅供您自测参考,不作为医学诊断。</view>
|
||||
<view class="text-df grey margin-top-xs">3、您的所有信息,都将保密。</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex" style="margin-top: 80rpx;">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="card">
|
||||
<view class="btn" @click="startEvaluation">开始测评</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="literature" v-if="assessReferenceList!=null">
|
||||
<view class="text-bold color">参考文献</view>
|
||||
<block v-for="(item,index) in assessReferenceList" :key="index">
|
||||
<view class="marginTop-sm text-df grey" v-if="null!=item.referenceUrl && ''!=item.referenceUrl">
|
||||
<a v-bind:href="item.referenceUrl">[{{index+1}}]{{item.reference}}</a>
|
||||
</view>
|
||||
<view v-else>[{{index+1}}]{{item.reference}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '评估问卷',
|
||||
illustrate: '本测试结果仅供用户自测参考,不作为医学诊断。',
|
||||
formData: '',
|
||||
type: '',
|
||||
times: '', //评估时长
|
||||
questionCount: '', //评估题数
|
||||
assessCount: '', //评估人数
|
||||
shuju: null,
|
||||
assessReferenceList: null, //参考文献
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// let a={
|
||||
// userId: '29',
|
||||
// headSculpture: 'https://sharkbaby.yhy.ren/0042fab3c00f4fae80e3d2b732a0596a.jpg',
|
||||
// name: '寒王',
|
||||
// memberId: '0',
|
||||
// diseases: '95',
|
||||
// typed:2,
|
||||
// age:18,
|
||||
// }
|
||||
// let b={
|
||||
// userId: '29',
|
||||
// headSculpture: 'https://sharkbaby.yhy.ren/0042fab3c00f4fae80e3d2b732a0596a.jpg',
|
||||
// name: '寒王',
|
||||
// id: '0',
|
||||
// dicCode: '15',
|
||||
// typed:1,
|
||||
// }
|
||||
// let c={
|
||||
// userId: '1855',
|
||||
// headSculpture: 'https://sharkbaby.yhy.ren/0042fab3c00f4fae80e3d2b732a0596a.jpg',
|
||||
// name: '寒王',
|
||||
// planId: '15',
|
||||
// diseases: '103',
|
||||
// }
|
||||
// console.log(JSON.stringify(a))
|
||||
this.shuju = JSON.parse(options.params)
|
||||
this.formData = options.params
|
||||
this.type = this.shuju.typed
|
||||
},
|
||||
onShow() {
|
||||
let a, b = ''
|
||||
// 心理评估
|
||||
if (this.shuju.typed == 1) {
|
||||
a = this.shuju.dicCode
|
||||
b = this.shuju.id
|
||||
} else {
|
||||
a = this.shuju.diseases
|
||||
b = this.shuju.memberId
|
||||
}
|
||||
this.$API.getAssessInfo({
|
||||
data: {
|
||||
diseases: a, //评估id
|
||||
memberId: b, //成员id
|
||||
type: this.shuju.typed, //评估类型 1.心理 2.疾病
|
||||
userId: this.shuju.userId, //用户账号
|
||||
}
|
||||
}).then(res => {
|
||||
this.times = res.data.times
|
||||
this.questionCount = res.data.questionCount
|
||||
this.assessCount = res.data.assessCount
|
||||
this.assessReferenceList = res.data.assessReferenceList
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
startEvaluation() {
|
||||
// 心理评估问卷页
|
||||
if (this.type == '1') {
|
||||
uni.redirectTo({
|
||||
url: '/pages/psychological-assessment/index/index?params=' + this.formData
|
||||
})
|
||||
// 健康评估问卷页
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pages/health-risks/index/index?params=' + this.formData
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: linear-gradient(171deg, #EFFFFD 10.63%, #F4F8F7 73.62%);
|
||||
}
|
||||
|
||||
.topContioner {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
z-index: 10;
|
||||
|
||||
.leftBack {
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.earnPointsBg {
|
||||
width: 100vw;
|
||||
height: 574rpx;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.contioner {
|
||||
padding: 74rpx 32rpx 0;
|
||||
z-index: 2;
|
||||
|
||||
.color {
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.grey {
|
||||
color: #909292;
|
||||
}
|
||||
|
||||
.avare {
|
||||
$wh: 80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.introduce {
|
||||
padding: 20rpx;
|
||||
width: calc(502rpx - 40rpx);
|
||||
height: calc(120rpx - 40rpx);
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 0rpx 0rpx;
|
||||
}
|
||||
|
||||
.evaluation {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 26rpx 34rpx 24rpx 36rpx;
|
||||
margin-top: 16rpx;
|
||||
width: calc(502rpx - 70rpx);
|
||||
height: calc(278rpx - 50rpx);
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
||||
|
||||
.intralTime {
|
||||
$wh: 60rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
width: calc(502rpx - 40rpx);
|
||||
padding: 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 16rpx 16rpx;
|
||||
|
||||
.btn {
|
||||
width: 424rpx;
|
||||
text-align: center;
|
||||
line-height: 92rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
margin: 0 20rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.literature {
|
||||
padding: 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 16rpx 16rpx;
|
||||
margin: 60rpx 0 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,230 @@
|
|||
page {
|
||||
background: linear-gradient(90deg, #E3F5FF 0%, #ECF8FF 100%);
|
||||
width: 1080px;
|
||||
height: 1920px;
|
||||
}
|
||||
|
||||
.pageBox {
|
||||
padding: 36px 40px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.homeHide{
|
||||
$wh:80px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
position: absolute;
|
||||
bottom: 300px;
|
||||
right: -40px;
|
||||
image{
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
.homeShow{
|
||||
$wh:80px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
position: absolute;
|
||||
bottom: 300px;
|
||||
right: 20px;
|
||||
image{
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
.themColor {
|
||||
color: #3AAFB8;
|
||||
}
|
||||
.card {
|
||||
padding: 40px 40px 28px 40px;
|
||||
width: calc(100% - 80px);
|
||||
height: calc(1624px - 68px);
|
||||
background: #FFFFFF;
|
||||
.topImg{
|
||||
width: 502px;
|
||||
height: 290px;
|
||||
margin-right: 32px;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.leftWidth{
|
||||
width: 80px;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
text-align: center;
|
||||
background: #11ACFF;
|
||||
border-radius: 8px;
|
||||
font-size: 32px;
|
||||
color: #FFFFFF;
|
||||
margin-right: 12px;
|
||||
margin-top:10px;
|
||||
}
|
||||
.nameTitle{
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 48px;
|
||||
}
|
||||
.lowHeat{
|
||||
width: 48px;
|
||||
height: 62px;
|
||||
}
|
||||
::v-deep .uni-progress-bar {
|
||||
// 这主要是加上deep才能改变它原来的样式
|
||||
border-radius: 50px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
::v-deep .uni-progress-inner-bar{
|
||||
background: linear-gradient( 90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
.titleOne{
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 40px;
|
||||
color: #17191A;
|
||||
padding-top: 60px;
|
||||
}
|
||||
.item {
|
||||
border-bottom: 1px solid #EBEDF0;
|
||||
padding: 32px 0;
|
||||
}
|
||||
.left{
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
color: #17191A;
|
||||
margin-right: 32px;
|
||||
}
|
||||
.right{
|
||||
font-size: 32px;
|
||||
color: #3F4040;
|
||||
}
|
||||
.yuan{
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 4px;
|
||||
display: inline-block;
|
||||
}
|
||||
.dataList {
|
||||
color: #17191A;
|
||||
font-size: 32px;
|
||||
.title {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 40px;
|
||||
color: #17191A;
|
||||
margin-top: 60px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.cut{
|
||||
margin: 32px 0;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background: #EBEDF0;
|
||||
}
|
||||
|
||||
.right {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
span {
|
||||
padding: 0 20rpx;
|
||||
margin:0 30rpx 30rpx 0;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
}
|
||||
.audio {
|
||||
width: 100%;
|
||||
margin-bottom: 30rpx;
|
||||
audio {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.context {
|
||||
line-height: 44rpx;
|
||||
margin-bottom: 30rpx;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
.imageBox {
|
||||
width: 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottomSelect {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
|
||||
.bottomImg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.lineHeight{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36px;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.titleShow {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 40px;
|
||||
color: #3AAFB8;
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
width: 160px;
|
||||
height: 4px;
|
||||
background: #3AAFB8;
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
.bottomBack{
|
||||
width: 100%;
|
||||
line-height: 76px;
|
||||
text-align: center;
|
||||
background: rgba(255,255,255,0.4);
|
||||
border-radius: 38px;
|
||||
border: 1px solid #FFFFFF;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
color: #17191A;
|
||||
margin-top: 28px;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,165 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="pageShow">
|
||||
<view class="card flex flex-direction">
|
||||
<view class="flex justify-between">
|
||||
<view class="topImg">
|
||||
<image :src="fomeData.imgAddress"></image>
|
||||
</view>
|
||||
<view class="flex-sub flex justify-between flex-direction" style="margin: 24px 0 12px;">
|
||||
<view class="flex">
|
||||
<view class="leftWidth">{{tagLable}}</view>
|
||||
<view class="nameTitle flex-sub">{{fomeData.dishName}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<span class="themColor" style="font-size: 36px;">{{fomeData.heatAmount}}</span><span
|
||||
class="themColor" style="font-size: 28px;">千卡</span
|
||||
style="font-size: 28px;color:#666;"><span>/100克</span>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image src="../../static/images/lowHeat.png" class="lowHeat" style="margin-right: 8px;"></image>
|
||||
<view class="flex-sub" style="margin-top: 15px;">
|
||||
<progress :percent="fomeData.percentage" stroke-width="8" activeColor="#36AAB1"
|
||||
backgroundColor="#E5FDFF" />
|
||||
</view>
|
||||
<image src="../../static/images/highHeat.png" class="lowHeat" style="margin-left: 8px;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="flex-sub" style="height: 0;">
|
||||
<block v-if="imgIndex==0">
|
||||
<view class="titleOne">疾病人群进食提示</view>
|
||||
<view class="item flex" v-if="fomeData.foodsInfo.foodsLevelB">
|
||||
<span class="left"><span class="yuan" style="background: #10AB4A;"></span>优选</span>
|
||||
<view class="right flex-sub">{{fomeData.foodsInfo.foodsLevelB}}</view>
|
||||
</view>
|
||||
<view class="item flex" v-if="fomeData.foodsInfo.foodsLevelC">
|
||||
<span class="left"><span class="yuan" style="background: #F6A23D;"></span>可食</span>
|
||||
<view class="right flex-sub">{{fomeData.foodsInfo.foodsLevelC}}</view>
|
||||
</view>
|
||||
<view class="flex" style="padding-top: 32px;" v-if="fomeData.foodsInfo.foodsLevelE">
|
||||
<span class="left"><span class="yuan" style="background: #FF4545;"></span>限制</span>
|
||||
<view class="right flex-sub">{{fomeData.foodsInfo.foodsLevelE}}</view>
|
||||
</view>
|
||||
<block v-if="fomeData.prevent!=null">
|
||||
<view class="titleOne">食用说明</view>
|
||||
<view style="padding-top: 32px;font-size: 32px;color: #3F4040;"
|
||||
v-html="fomeData.prevent.replace(/(\r\n|\n|\r)/gm, '<br />')">
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<block v-for="(item,index) in fomeData.nutrientInfo" :key="index">
|
||||
<view class="dataList" :style="{borderRadius:index==0?'0 0 20rpx 20rpx':''}"
|
||||
v-if="item.info.length!=0">
|
||||
<view class="title">{{item.name}}</view>
|
||||
<block v-for="(v,i) in item.info" :key="i">
|
||||
<view class="flex-between">
|
||||
<view class="left">{{v.nutrientName}}</view>
|
||||
<view class="right">{{v.nutrientValue}} {{v.company?v.company:''}}</view>
|
||||
</view>
|
||||
<view class="cut" v-if="i<item.info.length-1"></view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="dataList" style="border-radius: 0 0 20rpx 20rpx">
|
||||
<view class="c_list_null" v-if="!fomeData.nutrientInfo.length">
|
||||
<image src="/static/images/nth2.png" class="nth_image" mode="widthFix" />
|
||||
<text class="text">暂无数据~</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="bottomSelect">
|
||||
<view class="bottomImg">
|
||||
<image
|
||||
:src="imgIndex==0?'https://sharkbaby.yhy.ren/leftBg.png':'https://sharkbaby.yhy.ren/rightBg.png'">
|
||||
</image>
|
||||
</view>
|
||||
<view class="bg-video lineHeight" @tap="selectChange(0)">
|
||||
<view :class="['title',imgIndex==0?'titleShow':'']">进食提示</view>
|
||||
<view class="tagWidth" v-if="imgIndex==0"></view>
|
||||
</view>
|
||||
<view class="bg-video lineHeight" @tap="selectChange(1)">
|
||||
<view :class="['title',imgIndex==1?'titleShow':'']">营养成分</view>
|
||||
<view class="tagWidth" v-if="imgIndex==1"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottomBack" @tap="back">返回上一页</view>
|
||||
<view class="homeHide" v-show="!isHome" @tap="backTap(0)">
|
||||
<image src="../../static/images/homeHide.png"></image>
|
||||
</view>
|
||||
<view class="homeShow" v-show="isHome" @tap="backTap(1)">
|
||||
<image src="../../static/images/homeShow.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
showLoading,
|
||||
hideLoading,
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
imgIndex: 0,
|
||||
tagLable: '',
|
||||
fomeData: {},
|
||||
id: null, //食物id
|
||||
userId:'29',
|
||||
pageShow: false,
|
||||
isHome: false, //返回首页图标是否显示
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
this.id=opt.id
|
||||
this.tagLable=opt.lableName
|
||||
this.getFoodsInfo()
|
||||
},
|
||||
methods: {
|
||||
selectChange(index) {
|
||||
this.imgIndex = index
|
||||
},
|
||||
// 获取食材详情
|
||||
async getFoodsInfo() {
|
||||
showLoading('加载中...')
|
||||
let ret = await this.$API.selectFoodsInfo({
|
||||
data: {
|
||||
foodsId: this.id,
|
||||
userId:this.userId
|
||||
}
|
||||
})
|
||||
// 去除数组为0的数据
|
||||
if (ret.data.nutrientInfo.length != 0) {
|
||||
ret.data.nutrientInfo.forEach((item, index) => {
|
||||
item.info = item.info.filter((item1) => item1.nutrientValue !== 0);
|
||||
});
|
||||
}
|
||||
this.fomeData = ret.data || {}
|
||||
this.$nextTick(() => {
|
||||
this.pageShow = true
|
||||
hideLoading()
|
||||
})
|
||||
},
|
||||
// 返回上一页
|
||||
back(){
|
||||
history.go(-1)
|
||||
},
|
||||
// 返回首页
|
||||
backTap(e) {
|
||||
if (e == 0) {
|
||||
this.isHome = true
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/hairtailScreen/bestFood/index/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './detail.scss'
|
||||
</style>
|
|
@ -0,0 +1,145 @@
|
|||
page {
|
||||
background: linear-gradient(90deg, #E3F5FF 0%, #ECF8FF 100%);
|
||||
width: 1080px;
|
||||
height: 1920px;
|
||||
}
|
||||
|
||||
.pageBox {
|
||||
padding: 40px;
|
||||
|
||||
.bestFoodBg {
|
||||
width: 100%;
|
||||
height: 1260px;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: calc(100% - 80px);
|
||||
height: calc(1260px - 88px);
|
||||
background: #FFFFFF;
|
||||
border-radius: 12px;
|
||||
padding: 48px 40px 40px 40px;
|
||||
color: #171919;
|
||||
position: relative;
|
||||
|
||||
.preNext{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 40px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.nothing{
|
||||
$wh:648px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin: 0 auto;
|
||||
margin-top: 160px;
|
||||
image{
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
.foodImg {
|
||||
width: 206px;
|
||||
height: 154px;
|
||||
}
|
||||
|
||||
.themColor {
|
||||
color: #3AAFB8;
|
||||
}
|
||||
|
||||
.rightArrow {
|
||||
$wh: 48px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
|
||||
.cutt {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background: #E9E9E9;
|
||||
margin: 24px 0 12px;
|
||||
}
|
||||
|
||||
.whiteBtn {
|
||||
width: 232px;
|
||||
line-height: 108px;
|
||||
text-align: center;
|
||||
border: 1px solid #FFFFFF;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 36px;
|
||||
color: #28A6B4;
|
||||
}
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
width: 317px;
|
||||
height: 150px;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
border-radius: 12px;
|
||||
border: 1px solid #FFFFFF;
|
||||
|
||||
.text-four {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.text-eight {
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.tagWidthShow {
|
||||
background: #11ACFF;
|
||||
}
|
||||
|
||||
.tagShow {
|
||||
background: #3AAFB8 !important;
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
.swiper {
|
||||
height: 316px;
|
||||
|
||||
.tag {
|
||||
width: 232px;
|
||||
height: 108px;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
border-radius: 12px 12px 12px 12px;
|
||||
border: 1px solid #FFFFFF;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
color: #42444F;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//设置轮播的指示点大小
|
||||
::v-deep .uni-swiper-dots {
|
||||
// 指示点整个区域
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
::v-deep .uni-swiper-dot {
|
||||
// 指示点元素默认样式
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
::v-deep .uni-swiper-dot-active {
|
||||
// 指示点元素激活(当前选中)状态样式
|
||||
width: 48px;
|
||||
height: 14px;
|
||||
background: #28A6B4;
|
||||
border-radius: 26px 26px 26px 26px;
|
||||
}
|
|
@ -0,0 +1,196 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="bestFoodBg" v-if="oneIndex==null||name==null">
|
||||
<image src="../../static/images/bestFoodBg.png" class="bestFoodBg"></image>
|
||||
</view>
|
||||
<view class="card" v-else>
|
||||
<view class="text-center text-bold" style="font-size: 48px;margin-bottom: 28px;color: #17191A;">最佳食物列表
|
||||
</view>
|
||||
<block v-if="foodList.length>0">
|
||||
<block v-for="(item,index) in foodList" :key="index">
|
||||
<view class="flex-between align-center" @tap="goDetail(item)">
|
||||
<view class="flex-contion">
|
||||
<view class="foodImg" style="margin-right: 48px;">
|
||||
<image :src="item.imgAddress" class="foodImg"></image>
|
||||
</view>
|
||||
<view>
|
||||
<view style="font-size: 44px;font-weight: 500;margin-bottom: 10px;">
|
||||
{{item.foodsName}}
|
||||
</view>
|
||||
<view>
|
||||
<span class="themColor" style="font-size: 36px;">{{item.energy}}</span>
|
||||
<span class="themColor" style="font-size: 28px;">千卡</span>
|
||||
<span style="font-size: 28px;color:#666;">/100克</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rightArrow">
|
||||
<image src="../../static/images/rightArrow.png" class="rightArrow"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cutt"></view>
|
||||
</block>
|
||||
<view class="flex justify-center preNext">
|
||||
<view class="whiteBtn" v-if="query.pageNum>1" @tap="previousPage">上一页</view>
|
||||
<view class="whiteBtn" v-if="totalWatch" @tap="nextPage">下一页</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="isPageShow&&foodList.length==0">
|
||||
<view class="nothing">
|
||||
<image src="../../static/images/nothing.png"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="flex-between" style="margin-top: 40px;">
|
||||
<block v-for="(item,index) in list" :key="index">
|
||||
<view :class="['tagWidth flex-conter flex-direction',index==oneIndex?'tagWidthShow':'']"
|
||||
@tap="oneChane(item,index)">
|
||||
<view class="text-four" :style="{'color':index==oneIndex?'#fff': '#42444F'}">{{item.name}}</view>
|
||||
<view class="text-eight" :style="{'color':index==oneIndex?'#fff': '#6E7477'}">{{item.subtitle}}
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="title">疾病选择</view>
|
||||
<swiper class="swiper" circular indicator-dots indicator-color="#fff" :current="currentIndex"
|
||||
@change="currentChange">
|
||||
<block v-for="(item,index) in diseaseList" :key="index">
|
||||
<swiper-item>
|
||||
<view class="flex-between flex-wrap">
|
||||
<view v-for="(item1,index1) in item" :key="index1"
|
||||
:class="['tag flex-conter',name==item1.diseaseName?'tagShow':'']" @tap="twoChane(item1)">
|
||||
{{item1.diseaseName}}
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
computed: {
|
||||
totalWatch() {
|
||||
return this.query.pageNum * 5 < this.total
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPageShow: false, //列表是否显示
|
||||
list: [{
|
||||
id: 1,
|
||||
name: '优选',
|
||||
subtitle: 'GOOD'
|
||||
}, {
|
||||
id: 2,
|
||||
name: '可食',
|
||||
subtitle: 'OK'
|
||||
}, {
|
||||
id: 3,
|
||||
name: '限制',
|
||||
subtitle: 'NO'
|
||||
}],
|
||||
oneIndex: null,
|
||||
currentIndex: 0, //滑块索引
|
||||
diseaseList: [],
|
||||
name: null,
|
||||
// 食物列表
|
||||
foodList: [],
|
||||
// 参数
|
||||
query: {
|
||||
diseaseIds: [],
|
||||
level: '1',
|
||||
pageSize: 5, //每页数据量
|
||||
pageNum: 1, //当前页码
|
||||
userId: '29',
|
||||
},
|
||||
total: 0, //总条数
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getLabel()
|
||||
},
|
||||
methods: {
|
||||
// 获取标签
|
||||
getLabel() {
|
||||
this.$API.selectDictListByFoodList({
|
||||
data: {
|
||||
userName: 'admin',
|
||||
diseaseType: 0,
|
||||
userId: this.query.userId,
|
||||
}
|
||||
}).then(res => {
|
||||
this.diseaseList = this.getArr(res.data, 8)
|
||||
})
|
||||
},
|
||||
getArr(arr, num) {
|
||||
let newArr = [...arr] // 因为splice会改变原数组,要深拷贝一下
|
||||
let list = []
|
||||
for (let i = 0; i < newArr.length;) {
|
||||
list.push(newArr.splice(i, num))
|
||||
}
|
||||
return list
|
||||
},
|
||||
getPageData() {
|
||||
this.isPageShow = false
|
||||
this.$API.getDiseaseFoodsLevel({
|
||||
data: this.query
|
||||
}).then(res => {
|
||||
if (res.code = 200) {
|
||||
this.foodList = res.rows
|
||||
this.total = res.total
|
||||
this.$nextTick(() => {
|
||||
this.isPageShow = true
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
oneChane(item, index) {
|
||||
if(this.name == null) return toast('请先选择疾病')
|
||||
this.oneIndex = index
|
||||
this.query.level = item.id
|
||||
this.query.pageNum = 1
|
||||
if (this.name != null) {
|
||||
this.getPageData()
|
||||
}
|
||||
},
|
||||
twoChane(item1) {
|
||||
this.name = item1.diseaseName
|
||||
this.query.diseaseIds[0] = item1.id
|
||||
this.query.pageNum = 1
|
||||
if (this.oneIndex != null) {
|
||||
this.getPageData()
|
||||
}
|
||||
},
|
||||
currentChange(e) {
|
||||
this.currentIndex = e.detail.current
|
||||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/hairtailScreen/bestFood/detail/detail?id=' + item.id + '&lableName=' + this.list[
|
||||
this.oneIndex].name
|
||||
})
|
||||
},
|
||||
// 上一页
|
||||
previousPage() {
|
||||
this.query.pageNum -= 1
|
||||
this.getPageData()
|
||||
},
|
||||
// 下一页
|
||||
nextPage() {
|
||||
this.query.pageNum += 1
|
||||
this.getPageData()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './index.scss';
|
||||
</style>
|
|
@ -0,0 +1,140 @@
|
|||
page {
|
||||
background: linear-gradient(90deg, #E3F5FF 0%, #ECF8FF 100%);
|
||||
width: 1080px;
|
||||
height: 1920px;
|
||||
}
|
||||
|
||||
.pageBox {
|
||||
padding: 36px 40px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.homeHide{
|
||||
$wh:80px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
position: absolute;
|
||||
bottom: 300px;
|
||||
right: -40px;
|
||||
image{
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
.homeShow{
|
||||
$wh:80px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
position: absolute;
|
||||
bottom: 300px;
|
||||
right: 20px;
|
||||
image{
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
.themColor {
|
||||
color: #3AAFB8;
|
||||
}
|
||||
.card {
|
||||
padding: 40px 40px 28px 40px;
|
||||
width: calc(100% - 80px);
|
||||
height: calc(1732px - 68px);
|
||||
background: #FFFFFF;
|
||||
.topTitle{
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 48px;
|
||||
color: #17191A;
|
||||
text-align: center;
|
||||
margin-bottom: 44px;
|
||||
}
|
||||
.topImg{
|
||||
width: 100%;
|
||||
height: 540px;
|
||||
position: relative;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.tagWidth{
|
||||
width: calc(840px - 160px);
|
||||
height: 118px;
|
||||
padding: 0 80px;
|
||||
background: rgba(255,255,255,0.9);
|
||||
border-radius: 12px 12px 12px 12px;
|
||||
border: 1px solid #FFFFFF;
|
||||
position: absolute;
|
||||
font-size: 36px;
|
||||
bottom: 40px;
|
||||
left: 40px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.greyColor{
|
||||
color: #6E7477;
|
||||
}
|
||||
.cutt{
|
||||
width: 2px;
|
||||
height: 42px;
|
||||
background: #6E7477;
|
||||
display: inline-block;
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
.exchange{
|
||||
$wh:92px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin: 0 auto;
|
||||
margin-top: 60px;
|
||||
margin-bottom: 60px;
|
||||
image{
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
.tagBg{
|
||||
width: calc(100% - 160px);
|
||||
height: 118px;
|
||||
background: #89CFD4;
|
||||
border-radius: 12px;
|
||||
font-size: 36px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 80px;
|
||||
margin-bottom: 48px;
|
||||
.cutt{
|
||||
width: 2px;
|
||||
height: 42px;
|
||||
background: rgba(255,255,255,0.4);
|
||||
display: inline-block;
|
||||
margin-left: 24px;
|
||||
}
|
||||
.colorWhite{
|
||||
color: rgba(255,255,255,0.8);
|
||||
}
|
||||
}
|
||||
.bottomTitle{
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
color: $uni-color;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.bottomBack{
|
||||
width: 100%;
|
||||
line-height: 76px;
|
||||
text-align: center;
|
||||
background: rgba(255,255,255,0.4);
|
||||
border-radius: 38px;
|
||||
border: 1px solid #FFFFFF;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
color: #17191A;
|
||||
margin-top: 28px;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="pageShow">
|
||||
<view class="card">
|
||||
<scroll-view scroll-y style="height: 100%;">
|
||||
<view class="topTitle">{{fomeData.foodTypeName}}食物列表</view>
|
||||
<view class="topImg">
|
||||
<image :src="fomeData.foodIcon"></image>
|
||||
<view class="tagWidth">
|
||||
<view class="flex align-center">
|
||||
<text style="color: #42444F;">{{fomeData.foodName}}</text>
|
||||
<text class="cutt"></text>
|
||||
</view>
|
||||
<view class="greyColor">100g</view>
|
||||
<view class="greyColor">{{fomeData.foodKcal}}{{fomeData.foodUnit}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="exchange">
|
||||
<image src="../../static/images/exchange.png"></image>
|
||||
</view>
|
||||
<block v-for="(item,index) in fomeData.foodInfos" :key="index">
|
||||
<view class="tagBg">
|
||||
<view class="flex align-center">
|
||||
<text style="color: #fff;">{{item.foodName}}</text>
|
||||
<text class="cutt"></text>
|
||||
</view>
|
||||
<view class="colorWhite">100g</view>
|
||||
<view class="colorWhite">{{item.foodKcal}}{{item.foodUnit}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="bottomTitle">热量合计:{{fomeData.foodKcalSum}}千卡</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="bottomBack" @tap="back">返回上一页</view>
|
||||
<view class="homeHide" v-show="!isHome" @tap="backTap(0)">
|
||||
<image src="../../static/images/homeHide.png"></image>
|
||||
</view>
|
||||
<view class="homeShow" v-show="isHome" @tap="backTap(1)">
|
||||
<image src="../../static/images/homeShow.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
showLoading,
|
||||
hideLoading,
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
fomeData: {},
|
||||
id: null, //食物id
|
||||
pageShow: false,
|
||||
isHome: false, //返回首页图标是否显示
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
this.id = opt.id
|
||||
this.getFoodsInfo()
|
||||
},
|
||||
methods: {
|
||||
// 获取食材详情
|
||||
async getFoodsInfo() {
|
||||
let ret = await this.$API.queryEeFoodInfoDetails({
|
||||
data: {
|
||||
id: this.id
|
||||
}
|
||||
})
|
||||
this.fomeData = ret.data || {}
|
||||
this.$nextTick(() => {
|
||||
this.pageShow = true
|
||||
})
|
||||
},
|
||||
// 返回上一页
|
||||
back() {
|
||||
history.go(-1)
|
||||
},
|
||||
// 返回首页
|
||||
backTap(e) {
|
||||
if (e == 0) {
|
||||
this.isHome = true
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/hairtailScreen/bestFood/index/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './detail.scss'
|
||||
</style>
|
|
@ -0,0 +1,188 @@
|
|||
page {
|
||||
background: linear-gradient(90deg, #E3F5FF 0%, #ECF8FF 100%);
|
||||
width: 1080px;
|
||||
height: 1920px;
|
||||
}
|
||||
|
||||
.pageBox {
|
||||
padding: 40px;
|
||||
|
||||
.bestFoodBg {
|
||||
width: 100%;
|
||||
height: 1260px;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: calc(100% - 80px);
|
||||
height: calc(1260px - 88px);
|
||||
background: #FFFFFF;
|
||||
border-radius: 12px;
|
||||
padding: 48px 40px 40px 40px;
|
||||
color: #171919;
|
||||
position: relative;
|
||||
|
||||
.preNext{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 40px;
|
||||
left: 0;
|
||||
}
|
||||
.nothing{
|
||||
$wh:648px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin: 0 auto;
|
||||
margin-top: 160px;
|
||||
image{
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
|
||||
.foodImg {
|
||||
width: 206px;
|
||||
height: 154px;
|
||||
}
|
||||
|
||||
.themColor {
|
||||
color: #3AAFB8;
|
||||
}
|
||||
|
||||
.rightArrow {
|
||||
$wh: 48px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
|
||||
.cutt {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background: #E9E9E9;
|
||||
margin: 24px 0 12px;
|
||||
}
|
||||
|
||||
.whiteBtn {
|
||||
width: 232px;
|
||||
line-height: 108px;
|
||||
text-align: center;
|
||||
border: 1px solid #FFFFFF;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 36px;
|
||||
color: #28A6B4;
|
||||
}
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
width: 317px;
|
||||
height: 150px;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
border-radius: 12px;
|
||||
border: 1px solid #FFFFFF;
|
||||
|
||||
.text-four {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.text-eight {
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.tagWidthShow {
|
||||
background: #11ACFF;
|
||||
}
|
||||
|
||||
.tagShow {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.tagHide{
|
||||
color: #42444F;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
.tag {
|
||||
width: 232px;
|
||||
height: 386px;
|
||||
background: rgba(255,255,255,0.4);
|
||||
border-radius: 12px 12px 12px 12px;
|
||||
border: 1px solid #FFFFFF;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
margin-top: 38px;
|
||||
.iconSelect{
|
||||
$wh:88px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin: 0 auto;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.exchangeTag{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.search{
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
position: relative;
|
||||
margin-top: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.inputClass{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 40px;
|
||||
padding-left: 40px;
|
||||
}
|
||||
.searchTitle{
|
||||
position: absolute;
|
||||
right: 66px;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 52px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//设置轮播的指示点大小
|
||||
::v-deep .uni-swiper-dots {
|
||||
// 指示点整个区域
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
::v-deep .uni-swiper-dot {
|
||||
// 指示点元素默认样式
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
::v-deep .uni-swiper-dot-active {
|
||||
// 指示点元素激活(当前选中)状态样式
|
||||
width: 48px;
|
||||
height: 14px;
|
||||
background: #28A6B4;
|
||||
border-radius: 26px 26px 26px 26px;
|
||||
}
|
|
@ -0,0 +1,164 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="bestFoodBg" v-if="!isPage">
|
||||
<image src="../../static/images/exchangeBg.png" class="bestFoodBg"></image>
|
||||
</view>
|
||||
<view class="card" v-else>
|
||||
<view class="text-center text-bold" style="font-size: 48px;margin-bottom: 28px;color: #17191A;">
|
||||
<text v-if="selectIndex!=null">{{diseaseList[selectIndex].foodType}}</text>食物列表
|
||||
</view>
|
||||
<block v-if="foodList.length>0">
|
||||
<block v-for="(item,index) in foodList" :key="index">
|
||||
<view class="flex-between align-center" @tap="goDetail(item)">
|
||||
<view class="flex-contion">
|
||||
<view class="foodImg" style="margin-right: 48px;">
|
||||
<image :src="item.foodIcon" class="foodImg"></image>
|
||||
</view>
|
||||
<view>
|
||||
<view style="font-size: 44px;font-weight: 500;margin-bottom: 10px;">{{item.foodName}}
|
||||
</view>
|
||||
<view>
|
||||
<span class="themColor" style="font-size: 36px;">{{item.foodKcal}}</span>
|
||||
<span class="themColor" style="font-size: 28px;">千卡</span>
|
||||
<span style="font-size: 28px;color:#666;">/100克</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rightArrow">
|
||||
<image src="../../static/images/rightArrow.png" class="rightArrow"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cutt"></view>
|
||||
</block>
|
||||
<view class="flex justify-center preNext">
|
||||
<view class="whiteBtn" v-if="pageNum>1" @tap="previousPage">上一页</view>
|
||||
<view class="whiteBtn" v-if="totalWatch" @tap="nextPage">下一页</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="isPageShow&&foodList.length==0">
|
||||
<view class="nothing">
|
||||
<image src="../../static/images/nothing.png"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="search">
|
||||
<image src="../../static/images/search.png"></image>
|
||||
<input placeholder="搜索您想要的食物" class="inputClass" v-model="contentText" @input="input" maxlength="17" />
|
||||
<view class="searchTitle" @tap="searchChange">搜索</view>
|
||||
</view>
|
||||
<view class="flex-between flex-wrap">
|
||||
<view v-for="(item,index) in diseaseList" :key="index"
|
||||
:class="['tag flex-conter bg-video',selectIndex==index?'tagShow':'tagHide']"
|
||||
@tap="twoChane(item,index)">
|
||||
<image v-if="selectIndex==index" src="../../static/images/exchangeTag.png" class="exchangeTag">
|
||||
</image>
|
||||
<view class="bg-video text-center">
|
||||
<view class="iconSelect">
|
||||
<image :src="selectIndex==index?item.iconNotSelect:item.iconSelect"></image>
|
||||
</view>
|
||||
<view style="margin-top: 16px;">{{item.foodType}}</view>
|
||||
<view :style="{fontSize:'20px',color:(selectIndex==index?'rgba(255,255,255,0.6)':'')}">
|
||||
{{item.english}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
computed: {
|
||||
totalWatch() {
|
||||
return this.pageNum * 5 < this.total
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
diseaseList: [],
|
||||
// 食物列表
|
||||
foodList: [],
|
||||
contentText: '', //搜索框
|
||||
typeCode: '', //分类id
|
||||
selectIndex: null, //索引
|
||||
pageSize: 5,
|
||||
pageNum: 1,
|
||||
isPage: false,
|
||||
total: 0, //总条数
|
||||
isPageShow: false, //列表是否显示
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$API.queryEeFoodType({
|
||||
data: {
|
||||
userId: 29
|
||||
}
|
||||
}).then(res => {
|
||||
this.diseaseList = res.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 选择
|
||||
twoChane(item, index) {
|
||||
this.selectIndex = index
|
||||
this.typeCode = item.id
|
||||
this.pageNum = 1
|
||||
this.getPageData()
|
||||
},
|
||||
// 列表数据
|
||||
getPageData() {
|
||||
this.isPageShow = false
|
||||
this.isPage = true
|
||||
this.$API.queryEeFoodInfo({
|
||||
data: {
|
||||
foodType: this.typeCode, //食物类型
|
||||
foodName: this.contentText, //食物名
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize,
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.foodList = res.rows
|
||||
this.total = res.total
|
||||
this.$nextTick(() => {
|
||||
this.isPageShow = true
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 搜索input框
|
||||
input(e) {
|
||||
this.contentText = e.detail.value
|
||||
},
|
||||
// 搜索按钮
|
||||
searchChange() {
|
||||
this.pageNum = 1
|
||||
this.getPageData()
|
||||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/hairtailScreen/exchangePortion/detail/detail?id=' + item.id
|
||||
})
|
||||
},
|
||||
// 上一页
|
||||
previousPage() {
|
||||
this.pageNum -= 1
|
||||
this.getPageData()
|
||||
},
|
||||
// 下一页
|
||||
nextPage() {
|
||||
this.pageNum += 1
|
||||
this.getPageData()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './index.scss';
|
||||
</style>
|
|
@ -0,0 +1,252 @@
|
|||
page {
|
||||
background: linear-gradient(90deg, #E3F5FF 0%, #ECF8FF 100%);
|
||||
width: 1080px;
|
||||
height: 1920px;
|
||||
}
|
||||
|
||||
.pageBox {
|
||||
padding: 36px 40px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.homeHide{
|
||||
$wh:80px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
position: absolute;
|
||||
bottom: 300px;
|
||||
right: -40px;
|
||||
image{
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
.homeShow{
|
||||
$wh:80px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
position: absolute;
|
||||
bottom: 300px;
|
||||
right: 20px;
|
||||
image{
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
.themColor {
|
||||
color: #3AAFB8;
|
||||
}
|
||||
.card {
|
||||
padding: 40px 40px 28px 40px;
|
||||
width: calc(100% - 80px);
|
||||
height: calc(1624px - 68px);
|
||||
background: #FFFFFF;
|
||||
.imgAddress{
|
||||
width: 206px;
|
||||
height: 154px;
|
||||
margin-right: 46px;
|
||||
}
|
||||
.titleInter{
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 44px;
|
||||
color: #171919;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.tag{
|
||||
min-width: 48px;
|
||||
line-height: 80px;
|
||||
background: #89CFD4;
|
||||
border-radius: 8px;
|
||||
padding: 0 8px;
|
||||
font-size: 32px;
|
||||
color: #FFFFFF;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.topImg{
|
||||
width: 502px;
|
||||
height: 290px;
|
||||
margin-right: 32px;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.leftWidth{
|
||||
padding: 0 8px;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
text-align: center;
|
||||
background: #3AAFB8;
|
||||
border-radius: 8px;
|
||||
font-size: 32px;
|
||||
color: #FFFFFF;
|
||||
margin-right: 12px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.nameTitle{
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 48px;
|
||||
}
|
||||
.lowHeat{
|
||||
width: 48px;
|
||||
height: 62px;
|
||||
}
|
||||
::v-deep .uni-progress-bar {
|
||||
// 这主要是加上deep才能改变它原来的样式
|
||||
border-radius: 50px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
::v-deep .uni-progress-inner-bar{
|
||||
background: linear-gradient( 90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
.titleOne{
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 40px;
|
||||
color: #17191A;
|
||||
padding-top: 60px;
|
||||
}
|
||||
.item {
|
||||
border-bottom: 1px solid #EBEDF0;
|
||||
padding: 32px 0;
|
||||
}
|
||||
.left{
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
color: #17191A;
|
||||
margin-right: 32px;
|
||||
}
|
||||
.right{
|
||||
font-size: 32px;
|
||||
color: #3F4040;
|
||||
}
|
||||
.yuan{
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 4px;
|
||||
display: inline-block;
|
||||
}
|
||||
.dataList {
|
||||
color: #17191A;
|
||||
font-size: 32px;
|
||||
.title {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 40px;
|
||||
color: #17191A;
|
||||
margin-top: 60px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.cut{
|
||||
margin: 32px 0;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background: #EBEDF0;
|
||||
}
|
||||
|
||||
.right {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
span {
|
||||
padding: 0 20rpx;
|
||||
margin:0 30rpx 30rpx 0;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
}
|
||||
.audio {
|
||||
width: 100%;
|
||||
margin-bottom: 30rpx;
|
||||
audio {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.context {
|
||||
line-height: 44rpx;
|
||||
margin-bottom: 30rpx;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
.imageBox {
|
||||
width: 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottomSelect {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
|
||||
.bottomImg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.lineHeight{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36px;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.titleShow {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 40px;
|
||||
color: #3AAFB8;
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
width: 160px;
|
||||
height: 4px;
|
||||
background: #3AAFB8;
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
.bottomBack{
|
||||
width: 100%;
|
||||
line-height: 76px;
|
||||
text-align: center;
|
||||
background: rgba(255,255,255,0.4);
|
||||
border-radius: 38px;
|
||||
border: 1px solid #FFFFFF;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
color: #17191A;
|
||||
margin-top: 28px;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,156 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="pageShow">
|
||||
<view class="card flex flex-direction">
|
||||
<view class="flex justify-between">
|
||||
<view class="topImg">
|
||||
<image :src="fomeData.imgAddress"></image>
|
||||
</view>
|
||||
<view class="flex-sub flex justify-between flex-direction" style="margin: 24px 0 12px;">
|
||||
<view class="flex">
|
||||
<view class="leftWidth">{{tagLable}}</view>
|
||||
<view class="nameTitle flex-sub">{{fomeData.dishName}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<span class="themColor" style="font-size: 36px;">{{fomeData.heatAmount}}</span><span
|
||||
class="themColor" style="font-size: 28px;">千卡</span
|
||||
style="font-size: 28px;color:#666;"><span>/100克</span>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<image src="../../static/images/lowHeat.png" class="lowHeat" style="margin-right: 8px;"></image>
|
||||
<view class="flex-sub" style="margin-top: 15px;">
|
||||
<progress :percent="fomeData.percentage" stroke-width="8" activeColor="#36AAB1"
|
||||
backgroundColor="#E5FDFF" ></progress>
|
||||
</view>
|
||||
<image src="../../static/images/highHeat.png" class="lowHeat" style="margin-left: 8px;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="flex-sub" style="height: 0;">
|
||||
<block v-if="imgIndex==0">
|
||||
<block v-for="(item,index) in fomeData.nutrientInfo" :key="index">
|
||||
<view class="dataList" :style="{borderRadius:index==0?'0 0 20rpx 20rpx':''}"
|
||||
v-if="item.info.length!=0">
|
||||
<view class="title">{{item.name}}</view>
|
||||
<block v-for="(v,i) in item.info" :key="i">
|
||||
<view class="flex-between">
|
||||
<view class="left">{{v.nutrientName}}</view>
|
||||
<view class="right">{{v.nutrientValue}} {{v.company?v.company:''}}</view>
|
||||
</view>
|
||||
<view class="cut" v-if="i<item.info.length-1"></view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="dataList" style="border-radius: 0 0 20rpx 20rpx">
|
||||
<view class="c_list_null" v-if="!fomeData.nutrientInfo.length">
|
||||
<image src="/static/images/nth2.png" class="nth_image" mode="widthFix" />
|
||||
<text class="text">暂无数据~</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view style="padding-top: 24px;"></view>
|
||||
<block v-for="(item,index) in fomeData.dishInfo" :key="index">
|
||||
<view class="flex align-center" style="margin-top: 36px;">
|
||||
<image :src="item.imgAddress" class="imgAddress"></image>
|
||||
<view>
|
||||
<view class="titleInter">{{item.dishName}}</view>
|
||||
<view v-if="item.tags" class="flex flex-wrap">
|
||||
<view v-for="(item2,index2) in item.tags.split('、')" class="tag">{{item2}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="bottomSelect">
|
||||
<view class="bottomImg">
|
||||
<image
|
||||
:src="imgIndex==0?'https://sharkbaby.yhy.ren/leftBg.png':'https://sharkbaby.yhy.ren/rightBg.png'">
|
||||
</image>
|
||||
</view>
|
||||
<view class="bg-video lineHeight" @tap="selectChange(0)">
|
||||
<view :class="['title',imgIndex==0?'titleShow':'']">营养成分</view>
|
||||
<view class="tagWidth" v-if="imgIndex==0"></view>
|
||||
</view>
|
||||
<view class="bg-video lineHeight" @tap="selectChange(1)">
|
||||
<view :class="['title',imgIndex==1?'titleShow':'']">菜品搭配</view>
|
||||
<view class="tagWidth" v-if="imgIndex==1"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottomBack" @tap="back">返回上一页</view>
|
||||
<view class="homeHide" v-show="!isHome" @tap="backTap(0)">
|
||||
<image src="../../static/images/homeHide.png"></image>
|
||||
</view>
|
||||
<view class="homeShow" v-show="isHome" @tap="backTap(1)">
|
||||
<image src="../../static/images/homeShow.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
showLoading,
|
||||
hideLoading,
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
imgIndex: 0,
|
||||
tagLable: '',
|
||||
fomeData: {},
|
||||
id: null, //食物id
|
||||
userId: '29',
|
||||
pageShow: false,
|
||||
isHome: false, //返回首页图标是否显示
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
this.tagLable=opt.lableName
|
||||
this.id = opt.id
|
||||
this.getFoodsInfo()
|
||||
},
|
||||
methods: {
|
||||
selectChange(index) {
|
||||
this.imgIndex = index
|
||||
},
|
||||
// 获取食材详情
|
||||
async getFoodsInfo() {
|
||||
let ret = await this.$API.selectFoodsInfo({
|
||||
data: {
|
||||
foodsId: this.id,
|
||||
userId: this.userId
|
||||
}
|
||||
})
|
||||
// 去除数组为0的数据
|
||||
if (ret.data.nutrientInfo.length != 0) {
|
||||
ret.data.nutrientInfo.forEach((item, index) => {
|
||||
item.info = item.info.filter((item1) => item1.nutrientValue !== 0);
|
||||
});
|
||||
}
|
||||
this.fomeData = ret.data || {}
|
||||
this.$nextTick(() => {
|
||||
this.pageShow = true
|
||||
})
|
||||
},
|
||||
// 返回上一页
|
||||
back() {
|
||||
history.go(-1)
|
||||
},
|
||||
// 返回首页
|
||||
backTap(e) {
|
||||
if (e == 0) {
|
||||
this.isHome = true
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/hairtailScreen/foodIngredients/index/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './detail.scss'
|
||||
</style>
|
|
@ -0,0 +1,191 @@
|
|||
page {
|
||||
background: linear-gradient(90deg, #E3F5FF 0%, #ECF8FF 100%);
|
||||
width: 1080px;
|
||||
height: 1920px;
|
||||
}
|
||||
|
||||
.pageBox {
|
||||
padding: 40px;
|
||||
|
||||
.bestFoodBg {
|
||||
width: 100%;
|
||||
height: 1260px;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: calc(100% - 80px);
|
||||
height: calc(1260px - 88px);
|
||||
background: #FFFFFF;
|
||||
border-radius: 12px;
|
||||
padding: 48px 40px 40px 40px;
|
||||
color: #171919;
|
||||
position: relative;
|
||||
|
||||
.preNext{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 40px;
|
||||
left: 0;
|
||||
}
|
||||
.nothing{
|
||||
$wh:648px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin: 0 auto;
|
||||
margin-top: 160px;
|
||||
image{
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
|
||||
.foodImg {
|
||||
width: 206px;
|
||||
height: 154px;
|
||||
}
|
||||
|
||||
.themColor {
|
||||
color: #3AAFB8;
|
||||
}
|
||||
|
||||
.rightArrow {
|
||||
$wh: 48px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
|
||||
.cutt {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
margin: 24px 0 12px;
|
||||
}
|
||||
|
||||
.whiteBtn {
|
||||
width: 232px;
|
||||
line-height: 108px;
|
||||
text-align: center;
|
||||
border: 1px solid #FFFFFF;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 36px;
|
||||
color: #28A6B4;
|
||||
}
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
width: 317px;
|
||||
height: 150px;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
border-radius: 12px;
|
||||
border: 1px solid #FFFFFF;
|
||||
|
||||
.text-four {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.text-eight {
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.tagWidthShow {
|
||||
background: #11ACFF;
|
||||
}
|
||||
|
||||
.tagShow {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.tagHide{
|
||||
color: #42444F;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
.swiper {
|
||||
height: 416px;
|
||||
|
||||
.tag {
|
||||
width: 232px;
|
||||
height: 158px;
|
||||
background: rgba(255,255,255,0.4);
|
||||
border-radius: 12px;
|
||||
border: 1px solid #FFFFFF;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 22px;
|
||||
margin-top: 24px;
|
||||
.iconSelect{
|
||||
$wh:68px;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin: 0 auto;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.ingredientsBg{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
}
|
||||
.search{
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
position: relative;
|
||||
margin-top: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.inputClass{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 40px;
|
||||
padding-left: 40px;
|
||||
}
|
||||
.searchTitle{
|
||||
position: absolute;
|
||||
right: 66px;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 52px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//设置轮播的指示点大小
|
||||
::v-deep .uni-swiper-dots {
|
||||
// 指示点整个区域
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
::v-deep .uni-swiper-dot {
|
||||
// 指示点元素默认样式
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
::v-deep .uni-swiper-dot-active {
|
||||
// 指示点元素激活(当前选中)状态样式
|
||||
width: 48px;
|
||||
height: 14px;
|
||||
background: #28A6B4;
|
||||
border-radius: 26px 26px 26px 26px;
|
||||
}
|
|
@ -0,0 +1,180 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="bestFoodBg" v-if="!isPage&&name==null">
|
||||
<image src="../../static/images/ingredients.png" class="bestFoodBg"></image>
|
||||
</view>
|
||||
<view class="card" v-else>
|
||||
<view class="text-center text-bold" style="font-size: 48px;margin-bottom: 28px;color: #17191A;">
|
||||
<text v-if="name!=null">{{name}}</text>食物列表
|
||||
</view>
|
||||
<block v-if="foodList.length>0">
|
||||
<block v-for="(item,index) in foodList" :key="index">
|
||||
<view class="flex-between align-center" @tap="goDetail(item)">
|
||||
<view class="flex-contion">
|
||||
<view class="foodImg" style="margin-right: 48px;">
|
||||
<image :src="item.imgAddress" class="foodImg"></image>
|
||||
</view>
|
||||
<view>
|
||||
<view style="font-size: 44px;font-weight: 500;margin-bottom: 10px;">{{item.foodsName}}
|
||||
</view>
|
||||
<view>
|
||||
<span class="themColor" style="font-size: 36px;">{{item.energy}}</span>
|
||||
<span class="themColor" style="font-size: 28px;">千卡</span>
|
||||
<span style="font-size: 28px;color:#666;">/100克</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rightArrow">
|
||||
<image src="../../static/images/rightArrow.png" class="rightArrow"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cutt"></view>
|
||||
</block>
|
||||
<view class="flex justify-center preNext">
|
||||
<view class="whiteBtn" v-if="pageNum>1" @tap="previousPage">上一页</view>
|
||||
<view class="whiteBtn" v-if="totalWatch" @tap="nextPage">下一页</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="isPageShow&&foodList.length==0">
|
||||
<view class="nothing">
|
||||
<image src="../../static/images/nothing.png"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="search">
|
||||
<image src="../../static/images/search.png"></image>
|
||||
<input placeholder="搜索您想要的食物" class="inputClass" v-model="contentText" @input="input" maxlength="17" />
|
||||
<view class="searchTitle" @tap="searchChange">搜索</view>
|
||||
</view>
|
||||
<swiper class="swiper" circular indicator-dots indicator-color="#fff">
|
||||
<block v-for="(item,index) in diseaseList" :key="index">
|
||||
<swiper-item>
|
||||
<view class="flex-between flex-wrap">
|
||||
<view v-for="(item1,index1) in item" :key="index1"
|
||||
:class="['tag flex-conter bg-video',name==item1.typeName?'tagShow':'tagHide']"
|
||||
@tap="twoChane(item1)">
|
||||
<image v-if="name==item1.typeName" src="../../static/images/ingredientsBg.png"
|
||||
class="ingredientsBg"></image>
|
||||
<view class="bg-video text-center">
|
||||
<view class="iconSelect">
|
||||
<image :src="name==item1.typeName?item1.imgUrl:item1.imgUrl1"></image>
|
||||
</view>
|
||||
<view style="margin-top: 16px;">{{item1.typeName}}</view>
|
||||
<view
|
||||
:style="{fontSize:'16px',color:(name==item1.typeName?'rgba(255,255,255,0.6)':'')}">
|
||||
{{item1.engName}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
computed: {
|
||||
totalWatch() {
|
||||
return this.pageNum * 5 < this.total
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
diseaseList: [],
|
||||
name: null,
|
||||
// 食物列表
|
||||
foodList: [],
|
||||
contentText: '', //搜索框
|
||||
typeCode: '', //分类id
|
||||
pageSize: 5,
|
||||
pageNum: 1,
|
||||
isPage: false,
|
||||
total: 0, //总条数
|
||||
isPageShow: false, //列表是否显示
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$API.getFoodTypes({
|
||||
data: {
|
||||
userId: 29
|
||||
}
|
||||
}).then(res => {
|
||||
this.diseaseList = this.getArr(res.rows, 8)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getArr(arr, num) {
|
||||
let newArr = [...arr] // 因为splice会改变原数组,要深拷贝一下
|
||||
let list = []
|
||||
for (let i = 0; i < newArr.length;) {
|
||||
list.push(newArr.splice(i, num))
|
||||
}
|
||||
return list
|
||||
},
|
||||
// 选择
|
||||
twoChane(item1) {
|
||||
this.name = item1.typeName
|
||||
this.typeCode = item1.typeCode
|
||||
this.pageNum = 1
|
||||
this.getPageData()
|
||||
},
|
||||
// 列表数据
|
||||
getPageData() {
|
||||
this.isPageShow = false
|
||||
this.$API.selectFoodsList({
|
||||
data: {
|
||||
foodType: this.typeCode,
|
||||
foodsInfo: this.contentText,
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize,
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.foodList = res.rows
|
||||
this.total = res.total
|
||||
this.$nextTick(() => {
|
||||
this.isPageShow = true
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 搜索input框
|
||||
input(e) {
|
||||
this.contentText = e.detail.value
|
||||
},
|
||||
// 搜索按钮
|
||||
searchChange() {
|
||||
this.pageNum = 1
|
||||
this.isPage = true
|
||||
this.getPageData()
|
||||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/hairtailScreen/foodIngredients/detail/detail?id=' + item.id + '&lableName=' + item
|
||||
.typeName
|
||||
})
|
||||
},
|
||||
// 上一页
|
||||
previousPage() {
|
||||
this.pageNum -= 1
|
||||
this.getPageData()
|
||||
},
|
||||
// 下一页
|
||||
nextPage() {
|
||||
this.pageNum += 1
|
||||
this.getPageData()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './index.scss';
|
||||
</style>
|
After Width: | Height: | Size: 2.2 MiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 5.5 MiB |
After Width: | Height: | Size: 331 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.9 MiB |
After Width: | Height: | Size: 139 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 383 KiB |
After Width: | Height: | Size: 241 B |
After Width: | Height: | Size: 2.3 KiB |
|
@ -0,0 +1,239 @@
|
|||
.pageBox{
|
||||
.bgBackground {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
width: 100vw;
|
||||
height: 606rpx;
|
||||
background: linear-gradient(145deg, #E4F5EB 0%, rgba(228, 245, 235, 0) 100%);
|
||||
}
|
||||
.themColor{
|
||||
color: $uni-color;
|
||||
}
|
||||
.fontColor {
|
||||
color: #17191A;
|
||||
}
|
||||
.contioner {
|
||||
padding:58rpx 32rpx 32rpx;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
color: #3F4040;
|
||||
.riskFactor{
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
margin-left: 12rpx;
|
||||
.leftColor{
|
||||
color: #3F4040;
|
||||
}
|
||||
.rightColor{
|
||||
color: #8E9AAB;
|
||||
}
|
||||
.table{
|
||||
background: #EBF7F8;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
.tableList{
|
||||
.line{
|
||||
border-bottom: 2rpx solid #EEEEEE;
|
||||
padding: 20rpx 0;
|
||||
&:first-child{
|
||||
border-left: 2rpx solid #EEEEEE;
|
||||
border-right: 2rpx solid #EEEEEE;
|
||||
}
|
||||
&:nth-last-child(1){
|
||||
border-left: 2rpx solid #EEEEEE;
|
||||
border-right: 2rpx solid #EEEEEE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.dotocr {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 10rpx;
|
||||
width: 360rpx;
|
||||
height: 488rpx;
|
||||
z-index: -1;
|
||||
}
|
||||
.topWidth {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: #FFFFFF;
|
||||
border: 7rpx solid #6ACBD1;
|
||||
border-radius: 40rpx;
|
||||
margin-top: 48rpx;
|
||||
}
|
||||
.whiteShaw {
|
||||
width: calc(100% -24rpx);
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0, 0, 0, 0);
|
||||
margin-top: -28rpx;
|
||||
margin-left: 12rpx;
|
||||
|
||||
.topBg {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: linear-gradient(180deg, rgba(56, 176, 184, 0.30) 0%, rgba(56, 176, 184, 0.00) 100%);
|
||||
}
|
||||
|
||||
.contonentPadding {
|
||||
padding: 16rpx 20rpx 32rpx;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0,0,0,0.1);
|
||||
.planImg{
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.sector{
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
}
|
||||
.titlePoastion{
|
||||
position: absolute;
|
||||
bottom: 12rpx;
|
||||
left: 48%;
|
||||
transform: translateX(-50%);
|
||||
.topTitle{
|
||||
font-size: 56rpx;
|
||||
color: #3AAFB8;
|
||||
font-weight: bold;
|
||||
}
|
||||
.bottomTitle{
|
||||
font-size: 24rpx;
|
||||
color: #909292;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.leftTagOne{
|
||||
width: 144rpx;
|
||||
height: 16rpx;
|
||||
background: linear-gradient(360deg, #38B0B8 0%, rgba(56,176,184,0) 100%);
|
||||
}
|
||||
.leftTagTwo{
|
||||
width: 252rpx;
|
||||
height: 16rpx;
|
||||
background: linear-gradient(360deg, #38B0B8 0%, rgba(56,176,184,0) 100%);
|
||||
}
|
||||
}
|
||||
.riskResults{
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
margin-left: 12rpx;
|
||||
.replace{
|
||||
background: #EBF7F8;
|
||||
border-radius: 20rpx;
|
||||
padding: 24rpx 32rpx;
|
||||
}
|
||||
.leftColor{
|
||||
color: #112950;
|
||||
}
|
||||
.rightColor{
|
||||
color: #8E9AAB;
|
||||
}
|
||||
.charts-box {
|
||||
width: 630rpx;
|
||||
height: 600rpx;
|
||||
}
|
||||
.locationOne{
|
||||
margin-left: 10%;
|
||||
}
|
||||
.locationTwo{
|
||||
margin-left: 36%;
|
||||
}
|
||||
.locationThree{
|
||||
margin-left: 60%;
|
||||
}
|
||||
.locationFour{
|
||||
margin-left: 85%;
|
||||
}
|
||||
.location{
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 20rpx solid #009DFF;
|
||||
border-right: 16rpx solid transparent;
|
||||
border-left: 16rpx solid transparent;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.progress{
|
||||
height: 12rpx;
|
||||
&:first-child{
|
||||
border-radius: 50rpx 0rpx 0rpx 50rpx;
|
||||
}
|
||||
&:nth-last-child(1){
|
||||
border-radius: 0 50rpx 50rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.tagWidth {
|
||||
display: inline-block;
|
||||
width: 6rpx;
|
||||
height: 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.preventionPoints{
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
margin-left: 12rpx;
|
||||
|
||||
.grey {
|
||||
display: inline-block;
|
||||
white-space:pre-wrap;
|
||||
color: #909292;
|
||||
text-indent: 1rem;
|
||||
line-height: 46rpx;
|
||||
letter-spacing: 2rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.cutt{
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #eee;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.bottomBtn{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
background: #FFFFFF;
|
||||
.btn{
|
||||
width: 686rpx;
|
||||
height: 84rpx;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
background: $uni-color;
|
||||
border-radius: 42rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
.btnBottom{
|
||||
width: 100vw;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 110rpx;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/* 兼容 iOS < 11.2 */
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/* 兼容 iOS >= 11.2 */
|
||||
.btn{
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
background-color: $uni-color;
|
||||
border-radius: 8rpx;
|
||||
flex: 1;
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,235 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="isShow">
|
||||
<view class="bgBackground"></view>
|
||||
<view class="contioner">
|
||||
<view class="fontColor">{{realName}}</view>
|
||||
<view class="fontColor text-bold text-xl marginTop-sm">欢迎开启您的专属健康报告</view>
|
||||
<image src="https://sharkbaby.yhy.ren/maskGroup.png" class="dotocr"></image>
|
||||
<view class="topWidth"></view>
|
||||
<view class="whiteShaw color">
|
||||
<view class="topBg"></view>
|
||||
<view class="contonentPadding">
|
||||
<view class="text-xl text-bold">评估结果</view>
|
||||
<view class="bg-video">
|
||||
<image class="sector"
|
||||
:src="evaluationIndex==0?'https://sharkbaby.yhy.ren/range.png':evaluationIndex==1?'https://sharkbaby.yhy.ren/sameAs.png':'https://sharkbaby.yhy.ren/goodTwo.png'">
|
||||
</image>
|
||||
<view class="titlePoastion text-center">
|
||||
<view class="topTitle">{{formeDate.nowRiskValue}}</view>
|
||||
<view class="bottomTitle">我的健康分</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 各维度健康报告 -->
|
||||
<!-- <view class="riskResults marginTop-sm padding marginBottom-sm">
|
||||
<view class="text-xl text-bold">各维度健康报告</view>
|
||||
<view class="leftTagTwo marginBottom"></view>
|
||||
<block v-for="(item,index) in formeDate.listMap" :key="index">
|
||||
<view class="replace text-sm marginBottom-sm">
|
||||
<view class="marginBottom-sm">{{item.name}}</view>
|
||||
<view class="location"
|
||||
:class="formeDate.listMap[index].level==1?'locationOne':formeDate.listMap[index].level==2?'locationTwo':formeDate.listMap[index].level==3?'locationThree':'locationFour'">
|
||||
</view>
|
||||
<view class="flex-contion text-xs marginBottom-sm">
|
||||
<block v-for="(item1,index1) in formeDate.listMap" :key="index1">
|
||||
<block v-if="index1<4">
|
||||
<view class="flex-sub progress" :style="{background:item1.bgColor}">
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
<view class="flex-contion text-xs text-center">
|
||||
<block v-for="(item2,index2) in formeDate.listMap" :key="index2">
|
||||
<block v-if="index2<4">
|
||||
<view class="flex-sub">{{item2.proressName}}</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view> -->
|
||||
<!-- 习惯分析 -->
|
||||
<view class="riskFactor marginTop-lg padding">
|
||||
<view class="flex-contion marginBottom">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="leftColor text-xl text-bold">习惯分析</text>
|
||||
</view>
|
||||
<view class="flex table text-lg text-bold">
|
||||
<view class="flex-sub text-center">习惯类别</view>
|
||||
<view class="flex-sub text-center">个数</view>
|
||||
<view class="flex-sub text-center">内容</view>
|
||||
</view>
|
||||
<block v-for="(item1,index1) in formeDate.habitList" :key="index1">
|
||||
<view class="tableList flex text-sm">
|
||||
<view class="line flex-sub flex-conter" style="color: #3F4040;">{{item1.habitType}}</view>
|
||||
<view class="line flex-sub flex-conter" :style="{'color':index1==0?'#3F4040':'#FF7B7B'}">
|
||||
{{item1.score}}个</view>
|
||||
<view class="line flex-sub text-center" style="color: #17191A;">{{item1.habitName}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<block v-if="formeDate.assessList.length>0">
|
||||
<!-- 相关风险因素 -->
|
||||
<view class="riskFactor marginTop-sm padding">
|
||||
<view class="flex-contion marginBottom">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="leftColor text-xl text-bold">可改变的危险因素</text>
|
||||
</view>
|
||||
<view class="flex table text-lg text-bold">
|
||||
<view class="flex-sub text-center">危险因素</view>
|
||||
<view class="flex-sub text-center">本次评估</view>
|
||||
<view class="flex-sub text-center">理想水平</view>
|
||||
</view>
|
||||
<block v-for="(item1,index1) in formeDate.assessList" :key="index1">
|
||||
<view class="tableList flex text-sm">
|
||||
<!-- 危险因素 -->
|
||||
<view class="line flex-sub flex-conter" style="color: #17191A;">{{item1.name}}</view>
|
||||
<!-- 本次评估 -->
|
||||
<view class="line flex-sub flex-conter" style="color:#D95959">
|
||||
{{item1.newAssess}}
|
||||
</view>
|
||||
<!-- 理想水平 -->
|
||||
<view class="line flex-sub text-center" style="color: #3F4040;">{{item1.idealValue}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="preventionPoints padding marginTop" v-if="formeDate.suggest.length!=0">
|
||||
<view class="text-xl text-bold">目前状况</view>
|
||||
<view class="leftTagOne marginBottom"></view>
|
||||
<block v-for="(item,index) in formeDate.suggest" :key="index">
|
||||
<view class="flex-contion marginBottom-sm">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">step {{index+1}}</text>
|
||||
</view>
|
||||
<view class="marginBottom-sm text-df text-bold">{{item.typeList[0]}}</view>
|
||||
<view class="marginBottom-sm text-df text-bold">{{item.typeList[1]}}</view>
|
||||
<view class="grey" v-html="item.name" style="text-indent: 2rem;"></view>
|
||||
<view class="cutt" style="text-indent: 2rem;" v-if="index<formeDate.suggest.length-1"></view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<view class="preventionPoints padding marginTop">
|
||||
<view class="text-xl text-bold">评估建议</view>
|
||||
<view class="leftTagOne marginBottom"></view>
|
||||
<view class="grey">{{formeDate.riskDesc}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnBottom">
|
||||
<view class="btn" @tap="goPage">查看个人自主计划</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 真实姓名
|
||||
realName: '',
|
||||
// 评估结果数据
|
||||
formeDate: {},
|
||||
userParameters: {}, //用户参数
|
||||
// 评估类型
|
||||
evaluationIndex: null,
|
||||
isShow: false, //页面数据加载完成
|
||||
memberId: '',
|
||||
userId: '',
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
let a = {
|
||||
userId: '7692',
|
||||
headSculpture: 'https://sharkbaby.yhy.ren/0042fab3c00f4fae80e3d2b732a0596a.jpg',
|
||||
name: '的',
|
||||
memberId: '0',
|
||||
}
|
||||
console.log(JSON.stringify(a))
|
||||
let data = JSON.parse(decodeURIComponent(opt.params))
|
||||
if (data.userParameters) {
|
||||
this.userParameters = JSON.parse(data.userParameters)
|
||||
} else {
|
||||
if (data.token) {
|
||||
this.userParameters.openId = data.openId //用户唯一标识
|
||||
this.userParameters.token = data.token //用户唯一标识
|
||||
}
|
||||
// memberId为0代表用户,否则为成员
|
||||
if (data.memberId != '0') {
|
||||
this.userParameters.userId = data.memberId
|
||||
} else {
|
||||
this.userParameters.userId = data.userId //用户id
|
||||
}
|
||||
}
|
||||
this.memberId = data.memberId // 判断是用户还是成员 0用户 成员id
|
||||
this.realName = data.name // 判断是用户还是成员 0用户 成员id
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
getInfo() {
|
||||
let that = this
|
||||
showLoading('加载中...')
|
||||
that.$API.getDiseaseResult({
|
||||
data: {
|
||||
diseaseId: '95',
|
||||
...this.userParameters,
|
||||
}
|
||||
}).then((res) => {
|
||||
that.formeDate = res.data
|
||||
let index;
|
||||
let score = Number(res.data.nowRiskValue)
|
||||
if (score >= 0 && score < 42) {
|
||||
index = 0
|
||||
} else if (score >= 42 && score <= 68) {
|
||||
index = 1
|
||||
} else {
|
||||
index = 2
|
||||
}
|
||||
this.evaluationIndex = index
|
||||
that.$set(that, 'isShow', true)
|
||||
if (res.data.listMap.length == 7) {
|
||||
res.data.listMap[0].bgColor = "#009DFF"
|
||||
res.data.listMap[1].bgColor = "#3AAFB8"
|
||||
res.data.listMap[2].bgColor = "#FDA92A"
|
||||
res.data.listMap[3].bgColor = "#F87C7C"
|
||||
res.data.listMap[0].proressName = "健康"
|
||||
res.data.listMap[1].proressName = "低风险"
|
||||
res.data.listMap[2].proressName = "中风险"
|
||||
res.data.listMap[3].proressName = "高风险"
|
||||
}
|
||||
if (res.data.suggest.length > 0) {
|
||||
res.data.suggest.map(item => {
|
||||
item.typeList = item.type.split(" ")
|
||||
})
|
||||
}
|
||||
hideLoading()
|
||||
})
|
||||
},
|
||||
// 返回上一个页面
|
||||
backChange() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
// 跳转计划页面
|
||||
viewPlan() {
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/tabBar/project/project'
|
||||
})
|
||||
}, 0)
|
||||
},
|
||||
// 跳转到自主计划首页
|
||||
goPage() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/selfRegistration/index/index?userId=' + this.userParameters.userId+ "&riskId=" + this.formeDate.id
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './basicReport.scss';
|
||||
</style>
|
|
@ -0,0 +1,374 @@
|
|||
.bgBackground {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
width: 100vw;
|
||||
height: 606rpx;
|
||||
background: linear-gradient(145deg, #E4F5EB 0%, rgba(228, 245, 235, 0) 100%);
|
||||
}
|
||||
|
||||
.themColor {
|
||||
color: $uni-color;
|
||||
}
|
||||
.rightImg{
|
||||
$wh:32rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
|
||||
.contioner {
|
||||
padding: 32rpx;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
color: #3F4040;
|
||||
.avter {
|
||||
$wh: 64rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.dotocr {
|
||||
width: 218rpx;
|
||||
height: 212rpx;
|
||||
}
|
||||
|
||||
.topWidth {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: #FFFFFF;
|
||||
border: 7rpx solid #6ACBD1;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
|
||||
.whiteShaw {
|
||||
width: calc(100% -24rpx);
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0, 0, 0, 0);
|
||||
margin: -28rpx 0 50rpx 12rpx;
|
||||
.topBg {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: linear-gradient(180deg, rgba(56, 176, 184, 0.30) 0%, rgba(56, 176, 184, 0.00) 100%);
|
||||
}
|
||||
.contonentPadding {
|
||||
padding: 16rpx 20rpx 32rpx;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0,0,0,0.1);
|
||||
.gardenClass{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -20rpx;
|
||||
width: 100%;
|
||||
.circle3 {
|
||||
width: 44rpx;
|
||||
height: 22rpx;
|
||||
border-radius: 0 0 50rpx 50rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
.tabClass{
|
||||
width: 480rpx;
|
||||
height: 80rpx;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 32rpx;
|
||||
background: #EBF7F8;
|
||||
border-radius: 16rpx;
|
||||
color: #3F4040;
|
||||
font-size: 36rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.whiteBg{
|
||||
width: 228rpx;
|
||||
margin: 0 8rpx;
|
||||
line-height: 68rpx;
|
||||
text-align: center;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
color: $uni-color;
|
||||
}
|
||||
}
|
||||
|
||||
.seriesTag{
|
||||
width: 160rpx;
|
||||
text-align: center;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
color: #FFFFFF;
|
||||
border-radius: 0 50rpx 50rpx 0;
|
||||
}
|
||||
.assressTag{
|
||||
display: inline-block;
|
||||
padding: 2rpx 8rpx;
|
||||
background: #E8FDFF;
|
||||
border-radius: 8rpx;
|
||||
color: $uni-color;
|
||||
font-size: 36rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.greyBg{
|
||||
text-indent: 2rem;
|
||||
padding: 24rpx 20rpx;
|
||||
background: #EBF7F8;
|
||||
border-radius: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #3F4040;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
.srcoll{
|
||||
width: calc(100% - 60rpx);
|
||||
white-space: nowrap;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.tagBg{
|
||||
display: inline-block;
|
||||
padding: 0 20rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 50rpx;
|
||||
color: #909292;
|
||||
margin-right: 14rpx;
|
||||
}
|
||||
.tagBgShaw{
|
||||
border: 2rpx solid #3AAFB8;
|
||||
color: #3F4040;
|
||||
}
|
||||
.chartsBox{
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pageBox {
|
||||
.tagWidth {
|
||||
display: inline-block;
|
||||
width: 6rpx;
|
||||
height: 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.riskResults {
|
||||
background: #FFFFFF;
|
||||
margin-left: 12rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.leftColor {
|
||||
color: #112950;
|
||||
}
|
||||
|
||||
.rightColor {
|
||||
color: #8E9AAB;
|
||||
}
|
||||
|
||||
.charts-box {
|
||||
width: 630rpx;
|
||||
height: 500rpx;
|
||||
}
|
||||
|
||||
.location {
|
||||
width: 34rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.progress {
|
||||
height: 12rpx;
|
||||
margin-right: 2rpx;
|
||||
|
||||
&:first-child {
|
||||
border-radius: 50rpx 0rpx 0rpx 50rpx;
|
||||
}
|
||||
|
||||
&:nth-last-child(1) {
|
||||
border-radius: 0 50rpx 50rpx 0;
|
||||
margin-right: 0rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.lifeStyle {
|
||||
padding: 20rpx 30rpx;
|
||||
background: #EBF7F8;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.leftColor {
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.rightColor {
|
||||
color: #ECA13B;
|
||||
}
|
||||
|
||||
.fontColor {
|
||||
color: #3F4040;
|
||||
}
|
||||
|
||||
.lineHeight {
|
||||
line-height: 38rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.riskFactor {
|
||||
background: #FFFFFF;
|
||||
margin-left: 12rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.leftColor {
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.rightColor {
|
||||
color: #8E9AAB;
|
||||
}
|
||||
|
||||
.table {
|
||||
background: #EBF7F8;
|
||||
padding: 20rpx 0;
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.tableList {
|
||||
.line {
|
||||
border-bottom: 2rpx solid #EEEEEE;
|
||||
padding: 20rpx 0;
|
||||
color: #17191A;
|
||||
|
||||
&:first-child {
|
||||
border-left: 2rpx solid #E6EFF1;
|
||||
border-right: 2rpx solid #E6EFF1;
|
||||
}
|
||||
|
||||
&:nth-last-child(1) {
|
||||
border-left: 2rpx solid #E6EFF1;
|
||||
border-right: 2rpx solid #E6EFF1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.diseaseProfile {
|
||||
background: #FFFFFF;
|
||||
margin-left: 12rpx;
|
||||
border-radius: 16rpx;
|
||||
color: #3F4040;
|
||||
|
||||
.fontColor {
|
||||
line-height: 38rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.preventionPoints {
|
||||
background: #FFFFFF;
|
||||
margin-left: 12rpx;
|
||||
border-radius: 16rpx;
|
||||
color: #3F4040;
|
||||
.fontColor {
|
||||
line-height: 38rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 188rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: #d8eff1;
|
||||
border-radius: 50rpx;
|
||||
color: $uni-color;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
.perfect {
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
margin-left: 12rpx;
|
||||
color: #3F4040;
|
||||
.title {
|
||||
color: #112950;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.circular {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
background: #E93A00;
|
||||
}
|
||||
|
||||
.circular1 {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
background: $uni-color;
|
||||
}
|
||||
|
||||
.fontColor {
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.rightColor {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.cut {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #E9E9E9;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.text-sm {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.text-df {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.text-lg {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.locationOne {
|
||||
margin-left: 10%;
|
||||
}
|
||||
|
||||
.locationTwo {
|
||||
margin-left: 36%;
|
||||
}
|
||||
|
||||
.locationThree {
|
||||
margin-left: 60%;
|
||||
}
|
||||
|
||||
.locationFour {
|
||||
margin-left: 85%;
|
||||
}
|
||||
|
||||
.location {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 20rpx solid #009DFF;
|
||||
border-right: 16rpx solid transparent;
|
||||
border-left: 16rpx solid transparent;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.progress {
|
||||
height: 12rpx;
|
||||
margin-right: 2rpx;
|
||||
|
||||
&:first-child {
|
||||
border-radius: 50rpx 0rpx 0rpx 50rpx;
|
||||
}
|
||||
|
||||
&:nth-last-child(1) {
|
||||
border-radius: 0 50rpx 50rpx 0;
|
||||
margin-right: 0rpx;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,525 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="bgBackground"></view>
|
||||
<view class="contioner" v-if="isShow">
|
||||
<view class="flex-align">
|
||||
<view>
|
||||
<view class="flex-contion">
|
||||
<image :src="userProfile" class="avter"></image>
|
||||
<view class="text-bold fontColor">Hi~{{userName}}</view>
|
||||
</view>
|
||||
<view class="fontColor text-bold text-xl margin-top-xs">欢迎开启您的专属健康报告</view>
|
||||
</view>
|
||||
<image src="https://shayu5qny.yhy.ren/dotocr.png" class="dotocr"></image>
|
||||
</view>
|
||||
<view class="topWidth"></view>
|
||||
<view class="whiteShaw color">
|
||||
<view class="topBg"></view>
|
||||
<view class="contonentPadding bg-video">
|
||||
<view class="tabClass">
|
||||
<view :class="[tabIndex==0?'whiteBg':'flex-sub text-center']" @tap="tabChange(0)">评估详情</view>
|
||||
<view :class="[tabIndex==1?'whiteBg':'flex-sub text-center']" @tap="tabChange(1)">健康指南</view>
|
||||
</view>
|
||||
<block v-if="cardList.length>1">
|
||||
<scroll-view scroll-x class="srcoll marginBottom" scroll-with-animation
|
||||
:scroll-left="scrollLeft" @scroll="scroll">
|
||||
<block v-for="(item,index) in cardList" :key="index">
|
||||
<view :class="['tagBg',cardIndex==index?'tagBgShaw':'']" @tap="cardChange(index)">
|
||||
{{item.diseaseName}}
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</block>
|
||||
<block v-if="tabIndex==0">
|
||||
<view class="flex-contion marginBottom-sm text-xl">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">
|
||||
您的本次评估结果为:
|
||||
<text class="themColor" v-if="title=='肥胖症'">0级</text>
|
||||
<text v-else
|
||||
:style="{'color':series==1?'#269452':series==2?'#34BA5F':series==3?'#FFD540':series==4?'#F9BB00':series==5?'#FF6B2E': '#E93A00'}">
|
||||
{{series==1?'低风险':series==2?'较低风险':series==3?'中等风险':series==4?'较高风险':series==5?'高风险': '疑似已患'}}
|
||||
</text>
|
||||
</text>
|
||||
</view>
|
||||
<block v-if="title!='肥胖症'">
|
||||
<view class="flex-align">
|
||||
<view>
|
||||
<view class="seriesTag"><text style="font-size: 60rpx;">{{series}}</text>级</view>
|
||||
<view style="width: 232rpx;">
|
||||
<view class="assressTag">{{title}}评估</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="chartsBox">
|
||||
<qiun-data-charts type="funnel" :opts="optsFunnel" :chartData="chartDataFunnel" />
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="greyBg">{{card.riskInfo}}</view>
|
||||
<!-- 肥胖症进度条 -->
|
||||
<view class="card padding" v-if="card.diseaseName=='肥胖症'">
|
||||
<view class="text-sm marginBottom-sm">
|
||||
<view class="flex-contion marginBottom-sm text-xl">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">BMI</text>
|
||||
</view>
|
||||
<!-- 位置 -->
|
||||
<view class="location"
|
||||
:class="card.nowRiskLevel=='体重消瘦'?'locationOne':card.nowRiskLevel=='体重正常'?'locationTwo':card.nowRiskLevel=='体重超重'?'locationThree':'locationFour'"
|
||||
src="/pages/assessment/static/images/location.png"></view>
|
||||
<!-- 进度条 -->
|
||||
<view class="flex-contion text-xs marginBottom-sm">
|
||||
<block v-for="(item1,index1) in listMap" :key="index1">
|
||||
<view class="flex-sub progress" :style="{background:item1.bgColor}"></view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="flex-contion text-xs text-center">
|
||||
<block v-for="(item2,index2) in listMap" :key="index2">
|
||||
<view class="flex-sub">{{item2.proressName}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 您做的不好的地方,请改善 -->
|
||||
<view class="perfect marginTop-sm">
|
||||
<view class="flex-contion marginBottom-sm text-xl">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">您做的不好的地方,请改善</text>
|
||||
</view>
|
||||
<block v-for="(item1,index1) in healthList.qnameMap.isNoHealth" :key="index1">
|
||||
<view class="flex-align marginTop" @click="goDetails(item1)">
|
||||
<view class="flex-contion">
|
||||
<view class="circular marginRight-sm"></view>
|
||||
<view class="fontColor text-df">{{item1.riskValue}}</view>
|
||||
</view>
|
||||
<image src="../static/images/right.png" class="rightImg"></image>
|
||||
</view>
|
||||
<view class="cut" v-if="index1<healthList.qnameMap.isNoHealth.length-1"></view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<view class="flex gardenClass">
|
||||
<view v-for="(garden,gardenIndex) in todos" :key="gardenIndex" class="circle3"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="tabIndex==0">
|
||||
<block v-for="(item,index) in cardList" :key="index">
|
||||
<!-- 风险结果 -->
|
||||
<view class="riskResults marginTop-sm padding" v-if="index==cardIndex&&card.specialShow!='现已患'">
|
||||
<view class="flex-contion marginBottom-sm text-xl">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">风险结果</text>
|
||||
</view>
|
||||
<!-- 雷达图 -->
|
||||
<view class="charts-box" v-if="isChart">
|
||||
<qiun-data-charts type="radar" inScrollView :opts="opt" :chartData="chartData" canvas2d
|
||||
@tap="tap" />
|
||||
</view>
|
||||
<!-- 生活方式水平 -->
|
||||
<view class="lifeStyle">
|
||||
<view class="text-lg marginBottom-sm">
|
||||
<text class="leftColor text-bold">现有生活方式水平风险:</text>
|
||||
<text class="rightColor text-bold margin-left-xs">{{card.nowRiskLevel}}</text>
|
||||
</view>
|
||||
<view class="fontColor lineHeight text-df lettSpacing">
|
||||
{{card.nowRiskDesc}}
|
||||
</view>
|
||||
<view class="text-lg marginBottom-sm marginTop-lg">
|
||||
<text class="leftColor text-bold">健康生活方式可降低风险:</text>
|
||||
<text class="rightColor text-bold margin-left-xs">{{card.idealRiskLevel}}</text>
|
||||
</view>
|
||||
<view class="fontColor lineHeight text-df lettSpacing">
|
||||
{{card.idealRiskDesc}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 相关风险因素 -->
|
||||
<view class="riskFactor marginTop-sm padding" v-if="index==cardIndex">
|
||||
<view class="flex-contion marginBottom-sm text-xl">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">相关危险因素</text>
|
||||
</view>
|
||||
<view class="marginTop-lg flex table text-df">
|
||||
<view class="flex-sub text-center">危险因素</view>
|
||||
<view class="flex-sub text-center">本次评估</view>
|
||||
<view class="flex-sub text-center">理想水平</view>
|
||||
</view>
|
||||
<block v-for="(item1,index1) in card.assessList" :key="index1">
|
||||
<view class="tableList flex text-df">
|
||||
<!-- 危险因素 -->
|
||||
<view class="line flex-sub text-center">{{item1.name}}</view>
|
||||
<!-- 本次评估 -->
|
||||
<view class="line flex-sub text-center"
|
||||
:style="{'color':item1.isError==1&&item1.name.indexOf('家族史')<0?'#D95959':''}">
|
||||
{{item1.newAssess}}
|
||||
</view>
|
||||
<!-- 理想水平 -->
|
||||
<view class="line flex-sub text-center">{{item1.idealValue}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 疾病简介 -->
|
||||
<view class="diseaseProfile marginTop-sm padding" v-if="index==cardIndex">
|
||||
<view class="flex-contion marginBottom-sm text-xl">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">疾病简介</text>
|
||||
</view>
|
||||
<view class="fontColor text-df marginTop-sm lettSpacing">
|
||||
{{card.diseaseIntroduce}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 防止要点 -->
|
||||
<view class="preventionPoints marginTop-sm padding" v-if="index==cardIndex">
|
||||
<view class="flex-contion marginBottom-sm text-xl">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">{{(diseaseId != 111 && diseaseId != 106) ? '防治要点' : '指导建议'}}</text>
|
||||
</view>
|
||||
<view class="fontColor text-df marginTop-sm lettSpacing" v-if="card.prevent!=null">
|
||||
{{card.prevent}}
|
||||
</view>
|
||||
<view class="flex-align marginTop-lg"
|
||||
v-if="card.dietUrl!=null||card.motionUrl!=null||card.psychologyUrl!=null">
|
||||
<view class="btn" @click="guidance(card.dietUrl)" v-if="card.dietUrl!=null">饮食指导</view>
|
||||
<view class="btn" @click="guidance(card.motionUrl)" v-if="card.motionUrl!=null">运动指导</view>
|
||||
<view class="btn" @click="guidance(card.psychologyUrl)" v-if="card.psychologyUrl!=null">心理指导
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<!-- 健康指南显示 -->
|
||||
<block v-else>
|
||||
<!-- 达到理想目标,风险下降率为 -->
|
||||
<view class="perfect marginTop-sm padding" v-if="healthList.assessList.length!=0">
|
||||
<view class="flex-contion marginBottom-sm text-xl">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">达到理想目标,风险下降率为</text>
|
||||
</view>
|
||||
<block v-for="(item1,index1) in healthList.assessList" :key="index1">
|
||||
<view class="flex-align text-df" style="margin-top: 24rpx;">
|
||||
<view class="leftColor">{{item1.name}}</view>
|
||||
<view class="rightColor">{{item1.pre}}</view>
|
||||
</view>
|
||||
<!-- 分割线 -->
|
||||
<view class="cut" v-if="index1<healthList.assessList.length-1"></view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 您做的好的地方,请保持 -->
|
||||
<view class="perfect marginTop-sm padding">
|
||||
<view class="flex-contion marginBottom-sm text-xl">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">您做的好的地方,请保持</text>
|
||||
</view>
|
||||
<block v-for="(item1,index1) in healthList.qnameMap.isHealth" :key="index1">
|
||||
<view class="flex-contion marginTop">
|
||||
<view class="circular1 marginRight-sm"></view>
|
||||
<view class="fontColor text-df">{{item1}}</view>
|
||||
</view>
|
||||
<view class="cut" v-if="index1<healthList.qnameMap.isHealth.length-1"></view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="cardList.length==0">
|
||||
<nothing :marginTop='40' context='暂无评估数据~'></nothing>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading,
|
||||
goPage
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false, //页面数据加载完成
|
||||
todos:['','','','','','','','','','','','','','','',''],
|
||||
userParameters: {}, //接收用户参数
|
||||
tabIndex: 0, //顶部切换索引
|
||||
scrollLeft: 0, //全部分类点击滚动的位置
|
||||
title: '', //评估的名称
|
||||
memberId: '', //判断是用户还是成员 0用户 成员id
|
||||
card: {
|
||||
assessList: []
|
||||
},
|
||||
cardList: [],
|
||||
// 选择的索引
|
||||
cardIndex: 0,
|
||||
// 肥胖症进度条内容
|
||||
listMap: [{
|
||||
bgColor: "#009DFF",
|
||||
proressName: "偏瘦"
|
||||
}, {
|
||||
bgColor: "#3AAFB8",
|
||||
proressName: "正常"
|
||||
}, {
|
||||
bgColor: "#FDA92A",
|
||||
proressName: "超重"
|
||||
}, {
|
||||
bgColor: "#F87C7C",
|
||||
proressName: "肥胖"
|
||||
}],
|
||||
opt: {
|
||||
fontSize: 10,
|
||||
legend: {
|
||||
position: "bottom",
|
||||
},
|
||||
extra: {
|
||||
radar: {
|
||||
border: true,
|
||||
gridCount: 5,
|
||||
max: 100,
|
||||
gridColor: ''
|
||||
},
|
||||
},
|
||||
},
|
||||
// 雷达图数据
|
||||
chartData: {},
|
||||
chartDataFunnel: {},
|
||||
optsFunnel: {
|
||||
color: ["#269452", "#34BA5F", "#FFD540", "#F9BB00", "#FF6B2E", "#E93A00"],
|
||||
dataLabel: false,
|
||||
loadingType: 0,
|
||||
padding: [0, 5, 0, 15],
|
||||
enableScroll: false,
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
extra: {
|
||||
funnel: {
|
||||
activeOpacity: 0.3,
|
||||
activeWidth: 10,
|
||||
border: true,
|
||||
borderWidth: 2,
|
||||
borderColor: "#FFFFFF",
|
||||
fillOpacity: 1,
|
||||
labelAlign: "left",
|
||||
type: "pyramid"
|
||||
}
|
||||
}
|
||||
},
|
||||
userProfile: '', //用户头像
|
||||
userName: '', //名称
|
||||
cno: '',
|
||||
diseaseId: '0', //疾病id
|
||||
isAll: false,
|
||||
series: '', //级数
|
||||
healthList: {},
|
||||
isChart: false, //雷达图切换时隐藏
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
let data = JSON.parse(decodeURIComponent(opt.params))
|
||||
this.memberId = data.memberId //判断是用户还是成员 0用户 成员id
|
||||
this.cno = data.cno
|
||||
if (data.diseases == '') {
|
||||
this.diseaseId = '0'
|
||||
} else {
|
||||
this.diseaseId = data.diseases
|
||||
}
|
||||
if (data.userParameters) {
|
||||
this.userParameters = JSON.parse(data.userParameters) //用户参数
|
||||
} else {
|
||||
this.userParameters.userId = data.userId //用户id
|
||||
}
|
||||
this.userProfile = data.headSculpture //用户头像
|
||||
this.userName = data.name //名称
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
getFunnelData() {
|
||||
//模拟从服务器获取数据时的延时
|
||||
//模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
|
||||
let res = {
|
||||
series: [{
|
||||
data: [{
|
||||
"name": "",
|
||||
"centerText": "",
|
||||
"value": 40
|
||||
}, {
|
||||
"name": "",
|
||||
"centerText": "",
|
||||
"value": 35
|
||||
}, {
|
||||
"name": "",
|
||||
"centerText": "",
|
||||
"value": 25
|
||||
}, {
|
||||
"name": "",
|
||||
"centerText": "",
|
||||
"value": 20
|
||||
}, {
|
||||
"name": "",
|
||||
"centerText": "",
|
||||
"value": 15
|
||||
}, {
|
||||
"name": "",
|
||||
"centerText": "",
|
||||
"value": 8
|
||||
}]
|
||||
}]
|
||||
};
|
||||
this.chartDataFunnel = JSON.parse(JSON.stringify(res));
|
||||
},
|
||||
// 顶部tab切换
|
||||
tabChange(index) {
|
||||
this.tabIndex = index
|
||||
},
|
||||
tap() {
|
||||
console.log('点击了图标')
|
||||
},
|
||||
// 调取接口
|
||||
async getInfo() {
|
||||
showLoading('加载中...')
|
||||
let that = this
|
||||
let ret = []
|
||||
// 查询单个疾病报告
|
||||
if (that.cno != '') {
|
||||
ret = await that.$API.getAssessReport({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
cno: that.cno,
|
||||
memberId: that.memberId,
|
||||
diseaseId: that.diseaseId
|
||||
}
|
||||
})
|
||||
that.isAll = false
|
||||
that.healthList = ret.data[ret.data.length - 1] //健康指南数据
|
||||
ret.data.splice(-1, 1) //删除健康指南
|
||||
if (ret.data[0].diseaseName == '肥胖症') {
|
||||
// 删除肥胖症
|
||||
if (that.healthList.assessList.length > 0) {
|
||||
that.healthList.assessList.map((item, index) => {
|
||||
if (item.name == '肥胖症') {
|
||||
that.healthList.assessList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 查询所有疾病报告
|
||||
ret = await that.$API.getAssessReport({
|
||||
data: {
|
||||
deptId: 2,
|
||||
...that.userParameters,
|
||||
memberId: that.memberId
|
||||
}
|
||||
})
|
||||
that.isAll = true
|
||||
}
|
||||
// 所有数据
|
||||
that.cardList = ret.data
|
||||
if (that.isAll) {
|
||||
let res = await this.$API.selectHealthyGuide({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
memberId: this.memberId,
|
||||
diseaseId: 90
|
||||
}
|
||||
})
|
||||
if (res.code == 200 && res.data) {
|
||||
// 删除肥胖症
|
||||
if (res.data.assessList.length > 0) {
|
||||
res.data.assessList.map((item, index) => {
|
||||
if (item.name == '肥胖症') {
|
||||
res.data.assessList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
that.healthList = res.data //健康指南数据
|
||||
}
|
||||
}
|
||||
that.cardChange(0)
|
||||
},
|
||||
// 返回上一个页面
|
||||
backChange() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
getServerData() {
|
||||
this.chartData.series[0].name = '当前风险'
|
||||
this.chartData.series[1].name = '理想风险'
|
||||
this.chartData.categories.map((item, index) => {
|
||||
if (item.length > 4) {
|
||||
this.chartData.categories[index] = item.substring(0, 4) + '...'
|
||||
}
|
||||
})
|
||||
this.isShow = true
|
||||
this.isChart = true
|
||||
},
|
||||
// 选择事件
|
||||
cardChange(index) {
|
||||
showLoading('加载中...')
|
||||
this.cardIndex = index
|
||||
this.diseaseId = this.cardList[index].diseaseId
|
||||
this.scrollLeft = (index - 1) * 68 //左右滑动切换
|
||||
this.title = this.cardList[index].diseaseName //评估名称
|
||||
this.getDiseaseContent()
|
||||
this.series = this.cardList[index].specialShowType
|
||||
this.isChart = false
|
||||
},
|
||||
// 单个评估数据赋值
|
||||
async getDiseaseContent() {
|
||||
let ret = await this.$API.getDiseaseContent({
|
||||
data: {
|
||||
...this.userParameters,
|
||||
deptId: 2,
|
||||
memberId: this.memberId,
|
||||
diseaseId: this.diseaseId,
|
||||
}
|
||||
})
|
||||
if (ret.code == 200 && ret.data) {
|
||||
this.card = ret.data
|
||||
hideLoading()
|
||||
this.isShow = true
|
||||
}
|
||||
this.series = ret.data.specialShowType //级数
|
||||
// 雷达图数据
|
||||
this.chartData = JSON.parse(JSON.stringify(ret.data.qnameMap));
|
||||
this.getServerData()
|
||||
this.getFunnelData();
|
||||
},
|
||||
// 分类滚动方法
|
||||
scroll(e) {
|
||||
this.scrollLeft = e.detail.scrollLeft
|
||||
},
|
||||
// 跳转计划页面
|
||||
viewPlan() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/tabBar/project/project'
|
||||
})
|
||||
},
|
||||
// 跳转详情页面
|
||||
goDetails(item1) {
|
||||
let data = {
|
||||
riskName: item1.riskName,
|
||||
riskValue: item1.riskValue,
|
||||
ideaKey: item1.ideaKey,
|
||||
ideaValue: item1.ideaValue,
|
||||
name: item1.name,
|
||||
}
|
||||
goPage(['health-risks', 'guideDetails'], {
|
||||
formData: JSON.stringify(data)
|
||||
})
|
||||
},
|
||||
// 指导
|
||||
guidance(id) {
|
||||
if (window.Android) {
|
||||
window.Android.guidance(id)
|
||||
}
|
||||
if (window.webkit) {
|
||||
window.webkit.messageHandlers.guidance.postMessage(id);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './evaluationResults.scss';
|
||||
</style>
|
|
@ -0,0 +1,83 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="contioner">
|
||||
<view class="topCard">
|
||||
<view class="flex-align text-xl">
|
||||
<view class="flex-contion">
|
||||
<view class="tagWidth"></view>
|
||||
<view>{{formData.riskName}}</view>
|
||||
</view>
|
||||
<view class="fontColor">{{formData.riskValue}}</view>
|
||||
</view>
|
||||
<view class="cutt"></view>
|
||||
<view class="text-three marginTop-sm">
|
||||
<text>{{formData.ideaKey}}:</text>
|
||||
<text class="margin-left-xs">{{formData.ideaValue}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="topCard" style="margin-top: 24rpx;">
|
||||
<view class="flex-contion">
|
||||
<view class="tagWidth"></view>
|
||||
<view class="text-xl">改善方法</view>
|
||||
</view>
|
||||
<view class="cutt"></view>
|
||||
<view class="text-three">{{formData.name}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: '',
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.formData = JSON.parse(options.formData)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pageBox {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #3F4040;
|
||||
|
||||
.contioner {
|
||||
padding: 32rpx;
|
||||
}
|
||||
|
||||
.topCard {
|
||||
padding: 32rpx 32rpx 40rpx 32rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.text-three {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
width: 6rpx;
|
||||
height: 32rpx;
|
||||
background: $uni-color;
|
||||
border-radius: 4rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.cutt {
|
||||
width: 100%;
|
||||
height: 2rpx;
|
||||
background: #EEEEEE;
|
||||
margin: 16rpx 0 18rpx 0;
|
||||
}
|
||||
|
||||
.fontColor {
|
||||
color: #F5973F;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,266 @@
|
|||
page{
|
||||
background: #F3F4F6;
|
||||
}
|
||||
.pageBox{
|
||||
.color{
|
||||
color: #17191A;
|
||||
}
|
||||
.inputPopup{
|
||||
background: #FFF;
|
||||
padding: 20rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
.inputClass{
|
||||
border: 2rpx solid #3AAFB8;
|
||||
line-height: 64rpx;
|
||||
height: 64rpx;
|
||||
border-radius: 8rpx;
|
||||
padding-left: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.topPostionBg{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100vw;
|
||||
height: 528rpx;
|
||||
background: linear-gradient(155deg, #E4F5EB 0%, rgba(228,245,235,0) 100%);
|
||||
}
|
||||
.staging{
|
||||
width: 470rpx;
|
||||
height: calc(580rpx - 42rpx);
|
||||
border-radius: 48rpx;
|
||||
background: #FFF;
|
||||
padding: 22rpx 32rpx 20rpx;
|
||||
.bg{
|
||||
width: 100%;
|
||||
height: 224rpx;
|
||||
background: linear-gradient(180deg, #D8FCFF 0%, #FFF 100%);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-radius: 48rpx 48rpx 0 0;
|
||||
}
|
||||
.stagingBackground{
|
||||
width: 268rpx;
|
||||
height: 166rpx;
|
||||
}
|
||||
.threeSix{
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
.oneTwo{
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
.stagBtn{
|
||||
width: calc(406rpx - 278rpx);
|
||||
padding: 10rpx 138rpx 10rpx 140rpx;
|
||||
border-radius: 50rpx;
|
||||
border: 2rpx solid $uni-color;
|
||||
background: $uni-color;
|
||||
margin: 0 auto;
|
||||
color: #FFF;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
.colorGrey{
|
||||
color: #909292;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
}
|
||||
.contioner{
|
||||
padding: 32rpx;
|
||||
.backBottom{
|
||||
position: fixed;
|
||||
bottom: 10vh;
|
||||
right: 34rpx;
|
||||
padding: 12rpx 32rpx;
|
||||
border-radius: 50rpx;
|
||||
background: #FFF;
|
||||
box-shadow: 0 8rpx 8rpx 0 rgba(4, 70, 74, 0.14);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:24rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
.topCard{
|
||||
padding: 12rpx;
|
||||
margin-top: 48rpx;
|
||||
border-radius: 32rpx;
|
||||
background: #FFFFFF;
|
||||
.headSculpture{
|
||||
$wh:112rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
background: #F3F4F6;
|
||||
border-radius: 50%;
|
||||
border: 6rpx solid #FFFFFF;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
top: -52rpx;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:100rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.border{
|
||||
border: 1rpx dotted #3AAFB8;
|
||||
border-radius: 20rpx;
|
||||
.cut{
|
||||
display: inline-block;
|
||||
width: 4rpx;
|
||||
height: 20rpx;
|
||||
margin: 0 12rpx;
|
||||
background: $uni-color;
|
||||
}
|
||||
.top{
|
||||
margin-top: 72rpx;
|
||||
color: $uni-color;
|
||||
}
|
||||
.tag{
|
||||
padding: 0 20rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 4rpx;
|
||||
background: #F3F4F6;
|
||||
color: #909292;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.avare {
|
||||
$wh: 80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.tagWidth{
|
||||
width: 48rpx;
|
||||
height: 8rpx;
|
||||
background: #EFF9F8;
|
||||
border-radius: 50rpx;
|
||||
margin-right: 12rpx;
|
||||
margin-top: 20rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
.tagBgShaw{
|
||||
background: $uni-color;
|
||||
}
|
||||
.introduce {
|
||||
padding: 20rpx;
|
||||
width: calc(502rpx - 40rpx);
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 0rpx 0rpx;
|
||||
}
|
||||
.borderBottom{
|
||||
border-radius: 0rpx 16rpx 16rpx 16rpx;
|
||||
}
|
||||
.rightGet{
|
||||
width: 136rpx;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(180deg, #FDC674 0%, #FF9A02 100%);
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
margin-left: 38rpx;
|
||||
}
|
||||
|
||||
.evaluation {
|
||||
width: calc(502rpx - 40rpx);
|
||||
padding: 20rpx;
|
||||
margin-top: 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
||||
.greyTag{
|
||||
padding: 18rpx 40rpx;
|
||||
background: #F8F8F8;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 20rpx;
|
||||
color: #3F4040;
|
||||
.tegWidth{
|
||||
width: 2rpx;
|
||||
height: 24rpx;
|
||||
background: #CCCCCC;
|
||||
margin: 0 24rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.shawDown{
|
||||
background: #EFF9F8;
|
||||
color: $uni-color;
|
||||
}
|
||||
.cut{
|
||||
margin-top: 32rpx;
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.greyColor{
|
||||
color: grey;
|
||||
}
|
||||
.qding{
|
||||
width: 320rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50rpx;
|
||||
margin: 0 auto;
|
||||
color: #FFFFFF;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.pickerTag{
|
||||
padding: 0 24rpx 0 20rpx;
|
||||
height: 62rpx;
|
||||
background: #F8F8F8;
|
||||
border-radius: 8rpx;
|
||||
margin: 20rpx 0;
|
||||
color: #909292;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.pickerShow{
|
||||
background: #EFF9F8;
|
||||
color: #3AAFB8;
|
||||
}
|
||||
}
|
||||
.rightLayOut{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 32rpx;
|
||||
.leftTag{
|
||||
padding: 20rpx 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 16rpx 0rpx 16rpx 16rpx;
|
||||
color: #FFFFFF;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.rightAvter{
|
||||
$wh:80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.bottomBtn{
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
width: calc(100% - 64rpx);
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,961 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="pageShow">
|
||||
<view class="topPostionBg"></view>
|
||||
<block v-if="temporarily">
|
||||
<uni-popup type="center" ref="center" :isMaskClick="false">
|
||||
<view class="staging bg-video">
|
||||
<view class="bg"></view>
|
||||
<view class="text-center">
|
||||
<image src="https://shayu5qny.yhy.ren/stagingBackground.png" class="stagingBackground"></image>
|
||||
</view>
|
||||
<view class="text-xxl text-center threeSix text-bold">温馨提示</view>
|
||||
<view class="text-center text-sm oneTwo">嗨!发现您还有一份填了一半的问卷呢</view>
|
||||
<view class="text-center text-sm">请告诉我您想怎么处理</view>
|
||||
<view class="stagBtn margin-top-xs" @tap="continueChange">继续填写</view>
|
||||
<view class="text-center text-df colorGrey" @tap="againQuestion">重新填写</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</block>
|
||||
<view class="contioner" v-else>
|
||||
<view class="topCard bg-video">
|
||||
<view class="headSculpture">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png"></image>
|
||||
</view>
|
||||
<view class="border text-center bg-video">
|
||||
<view class="top text-df text-bold">
|
||||
<text class="color">鲨鱼宝宝</text>
|
||||
<text class="cut"></text>
|
||||
<text>专属评估客服</text>
|
||||
</view>
|
||||
<view class="flex-conter margin-top-xs marginBottom">
|
||||
<view class="tag marginRight-xs">{{(allCount*15/60).toFixed(0)}}分钟</view>
|
||||
<view class="tag marginRight-xs">{{allCount}}题</view>
|
||||
<view class="tag marginRight-xs" v-if="subTopic.length>0">父子题</view>
|
||||
<view class="tag" v-if="integral!=0">积分奖励</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y :style="{'height':srcollHeight}" :scroll-top="scrollView" @scroll="scroll"
|
||||
scroll-with-animation>
|
||||
<view class="next" style="padding-top: 32rpx;"></view>
|
||||
<block v-for="(item,index) in cardRadio" :key="index">
|
||||
<view v-show="item.hidden">
|
||||
<view class="flex bg-video" style="margin-top: 32rpx;">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="color flex-sub">
|
||||
<view class="introduce text-df">
|
||||
<view v-html="(index + 1)+':'+item.subjectInfo"></view>
|
||||
<view class="text-sm margin-top-xs" style="color: #5878B4;" v-if="item.memo!=null">
|
||||
注:{{item.memo}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 单选样式 -->
|
||||
<block v-if="item.subjectType=='0'">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">单选</view>
|
||||
<block v-for="(item1,index1) in item.diseaseAssessSubjectOption" :key="index1">
|
||||
<view :class="['greyTag',item1.hidden?'shawDown':'']"
|
||||
@tap="cardChange(index,index1,item1)">
|
||||
<text class="text-bold">{{item1.optionCode}}</text>
|
||||
<text class="tegWidth"></text>
|
||||
<text>{{item1.optionValue}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 多选样式 -->
|
||||
<block v-if="item.subjectType=='1'">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">多选</view>
|
||||
<checkbox-group>
|
||||
<label v-for="(item1,index1) in item.diseaseAssessSubjectOption"
|
||||
:key="item1.id" @tap="multipleChange(index,index1,item1)">
|
||||
<view :class="['greyTag flex-contion',item1.hidden?'shawDown':'']">
|
||||
<checkbox color="#3AAFB8" :value="item1.optionCode"
|
||||
:checked="item1.hidden" />
|
||||
<view class="marginLeft-sm">{{item1.optionValue}}</view>
|
||||
</view>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
<view class="qding" @tap="nextMulQuestion(index)">确认</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 填空样式 -->
|
||||
<block v-if="item.subjectType=='2'||item.subjectType=='4'">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">填空</view>
|
||||
<block v-for="(item1,index1) in item.diseaseAssessSubjectOption" :key="index1">
|
||||
<view class="marginTop-sm" v-if="item.subjectType=='2'">
|
||||
{{item1.optionValue}}
|
||||
</view>
|
||||
<view @tap="inputChange(item.subjectInfo,
|
||||
item1.optionCode!=''&&item1.optionCode!=null?item1.optionCode:item1.defaultValue,
|
||||
index,index1)" :class="['inputClass',(item1.optionCode==''||item1.optionCode==null)&&(
|
||||
item1.defaultValue==''||item1.defaultValue==null)?'greyColor':'']">
|
||||
{{item1.optionCode!=''&&item1.optionCode!=null?item1.optionCode:
|
||||
item1.defaultValue!=''&&item1.defaultValue!=null?item1.defaultValue:'请输入'}}
|
||||
</view>
|
||||
</block>
|
||||
<view class="qding" @tap="nextBlanQuestion(index)">确认</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 时间选择器样式 -->
|
||||
<block v-if="item.subjectType=='5'">
|
||||
<view class="evaluation">
|
||||
<block v-for="(item1,index1) in item.diseaseAssessSubjectOption" :key="index1">
|
||||
<view class="marginTop-sm text-df" style="color: #909292;">
|
||||
{{item1.optionValue}}
|
||||
</view>
|
||||
<picker mode="time" :value="item1.optionCode"
|
||||
@change="bindTimeChange($event,item1)">
|
||||
<view :class="['pickerTag flex-between align-center',item1.optionCode!=''?'pickerShow':'']">
|
||||
<view>
|
||||
{{item1.optionCode==''?'请选择':item1.optionCode}}
|
||||
</view>
|
||||
<uni-icons type="right" size="14" :style="{'color':item1.optionCode==''?'#909292':'#3AAFB8'}"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</block>
|
||||
<view class="qding" @tap="pickerQuestion(index)">确认</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-end" :class="['quest'+index]" v-if="item.defaultValue!=''">
|
||||
<view class="rightLayOut">
|
||||
<view class="leftTag flex-sub">{{item.defaultValue}}</view>
|
||||
<image :src="userProfile" class="rightAvter">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view style="width: 100%;height: 100rpx;"></view>
|
||||
</scroll-view>
|
||||
<uni-popup type="top" ref="inputRef" @maskClick="close">
|
||||
<view class="inputPopup">
|
||||
<view class="text-df">{{inputTitle}}</view>
|
||||
<block v-if="inputTitle!='请填写以下常规医学指标检查结果'&&inputTitle!='请填写以下医学指标检查结果'&&inputTitle!='请填写胃功能检查结果'">
|
||||
<block v-if="inputTitle!='请填写 骨密度检查指标-T值'">
|
||||
<input placeholder="请输入" type="number" @input="inputChange1" :value="inputValue"
|
||||
:focus="focus" @confirm="close" class="inputClass" />
|
||||
</block>
|
||||
<block v-else>
|
||||
<input placeholder="请输入" type="text" @input="inputChange1" :value="inputValue"
|
||||
:focus="focus" confirm-type="完成" @confirm="close" class="inputClass" />
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<input :value="inputValue" type="digit" placeholder="请输入" :focus="focus" @input="inputChange1"
|
||||
@confirm="close" class="inputClass" />
|
||||
</block>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<view class="bottomBtn" @tap="submitMultiple" v-if="isNext">生成评估报告</view>
|
||||
<!-- 返回底部 -->
|
||||
<view class="backBottom" @tap="goBottom" v-show="scrollGun<600&&isBottom">
|
||||
<image src="https://shayu5qny.yhy.ren/Frame.png"></image>
|
||||
<view class="text-sm themColor">返回底部</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageShow: false, //数据是否渲染完成
|
||||
isBumit: false, //是否提交
|
||||
userParameters: {}, //接收用户参数
|
||||
queShow: 0, //暂存题目索引
|
||||
// 题目类型
|
||||
diseases: '',
|
||||
// 是否为最后一题
|
||||
isNext: false,
|
||||
// 腰围
|
||||
waist: null,
|
||||
// 臀围
|
||||
hipline: null,
|
||||
// 存取所有答案
|
||||
questionObject: {},
|
||||
// 键
|
||||
key: '',
|
||||
// 值
|
||||
value: '',
|
||||
// 所有父题集合
|
||||
cardRadio: [],
|
||||
// 所有子题目集合
|
||||
subTopic: [],
|
||||
// 暂存问卷页面是否显示
|
||||
temporarily: false,
|
||||
// 获取问卷生成id
|
||||
generationId: '',
|
||||
// 获取暂存问卷的选中项
|
||||
checkItem: {},
|
||||
allCount: '', //总题目数量
|
||||
userProfile: '', //用户头像
|
||||
memberId: '', //判断是用户还是成员 0用户 成员id
|
||||
memberName: '', // 成员昵称
|
||||
memberImg: '', // 成员头像
|
||||
memberAge: '', // 成员年龄
|
||||
age: '', //用户年龄
|
||||
srcollHeight: "", //题目的高度
|
||||
scrollView: 0, //题目距离顶部的位置
|
||||
scrollGun: 0, //屏幕滚动的高度
|
||||
fixedHeight: 100000, //固定底部高度
|
||||
integral: null,
|
||||
isBottom: false, //是否显示返回底部按钮
|
||||
inptuIndex: 0, //输入框父级索引
|
||||
inptuIndex1: 0, //输入框索引
|
||||
inputValue: '', //输入框的值
|
||||
inputTitle: '', //题目标题
|
||||
focus: false, //是否获取焦点
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
let data = JSON.parse(decodeURIComponent(options.params))
|
||||
if (data.token) {
|
||||
this.userParameters.openId = data.openId //用户唯一标识
|
||||
this.userParameters.token = data.token //用户唯一标识
|
||||
}
|
||||
this.userParameters.userId = data.userId //用户id
|
||||
this.diseases = data.diseases // 疾病编码
|
||||
this.memberId = data.memberId // 判断是用户还是成员 0用户 成员id
|
||||
this.age = data.age //用户年龄
|
||||
this.userName = data.name //名称
|
||||
this.userProfile = data.headSculpture //用户头像
|
||||
// 查询是否有暂存数据
|
||||
this.temporaryAata()
|
||||
this.selectIntegral()
|
||||
},
|
||||
// 页面销毁前暂存问卷
|
||||
beforeDestroy() {
|
||||
if (!this.isBumit) {
|
||||
this.temporaryQuestion()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 查询是否有积分奖励
|
||||
selectIntegral() {
|
||||
this.$API.selectTaskIntegral({
|
||||
data: {
|
||||
...this.userParameters,
|
||||
assessIds: this.diseases, //本次评估病种
|
||||
typeId: 1, //查询类型id 1疾病
|
||||
}
|
||||
}).then(res => {
|
||||
this.integral = res.data
|
||||
})
|
||||
},
|
||||
//点击获取下一题的距离
|
||||
questClass(index) {
|
||||
this.queShow = index + 1 //暂存问卷题目索引
|
||||
setTimeout(() => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".quest" + index).boundingClientRect((data) => {
|
||||
this.scrollView = parseInt(this.scrollGun + data.top - 82)
|
||||
}).exec();
|
||||
if (index > 3) {
|
||||
this.isBottom = true
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
// 滚动位置赋值
|
||||
scroll(e) {
|
||||
this.scrollGun = e.target.scrollTop
|
||||
},
|
||||
// 滚动到页面底部
|
||||
goBottom() {
|
||||
let num = this.fixedHeight++
|
||||
this.scrollView = num
|
||||
},
|
||||
//获取元素高度
|
||||
Height() {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".next").boundingClientRect((data) => {
|
||||
// 得到高度
|
||||
this.srcollHeight = uni.getSystemInfoSync().windowHeight - data.top - 18 + "px";
|
||||
}).exec();
|
||||
},
|
||||
// 查询是否有暂存数据
|
||||
temporaryAata() {
|
||||
let that = this
|
||||
let a = this.userParameters
|
||||
if (that.memberId != '0') {
|
||||
a.userId = this.memberId
|
||||
}
|
||||
that.$API.selectPaperList({
|
||||
data: {
|
||||
...a,
|
||||
diseseaId: that.diseases
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.data == null) {
|
||||
that.getInfo()
|
||||
} else {
|
||||
// 获取问卷生成id 继续填写时需要
|
||||
that.generationId = res.data.id
|
||||
that.queShow = parseInt(res.data.lastSubCode) // 获取暂存题目索引
|
||||
that.$set(that, 'temporarily', true)
|
||||
that.pageShow = true
|
||||
setTimeout(() => {
|
||||
that.$refs.center.open()
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取问卷信息
|
||||
async getInfo() {
|
||||
let that = this
|
||||
showLoading('加载中...')
|
||||
let ret = await that.$API.selectBasisAssessInfo({
|
||||
data: {
|
||||
...this.userParameters,
|
||||
diseases: that.diseases,
|
||||
memberId: that.memberId,
|
||||
}
|
||||
})
|
||||
this.allCount = ret.data.subject.length //题目总数
|
||||
const isSubject = ret.data.subject.findIndex(item => item.hidden == true)
|
||||
ret.data.subject.map((item, index) => {
|
||||
// 去掉月经题目
|
||||
if (item.isTopSubject == 0 && item.id != 603) {
|
||||
// 得到所有父题及选择的题
|
||||
that.cardRadio.push(item)
|
||||
}
|
||||
if (item.isTopSubject == 1) {
|
||||
// 得到所有子题
|
||||
that.subTopic.push(item)
|
||||
}
|
||||
if (isSubject != -1) { //答过
|
||||
// 多选回显处理
|
||||
if (item.subjectType == '1' && item.hidden && item.id != 612) {
|
||||
const index = item.diseaseAssessSubjectOption.findIndex(item => {
|
||||
return item.hidden == true
|
||||
})
|
||||
if (index == -1) {
|
||||
item.diseaseAssessSubjectOption[item.diseaseAssessSubjectOption.length - 1]
|
||||
.hidden = true
|
||||
} else {
|
||||
item.diseaseAssessSubjectOption[item.diseaseAssessSubjectOption.length - 1]
|
||||
.hidden = false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
const isSubjects = ret.data.subject.findIndex(item => item.hidden == true)
|
||||
that.cardRadio.map((item, index) => {
|
||||
if (isSubjects != -1) { //答过
|
||||
// 单选回显处理
|
||||
if (item.subjectType == '0' && item.hidden) {
|
||||
const index11 = item.diseaseAssessSubjectOption.findIndex(item1 => {
|
||||
return item1.hidden == true
|
||||
})
|
||||
if (index11 != -1) {
|
||||
item.defaultValue = item.diseaseAssessSubjectOption[index11].optionCode + '.' +
|
||||
item.diseaseAssessSubjectOption[index11].optionValue
|
||||
}
|
||||
}
|
||||
// 多选回显处理
|
||||
if (item.subjectType == '1' && item.hidden) {
|
||||
let a = []
|
||||
item.diseaseAssessSubjectOption.map((items, indexs) => {
|
||||
if (items.hidden) {
|
||||
a.push(items.optionValue)
|
||||
}
|
||||
})
|
||||
item.defaultValue = a.toString()
|
||||
}
|
||||
// 填空回显处理
|
||||
if (item.subjectType == '2' || item.subjectType == '4') {
|
||||
if (item.diseaseAssessSubjectOption.length == 1) {
|
||||
// 有值才赋值
|
||||
if (item.diseaseAssessSubjectOption[0].optionCode != null && item
|
||||
.diseaseAssessSubjectOption[0].optionCode != '') {
|
||||
item.defaultValue = item.diseaseAssessSubjectOption[0].optionValue + ':' +
|
||||
item
|
||||
.diseaseAssessSubjectOption[0].optionCode
|
||||
}
|
||||
} else {
|
||||
let a = []
|
||||
item.diseaseAssessSubjectOption.map((items, indexs) => {
|
||||
if (items.optionCode != '' && items.optionCode != null) {
|
||||
a.push(items.optionValue + ':' + items
|
||||
.optionCode) //对话框 展示给用户看的值
|
||||
} else {
|
||||
a.push(items.optionValue + ':' + items
|
||||
.defaultValue) //对话框 展示给用户看的值
|
||||
}
|
||||
})
|
||||
item.defaultValue = a.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
that.subTopic.map((item, index) => {
|
||||
if (isSubjects != -1) { //答过
|
||||
// 单选回显处理
|
||||
if (item.subjectType == '0' && item.hidden) {
|
||||
const index11 = item.diseaseAssessSubjectOption.findIndex(item1 => {
|
||||
return item1.hidden == true
|
||||
})
|
||||
item.defaultValue = item.diseaseAssessSubjectOption[index11].optionCode + '.' +
|
||||
item.diseaseAssessSubjectOption[index11].optionValue
|
||||
}
|
||||
// 填空回显处理
|
||||
if (item.subjectType == '2' || item.subjectType == '4') {
|
||||
if (item.diseaseAssessSubjectOption.length == 1) {
|
||||
// 有值才赋值
|
||||
if (item.diseaseAssessSubjectOption[0].optionCode != null) {
|
||||
item.defaultValue = item.diseaseAssessSubjectOption[0].optionValue + ':' +
|
||||
item
|
||||
.diseaseAssessSubjectOption[0].optionCode
|
||||
}
|
||||
} else {
|
||||
let a = []
|
||||
item.diseaseAssessSubjectOption.map((items, indexs) => {
|
||||
if (items.optionCode != '' && items.optionCode != null) {
|
||||
a.push(items.optionValue + ':' + items
|
||||
.optionCode) //对话框 展示给用户看的值
|
||||
} else {
|
||||
a.push(items.optionValue + ':' + items
|
||||
.defaultValue) //对话框 展示给用户看的值
|
||||
}
|
||||
})
|
||||
item.defaultValue = a.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
that.cardRadio.map((item, index) => {
|
||||
if (index == 0) {
|
||||
item.hidden = true
|
||||
} else {
|
||||
item.hidden = false
|
||||
}
|
||||
})
|
||||
if (ret.data.topPaperSave != null) {
|
||||
that.questionObject = JSON.parse(ret.data.topPaperSave.paperJson)
|
||||
}
|
||||
that.pageShow = true
|
||||
// 获取题目列表高度
|
||||
setTimeout(() => {
|
||||
that.Height()
|
||||
hideLoading()
|
||||
}, 100)
|
||||
},
|
||||
// 输入框点击获取索引
|
||||
inputChange(value, value1, index, index1) {
|
||||
this.inputTitle = value
|
||||
this.inputValue = value1
|
||||
this.inptuIndex = index
|
||||
this.inptuIndex1 = index1
|
||||
this.$refs.inputRef.open()
|
||||
this.$nextTick(() => {
|
||||
this.focus = true
|
||||
})
|
||||
},
|
||||
// 关闭输入框弹框
|
||||
close() {
|
||||
this.focus = false
|
||||
this.cardRadio[this.inptuIndex].diseaseAssessSubjectOption[this.inptuIndex1].optionCode = this.inputValue
|
||||
},
|
||||
// 输入框
|
||||
inputChange1(e, item1) {
|
||||
this.inputValue = e.detail.value
|
||||
},
|
||||
// 填空 确定
|
||||
nextBlanQuestion(index) {
|
||||
let that = this;
|
||||
for (var i = 0; i < that.cardRadio[index].diseaseAssessSubjectOption.length; i++) {
|
||||
if (that.cardRadio[index].diseaseAssessSubjectOption[i].optionCode == '' || that.cardRadio[index]
|
||||
.diseaseAssessSubjectOption[i].optionCode == null) {
|
||||
return toast('请先填写')
|
||||
}
|
||||
}
|
||||
let value = that.cardRadio[index].diseaseAssessSubjectOption[0].optionCode
|
||||
// 只允许输入整数的正则表达式
|
||||
const reg = /^\d*$/;
|
||||
const regs = /^[+-]?(0|([1-9]\d*))(\.\d{1})?$/
|
||||
let subType = that.cardRadio[index].subjectCode
|
||||
if ((subType == 'waist' || subType == 'height') && !reg.test(value)) {
|
||||
if (subType == 'waist') {
|
||||
return toast('腰围只能输入整数')
|
||||
} else {
|
||||
return toast('身高只能输入整数')
|
||||
}
|
||||
}
|
||||
if (subType == 'weight' && !regs.test(value)) {
|
||||
return toast('体重只能输入一位整数')
|
||||
}
|
||||
// memberId不为0时为成员,否则就是用户本人
|
||||
if (that.cardRadio[index].subjectCode == 'smoke_begin_age' || that.cardRadio[index].subjectCode ==
|
||||
'smoke_end_age') {
|
||||
if (value > this.age || value == 0) return toast(value > this.age ? '不能大于当前的年龄' :
|
||||
'不能为0')
|
||||
}
|
||||
let data = that.cardRadio[index].diseaseAssessSubjectOption
|
||||
if (data.length == 1) {
|
||||
// 获取键和值
|
||||
that.key = that.cardRadio[index].subjectCode
|
||||
that.$set(that.questionObject, that.key, value)
|
||||
that.cardRadio[index].defaultValue = data[0].optionValue + ':' + data[0].optionCode
|
||||
} else {
|
||||
let a = []
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
let key = data[i].qcode
|
||||
if (data[i].optionCode != '' && data[i].optionCode != null) {
|
||||
a.push(data[i].optionValue + ':' + data[i].optionCode) //对话框 展示给用户看的值
|
||||
// 获取键和值
|
||||
this.$set(this.questionObject, key, data[i].optionCode)
|
||||
} else {
|
||||
a.push(data[i].optionValue + ':' + data[i].defaultValue) //对话框 展示给用户看的值
|
||||
this.$set(this.questionObject, key, data[i].defaultValue)
|
||||
}
|
||||
}
|
||||
that.$set(that.cardRadio[index], 'defaultValue', a.toString())
|
||||
}
|
||||
// 判断是否为最后一题
|
||||
if (index == that.cardRadio.length - 1) {
|
||||
that.$set(that.cardRadio[index], 'hidden', true)
|
||||
return that.$set(that, 'isNext', true)
|
||||
} else {
|
||||
that.$set(that.cardRadio[index + 1], 'hidden', true)
|
||||
}
|
||||
that.questClass(index)
|
||||
},
|
||||
//单选 卡片点击事件
|
||||
cardChange(index, index1, item1) {
|
||||
let that = this
|
||||
// 获取键和值
|
||||
that.key = that.cardRadio[index].diseaseAssessSubjectOption[index1].qcode
|
||||
that.value = that.cardRadio[index].diseaseAssessSubjectOption[index1].optionCode
|
||||
that.$set(that.cardRadio[index], 'defaultValue', item1.optionCode + '.' + item1.optionValue)
|
||||
if (that.key.indexOf("sport_in") != -1) {
|
||||
if (that.key.indexOf("sport_freq") != -1) {
|
||||
let keys = that.key.split(",");
|
||||
keys.map((item) => {
|
||||
that.$set(that.questionObject, item.split(":")[0], item.split(":")[1])
|
||||
})
|
||||
} else {
|
||||
let keys = that.key.split(":");
|
||||
that.$set(that.questionObject, keys[0], keys[1])
|
||||
}
|
||||
|
||||
} else {
|
||||
that.$set(that.questionObject, that.key, that.value)
|
||||
}
|
||||
//获取到原选中的选项
|
||||
let oldIndex = -1;
|
||||
// 循环单个选项
|
||||
that.cardRadio[index].diseaseAssessSubjectOption.map((item, ind) => {
|
||||
if (item.hidden) {
|
||||
oldIndex = ind;
|
||||
}
|
||||
// 判断卡片选中哪一项
|
||||
if (ind == index1) {
|
||||
item.hidden = true
|
||||
} else {
|
||||
item.hidden = false
|
||||
}
|
||||
})
|
||||
if (oldIndex != -1) {
|
||||
// 获取子题列表
|
||||
let oldZiti = this.fuyon(that.cardRadio[index].id, oldIndex + 1);
|
||||
// 是不是已经存在子题,只有存在时才删
|
||||
const isSelect = that.cardRadio.findIndex(item => item.parentCode == that.cardRadio[index].id)
|
||||
if (oldZiti.length > 0) {
|
||||
//卡片返回重新选择 如果父题原选中项有子题则删除之前子题集合
|
||||
oldZiti.map((item, oldZi) => {
|
||||
if (isSelect != -1) {
|
||||
that.cardRadio.splice(index + 1 + (oldZiti.length - oldZi - 1), 1);
|
||||
}
|
||||
for (let key in that.questionObject) {
|
||||
|
||||
if (item.subjectCode == key) {
|
||||
Reflect.deleteProperty(that.questionObject, key)
|
||||
}
|
||||
}
|
||||
const idx = that.subTopic.findIndex(val => val.id == item.id)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
let num = this.fuyon(that.cardRadio[index].id, that.cardRadio[index].diseaseAssessSubjectOption[index1]
|
||||
.optionCode);
|
||||
// 插入子题方法
|
||||
this.matching(num, index + 1)
|
||||
// 判断是否为最后一题
|
||||
if (index == that.cardRadio.length - 1) {
|
||||
that.$set(that.cardRadio[index], 'hidden', true)
|
||||
that.$set(that, 'isNext', true)
|
||||
} else {
|
||||
that.$set(that.cardRadio[index + 1], 'hidden', true)
|
||||
}
|
||||
that.questClass(index)
|
||||
},
|
||||
// 子题插入父题后面
|
||||
matching(num, index1) {
|
||||
var that = this
|
||||
//合适位置插入子题集合
|
||||
num.map((item, index) => {
|
||||
that.cardRadio.splice(index1 + index, 0, item);
|
||||
})
|
||||
},
|
||||
// 匹配符合条件的子题目
|
||||
fuyon(id, code) {
|
||||
let num = []
|
||||
//拿到符合条件的子题
|
||||
this.subTopic.map((item) => {
|
||||
if (item.parentCode == id && item.parentSign.indexOf(code) > -1) {
|
||||
num.push(item)
|
||||
}
|
||||
})
|
||||
return num;
|
||||
},
|
||||
//有父子题则显示
|
||||
jinru() {
|
||||
let num = []
|
||||
let b = []
|
||||
this.cardRadio.map((item, index) => {
|
||||
item.diseaseAssessSubjectOption.map((item1, index1) => {
|
||||
//拿到符合条件的子题
|
||||
this.subTopic.map((item2, index2) => {
|
||||
if (item1.hidden && item2.parentCode == item.id && item2.parentSign
|
||||
.indexOf(item.diseaseAssessSubjectOption[index1].optionCode) > -1
|
||||
) {
|
||||
num.push(item2)
|
||||
b.push(index)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
if (num.length > 0) {
|
||||
num.map((item3, index3) => {
|
||||
this.cardRadio.splice(b[index3] + 1 + index3, 0, item3);
|
||||
})
|
||||
}
|
||||
this.cardRadio.map((item, index) => {
|
||||
if (index <= this.queShow) {
|
||||
item.hidden = true
|
||||
} else {
|
||||
item.hidden = false
|
||||
}
|
||||
})
|
||||
},
|
||||
//多选 卡片点击事件
|
||||
multipleChange(index, index1, item1) {
|
||||
let that = this
|
||||
let data = that.cardRadio[index].diseaseAssessSubjectOption
|
||||
if (index1 == data.length - 1 && !data[index1].hidden) {
|
||||
data.map(item => {
|
||||
item.hidden = false
|
||||
})
|
||||
data[index1].hidden = true
|
||||
} else {
|
||||
data[index1].hidden = !data[index1].hidden
|
||||
data[data.length - 1].hidden = false
|
||||
}
|
||||
},
|
||||
// 多选 确定
|
||||
nextMulQuestion(index) {
|
||||
let that = this;
|
||||
let b = []
|
||||
that.cardRadio[index].diseaseAssessSubjectOption.map(ite => {
|
||||
if (ite.hidden) {
|
||||
b.push(ite)
|
||||
}
|
||||
})
|
||||
if (b.length == 0) return toast('请选择')
|
||||
if (index == that.cardRadio.length - 1) {
|
||||
that.cardRadio[index].hidden = true
|
||||
that.$set(that, 'isNext', true)
|
||||
} else {
|
||||
that.cardRadio[index + 1].hidden = true
|
||||
}
|
||||
let data = that.cardRadio[index].diseaseAssessSubjectOption
|
||||
let a = []
|
||||
// 赋值
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data[i].hidden) {
|
||||
a.push(data[i].optionValue)
|
||||
}
|
||||
if (data[i].hidden && i < data.length - 1) { // 没有选择均无选项
|
||||
that.$set(that.questionObject, data[i].qcode, '1')
|
||||
that.$set(that.questionObject, data[data.length - 1].qcode, '2')
|
||||
} else if (data[i].hidden) { // 选择均无选项
|
||||
that.$set(that.questionObject, data[i].qcode, '1')
|
||||
data.map((item, indexs) => {
|
||||
if (indexs < data.length - 1) {
|
||||
that.$set(that.questionObject, item.qcode, '2')
|
||||
}
|
||||
})
|
||||
} else if (i < data.length - 1) {
|
||||
that.$set(that.questionObject, data[i].qcode, '2')
|
||||
}
|
||||
}
|
||||
that.cardRadio[index].defaultValue = a.toString()
|
||||
that.questClass(index)
|
||||
},
|
||||
// 阳性阳性点击
|
||||
hivChange(index1, index) {
|
||||
this.cardRadio[index].diseaseAssessSubjectOption[index1].hidden = !this.cardRadio[index]
|
||||
.diseaseAssessSubjectOption[index1].hidden
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 阴性阳性提交
|
||||
submitHiv(index, val) {
|
||||
let that = this
|
||||
if (that.cardRadio[index].subjectCode == 'hiv_his') {
|
||||
let data = that.cardRadio[index].diseaseAssessSubjectOption
|
||||
// 赋值
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data[i].hidden) {
|
||||
that.$set(that.questionObject, data[i].qcode, 1)
|
||||
} else {
|
||||
that.$set(that.questionObject, data[i].qcode, 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 时间选择器
|
||||
bindTimeChange(e, item1) {
|
||||
item1.optionCode = e.detail.value
|
||||
},
|
||||
// 时间选择器 确定
|
||||
pickerQuestion(index) {
|
||||
let data = this.cardRadio[index].diseaseAssessSubjectOption
|
||||
if (data[0].optionCode == '' || data[1].optionCode == '') return toast('请先选择')
|
||||
if (data[0].optionCode == data[1].optionCode) return toast('开始时间不能等于结束时间')
|
||||
let hour = this.calculateMinutes(data[0].optionCode, data[1].optionCode) //判断睡了多久 小时
|
||||
let a = []
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
let key = data[i].qcode
|
||||
a.push(data[i].optionValue + ':' + data[i].optionCode) //对话框 展示给用户看的值
|
||||
// 获取键和值
|
||||
this.$set(this.questionObject, key, data[i].optionCode)
|
||||
}
|
||||
this.$set(this.cardRadio[index], 'defaultValue', a.toString())
|
||||
let oldZiti = this.pickerFuyon('first'); // 获取父题中是否有其对应的子题
|
||||
// 父题中存在对应的子题则删除
|
||||
if (oldZiti.length > 0) {
|
||||
//卡片返回重新选择 如果父题原选中项有子题则删除之前子题集合
|
||||
oldZiti.map((item, oldZi) => {
|
||||
this.cardRadio.splice(index + 1 + (oldZiti.length - oldZi - 1), 1);
|
||||
for (let key in this.questionObject) {
|
||||
if (item.subjectCode == key) {
|
||||
Reflect.deleteProperty(this.questionObject, key)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 父题中不存在对应的子题并且睡眠时间小于7小时则增加子题
|
||||
if (oldZiti.length == 0 && hour < 7) {
|
||||
let num = this.pickerFuyon('last'); // 获取子题列表
|
||||
this.matching(num, index + 1) // 插入子题方法
|
||||
}
|
||||
this.$set(this.cardRadio[index + 1], 'hidden', true)
|
||||
this.questClass(index)
|
||||
console.log(this.questionObject, 'this.questionObject')
|
||||
},
|
||||
// 匹配符合条件的子题目
|
||||
pickerFuyon(value) {
|
||||
let num = []
|
||||
// 获取父题中是否存在对应子题
|
||||
if (value == 'first') {
|
||||
this.cardRadio.map((item) => {
|
||||
if (item.id == 695 || item.id == 694) {
|
||||
num.push(item)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
//拿到符合条件的子题
|
||||
this.subTopic.map((item) => {
|
||||
if (item.id == 695 || item.id == 694) {
|
||||
num.push(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
return num;
|
||||
},
|
||||
calculateMinutes(time1, time2) {
|
||||
// 将时间转换为小时数
|
||||
const hours1 = time1.split(':').reduce((acc, value) => acc * 60 + parseInt(value, 10), 0);
|
||||
const hours2 = time2.split(':').reduce((acc, value) => acc * 60 + parseInt(value, 10), 0);
|
||||
// 计算差值并转换为小时
|
||||
let diff = 0
|
||||
let num = 0
|
||||
if (time2 < time1) {
|
||||
diff = 24 - (hours1 / 60) + (hours2 / 60)
|
||||
} else {
|
||||
diff = Math.abs(hours2 - hours1) / 60
|
||||
}
|
||||
return diff;
|
||||
},
|
||||
// 提交答题
|
||||
async submitMultiple() {
|
||||
this.isBumit = true //提交时不执行页面销毁暂存问卷方法
|
||||
if (this.$preventClick()) return
|
||||
let a = []
|
||||
this.cardRadio.map(item => {
|
||||
if (item.hidden) {
|
||||
a.push(item)
|
||||
}
|
||||
})
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
if (a[i].defaultValue == "") {
|
||||
return toast('请将题目填写完')
|
||||
}
|
||||
}
|
||||
let that = this
|
||||
showLoading('提交中')
|
||||
if(that.questionObject == "1"){
|
||||
|
||||
}else{
|
||||
if(that.questionObject){
|
||||
|
||||
}else{
|
||||
that.questionObject.sport_time = "4"
|
||||
}
|
||||
}
|
||||
|
||||
let questionObject = JSON.stringify(that.questionObject)
|
||||
let reg = await that.$API.basisAssessSaveJson({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
diseases: that.diseases,
|
||||
subjectJson: questionObject,
|
||||
subType: '1',
|
||||
memberId: that.memberId
|
||||
}
|
||||
})
|
||||
hideLoading()
|
||||
if (reg.code == 200) {
|
||||
if (this.diseases == '95') {
|
||||
let b = {
|
||||
userParameters: JSON.stringify(this.userParameters), //用户参数
|
||||
name: this.userName,
|
||||
memberId: this.memberId, // 判断是用户还是成员 0用户 成员id
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages/health-risks/basicReport/basicReport?params=' + JSON
|
||||
.stringify(b)
|
||||
})
|
||||
} else {
|
||||
let b = {
|
||||
memberId: this.memberId, // 判断是用户还是成员 0用户 成员id
|
||||
userParameters: JSON.stringify(this.userParameters), //用户参数
|
||||
headSculpture: this.userProfile,
|
||||
name: this.userName,
|
||||
cno: reg.data,
|
||||
diseases: '',
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages/health-risks/evaluationResults/evaluationResults?params=' + JSON
|
||||
.stringify(b)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
toast(reg.msg ? reg.msg : '生成报告异常')
|
||||
}
|
||||
},
|
||||
// 暂存问卷
|
||||
temporaryQuestion() {
|
||||
if (this.$preventClick()) return
|
||||
let that = this
|
||||
let a = that.cardRadio
|
||||
let b = []
|
||||
if (that.subTopic.length > 0) {
|
||||
that.subTopic.map(item => {
|
||||
let res = a.filter(it => Number(it.parentCode) === item.parentCode);
|
||||
if (res.length > 0) {
|
||||
item = res[0]
|
||||
}
|
||||
})
|
||||
a.map((item, index) => {
|
||||
// 月经赋值
|
||||
if (item.id == 603 && that.age < 35) {
|
||||
that.$set(that.questionObject, item.diseaseAssessSubjectOption[0].qcode,
|
||||
'1')
|
||||
}
|
||||
if (item.isTopSubject == 0) {
|
||||
// 得到所有父题及选择的题
|
||||
b.push(item)
|
||||
}
|
||||
})
|
||||
that.subTopic.map(item => {
|
||||
b.push(item)
|
||||
})
|
||||
that.cardRadio = b
|
||||
}
|
||||
let paperJson = JSON.stringify(that.cardRadio)
|
||||
let ret = that.$API.basisAssessSaveJson({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
diseases: that.diseases, //题目类型
|
||||
memberId: that.memberId, //成员id
|
||||
subjectJson: paperJson, //存取所有的题目
|
||||
lastSubCode: that.queShow, //最后答题完成的编号
|
||||
subType: '0', //答题状态(1 完成 0未完成 )
|
||||
}
|
||||
})
|
||||
},
|
||||
// 继续填写
|
||||
async continueChange() {
|
||||
if (this.$preventClick()) return
|
||||
let that = this
|
||||
let ret = await this.$API.generatePaper({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
paperId: that.generationId, //试卷id
|
||||
memberId: that.memberId
|
||||
}
|
||||
})
|
||||
that.temporarily = false
|
||||
that.allCount = ret.data.subject.length //题目总数
|
||||
if (ret.data.topPaperSave != null) {
|
||||
that.questionObject = JSON.parse(ret.data.topPaperSave.paperJson)
|
||||
}
|
||||
ret.data.subject.map((item, index) => {
|
||||
// 月经赋值
|
||||
if (item.id == 603 && that.age < 35) {
|
||||
that.$set(that.questionObject, item.diseaseAssessSubjectOption[0].qcode,
|
||||
'1')
|
||||
}
|
||||
// 去掉月经题目
|
||||
if (item.isTopSubject == 1 && item.id != 603) {
|
||||
// 得到所有子题
|
||||
that.subTopic.push(item)
|
||||
}
|
||||
if (item.isTopSubject == 0) {
|
||||
// 得到所有父题及选择的题
|
||||
that.cardRadio.push(item)
|
||||
}
|
||||
})
|
||||
that.jinru()
|
||||
setTimeout(() => {
|
||||
that.Height() // 获取题目列表高度
|
||||
that.scrollView = 100000
|
||||
}, 100)
|
||||
},
|
||||
// 重新填写
|
||||
againQuestion() {
|
||||
if (this.$preventClick()) return
|
||||
this.cardRadio = []
|
||||
this.subTopic = []
|
||||
this.temporarily = false
|
||||
this.getInfo()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss';
|
||||
</style>
|
After Width: | Height: | Size: 346 B |
|
@ -0,0 +1,25 @@
|
|||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,265 @@
|
|||
.pageBox {
|
||||
.color{
|
||||
color: #17191A;
|
||||
}
|
||||
.topPostionBg{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100vw;
|
||||
height: 528rpx;
|
||||
background: linear-gradient(155deg, #E4F5EB 0%, rgba(228,245,235,0) 100%);
|
||||
}
|
||||
.contioner{
|
||||
padding: 32rpx;
|
||||
.backBottom{
|
||||
position: fixed;
|
||||
bottom: 10vh;
|
||||
right: 34rpx;
|
||||
padding: 12rpx 32rpx;
|
||||
border-radius: 50rpx;
|
||||
background: #FFF;
|
||||
box-shadow: 0 8rpx 8rpx 0 rgba(4, 70, 74, 0.14);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:24rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
.topCard{
|
||||
padding: 12rpx;
|
||||
margin-top: 48rpx;
|
||||
border-radius: 32rpx;
|
||||
background: #FFFFFF;
|
||||
.headSculpture{
|
||||
$wh:112rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
background: #F3F4F6;
|
||||
border-radius: 50%;
|
||||
border: 6rpx solid #FFFFFF;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
top: -52rpx;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:100rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.border{
|
||||
border: 1rpx dotted #3AAFB8;
|
||||
border-radius: 20rpx;
|
||||
.cut{
|
||||
display: inline-block;
|
||||
width: 4rpx;
|
||||
height: 20rpx;
|
||||
margin: 0 12rpx;
|
||||
background: $uni-color;
|
||||
}
|
||||
.top{
|
||||
margin-top: 72rpx;
|
||||
color: $uni-color;
|
||||
}
|
||||
.tag{
|
||||
padding: 0 20rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 4rpx;
|
||||
background: #F3F4F6;
|
||||
color: #909292;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.avare {
|
||||
$wh: 80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.introduce {
|
||||
padding: 20rpx;
|
||||
width: calc(502rpx - 40rpx);
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 0rpx 0rpx;
|
||||
}
|
||||
.borderBottom{
|
||||
border-radius: 0rpx 16rpx 16rpx 16rpx;
|
||||
}
|
||||
.rightGet{
|
||||
width: 136rpx;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(180deg, #FDC674 0%, #FF9A02 100%);
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
margin-left: 38rpx;
|
||||
}
|
||||
|
||||
.evaluation {
|
||||
width: calc(502rpx - 40rpx);
|
||||
padding: 20rpx;
|
||||
margin-top: 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
||||
.greyTag{
|
||||
padding: 18rpx 40rpx;
|
||||
background: #F8F8F8;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 20rpx;
|
||||
color: #3F4040;
|
||||
.tegWidth{
|
||||
width: 2rpx;
|
||||
height: 24rpx;
|
||||
background: #CCCCCC;
|
||||
margin: 0 24rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
.tagWidth{
|
||||
$wh:40rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 32rpx;
|
||||
border: 4rpx solid #DCDCDC;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
.tagShaw{
|
||||
border: 4rpx solid $uni-color;
|
||||
background: $uni-color;
|
||||
}
|
||||
}
|
||||
.shawDown{
|
||||
background: #EFF9F8;
|
||||
color: $uni-color;
|
||||
}
|
||||
.cut{
|
||||
margin-top: 32rpx;
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #eee;
|
||||
}
|
||||
.fenge{
|
||||
width: 2rpx;
|
||||
height: 80rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: #eee;
|
||||
}
|
||||
.inputClass{
|
||||
border: 2rpx solid #3AAFB8;
|
||||
line-height: 64rpx;
|
||||
height: 64rpx;
|
||||
border-radius: 8rpx;
|
||||
padding:0 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.cutt {
|
||||
width: 2rpx;
|
||||
height: 32rpx;
|
||||
background: #323232;
|
||||
opacity: 0.2;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.qding{
|
||||
width: 320rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50rpx;
|
||||
margin: 0 auto;
|
||||
color: #FFFFFF;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.rightLayOut{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 32rpx;
|
||||
.leftTag{
|
||||
padding: 20rpx 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 16rpx 0rpx 16rpx 16rpx;
|
||||
color: #FFFFFF;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.rightAvter{
|
||||
$wh:80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.bottomBtn{
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
width: calc(100% - 64rpx);
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.pupupCard {
|
||||
width: 650rpx;
|
||||
min-height: 854rpx;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 0 20rpx;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
color: #333333;
|
||||
|
||||
.drawerBg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawerLogo {
|
||||
width: 236rpx;
|
||||
height: 266rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.wenTitle {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
margin-top: 38rpx;
|
||||
}
|
||||
|
||||
.bottomTitle {
|
||||
text-indent: 2rem;
|
||||
padding: 16rpx 32rpx 6rpx;
|
||||
letter-spacing: 3rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 328rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,582 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="pageShow" @touchmove.stop="">
|
||||
<view class="topPostionBg"></view>
|
||||
<view class="contioner">
|
||||
<view class="topCard bg-video">
|
||||
<view class="headSculpture">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png"></image>
|
||||
</view>
|
||||
<view class="border text-center bg-video">
|
||||
<view class="top text-df text-bold">
|
||||
<text class="color">鲨鱼宝宝</text>
|
||||
<text class="cut"></text>
|
||||
<text>专属评估客服</text>
|
||||
</view>
|
||||
<view class="flex-conter margin-top-xs marginBottom">
|
||||
<view class="tag marginRight-xs">{{(totalNumber*15/60).toFixed(0)}}分钟</view>
|
||||
<view class="tag marginRight-xs">{{totalNumber}}题</view>
|
||||
<view class="tag marginRight-xs" v-if="subTopic.length>0">父子题</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y :style="{'height':srcollHeight}" :scroll-top="scrollView" @scroll="scroll"
|
||||
scroll-with-animation>
|
||||
<view class="next" style="padding-top: 32rpx;"></view>
|
||||
<block v-for="(item,index) in cardRadio" :key="index">
|
||||
<view v-show="item.hidden">
|
||||
<view class="flex bg-video" style="margin-top: 32rpx;">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="color flex-sub">
|
||||
<view class="introduce text-df">
|
||||
<view>{{index + 1 }}: {{item.subjectInfo}}</view>
|
||||
<view class="text-sm margin-top-xs" style="color: #5878B4;" v-if="item.memo!=null">
|
||||
注:{{item.memo}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 单选样式 -->
|
||||
<block v-if="item.subjectType=='0'">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">单选</view>
|
||||
<block v-for="(item1,index1) in item.diseaseAssessSubjectOption" :key="index1">
|
||||
<view :class="['greyTag',item1.hidden?'shawDown':'']"
|
||||
@click="cardChange(index,index1,item1)">
|
||||
<text class="text-bold">{{item1.optionCode}}</text>
|
||||
<text class="tegWidth"></text>
|
||||
<text>{{item1.optionValue}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 多选样式 -->
|
||||
<block v-if="item.subjectType=='1'">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">多选</view>
|
||||
<block v-for="(item1,index1) in item.diseaseAssessSubjectOption" :key="index1">
|
||||
<view :class="['greyTag flex-contion',item1.hidden?'shawDown':'']"
|
||||
@tap="multipleChange(index,index1)">
|
||||
<view v-if="!item1.hidden" class="tagWidth"></view>
|
||||
<view v-else class="tagWidth tagShaw flex-conter">
|
||||
<uni-icons type="checkmarkempty" color="#fff"></uni-icons>
|
||||
</view>
|
||||
<view class="flex-sub">{{item1.optionValue}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="qding" @tap="nextMulQuestion(index)">确认</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 填空样式 -->
|
||||
<block v-if="item.subjectType=='2'">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">填空</view>
|
||||
<view class="inputClass flex-between align-center text-lg">
|
||||
<input placeholder="请输入" type="number" @input="inputChange"
|
||||
:value="pulseNum" />
|
||||
<view class="flex-contion">
|
||||
<view class="cutt"></view>
|
||||
<view>次</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="qding" @tap="nextBlanQuestion(index)">确认</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-end" :class="['quest'+index]" v-if="item.defaultValue!=''">
|
||||
<view class="rightLayOut">
|
||||
<view class="leftTag flex-sub">{{item.defaultValue}}</view>
|
||||
<image :src="userProfile" class="rightAvter"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view style="width: 100%;height: 100rpx;"></view>
|
||||
</scroll-view>
|
||||
<view class="bottomBtn" @tap="submitMultiple" v-if="isNext">完成答题</view>
|
||||
<!-- 返回底部 -->
|
||||
<view class="backBottom" @tap="goBottom" v-show="scrollGun<600&&isBottom">
|
||||
<image src="https://shayu5qny.yhy.ren/Frame.png"></image>
|
||||
<view class="text-sm themColor">返回底部</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="popup">
|
||||
<view class="pupupCard">
|
||||
<image src="https://shayu5qny.yhy.ren/drawerBg.png" class="drawerBg"></image>
|
||||
<view class="flex-conter">
|
||||
<image src="https://shayu5qny.yhy.ren/drawerLogo.png" class="drawerLogo"></image>
|
||||
</view>
|
||||
<view class="text-center wenTitle">温馨提示</view>
|
||||
<view class="bottomTitle">
|
||||
尊贵的用户<text
|
||||
style="color: #3AAFB8;">{{nickname}}</text>您好,欢迎参加此次健康管理计划,为了提高您参与计划过程中的安全性,预防运动损伤情况的发生,当出现以下状况时,请立刻停止运动,并寻求专业人员帮助!
|
||||
</view>
|
||||
<view style="padding: 0rpx 32rpx 24rpx;letter-spacing: 3rpx;">
|
||||
<view>1 处于疾病发作急性期时。</view>
|
||||
<view class="margin-top-xs">2 运动过程中出现头晕、胸闷、心悸、眼花等异常情况时。</view>
|
||||
<view class="margin-top-xs">3 出现关节、肌肉刺痛时(注意:肌肉酸痛为正常现象)。</view>
|
||||
</view>
|
||||
<view class="flex-conter">
|
||||
<view class="btn" @tap="submit">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userParameters: {}, //接收用户参数
|
||||
pageShow: false, //数据是否渲染完成
|
||||
srcollHeight: "", //题目的高度
|
||||
scrollView: 0, //题目距离顶部的位置
|
||||
scrollGun: 0, //屏幕滚动的高度
|
||||
fixedHeight: 100000, //固定底部高度
|
||||
isBottom: false, //是否显示返回底部按钮
|
||||
userProfile: '', //用户头像
|
||||
nickname: '', //用户名称
|
||||
pulseNum: '', // 脉搏次数
|
||||
totalNumber: '', //题目总数
|
||||
// 题目类型
|
||||
diseases: '',
|
||||
// 是否为最后一题
|
||||
isNext: false,
|
||||
// 存取所有答案
|
||||
questionObject: {},
|
||||
// 键
|
||||
key: '',
|
||||
// 值
|
||||
value: '',
|
||||
// 所有父题集合
|
||||
cardRadio: [],
|
||||
// 所有子题目集合
|
||||
subTopic: [],
|
||||
// 计划id
|
||||
planId: '',
|
||||
// 最后一个题目
|
||||
lastObj: {},
|
||||
// 心率填写次数
|
||||
tk_num: 0,
|
||||
// 判断监测第三题是否删除
|
||||
monitor: false,
|
||||
currentFive: null, //第五题 过敏主食
|
||||
toiceList: [], //下一题的题目
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
let data = JSON.parse(decodeURIComponent(opt.params))
|
||||
if (data.token) {
|
||||
this.userParameters.openId = data.openId //用户唯一标识
|
||||
this.userParameters.token = data.token //用户唯一标识
|
||||
}
|
||||
this.userParameters.userId = data.userId //用户id
|
||||
this.planId = data.planId // 计划id
|
||||
this.diseases = data.diseases // 题目类型
|
||||
this.nickname = data.name //用户名称
|
||||
this.userProfile = data.headSculpture //用户头像
|
||||
this.getPlanInfo()
|
||||
},
|
||||
methods: {
|
||||
//获取元素高度
|
||||
Height() {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".next").boundingClientRect((data) => {
|
||||
// 得到高度
|
||||
this.srcollHeight = uni.getSystemInfoSync().windowHeight - data.top - 18 + "px";
|
||||
}).exec();
|
||||
},
|
||||
//点击获取下一题的距离
|
||||
questClass(index) {
|
||||
setTimeout(() => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".quest" + index).boundingClientRect((data) => {
|
||||
this.scrollView = parseInt(this.scrollGun + data.top - 142)
|
||||
if (index > 3) {
|
||||
this.isBottom = true
|
||||
}
|
||||
}).exec();
|
||||
}, 100)
|
||||
},
|
||||
// 滚动位置赋值
|
||||
scroll(e) {
|
||||
this.scrollGun = e.target.scrollTop
|
||||
},
|
||||
// 滚动到页面底部
|
||||
goBottom() {
|
||||
let num = this.fixedHeight++
|
||||
this.scrollView = num
|
||||
},
|
||||
// 获取计划饮食运动问卷信息
|
||||
async getPlanInfo() {
|
||||
let that = this
|
||||
let ret = await that.$API.selectFoodsSubjectList({
|
||||
data: {
|
||||
...this.userParameters,
|
||||
planId: that.planId,
|
||||
}
|
||||
})
|
||||
this.totalNumber = ret.data.length //获取题目总数
|
||||
ret.data.map((item) => {
|
||||
item.defaultValue = ''
|
||||
if (item.isTopSubject == 0) {
|
||||
// 得到所有父题
|
||||
that.cardRadio.push(item)
|
||||
} else {
|
||||
// 得到所有子题
|
||||
that.subTopic.push(item)
|
||||
}
|
||||
// 获取你日常饮食中主食偏向题目
|
||||
if (item.subjectCode == 'foods_deviation') {
|
||||
that.currentFive = item
|
||||
}
|
||||
})
|
||||
that.cardRadio[0].hidden = true
|
||||
// 获取最后一道监测题目
|
||||
const sugIndex = that.cardRadio.findIndex(item => item.subjectCode == 'monitor_sug_ex')
|
||||
that.lastObj = that.cardRadio[sugIndex]
|
||||
that.pageShow = true
|
||||
// 获取题目列表高度
|
||||
setTimeout(() => {
|
||||
that.Height()
|
||||
}, 100)
|
||||
},
|
||||
//单选 卡片点击事件
|
||||
cardChange(index, index1, item1) {
|
||||
let that = this
|
||||
that.$set(that.cardRadio[index], 'defaultValue', item1.optionCode + '.' + item1.optionValue)
|
||||
// 获取键和值
|
||||
that.key = that.cardRadio[index].diseaseAssessSubjectOption[index1].qcode
|
||||
that.value = that.cardRadio[index].diseaseAssessSubjectOption[index1].optionCode
|
||||
if (that.key.indexOf("sport_in") != -1) {
|
||||
if (that.key.indexOf("sport_freq") != -1) {
|
||||
let keys = that.key.split(",");
|
||||
keys.map((item) => {
|
||||
that.$set(that.questionObject, item.split(":")[0], item.split(":")[1])
|
||||
})
|
||||
} else {
|
||||
let keys = that.key.split(":");
|
||||
that.$set(that.questionObject, keys[0], keys[1])
|
||||
}
|
||||
} else {
|
||||
that.$set(that.questionObject, that.key, that.value)
|
||||
}
|
||||
//获取到原选中的选项
|
||||
let oldIndex = -1;
|
||||
that.cardRadio[index].diseaseAssessSubjectOption.map((item, ind) => {
|
||||
if (item.hidden) {
|
||||
oldIndex = ind;
|
||||
}
|
||||
// 判断卡片选中哪一项
|
||||
if (ind == index1) {
|
||||
item.hidden = true
|
||||
} else {
|
||||
item.hidden = false
|
||||
}
|
||||
})
|
||||
if (oldIndex != -1) {
|
||||
// 获取子题列表
|
||||
let oldZiti = this.fuyon(that.cardRadio[index].id, oldIndex + 1);
|
||||
if (oldZiti.length > 0) {
|
||||
//卡片返回重新选择 如果父题原选中项有子题则删除之前子题集合
|
||||
oldZiti.map((item, oldZi) => {
|
||||
that.cardRadio.splice(index + 1 + (oldZiti.length - oldZi - 1), 1);
|
||||
})
|
||||
}
|
||||
}
|
||||
// // 监测题判断
|
||||
const cardIndex = that.cardRadio.findIndex(item => item.subjectClass == 3)
|
||||
// 最后一道监测题的索引
|
||||
const sugIndex = that.cardRadio.findIndex(item => item.subjectCode == 'monitor_sug_ex')
|
||||
if (!this.monitor) {
|
||||
if (that.questionObject.monitor_sug_mo == 2 || that.questionObject.monitor_sug_mo == 3 || that
|
||||
.questionObject.monitor_sug_mo == 4 || that.questionObject.monitor_sug_st == 1 || that
|
||||
.questionObject.monitor_sug_st == 3) {
|
||||
this.monitor = true
|
||||
that.cardRadio.splice(sugIndex, 1)
|
||||
}
|
||||
}
|
||||
// 倒数第二道
|
||||
if (that.cardRadio[index].id == 665 || that.cardRadio[index].id == 666 || that.cardRadio[index].id ==
|
||||
667 || that.cardRadio[index].id == 668 || that.cardRadio[index].id == 669 || that.cardRadio[index]
|
||||
.id == 670 || that.cardRadio[index].id == 671) {
|
||||
if (that.cardRadio[index].diseaseAssessSubjectOption[index1].optionCode == 1) {
|
||||
return that.isNext = true
|
||||
} else {
|
||||
that.isNext = false
|
||||
}
|
||||
}
|
||||
if (that.cardRadio[index].id == 672 || that.cardRadio[index].id == 664) {
|
||||
if (that.cardRadio[index].diseaseAssessSubjectOption[index1].optionCode == 1) {
|
||||
that.isNext = false
|
||||
} else {
|
||||
return that.isNext = true
|
||||
}
|
||||
}
|
||||
let num = this.fuyon(that.cardRadio[index].id, that.cardRadio[index].diseaseAssessSubjectOption[index1]
|
||||
.optionCode);
|
||||
// 插入子题方法
|
||||
this.matching(num, index + 1)
|
||||
// 判断是否为最后一题
|
||||
if (index == that.cardRadio.length - 1) {
|
||||
that.$set(that.cardRadio[index], 'hidden', true)
|
||||
return that.$set(that, 'isNext', true)
|
||||
} else {
|
||||
that.$set(that.cardRadio[index + 1], 'hidden', true)
|
||||
}
|
||||
that.questClass(index)
|
||||
// setTimeout(() => {
|
||||
// if (that.cardRadio.length - 1 == index) return that.submitMultiple()
|
||||
// }, 100)
|
||||
},
|
||||
// 子题插入父题后面
|
||||
matching(num, index1) {
|
||||
var that = this
|
||||
//合适位置插入子题集合
|
||||
num.map((item, index) => {
|
||||
that.cardRadio.splice(index1 + index, 0, item);
|
||||
})
|
||||
},
|
||||
// 匹配符合条件的子题目
|
||||
fuyon(id, code) {
|
||||
let num = []
|
||||
//拿到符合条件的子题
|
||||
this.subTopic.map((item) => {
|
||||
const codeArr = item.parentSign.split(",")
|
||||
const codeIndex = codeArr.findIndex(item => item == code)
|
||||
|
||||
if (item.parentCode == id && codeIndex != -1) {
|
||||
|
||||
num.push(item)
|
||||
}
|
||||
})
|
||||
return num;
|
||||
},
|
||||
//多选 卡片点击事件
|
||||
multipleChange(index, index1) {
|
||||
let that = this
|
||||
let list = []
|
||||
// 选项互斥
|
||||
let data = that.cardRadio[index].diseaseAssessSubjectOption
|
||||
// 过敏多选题
|
||||
if (that.cardRadio[index].subjectCode == 'foods_allergy' && data[index1].qcode != 'jw') {
|
||||
data.map(item => {
|
||||
if (item.hidden) {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
if (list.length > 2 && !data[index1].hidden) return toast('不能超过三个过敏项')
|
||||
}
|
||||
// 选择(以上都没有)按钮进入
|
||||
if (data[index1].qcode == 'jw') {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
// 最后一项勾选 其余选项取消勾选
|
||||
if (i != data.length - 1) {
|
||||
data[i].hidden = false
|
||||
} else {
|
||||
data[i].hidden = true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 取消最后一项(以上都没有)勾选
|
||||
if (data[data.length - 1].qcode == 'jw' && data[data.length - 1].hidden) {
|
||||
data[data.length - 1].hidden = false
|
||||
}
|
||||
data[index1].hidden = !data[index1].hidden
|
||||
}
|
||||
// 赋值
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data[i].hidden && i < data.length - 1) {
|
||||
that.$set(that.questionObject, data[i].qcode, '1')
|
||||
} else if (data[i].hidden) {
|
||||
data.map((item, indexs) => {
|
||||
if (indexs < data.length - 1) {
|
||||
that.$set(that.questionObject, item.qcode, '2')
|
||||
}
|
||||
})
|
||||
} else if (i < data.length - 1) {
|
||||
that.$set(that.questionObject, data[i].qcode, '2')
|
||||
}
|
||||
}
|
||||
},
|
||||
// 多选 确定
|
||||
nextMulQuestion(index) {
|
||||
let that = this;
|
||||
let b = []
|
||||
that.cardRadio[index].diseaseAssessSubjectOption.map(ite => {
|
||||
if (ite.hidden) {
|
||||
b.push(ite)
|
||||
}
|
||||
})
|
||||
if (b.length == 0) return toast('请选择')
|
||||
// 如果上一题选择的是小麦过敏则删除下一题主食选择 体重正常时进入
|
||||
if (that.cardRadio[index + 1].subjectCode != 'weight_target') {
|
||||
if (that.cardRadio[index].subjectCode == 'foods_allergy' && that.questionObject.foods_allergy_v ==
|
||||
'1') {
|
||||
that.questionObject.foods_deviation = '2'
|
||||
that.zhushi('删除')
|
||||
// 如果上一题选择的不是选择小麦过敏则回显主食选择
|
||||
} else if (that.cardRadio[index].subjectCode == 'foods_allergy' && that.questionObject
|
||||
.foods_allergy_v != '1') {
|
||||
that.zhushi('新增')
|
||||
}
|
||||
// 体重超标时进入
|
||||
} else {
|
||||
if (that.questionObject.foods_allergy_v == '1') {
|
||||
that.questionObject.foods_deviation = '2'
|
||||
that.zhushi('删除')
|
||||
} else {
|
||||
that.zhushi('新增体重')
|
||||
}
|
||||
}
|
||||
if (index == that.cardRadio.length - 1) {
|
||||
that.cardRadio[index].hidden = true
|
||||
that.$set(that, 'isNext', true)
|
||||
} else {
|
||||
that.cardRadio[index + 1].hidden = true
|
||||
}
|
||||
let data = that.cardRadio[index].diseaseAssessSubjectOption
|
||||
let a = []
|
||||
data.map(item => {
|
||||
if (item.hidden) {
|
||||
a.push(item.optionValue)
|
||||
}
|
||||
})
|
||||
that.cardRadio[index].defaultValue = a.toString()
|
||||
that.questClass(index)
|
||||
},
|
||||
// 输入框
|
||||
inputChange(e) {
|
||||
this.pulseNum = e.detail.value
|
||||
},
|
||||
// 填空 确认
|
||||
nextBlanQuestion(index) {
|
||||
let that = this;
|
||||
if (that.pulseNum == '') return toast('请填写')
|
||||
// 获取键和值
|
||||
that.key = that.cardRadio[index].subjectCode
|
||||
that.$set(that.questionObject, that.key, that.pulseNum)
|
||||
if (Number(that.questionObject.sport_pulse) * 4 < 55) {
|
||||
that.cardRadio.map((dataItem, dataIndex) => {
|
||||
if (dataIndex == index + 1) {
|
||||
that.toiceList = that.cardRadio.slice(dataIndex, that.cardRadio.length - 1)
|
||||
}
|
||||
})
|
||||
that.cardRadio.splice(index + 1)
|
||||
that.$set(that, 'isNext', true)
|
||||
that.$set(that.cardRadio[index], 'defaultValue', that.pulseNum + '次')
|
||||
that.submitMultiple()
|
||||
return
|
||||
}
|
||||
if (that.tk_num == 0 && Number(that.questionObject.sport_pulse) * 4 >= 105) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '建议静坐5min后复测',
|
||||
success: function(res) {
|
||||
that.$set(that, 'tk_num', 1)
|
||||
}
|
||||
});
|
||||
return
|
||||
}
|
||||
if (that.tk_num == 1 && Number(Number(that.questionObject.sport_pulse) * 4) >= 150) {
|
||||
that.cardRadio.map((dataItem, dataIndex) => {
|
||||
if (dataIndex == index + 1) {
|
||||
that.toiceList = that.cardRadio.slice(dataIndex, that.cardRadio.length - 1)
|
||||
}
|
||||
})
|
||||
that.cardRadio.splice(index + 1)
|
||||
that.$set(that, 'isNext', true)
|
||||
that.$set(that.cardRadio[index], 'defaultValue', that.pulseNum + '次')
|
||||
that.submitMultiple()
|
||||
return
|
||||
}
|
||||
// 判断是否为最后一题
|
||||
if (index == that.cardRadio.length - 2) {
|
||||
that.$set(that.cardRadio[index], 'hidden', true)
|
||||
that.$set(that, 'isNext', true)
|
||||
} else {
|
||||
if (that.toiceList.length == 0) {
|
||||
that.cardRadio.map((dataItem, dataIndex) => {
|
||||
if (dataIndex == index + 1) {
|
||||
that.toiceList = that.cardRadio.slice(dataIndex, that.cardRadio.length - 1)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.toiceList.map(dataItem => {
|
||||
that.cardRadio.push(dataItem)
|
||||
})
|
||||
}
|
||||
that.$set(that, 'isNext', false)
|
||||
that.$set(that.cardRadio[index + 1], 'hidden', true)
|
||||
}
|
||||
that.$set(that.cardRadio[index], 'defaultValue', that.pulseNum + '次')
|
||||
that.questClass(index)
|
||||
},
|
||||
zhushi(val) {
|
||||
this.cardRadio.map((item, index) => {
|
||||
if (val == '删除') {
|
||||
if (item.subjectCode == 'foods_deviation') {
|
||||
this.cardRadio.splice(index, 1)
|
||||
}
|
||||
} else {
|
||||
// 下一题如果是你日常饮食中主食偏向这个题目则不新增
|
||||
if (item.subjectCode == 'foods_allergy') {
|
||||
if (val == '新增') {
|
||||
if (this.cardRadio[index + 1].subjectCode != 'foods_deviation') {
|
||||
this.cardRadio.splice(index + 1, 0, this
|
||||
.currentFive) //splice(开始插入的下标数,0,需要插入的参数1,需要插入的参数2,需要插入的参数3……)
|
||||
}
|
||||
} else {
|
||||
if (this.cardRadio[index + 2].subjectCode != 'foods_deviation') {
|
||||
this.cardRadio.splice(index + 2, 0, this
|
||||
.currentFive) //splice(开始插入的下标数,0,需要插入的参数1,需要插入的参数2,需要插入的参数3……)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交答题
|
||||
submitMultiple() {
|
||||
const index = this.cardRadio.length
|
||||
let that = this
|
||||
let questionObject = JSON.stringify(that.questionObject)
|
||||
that.$refs.popup.open() //打开弹框
|
||||
that.$API.beingGenerated({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
planId: that.planId,
|
||||
buildStatus: 1
|
||||
}
|
||||
}).then(tores => {
|
||||
that.$API.openDayTaskDetail({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
diseaseId: that.diseases,
|
||||
subjectJson: questionObject,
|
||||
planId: that.planId,
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 弹框内的确定按钮
|
||||
submit() {
|
||||
this.$refs.popup.close()
|
||||
if (window.Android) {
|
||||
window.Android.submit()
|
||||
}
|
||||
if (window.webkit) {
|
||||
window.webkit.messageHandlers.submit.postMessage("");
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './diseaseIndex.scss'
|
||||
</style>
|
|
@ -0,0 +1,182 @@
|
|||
.pageBox {
|
||||
background: linear-gradient(180deg, #E4F5EB 0.01%, rgba(228, 245, 235, 0.00) 20%);
|
||||
.topWidth {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: #FFFFFF;
|
||||
border: 7rpx solid #6ACBD1;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
display: inline-block;
|
||||
width: 6rpx;
|
||||
height: 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.greyBg{
|
||||
|
||||
padding: 24rpx 20rpx;
|
||||
background: #EBF7F8;
|
||||
border-radius: 16rpx;
|
||||
text-indent: 2rem;
|
||||
}
|
||||
.whiteShaw {
|
||||
width: calc(100% -24rpx);
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0, 0, 0, 0);
|
||||
margin-top: -28rpx;
|
||||
margin-left: 12rpx;
|
||||
|
||||
.topBg {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: linear-gradient(180deg, rgba(56, 176, 184, 0.30) 0%, rgba(56, 176, 184, 0.00) 100%);
|
||||
}
|
||||
|
||||
.contonentPadding {
|
||||
padding: 16rpx 20rpx 32rpx;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0,0,0,0.1);
|
||||
.charts-box {
|
||||
width: 630rpx;
|
||||
height: 500rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.charts-box {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
}
|
||||
.lineHeight {
|
||||
font-size: 28rpx;
|
||||
line-height: 44rpx;
|
||||
text-indent: 2rem;
|
||||
}
|
||||
.card{
|
||||
padding: 32rpx 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 32rpx;
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
.leftImg {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.contioner {
|
||||
padding: 32rpx 20rpx;
|
||||
color: #3F4040;
|
||||
.titleBg {
|
||||
background: #EBF7F8;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx;
|
||||
line-height: 44rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.text-indent{
|
||||
text-indent: 2rem;
|
||||
}
|
||||
|
||||
.location {
|
||||
width: 34rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.averImage {
|
||||
$wh: 40rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
|
||||
.progress {
|
||||
height: 12rpx;
|
||||
margin-right: 2rpx;
|
||||
|
||||
&:first-child {
|
||||
border-radius: 50rpx 0rpx 0rpx 50rpx;
|
||||
}
|
||||
|
||||
&:nth-last-child(1) {
|
||||
border-radius: 0 50rpx 50rpx 0;
|
||||
margin-right: 0rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #686E75;
|
||||
border-bottom: 2rpx solid #686E75;
|
||||
}
|
||||
|
||||
|
||||
.tableList {
|
||||
.line {
|
||||
border-top: 2rpx solid #EEE;
|
||||
border-bottom: 2rpx solid #EEE;
|
||||
padding: 20rpx 0;
|
||||
color: #17191A;
|
||||
|
||||
&:first-child {
|
||||
border-left: 2rpx solid #EEE;
|
||||
border-right: 2rpx solid #EEE;
|
||||
}
|
||||
|
||||
&:nth-last-child(1) {
|
||||
border-left: 2rpx solid #EEE;
|
||||
border-right: 2rpx solid #EEE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pupupCard {
|
||||
width: 650rpx;
|
||||
height: 874rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
color: #333333;
|
||||
|
||||
.drawerBg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawerLogo {
|
||||
width: 236rpx;
|
||||
height: 266rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.wenTitle {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
margin-top: 38rpx;
|
||||
}
|
||||
|
||||
.bottomTitle {
|
||||
text-indent: 2rem;
|
||||
padding: 16rpx 32rpx 24rpx;
|
||||
letter-spacing: 3rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 328rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,412 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="isLoading">
|
||||
<!--全部计划-->
|
||||
<view class="contioner">
|
||||
<view class="topWidth"></view>
|
||||
<view class="whiteShaw color">
|
||||
<view class="topBg"></view>
|
||||
<view class="contonentPadding">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">您的抑郁情绪量表为 :{{depression.resultLevelRemark}}</text>
|
||||
</view>
|
||||
<!-- 结论 -->
|
||||
<view class="titleBg padding text-sm marginTop-lg text-indent">
|
||||
{{depression.resultInfo}}
|
||||
</view>
|
||||
<!-- 建议 -->
|
||||
<view class="text-sm marginTop-sm">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">建议</text>
|
||||
</view>
|
||||
<view class="lineHeight marginTop-sm">
|
||||
{{depression.resultProposal}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 指导 -->
|
||||
<view class="flex-contion marginTop-sm">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">指导</text>
|
||||
</view>
|
||||
<block v-for="(item,index) in depression.directionInfo" :key="item.directionUrl">
|
||||
<view class="marginTop flex-contion" @tap="goHealthBook(item.directionUrl)">
|
||||
<image :src="item.directionImg" class="leftImg"></image>
|
||||
<view class="flex-sub">{{item.directionName}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card padding marginBottom-sm">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">您的焦虑情绪量表为 :{{anxiety.resultLevelRemark}}</text>
|
||||
</view>
|
||||
<!-- 结论 -->
|
||||
<view class="titleBg padding text-sm marginTop-lg text-indent">
|
||||
{{anxiety.resultInfo}}
|
||||
</view>
|
||||
<!-- 建议 -->
|
||||
<view class="text-sm marginTop-sm">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">建议</text>
|
||||
</view>
|
||||
<view class="lineHeight marginTop-sm">
|
||||
{{anxiety.resultProposal}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 指导 -->
|
||||
<view class="flex-contion marginTop-sm">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">指导</text>
|
||||
</view>
|
||||
<block v-for="(item,index) in anxiety.directionInfo" :key="item.directionUrl">
|
||||
<view class="marginTop flex-contion" @tap="goHealthBook(item.directionUrl)">
|
||||
<image :src="item.directionImg" class="leftImg"></image>
|
||||
<view class="flex-sub">{{item.directionName}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 14天情绪 -->
|
||||
<view class="card padding" v-if="type==1||type==46">
|
||||
<view class="flex-contion marginBottom-sm">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">情绪智力量表</text>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<view class="flex-sub text-center" style="background: #EBF7F8;padding: 20rpx 0;">情绪名称</view>
|
||||
<view class="flex-sub text-center" style="background: #EBF7F8;padding: 20rpx 0;">得分</view>
|
||||
</view>
|
||||
<block v-for="(item1,index1) in scoreList" :key="item1.name">
|
||||
<view class="tableList flex text-sm">
|
||||
<view class="line flex-sub text-center">{{item1.name}}</view>
|
||||
<view class="line flex-sub text-center">{{item1.score}}分</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 测试结果 -->
|
||||
<block v-for="(item2,index2) in resultList" :key="item2.name">
|
||||
<!-- 结论 -->
|
||||
<view class="titleBg padding text-sm marginTop-lg">
|
||||
<view class="margin-bottom-xs">{{item2.name}}:</view>
|
||||
<view class="text-indent">{{item2.conclusion}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 14天压力 -->
|
||||
<view class="card padding" v-if="type==2||type==47">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">您的简易应对方式量表为 :{{emotional.result}}</text>
|
||||
</view>
|
||||
<!-- 结论 -->
|
||||
<view class="titleBg padding text-sm marginTop-lg text-indent">
|
||||
{{emotional.conclusion}}
|
||||
</view>
|
||||
<!-- 建议 -->
|
||||
<view class="text-sm marginTop-sm">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">建议</text>
|
||||
</view>
|
||||
<view class="lineHeight marginTop-sm">
|
||||
{{emotional.advice}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card padding marginTop-sm" v-if="type==46||type==47">
|
||||
<view class="charts-box">
|
||||
<qiun-data-charts type="line" :opts="opts" :chartData="chartData" inScrollView />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="placeholder"></view>
|
||||
<view class="btnList">
|
||||
<view class="btn" @tap="startPlanning">完成任务</view>
|
||||
</view>
|
||||
<!-- 触底弹框 -->
|
||||
<uni-popup type="center" ref="popup" :is-mask-click="false">
|
||||
<view class="pupupCard">
|
||||
<image src="https://shayu5qny.yhy.ren/drawerBg.png" class="drawerBg"></image>
|
||||
<view class="flex-conter">
|
||||
<image src="https://shayu5qny.yhy.ren/drawerLogo.png" class="drawerLogo"></image>
|
||||
</view>
|
||||
<view class="text-center wenTitle">温馨提示</view>
|
||||
<view class="bottomTitle" v-if="type == 2">
|
||||
尊贵的会员<text
|
||||
style="color: #3AAFB8;">{{userName}}</text>您好,欢迎参加14天压力管理计划!您的健康信息已经收到,请您先详细阅读您的压力报告,您个性化减压方案正在生成,为了确保方案的科学性,方案审核后,次日在“计划-每日任务”中即可查看,谢谢支持,愿您有个良好心态,面对压力!
|
||||
</view>
|
||||
<view class="bottomTitle" v-else>
|
||||
尊贵的会员<text
|
||||
style="color: #3AAFB8;">{{userName}}</text>您好,欢迎参加14天情绪管理计划!您的健康信息已经收到,请您先详细阅读您的情绪报告,您个性化情绪管理方案正在生成,为了确保方案的科学性,方案审核后,次日在“计划-每日任务”中即可查看,谢谢支持,愿您每天都有愉悦的心情,开启美好的生活!
|
||||
</view>
|
||||
<view class="flex-conter">
|
||||
<view class="btn" @click="close">我知道了</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading,
|
||||
goPage
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLoading: false, // 页面数据是否渲染完成
|
||||
userParameters: {}, //用户参数
|
||||
isPopup: false, //弹框是否显示
|
||||
type: null, //问卷类型 1 14天情绪 2 14天减压
|
||||
userName: '', //用户名称
|
||||
title: '', // 标题
|
||||
anxiety: {},
|
||||
depression: {},
|
||||
emotional: {},
|
||||
scoreList: [], //情绪分数
|
||||
resultList: [], //情绪测试结果
|
||||
locationOne: null, // 位置
|
||||
locationTwo: null, // 位置
|
||||
// 进度条颜色
|
||||
progressName: [{
|
||||
bgColor: '#1FD3E1'
|
||||
}, {
|
||||
bgColor: '#FFE3A4'
|
||||
}, {
|
||||
bgColor: '#FFB104'
|
||||
}, {
|
||||
bgColor: '#FF4504'
|
||||
}],
|
||||
pressureName: [{
|
||||
bgColor: '#1FD3E1',
|
||||
name: '积极应对倾向'
|
||||
}, {
|
||||
bgColor: '#FFE3A4',
|
||||
name: '中间应对倾向'
|
||||
}, {
|
||||
bgColor: '#FF4504',
|
||||
name: '消极应对倾向'
|
||||
}],
|
||||
userPlanId: '',
|
||||
taskId: '',
|
||||
chartData: {},
|
||||
//您可以通过修改 config-ucharts.js 文件中下标为 ['line'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
|
||||
opts: {
|
||||
padding: [15, 10, 0, 15],
|
||||
legend: {},
|
||||
xAxis: {
|
||||
disableGrid: true,
|
||||
},
|
||||
yAxis: {
|
||||
gridType: "dash",
|
||||
dashLength: 2
|
||||
},
|
||||
extra: {
|
||||
line: {
|
||||
type: "straight",
|
||||
width: 2,
|
||||
activeType: "hollow"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(opt) {
|
||||
let data = JSON.parse(decodeURIComponent(opt.params))
|
||||
if (data.token) {
|
||||
this.userParameters.openId = data.openId //用户唯一标识
|
||||
this.userParameters.token = data.token //用户唯一标识
|
||||
}
|
||||
if (data.userParameters) {
|
||||
this.userParameters = JSON.parse(data.userParameters) //用户参数
|
||||
} else {
|
||||
this.userParameters.userId = data.userId //用户id
|
||||
}
|
||||
this.type = data.type
|
||||
this.userName = data.name
|
||||
if (data.type == 46 || data.type == 47) {
|
||||
this.userPlanId = data.userPlanId
|
||||
this.taskId = data.taskId
|
||||
this.getResult()
|
||||
}
|
||||
this.getInfo()
|
||||
},
|
||||
// 滚动到底部间隔三秒弹框
|
||||
onReachBottom() {
|
||||
if (!this.isPopup && this.type != 46 && this.type != 47) {
|
||||
this.isPopup = true
|
||||
setTimeout(() => {
|
||||
this.$refs.popup.open()
|
||||
}, 3000)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 对比分析数据
|
||||
getResult() {
|
||||
this.$API.getResultEmotion({
|
||||
data: {
|
||||
...this.userParameters,
|
||||
userPlanId: this.userPlanId,
|
||||
taskId: this.taskId
|
||||
},
|
||||
}).then(res => {
|
||||
let ret = {
|
||||
categories: ["开始", "结束"],
|
||||
series: [{
|
||||
name: "",
|
||||
data: res.data.anxietys
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
data: res.data.depresseds
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
data: res.data.emotions
|
||||
}
|
||||
]
|
||||
};
|
||||
if (this.type == 46) {
|
||||
ret.series[0].name = "焦虑分数"
|
||||
ret.series[1].name = "抑郁分数"
|
||||
ret.series[2].name = "情绪智力分数"
|
||||
} else {
|
||||
ret.series[0].name = "简易应对分数"
|
||||
ret.series[1].name = "感知压力分数"
|
||||
ret.series[2].name = "焦虑自评分数"
|
||||
}
|
||||
this.chartData = JSON.parse(JSON.stringify(ret));
|
||||
})
|
||||
},
|
||||
async getInfo() {
|
||||
showLoading('加载中...')
|
||||
let that = this
|
||||
let ret = {}
|
||||
if (this.type == 1 || this.type == 46) {
|
||||
if (this.type == 1) {
|
||||
this.title = '情绪报告'
|
||||
} else {
|
||||
this.title = '情绪对比分析'
|
||||
}
|
||||
if (this.type == 1) {
|
||||
ret = await this.$API.getEmotionManagement({
|
||||
data: this.userParameters
|
||||
})
|
||||
} else {
|
||||
ret = await this.$API.getEmotionManagement({
|
||||
data: {
|
||||
...this.userParameters,
|
||||
userPlanId: this.userPlanId,
|
||||
taskId: this.taskId
|
||||
}
|
||||
})
|
||||
}
|
||||
this.anxiety = ret.data.anxiety
|
||||
this.depression = ret.data.depression
|
||||
this.emotional = ret.data.emotional
|
||||
this.depression.directionInfo = JSON.parse(ret.data.depression.directionInfo)
|
||||
this.anxiety.directionInfo = JSON.parse(ret.data.anxiety.directionInfo)
|
||||
this.scoreList = JSON.parse(ret.data.emotional.score)
|
||||
this.resultList = JSON.parse(ret.data.emotional.conclusion)
|
||||
this.anxiety.tableTitle = '焦虑情绪'
|
||||
this.emotional.tableTitle = '情绪智力'
|
||||
this.getProgressqxu()
|
||||
} else if (this.type == 2 || this.type == 47) {
|
||||
if (this.type == 2) {
|
||||
this.title = '减压报告'
|
||||
} else {
|
||||
this.title = '减压对比分析'
|
||||
}
|
||||
if (this.type == 2) {
|
||||
ret = await this.$API.getStressManagement({
|
||||
data: this.userParameters
|
||||
})
|
||||
} else {
|
||||
ret = await this.$API.getStressManagement({
|
||||
data: {
|
||||
...this.userParameters,
|
||||
userPlanId: this.userPlanId,
|
||||
taskId: this.taskId
|
||||
}
|
||||
})
|
||||
}
|
||||
this.anxiety = ret.data.anxiety
|
||||
this.depression = ret.data.depression
|
||||
this.emotional = ret.data.emotional
|
||||
this.depression.directionInfo = JSON.parse(ret.data.depression.directionInfo)
|
||||
this.anxiety.directionInfo = JSON.parse(ret.data.anxiety.directionInfo)
|
||||
this.anxiety.tableTitle = '焦虑情绪'
|
||||
this.depression.tableTitle = '感知压力'
|
||||
this.emotional.tableTitle = '简易应对方式'
|
||||
this.getProgressjya()
|
||||
}
|
||||
// 进度条对应位置
|
||||
if (ret.data.depression.resultLevel == 1) that.$set(that, 'locationOne', 10)
|
||||
if (ret.data.depression.resultLevel == 2) that.$set(that, 'locationOne', 36)
|
||||
if (ret.data.depression.resultLevel == 3) that.$set(that, 'locationOne', 60)
|
||||
if (ret.data.depression.resultLevel == 4) that.$set(that, 'locationOne', 85)
|
||||
if (ret.data.anxiety.resultLevel == 1) that.$set(that, 'locationTwo', 10)
|
||||
if (ret.data.anxiety.resultLevel == 2) that.$set(that, 'locationTwo', 36)
|
||||
if (ret.data.anxiety.resultLevel == 3) that.$set(that, 'locationTwo', 60)
|
||||
if (ret.data.anxiety.resultLevel == 4) that.$set(that, 'locationTwo', 85)
|
||||
this.$nextTick(() => {
|
||||
that.$set(that, 'isLoading', true)
|
||||
})
|
||||
hideLoading()
|
||||
},
|
||||
// 获取减压进度条对应文案
|
||||
getProgressjya() {
|
||||
this.progressName[0].nameOne = '较低'
|
||||
this.progressName[0].nameTwo = '无焦虑'
|
||||
this.progressName[1].nameOne = '适中'
|
||||
this.progressName[1].nameTwo = '轻微'
|
||||
this.progressName[2].nameOne = '较高'
|
||||
this.progressName[2].nameTwo = '中度'
|
||||
this.progressName[3].nameOne = '非常高'
|
||||
this.progressName[3].nameTwo = '重度'
|
||||
},
|
||||
// 获取情绪进度条对应文案
|
||||
getProgressqxu() {
|
||||
this.progressName[0].nameOne = '无抑郁'
|
||||
this.progressName[0].nameTwo = '无焦虑'
|
||||
this.progressName[1].nameOne = '轻微'
|
||||
this.progressName[1].nameTwo = '轻微'
|
||||
this.progressName[2].nameOne = '中度'
|
||||
this.progressName[2].nameTwo = '中度'
|
||||
this.progressName[3].nameOne = '重度'
|
||||
this.progressName[3].nameTwo = '重度'
|
||||
},
|
||||
// 抑郁指导
|
||||
goHealthBook(id) {
|
||||
if (window.Android) {
|
||||
window.Android.goHealthBook(id)
|
||||
}
|
||||
if (window.webkit) {
|
||||
window.webkit.messageHandlers.goHealthBook.postMessage(id);
|
||||
}
|
||||
},
|
||||
// 关闭弹框
|
||||
close() {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
// 开始计划
|
||||
startPlanning() {
|
||||
if (window.Android) {
|
||||
window.Android.startPlanning()
|
||||
}
|
||||
if (window.webkit) {
|
||||
window.webkit.messageHandlers.startPlanning.postMessage("");
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './moodRequest.scss';
|
||||
</style>
|
|
@ -0,0 +1,217 @@
|
|||
.pageBox {
|
||||
background: linear-gradient(180deg, #E4F5EB 0.01%, rgba(228, 245, 235, 0.00) 99.99%);
|
||||
.topWidth {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: #FFFFFF;
|
||||
border: 7rpx solid #6ACBD1;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
display: inline-block;
|
||||
width: 6rpx;
|
||||
height: 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.greyBg{
|
||||
|
||||
padding: 24rpx 20rpx;
|
||||
background: #EBF7F8;
|
||||
border-radius: 16rpx;
|
||||
text-indent: 2rem;
|
||||
}
|
||||
.whiteShaw {
|
||||
width: calc(100% -24rpx);
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0, 0, 0, 0);
|
||||
margin: -28rpx 0 50rpx 12rpx;
|
||||
.topBg {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: linear-gradient(180deg, rgba(56, 176, 184, 0.30) 0%, rgba(56, 176, 184, 0.00) 100%);
|
||||
}
|
||||
|
||||
.contonentPadding {
|
||||
padding: 16rpx 20rpx 40rpx;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0,0,0,0.1);
|
||||
.gardenClass{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -20rpx;
|
||||
width: 100%;
|
||||
.circle3 {
|
||||
width: 44rpx;
|
||||
height: 22rpx;
|
||||
border-radius: 0 0 50rpx 50rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
.charts-box {
|
||||
width: 630rpx;
|
||||
height: 500rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.contioner {
|
||||
padding: 32rpx 20rpx;
|
||||
color: #3F4040;
|
||||
|
||||
.title {
|
||||
background: #EBF7F8;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx;
|
||||
text-indent: 2rem;
|
||||
line-height: 44rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.titleBorder {
|
||||
color: #686E75;
|
||||
border-bottom: 2rpx solid #686E75;
|
||||
}
|
||||
|
||||
.tableList {
|
||||
.line {
|
||||
border-top: 2rpx solid #EBF7F8;
|
||||
;
|
||||
border-bottom: 2rpx solid #EBF7F8;
|
||||
padding: 20rpx 0;
|
||||
color: #112950;
|
||||
|
||||
&:first-child {
|
||||
border-left: 2rpx solid #EBF7F8;
|
||||
border-right: 2rpx solid #EBF7F8;
|
||||
}
|
||||
|
||||
&:nth-last-child(1) {
|
||||
border-left: 2rpx solid #EBF7F8;
|
||||
border-right: 2rpx solid #EBF7F8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.location {
|
||||
width: 34rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.averImage {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
|
||||
.progress {
|
||||
height: 12rpx;
|
||||
margin-right: 2rpx;
|
||||
|
||||
&:first-child {
|
||||
border-radius: 50rpx 0rpx 0rpx 50rpx;
|
||||
}
|
||||
|
||||
&:nth-last-child(1) {
|
||||
border-radius: 0 50rpx 50rpx 0;
|
||||
margin-right: 0rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.lineHeight {
|
||||
font-size: 28rpx;
|
||||
line-height: 44rpx;
|
||||
text-indent: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.riskFactor {
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
margin-left: 12rpx;
|
||||
|
||||
.leftColor {
|
||||
color: #112950;
|
||||
}
|
||||
|
||||
.rightColor {
|
||||
color: #8E9AAB;
|
||||
}
|
||||
|
||||
.table {
|
||||
background: #EBF7F8;
|
||||
padding: 20rpx 0;
|
||||
color: #112950;
|
||||
}
|
||||
|
||||
.averImage {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
|
||||
.tableList {
|
||||
.line {
|
||||
border-bottom: 2rpx solid #EEE;
|
||||
padding: 20rpx 0;
|
||||
|
||||
&:first-child {
|
||||
border-left: 2rpx solid #EEE;
|
||||
border-right: 2rpx solid #EEE;
|
||||
}
|
||||
|
||||
&:nth-last-child(1) {
|
||||
border-left: 2rpx solid #EEE;
|
||||
border-right: 2rpx solid #EEE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pupupCard {
|
||||
width: 650rpx;
|
||||
height: 874rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
color: #333333;
|
||||
|
||||
.drawerBg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawerLogo {
|
||||
width: 236rpx;
|
||||
height: 266rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.wenTitle {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
margin-top: 38rpx;
|
||||
}
|
||||
|
||||
.bottomTitle {
|
||||
text-indent: 2rem;
|
||||
padding: 16rpx 32rpx 24rpx;
|
||||
letter-spacing: 3rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 328rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,380 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<!--全部计划-->
|
||||
<view class="contioner">
|
||||
<block v-if="formData!=null">
|
||||
<view class="topWidth"></view>
|
||||
<view class="whiteShaw color">
|
||||
<view class="topBg"></view>
|
||||
<view class="contonentPadding bg-video">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">您的失眠程度为:<text class="themColor">{{formData.result}}</text></text>
|
||||
</view>
|
||||
<!-- 结论 -->
|
||||
<view class="title marginTop">
|
||||
<block v-if="type==0">
|
||||
您本次填写的量表得分为{{formData!=null?formData.score:tableData!=null?tableData.score:requestData.score}}分,
|
||||
{{formData.conclusion}}
|
||||
</block>
|
||||
<block v-else>{{formData.conclusion}}</block>
|
||||
</view>
|
||||
<!-- 睡眠问题 -->
|
||||
<view class="text-df marginTop" v-if="formData.steepIssue!=null">{{formData.steepIssue}}
|
||||
</view>
|
||||
<view class="flex-contion marginTop">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">建议</text>
|
||||
</view>
|
||||
<view class="lineHeight marginTop-sm ">{{formData.advice}}</view>
|
||||
<view class="flex gardenClass">
|
||||
<view v-for="(garden,gardenIndex) in todos" :key="gardenIndex" class="circle3"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="tableData!=null">
|
||||
<!-- 量表评分 -->
|
||||
<view class="riskFactor marginTop-sm padding marginBottom-sm">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">量表评分</text>
|
||||
</view>
|
||||
<!-- 结论 -->
|
||||
<view class="title padding text-sm marginTop-sm">
|
||||
{{tableData.result}}
|
||||
</view>
|
||||
<view class="marginTop-lg flex table">
|
||||
<view class="flex-sub text-center text-bold">项目</view>
|
||||
<view class="flex-sub text-center text-bold">分值</view>
|
||||
</view>
|
||||
<view class="tableList flex text-df">
|
||||
<!-- 项目 -->
|
||||
<view class="line flex-sub text-center">总分</view>
|
||||
<!-- 分值 -->
|
||||
<view class="line flex-sub text-center">{{tableData.score}}分</view>
|
||||
</view>
|
||||
<view class="tableList flex text-df">
|
||||
<view class="line flex-sub text-center">对失眠后果的估计</view>
|
||||
<view class="line flex-sub text-center">{{tableData.insomniaConsequences}}分</view>
|
||||
</view>
|
||||
<view class="tableList flex text-df">
|
||||
<view class="line flex-sub text-center">对失眠的担忧</view>
|
||||
<view class="line flex-sub text-center">{{tableData.insomniaAbout}}分</view>
|
||||
</view>
|
||||
<view class="tableList flex text-df">
|
||||
<view class="line flex-sub text-center">对睡眠的期待</view>
|
||||
<view class="line flex-sub text-center">{{tableData.sleepExpect}}分</view>
|
||||
</view>
|
||||
<view class="tableList flex text-df">
|
||||
<view class="line flex-sub text-center">对药物使用的认识</view>
|
||||
<view class="line flex-sub text-center">{{tableData.drugUse}}分</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="requestData!=null">
|
||||
<view class="card padding">
|
||||
<block v-if="type!=17">
|
||||
<block v-if="type!=33">
|
||||
|
||||
</block>
|
||||
<view class="marginBottom-sm" v-if="type==33">量表结果:{{requestData.result}}</view>
|
||||
<!-- 结论 -->
|
||||
<view class="title padding text-sm marginTop-lg">
|
||||
{{requestData.resultInfo||requestData.conclusion}}
|
||||
</view>
|
||||
<!-- 建议 -->
|
||||
<view class="text-sm marginTop-sm" style="color: #686E75;">
|
||||
<view class="text-lg marginBottom-sm" style="color: #112950;">建议</view>
|
||||
<view class="lineHeight">
|
||||
{{requestData.resultProposal||requestData.advice}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 指导 -->
|
||||
<block v-if="type!=33">
|
||||
<view class="flex-contion marginTop-sm">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl">指导</text>
|
||||
</view>
|
||||
<block v-for="(item,index) in requestData.directionInfo" :key="item.directionUrl">
|
||||
<view class="marginTop flex-contion" @tap="goHealthBook">
|
||||
<image :src="item.directionImg" class="leftImg"></image>
|
||||
<view class="flex-sub">{{item.directionName}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="marginBottom-sm">情绪智力量表</view>
|
||||
<block v-for="(item,index) in scoreList" :key="index">
|
||||
<view class="tableList flex text-sm">
|
||||
<view class="line flex-sub text-center">{{item.name}}</view>
|
||||
<view class="line flex-sub text-center">{{item.score}}分</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 结论 -->
|
||||
<block v-for="(item,index) in requestList" :key="index">
|
||||
<view class="margin-bottom-xs marginTop-lg">{{item.name}}</view>
|
||||
<view class="title padding text-sm">
|
||||
<view>{{item.conclusion}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<view style="width: 100%;height: 20rpx;"></view>
|
||||
</view>
|
||||
<view class="placeholder"></view>
|
||||
<view class="btnList">
|
||||
<view class="btn" @tap="startPlanning">完成任务</view>
|
||||
</view>
|
||||
<!-- 触底弹框 -->
|
||||
<uni-popup type="center" ref="popup" :is-mask-click="false" v-if="type==0">
|
||||
<view class="pupupCard">
|
||||
<image src="https://shayu5qny.yhy.ren/drawerBg.png" class="drawerBg"></image>
|
||||
<view class="flex-conter">
|
||||
<image src="https://shayu5qny.yhy.ren/drawerLogo.png" class="drawerLogo"></image>
|
||||
</view>
|
||||
<view class="text-center wenTitle">温馨提示</view>
|
||||
<view class="bottomTitle">
|
||||
尊贵的会员<text
|
||||
style="color: #3AAFB8;">{{userName}}</text>您好,欢迎参加21天改善睡眠计划!您的健康信息已经收到,请您先详细阅读您的睡眠报告,您个性化睡眠改善方案正在生成,为了确保方案的科学性,方案审核后,次日在“计划-每日任务”中即可查看,谢谢支持,愿您有个健康的睡眠!
|
||||
</view>
|
||||
<view class="flex-conter">
|
||||
<view class="btn" @click="close">我知道了</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading,
|
||||
goPage
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isPopup: false, //弹框是否显示
|
||||
userParameters: {}, //用户参数
|
||||
userName: '', //用户名称
|
||||
imgurl: '',
|
||||
// 标题
|
||||
title: '',
|
||||
type: 0, //类型 0代表综合问卷
|
||||
taskId: null, //任务Id
|
||||
// 位置
|
||||
location: 10,
|
||||
// 进度条颜色以及对应的内容
|
||||
progressName: [{
|
||||
bgColor: "#1FD3E1",
|
||||
scaleName: '无显著失眠',
|
||||
}, {
|
||||
bgColor: "#FFE3A4",
|
||||
scaleName: '轻度失眠',
|
||||
}, {
|
||||
bgColor: "#FFB104",
|
||||
scaleName: '中度失眠',
|
||||
}, {
|
||||
bgColor: "#FF4504",
|
||||
scaleName: '重度失眠',
|
||||
}],
|
||||
formData: null,
|
||||
// 量表评分
|
||||
tableData: null,
|
||||
requestData: null, //情绪 压力 问卷内容
|
||||
scoreList: [], //情绪分数
|
||||
requestList: [], //情绪结论
|
||||
todos:['','','','','','','','','','','','','','','',''],
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
let data = JSON.parse(decodeURIComponent(options.params))
|
||||
if (data.token) {
|
||||
this.userParameters.openId = data.openId //用户唯一标识
|
||||
this.userParameters.token = data.token //用户唯一标识
|
||||
}
|
||||
if (data.userParameters) {
|
||||
this.userParameters = JSON.parse(data.userParameters) //用户参数
|
||||
} else {
|
||||
this.userParameters.userId = data.userId //用户id
|
||||
}
|
||||
if (data.taskId) {
|
||||
this.$set(this, 'taskId', data.taskId)
|
||||
}
|
||||
this.$set(this, 'userName', data.name)
|
||||
this.$set(this, 'type', data.type)
|
||||
this.getInfo()
|
||||
},
|
||||
// 滚动到底部间隔三秒弹框
|
||||
onReachBottom() {
|
||||
if (!this.isPopup && this.type == 0) {
|
||||
setTimeout(() => {
|
||||
this.$refs.popup.open()
|
||||
this.isPopup = true
|
||||
}, 3000)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 返回上一个页面
|
||||
backChange() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
getInfo() {
|
||||
showLoading('加载中...')
|
||||
let that = this
|
||||
if (that.type == 0) {
|
||||
that.$API.getPsychologicalResult({
|
||||
data: this.userParameters
|
||||
}).then((res) => {
|
||||
hideLoading()
|
||||
that.title = '综合报告'
|
||||
that.tableData = res.data.beliefResult
|
||||
that.formData = res.data.insomniaResult
|
||||
that.imgurl = res.data.avatar
|
||||
that.getLocation()
|
||||
|
||||
})
|
||||
} else if (that.type == 2) {
|
||||
that.$API.getBeliefResult({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
taskId: that.taskId
|
||||
}
|
||||
}).then(res => {
|
||||
that.title = '个人信念和态度报告'
|
||||
that.tableData = res.data
|
||||
that.imgurl = res.data.avatar
|
||||
hideLoading()
|
||||
})
|
||||
} else if (that.type == 1) {
|
||||
that.$API.getInsomniaResult({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
taskId: that.taskId
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoading()
|
||||
that.title = '失眠严重程度指数(ISI)报告'
|
||||
that.formData = res.data
|
||||
that.imgurl = res.data.avatar
|
||||
that.getLocation()
|
||||
|
||||
})
|
||||
} else if (that.type == 15 || that.type == 16 || that.type == 32) {
|
||||
if (that.type == 15) {
|
||||
that.title = '抑郁自评评估结果报告'
|
||||
that.progressName[0].scaleName = '无抑郁'
|
||||
that.progressName[1].scaleName = '轻微'
|
||||
that.progressName[2].scaleName = '中度'
|
||||
that.progressName[3].scaleName = '重度'
|
||||
} else if (that.type == 16) {
|
||||
that.title = '焦虑自评评估结果报告'
|
||||
that.progressName[0].scaleName = '无焦虑'
|
||||
that.progressName[1].scaleName = '轻微'
|
||||
that.progressName[2].scaleName = '中度'
|
||||
that.progressName[3].scaleName = '重度'
|
||||
} else {
|
||||
that.title = '感知压力评估结果报告'
|
||||
that.progressName[0].scaleName = '较低'
|
||||
that.progressName[1].scaleName = '适中'
|
||||
that.progressName[2].scaleName = '适中'
|
||||
that.progressName[3].scaleName = '非常高'
|
||||
}
|
||||
that.$API.getPsychologyInfo({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
taskId: that.taskId
|
||||
}
|
||||
}).then(res => {
|
||||
hideLoading()
|
||||
that.requestData = res.data
|
||||
this.requestData.directionInfo = JSON.parse(res.data.directionInfo)
|
||||
that.getLocation()
|
||||
})
|
||||
} else if (that.type == 17) {
|
||||
that.title = '情绪智力评估结果报告'
|
||||
that.$API.getEmotionalInfo({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
taskId: that.taskId
|
||||
}
|
||||
}).then(res => {
|
||||
that.requestData = res.data
|
||||
this.scoreList = JSON.parse(res.data.score)
|
||||
this.requestList = JSON.parse(res.data.conclusion)
|
||||
hideLoading()
|
||||
})
|
||||
} else if (that.type == 33) {
|
||||
that.title = '简易应对方式报告'
|
||||
that.$API.getSimpleResponse({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
taskId: that.taskId
|
||||
}
|
||||
}).then(res => {
|
||||
that.requestData = res.data
|
||||
this.scoreList = JSON.parse(res.data.score)
|
||||
hideLoading()
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取图标
|
||||
getLocation() {
|
||||
let that = this
|
||||
if (that.formData != null) {
|
||||
// 图标位置
|
||||
if (that.formData.insomniaDegree == 0) {
|
||||
that.$set(that, 'location', 10)
|
||||
} else if (that.formData.insomniaDegree == 1) {
|
||||
that.$set(that, 'location', 36)
|
||||
} else if (that.formData.insomniaDegree == 2) {
|
||||
that.$set(that, 'location', 60)
|
||||
} else if (that.formData.insomniaDegree == 3) {
|
||||
that.$set(that, 'location', 85)
|
||||
}
|
||||
} else {
|
||||
// 图标位置
|
||||
if (that.requestData.resultLevel == 1) {
|
||||
that.$set(that, 'location', 10)
|
||||
} else if (that.requestData.resultLevel == 2) {
|
||||
that.$set(that, 'location', 36)
|
||||
} else if (that.requestData.resultLevel == 3) {
|
||||
that.$set(that, 'location', 60)
|
||||
} else if (that.requestData.resultLevel == 4) {
|
||||
that.$set(that, 'location', 85)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 指导方法
|
||||
goHealthBook() {
|
||||
if (window.Android) {
|
||||
window.Android.goHealthBook()
|
||||
}
|
||||
if (window.webkit) {
|
||||
window.webkit.messageHandlers.goHealthBook.postMessage("");
|
||||
}
|
||||
},
|
||||
// 关闭弹框
|
||||
close() {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
// 开始计划
|
||||
startPlanning(){
|
||||
if (window.Android) {
|
||||
window.Android.startPlanning()
|
||||
}
|
||||
if (window.webkit) {
|
||||
window.webkit.messageHandlers.startPlanning.postMessage("");
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './planningReport.scss'
|
||||
</style>
|
|
@ -0,0 +1,291 @@
|
|||
.pageBox {
|
||||
.color{
|
||||
color: #17191A;
|
||||
}
|
||||
.topPostionBg{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100vw;
|
||||
height: 528rpx;
|
||||
background: linear-gradient(155deg, #E4F5EB 0%, rgba(228,245,235,0) 100%);
|
||||
}
|
||||
.contioner{
|
||||
padding: 32rpx;
|
||||
.backBottom{
|
||||
position: fixed;
|
||||
bottom: 10vh;
|
||||
right: 34rpx;
|
||||
padding: 12rpx 32rpx;
|
||||
border-radius: 50rpx;
|
||||
background: #FFF;
|
||||
box-shadow: 0 8rpx 8rpx 0 rgba(4, 70, 74, 0.14);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:24rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
.topCard{
|
||||
padding: 12rpx;
|
||||
margin-top: 48rpx;
|
||||
border-radius: 32rpx;
|
||||
background: #FFFFFF;
|
||||
.headSculpture{
|
||||
$wh:112rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
background: #F3F4F6;
|
||||
border-radius: 50%;
|
||||
border: 6rpx solid #FFFFFF;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
top: -52rpx;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:100rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.border{
|
||||
border: 1rpx dotted #3AAFB8;
|
||||
border-radius: 20rpx;
|
||||
.cut{
|
||||
display: inline-block;
|
||||
width: 4rpx;
|
||||
height: 20rpx;
|
||||
margin: 0 12rpx;
|
||||
background: $uni-color;
|
||||
}
|
||||
.top{
|
||||
margin-top: 72rpx;
|
||||
color: $uni-color;
|
||||
}
|
||||
.tag{
|
||||
padding: 0 20rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 4rpx;
|
||||
background: #F3F4F6;
|
||||
color: #909292;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.avare {
|
||||
$wh: 80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.tagWidth{
|
||||
width: 48rpx;
|
||||
height: 8rpx;
|
||||
background: #EFF9F8;
|
||||
border-radius: 50rpx;
|
||||
margin-right: 12rpx;
|
||||
margin-top: 20rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
.tagBgShaw{
|
||||
background: $uni-color;
|
||||
}
|
||||
.introduce {
|
||||
padding: 20rpx;
|
||||
width: calc(502rpx - 40rpx);
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 0rpx 0rpx;
|
||||
}
|
||||
.borderBottom{
|
||||
border-radius: 0rpx 16rpx 16rpx 16rpx;
|
||||
}
|
||||
.rightGet{
|
||||
width: 136rpx;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(180deg, #FDC674 0%, #FF9A02 100%);
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
margin-left: 38rpx;
|
||||
}
|
||||
|
||||
.evaluation {
|
||||
width: calc(502rpx - 40rpx);
|
||||
padding: 20rpx;
|
||||
margin-top: 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
||||
.mask{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 10;
|
||||
}
|
||||
.greyTag{
|
||||
padding: 18rpx 40rpx;
|
||||
background: #F8F8F8;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 20rpx;
|
||||
color: #3F4040;
|
||||
.tegWidth{
|
||||
width: 2rpx;
|
||||
height: 24rpx;
|
||||
background: #CCCCCC;
|
||||
margin: 0 24rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.shawDown{
|
||||
background: #EFF9F8;
|
||||
color: $uni-color;
|
||||
}
|
||||
.cut{
|
||||
margin-top: 32rpx;
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #eee;
|
||||
}
|
||||
.fenge{
|
||||
width: 2rpx;
|
||||
height: 80rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: #eee;
|
||||
}
|
||||
.inputClass{
|
||||
border: 2rpx solid #3AAFB8;
|
||||
line-height: 64rpx;
|
||||
height: 64rpx;
|
||||
border-radius: 8rpx;
|
||||
padding:0 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.cutt {
|
||||
width: 2rpx;
|
||||
height: 32rpx;
|
||||
background: #323232;
|
||||
opacity: 0.2;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.qding{
|
||||
width: 320rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50rpx;
|
||||
margin: 0 auto;
|
||||
color: #FFFFFF;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.picker-view {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
height: 200upx;
|
||||
overflow: hidden;
|
||||
font-size: 40rpx;
|
||||
color: #909292;
|
||||
|
||||
.pickerSelected {
|
||||
color: $uni-color;
|
||||
}
|
||||
}
|
||||
.city-picker {
|
||||
border-top: 2rpx solid #EEE;
|
||||
border-bottom: 2rpx solid #EEE;
|
||||
}
|
||||
}
|
||||
.rightLayOut{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 32rpx;
|
||||
.leftTag{
|
||||
padding: 20rpx 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 16rpx 0rpx 16rpx 16rpx;
|
||||
color: #FFFFFF;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.rightAvter{
|
||||
$wh:80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.bottomBtn{
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
z-index: 10;
|
||||
width: calc(100% - 64rpx);
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.pupupCard {
|
||||
width: 650rpx;
|
||||
min-height: 854rpx;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 0 20rpx;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
color: #333333;
|
||||
|
||||
.drawerBg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawerLogo {
|
||||
width: 236rpx;
|
||||
height: 266rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.wenTitle {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
margin-top: 38rpx;
|
||||
}
|
||||
|
||||
.bottomTitle {
|
||||
text-indent: 2rem;
|
||||
padding: 16rpx 32rpx 6rpx;
|
||||
letter-spacing: 3rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 328rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,672 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="pageShow" @touchmove.stop="">
|
||||
<view class="topPostionBg"></view>
|
||||
<view class="contioner">
|
||||
<view class="topCard bg-video">
|
||||
<view class="headSculpture">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png"></image>
|
||||
</view>
|
||||
<view class="border text-center bg-video">
|
||||
<view class="top text-df text-bold">
|
||||
<text class="color">鲨鱼宝宝</text>
|
||||
<text class="cut"></text>
|
||||
<text>专属评估客服</text>
|
||||
</view>
|
||||
<view class="flex-conter margin-top-xs marginBottom">
|
||||
<view class="tag marginRight-xs">{{(answerList.length*15/60).toFixed(0)}}分钟</view>
|
||||
<view class="tag marginRight-xs">{{answerList.length}}题</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y :style="{'height':srcollHeight}" :scroll-top="scrollView" @scroll="scroll"
|
||||
scroll-with-animation>
|
||||
<view class="next" style="padding-top: 32rpx;"></view>
|
||||
<block v-for="(item,index) in answerList" :key="index">
|
||||
<view v-show="item.hidden">
|
||||
<view class="flex bg-video" style="margin-top: 32rpx;">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="color flex-sub">
|
||||
<!-- 标题 -->
|
||||
<view class="introduce text-df">{{index + 1 }}: {{item.questionName}}</view>
|
||||
<!-- 单选样式 -->
|
||||
<block v-if="item.questionType==1">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">单选</view>
|
||||
<block v-for="(item1,index1) in item.options" :key="index1">
|
||||
<view :class="['greyTag',item1.hidden?'shawDown':'']"
|
||||
@click="cardChange(index,index1,item,item1)">
|
||||
<text class="text-bold">{{item1.sort}}</text>
|
||||
<text class="tegWidth"></text>
|
||||
<text>{{item1.optionName}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 多选样式 -->
|
||||
<block v-if="item.questionType==2">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">多选</view>
|
||||
<checkbox-group>
|
||||
<label v-for="(item2,index2) in item.options" :key="item2.id"
|
||||
@tap="multipleCard(item,index1)">
|
||||
<view :class="['greyTag flex-contion',item2.hidden?'shawDown':'']">
|
||||
<checkbox color="#3AAFB8" :value="item2.sort"
|
||||
:checked="item2.hidden" />
|
||||
<view class="marginLeft-sm">{{item2.optionName}}</view>
|
||||
</view>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
<view class="qding" @tap="nextStep(index,item)">确认</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 时间滑动选择器 -->
|
||||
<block v-if="item.questionType==3&&item.questionImportType==1">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">请选择</view>
|
||||
<view class="bg-video">
|
||||
<picker-view class="picker-view" indicator-class="city-picker"
|
||||
mask-style="background:#E6EFF1;opacity:0" :value="item.importValue1"
|
||||
@change="oneChange($event,index)">
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item3,index3) in hours" :key="index3"
|
||||
:class="item.importValue1[0]==index3?'pickerSelected':''">
|
||||
{{item3}}
|
||||
</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item4,index4) in minutes" :key="index4"
|
||||
:class="item.importValue1[1]==index4?'pickerSelected':''">
|
||||
{{item4}}
|
||||
</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
<view class="mask" v-if="status=='1'"></view>
|
||||
</view>
|
||||
<view class="qding" @tap="nextStep(index,item)">确认</view>
|
||||
</view>
|
||||
</block>
|
||||
<!--2整数数字键盘 3带小数键盘 -->
|
||||
<block
|
||||
v-if="item.questionType==3&&(item.questionImportType==2||item.questionImportType==3)">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">填空</view>
|
||||
<view class="inputClass flex-between align-center text-lg fontColor">
|
||||
<input placeholder="请输入" v-if="item.questionImportType==2" type="number"
|
||||
:disabled="status==1?true:false" @input="inputChange($event,index)"
|
||||
:value="item.value" class="flex-sub" />
|
||||
<input placeholder="请输入" v-else type="digit"
|
||||
@input="inputChange($event,index)" :disabled="status==1?true:false"
|
||||
:value="item.value" class="flex-sub" />
|
||||
<view class="flex-contion">
|
||||
<view class="cutt"></view>
|
||||
<view>{{item.questionImportType==2?'次':'小时'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="qding" @tap="nextStep(index,item)">确认</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-end" :class="['quest'+index]" v-if="item.defaultValue!=''">
|
||||
<view class="rightLayOut">
|
||||
<view class="leftTag flex-sub">{{item.defaultValue}}</view>
|
||||
<image :src="userProfile" class="rightAvter"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view style="width: 100%;height: 100rpx;"></view>
|
||||
</scroll-view>
|
||||
<view class="bottomBtn" @tap="completeAnswer" v-if="isNext&&status!='1'">
|
||||
完成答题
|
||||
</view>
|
||||
<!-- 返回底部 -->
|
||||
<view class="backBottom" @tap="goBottom" v-show="scrollGun<600&&isBottom">
|
||||
<image src="https://shayu5qny.yhy.ren/Frame.png"></image>
|
||||
<view class="text-sm themColor">返回底部</view>
|
||||
</view>
|
||||
</view>
|
||||
<slot>
|
||||
<Eposter :width="canvasW" :height="canvasH" @on-error="" :list="answerList"
|
||||
backgroundColor="rgb(255, 255, 255)" @on-success="onSuccess" ref="Eposter">
|
||||
<view class="eposter Poster1" style="padding-top: 30rpx;">
|
||||
<view class="Poster1" v-for="(item,index) in answerList" :key="item.id" style="padding-top: 30rpx;">
|
||||
<view :data-enode="item.questionName+':'+item.importValue1[0]+':'+item.importValue1[1]"
|
||||
class="Poster1" v-if="item.questionImportType==1">
|
||||
{{item.questionName+':'+item.importValue1[0]+':'+item.importValue1[1]}}
|
||||
</view>
|
||||
<view :data-enode="item.questionName+':'+item.value" class="Poster1" v-else>
|
||||
{{item.questionName+':'+item.value}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="Poster1 marginTop" data-enode="接下来,就请您在今晚就开始按照您所规划的时间规律作息吧!">
|
||||
接下来,就请您在今晚就开始按照您所规划的时间规律作息吧!</view>
|
||||
</view>
|
||||
</Eposter>
|
||||
</slot>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
showLoading,
|
||||
hideLoading,
|
||||
toast
|
||||
} from "/tool/index.js"
|
||||
import Eposter from "@/components/evils-el-poster/Poster.vue";
|
||||
export default {
|
||||
components: {
|
||||
Eposter
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userParameters: {}, //接收用户参数
|
||||
pageShow: false, //数据是否渲染完成
|
||||
srcollHeight: "", //题目的高度
|
||||
scrollView: 0, //题目距离顶部的位置
|
||||
scrollGun: 0, //屏幕滚动的高度
|
||||
fixedHeight: 100000, //固定底部高度
|
||||
isBottom: false, //是否显示返回底部按钮
|
||||
userId: '', //用户id
|
||||
userName: '', //用户名称
|
||||
userProfile: '', //用户头像
|
||||
isNext: false, // 是否为最后一题
|
||||
answerList: [], // 题目列表
|
||||
hours: [], //小时
|
||||
minutes: [], //分钟
|
||||
id: null, // 问卷类型
|
||||
questionClassId: '', //问卷类型 判断是否可以进入报告页面
|
||||
taskId: '', //任务Id
|
||||
userPlanId: '', //用户计划ID
|
||||
status: 0, //问卷完成状态
|
||||
canvasW: 375, // 画布宽
|
||||
canvasH: 0, // 画布高
|
||||
};
|
||||
},
|
||||
onLoad(opt) {
|
||||
let data = JSON.parse(decodeURIComponent(opt.params))
|
||||
if (data.token) {
|
||||
this.userParameters.openId = data.openId //用户唯一标识
|
||||
this.userParameters.token = data.token //用户唯一标识
|
||||
}
|
||||
this.userParameters.userId = data.userId //用户id
|
||||
this.id = parseInt(data.type) //业务id
|
||||
this.userPlanId = data.userPlanId //用户计划ID
|
||||
this.userProfile = data.headSculpture //用户头像
|
||||
this.userName = data.name //用户名称
|
||||
// 每日计划进入
|
||||
if (data.questionClassId) {
|
||||
this.questionClassId = data.questionClassId //任务状态 0未完成 1已完成 3仅展示
|
||||
this.taskId = data.taskId //任务Id
|
||||
this.status = data.status //任务状态 0未完成 1已完成 3仅展示
|
||||
}
|
||||
// 初次渲染
|
||||
this.getPageData()
|
||||
// 渲染时间选择器
|
||||
this.getTime()
|
||||
},
|
||||
methods: {
|
||||
//获取元素高度
|
||||
Height() {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".next").boundingClientRect((data) => {
|
||||
// 得到高度
|
||||
this.srcollHeight = uni.getSystemInfoSync().windowHeight - data.top - 18 + "px";
|
||||
}).exec();
|
||||
},
|
||||
//点击获取下一题的距离
|
||||
questClass(index) {
|
||||
setTimeout(() => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".quest" + index).boundingClientRect((data) => {
|
||||
this.scrollView = parseInt(this.scrollGun + data.top - 82)
|
||||
if (index > 3) {
|
||||
this.isBottom = true
|
||||
}
|
||||
}).exec();
|
||||
}, 0)
|
||||
},
|
||||
// 滚动位置赋值
|
||||
scroll(e) {
|
||||
this.scrollGun = e.target.scrollTop
|
||||
},
|
||||
// 滚动到页面底部
|
||||
goBottom() {
|
||||
let num = this.fixedHeight++
|
||||
this.scrollView = num
|
||||
},
|
||||
getImgHh() {
|
||||
showLoading('保存中...')
|
||||
let that = this
|
||||
var query = uni.createSelectorQuery().in(that);
|
||||
setTimeout(() => {
|
||||
that.canvasH = that.answerList.length * 70
|
||||
that.$nextTick(() => {
|
||||
that.$refs.Eposter.createForElRect('Poster1', true)
|
||||
})
|
||||
}, 0)
|
||||
},
|
||||
onSuccess(val) {
|
||||
hideLoading()
|
||||
wx.saveImageToPhotosAlbum({
|
||||
filePath: val,
|
||||
success(res1) {
|
||||
uni.showToast({
|
||||
title: '保存成功!',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onError(err) {
|
||||
hideLoading()
|
||||
console.log(`err`, err);
|
||||
},
|
||||
// 获取数据
|
||||
async getPageData() {
|
||||
showLoading('加载中...')
|
||||
let data = {
|
||||
...this.userParameters
|
||||
}
|
||||
let ret = []
|
||||
if (this.id == 1 && this.questionClassId != 1) {
|
||||
// 21天安眠训练营
|
||||
ret = await this.$API.selectQuestAll({
|
||||
data
|
||||
})
|
||||
} else if (this.id == 2) {
|
||||
// 14天情绪计划
|
||||
ret = await this.$API.queryEmotionQuest({
|
||||
data
|
||||
})
|
||||
} else if (this.id == 3) {
|
||||
// 14天减压计划
|
||||
ret = await this.$API.queryStressManagement({
|
||||
data
|
||||
})
|
||||
} else {
|
||||
// 计划的列表每日任务单独问卷
|
||||
ret = await this.$API.selectQuestById({
|
||||
data: {
|
||||
questionClassId: this.questionClassId,
|
||||
taskId: this.taskId,
|
||||
userPlanId: this.userPlanId,
|
||||
...this.userParameters
|
||||
}
|
||||
})
|
||||
}
|
||||
let obj = ret.data || {}
|
||||
obj.map((item, index) => {
|
||||
if (index == 0) {
|
||||
item.hidden = true
|
||||
} else {
|
||||
item.hidden = false
|
||||
}
|
||||
console.log(item.questionType, 'questionType')
|
||||
item.defaultValue = ''
|
||||
// 将时间格式转变成int类型
|
||||
if (item.questionType == 3 && item.questionImportType == 1) {
|
||||
item.importValue1[0] = parseInt(item.importValue1[0])
|
||||
item.importValue1[1] = parseInt(item.importValue1[1])
|
||||
}
|
||||
})
|
||||
this.answerList = obj
|
||||
this.pageShow = true
|
||||
// 获取题目列表高度
|
||||
setTimeout(() => {
|
||||
this.Height()
|
||||
}, 100)
|
||||
hideLoading()
|
||||
},
|
||||
// 单选卡片点击事件
|
||||
cardChange(index, index1, item, item1) {
|
||||
let that = this
|
||||
// 循环单个选项
|
||||
that.answerList[index].options.map((indData, ind) => {
|
||||
// 判断卡片选中哪一项
|
||||
if (ind == index1) {
|
||||
indData.hidden = true
|
||||
} else {
|
||||
indData.hidden = false
|
||||
}
|
||||
})
|
||||
that.nextStep(index, item, item1)
|
||||
},
|
||||
// 多选卡片点击事件
|
||||
multipleCard(item, index1) {
|
||||
item.options[index1].hidden = !item.options[index1].hidden
|
||||
},
|
||||
// 初始时间
|
||||
getTime() {
|
||||
const date = new Date()
|
||||
this.hours = []
|
||||
const hour = date.getHours()
|
||||
this.minutes = []
|
||||
const minute = date.getMinutes()
|
||||
const h = [];
|
||||
const hs = [];
|
||||
const m = [];
|
||||
for (let i = 0; i < 24; i++) {
|
||||
if (i < 10) {
|
||||
hs.push('0' + i)
|
||||
} else {
|
||||
hs.push(i)
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < 60; i++) {
|
||||
if (i < 10) {
|
||||
m.push('0' + i)
|
||||
} else {
|
||||
m.push(i)
|
||||
}
|
||||
}
|
||||
this.hours = h.concat(hs);
|
||||
this.minutes = m;
|
||||
},
|
||||
// 时间选择器
|
||||
oneChange(e, index) {
|
||||
const val = e.detail.value
|
||||
let a = this.hours[val[0]]
|
||||
let b = this.minutes[val[1]]
|
||||
this.answerList[index].importValue1 = val
|
||||
this.answerList[index].value = a + ':' + b
|
||||
},
|
||||
// 填空
|
||||
inputChange(e, index) {
|
||||
this.answerList[index].value = e.detail.value
|
||||
},
|
||||
// 确认
|
||||
nextStep(index, item, item1) {
|
||||
// 填空判断
|
||||
if (item.questionType == 3 && item.questionImportType != 1) {
|
||||
if (item.value == null)
|
||||
return toast('请先填写!')
|
||||
// 小时进入
|
||||
if (item.questionImportType == 3 && item.value > 24) {
|
||||
return toast('时间不能超过24小时')
|
||||
}
|
||||
}
|
||||
// 单选显示
|
||||
if (item.questionType == 1) {
|
||||
item.defaultValue = item1.sort + '.' + item1.optionName
|
||||
// 多选显示
|
||||
} else if (item.questionType == 2) {
|
||||
let data = item.options
|
||||
let a = []
|
||||
data.map(ind => {
|
||||
if (ind.hidden) {
|
||||
a.push(ind.optionName)
|
||||
}
|
||||
})
|
||||
item.defaultValue = a.toString()
|
||||
} else {
|
||||
// 时间选择器显示
|
||||
if (item.questionImportType == 1) {
|
||||
if (item.value == null) {
|
||||
item.defaultValue = this.hours[item.importValue1[0]] + ':' + this.minutes[item.importValue1[1]]
|
||||
} else {
|
||||
item.defaultValue = item.value
|
||||
}
|
||||
// 填空显示
|
||||
} else {
|
||||
console.log(item.value, item.questionImportType, 'item.questionImportType')
|
||||
item.defaultValue = item.value + (item.questionImportType == 2 ? '次' : '小时')
|
||||
}
|
||||
}
|
||||
// 判断是否为最后一题
|
||||
if (index == this.answerList.length - 1) {
|
||||
this.$set(item, 'hidden', true)
|
||||
this.$set(this, 'isNext', true)
|
||||
} else {
|
||||
this.$set(this.answerList[index + 1], 'hidden', true)
|
||||
}
|
||||
// 时间选择器
|
||||
if (item.questionType == 3 && item.questionImportType == 1) {
|
||||
if (item.value == null) {
|
||||
// 为空时赋默认值
|
||||
let a = this.hours[item.importValue1[0]]
|
||||
let b = this.minutes[item.importValue1[1]]
|
||||
item.value = a + ':' + b
|
||||
}
|
||||
item.hidden = true
|
||||
}
|
||||
this.questClass(index)
|
||||
},
|
||||
// 完成答题
|
||||
completeAnswer() {
|
||||
if (this.$preventClick()) return // 防抖
|
||||
let nowIndex = this.answerList.length - 1
|
||||
let list = {}
|
||||
let list2 = {}
|
||||
let list3 = {}
|
||||
// 所有答案
|
||||
let resqult = []
|
||||
// 综合问卷时进入
|
||||
if ((this.id == 1 || this.id == 2 || this.id == 3 || this.id == 46 || this.id == 47) && this
|
||||
.questionClassId != 1) {
|
||||
// 循环所有题目查看结果
|
||||
this.answerList.map((item, index) => {
|
||||
let questionCode = item.questionCode
|
||||
let optionScore = null
|
||||
// 单选或者多选
|
||||
if (item.questionType == 1 || item.questionType == 2) {
|
||||
item.options.map((item1) => {
|
||||
if (item1.hidden) {
|
||||
optionScore = item1.optionScore
|
||||
}
|
||||
})
|
||||
if (!list[item.questionClassId]) {
|
||||
list[item.questionClassId] = {
|
||||
[questionCode]: optionScore
|
||||
};
|
||||
} else {
|
||||
list[item.questionClassId][questionCode] = optionScore;
|
||||
}
|
||||
// 填空 3||1代表时间选择器类型 3||2代表整数键盘 3||3代表数字键盘
|
||||
} else if (item.questionType == 3) {
|
||||
if (!list[item.questionClassId]) {
|
||||
list[item.questionClassId] = {
|
||||
[questionCode]: item.value
|
||||
};
|
||||
} else {
|
||||
list[item.questionClassId][questionCode] = item.value;
|
||||
}
|
||||
}
|
||||
})
|
||||
Object.keys(list).map((item) => {
|
||||
resqult.push({
|
||||
questionId: item,
|
||||
result: list[item],
|
||||
})
|
||||
})
|
||||
// 每日任务单独问卷进入
|
||||
} else {
|
||||
this.answerList.map((item, index) => {
|
||||
let questionCode = item.questionCode
|
||||
let optionScore = null
|
||||
// 单选或者多选
|
||||
if (item.questionType == 1 || item.questionType == 2) {
|
||||
item.options.map((item1) => {
|
||||
if (item1.hidden) {
|
||||
optionScore = item1.optionScore
|
||||
}
|
||||
})
|
||||
list[questionCode] = optionScore;
|
||||
// 填空 3||1代表时间选择器类型 3||2代表整数键盘 3||3代表数字键盘
|
||||
} else if (item.questionType == 3) {
|
||||
list[questionCode] = item.value;
|
||||
}
|
||||
})
|
||||
}
|
||||
// 多选判断
|
||||
if ((this.id == 1 || this.id == 2 || this.id == 3) && this.answerList[nowIndex].questionType == 2) {
|
||||
var falg = true;
|
||||
for (var i = 0; i < this.answerList[nowIndex].options.length; i++) {
|
||||
if (this.answerList[nowIndex].options[i].hidden) {
|
||||
falg = false;
|
||||
}
|
||||
}
|
||||
if (falg) return toast('请先选择!')
|
||||
this.$API.insertQuestResult({
|
||||
data: {
|
||||
result: JSON.stringify(resqult),
|
||||
userPlanId: this.userPlanId,
|
||||
...this.userParameters
|
||||
},
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: '加入成功!',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
let a = {
|
||||
type: 0,
|
||||
userParameters: JSON.stringify(this.userParameters),
|
||||
name: this.userName
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages/plan-questionnaire/planningReport/planningReport?params=' + JSON
|
||||
.stringify(a)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
if (this.answerList[nowIndex].questionType == 1 && !this.answerList[nowIndex].hidden) return toast(
|
||||
'请先选择!') //单选判断是否选择
|
||||
// 填空判断
|
||||
if (this.answerList[nowIndex].questionType == 3 && (this.answerList[nowIndex].value == null || this
|
||||
.answerList[nowIndex].value == '')) {
|
||||
if (this.answerList[nowIndex].questionType == 3 && !this.answerList[nowIndex].hidden) return toast(
|
||||
'请先填写!')
|
||||
}
|
||||
if (this.answerList[nowIndex].questionType == 2) {
|
||||
// 循环单个选项
|
||||
var falg = true;
|
||||
for (var i = 0; i < this.answerList[nowIndex].options.length; i++) {
|
||||
if (this.answerList[nowIndex].options[i].hidden) {
|
||||
falg = false;
|
||||
}
|
||||
}
|
||||
if (falg) return toast('请先选择!')
|
||||
}
|
||||
let result = null
|
||||
// 综合问卷
|
||||
if ((this.id == 1 || this.id == 2 || this.id == 3 || this.id == 46 || this.id == 47) && this
|
||||
.questionClassId != 1) {
|
||||
result = JSON.stringify(resqult)
|
||||
// 单独问卷
|
||||
} else {
|
||||
result = JSON.stringify(list)
|
||||
}
|
||||
showLoading('提交中...')
|
||||
this.$API.insertQuestResult({
|
||||
data: {
|
||||
result: result,
|
||||
questionId: this.questionClassId,
|
||||
taskId: this.taskId,
|
||||
userPlanId: this.userPlanId,
|
||||
...this.userParameters
|
||||
}
|
||||
}).then(res => {
|
||||
if (this.questionClassId != 3 && this.questionClassId != 4) {
|
||||
if (this.id == 1 && this.questionClassId != 1) {
|
||||
hideLoading()
|
||||
// 安眠报告
|
||||
let a = {
|
||||
type: 0,
|
||||
userParameters: JSON.stringify(this.userParameters),
|
||||
name: this.userName
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages/plan-questionnaire/planningReport/planningReport?params=' +
|
||||
JSON.stringify(a)
|
||||
})
|
||||
} else if (this.id == 2) {
|
||||
// 情绪综合报告
|
||||
setTimeout(() => {
|
||||
hideLoading()
|
||||
let a = {
|
||||
type: 1,
|
||||
userParameters: JSON.stringify(this.userParameters),
|
||||
name: this.userName
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages/plan-questionnaire/moodRequest/moodRequest?params=' +
|
||||
JSON.stringify(a)
|
||||
})
|
||||
}, 1000)
|
||||
// 减压综合报告
|
||||
} else if (this.id == 3) {
|
||||
setTimeout(() => {
|
||||
hideLoading()
|
||||
let a = {
|
||||
type: 2,
|
||||
userParameters: JSON.stringify(this.userParameters),
|
||||
name: this.userName
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages/plan-questionnaire/moodRequest/moodRequest?params=' +
|
||||
JSON.stringify(a)
|
||||
})
|
||||
}, 1000)
|
||||
//情绪 压力每日计划的第15天问卷进入
|
||||
} else if (this.id == 46 || this.id == 47) {
|
||||
setTimeout(() => {
|
||||
hideLoading()
|
||||
let a = {
|
||||
type: this.id,
|
||||
userParameters: JSON.stringify(this.userParameters),
|
||||
name: this.userName,
|
||||
userPlanId: this.userPlanId,
|
||||
taskId: this.taskId
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages/plan-questionnaire/moodRequest/moodRequest?params=' +
|
||||
JSON.stringify(a)
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
let a = {
|
||||
type: this.questionClassId,
|
||||
userParameters: JSON.stringify(this.userParameters),
|
||||
name: this.userName,
|
||||
taskId: this.taskId
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages/plan-questionnaire/planningReport/planningReport?params=' +
|
||||
JSON.stringify(a)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
hideLoading()
|
||||
if (this.questionClassId == 4) {
|
||||
// this.getImgHh()
|
||||
this.back()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '加入成功!',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
this.back()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 返回上一页
|
||||
back() {
|
||||
if (window.Android) {
|
||||
window.Android.back()
|
||||
}
|
||||
if (window.webkit) {
|
||||
window.webkit.messageHandlers.back.postMessage("");
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './psychologicalIndex.scss';
|
||||
</style>
|
|
@ -0,0 +1,267 @@
|
|||
page{
|
||||
background: #F3F4F6;
|
||||
}
|
||||
.pageBox{
|
||||
.themColor{
|
||||
color: #3AAFB8;
|
||||
}
|
||||
$uni-color:#3AAFB8;
|
||||
.color{
|
||||
color: #17191A;
|
||||
}
|
||||
.topPostionBg{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100vw;
|
||||
height: 528rpx;
|
||||
background: linear-gradient(155deg, #E4F5EB 0%, rgba(228,245,235,0) 100%);
|
||||
}
|
||||
.staging{
|
||||
width: 470rpx;
|
||||
height: calc(580rpx - 42rpx);
|
||||
border-radius: 48rpx;
|
||||
background: #FFF;
|
||||
padding: 22rpx 32rpx 20rpx;
|
||||
.bg{
|
||||
width: 100%;
|
||||
height: 224rpx;
|
||||
background: linear-gradient(180deg, #D8FCFF 0%, #FFF 100%);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-radius: 48rpx 48rpx 0 0;
|
||||
}
|
||||
.stagingBackground{
|
||||
width: 268rpx;
|
||||
height: 166rpx;
|
||||
}
|
||||
.threeSix{
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
.oneTwo{
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
.stagBtn{
|
||||
width: calc(406rpx - 278rpx);
|
||||
padding: 10rpx 138rpx 10rpx 140rpx;
|
||||
border-radius: 50rpx;
|
||||
border: 2rpx solid $uni-color;
|
||||
background: $uni-color;
|
||||
margin: 0 auto;
|
||||
color: #FFF;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
.colorGrey{
|
||||
color: #909292;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
}
|
||||
.contioner{
|
||||
padding: 32rpx;
|
||||
.backBottom{
|
||||
position: fixed;
|
||||
bottom: 10vh;
|
||||
right: 34rpx;
|
||||
padding: 12rpx 32rpx;
|
||||
border-radius: 50rpx;
|
||||
background: #FFF;
|
||||
box-shadow: 0 8rpx 8rpx 0 rgba(4, 70, 74, 0.14);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:24rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
.topCard{
|
||||
padding: 12rpx;
|
||||
margin-top: 48rpx;
|
||||
border-radius: 32rpx;
|
||||
background: #FFFFFF;
|
||||
.headSculpture{
|
||||
$wh:112rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
background: #F3F4F6;
|
||||
border-radius: 50%;
|
||||
border: 6rpx solid #FFFFFF;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
top: -52rpx;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:100rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.border{
|
||||
border: 1rpx dotted #3AAFB8;
|
||||
border-radius: 20rpx;
|
||||
.cut{
|
||||
display: inline-block;
|
||||
width: 4rpx;
|
||||
height: 20rpx;
|
||||
margin: 0 12rpx;
|
||||
background: $uni-color;
|
||||
}
|
||||
.top{
|
||||
margin-top: 72rpx;
|
||||
color: $uni-color;
|
||||
}
|
||||
.tag{
|
||||
padding: 0 20rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 4rpx;
|
||||
background: #F3F4F6;
|
||||
color: #909292;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.avare {
|
||||
$wh: 80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.introduce {
|
||||
padding: 20rpx;
|
||||
width: calc(502rpx - 40rpx);
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 0rpx 0rpx;
|
||||
}
|
||||
|
||||
.evaluation {
|
||||
width: calc(502rpx - 40rpx);
|
||||
padding: 20rpx;
|
||||
margin-top: 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
||||
.greyTag{
|
||||
padding: 18rpx 40rpx;
|
||||
background: #F8F8F8;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 20rpx;
|
||||
.tegWidth{
|
||||
width: 2rpx;
|
||||
height: 24rpx;
|
||||
background: #CCCCCC;
|
||||
margin: 0 24rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.shawDown{
|
||||
background: #EFF9F8;
|
||||
}
|
||||
.cut{
|
||||
margin-top: 32rpx;
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #eee;
|
||||
}
|
||||
.fenge{
|
||||
width: 2rpx;
|
||||
height: 80rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: #eee;
|
||||
}
|
||||
}
|
||||
.rightLayOut{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 32rpx;
|
||||
.leftTag{
|
||||
padding: 20rpx 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 16rpx 0rpx 16rpx 16rpx;
|
||||
color: #FFFFFF;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.rightAvter{
|
||||
$wh:80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.bottomBtn{
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
width: calc(100% - 64rpx);
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.centerScoll{
|
||||
width: 100%;
|
||||
height: calc(87vh - 184rpx);
|
||||
}
|
||||
|
||||
.black {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.blackColor {
|
||||
color: #8E9AAB;
|
||||
}
|
||||
|
||||
.fontColor {
|
||||
color: #112950;
|
||||
}
|
||||
|
||||
.singCard {
|
||||
padding: 40rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
border: 2rpx solid #DCDEE0;
|
||||
font-size: 28rpx;
|
||||
color: #112950;
|
||||
|
||||
image {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cardShadow {
|
||||
color: #3AAFB8;
|
||||
box-shadow: inset 0px 0px 12px 0px rgba(58, 175, 184, 0.8000);
|
||||
}
|
||||
.btnPostion{
|
||||
background: #E6EFF1;
|
||||
.next {
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
background: #3AAFB8;
|
||||
border-radius: 42rpx;
|
||||
margin-bottom: 48rpx;
|
||||
}
|
||||
|
||||
.temporary {
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
border-radius: 42rpx;
|
||||
border: 2rpx solid #DCDEE0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,744 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="isShow" @touchmove.stop="">
|
||||
<view class="topPostionBg"></view>
|
||||
<block v-if="temporarily">
|
||||
<uni-popup type="center" ref="center" :isMaskClick="false">
|
||||
<view class="staging bg-video">
|
||||
<view class="bg"></view>
|
||||
<view class="text-center">
|
||||
<image src="https://shayu5qny.yhy.ren/stagingBackground.png" class="stagingBackground"></image>
|
||||
</view>
|
||||
<view class="text-xxl text-center threeSix text-bold">温馨提示</view>
|
||||
<view class="text-center text-sm oneTwo">嗨!发现您还有一份填了一半的问卷呢</view>
|
||||
<view class="text-center text-sm">请告诉我您想怎么处理</view>
|
||||
<view class="stagBtn margin-top-xs" @tap="continueChange">继续填写</view>
|
||||
<view class="text-center text-df colorGrey" @tap="againQuestion">重新填写</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</block>
|
||||
<view class="contioner" v-else>
|
||||
<view class="topCard bg-video">
|
||||
<view class="headSculpture">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png"></image>
|
||||
</view>
|
||||
<view class="border text-center bg-video">
|
||||
<view class="top text-df text-bold">
|
||||
<text class="color">鲨鱼宝宝</text>
|
||||
<text class="cut"></text>
|
||||
<text>专属评估客服</text>
|
||||
</view>
|
||||
<view class="flex-conter margin-top-xs marginBottom">
|
||||
<view class="tag marginRight-xs">{{(cardRadio.length*15/60).toFixed(0)}}分钟</view>
|
||||
<view class="tag marginRight-xs">{{cardRadio.length}}题</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y :style="{'height':srcollHeight}" :scroll-top="scrollView" @scroll="scroll"
|
||||
scroll-with-animation>
|
||||
<view class="next" style="padding-top: 32rpx;"></view>
|
||||
<block v-for="(item,index) in cardRadio" :key="index">
|
||||
<view v-show="item.hidden">
|
||||
<!-- 单选样式 -->
|
||||
<view class="flex bg-video" style="margin-top: 32rpx;" v-if="dictNo!='10'">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="color">
|
||||
<view class="introduce text-df">
|
||||
<view>{{index + 1 }}: {{item.subInfo}}</view>
|
||||
<view class="text-sm margin-top-xs" style="color: #5878B4;" v-if="item.memo!=null">
|
||||
注:{{item.memo}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="evaluation">
|
||||
<view class="text-df">单选</view>
|
||||
<block v-for="(item1,index1) in item.optionList" :key="index1">
|
||||
<view :class="['greyTag',item1.hidden?'shawDown':'']"
|
||||
@tap="selectChange(index,index1,item,item1)">
|
||||
<text class="text-bold">{{item1.optCode}}</text>
|
||||
<text class="tegWidth"></text>
|
||||
<text style="color: #3F4040;">{{item1.optValue}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 单选 是否选项展示样式 -->
|
||||
<view class="flex bg-video" style="margin-top: 32rpx;" v-else>
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="evaluation fontColor">
|
||||
<view class="text-df">{{item.subInfo}}</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex bg-video" style="height: 60rpx;">
|
||||
<block v-for="(item1,index1) in item.optionList" :key="index1">
|
||||
<view :class="['flex-sub text-center',item1.hidden?'themColor':'']"
|
||||
@tap="selectChange(index,index1,item,item1)">
|
||||
<text style="line-height: 80rpx;">{{item1.optValue}}</text>
|
||||
</view>
|
||||
</block>
|
||||
<view class="fenge"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-end" :class="['quest'+index]" v-if="item.defaultValue!=null">
|
||||
<view class="rightLayOut">
|
||||
<view class="leftTag flex-sub">{{item.defaultValue}}</view>
|
||||
<image :src="userProfile" class="rightAvter"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view style="width: 100%;height: 100rpx;"></view>
|
||||
</scroll-view>
|
||||
<view class="bottomBtn" @tap="submit" v-if="isNext">生成评估报告</view>
|
||||
<!-- 返回底部 -->
|
||||
<view class="backBottom" @tap="goBottom" v-show="scrollGun<600&&isBottom">
|
||||
<image src="https://shayu5qny.yhy.ren/Frame.png"></image>
|
||||
<view class="text-sm themColor">返回底部</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false, //等待页面数据渲染完成
|
||||
isBottom: false, //是否显示返回底部按钮
|
||||
isBumit: false, //是否提交
|
||||
dictNo: '', // 心理类型编号
|
||||
userParameters: {}, //接收用户参数
|
||||
userProfile: '', //用户头像
|
||||
// 题目集合
|
||||
cardRadio: [],
|
||||
// 暂存问卷页面是否显示
|
||||
temporarily: null,
|
||||
// 总分数
|
||||
fraction: 0,
|
||||
// 记录选择的每道题目分数
|
||||
subject: [],
|
||||
// 雷达图我的得分数据
|
||||
chartMyList: [],
|
||||
score1: 0,
|
||||
score2: 0,
|
||||
positive: false, //08题目类型的判断结果
|
||||
id: null, //区分成员id
|
||||
isNext: false, //是否为最后一题
|
||||
optionQuest: [], //存取15类型的选择项
|
||||
jieguo: '', //15类型的结果
|
||||
srcollHeight: "", //题目的高度
|
||||
scrollView: 0, //题目距离顶部的位置
|
||||
scrollGun: 0, //屏幕滚动的高度
|
||||
fixedHeight: 100000, //固定底部高度
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
let data = JSON.parse(decodeURIComponent(options.params))
|
||||
if (data.token) {
|
||||
this.userParameters.openId = data.openId //用户唯一标识
|
||||
this.userParameters.token = data.token //用户唯一标识
|
||||
}
|
||||
this.userParameters.userId = data.userId //用户id
|
||||
this.userProfile = data.headSculpture //头像
|
||||
this.userName = data.name //名称
|
||||
this.id = data.id //用户传0 ,成员传家庭成员id
|
||||
this.dictNo = data.dicCode //心理类型编号
|
||||
// 查询是否有暂存数据
|
||||
this.temporaryAata()
|
||||
},
|
||||
// 页面销毁前暂存问卷
|
||||
beforeDestroy() {
|
||||
if (!this.isBumit) {
|
||||
this.temporaryQuestion()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//获取元素高度
|
||||
Height() {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".next").boundingClientRect((data) => {
|
||||
// 得到高度
|
||||
this.srcollHeight = uni.getSystemInfoSync().windowHeight - data.top - 18 + "px";
|
||||
}).exec();
|
||||
},
|
||||
// 滚动到页面底部
|
||||
goBottom() {
|
||||
let num = this.fixedHeight++
|
||||
this.scrollView = num
|
||||
},
|
||||
//点击获取下一题的距离
|
||||
questClass(index) {
|
||||
setTimeout(() => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".quest" + index).boundingClientRect((data) => {
|
||||
this.scrollView = parseInt(this.scrollGun + data.top - 82)
|
||||
}).exec();
|
||||
if (index > 3) {
|
||||
this.isBottom = true
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
// 查询是否有暂存数据
|
||||
temporaryAata() {
|
||||
let that = this
|
||||
that.$API.pagerUserByCode({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
dicCode: that.dictNo,
|
||||
memberId: that.id
|
||||
}
|
||||
}).then((res) => {
|
||||
// 判断是否有暂存问卷 0没有暂存 1有暂存
|
||||
if (res.data.queShow == 0) {
|
||||
that.getInfo()
|
||||
} else {
|
||||
that.temporarily = true
|
||||
that.isShow = true
|
||||
setTimeout(() => {
|
||||
that.$refs.center.open()
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取问卷信息
|
||||
async getInfo() {
|
||||
showLoading('加载中...')
|
||||
let that = this
|
||||
let ret = await that.$API.subjectList({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
dictNo: that.dictNo
|
||||
}
|
||||
})
|
||||
ret.data.map((item, index) => {
|
||||
if (index == 0) {
|
||||
item.hidden = true
|
||||
} else {
|
||||
item.hidden = false
|
||||
}
|
||||
})
|
||||
that.$set(that, 'cardRadio', ret.data) //获取总数据
|
||||
that.isShow = true
|
||||
// 获取题目列表高度
|
||||
setTimeout(() => {
|
||||
that.Height()
|
||||
}, 100)
|
||||
hideLoading()
|
||||
},
|
||||
//重新填写问卷信息
|
||||
async againQuestion() {
|
||||
let that = this
|
||||
let ret = await that.$API.anewQuery({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
dictCode: that.dictNo,
|
||||
memberId: that.id
|
||||
}
|
||||
})
|
||||
ret.data[0].hidden = true
|
||||
// 题目赋值
|
||||
that.$set(that, 'cardRadio', ret.data)
|
||||
that.temporarily = false
|
||||
setTimeout(() => {
|
||||
that.Height()
|
||||
}, 100)
|
||||
},
|
||||
//继续填写问卷信息
|
||||
continueChange() {
|
||||
let that = this
|
||||
// 调用根据评估类型查询评估答题试卷接口查询暂存问卷进度
|
||||
that.$API.pagerUserByCode({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
dicCode: that.dictNo,
|
||||
memberId: that.id
|
||||
}
|
||||
}).then((res) => {
|
||||
// json数据转成对象
|
||||
var jsarr = JSON.parse(res.data.paperJson);
|
||||
// 赋值
|
||||
that.$set(that, 'cardRadio', jsarr)
|
||||
that.temporarily = false
|
||||
setTimeout(() => {
|
||||
that.Height()
|
||||
that.scrollView = 100000
|
||||
}, 100)
|
||||
})
|
||||
},
|
||||
// 暂存问卷
|
||||
temporaryQuestion() {
|
||||
let that = this
|
||||
let paperJson = JSON.stringify(that.cardRadio)
|
||||
let ret = that.$API.tempSave({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
dictCode: that.dictNo, //心理题目类型
|
||||
paperJson: paperJson, //所有的题目
|
||||
paperState: '0', //题目完成状态
|
||||
queShow: 1, //是否有暂存数据 0无 1有
|
||||
queScore: that.fraction, //当前答题与前面题目的总分
|
||||
memberId: that.id
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交保存
|
||||
submit() {
|
||||
this.isBumit = true //提交时不执行页面销毁暂存问卷方法
|
||||
if (this.$preventClick()) return
|
||||
let that = this;
|
||||
that.cardRadio.map((item, index) => {
|
||||
item.optionList.map((item1) => {
|
||||
if (item1.hidden) {
|
||||
that.subject.push(item1.fraction) // 获取每道题目的分数
|
||||
that.optionQuest.push(item1.optCode) // MBTI职业性格测试问卷获取题目键值
|
||||
}
|
||||
})
|
||||
})
|
||||
if (that.dictNo != '07' && that.dictNo != '10') {
|
||||
that.cardRadio.map((item, inx) => {
|
||||
if (that.dictNo == '04' && inx < 6 && that.cardRadio[0].optionList[0].hidden) {
|
||||
that.fraction = 0
|
||||
} else if (that.dictNo == '04' && inx > 5 && that.cardRadio[5].optionList[0].hidden) {
|
||||
that.fraction = 0
|
||||
} else {
|
||||
item.optionList.map((item1, inx1) => {
|
||||
if (item1.hidden) {
|
||||
that.fraction += item1.fraction
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
// 职业倦怠 雷达图我的得分赋值
|
||||
if (that.dictNo == '06') {
|
||||
let a = [0, 1, 2, 3, 4]
|
||||
let b = [5, 6, 7, 8]
|
||||
let c = [9, 10, 11, 12, 13, 14]
|
||||
let one = 0;
|
||||
let two = 0;
|
||||
let three = 0;
|
||||
a.map((item) => {
|
||||
one += that.subject[item]
|
||||
})
|
||||
b.map((item) => {
|
||||
two += that.subject[item]
|
||||
})
|
||||
c.map((item) => {
|
||||
three += that.subject[item]
|
||||
})
|
||||
that.chartMyList[0] = parseInt(one / a.length)
|
||||
that.chartMyList[1] = parseInt(two / b.length)
|
||||
that.chartMyList[2] = parseInt(three / c.length)
|
||||
}
|
||||
|
||||
// 心理综合评估 雷达图我的得分赋值
|
||||
if (that.dictNo == '08') {
|
||||
let a = [0, 3, 11, 26, 39, 41, 47, 48, 51, 52, 55, 57]
|
||||
let b = [2, 8, 9, 27, 37, 44, 45, 50, 54, 64]
|
||||
let c = [5, 20, 33, 35, 36, 40, 60, 68, 72]
|
||||
let d = [4, 13, 14, 19, 21, 25, 28, 29, 30, 31, 53, 70, 78]
|
||||
let e = [1, 16, 22, 32, 38, 56, 71, 77, 79, 85]
|
||||
let f = [10, 23, 62, 66, 73, 80]
|
||||
let g = [12, 24, 46, 49, 69, 74, 81]
|
||||
let h = [7, 17, 42, 67, 75, 82]
|
||||
let i = [6, 15, 34, 61, 76, 83, 84, 86, 87, 89]
|
||||
let j = [18, 43, 58, 59, 63, 65, 88]
|
||||
let one = 0;
|
||||
let two = 0;
|
||||
let three = 0;
|
||||
let four = 0;
|
||||
let five = 0;
|
||||
let six = 0;
|
||||
let seven = 0;
|
||||
let eight = 0;
|
||||
let nine = 0;
|
||||
let ten = 0;
|
||||
a.map((item) => {
|
||||
one += that.subject[item]
|
||||
})
|
||||
b.map((item) => {
|
||||
two += that.subject[item]
|
||||
})
|
||||
c.map((item) => {
|
||||
three += that.subject[item]
|
||||
})
|
||||
d.map((item) => {
|
||||
four += that.subject[item]
|
||||
})
|
||||
e.map((item) => {
|
||||
five += that.subject[item]
|
||||
})
|
||||
f.map((item) => {
|
||||
six += that.subject[item]
|
||||
})
|
||||
g.map((item) => {
|
||||
seven += that.subject[item]
|
||||
})
|
||||
h.map((item) => {
|
||||
eight += that.subject[item]
|
||||
})
|
||||
i.map((item) => {
|
||||
nine += that.subject[item]
|
||||
})
|
||||
j.map((item) => {
|
||||
ten += that.subject[item]
|
||||
})
|
||||
that.chartMyList[0] = (one / a.length).toFixed(2)
|
||||
that.chartMyList[1] = (two / b.length).toFixed(2)
|
||||
that.chartMyList[2] = (three / c.length).toFixed(2)
|
||||
that.chartMyList[3] = (four / d.length).toFixed(2)
|
||||
that.chartMyList[4] = (five / e.length).toFixed(2)
|
||||
that.chartMyList[5] = (six / f.length).toFixed(2)
|
||||
that.chartMyList[6] = (seven / g.length).toFixed(2)
|
||||
that.chartMyList[7] = (eight / h.length).toFixed(2)
|
||||
that.chartMyList[8] = (nine / i.length).toFixed(2)
|
||||
that.chartMyList[9] = (ten / j.length).toFixed(2)
|
||||
let abc = 0
|
||||
that.subject.map((item) => {
|
||||
if (item > 0) {
|
||||
abc++
|
||||
}
|
||||
})
|
||||
// 判断08类型结果 true阳性 false阴性
|
||||
if (that.fraction > 160 || (that.chartMyList[0] > 2 || that.chartMyList[1] > 2 || that
|
||||
.chartMyList[2] > 2 || that.chartMyList[3] > 2 || that.chartMyList[4] > 2 ||
|
||||
that.chartMyList[5] > 2 || that.chartMyList[6] > 2 || that.chartMyList[7] > 2 ||
|
||||
that.chartMyList[8] > 2 || that.chartMyList[9] > 2) || abc > 43) {
|
||||
that.positive = true
|
||||
} else {
|
||||
that.positive = false
|
||||
}
|
||||
}
|
||||
// 孤独症 雷达图我的得分赋值
|
||||
if (that.dictNo == '10') {
|
||||
let a = [5, 9, 20, 25, 33, 38, 43, 50, 51, 56]
|
||||
let b = [2, 6, 12, 16, 23, 24, 26, 27, 32, 37, 42, 46, 51]
|
||||
let c = [0, 4, 8, 11, 12, 15, 21, 29, 34, 39, 50, 52, 53]
|
||||
let d = [3, 7, 10, 14, 17, 19, 28, 31, 36, 41, 45, 47, 55]
|
||||
let e = [1, 13, 18, 22, 30, 35, 40, 44, 48, 49, 54]
|
||||
let one = 0;
|
||||
let two = 0;
|
||||
let three = 0;
|
||||
let four = 0;
|
||||
let five = 0;
|
||||
a.map((item) => {
|
||||
one += that.subject[item]
|
||||
})
|
||||
b.map((item) => {
|
||||
two += that.subject[item]
|
||||
})
|
||||
c.map((item) => {
|
||||
three += that.subject[item]
|
||||
})
|
||||
d.map((item) => {
|
||||
four += that.subject[item]
|
||||
})
|
||||
e.map((item) => {
|
||||
five += that.subject[item]
|
||||
})
|
||||
that.chartMyList[0] = one
|
||||
that.chartMyList[1] = two
|
||||
that.chartMyList[2] = three
|
||||
that.chartMyList[3] = four
|
||||
that.chartMyList[4] = five
|
||||
that.fraction = one + two + three + four + five
|
||||
}
|
||||
// 儿童焦虑自评 雷达图我的得分赋值
|
||||
if (that.dictNo == '12') {
|
||||
let a = [0, 5, 8, 11, 14, 17, 18, 21, 23, 26, 29, 33, 37]
|
||||
let b = [4, 6, 13, 20, 22, 27, 32, 34, 36]
|
||||
let c = [3, 7, 12, 15, 19, 24, 28, 30]
|
||||
let d = [2, 9, 25, 31, 38, 39, 40]
|
||||
let e = [1, 10, 16, 35]
|
||||
let one = 0;
|
||||
let two = 0;
|
||||
let three = 0;
|
||||
let four = 0;
|
||||
let five = 0;
|
||||
a.map((item) => {
|
||||
one += that.subject[item]
|
||||
})
|
||||
b.map((item) => {
|
||||
two += that.subject[item]
|
||||
})
|
||||
c.map((item) => {
|
||||
three += that.subject[item]
|
||||
})
|
||||
d.map((item) => {
|
||||
four += that.subject[item]
|
||||
})
|
||||
e.map((item) => {
|
||||
five += that.subject[item]
|
||||
})
|
||||
that.chartMyList[0] = one
|
||||
that.chartMyList[1] = two
|
||||
that.chartMyList[2] = three
|
||||
that.chartMyList[3] = four
|
||||
that.chartMyList[4] = five
|
||||
}
|
||||
// A型性格评估 两个进度条 分数计算
|
||||
if (that.dictNo == '07') {
|
||||
let a = [1, 2, 5, 6, 9, 10, 13, 15, 18, 20, 21, 25, 28, 29, 33, 37, 39, 41, 43, 45, 49, 52, 53, 54, 57]
|
||||
let b = [0, 3, 4, 8, 11, 14, 16, 22, 24, 26, 27, 30, 31, 34, 38, 40, 46, 56, 58, 59, 17, 35, 44, 48,
|
||||
50
|
||||
]
|
||||
let c = [7, 12, 19, 23, 32, 36, 42, 47, 51, 55]
|
||||
let one = 0;
|
||||
let two = 0;
|
||||
a.map((item) => {
|
||||
one += that.subject[item]
|
||||
})
|
||||
b.map((item) => {
|
||||
two += that.subject[item]
|
||||
})
|
||||
c.map((item) => {
|
||||
that.score1 += that.subject[item]
|
||||
})
|
||||
that.fraction = one + two
|
||||
}
|
||||
// 多动症 奇偶判断
|
||||
if (that.dictNo == '11') {
|
||||
that.score1 = that.subject[0] + that.subject[2] + that.subject[4] + that.subject[6] + that.subject[
|
||||
8] +
|
||||
that.subject[10] + that.subject[12] + that.subject[14] + that.subject[16]
|
||||
that.score2 = that.subject[1] + that.subject[3] + that.subject[5] + that.subject[7] + that.subject[
|
||||
9] +
|
||||
that.subject[11] + that.subject[13] + that.subject[15] + that.subject[17]
|
||||
}
|
||||
// MBTI职业性格测试 获取每一项的值得出结果
|
||||
if (that.dictNo == '15') {
|
||||
let a = [3, 7, 11, 13, 17, 18, 21, 22, 25, 26, 33, 34, 41, 47, 53, 59, 61, 65, 66, 71, 76]
|
||||
let b = [2, 4, 12, 14, 23, 28, 31, 36, 39, 43, 46, 49, 52, 54, 57, 60, 62, 72, 73, 78, 81, 82, 85, 86,
|
||||
89, 92
|
||||
]
|
||||
let c = [5, 15, 29, 30, 37, 38, 44, 45, 50, 51, 55, 56, 63, 68, 74, 77, 79, 80, 83, 84, 87, 88, 90, 91]
|
||||
let d = [0, 1, 6, 8, 9, 10, 16, 19, 20, 24, 27, 32, 35, 40, 42, 48, 58, 64, 67, 69, 70, 75]
|
||||
let E = ['A', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'B', 'A', 'B', 'B', 'B', 'B', 'B', 'A', 'B', 'A',
|
||||
'B', 'A'
|
||||
];
|
||||
let I = ['B', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'A', 'B', 'A', 'A', 'A', 'A', 'A', 'B', 'A', 'B',
|
||||
'A', 'B'
|
||||
];
|
||||
let S = ['A', 'B', 'A', 'B', 'B', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'A', 'B', 'A', 'B',
|
||||
'B', 'A', 'B', 'A', 'B', 'A', 'A'
|
||||
];
|
||||
let N = ['B', 'A', 'B', 'A', 'A', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'B', 'A', 'B', 'A',
|
||||
'A', 'B', 'A', 'B', 'A', 'B', 'B'
|
||||
];
|
||||
let T = ['B', 'B', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B',
|
||||
'A', 'B', 'A', 'B', 'A'
|
||||
];
|
||||
let F = ['A', 'A', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A', 'B', 'A',
|
||||
'B', 'A', 'B', 'A', 'B'
|
||||
];
|
||||
let J = ['A', 'B', 'B', 'A', 'A', 'B', 'B', 'A', 'B', 'B', 'A', 'B', 'A', 'B', 'A', 'A', 'A', 'B', 'A',
|
||||
'A', 'B', 'B'
|
||||
];
|
||||
let P = ['B', 'A', 'A', 'B', 'B', 'A', 'A', 'B', 'A', 'A', 'B', 'A', 'B', 'A', 'B', 'B', 'B', 'A', 'B',
|
||||
'B', 'A', 'A'
|
||||
];
|
||||
let e = 0
|
||||
let i = 0
|
||||
let s = 0
|
||||
let n = 0
|
||||
let t = 0
|
||||
let f = 0
|
||||
let j = 0
|
||||
let p = 0
|
||||
a.map((item, index) => {
|
||||
if (that.optionQuest[item] == E[index]) {
|
||||
e += 1
|
||||
}
|
||||
if (that.optionQuest[item] == I[index]) {
|
||||
i += 1
|
||||
}
|
||||
})
|
||||
b.map((item, index) => {
|
||||
if (that.optionQuest[item] == S[index]) {
|
||||
s += 1
|
||||
}
|
||||
if (that.optionQuest[item] == N[index]) {
|
||||
n += 1
|
||||
}
|
||||
})
|
||||
c.map((item, index) => {
|
||||
if (that.optionQuest[item] == T[index]) {
|
||||
t += 1
|
||||
}
|
||||
if (that.optionQuest[item] == F[index]) {
|
||||
f += 1
|
||||
}
|
||||
})
|
||||
d.map((item, index) => {
|
||||
if (that.optionQuest[item] == J[index]) {
|
||||
j += 1
|
||||
}
|
||||
if (that.optionQuest[item] == P[index]) {
|
||||
p += 1
|
||||
}
|
||||
})
|
||||
let jieguoOne = ''
|
||||
let jieguoTwo = ''
|
||||
let jieguoThree = ''
|
||||
let jieguoFour = ''
|
||||
if (e > i) {
|
||||
jieguoOne = 'E'
|
||||
} else {
|
||||
jieguoOne = 'I'
|
||||
}
|
||||
if (s > n) {
|
||||
jieguoTwo = 'S'
|
||||
} else {
|
||||
jieguoTwo = 'N'
|
||||
}
|
||||
if (t > f) {
|
||||
jieguoThree = 'T'
|
||||
} else {
|
||||
jieguoThree = 'F'
|
||||
}
|
||||
if (j > p) {
|
||||
jieguoFour = 'J'
|
||||
} else {
|
||||
jieguoFour = 'P'
|
||||
}
|
||||
that.jieguo = `${jieguoOne}${jieguoTwo}${jieguoThree}${jieguoFour}`
|
||||
that.chartMyList[0] = e
|
||||
that.chartMyList[1] = i
|
||||
that.chartMyList[2] = s
|
||||
that.chartMyList[3] = n
|
||||
that.chartMyList[4] = t
|
||||
that.chartMyList[5] = f
|
||||
that.chartMyList[6] = j
|
||||
that.chartMyList[7] = p
|
||||
}
|
||||
// 威廉斯创造力倾向测评量表测试 获取每一项的值得出结果
|
||||
if (that.dictNo == '23') {
|
||||
let a = [0, 4, 20, 23, 24, 27, 28, 34, 35, 42, 43]
|
||||
let b = [1, 7, 10, 11, 18, 26, 32, 33, 36, 37, 38, 46, 47, 48]
|
||||
let c = [5, 12, 13, 15, 19, 21, 22, 29, 30, 31, 39, 44, 45]
|
||||
let d = [2, 3, 6, 8, 9, 14, 16, 17, 25, 40, 41, 49]
|
||||
let one = 0;
|
||||
let two = 0;
|
||||
let three = 0;
|
||||
let four = 0;
|
||||
a.map((item) => {
|
||||
one += that.subject[item]
|
||||
})
|
||||
b.map((item) => {
|
||||
two += that.subject[item]
|
||||
})
|
||||
c.map((item) => {
|
||||
three += that.subject[item]
|
||||
})
|
||||
d.map((item) => {
|
||||
four += that.subject[item]
|
||||
})
|
||||
that.chartMyList[0] = one
|
||||
that.chartMyList[1] = two
|
||||
that.chartMyList[2] = three
|
||||
that.chartMyList[3] = four
|
||||
}
|
||||
let paperJson = JSON.stringify(that.cardRadio)
|
||||
showLoading('提交中...')
|
||||
that.$API.savePaper({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
dictCode: that.dictNo, //心理题目类型
|
||||
paperJson: paperJson, //所有的题目
|
||||
dimensionFactors: that.chartMyList, //雷达图我的得分数据
|
||||
memberId: that.id, //成员id
|
||||
paperState: '1', //题目完成状态
|
||||
positive: that.positive, //08题目类型的判断结果
|
||||
score: that.fraction, //总分
|
||||
score1: that.score1,
|
||||
score2: that.score2,
|
||||
mbti: that.jieguo, //15类型结果
|
||||
}
|
||||
}).then((res) => {
|
||||
hideLoading()
|
||||
let a = {
|
||||
userParameters: JSON.stringify(this.userParameters),
|
||||
headSculpture: this.userProfile,
|
||||
name: this.userName,
|
||||
id: this.id,
|
||||
dicCode: this.dictNo,
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages/psychological-assessment/result/result?params=' + JSON.stringify(a)
|
||||
})
|
||||
})
|
||||
},
|
||||
scroll(e) {
|
||||
this.scrollGun = e.target.scrollTop
|
||||
},
|
||||
// 选择问卷题目
|
||||
selectChange(index, index1, item, item1) {
|
||||
let that = this
|
||||
for (var i = 0; i < this.cardRadio[index].optionList.length; i++) {
|
||||
// 判断卡片选中哪一项
|
||||
if (i == index1) {
|
||||
this.$set(this.cardRadio[index].optionList[i], 'hidden', true)
|
||||
} else {
|
||||
this.$set(this.cardRadio[index].optionList[i], 'hidden', false)
|
||||
}
|
||||
}
|
||||
this.$set(this.cardRadio[index], 'defaultValue', item1.optCode + '.' + item1.optValue)
|
||||
if (that.dictNo == '04') {
|
||||
var falg = 0;
|
||||
if (index == 0 && index1 == 0) {
|
||||
for (var i = 1; i < 5; i++) {
|
||||
that.cardRadio[i].hidden = false
|
||||
}
|
||||
that.cardRadio[5].hidden = true
|
||||
} else if (index == 5 && index1 == 0) {
|
||||
for (var i = 1; i < 5; i++) {
|
||||
that.cardRadio[5 + i].hidden = false
|
||||
}
|
||||
return that.isNext = true
|
||||
} else if (index == 0 || index == 5 || index == 4) {
|
||||
for (var i = index; i < that.cardRadio.length; i++) {
|
||||
var item = that.cardRadio[i];
|
||||
if (i + 1 < that.cardRadio.length) {
|
||||
if (falg == 0 || item.defaultValue) {
|
||||
if (item.defaultValue) {
|
||||
falg = 0;
|
||||
if (i < 5 || (i >= 5 && !that.cardRadio[5].optionList[0].hidden)) {
|
||||
item.hidden = true
|
||||
that.cardRadio[i + 1].hidden = true
|
||||
}
|
||||
} else {
|
||||
falg = 1;
|
||||
that.cardRadio[i + 1].hidden = false
|
||||
}
|
||||
} else {
|
||||
falg = 1;
|
||||
that.cardRadio[i + 1].hidden = false
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (index + 1 < that.cardRadio.length) {
|
||||
that.cardRadio[index + 1].hidden = true
|
||||
}
|
||||
if (index == 9) {
|
||||
return that.isNext = true
|
||||
}
|
||||
} else {
|
||||
if (that.cardRadio.length - 1 != index) {
|
||||
that.cardRadio[index + 1].hidden = true
|
||||
} else {
|
||||
return that.isNext = true
|
||||
}
|
||||
}
|
||||
that.questClass(index)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss';
|
||||
</style>
|
|
@ -0,0 +1,178 @@
|
|||
.fontColor {
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.grey {
|
||||
color: #909292;
|
||||
}
|
||||
|
||||
.color {
|
||||
color: #3F4040;
|
||||
}
|
||||
|
||||
.themColor {
|
||||
color: #3AAFB8;
|
||||
}
|
||||
.redColor{
|
||||
color: #F87C7C;
|
||||
}
|
||||
|
||||
.bgBackground {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
width: 100vw;
|
||||
height: 606rpx;
|
||||
background: linear-gradient(145deg, #E4F5EB 0%, rgba(228, 245, 235, 0) 100%);
|
||||
}
|
||||
|
||||
.contioner {
|
||||
padding: 32rpx;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
.avter {
|
||||
$wh: 64rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.dotocr {
|
||||
width: 218rpx;
|
||||
height: 212rpx;
|
||||
}
|
||||
|
||||
.topWidth {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: #FFFFFF;
|
||||
border: 7rpx solid #6ACBD1;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
display: inline-block;
|
||||
width: 6rpx;
|
||||
height: 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.greyBg{
|
||||
|
||||
padding: 24rpx 20rpx;
|
||||
background: #EBF7F8;
|
||||
border-radius: 16rpx;
|
||||
text-indent: 2rem;
|
||||
}
|
||||
.whiteShaw {
|
||||
width: calc(100% -24rpx);
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0, 0, 0, 0);
|
||||
margin: -28rpx 0 50rpx 12rpx;
|
||||
|
||||
.topBg {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: linear-gradient(180deg, rgba(56, 176, 184, 0.30) 0%, rgba(56, 176, 184, 0.00) 100%);
|
||||
}
|
||||
|
||||
.contonentPadding {
|
||||
padding: 16rpx 20rpx 32rpx;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0,0,0,0.1);
|
||||
.gardenClass{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -20rpx;
|
||||
width: 100%;
|
||||
.circle3 {
|
||||
width: 44rpx;
|
||||
height: 22rpx;
|
||||
border-radius: 0 0 50rpx 50rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
.charts-box {
|
||||
width: 630rpx;
|
||||
height: 500rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
margin-top: 32rpx;
|
||||
padding: 32rpx 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
margin-left: 12rpx;
|
||||
|
||||
|
||||
.leftImg {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.progress{
|
||||
height: 12rpx;
|
||||
margin-right: 2rpx;
|
||||
&:first-child{
|
||||
border-radius: 50rpx 0rpx 0rpx 50rpx;
|
||||
}
|
||||
&:nth-last-child(1){
|
||||
border-radius: 0 50rpx 50rpx 0;
|
||||
margin-right: 0rpx;
|
||||
}
|
||||
}
|
||||
.triangle{
|
||||
position: absolute;
|
||||
top: -32rpx;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 20rpx solid #009DFF;
|
||||
border-right: 16rpx solid transparent;
|
||||
border-left: 16rpx solid transparent;
|
||||
}
|
||||
.positive{
|
||||
color: #F5973F;
|
||||
}
|
||||
.cut{
|
||||
margin: 32rpx 0;
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #eee;
|
||||
}
|
||||
}
|
||||
.proposal{
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
margin-left: 12rpx;
|
||||
.lineHeight{
|
||||
line-height: 38rpx;
|
||||
}
|
||||
.table{
|
||||
width: 30%;
|
||||
border: 1rpx solid #EBF1F1;
|
||||
.border-right{
|
||||
width: 30%;
|
||||
border-right: 1rpx solid #EBF1F1;
|
||||
text-align: center;
|
||||
}
|
||||
.orangeBg{
|
||||
background: rgba(245, 151, 63, 0.20);
|
||||
}
|
||||
.border-bottom{
|
||||
border-bottom: 1rpx solid #EBF1F1;
|
||||
}
|
||||
.border-width{
|
||||
width: 70% !important;
|
||||
}
|
||||
}
|
||||
.table .border-bottom:nth-last-child(1){
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,432 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="bgBackground"></view>
|
||||
<view class="contioner" v-if="isLoading">
|
||||
<view class="flex-align">
|
||||
<view>
|
||||
<view class="flex-contion">
|
||||
<image :src="userProfile" class="avter"></image>
|
||||
<view class="text-bold fontColor">Hi~{{userName}}</view>
|
||||
</view>
|
||||
<view class="fontColor margin-top-xs">欢迎开启您的专属心理报告</view>
|
||||
</view>
|
||||
<image src="https://shayu5qny.yhy.ren/dotocr.png" class="dotocr"></image>
|
||||
</view>
|
||||
<view class="topWidth"></view>
|
||||
<view class="whiteShaw color">
|
||||
<view class="topBg"></view>
|
||||
<view class="contonentPadding bg-video">
|
||||
<view class="flex">
|
||||
<text class="tagWidth margin-top-xs"></text>
|
||||
<text class="text-xl text-bold">您的本次评估结果为:
|
||||
<text class="themColor" v-if="dictNo!=15">{{progressName[location-1].scaleName}}</text>
|
||||
<text class="redColor" v-else>{{resultLevelRemark}}</text>
|
||||
</text>
|
||||
</view>
|
||||
<!-- 扇形 -->
|
||||
|
||||
<view class="flex-contion" v-if="dictNo!=15">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl text-bold">您的本次评估结果的分数为:<text class="themColor">{{fraction}}</text></text>
|
||||
</view>
|
||||
<!-- 雷达图 -->
|
||||
<view class="charts-box" v-show="dictNo=='06'||dictNo=='08'">
|
||||
<qiun-data-charts type="radar" inScrollView :opts="opt" :chartData="chartData"
|
||||
:canvas2d="true" />
|
||||
</view>
|
||||
<view class="charts-box" v-show="dictNo=='10'||dictNo=='12'">
|
||||
<qiun-data-charts type="radar" inScrollView :opts="{legend:{show: false},extra: {radar: {border: true,gridCount: 5,max: max},
|
||||
}}" :chartData="chartData" :canvas2d="true" />
|
||||
</view>
|
||||
<view class="greyBg text-df color" style="margin-top: 32rpx;" v-if="resultInfo!=null">
|
||||
{{resultInfo}}
|
||||
</view>
|
||||
<view class="flex gardenClass">
|
||||
<view v-for="(garden,gardenIndex) in todos" :key="gardenIndex" class="circle3"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 07类型显示 -->
|
||||
<block v-if="dictNo=='07'">
|
||||
<view class="card padding marginTop">
|
||||
<!-- 进度条颜色 -->
|
||||
<view class="flex-contion text-center margin-bottom-xs" style="padding-top: 32rpx;">
|
||||
<block v-for="(item,index) in progressSeven" :key="index">
|
||||
<view class="flex-sub progress flex justify-center bg-video"
|
||||
:style="{background:item.bgColor}">
|
||||
<view class="triangle" v-if="aLocation-1==index"></view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 底部说明 -->
|
||||
<view class="flex-contion text-sm color text-center marginBottom-sm">
|
||||
<block v-for="(item1,index1) in progressSeven" :key="index1">
|
||||
<view class="flex-sub">{{item1.scaleName}}</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 结论 -->
|
||||
<view class="greyBg text-df color">{{resultSevenInfo}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 建议 -->
|
||||
<view class="card color" v-if="resultProposal!=null">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl text-bold">建议</text>
|
||||
</view>
|
||||
<view class="marginTop text-df" style="text-indent: 2rem;">{{resultProposal}}</view>
|
||||
</view>
|
||||
<!-- 15类型的结果 -->
|
||||
<view class="proposal padding text-df marginTop-sm" v-if="dictNo=='15'">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl text-bold">得分情况</text>
|
||||
</view>
|
||||
<view class="flex-align marginTop">
|
||||
<view>
|
||||
<view>外向</view>
|
||||
<view>实感</view>
|
||||
<view>思考</view>
|
||||
<view>判断</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="flex border-bottom">
|
||||
<view class="border-right orangeBg">E</view>
|
||||
<view class="flex-sub text-center">{{myChartsData[0]}}</view>
|
||||
</view>
|
||||
<view class="flex border-bottom">
|
||||
<view class="border-right orangeBg">S</view>
|
||||
<view class="flex-sub text-center">{{myChartsData[2]}}</view>
|
||||
</view>
|
||||
<view class="flex border-bottom">
|
||||
<view class="border-right orangeBg">T</view>
|
||||
<view class="flex-sub text-center">{{myChartsData[4]}}</view>
|
||||
</view>
|
||||
<view class="flex border-bottom">
|
||||
<view class="border-right orangeBg">J</view>
|
||||
<view class="flex-sub text-center">{{myChartsData[6]}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="table">
|
||||
<view class="flex border-bottom">
|
||||
<view class="border-right border-width">{{myChartsData[1]}}</view>
|
||||
<view class="flex-sub text-center orangeBg">I</view>
|
||||
</view>
|
||||
<view class="flex border-bottom">
|
||||
<view class="border-right border-width">{{myChartsData[3]}}</view>
|
||||
<view class="flex-sub text-center orangeBg">N</view>
|
||||
</view>
|
||||
<view class="flex border-bottom">
|
||||
<view class="border-right border-width">{{myChartsData[5]}}</view>
|
||||
<view class="flex-sub text-center orangeBg">F</view>
|
||||
</view>
|
||||
<view class="flex border-bottom">
|
||||
<view class="border-right border-width">{{myChartsData[7]}}</view>
|
||||
<view class="flex-sub text-center orangeBg">P</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>内向</view>
|
||||
<view>直觉</view>
|
||||
<view>情感</view>
|
||||
<view>认知</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 指导 -->
|
||||
<view class="card color" v-if="directions.length>0">
|
||||
<view class="flex-contion">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-xl text-bold">指导</text>
|
||||
</view>
|
||||
<block v-for="(item,index) in directions" :key="index">
|
||||
<view class="marginTop flex-contion" @tap="goHealthBook(item.directionUrl)">
|
||||
<image :src="item.directionImg" class="leftImg" mode="aspectFill"></image>
|
||||
<view class="flex-sub text-bold">{{item.directionName}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<block v-if="dictNo=='08'||dictNo=='23'">
|
||||
<block v-for="(item,index) in symptom" :key="index">
|
||||
<view class="card padding text-sm marginTop-sm">
|
||||
<view class="flex-align">
|
||||
<view class="flex-contion text-bold">
|
||||
<text class="color text-xl marginRight-sm">{{item.dimensionName}}</text>
|
||||
<text class="themColor text-df">{{myChartsData[index]}}</text>
|
||||
</view>
|
||||
<view class="text-xl" :class="myChartsData[index]>=2?'positive':'themColor'"
|
||||
v-if="dictNo!='23'">
|
||||
{{myChartsData[index]>=2?'阳性':'阴性'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cut"></view>
|
||||
<view class="text-sm contion lineHeight">{{item.dimensionInfo}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading,
|
||||
goPage
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
todos:['','','','','','','','','','','','','','','',''],
|
||||
userParameters: {}, //接收用户参数
|
||||
symptom: [], // 雷达图因子
|
||||
userName: '', //名称
|
||||
userProfile: '', //用户头像
|
||||
dictNo: '',
|
||||
id: '',
|
||||
dimensionCode: '',
|
||||
reportId: '',
|
||||
directions: [],
|
||||
// 结论
|
||||
resultInfo: '',
|
||||
// 建议
|
||||
resultProposal: '',
|
||||
progressName: [],
|
||||
// 位置
|
||||
location: null,
|
||||
fraction: '',
|
||||
// 07类型 进度条颜色以及对应的内容
|
||||
progressSeven: [],
|
||||
aLocation: '',
|
||||
// 雷达图我的得分数据
|
||||
myChartsData: [],
|
||||
opt: {
|
||||
color: ['#3673E8', '#1DCC00'],
|
||||
fontSize: 10,
|
||||
legend: {
|
||||
// 注意这里关闭了组件自带的图例
|
||||
show: true,
|
||||
position: "bottom",
|
||||
},
|
||||
extra: {
|
||||
radar: {
|
||||
border: true,
|
||||
gridCount: 5,
|
||||
max: 5
|
||||
},
|
||||
},
|
||||
},
|
||||
// 雷达图数据
|
||||
chartData: {},
|
||||
max: 0, //雷达图最大值
|
||||
resultLevelRemark: '', //10类型结果
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
let data = JSON.parse(decodeURIComponent(options.params))
|
||||
if (data.token) {
|
||||
this.userParameters.openId = data.openId //用户唯一标识
|
||||
this.userParameters.token = data.token //用户唯一标识
|
||||
}
|
||||
if (data.userParameters) {
|
||||
this.userParameters = JSON.parse(data.userParameters) //用户参数
|
||||
} else {
|
||||
this.userParameters.userId = data.userId //用户id
|
||||
}
|
||||
this.userProfile = data.headSculpture //头像
|
||||
this.userName = data.name //名称
|
||||
this.dictNo = data.dicCode //心理类型编号
|
||||
this.id = data.id
|
||||
if (data.reportId) {
|
||||
this.reportId = data.reportId //家庭成员页面进入 列表id
|
||||
this.dimensionCode = data.dimensionCode //维度因子编码
|
||||
}
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
async getInfo() {
|
||||
showLoading('加载中...')
|
||||
let that = this
|
||||
let ret = {}
|
||||
let reg = []
|
||||
if (that.reportId != null && that.reportId != '') {
|
||||
reg = await that.$API.assessmentResult({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
dicNo: that.dictNo,
|
||||
id: that.reportId
|
||||
}
|
||||
})
|
||||
} else {
|
||||
reg = await that.$API.queryResult({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
dicNo: that.dictNo,
|
||||
memberId: that.id
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询进度条以及进度条颜色对应的内容
|
||||
ret = await that.$API.queryResultByCode({
|
||||
data: {
|
||||
...that.userParameters,
|
||||
dictCode: that.dictNo
|
||||
}
|
||||
})
|
||||
if (that.dictNo != '07') {
|
||||
// 分数
|
||||
that.$set(that, 'fraction', reg.data.score)
|
||||
// 结论
|
||||
that.resultInfo = reg.data.resultInfo
|
||||
// 建议
|
||||
that.resultProposal = reg.data.resultProposal
|
||||
// 指导数据
|
||||
let jsarr = [];
|
||||
if (reg.data.directionInfo != '[{}]') {
|
||||
jsarr = JSON.parse(reg.data.directionInfo);
|
||||
}
|
||||
that.$set(that, 'location', reg.data.resultLevel)
|
||||
that.$set(that, 'directions', jsarr)
|
||||
if (that.dictNo != '15') {
|
||||
// 进度条对应内容
|
||||
that.progressName = ret.data
|
||||
} else {
|
||||
that.$set(that, 'resultLevelRemark', reg.data.resultLevelRemark) // 结果
|
||||
that.$set(that, 'myChartsData', JSON.parse(reg.data.dimensionInfo))
|
||||
}
|
||||
} else {
|
||||
// 进度条对应内容
|
||||
that.progressName = ret.data.gradeScales2
|
||||
that.progressSeven = ret.data.gradeScales1
|
||||
that.$set(that, 'aLocation', reg.data[0].resultLevel)
|
||||
that.$set(that, 'location', reg.data[1].resultLevel)
|
||||
// 分数
|
||||
that.$set(that, 'fraction', reg.data[0].score)
|
||||
that.progressSeven[0].bgColor = "#009DFF"
|
||||
that.progressSeven[1].bgColor = "#FDA92A"
|
||||
that.progressSeven[2].bgColor = "#F87C7C"
|
||||
// 结论
|
||||
that.resultInfo = reg.data[0].resultInfo
|
||||
that.resultSevenInfo = reg.data[1].resultInfo
|
||||
// 建议
|
||||
that.resultProposal = reg.data[0].resultProposal || reg.data[1].resultProposal
|
||||
let jsarr;
|
||||
if (reg.data[0].directionInfo != '[{}]') {
|
||||
jsarr = JSON.parse(reg.data[0].directionInfo);
|
||||
} else {
|
||||
jsarr = JSON.parse(reg.data[1].directionInfo);
|
||||
}
|
||||
that.$set(that, 'directions', jsarr)
|
||||
}
|
||||
hideLoading()
|
||||
that.$set(that, 'isLoading', true)
|
||||
// 雷达图我的得分数据
|
||||
if (that.dictNo === '06' || that.dictNo === '08' || that.dictNo === '10' || that.dictNo === '12' ||
|
||||
that.dictNo === '23') {
|
||||
that.$set(that, 'myChartsData', JSON.parse(reg.data.dimensionInfo))
|
||||
if (that.dictNo != '23') {
|
||||
that.getServerData(that.myChartsData);
|
||||
}
|
||||
if (that.dictNo == '08' || that.dictNo == '23') {
|
||||
return that.chartChange()
|
||||
}
|
||||
}
|
||||
},
|
||||
//综合评估报告 查询雷达因子的指导数据
|
||||
async chartChange() {
|
||||
let that = this
|
||||
var data = {}
|
||||
if (this.dimensionCode != null && this.dimensionCode != '') {
|
||||
data = {
|
||||
data: {
|
||||
dictCode: that.dictNo,
|
||||
dimensionCode: that.dimensionCode
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
data: {
|
||||
dictCode: that.dictNo
|
||||
}
|
||||
}
|
||||
}
|
||||
that.$API.queryDimensionFactors(data).then((res) => {
|
||||
// 雷达图因子
|
||||
that.symptom = res.data
|
||||
that.isLoading = true
|
||||
})
|
||||
},
|
||||
getServerData(myChartsData) {
|
||||
let that = this
|
||||
if (that.dictNo == '06') {
|
||||
let res = {
|
||||
categories: ['情绪衰竭', '玩世不恭', '成就感低落'],
|
||||
series: [{
|
||||
name: "我的得分",
|
||||
data: myChartsData,
|
||||
},
|
||||
{
|
||||
name: "参考值",
|
||||
data: [2, 2, 2],
|
||||
}
|
||||
]
|
||||
};
|
||||
this.chartData = JSON.parse(JSON.stringify(res));
|
||||
}
|
||||
if (that.dictNo == '08') {
|
||||
let res = {
|
||||
categories: ['躯体化', '强迫症状', '人际敏感', '忧郁', '焦虑', '敌对', '恐怖', '偏执', '精神病性', '其他'],
|
||||
series: [{
|
||||
name: "我的得分",
|
||||
data: myChartsData,
|
||||
},
|
||||
{
|
||||
name: "参考值",
|
||||
data: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
|
||||
}
|
||||
]
|
||||
};
|
||||
console.log(myChartsData, 'myChartsData')
|
||||
this.chartData = JSON.parse(JSON.stringify(res));
|
||||
}
|
||||
if (that.dictNo == '10') {
|
||||
this.max = Math.max.apply(null, myChartsData);
|
||||
let res = {
|
||||
categories: ['感觉能力', '交往能力', '运动能力', '语言能力', '自理能力'],
|
||||
series: [{
|
||||
name: "",
|
||||
data: myChartsData,
|
||||
}]
|
||||
};
|
||||
this.chartData = JSON.parse(JSON.stringify(res));
|
||||
}
|
||||
if (that.dictNo == '12') {
|
||||
this.max = Math.max.apply(null, myChartsData);
|
||||
let res = {
|
||||
categories: ['躯体化/惊恐', '广泛焦虑', '分离焦虑', '社交恐怖', '学校恐怖'],
|
||||
series: [{
|
||||
name: "",
|
||||
data: myChartsData,
|
||||
}]
|
||||
};
|
||||
this.chartData = JSON.parse(JSON.stringify(res));
|
||||
}
|
||||
},
|
||||
// 指导方法
|
||||
goHealthBook(id) {
|
||||
if (window.Android) {
|
||||
window.Android.goHealthBook(id)
|
||||
}
|
||||
if (window.webkit) {
|
||||
window.webkit.messageHandlers.goHealthBook.postMessage(id);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './result.scss';
|
||||
</style>
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="container">
|
||||
<view class="card">
|
||||
<view class="text-bold text-xl">戒烟数据</view>
|
||||
<view class="flex table text-bold marginTop">
|
||||
<view class="flex-sub text-center">类别</view>
|
||||
<view class="flex-sub text-center">当天</view>
|
||||
<view class="flex-sub text-center">本次累计</view>
|
||||
</view>
|
||||
<block v-for="(item1,index1) in List" :key="index1">
|
||||
<view class="tableList flex text-df">
|
||||
<!-- 类别 -->
|
||||
<view class="line flex-sub text-center">{{item1.type}}</view>
|
||||
<!-- 当天 -->
|
||||
<view class="line flex-sub text-center">
|
||||
{{item1.thisDay}}
|
||||
</view>
|
||||
<!-- 本次累计 -->
|
||||
<view class="line flex-sub text-center">{{item1.thisTime}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
List: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$SMOKE.smokingCessationData().then(res => {
|
||||
this.List = res.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
padding: 32rpx;
|
||||
color: #3F4040;
|
||||
|
||||
.card {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.table {
|
||||
background: #EBF7F8;
|
||||
padding: 20rpx 0;
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.tableList {
|
||||
.line {
|
||||
border-bottom: 2rpx solid #EEEEEE;
|
||||
padding: 20rpx 0;
|
||||
color: #17191A;
|
||||
|
||||
&:first-child {
|
||||
border-left: 2rpx solid #E6EFF1;
|
||||
border-right: 2rpx solid #E6EFF1;
|
||||
}
|
||||
|
||||
&:nth-last-child(1) {
|
||||
border-left: 2rpx solid #E6EFF1;
|
||||
border-right: 2rpx solid #E6EFF1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,110 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="contioner">
|
||||
<input placeholder="请输入标题" class="inputClass" maxlength="15" placeholder-style="color:#CDCDCD"
|
||||
v-model="title" />
|
||||
<textarea placeholder="写下你此刻的想法吧" class="marginTop color textClass" maxlength="600"
|
||||
placeholder-style="color:#CDCDCD" v-model="content" :adjust-position="false" />
|
||||
</view>
|
||||
<view class="placeholder"></view>
|
||||
<view class="btnList">
|
||||
<view class="btn" @tap="submit">确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '', //标题
|
||||
content: '', //想法
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
if (this.title == '' || this.content == '') return toast('请先填写')
|
||||
if (this.$preventClick()) return
|
||||
this.$SMOKE.smokingDiaryAdd({
|
||||
data: {
|
||||
title: this.title,
|
||||
content: this.content
|
||||
}
|
||||
}).then(res => {
|
||||
toast('保存成功')
|
||||
if (res.code == 200) {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.contioner {
|
||||
padding: 48rpx 32rpx;
|
||||
|
||||
.inputClass {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-bottom: 1rpx solid #EEE;
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.textClass {
|
||||
width: 100%;
|
||||
height: 800rpx;
|
||||
}
|
||||
|
||||
.color {
|
||||
color: #3F4040;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
height: 100rpx;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/* 兼容 iOS < 11.2 */
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/* 兼容 iOS >= 11.2 */
|
||||
}
|
||||
|
||||
.btnList {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100vw;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 110rpx;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/* 兼容 iOS < 11.2 */
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
|
||||
/* 兼容 iOS >= 11.2 */
|
||||
.btn {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
background-color: $uni-color;
|
||||
border-radius: 40rpx;
|
||||
flex: 1;
|
||||
margin: 0 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,127 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="contioner">
|
||||
<block v-for="(item,index) in List" :key="index">
|
||||
<view class="card" v-if="index==0">
|
||||
<view class="flex-contion" @tap="goResult(item.smokingReportId)">
|
||||
<image :src="item.smokingReportLevel=='轻度依赖'?'https://shayu5qny.yhy.ren/quitSmoking/qing.png':
|
||||
item.smokingReportLevel=='中度依赖'?'https://shayu5qny.yhy.ren/quitSmoking/zho.png':
|
||||
'https://shayu5qny.yhy.ren/quitSmoking/zhong.png'" class="leftImg"></image>
|
||||
<view class="flex-sub">
|
||||
<view class="flex-align">
|
||||
<view>{{item.smokingReportLevel}}</view>
|
||||
<view class="text-sm">
|
||||
<text
|
||||
:class="['title marginRight-xs',item.smokingReportScore<=3?'oneColor':item.smokingReportScore<=6?'twoColor':'threeColor']">{{item.smokingReportScore}}</text>分
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-sm greyColor">戒烟什么时候都不晚,越早戒烟越好</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-align margintop-four" @tap="goAssuss">
|
||||
<view class="text-df greyColor">距离上次评测{{num}}天</view>
|
||||
<view class="themColor flex-contion">重新评估<uni-icons type="right" color="#3AAFB8" size="20">
|
||||
</uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card flex-align marginTop" @tap="goResult(item.smokingReportId)" v-else>
|
||||
<view>
|
||||
<view class="text-bold">评估记录</view>
|
||||
<view class="text-sm greyColor margin-top-xs">{{item.qtime}}</view>
|
||||
</view>
|
||||
<view class="text-sm">
|
||||
<text
|
||||
:class="['title marginRight-xs',item.smokingReportScore<=3?'oneColor':item.smokingReportScore<=6?'twoColor':'threeColor']">{{item.smokingReportScore}}</text>分
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
formatTime
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
num: '', //天数
|
||||
List: [],
|
||||
date: formatTime(new Date()), //当前日期时间
|
||||
}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
console.log(this.date)
|
||||
this.$SMOKE.smokingReportList().then((res) => {
|
||||
this.List = res.rows
|
||||
let diffDate
|
||||
let myDate_1 = Date.parse(this.date)
|
||||
let myDate_2 = Date.parse(res.rows[0].qtime)
|
||||
diffDate = Math.abs(myDate_1 - myDate_2)
|
||||
this.num = Math.floor(diffDate / (1000 * 3600 * 24))
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 跳转评估问卷页面
|
||||
goAssuss() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/question/question'
|
||||
})
|
||||
},
|
||||
// 跳转评估结果页
|
||||
goResult(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/result/result?id=' + id
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.contioner {
|
||||
padding: 40rpx 32rpx;
|
||||
|
||||
.card {
|
||||
padding: 32rpx 24rpx;
|
||||
background: #FFF;
|
||||
border-radius: 20rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.themColor {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.greyColor {
|
||||
color: #909292;
|
||||
}
|
||||
|
||||
.leftImg {
|
||||
width: 130rpx;
|
||||
height: 130rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.oneColor {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.twoColor {
|
||||
color: #FF901C;
|
||||
}
|
||||
|
||||
.threeColor {
|
||||
color: #FF4545;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,154 @@
|
|||
.pageBox{
|
||||
color: #3F4040;
|
||||
.color{
|
||||
color: #3F4040;
|
||||
}
|
||||
.fontColor{
|
||||
color: #17191A;
|
||||
}
|
||||
.greyColor{
|
||||
color: #909292;
|
||||
}
|
||||
.themColor{
|
||||
color: $uni-color;
|
||||
}
|
||||
.fixedBg{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 728rpx;
|
||||
}
|
||||
.contioner{
|
||||
padding: 68rpx 32rpx 40rpx;
|
||||
.fourSize{
|
||||
font-size: 44rpx;
|
||||
}
|
||||
.btnWidth{
|
||||
padding: 6rpx 12rpx;
|
||||
margin-left: 20rpx;
|
||||
font-size: 20rpx;
|
||||
color: #FFF;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
.oneBg{
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
}
|
||||
.twoBg{
|
||||
background: linear-gradient(270deg, #FDC674 0%, #FF9A02 100%);
|
||||
}
|
||||
.threeBg{
|
||||
background: linear-gradient(270deg, #FDAA74 0%, #FF3F02 100%);
|
||||
}
|
||||
.lookBtn{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -32rpx;
|
||||
width: 192rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 40rpx 0 0 40rpx;
|
||||
background: #FFF;
|
||||
font-size: 26rpx;
|
||||
image{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
}
|
||||
.backgroundPlate{
|
||||
position: relative;
|
||||
padding: 32rpx 24rpx 24rpx;
|
||||
margin-top: 32rpx;
|
||||
border-radius: 20rpx;
|
||||
background: linear-gradient(to right, #36AAB1, #6ACBD1);
|
||||
.leftTitle{
|
||||
color: #FFF;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.sixFour{
|
||||
font-size: 64rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.eightPadding{
|
||||
padding: 0 8rpx;
|
||||
}
|
||||
.rightBtn{
|
||||
padding: 26rpx 40rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 24rpx;
|
||||
background: rgba(255, 255, 255, 0.60);
|
||||
.playImg{
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-left: 8rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
}
|
||||
.bgCard{
|
||||
padding: 32rpx 26rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #DEF3F4;
|
||||
margin-top: 24rpx;
|
||||
.marginLeft-four{
|
||||
margin-left: 10rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.tagCut{
|
||||
width: 1rpx;
|
||||
height: 80rpx;
|
||||
background: #CCE0E1;
|
||||
}
|
||||
.love{
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
}
|
||||
.branch{
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
.first{
|
||||
width: 48rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
.diot{
|
||||
width: 30rpx;
|
||||
height: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.card{
|
||||
padding: 32rpx 24rpx 52rpx;
|
||||
border-radius: 32rpx;
|
||||
background: #FFF;
|
||||
.rightImg{
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
.greyCut{
|
||||
width: 1rpx;
|
||||
height: 80rpx;
|
||||
background: #EEE;
|
||||
}
|
||||
.ellipses{
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
}
|
||||
.marginPadding{
|
||||
margin:0 38rpx 0 50rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.img{
|
||||
width: 196rpx;
|
||||
height: 216rpx;
|
||||
}
|
||||
.title{
|
||||
position: absolute;
|
||||
top: 24rpx;
|
||||
left: 14rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,323 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/indexBg.png" class="fixedBg"></image>
|
||||
<view class="contioner bg-video">
|
||||
<view class="bg-video">
|
||||
<view class="fontColor fourSize text-bold flex-contion">
|
||||
尼古丁依赖指数
|
||||
<view v-if="dataInfo.degreeOfDependence!=''"
|
||||
:class="['btnWidth',dataInfo.degreeOfDependence=='轻度依赖'?'oneBg':dataInfo.degreeOfDependence=='中度依赖'?'twoBg':'threeBg']">
|
||||
{{dataInfo.degreeOfDependence=='轻度依赖'?'轻度':dataInfo.degreeOfDependence=='中度依赖'?'中度':'重度'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-sm greyColor margin-top-xs" v-if="dataInfo.degreeOfDependence==''">
|
||||
想知道自己的尼古丁依赖程度吗?
|
||||
</view>
|
||||
<view class="lookBtn flex-conter" @tap="goAssuss">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/lookDetail.png"></image>
|
||||
<text v-if="dataInfo.timer">{{dataInfo.degreeOfDependence==''?'开始评估':'查看详情'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="backgroundPlate">
|
||||
<view class="flex-align">
|
||||
<view class="leftTitle">
|
||||
<view class="twoSize">戒烟第 <text class="text-xl eightPadding">{{dataInfo.quitSmokingDay}}</text>
|
||||
天</view>
|
||||
<view class="sixFour">{{dataInfo.timer}}</view>
|
||||
</view>
|
||||
<view class="rightBtn" @tap="start">
|
||||
{{dataInfo.exist==1?"重置戒烟":"开始戒烟"}}
|
||||
<image
|
||||
:src="dataInfo.exist==0?'https://shayu5qny.yhy.ren/quitSmoking/playBtn.png':'https://shayu5qny.yhy.ren/quitSmoking/resets.png'"
|
||||
class="playImg"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bgCard">
|
||||
<view class="flex-align" @tap="goDetail">
|
||||
<view class="text-center flex-grow">
|
||||
<view class="flex-conter flex-wrap">
|
||||
<!-- 寿命 时间 -->
|
||||
<view class="text-bold fourSize">{{dataInfo.lifetime}}</view>
|
||||
<view class="text-xs greyColor marginLeft-four">小时</view>
|
||||
</view>
|
||||
<view class="flex-conter">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/love.png" class="love"></image>
|
||||
<text class="text-xs greyColor marginLeft-xs">寿命</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tagCut"></view>
|
||||
<view class="text-center flex-grow">
|
||||
<view class="flex-conter flex-wrap">
|
||||
<!-- 少吸 支 -->
|
||||
<view class="text-bold fourSize">{{dataInfo.smokeLess}}</view>
|
||||
<view class="text-xs greyColor marginLeft-four">支</view>
|
||||
</view>
|
||||
<view class="flex-conter">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/branch.png" class="branch"></image>
|
||||
<text class="text-xs greyColor marginLeft-xs">少吸</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tagCut"></view>
|
||||
<view class="text-center flex-grow">
|
||||
<view class="flex-conter flex-wrap">
|
||||
<!-- 省钱 元 -->
|
||||
<view class="text-bold fourSize">{{dataInfo.saveMoney}}</view>
|
||||
<view class="text-xs greyColor marginLeft-four">元</view>
|
||||
</view>
|
||||
<view class="flex-conter">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/first.png" class="first"></image>
|
||||
<text class="text-xs greyColor marginLeft-xs">省钱</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评分 -->
|
||||
<view class="flex-align marginTop-lg" @tap="goRecove">
|
||||
<view class="text-sm">健康恢复评分:<text class="themColor text-xl text-bold">{{dataInfo.score}}</text>
|
||||
</view>
|
||||
<view class="text-sm text-bold">· · ·</view>
|
||||
</view>
|
||||
<cmd-progress :percent="dataInfo.percentage" :showInfo="false"
|
||||
stroke-color="linear-gradient(to right, #36AAB1, #6ACBD1)">
|
||||
</cmd-progress>
|
||||
<view class="text-xs greyColor margin-top-xs">生理烟瘾基本消除:{{dataInfo.percentage}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card marginTop">
|
||||
<view class="flex-align">
|
||||
<view class="text-bold text-df">烟瘾记录</view>
|
||||
<view class="text-sm greyColor flex-contion" @tap="goMore">
|
||||
查看更多<image src="https://shayu5qny.yhy.ren/quitSmoking/right.png" class="rightImg"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-align marginPadding">
|
||||
<view class="greyColor text-xs text-center">
|
||||
<view><text class="fourSize color text-bold">{{dataInfo.tobacco}}</text>次</view>
|
||||
<view>今日烟瘾</view>
|
||||
</view>
|
||||
<view class="greyCut"></view>
|
||||
<view class="greyColor text-xs text-center">
|
||||
<view><text class="fourSize color text-bold">{{dataInfo.addUp}}</text>次</view>
|
||||
<view>累计次数</view>
|
||||
</view>
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/addiction.png" class="ellipses marginLeft-lg"
|
||||
@tap="tobacco" style="transform: scale(0.9);"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card marginTop">
|
||||
<view>戒烟活动</view>
|
||||
<view class="flex-align margintop-four">
|
||||
<view class="bg-video" @tap="goPage(0)">
|
||||
<view class="title">
|
||||
<view class="text-sm fontColor text-bold">戒烟秘籍</view>
|
||||
<view class="text-xs">带你轻松戒烟</view>
|
||||
</view>
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/cessation.png" class="img"></image>
|
||||
</view>
|
||||
<view class="bg-video" @tap="goPage(1)">
|
||||
<view class="title">
|
||||
<view class="text-sm fontColor text-bold">戒烟日记</view>
|
||||
<view class="text-xs">记录戒烟时光</view>
|
||||
</view>
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/diary.png" class="img"></image>
|
||||
</view>
|
||||
<view class="bg-video" @tap="goPage(2)">
|
||||
<view class="title">
|
||||
<view class="text-sm fontColor text-bold">时光穿梭</view>
|
||||
<view class="text-xs">享受健康生活</view>
|
||||
</view>
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/shuttle.png" class="img"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataInfo: {},
|
||||
timer: null,
|
||||
birth: '', //出生日期
|
||||
age: '', //年龄
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.birth = options.birth //出生日期
|
||||
this.age = options.age //年龄
|
||||
uni.setStorageSync('userId', options.userId)
|
||||
uni.setStorageSync('openId', options.openId)
|
||||
},
|
||||
onShow() {
|
||||
this.getDataInfo()
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
// 获取数据
|
||||
getDataInfo() {
|
||||
showLoading('加载中...')
|
||||
this.$SMOKE.userSmokingHome().then(res => {
|
||||
this.dataInfo = res.data
|
||||
hideLoading()
|
||||
if (res.data.timer == '00:00:00') return
|
||||
let a = []
|
||||
a = res.data.timer.split(':')
|
||||
this.startTimer(a)
|
||||
})
|
||||
},
|
||||
// 计时
|
||||
startTimer(a) {
|
||||
let seconds = parseInt(a[2]);
|
||||
let minutes = parseInt(a[1]);
|
||||
let hours = parseInt(a[0]);
|
||||
this.timer = setInterval(() => {
|
||||
seconds++;
|
||||
if (seconds === 60) {
|
||||
seconds = 0;
|
||||
minutes++;
|
||||
if (minutes === 60) {
|
||||
minutes = 0;
|
||||
hours++;
|
||||
}
|
||||
}
|
||||
let timeString = (hours < 10 ? '0' + hours : hours) + ':' + (minutes < 10 ? '0' + minutes :
|
||||
minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
|
||||
// 等于24时则归0
|
||||
if (hours == 24) {
|
||||
seconds = 0
|
||||
minutes = 0
|
||||
hours = 0
|
||||
timeString = '00:00:00'
|
||||
this.dataInfo.quitSmokingDay = this.dataInfo.quitSmokingDay + 1
|
||||
}
|
||||
this.dataInfo.timer = timeString
|
||||
}, 1000);
|
||||
},
|
||||
//烟瘾来袭按钮
|
||||
tobacco() {
|
||||
this.$SMOKE.smokingCravingAdd().then(res => {
|
||||
this.dataInfo.tobacco++
|
||||
this.dataInfo.addUp++
|
||||
})
|
||||
},
|
||||
//开始或重置戒烟
|
||||
start() {
|
||||
let that = this
|
||||
//重置
|
||||
if (this.dataInfo.exist) {
|
||||
uni.showModal({
|
||||
title: '',
|
||||
content: '请坚持下去,每一次的尝试都是一次积累,你会越来越接近成功。',
|
||||
cancelText: '点错了',
|
||||
confirmText: '复吸了',
|
||||
confirmColor: '#3AAFB8',
|
||||
success(ret) {
|
||||
if (ret.confirm) {
|
||||
console.log('用户点击复吸了');
|
||||
clearInterval(that.timer)
|
||||
that.$SMOKE.userSmokingReset().then(res => {
|
||||
console.log("重置戒烟", res)
|
||||
that.dataInfo = {
|
||||
exist: 0, //0不存在戒烟 1存在戒烟
|
||||
quitSmokingDay: 0, //戒烟天数
|
||||
timer: '00:00:00',
|
||||
lifetime: 0, //小时
|
||||
smokeLess: 0, //支
|
||||
saveMoney: 0, //元
|
||||
score: 0, //评分
|
||||
percentage: 0, //百分比
|
||||
tobacco: that.dataInfo.tobacco,
|
||||
addUp: that.dataInfo.addUp
|
||||
}
|
||||
})
|
||||
} else if (ret.cancel) {
|
||||
console.log('用户点击点错了');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
//跳转填写表单
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/smokingSituation/smokingSituation?birth=' + this.birth + '&age=' +
|
||||
this.age
|
||||
})
|
||||
}
|
||||
},
|
||||
// 跳转
|
||||
goPage(index) {
|
||||
if (index == 0) {
|
||||
this.$SMOKE.getUserFirstInto({
|
||||
data: {
|
||||
routeUrl: '/pages/quitSmoking/smokingTips/smokingTips'
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.data) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/scriptsList/scriptsList'
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/smokingTips/smokingTips'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (index == 1) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/smokingDiary/smokingDiary'
|
||||
})
|
||||
} else {
|
||||
if (this.dataInfo.exist == 0) return toast('请先点击开始戒烟')
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/timeTravel/timeTravel'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 跳转健康恢复评分页面
|
||||
goRecove() {
|
||||
if (this.dataInfo.exist == 0) return toast('请先点击开始戒烟')
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/recoveryScore/recoveryScore'
|
||||
})
|
||||
},
|
||||
goAssuss() {
|
||||
// 跳转评估问卷页面
|
||||
if (this.dataInfo.degreeOfDependence == '') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/question/question'
|
||||
})
|
||||
} else {
|
||||
// 跳转评估记录页面
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/evaluationRecord/evaluationRecord'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 跳转烟瘾数据统计页面
|
||||
goMore() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/statistics/statistics'
|
||||
})
|
||||
},
|
||||
// 跳转我的戒烟数据页面
|
||||
goDetail() {
|
||||
if (this.dataInfo.exist == 0) return toast('请先点击开始戒烟')
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/cessationData/cessationData'
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./index.scss"
|
||||
</style>
|
|
@ -0,0 +1,267 @@
|
|||
page{
|
||||
background: #F3F4F6;
|
||||
}
|
||||
.pageBox{
|
||||
.themColor{
|
||||
color: #3AAFB8;
|
||||
}
|
||||
$uni-color:#3AAFB8;
|
||||
.color{
|
||||
color: #17191A;
|
||||
}
|
||||
.topPostionBg{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100vw;
|
||||
height: 528rpx;
|
||||
background: linear-gradient(155deg, #E4F5EB 0%, rgba(228,245,235,0) 100%);
|
||||
}
|
||||
.staging{
|
||||
width: 470rpx;
|
||||
height: calc(580rpx - 42rpx);
|
||||
border-radius: 48rpx;
|
||||
background: #FFF;
|
||||
padding: 22rpx 32rpx 20rpx;
|
||||
.bg{
|
||||
width: 100%;
|
||||
height: 224rpx;
|
||||
background: linear-gradient(180deg, #D8FCFF 0%, #FFF 100%);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-radius: 48rpx 48rpx 0 0;
|
||||
}
|
||||
.stagingBackground{
|
||||
width: 268rpx;
|
||||
height: 166rpx;
|
||||
}
|
||||
.threeSix{
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
.oneTwo{
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
.stagBtn{
|
||||
width: calc(406rpx - 278rpx);
|
||||
padding: 10rpx 138rpx 10rpx 140rpx;
|
||||
border-radius: 50rpx;
|
||||
border: 2rpx solid $uni-color;
|
||||
background: $uni-color;
|
||||
margin: 0 auto;
|
||||
color: #FFF;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
.colorGrey{
|
||||
color: #909292;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
}
|
||||
.contioner{
|
||||
padding: 32rpx;
|
||||
.backBottom{
|
||||
position: fixed;
|
||||
bottom: 10vh;
|
||||
right: 34rpx;
|
||||
padding: 12rpx 32rpx;
|
||||
border-radius: 50rpx;
|
||||
background: #FFF;
|
||||
box-shadow: 0 8rpx 8rpx 0 rgba(4, 70, 74, 0.14);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:24rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
.topCard{
|
||||
padding: 12rpx;
|
||||
margin-top: 48rpx;
|
||||
border-radius: 32rpx;
|
||||
background: #FFFFFF;
|
||||
.headSculpture{
|
||||
$wh:112rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
background: #F3F4F6;
|
||||
border-radius: 50%;
|
||||
border: 6rpx solid #FFFFFF;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
top: -52rpx;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:100rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.border{
|
||||
border: 1rpx dotted #3AAFB8;
|
||||
border-radius: 20rpx;
|
||||
.cut{
|
||||
display: inline-block;
|
||||
width: 4rpx;
|
||||
height: 20rpx;
|
||||
margin: 0 12rpx;
|
||||
background: $uni-color;
|
||||
}
|
||||
.top{
|
||||
margin-top: 72rpx;
|
||||
color: $uni-color;
|
||||
}
|
||||
.tag{
|
||||
padding: 0 20rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 4rpx;
|
||||
background: #F3F4F6;
|
||||
color: #909292;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.avare {
|
||||
$wh: 80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.introduce {
|
||||
padding: 20rpx;
|
||||
width: calc(502rpx - 40rpx);
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 0rpx 0rpx;
|
||||
}
|
||||
|
||||
.evaluation {
|
||||
width: calc(502rpx - 40rpx);
|
||||
padding: 20rpx;
|
||||
margin-top: 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
||||
.greyTag{
|
||||
padding: 18rpx 40rpx;
|
||||
background: #F8F8F8;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 20rpx;
|
||||
.tegWidth{
|
||||
width: 2rpx;
|
||||
height: 24rpx;
|
||||
background: #CCCCCC;
|
||||
margin: 0 24rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.shawDown{
|
||||
background: #EFF9F8;
|
||||
}
|
||||
.cut{
|
||||
margin-top: 32rpx;
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #eee;
|
||||
}
|
||||
.fenge{
|
||||
width: 2rpx;
|
||||
height: 80rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: #eee;
|
||||
}
|
||||
}
|
||||
.rightLayOut{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 32rpx;
|
||||
.leftTag{
|
||||
padding: 20rpx 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 16rpx 0rpx 16rpx 16rpx;
|
||||
color: #FFFFFF;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.rightAvter{
|
||||
$wh:80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.bottomBtn{
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
width: calc(100% - 64rpx);
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.centerScoll{
|
||||
width: 100%;
|
||||
height: calc(87vh - 184rpx);
|
||||
}
|
||||
|
||||
.black {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.blackColor {
|
||||
color: #8E9AAB;
|
||||
}
|
||||
|
||||
.fontColor {
|
||||
color: #112950;
|
||||
}
|
||||
|
||||
.singCard {
|
||||
padding: 40rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
border: 2rpx solid #DCDEE0;
|
||||
font-size: 28rpx;
|
||||
color: #112950;
|
||||
|
||||
image {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cardShadow {
|
||||
color: #3AAFB8;
|
||||
box-shadow: inset 0px 0px 12px 0px rgba(58, 175, 184, 0.8000);
|
||||
}
|
||||
.btnPostion{
|
||||
background: #E6EFF1;
|
||||
.next {
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
background: #3AAFB8;
|
||||
border-radius: 42rpx;
|
||||
margin-bottom: 48rpx;
|
||||
}
|
||||
|
||||
.temporary {
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
border-radius: 42rpx;
|
||||
border: 2rpx solid #DCDEE0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,237 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="isShow" @touchmove.stop="">
|
||||
<view class="topPostionBg"></view>
|
||||
<view class="contioner">
|
||||
<view class="topCard bg-video">
|
||||
<view class="headSculpture">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png"></image>
|
||||
</view>
|
||||
<view class="border text-center bg-video">
|
||||
<view class="top text-df text-bold">
|
||||
<text class="color">鲨鱼宝宝</text>
|
||||
<text class="cut"></text>
|
||||
<text>专属评估客服</text>
|
||||
</view>
|
||||
<view class="flex-conter margin-top-xs marginBottom">
|
||||
<view class="tag marginRight-xs">{{(cardRadio.length*15/60).toFixed(0)}}分钟</view>
|
||||
<view class="tag marginRight-xs">{{cardRadio.length}}题</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y :style="{'height':srcollHeight}" :scroll-top="scrollView" @scroll="scroll"
|
||||
scroll-with-animation>
|
||||
<view class="next" style="padding-top: 32rpx;"></view>
|
||||
<block v-for="(item,index) in cardRadio" :key="index">
|
||||
<view v-show="item.select">
|
||||
<!-- 单选样式 -->
|
||||
<view class="flex bg-video" style="margin-top: 32rpx;"
|
||||
v-if="item.id==1||item.id==3||item.id==4">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="color">
|
||||
<view class="introduce text-df">{{index + 1 }}: {{item.title}}</view>
|
||||
<view class="evaluation">
|
||||
<view class="text-df">单选</view>
|
||||
<block v-for="(item1,index1) in item.sonquestion" :key="index1">
|
||||
<view :class="['greyTag',item1.select?'shawDown':'']"
|
||||
@tap="selectChange(index,index1,item,item1)">
|
||||
<text class="text-bold">{{item1.level}}</text>
|
||||
<text class="tegWidth"></text>
|
||||
<text style="color: #3F4040;">{{item1.topic}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 单选 是否选项展示样式 -->
|
||||
<view class="flex bg-video" style="margin-top: 32rpx;" v-else>
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="evaluation fontColor">
|
||||
<view class="text-df">{{index + 1 }}:{{item.title}}</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex bg-video" style="height: 60rpx;">
|
||||
<block v-for="(item1,index1) in item.sonquestion" :key="index1">
|
||||
<view :class="['flex-sub text-center',item1.select?'themColor':'']"
|
||||
@tap="selectChange(index,index1,item,item1)">
|
||||
<text style="line-height: 80rpx;">{{item1.topic}}</text>
|
||||
</view>
|
||||
</block>
|
||||
<view class="fenge"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-end" :class="['quest'+index]" v-if="item.defaultValue!=null">
|
||||
<view class="rightLayOut">
|
||||
<view class="leftTag flex-sub">{{item.defaultValue}}</view>
|
||||
<image :src="userProfile" class="rightAvter"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view style="width: 100%;height: 100rpx;"></view>
|
||||
</scroll-view>
|
||||
<view class="bottomBtn" @tap="submit" v-if="isNext">生成评估报告</view>
|
||||
<!-- 返回底部 -->
|
||||
<view class="backBottom" @tap="goBottom" v-show="scrollGun<600&&isBottom">
|
||||
<image src="https://shayu5qny.yhy.ren/Frame.png"></image>
|
||||
<view class="text-sm themColor">返回底部</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false, //等待页面数据渲染完成
|
||||
isBottom: false, //是否显示返回底部按钮
|
||||
isNext: false,
|
||||
userProfile: '', //用户头像
|
||||
cardRadio: [], // 题目集合
|
||||
subject: [], //分数
|
||||
srcollHeight: "", //题目的高度
|
||||
scrollView: 0, //题目距离顶部的位置
|
||||
scrollGun: 0, //屏幕滚动的高度
|
||||
fixedHeight: 100000, //固定底部高度
|
||||
questionFive: null, //第五题
|
||||
}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
//获取元素高度
|
||||
Height() {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".next").boundingClientRect((data) => {
|
||||
// 得到高度
|
||||
this.srcollHeight = uni.getSystemInfoSync().windowHeight - data.top - 18 + "px";
|
||||
}).exec();
|
||||
},
|
||||
//点击获取下一题的距离
|
||||
questClass(index) {
|
||||
setTimeout(() => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".quest" + index).boundingClientRect((data) => {
|
||||
this.scrollView = parseInt(this.scrollGun + data.top - 82)
|
||||
}).exec();
|
||||
if (index > 3) {
|
||||
this.isBottom = true
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
scroll(e) {
|
||||
this.scrollGun = e.target.scrollTop
|
||||
},
|
||||
// 滚动到页面底部
|
||||
goBottom() {
|
||||
let num = this.fixedHeight++
|
||||
this.scrollView = num
|
||||
},
|
||||
// 获取问卷信息
|
||||
async getInfo() {
|
||||
showLoading('加载中...')
|
||||
let ret = await this.$SMOKE.questionSmokingList()
|
||||
this.userProfile = ret.data.avatar
|
||||
this.cardRadio = ret.data.list //获取总题目
|
||||
this.questionFive = this.cardRadio[4]
|
||||
this.cardRadio[0].select = true
|
||||
this.isShow = true
|
||||
// 获取题目列表高度
|
||||
setTimeout(() => {
|
||||
this.Height()
|
||||
}, 100)
|
||||
hideLoading()
|
||||
},
|
||||
// 提交保存
|
||||
submit() {
|
||||
if (this.$preventClick()) return
|
||||
if (this.cardRadio.length == 6) {
|
||||
let a = []
|
||||
this.cardRadio[4].sonquestion.map(item => {
|
||||
if (item.select) {
|
||||
a.push(item.select)
|
||||
}
|
||||
})
|
||||
if (a.length == 0) {
|
||||
return toast('请先回答第五题')
|
||||
}
|
||||
}
|
||||
let that = this;
|
||||
that.cardRadio.map((item, index) => {
|
||||
item.sonquestion.map((item1) => {
|
||||
if (item1.select) {
|
||||
that.subject.push(item1.score) // 获取每道题目的分数
|
||||
}
|
||||
})
|
||||
})
|
||||
let answers5 = 0
|
||||
let answers6 = ''
|
||||
if (this.cardRadio.length == 6) {
|
||||
answers5 = that.subject[4]
|
||||
answers6 = that.subject[5]
|
||||
} else {
|
||||
answers5 = 0
|
||||
answers6 = that.subject[4]
|
||||
}
|
||||
showLoading('提交中...')
|
||||
that.$SMOKE.smokingReportAdd({
|
||||
data: {
|
||||
answers1: that.subject[0], //第一题分数
|
||||
answers2: that.subject[1], //第二题分数
|
||||
answers3: that.subject[2], //第三题分数
|
||||
answers4: that.subject[3], //第四题分数
|
||||
answers5: answers5, //第五题分数
|
||||
answers6: answers6, //第六题分数
|
||||
user_code: uni.getStorageSync('userId'), //用户id
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
hideLoading()
|
||||
uni.redirectTo({
|
||||
url: '/pages/quitSmoking/result/result?id=' + res.data.smokingReportId
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择问卷题目
|
||||
selectChange(index, index1, item, item1) {
|
||||
let that = this
|
||||
for (var i = 0; i < this.cardRadio[index].sonquestion.length; i++) {
|
||||
// 判断卡片选中哪一项
|
||||
if (i == index1) {
|
||||
this.$set(this.cardRadio[index].sonquestion[i], 'select', true)
|
||||
} else {
|
||||
this.$set(this.cardRadio[index].sonquestion[i], 'select', false)
|
||||
}
|
||||
}
|
||||
if (index == 0) {
|
||||
if (this.cardRadio[0].sonquestion[3].select) {
|
||||
this.cardRadio.splice(4, 1)
|
||||
} else {
|
||||
if (this.cardRadio.length != 6) {
|
||||
this.cardRadio.splice(4, 0, this.questionFive)
|
||||
this.cardRadio[4].select = true
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$set(this.cardRadio[index], 'defaultValue', item1.level + '.' + item1.topic)
|
||||
that.questClass(index)
|
||||
if (that.cardRadio.length - 1 != index) {
|
||||
that.cardRadio[index + 1].select = true
|
||||
} else {
|
||||
return that.isNext = true
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './question.scss';
|
||||
</style>
|
|
@ -0,0 +1,146 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<image src="../static/images/fixedBg.png" class="fixedBg"></image>
|
||||
<view class="contioner bg-video">
|
||||
<view class="flex-align">
|
||||
<view>
|
||||
<view class="flex-contion">
|
||||
<image :src="formData.img" class="avare marginRight"></image>
|
||||
<view class="text-bold whiteColor">{{formData.name}}</view>
|
||||
</view>
|
||||
<view class="margin-top-xs whiteRgb">欢迎查看您的健康恢复评分</view>
|
||||
</view>
|
||||
<view class="whiteColor"><text class="eightSize">{{formData.score}}</text>分</view>
|
||||
</view>
|
||||
<view class="card marginTop">
|
||||
<view class="text-bold text-lg">恢复评分详情</view>
|
||||
<view class="flex-align marginTop">
|
||||
<view class="greyBg text-center">
|
||||
<view class="bg-video text-center">
|
||||
<cmd-progress type="circle" :percent="formData.physiology" :width="60" :stroke-width="10"
|
||||
stroke-color="#3BDEB9" :showInfo="false"></cmd-progress>
|
||||
<view class="titlePoastion">
|
||||
<view class="text-sm">{{formData.physiology}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-xs">生理烟瘾基本消除</view>
|
||||
</view>
|
||||
<view class="greyBg text-center">
|
||||
<view class="bg-video text-center">
|
||||
<cmd-progress type="circle" :percent="formData.psychology" :width="60" :stroke-width="10"
|
||||
stroke-color="#2780FE" :showInfo="false"></cmd-progress>
|
||||
<view class="titlePoastion">
|
||||
<view class="text-sm">{{formData.psychology}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-xs">心理烟瘾基本消除</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view style="width: 100%;height: 30rpx;"></view> -->
|
||||
<block v-for="(item,index) in formData.scoreLists" :key="index">
|
||||
<view class="flex-align text-two marginTop-lg">
|
||||
<view>{{item.name}}</view>
|
||||
<view class="greyColor">{{item.value}}%</view>
|
||||
</view>
|
||||
<cmd-progress :percent="item.value" stroke-color="#3AAFB8" :show-info="false"></cmd-progress>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {},
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.time) {
|
||||
this.$SMOKE.healthRecoveryScore({
|
||||
data: {
|
||||
time: option.time
|
||||
},
|
||||
}).then(res => {
|
||||
this.formData = res.data
|
||||
})
|
||||
} else {
|
||||
this.$SMOKE.healthRecoveryScore().then(res => {
|
||||
this.formData = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .cmd-progress-inner{
|
||||
display: block;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.fixedBg {
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
height: 504rpx;
|
||||
}
|
||||
|
||||
.contioner {
|
||||
padding: 32rpx;
|
||||
color: #17191A;
|
||||
|
||||
.whiteColor {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.eightSize {
|
||||
font-size: 80rpx;
|
||||
}
|
||||
|
||||
.whiteRgb {
|
||||
color: rgba(255, 255, 255, 0.60);
|
||||
}
|
||||
|
||||
.fontColor {
|
||||
color: #3F4040;
|
||||
}
|
||||
|
||||
.avare {
|
||||
$wh: 64rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 32rpx 24rpx;
|
||||
background: #FFF;
|
||||
border-radius: 20rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.greyBg {
|
||||
padding: 22rpx 0 24rpx 0;
|
||||
width: 306rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #F8F8F8;
|
||||
.titlePoastion{
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.text-two {
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.greyColor {
|
||||
color: #909292;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,188 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/resultTop.png" class="resultTop"></image>
|
||||
<view class="contioner bg-video">
|
||||
<view class="card">
|
||||
<view class="text-bold">尼古丁依赖程度</view>
|
||||
<view class="flex margin-eight">
|
||||
<view class="flex-sub text-center bg-video flex-direction flex-conter">
|
||||
<view class="location" v-if="location==1">
|
||||
<view class="tagWidth">{{score}}分</view>
|
||||
<view class="tagSan"></view>
|
||||
</view>
|
||||
<view class="progressBg leftBG"></view>
|
||||
<view class="text-sm margin-top-xs">轻度</view>
|
||||
</view>
|
||||
<view class="flex-sub text-center bg-video flex-direction flex-conter">
|
||||
<view class="location" v-if="location==2">
|
||||
<view class="tagWidth">{{score}}分</view>
|
||||
<view class="tagSan"></view>
|
||||
</view>
|
||||
<view class="progressBg centerBG"></view>
|
||||
<view class="text-sm margin-top-xs">中度</view>
|
||||
</view>
|
||||
<view class="flex-sub text-center bg-video flex-direction flex-conter">
|
||||
<view class="location" v-if="location==3">
|
||||
<view class="tagWidth">{{score}}分</view>
|
||||
<view class="tagSan"></view>
|
||||
</view>
|
||||
<view class="progressBg rightBG"></view>
|
||||
<view class="text-sm margin-top-xs">重度</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="greyBg marginTop">{{result}}</view>
|
||||
</view>
|
||||
<view class="card marginTop">
|
||||
<view class="text-bold">戒烟意见</view>
|
||||
<block v-for="(item,index) in List" :key="index">
|
||||
<view class="flex marginTop">
|
||||
<view class="tagYuan"></view>
|
||||
<view class="text-sm flex-sub title">{{item}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn" @tap="goHome">开启健康生活之旅</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
location: '',
|
||||
score: '',
|
||||
result: '',
|
||||
List: ['是时候考虑一辈子的吸烟费用了,你不妨按年算算花费。', '您也许会说出得起这笔钱,但您真的不在乎花大笔的金钱破坏自己的生活吗。']
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.$SMOKE.getById({
|
||||
data: {
|
||||
id: option.id //报告id
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.data.smokingReportScore <= 3) {
|
||||
this.location = 1
|
||||
} else if (res.data.smokingReportScore <= 6) {
|
||||
this.location = 2
|
||||
} else {
|
||||
this.location = 3
|
||||
}
|
||||
this.score = res.data.smokingReportScore
|
||||
this.result = res.data.smokingReportLevel
|
||||
this.List = res.data.smokingReportDesc.split(';')
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 返回戒烟主页
|
||||
goHome() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/quitSmoking/index/index?userId=' + uni.getStorageSync('userId')+"&openId="+uni.getStorageSync("openId")
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pageBox {
|
||||
color: #3F4040;
|
||||
|
||||
.resultTop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 686rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.contioner {
|
||||
padding: 112rpx 32rpx 32rpx;
|
||||
|
||||
.card {
|
||||
padding: 32rpx 24rpx;
|
||||
background: #FFF;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.margin-eight {
|
||||
margin-top: 104rpx;
|
||||
}
|
||||
|
||||
.progressBg {
|
||||
width: 100%;
|
||||
height: 12rpx;
|
||||
}
|
||||
|
||||
.leftBG {
|
||||
border-radius: 50rpx 0 0 50rpx;
|
||||
background: #5DACB6;
|
||||
}
|
||||
|
||||
.centerBG {
|
||||
background: #F3B43F;
|
||||
}
|
||||
|
||||
.rightBG {
|
||||
border-radius: 0 50rpx 50rpx 0;
|
||||
background: #ED6D42;
|
||||
}
|
||||
|
||||
.location {
|
||||
position: absolute;
|
||||
bottom: 66rpx;
|
||||
|
||||
.tagWidth {
|
||||
padding: 2rpx 8rpx;
|
||||
font-size: 20rpx;
|
||||
color: #FFF;
|
||||
background: #17191A;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.tagSan {
|
||||
margin-left: 14rpx;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 16rpx solid #17191A;
|
||||
border-right: 10rpx solid transparent;
|
||||
border-left: 10rpx solid transparent;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.greyBg {
|
||||
padding: 24rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #F8F8F8;
|
||||
font-size: 28rpx;
|
||||
color: #909292;
|
||||
}
|
||||
|
||||
.tagYuan {
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
margin-right: 8rpx;
|
||||
margin-top: 12rpx;
|
||||
border-radius: 50%;
|
||||
background: $uni-color;
|
||||
}
|
||||
|
||||
.title {
|
||||
letter-spacing: 4rpx;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
color: #FFF;
|
||||
border-radius: 50rpx;
|
||||
margin-top: 48rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,59 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="container">
|
||||
<view class="tagWidth"></view>
|
||||
<markdown-it-vue-light class="md-body" :content="value" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MarkdownIt from "markdown-it"
|
||||
import MarkdownItVueLight from 'markdown-it-vue/dist/markdown-it-vue-light.umd.min.js'
|
||||
import 'markdown-it-vue/dist/markdown-it-vue-light.css'
|
||||
export default {
|
||||
components: {
|
||||
MarkdownItVueLight
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: '',
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.value = JSON.parse(decodeURIComponent(option.params.replace(/%/g, '%25')))
|
||||
this.$SMOKE.smokingSecretAdd({
|
||||
data: {
|
||||
studyId: option.secretId
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pageBox {
|
||||
background: linear-gradient(180deg, #F9E8D8 0%, #F3F4F6 400rpx);
|
||||
padding: 32rpx;
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
padding: 32rpx;
|
||||
color: #3F4040;
|
||||
border-radius: 16rpx;
|
||||
background: #FFF;
|
||||
|
||||
.tagWidth {
|
||||
position: absolute;
|
||||
top: 58rpx;
|
||||
left: 24rpx;
|
||||
width: 116rpx;
|
||||
height: 10rpx;
|
||||
background: linear-gradient(270deg, rgba(253, 198, 116, 0.00) 0%, #FF9A02 100%);
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,135 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="container">
|
||||
<view class="topCard">
|
||||
<view class="title orange">{{formDate.title}}</view>
|
||||
<view class="margintop-four text-df orange">{{formDate.tipOne}}</view>
|
||||
<image class="tagLeft" src="https://sharkbaby.yhy.ren/groups.png"></image>
|
||||
<image class="tagRight" src="https://sharkbaby.yhy.ren/groups.png"></image>
|
||||
</view>
|
||||
<view class="card margintop-four">
|
||||
<view class="text-xl text-bold">戒烟解读</view>
|
||||
<block v-for="(item,index) in formDate.directoryInfos" :key="index">
|
||||
<view class="orangeBg margintop-four flex-align">
|
||||
<view class="text-df flex-sub marginRight-eight">
|
||||
<view class="marginBottom-sm">{{index+1}}.{{item.title}}</view>
|
||||
<view class="flex-contion text-xs">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/eyes.png" class="eyes"></image>
|
||||
<view class="grey">{{item.numberOfPeople}}人学习过</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn" @tap="goPage(item)">学习</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formDate: {},
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.index = parseInt(options.index)
|
||||
},
|
||||
onShow() {
|
||||
this.$SMOKE.cheatsList().then(res => {
|
||||
this.formDate = res.data[this.index]
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
goPage(item) {
|
||||
const instruction = JSON.stringify(item.instruction)
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/scriptsDetail/scriptsDetail?params=' + encodeURIComponent(
|
||||
instruction) + '&secretId=' + item.secretId
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
padding: 32rpx;
|
||||
color: #3F4040;
|
||||
|
||||
|
||||
.topCard {
|
||||
position: relative;
|
||||
padding: 40rpx 24rpx 32rpx;
|
||||
border-radius: 16rpx;
|
||||
background: linear-gradient(#F8EBE2 0%, #fff 100%);
|
||||
$width: 12rpx;
|
||||
$height: 56rpx;
|
||||
|
||||
.tagLeft {
|
||||
position: absolute;
|
||||
bottom: -38rpx;
|
||||
left: 48rpx;
|
||||
width: $width;
|
||||
height: $height;
|
||||
}
|
||||
|
||||
.tagRight {
|
||||
position: absolute;
|
||||
bottom: -38rpx;
|
||||
right: 48rpx;
|
||||
width: $width;
|
||||
height: $height;
|
||||
}
|
||||
|
||||
.orange {
|
||||
color: #724030;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #FFF;
|
||||
|
||||
.orangeBg {
|
||||
padding: 32rpx 24rpx;
|
||||
border: 1rpx solid rgba(251, 235, 212, 1);
|
||||
background: #FEF9F6;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.marginRight-eight {
|
||||
margin-right: 48rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 124rpx;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
border-radius: 32rpx;
|
||||
background: #ED7143;
|
||||
color: #FFF;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.eyes {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
|
||||
.grey {
|
||||
color: #909292;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,104 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="container">
|
||||
<view class="topCard">
|
||||
<view class="title orange">戒烟秘籍说明提示</view>
|
||||
<view class="margintop-four text-df orange">
|
||||
在看本方法时,无需刻意戒烟,可以边看边吸,一切遵循内心,不要企图我会告诉你:吸烟会让你得冠心病、心脑血管病疾病、高血压、糖尿病、肺癌……如果告诉你这些有用,我相信早你就戒了,全世界也不会有这么多烟民了。
|
||||
</view>
|
||||
</view>
|
||||
<view class="card margintop-four">
|
||||
<view class="text-xl text-bold">戒烟科普</view>
|
||||
<block v-for="(item,index) in List" :key="index">
|
||||
<view class="orangeBg margintop-four flex-align">
|
||||
<view class="text-df flex-sub marginRight-eight">
|
||||
<view class="marginBottom-sm">
|
||||
{{item.title}}<text>({{item.completed}}/{{item.unfinished}})</text>
|
||||
</view>
|
||||
<cmd-progress :percent="item.completed/item.unfinished*100" stroke-color="#ED7143"
|
||||
:show-info="false"></cmd-progress>
|
||||
</view>
|
||||
<view class="btn" @tap="goPage(index)">解读</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
List: [],
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$SMOKE.cheatsList().then(res => {
|
||||
this.List = res.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
goPage(index) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/scriptsLearn/scriptsLearn?index=' + index
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
padding: 32rpx;
|
||||
color: #3F4040;
|
||||
|
||||
::v-deep .cmd-progress-inner {
|
||||
background-color: #FBEBD4;
|
||||
}
|
||||
|
||||
.topCard {
|
||||
padding: 40rpx 24rpx 32rpx;
|
||||
border-radius: 16rpx;
|
||||
background: linear-gradient(#F8EBE2 0%, #fff 100%);
|
||||
|
||||
.orange {
|
||||
color: #724030;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #FFF;
|
||||
|
||||
.orangeBg {
|
||||
padding: 32rpx 24rpx;
|
||||
border: 1rpx solid rgba(251, 235, 212, 1);
|
||||
background: #FEF9F6;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.marginRight-eight {
|
||||
margin-right: 48rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 124rpx;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
border-radius: 32rpx;
|
||||
background: #ED7143;
|
||||
color: #FFF;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,164 @@
|
|||
<template>
|
||||
<view class="pageBox" :class="{'show':isShow}">
|
||||
<view class="contioner" v-if="List.length>0">
|
||||
<block v-for="(item,index) in List" :key="index">
|
||||
<view class="card marginTop">
|
||||
<view class="flex">
|
||||
<view class="union">
|
||||
<image src="https://sharkbaby.yhy.ren/jinhao.png"></image>
|
||||
</view>
|
||||
<view class="flex-sub word-break">
|
||||
<view class="text-bold">{{item.title}}</view>
|
||||
<view class="text-df title">{{item.content}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex-align">
|
||||
<view class="greyColor text-sm">{{item.createTime}}</view>
|
||||
<view class="tagWidth flex-conter" @tap="shanchu(item.id)">
|
||||
<uni-icons type="trash-filled" color="#FF4545" size="18"></uni-icons>
|
||||
<text>删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<nothing v-else></nothing>
|
||||
<view class="fixedTag" @tap="goComment">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/send.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
List: [],
|
||||
pageNum: 1,
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getInfo()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.pageNum++
|
||||
this.$SMOKE.smokingDiaryList({
|
||||
data: {
|
||||
pageNum: this.pageNum,
|
||||
pageSize: 10
|
||||
}
|
||||
}).then(res => {
|
||||
this.List = this.List.length < res.total ? this.List.concat(res.rows) : this.List
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getInfo(val) {
|
||||
this.$SMOKE.smokingDiaryList().then(res => {
|
||||
this.List = res.rows
|
||||
this.isShow = true
|
||||
})
|
||||
},
|
||||
goComment() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/content/content'
|
||||
})
|
||||
},
|
||||
shanchu(id) {
|
||||
toast('删除成功')
|
||||
this.$SMOKE.smokingDiaryDelete({
|
||||
data: {
|
||||
id: id
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.getInfo('删除')
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pageBox {
|
||||
opacity: 0;
|
||||
transition: opacity ease .3s;
|
||||
|
||||
&.show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.contioner {
|
||||
padding: 8rpx 32rpx;
|
||||
|
||||
.card {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #FFF;
|
||||
|
||||
.word-break {
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.union {
|
||||
$wh: 28rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 12rpx;
|
||||
|
||||
image {
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-top: 16rpx;
|
||||
letter-spacing: 6rpx;
|
||||
line-height: 48rpx;
|
||||
color: #3F4040;
|
||||
}
|
||||
|
||||
.cut {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #eee;
|
||||
margin: 24rpx 0 33rpx;
|
||||
}
|
||||
|
||||
.greyColor {
|
||||
color: #909292;
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
color: #FF4545;
|
||||
font-size: 24rpx;
|
||||
width: 118rpx;
|
||||
height: 50rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid rgba(255, 69, 69, 0.40);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fixedTag {
|
||||
position: fixed;
|
||||
bottom: 70rpx;
|
||||
right: 32rpx;
|
||||
|
||||
image {
|
||||
$wh: 104rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,239 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="contioner">
|
||||
<view class="card marginTop">
|
||||
<view class="flex-align">
|
||||
<view>最后吸烟日</view>
|
||||
<picker mode="date" :start="birth" :end="cuttDate" :value="date" @change="bindDateChange">
|
||||
<view :class="['flex-contion',date==''?'greyColor':'']">
|
||||
{{date==''?'请选择':date}}
|
||||
<uni-icons type="right" color="#3AAFB8" size="22"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex-align">
|
||||
<view>最后吸烟时间</view>
|
||||
<picker mode="time" :value="time" @change="bindTimeChange">
|
||||
<view :class="['flex-contion',time==''?'greyColor':'']">
|
||||
{{time==''?'请选择':time}}
|
||||
<uni-icons type="right" color="#3AAFB8" size="22"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex-align">
|
||||
<view>烟龄</view>
|
||||
<view class="flex-contion">
|
||||
<input v-model="smokerAge" placeholder="请输入" type="number" class="text-df text-right" />
|
||||
<text class="greyColor marginLeft-xs">(年)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex-align">
|
||||
<view>吸烟量</view>
|
||||
<view class="flex-contion">
|
||||
<input v-model="smokingVolume" placeholder="请输入" type="number" class="text-df text-right" />
|
||||
<text class="greyColor marginLeft-xs">(支/天)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex-align">
|
||||
<view>烟价</view>
|
||||
<view class="flex-contion">
|
||||
<input v-model="cigarettePrice" placeholder="请输入" type="digit" class="text-df text-right" />
|
||||
<text class="greyColor marginLeft-xs">(20支/包)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex-align">
|
||||
<view>焦油含量</view>
|
||||
<view class="flex-contion">
|
||||
<input v-model="tar" placeholder="请输入" type="digit" class="text-df text-right" />
|
||||
<text class="greyColor marginLeft-xs">(毫克/支)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex-align">
|
||||
<view>吸一支烟的时间</view>
|
||||
<view class="flex-contion">
|
||||
<input v-model="smokerTime" placeholder="请输入" type="digit" class="text-df text-right" />
|
||||
<text class="greyColor marginLeft-xs">(分钟)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex-align">
|
||||
<view>曾尝试戒烟几次</view>
|
||||
<view class="flex-contion">
|
||||
<input v-model="smokerNum" placeholder="请输入" type="number" class="text-df text-right" />
|
||||
<text class="greyColor marginLeft-xs">(次)</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="placeholder"></view>
|
||||
<view class="btnList">
|
||||
<view class="btn" @tap="submit">确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
formatTime,
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
date: '', //最后吸烟日
|
||||
time: '', //最后吸烟时间
|
||||
smokerAge: '', //烟龄
|
||||
smokingVolume: '', //吸烟量
|
||||
cigarettePrice: '', //烟价
|
||||
tar: '', //焦油含量
|
||||
smokerTime: '', //吸一支烟的时间
|
||||
smokerNum: '', //曾尝试戒烟几次
|
||||
cuttDate: formatTime(new Date()).split(" ")[0], // 年月日
|
||||
timeDate: formatTime(new Date()).split(" ")[1], //时分秒
|
||||
birth: '', //出生日期
|
||||
age: '', //年龄
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.birth = options.birth //出生日期
|
||||
this.age = options.age //年龄
|
||||
},
|
||||
methods: {
|
||||
//开始戒烟
|
||||
submit() {
|
||||
if (this.date == '' || this.time == '' || this.smokerAge == '' || this.smokingVolume == '' ||
|
||||
this.cigarettePrice == '' || this.tar == '' || this.smokerTime == '' || this
|
||||
.smokerNum == '') return toast('请先填写完整')
|
||||
if (this.date == this.cuttDate && this.time > this.timeDate) return uni.showToast({
|
||||
icon: 'none',
|
||||
title: '最后吸烟时间不能晚于当前时间',
|
||||
duration: 3000
|
||||
})
|
||||
if (this.smokingVolume == 0) return toast('吸烟量为零,无需戒烟')
|
||||
if (this.cigarettePrice == 0) return toast('烟价不能为零')
|
||||
if (this.tar == 0) return toast('焦油含量不能为零')
|
||||
if (this.smokerTime == 0) return toast('吸一支烟的时间不能为零')
|
||||
// 只允许输入整数的正则表达式
|
||||
const reg = /^\d*$/;
|
||||
if (!reg.test(this.smokerAge)) {
|
||||
return toast('烟龄只能输入整数')
|
||||
}
|
||||
if (!reg.test(this.smokingVolume)) {
|
||||
return toast('吸烟量只能输入整数')
|
||||
}
|
||||
// 只允许输入两位小数的正则表达式
|
||||
const rege = /^\d+(\.\d{0,2})?$/;
|
||||
if (!rege.test(this.cigarettePrice)) {
|
||||
return toast('烟价只能输入两位小数')
|
||||
}
|
||||
// 只允许输入一位小数的正则表达式
|
||||
const regex = /^\d+(\.\d{0,1})?$/;
|
||||
if (!regex.test(this.tar)) {
|
||||
return toast('焦油含量只能输入一位小数')
|
||||
}
|
||||
if (!regex.test(this.smokerTime)) {
|
||||
return toast('吸一支烟的时间只能输入一位小数')
|
||||
}
|
||||
if (!reg.test(this.smokerNum)) {
|
||||
return toast('曾尝试戒烟几次只能输入整数')
|
||||
}
|
||||
if (Number(this.smokerAge) > Number(this.age)) return toast('烟龄不大于年龄')
|
||||
var data = {
|
||||
smokingDate: this.date + " " + this.time + ":00",
|
||||
smokingAge: this.smokerAge,
|
||||
smokingAmount: this.smokingVolume,
|
||||
smokingPrices: this.cigarettePrice,
|
||||
smokingTarContent: this.tar,
|
||||
smokingAmountTime: this.smokerTime,
|
||||
smokingQuitTimes: this.smokerNum
|
||||
}
|
||||
this.$SMOKE.userSmokingAdd({
|
||||
data,
|
||||
}).then(res => {
|
||||
toast('保存成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
// 最后吸烟日
|
||||
bindDateChange(e) {
|
||||
this.date = e.detail.value
|
||||
},
|
||||
// 最后吸烟时间
|
||||
bindTimeChange(e) {
|
||||
this.time = e.detail.value
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.contioner {
|
||||
padding: 40rpx 32rpx;
|
||||
color: #3F4040;
|
||||
|
||||
.rightColor {
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 32rpx 24rpx;
|
||||
background: #FFF;
|
||||
border-radius: 20rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.greyColor {
|
||||
color: #909292;
|
||||
}
|
||||
|
||||
.cut {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #E9E9E9;
|
||||
margin: 32rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
height: 100rpx;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/* 兼容 iOS < 11.2 */
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/* 兼容 iOS >= 11.2 */
|
||||
}
|
||||
|
||||
.btnList {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100vw;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 110rpx;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/* 兼容 iOS < 11.2 */
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
|
||||
/* 兼容 iOS >= 11.2 */
|
||||
.btn {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
background-color: $uni-color;
|
||||
border-radius: 40rpx;
|
||||
flex: 1;
|
||||
margin: 0 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,128 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/slice.png" class="cheatsTop"></image>
|
||||
<view class="content bg-video">
|
||||
<view class="bg-video">
|
||||
<view class="topTitle">
|
||||
<view class="top">戒烟秘籍</view>
|
||||
<view class="zhojian">
|
||||
本人有近20年的吸烟历史,吸烟给我的生活、工作、身体带来了很多的痛苦和烦恼,我曾尝试过靠毅力戒烟、逐步减量法戒烟、用电子烟替代戒烟等多种方法,但最终都以失败告终。
|
||||
</view>
|
||||
<view class="zhoxia">
|
||||
直到有一天,我遇到了湘雅附二的一位心血管科的教授,他教给了我一本戒烟武林秘籍,让我成功的摆脱了香烟。
|
||||
</view>
|
||||
<view class="zhoxia">
|
||||
我将方法进行了总结,希望能给准备戒烟或正在戒烟的朋友们提供一些帮助。
|
||||
</view>
|
||||
<view class="zhoxia">
|
||||
本方法具备:即时见效、无论烟瘾轻重,同样有效、无痛苦、不需要意志力、不适用冲击疗法、无需辅助手段或替代品、效果持久稳定等特征。
|
||||
</view>
|
||||
</view>
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/shuxie.png" mode="widthFix" class="imgClass">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/cheatsBi.png" mode="widthFix" class="cheatsBi"></image>
|
||||
<view class="flex-conter cheatsBtn" @tap="goMIiji">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/cheatsBtn.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/cheatsBottom.png" class="cheatsBottom"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goMIiji() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/scriptsList/scriptsList'
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.pageBox {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #FED9A2;
|
||||
}
|
||||
|
||||
.cheatsTop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 200rpx;
|
||||
height: 164rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 72rpx 8rpx 0 32rpx;
|
||||
color: #724030;
|
||||
z-index: 10;
|
||||
|
||||
.topTitle {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 72rpx;
|
||||
line-height: 50rpx;
|
||||
|
||||
.top {
|
||||
text-align: center;
|
||||
font-size: 56rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.zhojian {
|
||||
margin-top: 64rpx;
|
||||
padding: 0 40rpx;
|
||||
font-size: 28rpx;
|
||||
text-indent: 2rem;
|
||||
}
|
||||
|
||||
.zhoxia {
|
||||
margin-top: 40rpx;
|
||||
padding: 0 40rpx;
|
||||
font-size: 28rpx;
|
||||
text-indent: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.imgClass {
|
||||
width: 100%;
|
||||
height: 1184rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cheatsBi {
|
||||
margin-top: -122rpx;
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.cheatsBottom {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100vw;
|
||||
height: 254rpx;
|
||||
}
|
||||
|
||||
.cheatsBtn {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 36rpx;
|
||||
z-index: 10;
|
||||
|
||||
image {
|
||||
width: 494rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
After Width: | Height: | Size: 242 KiB |
|
@ -0,0 +1,225 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="contioner">
|
||||
<view class="topSelect flex-align">
|
||||
<block v-for="(item,index) in List" :key="index">
|
||||
<view :class="['flex-sub text-df text-center',dateIndex==index?'shaw':'']"
|
||||
@tap="selectChange(index)">
|
||||
{{item}}
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="card marginTop">
|
||||
<view>连续记录数</view>
|
||||
<view class="tag"></view>
|
||||
<view class="charts-box">
|
||||
<qiun-data-charts type="column" :opts="opts" :chartData="chartData" :ontouch="true" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="card marginTop">
|
||||
<view class="flex-align marginBottom">
|
||||
<view class="flex-contion">
|
||||
<view class="tagWidth"></view>
|
||||
<view>烟瘾记录</view>
|
||||
</view>
|
||||
<view class="themColor text-six">平均:{{num}}次/{{this.dateIndex==0?'天':'月'}}</view>
|
||||
</view>
|
||||
<block v-for="(item,index) in recodeList" :key="index">
|
||||
<view class="flex-align">
|
||||
<view class="text-df">{{item.time}}</view>
|
||||
<view class="greyColor text-xs">
|
||||
<text class="themColor text-bold text-eight marginRight-xs">{{item.num}}</text>次
|
||||
</view>
|
||||
</view>
|
||||
<view class="cut" v-if="index<recodeList.length-1"></view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
List: ['周', '月'],
|
||||
dateIndex: 0, //顶部切换索引
|
||||
chartData: {},
|
||||
num: '', //多少次/天
|
||||
recodeList: [{
|
||||
time: '凌晨00:00 ~ 02:59',
|
||||
num: '',
|
||||
}, {
|
||||
time: '凌晨03:00 ~ 05:59',
|
||||
num: '',
|
||||
}, {
|
||||
time: '早上06:00 ~ 08:59',
|
||||
num: '',
|
||||
}, {
|
||||
time: '上午09:00 ~ 11:59',
|
||||
num: '',
|
||||
}, {
|
||||
time: '中午12:00 ~ 14:59',
|
||||
num: '',
|
||||
}, {
|
||||
time: '下午15:00~17:59',
|
||||
num: '',
|
||||
}, {
|
||||
time: '晚上18:00~20:59',
|
||||
num: '',
|
||||
}, {
|
||||
time: '晚上21:00~23:59',
|
||||
num: '',
|
||||
}], //记录
|
||||
opts: {
|
||||
color: ["#3AAFB8"],
|
||||
enableScroll: true,
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
dataLabel: false,
|
||||
xAxis: {
|
||||
rotateLabel: true,
|
||||
marginTop: 10,
|
||||
disableGrid: true,
|
||||
scrollShow: true,
|
||||
itemCount: 7,
|
||||
scrollShow: false,
|
||||
},
|
||||
extra: {
|
||||
column: {
|
||||
type: "group",
|
||||
width: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据
|
||||
getInfo() {
|
||||
showLoading('加载中...')
|
||||
this.$SMOKE.cartogram({
|
||||
data: {
|
||||
type: this.dateIndex
|
||||
},
|
||||
}).then(res => {
|
||||
this.num = res.data.averageHeat
|
||||
this.recodeList[0].num = res.data.recode.zerototwo
|
||||
this.recodeList[1].num = res.data.recode.threetofive
|
||||
this.recodeList[2].num = res.data.recode.sixtoeight
|
||||
this.recodeList[3].num = res.data.recode.ninetoeleven
|
||||
this.recodeList[4].num = res.data.recode.twelvetofourteen
|
||||
this.recodeList[5].num = res.data.recode.fifteentoseventeen
|
||||
this.recodeList[6].num = res.data.recode.eighteentotwenty
|
||||
this.recodeList[7].num = res.data.recode.twentyone
|
||||
this.getServerData(res.data.timeList, res.data.infoList)
|
||||
hideLoading()
|
||||
})
|
||||
},
|
||||
selectChange(index) {
|
||||
this.dateIndex = index
|
||||
this.getInfo()
|
||||
},
|
||||
getServerData(timeList, infoList) {
|
||||
let res = {
|
||||
categories: timeList,
|
||||
series: [{
|
||||
name: "",
|
||||
data: infoList
|
||||
}]
|
||||
};
|
||||
this.chartData = JSON.parse(JSON.stringify(res));
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pageBox {
|
||||
color: #3F4040;
|
||||
|
||||
.themColor {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.text-six {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.text-eight {
|
||||
font-size: 48rpx;
|
||||
}
|
||||
|
||||
.greyColor {
|
||||
color: #909292;
|
||||
}
|
||||
|
||||
.contioner {
|
||||
padding: 40rpx 32rpx;
|
||||
|
||||
.topSelect {
|
||||
margin-top: 20rpx;
|
||||
height: calc(64rpx - 8rpx);
|
||||
padding: 4rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 16rpx;
|
||||
background: #EEE;
|
||||
|
||||
.shaw {
|
||||
width: 226rpx;
|
||||
height: 100%;
|
||||
border-radius: 16rpx;
|
||||
background: #FFF;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 32rpx 24rpx;
|
||||
background: #FFF;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.tag {
|
||||
width: 28rpx;
|
||||
height: 4rpx;
|
||||
border-radius: 50rpx;
|
||||
background: #3F4040;
|
||||
margin-left: 68rpx;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.charts-box {
|
||||
width: 100%;
|
||||
height: 600rpx;
|
||||
}
|
||||
|
||||
.tagWidth {
|
||||
width: 6rpx;
|
||||
height: 36rpx;
|
||||
border-radius: 50rpx;
|
||||
background: $uni-color;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.cut {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #E9E9E9;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,216 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="contioner">
|
||||
<view class="card">
|
||||
<view class="flex-conter">
|
||||
欢迎来到
|
||||
<view class="dateWidth">
|
||||
<uni-datetime-picker v-model="single" :start="cuttDate" type="date" :clear-icon="false"
|
||||
@change="maskClick">
|
||||
{{single}}
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/dateTime.png" class="dateTime"></image>
|
||||
</view>
|
||||
<view class="zanwu">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/shiguang.png"></image>
|
||||
</view>
|
||||
<view class="text-center blueColor">{{dataInfo.quitSmokeTime}}</view>
|
||||
<view class="cut"></view>
|
||||
<view class="flex-align">
|
||||
<view class="text-center flex-grow">
|
||||
<view>
|
||||
<!-- 寿命 时间 -->
|
||||
<text class="text-bold fourSize">{{dataInfo.lifetime}}</text>
|
||||
<text class="text-xs greyColor marginLeft-four">小时</text>
|
||||
</view>
|
||||
<view class="flex-conter">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/love.png" class="love"></image>
|
||||
<text class="text-xs greyColor marginLeft-xs">寿命</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tagCut"></view>
|
||||
<view class="text-center flex-grow">
|
||||
<view>
|
||||
<!-- 少吸 支 -->
|
||||
<text class="text-bold fourSize">{{dataInfo.smokeLess}}</text>
|
||||
<text class="text-xs greyColor marginLeft-four">支</text>
|
||||
</view>
|
||||
<view class="flex-conter">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/branch.png" class="branch"></image>
|
||||
<text class="text-xs greyColor marginLeft-xs">少吸</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tagCut"></view>
|
||||
<view class="text-center flex-grow">
|
||||
<view>
|
||||
<!-- 省钱 元 -->
|
||||
<text class="text-bold fourSize">{{dataInfo.saveMoney}}</text>
|
||||
<text class="text-xs greyColor marginLeft-four">元</text>
|
||||
</view>
|
||||
<view class="flex-conter">
|
||||
<image src="https://shayu5qny.yhy.ren/quitSmoking/first.png" class="first"></image>
|
||||
<text class="text-xs greyColor marginLeft-xs">省钱</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评分 -->
|
||||
<view class="flex-align marginTop-lg" @tap="goPage">
|
||||
<view class="text-sm">健康恢复评分:<text class="themColor text-xl text-bold">{{dataInfo.score}}</text>
|
||||
</view>
|
||||
<view class="text-sm text-bold">· · ·</view>
|
||||
</view>
|
||||
<cmd-progress :percent="dataInfo.percentage" :showInfo="false"
|
||||
stroke-color="linear-gradient(to right, #36AAB1, #6ACBD1)">
|
||||
</cmd-progress>
|
||||
<view class="text-xs greyColor margin-top-xs">生理烟瘾基本消除:{{dataInfo.percentage}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
formatTime,
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
const currentDate = this.getDate({
|
||||
format: true
|
||||
})
|
||||
return {
|
||||
single: currentDate,
|
||||
dataInfo: {},
|
||||
cuttDate: formatTime(new Date()).split(" ")[0], // 年月日
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据
|
||||
getInfo() {
|
||||
this.$SMOKE.timeTravel({
|
||||
data: {
|
||||
time: this.single + ' 00:00:00'
|
||||
},
|
||||
}).then(res => {
|
||||
this.dataInfo = res.data
|
||||
})
|
||||
},
|
||||
getDate(type) {
|
||||
const date = new Date();
|
||||
let year = date.getFullYear() + 20;
|
||||
let month = date.getMonth() + 1;
|
||||
let day = date.getDate();
|
||||
|
||||
if (type === 'start') {
|
||||
year = year - 60;
|
||||
} else if (type === 'end') {
|
||||
year = year + 2;
|
||||
}
|
||||
month = month > 9 ? month : '0' + month;
|
||||
day = day > 9 ? day : '0' + day;
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
maskClick() {
|
||||
this.getInfo()
|
||||
},
|
||||
goPage() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/quitSmoking/recoveryScore/recoveryScore?time=' + this.single
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.contioner {
|
||||
padding: 32rpx;
|
||||
|
||||
.card {
|
||||
padding: 64rpx 24rpx 32rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #FFF;
|
||||
color: #3F4040;
|
||||
|
||||
.fontColor {
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.greyColor {
|
||||
color: #909292;
|
||||
}
|
||||
|
||||
.themColor {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.blueColor {
|
||||
color: #3B74E2;
|
||||
}
|
||||
|
||||
.dateTime {
|
||||
$wh: 40rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
|
||||
.dateWidth {
|
||||
width: 180rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.zanwu {
|
||||
$wh: 512rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin: 0 auto -48rpx;
|
||||
margin-top: 28rpx;
|
||||
|
||||
image {
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
|
||||
.cut {
|
||||
width: 100%;
|
||||
height: 2rpx;
|
||||
background: #EEE;
|
||||
margin: 48rpx 0;
|
||||
}
|
||||
|
||||
.tagCut {
|
||||
width: 1rpx;
|
||||
height: 80rpx;
|
||||
background: #CCE0E1;
|
||||
}
|
||||
|
||||
.love {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.branch {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.first {
|
||||
width: 48rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.diot {
|
||||
width: 30rpx;
|
||||
height: 6rpx;
|
||||
}
|
||||
|
||||
.marginLeft-four {
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,333 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<image src="https://sharkbaby.yhy.ren/reportsBg.png" class="reportsBg"></image>
|
||||
<view class="bg-video card marginBottom" v-for="(item, index) in analysisReports" :key="index">
|
||||
<view class="examClass flex-contion">
|
||||
<image src="https://sharkbaby.yhy.ren/grade.png"></image>{{item.examClass}}
|
||||
</view>
|
||||
<block v-if="!item.hidden">
|
||||
<view class="flex-contion text-bold margin-bottom-xs">
|
||||
<view class="cutt"></view>
|
||||
<view>解释</view>
|
||||
</view>
|
||||
<view class="greyColor">{{item.itemExplain}}</view>
|
||||
<view class="flex-contion text-bold margin-bottom-xs marginTop-sm">
|
||||
<view class="cutt"></view>
|
||||
<view>判断</view>
|
||||
</view>
|
||||
<view class="greyColor" v-if="item.examClass!='血压'&&item.examClass!='血糖'&&item.examClass!='血脂'">{{item.examRang}}</view>
|
||||
<block v-if="item.examClass=='血压'">
|
||||
<view class="table text-df marginTop-sm marginBottom-sm">
|
||||
<view class="text-center borderBottom text-bold">血压水平分类及定义</view>
|
||||
<view class="flex borderBottom text-bold">
|
||||
<view class="flex-sub text-center borderRight">分类</view>
|
||||
<view class="flex-sub text-center borderRight">收缩压(mg)</view>
|
||||
<view class="flex-sub text-center">舒张压(mmHg)</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="flex-sub text-center borderRight">正常血压</view>
|
||||
<view class="flex-sub text-center borderRight"><120 和</view>
|
||||
<view class="flex-sub text-center"><80</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="flex-sub text-center borderRight">正常高值</view>
|
||||
<view class="flex-sub text-center borderRight">120-139 和(或)</view>
|
||||
<view class="flex-sub text-center">80-89</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="flex-sub text-center borderRight">高血压</view>
|
||||
<view class="flex-sub text-center borderRight">≥140 和(或)</view>
|
||||
<view class="flex-sub text-center">≥290</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="flex-sub text-center borderRight">1级高血压(轻度)</view>
|
||||
<view class="flex-sub text-center borderRight">140-159和(或)</view>
|
||||
<view class="flex-sub text-center">90-99</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="flex-sub text-center borderRight">2级高血压(中度)</view>
|
||||
<view class="flex-sub text-center borderRight">160-179和(或)</view>
|
||||
<view class="flex-sub text-center">100-109</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="flex-sub text-center borderRight">3级高血压(重度)</view>
|
||||
<view class="flex-sub text-center borderRight">≥180和(或)</view>
|
||||
<view class="flex-sub text-center">≥110</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="flex-sub text-center borderRight">单纯收缩期高血压</view>
|
||||
<view class="flex-sub flex-conter borderRight">≥140 和</view>
|
||||
<view class="flex-sub flex-conter"><90</view>
|
||||
</view>
|
||||
<view class="text-center">注:当收缩压和舒张压分属于不同级别时,以较高的分级为准</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 血糖 -->
|
||||
<block v-if="item.examClass=='血糖'">
|
||||
<view class="table text-df marginTop-sm">
|
||||
<view class="text-center borderBottom text-bold">糖代谢状态分类(世界卫生组织1999年)</view>
|
||||
<view class="flex text-bold borderBottom">
|
||||
<view class="borderRight flex-conter" style="width: 30%;">糖代谢状态</view>
|
||||
<view class="flex-sub">
|
||||
<view class="text-center borderBottom">静脉血浆葡萄糖(mmol/L)</view>
|
||||
<view class="flex">
|
||||
<text class="flex-sub borderRight text-center">空腹血糖</text>
|
||||
<text class="flex-sub text-center">糖负荷后2h血糖</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="text-center borderRight" style="width: 30%;">正常血糖</view>
|
||||
<view class="flex-sub text-center borderRight"><6.1</view>
|
||||
<view class="flex-sub text-center"><7.8</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="text-center borderRight" style="width: 30%;">空腹血糖受损</view>
|
||||
<view class="flex-sub text-center borderRight">≥6.1,<7.0</view>
|
||||
<view class="flex-sub text-center"><7.8</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="text-center borderRight" style="width: 30%;">糖耐里减低</view>
|
||||
<view class="flex-sub text-center borderRight"><7.0</view>
|
||||
<view class="flex-sub text-center">≥7.8,<11.1</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="text-center borderRight" style="width: 30%;">糖尿病</view>
|
||||
<view class="flex-sub text-center borderRight">≥7</view>
|
||||
<view class="flex-sub text-center">>11.1</view>
|
||||
</view>
|
||||
<view class="text-center">注;空腹血糖受损和糖耐里减低统称为糖调节受损,也称糖尿病前期;空腹血糖正常参考</view>
|
||||
</view>
|
||||
<view class="table text-df marginTop-sm marginBottom-sm">
|
||||
<view class="text-center borderBottom text-bold">糖尿病诊断标准</view>
|
||||
<view class="flex borderBottom text-bold">
|
||||
<view class="flex-conter borderRight" style="width: 30%;">诊断标准</view>
|
||||
<view class="flex-sub text-center">静脉血浆前萄糖或糖化血红蛋白水平</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="text-center borderRight" style="width: 30%;">典型糖尿病症状</view>
|
||||
<view class="flex-sub flex-conter"></view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="text-center borderRight" style="width: 30%;">加上随机血糖</view>
|
||||
<view class="flex-sub text-center">≥11.1mmol/L</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="text-center borderRight" style="width: 30%;">或加上空腹血糖</view>
|
||||
<view class="flex-sub flex-conter">≥7.0mmol/L</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="text-center borderRight" style="width: 30%;">或加上0GTT 2h血糖</view>
|
||||
<view class="flex-sub flex-conter">≥11.1mmol/L</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="text-center borderRight" style="width: 30%;">或加上糖化血红蛋白</view>
|
||||
<view class="flex-sub flex-conter">≥6.5%</view>
|
||||
</view>
|
||||
<view class="text-center">无糖尿病典型症状者,须改日复查确认</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="item.examClass=='血脂'">
|
||||
<view class="table text-df marginTop-sm marginBottom-sm">
|
||||
<view class="flex borderBottom text-bold">
|
||||
<view class="flex-sub text-center borderRight">分类</view>
|
||||
<view class="flex-sub text-center">正常值范围</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="flex-sub text-center borderRight">总胆固醇(TC)</view>
|
||||
<view class="flex-sub flex-conter"><5.2mmol/L</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="flex-sub text-center borderRight">甘油三酯(TG)</view>
|
||||
<view class="flex-sub text-center"><1.7mmol/L</view>
|
||||
</view>
|
||||
<view class="flex borderBottom">
|
||||
<view class="flex-sub text-center borderRight">低密度脂蛋白(LDL-C)</view>
|
||||
<view class="flex-sub flex-conter"><3.4mmol/L</view>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<view class="flex-sub text-center borderRight">高密度脂蛋白(HDL-C)</view>
|
||||
<view class="flex-sub flex-conter">≥1.04mmol/L</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-for="(item1, index1) in item.chartList" :key="index1">
|
||||
<!-- 折线图部分 -->
|
||||
<view class="charts-box margin-top-xs">
|
||||
<qiun-data-charts type="line" :opts="opts" canvas2d @tap="tap" :chartData="item1.seriesJson"
|
||||
onmovetip :ontouch="true" tapLegend />
|
||||
</view>
|
||||
<view class="flex-contion text-bold" v-if="item1.trendAnalysis">
|
||||
<view>趋势说明:</view>
|
||||
<view class="themColor">{{item1.trendAnalysis}}</view>
|
||||
</view>
|
||||
<view v-if="item1.conclusion!='不生成报告'" class="margin-top-xs">
|
||||
<text class="text-bold themColor">结论:</text><text class="greyColor">{{item1.conclusion}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<view class="bottomCard themColor flex-conter" @tap="changeClick(item)">
|
||||
<text>{{item.hidden?'展开':'收起'}}</text>
|
||||
<uni-icons :type="item.hidden?'bottom':'top'" color="#3AAFB8" size="24"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
showLoading,
|
||||
hideLoading,
|
||||
toast
|
||||
} from '/tool/index.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
analysisReports: [],
|
||||
opts: {
|
||||
color: ['#3AAFB8'],
|
||||
xAxis: {
|
||||
disableGrid: true
|
||||
},
|
||||
yAxis: {
|
||||
gridType: "dash",
|
||||
dashLength: 2
|
||||
},
|
||||
extra: {
|
||||
area: {
|
||||
type: "curve",
|
||||
opacity: 0.2,
|
||||
addLine: true,
|
||||
width: 2,
|
||||
gradient: true,
|
||||
activeType: "hollow"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
uni.setStorageSync('userId', option.userId)
|
||||
this.getUserAnalysisReport(option.id);
|
||||
},
|
||||
methods: {
|
||||
tap() {
|
||||
console.log('点击了图标')
|
||||
},
|
||||
changeClick(item) {
|
||||
item.hidden = !item.hidden
|
||||
},
|
||||
getUserAnalysisReport(id) {
|
||||
showLoading('加载中...')
|
||||
this.$API.getUserAnalysisReport({
|
||||
data: {
|
||||
id
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
if (res.code == 200) {
|
||||
res.data.map(item => {
|
||||
item.chartList.map((item1, index) => {
|
||||
let a = JSON.parse(item1.seriesJson);
|
||||
let splitNumber = 5;
|
||||
if (a.series[0].data.length != 0) {
|
||||
let max = Math.max.apply(null, a.series[0].data);
|
||||
let min = Math.min.apply(null, a.series[0].data);
|
||||
if ((Number(max) - Number(min) >= 5) || (Number(max) - Number(
|
||||
min) == 0)) {
|
||||
splitNumber = 5;
|
||||
} else {
|
||||
splitNumber = 1
|
||||
}
|
||||
}
|
||||
let resData = {
|
||||
categories: a.categories,
|
||||
series: a.series,
|
||||
splitNumber: splitNumber
|
||||
};
|
||||
item1.seriesJson = JSON.parse(JSON.stringify(resData));
|
||||
})
|
||||
})
|
||||
res.data.map(item => item.hidden = false)
|
||||
this.analysisReports = res.data
|
||||
} else {
|
||||
toast(res.msg)
|
||||
}
|
||||
hideLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.pageBox {
|
||||
padding: 32rpx;
|
||||
color: #3F4040;
|
||||
|
||||
.themColor {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.greyColor {
|
||||
color: #909292;
|
||||
}
|
||||
.table{
|
||||
width: 100%;
|
||||
border: 1rpx solid #000;
|
||||
.borderRight{
|
||||
border-right: 1rpx solid #000;
|
||||
}
|
||||
.borderBottom{
|
||||
border-bottom: 1rpx solid #000;
|
||||
}
|
||||
}
|
||||
|
||||
.reportsBg {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 552rpx;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 20rpx 24rpx 0;
|
||||
border-radius: 16rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.bottomCard {
|
||||
border-top: 2rpx solid #eee;
|
||||
width: 100%;
|
||||
line-height: 80rpx;
|
||||
margin-top: 20rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.examClass {
|
||||
font-weight: bold;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 36rpx;
|
||||
|
||||
image {
|
||||
$wh: 40rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cutt {
|
||||
width: 4rpx;
|
||||
height: 32rpx;
|
||||
background: $uni-color;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.charts-box {
|
||||
width: 100%;
|
||||
height: 600rpx;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,364 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- 背景图片 -->
|
||||
<image src="https://shayu5qny.yhy.ren/revision/earnPointsBg.png" class="earnPointsBg"></image>
|
||||
<view class="contioner bg-video">
|
||||
<view class="flex">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="color">
|
||||
<view class="introduce text-df">
|
||||
欢迎使用线上健康评估工具,让我们一起探索您的健康需求吧!
|
||||
</view>
|
||||
<view class="evaluation">
|
||||
<view class="text-bold color">测评介绍</view>
|
||||
<view class="flex-align" style="color: #3F4040;margin-left: 12rpx;">
|
||||
<view class="text-center">
|
||||
<image src="https://shayu5qny.yhy.ren/intralTime.png" class="intralTime"></image>
|
||||
<view><text class="text-bold text-xl">{{times}}</text><text class="text-sm">分钟</text>
|
||||
</view>
|
||||
<view class="grey text-sm margin-top-xs">简单快速</view>
|
||||
</view>
|
||||
<view class="text-center">
|
||||
<image src="https://shayu5qny.yhy.ren/questions.png" class="intralTime"></image>
|
||||
<view><text class="text-bold text-xl">{{questionCount}}</text><text
|
||||
class="text-sm">题</text></view>
|
||||
<view class="grey text-sm margin-top-xs">专业量表</view>
|
||||
</view>
|
||||
<view class="text-center">
|
||||
<image src="https://shayu5qny.yhy.ren/peoples.png" class="intralTime"></image>
|
||||
<view><text class="text-bold text-xl">{{assessCount}}</text><text
|
||||
class="text-sm">人</text></view>
|
||||
<view class="grey text-sm margin-top-xs">已完成测评</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex" style="margin-top: 80rpx;">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="card">
|
||||
<view class="text-bold color">说明:</view>
|
||||
<view class="text-df grey marginTop-sm">1、填写本问卷,您将获得您的专属健康报告及生活方式改善建议。</view>
|
||||
<view class="text-df grey margin-top-xs">2、本问卷测试结果仅供您自测参考,不作为医学诊断。</view>
|
||||
<view class="text-df grey margin-top-xs">3、您的所有信息,都将保密。</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex" style="margin-top: 80rpx;">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="card">
|
||||
<view class="btn" @click="startEvaluation">开始测评</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="literature" v-if="assessReferenceList!=null">
|
||||
<view class="text-bold color">参考文献</view>
|
||||
<block v-for="(item,index) in assessReferenceList" :key="index">
|
||||
<view class="marginTop-sm text-df grey">[{{index+1}}]{{item.reference}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="codePopup" type="center" :isMaskClick="false">
|
||||
<view class="cards">
|
||||
<view class="bg-video flex-contion text-sm">
|
||||
<input v-model="phone" placeholder="请输入你的手机号码" class="inputClass" />
|
||||
<view class="flex-contion rightTitle">
|
||||
<text>+86</text>
|
||||
<image src="https://shayu5qny.yhy.ren/downward.png" class="downward"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cutt"></view>
|
||||
<view class="bg-video flex-align text-sm">
|
||||
<input v-model="code" @input="onKeyInput" placeholder="请输入验证码" class="inputClass flex-sub" />
|
||||
<view class="rightTwo themColor text-bold" @click="!isResend?getCode():''">
|
||||
{{isResend?'重新发送'+(time):'获取验证码'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cutt"></view>
|
||||
<view :class="['btns',phone==''||code==''||!isCode?'':'disabled']"
|
||||
@click="phone!=''&&code!=''&&isCode?signIn():''">登录</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading,
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '评估问卷',
|
||||
illustrate: '本测试结果仅供用户自测参考,不作为医学诊断。',
|
||||
times: '', //评估时长
|
||||
questionCount: '', //评估题数
|
||||
assessCount: '', //评估人数
|
||||
assessReferenceList: null, //参考文献
|
||||
phone: '', //手机号码
|
||||
code: '', //验证码
|
||||
isCode: false, //判断是否获取验证码
|
||||
timer: null, //验证码倒计时定时器
|
||||
time: 60, //秒
|
||||
isResend: false, //是否显示重新发送
|
||||
age: '', //年龄
|
||||
name: '', //昵称
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.codePopup.open()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 查询详情数据
|
||||
getDetail() {
|
||||
this.$API.getAssessInfo({
|
||||
data: {
|
||||
diseases: 95, //评估id
|
||||
memberId: 0, //成员id
|
||||
type: 2, //评估类型 1.心理 2.疾病
|
||||
}
|
||||
}).then(res => {
|
||||
this.times = res.data.times
|
||||
this.questionCount = res.data.questionCount
|
||||
this.assessCount = res.data.assessCount
|
||||
this.assessReferenceList = res.data.assessReferenceList
|
||||
})
|
||||
},
|
||||
// 登录
|
||||
async signIn() {
|
||||
if (this.$preventClick()) return
|
||||
var that = this
|
||||
const reg = (/^1\d{10}$/);
|
||||
if (!reg.test(this.phone)) return toast('手机号码格式不正确,请重新填写')
|
||||
let ret1 = that.$API.appLogin({
|
||||
data: {
|
||||
phone: that.phone,
|
||||
code: that.code
|
||||
},
|
||||
}).then(async (res) => {
|
||||
hideLoading()
|
||||
if (res.code != 200) return uni.showToast({
|
||||
title: res.msg || '登录失败,请联系管理员',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
success: () => {}
|
||||
})
|
||||
if (res.data.sysUser == null) return toast('用户未注册')
|
||||
uni.setStorageSync("userId", res.data.sysUser.userId)
|
||||
this.age = res.data.sysUser.age
|
||||
this.name = res.data.sysUser.nickName
|
||||
this.$API.hasLifestyleAssessment().then(ret => {
|
||||
if (ret.data.status == 0) { //未评估
|
||||
this.getDetail()
|
||||
} else { //已评估 跳转报告页
|
||||
uni.redirectTo({
|
||||
url: '/pages/scanCodeEvaluation/health-risks/basicReport/basicReport?age=' +
|
||||
this.age + '&name=' + this.name
|
||||
})
|
||||
}
|
||||
this.$refs.codePopup.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
onKeyInput: function(event) {
|
||||
this.code = event.target.value
|
||||
},
|
||||
startEvaluation() {
|
||||
uni.redirectTo({
|
||||
url: '/pages/scanCodeEvaluation/health-risks/index/index?age=' + this.age + '&name=' + this
|
||||
.name
|
||||
})
|
||||
},
|
||||
// 获取验证码
|
||||
getCode() {
|
||||
if (this.$preventClick()) return
|
||||
if (!this.phone) return toast('请输入手机号')
|
||||
const reg = (/^1\d{10}$/);
|
||||
if (!reg.test(this.phone)) return toast('手机号码格式不正确,请重新填写')
|
||||
this.isCode = true
|
||||
this.isResend = true
|
||||
this.$API.sendTheVerificationCodeApp({
|
||||
data: {
|
||||
phone: this.phone,
|
||||
exist: 1
|
||||
}
|
||||
}).then(res => {
|
||||
this.timeFunction()
|
||||
if (res.code != 200) return toast(res.msg)
|
||||
})
|
||||
},
|
||||
// 倒计时
|
||||
timeFunction() {
|
||||
this.timer = setInterval(() => {
|
||||
this.time--
|
||||
if (this.time == 0) {
|
||||
clearInterval(this.timer)
|
||||
this.isResend = false
|
||||
this.time = 60
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.cards {
|
||||
padding: 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.rightTitle {
|
||||
position: absolute;
|
||||
right: 8rpx;
|
||||
z-index: 10;
|
||||
width: 200rpx;
|
||||
height: 96rpx;
|
||||
line-height: 96rpx;
|
||||
text-align: right;
|
||||
justify-content: flex-end;
|
||||
|
||||
.downward {
|
||||
$wh: 32rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
|
||||
.btns {
|
||||
width: 100%;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
border-radius: 50rpx;
|
||||
background: #CDCDCD;
|
||||
color: #FFFFFF;
|
||||
font-size: 28rpx;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.inputClass {
|
||||
width: 100%;
|
||||
height: 96rpx;
|
||||
line-height: 96rpx;
|
||||
// border-bottom: 1rpx solid #E9E9E9;
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
|
||||
.cutt {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #E9E9E9;
|
||||
}
|
||||
|
||||
.fontColor {
|
||||
color: #3F4040;
|
||||
}
|
||||
|
||||
.themColor {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
background: $uni-color !important;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: linear-gradient(171deg, #EFFFFD 10.63%, #F4F8F7 73.62%);
|
||||
}
|
||||
|
||||
.topContioner {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
z-index: 10;
|
||||
|
||||
.leftBack {
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.earnPointsBg {
|
||||
width: 100vw;
|
||||
height: 574rpx;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.contioner {
|
||||
padding: 74rpx 32rpx 0;
|
||||
z-index: 2;
|
||||
|
||||
.color {
|
||||
color: #17191A;
|
||||
}
|
||||
|
||||
.grey {
|
||||
color: #909292;
|
||||
}
|
||||
|
||||
.avare {
|
||||
$wh: 80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.introduce {
|
||||
padding: 20rpx;
|
||||
width: calc(502rpx - 40rpx);
|
||||
height: calc(120rpx - 40rpx);
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 0rpx 0rpx;
|
||||
}
|
||||
|
||||
.evaluation {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 26rpx 34rpx 24rpx 36rpx;
|
||||
margin-top: 16rpx;
|
||||
width: calc(502rpx - 70rpx);
|
||||
height: calc(278rpx - 50rpx);
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
||||
|
||||
.intralTime {
|
||||
$wh: 60rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
width: calc(502rpx - 40rpx);
|
||||
padding: 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 16rpx 16rpx;
|
||||
|
||||
.btn {
|
||||
width: 424rpx;
|
||||
text-align: center;
|
||||
line-height: 92rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
margin: 0 20rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.literature {
|
||||
padding: 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 16rpx 16rpx;
|
||||
margin: 60rpx 0 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,208 @@
|
|||
.pageBox{
|
||||
.bgBackground {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
width: 100vw;
|
||||
height: 606rpx;
|
||||
background: linear-gradient(145deg, #E4F5EB 0%, rgba(228, 245, 235, 0) 100%);
|
||||
}
|
||||
.themColor{
|
||||
color: $uni-color;
|
||||
}
|
||||
.fontColor {
|
||||
color: #17191A;
|
||||
}
|
||||
.contioner {
|
||||
padding:58rpx 32rpx 32rpx;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
color: #3F4040;
|
||||
|
||||
.dotocr {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 10rpx;
|
||||
width: 360rpx;
|
||||
height: 488rpx;
|
||||
z-index: -1;
|
||||
}
|
||||
.topWidth {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: #FFFFFF;
|
||||
border: 7rpx solid #6ACBD1;
|
||||
border-radius: 40rpx;
|
||||
margin-top: 48rpx;
|
||||
}
|
||||
.whiteShaw {
|
||||
width: calc(100% -24rpx);
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0, 0, 0, 0);
|
||||
margin-top: -28rpx;
|
||||
margin-left: 12rpx;
|
||||
|
||||
.topBg {
|
||||
width: 100%;
|
||||
height: 32rpx;
|
||||
background: linear-gradient(180deg, rgba(56, 176, 184, 0.30) 0%, rgba(56, 176, 184, 0.00) 100%);
|
||||
}
|
||||
|
||||
.contonentPadding {
|
||||
padding: 16rpx 20rpx 32rpx;
|
||||
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(0,0,0,0.1);
|
||||
.planImg{
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.sector{
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
}
|
||||
.titlePoastion{
|
||||
position: absolute;
|
||||
bottom: 12rpx;
|
||||
left: 48%;
|
||||
transform: translateX(-50%);
|
||||
.topTitle{
|
||||
font-size: 56rpx;
|
||||
color: #3AAFB8;
|
||||
font-weight: bold;
|
||||
}
|
||||
.bottomTitle{
|
||||
font-size: 24rpx;
|
||||
color: #909292;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.leftTagOne{
|
||||
width: 144rpx;
|
||||
height: 16rpx;
|
||||
background: linear-gradient(360deg, #38B0B8 0%, rgba(56,176,184,0) 100%);
|
||||
}
|
||||
.leftTagTwo{
|
||||
width: 252rpx;
|
||||
height: 16rpx;
|
||||
background: linear-gradient(360deg, #38B0B8 0%, rgba(56,176,184,0) 100%);
|
||||
}
|
||||
}
|
||||
.riskResults{
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
margin-left: 12rpx;
|
||||
.replace{
|
||||
background: #EBF7F8;
|
||||
border-radius: 20rpx;
|
||||
padding: 24rpx 32rpx;
|
||||
}
|
||||
.leftColor{
|
||||
color: #112950;
|
||||
}
|
||||
.rightColor{
|
||||
color: #8E9AAB;
|
||||
}
|
||||
.charts-box {
|
||||
width: 630rpx;
|
||||
height: 600rpx;
|
||||
}
|
||||
.locationOne{
|
||||
margin-left: 10%;
|
||||
}
|
||||
.locationTwo{
|
||||
margin-left: 36%;
|
||||
}
|
||||
.locationThree{
|
||||
margin-left: 60%;
|
||||
}
|
||||
.locationFour{
|
||||
margin-left: 85%;
|
||||
}
|
||||
.location{
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 20rpx solid #009DFF;
|
||||
border-right: 16rpx solid transparent;
|
||||
border-left: 16rpx solid transparent;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.progress{
|
||||
height: 12rpx;
|
||||
&:first-child{
|
||||
border-radius: 50rpx 0rpx 0rpx 50rpx;
|
||||
}
|
||||
&:nth-last-child(1){
|
||||
border-radius: 0 50rpx 50rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.preventionPoints{
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
margin-left: 12rpx;
|
||||
.tagWidth {
|
||||
display: inline-block;
|
||||
width: 6rpx;
|
||||
height: 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 50rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.grey {
|
||||
display: inline-block;
|
||||
white-space:pre-wrap;
|
||||
color: #909292;
|
||||
text-indent: 1rem;
|
||||
line-height: 46rpx;
|
||||
letter-spacing: 2rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.cutt{
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #eee;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.bottomBtn{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
background: #FFFFFF;
|
||||
.btn{
|
||||
width: 686rpx;
|
||||
height: 84rpx;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
background: $uni-color;
|
||||
border-radius: 42rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
.btnBottom{
|
||||
width: 100vw;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 110rpx;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/* 兼容 iOS < 11.2 */
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/* 兼容 iOS >= 11.2 */
|
||||
.btn{
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
background-color: $uni-color;
|
||||
border-radius: 8rpx;
|
||||
flex: 1;
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,151 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="isShow">
|
||||
<view class="bgBackground"></view>
|
||||
<view class="contioner">
|
||||
<view class="fontColor">{{realName}}</view>
|
||||
<view class="fontColor text-bold text-xl marginTop-sm">欢迎开启您的专属健康报告</view>
|
||||
<image src="https://sharkbaby.yhy.ren/maskGroup.png" class="dotocr"></image>
|
||||
<view class="topWidth"></view>
|
||||
<view class="whiteShaw color">
|
||||
<view class="topBg"></view>
|
||||
<view class="contonentPadding">
|
||||
<view class="text-xl text-bold">评估结果</view>
|
||||
<view class="bg-video">
|
||||
<image class="sector"
|
||||
:src="evaluationIndex==0?'https://sharkbaby.yhy.ren/range.png':evaluationIndex==1?'https://sharkbaby.yhy.ren/sameAs.png':'https://sharkbaby.yhy.ren/goodTwo.png'">
|
||||
</image>
|
||||
<view class="titlePoastion text-center">
|
||||
<view class="topTitle">{{formeDate.nowRiskValue}}</view>
|
||||
<view class="bottomTitle">我的健康分</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 各维度健康报告 -->
|
||||
<view class="riskResults marginTop-sm padding marginBottom-sm">
|
||||
<view class="text-xl text-bold">各维度健康报告</view>
|
||||
<view class="leftTagTwo marginBottom"></view>
|
||||
<block v-for="(item,index) in formeDate.listMap" :key="index">
|
||||
<view class="replace text-sm marginBottom-sm">
|
||||
<view class="marginBottom-sm">{{item.name}}</view>
|
||||
<!-- 位置 -->
|
||||
<view class="location"
|
||||
:class="formeDate.listMap[index].level==1?'locationOne':formeDate.listMap[index].level==2?'locationTwo':formeDate.listMap[index].level==3?'locationThree':'locationFour'">
|
||||
</view>
|
||||
<!-- 进度条 -->
|
||||
<view class="flex-contion text-xs marginBottom-sm">
|
||||
<block v-for="(item1,index1) in formeDate.listMap" :key="index1">
|
||||
<block v-if="index1<4">
|
||||
<view class="flex-sub progress" :style="{background:item1.bgColor}">
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
<view class="flex-contion text-xs text-center">
|
||||
<block v-for="(item2,index2) in formeDate.listMap" :key="index2">
|
||||
<block v-if="index2<4">
|
||||
<view class="flex-sub">{{item2.proressName}}</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="preventionPoints padding" v-if="formeDate.suggest.length!=0">
|
||||
<view class="text-xl text-bold">目前状况</view>
|
||||
<view class="leftTagOne marginBottom"></view>
|
||||
<block v-for="(item,index) in formeDate.suggest" :key="index">
|
||||
<view class="flex-contion marginBottom-sm">
|
||||
<text class="tagWidth"></text>
|
||||
<text class="text-bold">step {{index+1}}</text>
|
||||
</view>
|
||||
<view class="marginBottom-sm text-df text-bold">{{item.typeList[0]}}</view>
|
||||
<view class="marginBottom-sm text-df text-bold">{{item.typeList[1]}}</view>
|
||||
<text class="grey">{{item.name.replace(/\\n/g,'\n')}}</text>
|
||||
<view class="cutt" v-if="index<formeDate.suggest.length-1"></view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnBottom">
|
||||
<view class="btn" @tap="goPage">重新评估</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 真实姓名
|
||||
realName: '',
|
||||
// 评估结果数据
|
||||
formeDate: {},
|
||||
// 评估类型
|
||||
evaluationIndex: null,
|
||||
isShow: false, //页面数据加载完成
|
||||
memberId: '0',
|
||||
age: '',
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
this.realName = opt.name // 判断是用户还是成员 0用户 成员id
|
||||
this.age = opt.age // 判断是用户还是成员 0用户 成员id
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
getInfo() {
|
||||
let that = this
|
||||
showLoading('加载中...')
|
||||
that.$API.getDiseaseResult({
|
||||
data: {
|
||||
diseaseId: '95',
|
||||
}
|
||||
}).then((res) => {
|
||||
that.formeDate = res.data
|
||||
let index;
|
||||
let score = Number(res.data.nowRiskValue)
|
||||
if (score >= 0 && score < 42) {
|
||||
index = 0
|
||||
} else if (score >= 42 && score <= 68) {
|
||||
index = 1
|
||||
} else {
|
||||
index = 2
|
||||
}
|
||||
this.evaluationIndex = index
|
||||
that.$set(that, 'isShow', true)
|
||||
if (res.data.listMap.length == 7) {
|
||||
res.data.listMap[0].bgColor = "#009DFF"
|
||||
res.data.listMap[1].bgColor = "#3AAFB8"
|
||||
res.data.listMap[2].bgColor = "#FDA92A"
|
||||
res.data.listMap[3].bgColor = "#F87C7C"
|
||||
res.data.listMap[0].proressName = "健康"
|
||||
res.data.listMap[1].proressName = "低风险"
|
||||
res.data.listMap[2].proressName = "中风险"
|
||||
res.data.listMap[3].proressName = "高风险"
|
||||
}
|
||||
if (res.data.suggest.length > 0) {
|
||||
res.data.suggest.map(item => {
|
||||
item.typeList = item.type.split(" ")
|
||||
})
|
||||
}
|
||||
hideLoading()
|
||||
})
|
||||
},
|
||||
// 重新评估
|
||||
goPage() {
|
||||
uni.redirectTo({
|
||||
url: '/pages/scanCodeEvaluation/health-risks/index/index?age=' + this.age + '&name=' + this
|
||||
.realName
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './basicReport.scss';
|
||||
</style>
|
|
@ -0,0 +1,253 @@
|
|||
page{
|
||||
background: #F3F4F6;
|
||||
}
|
||||
.pageBox{
|
||||
.color{
|
||||
color: #17191A;
|
||||
}
|
||||
.inputPopup{
|
||||
background: #FFF;
|
||||
padding: 20rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
.inputClass{
|
||||
border: 2rpx solid #3AAFB8;
|
||||
line-height: 64rpx;
|
||||
height: 64rpx;
|
||||
border-radius: 8rpx;
|
||||
padding-left: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.topPostionBg{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100vw;
|
||||
height: 528rpx;
|
||||
background: linear-gradient(155deg, #E4F5EB 0%, rgba(228,245,235,0) 100%);
|
||||
}
|
||||
.staging{
|
||||
width: 470rpx;
|
||||
height: calc(580rpx - 42rpx);
|
||||
border-radius: 48rpx;
|
||||
background: #FFF;
|
||||
padding: 22rpx 32rpx 20rpx;
|
||||
.bg{
|
||||
width: 100%;
|
||||
height: 224rpx;
|
||||
background: linear-gradient(180deg, #D8FCFF 0%, #FFF 100%);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-radius: 48rpx 48rpx 0 0;
|
||||
}
|
||||
.stagingBackground{
|
||||
width: 268rpx;
|
||||
height: 166rpx;
|
||||
}
|
||||
.threeSix{
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
.oneTwo{
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
.stagBtn{
|
||||
width: calc(406rpx - 278rpx);
|
||||
padding: 10rpx 138rpx 10rpx 140rpx;
|
||||
border-radius: 50rpx;
|
||||
border: 2rpx solid $uni-color;
|
||||
background: $uni-color;
|
||||
margin: 0 auto;
|
||||
color: #FFF;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
.colorGrey{
|
||||
color: #909292;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
}
|
||||
.contioner{
|
||||
padding: 32rpx;
|
||||
.backBottom{
|
||||
position: fixed;
|
||||
bottom: 10vh;
|
||||
right: 34rpx;
|
||||
padding: 12rpx 32rpx;
|
||||
border-radius: 50rpx;
|
||||
background: #FFF;
|
||||
box-shadow: 0 8rpx 8rpx 0 rgba(4, 70, 74, 0.14);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:24rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
.topCard{
|
||||
padding: 12rpx;
|
||||
margin-top: 48rpx;
|
||||
border-radius: 32rpx;
|
||||
background: #FFFFFF;
|
||||
.headSculpture{
|
||||
$wh:112rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
background: #F3F4F6;
|
||||
border-radius: 50%;
|
||||
border: 6rpx solid #FFFFFF;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
top: -52rpx;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
image{
|
||||
$wh:100rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.border{
|
||||
border: 1rpx dotted #3AAFB8;
|
||||
border-radius: 20rpx;
|
||||
.cut{
|
||||
display: inline-block;
|
||||
width: 4rpx;
|
||||
height: 20rpx;
|
||||
margin: 0 12rpx;
|
||||
background: $uni-color;
|
||||
}
|
||||
.top{
|
||||
margin-top: 72rpx;
|
||||
color: $uni-color;
|
||||
}
|
||||
.tag{
|
||||
padding: 0 20rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 4rpx;
|
||||
background: #F3F4F6;
|
||||
color: #909292;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.avare {
|
||||
$wh: 80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.tagWidth{
|
||||
width: 48rpx;
|
||||
height: 8rpx;
|
||||
background: #EFF9F8;
|
||||
border-radius: 50rpx;
|
||||
margin-right: 12rpx;
|
||||
margin-top: 20rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
.tagBgShaw{
|
||||
background: $uni-color;
|
||||
}
|
||||
.introduce {
|
||||
padding: 20rpx;
|
||||
width: calc(502rpx - 40rpx);
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 16rpx 0rpx 0rpx;
|
||||
}
|
||||
.borderBottom{
|
||||
border-radius: 0rpx 16rpx 16rpx 16rpx;
|
||||
}
|
||||
.rightGet{
|
||||
width: 136rpx;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(180deg, #FDC674 0%, #FF9A02 100%);
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
margin-left: 38rpx;
|
||||
}
|
||||
|
||||
.evaluation {
|
||||
width: calc(502rpx - 40rpx);
|
||||
padding: 20rpx;
|
||||
margin-top: 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
||||
.greyTag{
|
||||
padding: 18rpx 40rpx;
|
||||
background: #F8F8F8;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 20rpx;
|
||||
color: #3F4040;
|
||||
.tegWidth{
|
||||
width: 2rpx;
|
||||
height: 24rpx;
|
||||
background: #CCCCCC;
|
||||
margin: 0 24rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.shawDown{
|
||||
background: #EFF9F8;
|
||||
color: $uni-color;
|
||||
}
|
||||
.cut{
|
||||
margin-top: 32rpx;
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.greyColor{
|
||||
color: grey;
|
||||
}
|
||||
.qding{
|
||||
width: 320rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50rpx;
|
||||
margin: 0 auto;
|
||||
color: #FFFFFF;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.rightLayOut{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 32rpx;
|
||||
.leftTag{
|
||||
padding: 20rpx 32rpx;
|
||||
background: #3AAFB8;
|
||||
border-radius: 16rpx 0rpx 16rpx 16rpx;
|
||||
color: #FFFFFF;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.rightAvter{
|
||||
$wh:80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.bottomBtn{
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
width: calc(100% - 64rpx);
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #36AAB1 0%, #6ACBD1 100%);
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,825 @@
|
|||
<template>
|
||||
<view class="pageBox" v-if="pageShow">
|
||||
<view class="topPostionBg"></view>
|
||||
<block v-if="temporarily">
|
||||
<uni-popup type="center" ref="center" :isMaskClick="false">
|
||||
<view class="staging bg-video">
|
||||
<view class="bg"></view>
|
||||
<view class="text-center">
|
||||
<image src="https://shayu5qny.yhy.ren/stagingBackground.png" class="stagingBackground"></image>
|
||||
</view>
|
||||
<view class="text-xxl text-center threeSix text-bold">温馨提示</view>
|
||||
<view class="text-center text-sm oneTwo">嗨!发现您还有一份填了一半的问卷呢</view>
|
||||
<view class="text-center text-sm">请告诉我您想怎么处理</view>
|
||||
<view class="stagBtn margin-top-xs" @tap="continueChange">继续填写</view>
|
||||
<view class="text-center text-df colorGrey" @tap="againQuestion">重新填写</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</block>
|
||||
<view class="contioner" v-else>
|
||||
<view class="topCard bg-video">
|
||||
<view class="headSculpture">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png"></image>
|
||||
</view>
|
||||
<view class="border text-center bg-video">
|
||||
<view class="top text-df text-bold">
|
||||
<text class="color">鲨鱼宝宝</text>
|
||||
<text class="cut"></text>
|
||||
<text>专属评估客服</text>
|
||||
</view>
|
||||
<view class="flex-conter margin-top-xs marginBottom">
|
||||
<view class="tag marginRight-xs">{{(allCount*15/60).toFixed(0)}}分钟</view>
|
||||
<view class="tag marginRight-xs">{{allCount}}题</view>
|
||||
<view class="tag marginRight-xs" v-if="subTopic.length>0">父子题</view>
|
||||
<view class="tag" v-if="integral!=0">积分奖励</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y :style="{'height':srcollHeight}" :scroll-top="scrollView" @scroll="scroll"
|
||||
scroll-with-animation>
|
||||
<view class="next" style="padding-top: 32rpx;"></view>
|
||||
<block v-for="(item,index) in cardRadio" :key="index">
|
||||
<view v-show="item.hidden">
|
||||
<view class="flex bg-video" style="margin-top: 32rpx;">
|
||||
<image src="https://shayu5qny.yhy.ren/youngerSister.png" class="avare"></image>
|
||||
<view class="color flex-sub">
|
||||
<view class="introduce text-df">
|
||||
<view>{{index + 1 }}:{{item.subjectInfo}}</view>
|
||||
<view class="text-sm margin-top-xs" style="color: #5878B4;" v-if="item.memo!=null">
|
||||
注:{{item.memo}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 单选样式 -->
|
||||
<block v-if="item.subjectType=='0'">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">单选</view>
|
||||
<block v-for="(item1,index1) in item.diseaseAssessSubjectOption" :key="index1">
|
||||
<view :class="['greyTag',item1.hidden?'shawDown':'']"
|
||||
@tap="cardChange(index,index1,item1)">
|
||||
<text class="text-bold">{{item1.optionCode}}</text>
|
||||
<text class="tegWidth"></text>
|
||||
<text>{{item1.optionValue}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 多选样式 -->
|
||||
<block v-if="item.subjectType=='1'">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">多选</view>
|
||||
<checkbox-group>
|
||||
<label v-for="(item1,index1) in item.diseaseAssessSubjectOption"
|
||||
:key="item1.id" @tap="multipleChange(index,index1,item1)">
|
||||
<view :class="['greyTag flex-contion',item1.hidden?'shawDown':'']">
|
||||
<checkbox color="#3AAFB8" :value="item1.optionCode"
|
||||
:checked="item1.hidden" />
|
||||
<view class="marginLeft-sm">{{item1.optionValue}}</view>
|
||||
</view>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
<view class="qding" @tap="nextMulQuestion(index)">确认</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 填空样式 -->
|
||||
<block v-if="item.subjectType=='2'||item.subjectType=='4'">
|
||||
<view class="evaluation">
|
||||
<view class="text-df">填空</view>
|
||||
<block v-for="(item1,index1) in item.diseaseAssessSubjectOption" :key="index1">
|
||||
<view class="marginTop-sm" v-if="item.subjectType=='2'">
|
||||
{{item1.optionValue}}
|
||||
</view>
|
||||
<view @tap="inputChange(item.subjectInfo,
|
||||
item1.optionCode!=''&&item1.optionCode!=null?item1.optionCode:item1.defaultValue,
|
||||
index,index1)" :class="['inputClass',(item1.optionCode==''||item1.optionCode==null)&&(
|
||||
item1.defaultValue==''||item1.defaultValue==null)?'greyColor':'']">
|
||||
{{item1.optionCode!=''&&item1.optionCode!=null?item1.optionCode:
|
||||
item1.defaultValue!=''&&item1.defaultValue!=null?item1.defaultValue:'请输入'}}
|
||||
</view>
|
||||
</block>
|
||||
<view class="qding" @tap="nextBlanQuestion(index)">确认</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-end" :class="['quest'+index]" v-if="item.defaultValue!=''">
|
||||
<view class="rightLayOut">
|
||||
<view class="leftTag flex-sub">{{item.defaultValue}}</view>
|
||||
<image :src="userProfile" class="rightAvter">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view style="width: 100%;height: 100rpx;"></view>
|
||||
</scroll-view>
|
||||
<uni-popup type="top" ref="inputRef" @maskClick="close">
|
||||
<view class="inputPopup">
|
||||
<view class="text-df">{{inputTitle}}</view>
|
||||
<block v-if="inputTitle!='请填写以下常规医学指标检查结果'&&inputTitle!='请填写以下医学指标检查结果'&&inputTitle!='请填写胃功能检查结果'">
|
||||
<block v-if="inputTitle!='请填写 骨密度检查指标-T值'">
|
||||
<input placeholder="请输入" type="number" @input="inputChange1" :value="inputValue"
|
||||
:focus="focus" @confirm="close" class="inputClass" />
|
||||
</block>
|
||||
<block v-else>
|
||||
<input placeholder="请输入" type="text" @input="inputChange1" :value="inputValue"
|
||||
:focus="focus" confirm-type="完成" @confirm="close" class="inputClass" />
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<input :value="inputValue" type="digit" placeholder="请输入" :focus="focus" @input="inputChange1"
|
||||
@confirm="close" class="inputClass" />
|
||||
</block>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<view class="bottomBtn" @tap="submitMultiple" v-if="isNext">生成评估报告</view>
|
||||
<!-- 返回底部 -->
|
||||
<view class="backBottom" @tap="goBottom" v-show="scrollGun<600&&isBottom">
|
||||
<image src="https://shayu5qny.yhy.ren/Frame.png"></image>
|
||||
<view class="text-sm themColor">返回底部</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading
|
||||
} from "/tool/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageShow: false, //数据是否渲染完成
|
||||
isBumit: false, //是否提交
|
||||
queShow: 0, //暂存题目索引
|
||||
// 题目类型
|
||||
diseases: '95',
|
||||
// 是否为最后一题
|
||||
isNext: false,
|
||||
// 腰围
|
||||
waist: null,
|
||||
// 臀围
|
||||
hipline: null,
|
||||
// 存取所有答案
|
||||
questionObject: {},
|
||||
// 键
|
||||
key: '',
|
||||
// 值
|
||||
value: '',
|
||||
// 所有父题集合
|
||||
cardRadio: [],
|
||||
// 所有子题目集合
|
||||
subTopic: [],
|
||||
// 暂存问卷页面是否显示
|
||||
temporarily: false,
|
||||
// 获取问卷生成id
|
||||
generationId: '',
|
||||
// 获取暂存问卷的选中项
|
||||
checkItem: {},
|
||||
allCount: '', //总题目数量
|
||||
userProfile: 'https://shayu5qny.yhy.ren/youngerSister.png', //用户头像
|
||||
memberId: '0', //判断是用户还是成员 0用户 成员id
|
||||
memberName: '', // 成员昵称
|
||||
memberImg: '', // 成员头像
|
||||
memberAge: '', // 成员年龄
|
||||
age: '', //用户年龄
|
||||
srcollHeight: "", //题目的高度
|
||||
scrollView: 0, //题目距离顶部的位置
|
||||
scrollGun: 0, //屏幕滚动的高度
|
||||
fixedHeight: 100000, //固定底部高度
|
||||
integral: null,
|
||||
isBottom: false, //是否显示返回底部按钮
|
||||
inptuIndex: 0, //输入框父级索引
|
||||
inptuIndex1: 0, //输入框索引
|
||||
inputValue: '', //输入框的值
|
||||
inputTitle: '', //题目标题
|
||||
focus: false, //是否获取焦点
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.age = options.age //用户年龄
|
||||
this.userName = options.name //名称
|
||||
// 查询是否有暂存数据
|
||||
this.temporaryAata()
|
||||
this.selectIntegral()
|
||||
},
|
||||
// 页面销毁前暂存问卷
|
||||
beforeDestroy() {
|
||||
if (!this.isBumit) {
|
||||
this.temporaryQuestion()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 查询是否有积分奖励
|
||||
selectIntegral() {
|
||||
this.$API.selectTaskIntegral({
|
||||
data: {
|
||||
assessIds: this.diseases, //本次评估病种
|
||||
typeId: 1, //查询类型id 1疾病
|
||||
}
|
||||
}).then(res => {
|
||||
this.integral = res.data
|
||||
})
|
||||
},
|
||||
//点击获取下一题的距离
|
||||
questClass(index) {
|
||||
this.queShow = index + 1 //暂存问卷题目索引
|
||||
setTimeout(() => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".quest" + index).boundingClientRect((data) => {
|
||||
this.scrollView = parseInt(this.scrollGun + data.top - 82)
|
||||
}).exec();
|
||||
if (index > 3) {
|
||||
this.isBottom = true
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
// 滚动位置赋值
|
||||
scroll(e) {
|
||||
this.scrollGun = e.target.scrollTop
|
||||
},
|
||||
// 滚动到页面底部
|
||||
goBottom() {
|
||||
let num = this.fixedHeight++
|
||||
this.scrollView = num
|
||||
},
|
||||
//获取元素高度
|
||||
Height() {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".next").boundingClientRect((data) => {
|
||||
// 得到高度
|
||||
this.srcollHeight = uni.getSystemInfoSync().windowHeight - data.top - 18 + "px";
|
||||
}).exec();
|
||||
},
|
||||
// 查询是否有暂存数据
|
||||
temporaryAata() {
|
||||
let that = this
|
||||
that.$API.selectPaperList({
|
||||
data: {
|
||||
diseseaId: that.diseases
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.data == null) {
|
||||
that.getInfo()
|
||||
} else {
|
||||
// 获取问卷生成id 继续填写时需要
|
||||
that.generationId = res.data.id
|
||||
that.queShow = parseInt(res.data.lastSubCode) // 获取暂存题目索引
|
||||
that.$set(that, 'temporarily', true)
|
||||
that.pageShow = true
|
||||
setTimeout(() => {
|
||||
that.$refs.center.open()
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取问卷信息
|
||||
async getInfo() {
|
||||
let that = this
|
||||
showLoading('加载中...')
|
||||
let ret = await that.$API.selectBasisAssessInfo({
|
||||
data: {
|
||||
diseases: that.diseases,
|
||||
memberId: that.memberId,
|
||||
}
|
||||
})
|
||||
this.allCount = ret.data.subject.length //题目总数
|
||||
const isSubject = ret.data.subject.findIndex(item => item.hidden == true)
|
||||
ret.data.subject.map((item, index) => {
|
||||
// 去掉月经题目
|
||||
if (item.isTopSubject == 0 && item.id != 603) {
|
||||
// 得到所有父题及选择的题
|
||||
that.cardRadio.push(item)
|
||||
}
|
||||
if (item.isTopSubject == 1) {
|
||||
// 得到所有子题
|
||||
that.subTopic.push(item)
|
||||
}
|
||||
if (isSubject != -1) { //答过
|
||||
// 多选回显处理
|
||||
if (item.subjectType == '1' && item.hidden && item.id != 612) {
|
||||
const index = item.diseaseAssessSubjectOption.findIndex(item => {
|
||||
return item.hidden == true
|
||||
})
|
||||
if (index == -1) {
|
||||
item.diseaseAssessSubjectOption[item.diseaseAssessSubjectOption.length - 1]
|
||||
.hidden = true
|
||||
} else {
|
||||
item.diseaseAssessSubjectOption[item.diseaseAssessSubjectOption.length - 1]
|
||||
.hidden = false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
const isSubjects = ret.data.subject.findIndex(item => item.hidden == true)
|
||||
that.cardRadio.map((item, index) => {
|
||||
if (isSubjects != -1) { //答过
|
||||
// 单选回显处理
|
||||
if (item.subjectType == '0' && item.hidden) {
|
||||
const index11 = item.diseaseAssessSubjectOption.findIndex(item1 => {
|
||||
return item1.hidden == true
|
||||
})
|
||||
if (index11 != -1) {
|
||||
item.defaultValue = item.diseaseAssessSubjectOption[index11].optionCode + '.' +
|
||||
item.diseaseAssessSubjectOption[index11].optionValue
|
||||
}
|
||||
}
|
||||
// 多选回显处理
|
||||
if (item.subjectType == '1' && item.hidden) {
|
||||
let a = []
|
||||
item.diseaseAssessSubjectOption.map((items, indexs) => {
|
||||
if (items.hidden) {
|
||||
a.push(items.optionValue)
|
||||
}
|
||||
})
|
||||
item.defaultValue = a.toString()
|
||||
}
|
||||
// 填空回显处理
|
||||
if (item.subjectType == '2' || item.subjectType == '4') {
|
||||
if (item.subjectInfo != '请填写以下常规医学指标检查结果' && item.subjectInfo !=
|
||||
'请填写以下医学指标检查结果' && item.subjectInfo != '请填写胃功能检查结果' && item.subjectCode != 'T'
|
||||
) {
|
||||
// 有值才赋值
|
||||
if (item.diseaseAssessSubjectOption[0].optionCode != null && item
|
||||
.diseaseAssessSubjectOption[0].optionCode != '') {
|
||||
item.defaultValue = item.diseaseAssessSubjectOption[0].optionValue + ':' +
|
||||
item
|
||||
.diseaseAssessSubjectOption[0].optionCode
|
||||
}
|
||||
} else {
|
||||
let a = []
|
||||
item.diseaseAssessSubjectOption.map((items, indexs) => {
|
||||
if (items.optionCode != '' && items.optionCode != null) {
|
||||
a.push(items.optionValue + ':' + items
|
||||
.optionCode) //对话框 展示给用户看的值
|
||||
} else {
|
||||
a.push(items.optionValue + ':' + items
|
||||
.defaultValue) //对话框 展示给用户看的值
|
||||
}
|
||||
})
|
||||
item.defaultValue = a.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
that.subTopic.map((item, index) => {
|
||||
if (isSubjects != -1) { //答过
|
||||
// 单选回显处理
|
||||
if (item.subjectType == '0' && item.hidden) {
|
||||
const index11 = item.diseaseAssessSubjectOption.findIndex(item1 => {
|
||||
return item1.hidden == true
|
||||
})
|
||||
item.defaultValue = item.diseaseAssessSubjectOption[index11].optionCode + '.' +
|
||||
item.diseaseAssessSubjectOption[index11].optionValue
|
||||
}
|
||||
// 填空回显处理
|
||||
if (item.subjectType == '2' || item.subjectType == '4') {
|
||||
if (item.subjectInfo != '请填写以下常规医学指标检查结果' && item.subjectInfo !=
|
||||
'请填写以下医学指标检查结果' && item.subjectInfo != '请填写胃功能检查结果' && item.subjectCode != 'T'
|
||||
) {
|
||||
// 有值才赋值
|
||||
if (item.diseaseAssessSubjectOption[0].optionCode != null) {
|
||||
item.defaultValue = item.diseaseAssessSubjectOption[0].optionValue + ':' +
|
||||
item
|
||||
.diseaseAssessSubjectOption[0].optionCode
|
||||
}
|
||||
} else {
|
||||
let a = []
|
||||
item.diseaseAssessSubjectOption.map((items, indexs) => {
|
||||
if (items.optionCode != '' && items.optionCode != null) {
|
||||
a.push(items.optionValue + ':' + items
|
||||
.optionCode) //对话框 展示给用户看的值
|
||||
} else {
|
||||
a.push(items.optionValue + ':' + items
|
||||
.defaultValue) //对话框 展示给用户看的值
|
||||
}
|
||||
})
|
||||
item.defaultValue = a.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
that.cardRadio.map((item, index) => {
|
||||
if (index == 0) {
|
||||
item.hidden = true
|
||||
} else {
|
||||
item.hidden = false
|
||||
}
|
||||
})
|
||||
if (ret.data.topPaperSave != null) {
|
||||
that.questionObject = JSON.parse(ret.data.topPaperSave.paperJson)
|
||||
}
|
||||
that.pageShow = true
|
||||
// 获取题目列表高度
|
||||
setTimeout(() => {
|
||||
that.Height()
|
||||
hideLoading()
|
||||
}, 100)
|
||||
},
|
||||
// 输入框点击获取索引
|
||||
inputChange(value, value1, index, index1) {
|
||||
this.inputTitle = value
|
||||
this.inputValue = value1
|
||||
this.inptuIndex = index
|
||||
this.inptuIndex1 = index1
|
||||
this.$refs.inputRef.open()
|
||||
this.$nextTick(() => {
|
||||
this.focus = true
|
||||
})
|
||||
},
|
||||
// 关闭输入框弹框
|
||||
close() {
|
||||
this.focus = false
|
||||
this.cardRadio[this.inptuIndex].diseaseAssessSubjectOption[this.inptuIndex1].optionCode = this.inputValue
|
||||
},
|
||||
// 输入框
|
||||
inputChange1(e, item1) {
|
||||
this.inputValue = e.detail.value
|
||||
},
|
||||
// 填空 确定
|
||||
nextBlanQuestion(index) {
|
||||
let that = this;
|
||||
for (var i = 0; i < that.cardRadio[index].diseaseAssessSubjectOption.length; i++) {
|
||||
if (that.cardRadio[index].diseaseAssessSubjectOption[i].optionCode == '' || that.cardRadio[index]
|
||||
.diseaseAssessSubjectOption[i].optionCode == null) {
|
||||
return toast('请先填写')
|
||||
}
|
||||
}
|
||||
let value = that.cardRadio[index].diseaseAssessSubjectOption[0].optionCode
|
||||
// 只允许输入整数的正则表达式
|
||||
const reg = /^\d*$/;
|
||||
const regs = /^[+-]?(0|([1-9]\d*))(\.\d{1})?$/
|
||||
let subType = that.cardRadio[index].subjectCode
|
||||
if ((subType == 'waist' || subType == 'height') && !reg.test(value)) {
|
||||
if (subType == 'waist') {
|
||||
return toast('腰围只能输入整数')
|
||||
} else {
|
||||
return toast('身高只能输入整数')
|
||||
}
|
||||
}
|
||||
if (subType == 'weight' && !regs.test(value)) {
|
||||
return toast('体重只能输入一位整数')
|
||||
}
|
||||
// memberId不为0时为成员,否则就是用户本人
|
||||
if (that.cardRadio[index].subjectCode == 'smoke_begin_age' || that.cardRadio[index].subjectCode ==
|
||||
'smoke_end_age') {
|
||||
if (value > this.age || value == 0) return toast(value > this.age ? '不能大于当前的年龄' :
|
||||
'不能为0')
|
||||
}
|
||||
let data = that.cardRadio[index].diseaseAssessSubjectOption
|
||||
if (that.cardRadio[index].subjectInfo != '请填写以下常规医学指标检查结果' && that.cardRadio[index].subjectInfo !=
|
||||
'请填写以下医学指标检查结果' && that.cardRadio[index].subjectInfo != '请填写胃功能检查结果' && that.cardRadio[index]
|
||||
.subjectCode != 'T') {
|
||||
// 获取键和值
|
||||
that.key = that.cardRadio[index].subjectCode
|
||||
that.$set(that.questionObject, that.key, value)
|
||||
that.cardRadio[index].defaultValue = that.cardRadio[index].diseaseAssessSubjectOption[0].optionValue +
|
||||
':' + that.cardRadio[index]
|
||||
.diseaseAssessSubjectOption[0].optionCode
|
||||
} else {
|
||||
let a = []
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
// item.defaultValue=
|
||||
let key = data[i].qcode
|
||||
if (data[i].optionCode != '' && data[i].optionCode != null) {
|
||||
a.push(data[i].optionValue + ':' + data[i].optionCode) //对话框 展示给用户看的值
|
||||
// 获取键和值
|
||||
this.$set(this.questionObject, key, data[i].optionCode)
|
||||
} else {
|
||||
a.push(data[i].optionValue + ':' + data[i].defaultValue) //对话框 展示给用户看的值
|
||||
this.$set(this.questionObject, key, data[i].defaultValue)
|
||||
}
|
||||
}
|
||||
that.$set(that.cardRadio[index], 'defaultValue', a.toString())
|
||||
}
|
||||
// 判断是否为最后一题
|
||||
if (index == that.cardRadio.length - 1) {
|
||||
that.$set(that.cardRadio[index], 'hidden', true)
|
||||
return that.$set(that, 'isNext', true)
|
||||
} else {
|
||||
that.$set(that.cardRadio[index + 1], 'hidden', true)
|
||||
}
|
||||
that.questClass(index)
|
||||
},
|
||||
//单选 卡片点击事件
|
||||
cardChange(index, index1, item1) {
|
||||
let that = this
|
||||
// 获取键和值
|
||||
that.key = that.cardRadio[index].diseaseAssessSubjectOption[index1].qcode
|
||||
that.value = that.cardRadio[index].diseaseAssessSubjectOption[index1].optionCode
|
||||
that.$set(that.cardRadio[index], 'defaultValue', item1.optionCode + '.' + item1.optionValue)
|
||||
if (that.key.indexOf("sport_in") != -1) {
|
||||
if (that.key.indexOf("sport_freq") != -1) {
|
||||
let keys = that.key.split(",");
|
||||
keys.map((item) => {
|
||||
that.$set(that.questionObject, item.split(":")[0], item.split(":")[1])
|
||||
})
|
||||
} else {
|
||||
let keys = that.key.split(":");
|
||||
that.$set(that.questionObject, keys[0], keys[1])
|
||||
}
|
||||
|
||||
} else {
|
||||
that.$set(that.questionObject, that.key, that.value)
|
||||
}
|
||||
//获取到原选中的选项
|
||||
let oldIndex = -1;
|
||||
// 循环单个选项
|
||||
that.cardRadio[index].diseaseAssessSubjectOption.map((item, ind) => {
|
||||
if (item.hidden) {
|
||||
oldIndex = ind;
|
||||
}
|
||||
// 判断卡片选中哪一项
|
||||
if (ind == index1) {
|
||||
item.hidden = true
|
||||
} else {
|
||||
item.hidden = false
|
||||
}
|
||||
})
|
||||
if (oldIndex != -1) {
|
||||
// 获取子题列表
|
||||
let oldZiti = this.fuyon(that.cardRadio[index].id, oldIndex + 1);
|
||||
// 是不是已经存在子题,只有存在时才删
|
||||
const isSelect = that.cardRadio.findIndex(item => item.parentCode == that.cardRadio[index].id)
|
||||
if (oldZiti.length > 0) {
|
||||
//卡片返回重新选择 如果父题原选中项有子题则删除之前子题集合
|
||||
oldZiti.map((item, oldZi) => {
|
||||
if (isSelect != -1) {
|
||||
that.cardRadio.splice(index + 1 + (oldZiti.length - oldZi - 1), 1);
|
||||
}
|
||||
for (let key in that.questionObject) {
|
||||
|
||||
if (item.subjectCode == key) {
|
||||
Reflect.deleteProperty(that.questionObject, key)
|
||||
}
|
||||
}
|
||||
const idx = that.subTopic.findIndex(val => val.id == item.id)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
let num = this.fuyon(that.cardRadio[index].id, that.cardRadio[index].diseaseAssessSubjectOption[index1]
|
||||
.optionCode);
|
||||
// 插入子题方法
|
||||
this.matching(num, index + 1)
|
||||
// 判断是否为最后一题
|
||||
if (index == that.cardRadio.length - 1) {
|
||||
that.$set(that.cardRadio[index], 'hidden', true)
|
||||
that.$set(that, 'isNext', true)
|
||||
} else {
|
||||
that.$set(that.cardRadio[index + 1], 'hidden', true)
|
||||
}
|
||||
that.questClass(index)
|
||||
},
|
||||
// 子题插入父题后面
|
||||
matching(num, index1) {
|
||||
var that = this
|
||||
//合适位置插入子题集合
|
||||
num.map((item, index) => {
|
||||
that.cardRadio.splice(index1 + index, 0, item);
|
||||
})
|
||||
},
|
||||
// 匹配符合条件的子题目
|
||||
fuyon(id, code) {
|
||||
let num = []
|
||||
//拿到符合条件的子题
|
||||
this.subTopic.map((item) => {
|
||||
if (item.parentCode == id && item.parentSign.indexOf(code) > -1) {
|
||||
num.push(item)
|
||||
}
|
||||
})
|
||||
return num;
|
||||
},
|
||||
//有父子题则显示
|
||||
jinru() {
|
||||
let num = []
|
||||
let b = []
|
||||
this.cardRadio.map((item, index) => {
|
||||
item.diseaseAssessSubjectOption.map((item1, index1) => {
|
||||
//拿到符合条件的子题
|
||||
this.subTopic.map((item2, index2) => {
|
||||
if (item1.hidden && item2.parentCode == item.id && item2.parentSign
|
||||
.indexOf(item.diseaseAssessSubjectOption[index1].optionCode) > -1
|
||||
) {
|
||||
num.push(item2)
|
||||
b.push(index)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
if (num.length > 0) {
|
||||
num.map((item3, index3) => {
|
||||
this.cardRadio.splice(b[index3] + 1 + index3, 0, item3);
|
||||
})
|
||||
}
|
||||
this.cardRadio.map((item, index) => {
|
||||
if (index <= this.queShow) {
|
||||
item.hidden = true
|
||||
} else {
|
||||
item.hidden = false
|
||||
}
|
||||
})
|
||||
},
|
||||
//多选 卡片点击事件
|
||||
multipleChange(index, index1, item1) {
|
||||
let that = this
|
||||
let data = that.cardRadio[index].diseaseAssessSubjectOption
|
||||
if (index1 == data.length - 1 && !data[index1].hidden) {
|
||||
data.map(item => {
|
||||
item.hidden = false
|
||||
})
|
||||
data[index1].hidden = true
|
||||
} else {
|
||||
data[index1].hidden = !data[index1].hidden
|
||||
data[data.length - 1].hidden = false
|
||||
}
|
||||
},
|
||||
// 多选 确定
|
||||
nextMulQuestion(index) {
|
||||
let that = this;
|
||||
let b = []
|
||||
that.cardRadio[index].diseaseAssessSubjectOption.map(ite => {
|
||||
if (ite.hidden) {
|
||||
b.push(ite)
|
||||
}
|
||||
})
|
||||
if (b.length == 0) return toast('请选择')
|
||||
if (index == that.cardRadio.length - 1) {
|
||||
that.cardRadio[index].hidden = true
|
||||
that.$set(that, 'isNext', true)
|
||||
} else {
|
||||
that.cardRadio[index + 1].hidden = true
|
||||
}
|
||||
let data = that.cardRadio[index].diseaseAssessSubjectOption
|
||||
let a = []
|
||||
// 赋值
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data[i].hidden) {
|
||||
a.push(data[i].optionValue)
|
||||
}
|
||||
if (data[i].hidden && i < data.length - 1) { // 没有选择均无选项
|
||||
that.$set(that.questionObject, data[i].qcode, '1')
|
||||
that.$set(that.questionObject, data[data.length - 1].qcode, '2')
|
||||
} else if (data[i].hidden) { // 选择均无选项
|
||||
that.$set(that.questionObject, data[i].qcode, '1')
|
||||
data.map((item, indexs) => {
|
||||
if (indexs < data.length - 1) {
|
||||
that.$set(that.questionObject, item.qcode, '2')
|
||||
}
|
||||
})
|
||||
} else if (i < data.length - 1) {
|
||||
that.$set(that.questionObject, data[i].qcode, '2')
|
||||
}
|
||||
}
|
||||
that.cardRadio[index].defaultValue = a.toString()
|
||||
that.questClass(index)
|
||||
},
|
||||
// 阳性阳性点击
|
||||
hivChange(index1, index) {
|
||||
this.cardRadio[index].diseaseAssessSubjectOption[index1].hidden = !this.cardRadio[index]
|
||||
.diseaseAssessSubjectOption[index1].hidden
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 阴性阳性提交
|
||||
submitHiv(index, val) {
|
||||
let that = this
|
||||
if (that.cardRadio[index].subjectCode == 'hiv_his') {
|
||||
let data = that.cardRadio[index].diseaseAssessSubjectOption
|
||||
// 赋值
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data[i].hidden) {
|
||||
that.$set(that.questionObject, data[i].qcode, 1)
|
||||
} else {
|
||||
that.$set(that.questionObject, data[i].qcode, 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 提交答题
|
||||
async submitMultiple() {
|
||||
this.isBumit = true //提交时不执行页面销毁暂存问卷方法
|
||||
if (this.$preventClick()) return
|
||||
let a = []
|
||||
this.cardRadio.map(item => {
|
||||
if (item.hidden) {
|
||||
a.push(item)
|
||||
}
|
||||
})
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
if (a[i].defaultValue == "") {
|
||||
return toast('请将题目填写完')
|
||||
}
|
||||
}
|
||||
let that = this
|
||||
showLoading('提交中')
|
||||
let questionObject = JSON.stringify(that.questionObject)
|
||||
let reg = await that.$API.basisAssessSaveJson({
|
||||
data: {
|
||||
diseases: that.diseases,
|
||||
subjectJson: questionObject,
|
||||
subType: '1',
|
||||
memberId: that.memberId
|
||||
}
|
||||
})
|
||||
hideLoading()
|
||||
if (reg.code == 200) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/scanCodeEvaluation/health-risks/basicReport/basicReport?age=' + this.age + '&name=' + this.userName
|
||||
})
|
||||
} else {
|
||||
toast(reg.msg ? reg.msg : '生成报告异常')
|
||||
}
|
||||
},
|
||||
// 暂存问卷
|
||||
temporaryQuestion() {
|
||||
if (this.$preventClick()) return
|
||||
let that = this
|
||||
let a = that.cardRadio
|
||||
let b = []
|
||||
if (that.subTopic.length > 0) {
|
||||
that.subTopic.map(item => {
|
||||
let res = a.filter(it => Number(it.parentCode) === item.parentCode);
|
||||
if (res.length > 0) {
|
||||
item = res[0]
|
||||
}
|
||||
})
|
||||
a.map((item, index) => {
|
||||
// 月经赋值
|
||||
if (item.id == 603 && that.age < 35) {
|
||||
that.$set(that.questionObject, item.diseaseAssessSubjectOption[0].qcode,
|
||||
'1')
|
||||
}
|
||||
if (item.isTopSubject == 0) {
|
||||
// 得到所有父题及选择的题
|
||||
b.push(item)
|
||||
}
|
||||
})
|
||||
that.subTopic.map(item => {
|
||||
b.push(item)
|
||||
})
|
||||
that.cardRadio = b
|
||||
}
|
||||
let paperJson = JSON.stringify(that.cardRadio)
|
||||
let ret = that.$API.basisAssessSaveJson({
|
||||
data: {
|
||||
diseases: that.diseases, //题目类型
|
||||
memberId: that.memberId, //成员id
|
||||
subjectJson: paperJson, //存取所有的题目
|
||||
lastSubCode: that.queShow, //最后答题完成的编号
|
||||
subType: '0', //答题状态(1 完成 0未完成 )
|
||||
}
|
||||
})
|
||||
},
|
||||
// 继续填写
|
||||
async continueChange() {
|
||||
if (this.$preventClick()) return
|
||||
let that = this
|
||||
let ret = await this.$API.generatePaper({
|
||||
data: {
|
||||
paperId: that.generationId, //试卷id
|
||||
memberId: that.memberId
|
||||
}
|
||||
})
|
||||
that.temporarily = false
|
||||
that.allCount = ret.data.subject.length //题目总数
|
||||
if (ret.data.topPaperSave != null) {
|
||||
that.questionObject = JSON.parse(ret.data.topPaperSave.paperJson)
|
||||
}
|
||||
ret.data.subject.map((item, index) => {
|
||||
// 月经赋值
|
||||
if (item.id == 603 && that.age < 35) {
|
||||
that.$set(that.questionObject, item.diseaseAssessSubjectOption[0].qcode,
|
||||
'1')
|
||||
}
|
||||
// 去掉月经题目
|
||||
if (item.isTopSubject == 1 && item.id != 603) {
|
||||
// 得到所有子题
|
||||
that.subTopic.push(item)
|
||||
}
|
||||
if (item.isTopSubject == 0) {
|
||||
// 得到所有父题及选择的题
|
||||
that.cardRadio.push(item)
|
||||
}
|
||||
})
|
||||
that.jinru()
|
||||
setTimeout(() => {
|
||||
that.Height() // 获取题目列表高度
|
||||
that.scrollView = 100000
|
||||
}, 100)
|
||||
},
|
||||
// 重新填写
|
||||
againQuestion() {
|
||||
if (this.$preventClick()) return
|
||||
this.cardRadio = []
|
||||
this.subTopic = []
|
||||
this.temporarily = false
|
||||
this.getInfo()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss';
|
||||
</style>
|
After Width: | Height: | Size: 346 B |