xuqiang 4 лет назад
Родитель
Сommit
c826b5a47e

+ 1 - 0
src/main/nine-space/package.json

@@ -15,6 +15,7 @@
     "better-scroll": "^2.4.2",
     "better-scroll": "^2.4.2",
     "clipboard": "^2.0.8",
     "clipboard": "^2.0.8",
     "core-js": "^3.6.5",
     "core-js": "^3.6.5",
+    "dayjs": "^1.10.7",
     "echarts": "^4.9.0",
     "echarts": "^4.9.0",
     "html2canvas": "^1.3.2",
     "html2canvas": "^1.3.2",
     "lodash": "^4.17.21",
     "lodash": "^4.17.21",

+ 24 - 16
src/main/nine-space/src/components/Post.vue

@@ -4,7 +4,8 @@
             <div class="wrapper">
             <div class="wrapper">
                 <div class="img" ref="wrap"></div>
                 <div class="img" ref="wrap"></div>
                 <div class="content" v-if="!img" ref="post" @click.stop>
                 <div class="content" v-if="!img" ref="post" @click.stop>
-                    <van-image :src="getImg(info.pic)" width="80vw" height="80vw" fit="cover" @load="loadImg" />
+                    <!-- @load="loadImg" -->
+                    <van-image :src="banners" width="80vw" height="80vw" fit="cover" />
                     <div class="info">
                     <div class="info">
                         <div class="name van-multi-ellipsis--l2">
                         <div class="name van-multi-ellipsis--l2">
                             {{ info.name }}
                             {{ info.name }}
@@ -34,17 +35,19 @@
                 <div class="tips">长按图片保存</div>
                 <div class="tips">长按图片保存</div>
             </div>
             </div>
         </van-overlay>
         </van-overlay>
-        <!-- <div class="share" @click="init">
-      <img src="../assets/svgs/icon-share.svg" alt="" />
-      <span>分享</span>
-    </div> -->
+        <div class="share" @click="init">
+            <img src="../assets/svgs/icon-share.svg" alt="" />
+            <span>分享</span>
+        </div>
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
 import vueQrcode from '@chenfengyuan/vue-qrcode';
 import vueQrcode from '@chenfengyuan/vue-qrcode';
 import html2canvas from 'html2canvas';
 import html2canvas from 'html2canvas';
+import product from '../mixins/product';
 const path = require('path');
 const path = require('path');
 export default {
 export default {
+    mixins: [product],
     props: {
     props: {
         info: {
         info: {
             type: Object,
             type: Object,
@@ -67,13 +70,18 @@ export default {
     computed: {
     computed: {
         url() {
         url() {
             return path.resolve(this.$baseUrl, this.pageUrl + '?id=' + this.info.id);
             return path.resolve(this.$baseUrl, this.pageUrl + '?id=' + this.info.id);
+        },
+        banners() {
+            return this.info.pic[0].url || [];
         }
         }
     },
     },
     components: {
     components: {
         vueQrcode
         vueQrcode
     },
     },
+    mounted() {},
     methods: {
     methods: {
         init() {
         init() {
+            console.log(this.info.pic[0].url);
             if (!this.img) {
             if (!this.img) {
                 this.$toast.loading({
                 this.$toast.loading({
                     message: '加载中...',
                     message: '加载中...',
@@ -82,18 +90,18 @@ export default {
             }
             }
 
 
             this.show = true;
             this.show = true;
-        },
-        loadImg() {
-            setTimeout(() => {
-                html2canvas(this.$refs.post).then(canvas => {
-                    this.$toast.clear();
-                    this.$refs.wrap.appendChild(canvas);
-                    this.$nextTick(() => {
-                        this.img = true;
-                    });
-                });
-            }, 100);
         }
         }
+        // loadImg() {
+        //     setTimeout(() => {
+        //         html2canvas(this.$refs.post).then(canvas => {
+        //             this.$toast.clear();
+        //             this.$refs.wrap.appendChild(canvas);
+        //             this.$nextTick(() => {
+        //                 this.img = true;
+        //             });
+        //         });
+        //     }, 100);
+        // }
     }
     }
 };
 };
 </script>
 </script>

+ 4 - 0
src/main/nine-space/src/mixins/common.js

@@ -62,6 +62,9 @@ export default {
             });
             });
         },
         },
         getImg(imgs = '', type = '', size = 600) {
         getImg(imgs = '', type = '', size = 600) {
+            // console.log(imgs);
+            // console.log(type);
+            // console.log(size);
             if (!imgs) {
             if (!imgs) {
                 imgs = '';
                 imgs = '';
             }
             }
@@ -74,6 +77,7 @@ export default {
             });
             });
             if (imgs.length > 0) {
             if (imgs.length > 0) {
                 let img = type ? imgs[0][type] : imgs[0];
                 let img = type ? imgs[0][type] : imgs[0];
+                // console.log(img);
                 return img + (/\.gif$/i.test(img) ? '' : `?x-oss-process=image/resize,h_${size},m_lfit`);
                 return img + (/\.gif$/i.test(img) ? '' : `?x-oss-process=image/resize,h_${size},m_lfit`);
             } else {
             } else {
                 return '';
                 return '';

+ 47 - 1
src/main/nine-space/src/mixins/product.js

@@ -1,3 +1,12 @@
+import dayjs from 'dayjs';
+require('dayjs/locale/zh-cn');
+dayjs.locale('zh-cn');
+var relativeTime = require('dayjs/plugin/relativeTime');
+dayjs.extend(relativeTime);
+var calendar = require('dayjs/plugin/calendar');
+dayjs.extend(calendar);
+var duration = require('dayjs/plugin/duration');
+dayjs.extend(duration);
 export default {
 export default {
     data() {
     data() {
         return {
         return {
@@ -24,11 +33,27 @@ export default {
                     label: '视频',
                     label: '视频',
                     value: 'video/mp4'
                     value: 'video/mp4'
                 }
                 }
-            ]
+            ],
+            startTime: ''
         };
         };
     },
     },
+    computed: {
+        bannerList() {
+            return [...this.changeImgs(this.banners)].map(item => {
+                return this.getImg(item, '', 800);
+            });
+        },
+        isAppointment() {
+            if (this.info.startTime) {
+                return dayjs().isBefore(dayjs(this.info.startTime));
+            } else {
+                return false;
+            }
+        }
+    },
     methods: {
     methods: {
         changeImgs(list = []) {
         changeImgs(list = []) {
+            console.log(list);
             return list.map(item => {
             return list.map(item => {
                 if (item.type === 'video/mp4') {
                 if (item.type === 'video/mp4') {
                     return item.thumb;
                     return item.thumb;
@@ -39,6 +64,27 @@ export default {
         },
         },
         isVideo(info = {}) {
         isVideo(info = {}) {
             return info.type === 'video/mp4';
             return info.type === 'video/mp4';
+        },
+        getTime(startTime) {
+            console.log(22);
+            if (!startTime) {
+                return;
+            }
+            if (!this.isAppointment) {
+                return;
+            }
+            var x = dayjs(startTime);
+            var y = dayjs();
+            let d = dayjs.duration(x.diff(y));
+            let day = parseInt(d.asDays());
+            let str = '';
+            if (day > 0) {
+                str += day + '天 ';
+            }
+            this.startTime = str + dayjs.duration(x.diff(y)).format('HH:mm:ss');
+            setTimeout(() => {
+                this.getTime(startTime);
+            }, 1000);
         }
         }
     }
     }
 };
 };

+ 16 - 1
src/main/nine-space/src/plugins/http.js

@@ -1,7 +1,22 @@
 import axios from 'axios';
 import axios from 'axios';
 import qs from 'qs';
 import qs from 'qs';
 /* eslint-disable */
 /* eslint-disable */
-let baseUrl = process.env.VUE_APP_BASE_URL;
+// let baseUrl = process.env.VUE_APP_BASE_URL;
+let baseUrl = 'http://localhost:8080';
+switch (process.env.NODE_ENV) {
+    case 'development':
+        baseUrl = 'https://nfttest.9space.vip/';
+        // baseUrl = 'http://192.168.50.190:8080';
+        // baseUrl = 'http://localhost:8080';
+        // baseUrl = 'http://192.168.50.190:8080';
+        break;
+    case 'test':
+        baseUrl = 'http://localhost:8080';
+        break;
+    case 'production':
+        baseUrl = '../../';
+        break;
+}
 const axiosInstance = axios.create({
 const axiosInstance = axios.create({
     baseURL: baseUrl
     baseURL: baseUrl
 });
 });

+ 4 - 7
src/main/nine-space/src/views/asset/Consignment.vue

@@ -23,10 +23,7 @@
                 text="出售成功的加密作品将会携带加密作品的所有信息转让于购买方,包括但不限于:加 密空间、权益的使用、加密作品的区块信息等"
                 text="出售成功的加密作品将会携带加密作品的所有信息转让于购买方,包括但不限于:加 密空间、权益的使用、加密作品的区块信息等"
             />
             />
             <div class="bottom-content">
             <div class="bottom-content">
-                <div class="btn1">
-                    取消
-                    <!-- <van-button @click="submit" :disabled="orderId"> 取消 </van-button> -->
-                </div>
+                <div class="btn1" @click="$router.go(-1)">取消</div>
                 <div class="btn2" @click="submit">确认寄售</div>
                 <div class="btn2" @click="submit">确认寄售</div>
             </div>
             </div>
         </div>
         </div>
@@ -160,15 +157,15 @@ export default {
         width: 375px;
         width: 375px;
         height: 5px;
         height: 5px;
         background: #202122;
         background: #202122;
+        &.border1 {
+            margin-top: 20px;
+        }
     }
     }
     .content {
     .content {
         width: 375px;
         width: 375px;
         height: 70px;
         height: 70px;
         line-height: 70px;
         line-height: 70px;
         background: #19191b;
         background: #19191b;
-        &.border1 {
-            margin-top: 20px;
-        }
     }
     }
     .input {
     .input {
         margin-top: 20px;
         margin-top: 20px;

+ 1 - 0
src/main/nine-space/src/views/asset/Detail.vue

@@ -238,6 +238,7 @@ export default {
             });
             });
             this.$http.get('/asset/get/' + this.$route.query.id).then(res => {
             this.$http.get('/asset/get/' + this.$route.query.id).then(res => {
                 this.info = res;
                 this.info = res;
+                console.log(this.info);
                 this.$nextTick(() => {
                 this.$nextTick(() => {
                     if (this.isBuy) {
                     if (this.isBuy) {
                         this.btn = this.$refs.btn;
                         this.btn = this.$refs.btn;

+ 60 - 1
src/main/nine-space/src/views/product/Detail.vue

@@ -25,6 +25,11 @@
         </swiper>
         </swiper>
 
 
         <div class="info">
         <div class="info">
+            <div class="name" v-if="info.salable">
+                <div class="name1">首发抢购倒计时</div>
+                <div class="name2">{{ startTime }}</div>
+            </div>
+
             <div class="price-line" v-if="info.salable">
             <div class="price-line" v-if="info.salable">
                 <div class="price"><i class="font_family icon-icon_jiage"></i>{{ info.price }}</div>
                 <div class="price"><i class="font_family icon-icon_jiage"></i>{{ info.price }}</div>
                 <div class="price-sub" v-if="info.originalPrice">¥{{ info.originalPrice || 0 }}</div>
                 <div class="price-sub" v-if="info.originalPrice">¥{{ info.originalPrice || 0 }}</div>
@@ -107,6 +112,13 @@
                 <div class="page-text page-detail" v-html="info.detail"></div
                 <div class="page-text page-detail" v-html="info.detail"></div
             ></template>
             ></template>
         </div>
         </div>
+        <div class="btn van-safe-area-bottom" v-if="info.isAppointment">
+            <div class="btns">
+                <van-button @click="appointment" type="primary" block round>
+                    {{ info.appointment ? '已预约' : '一键预约' }}
+                </van-button>
+            </div>
+        </div>
 
 
         <div class="btn van-safe-area-bottom" ref="btn" v-if="isBuy">
         <div class="btn van-safe-area-bottom" ref="btn" v-if="isBuy">
             <div class="btns">
             <div class="btns">
@@ -187,6 +199,19 @@ export default {
                 startPosition: index
                 startPosition: index
             });
             });
         },
         },
+        appointment() {
+            this.$http
+                .post('/collection/appointment?id=' + this.info.id)
+                .then(res => {
+                    this.getProduct();
+                    this.$toast.success('预约成功');
+                })
+                .catch(e => {
+                    if (e.error) {
+                        this.$toast.warning(e.error);
+                    }
+                });
+        },
         getProduct() {
         getProduct() {
             this.$toast.loading({
             this.$toast.loading({
                 message: '加载中...',
                 message: '加载中...',
@@ -196,6 +221,7 @@ export default {
                 .get('/collection/get/' + this.$route.query.id)
                 .get('/collection/get/' + this.$route.query.id)
                 .then(res => {
                 .then(res => {
                     this.info = res;
                     this.info = res;
+                    this.getTime(res.startTime);
                     this.$nextTick(() => {
                     this.$nextTick(() => {
                         if (this.isBuy) {
                         if (this.isBuy) {
                             this.btn = this.$refs.btn;
                             this.btn = this.$refs.btn;
@@ -263,7 +289,24 @@ export default {
     z-index: 2;
     z-index: 2;
     padding: 16px 16px 0;
     padding: 16px 16px 0;
     box-sizing: border-box;
     box-sizing: border-box;
-
+    .name {
+        text-align: center;
+        .name1 {
+            font-size: 14px;
+            font-weight: 400;
+            color: #ffffff;
+            line-height: 24px;
+        }
+        .name2 {
+            font-size: 16px;
+            font-weight: 400;
+            color: #fdfb60;
+            line-height: 24px;
+            background: linear-gradient(135deg, #fdfb60 0%, #ff8f3e 100%);
+            -webkit-background-clip: text;
+            -webkit-text-fill-color: transparent;
+        }
+    }
     .price {
     .price {
         font-size: 36px;
         font-size: 36px;
         font-family: OSP;
         font-family: OSP;
@@ -365,7 +408,23 @@ export default {
         font-size: 13px;
         font-size: 13px;
     }
     }
 }
 }
+.buy {
+    width: 100%;
+    display: block;
+    height: 52px;
+    background: linear-gradient(135deg, @prim 0%, @warn 100%);
+    border-radius: 8px;
+    border-width: 0;
+    color: #000;
+    &:hover {
+        background: linear-gradient(135deg, darken(@prim, 10%), darken(@warn, 10%));
+    }
 
 
+    &.used {
+        background: linear-gradient(135deg, darken(@prim, 50%), darken(@warn, 50%));
+        color: #939599;
+    }
+}
 /deep/ .mySwiper {
 /deep/ .mySwiper {
     width: 100vw;
     width: 100vw;
     height: 100vw;
     height: 100vw;

+ 5 - 0
src/main/nine-space/yarn.lock

@@ -3387,6 +3387,11 @@ dashdash@^1.12.0:
   dependencies:
   dependencies:
     assert-plus "^1.0.0"
     assert-plus "^1.0.0"
 
 
+dayjs@^1.10.7:
+  version "1.10.7"
+  resolved "https://registry.nlark.com/dayjs/download/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468"
+  integrity sha1-LPX5Gt0oEWdIRAhmoKHSbzps5Gg=
+
 debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
 debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
   version "2.6.9"
   version "2.6.9"
   resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
   resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"

+ 2 - 0
src/main/pc-space/src/mixins/common.js

@@ -73,6 +73,7 @@ export default {
             this.$router.push(link);
             this.$router.push(link);
         },
         },
         getImg(imgs = '', type = '', size = 300) {
         getImg(imgs = '', type = '', size = 300) {
+            // console.log(imgs);
             if (!imgs) {
             if (!imgs) {
                 imgs = '';
                 imgs = '';
             }
             }
@@ -85,6 +86,7 @@ export default {
             });
             });
             if (imgs.length > 0) {
             if (imgs.length > 0) {
                 let img = type ? imgs[0][type] : imgs[0];
                 let img = type ? imgs[0][type] : imgs[0];
+                // console.log(img);
                 return img + (/\.gif$/i.test(img) ? '' : `?x-oss-process=image/resize,h_${size},m_lfit`);
                 return img + (/\.gif$/i.test(img) ? '' : `?x-oss-process=image/resize,h_${size},m_lfit`);
             } else {
             } else {
                 return '';
                 return '';

+ 3 - 0
src/main/pc-space/src/mixins/product.js

@@ -53,6 +53,7 @@ export default {
     },
     },
     methods: {
     methods: {
         changeImgs(list = []) {
         changeImgs(list = []) {
+            console.log(list);
             return list.map(item => {
             return list.map(item => {
                 if (item.type === 'video/mp4') {
                 if (item.type === 'video/mp4') {
                     return item.thumb;
                     return item.thumb;
@@ -71,6 +72,7 @@ export default {
             if (!this.isAppointment) {
             if (!this.isAppointment) {
                 return;
                 return;
             }
             }
+            console.log(222);
             var x = dayjs(startTime);
             var x = dayjs(startTime);
             var y = dayjs();
             var y = dayjs();
             let d = dayjs.duration(x.diff(y));
             let d = dayjs.duration(x.diff(y));
@@ -80,6 +82,7 @@ export default {
                 str += day + '天 ';
                 str += day + '天 ';
             }
             }
             this.startTime = str + dayjs.duration(x.diff(y)).format('HH:mm:ss');
             this.startTime = str + dayjs.duration(x.diff(y)).format('HH:mm:ss');
+            console.log(this.startTime);
             setTimeout(() => {
             setTimeout(() => {
                 this.getTime(startTime);
                 this.getTime(startTime);
             }, 1000);
             }, 1000);

+ 1 - 1
src/main/pc-space/src/views/user/PayRecord.vue

@@ -97,7 +97,7 @@ export default {
         },
         },
         setList(list) {
         setList(list) {
             this.tableData = list;
             this.tableData = list;
-            console.log(this.tableData);
+            // console.log(this.tableData);
         },
         },
         handleClick(row) {
         handleClick(row) {
             this.$confirm('确定删除该订单吗?', '警告', {
             this.$confirm('确定删除该订单吗?', '警告', {