瀏覽代碼

UI走查修改

skyblued 3 年之前
父節點
當前提交
0bbad336df

+ 2 - 2
src/student/main.ts

@@ -12,8 +12,8 @@ import { state } from '@/state'
 
 const app = createApp(App)
 
-import Vconsole from 'vconsole'
-const vconsole = new Vconsole()
+// import Vconsole from 'vconsole'
+// const vconsole = new Vconsole()
 
 state.platformType = 'STUDENT'
 

+ 2 - 1
src/views/shop-mall/goods-detail/index.module.less

@@ -12,7 +12,7 @@
   font-size: 14px;
   color: #fff;
   background: rgba(0, 0, 0, 0.5);
-  border-radius: 4px;
+  border-radius: 12px;
 }
 
 .goodsHead {
@@ -159,6 +159,7 @@
 }
 
 .actionBar {
+  height: var(--van-submit-bar-height);
   padding: 0px 5px;
   justify-content: space-between;
   box-shadow: 0px -10px 10px var(--box-shadow-color);

+ 42 - 30
src/views/shop-mall/goods-detail/index.tsx

@@ -19,7 +19,8 @@ import {
   Icon,
   Badge,
   Toast,
-  Popup
+  Popup,
+  SubmitBar
 } from 'vant'
 import { defineComponent } from 'vue'
 import styles from './index.module.less'
@@ -73,6 +74,13 @@ export default defineComponent({
         }
       })
       return skuStockList
+    },
+    getPrice() {
+      let item = this.skuStockList.filter(n => n.id == this.radio) as any
+      if (item && Array.isArray(item) && item.length) {
+        return item[0].price
+      }
+      return 0
     }
   },
   async mounted() {
@@ -208,7 +216,7 @@ export default defineComponent({
                 <div class={styles.priceGroup}>
                   <span class={styles.price}>
                     <i>¥</i>
-                    {moneyFormat(product.price)}
+                    {moneyFormat(this.getPrice)}
                   </span>
                   <del class={styles.delPrice}>
                     ¥{moneyFormat(product.originalPrice)}
@@ -278,35 +286,39 @@ export default defineComponent({
         )}
 
         {!this.loading && (
-          <ActionBar class={styles.actionBar}>
-            <ActionBarIcon
-              icon="cart-o"
-              // text="购物车"
-              onClick={() => {
-                this.$router.push('/cart')
-              }}
-              v-slots={{
-                icon: () => (
-                  <Badge content={this.cartCount} showZero={false}>
-                    <Icon name={iconShopCart} size={30} />
-                  </Badge>
-                )
-              }}
-            />
-            <div class={styles.buyGroup}>
-              <ActionBarButton
-                type="primary"
-                class={styles.addCertBtn}
-                text="加入购物车"
-                onClick={() => this.onShowCart()}
-              />
-              <ActionBarButton
-                type="primary"
-                text="立即购买"
-                onClick={() => this.onShowCart('cartConfirm')}
+          <>
+          
+            <ActionBar class={styles.actionBar}>
+              <ActionBarIcon
+                icon="cart-o"
+                // text="购物车"
+                onClick={() => {
+                  this.$router.push('/cart')
+                }}
+                v-slots={{
+                  icon: () => (
+                    <Badge content={this.cartCount} showZero={false}>
+                      <Icon name={iconShopCart} size={30} />
+                    </Badge>
+                  )
+                }}
               />
-            </div>
-          </ActionBar>
+              <div class={styles.buyGroup}>
+                <ActionBarButton
+                  type="primary"
+                  class={styles.addCertBtn}
+                  text="加入购物车"
+                  onClick={() => this.onShowCart()}
+                />
+                <ActionBarButton
+                  type="primary"
+                  text="立即购买"
+                  onClick={() => this.onShowCart('cartConfirm')}
+                />
+              </div>
+            </ActionBar>
+            <SubmitBar style={{display: 'none'}}></SubmitBar>
+          </>
         )}
         <Popup
           show={this.addGoodsShow}

+ 1 - 1
src/views/shop-mall/goods-list/index.module.less

@@ -21,7 +21,7 @@
 }
 .filterTagWrap {
   display: flex;
-  padding: 8px 0 0 14px;
+  padding: 6px 0 0 14px;
   flex-wrap: wrap;
   .filterTag {
     border: 1px solid var(--van-primary-color) !important;

+ 0 - 11
src/views/shop-mall/goods-list/index.tsx

@@ -227,17 +227,6 @@ export default defineComponent({
         </Sticky>
 
         <div class={styles.filterTagWrap}>
-          {/* {this.productCategory.id ? (
-            <Tag
-              class={styles.filterTag}
-              closeable={true}
-              onClose={() => this.onClearTag('productCategory')}
-            >
-              {this.productCategory.name}
-            </Tag>
-          ) : (
-            ''
-          )} */}
           {this.productAttributeCategory.id ? (
             <Tag
               class={styles.filterTag}

+ 10 - 0
src/views/shop-mall/index.module.less

@@ -12,8 +12,18 @@
     margin-right: 5px;
   }
 }
+.iconBadge{
+  :global{
+    .van-badge{
+      border: none;
+    }
+  }
+}
 .searchBox {
   :global {
+    .van-search{
+      padding-bottom: 0;
+    }
     .van-search .van-search__content {
       background-color: #fff !important;
     }

+ 11 - 3
src/views/shop-mall/index.tsx

@@ -1,5 +1,6 @@
 import ColHeader from '@/components/col-header'
 import {
+  Badge,
   Dialog,
   Divider,
   Icon,
@@ -89,10 +90,17 @@ export default defineComponent({
             v-slots={{
               right: () => (
                 <div class={styles['icon-shop-cart']}>
-                  {this.count > 0 && (
+                  {/* {this.count > 0 && (
                     <span class={styles.dot}>{this.count}</span>
-                  )}
-                  <Icon name={iconShopCart} size={24} />
+                  )} */}
+                  <Badge
+                    class={styles.iconBadge}
+                    showZero={false}
+                    color="rgba(236,92,50,1)"
+                    content={this.count}
+                  >
+                    <Icon name={iconShopCart} size={24} />
+                  </Badge>
                 </div>
               )
             }}