|
|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="page">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="fixhead" :style="{ marginTop: geStatusBarHeight() + 'px'}">
|
|
|
|
|
<selShop :showName="false" :showQR="true" :shopid="shopid" :shop="shop" @changeArea="changeArea"></selShop>
|
|
|
|
|
<selShop :showName="true" :showQR="false" :shopid="shopid" :shop="shop" @changeArea="changeArea"></selShop>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<scroll-view class="scrolllist" scroll-x="true" scroll-with-animation :scroll-left="scrollLeft">
|
|
|
|
|
<view class="tabicl" v-for="(item, index) in list" :key="index" :class="index==tabCurrentIndex?'cur':''" @tap="tabSelect" :data-id="index">
|
|
|
|
|
<view class="ptext">{{item.name}}</view>
|
|
|
|
|
@ -99,7 +99,6 @@
|
|
|
|
|
<button type="primary" class="btn" @click="submit('valiForm')">计算</button>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
|
|
|
|
|
<!-- 体质测评 -->
|
|
|
|
|
<scroll-view v-else-if="list[index].id==10" scroll-y style="height: 100%;width: 100%;">
|
|
|
|
|
<view class="tzcontent">
|
|
|
|
|
@ -109,7 +108,7 @@
|
|
|
|
|
</view>
|
|
|
|
|
<uni-forms ref="valiForm1" label-position="top">
|
|
|
|
|
<view class="example">
|
|
|
|
|
<uni-forms-item v-for="(item, i) in list[index].slist" :key="i" :name="item.name+'('+item.description+')'"
|
|
|
|
|
<uni-forms-item v-for="(item, i) in list[index].slist" :key="i" :name="item.name+'('+item.description+')'"
|
|
|
|
|
:label="numberToChinese(i+1)+'、'+item.name+'('+item.description+') 得分:'+(item.score?item.score:0)" labelWidth="700rpx" >
|
|
|
|
|
<view v-if="item.questions" class="uni-list" v-for="(cell, j) in item.questions" :key="'c'+j">
|
|
|
|
|
<view class="optxt">{{(j+1)+'、'+cell.content}}</view>
|
|
|
|
|
@ -121,7 +120,7 @@
|
|
|
|
|
<button type="primary" class="btn" @click="tzsubmit('valiForm1')">提交</button>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<scroll-view v-else scroll-y style="height: 100%;width: 100%;">
|
|
|
|
|
<view class="card" v-for="(item, i) in tabItem.slist" :key="i" @tap="gotoDetail(item,tabItem.name,index)">
|
|
|
|
|
<view class="limg imgload">
|
|
|
|
|
@ -144,13 +143,13 @@
|
|
|
|
|
</view>
|
|
|
|
|
<uni-load-more iconType="circle" :status="tabItem.loadStatus" />
|
|
|
|
|
</scroll-view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</swiper-item>
|
|
|
|
|
</swiper>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 是否登录 -->
|
|
|
|
|
<openlogin ref="loginId" @getPhoneNumber="getPhoneNumber"></openlogin>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -177,7 +176,7 @@
|
|
|
|
|
sexs: [{
|
|
|
|
|
text: '男性',
|
|
|
|
|
value: "male"
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '女性',
|
|
|
|
|
value: "female"
|
|
|
|
|
@ -232,7 +231,7 @@
|
|
|
|
|
// name:"健康饮食",
|
|
|
|
|
// id:7,
|
|
|
|
|
// loadStatus:'more',//'more', // 'noMore',
|
|
|
|
|
// slist:[
|
|
|
|
|
// slist:[
|
|
|
|
|
// ]
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
@ -293,13 +292,13 @@
|
|
|
|
|
name: '0'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
description:"(亲爱的伽人,欢迎来到中医九种体质自测普查,此版本适用人群:全年龄段评分标准:请根据近1年真实情况勾选。打分规则:完全符合 = 2分 | 偶尔有 = 1分 | 完全不符合 = 0分请选择)",
|
|
|
|
|
title:"中医九种体质自测普查",
|
|
|
|
|
surveyId:null,
|
|
|
|
|
scores:0,
|
|
|
|
|
sessionId:null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
onLoad(option) {
|
|
|
|
|
@ -307,15 +306,15 @@
|
|
|
|
|
this.id=option.id;
|
|
|
|
|
}
|
|
|
|
|
// 获取分类信息
|
|
|
|
|
this.getSort();
|
|
|
|
|
this.getSort();
|
|
|
|
|
},
|
|
|
|
|
onShow(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.openId = myCache('openId');
|
|
|
|
|
var user = myCache('user');
|
|
|
|
|
this.userid = user.userid? user.userid:'';
|
|
|
|
|
this.phone = user.userphone;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cartnum=getcartNum();
|
|
|
|
|
if(cartnum>0){
|
|
|
|
|
// 底部菜单消息角标
|
|
|
|
|
@ -330,7 +329,7 @@
|
|
|
|
|
index: 4
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var messageNum=getmessageNum();
|
|
|
|
|
console.log("messageNum",messageNum)
|
|
|
|
|
if(messageNum>0){
|
|
|
|
|
@ -346,7 +345,7 @@
|
|
|
|
|
index: 3
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
if(this.userid==""||this.userid=="0"){
|
|
|
|
|
@ -366,7 +365,7 @@
|
|
|
|
|
num = String(num).split("").reverse().join(""); // 将数字反转以便从低位到高位处理
|
|
|
|
|
let result = '';
|
|
|
|
|
let unitIndex = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < num.length; i++) {
|
|
|
|
|
let n = Number(num[i]);
|
|
|
|
|
if (n !== 0) {
|
|
|
|
|
@ -381,7 +380,7 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result.replace(/零([亿万])/g, "$1").replace(/零+/g, "零"); // 处理连续零和结果尾部的零
|
|
|
|
|
},
|
|
|
|
|
getoption(options){
|
|
|
|
|
@ -414,7 +413,7 @@
|
|
|
|
|
score+=cell.score;
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.list[this.tabCurrentIndex].slist[ind]["score"]=score;
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
@ -435,9 +434,9 @@
|
|
|
|
|
optionId:cell.optionId
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
if(tj>0){
|
|
|
|
|
this.tzsavedo(answers)
|
|
|
|
|
@ -452,7 +451,7 @@
|
|
|
|
|
if (ress.confirm) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async tzsavedo(answers){
|
|
|
|
|
@ -469,13 +468,13 @@
|
|
|
|
|
|
|
|
|
|
// 1.若平和质总分 ≥ 8分,且其他所有体质总分均 < 6分)
|
|
|
|
|
// 则跳出为:恭喜您,您的体质为“为平和体质”,非常完美。请联系您的馆主或教练,领取训练及生活方案,继续保持哦。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 2.(若某一种偏颇体质(气虚/阳虚/阴虚等)总分 ≥ 8分)
|
|
|
|
|
// 亲爱的伽人您好,您的体质为典型(气虚/阳虚/阴虚等,是什么就跳出什么)体质。请联系您的馆主或教练,领取训练机生活方案,快速调整哦。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 3.(若某一种偏颇体质总分在 6 ~ 7分 之间)则跳出为:
|
|
|
|
|
// 亲爱的伽人您好,您的体质为典型(气虚/阳虚/阴虚等,是什么就跳出什么)倾向体质。请联系您的馆主或教练,领取训练机生活方案,快速调整哦。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 4.(若有两种及以上偏颇体质分数都7分含7分以上,)则跳出:
|
|
|
|
|
// 亲爱的伽人您好,您的体质为复合型体质典型,建议综合调理。请联系您的馆主或教练,领取训练机生活方案,快速调整哦。
|
|
|
|
|
var ifone=0,iftwo=0,ifthree=0,iffour=0;
|
|
|
|
|
@ -522,7 +521,7 @@
|
|
|
|
|
else if(iffour>1){
|
|
|
|
|
tips="亲爱的伽人您好,您的体质为复合型体质典型,建议综合调理。请联系您的馆主或教练,领取训练机生活方案,快速调整哦。"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: tips,
|
|
|
|
|
@ -531,15 +530,15 @@
|
|
|
|
|
success: ress => {
|
|
|
|
|
if (ress.confirm) {}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
else{
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: res.message? res.message:'体质测评提交失败!请重试!',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
confirmText: '确定'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch{
|
|
|
|
|
@ -548,9 +547,9 @@
|
|
|
|
|
content: '计算异常!请重试!',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
confirmText: '确定'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
async getSort() {
|
|
|
|
|
// 分类
|
|
|
|
|
@ -636,7 +635,7 @@
|
|
|
|
|
async getList() {
|
|
|
|
|
if(this.list[this.tabCurrentIndex].loadStatus!=="noMore")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var para={
|
|
|
|
|
visitStore:this.shopid
|
|
|
|
|
}
|
|
|
|
|
@ -679,21 +678,21 @@
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: '数据加载中...'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 体质测评
|
|
|
|
|
if(this.list[this.tabCurrentIndex].id==10){
|
|
|
|
|
// 获取体质测评项
|
|
|
|
|
const {data: res} = await uni.$http.get(url);
|
|
|
|
|
if(res.data){
|
|
|
|
|
var data=res.data;
|
|
|
|
|
this.list[this.tabCurrentIndex].loadStatus="noMore";
|
|
|
|
|
this.list[this.tabCurrentIndex].loadStatus="noMore";
|
|
|
|
|
this.list[this.tabCurrentIndex].slist=data.constitutions?data.constitutions:[];
|
|
|
|
|
this.description=data.description;
|
|
|
|
|
this.title=data.title;
|
|
|
|
|
this.surveyId=data.surveyId;
|
|
|
|
|
this.sessionId=data.sessionId;
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
|
|
|
|
|
if(this.userid){
|
|
|
|
|
// 获取体质测评上次答题结果(需登录)
|
|
|
|
|
const {data: rest} = await uni.$http.get("/api/questionnaire/result");
|
|
|
|
|
@ -708,10 +707,10 @@
|
|
|
|
|
success: ress => {
|
|
|
|
|
if (ress.confirm) {}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// var constitutionScores=rest.data.constitutionScores?rest.data.constitutionScores:[];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// var answers=rest.data.answers?rest.data.answers:[];
|
|
|
|
|
// answers.forEach(cell=>{
|
|
|
|
|
// this.list[this.tabCurrentIndex].slist.forEach((item,ii)=>{
|
|
|
|
|
@ -731,7 +730,7 @@
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -798,7 +797,7 @@
|
|
|
|
|
url: `/pages/product/list?id=2`
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else if(this.list[e.currentTarget.dataset.id].id==8){
|
|
|
|
|
else if(this.list[e.currentTarget.dataset.id].id==8){
|
|
|
|
|
// 教练培训
|
|
|
|
|
uni.reLaunch({
|
|
|
|
|
url: `/pages/product/list`
|
|
|
|
|
@ -808,7 +807,7 @@
|
|
|
|
|
this.tabCurrentIndex = e.currentTarget.dataset.id;
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
animationfinish({ detail: { current } }) {
|
|
|
|
|
// console.log("animationfinish")
|
|
|
|
|
@ -835,7 +834,7 @@
|
|
|
|
|
url: `/pages/product/list?id=2`
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else if(this.list[e.detail.current].id==8){
|
|
|
|
|
else if(this.list[e.detail.current].id==8){
|
|
|
|
|
// 教练培训
|
|
|
|
|
uni.reLaunch({
|
|
|
|
|
url: `/pages/product/list`
|
|
|
|
|
@ -922,7 +921,7 @@
|
|
|
|
|
if (ress.confirm) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
uni.showModal({
|
|
|
|
|
@ -930,16 +929,16 @@
|
|
|
|
|
content: '计算异常!请重试!',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
confirmText: '确定'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
else{
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: res.message? res.message:'计算异常!请重试!',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
confirmText: '确定'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch{
|
|
|
|
|
@ -948,9 +947,9 @@
|
|
|
|
|
content: '计算异常!请重试!',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
confirmText: '确定'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 获取状态栏高度
|
|
|
|
|
geStatusBarHeight(){
|
|
|
|
|
@ -1002,7 +1001,7 @@
|
|
|
|
|
.swiper-item {
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.scrolltab{
|
|
|
|
|
height: 60rpx;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
@ -1101,9 +1100,9 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.scrolllist{
|
|
|
|
|
height: 110rpx;
|
|
|
|
|
height: 110rpx;
|
|
|
|
|
background: #FFF;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
width: 100%;
|
|
|
|
|
@ -1142,7 +1141,7 @@
|
|
|
|
|
background-image: url('/static/image/no.png');
|
|
|
|
|
background-size: 52% auto;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-position: center;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #00a89b;
|
|
|
|
|
@ -1254,7 +1253,7 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
::v-deep.uni-data-checklist .checklist-group .checklist-box .checklist-content .checklist-text{
|
|
|
|
|
line-height: 40rpx !important;
|
|
|
|
|
font-size: 28rpx !important;
|
|
|
|
|
@ -1326,7 +1325,7 @@
|
|
|
|
|
height: 40rpx;
|
|
|
|
|
line-height: 40rpx;
|
|
|
|
|
margin-left: 16rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.example {
|
|
|
|
|
margin: 20rpx 8rpx 0;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
|