|
|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
|
<div class="submit">
|
|
|
- <div class="address" v-if="!info.airDrop">
|
|
|
+ <van-notice-bar text="一口价支付" background="#FF7F1F" color="#fff" />
|
|
|
+ <div class="address" v-if="!isNFT">
|
|
|
<div class="van-address-item van-contact-card" @click="onAdd">
|
|
|
<div class="van-cell van-cell--borderless">
|
|
|
<div class="van-cell__value van-cell__value--alone van-address-item__value">
|
|
|
@@ -17,22 +18,40 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="assets">
|
|
|
- <div class="assets-title">
|
|
|
- <div class="text1">{{ info.name }}</div>
|
|
|
- <div class="text2" v-if="info.airDrop">商品的铸造将会销毁对应藏品,请谨慎选择</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="assets-product" v-for="item in list" :key="item.id">
|
|
|
- <van-image width="60" height="60" radius="6" :src="getImg(changeImgs(item.pic))" fit="cover" />
|
|
|
+ <div class="assets-product">
|
|
|
+ <van-image width="80" height="80" radius="6" :src="getImg(changeImgs(info.pic))" fit="cover" />
|
|
|
<div class="assets-info">
|
|
|
- <div class="text1">{{ item.name }}</div>
|
|
|
+ <div class="text1">{{ info.name }}</div>
|
|
|
<div class="flex1"></div>
|
|
|
- <div class="text2" v-if="item.category">类型:{{ item.category }}</div>
|
|
|
- <div class="text2" v-if="item.number">编号:{{ item.number }}</div>
|
|
|
+
|
|
|
+ <div class="text2">
|
|
|
+ <div class="time">
|
|
|
+ <img src="../../assets/info_icon_time.png" alt="" />
|
|
|
+ <span>距结束:<van-count-down :time="time" format="HH 小时 mm 分 ss 秒" /></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="text2" v-if="info.category">类型:{{ info.category }}</div>
|
|
|
+ <div class="text2" v-if="info.number">编号:{{ info.number }}</div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <div class="text-list">
|
|
|
+ <div class="text-info">
|
|
|
+ <span class="text1">一口价</span>
|
|
|
+ <span class="text2">¥{{ info.fixedPrice }}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="text-info">
|
|
|
+ <span class="text1">GAS费用</span>
|
|
|
+ <span class="text2">¥{{ gas }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="text-info">
|
|
|
+ <span class="text1">实际支付</span>
|
|
|
+ <span class="text2 prim">¥{{ money }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="pay" v-if="!$store.state.review">
|
|
|
<div class="pay-item" @click="payType = item.type" v-for="(item, index) in payInfos" :key="index">
|
|
|
<img class="icon" :src="item.icon" alt="" />
|
|
|
@@ -43,8 +62,8 @@
|
|
|
|
|
|
<div class="bottom van-safe-area-bottom" ref="bottom">
|
|
|
<div class="bottom-content">
|
|
|
- <span class="text">GAS费</span>
|
|
|
- <span class="price"> <img src="@assets/jiage_huang.png" alt="" />{{ gas }} </span>
|
|
|
+ <span class="text">实际支付</span>
|
|
|
+ <span class="price"> <img src="@assets/jiage_huang.png" alt="" />{{ money }} </span>
|
|
|
<div class="btn">
|
|
|
<van-button
|
|
|
round
|
|
|
@@ -64,15 +83,16 @@
|
|
|
|
|
|
<script>
|
|
|
import asset from '../../mixins/asset';
|
|
|
-import product from '../../mixins/product';
|
|
|
+import imgInfo from '../../mixins/imgInfo';
|
|
|
import resolveUrl from 'resolve-url';
|
|
|
let inWeixin = /micromessenger/i.test(navigator.userAgent);
|
|
|
let inApp = /#cordova#/i.test(navigator.userAgent);
|
|
|
let inIos = /iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
|
+import auctionOrder from '../../mixins/auctionOrder';
|
|
|
export default {
|
|
|
name: 'activitySubmit',
|
|
|
inject: ['setKeeps'],
|
|
|
- mixins: [asset, product],
|
|
|
+ mixins: [asset, imgInfo, auctionOrder],
|
|
|
data() {
|
|
|
return {
|
|
|
addressInfo: {},
|
|
|
@@ -103,14 +123,30 @@ export default {
|
|
|
enable_wx_lite: false,
|
|
|
enable_wx_pub: false,
|
|
|
assets: '',
|
|
|
- activityId: 0,
|
|
|
+ auctionId: 0,
|
|
|
orderId: 0,
|
|
|
hrefUrl: '',
|
|
|
timer: null,
|
|
|
- info: {}
|
|
|
+ info: {},
|
|
|
+ time: '',
|
|
|
+ payMentType: 'FIXED_PRICE'
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ money() {
|
|
|
+ let money = 0;
|
|
|
+ if (this.info.fixedPrice) {
|
|
|
+ money = this.accAdd(this.info.fixedPrice, money);
|
|
|
+ }
|
|
|
+ if (this.gas) {
|
|
|
+ money = this.accAdd(money, this.gas);
|
|
|
+ }
|
|
|
+
|
|
|
+ return money;
|
|
|
+ },
|
|
|
+ isNFT() {
|
|
|
+ return this.info.auctionType === 'NFT';
|
|
|
+ },
|
|
|
showAddress() {
|
|
|
if (this.addressInfo.id) {
|
|
|
return {
|
|
|
@@ -130,14 +166,18 @@ export default {
|
|
|
// console.log(id);
|
|
|
this.addressInfo = info;
|
|
|
});
|
|
|
-
|
|
|
- if (this.$route.query.assets) {
|
|
|
- this.assets = this.$route.query.assets;
|
|
|
- this.activityId = this.$route.query.activityId;
|
|
|
- this.getProduct(this.$route.query.assets.split(','));
|
|
|
- this.$http.get('/mintActivity/get/' + this.activityId).then(res => {
|
|
|
+ this.$http.get('/sysConfig/get/gas_fee').then(res => {
|
|
|
+ this.gas = res.value;
|
|
|
+ if (window.cordova && window.cordova.platformId === 'ios' && this.$store.state.review) {
|
|
|
+ this.gas = 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (this.$route.query.auctionId) {
|
|
|
+ this.auctionId = this.$route.query.auctionId;
|
|
|
+ this.$http.get('/auctionActivity/get/' + this.auctionId).then(res => {
|
|
|
this.info = res;
|
|
|
- this.gas = res.gasPrice;
|
|
|
+ this.time = this.getTime(res.endTime);
|
|
|
+ // this.gas = res.gasPrice;
|
|
|
this.$http
|
|
|
.post(
|
|
|
'/userAddress/all',
|
|
|
@@ -198,6 +238,11 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ getTime(endTime) {
|
|
|
+ console.log(new Date(endTime).getTime());
|
|
|
+ let time = new Date(endTime).getTime() - new Date().getTime();
|
|
|
+ return time;
|
|
|
+ },
|
|
|
onAdd() {
|
|
|
this.$router.push('/mineAddress?page=submit&chooseId=' + this.addressInfo.id);
|
|
|
},
|
|
|
@@ -230,17 +275,8 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getProduct(list = [], index = 0) {
|
|
|
- if (index >= list.length) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$http.get('/asset/get/' + list[index]).then(res => {
|
|
|
- this.list.push(res);
|
|
|
- this.getProduct(list, index + 1);
|
|
|
- });
|
|
|
- },
|
|
|
createOrder() {
|
|
|
- if (!this.addressInfo.id && !this.info.airDrop) {
|
|
|
+ if (!this.addressInfo.id && !this.isNFT) {
|
|
|
this.$toast('请选择收货地址');
|
|
|
return;
|
|
|
}
|
|
|
@@ -250,13 +286,18 @@ export default {
|
|
|
}
|
|
|
this.$toast.loading('请不要离开当前页面');
|
|
|
|
|
|
+ let form = {
|
|
|
+ userId: this.$store.state.userInfo.id,
|
|
|
+ auctionId: this.auctionId,
|
|
|
+ type: this.payMentType
|
|
|
+ };
|
|
|
+
|
|
|
+ if (!this.isNFT) {
|
|
|
+ form.addressId = this.addressInfo.id;
|
|
|
+ }
|
|
|
+
|
|
|
return this.$http
|
|
|
- .post('/mintOrder/create', {
|
|
|
- assets: this.assets,
|
|
|
- mintActivityId: this.activityId,
|
|
|
- addressId: this.addressInfo.id,
|
|
|
- invitor: sessionStorage.getItem('invitor')
|
|
|
- })
|
|
|
+ .post('/auctionOrder/createFixPrice', form)
|
|
|
.then(res => {
|
|
|
return Promise.resolve(res);
|
|
|
})
|
|
|
@@ -371,7 +412,7 @@ export default {
|
|
|
} else if (this.payType === 'H5PAY') {
|
|
|
document.location.href = resolveUrl(
|
|
|
this.$baseUrl,
|
|
|
- '/payOrder/v2/mint/sandQuick?id=' + this.orderId
|
|
|
+ '/payOrder/v2/payAuctionOrder?id=' + this.orderId
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
@@ -459,9 +500,10 @@ export default {
|
|
|
flex-grow: 1;
|
|
|
margin-left: 12px;
|
|
|
.text1 {
|
|
|
- font-size: 12px;
|
|
|
+ font-size: 14px;
|
|
|
color: #000000;
|
|
|
line-height: 24px;
|
|
|
+ font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.text2 {
|
|
|
@@ -480,7 +522,7 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
height: 48px;
|
|
|
- border-bottom: 1px solid @tabBorder;
|
|
|
+ border-top: 1px solid @tabBorder;
|
|
|
.icon {
|
|
|
height: 24px;
|
|
|
display: block;
|
|
|
@@ -558,4 +600,58 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.text-list {
|
|
|
+ padding: 0 16px;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+.text-info {
|
|
|
+ .flex();
|
|
|
+ height: 48px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #000000;
|
|
|
+ line-height: 24px;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .text2 {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .prim {
|
|
|
+ color: @prim;
|
|
|
+ }
|
|
|
+
|
|
|
+ border-top: 1px solid #f5f7fa;
|
|
|
+}
|
|
|
+
|
|
|
+.van-notice-bar {
|
|
|
+ height: 28px;
|
|
|
+ /deep/.van-notice-bar__wrap {
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.time {
|
|
|
+ .flex();
|
|
|
+ height: 22px;
|
|
|
+ background: #fff7f2;
|
|
|
+ border-radius: 4px;
|
|
|
+ display: inline-flex;
|
|
|
+ padding: 0 4px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ img {
|
|
|
+ width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ margin-left: 2px;
|
|
|
+ .flex();
|
|
|
+ font-size: 12px;
|
|
|
+ color: #ff7f1f;
|
|
|
+ line-height: 22px;
|
|
|
+ .van-count-down {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #ff7f1f;
|
|
|
+ line-height: 22px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|