Browse Source

增加teac生态发展资产
产品加视频

xiaomei 3 months ago
parent
commit
96b336a744
4 changed files with 98 additions and 9 deletions
  1. 2 1
      src/language/en.json
  2. 1 1
      src/language/zh.json
  3. 28 0
      src/views/mine/share.vue
  4. 67 7
      src/views/trade/detail.vue

+ 2 - 1
src/language/en.json

@@ -494,5 +494,6 @@
   "lang493": "Are you sure you want to transfer TeaC?",
   "lang494": "Daily output",
   "lang495": "Storage of tea rights",
-  "lang496": "Please enter the name of the tea rights"
+  "lang496": "Please enter the name of the tea rights",
+  "lang497": "TeaC·EcologyDevelop"
 }

+ 1 - 1
src/language/zh.json

@@ -495,7 +495,7 @@
   "lang494": "日产出量",
   "lang495": "存储茶权",
   "lang496": "请输入茶权名称",
-  "lang497": "",
+  "lang497": "TeaC·生态发展",
   "lang498": "",
   "lang499": "",
   "lang500": ""

+ 28 - 0
src/views/mine/share.vue

@@ -127,6 +127,22 @@
               </div>
             </div> -->
           </div>
+          <div class="total_box" v-else-if="coin_type == 'teac_ecology'">
+            <div>
+              <span class="text">{{ $t('lang80') }}({{ $t('lang497') }})</span>
+            </div>
+            <div class="total">
+              <span>{{ Math.floor(teac_ecology * 100) / 100 || 0 }}</span>
+            </div>
+            <!-- <div class="buy_box f-sa">
+              <div class="buy" @click="navigation('')">
+                <van-button class="buy_btn" type="primary">{{ $t('lang138') }}</van-button>
+              </div>
+              <div class="buy" @click="navigation('frozenTransfer')">
+                <van-button class="buy_btn" type="primary">{{ $t('lang278') }}</van-button>
+              </div>
+            </div> -->
+          </div>
         </div>
 
         <div class="bare" v-if="total <= 0">
@@ -168,6 +184,7 @@
                       <span class="ssm" v-else-if="coin_type == 'teac'">TeaC</span>
                       <span class="ssm" v-else-if="coin_type == 'frozen'">{{ $t('lang339') }}</span>
                       <span class="ssm" v-else-if="coin_type == 'teac_angel'">{{ $t('lang485') }}</span>
+                      <span class="ssm" v-else-if="coin_type == 'teac_ecology'">{{ $t('lang497') }}</span>
                     </span>
                   </div>
                   <div class="f-c" v-if="coin_type == 'token'">
@@ -206,6 +223,15 @@
                       {{ $t('lang294') + (item.address.substring(0, 5) + '****' + item.address.substring(item.address.length - 5, item.address.length)) }}
                     </span> -->
                   </div>
+                  <div class="f-c" v-else-if="coin_type == 'teac_ecology'">
+                    <span class="key">{{ statusList[item.action] }}</span>
+                    <!-- <span class="key" v-if="item.action == 3 && item.address">
+                      {{ $t('lang295') + (item.address.substring(0, 5) + '****' + item.address.substring(item.address.length - 5, item.address.length)) }}
+                    </span>
+                    <span class="key" v-if="item.action == 4 && item.address">
+                      {{ $t('lang294') + (item.address.substring(0, 5) + '****' + item.address.substring(item.address.length - 5, item.address.length)) }}
+                    </span> -->
+                  </div>
                 </div>
               </div>
             </div>
@@ -245,6 +271,7 @@ export default {
       teac: 0, // teac资产
       frozen: 0, // 标记茶宝资产
       teac_angel: 0, // teac天使资产
+      teac_ecology: 0, // teac生态资产
       coin_type: '',
       h5: 1, //是否是h5端 0否 1是
     };
@@ -297,6 +324,7 @@ export default {
           this.teac = data.filter(i => i.coin_key == 'teac')[0].amount;
           this.frozen = data.filter(i => i.coin_key == 'frozen')[0].amount;
           this.teac_angel = data.filter(i => i.coin_key == 'teac_angel')[0].amount;
+          this.teac_ecology = data.filter(i => i.coin_key == 'teac_ecology')[0].amount;
         } else {
         }
       });

+ 67 - 7
src/views/trade/detail.vue

@@ -5,13 +5,19 @@
     <div class="back" @click="goBack">
       <van-icon name="arrow-left" size="22" />
     </div>
-    <!-- 商品图片轮播 -->
-    <van-swipe class="product-swiper" autoplay="3000" indicator-color="#fff">
-      <van-swipe-item class="swipe-item" v-for="(image, index) in product.info.img_url" :key="index">
-        <!-- <img :src="image" alt="商品图片" /> -->
-        <van-image class="product-image" style="width: 100%; height: 100%" radius="0" :src="image" />
-      </van-swipe-item>
-    </van-swipe>
+    <div class="banner_box">
+      <video :src="product.info.video" width="100%" object-fit="cover" style="width: 100%;" :controls="true" v-show="topVal == 0"></video>
+      <!-- 商品图片轮播 -->
+      <van-swipe class="product-swiper" autoplay="3000" indicator-color="#fff" v-show="topVal == 1">
+        <van-swipe-item class="swipe-item" v-for="(image, index) in product.info.img_url" :key="index">
+          <!-- <img :src="image" alt="商品图片" /> -->
+          <van-image class="product-image" style="width: 100%; height: 100%" radius="0" :src="image" />
+        </van-swipe-item>
+      </van-swipe>
+      <div class="small_btn_box flex_r">
+          <div class="small_btn" v-for="(item,index) in btns" :key="index" :class="[topVal == item.value? 'small_btn small_btn_active' : 'small_btn']" @click="changeBtn(index,item)">{{ item.text }}</div>
+      </div>
+    </div>
 
     <!-- 商品信息 -->
     <div class="product-info">
@@ -222,6 +228,16 @@ export default {
         order: [],
         times: [],
       },
+      btns: [
+        {
+            text: "图集",
+            value: 1,
+        },{
+            text: "常见问题",
+            value: 2,
+        }
+      ],
+      topVal: 1,
       time: 30 * 60 * 60 * 1000,
       cascaderShow: false,
       cascaderValue: '',
@@ -294,6 +310,13 @@ export default {
         if (res.code == 200) {
           this.product = res.data;
           this.product.info.img_url = res.data.info.img_url.split(',');
+          if(this.product.info.video && this.btns.length == 2) {
+            this.btns.unshift({
+                text: "视频",
+                value: 0,
+            })
+            this.topVal = 0
+          }
           this.getProductAddres();
         } else {
         }
@@ -416,6 +439,11 @@ export default {
           // on cancel
         });
     },
+    changeBtn(index,item) {
+      if (item.value != 2) {
+        this.topVal = item.value
+      }
+    }
   },
 };
 </script>
@@ -424,6 +452,38 @@ export default {
   //   background-color: #fff;
   padding-bottom: 100px;
 }
+.flex_r {
+  display: flex;
+  align-items: center;
+}
+// 视频视图样式-start
+.banner_box {
+    position: relative;
+    padding: 0;
+    margin: 0;
+}
+.small_btn_box {
+    position: absolute;
+    z-index: 999;
+    bottom: 25px;
+    right: 20px;
+    padding: 2px;
+    border-radius: 15px;
+    background-color: rgba(0, 0, 0, 0.6);
+
+    .small_btn {
+        color: #fff;
+        font-size: 10px;
+        padding: 2px 8px;
+        border-radius: 15px;
+    }
+    .small_btn_active {
+        color: #000;
+        background-color: #fff;
+    }
+}
+
+// 视频视图样式-end
 
 .product-swiper {
   height: 250px;