|
|
@@ -3,70 +3,113 @@
|
|
|
<van-sticky>
|
|
|
<div class="padding-safe-top">
|
|
|
<div class="shopping_cart_top_one">
|
|
|
- <img :src="require('@assets/icon-back@3x.png')" alt="" class="shopping_cart_top_one_img"
|
|
|
- @click="$router.back()">
|
|
|
+ <img
|
|
|
+ :src="require('@assets/icon-back@3x.png')"
|
|
|
+ alt=""
|
|
|
+ class="shopping_cart_top_one_img"
|
|
|
+ @click="$router.back()"
|
|
|
+ />
|
|
|
购物车
|
|
|
<div class="shopping_cart_top_one_btn" v-if="!showDelete" @click="showDelete = true">管理</div>
|
|
|
<div class="shopping_cart_top_one_btns" v-else @click="accomplish">完成</div>
|
|
|
</div>
|
|
|
<div class="shopping_cart_top_two">
|
|
|
- <div class="shopping_cart_top_two_con" :class="{ active: active === 'ALL' }"
|
|
|
- @click="changeActive('ALL')">
|
|
|
+ <div
|
|
|
+ class="shopping_cart_top_two_con"
|
|
|
+ :class="{ active: active === 'ALL' }"
|
|
|
+ @click="changeActive('ALL')"
|
|
|
+ >
|
|
|
全部(10)
|
|
|
<div class="shopping_cart_top_two_con_one" v-if="active == 'ALL'"></div>
|
|
|
</div>
|
|
|
- <div class="shopping_cart_top_two_con" :class="{ active: active === 'SELLOUT' }"
|
|
|
- @click="changeActive('SELLOUT')">
|
|
|
+ <div
|
|
|
+ class="shopping_cart_top_two_con"
|
|
|
+ :class="{ active: active === 'SELLOUT' }"
|
|
|
+ @click="changeActive('SELLOUT')"
|
|
|
+ >
|
|
|
售罄(2)
|
|
|
<div class="shopping_cart_top_two_con_two" v-if="active == 'SELLOUT'"></div>
|
|
|
</div>
|
|
|
<div class="shopping_cart_top_two_con" @click="cartExplain">
|
|
|
- <img :src="require('@assets/icon-shuoming@3x.png')" alt="" class="shopping_cart_top_two_con_img">
|
|
|
+ <img
|
|
|
+ :src="require('@assets/icon-shuoming@3x.png')"
|
|
|
+ alt=""
|
|
|
+ class="shopping_cart_top_two_con_img"
|
|
|
+ />
|
|
|
<div>说明</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-sticky>
|
|
|
- <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">
|
|
|
+ <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_con" v-for="(item, index) in collectionList" :key="index" @click="settle(index)">
|
|
|
- <img :src="item.check ? select : unchecked" alt="" class="box-list_con_check">
|
|
|
+ <img :src="item.check ? select : unchecked" alt="" class="box-list_con_check" />
|
|
|
<van-image width="80" height="80" :src="item.img" fit="contain" radius="8" />
|
|
|
<div v-if="item.type == 'DOMAIN'" class="box-list_con_right">
|
|
|
<div class="box-list_con_right_top">
|
|
|
- <img :src="require('@assets/png-da-zi@3x.png')" alt="" class="box-list_con_right_top_img">
|
|
|
+ <img :src="require('@assets/png-da-zi@3x.png')" alt="" class="box-list_con_right_top_img" />
|
|
|
<div class="box-list_con_right_top_title">
|
|
|
- <div class="box-list_con_right_top_title_name"
|
|
|
- :class="active == 'SELLOUT' ? 'box-list_con_right_top_title_names' : ''">{{ item.name }}
|
|
|
+ <div
|
|
|
+ class="box-list_con_right_top_title_name"
|
|
|
+ :class="active == 'SELLOUT' ? 'box-list_con_right_top_title_names' : ''"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
</div>
|
|
|
<div class="box-list_con_right_top_title_time">剩余时长 {{ item.endTime }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="box-list_con_right_bottom" v-if="active == 'ALL'">
|
|
|
- <img :src="require('@assets/icon_jiage@3x (4).png')" alt=""
|
|
|
- class="box-list_con_right_bottom_price_img">
|
|
|
+ <img
|
|
|
+ :src="require('@assets/icon_jiage@3x (4).png')"
|
|
|
+ alt=""
|
|
|
+ class="box-list_con_right_bottom_price_img"
|
|
|
+ />
|
|
|
<div class="box-list_con_right_bottom_price">{{ item.price }}</div>
|
|
|
</div>
|
|
|
<div class="box-list_con_right_bottom_noBuy" v-else>藏品已售罄不能购买</div>
|
|
|
</div>
|
|
|
<div v-else class="box-list_con_right_two">
|
|
|
- <div class="box-list_con_right_two_name"
|
|
|
- :class="active == 'SELLOUT' ? 'box-list_con_right_two_names' : ''">{{ item.name }}</div>
|
|
|
+ <div
|
|
|
+ class="box-list_con_right_two_name"
|
|
|
+ :class="active == 'SELLOUT' ? 'box-list_con_right_two_names' : ''"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </div>
|
|
|
<div class="box-list_con_right_two_information">
|
|
|
<van-image width="14" height="14" :src="item.myImg" fit="cover" radius="100" />
|
|
|
<div class="box-list_con_right_two_information_name">{{ item.myName }}</div>
|
|
|
</div>
|
|
|
<div class="box-list_con_right_bottom" v-if="active == 'ALL'">
|
|
|
- <img :src="require('@assets/icon_jiage@3x (4).png')" alt=""
|
|
|
- class="box-list_con_right_bottom_price_img">
|
|
|
+ <img
|
|
|
+ :src="require('@assets/icon_jiage@3x (4).png')"
|
|
|
+ alt=""
|
|
|
+ class="box-list_con_right_bottom_price_img"
|
|
|
+ />
|
|
|
<div class="box-list_con_right_bottom_price">{{ item.price }}</div>
|
|
|
</div>
|
|
|
<div class="box-list_con_right_bottom_noBuy" v-else>藏品已售罄不能购买</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <van-empty :image="require('@assets/empty_img_asset_dark.png')" v-if="empty" description="没有任何藏品哦~" />
|
|
|
+ <van-empty
|
|
|
+ :image="require('@assets/empty_img_asset_dark.png')"
|
|
|
+ v-if="empty"
|
|
|
+ description="没有任何藏品哦~"
|
|
|
+ />
|
|
|
</van-list>
|
|
|
</van-pull-refresh>
|
|
|
<!-- <div class="box-list">
|
|
|
@@ -74,13 +117,17 @@
|
|
|
</div> -->
|
|
|
<div class="shopping_cart_btn van-safe-area-bottom" v-if="active == 'ALL' && showDelete == false">
|
|
|
<div class="shopping_cart_btn_left" @click="checkAll">
|
|
|
- <img :src="checkAllStatus ? select : unchecked" alt="" class="shopping_cart_btn_left_img">
|
|
|
+ <img :src="checkAllStatus ? select : unchecked" alt="" class="shopping_cart_btn_left_img" />
|
|
|
<div>全选</div>
|
|
|
</div>
|
|
|
<div class="shopping_cart_btn_right">
|
|
|
<div class="shopping_cart_btn_right_one">合计</div>
|
|
|
<div class="shopping_cart_btn_right_two">
|
|
|
- <img :src="require('@assets/icon_jiage@3x (3).png')" alt="" class="shopping_cart_btn_right_two_img">
|
|
|
+ <img
|
|
|
+ :src="require('@assets/icon_jiage@3x (3).png')"
|
|
|
+ alt=""
|
|
|
+ class="shopping_cart_btn_right_two_img"
|
|
|
+ />
|
|
|
<div>{{ price }}</div>
|
|
|
</div>
|
|
|
<div class="shopping_cart_btn_right_three" @click="settleAccounts">
|
|
|
@@ -90,7 +137,7 @@
|
|
|
</div>
|
|
|
<div class="shopping_cart_btn van-safe-area-bottom" v-else-if="showDelete == true">
|
|
|
<div class="shopping_cart_btn_left" @click="checkAll">
|
|
|
- <img :src="checkAllStatus ? select : unchecked" alt="" class="shopping_cart_btn_left_img">
|
|
|
+ <img :src="checkAllStatus ? select : unchecked" alt="" class="shopping_cart_btn_left_img" />
|
|
|
<div>全选</div>
|
|
|
</div>
|
|
|
<div class="shopping_cart_btn_right">
|
|
|
@@ -136,67 +183,66 @@ export default {
|
|
|
totalSettlement: 0,
|
|
|
page: 0,
|
|
|
showDelete: false
|
|
|
- }
|
|
|
+ };
|
|
|
},
|
|
|
mounted() {
|
|
|
// this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
changeActive(title) {
|
|
|
- this.active = title
|
|
|
- this.showDelete = false
|
|
|
- this.checkAllStatus = false
|
|
|
- this.price = 0
|
|
|
- this.totalSettlement = 0
|
|
|
- this.getList(true)
|
|
|
+ this.active = title;
|
|
|
+ this.showDelete = false;
|
|
|
+ this.checkAllStatus = false;
|
|
|
+ this.price = 0;
|
|
|
+ this.totalSettlement = 0;
|
|
|
+ this.getList(true);
|
|
|
},
|
|
|
accomplish() {
|
|
|
- this.showDelete = false
|
|
|
+ this.showDelete = false;
|
|
|
if (this.active == 'SELLOUT') {
|
|
|
- this.checkAllStatus = false
|
|
|
- this.totalSettlement = 0
|
|
|
- this.getList(true)
|
|
|
+ this.checkAllStatus = false;
|
|
|
+ this.totalSettlement = 0;
|
|
|
+ this.getList(true);
|
|
|
}
|
|
|
},
|
|
|
- cartExplain() {
|
|
|
- },
|
|
|
+ cartExplain() {},
|
|
|
checkAll() {
|
|
|
- this.checkAllStatus = !this.checkAllStatus
|
|
|
+ this.checkAllStatus = !this.checkAllStatus;
|
|
|
if (this.checkAllStatus) {
|
|
|
- this.price = 0
|
|
|
- this.totalSettlement = this.collectionList.length
|
|
|
+ this.price = 0;
|
|
|
+ this.totalSettlement = this.collectionList.length;
|
|
|
this.collectionList.forEach(item => {
|
|
|
- item.check = true
|
|
|
- this.price += Number(item.price)
|
|
|
- })
|
|
|
- this.price = this.price.toFixed(1)
|
|
|
+ item.check = true;
|
|
|
+ this.price += Number(item.price);
|
|
|
+ });
|
|
|
+ this.price = this.price.toFixed(1);
|
|
|
} else {
|
|
|
- this.price = 0
|
|
|
- this.totalSettlement = 0
|
|
|
+ this.price = 0;
|
|
|
+ this.totalSettlement = 0;
|
|
|
this.collectionList.forEach(item => {
|
|
|
- item.check = false
|
|
|
- })
|
|
|
+ item.check = false;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
settle(index) {
|
|
|
if (this.active == 'SELLOUT' && !this.showDelete) {
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
- this.collectionList[index].check = !this.collectionList[index].check
|
|
|
- let newCollectionList = this.collectionList.filter(item => item.check == true)
|
|
|
+ this.collectionList[index].check = !this.collectionList[index].check;
|
|
|
+ let newCollectionList = this.collectionList.filter(item => item.check == true);
|
|
|
if (this.collectionList.length == newCollectionList.length) {
|
|
|
- this.checkAllStatus = true
|
|
|
+ this.checkAllStatus = true;
|
|
|
} else {
|
|
|
- this.checkAllStatus = false
|
|
|
+ this.checkAllStatus = false;
|
|
|
}
|
|
|
this.$nextTick(() => {
|
|
|
- this.totalSettlement = newCollectionList.length
|
|
|
- this.price = 0
|
|
|
- console.log("dcghcfgfc", newCollectionList)
|
|
|
+ this.totalSettlement = newCollectionList.length;
|
|
|
+ this.price = 0;
|
|
|
+ console.log('dcghcfgfc', newCollectionList);
|
|
|
newCollectionList.forEach(item => {
|
|
|
- this.price += Number(item.price)
|
|
|
- })
|
|
|
- this.price = this.price.toFixed(1)
|
|
|
+ this.price += Number(item.price);
|
|
|
+ });
|
|
|
+ this.price = this.price.toFixed(1);
|
|
|
// for (let i = 0; i <= newCollectionList.length; i++) {
|
|
|
// this.price += Number(newCollectionList[i].price)
|
|
|
// }
|
|
|
@@ -204,9 +250,9 @@ export default {
|
|
|
},
|
|
|
settleAccounts() {
|
|
|
if (this.totalSettlement == 0) {
|
|
|
- return
|
|
|
+ return;
|
|
|
} else {
|
|
|
- this.$router.push('/shoppingCartSubmit')
|
|
|
+ this.$router.push('/shoppingCartSubmit');
|
|
|
// Dialog.confirm({
|
|
|
// title: '有藏品已售罄,无法购买!',
|
|
|
// confirmButtonText: '一键删除',
|
|
|
@@ -220,7 +266,7 @@ export default {
|
|
|
},
|
|
|
del() {
|
|
|
if (this.totalSettlement == 0) {
|
|
|
- return
|
|
|
+ return;
|
|
|
} else {
|
|
|
Dialog.confirm({
|
|
|
title: '确认将这' + this.totalSettlement + '个藏品删除?',
|
|
|
@@ -228,9 +274,9 @@ export default {
|
|
|
cancelButtonText: '再想想',
|
|
|
confirmButtonColor: '#FF4F50',
|
|
|
cancelButtonColor: '#626366'
|
|
|
- }).then(() => {
|
|
|
-
|
|
|
- }).catch(() => { })
|
|
|
+ })
|
|
|
+ .then(() => {})
|
|
|
+ .catch(() => {});
|
|
|
}
|
|
|
},
|
|
|
pad(n, width, z) {
|
|
|
@@ -269,17 +315,17 @@ export default {
|
|
|
this.page = 0;
|
|
|
}
|
|
|
if (this.checkAllStatus) {
|
|
|
- let newPrice = Number(this.price)
|
|
|
+ let newPrice = Number(this.price);
|
|
|
res.content.forEach(item => {
|
|
|
- item.check = true
|
|
|
- newPrice += Number(item.price)
|
|
|
- })
|
|
|
- this.totalSettlement = this.totalSettlement + res.content.length
|
|
|
- this.price = newPrice.toFixed(1)
|
|
|
+ item.check = true;
|
|
|
+ newPrice += Number(item.price);
|
|
|
+ });
|
|
|
+ this.totalSettlement = this.totalSettlement + res.content.length;
|
|
|
+ this.price = newPrice.toFixed(1);
|
|
|
} else {
|
|
|
res.content.forEach(item => {
|
|
|
- item.check = false
|
|
|
- })
|
|
|
+ item.check = false;
|
|
|
+ });
|
|
|
}
|
|
|
this.collectionList = [...this.collectionList, ...res.content];
|
|
|
this.empty = res.empty;
|
|
|
@@ -293,13 +339,13 @@ export default {
|
|
|
onRefresh() {
|
|
|
this.getList(true).then(() => {
|
|
|
this.isLoading = false;
|
|
|
- this.price = 0
|
|
|
- this.totalSettlement = 0
|
|
|
- this.checkAllStatus = false
|
|
|
+ this.price = 0;
|
|
|
+ this.totalSettlement = 0;
|
|
|
+ this.checkAllStatus = false;
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
/deep/ .van-dialog__header {
|
|
|
@@ -314,7 +360,7 @@ export default {
|
|
|
position: relative;
|
|
|
font-size: 16px;
|
|
|
font-weight: bold;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
line-height: 50px;
|
|
|
text-align: center;
|
|
|
background: #161414;
|
|
|
@@ -330,7 +376,7 @@ export default {
|
|
|
.shopping_cart_top_one_btn {
|
|
|
font-size: 14px;
|
|
|
font-weight: 400;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
line-height: 24px;
|
|
|
position: absolute;
|
|
|
top: 13px;
|
|
|
@@ -340,7 +386,7 @@ export default {
|
|
|
.shopping_cart_top_one_btns {
|
|
|
font-size: 14px;
|
|
|
font-weight: 400;
|
|
|
- color: #00FE1E;
|
|
|
+ color: #00fe1e;
|
|
|
line-height: 24px;
|
|
|
position: absolute;
|
|
|
top: 13px;
|
|
|
@@ -368,7 +414,7 @@ export default {
|
|
|
.shopping_cart_top_two_con_one {
|
|
|
width: 28px;
|
|
|
height: 2px;
|
|
|
- background: #00FE1E;
|
|
|
+ background: #00fe1e;
|
|
|
border-radius: 2px;
|
|
|
position: absolute;
|
|
|
left: 12px;
|
|
|
@@ -378,7 +424,7 @@ export default {
|
|
|
.shopping_cart_top_two_con_two {
|
|
|
width: 28px;
|
|
|
height: 2px;
|
|
|
- background: #00FE1E;
|
|
|
+ background: #00fe1e;
|
|
|
border-radius: 2px;
|
|
|
position: absolute;
|
|
|
left: 9px;
|
|
|
@@ -393,7 +439,7 @@ export default {
|
|
|
|
|
|
.active {
|
|
|
font-weight: 500;
|
|
|
- color: #00FE1E;
|
|
|
+ color: #00fe1e;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -445,7 +491,7 @@ export default {
|
|
|
width: calc(47vw);
|
|
|
font-size: 14px;
|
|
|
font-weight: bold;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
line-height: 24px;
|
|
|
margin-bottom: 2px;
|
|
|
overflow: hidden;
|
|
|
@@ -460,7 +506,7 @@ export default {
|
|
|
.box-list_con_right_top_title_time {
|
|
|
max-width: 114px;
|
|
|
height: 17px;
|
|
|
- background: #1E1E1E;
|
|
|
+ background: #1e1e1e;
|
|
|
border-radius: 2px;
|
|
|
text-align: center;
|
|
|
font-size: 10px;
|
|
|
@@ -478,7 +524,7 @@ export default {
|
|
|
width: calc(52vw);
|
|
|
font-size: 14px;
|
|
|
font-weight: bold;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
line-height: 24px;
|
|
|
margin-bottom: 4px;
|
|
|
overflow: hidden;
|
|
|
@@ -519,7 +565,7 @@ export default {
|
|
|
font-size: 20px;
|
|
|
font-family: OSP-DIN, OSP;
|
|
|
font-weight: normal;
|
|
|
- color: #00FE1E;
|
|
|
+ color: #00fe1e;
|
|
|
line-height: 14px;
|
|
|
}
|
|
|
}
|
|
|
@@ -566,7 +612,7 @@ export default {
|
|
|
.shopping_cart_btn_right_one {
|
|
|
font-size: 14px;
|
|
|
font-weight: bold;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
|
|
|
@@ -574,7 +620,7 @@ export default {
|
|
|
font-size: 32px;
|
|
|
font-family: OSP-DIN, OSP;
|
|
|
font-weight: normal;
|
|
|
- color: #00FE1E;
|
|
|
+ color: #00fe1e;
|
|
|
display: flex;
|
|
|
margin-right: 11px;
|
|
|
|
|
|
@@ -588,11 +634,11 @@ export default {
|
|
|
.shopping_cart_btn_right_three {
|
|
|
width: 120px;
|
|
|
height: 38px;
|
|
|
- background: #00FE1E;
|
|
|
+ background: #00fe1e;
|
|
|
border-radius: 22px;
|
|
|
font-size: 16px;
|
|
|
font-weight: bold;
|
|
|
- color: #0B0B0B;
|
|
|
+ color: #0b0b0b;
|
|
|
line-height: 38px;
|
|
|
text-align: center;
|
|
|
|
|
|
@@ -604,4 +650,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|