Browse Source

feat: 语音搜索部分

潮流
姜鑫 4 years ago
parent
commit
733f2c4120
  1. 2
      src/components/Customer/Customer.vue
  2. 2
      src/components/QuestionClassify/QuestionClassify.vue
  3. 2
      src/components/QuestionList/QuestionList.vue
  4. 24
      src/components/Search/Search.vue
  5. 2
      src/components/SearchResultItem/SearchResultItem.vue
  6. 11
      src/components/SearchResultList/SearchResultList.vue
  7. 34
      src/components/Voice/Voice.vue
  8. 4
      src/router/index.js
  9. 2
      src/store/root/state.js
  10. 4
      src/views/Movie/Movie.vue

2
src/components/Customer/Customer.vue

@ -46,7 +46,7 @@ function close() {
width: 600px; width: 600px;
height: 400px; height: 400px;
margin: 0 auto; margin: 0 auto;
margin-top: 342px;
margin-top: 760px;
background: #ffffff; background: #ffffff;
box-shadow: 0px 40px 60px rgba(0, 0, 0, 0.08); box-shadow: 0px 40px 60px rgba(0, 0, 0, 0.08);
border-radius: 12px; border-radius: 12px;

2
src/components/QuestionClassify/QuestionClassify.vue

@ -52,7 +52,7 @@ function closeQuestionClassify() {
background: #ffffff; background: #ffffff;
box-shadow: 0px 40px 60px rgba(0, 0, 0, 0.08); box-shadow: 0px 40px 60px rgba(0, 0, 0, 0.08);
border-radius: 16px; border-radius: 16px;
top: 60px;
top: 462px;
left: 50%; left: 50%;
margin-left: -427px; margin-left: -427px;
.title { .title {

2
src/components/QuestionList/QuestionList.vue

@ -108,7 +108,7 @@ function closeQuestionDetail() {
background: #ffffff; background: #ffffff;
box-shadow: 0px 40px 60px rgba(0, 0, 0, 0.08); box-shadow: 0px 40px 60px rgba(0, 0, 0, 0.08);
border-radius: 16px; border-radius: 16px;
top: 60px;
top: 462px;
left: 50%; left: 50%;
margin-left: -427px; margin-left: -427px;
.title { .title {

24
src/components/Search/Search.vue

@ -9,8 +9,8 @@
<img @click="setVoice" src="../../assets/images/search/search-voice.png" class="voice-icon" alt="" /> <img @click="setVoice" src="../../assets/images/search/search-voice.png" class="voice-icon" alt="" />
</div> </div>
<div class="flex">
<div class="right-box" v-show="!showVoice">
<div class="flex" v-if="!showVoice">
<div class="right-box">
<h1 class="title">快捷入口</h1> <h1 class="title">快捷入口</h1>
<h1 class="title-en">Quick entrance</h1> <h1 class="title-en">Quick entrance</h1>
<div class="facility-list"> <div class="facility-list">
@ -23,20 +23,8 @@
<keyboardByWritten @del="del" @handle-word="handleLetter" v-else /> <keyboardByWritten @del="del" @handle-word="handleLetter" v-else />
</div> </div>
</div> </div>
<!-- <div class="left-box" v-show="!keywords.length && !showVoice">
</div>
<SearchResultList
@handle-shop="handleShop"
@handle-activity="handleActivity"
:list="searchShopListRef"
:config="config"
v-show="keywords.length && !showVoice"
/> -->
</div> </div>
<div v-show="!keywords.length && !showVoice">
<h1 class="title">万象热搜</h1> <h1 class="title">万象热搜</h1>
<h1 class="title-en">MIXC hot search</h1> <h1 class="title-en">MIXC hot search</h1>
<ScrollView class="hot-scroll" :list="hotRecommend" scrollbar> <ScrollView class="hot-scroll" :list="hotRecommend" scrollbar>
@ -56,11 +44,11 @@
</Transition> </Transition>
</Teleport> </Teleport>
</div> </div>
<!-- <div class="search-right">
</div>
<SearchResultList @handle-shop="handleShop" @handle-activity="handleActivity" :list="searchShopListRef" :config="config" v-if="keywords.length && !showVoice" />
<Voice @handle-question="showClassify = true" v-if="showVoice" /> <Voice @handle-question="showClassify = true" v-if="showVoice" />
</div> -->
</div> </div>
<div class="search-btn" @click="close"> <div class="search-btn" @click="close">
<img src="../../assets/images/search/back.png" alt="" /> <img src="../../assets/images/search/back.png" alt="" />
@ -201,7 +189,7 @@ onBeforeUnmount(() => {
.input { .input {
border: none; border: none;
outline: none; outline: none;
width: 255px;
width: 262px;
height: 78px; height: 78px;
background: transparent; background: transparent;
font-weight: 700; font-weight: 700;

2
src/components/SearchResultItem/SearchResultItem.vue

@ -41,7 +41,7 @@ function handleShop() {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 24px; padding: 0 24px;
width: 352px;
width: 302px;
height: 72px; height: 72px;
background: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.8);
border-radius: 12px; border-radius: 12px;

11
src/components/SearchResultList/SearchResultList.vue

@ -14,10 +14,6 @@
<template v-if="activities.length"> <template v-if="activities.length">
<h1 class="title"> <h1 class="title">
{{ $t('act') }} {{ $t('act') }}
<div>
<i>{{ $t('result') }}</i>
<b>{{ activities.length }}</b>
</div>
</h1> </h1>
<div class="activity"> <div class="activity">
<div class="activity-item" @click="handleActivity(item)" v-for="item of activities" :key="item.activityId"> <div class="activity-item" @click="handleActivity(item)" v-for="item of activities" :key="item.activityId">
@ -67,8 +63,9 @@ function handleActivity(item) {
<style lang="scss" scoped> <style lang="scss" scoped>
.search-result-scroll { .search-result-scroll {
position: relative; position: relative;
height: 900px;
height: 1118px;
overflow: hidden; overflow: hidden;
margin-left: 80px;
.scroll-result { .scroll-result {
padding-bottom: 200px; padding-bottom: 200px;
} }
@ -94,11 +91,11 @@ function handleActivity(item) {
align-items: center; align-items: center;
padding: 0 8px; padding: 0 8px;
width: 532px;
width: 457px;
height: 84px; height: 84px;
background: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.8);
border-radius: 12px; border-radius: 12px;
margin-right: 8px;
margin-right: 6px;
margin-bottom: 8px; margin-bottom: 8px;
.activity-name { .activity-name {
font-weight: 700; font-weight: 700;

34
src/components/Voice/Voice.vue

@ -77,16 +77,36 @@ const showCustomerDialog = ref(false)
<style lang="scss" scoped> <style lang="scss" scoped>
.speech-wrapper { .speech-wrapper {
position: absolute; position: absolute;
left: 0;
right: 0;
bottom: 0;
left: 16px;
right: 16px;
top: 416px;
height: 360px; height: 360px;
:deep(svg) {
height: 85px !important;
}
.lottie-box { .lottie-box {
position: relative;
height: 115px; height: 115px;
margin-top: -42px; margin-top: -42px;
&::before,
&::after {
content: '';
position: absolute;
width: 328px;
top: 42px;
height: 2px;
background: linear-gradient(90deg, #ffbd35 0%, #ffd260 100%);
}
&::before {
left: 0;
}
&::after {
right: 0;
}
} }
:deep(svg) { :deep(svg) {
transform: scale(4.55) !important;
transform: scale(3.5) !important;
} }
.start-btn { .start-btn {
display: flex; display: flex;
@ -119,9 +139,9 @@ const showCustomerDialog = ref(false)
} }
.voice-scroll { .voice-scroll {
position: fixed; position: fixed;
top: 180px;
left: 72px;
right: 754px;
top: 802px;
left: 80px;
right: 58px;
bottom: 0; bottom: 0;
.title { .title {
font-weight: 700; font-weight: 700;

4
src/router/index.js

@ -26,8 +26,8 @@ router.beforeEach(async to => {
try { try {
const store = useStore() const store = useStore()
// const voiceRes = await getIsShowVoiceBtn()
// store.isUseSpeech !== voiceRes.data.isOpen && store.SET_ISUSE_SPEECH(voiceRes.data.isOpen)
const voiceRes = await getIsShowVoiceBtn()
store.isUseSpeech !== voiceRes.data.isOpen && store.SET_ISUSE_SPEECH(voiceRes.data.isOpen)
const res = await getIndexList() const res = await getIndexList()
const { data, code } = res const { data, code } = res

2
src/store/root/state.js

@ -15,5 +15,5 @@ export const state = () => ({
showDetail: false, //是否显示详情 showDetail: false, //是否显示详情
currentFloor: {}, //设备所属的当前楼栋的当前楼层信息 currentFloor: {}, //设备所属的当前楼栋的当前楼层信息
isUseFace: 0, //是否使用人脸 0:不使用 1: 使用 isUseFace: 0, //是否使用人脸 0:不使用 1: 使用
isUseSpeech: 1 //是否使用语音 0:不使用 1: 使用
isUseSpeech: 0 //是否使用语音 0:不使用 1: 使用
}) })

4
src/views/Movie/Movie.vue

@ -29,7 +29,7 @@
</p> </p>
</ScrollView> </ScrollView>
<ScrollView class="movie-scroll"> <ScrollView class="movie-scroll">
<div class="scroll-content">
<TransitionGroup tag="div" name="zoom" class="scroll-content">
<div class="movie-item" v-for="item of list" @click="handleMovie(item)" :key="item.id"> <div class="movie-item" v-for="item of list" @click="handleMovie(item)" :key="item.id">
<div class="poster-wrapper"> <div class="poster-wrapper">
<img class="poster" :src="item.posterPath" alt="" /> <img class="poster" :src="item.posterPath" alt="" />
@ -45,7 +45,7 @@
<div class="buy">{{ $t('ticket') }}</div> <div class="buy">{{ $t('ticket') }}</div>
</div> </div>
</div> </div>
</div>
</TransitionGroup>
</ScrollView> </ScrollView>
</div> </div>
</View> </View>

Loading…
Cancel
Save