瀏覽代碼

与茶付宝打通、增加teac天使资产

xiaomei 4 月之前
父節點
當前提交
8797c6b80b

+ 1 - 0
public/index.html

@@ -5,6 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
     <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
+    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.2.js"></script>
     <title>RWACHA</title>
   </head>
   <style>

+ 34 - 11
src/App.vue

@@ -1,9 +1,7 @@
 <template>
   <div id="app">
     <!-- <Header @reload="reload"></Header> -->
-    <router-view class="router"
-                 v-if="loadRouter" />
-    
+    <router-view class="router" v-if="loadRouter" />
   </div>
 </template>
 
@@ -13,9 +11,10 @@ import { simpleRpcProvider } from '@/utils/provider';
 import Header from '@/components/Header.vue';
 import BottomNavigation from '@/components/BottomNavigation.vue';
 import Sidebar from '@/components/Sidebar.vue';
+import { Toast } from 'vant';
 export default {
   name: 'App',
-  data () {
+  data() {
     return {
       loadRouter: true,
     };
@@ -25,31 +24,56 @@ export default {
     BottomNavigation,
     Sidebar,
   },
-  beforeCreate () {
+  beforeCreate() {
+    let token = this.$route.query.token;
+    if (token) {
+      localStorage.setItem('website', 'app');
+      localStorage.setItem('account', this.$route.query.mobile);
+      localStorage.setItem('token__' + this.$route.query.mobile, token);
+      this.$store.commit('SETACCOUNTS', this.$route.query.mobile);
+    }
     this.$store.dispatch('setWebProvider');
     // localStorage.setItem('lang', "zh-CN");
   },
   computed: {
     ...mapState(['account', 'provider', 'gasPrice', 'slippage', 'deadline', 'transactions', 'block', 'expert']),
   },
-  async created () {
+  async created() {
     const blockNumber = await simpleRpcProvider.eth.getBlockNumber();
     this.$store.commit('SETBLOCK', blockNumber);
     this.timer = setInterval(async () => {
       const blockNumber = await simpleRpcProvider.eth.getBlockNumber();
       this.$store.commit('SETBLOCK', blockNumber);
     }, 6000);
+    // window.__lastPath__ = window.location.pathname;
+
+    window.addEventListener('popstate', function (e) {
+      const currentPath = window.location.pathname;
+      console.log('popstate 触发了');
+      // console.log("当前路径111",currentPath);
+      console.log('上一个路径222', window.__lastPath__);
+      // Toast({ message: currentPath });
+      let a = window.__lastPath__ == '/' || window.__lastPath__ == '/mine' || window.__lastPath__ == '/teaTalk' || window.__lastPath__ == '/transfer' || window.__lastPath__ == '/storage';
+      // Toast({ message: '当前路径111' + window.__currentPath__ + '上一个路径:' + window.__lastPath__ +"a"+a});
+      if (window.__lastPath__ == '/' || window.__lastPath__ == '/mine' || window.__lastPath__ == '/teaTalk' || window.__lastPath__ == '/transfer' || window.__lastPath__ == '/storage') {
+        // 通知 App 返回
+        // Toast({ message: "触发了退出小程序" });
+        console.log('退出小程序');
+        wx.miniProgram.postMessage({ data: {foo: 'bar'} })
+        return wx.miniProgram.switchTab({ url: '/pages/index/index' });
+      }
+    });
   },
   watch: {
-    block () {
+    block() {
       this.handleUpdateTransactions();
     },
   },
-  beforeDestroy () {
+  beforeDestroy() {
     window.clearInterval(this.timer);
   },
   methods: {
-    async handleUpdateTransactions () {
+    async handleUpdateTransactions() {
       if (!this.account) {
         return;
       }
@@ -60,7 +84,6 @@ export default {
       pendTransactions.forEach((item, index) => {
         simpleRpcProvider.eth.getTransactionReceipt(item.hash).then(receipt => {
           if (receipt) {
-
             this.$store.commit('SETTRANSACTIONSRECEIPT', {
               hash: item.hash,
               receipt,
@@ -94,7 +117,7 @@ export default {
         });
       });
     },
-    async reload () {
+    async reload() {
       this.loadRouter = false;
       this.$nextTick(() => {
         this.loadRouter = true;

+ 11 - 0
src/api/home.js

@@ -94,6 +94,17 @@ export default {
       data
     })
   },
+  // 绑定上级(茶)
+  chaBindParent(data) {
+    return request.request({
+      url: '/member/bind',
+      method: "post",
+      headers: {
+        'Accept-Language': localStorage.getItem('language') || 'zh-cn',
+      },
+      data
+    })
+  },
   //提现记录
   withdrawList(data) {
     return request.request({

二進制
src/assets/images/index/teac_angel.png


+ 10 - 1
src/components/Header.vue

@@ -51,8 +51,10 @@ export default {
   computed: {
     ...mapState(['account']),
     getAccount() {
-      if (this.account) {
+      if (this.account.length > 11) {
         return this.account.substring(0, 5) + '****' + this.account.substring(this.account.length - 5, this.account.length);
+      } else if(this.account.length == 11){
+        return this.account.substring(0, 3) + '****' + this.account.substring(this.account.length - 4, this.account.length);
       } else {
         return '';
       }
@@ -112,6 +114,13 @@ export default {
       }
     },
     handleLogin() {
+      let token = this.$route.query.token;
+      if (token) {
+        localStorage.setItem('website', "app");
+        localStorage.setItem('account', this.$route.query.mobile);
+        localStorage.setItem('token__' + this.$route.query.mobile, token);
+        this.$store.commit('SETACCOUNTS', this.$route.query.mobile);
+      }
       this.$store.dispatch('setWebProvider');
     },
     editionSwitching(item) {

+ 9 - 5
src/language/en.json

@@ -21,7 +21,7 @@
   "lang20": "Estimated Rewards",
   "lang21": "Bind Invitation Address",
   "lang22": "Bind",
-  "lang23": "Please enter the parent wallet address",
+  "lang23": "Please enter the inviter wallet address or UID",
   "lang24": "Collapse",
   "lang25": "Expand",
   "lang26": "Grabbed",
@@ -205,11 +205,11 @@
   "lang204": "All orders",
   "lang205": "Asset Details",
   "lang206": "Consignment: ",
-  "lang207": "The other party's address",
-  "lang208": "Enter the wallet address of the other party",
+  "lang207": "To Address or UID",
+  "lang208": "Enter the wallet address of the other party or UID",
   "lang209": "Amount of gift",
   "lang210": "Network fee",
-  "lang211": "Please enter the wallet address of the other party",
+  "lang211": "Please enter the wallet address of the other party or UID",
   "lang212": "Please enter the amount of gift",
   "lang213": "Are you sure to give ChaBao",
   "lang214": "Confirm the gift",
@@ -479,5 +479,9 @@
   "lang478": "The highest monthly output of this tea mining pool",
   "lang479": "Please read and confirm the 'Storage Agreement' in full",
   "lang480": "Please read and confirm in full",
-  "lang481": "Storage Agreement"
+  "lang481": "Storage Agreement",
+  "lang482": "Bind mobile phone number",
+  "lang483": "Bind wallet address",
+  "lang484": "Please enter wallet address",
+  "lang485": "TeaC·Angel"
 }

+ 8 - 8
src/language/zh.json

@@ -21,7 +21,7 @@
   "lang20": "预估奖励",
   "lang21": "绑定邀请地址",
   "lang22": "绑定",
-  "lang23": "请输入上级钱包地址",
+  "lang23": "请输入邀请者钱包地址或UID",
   "lang24": "收起",
   "lang25": "展开",
   "lang26": "已抢",
@@ -205,11 +205,11 @@
   "lang204": "全部订单",
   "lang205": "资产明细",
   "lang206": "寄售:",
-  "lang207": "对方地址",
-  "lang208": "输入对方钱包地址",
+  "lang207": "对方地址或UID",
+  "lang208": "输入对方钱包地址或UID",
   "lang209": "赠送数量",
   "lang210": "网络费",
-  "lang211": "请输入对方钱包地址",
+  "lang211": "请输入对方钱包地址或UID",
   "lang212": "请输入赠送的数量",
   "lang213": "是否确定赠送茶宝",
   "lang214": "确认赠送",
@@ -480,8 +480,8 @@
   "lang479": "请完整阅读并确认《存储协议》",
   "lang480": "请完整阅读并确认",
   "lang481": "存储协议",
-  "lang482": "",
-  "lang483": "",
-  "lang484": "",
-  "lang485": ""
+  "lang482": "绑定手机号",
+  "lang483": "绑定钱包地址",
+  "lang484": "请输入钱包地址",
+  "lang485": "TeaC·天使"
 }

+ 15 - 1
src/router/index.js

@@ -1,6 +1,6 @@
 import Vue from 'vue';
 import VueRouter from 'vue-router';
-import { Notify } from 'vant';
+import { Notify, Toast } from 'vant';
 
 
 import Home from '../views/Home.vue';
@@ -472,6 +472,20 @@ const router = new VueRouter({
   routes,
 });
 
+
+// 在 router/index.js 或 main.js 中写
+router.beforeEach((to, from, next) => {
+  console.log('当前路径:', to.fullPath);
+  console.log('上一个路径:', from.fullPath);
+  // 可以保存在 store 或 window 上,供后续使用
+  window.__currentPath__ = to.fullPath.split('?')[0]+"111";
+  window.__lastPath__ = from.fullPath.indexOf('?') > -1 ? (from.fullPath.split('?')[0] || '/') : from.fullPath;
+  // Toast({ message: '当前路径:'+to.fullPath+"上一个路径:" + window.__lastPath__ });
+  next();
+});
+
+
+
 // router.beforeEach((to, from, next) => {
 //   let parentId = localStorage.getItem('parentId')
 //   if (to.meta.requiresAuth) {

+ 6 - 2
src/store/index.js

@@ -90,7 +90,7 @@ export default new Vuex.Store({
         // console.log(localStorage.getItem("token"), '获取到的token');
         account = account.toLowerCase()
 
-        if (account != localStorage.getItem("account") || !localStorage.getItem("token__" + account)) {
+        if (account != localStorage.getItem('account') || !localStorage.getItem('token__' + account)) {
           let web3 = new Web3(window.web3.currentProvider);
           web3.eth.personal.sign(web3.utils.fromUtf8('register'), account, (err, res) => {
             if (res) {
@@ -252,7 +252,11 @@ export default new Vuex.Store({
         });
         web3js.eth.getAccounts(function (error, result) {
           if (!error) {
-            commit('SETACCOUNTS', result[0]);
+            if (localStorage.getItem('website')) {
+              commit('SETACCOUNTS', localStorage.getItem('account'));
+            } else {
+              commit('SETACCOUNTS', result[0]);
+            }
           }
         });
         web3Provider.on('chainChanged', function (networkIDstring) {

+ 13 - 0
src/utils/request.js

@@ -1,5 +1,6 @@
 import axios from "axios";
 import { Toast } from "vant";
+import Vue from 'vue';
 import store from "../store";
 const service = axios.create({
     // baseURL: 'http://192.168.1.23/api/',
@@ -24,8 +25,20 @@ service.interceptors.response.use(
             return res.data;
         } else if (res.data.code === 14999) {  //token失效,删除登录信息
             let lang = localStorage.getItem('language');
+            let website = localStorage.getItem('website')
             localStorage.clear()
             localStorage.setItem('language', lang);
+            if(website){
+                let token = this.$route.query.token;
+                localStorage.setItem('website', "app");
+                if (token) {
+                    localStorage.setItem('account', this.$route.query.mobile);
+                    localStorage.setItem('token__' + this.$route.query.mobile, token);
+                    this.$store.commit('SETACCOUNTS', this.$route.query.mobile);
+                } else {
+                    Toast({message:"登录信息已过期,请退出后重新登录进入"})
+                }
+            }
             //在这个地方做个 操作 去调用store里面的方法或复制过来
             store.dispatch('setWebProvider');
             Toast({ message: `${res.data.msg}` })

+ 6 - 1
src/views/bulletin/details.vue

@@ -43,7 +43,12 @@ export default {
   methods: {
     //返回上一页
     back() {
-      this.$router.back();
+      if (window.history.length <= 1) {
+      // 如果没有历史记录,可以跳转到默认页
+        this.$router.replace('/'); 
+      } else {
+        this.$router.back();
+      }
     },
     dateFormatFn(date) {
       if (date) {

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

@@ -98,7 +98,12 @@ export default {
     },
     //返回上一页
     back() {
-      this.$router.back();
+      if (window.history.length <= 1) {
+      // 如果没有历史记录,可以跳转到默认页
+        this.$router.replace('/'); 
+      } else {
+        this.$router.back();
+      }
     },
     handleScroll(event) {
       const container = event.target;

+ 6 - 1
src/views/exchange/index.vue

@@ -48,7 +48,12 @@ export default {
   methods: {
     //返回上一页
     back() {
-      this.$router.back();
+      if (window.history.length <= 1) {
+      // 如果没有历史记录,可以跳转到默认页
+        this.$router.replace('/'); 
+      } else {
+        this.$router.back();
+      }
     },
     navigation(name, query) {
       this.$router.push({ name, query });

+ 54 - 18
src/views/index/index.vue

@@ -260,6 +260,14 @@ export default {
     } else {
       Locale.use('zh-CN', zhCN);
     }
+    let token = this.$route.query.token;
+    if (token) {
+      document.title = "返回茶付宝";
+      localStorage.setItem('account', this.$route.query.mobile);
+      localStorage.setItem('token__' + this.$route.query.mobile, token);
+      localStorage.setItem('website', 'app');
+      this.$store.commit('SETACCOUNTS', this.$route.query.mobile);
+    }
     this.inviteCode = this.$route.query.inviteCode;
     if (this.inviteCode) {
       localStorage.setItem('inviteCode', this.inviteCode);
@@ -318,33 +326,61 @@ export default {
         // sign: res,
       };
       //绑定上级 看信息
-      homeApi.auth(data).then(res => {
-        // console.log('走了这里11');
-        //我是绑定上级
-        if (res.code == 200) {
-          if (res.data.parent_id != 0) {
-            Notify({ type: 'success', message: this.$t('lang152') });
-            this.bindShow = false;
-            this.show = false;
-            this.init();
-            localStorage.setItem('userinfo', JSON.stringify(res.data));
-            localStorage.setItem('token__' + account, res.data.token);
-            localStorage.setItem('parentId', res.data.parent_id);
+      if (localStorage.getItem('website')) {
+        homeApi.chaBindParent({
+        mobile: this.account,
+        inviteCode: this.inviteCode,
+      }).then(res => {
+          // console.log('走了这里11');
+          //我是绑定上级
+          if (res.code == 200) {
+            if (res.data.parent_id != 0) {
+              Notify({ type: 'success', message: this.$t('lang152') });
+              this.bindShow = false;
+              this.show = false;
+              this.init();
+              localStorage.setItem('userinfo', JSON.stringify(res.data));
+              localStorage.setItem('token__' + this.account, res.data.token);
+              localStorage.setItem('parentId', res.data.parent_id);
+            } else {
+              this.show = true;
+              Notify({ type: 'danger', message: res.msg });
+            }
           } else {
             this.show = true;
             Notify({ type: 'danger', message: res.msg });
           }
-        } else {
-          this.show = true;
-          Notify({ type: 'danger', message: res.msg });
-        }
-      });
+        });
+      } else {
+        homeApi.auth(data).then(res => {
+          // console.log('走了这里11');
+          //我是绑定上级
+          if (res.code == 200) {
+            if (res.data.parent_id != 0) {
+              Notify({ type: 'success', message: this.$t('lang152') });
+              this.bindShow = false;
+              this.show = false;
+              this.init();
+              localStorage.setItem('userinfo', JSON.stringify(res.data));
+              localStorage.setItem('token__' + this.account, res.data.token);
+              localStorage.setItem('parentId', res.data.parent_id);
+            } else {
+              this.show = true;
+              Notify({ type: 'danger', message: res.msg });
+            }
+          } else {
+            this.show = true;
+            Notify({ type: 'danger', message: res.msg });
+          }
+        });
+      }
     },
     changeBanner(index) {
       this.$refs.swipeRef.swipeTo(index, { immediate: false });
     },
     getUserInfo() {
-      homeApi.getUserInfo({ address: this.account, inviteCode: this.inviteCode }).then(res => {
+      // address: this.account, inviteCode: this.inviteCode
+      homeApi.getUserInfo({}).then(res => {
         if (res.code == 200) {
           localStorage.setItem('userinfo', JSON.stringify(res.data));
           localStorage.setItem('parentId', res.data.parent_id);

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

@@ -65,7 +65,12 @@ export default {
   methods: {
     //返回上一页
     back() {
-      this.$router.back();
+      if (window.history.length <= 1) {
+      // 如果没有历史记录,可以跳转到默认页
+        this.$router.replace('/'); 
+      } else {
+        this.$router.back();
+      }
     },
 
     getNewbieWeal() {

+ 3 - 1
src/views/mine/frozenTransfer.vue

@@ -141,7 +141,9 @@ export default {
           homeApi
             .frozenTransfer({
               amount: _this.amount,
-              address: _this.send_address,
+              // address: _this.send_address,
+              account: _this.send_address,
+              // type: _this.send_address.indexOf('0x') > -1 ? 0 : 1, //type: 0地址 1uid
             })
             .then(res => {
               if (res.code == 200) {

+ 8 - 5
src/views/mine/index.vue

@@ -16,7 +16,7 @@
             </span>
             <img src="@/assets/images/trade/copy.png" alt="" class="copys" @click="copy" :data-clipboard-text="this.userinfo.nickname" />
           </div>
-          <div class="flex-row">
+          <div class="flex-row" v-if="userinfo.address">
             <span
               :class="[
                 userinfo.direct_super.address_level == 1
@@ -289,7 +289,9 @@ export default {
     init() {
       if (this.account) {
         this.userinfo = JSON.parse(localStorage.getItem('userinfo'));
-        this.userinfo.addressEncrypt = this.userinfo.address.substring(0, 5) + '****' + this.userinfo.address.substring(this.userinfo.address.length - 5, this.userinfo.address.length);
+        if (this.userinfo.address) {
+          this.userinfo.addressEncrypt = this.userinfo.address.substring(0, 5) + '****' + this.userinfo.address.substring(this.userinfo.address.length - 5, this.userinfo.address.length);
+        }
         this.getUserInfo();
         this.getNftList();
         this.getWaitPayOrderCount();
@@ -383,7 +385,8 @@ export default {
         if (res.code == 200) {
           this.userinfo = res.data;
           this.order_count = res.data.order_count;
-          this.userinfo.addressEncrypt = this.userinfo.address.substring(0, 5) + '****' + this.userinfo.address.substring(this.userinfo.address.length - 5, this.userinfo.address.length);
+          if (this.userinfo.address)
+            this.userinfo.addressEncrypt = this.userinfo.address.substring(0, 5) + '****' + this.userinfo.address.substring(this.userinfo.address.length - 5, this.userinfo.address.length);
         }
       });
     },
@@ -411,7 +414,7 @@ export default {
       }
     },
     copy() {
-      if (this.userinfo.address) {
+      // if (this.userinfo.address) {
         var clipboard = new Clipboard('.copys');
         clipboard.on('success', e => {
           this.$toast(this.$t('lang45'));
@@ -421,7 +424,7 @@ export default {
           this.$toast(this.$t('lang46'));
           clipboard.destroy(); // 释放内存
         });
-      }
+      // }
     },
     navigatorTo(router) {
       if (this.$route.name == router) return;

+ 6 - 1
src/views/mine/invite.vue

@@ -47,7 +47,12 @@ export default {
   methods: {
     //返回上一页
     back() {
-      this.$router.back();
+      if (window.history.length <= 1) {
+      // 如果没有历史记录,可以跳转到默认页
+        this.$router.replace('/'); 
+      } else {
+        this.$router.back();
+      }
     },
     copy() {
       if (this.inviteLink) {

+ 2 - 1
src/views/mine/sendChaBao.vue

@@ -140,7 +140,8 @@ export default {
           homeApi
             .chabaoGift({
               amount: _this.amount,
-              address: _this.send_address,
+              account: _this.send_address,
+              // type: _this.send_address.indexOf('0x') > -1 ? 0 : 1, //type: 0地址 1uid
             })
             .then(res => {
               if (res.code == 200) {

+ 24 - 5
src/views/mine/setting.vue

@@ -21,12 +21,19 @@
           <span style="color: #aaaaaa" v-if="userinfo.name">{{ userinfo.name }}</span>
           <span style="color: #aaaaaa" v-else>{{ $t('lang98') }}</span>
         </div>
-        <div @click="showPopup(2)" class="li">
+        <div class="li">
           <div class="li_left">
-            <span>{{ $t('lang100') }}</span>
+            <span>{{ $t('lang482') }}</span>
           </div>
           <span style="color: #aaaaaa" v-if="userinfo.phone">{{ userinfo.phone }}</span>
-          <span style="color: #aaaaaa" v-else>{{ $t('lang98') }}</span>
+          <span style="color: #aaaaaa" @click="showPopup(2)" v-else>{{ $t('lang98') }}</span>
+        </div>
+        <div class="li">
+          <div class="li_left">
+            <span>{{ $t('lang483') }}</span>
+          </div>
+          <span style="color: #aaaaaa" v-if="userinfo.address">{{ userinfo.address.substring(0, 5)+"****"+userinfo.address.substring(userinfo.address.length-5, userinfo.address.length) }}</span>
+          <span style="color: #aaaaaa" @click="showPopup(4)" v-else>{{ $t('lang98') }}</span>
         </div>
         <div @click="showPopup(3)" class="li">
           <div class="li_left">
@@ -65,17 +72,19 @@
         </div>
       </div>
     </div>
-    <van-popup v-model="editShow" round style="width: 80%" :close-on-click-overlay="true" @close="editShow = false">
+    <van-popup v-model="editShow" round style="width: 80%" :close-on-click-overlay="true" @close="handleColse">
       <div class="bind_box">
-        <van-icon name="cross" class="close" size="20" @click="editShow = false" />
+        <van-icon name="cross" class="close" size="20" @click="handleColse" />
         <div class="title" v-if="editType == 0">{{ $t('lang105') }}</div>
         <div class="title" v-if="editType == 1">{{ $t('lang106') }}</div>
         <div class="title" v-if="editType == 2">{{ $t('lang107') }}</div>
         <div class="title" v-if="editType == 3">{{ $t('lang231') }}</div>
+        <div class="title" v-if="editType == 4">{{ $t('lang483') }}</div>
         <div class="address_field" v-if="editType != 3">
           <van-field v-model="inputValue" type="text" rows="1" autosize :placeholder="$t('lang108')" v-if="editType == 0" />
           <van-field v-model="inputValue" type="text" rows="1" autosize :placeholder="$t('lang109')" v-if="editType == 1" />
           <van-field v-model="inputValue" type="text" rows="1" autosize :placeholder="$t('lang110')" v-if="editType == 2" />
+          <van-field v-model="inputValue" type="textarea" rows="2" autosize :placeholder="$t('lang484')" v-if="editType == 4" />
         </div>
         <div class="address_field" v-if="editType == 3">
           <div class="flex-row bt">
@@ -178,6 +187,10 @@ export default {
         this.getUserInfo();
       }
     },
+    handleColse(){
+      this.editShow = false
+      this.inputValue = '';
+    },
     editUserInfo() {
       if (this.editType == 0 && !this.inputValue) {
         return this.$toast(this.$t('lang169'));
@@ -187,6 +200,8 @@ export default {
         return this.$toast(this.$t('lang171'));
       } else if ((this.editType == 3 && !this.addressDetail) || (this.editType == 3 && !this.areaText)) {
         return this.$toast(this.$t('lang238'));
+      } else if ((this.editType == 4 && !this.inputValue)) {
+        return this.$toast(this.$t('lang484'));
       }
       let params = {};
       if (this.editType == 0) {
@@ -198,6 +213,8 @@ export default {
       } else if (this.editType == 3) {
         params.address = this.areaText.replace(/\//g, ' ') + ' ' + this.addressDetail;
         params.area_code = this.area_code;
+      } else if (this.editType == 4) {
+        params.address = this.inputValue;
       }
 
       homeApi.setUserInfo(params).then(res => {
@@ -209,6 +226,8 @@ export default {
           this.area_code = '';
           this.getUserInfo();
           Notify({ type: 'success', message: this.$t('lang172') });
+        } else {
+          this.$toast(res.msg);
         }
       });
     },

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

@@ -108,6 +108,22 @@
               </div>
             </div>
           </div>
+          <div class="total_box" v-else-if="coin_type == 'teac_angel'">
+            <div>
+              <span class="text">{{ $t('lang80') }}({{ $t('lang485') }})</span>
+            </div>
+            <div class="total">
+              <span>{{ Math.floor(teac_angel * 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">
@@ -148,6 +164,7 @@
                       </span>
                       <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>
                   </div>
                   <div class="f-c" v-if="coin_type == 'token'">
@@ -177,6 +194,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_angel'">
+                    <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>
@@ -215,6 +241,7 @@ export default {
       balance: 0, //茶宝资产
       teac: 0, // teac资产
       frozen: 0, // 标记茶宝资产
+      teac_angel: 0, // teac天使资产
       coin_type: '',
     };
   },
@@ -242,9 +269,6 @@ export default {
     changeNav(item, index) {
       this.navIndex = index;
     },
-    dateFormatFn(date) {
-      return dateFormat(new Date(date * 1000), 'yyyy-MM-dd hh:mm:ss');
-    },
     handleScroll(event) {
       const container = event.target;
       const scrollTop = container.scrollTop; // 滚动距离
@@ -265,6 +289,7 @@ export default {
           this.balance = data.filter(i => i.coin_key == 'token')[0].amount;
           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;
         } else {
         }
       });

+ 7 - 1
src/views/mine/synthesis.vue

@@ -40,6 +40,7 @@
 import { mapState } from 'vuex';
 import { homeApi } from '@/api/index';
 import { dateFormat } from '@/utils/formatTool.js';
+import { Toast } from 'vant';
 export default {
   data() {
     return {
@@ -56,7 +57,12 @@ export default {
   methods: {
     //返回上一页
     back() {
-      this.$router.back();
+      if (window.history.length <= 1) {
+      // 如果没有历史记录,可以跳转到默认页
+        this.$router.replace('/'); 
+      } else {
+        this.$router.back();
+      }
     },
     init() {
       this.getSynthesisList();

+ 8 - 1
src/views/pendingOrder/index.vue

@@ -384,7 +384,14 @@ export default {
       });
     },
     //判断是否登录
-    handleLogin () {
+    handleLogin() {
+      let token = this.$route.query.token;
+      if (token) {
+        localStorage.setItem('website', "app");
+        localStorage.setItem('account', this.$route.query.mobile);
+        localStorage.setItem('token__' + this.$route.query.mobile, token);
+        this.$store.commit('SETACCOUNTS', this.$route.query.mobile);
+      }
       this.$store.dispatch('setWebProvider');
     },
     //是否授权

+ 6 - 1
src/views/teacEx/index.vue

@@ -50,7 +50,12 @@ export default {
     },
     //返回上一页
     back() {
-      this.$router.back();
+      if (window.history.length <= 1) {
+      // 如果没有历史记录,可以跳转到默认页
+        this.$router.replace('/'); 
+      } else {
+        this.$router.back();
+      }
     },
     navigatorTo(router) {
       if (this.$route.name == router) return;

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

@@ -34,7 +34,7 @@
               <line x1="63" y1="29" x2="63" y2="73" stroke="#e7e7e7" stroke-width="5.2" stroke-linecap="round" />
             </svg>
             <span class="small">
-              <span style="margin-right: -5px">{{ product.info.cost_price }}</span>
+              <span style="margin-right: -2px">{{ product.info.cost_price }}</span>
               <svg width="16" height="19" viewBox="40 -22 50 96" xmlns="http://www.w3.org/2000/svg">
                 <path
                   d="M70,35
@@ -279,7 +279,12 @@ export default {
       }
     },
     goBack() {
-      this.$router.back();
+      if (window.history.length <= 1) {
+      // 如果没有历史记录,可以跳转到默认页
+        this.$router.replace('/'); 
+      } else {
+        this.$router.back();
+      }
     },
     toPage(name) {
       this.$router.push({ name });