1.调整收货地址表数据结构以及接口

2.增加粉丝表数据结构以及接口
master
panqihua 2 years ago
parent 203d98ead2
commit 9e8c608aa8
  1. 9
      src/api/platform/follower.js
  2. 11
      src/views/platform/address.vue
  3. 152
      src/views/platform/follower.vue
  4. 13
      src/views/system/user/index.vue

@ -0,0 +1,9 @@
import request from "@/utils/request";
// 查询收货地址列表
export function listFollower(user_id) {
return request({
url: `/platform/follower/list/${user_id}`,
method: "get",
});
}

@ -31,6 +31,9 @@ import { listAddress, getAddress, delAddress, addAddress, updateAddress } from "
export default { export default {
name: "Address", name: "Address",
props: {
userId: Number
},
data() { data() {
return { return {
// //
@ -101,6 +104,7 @@ export default {
/** 查询收货地址列表 */ /** 查询收货地址列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.userId = this.userId
listAddress(this.queryParams).then(response => { listAddress(this.queryParams).then(response => {
this.addressList = response.rows; this.addressList = response.rows;
this.total = response.total; this.total = response.total;
@ -195,6 +199,13 @@ export default {
...this.queryParams ...this.queryParams
}, `address_${new Date().getTime()}.xlsx`) }, `address_${new Date().getTime()}.xlsx`)
} }
},
watch: {
userId(newValue) {
if (newValue) {
this.getList();
}
}
} }
}; };
</script> </script>

@ -0,0 +1,152 @@
<template>
<div class="app-container">
<el-table v-loading="loading" :data="followers">
<el-table-column label="绑定时间" align="center" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="昵称" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.followingUser.nickName }}</span>
</template>
</el-table-column>
<el-table-column label="ID" align="center">
<template slot-scope="scope">
<span>{{ scope.row.followingUser.userId }}</span>
</template>
</el-table-column>
<el-table-column label="手机号" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.followingUser.phonenumber }}</span>
</template>
</el-table-column>
<el-table-column label="微信昵称" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.followingUser.wechatNickName }}</span>
</template>
</el-table-column>
<el-table-column label="头像" align="center">
<template slot-scope="scope">
<el-avatar :size="50" :src="getAvatar(scope.row.followingUser)" />
</template>
</el-table-column>
<el-table-column label="性别" align="center">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.followingUser.sex" />
</template>
</el-table-column>
<el-table-column label="推荐人" align="center">
<template slot-scope="scope">
{{ scope.row.isDefault ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="登陆时间" align="center" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.followingUser.loginDate) }}</span>
</template>
</el-table-column>
<el-table-column label="注册时间" align="center" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.followingUser.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.followingUser.status" />
</template>
</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 { listFollower } from "@/api/platform/follower";
import { getAvatar } from "@/utils";
export default {
name: "Follower",
props: {
userId: Number
},
dicts: ['sys_normal_disable', 'sys_user_sex'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
followers: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {},
};
},
mounted() {
this.getList();
},
methods: {
getAvatar,
/** 查询粉丝列表 */
getList() {
this.loading = true;
listFollower(this.userId).then(response => {
this.followers = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
}
},
watch: {
userId(newValue) {
if (newValue) {
this.getList();
}
}
}
};
</script>

@ -78,7 +78,7 @@
</el-table-column> </el-table-column>
<el-table-column label="推荐人" align="center"> <el-table-column label="推荐人" align="center">
<template slot-scope="scope" v-if="scope.row.referrerSysUser"> <template slot-scope="scope" v-if="scope.row.referrerSysUser">
<span>{{ scope.row.referrerSysUser.phonenumber }}</span> <span>{{ scope.row.referrerSysUser.nickName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="登陆时间" align="center"> <el-table-column label="登陆时间" align="center">
@ -131,12 +131,14 @@
<el-tab-pane label="钱包明细" name="balance">钱包明细</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="pay_detail">购买明细</el-tab-pane>
<el-tab-pane v-hasPermi="['platform:address:list']" label="收货地址" name="address"> <el-tab-pane v-hasPermi="['platform:address:list']" label="收货地址" name="address">
<platform-address /> <platform-address :user-id="form.userId" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="浏览记录" name="browser_history">浏览记录</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="star_history">收藏记录</el-tab-pane>
<el-tab-pane label="购物车" name="cart">购物车</el-tab-pane> <el-tab-pane label="购物车" name="cart">购物车</el-tab-pane>
<el-tab-pane label="粉丝" name="fans">粉丝</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">优惠券</el-tab-pane>
</el-tabs> </el-tabs>
</el-dialog> </el-dialog>
@ -168,13 +170,14 @@
<script> <script>
import { listUser, getUser, delUser, resetUserPwd, changeUserStatus, updateStatus } from "@/api/system/user"; import { listUser, getUser, delUser, resetUserPwd, changeUserStatus, updateStatus } from "@/api/system/user";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { getAvatar } from "../../../utils"; import { getAvatar } from "@/utils";
import baseForm from "./profile/baseForm" import baseForm from "./profile/baseForm"
import platformAddress from "@/views/platform/address" import platformAddress from "@/views/platform/address"
import platformFollower from "@/views/platform/follower"
export default { export default {
name: "User", name: "User",
dicts: ['sys_normal_disable', 'sys_user_sex'], dicts: ['sys_normal_disable', 'sys_user_sex'],
components: { baseForm, platformAddress }, components: { baseForm, platformAddress, platformFollower },
data() { data() {
return { return {
// //

Loading…
Cancel
Save