Sfoglia il codice sorgente

fix 修改bug&图书信息补全&用户详细接口对接

haveyou 1 anno fa
parent
commit
7f29a2d811

+ 5 - 1
src/components/CommonPage/SimpleFormModal.vue

@@ -6,8 +6,10 @@
     v-model="visible"
     :title="title"
     position="center"
-    :body-style="{ overflow: 'auto', maxHeight: '84vh' }"
+    :body-style="{ overflow: 'auto', maxHeight: '84vh',position: 'relative' }"
   >
+    <slot name="other"></slot>
+
     <SimpleForm
       :items="items"
       :labelWidth="labelWidth"
@@ -19,6 +21,8 @@
       <slot :name="key" :item="item" :model="model" :updateValue="updateValue"></slot>
     </template>
     </SimpleForm>
+
+
     <template #footer>
       <el-button @click="handleCancel">关闭</el-button>
       <el-button type="primary" @click="handleSumbit" v-if="type !== 'detail'"

+ 16 - 4
src/views/customer/list/components/customer-detail.vue

@@ -16,12 +16,12 @@
     </div>
 
     <div class="flex items-center mb-5 mt-5 ml-3">
-      <el-statistic :value="562">
+      <el-statistic :value="accountInfo.restMoney">
         <template #title>
           <el-text>账户余额</el-text>
         </template>
       </el-statistic>
-      <el-statistic :value="562" style="margin-left: 80px">
+      <el-statistic :value="accountInfo.totalMoney" style="margin-left: 80px">
         <template #title>
           <el-text>总订单数</el-text>
         </template>
@@ -36,10 +36,10 @@
         <account-change :row="currentRow" />
       </el-tab-pane>
       <el-tab-pane label="扫描记录" name="scanLog">
-        <scan-log />
+        <scan-log :row="currentRow" />
       </el-tab-pane>
       <el-tab-pane label="推荐信息" name="recommend">
-        <recommend-info />
+        <recommend-info :row="currentRow" />
       </el-tab-pane>
       <el-tab-pane label="意见反馈" name="fallback">
         <fallback-info />
@@ -65,6 +65,7 @@
     nextTick(() => {
       activeName.value = tabName || 'baseinfo';
       getUserInfo(row.id);
+      getAccountInfo(row.id);
     });
   }
 
@@ -79,6 +80,17 @@
     });
   };
 
+  //获取用户账户信息
+  const accountInfo = ref({});
+  const getAccountInfo = (id) => {
+    request({
+      url: `/user/userAccountInfo/getUserAccount/${id}`,
+      method: 'get'
+    }).then((res) => {
+      accountInfo.value = res.data.data;
+    });
+  };
+
   defineExpose({
     handleOpen
   });

+ 1 - 0
src/views/customer/list/components/detail/account-change.vue

@@ -35,6 +35,7 @@
   watch(
     () => props.row,
     (row) => {
+      if (!row || (row && !row.id)) return;
       pageConfig.pageUrl = `/user/userInfo/getUserAccountChangeLog/${row.id}`;
       pageRef.value?.reload();
     },

+ 31 - 9
src/views/customer/list/components/detail/recommend-info.vue

@@ -15,23 +15,45 @@
 
   defineOptions({ name: 'recommendInfo' });
 
-  /** 表格列配置 */
-  const columns = ref([
-    { label: 'UID', prop: 'cover', align: 'center' },
-    { label: '昵称', prop: 'baseInfo', align: 'center' },
-    { label: '手机号', prop: 'money', align: 'center' },
-    { label: '邀请时间', prop: 'createTime', align: 'center' }
-  ]);
-
+  const props = defineProps({
+    row: {
+      type: Object,
+      default() {
+        return {};
+      }
+    }
+  });
   /** 页面组件实例 */
   const pageRef = ref(null);
 
   const pageConfig = reactive({
-    pageUrl: '/book/bookInfo/list',
+    pageUrl: '/user/userInviteLog/myInviteLog',
     fileName: '推荐信息',
     cacheKey: 'recommendInfo'
   });
 
+  watch(
+    () => props.row,
+    (row) => {
+      if (!row || (row && !row.id)) return;
+      pageConfig.pageUrl = `/user/userInviteLog/myInviteLog`;
+      pageConfig.params = { inviteUserId: row.id };
+      pageRef.value?.reload();
+    },
+    {
+      immediate: true,
+      deep: true
+    }
+  );
+
+  /** 表格列配置 */
+  const columns = ref([
+    { label: 'UID', prop: 'beInviteUserId', align: 'center' },
+    { label: '昵称', prop: 'nickName', align: 'center' },
+    { label: '手机号', prop: 'mobile', align: 'center' },
+    { label: '邀请时间', prop: 'createTime', align: 'center', minWidth: 120 }
+  ]);
+
   //刷新表格
   function reload(where) {
     pageRef.value?.reload(where);

+ 32 - 11
src/views/customer/list/components/detail/scan-log.vue

@@ -15,23 +15,44 @@
 
   defineOptions({ name: 'accountChangeLog' });
 
-  /** 表格列配置 */
-  const columns = ref([
-    { label: '序号', type: 'index', align: 'center', width: 60 },
-    { label: 'ISBN', prop: 'baseInfo', align: 'center' },
-    { label: '商品名称', prop: 'money', align: 'center' },
-    { label: '扫描时间', prop: 'createTime', align: 'center' }
-  ]);
-
+  const props = defineProps({
+    row: {
+      type: Object,
+      default() {
+        return {};
+      }
+    }
+  });
   /** 页面组件实例 */
   const pageRef = ref(null);
 
   const pageConfig = reactive({
-    pageUrl: '/book/bookInfo/list',
-    fileName: '余额变动',
-    cacheKey: 'accountChangeLogTable'
+    fileName: '扫描记录',
+    cacheKey: 'scanLogTable'
   });
 
+  watch(
+    () => props.row,
+    (row) => {
+      if (!row || (row && !row.id)) return;
+      pageConfig.pageUrl = `/user/userScanLog/getUserScanLogList/${row.id}`;
+      pageRef.value?.reload();
+    },
+    {
+      immediate: true,
+      deep: true
+    }
+  );
+
+  /** 表格列配置 */
+  const columns = ref([
+    { label: '序号', type: 'index', align: 'center', width: 60 },
+    { label: 'ISBN', prop: 'isbn', align: 'center' },
+    { label: '商品名称', prop: 'bookName', align: 'center' },
+    { label: '扫描次数', prop: 'scanTimes', align: 'center' },
+    { label: '扫描时间', prop: 'createTime', align: 'center' }
+  ]);
+
   //刷新表格
   function reload(where) {
     pageRef.value?.reload(where);

+ 37 - 10
src/views/data/books/components/books-edit.vue

@@ -8,14 +8,27 @@
     width="1080px"
     :formProps="{ grid: 8 }"
     :formatData="formatData"
+    labelWidth="120px"
     @success="(data) => emit('success', data)"
-  ></simple-form-modal>
+  >
+    <template #other>
+      <div class="image-pos" id="image-pos">
+        <image-upload
+          :limit="1"
+          v-model="formData.cover"
+          :item-style="{ width: '260px', height: '320px', margin: 0 }"
+          :button-style="{ width: '260px', height: '320px', margin: 0 }"
+        />
+      </div>
+    </template>
+  </simple-form-modal>
 </template>
 
 <script setup>
   import { reactive, ref, defineEmits, getCurrentInstance } from 'vue';
   import { useFormData } from '@/utils/use-form-data';
   import SimpleFormModal from '@/components/CommonPage/SimpleFormModal.vue';
+  import ImageUpload from '@/components/ImageUpload/index.vue';
   const { proxy } = getCurrentInstance();
 
   //获取省市
@@ -24,12 +37,14 @@
   const title = ref('新增图书');
   const emit = defineEmits(['success']);
 
+  let colProps = { style: { marginRight: '15px' } };
+
   const formItems = reactive([
     { type: 'input', label: '书名', prop: 'bookName', required: true },
-    { type: 'input', label: 'ISBN', prop: 'isbn', required: true },
-    { type: 'imageUpload', label: '封面', prop: 'cover', props: { limit: 1 } },
+    { type: 'input', label: 'ISBN', prop: 'isbn', required: true, colProps },
+    // { type: 'imageUpload', label: '封面', prop: 'cover', props: { limit: 1 } },
     { type: 'input', label: '作者', prop: 'author', required: true },
-    { type: 'input', label: '定价', prop: 'price', required: true },
+    { type: 'input', label: '定价', prop: 'price', required: true, colProps },
     { type: 'input', label: '出版社', prop: 'publish', required: true },
     {
       type: 'date',
@@ -39,7 +54,8 @@
       props: {
         format: 'YYYY-MM-DD',
         valueFormat: 'YYYY-MM-DD'
-      }
+      },
+      colProps
     },
     {
       type: 'dictSelect',
@@ -47,20 +63,21 @@
       prop: 'bookTag',
       props: { code: 'book_tag' }
     },
-    { type: 'input', label: '中图分类', prop: 'chineCateNo' },
+    { type: 'input', label: '中图分类', prop: 'chineCateNo', colProps },
     { type: 'input', label: '丛书提名', prop: 'bookPut' },
-    { type: 'input', label: '其他提名', prop: 'otherPut' },
+    { type: 'input', label: '其他提名', prop: 'otherPut', colProps },
     { type: 'input', label: '主题', prop: 'bookTopic' },
-    { type: 'input', label: '语种', prop: 'lang' },
-    { type: 'input', label: '装帧', prop: 'bookFormat' },
+    { type: 'input', label: '语种', prop: 'lang', colProps },
     { type: 'input', label: '开本尺寸', prop: 'bookFormat' },
+    { type: 'input', label: '装帧', prop: 'bookPack', colProps },
+    { type: 'input', label: '翻译人', prop: 'translator' },
     {
       type: 'dictSelect',
       label: '是否套装',
       prop: 'suit',
       props: { code: 'is_common_yes' }
     },
-    { type: 'input', label: '版本', prop: 'bookVersion' },
+    { type: 'input', label: '中图法分类名称', prop: 'chineCateName' },
     { type: 'input', label: '总页数', prop: 'pageTotal' },
     {
       type: 'dictSelect',
@@ -68,8 +85,10 @@
       prop: 'perCheck',
       props: { code: 'is_common_yes' }
     },
+    { type: 'input', label: '字数', prop: 'worldCount' },
     { type: 'input', label: '出版地', prop: 'putAddress' },
     { type: 'input', label: '读者对象', prop: 'readers' },
+    { type: 'input', label: '版本', prop: 'bookVersion' },
     { type: 'input', label: '印刷厂', prop: 'printHouse' },
     {
       type: 'date',
@@ -165,3 +184,11 @@
 
   defineExpose({ handleOpen });
 </script>
+<style lang="scss">
+  .image-pos {
+    position: absolute;
+    right: 40px;
+    top: 16px;
+    z-index:10
+  }
+</style>