|
|
@@ -7,7 +7,7 @@
|
|
|
:src="require('@assets/icon-back@3x.png')"
|
|
|
alt=""
|
|
|
class="product_top_one_img"
|
|
|
- @click="$router.back()"
|
|
|
+ @click="goBack"
|
|
|
/>
|
|
|
收到报价
|
|
|
</div>
|
|
|
@@ -24,123 +24,204 @@
|
|
|
<div class="product_left_time">剩余时长 {{ info.endTime }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="product_detailed_information_con_right_price">最高价:¥1000</div>
|
|
|
+ <div class="product_detailed_information_con_right_price">最高价:¥{{ highestBid }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="number_of_quotations">共10条报价</div>
|
|
|
- <!-- <van-pull-refresh v-if="quotedPriceList.length == 0" success-text="加载成功" success-duration="500" class="search"
|
|
|
- v-model="isLoading" :head-height="80" @refresh="onRefresh"> -->
|
|
|
- <!-- <van-list style="padding-bottom: 100px" class="box-list" v-model:loading="loading" :finished="finished"
|
|
|
- finished-text=""> -->
|
|
|
- <div class="box-list">
|
|
|
- <div class="box-list_con" v-for="(item, index) in quotedPriceList" :key="index">
|
|
|
- <div class="box-list_con_left">
|
|
|
- <van-image
|
|
|
- width="40"
|
|
|
- height="40"
|
|
|
- class="user-img"
|
|
|
- :src="item.minterAvatar"
|
|
|
- fit="cover"
|
|
|
- radius="100"
|
|
|
- />
|
|
|
- <div>
|
|
|
- <div class="box-list_con_left_name">{{ item.name }}</div>
|
|
|
- <div class="box-list_con_left_time">{{ item.time }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="box-list_con_right">
|
|
|
- <div class="box-list_con_right_fu">
|
|
|
- <div class="box-list_con_right_con">
|
|
|
- <img
|
|
|
- :src="require('@assets/icon_jiage@3x (2).png')"
|
|
|
- alt=""
|
|
|
- class="box-list_con_right_img"
|
|
|
+ <div class="number_of_quotations">共{{ quotedPriceList.length }}条报价</div>
|
|
|
+ <van-pull-refresh
|
|
|
+ success-text="加载成功"
|
|
|
+ success-duration="500"
|
|
|
+ class="search"
|
|
|
+ v-model="isLoading"
|
|
|
+ :head-height="80"
|
|
|
+ @refresh="onRefresh"
|
|
|
+ >
|
|
|
+ <van-list
|
|
|
+ style="padding-bottom: 100px"
|
|
|
+ class="box-list"
|
|
|
+ v-model:loading="loading"
|
|
|
+ :finished="finished"
|
|
|
+ finished-text=""
|
|
|
+ @load="getList"
|
|
|
+ >
|
|
|
+ <div class="box-list">
|
|
|
+ <div class="box-list_con" v-for="(item, index) in quotedPriceList" :key="index">
|
|
|
+ <div class="box-list_con_left">
|
|
|
+ <van-image
|
|
|
+ width="40"
|
|
|
+ height="40"
|
|
|
+ class="user-img"
|
|
|
+ :src="item.avatar"
|
|
|
+ fit="cover"
|
|
|
+ radius="100"
|
|
|
/>
|
|
|
- <div class="box-list_con_right_con_price">{{ item.price }}</div>
|
|
|
+ <div>
|
|
|
+ <div class="box-list_con_left_name">{{ item.nickname }}</div>
|
|
|
+ <div class="box-list_con_left_time">{{ item.createdAt }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="box-list_con_right">
|
|
|
+ <div class="box-list_con_right_fu">
|
|
|
+ <div class="box-list_con_right_con">
|
|
|
+ <img
|
|
|
+ :src="require('@assets/icon_jiage@3x (2).png')"
|
|
|
+ alt=""
|
|
|
+ class="box-list_con_right_img"
|
|
|
+ />
|
|
|
+ <div class="box-list_con_right_con_price">{{ item.price }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="box-list_con_right_con_btn" v-if="item.status != 'ASKING'">对方已取消</div>
|
|
|
+ <div v-else class="box-list_con_right_con_btns" @click="acceptOffer(index)">接受</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="item.cancel" class="box-list_con_right_con_btn">对方已取消</div>
|
|
|
- <div v-else class="box-list_con_right_con_btns">接受</div>
|
|
|
+ </div>
|
|
|
+ <van-empty
|
|
|
+ :image="require('@assets/empty_img_asset_dark.png')"
|
|
|
+ v-if="empty"
|
|
|
+ description="没有任何报价哦~"
|
|
|
+ />
|
|
|
+ </van-list>
|
|
|
+ </van-pull-refresh>
|
|
|
+ <van-popup v-model:show="show">
|
|
|
+ <div class="accept_offer_title">接受报价</div>
|
|
|
+ <div class="accept_offer_title_tip">
|
|
|
+ <div class="accept_offer_title_tip_con">
|
|
|
+ <img :src="require('@assets/png-xiao-zi@3x.png')" alt="" class="accept_offer_title_tip_con_img" />
|
|
|
+ <div class="accept_offer_title_tip_con_text">{{ info.name }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <!-- <van-empty :image="require('@assets/empty_img_asset_dark.png')" v-if="empty" description="没有任何报价哦~" />
|
|
|
- </van-list> -->
|
|
|
- <!-- </van-pull-refresh> -->
|
|
|
+ <div class="accept_offer_list">
|
|
|
+ <div class="accept_offer_list_title">出售价格</div>
|
|
|
+ <div class="accept_offer_list_price">¥{{ price }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="accept_offer_list">
|
|
|
+ <div class="accept_offer_list_title">版税({{ royalties }}%)</div>
|
|
|
+ <div class="accept_offer_list_price">¥{{ royaltiesAmount }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="accept_offer_list">
|
|
|
+ <div class="accept_offer_list_title">技术服务费({{ serviceCharge }}%)</div>
|
|
|
+ <div class="accept_offer_list_price">¥{{ serviceChargeAmount }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="accept_offer_list">
|
|
|
+ <div class="accept_offer_list_title">支付通道费({{ payChannel }}%)</div>
|
|
|
+ <div class="accept_offer_list_price">¥{{ payChannelAmount }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="final_income">
|
|
|
+ <div class="final_income_title">最终收入</div>
|
|
|
+ <div class="final_income_price">¥{{ finalIncome }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="accept_offer_btn">
|
|
|
+ <div class="accept_offer_btn_left" @click="show = false">取消</div>
|
|
|
+ <div class="accept_offer_btn_right" @click="affirmBtn">确认</div>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import asset from '../../mixins/asset';
|
|
|
import product from '../../mixins/product';
|
|
|
+let fromRoute = null;
|
|
|
export default {
|
|
|
mixins: [asset, product],
|
|
|
data() {
|
|
|
return {
|
|
|
+ fromRoute: null,
|
|
|
assetId: 0,
|
|
|
+ domainOrderId: 0,
|
|
|
+ highestBid: 0,
|
|
|
info: {},
|
|
|
- quotedPriceList: [
|
|
|
- {
|
|
|
- name: '用户昵称',
|
|
|
- time: '02-20 22:08',
|
|
|
- minterAvatar: require('@assets/svgs/img_default_photo.svg'),
|
|
|
- price: 1000,
|
|
|
- cancel: false
|
|
|
- },
|
|
|
- {
|
|
|
- name: '用户昵称',
|
|
|
- time: '02-20 22:08',
|
|
|
- minterAvatar: require('@assets/svgs/img_default_photo.svg'),
|
|
|
- price: 1000,
|
|
|
- cancel: false
|
|
|
- },
|
|
|
- {
|
|
|
- name: '用户昵称',
|
|
|
- time: '02-20 22:08',
|
|
|
- minterAvatar: require('@assets/svgs/img_default_photo.svg'),
|
|
|
- price: 1000,
|
|
|
- cancel: true
|
|
|
- },
|
|
|
- {
|
|
|
- name: '用户昵称',
|
|
|
- time: '02-20 22:08',
|
|
|
- minterAvatar: require('@assets/svgs/img_default_photo.svg'),
|
|
|
- price: 1000,
|
|
|
- cancel: false
|
|
|
- }
|
|
|
- ],
|
|
|
+ id: 0,
|
|
|
+ show: false,
|
|
|
+ quotedPriceList: [],
|
|
|
loading: false,
|
|
|
finished: false,
|
|
|
- page: 0
|
|
|
+ page: 0,
|
|
|
+ price: 0,
|
|
|
+ royalties: 5,
|
|
|
+ serviceCharge: 5,
|
|
|
+ payChannel: 1,
|
|
|
+ royaltiesAmount: 0,
|
|
|
+ serviceChargeAmount: 0,
|
|
|
+ payChannelAmount: 0,
|
|
|
+ finalIncome: 0
|
|
|
};
|
|
|
},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ // timeOne() {
|
|
|
+ // return this.quotedPriceList.forEach(item => {
|
|
|
+ // this.dayjs(item.createdAt).format('MM-DD');
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // timeTwo() {
|
|
|
+ // return this.dayjs(this.info.createdAt).format('HH:mm');
|
|
|
+ // }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
if (this.$route.query.id) {
|
|
|
this.assetId = this.$route.query.id;
|
|
|
+ this.domainOrderId = this.$route.query.domainOrderId;
|
|
|
this.getDomain();
|
|
|
}
|
|
|
+ this.emitter.on('updateFrom', from => {
|
|
|
+ fromRoute = from;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ beforeRouteEnter(to, from) {
|
|
|
+ fromRoute = from;
|
|
|
},
|
|
|
methods: {
|
|
|
+ acceptOffer(index) {
|
|
|
+ this.id = this.quotedPriceList[index].id;
|
|
|
+ this.royalties = this.quotedPriceList[index].royalties;
|
|
|
+ if (this.quotedPriceList[index].serviceCharge >= 1) {
|
|
|
+ this.serviceCharge = this.quotedPriceList[index].serviceCharge - 1;
|
|
|
+ this.payChannel = 1;
|
|
|
+ } else {
|
|
|
+ this.serviceCharge = this.quotedPriceList[index].serviceCharge;
|
|
|
+ this.payChannel = 0;
|
|
|
+ }
|
|
|
+ this.show = true;
|
|
|
+ this.price = Number(this.quotedPriceList[index].price);
|
|
|
+ this.royaltiesAmount = Number((Math.floor(this.price * (this.royalties || 0)) / 100).toFixed(2));
|
|
|
+ this.serviceChargeAmount = Number((Math.floor(this.price * (this.serviceCharge || 0)) / 100).toFixed(2));
|
|
|
+ this.payChannelAmount = Number((Math.floor(this.price * (this.payChannel || 0)) / 100).toFixed(2));
|
|
|
+ this.finalIncome = this.price - (this.royaltiesAmount + this.serviceChargeAmount + this.payChannelAmount);
|
|
|
+ this.finalIncome = this.finalIncome.toFixed(2);
|
|
|
+ },
|
|
|
pad(n, width, z) {
|
|
|
z = z || '0';
|
|
|
n = n + '';
|
|
|
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
|
|
},
|
|
|
getDomain() {
|
|
|
+ this.$toast.loading({
|
|
|
+ message: '加载中...',
|
|
|
+ forbidClick: true
|
|
|
+ });
|
|
|
+ this.$http
|
|
|
+ .post('/domainAsk/maxPrice', {
|
|
|
+ domainOrderId: this.domainOrderId
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.highestBid = res;
|
|
|
+ })
|
|
|
+ .catch(e => {});
|
|
|
return this.$http.get('/asset/get/' + this.assetId).then(res => {
|
|
|
- if (res.endTime) {
|
|
|
- res.endTime = this.dayjs(res.endTime).diff(this.dayjs(), 'second');
|
|
|
- res.endTime =
|
|
|
- Math.floor(res.endTime / 24 / 3600) +
|
|
|
- '天' +
|
|
|
- this.pad(parseInt(res.endTime / 3600) % 24, 2) +
|
|
|
- '时' +
|
|
|
- this.pad(parseInt(res.endTime / 60) % 60, 2) +
|
|
|
- '分';
|
|
|
- }
|
|
|
+ res.endTime = this.dayjs(res.endTime).diff(this.dayjs(), 'second');
|
|
|
+ res.endTime =
|
|
|
+ Math.floor(res.endTime / 24 / 3600) +
|
|
|
+ '天' +
|
|
|
+ this.pad(parseInt(res.endTime / 3600) % 24, 2) +
|
|
|
+ '时' +
|
|
|
+ this.pad(parseInt(res.endTime / 60) % 60, 2) +
|
|
|
+ '分';
|
|
|
this.info = res;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$toast.clear();
|
|
|
+ }, 100);
|
|
|
});
|
|
|
},
|
|
|
getList(isFirst = false) {
|
|
|
@@ -152,10 +233,14 @@ export default {
|
|
|
this.finished = false;
|
|
|
this.empty = false;
|
|
|
let query = {
|
|
|
- type: 'DOMAIN'
|
|
|
+ type: 'DOMAIN',
|
|
|
+ status: 'ASKING,FINISH,REFUNDED',
|
|
|
+ companyId: 1,
|
|
|
+ assetId: this.assetId,
|
|
|
+ ownerId: this.$store.state.userInfo.id
|
|
|
};
|
|
|
- let sort = 'likes,desc';
|
|
|
- let url = 'collection/all';
|
|
|
+ let sort = 'price,desc';
|
|
|
+ let url = 'domainAsk/all';
|
|
|
return this.$http
|
|
|
.post(
|
|
|
url,
|
|
|
@@ -163,8 +248,7 @@ export default {
|
|
|
page: this.page,
|
|
|
size: 20,
|
|
|
query: query,
|
|
|
- sort: sort,
|
|
|
- search: this.search
|
|
|
+ sort: sort
|
|
|
},
|
|
|
{ body: 'json' }
|
|
|
)
|
|
|
@@ -182,6 +266,29 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ affirmBtn() {
|
|
|
+ this.$http
|
|
|
+ .post('/domainAsk/accept', {
|
|
|
+ id: this.id
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.show = false;
|
|
|
+ this.$toast.success('接受成功');
|
|
|
+ this.$router.back();
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$toast(e.error || '接受报价失败');
|
|
|
+ this.show = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ goBack() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/store',
|
|
|
+ query: {
|
|
|
+ goBack: true
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
onRefresh() {
|
|
|
this.getList(true).then(() => {
|
|
|
this.isLoading = false;
|
|
|
@@ -196,6 +303,120 @@ export default {
|
|
|
background: #0f0f0f;
|
|
|
}
|
|
|
|
|
|
+/deep/ .van-popup {
|
|
|
+ width: calc(80vw);
|
|
|
+ background: #161414;
|
|
|
+ border-radius: 8px;
|
|
|
+ border: 1px solid #302b30;
|
|
|
+ backdrop-filter: blur(11px);
|
|
|
+ padding: 24px 20px 30px;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .accept_offer_title {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 24px;
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .accept_offer_title_tip {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ margin-bottom: 24px;
|
|
|
+
|
|
|
+ .accept_offer_title_tip_con {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .accept_offer_title_tip_con_img {
|
|
|
+ width: 10px;
|
|
|
+ height: 18px;
|
|
|
+ margin-right: 6px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .accept_offer_title_tip_con_text {
|
|
|
+ width: calc(62vw);
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 24px;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .accept_offer_list {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ border-bottom: 1px #242424 solid;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+
|
|
|
+ .accept_offer_list_title {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #939599;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .accept_offer_list_price {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .final_income {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 30px;
|
|
|
+
|
|
|
+ .final_income_title {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .final_income_price {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #00fe1e;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .accept_offer_btn {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 38px;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ .accept_offer_btn_left {
|
|
|
+ width: calc(32vw);
|
|
|
+ height: 38px;
|
|
|
+ background: #2d2b2b;
|
|
|
+ border-radius: 8px;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .accept_offer_btn_right {
|
|
|
+ width: calc(32vw);
|
|
|
+ height: 38px;
|
|
|
+ background: #00fe1e;
|
|
|
+ border-radius: 8px;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.product_top_one {
|
|
|
height: 50px;
|
|
|
font-size: 16px;
|
|
|
@@ -362,6 +583,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.box-list_con_right_con_btns {
|
|
|
+ float: right;
|
|
|
margin-top: 8px;
|
|
|
width: 38px;
|
|
|
height: 22px;
|