panhui 3 年之前
父節點
當前提交
3c65e9a01f
共有 3 個文件被更改,包括 24 次插入4 次删除
  1. 11 1
      src/views/HomePage.vue
  2. 12 1
      src/views/MinePage.vue
  3. 1 2
      src/views/ProductListPage.vue

+ 11 - 1
src/views/HomePage.vue

@@ -87,6 +87,7 @@
                             height="calc(100vw - 40px)"
                             fit="cover"
                             radius="4"
+                            @click="goList(item.id)"
                         />
                         <div class="first-content">
                             <product-info :info="hotInfo"></product-info>
@@ -98,7 +99,7 @@
                         </div>
                     </div>
                     <div class="second" v-else>
-                        <van-image :src="item.icon || secondImg" fit="cover" />
+                        <van-image @click="goList(item.id)" :src="item.icon || secondImg" fit="cover" />
 
                         <div class="status">
                             <img src="../assets/info_icon_shijian.png" alt="" />
@@ -197,6 +198,15 @@ function getSaleBatch() {
     })
 }
 
+const goList = id => {
+    router.push({
+        path: '/productList',
+        query: {
+            batchId: id
+        }
+    })
+}
+
 onMounted(() => {
     getBanner()
     getSaleBatch()

+ 12 - 1
src/views/MinePage.vue

@@ -7,6 +7,11 @@
                 <span class="name">{{ user.nickname }}</span>
                 <img src="../assets/icon_bianji.png" class="icon" alt="" />
             </div>
+            <div class="userInfo" v-else @click="goLogin">
+                <van-image width="60" height="60" radius="4"></van-image>
+                <span class="name">未登录</span>
+                <img src="../assets/icon_bianji.png" class="icon" alt="" />
+            </div>
 
             <div class="order-card">
                 <div class="card-left">
@@ -59,7 +64,7 @@
                     </template>
                 </van-cell>
 
-                <van-cell title="绑定银行卡" value="未绑定" is-link>
+                <van-cell title="我的银行卡" value="未绑定" is-link>
                     <template #icon>
                         <img class="menu-icon" src="../assets/info_icon_ka.png" alt="" />
                     </template>
@@ -95,10 +100,16 @@
 <script setup>
 import { computed } from 'vue'
 import { useUserStore } from '../stores/user'
+import { useRouter } from 'vue-router'
 const userStore = useUserStore()
 const user = computed(() => {
     return userStore.user
 })
+
+const router = useRouter()
+const goLogin = () => {
+    router.push('/home')
+}
 </script>
 
 <style lang="less" scoped>

+ 1 - 2
src/views/ProductListPage.vue

@@ -63,8 +63,7 @@ function getBatch() {
 
 const status = computed(() => {
     let date1 = getYear(new Date()) + '/' + (getMonth(new Date()) + 1) + '/' + getDate(new Date())
-    console.log(date1)
-    if (batchInfo.value) {
+    if (batchInfo.value && batchInfo.value.saleStart) {
         if (
             isAfter(new Date(), new Date(date1 + ' ' + batchInfo.value.saleStart)) &&
             isBefore(new Date(), new Date(date1 + ' ' + batchInfo.value.saleEnd))