浏览代码

feat(api): 旧系统 member list

gemercheung 3 年之前
父节点
当前提交
ff62f77515
共有 3 个文件被更改,包括 73 次插入31 次删除
  1. 2 2
      src/api/member/list.ts
  2. 49 9
      src/views/dashboard/member/list.vue
  3. 22 20
      src/views/dashboard/order/list.vue

+ 2 - 2
src/api/member/list.ts

@@ -2,7 +2,7 @@ import { defHttp } from '/@/utils/http/axios';
 import { PageParams, MemberListGetResultModel } from './model';
 import { PageParams, MemberListGetResultModel } from './model';
 
 
 enum Api {
 enum Api {
-  pageList = '/basic-api/member/list',
+  pageList = '/basic-api/user/list',
 }
 }
 
 
 /**
 /**
@@ -10,7 +10,7 @@ enum Api {
  */
  */
 
 
 export const ListApi = (params: PageParams) =>
 export const ListApi = (params: PageParams) =>
-  defHttp.get<MemberListGetResultModel>({
+  defHttp.post<MemberListGetResultModel>({
     url: Api.pageList,
     url: Api.pageList,
     params,
     params,
     headers: {
     headers: {

+ 49 - 9
src/views/dashboard/member/list.vue

@@ -1,15 +1,46 @@
+<!-- 
+avatar: "https://thirdwx.qlogo.cn/mmopen/vi_32/dTbT3X0Fm7BnUA4DoQhBy14smppF5eBibqPSOib3ou5elGuJ1eYZ9sib2ZALDMs1icYupWIxiaJwWETTV8we9brCHhQ/132"
+bindBrandId: null
+bindBrandName: null
+birthday: 631123200000
+brandId: null
+brandName: null
+city: ""
+gender: 1
+id: 25
+isAdmin: 0
+lastLoginIp: "117.136.32.65"
+lastLoginTime: 1631504271000
+levelName: null
+mobile: "13536501128"
+nickname: "波仔"
+password: "oeADe5U9uLeMYsNigq98zdu8J96A"
+registerIp: "117.136.32.65"
+registerTime: 1631504271000
+userLevelId: null
+username: "微信用户f8f4igi4j9ks"
+weixinOpenid: "oeADe5U9uLeMYsNigq98zdu8J96A" 
+-->
 <template>
 <template>
   <div class="p-4">
   <div class="p-4">
     <BasicTable @register="registerTable">
     <BasicTable @register="registerTable">
       <template #toolbar> </template>
       <template #toolbar> </template>
-      <template #avatarUrl="{ record }">
-        <Avatar :size="80" :src="record.avatarUrl" />
+      <template #avatar="{ record }">
+        <Avatar :size="80" :src="record.avatar" />
       </template>
       </template>
 
 
       <template #gender="{ record }">
       <template #gender="{ record }">
         {{ renderGenderLabel(record.gender) }}
         {{ renderGenderLabel(record.gender) }}
       </template>
       </template>
 
 
+      <template #birthday="{ record }">
+        <Time :value="record.birthday" mode="datetime" />
+      </template>
+
+      <template #lastLoginTime="{ record }">
+        <Time :value="record.lastLoginTime" mode="datetime" />
+      </template>
+
       <template #action="{ record }">
       <template #action="{ record }">
         <TableAction
         <TableAction
           :actions="[
           :actions="[
@@ -45,9 +76,10 @@
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   import { useGo } from '/@/hooks/web/usePage';
   import { useGo } from '/@/hooks/web/usePage';
   import { Avatar } from 'ant-design-vue';
   import { Avatar } from 'ant-design-vue';
+  import { Time } from '/@/components/Time';
 
 
   export default defineComponent({
   export default defineComponent({
-    components: { BasicTable, TableAction, Avatar },
+    components: { BasicTable, TableAction, Avatar, Time },
     setup() {
     setup() {
       const { createMessage } = useMessage();
       const { createMessage } = useMessage();
       const go = useGo();
       const go = useGo();
@@ -61,14 +93,14 @@
         },
         },
         {
         {
           title: '会员名称',
           title: '会员名称',
-          dataIndex: 'name',
+          dataIndex: 'nickname',
           sorter: true,
           sorter: true,
           width: 160,
           width: 160,
         },
         },
         {
         {
           title: '头像',
           title: '头像',
-          dataIndex: 'avatarUrl',
-          slots: { customRender: 'avatarUrl' },
+          dataIndex: 'avatar',
+          slots: { customRender: 'avatar' },
           width: 120,
           width: 120,
         },
         },
         {
         {
@@ -81,22 +113,24 @@
         {
         {
           title: '出生日期',
           title: '出生日期',
           dataIndex: 'birthday',
           dataIndex: 'birthday',
+          slots: { customRender: 'birthday' },
           width: 120,
           width: 120,
         },
         },
         {
         {
           title: '最后登录时间',
           title: '最后登录时间',
-          dataIndex: 'lastLogin',
+          dataIndex: 'lastLoginTime',
+          slots: { customRender: 'lastLoginTime' },
           sorter: true,
           sorter: true,
           width: 120,
           width: 120,
         },
         },
         {
         {
           title: '微信名',
           title: '微信名',
-          dataIndex: 'nickName',
+          dataIndex: 'username',
           width: 120,
           width: 120,
         },
         },
         {
         {
           title: '手机号',
           title: '手机号',
-          dataIndex: 'phone',
+          dataIndex: 'mobile',
           width: 120,
           width: 120,
         },
         },
       ];
       ];
@@ -128,6 +162,12 @@
         rowKey: 'id',
         rowKey: 'id',
         pagination: { pageSize: 20 },
         pagination: { pageSize: 20 },
         bordered: true,
         bordered: true,
+        fetchSetting: {
+          pageField: 'page',
+          sizeField: 'limit',
+          listField: 'list',
+          totalField: 'totalCount',
+        },
       });
       });
 
 
       function renderGenderLabel(gender: number): string {
       function renderGenderLabel(gender: number): string {

+ 22 - 20
src/views/dashboard/order/list.vue

@@ -51,11 +51,11 @@ userName: "微信用户q0zj95zuo4pv" -->
       <template #orderStatus="{ record }">
       <template #orderStatus="{ record }">
         {{ renderOrderStatusLabel(record.orderStatus) }}
         {{ renderOrderStatusLabel(record.orderStatus) }}
       </template>
       </template>
-      <template #shipingStatus="{ record }">
-        {{ renderShipingStatusLabel(record.shipingStatus) }}
+      <template #shippingStatus="{ record }">
+        {{ rendershippingStatusLabel(record.shippingStatus) }}
       </template>
       </template>
-      <template #paymentStatus="{ record }">
-        {{ renderPaymentStatusLabel(record.paymentStatus) }}
+      <template #payStatus="{ record }">
+        {{ renderpayStatusLabel(record.payStatus) }}
       </template>
       </template>
       <template #addTime="{ record }">
       <template #addTime="{ record }">
         <Time :value="record.addTime" mode="datetime" />
         <Time :value="record.addTime" mode="datetime" />
@@ -67,7 +67,7 @@ userName: "微信用户q0zj95zuo4pv" -->
               icon: 'mdi:information-outline',
               icon: 'mdi:information-outline',
               label: '详情',
               label: '详情',
               onClick: () => {
               onClick: () => {
-                go(`/order/list/detail/${record.orderNo}`);
+                go(`/order/list/detail/${record.orderSn}`);
               },
               },
             },
             },
             {
             {
@@ -130,7 +130,7 @@ userName: "微信用户q0zj95zuo4pv" -->
         },
         },
         {
         {
           title: 'VR场景',
           title: 'VR场景',
-          dataIndex: 'scene.name',
+          dataIndex: 'brandName',
           width: 80,
           width: 80,
         },
         },
         {
         {
@@ -149,15 +149,15 @@ userName: "微信用户q0zj95zuo4pv" -->
         },
         },
         {
         {
           title: '发货状态',
           title: '发货状态',
-          dataIndex: 'shipingStatus',
+          dataIndex: 'shippingStatus',
           sorter: true,
           sorter: true,
-          slots: { customRender: 'shipingStatus' },
+          slots: { customRender: 'shippingStatus' },
           width: 80,
           width: 80,
         },
         },
         {
         {
           title: '付款状态',
           title: '付款状态',
-          dataIndex: 'paymentStatus',
-          slots: { customRender: 'paymentStatus' },
+          dataIndex: 'payStatus',
+          slots: { customRender: 'payStatus' },
           width: 60,
           width: 60,
         },
         },
         {
         {
@@ -167,7 +167,7 @@ userName: "微信用户q0zj95zuo4pv" -->
         },
         },
         {
         {
           title: '快递单号',
           title: '快递单号',
-          dataIndex: 'shipingNo',
+          dataIndex: 'shippingNo',
           width: 80,
           width: 80,
         },
         },
         {
         {
@@ -238,20 +238,22 @@ userName: "微信用户q0zj95zuo4pv" -->
       function renderOrderStatusLabel(type: number): string {
       function renderOrderStatusLabel(type: number): string {
         switch (type) {
         switch (type) {
           case 0:
           case 0:
-            return '已取消';
-          case 1:
             return '待付款';
             return '待付款';
-          case 2:
+          case 101:
+            return '已取消';
+          case 201:
             return '已付款';
             return '已付款';
-          case 3:
+          case 1:
             return '已发货';
             return '已发货';
-          case 4:
+          case 2:
             return '已收货';
             return '已收货';
+          case 501:
+            return '完成';
           default:
           default:
             return '';
             return '';
         }
         }
       }
       }
-      function renderShipingStatusLabel(type: number): string {
+      function rendershippingStatusLabel(type: number): string {
         switch (type) {
         switch (type) {
           case 0:
           case 0:
             return '未发货';
             return '未发货';
@@ -261,7 +263,7 @@ userName: "微信用户q0zj95zuo4pv" -->
             return '';
             return '';
         }
         }
       }
       }
-      function renderPaymentStatusLabel(type: number): string {
+      function renderpayStatusLabel(type: number): string {
         switch (type) {
         switch (type) {
           case 0:
           case 0:
             return '未付款';
             return '未付款';
@@ -279,8 +281,8 @@ userName: "微信用户q0zj95zuo4pv" -->
         go,
         go,
         renderOrderTypeLabel,
         renderOrderTypeLabel,
         renderOrderStatusLabel,
         renderOrderStatusLabel,
-        renderShipingStatusLabel,
-        renderPaymentStatusLabel,
+        rendershippingStatusLabel,
+        renderpayStatusLabel,
         uploadApi: uploadApi as any,
         uploadApi: uploadApi as any,
       };
       };
     },
     },