xiaomei 8 months ago
parent
commit
d29ab73da9

BIN
src/assets/images/copy.png


BIN
src/assets/images/down.png


+ 1 - 1
src/components/BottomNavigation.vue

@@ -25,7 +25,7 @@ export default {
         // { img: require('@/assets/images/tabbar/buy.png'), bright: require('@/assets/images/tabbar/buy-active.png'), text: this.$t('lang48'), name: 'trade' },
         { img: require('@/assets/images/tabbar/shichang.png'), bright: require('@/assets/images/tabbar/shichang-active.png'), text: this.$t('lang243'), name: 'transfer' },
         // { img: require('@/assets/images/tabbar/cha.png'), bright: require('@/assets/images/tabbar/cha-active.png'), text: this.$t('lang50'), name: '' },
-        { img: require('@/assets/images/tabbar/community.png'), bright: require('@/assets/images/tabbar/community-active.png'), text: this.$t('lang215'), name: '' },
+        { img: require('@/assets/images/tabbar/community.png'), bright: require('@/assets/images/tabbar/community-active.png'), text: this.$t('lang291'), name: 'teaTalk' },
         { img: require('@/assets/images/tabbar/mine.png'), bright: require('@/assets/images/tabbar/mine-active.png'), text: this.$t('lang51'), name: 'mine' },
       ],
       routeName: '0',

+ 4 - 1
src/language/en.json

@@ -288,5 +288,8 @@
   "lang287": "Received successfully",
   "lang288": "Time left to expire:",
   "lang289": "Mark amount",
-  "lang290": "Number: "
+  "lang290": "Number: ",
+  "lang291": "Tea Talk",
+  "lang292": "Link copied, open in browser to download image",
+  "lang293": "Download"
 }

+ 3 - 1
src/language/zh.json

@@ -289,5 +289,7 @@
   "lang288": "距离过期剩余:",
   "lang289": "标记金额",
   "lang290": "编号:",
-  "lang291": ""
+  "lang291": "茶说",
+  "lang292": "链接已复制,在浏览器打开下载图片",
+  "lang293": "下载图片"
 }

+ 9 - 0
src/router/index.js

@@ -36,6 +36,7 @@ import sendChaBao from '../views/mine/sendChaBao.vue'; //转账茶宝
 import teaRights from '../views/mine/teaRights.vue'; //我的茶权
 import operationLog from '../views/mine/operationLog.vue'; //操作记录
 import welfare from '../views/index/welfare.vue'; //新人福利
+import teaTalk from '../views/mine/teaTalk.vue'; //茶说
 Vue.use(VueRouter);
 const routes = [
 
@@ -242,6 +243,14 @@ const routes = [
           requiresAuth: true
         }
       },
+      {
+        path: 'teaTalk',
+        name: 'teaTalk',
+        component: teaTalk,
+        meta: {
+          requiresAuth: true
+        }
+      },
     ],
   },
 ];

+ 1 - 0
src/views/bulletin/index.vue

@@ -73,6 +73,7 @@ export default {
       let params = {
         page: this.page,
         query: {},
+        type_id: 1
       };
       homeApi.getAnnouncement(params).then(res => {
         if (res.code == 200) {

+ 1 - 1
src/views/index/welfare.vue

@@ -18,7 +18,7 @@
         <span class="btn_text" v-if="superFl.is_super == 0 && new Date().getTime() > 0 && new Date().getTime() < Number(superFl.end_time) * 1000" @click="setSuperWeal">{{ $t('lang266') }}</span>
         <span class="btn_text" v-else-if="superFl.is_super == 0 && new Date().getTime() > Number(superFl.end_time) * 1000 && Number(superFl.end_time) != 0">{{ $t('lang285') }}</span>
         <span class="btn_text" v-else-if="superFl.is_super == 0 && Number(superFl.end_time) == 0">{{ $t('lang286') }}</span>
-        <span class="btn_text" v-else-if="superFl.is_super == 1">{{ $t('lang283') }}</span>
+        <span class="btn_text" v-else-if="superFl.is_super >= 1">{{ $t('lang283') }}</span>
       </div>
       <div class="count flex-row" v-if="superFl.is_super == 0 && new Date().getTime() > 0 && new Date().getTime() < Number(superFl.end_time) * 1000">
         <span>{{ $t('lang288') }}</span>

+ 11 - 3
src/views/mine/index.vue

@@ -16,12 +16,14 @@
           <div class="flex-row">
             <span
               :class="[
-                userinfo.is_super == 1 && userinfo.direct_super.direct_super <  userinfo.direct_super.one
+                userinfo.is_super == 1
                   ? 'text_3 level1'
-                  : userinfo.direct_super.direct_super >= userinfo.direct_super.one && userinfo.direct_super.direct_super < userinfo.direct_super.two
+                  : userinfo.is_super == 2
                   ? 'text_3 level2'
-                  : userinfo.direct_super.direct_super >= userinfo.direct_super.two
+                  : userinfo.is_super == 3
                   ? 'text_3 level3'
+                  : userinfo.is_super == 4
+                  ? 'text_3 level4'
                   : 'text_3',
               ]"
               >{{ $t('lang35') }}{{ userinfo.addressEncrypt }}</span
@@ -517,6 +519,12 @@ export default {
       padding: 2px 6px;
       background-color: #000;
     }
+    .level4 {
+      color: #00A733 !important;
+      border-radius: 10px;
+      padding: 2px 6px;
+      background-color: #000;
+    }
     .text-wrapper_1 {
       font-size: 11px;
       line-height: 100%;

+ 11 - 3
src/views/mine/myTeaFriends.vue

@@ -27,12 +27,14 @@
                   <div class="f-row">
                     <span
                       :class="[
-                        item.is_super == 1 && item.direct_super < direct_super.one
+                        item.address_level == 1
                           ? 'address level1'
-                          : item.direct_super >= direct_super.one && item.direct_super < direct_super.two
+                          : item.address_level == 2
                           ? 'address level2'
-                          : item.direct_super >= direct_super.two
+                          : item.address_level == 3
                           ? 'address level3'
+                          : item.address_level >= 4
+                          ? 'address level4'
                           : 'address',
                       ]"
                     >
@@ -332,6 +334,12 @@ export default {
             padding: 2px 6px;
             background-color: #000;
           }
+          .level4 {
+            color: #00A733 !important;
+            border-radius: 10px;
+            padding: 2px 6px;
+            background-color: #000;
+          }
         }
       }
     }

+ 217 - 0
src/views/mine/teaTalk.vue

@@ -0,0 +1,217 @@
+<template>
+  <div class="assets" @scroll="handleScroll">
+    <div class="list" v-if="list.length > 0">
+      <div class="item f-sb-n" v-for="(item, index) in list" :key="index">
+        <div class="left">
+          <div>
+            <span v-html="item.introduction"></span>
+            <img src="@/assets/images/copy.png" alt="" class="icon copys" :data-clipboard-text="item.introduction.replace(/<[^>]*>/g, '')" @click="copy(item.introduction.replace(/<[^>]*>/g, ''))" />
+          </div>
+          <div>
+            <van-image :src="item.img_url" alt="" class="pic" @click="preview(item.img_url)" />
+          </div>
+          <div class="time">
+            <span>{{ dateFormatFn(item.createtime) }}</span>
+          </div>
+        </div>
+        <div class="right f-row copys" :data-clipboard-text="item.img_url" @click="copyimg(item.img_url)">
+          <img src="@/assets/images/down.png" alt="" class="icon" />
+          <span>{{ $t('lang293') }}</span>
+        </div>
+      </div>
+    </div>
+    <div class="nomore" v-else>
+      <span>{{ $t('lang60') }}</span>
+    </div>
+    <BottomNavigation></BottomNavigation>
+  </div>
+</template>
+
+<script>
+import { homeApi } from '@/api/index';
+import { Dialog, Notify, Toast, ImagePreview } from 'vant';
+import { dateFormat } from '@/utils/formatTool.js';
+import BottomNavigation from '@/components/BottomNavigation.vue';
+import Clipboard from 'clipboard';
+export default {
+  components: {
+    BottomNavigation,
+  },
+  data() {
+    return {
+      list: [],
+      page: 1,
+      loading: false,
+      finished: false,
+      total: 0,
+    };
+  },
+  mounted() {
+    this.getAnnouncement();
+  },
+  methods: {
+    copy(result) {
+      console.log(result);
+
+      if (result) {
+        var clipboard = new Clipboard('.copys');
+        clipboard.on('success', e => {
+          this.$toast(this.$t('lang45'));
+          clipboard.destroy(); // 释放内存
+        });
+        clipboard.on('error', e => {
+          this.$toast(this.$t('lang46'));
+          clipboard.destroy(); // 释放内存
+        });
+      }
+    },
+    copyimg(result) {
+      console.log(result);
+
+      if (result) {
+        var clipboard = new Clipboard('.copys');
+        clipboard.on('success', e => {
+          this.$toast(this.$t('lang292'));
+          clipboard.destroy(); // 释放内存
+        });
+        clipboard.on('error', e => {
+          this.$toast(this.$t('lang46'));
+          clipboard.destroy(); // 释放内存
+        });
+      }
+    },
+    dateFormatFn(date) {
+      if (date) {
+        return dateFormat(new Date(date * 1000), 'yyyy-MM-dd hh:mm:ss');
+      }
+    },
+    getAnnouncement() {
+      let params = {
+        page: this.page,
+        query: {},
+        type_id: 3,
+      };
+      homeApi.getAnnouncement(params).then(res => {
+        if (res.code == 200) {
+          if (this.list.length >= res.data.total) {
+            this.page = -1; // 重置为 -1,表示没有更多数据
+          } else {
+            console.log(res.data.rows);
+
+            this.list = [...this.list, ...res.data.rows];
+            if (this.list.length >= res.data.total) {
+              this.page = -1; // 重置为 -1,表示没有更多数据
+            }
+          }
+        } else {
+        }
+      });
+    },
+    handleScroll(event) {
+      const container = event.target;
+      const scrollTop = container.scrollTop; // 滚动距离
+      const scrollHeight = container.scrollHeight; // 内容总高度
+      const clientHeight = container.clientHeight; // 可视区域高度
+      // 判断是否滑动到底部
+      if (scrollTop + clientHeight >= scrollHeight - 10) {
+        console.log('Bottom');
+        if (this.page != -1) {
+          this.page++; // 页数加 1
+          this.getAnnouncement(); // 触发加载更多
+        }
+      }
+    },
+    preview(img_url) {
+      ImagePreview([img_url]);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.f-sb {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.f-sa {
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
+}
+.f-sb-n {
+  display: flex;
+  align-items: flex-end;
+  justify-content: space-between;
+}
+.f-col {
+  display: flex;
+  flex-direction: column;
+}
+.f-row {
+  display: flex;
+  align-items: center;
+}
+.assets {
+  padding: 20px 13px 50px;
+  height: 100vh;
+  overflow: auto;
+
+  .list {
+    color: #000;
+    font-size: 14px;
+    font-weight: 600;
+
+    .item {
+      padding: 13px;
+      border-radius: 12px;
+      margin-bottom: 10px;
+      background-color: #fff;
+      .left {
+        line-height: 150%;
+        padding-right: 10px;
+        .icon {
+          width: 14px;
+          height: 14px;
+          margin-left: 10px;
+        }
+        .pic {
+          min-width: 50px;
+          min-height: 50px;
+          max-width: 100%;
+          max-height: 140px;
+          margin: 10px 0;
+
+          ::v-deep img {
+            max-width: 100% !important;
+            max-height: 140px !important;
+          }
+        }
+        .time {
+          font-size: 10px;
+          font-weight: normal;
+          color: #aaa;
+        }
+      }
+      .right {
+        font-size: 9px;
+        color: #7c92bf;
+        width: fit-content;
+        white-space: nowrap;
+        padding-bottom: 6px;
+        .icon {
+          width: 14px;
+          height: 14px;
+          margin-right: 3px;
+        }
+      }
+    }
+  }
+  .nomore {
+    color: #aaa;
+    text-align: center;
+    font-size: 12px;
+    padding: 20px 0;
+  }
+}
+</style>