panhui 4 éve
szülő
commit
e1a84d13b9

BIN
src/assets/manghe.png


+ 24 - 14
src/components/asset/assetInfo.vue

@@ -9,25 +9,35 @@
         class="product"
         @click="click"
     >
-        <van-image width="100%" height="calc(45vw - 21.6px)" :src="getImg(changeImgs(info.pic))" fit="cover" />
-        <div class="number" v-if="info.number">编号:{{ info.number }}</div>
+        <van-image
+            v-if="opened === false"
+            width="100%"
+            height="calc(45vw - 21.6px)"
+            :src="require('../../assets/manghe.png')"
+            fit="cover"
+        />
+        <van-image v-else width="100%" height="calc(45vw - 21.6px)" :src="getImg(changeImgs(info.pic))" fit="cover" />
+        <div class="number" v-if="info.number && opened">编号:{{ info.number }}</div>
 
         <div class="content">
             <div class="name van-ellipsis">
-                {{ info.name }}
+                {{ !opened ? '盲盒待开启' : info.name }}
             </div>
-            <div class="price-content" v-if="info.consignment">
-                <div class="price">
-                    <img src="@assets/jiage_huang.png" alt="" />
-                    <span>{{ info.sellPrice }}</span>
+            <template v-if="opened">
+                <div class="price-content" v-if="info.consignment">
+                    <div class="price">
+                        <img src="@assets/jiage_huang.png" alt="" />
+                        <span>{{ info.sellPrice }}</span>
+                    </div>
                 </div>
-            </div>
-            <div class="status" v-else-if="info.status === 'NORMAL'">
-                {{ info.publicShow ? '仅展示' : '未展示' }}
-            </div>
-            <div class="status" v-else>
-                {{ getLabelName(info.status, assetStatusOptions) }}
-            </div>
+                <div class="status" v-else-if="info.status === 'NORMAL'">
+                    {{ info.publicShow ? '仅展示' : '未展示' }}
+                </div>
+                <div class="status" v-else>
+                    {{ getLabelName(info.status, assetStatusOptions) }}
+                </div>
+            </template>
+            <div v-else class="status" style="min-height: 24px"></div>
             <div class="text">
                 <div class="minter">
                     <van-image width="18" height="18" radius="18" :src="info.minterAvatar" fit="cover" />

+ 2 - 2
src/components/order/OrderOpen.vue

@@ -44,6 +44,7 @@ export default {
     },
     methods: {
         open() {
+            this.$emit('getProduct');
             this.$http.post('/order/open?id=' + this.id);
             this.addClass('img2', 'animate__rollOut', false)
                 .then(() => {
@@ -58,9 +59,8 @@ export default {
                 .then(() => {
                     this.showProduct = true;
                 });
-        },
+        }
         //组件名,动画名,展示(true:出现,false:消失)
-        
     }
 };
 </script>

+ 10 - 3
src/components/product/ProductBanner.vue

@@ -11,10 +11,16 @@
                     <!-- <div class="video-box" v-if="isVideo(item)">
                         <van-icon color="#fff" size="60" name="play-circle" />
                     </div> -->
-
+                    <van-image
+                        v-if="opened === false"
+                        width="calc(100vw - 134px)"
+                        height="calc(100vw - 134px)"
+                        :src="require('../../assets/manghe.png')"
+                        fit="cover"
+                    />
                     <video
                         class="swiper-video"
-                        v-if="isVideo(item)"
+                        v-else-if="isVideo(item)"
                         :src="item.url"
                         controls
                         :poster="getImg(changeImgs([item]), '', 1200)"
@@ -58,6 +64,7 @@ import 'swiper/swiper.min.css';
 import 'swiper/swiper-bundle.min.css';
 
 import product from '../../mixins/product';
+import asset from '../../mixins/asset';
 import Post from '../Post.vue';
 import ThreeMode from './ThreeMode.vue';
 import { ImagePreview } from 'vant';
@@ -74,7 +81,7 @@ export default {
             default: 'product'
         }
     },
-    mixins: [product],
+    mixins: [product, asset],
     components: {
         Swiper,
         SwiperSlide,

+ 5 - 0
src/mixins/asset.js

@@ -28,5 +28,10 @@ export default {
                 }
             ]
         };
+    },
+    computed: {
+        opened() {
+            return this.info ? this.info.opened : true;
+        }
     }
 };

+ 67 - 56
src/views/Mine.vue

@@ -100,63 +100,66 @@
                 </div>
             </div>
         </div>
-        <van-cell class="title" title="我的订单" :border="false" />
+        <div class="card">
+            <van-cell class="title" title="我的订单" :border="false" />
 
-        <div class="orderList">
-            <div class="order-info" @click="$router.push('/orders?type=DEFAULT')">
-                <img src="@assets/info_icon_shangpindingdan.png" alt="" />
-                <span>作品订单</span>
-            </div>
-            <div class="order-info" @click="$router.push('/activityOrders')" v-if="!$store.state.review">
-                <img src="@assets/info_icon_zhuzaodingdan.png" alt="" />
-                <span>铸造订单</span>
+            <div class="orderList">
+                <div class="order-info" @click="$router.push('/orders?type=DEFAULT')">
+                    <img src="@assets/info_icon_shangpindingdan.png" alt="" />
+                    <span>作品订单</span>
+                </div>
+                <div class="order-info" @click="$router.push('/activityOrders')" v-if="!$store.state.review">
+                    <img src="@assets/info_icon_zhuzaodingdan.png" alt="" />
+                    <span>铸造订单</span>
+                </div>
             </div>
         </div>
-
-        <van-cell class="title" title="我的服务" :border="false" />
-
-        <van-grid class="menus" :border="false">
-            <van-grid-item text="我的银行卡" :to="{ path: '/mineBanks' }">
-                <template #icon>
-                    <van-icon :name="require('@assets/icon_yinhangka.png')" class="search-icon" />
-                </template>
-            </van-grid-item>
-            <van-grid-item text="我的积分" @click="wait" v-if="!$store.state.review">
-                <template #icon>
-                    <van-icon :name="require('@assets/icon-jifen.png')" class="search-icon" />
-                </template>
-            </van-grid-item>
-            <van-grid-item text="我赞过的" :to="{ path: '/mineLikes' }">
-                <template #icon>
-                    <van-icon :name="require('@assets/icon-dianzan1.png')" class="search-icon" />
-                </template>
-            </van-grid-item>
-            <van-grid-item text="地址管理" :to="{ path: '/mineAddress' }" v-if="!$store.state.review">
-                <template #icon>
-                    <van-icon :name="require('@assets/icon_dizhi.png')" class="search-icon" />
-                </template>
-            </van-grid-item>
-            <van-grid-item text="交易历史" :to="{ path: '/mineExchange' }">
-                <template #icon>
-                    <van-icon :name="require('@assets/info_icon_jiaoyijilu.png')" class="search-icon" />
-                </template>
-            </van-grid-item>
-            <van-grid-item text="了解更多" :to="{ path: '/question' }">
-                <template #icon>
-                    <van-icon :name="require('@assets/icon_liaojiegengduo.png')" class="search-icon" />
-                </template>
-            </van-grid-item>
-            <van-grid-item text="关于我们" :to="{ path: '/about' }">
-                <template #icon>
-                    <van-icon :name="require('@assets/icon-guanyuwomen.png')" class="search-icon" />
-                </template>
-            </van-grid-item>
-            <van-grid-item text="账号与安全" :to="{ path: '/security' }">
-                <template #icon>
-                    <van-icon :name="require('@assets/icon-anquan.png')" class="search-icon" />
-                </template>
-            </van-grid-item>
-        </van-grid>
+        <div class="card">
+            <van-cell class="title" title="我的服务" :border="false" />
+
+            <van-grid class="menus" :border="false">
+                <van-grid-item text="我的银行卡" :to="{ path: '/mineBanks' }">
+                    <template #icon>
+                        <van-icon :name="require('@assets/icon_yinhangka.png')" class="search-icon" />
+                    </template>
+                </van-grid-item>
+                <van-grid-item text="我的积分" @click="wait" v-if="!$store.state.review">
+                    <template #icon>
+                        <van-icon :name="require('@assets/icon-jifen.png')" class="search-icon" />
+                    </template>
+                </van-grid-item>
+                <van-grid-item text="我赞过的" :to="{ path: '/mineLikes' }">
+                    <template #icon>
+                        <van-icon :name="require('@assets/icon-dianzan1.png')" class="search-icon" />
+                    </template>
+                </van-grid-item>
+                <van-grid-item text="地址管理" :to="{ path: '/mineAddress' }" v-if="!$store.state.review">
+                    <template #icon>
+                        <van-icon :name="require('@assets/icon_dizhi.png')" class="search-icon" />
+                    </template>
+                </van-grid-item>
+                <van-grid-item text="交易历史" :to="{ path: '/mineExchange' }">
+                    <template #icon>
+                        <van-icon :name="require('@assets/info_icon_jiaoyijilu.png')" class="search-icon" />
+                    </template>
+                </van-grid-item>
+                <van-grid-item text="了解更多" :to="{ path: '/question' }">
+                    <template #icon>
+                        <van-icon :name="require('@assets/icon_liaojiegengduo.png')" class="search-icon" />
+                    </template>
+                </van-grid-item>
+                <van-grid-item text="关于我们" :to="{ path: '/about' }">
+                    <template #icon>
+                        <van-icon :name="require('@assets/icon-guanyuwomen.png')" class="search-icon" />
+                    </template>
+                </van-grid-item>
+                <van-grid-item text="账号与安全" :to="{ path: '/security' }">
+                    <template #icon>
+                        <van-icon :name="require('@assets/icon-anquan.png')" class="search-icon" />
+                    </template>
+                </van-grid-item>
+            </van-grid>
+        </div>
 
         <div class="tabbar-placeholder"></div>
 
@@ -280,12 +283,14 @@ export default {
 }
 
 /deep/ .title {
-    padding: 20px 16px 10px;
+    padding: 12px 12px 6px;
+    border-bottom: 1px solid @bg3;
     .van-cell__title {
         span {
             font-size: @font3;
             line-height: 28px;
             color: @text0;
+            font-weight: bold;
         }
     }
 
@@ -302,7 +307,7 @@ export default {
 }
 .orderList {
     .flex();
-    padding: 0 16px;
+    padding: 0 12px;
     .order-info {
         padding: 20px 0;
         position: relative;
@@ -544,4 +549,10 @@ export default {
 .edit {
     color: @text3;
 }
+
+.card {
+    box-shadow: 0px 2px 6px 0px rgba(200, 201, 204, 0.3);
+    border-radius: 12px;
+    margin: 16px;
+}
 </style>

+ 139 - 110
src/views/Submit.vue

@@ -111,7 +111,8 @@ export default {
             enable_wx_pub: false,
             launchName: '',
             launchPath: '',
-            createOrderTimer: null
+            createOrderTimer: null,
+            timerNum: 0
         };
     },
     computed: {
@@ -208,7 +209,31 @@ export default {
                 if (this.timer) {
                     clearTimeout(this.timer);
                 }
-                if (res.status === 'PROCESSING' || res.status === 'FINISH' || res.status === 'CANCELLED') {
+                if (this.timerNum >= 20) {
+                    this.$toast.clear();
+                    this.$dialog
+                        .confirm({
+                            title: '提示',
+                            message: '订单是否已经支付',
+                            confirmButtonText: '已经支付',
+                            cancelButtonText: '暂未支付,立即支付'
+                        })
+                        .then(() => {
+                            this.$dialog
+                                .alert({
+                                    title: '稍等一下哦',
+                                    message:
+                                        '前方发生拥堵,工程师小哥哥正在加急处理,下单的藏品后续会直接出现在藏品室哦~'
+                                })
+                                .then(res => {
+                                    this.$router.back();
+                                });
+                        })
+                        .catch(e => {
+                            this.timerNum = 0;
+                            this.pay();
+                        });
+                } else if (res.status === 'PROCESSING' || res.status === 'FINISH' || res.status === 'CANCELLED') {
                     this.$toast.clear();
                     this.$dialog
                         .alert({
@@ -225,6 +250,7 @@ export default {
                             // on close
                         });
                 } else if (next) {
+                    this.timerNum += 1;
                     this.timer = setTimeout(() => {
                         this.getOrder(next);
                     }, 1500);
@@ -304,114 +330,8 @@ export default {
             }
             this.createOrder()
                 .then(res => {
-                    if (this.money) {
-                        this.$toast.clear();
-                        this.orderId = res.id;
-                        this.$router.replace({ query: { ...this.$route.query, orderId: res.id } });
-                        this.$nextTick(() => {
-                            if (this.$store.state.review) {
-                                window.store.order('358');
-                                this.getOrder(true);
-                            } else if (this.payType === 'ALIPAY') {
-                                if (this.inWeixin) {
-                                    document.location.replace(
-                                        resolveUrl(this.$baseUrl, '/payOrder/alipay_wx?id=' + res.id)
-                                    );
-                                } else {
-                                    this.$http
-                                        .get(`/payOrder/${this.inApp ? 'alipay_app' : 'alipay_h5'}?id=${res.id}`)
-                                        .then(res => {
-                                            this.$toast.clear();
-                                            this.hrefUrl = 'alipays://platformapi/startapp?saId=10000007&qrcode=' + res;
-                                            // window.open(
-                                            //     'alipays://platformapi/startapp?saId=10000007&qrcode=' + res,
-                                            //     '_blank'
-                                            // );
-                                            this.$nextTick(() => {
-                                                document.getElementById('pay').click();
-                                            });
-
-                                            this.$toast.loading({
-                                                message: '加载中...',
-                                                forbidClick: true
-                                            });
-                                            this.getOrder(true);
-                                        })
-                                        .catch(e => {
-                                            if (e.error) {
-                                                this.$toast(e.error);
-                                            }
-                                        });
-                                }
-                            } else if (this.payType === 'WEIXIN') {
-                                this.$toast.loading('加载中');
-                                this.$http
-                                    .post('/payOrder/weixin', {
-                                        id: res.id,
-                                        channel: this.payChannel,
-                                        openId: localStorage.getItem('openId') || 'oWJG55wLnwdVzXoKka1-DzQKOd_Y'
-                                    })
-                                    .then(res => {
-                                        if ('wx_pub' === this.payChannel) {
-                                            console.log('wxPayParams', res);
-                                            wx.chooseWXPay({
-                                                ...res,
-                                                success(res) {
-                                                    this.$toast.success('支付成功');
-                                                    setTimeout(() => {
-                                                        this.$router.replace('/orders');
-                                                    }, 1000);
-                                                },
-                                                fail(e) {
-                                                    console.log(e);
-                                                    this.$toast('支付失败,请稍后再试');
-                                                }
-                                            });
-                                        } else {
-                                            this.$toast.clear();
-                                            this.hrefUrl = res.scheme_code;
-                                            this.$nextTick(() => {
-                                                document.getElementById('pay').click();
-                                            });
-
-                                            this.$toast.loading({
-                                                message: '加载中...',
-                                                forbidClick: true
-                                            });
-                                            this.getOrder(true);
-                                        }
-                                        // console.log({
-                                        //     ...res,
-                                        //     package: res.package || res.packageValue
-                                        // });
-                                        // let _this = this;
-                                        // wx.chooseWXPay({
-                                        //     ...res,
-                                        //     package: res.package || res.packageValue,
-                                        //     timestamp: res.timeStamp,
-                                        //     success(res) {
-                                        //         _this.$toast.success('支付成功');
-                                        //         setTimeout(() => {
-                                        //             _this.$router.replace('/orders');
-                                        //         }, 1000);
-                                        //     },
-                                        //     fail(e) {
-                                        //         console.log(e);
-                                        //         _this.$toast('支付失败,请稍后再试');
-                                        //     }
-                                        // });
-                                    })
-                                    .catch(e => {
-                                        this.$toast(e.error || '支付失败请稍后再试');
-                                    });
-                            }
-                        });
-                    } else {
-                        this.$toast.success('支付成功');
-                        setTimeout(() => {
-                            this.$router.replace('/orderDetail?id=' + res.id);
-                        }, 1000);
-                    }
+                    this.orderId = res.id;
+                    this.pay();
                 })
                 .catch(e => {
                     if (e) {
@@ -419,6 +339,115 @@ export default {
                     }
                 });
         },
+        pay() {
+            if (this.money) {
+                this.$toast.clear();
+                this.$router.replace({ query: { ...this.$route.query, orderId: this.orderId } });
+                this.$nextTick(() => {
+                    if (this.$store.state.review) {
+                        window.store.order('358');
+                        this.getOrder(true);
+                    } else if (this.payType === 'ALIPAY') {
+                        if (this.inWeixin) {
+                            document.location.replace(
+                                resolveUrl(this.$baseUrl, '/payOrder/alipay_wx?id=' + this.orderId)
+                            );
+                        } else {
+                            this.$http
+                                .get(`/payOrder/${this.inApp ? 'alipay_app' : 'alipay_h5'}?id=${this.orderId}`)
+                                .then(res => {
+                                    this.$toast.clear();
+                                    this.hrefUrl = 'alipays://platformapi/startapp?saId=10000007&qrcode=' + res;
+                                    // window.open(
+                                    //     'alipays://platformapi/startapp?saId=10000007&qrcode=' + res,
+                                    //     '_blank'
+                                    // );
+                                    this.$nextTick(() => {
+                                        document.getElementById('pay').click();
+                                    });
+
+                                    this.$toast.loading({
+                                        message: '加载中...',
+                                        forbidClick: true
+                                    });
+                                    this.getOrder(true);
+                                })
+                                .catch(e => {
+                                    if (e.error) {
+                                        this.$toast(e.error);
+                                    }
+                                });
+                        }
+                    } else if (this.payType === 'WEIXIN') {
+                        this.$toast.loading('加载中');
+                        this.$http
+                            .post('/payOrder/weixin', {
+                                id: this.orderId,
+                                channel: this.payChannel,
+                                openId: localStorage.getItem('openId') || 'oWJG55wLnwdVzXoKka1-DzQKOd_Y'
+                            })
+                            .then(res => {
+                                if ('wx_pub' === this.payChannel) {
+                                    console.log('wxPayParams', res);
+                                    wx.chooseWXPay({
+                                        ...res,
+                                        success(res) {
+                                            this.$toast.success('支付成功');
+                                            setTimeout(() => {
+                                                this.$router.replace('/orders');
+                                            }, 1000);
+                                        },
+                                        fail(e) {
+                                            console.log(e);
+                                            this.$toast('支付失败,请稍后再试');
+                                        }
+                                    });
+                                } else {
+                                    this.$toast.clear();
+                                    this.hrefUrl = res.scheme_code;
+                                    this.$nextTick(() => {
+                                        document.getElementById('pay').click();
+                                    });
+
+                                    this.$toast.loading({
+                                        message: '加载中...',
+                                        forbidClick: true
+                                    });
+                                    this.getOrder(true);
+                                }
+                                // console.log({
+                                //     ...res,
+                                //     package: res.package || res.packageValue
+                                // });
+                                // let _this = this;
+                                // wx.chooseWXPay({
+                                //     ...res,
+                                //     package: res.package || res.packageValue,
+                                //     timestamp: res.timeStamp,
+                                //     success(res) {
+                                //         _this.$toast.success('支付成功');
+                                //         setTimeout(() => {
+                                //             _this.$router.replace('/orders');
+                                //         }, 1000);
+                                //     },
+                                //     fail(e) {
+                                //         console.log(e);
+                                //         _this.$toast('支付失败,请稍后再试');
+                                //     }
+                                // });
+                            })
+                            .catch(e => {
+                                this.$toast(e.error || '支付失败请稍后再试');
+                            });
+                    }
+                });
+            } else {
+                this.$toast.success('支付成功');
+                setTimeout(() => {
+                    this.$router.replace('/orderDetail?id=' + this.orderId);
+                }, 1000);
+            }
+        },
         goCoupon() {
             if (!this.orderId) {
                 this.$router.push('/couponList?collectionId=' + this.info.id);

+ 17 - 1
src/views/asset/Detail.vue

@@ -320,6 +320,13 @@
                 </div>
             </van-popup>
         </div>
+
+        <order-open
+            ref="box"
+            @getProduct="getProduct(true)"
+            :id="orderInfo.id"
+            :imgSrc="getImg(changeImgs(info.pic))"
+        ></order-open>
     </div>
 </template>
 
@@ -333,11 +340,13 @@ import { Dialog } from 'vant';
 import HashCode from '../../components/product/HashCode.vue';
 import ProductTitle from '../../components/product/ProductTitle.vue';
 import ProductBanner from '../../components/product/ProductBanner.vue';
+import OrderOpen from '../../components/order/OrderOpen.vue';
 export default {
     components: {
         HashCode,
         ProductTitle,
-        ProductBanner
+        ProductBanner,
+        OrderOpen
     },
     mixins: [asset, product],
     data() {
@@ -585,6 +594,10 @@ export default {
                 if (res.orderId) {
                     this.$http.get('/order/get/' + res.orderId).then(res => {
                         this.orderInfo = res;
+                        if (this.orderInfo.type === 'BLIND_BOX' && !this.orderInfo.opened) {
+                            this.$toast.clear();
+                            this.openBlindBox();
+                        }
                     });
                 }
                 wx.updateAppMessageShareData({
@@ -627,6 +640,9 @@ export default {
                 }
             });
         },
+        openBlindBox() {
+            this.$refs.box.show = true;
+        },
         likeProduct() {
             if (!this.info.liked) {
                 this.$http.get(`/collection/${this.info.id}/like`).then(() => {