panhui 4 лет назад
Родитель
Сommit
645a6bb0c7

+ 9 - 5
src/main/nine-space/src/components/Post.vue

@@ -5,7 +5,7 @@
         <div class="img" ref="wrap"></div>
         <div class="content" v-if="!img" ref="post" @click.stop>
           <van-image
-            :src="getImg(info.pics)"
+            :src="getImg(info.pics || info.pic)"
             width="80vw"
             height="80vw"
             fit="cover"
@@ -20,7 +20,7 @@
                 <img src="../assets/svgs/jiage.svg" alt="" />
                 <span>{{ info.price }}</span>
               </div>
-              <div class="text1">
+              <div class="text1" v-if="info.stock">
                 <span>已售 {{ info.sale }}</span>
                 <span>剩余 {{ info.stock }}</span>
               </div>
@@ -50,10 +50,10 @@
         <div class="tips">长按图片保存</div>
       </div>
     </van-overlay>
-    <div class="share" @click="init">
+    <!-- <div class="share" @click="init">
       <img src="../assets/svgs/icon-share.svg" alt="" />
       <span>分享</span>
-    </div>
+    </div> -->
   </div>
 </template>
 <script>
@@ -68,6 +68,10 @@ export default {
         return {};
       },
     },
+    pageUrl: {
+      type: String,
+      default: "productDetail",
+    },
   },
   data() {
     return {
@@ -78,7 +82,7 @@ export default {
   },
   computed: {
     url() {
-      return path.resolve(this.$baseUrl, "productDetail?id=" + this.info.id);
+      return path.resolve(this.$baseUrl, this.pageUrl + "?id=" + this.info.id);
     },
   },
   components: {

+ 5 - 1
src/main/nine-space/src/components/asset/assetInfo.vue

@@ -23,6 +23,9 @@
       <div class="price" v-if="info.status === 'ON_SALE'">
         <i class="font_family icon-icon_jiage"></i>{{ info.price }}
       </div>
+      <div class="status" v-else-if="info.status === 'NORMAL'">
+        {{ info.publicShow ? "仅展示" : "未展示" }}
+      </div>
       <div class="status" v-else>
         {{ getLabelName(info.status, assetStatusOptions) }}
       </div>
@@ -100,9 +103,10 @@ export default {
   margin: 8px;
   background-color: @bg2;
   display: inline-block;
+  border-radius: 8px;
+  overflow: hidden;
 
   .van-image {
-    border-radius: 8px 8px 0px 0px;
     overflow: hidden;
     display: block;
   }

+ 3 - 2
src/main/nine-space/src/components/product/productInfo.vue

@@ -86,9 +86,10 @@ export default {
   margin: 8px;
   background-color: @bg2;
   display: inline-block;
+  border-radius: 8px;
+  overflow: hidden;
 
   .van-image {
-    border-radius: 8px 8px 0px 0px;
     overflow: hidden;
     display: block;
   }
@@ -126,7 +127,7 @@ export default {
       line-height: 24px;
       span {
         &:last-child {
-          color: @prim;
+          color: #fff;
           font-size: 16px;
         }
       }

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

@@ -101,5 +101,13 @@ export default {
 
       return info ? info.label : "";
     },
+    scrollRefreash() {
+      if (this.bs.value) {
+        setTimeout(() => {
+          this.$toast.clear();
+          this.bs.value.refresh();
+        }, 50);
+      }
+    },
   },
 };

+ 1 - 3
src/main/nine-space/src/views/Creator.vue

@@ -82,9 +82,7 @@ export default {
         )
         .then((res) => {
           this.miners = res.content;
-          setTimeout(() => {
-            this.bs.value.refresh();
-          }, 100);
+          this.scrollRefreash();
         });
     },
   },

+ 2 - 24
src/main/nine-space/src/views/Discover.vue

@@ -133,11 +133,7 @@ export default {
         message: "加载中...",
         forbidClick: true,
       });
-      Promise.all([this.getBanner(), this.getList()]).then(() => {
-        setTimeout(() => {
-          this.bs.value.refresh();
-        }, 100);
-      });
+      Promise.all([this.getBanner(), this.getList()]).then(() => {});
     },
     getBanner() {
       this.$http
@@ -171,6 +167,7 @@ export default {
         )
         .then((res) => {
           this.list = res.content;
+          this.scrollRefreash();
         });
     },
     change(isFixed) {
@@ -182,25 +179,6 @@ export default {
         this.$refs.top.$el.appendChild(this.stiky);
       }
     },
-    changeActive(active) {
-      if (this.active === active) {
-        return;
-      }
-      this.$nextTick(() => {
-        this.bs.value.scrollTo(0, 0);
-        this.bs.value.refresh();
-        setTimeout(() => {
-          this.active = active;
-          this.$nextTick(() => {
-            if (active === "explore") {
-              this.getInit();
-            } else {
-              this.$refs.creator.init();
-            }
-          });
-        }, 100);
-      });
-    },
   },
 };
 </script>

+ 67 - 8
src/main/nine-space/src/views/Store.vue

@@ -10,17 +10,17 @@
           >
             我拥有的
           </div>
-          <div
+          <!-- <div
             class="btn"
             :class="{ active: active === 'creator' }"
             @click="changeActive('creator')"
           >
             我卖出的
-          </div>
+          </div> -->
         </div>
-        <div class="search">
+        <!-- <div class="search">
           <img src="../assets/svgs/search.svg" alt="" />
-        </div>
+        </div> -->
       </div>
 
       <van-tabs
@@ -28,6 +28,7 @@
         line-width="16"
         line-height="2"
         :ellipsis="false"
+        @change="getList"
       >
         <van-tab
           :title="item.label"
@@ -36,13 +37,36 @@
           v-for="(item, index) in typeOptions"
         ></van-tab>
       </van-tabs>
+
+      <!-- <van-button
+        color="#272828"
+        round
+        size="mini"
+        icon="arrow-down"
+        icon-position="right"
+        class="select"
+        @click="showSelect = true"
+      >
+        全部
+      </van-button> -->
     </van-sticky>
 
     <div class="box-list">
       <template v-for="(item, index) in list" :key="index">
         <asset-info :info="item"></asset-info>
       </template>
+
+      <van-empty v-if="empty" description="您还没有任何藏品哦~" />
     </div>
+    <van-action-sheet
+      ref="action"
+      v-model:show="showSelect"
+      description="选择筛选方式"
+      :actions="actions"
+      cancel-text="取消"
+      close-on-click-action
+      @open="open"
+    />
   </div>
 </template>
 
@@ -74,13 +98,22 @@ export default {
           type: "BLIND_BOX",
         },
       ],
+      showSelect: false,
+      actions: [{ name: "选项一" }, { name: "选项二" }, { name: "选项三" }],
+      action: null,
     };
   },
   mounted() {
     this.$nextTick(() => {
       this.stiky = this.$refs.top.$el.childNodes[0];
     });
-    this.getList();
+    this.checkLogin()
+      .then(() => {
+        this.getList();
+      })
+      .catch(() => {
+        this.empty = true;
+      });
   },
   beforeUnmount() {
     if (this.stiky.parentNode.nodeName == "BODY") {
@@ -88,9 +121,22 @@ export default {
         document.body.removeChild(this.stiky);
       });
     }
+    if (this.action) {
+      document.body.removeChild(this.action);
+    }
   },
   methods: {
+    open() {
+      this.$nextTick(() => {
+        this.action = document.getElementsByClassName("van-action-sheet")[0];
+        console.log(this.action);
+        document.body.appendChild(this.action);
+      });
+    },
     getList() {
+      if (!this.isLogin) {
+        return;
+      }
       this.$toast.loading({
         message: "加载中...",
         forbidClick: true,
@@ -104,6 +150,7 @@ export default {
             size: 20,
             query: {
               userId: this.$store.state.userInfo.id,
+              type: this.type,
             },
             sort: "createdAt,desc",
           },
@@ -112,9 +159,7 @@ export default {
         .then((res) => {
           this.list = res.content;
           this.empty = res.empty;
-          setTimeout(() => {
-            this.bs.value.refresh();
-          }, 100);
+          this.scrollRefreash();
         });
     },
     change(isFixed) {
@@ -165,6 +210,16 @@ export default {
     }
   }
 }
+.select {
+  position: absolute;
+  right: 16px;
+  bottom: 9px;
+  color: #939599 !important;
+  min-width: 96px;
+}
+/deep/.van-sticky {
+  position: relative;
+}
 
 .discover {
   background-color: @bg3;
@@ -269,4 +324,8 @@ export default {
 /deep/ .van-tabs__line {
   bottom: 20px;
 }
+
+/deep/.van-action-sheet__description::after {
+  border-bottom: 1px solid #f2f2f2;
+}
 </style>

+ 48 - 4
src/main/nine-space/src/views/account/Login.vue

@@ -17,7 +17,7 @@
       </div>
     </div>
 
-    <van-form @submit="submit" ref="form">
+    <van-form @submit="submit" ref="form" v-if="active === 'phone'">
       <van-field
         type="tel"
         name="用户名"
@@ -44,7 +44,6 @@
         placeholder="请输入密码"
         v-model="form.password"
         :rules="[{ required: true, message: '请填写密码' }]"
-        v-if="active === 'phone'"
       >
         <template #left-icon>
           <img
@@ -54,12 +53,57 @@
         </template>
       </van-field>
 
+      <div class="button">
+        <!-- <van-button plain class="forget" @click="$router.replace('/forget')">
+          忘记密码?
+        </van-button> -->
+
+        <van-button
+          round
+          block
+          native-type="submit"
+          color="linear-gradient(to right, #FDFB60, #FF8F3E)"
+          class="sure"
+          >登录</van-button
+        >
+        <van-button
+          class="del"
+          round
+          block
+          plain
+          @click="$router.replace('/register')"
+          >暂无账号,立即注册</van-button
+        >
+      </div>
+    </van-form>
+
+    <van-form @submit="submit" ref="code" v-else>
+      <van-field
+        type="tel"
+        name="手机号码"
+        placeholder="请输入手机号码"
+        v-model="form.phone"
+        :rules="[
+          { required: true, message: '请输入手机号码' },
+          {
+            pattern: phonePattern,
+            message: '手机号码格式错误',
+          },
+        ]"
+      >
+        <template #left-icon>
+          <img
+            :src="require('../../assets/svgs/login_icon_zhanghao.svg')"
+            class="icon"
+          />
+        </template>
+      </van-field>
+
       <van-field
         type="code"
         name="验证码"
         placeholder="请输入验证码"
         v-model="form.code"
-        v-else
         :rules="[{ required: true, message: '请输入验证码' }]"
       >
         <template #left-icon>
@@ -123,7 +167,7 @@ export default {
   },
   methods: {
     sendPhone() {
-      this.$refs.form.validate("手机号码").then(() => {
+      this.$refs.code.validate("手机号码").then(() => {
         this.sendMsg(this.form.phone);
       });
     },

+ 26 - 0
src/main/nine-space/src/views/account/Security.vue

@@ -10,9 +10,32 @@
       />
       <van-cell title="修改手机号" :to="{ path: '/changePhone' }" is-link />
     </van-cell-group>
+    <div class="logout">
+      <van-button type="primary" @click="logout" plain block round
+        >退出登录</van-button
+      >
+    </div>
   </div>
 </template>
 
+<script>
+export default {
+  methods: {
+    logout() {
+      this.$dialog
+        .confirm({
+          title: "提示",
+          message: "确认要退出登录吗?",
+        })
+        .then(() => {
+          localStorage.removeItem("nineToken");
+          this.$router.go(-1);
+        });
+    },
+  },
+};
+</script>
+
 <style lang="less" scoped>
 .title {
   background-color: #181818;
@@ -32,4 +55,7 @@
 .van-cell {
   padding: 23px 16px;
 }
+.logout {
+  padding: 50px 30px 50px;
+}
 </style>

+ 98 - 69
src/main/nine-space/src/views/asset/Detail.vue

@@ -8,15 +8,19 @@
 
     <div class="info">
       <div class="price-line">
-        <!-- <div class="price">
-          <i class="font_family icon-icon_jiage"></i>{{ info.price }}
+        <template v-if="info.status === 'ON_SALE'">
+          <div class="price">
+            <i class="font_family icon-icon_jiage"></i>{{ info.price }}
+          </div>
+          <div class="sub" v-if="info.royalties">
+            含 <span>{{ info.royalties }}%</span> 版税
+          </div>
+        </template>
+
+        <div class="status" v-else-if="info.status == 'NORMAL'">
+          {{ info.publicShow ? "仅展示" : "未展示" }}
         </div>
-        <div class="sub">含 <span>5%</span> 版税</div>
-        <div class="text">
-          <span>已售 {{ info.sale }}</span>
-          <span>剩余 {{ info.stock }}</span>
-        </div> -->
-        <div class="status">
+        <div class="status" v-else>
           {{ getLabelName(info.status, assetStatusOptions) }}
         </div>
       </div>
@@ -36,76 +40,84 @@
     </div>
 
     <driver />
-    <van-cell
-      is-link
-      class="creator"
-      :to="{
-        path: '/creatorDetail',
-        query: {
-          id: info.minterId,
-        },
-      }"
-    >
-      <template #icon>
-        <van-image
-          width="40"
-          height="40"
-          :src="info.minterAvatar"
-          fit="cover"
-          radius="100"
-        />
-      </template>
-      <template #title>
-        <div class="text1">{{ info.minter }}</div>
-        <div class="text2">铸造者</div>
-      </template>
-    </van-cell>
-    <van-cell
-      is-link
-      class="creator"
-      :to="{
-        path: '/creatorDetail',
-        query: {
-          id: info.minterId,
-        },
-      }"
-    >
-      <template #icon>
-        <van-image
-          width="40"
-          height="40"
-          :src="info.minterAvatar"
-          fit="cover"
-          radius="100"
-        />
-      </template>
-      <template #title>
-        <div class="text1">{{ info.minter }}</div>
-        <div class="text2">持有者</div>
-      </template>
-    </van-cell>
+    <div class="user">
+      <van-cell
+        is-link
+        class="creator"
+        :to="{
+          path: '/creatorDetail',
+          query: {
+            id: info.minterId,
+          },
+        }"
+      >
+        <template #icon>
+          <van-image
+            width="40"
+            height="40"
+            class="user-img"
+            :src="info.minterAvatar"
+            fit="cover"
+            radius="100"
+          />
+        </template>
+        <template #title>
+          <div class="text1 van-ellipsis">{{ info.minter }}</div>
+          <div class="text2">铸造者</div>
+        </template>
+      </van-cell>
+      <van-cell
+        is-link
+        class="creator"
+        :to="{
+          path: '/creatorDetail',
+          query: {
+            id: info.minterId,
+          },
+        }"
+      >
+        <template #icon>
+          <van-image
+            width="40"
+            height="40"
+            class="user-img"
+            :src="info.minterAvatar"
+            fit="cover"
+            radius="100"
+          />
+        </template>
+        <template #title>
+          <div class="text1 van-ellipsis">{{ info.minter }}</div>
+          <div class="text2">持有者</div>
+        </template>
+      </van-cell>
+    </div>
     <driver />
 
     <div class="goods">
-      <div class="page-title">商品特性</div>
-      <div class="specific-list">
-        <div
-          class="specific-item"
-          v-for="(item, index) in properties"
-          :key="index"
-        >
-          <div class="text1">{{ item.name }}</div>
-          <div class="text2">{{ item.value }}</div>
+      <template v-if="properties.length > 0">
+        <div class="page-title">商品特性</div>
+        <div class="specific-list">
+          <div
+            class="specific-item"
+            v-for="(item, index) in properties"
+            :key="index"
+          >
+            <div class="text1">{{ item.name }}</div>
+            <div class="text2">{{ item.value }}</div>
+          </div>
         </div>
-      </div>
+      </template>
       <div class="page-title">链上信息</div>
       <div class="page-text">
         Hash地址:{{ info.txHash }}<br />
         区块高度: {{ info.blockNumber }}<br />
         令牌ID: {{ info.tokenId }}
       </div>
-      <div class="page-title">作品描述</div>
-      <div class="page-text" v-html="info.detail"></div>
+      <template v-if="info.detail">
+        <div class="page-title">作品描述</div>
+        <div class="page-text" v-html="info.detail"></div>
+      </template>
     </div>
 
     <div class="btn van-safe-area-bottom" ref="btn" v-if="isBuy">
@@ -126,7 +138,7 @@
 
     <driver />
 
-    <post :info="info" />
+    <post :info="info" pageUrl="assetDetail" />
   </div>
 </template>
 
@@ -445,4 +457,21 @@ export default {
   color: #fdfb60;
   line-height: 24px;
 }
+
+.user {
+  display: flex;
+  .creator {
+    width: 50%;
+  }
+
+  .user-img {
+    flex-shrink: 0;
+  }
+
+  /deep/.van-cell__title {
+    margin-left: 10px;
+    overflow: hidden;
+  }
+}
+
 </style>

+ 1 - 3
src/main/nine-space/src/views/creator/Detail.vue

@@ -210,9 +210,7 @@ export default {
         .then((res) => {
           this.list = res.content;
           this.empty = res.empty;
-          setTimeout(() => {
-            this.bs.value.refresh();
-          }, 100);
+          this.scrollRefreash();
         });
     },
     changeMenu(menu) {

+ 1 - 3
src/main/nine-space/src/views/creator/List.vue

@@ -118,9 +118,7 @@ export default {
         .then((res) => {
           this.list = res.content;
           this.empty = res.empty;
-          setTimeout(() => {
-            this.bs.value.refresh();
-          }, 100);
+          this.scrollRefreash();
         });
     },
   },

+ 1 - 3
src/main/nine-space/src/views/creator/Search.vue

@@ -95,9 +95,7 @@ export default {
         .then((res) => {
           this.list = res.content;
           this.empty = res.empty;
-          setTimeout(() => {
-            this.bs.value.refresh();
-          }, 100);
+          this.scrollRefreash();
         });
     },
   },

+ 1 - 3
src/main/nine-space/src/views/order/Detail.vue

@@ -100,9 +100,7 @@ export default {
     });
     this.$http.get("/order/get/" + this.$route.query.id).then((res) => {
       this.info = res;
-      setTimeout(() => {
-        this.bs.value.refresh();
-      }, 100);
+      this.scrollRefreash();
     });
   },
   methods: {

+ 5 - 3
src/main/nine-space/src/views/order/Orders.vue

@@ -119,9 +119,7 @@ export default {
         .then((res) => {
           this.list = res.content;
           this.empty = res.empty;
-          setTimeout(() => {
-            this.bs.value.refresh();
-          }, 100);
+          this.scrollRefreash();
         });
     },
     changeStatus(name) {
@@ -200,6 +198,10 @@ export default {
   min-height: 100vh;
 }
 
+.list {
+  padding-bottom: 100px;
+}
+
 .grid-img {
   display: block;
 }

+ 21 - 18
src/main/nine-space/src/views/product/Detail.vue

@@ -11,7 +11,10 @@
         <div class="price">
           <i class="font_family icon-icon_jiage"></i>{{ info.price }}
         </div>
-        <div class="sub">含 <span>5%</span> 版税</div>
+        <div class="sub" v-if="info.royalties">
+          含 <span>{{ info.royalties }}%</span> 版税
+        </div>
+        <div class="flex1"></div>
         <div class="text">
           <span>已售 {{ info.sale }}</span>
           <span>剩余 {{ info.stock }}</span>
@@ -19,14 +22,15 @@
       </div>
       <div class="title">{{ info.name }}</div>
       <div class="info-bottom">
-        <span class="text1" v-if="info.type !== 'DEFAULT'"> 编号 338392 </span>
+        <!-- <span class="text1" v-if="info.type !== 'DEFAULT'"> 编号 338392 </span>
         <van-button
           v-if="info.type !== 'DEFAULT'"
           type="primary"
           plain
           size="mini"
           >选择其他编号</van-button
-        >
+        > -->
+        <div class="flex1"></div>
         <like-button :isLike="info.liked" @click="likeProduct">
           {{ info.likes }}
         </like-button>
@@ -63,17 +67,19 @@
     <driver />
 
     <div class="goods">
-      <div class="page-title">商品特性</div>
-      <div class="specific-list">
-        <div
-          class="specific-item"
-          v-for="(item, index) in properties"
-          :key="index"
-        >
-          <div class="text1">{{ item.name }}</div>
-          <div class="text2">{{ item.value }}</div>
+      <template v-if="properties.length > 0">
+        <div class="page-title">商品特性</div>
+        <div class="specific-list">
+          <div
+            class="specific-item"
+            v-for="(item, index) in properties"
+            :key="index"
+          >
+            <div class="text1">{{ item.name }}</div>
+            <div class="text2">{{ item.value }}</div>
+          </div>
         </div>
-      </div>
+      </template>
       <!-- <div class="page-title">链上信息</div>
       <div class="page-text">
         创世“由艺术大师天野喜孝为游戏”百分之一“倾情绘制,天野喜孝是日本知名画家,插画师,角色设计师,普任”最终幻想“系列多部作品的角色设计
@@ -139,7 +145,7 @@ export default {
       return this.info.properties || [];
     },
     isBuy() {
-      return this.info.stock && this.info.onShelf;
+      return this.info.stock && this.info.onShelf && this.info.salable;
     },
   },
   mounted() {
@@ -165,10 +171,7 @@ export default {
           document.body.appendChild(this.$refs.btn);
         });
 
-        setTimeout(() => {
-          this.$toast.clear();
-          this.bs.value.refresh();
-        }, 100);
+        this.scrollRefreash();
       });
     },
     likeProduct() {

+ 1 - 3
src/main/nine-space/src/views/product/List.vue

@@ -135,9 +135,7 @@ export default {
         .then((res) => {
           this.list = res.content;
           this.empty = res.empty;
-          setTimeout(() => {
-            this.bs.value.refresh();
-          }, 100);
+          this.scrollRefreash();
         });
     },
   },

+ 1 - 3
src/main/nine-space/src/views/product/Search.vue

@@ -109,9 +109,7 @@ export default {
         .then((res) => {
           this.list = res.content;
           this.empty = res.empty;
-          setTimeout(() => {
-            this.bs.value.refresh();
-          }, 100);
+          this.scrollRefreash();
         });
     },
   },

+ 1 - 3
src/main/nine-space/src/views/user/Followers.vue

@@ -34,9 +34,7 @@ export default {
     this.$http.get("/user/myFollowers").then((res) => {
       this.list = res;
       this.empty = res.length === 0;
-      setTimeout(() => {
-        this.bs.value.refresh();
-      }, 100);
+      this.scrollRefreash();
     });
   },
 };

+ 1 - 3
src/main/nine-space/src/views/user/Follows.vue

@@ -48,9 +48,7 @@ export default {
       this.$http.get("/user/myFollows").then((res) => {
         this.list = res;
         this.empty = res.length === 0;
-        setTimeout(() => {
-          this.bs.value.refresh();
-        }, 100);
+        this.scrollRefreash();
       });
     },
   },

+ 1 - 3
src/main/nine-space/src/views/user/Likes.vue

@@ -95,9 +95,7 @@ export default {
       this.$http.get("/collection/myLikes").then((res) => {
         this.list = res;
         this.empty = res.length === 0;
-        setTimeout(() => {
-          this.bs.value.refresh();
-        }, 100);
+        this.scrollRefreash();
       });
     },
   },