|
|
@@ -0,0 +1,525 @@
|
|
|
+<template>
|
|
|
+ <div class="product-detail-page">
|
|
|
+ <!-- 顶部返回按钮 -->
|
|
|
+ <!-- <van-nav-bar title="NFTCHA-全球首个NFT茶交易平台" left-arrow @click-left="goBack" /> -->
|
|
|
+ <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.images" :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="product-info">
|
|
|
+ <div class="product-price-stock">
|
|
|
+ <div class="left">
|
|
|
+ <div class="price">
|
|
|
+ <span>{{ product.teac_price }}</span>
|
|
|
+ <span class="small" style="color: #fff">TeaC</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="goods_info">
|
|
|
+ <div class="flex jsb">
|
|
|
+ <span class="title">{{ product.name }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 商品详情 -->
|
|
|
+ <div class="product-details">
|
|
|
+ <div class="section-title">{{ $t('lang62') }}</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 宣传图片 -->
|
|
|
+ <div v-html="product.details" class="promo-image"></div>
|
|
|
+ <!-- 底部导航栏 -->
|
|
|
+ <div class="bottom">
|
|
|
+ <div class="flex">
|
|
|
+ <div class="flex flex-c" @click="toPage('kf')">
|
|
|
+ <img src="@/assets/images/trade/custom.png" alt="" class="icon" />
|
|
|
+ <span>{{ $t('lang67') }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="flex flex-c" @click="toPage('invite')">
|
|
|
+ <img src="@/assets/images/trade/share.png" alt="" class="icon" />
|
|
|
+ <span>{{ $t('lang68') }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="buy" @click="stepperShow = true">
|
|
|
+ <van-button class="buy_btn" type="primary">{{ $t('lang456') }}</van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 选择数量 -->
|
|
|
+ <van-popup v-model="stepperShow" round position="bottom">
|
|
|
+ <div class="area">
|
|
|
+ <div class="title">{{ $t('lang242') }}</div>
|
|
|
+ <div class="stepper">
|
|
|
+ <span>{{ $t('lang242') }}</span>
|
|
|
+ <van-stepper v-model="number" min="1" />
|
|
|
+ </div>
|
|
|
+ <div class="submit">
|
|
|
+ <van-button class="submit_btn" type="primary" @click="submitNoarea">{{ $t('lang71') }}</van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
+ <van-popup v-model="loading" round class="loading-popup">
|
|
|
+ <div class="loading">
|
|
|
+ <van-loading type="spinner" />
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+ <script>
|
|
|
+import { homeApi } from '@/api/index';
|
|
|
+import { Dialog, Notify, Toast } from 'vant';
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ product: {},
|
|
|
+ cascaderShow: false,
|
|
|
+ loading: false,
|
|
|
+ stepperShow: false,
|
|
|
+ number: 1,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getTeacExDetail(this.$route.query.id);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ goBack() {
|
|
|
+ this.$router.back();
|
|
|
+ },
|
|
|
+ toPage(name) {
|
|
|
+ this.$router.push({ name });
|
|
|
+ },
|
|
|
+ getTeacExDetail(id) {
|
|
|
+ homeApi.getTeacExDetail({ product_id: id }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.product = res.data;
|
|
|
+ this.product.images = res.data.images.split(',');
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 无关联地区的
|
|
|
+ submitNoarea() {
|
|
|
+ if (this.number <= 0) {
|
|
|
+ return Notify({ type: 'warning', message: this.$t('lang119') });
|
|
|
+ }
|
|
|
+ let _this = this;
|
|
|
+ Dialog.confirm({
|
|
|
+ title: this.$t('lang136'),
|
|
|
+ message: this.$t('lang450'),
|
|
|
+ confirmButtonText: _this.$t('lang111'),
|
|
|
+ cancelButtonText: _this.$t('lang135'),
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ _this.loading = true;
|
|
|
+ homeApi.getTeacExOrder({ product_id: _this.product.id, stock: _this.number }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ _this.loading = false;
|
|
|
+ _this.stepperShow = false;
|
|
|
+ Toast({ message: res.msg });
|
|
|
+ _this.$router.push('mine');
|
|
|
+ } else if (res.code == 15001) {
|
|
|
+ _this.loading = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.$router.push('recharge');
|
|
|
+ }, 300);
|
|
|
+ } else {
|
|
|
+ _this.loading = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // on cancel
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+ <style lang="less" scoped>
|
|
|
+.product-detail-page {
|
|
|
+ // background-color: #fff;
|
|
|
+ min-height: 100vh;
|
|
|
+ padding-bottom: 100px;
|
|
|
+}
|
|
|
+
|
|
|
+.product-swiper {
|
|
|
+ height: 250px;
|
|
|
+ width: 100vw;
|
|
|
+}
|
|
|
+
|
|
|
+.product-image {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.product-info {
|
|
|
+ .product-price-stock {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 6px 14px;
|
|
|
+ background: linear-gradient(to right, #1ab986, #25d7bb);
|
|
|
+ .left {
|
|
|
+ flex: 1;
|
|
|
+ padding-right: 10px;
|
|
|
+ .price {
|
|
|
+ font-size: 22px;
|
|
|
+ color: #fff;
|
|
|
+ .small {
|
|
|
+ color: #e7e7e7;
|
|
|
+ font-size: 12px;
|
|
|
+ padding-right: 6px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .tags {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 11px;
|
|
|
+ color: #f8f8f8;
|
|
|
+ text-align: right;
|
|
|
+ margin-top: 6px;
|
|
|
+ .tag {
|
|
|
+ white-space: nowrap;
|
|
|
+ color: #1ab986;
|
|
|
+ font-size: 11px;
|
|
|
+ border-radius: 4px;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .end {
|
|
|
+ text-align: center;
|
|
|
+ line-height: 40px;
|
|
|
+ }
|
|
|
+ .countdown {
|
|
|
+ min-width: 100px;
|
|
|
+ height: 40px;
|
|
|
+ font-size: 13px;
|
|
|
+ border-left: 1px solid #f1f1f1;
|
|
|
+ padding-left: 10px;
|
|
|
+ .clock {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ margin-right: 4px;
|
|
|
+ }
|
|
|
+ .count {
|
|
|
+ margin-top: 6px;
|
|
|
+ }
|
|
|
+ .colon {
|
|
|
+ display: inline-block;
|
|
|
+ margin: 0 4px;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 11px;
|
|
|
+ }
|
|
|
+ .block {
|
|
|
+ display: inline-block;
|
|
|
+ width: 21px;
|
|
|
+ color: #1ab986;
|
|
|
+ font-size: 12px;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 4px;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .goods_info {
|
|
|
+ padding: 8px 14px;
|
|
|
+ background-color: #fff;
|
|
|
+ .title {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 550;
|
|
|
+ color: #3d3d3d;
|
|
|
+ }
|
|
|
+ .red {
|
|
|
+ color: rgb(255, 48, 48);
|
|
|
+ font-size: 11px;
|
|
|
+ }
|
|
|
+ .tag {
|
|
|
+ color: #0db39a;
|
|
|
+ font-size: 11px;
|
|
|
+ padding-top: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.issue {
|
|
|
+ color: #aaaaaa;
|
|
|
+ font-size: 13px;
|
|
|
+ padding: 16px 14px;
|
|
|
+ margin: 8px 0;
|
|
|
+ background-color: #ffffff;
|
|
|
+ .item {
|
|
|
+ .ellipsis-icon {
|
|
|
+ transform: rotate(90deg);
|
|
|
+ margin-left: 0.8em;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .ssm {
|
|
|
+ content: 'USDT';
|
|
|
+ font-size: 8px;
|
|
|
+ }
|
|
|
+ .item:last-child {
|
|
|
+ .ellipsis-icon {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .tag {
|
|
|
+ font-size: 12px;
|
|
|
+ padding: 2px 6px;
|
|
|
+ border-radius: 4px;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ .current {
|
|
|
+ color: #000;
|
|
|
+ .red {
|
|
|
+ color: rgb(255, 48, 48);
|
|
|
+ }
|
|
|
+ .tag {
|
|
|
+ color: #29b286;
|
|
|
+
|
|
|
+ background-color: #d4f0e7;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.zp {
|
|
|
+ color: #3d3d3d;
|
|
|
+ font-size: 12px;
|
|
|
+ padding: 16px 14px;
|
|
|
+ margin: 8px 0;
|
|
|
+ background-color: #ffffff;
|
|
|
+ white-space: nowrap;
|
|
|
+
|
|
|
+ .safe {
|
|
|
+ width: 22px;
|
|
|
+ height: 22px;
|
|
|
+ margin-right: 4px;
|
|
|
+ }
|
|
|
+ .t {
|
|
|
+ font-size: 13px;
|
|
|
+ white-space: wrap;
|
|
|
+ }
|
|
|
+}
|
|
|
+.jsb {
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+.flex {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.section-title {
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+
|
|
|
+.product-details {
|
|
|
+ color: #3d3d3d;
|
|
|
+ font-size: 12px;
|
|
|
+ padding: 16px 14px;
|
|
|
+ margin: 8px 0 0;
|
|
|
+ background-color: #ffffff;
|
|
|
+
|
|
|
+ .box {
|
|
|
+ color: #aaaaaa;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ padding: 7px 14px;
|
|
|
+ border-radius: 10px;
|
|
|
+ background-color: #ededed;
|
|
|
+ .item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ width: 50%;
|
|
|
+ padding: 7px 0px;
|
|
|
+ .val {
|
|
|
+ color: #000;
|
|
|
+ width: 50%;
|
|
|
+ // display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.ellipsis {
|
|
|
+ overflow: hidden; /* 确保超出容器的文本被裁剪 */
|
|
|
+ white-space: nowrap; /* 确保文本在一行内显示 */
|
|
|
+ text-overflow: ellipsis; /* 使用省略号表示文本超出 */
|
|
|
+}
|
|
|
+.promo-image {
|
|
|
+ width: 100%;
|
|
|
+ img {
|
|
|
+ width: 100% !important;
|
|
|
+ }
|
|
|
+ // margin-top: 14px;
|
|
|
+}
|
|
|
+.stepper {
|
|
|
+ color: #000;
|
|
|
+ font-size: 14px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 36px 0 50px;
|
|
|
+}
|
|
|
+.van-tabbar-item {
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+.bottom {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 50px;
|
|
|
+ background-color: #fff;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 14px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .flex-c {
|
|
|
+ color: #3d3d3d;
|
|
|
+ font-size: 10px;
|
|
|
+ flex-direction: column;
|
|
|
+ margin-right: 16px;
|
|
|
+ .icon {
|
|
|
+ width: 22px;
|
|
|
+ height: 22px;
|
|
|
+ margin-bottom: 3px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .buy {
|
|
|
+ &_btn {
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ font-size: 13px;
|
|
|
+ background-color: #29b286;
|
|
|
+ border: none;
|
|
|
+ padding: 0 16px;
|
|
|
+ white-space: nowrap;
|
|
|
+ border-radius: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.back {
|
|
|
+ position: fixed;
|
|
|
+ z-index: 99;
|
|
|
+ top: 14px;
|
|
|
+ left: 14px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ margin: auto auto;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: #7a777b;
|
|
|
+}
|
|
|
+.area {
|
|
|
+ padding: 20px 30px;
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ position: relative;
|
|
|
+ .title {
|
|
|
+ color: #000;
|
|
|
+ font-size: 15px;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: bold;
|
|
|
+ padding: 0 0 14px;
|
|
|
+ }
|
|
|
+ .vanlist {
|
|
|
+ max-height: 350px;
|
|
|
+ min-height: 350px;
|
|
|
+ overflow: auto;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin: 20px 0;
|
|
|
+ border: none !important;
|
|
|
+
|
|
|
+ .item {
|
|
|
+ padding: 12px 0 !important;
|
|
|
+ border-bottom: 0.5px solid rgba(190, 190, 190, 0.15);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .nomore {
|
|
|
+ color: #aaa;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 12px;
|
|
|
+ height: 350px;
|
|
|
+ padding: 40px 0;
|
|
|
+ }
|
|
|
+ .submit {
|
|
|
+ width: 100%;
|
|
|
+ // position: fixed;
|
|
|
+ bottom: 30px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ &_btn {
|
|
|
+ width: 100%;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ font-size: 14px;
|
|
|
+ background-color: #29b286;
|
|
|
+ border: none;
|
|
|
+ white-space: nowrap;
|
|
|
+ border-radius: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .input {
|
|
|
+ width: 100%;
|
|
|
+ border: 1px solid #29b286;
|
|
|
+ border-radius: 20px;
|
|
|
+ }
|
|
|
+ ::v-deep .van-field__control {
|
|
|
+ padding: 6px 12px;
|
|
|
+ }
|
|
|
+ ::v-deep .van-icon-search {
|
|
|
+ font-size: 20px;
|
|
|
+ color: #29b286;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .van-hairline--top-bottom::after,
|
|
|
+ ::v-deep.van-hairline-unset--top-bottom::after {
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+}
|
|
|
+::v-deep .van-hairline--left::after {
|
|
|
+ border-left-width: 0.005px !important;
|
|
|
+}
|
|
|
+::v-deep .van-cascader__option,
|
|
|
+::v-deep .van-cascader__title {
|
|
|
+ color: #000;
|
|
|
+}
|
|
|
+
|
|
|
+.loading {
|
|
|
+ padding: 50px 60px;
|
|
|
+ border: none;
|
|
|
+ background-color: rgba(#353535, 1);
|
|
|
+}
|
|
|
+.loading-popup {
|
|
|
+ background-color: rgba(#353535, 0);
|
|
|
+}
|
|
|
+::v-deep .van-stepper__plus::after {
|
|
|
+ font-size: 12px !important;
|
|
|
+ width: 1%;
|
|
|
+ height: 12px;
|
|
|
+ // transform: scale(0.5);
|
|
|
+}
|
|
|
+::v-deep .van-stepper__plus::before {
|
|
|
+ // font-size: 12px !important;
|
|
|
+ width: 12px;
|
|
|
+ height: 2%;
|
|
|
+ // transform: scale(0.5);
|
|
|
+}
|
|
|
+::v-deep .van-stepper__minus::before {
|
|
|
+ width: 12px;
|
|
|
+ height: 2%;
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|
|
|
+
|