Procházet zdrojové kódy

fix:联调剩下模块接口数据

aamin před 1 rokem
rodič
revize
996aaba8ec

+ 2 - 1
src/api/api/artwork/index.ts

@@ -1,4 +1,5 @@
 import axiosInstance from '@/api/request'
 export const ArtworkApi = {
-  getSearchByKeyword: (data: any) => axiosInstance.post('show/cultural/pageList', data)
+  getSearchByKeyword: (data: any) => axiosInstance.post('show/cultural/pageList', data),
+  getConfig:()=> axiosInstance.get('show/cultural/getConfig')
 }

+ 29 - 2
src/views/EnterNingguo/artwork.vue

@@ -50,15 +50,32 @@ const onSearch = (eventData: any) => {
 const isShowIframe = ref(false)
 const iframeLink = ref('')
 
+const isOpen = ref(false)
+
+const getState = async () => {
+  const res: any = await ArtworkApi.getConfig()
+  if (res.code == 0) {
+    isOpen.value = res.data == 1 ? true : false
+  }
+
+  if (isOpen.value) {
+    getList()
+  }
+
+}
+
 
 onBeforeMount(() => {
-  getList()
+  getState()
 })
 
 </script>
 
 <template>
-  <div class='artwork-box'>
+  <div class="noopen" v-if="!isOpen">
+    宁博文创尚未开放,敬请期待
+  </div>
+  <div class='artwork-box' v-else>
     <SearchInput @onSearch="onSearch" />
     <div class="search-list" v-if="searchList.length > 0">
       <div class="list-item" v-for="(item, index) in searchList" :key="index"
@@ -80,6 +97,16 @@ onBeforeMount(() => {
 </template>
 
 <style lang='less' scoped>
+.noopen{
+  width: 100%;
+  min-height: 100%;
+  background: #F7F3E8;
+  overflow: auto;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: #333333;
+}
 .artwork-box {
   width: 100%;
   min-height: 100%;

+ 0 - 2
src/views/EnterNingguo/summarize.vue

@@ -126,8 +126,6 @@ onBeforeMount(async () => {
       white-space: pre-wrap;
       color: #88866F;
       // line-height: 44px;
-
-
     }
 
   }

+ 23 - 12
src/views/ExhibitionService/BookingTime.vue

@@ -57,7 +57,9 @@ const getBookingTime = async () => {
   if (res.code == 0) {
     bookingTimeList.value = res.data.time
     disableTimeList.value = res.data.stopDate
-    noticeText.value = res.notice
+    noticeText.value = res.data.notice
+
+    console.log(noticeText.value)
   } else {
     showToast(res.msg)
   }
@@ -68,14 +70,22 @@ watch(selectDate, () => {
   getBookingTime()
 })
 
-watch(disableTimeList, () => {
+watch(disableTimeList, (newVal: any) => {
   dateArray.value = dateArray.value.map((item: any) => {
     return {
       ...item,
       isDisabled: disableTimeList.value.includes(item.date.slice(0, 10))
     }
   })
-  console.log('发生变化', dateArray.value, disableTimeList.value)
+  let today = selectDate.value.slice(0, 10)
+  if (newVal.includes(today)) {
+    const newDate = dateArray.value.find((item: any) => {
+      return item.isDisabled == false
+    })
+    selectDate.value = newDate.date
+    console.log(selectDate.value)
+  }
+
 }, { immediate: true })
 
 const selectDateFu = (item: any) => {
@@ -103,15 +113,9 @@ const goInpitInfo = async () => {
       return item.time === selectTime.value
     })
     if (selectTimeItem.length > 0 && selectTimeItem[0].pcs > 0) {
-
       store.selectDate = selectDate.value
       store.selectTime = selectTime.value
-
       router.push({ name: 'bookInputInfo' });
-
-      // router.push({
-      //   name: 'bookInputInfo'
-      // })
     } else {
       router.go(0)
     }
@@ -121,9 +125,8 @@ const goInpitInfo = async () => {
 
 }
 
-onBeforeMount(() => {
+onMounted(() => {
   dateArray.value = getFutureDates(13)
-  console.log(store.selectDate)
   if (store.selectDate != '' && store.selectTime != '') {
     selectDate.value = store.selectDate
     selectTime.value = store.selectTime
@@ -148,6 +151,8 @@ onBeforeMount(() => {
         <div>{{ item.time }}</div>
         <div>{{ item.pcs == 0 ? `预约已满` : `剩余${item.pcs}` }}</div>
       </div>
+
+      <div class="notice-box" v-html="noticeText"></div>
     </div>
     <div class="online-box" v-if="selectDate != '' && selectTime != ''" @click="goInpitInfo()">发起预约</div>
   </div>
@@ -167,7 +172,7 @@ onBeforeMount(() => {
   max-width: 500px;
   position: relative;
   overflow: auto;
-  
+
 
   .date-select-box {
     width: 35%;
@@ -222,6 +227,12 @@ onBeforeMount(() => {
       background: #E4DCC5;
       color: #333333;
     }
+
+    .notice-box{
+      width: 100%;
+      white-space: pre-wrap;
+      color: #88866fad;
+    }
   }
 }