浏览代码

Merge branch 'feature/mockApi' of http://192.168.0.115:3000/zhangyupeng/zfb_mp into feature/mockApi

gemercheung 3 年之前
父节点
当前提交
d4994c0262

+ 2 - 2
src/api/sys/user.ts

@@ -3,7 +3,7 @@ import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userMod
 import { encodeStr } from '/@/utils/encodeUtil';
 import { ErrorMessageMode } from '/#/axios';
 import { ContentTypeEnum } from '/@/enums/httpEnum';
-import { encode } from 'js-base64';
+// import { encode } from 'js-base64';
 
 enum Api {
   // Login = '/basic-api/sys/login',
@@ -25,7 +25,7 @@ export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'modal')
 
   const paramData: LoginParams = {
     ...params,
-    userPassword: encodeStr(encode(params.userPassword)),
+    userPassword: encodeStr(window.btoa(params.userPassword)),
   };
 
   return defHttp.post<LoginResultModel>(

+ 0 - 1
src/views/dashboard/order/confirmModal.vue

@@ -32,7 +32,6 @@
             immediate: true,
             onChange: function (value, opt) {
               Reflect.set(modalRecord, 'shippingName', opt.label);
-              console.log('labelField', modalRecord, value, opt);
             },
             params: {
               page: 1,

+ 137 - 12
src/views/dashboard/order/data.tsx

@@ -1,14 +1,84 @@
 import { DescItem } from '/@/components/Description/index';
 import { BasicColumn } from '/@/components/Table/src/types/table';
 import { Button } from '/@/components/Button';
-
+// import { Time } from '/@/components/Time';
 import { Badge } from 'ant-design-vue';
 
 export const refundData = {
-  a1: '1000000000',
-  a2: '已取货',
-  a3: '1234123421',
-  a4: '3214321432',
+  id: 731,
+  orderSn: '20220210070337274124598',
+  userId: 21,
+  orderStatus: 300,
+  shippingStatus: 1,
+  payStatus: 2,
+  consignee: '刘生',
+  country: null,
+  province: '浙江省',
+  city: '杭州市',
+  district: '萧山区',
+  address: '桂语朝阳2-3001',
+  mobile: '13967143520',
+  postscript: null,
+  shippingId: 91,
+  shippingName: '亚马逊物流',
+  shippingNo: '11111',
+  payId: 'wx1007033753906933ad37fff63824bd0000',
+  payName: null,
+  shippingFee: 0.0,
+  actualPrice: 0.01,
+  integral: 0,
+  integralMoney: 0.0,
+  orderPrice: 0.01,
+  goodsPrice: 0.01,
+  addTime: 1644447817000,
+  confirmTime: null,
+  payTime: 1644447827000,
+  freightPrice: 0,
+  couponId: '',
+  parentId: null,
+  couponPrice: 0.0,
+  callbackStatus: null,
+  orderType: '4',
+  userName: '微信用户lkp4qslsfsds',
+  goodsList: [
+    {
+      id: 873,
+      orderId: 731,
+      goodsId: 77007479,
+      goodsName: '特权证',
+      goodsSn: '001',
+      productId: 4182,
+      number: 1,
+      marketPrice: 0.02,
+      retailPrice: 0.01,
+      goodsSpecifitionNameValue: null,
+      isReal: null,
+      goodsSpecifitionIds: null,
+      listPicUrl:
+        'https://4dkk.4dage.com/shop/huafa/20220107/11124928804fa0.jpg?x-oss-process=image/resize,m_fixed,w_400,h_400',
+    },
+    {
+      id: 8753,
+      orderId: 731,
+      goodsId: 77007479,
+      goodsName: '特权证',
+      goodsSn: '001',
+      productId: 4182,
+      number: 1,
+      marketPrice: 0.02,
+      retailPrice: 0.01,
+      goodsSpecifitionNameValue: null,
+      isReal: null,
+      goodsSpecifitionIds: null,
+      listPicUrl:
+        'https://4dkk.4dage.com/shop/huafa/20220107/11124928804fa0.jpg?x-oss-process=image/resize,m_fixed,w_400,h_400',
+    },
+  ],
+  brandName: '三江新村标清VR',
+  nickName: '【指房宝】天门科技13967143520',
+  brandId: 1046773,
+  newId: null,
+  logistics: { result: '快递单号错误' },
 };
 
 export const personData = {
@@ -18,22 +88,77 @@ export const personData = {
   b4: '浙江省杭州市西湖区万塘路18号',
   b5: '无',
 };
+export const goodsSchema: DescItem[] = [
+  {
+    field: 'goodsList',
+    label: '商品信息',
+  },
+  {
+    field: 'payStatus',
+    label: '付款状态',
+  },
+  {
+    field: 'nickName',
+    label: '会员昵称',
+  },
+  {
+    field: 'payTime',
+    label: '付款时间',
+    render: (val) => {
+      return val;
+      // return (<Time :value="val" mode="datetime" />)
+    },
+  },
+  {
+    field: 'addTime',
+    label: '下单时间',
+  },
+  {
+    field: 'goodsPrice',
+    label: '商品总价',
+  },
+];
+
 export const refundSchema: DescItem[] = [
   {
-    field: 'a1',
-    label: '取货单号',
+    field: 'orderSn',
+    label: '单号',
   },
   {
-    field: 'a2',
-    label: '状态',
+    field: 'orderStatus',
+    label: '订单状态',
   },
   {
     field: 'a3',
-    label: '销售单号',
+    label: '发货状态',
+  },
+  {
+    field: 'payId',
+    label: '支付单号',
+  },
+  {
+    field: 'consignee',
+    label: '收货人',
+  },
+  {
+    field: 'address',
+    label: '收货地址',
+  },
+  {
+    field: 'mobile',
+    label: '联系电话',
+  },
+  {
+    field: 'shippingName',
+    label: '快递公司',
+  },
+  {
+    field: 'shippingNo',
+    label: '快递单号',
   },
   {
-    field: 'a4',
-    label: '子订单',
+    field: 'shippingFee',
+    label: '快递费用',
   },
 ];
 export const personSchema: DescItem[] = [

+ 79 - 3
src/views/dashboard/order/detail.vue

@@ -5,10 +5,31 @@
         size="middle"
         title="商品详情"
         :bordered="false"
+        :useCollapse="true"
         :column="3"
         :data="refundData"
-        :schema="refundSchema"
+        :schema="goodsSchema"
       />
+      <div>
+        <a-row :gutter="16">
+          <a-col :span="24">
+            <a-card
+              v-for="item in refundData.goodsList"
+              :key="item.id"
+              :hoverable="true"
+              :class="`${prefixCls}__card`"
+            >
+              <div :class="`${prefixCls}__card-title`">
+                <TableImg :size="50" :simpleShow="true" :imgList="[item.listPicUrl]" />
+              </div>
+              <div :class="`${prefixCls}__card-detail`">
+                <div>{{ item.goodsName }}</div>
+                ¥{{ item.retailPrice }}X {{ item.number }}
+              </div>
+            </a-card>
+          </a-col>
+        </a-row>
+      </div>
       <a-divider />
       <Description
         size="middle"
@@ -69,17 +90,21 @@
   import { Description } from '/@/components/Description/index';
   import { useRoute, useRouter } from 'vue-router';
   import { useTabs } from '/@/hooks/web/useTabs';
-  import { refundSchema, refundData, personData, personSchema } from './data';
-  import { Divider, Card, Steps } from 'ant-design-vue';
+  import { TableImg } from '/@/components/Table';
+  import { refundSchema, refundData, personData, goodsSchema, personSchema } from './data';
+  import { Divider, Card, Row, Col, Steps } from 'ant-design-vue';
 
   export default defineComponent({
     components: {
       PageWrapper,
       Description,
+      TableImg,
       [Divider.name]: Divider,
       [Card.name]: Card,
       [Steps.name]: Steps,
       [Steps.Step.name]: Steps.Step,
+      [Row.name]: Row,
+      [Col.name]: Col,
     },
     setup() {
       const route = useRoute();
@@ -91,13 +116,64 @@
       setTitle(`No.${id} - 订单详情`);
 
       return {
+        prefixCls: 'list-card',
         refundSchema,
         refundData,
         personData,
         personSchema,
+        goodsSchema,
         router,
         id,
       };
     },
   });
 </script>
+<style lang="less" scoped>
+  &/deep/ .ant-card-body {
+    padding: 16px;
+    display: flex;
+    justify-content: space-between;
+    width: 100%;
+  }
+  .list-card {
+    &__link {
+      margin-top: 10px;
+      font-size: 14px;
+
+      a {
+        margin-right: 30px;
+      }
+
+      span {
+        margin-left: 5px;
+      }
+    }
+
+    &__card {
+      margin-bottom: -8px;
+      display: flex;
+
+      &-title {
+        flex: 1;
+        margin-bottom: 5px;
+        font-size: 16px;
+        font-weight: 500;
+        color: @text-color;
+
+        .icon {
+          margin-top: -5px;
+          margin-right: 10px;
+          font-size: 38px !important;
+        }
+      }
+
+      &-detail {
+        flex: 1;
+        padding-top: 10px;
+        padding-left: 30px;
+        font-size: 14px;
+        color: @text-color-secondary;
+      }
+    }
+  }
+</style>