添加pc端代码注释

This commit is contained in:
mabo
2021-07-30 18:17:01 +08:00
parent 93ba1c134f
commit ff92fd8d76
19 changed files with 85 additions and 349 deletions

View File

@@ -1,43 +1,15 @@
<template>
<div class="wrapper">
<div class="orderBox">
<!-- <ul class="orderUl">
<li>
<div class="circle">
<Icon size="50" type="ios-card" />
</div>
<div class="info">
<Badge :count="0"> 代付款 </Badge>
</div>
</li>
<li>
<div class="circle">
<Icon size="50" type="ios-card" />
</div>
<div class="info">
<Badge :count="0"> 待收货 </Badge>
</div>
</li>
<li>
<div class="circle">
<Icon size="50" type="ios-card" />
</div>
<div class="info">
<Badge :count="0"> 待评价 </Badge>
</div>
</li>
</ul> -->
<div class="userBox">
<div class="box">
<!-- 我的订单组件 -->
<myOrderPage :homePage="true" />
</div>
<div class="box">
<!-- 近期收藏 -->
<myFavorites :homePage="true" />
</div>
<div class="box">
</div>
<div>
<div class="userBox">
<div class="box">
<!-- 我的订单组件 -->
<myOrderPage :homePage="true" />
</div>
<div class="box">
<!-- 近期收藏 -->
<myFavorites :homePage="true" />
</div>
<div class="box">
</div>
</div>
</div>
@@ -57,42 +29,6 @@ export default {
</script>
<style scoped lang="scss">
.circle {
width: 70px;
height: 70px;
border-radius: 50%;
overflow: hidden;
background: $success_color;
margin: 0 auto;
text-align: center;
color: #fff;
> i {
line-height: 70px;
}
}
.info {
text-align: center;
font-size: 18px;
margin: 10px 0;
}
.orderUl {
overflow: hidden;
> li {
cursor: pointer;
border-radius: 0.4em;
float: left;
padding: 10px 0;
margin: 0 11px;
width: 200px;
text-align: center;
@include background_color($light_background_color);
}
}
.userBox {
padding: 0 0 20px 0;
}

View File

@@ -1,90 +0,0 @@
<template>
<div>
<Table border ref="selection" :columns="columns" :data="shoppingCart" size="large" no-data-text="您的购物车没有商品请先添加商品到购物车再点击购买">
<template slot-scope="{row}" slot="price">
<span>{{row.price | unitPrice('¥')}}</span>
</template>
</Table>
<div class="go-to">
<Button @click="goTo" type="primary">去付款</Button>
</div>
</div>
</template>
<script>
import store from '@/vuex/store';
import { mapState, mapActions } from 'vuex';
export default {
name: 'MyShoppingCart',
data () {
return {
columns: [ // 表格表头
{
type: 'selection',
width: 58,
align: 'center'
},
{
title: '图片',
key: 'img',
width: 86,
render: (h, params) => {
return h('div', [
h('img', {
attrs: {
src: params.row.img
}
})
]);
},
align: 'center'
},
{
title: '标题',
key: 'title',
align: 'center'
},
{
title: '套餐',
width: 198,
key: 'package',
align: 'center'
},
{
title: '数量',
key: 'count',
width: 68,
align: 'center'
},
{
title: '价格',
width: 68,
slot: 'price',
align: 'center'
}
]
};
},
created () {
this.loadShoppingCart();
},
computed: {
...mapState(['shoppingCart'])
},
methods: {
...mapActions(['loadShoppingCart']),
goTo () {
this.$router.push('/cart');
}
},
store
};
</script>
<style scoped>
.go-to {
margin: 15px;
display: flex;
justify-content: flex-end;
}
</style>

View File

@@ -95,7 +95,7 @@ export default {
this.getList()
},
changePageSize (val) { // 修改页数
this.pageNumber = 1;
this.params.pageNumber = 1;
this.params.pageSize = val;
this.getList()
},

View File

@@ -100,7 +100,7 @@ export default {
this.getList()
},
changePageSize (val) { // 改变页数
this.pageNumber = 1;
this.params.pageNumber = 1;
this.params.pageSize = val;
this.getList()
},

View File

@@ -20,10 +20,10 @@
</li>
</ul>
<Page :total="total" @on-change="changePageNum"
v-if="list.length && total > params.pageNumber"
class="pageration"
@on-page-size-change="changePageSize"
:page-size="params.pageSize"
show-total
show-sizer>
</Page>
<Spin v-if="loading" fix></Spin>
@@ -41,7 +41,7 @@ export default {
'已使用',
'已过期'
],
statusList: ['NEW', 'USED', 'EXPIRE'],
statusList: ['NEW', 'USED', 'EXPIRE'], // 优惠券状态
loading: false, // 列表加载状态
params: { // 请求参数
pageNumber: 1,
@@ -86,7 +86,7 @@ export default {
},
changePageSize (val) { // 分页改变页数
this.pageNumber = 1;
this.params.pageNumber = 1;
this.params.pageSize = val;
this.getList()
},

View File

@@ -72,15 +72,16 @@
<!-- 分页 -->
<div class="page-size">
<Page
:current="searchForm.pageNumber"
:current="walletForm.pageNumber"
:total="logColumnsData.total"
:page-size="searchForm.pageSize"
:page-size="walletForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
transfer
></Page>
</div>
</TabPane>
@@ -93,15 +94,16 @@
<!-- 分页 -->
<div class="page-size">
<Page
:current="rechargeSearchForm.pageNumber"
:current="rechargeForm.pageNumber"
:total="rechargeListData.total"
:page-size="rechargeSearchForm.pageSize"
:page-size="rechargeForm.pageSize"
@on-change="rechargeChangePage"
@on-page-size-change="rechargeChangePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
transfer
></Page>
</div>
</TabPane>
@@ -114,15 +116,16 @@
<!-- 分页 -->
<div class="page-size">
<Page
:current="withdrawApplySearchForm.pageNumber"
:current="withdrawApplyForm.pageNumber"
:total="withdrawApplyColumnsListData.total"
:page-size="withdrawApplySearchForm.pageSize"
:page-size="withdrawApplyForm.pageSize"
@on-change="withdrawChangePage"
@on-page-size-change="withdrawChangePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
transfer
></Page>
</div>
</TabPane>
@@ -131,7 +134,6 @@
</template>
<script>
import card from '@/components/card';
import {
getMembersWallet,
getDepositLog,
@@ -158,19 +160,19 @@ export default {
price: 1
},
// 余额日志
searchForm: {
walletForm: {
// 搜索框初始化对象
pageNumber: 1,
pageSize: 10
},
// 充值记录
rechargeSearchForm: {
rechargeForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10 // 页面大小
},
// 提现记录
withdrawApplySearchForm: {
withdrawApplyForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10 // 页面大小
@@ -358,17 +360,17 @@ export default {
withdrawApplyColumnsListData: {} // 提现记录
};
},
components: { card },
mounted () {
this.init();
},
methods: {
// 初始化数据
init () {
getMembersWallet().then((res) => {
this.frozenDeposit = res.result.memberFrozenWallet;
this.memberDeposit = res.result.memberWallet;
});
getDepositLog(this.searchForm).then((res) => {
getDepositLog(this.walletForm).then((res) => {
if (res.message === 'success') {
this.logColumnsData = res.result;
}
@@ -390,7 +392,7 @@ export default {
},
// 充值记录
getRechargeData () {
getRecharge(this.rechargeSearchForm).then((res) => {
getRecharge(this.rechargeForm).then((res) => {
if (res.message === 'success') {
this.rechargeListData = res.result;
}
@@ -398,7 +400,7 @@ export default {
},
// 提现记录
getWithdrawApplyData () {
getWithdrawApply(this.withdrawApplySearchForm).then((res) => {
getWithdrawApply(this.withdrawApplyForm).then((res) => {
if (res.message === 'success') {
this.withdrawApplyColumnsListData = res.result;
}
@@ -406,29 +408,32 @@ export default {
},
// 余额日志
changePage (v) {
this.searchForm.pageNumber = v;
this.walletForm.pageNumber = v;
this.init();
},
changePageSize (v) {
this.searchForm.pageSize = v;
this.walletForm.pageNumber = 1;
this.walletForm.pageSize = v;
this.init();
},
// 充值记录
rechargeChangePage (v) {
this.rechargeSearchForm.pageNumber = v;
this.rechargeForm.pageNumber = v;
this.getRechargeData();
},
rechargeChangePageSize (v) {
this.rechargeSearchForm.pageSize = v;
this.rechargeForm.pageNumber = 1;
this.rechargeForm.pageSize = v;
this.getRechargeData();
},
// 提现记录
withdrawChangePage (v) {
this.withdrawApplySearchForm.pageNumber = v;
this.withdrawApplyForm.pageNumber = v;
this.getWithdrawApplyData();
},
withdrawChangePageSize (v) {
this.withdrawApplySearchForm.pageSize = v;
this.withdrawApplyForm.pageNumber = 1;
this.withdrawApplyForm.pageSize = v;
this.getWithdrawApplyData();
},
// 弹出在线充值框
@@ -456,6 +461,7 @@ export default {
this.withdrawApplyFormData.price = 1;
this.withdrawApplyModal = true;
},
// 提现
withdrawal () {
this.$refs['withdrawApplyFormData'].validate((valid) => {
if (valid) {
@@ -496,7 +502,5 @@ export default {
.ivu-btn {
margin: 0 4px;
}
.fontsize_48 {
font-size: 48px;
}
</style>

View File

@@ -91,7 +91,7 @@ export default {
this.getList()
},
changePageSize (val) { // 修改页数
this.pageNumber = 1;
this.params.pageNumber = 1;
this.params.pageSize = val;
this.getList()
},