新币+dapp app 前端
zzzz
2024-04-08 b78dbd7d2e97cd0d698bc67639d93067bb56781c
first commit
3 files modified
1 files added
10006 ■■■■■ changed files
package.json 1 ●●●● patch | view | raw | blame | history
src/main.js 60 ●●●●● patch | view | raw | blame | history
src/page/order/MiningMachineOrder/index.vue 173 ●●●●● patch | view | raw | blame | history
yarn.lock 9772 ●●●●● patch | view | raw | blame | history
package.json
@@ -20,6 +20,7 @@
    "js-md5": "^0.7.3",
    "klinecharts": "^8.6.1",
    "lightweight-charts": "^3.8.0",
    "moment": "^2.30.1",
    "node-polyfill-webpack-plugin": "^2.0.0",
    "postcss-loader": "^7.0.1",
    "qrcode": "^1.5.1",
src/main.js
@@ -1,25 +1,47 @@
import Vue from 'vue'
import store from './store';
import App from './App.vue'
import i18n from './i18n'
import router from '@/router/router'
import '@/assets/remNew.js'
import Vue from "vue";
import store from "./store";
import App from "./App.vue";
import i18n from "./i18n";
import router from "@/router/router";
import "@/assets/remNew.js";
import moment from "moment";
Vue.config.productionTip = false
Vue.prototype.TITLE = process.env.VUE_APP_TITLE
Vue.prototype.H5ZZ = process.env.VUE_APP_H5ZZ
Vue.prototype.APPZZ = process.env.VUE_APP_APPZZ
import { Button, Row, Col, NavBar, Toast, Loading, Dialog, Tabbar, TabbarItem, NoticeBar, Icon } from 'vant'
Vue.use(Button).use(Row).use(Col).use(NavBar).use(Toast).use(Loading).use(Dialog).use(Tabbar).use(TabbarItem).use(NoticeBar).use(Icon)
window.eventBus = new Vue()
Vue.config.productionTip = false;
Vue.prototype.$moment = moment;
Vue.prototype.TITLE = process.env.VUE_APP_TITLE;
Vue.prototype.H5ZZ = process.env.VUE_APP_H5ZZ;
Vue.prototype.APPZZ = process.env.VUE_APP_APPZZ;
import {
  Button,
  Row,
  Col,
  NavBar,
  Toast,
  Loading,
  Dialog,
  Tabbar,
  TabbarItem,
  NoticeBar,
  Icon,
} from "vant";
Vue.use(Button)
  .use(Row)
  .use(Col)
  .use(NavBar)
  .use(Toast)
  .use(Loading)
  .use(Dialog)
  .use(Tabbar)
  .use(TabbarItem)
  .use(NoticeBar)
  .use(Icon);
window.eventBus = new Vue();
// import FastClick from 'fastclick'
// FastClick.attach(document.body);
import VueClipboard from 'vue-clipboard2'
VueClipboard.config.autoSetContainer = true
import VueClipboard from "vue-clipboard2";
VueClipboard.config.autoSetContainer = true;
Vue.use(VueClipboard);
new Vue({
  //  Router:Router,
@@ -29,5 +51,5 @@
  store: store,
  i18n,
  router: router,
  render: h => h(App),
}).$mount('#app')
  render: (h) => h(App),
}).$mount("#app");
src/page/order/MiningMachineOrder/index.vue
@@ -1,144 +1,181 @@
<template>
  <div id="financialOrder" class="financialOrder">
    <assets-head :title="title" :back-func="backFunc"></assets-head>
    <div class="box-border  ">
    <div class="box-border">
      <div class="flex flex-col justify-center items-center px-33">
        <div class="font-32 font-400 my-34 textColor">{{ $t('锁仓金额') }}(USDT)</div>
        <div class="font-32 font-400 my-34 textColor">
          {{ $t("锁仓金额") }}(USDT)
        </div>
        <div class="font-66 mb-65 textColor">{{ dataObj.amount }}</div>
      </div>
      <div class=" px-33 boderT12">
      <div class="px-33 boderT12">
        <div class="flex justify-between flex-row items-center h-98">
          <div class="font-31 font-400 text-grey">{{ $t('锁仓时间') }}</div>
          <div class="font-31 font-400 textColor">{{ dataObj.cycle == 0 ? $t('无限期') : dataObj.cycle + $t('天') }}</div>
          <div class="font-31 font-400 text-grey">{{ $t("锁仓时间") }}</div>
          <div class="font-31 font-400 textColor">
            {{ dataObj.cycle == 0 ? $t("无限期") : dataObj.cycle + $t("天") }}
          </div>
        </div>
        <div class="flex justify-between items-center h-98">
          <div class="font-31 font-400 text-grey">{{ $t('当日收益') }}</div>
          <div class="font-31 font-400 textColor">{{ dataObj.profit_may / 30 }}&nbsp;{{ dataObj.outputCurrency ?
            dataObj.outputCurrency.toUpperCase() : 'USDT' }}</div>
          <div class="font-31 font-400 text-grey">{{ $t("当日收益") }}</div>
          <div class="font-31 font-400 textColor">
            {{ dataObj.profit_may / 30 }}&nbsp;{{
              dataObj.outputCurrency
                ? dataObj.outputCurrency.toUpperCase()
                : "USDT"
            }}
          </div>
        </div>
        <div class="flex justify-between items-center h-98">
          <div class="font-31 font-400 text-grey">{{ $t('已获收益') }}</div>
          <div class="font-31 font-400 text-grey">{{ $t("已获收益") }}</div>
          <div class="font-31 font-400 textColor">{{ dataObj.profit }}</div>
        </div>
        <div class="flex justify-between items-center h-98">
          <div class="font-31 font-400 text-grey">{{ $t('剩余天数') }}</div>
          <div class="font-31 font-400 textColor">{{ dataObj.days + $t('天') }}</div>
          <div class="font-31 font-400 text-grey">{{ $t("剩余天数") }}</div>
          <div class="font-31 font-400 textColor">
            {{ dataObj.days + $t("天") }}
          </div>
        </div>
      </div>
      <div class="px-33 boderT12">
        <div class="flex justify-between items-center h-98">
          <div class="font-31 font-400 text-grey">30{{ $t('天') }}{{ $t('预期收益') }}</div>
          <div class="font-31 font-400 textColor">{{ dataObj.profit_may }}&nbsp;{{ dataObj.outputCurrency ?
            dataObj.outputCurrency.toUpperCase() : 'USDT' }}</div>
          <div class="font-31 font-400 text-grey">
            30{{ $t("天") }}{{ $t("预期收益") }}
          </div>
          <div class="font-31 font-400 textColor">
            {{ dataObj.profit_may }}&nbsp;{{
              dataObj.outputCurrency
                ? dataObj.outputCurrency.toUpperCase()
                : "USDT"
            }}
          </div>
        </div>
        <div class="flex justify-between items-center h-98">
          <div class="font-31 font-400 text-grey">{{ $t('日收益率') }}</div>
          <div class="font-31 font-400 textColor">{{ dataObj.daily_rate }}%</div>
          <div class="font-31 font-400 text-grey">{{ $t("日收益率") }}</div>
          <div class="font-31 font-400 textColor">
            {{ dataObj.daily_rate }}%
          </div>
        </div>
      </div>
      <div class="px-33 boderT12">
        <div class="flex justify-between items-center h-98">
          <div class="font-31 font-400 text-grey">{{ $t('起息时间') }}</div>
          <div class="font-31 font-400 textColor">{{ dataObj.earn_timeStr }}</div>
          <div class="font-31 font-400 text-grey">{{ $t("起息时间") }}</div>
          <div class="font-31 font-400 textColor">
            {{ dataObj.earn_timeStr }}
          </div>
        </div>
        <div class="flex justify-between items-center h-98">
          <div class="font-31 font-400 text-grey">{{ $t('到期时间') }}</div>
          <div class="font-31 font-400 textColor">{{ dataObj.stop_timeStr ? dataObj.stop_timeStr : '--' }}</div>
          <div class="font-31 font-400 text-grey">{{ $t("到期时间") }}</div>
          <div class="font-31 font-400 textColor">
            {{
              $moment(dataObj.earn_timeStr)
                .add(dataObj.days, "days")
                .format("YYYY-MM-DD")
            }}
          </div>
        </div>
      </div>
      <div class="px-33 boderT12">
        <div class="flex justify-between items-center h-98">
          <div class="font-31 font-400 text-grey">{{ $t('订单编号') }}</div>
          <div class="font-31 font-400 text-grey">{{ $t("订单编号") }}</div>
          <div class="font-31 font-400 textColor">{{ dataObj.order_no }}</div>
        </div>
        <div class="flex justify-between items-center h-98">
          <div class="font-31 font-400 text-grey">{{ $t('订单时间') }}</div>
          <div class="font-31 font-400 textColor">{{ dataObj.create_timeStr }}</div>
          <div class="font-31 font-400 text-grey">{{ $t("订单时间") }}</div>
          <div class="font-31 font-400 textColor">
            {{ dataObj.create_timeStr }}
          </div>
        </div>
      </div>
    </div>
    <button v-if="this.showBtn" @click="ransom"
    <button
      v-if="this.showBtn"
      @click="ransom"
      class="text-white btnMain h-97 lh-97 w-762 rounded-lg text-center fixed wz border-none"
      :disabled="!dataObj.can_close" :class="!dataObj.can_close ? 'greyBg textColor1' : ''">{{ $t('我要赎回') }}
      :disabled="!dataObj.can_close"
      :class="!dataObj.can_close ? 'greyBg textColor1' : ''"
    >
      {{ $t("我要赎回") }}
    </button>
  </div>
</template>
<script>
import assetsHead from '@/components/assets-head'
import assetsHead from "@/components/assets-head";
import { ransomMachineProduct, getMinerorder } from "@/API/financialManagement";
import dayjs from "dayjs";
export default {
  name: "index",
  components: {
    assetsHead
    assetsHead,
  },
  data() {
    return {
      type: '',
      order_no: '',
      type: "",
      order_no: "",
      showBtn: false,
      title: '',
      title: "",
      dataObj: {
        amount: 0,
        cycle: '',
        daily_profit: '',
        profit: '',
        days: '',
        daily_rate: '',
        earn_time: '',
        stop_time: '',
        order_no: '',
        create_time: ''
      }
    }
        cycle: "",
        daily_profit: "",
        profit: "",
        days: "",
        daily_rate: "",
        earn_time: "",
        stop_time: "",
        order_no: "",
        create_time: "",
      },
    };
  },
  filters: {
    timeFomat(value) {
      return dayjs(value).format('YYYY-MM-DD HH:mm:ss')
    }
      return dayjs(value).format("YYYY-MM-DD HH:mm:ss");
    },
  },
  mounted() {
    this.type = this.$route.query.type
    this.order_no = this.$route.query.order_no
    this.showBtn = this.$route.query.showBtn
    this.getOrderDetail()
    this.type = this.$route.query.type;
    this.order_no = this.$route.query.order_no;
    this.showBtn = this.$route.query.showBtn;
    this.getOrderDetail();
  },
  methods: {
    backFunc() {
      this.$router.push({
        path: '/funds',
        path: "/funds",
        query: {
          tab: 3,
          index: 1 // 0: 查看理财订单 1: 矿机
        }
      })
          index: 1, // 0: 查看理财订单 1: 矿机
        },
      });
    },
    ransom() { // 赎回
    ransom() {
      // 赎回
      ransomMachineProduct({
        order_no: this.order_no
      }).then(res => {
        this.$toast(this.$t('赎回成功'))
        order_no: this.order_no,
      }).then((res) => {
        this.$toast(this.$t("赎回成功"));
        setTimeout(() => {
          this.backFunc()
        }, 1000)
      })
          this.backFunc();
        }, 1000);
      });
    },
    getOrderDetail() {
      getMinerorder({
        order_no: this.order_no
      }).then(res => {
        this.dataObj = res
        let title = this.$i18n.locale === 'en' ? res.miner_name_en : res.miner_name_cn
        this.title = title + ' ' + this.$t('详情')
      })
    }
  }
}
        order_no: this.order_no,
      }).then((res) => {
        this.dataObj = res;
        let title =
          this.$i18n.locale === "en" ? res.miner_name_en : res.miner_name_cn;
        this.title = title + " " + this.$t("详情");
      });
    },
  },
};
</script>
<style lang="scss" scoped>
yarn.lock
New file
Diff too large