用户详情增加钱包明细、购买明细、浏览记录、收藏记录、购物车、优惠券

master
panqihua 2 years ago
parent 9e8c608aa8
commit c7e6ae119b
  1. 10
      src/api/platform/cart.js
  2. 92
      src/views/platform/buyDetail.vue
  3. 64
      src/views/platform/cart.vue
  4. 98
      src/views/platform/discount.vue
  5. 33
      src/views/platform/result/card.vue
  6. 65
      src/views/platform/result/collect.vue
  7. 72
      src/views/platform/result/history.vue
  8. 132
      src/views/platform/walletDetail.vue
  9. 38
      src/views/system/user/index.vue

@ -0,0 +1,10 @@
import request from "@/utils/request";
// 查询购物车列表
export function listCart(query) {
return request({
url: "/platform/cart/list",
method: "get",
params: query,
});
}

@ -0,0 +1,92 @@
<template>
<div class="app-container">
<el-form class="query-form" :inline="true">
<el-form-item label="配送方式">
<el-select v-model="queryParams.delivery_method" placeholder="全部类型" clearable>
<el-option v-for="dict in dict.type.delivery_method" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini">查询</el-button>
<el-button icon="el-icon-refresh" size="mini">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="followers">
<el-table-column label="新创建时间" align="center">
</el-table-column>
<el-table-column label="订单号" align="center">
</el-table-column>
<el-table-column label="类型" align="center">
</el-table-column>
<el-table-column label="订单金额" align="center">
</el-table-column>
<el-table-column label="支付方式" align="center">
</el-table-column>
<el-table-column label="订单状态" align="center">
</el-table-column>
<el-table-column label="收货地址" align="center">
</el-table-column>
<el-table-column label="收货人" align="center">
</el-table-column>
<el-table-column label="手机号" align="center">
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
</template>
<script>
export default {
name: "BuyDetail",
dicts: ['delivery_method'],
data() {
return {
loading: false,
buyDetailList: [],
total: 0,
//
queryParams: {
pageNum: 1,
pageSize: 10,
delivery_method: undefined,
dateRange: undefined
},
}
},
mounted() {
this.getList();
},
methods: {
getList() {
}
},
watch: {
userId(newValue) {
if (newValue) {
this.getList();
}
}
}
}
</script>
<style scoped>
.query-form {
margin-bottom: 20px;
}
</style>

@ -0,0 +1,64 @@
<template>
<div class="app-container">
<el-table v-loading="loading" :data="cartList">
<el-table-column label="添加时间" align="center">
</el-table-column>
<el-table-column label="商品名称" align="center">
</el-table-column>
<el-table-column label="图片" align="center">
</el-table-column>
<el-table-column label="规格" align="center">
</el-table-column>
<el-table-column label="数量" align="center">
</el-table-column>
<el-table-column label="店铺" align="center">
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
</template>
<script>
import { listCart } from "@/api/platform/cart";
export default {
name: "Cart",
props: {
userId: Number
},
data() {
return {
//
loading: false,
//
cartList: [],
//
total: 0,
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
}
},
methods: {
getList() {
// this.loading = true;
listCart(this.userId).then(response => {
this.cartList = response.rows;
this.total = response.total;
this.loading = false;
});
}
},
watch: {
userId(newValue) {
if (newValue) {
this.getList();
}
}
}
}
</script>

@ -0,0 +1,98 @@
<template>
<div class="app-container">
<el-form class="query-form" :inline="true">
<el-form-item label="领取时间">
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini">查询</el-button>
<el-button icon="el-icon-refresh" size="mini">重置</el-button>
</el-form-item>
</el-form>
<div class="count">
<el-row>
<el-col :span="3">平台优惠券156.00</el-col>
<el-col :span="3">已使用45.00</el-col>
<el-col :span="3">已过期456.00</el-col>
<el-col :span="3">未使用 456.00</el-col>
</el-row>
<el-row>
<el-col :span="3">店铺优惠券156.00</el-col>
<el-col :span="3">已使用45.00</el-col>
<el-col :span="3">已过期456.00</el-col>
<el-col :span="3">未使用 456.00</el-col>
</el-row>
</div>
<el-table v-loading="loading" :data="followers">
<el-table-column label="领取时间" align="center">
</el-table-column>
<el-table-column label="名称" align="center">
</el-table-column>
<el-table-column label="优惠" align="center">
</el-table-column>
<el-table-column label="发券人" align="center">
</el-table-column>
<el-table-column label="状态" align="center">
</el-table-column>
<el-table-column label="使用时间" align="center">
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
</template>
<script>
export default {
name: "Discount",
data() {
return {
loading: false,
discountList: [],
total: 0,
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
}
},
mounted() {
this.getList();
},
methods: {
getList() {
}
},
watch: {
userId(newValue) {
if (newValue) {
this.getList();
}
}
}
}
</script>
<style scoped>
.query-form {
margin-bottom: 20px;
}
.count {
font-weight: bold;
}
.count>div {
margin-bottom: 20px;
}
</style>

@ -0,0 +1,33 @@
<template>
<el-card :body-style="{ padding: '0px' }">
<img :src="item.imgUrl" class="image" />
<div style="padding: 14px">
<span>{{ item.name }}</span>
<el-row type="flex" class="row-bg" justify="space-between">
<el-col class="price">{{ item.price }}</el-col>
<el-col style="text-align:right">已售{{ item.sale }}</el-col>
</el-row>
<div><del>{{ item.originPrice }}</del></div>
</div>
</el-card>
</template>
<script>
export default {
name: "Card",
props: {
item: Object
},
data() {
return {
}
}
}
</script>
<style scoped>
.price {
color: red;
font-weight: bold;
font-size: 18px;
}
</style>

@ -0,0 +1,65 @@
<template>
<div class="app-container scroll">
<div class="total">{{ total }}条记录</div>
<el-row :gutter="20">
<el-col :span="4" v-for="(item, index) in collectList" class="shop-card" :key="index">
<Card :item="item" />
</el-col>
</el-row>
</div>
</template>
<script>
import Card from "./card.vue"
export default {
name: "Collect",
components: { Card },
props: {
userId: Number
},
data() {
return {
//
total: 256,
collectList: [],
//
loading: true,
}
},
mounted() {
this.getList()
},
methods: {
getList() {
this.collectList = Array.from(new Array(20).keys()).map(item => {
return {
imgUrl: 'http://dummyimage.com/200x200',
name: '劳斯莱斯英伦男士手表',
price: 1999,
sale: 120,
originPrice: 2500
}
})
}
},
watch: {
userId(newValue) {
if (newValue) {
this.getList();
}
}
}
}
</script>
<style scoped>
.total,
.shop-card {
margin-bottom: 20px;
}
.scroll {
height: 700px;
overflow-y: auto;
}
</style>

@ -0,0 +1,72 @@
<template>
<div class="app-container scroll">
<div class="total">{{ total }}条记录</div>
<h2>2022-12-31</h2>
<el-row :gutter="20">
<el-col :span="4" v-for="(item, index) in collectList" class="shop-card" :key="index">
<Card :item="item" />
</el-col>
</el-row>
<h2>2022-12-31</h2>
<el-row :gutter="20">
<el-col :span="4" v-for="(item, index) in collectList" class="shop-card" :key="index">
<Card :item="item" />
</el-col>
</el-row>
</div>
</template>
<script>
import Card from "./card.vue"
export default {
name: "History",
components: { Card },
props: {
userId: Number
},
data() {
return {
//
total: 256,
collectList: [],
//
loading: true,
}
},
mounted() {
this.getList()
},
methods: {
getList() {
this.collectList = Array.from(new Array(10).keys()).map(item => {
return {
imgUrl: 'http://dummyimage.com/200x200',
name: '劳斯莱斯英伦男士手表',
price: 1999,
sale: 120,
originPrice: 2500
}
})
}
},
watch: {
userId(newValue) {
if (newValue) {
this.getList();
}
}
}
}
</script>
<style scoped>
.total,
.shop-card {
margin-bottom: 20px;
}
.scroll {
height: 700px;
overflow-y: auto;
}
</style>

@ -0,0 +1,132 @@
<template>
<div class="app-container">
<el-row class="balance">
<el-col span="4">
<div>123.00</div>
<div>钱包余额</div>
</el-col>
<el-col span="4">
<div>123.00</div>
<div>提现总金额</div>
</el-col>
<el-col span="4">
<div>123.00</div>
<div>充值金额</div>
</el-col>
<el-col span="4">
<div>123.00</div>
<div>邀请金额</div>
</el-col>
<el-col span="4">
<div>123.00</div>
<div>支出金额</div>
</el-col>
</el-row>
<el-form class="query-form" :inline="true">
<el-form-item label="类型">
<el-select v-model="queryParams.wallet_type" placeholder="全部类型" clearable>
<el-option v-for="dict in dict.type.wallet_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini">查询</el-button>
<el-button icon="el-icon-refresh" size="mini">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="followers">
<el-table-column label="新创建时间" align="center">
</el-table-column>
<el-table-column label="订单号" align="center">
</el-table-column>
<el-table-column label="收支类型" align="center">
</el-table-column>
<el-table-column label="金额" align="center">
</el-table-column>
<el-table-column label="类型" align="center">
</el-table-column>
<el-table-column label="钱包余额" align="center">
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
</template>
<script>
export default {
name: "WalletDetail",
dicts: ['wallet_type'],
data() {
return {
loading: false,
walletDetailList: [],
total: 0,
//
queryParams: {
pageNum: 1,
pageSize: 10,
wallet_type: undefined,
dateRange: undefined
},
}
},
mounted() {
this.getList();
},
methods: {
getList() {
}
},
watch: {
userId(newValue) {
if (newValue) {
this.getList();
}
}
}
}
</script>
<style scoped>
.query-form {
margin-top: var(--space);
margin-bottom: calc(var(--space) * 2);
}
.balance>div {
background-color: rgba(22, 132, 252, 0.2);
height: 80px;
color: rgba(16, 16, 16, 1);
font-size: 16px;
text-align: left;
font-family: SourceHanSansSC-medium;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.balance>div>div:first-child {
margin-bottom: 5px;
}
.balance>div:not(:first-child) {
margin-left: 20px;
}
</style>

@ -128,18 +128,30 @@
<el-tab-pane label="基本信息" name="base">
<base-form :reset="reset" :form="form" show-detail />
</el-tab-pane>
<el-tab-pane label="钱包明细" name="balance">钱包明细</el-tab-pane>
<el-tab-pane label="购买明细" name="pay_detail">购买明细</el-tab-pane>
<el-tab-pane label="钱包明细" name="balance">
<platform-wallet-detail :user-id="form.userId" />
</el-tab-pane>
<el-tab-pane label="购买明细" name="pay_detail">
<platform-buy-detail :user-id="form.userId" />
</el-tab-pane>
<el-tab-pane v-hasPermi="['platform:address:list']" label="收货地址" name="address">
<platform-address :user-id="form.userId" />
</el-tab-pane>
<el-tab-pane label="浏览记录" name="browser_history">浏览记录</el-tab-pane>
<el-tab-pane label="收藏记录" name="star_history">收藏记录</el-tab-pane>
<el-tab-pane label="购物车" name="cart">购物车</el-tab-pane>
<el-tab-pane label="浏览记录" name="browser_history">
<platform-history :user-id="form.userId" />
</el-tab-pane>
<el-tab-pane label="收藏记录" name="star_history">
<platform-collect :user-id="form.userId" />
</el-tab-pane>
<el-tab-pane label="购物车" name="cart">
<platform-cart :user-id="form.userId" />
</el-tab-pane>
<el-tab-pane label="粉丝" name="fans">
<platform-follower :user-id="form.userId" />
</el-tab-pane>
<el-tab-pane label="优惠券" name="discount_coupon">优惠券</el-tab-pane>
<el-tab-pane label="优惠券" name="discount_coupon">
<platform-discount :user-id="form.userId" />
</el-tab-pane>
</el-tabs>
</el-dialog>
@ -174,10 +186,16 @@ import { getAvatar } from "@/utils";
import baseForm from "./profile/baseForm"
import platformAddress from "@/views/platform/address"
import platformFollower from "@/views/platform/follower"
import platformCart from "@/views/platform/cart"
import platformCollect from "@/views/platform/result/collect"
import platformHistory from "@/views/platform/result/history"
import platformDiscount from "@/views/platform/discount"
import platformBuyDetail from "@/views/platform/buyDetail"
import platformWalletDetail from "@/views/platform/walletDetail"
export default {
name: "User",
dicts: ['sys_normal_disable', 'sys_user_sex'],
components: { baseForm, platformAddress, platformFollower },
components: { baseForm, platformAddress, platformFollower, platformCart, platformCollect, platformDiscount, platformHistory, platformBuyDetail, platformWalletDetail },
data() {
return {
//
@ -451,7 +469,11 @@ export default {
}
};
</script>
<style>
<style >
:root {
--space: 20px;
}
.custom-divider.el-divider {
margin-top: 0 !important;
margin-bottom: 20px !important;

Loading…
Cancel
Save