yuanyuan vor 3 Jahren
Ursprung
Commit
f6c8d65e53

BIN
src/assets/png-zhiding@3x.png


BIN
src/assets/weijiaru@3x.png


BIN
src/assets/yijiaru@3x.png


BIN
src/assets/yijiaruliebiao@3x.png


+ 61 - 6
src/components/product/SaleInfo.vue

@@ -30,7 +30,7 @@
             </div>
         </template>
         <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="getData">
-            <div @click="goDetail(item)" class="product-info" v-for="(item, index) in list" :key="index">
+            <div class="product-info" v-for="(item, index) in list" :key="index">
                 <div class="top">
                     <div class="user">
                         <van-image width="24" height="24" radius="24" :src="item.ownerAvatar" fit="cover" />
@@ -45,12 +45,20 @@
                     <div class="name">{{ item.name }}</div>
                     <div class="num" v-if="getNum(item)">#{{ getNum(item) }}</div>
                     <div class="num" v-else></div>
-                    <div class="buy" v-if="!item.soldOut">
+                    <div class="buy" v-if="!item.soldOut" @click="goDetail(item)">
                         <span>{{ !item.salable ? '去看看' : '去购买' }}</span>
 
                         <img src="../../assets/icon-jiantou2.png" alt="" />
                     </div>
                 </div>
+                <img
+                    :src="require('@assets/weijiaru@3x.png')"
+                    alt=""
+                    class="product-info_img"
+                    @click="onAddCart(item)"
+                    v-if="item.inCart == false"
+                />
+                <img :src="require('@assets/yijiaru@3x.png')" alt="" class="product-info_img" v-else />
             </div>
         </van-list>
     </van-action-sheet>
@@ -59,6 +67,7 @@
 <script>
 import { throwStatement } from '@babel/types';
 import list from '../../mixins/list';
+import { mapState } from 'vuex';
 export default {
     props: {
         info: {
@@ -84,11 +93,13 @@ export default {
                 price: 0
             },
             total: 0,
-            salable: true
+            salable: true,
+            timeId: 0
         };
     },
     mixins: [list],
     computed: {
+        ...mapState(['userInfo']),
         search() {
             if (this.info.prefixName) {
                 return this.info.prefixName;
@@ -104,6 +115,41 @@ export default {
         }
     },
     methods: {
+        onAddCart(info) {
+            if (this.timeId) {
+                clearTimeout(this.timeId);
+                this.timeId = 0;
+            }
+            this.timeId = setTimeout(() => {
+                this.addCarts(info);
+            }, 500);
+        },
+        addCarts(info) {
+            this.checkLogin().then(() => {
+                if (info.source == 'OFFICIAL') {
+                    this.$toast('官方藏品不能加入购物车');
+                    return;
+                }
+                if (this.userInfo.id == info.ownerId) {
+                    this.$toast('不能把自己的藏品加入购物车');
+                    return;
+                }
+                let id = info.id;
+                let data = {
+                    collectionId: id
+                };
+                this.$http
+                    .post('/cart/create', data)
+                    .then(res => {
+                        this.$toast.success('恭喜加入购物车');
+                        this.$emit('fatherMethod');
+                        this.getData(true);
+                    })
+                    .catch(e => {
+                        this.$toast(e.error);
+                    });
+            });
+        },
         changeSalable() {
             if (this.salable) {
                 this.salable = '';
@@ -274,7 +320,6 @@ export default {
         }
     }
 }
-
 /deep/.van-overlay {
     width: 100vw;
     height: 100vh;
@@ -291,9 +336,16 @@ export default {
     background: #f5f7fa;
     border-radius: 12px;
     margin: 12px 12px;
-    padding: 12px;
+    padding: 16px 12px;
     display: block;
-
+    position: relative;
+    .product-info_img {
+        width: 26px;
+        height: 16px;
+        position: absolute;
+        top: 0;
+        right: 0;
+    }
     .top {
         .flex();
         justify-content: space-between;
@@ -328,6 +380,9 @@ export default {
         }
 
         .price {
+            position: absolute;
+            top: 18px;
+            right: 12px;
             font-size: 16px;
             font-weight: bold;
             color: #000000;

+ 32 - 8
src/components/product/productInfo.vue

@@ -67,6 +67,7 @@
             </div>
             <div class="sold" v-else-if="isSold" style="color: #ff4f50">即将售罄</div>
         </div>
+        <img :src="require('@assets/yijiaruliebiao@3x.png')" alt="" class="product_img" v-if="info.inCart == true" />
     </div>
 </template>
 
@@ -146,14 +147,30 @@ export default {
             if (!this.usedBuy && this.info.source === 'TRANSFER') {
                 this.$toast('该通道暂且关闭');
             } else {
-                let query = {};
-                if (this.type) {
-                    query.type = this.type;
-                }
-                this.$router.push({
-                    path: '/productDetail/' + this.info.id,
-                    query
-                });
+                this.$http
+                    .get('/collection/get/' + this.info.id)
+                    .then(res => {
+                        let query = {};
+                        if (this.type) {
+                            query.type = this.type;
+                        }
+                        this.$router.push({
+                            path: '/productDetail/' + this.info.id,
+                            query
+                        });
+                    })
+                    .catch(e => {
+                        if (e && e.error) {
+                            this.$dialog
+                                .alert({
+                                    title: '提示',
+                                    message: '该藏品已被别人购买'
+                                })
+                                .then(res => {
+                                    this.$emit('fatherProduct');
+                                });
+                        }
+                    });
             }
         }
     }
@@ -252,6 +269,13 @@ export default {
         }
     }
 }
+.product_img {
+    width: 26px;
+    height: 16px;
+    position: absolute;
+    top: 0;
+    right: 0;
+}
 .price-content {
     display: flex;
     align-items: center;

+ 52 - 11
src/styles/app.less

@@ -46,15 +46,20 @@
 }
 
 * {
-    -webkit-touch-callout: none; /*系统默认菜单被禁用*/
+    -webkit-touch-callout: none;
+    /*系统默认菜单被禁用*/
 
-    -webkit-user-select: none; /*webkit浏览器*/
+    -webkit-user-select: none;
+    /*webkit浏览器*/
 
-    -khtml-user-select: none; /*早期浏览器*/
+    -khtml-user-select: none;
+    /*早期浏览器*/
 
-    -moz-user-select: none; /*火狐*/
+    -moz-user-select: none;
+    /*火狐*/
 
-    -ms-user-select: none; /*IE10*/
+    -ms-user-select: none;
+    /*IE10*/
 
     user-select: none;
 }
@@ -74,6 +79,7 @@ textarea {
 .van-divider::before {
     height: 5px;
 }
+
 html,
 body {
     padding: 0;
@@ -86,10 +92,12 @@ body {
     background-color: #272b2e;
     -webkit-font-smoothing: antialiased;
 }
+
 body {
     height: var(--app-height);
     overflow: hidden;
 }
+
 #app,
 .scroll-wrapper {
     padding: 0;
@@ -100,14 +108,17 @@ body {
     -webkit-overflow-scrolling: touch;
     -webkit-font-smoothing: antialiased;
 }
+
 .scroll-wrapper {
     overflow: auto;
     -webkit-overflow-scrolling: touch;
 }
+
 ::-webkit-scrollbar {
     display: none;
     opacity: 0;
 }
+
 input:-webkit-autofill {
     box-shadow: 0 0 0px 1000px @bg inset;
     -webkit-text-fill-color: @text0;
@@ -120,16 +131,20 @@ input:-webkit-autofill {
 .flex1 {
     flex-grow: 1;
 }
+
 .van-dialog {
     border-radius: 8px;
+
     .van-dialog__header {
         font-size: 16px;
         font-weight: bold;
         padding-top: 20px;
     }
+
     .van-hairline--left::after {
         border-color: #f2f4f5;
     }
+
     .van-hairline--top::after {
         border-color: #f2f4f5;
     }
@@ -138,6 +153,7 @@ input:-webkit-autofill {
         padding: 20px 40px 30px;
     }
 }
+
 // .van-dialog__footer {
 //     .van-button--default {
 //         // color: #626366;
@@ -160,18 +176,21 @@ input:-webkit-autofill {
 }
 
 .van-tab {
-    color: @text3 !important;
+    color: @text3  !important;
     font-size: @font2;
+
     &.van-tab--active {
-        color: @prim !important;
+        color: @prim  !important;
         font-weight: bold;
     }
+
     padding: 0 0 !important;
     flex-shrink: 0 !important;
     flex-grow: 0 !important;
     margin-right: 50px;
     word-break: keep-all;
 }
+
 .van-tabs__nav--line.van-tabs__nav--complete {
     padding-left: 16px !important;
     padding-right: 16px !important;
@@ -182,20 +201,24 @@ input:-webkit-autofill {
 .van-tabs__line {
     bottom: 20px;
 }
+
 .van-sticky--fixed {
     background-color: @bg;
 }
+
 .van-tab--active {
     .tab {
         .van-icon-arrow-up {
             color: #646566;
         }
     }
+
     &.asc {
         .tab {
             .van-icon-arrow-up {
                 color: @prim;
             }
+
             .van-icon-arrow-down {
                 color: #646566;
             }
@@ -216,6 +239,7 @@ input:-webkit-autofill {
 .van-tabs.dark {
     background-color: #181818;
 }
+
 .van-nav-bar.dark {
     background-color: #181818;
 }
@@ -237,10 +261,12 @@ input:-webkit-autofill {
     // background-size: content;
     // background-attachment: fixed;
 }
+
 .van-key--blue {
-    background-color: @prim!important;
+    background-color: @prim  !important;
     font-size: 16px;
 }
+
 .splash-screen {
     position: fixed;
     width: 100vw;
@@ -259,6 +285,7 @@ input:-webkit-autofill {
 .activeAvatar {
     // overflow: initial !important;
     padding: 0.5%;
+
     // background-color: #fff;
     img {
         border-radius: 100px;
@@ -275,7 +302,9 @@ input:-webkit-autofill {
         box-sizing: border-box;
         // box-shadow: 0px 0px 6px 0px rgba(38, 245, 13, 0.6);
     }
+
     position: relative;
+
     &::after {
         content: '';
         background-image: url(https://cdn.raex.vip/png-touxiangkuang.png);
@@ -291,9 +320,11 @@ input:-webkit-autofill {
 
 .darkTabs {
     background-color: #222426;
+
     .van-tab.van-tab--active {
         color: #43ce00 !important;
     }
+
     .van-tabs__line {
         background-color: #43ce00 !important;
         width: 16px;
@@ -305,9 +336,11 @@ input:-webkit-autofill {
     .van-tab.van-tab--active {
         color: #00fe1e !important;
     }
+
     .van-tabs__line {
         background-color: #00fe1e !important;
     }
+
     .van-tabs__nav--line.van-tabs__nav--complete {
         border-top-width: 0;
     }
@@ -320,28 +353,34 @@ input:-webkit-autofill {
         padding: 0 16px;
     }
 }
+
 .saleSheet {
-    min-height: 80vh;
-    max-height: 80vh;
+    min-height: calc(92vh - 1.5px);
+    max-height: calc(92vh - 1.5px);
+
     .van-action-sheet__header {
         border-bottom-width: 0px;
         font-size: 16px;
         font-weight: bold;
     }
+
     .van-action-sheet__description {
         text-align: left;
         padding: 0px 16px 0;
+
         &::after {
             content: none;
         }
     }
 }
+
 .padding-safe-top {
     padding-top: var(--safe-top);
 }
 
 .van-dialog {
     width: 260px;
+
     .van-dialog__message--has-title {
         color: #939599;
         padding: 16px 23px 20px;
@@ -355,8 +394,10 @@ input:-webkit-autofill {
 .risk {
     background-color: transparent;
     width: auto;
+
     .van-action-bar {
         padding: 10px 16px;
+
         .van-action-bar-button {
             border-radius: 4px;
         }
@@ -366,4 +407,4 @@ input:-webkit-autofill {
 .preSticky {
     position: relative;
     z-index: 99;
-}
+}

+ 4 - 0
src/views/Discover.vue

@@ -265,6 +265,7 @@
                         v-if="sort === 'collection_MY' || sort === 'domain' || sort === 'collection'"
                         v-model:info="list[index]"
                         dark
+                        @fatherProduct="fatherProduct"
                     >
                     </product-info>
                     <!-- <prefixName-info v-if="sort === 'collection'" v-model:info="list[index]" dark></prefixName-info> -->
@@ -434,6 +435,9 @@ export default {
         });
     },
     methods: {
+        fatherProduct() {
+            this.getList(true);
+        },
         artSelection(name) {
             if (name == '铸造活动') {
                 this.$router.push('/activityList');

+ 1 - 1
src/views/activity/List.vue

@@ -50,7 +50,7 @@
                             <div class="flex1"></div>
                             <div class="text2">
                                 <span v-if="item.startTime">
-                                    开始时间:{{ dayjs(item.startTime).format('MM-DD') }}</span
+                                    开始时间:{{ dayjs(item.startTime).format('MM-DD HH:mm') }}</span
                                 >
                                 <div class="flex1"></div>
                                 <div class="btn" v-if="active == 'ACTIVE'">

+ 35 - 1
src/views/product/Detail.vue

@@ -105,6 +105,7 @@
                             ref="sale"
                             :info="info"
                             :blindBoxItems="blindBoxItems"
+                            @fatherMethod="fatherMethod"
                         ></sale-info>
 
                         <tasks
@@ -707,6 +708,10 @@
         <div class="back-content" @click="goBack">
             <img src="@assets/icon_fanhui2.png" alt="" />
         </div>
+        <div class="shopping_cart" v-if="cartNum != 0" @click="$router.push('/shoppingCart')">
+            <img :src="require('@assets/png-zhiding@3x.png')" alt="" class="shopping_cart_img" />
+            <div class="shopping_cart_num">{{ cartNum }}</div>
+        </div>
         <!-- <driver /> -->
 
         <!-- <driver /> -->
@@ -868,6 +873,9 @@ export default {
         // }
     },
     methods: {
+        fatherMethod() {
+            this.getCartNum();
+        },
         goSearch() {
             this.setKeeps(['productSearch'], false);
             this.$router.push(`/productSearch?search=${this.info.prefixName}`);
@@ -2563,7 +2571,33 @@ export default {
         z-index: 1;
     }
 }
-
+.shopping_cart {
+    width: 48px;
+    height: 48px;
+    position: fixed;
+    right: 8px;
+    bottom: 66px;
+    z-index: 9999;
+    .shopping_cart_img {
+        width: 48px;
+        height: 48px;
+    }
+    .shopping_cart_num {
+        width: 19px;
+        height: 14px;
+        background: #ffffff;
+        border-radius: 8px;
+        border: 1px solid #ff6d2a;
+        font-size: 10px;
+        font-weight: bold;
+        color: #ff602a;
+        line-height: 14px;
+        text-align: center;
+        position: absolute;
+        top: 0px;
+        right: 0px;
+    }
+}
 /deep/.van-collapse-item__content {
     padding: 12px 16px !important;
     background-color: #131313 !important;

+ 9 - 1
src/views/product/HopeMarket.vue

@@ -191,7 +191,12 @@
                 @load="getData"
             >
                 <template v-for="(item, index) in showList" :key="index">
-                    <product-info dark v-model:info="list[index]" @update:info="init"></product-info>
+                    <product-info
+                        dark
+                        v-model:info="list[index]"
+                        @update:info="init"
+                        @fatherProduct="fatherProduct"
+                    ></product-info>
                 </template>
 
                 <van-empty
@@ -388,6 +393,9 @@ export default {
         });
     },
     methods: {
+        fatherProduct() {
+            this.getData(true);
+        },
         selectEvent(info) {
             this.setting = info.setting;
             this.search = info.search;

+ 4 - 1
src/views/product/MetaDomain.vue

@@ -83,7 +83,7 @@
                 @load="getList"
             >
                 <template v-for="(item, index) in list" :key="item.id">
-                    <product-info v-model:info="list[index]" domain></product-info>
+                    <product-info v-model:info="list[index]" domain @fatherProduct="fatherProduct"></product-info>
                 </template>
                 <van-empty
                     :image="require('@assets/empty_img_asset_dark.png')"
@@ -360,6 +360,9 @@ export default {
         ProductInfo
     },
     methods: {
+        fatherProduct() {
+            this.getList(true);
+        },
         onInput(e) {
             if (e.key === 'Enter') {
                 this.$nextTick(() => {