|
@ -1,35 +1,37 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="home"> |
|
|
|
|
|
|
|
|
<view class="page"> |
|
|
|
|
|
|
|
|
<image src="/static/image/bg/1.png" |
|
|
|
|
|
|
|
|
<image :src="configList.img_13" |
|
|
class="page-bg" |
|
|
class="page-bg" |
|
|
mode="aspectFill"></image> |
|
|
mode="aspectFill"></image> |
|
|
|
|
|
|
|
|
|
|
|
<image :src="configList.img_7" |
|
|
|
|
|
class="logo" |
|
|
|
|
|
mode="widthFix"></image> |
|
|
|
|
|
|
|
|
<!-- next1 --> |
|
|
<!-- next1 --> |
|
|
<view class="content_now" v-if="stop == 1"> |
|
|
|
|
|
<view class="" |
|
|
|
|
|
v-if="probleme[index]" |
|
|
|
|
|
v-html="$utils.stringFormatHtml(probleme[index].title)"> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="content" v-if="question[index]"> |
|
|
|
|
|
|
|
|
<!-- <view class="mian-btn" |
|
|
|
|
|
:class="{active:isActive === '是'}" |
|
|
|
|
|
@click="setActive('是')">是</view> |
|
|
|
|
|
|
|
|
<image :src="configList.img_11" |
|
|
|
|
|
class="content-bg" |
|
|
|
|
|
mode="aspectFill"></image> |
|
|
|
|
|
|
|
|
<view class="mian-btn" |
|
|
|
|
|
:class="{active:isActive === '否'}" |
|
|
|
|
|
@click="setActive('否')">否</view> --> |
|
|
|
|
|
|
|
|
<view class="" |
|
|
|
|
|
v-html="$utils.stringFormatHtml(question[index].title)"> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="mian-btn" |
|
|
<view class="mian-btn" |
|
|
v-for="(item, index) in probleme[index] && probleme[index].danan && probleme[index].danan.split(',')" |
|
|
|
|
|
:class="{active:isActive === item}" |
|
|
|
|
|
:key="index" |
|
|
|
|
|
@click="setActive(item)">{{ item }}</view> |
|
|
|
|
|
|
|
|
v-for="(item, i) in question[index].answerObjectSkuList" |
|
|
|
|
|
:class="{active : answerIds[index] == item.id}" |
|
|
|
|
|
:key="i" |
|
|
|
|
|
@click="select(item)"> |
|
|
|
|
|
{{ item.title }} |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<!-- next2 --> |
|
|
<!-- next2 --> |
|
|
<view class="content_now" v-if="stop == 2"> |
|
|
|
|
|
|
|
|
<view class="content" v-if="stop == 2"> |
|
|
<text class="font-bold mb-60">请选择您所在的区域</text> |
|
|
<text class="font-bold mb-60">请选择您所在的区域</text> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<picker |
|
|
<picker |
|
@ -57,21 +59,21 @@ |
|
|
|
|
|
|
|
|
<view class="an"> |
|
|
<view class="an"> |
|
|
|
|
|
|
|
|
<!-- <view style="display: flex;width: 600rpx;" |
|
|
|
|
|
v-if="stop == 1"> |
|
|
|
|
|
<view class="next-btn" |
|
|
|
|
|
|
|
|
<view style="display: flex;gap: 30rpx;" |
|
|
|
|
|
> |
|
|
|
|
|
<view class="next-btn-2" |
|
|
v-if="index > 0" |
|
|
v-if="index > 0" |
|
|
@click="index--"> |
|
|
|
|
|
|
|
|
@click="ret"> |
|
|
上一题 |
|
|
上一题 |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="next-btn" |
|
|
<view class="next-btn" |
|
|
@click="next"> |
|
|
|
|
|
|
|
|
@click="next1"> |
|
|
下一题 |
|
|
下一题 |
|
|
</view> |
|
|
</view> |
|
|
</view> --> |
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="next-btn" |
|
|
|
|
|
|
|
|
<!-- <view class="next-btn" |
|
|
v-if="stop == 1" |
|
|
v-if="stop == 1" |
|
|
@click="next"> |
|
|
@click="next"> |
|
|
下一题 |
|
|
下一题 |
|
@ -81,7 +83,7 @@ |
|
|
v-if="stop == 2" |
|
|
v-if="stop == 2" |
|
|
@click="next"> |
|
|
@click="next"> |
|
|
提交 |
|
|
提交 |
|
|
</view> |
|
|
|
|
|
|
|
|
</view> --> |
|
|
|
|
|
|
|
|
<text class="second-color">{{ configList.bg_title }}</text> |
|
|
<text class="second-color">{{ configList.bg_title }}</text> |
|
|
</view> |
|
|
</view> |
|
@ -101,61 +103,84 @@ |
|
|
province : '', |
|
|
province : '', |
|
|
city : '', |
|
|
city : '', |
|
|
district : '', |
|
|
district : '', |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
question : [], |
|
|
|
|
|
answerIds : [], |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed : { |
|
|
computed : { |
|
|
...mapState(['problemList', 'configList', 'queryMyLog']), |
|
|
|
|
|
probleme(){ |
|
|
|
|
|
|
|
|
|
|
|
let ids = [] |
|
|
|
|
|
|
|
|
|
|
|
for(let i = 0;i < this.queryMyLog.length;i++){ |
|
|
|
|
|
ids.push(this.queryMyLog[i].topId) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return this.problemList.filter(n => { |
|
|
|
|
|
return !ids.includes(n.id) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
...mapState(['configList']), |
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad() { |
|
|
if(this.probleme.length == 0){ |
|
|
|
|
|
this.stop++ |
|
|
|
|
|
} |
|
|
|
|
|
let address = uni.getStorageSync('user_address') |
|
|
|
|
|
if(address){ |
|
|
|
|
|
this.address = JSON.parse(address) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.firstQuestion() |
|
|
}, |
|
|
}, |
|
|
onShow() { |
|
|
onShow() { |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
setActive(value){ |
|
|
|
|
|
this.isActive = value |
|
|
|
|
|
|
|
|
select(item){ |
|
|
|
|
|
this.answerIds.splice(this.index, 1, item.id) |
|
|
|
|
|
this.isActive = item.toMainId |
|
|
}, |
|
|
}, |
|
|
next(){ |
|
|
|
|
|
this['next' + this.stop]() |
|
|
|
|
|
|
|
|
ret(){ |
|
|
|
|
|
this.index-- |
|
|
|
|
|
this.isActive = null |
|
|
|
|
|
this.question[this.index] |
|
|
|
|
|
.answerObjectSkuList.forEach(n => { |
|
|
|
|
|
if(n.id == this.answerIds[this.index]){ |
|
|
|
|
|
this.isActive = n.toMainId |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
firstQuestion(){ |
|
|
|
|
|
this.$api('firstQuestion', res => { |
|
|
|
|
|
if(res.code == 200){ |
|
|
|
|
|
this.question.push(res.result) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
next1(){ |
|
|
next1(){ |
|
|
if(this.isActive){ |
|
|
|
|
|
this.$api('submitLog', { |
|
|
|
|
|
topId : this.probleme[this.index].id, |
|
|
|
|
|
context : this.isActive, |
|
|
|
|
|
}, res => { |
|
|
|
|
|
this.isActive = null |
|
|
|
|
|
if(this.index == this.probleme.length - 1){ |
|
|
|
|
|
this.stop = 2 |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.index++ |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
if(!this.isActive){ |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title:'请选择后进行下一题', |
|
|
title:'请选择后进行下一题', |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let item = null |
|
|
|
|
|
this.question[this.index] |
|
|
|
|
|
.answerObjectSkuList.forEach(n => { |
|
|
|
|
|
if(n.id == this.answerIds[this.index]){ |
|
|
|
|
|
item = n |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(item.isEnd == 'Y'){ |
|
|
|
|
|
this.$store.commit('getTitleByIds', item.toRuleId) |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.$api('getProblemById', { |
|
|
|
|
|
id : this.isActive |
|
|
|
|
|
}, res => { |
|
|
|
|
|
if(res.code == 200){ |
|
|
|
|
|
this.index++ |
|
|
|
|
|
this.question.splice(this.index, 1, res.result) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// this.$api('submitLog', { |
|
|
|
|
|
// topId : this.probleme[this.index].id, |
|
|
|
|
|
// context : this.isActive, |
|
|
|
|
|
// }, res => { |
|
|
|
|
|
// this.isActive = null |
|
|
|
|
|
// if(this.index == this.probleme.length - 1){ |
|
|
|
|
|
// this.stop = 2 |
|
|
|
|
|
// }else{ |
|
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
|
// url: '/pages/index/preAppoint' |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
}, |
|
|
}, |
|
|
next2(){ |
|
|
next2(){ |
|
|
// this.stop = 3 |
|
|
// this.stop = 3 |
|
@ -187,6 +212,33 @@ |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
|
|
|
.page{ |
|
|
|
|
|
.logo{ |
|
|
|
|
|
width: 600rpx; |
|
|
|
|
|
margin: 150rpx 75rpx; |
|
|
|
|
|
} |
|
|
|
|
|
.content{ |
|
|
|
|
|
position: relative; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
box-sizing: border-box; |
|
|
|
|
|
padding: 0 60rpx; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
width: 700rpx; |
|
|
|
|
|
height: 650rpx; |
|
|
|
|
|
margin: 0 25rpx; |
|
|
|
|
|
.content-bg{ |
|
|
|
|
|
height: 100%; |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
top: 0; |
|
|
|
|
|
left: 0; |
|
|
|
|
|
z-index: -1; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.region{ |
|
|
.region{ |
|
|
display: flex; |
|
|
display: flex; |
|
@ -215,18 +267,26 @@ |
|
|
color: #e6bf7f; |
|
|
color: #e6bf7f; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.next-btn{ |
|
|
.next-btn{ |
|
|
background-image: url('../../static/image/home/btn.png'); |
|
|
|
|
|
background-size: contain; |
|
|
|
|
|
background-repeat: no-repeat; |
|
|
|
|
|
background-position: center; |
|
|
|
|
|
width: 280rpx; |
|
|
|
|
|
|
|
|
width: 120rpx; |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
color: white; |
|
|
color: white; |
|
|
padding: 16rpx 90rpx; |
|
|
padding: 16rpx 90rpx; |
|
|
|
|
|
background-color: $uni-color; |
|
|
|
|
|
border-radius: 30rpx; |
|
|
|
|
|
} |
|
|
|
|
|
.next-btn-2{ |
|
|
|
|
|
width: 120rpx; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
color: white; |
|
|
|
|
|
padding: 16rpx 90rpx; |
|
|
|
|
|
background-color: $uni-color-primary; |
|
|
|
|
|
border-radius: 30rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.an{ |
|
|
.an{ |
|
@ -239,4 +299,7 @@ |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
} |
|
|
} |
|
|
|
|
|
.second-color{ |
|
|
|
|
|
margin-top: 20rpx; |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |