1
jhzh
2024-10-21 b07cdd51ed7a0c545391da354660dc8ffb0d5fbd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<template>
  <div id="order-generation" class="w-full">
    <order-nav />
    <div class="mt-40 px-32 c2cColor">
      <h1 class="font-48 font-400">{{ $t("订单已生成") }}</h1>
      <div class="flex items-center mt-16 font-28">
        <span>{{ $t("请在倒计时时间内付款给卖家。") }}</span>
        <van-count-down class="flex font-700 mx-10" :time="time">
          <template #default="timeData">
            <span class="block">{{ timeData.hours }}</span>
            <span class="colon">:</span>
            <span class="block">{{ timeData.minutes }}</span>
            <span class="colon">:</span>
            <span class="block">{{ timeData.seconds }}</span>
          </template>
        </van-count-down>
      </div>
      <div
        class="w-full mt-50 pt-46 pl-32 pb-42 box-border border-ra tabBackground"
      >
        <div class="flex justify-between">
          <div
            @click="
              $router.push(`/advertiserDetail?uid=${orderDetail.c2cUserId}`)
            "
            class="flex items-center"
          >
            <img
              class="w-38 h-38 mr-10"
              :src="orderDetail.c2cUserHeadImg"
              alt=""
            />
            <h3 class="font-32 font-400">{{ orderDetail.realName }}</h3>
            <img
              class="w-30 h-30 ml-8 mr-20"
              src="~@/assets/image/otc/buy/star.png"
              alt=""
              v-if="orderDetail.c2cUserType"
            />
            <van-icon
              color="#9399A4"
              name="arrow"
              class="relative top-1 font-700 font-20"
            />
          </div>
          <div
            style="
              background: linear-gradient(to right, #b6dbff, #1d91ff);
              border-top-left-radius: 40px;
              border-bottom-left-radius: 40px;
            "
            class="flex items-center font-24 text-white py-10 px-14"
            @click="gotoChat"
          >
            <img
              class="w-35 h-33 mr-10"
              src="~@/assets/image/c2c/Vector-white.png"
              alt=""
            />
            {{ $t("联系卖家") }}
          </div>
        </div>
        <div class="mt-60">
          <div class="flex items-center mb-30 pr- 185">
            <img
              class="w-28 h-28 mr-12"
              src="~@/assets/image/c2c/gou.png"
              alt=""
            />
            <p class="font-24">
              {{ $t("卖家的数字货币现已存入托管账户,请放心付款") }}
            </p>
          </div>
          <div class="flex justify-between">
            <div class="flex items-center">
              <img
                class="w-28 h-28 mr-12"
                src="~@/assets/image/c2c/gou.png"
                alt=""
              />
              <p class="font-24">{{ $t("7x24小时客服支持") }}</p>
            </div>
            <div class="pr-40" @click="tokefu">
              <van-icon
                color="#9399A4"
                name="arrow"
                class="relative top-1 font-700 font-20"
              />
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="w-full h-16 my-40 diviLine"></div>
    <div class="px-32">
      <order-data :title="$t('购买')" :detail="orderDetail" />
    </div>
    <div class="w-full h-16 my-40 diviLine"></div>
    <div class="px-32">
      <h2 class="font-400 font-30 c2cColor">{{ $t("交易方式") }}</h2>
      <div class="flex items-center mt-28">
        <div class="w-6 h-28 border-ra" style="background: #e7bb41"></div>
        <span class="ml-8 text-grey">{{ orderDetail.methodName }}</span>
      </div>
    </div>
    <div class="w-full h-56 mt-32 mb-40 diviLine"></div>
    <div class="flex px-40 pb-80 footer-box">
      <van-button
        class="w-244 h-80 font-30 mr-16 text-black border-none"
        type="primary"
        style="background: #eaebee"
        @click="cancelOrder"
        >{{ $t("取消订单") }}</van-button
      >
      <van-button
        class="flex-1 h-80 font-30 btnMain border-none"
        type="info"
        @click="goToPayment"
        >{{ $t("去付款") }}</van-button
      >
    </div>
  </div>
</template>
 
<script>
import { mapState } from "vuex";
 
import { CountDown, Icon, Cell, CellGroup, Button, Notify } from "vant";
import OrderNav from "@/components/order-nav/OrderNav";
import OrderData from "@/page/c2cOrder/components/order-data/OrderData";
import otcApi from "@/API/otc";
 
export default {
  name: "orderGeneration",
  data() {
    return {
      time: 0, //15 * 60 * 60 * 1000,
      orderDetail: {},
      interval: null,
      // orderNumber: ''
    };
  },
  async created() {
    const order_no = this.$store.state.c2c.order_no;
    const res = await otcApi.ctcOrderGetDetail({
      order_no,
      language: this.$i18n.locale,
    });
    this.orderDetail = res.data;
    this.time = this.orderDetail.autoCancelTimeRemain * 1000;
    this.interval = setInterval(() => {
      this.time = this.time - 1000;
      if (this.time <= 0) {
        clearInterval(this.interval);
      }
    }, 1000);
  },
  methods: {
    // 取消订单
    cancelOrder() {
      if (this.time >= 0) {
        this.$router.push({ path: "/cancelOrder" });
      } else {
        Notify({ type: "warning", message: this.$t("订单不能取消") });
      }
    },
    // 付款
    goToPayment() {
      this.$router.push({ path: "/paymentBuy" });
    },
    gotoChat() {
      this.$router.push({ path: "/chat" });
    },
    tokefu() {
      this.$router.push("/customerService");
    },
  },
  computed: {
    ...mapState("c2cBuy", ["count", "totalPrice", "orderNumber"]),
  },
  components: {
    [CountDown.name]: CountDown,
    [Icon.name]: Icon,
    [Cell.name]: Cell,
    [CellGroup.name]: CellGroup,
    [Button.name]: Button,
    OrderNav,
    OrderData,
  },
};
</script>
 
<style lang="scss" scoped>
@import "@/assets/init.scss";
 
.border-ra {
  border-radius: 20px;
}
 
#order-generation {
  ::v-deep .van-count-down {
    font-size: 28px;
    color: $blue;
  }
 
  ::v-deep .van-cell-group,
  .van-cell {
    @include themify() {
      color: themed("text_color1");
    }
 
    @include themify() {
      background: themed("main_background");
    }
  }
 
  ::v-deep .van-cell__value {
    @include themify() {
      color: themed("text_color");
    }
  }
 
  .footer-box {
    @include themify() {
      background: themed("main_background");
    }
  }
}
</style>