浏览代码

title根据店铺名称

潘超林 3 月之前
父节点
当前提交
04b6940091

+ 6 - 1
src/App.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="app">
+  <div id="app" v-title="title">
     <router-view />
     <theme-picker />
   </div>
@@ -11,6 +11,11 @@ import ThemePicker from "@/components/ThemePicker";
 export default {
   name: "App",
   components: { ThemePicker },
+  data(){
+    return {
+      title:""
+    }
+  },
   metaInfo() {
     return {
       title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,

+ 64 - 17
src/layout/components/Sidebar/Logo.vue

@@ -1,45 +1,92 @@
 <template>
-  <div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
+  <div
+    class="sidebar-logo-container"
+    :class="{ collapse: collapse }"
+    :style="{
+      backgroundColor:
+        sideTheme === 'theme-dark'
+          ? variables.menuBackground
+          : variables.menuLightBackground,
+    }"
+  >
     <transition name="sidebarLogoFade">
-      <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
+      <router-link
+        v-if="collapse"
+        key="collapse"
+        class="sidebar-logo-link"
+        to="/"
+      >
         <img v-if="logo" :src="logo" class="sidebar-logo" />
-        <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
+        <h1
+          v-else
+          class="sidebar-title"
+          :style="{
+            color:
+              sideTheme === 'theme-dark'
+                ? variables.logoTitleColor
+                : variables.logoLightTitleColor,
+          }"
+        >
+          {{ title }}
+        </h1>
       </router-link>
       <router-link v-else key="expand" class="sidebar-logo-link" to="/">
         <img v-if="logo" :src="logo" class="sidebar-logo" />
-        <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
+        <h1
+          class="sidebar-title"
+          :style="{
+            color:
+              sideTheme === 'theme-dark'
+                ? variables.logoTitleColor
+                : variables.logoLightTitleColor,
+          }"
+        >
+          {{ title }}
+        </h1>
       </router-link>
     </transition>
   </div>
 </template>
 
 <script>
-import logoImg from '@/assets/logo/logo.png'
-import variables from '@/assets/styles/variables.scss'
-
+import logoImg from "@/assets/logo/logo.png";
+import variables from "@/assets/styles/variables.scss";
+import { getStoreInfo } from "@/api/common/index";
 export default {
-  name: 'SidebarLogo',
+  name: "SidebarLogo",
   props: {
     collapse: {
       type: Boolean,
-      required: true
-    }
+      required: true,
+    },
   },
   computed: {
     variables() {
       return variables;
     },
     sideTheme() {
-      return this.$store.state.settings.sideTheme
-    }
+      return this.$store.state.settings.sideTheme;
+    },
   },
   data() {
     return {
-      title: process.env.VUE_APP_TITLE,
-      logo: logoImg
-    }
-  }
-}
+      title: "", //process.env.VUE_APP_TITLE
+      logo: logoImg,
+    };
+  },
+  mounted(){
+    this.getInfo()
+  },
+  methods: {
+    getInfo() {
+      getStoreInfo().then((res) => {
+        if (res.code == 200) {
+         this.title = res.data.storeName;
+        }
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>

+ 4 - 0
src/main.js

@@ -20,6 +20,10 @@ import { getDicts } from "@/api/system/dict/data";
 import { getCity } from "@/api/common/index";
 import { getConfigKey } from "@/api/system/config";
 import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
+
+
+
+
 // 分页组件
 import Pagination from "@/components/Pagination";
 // 自定义表格工具组件

+ 7 - 2
src/permission.js

@@ -5,7 +5,7 @@ import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
 import { getToken } from '@/utils/auth'
 import { isRelogin } from '@/utils/request'
-
+import { getStoreInfo } from "@/api/common/index";
 NProgress.configure({ showSpinner: false })
 
 const whiteList = ['/login', '/register']
@@ -13,7 +13,12 @@ const whiteList = ['/login', '/register']
 router.beforeEach((to, from, next) => {
   // next()
   if (getToken()) {
-    to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
+    getStoreInfo().then((res) => {
+      if (res.code == 200) {
+        window.document.title = res.data.storeName
+      }
+    });
+    // to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
     /* has token*/
     if (to.path === '/login') {
       next({ path: '/' })

+ 15 - 1
src/views/manage/order.vue

@@ -1038,10 +1038,24 @@ export default {
               }
             }
 
-            console.log("1231231", e);
             totalList.push(e);
           }
+
+          totalList.forEach((e) => {
+            console.log("zxczxc", JSON.parse(e.goodsInfo));
+            let goos = JSON.parse(e.goodsInfo);
+            let detail = "";
+            if (goos) {
+              goos.forEach((a) => {
+                detail += `${a.skuName}(${a.specsValue[0]?.specsName})-数量:${a.quantity}${a.unit};`;
+              });
+              e.goodsDetails = detail;
+              console.log(e);
+            }
+          });
+
           this.spuList = totalList;
+
           this.total = response.data.total;
           this.loading = false;
         }

+ 7 - 2
src/views/manage/sales.vue

@@ -165,6 +165,8 @@
         </template>
       </el-table-column>
       <el-table-column label="销售额(元)" align="center" prop="salePrice" />
+      <el-table-column label="退款金额(元)" align="center" prop="applyRefundAmount" />
+
       <el-table-column label="状态" align="center" prop="spuStatus">
         <template slot-scope="scope">
           {{
@@ -224,14 +226,17 @@
         <el-descriptions-item label="商品价格(元)">
           {{ form.price }}
         </el-descriptions-item>
-        <el-descriptions-item label="商品库存"> {{ form.stock }}</el-descriptions-item>
+        <el-descriptions-item label="商品库存"> {{ form.stock }} {{ form.unit }}</el-descriptions-item>
 
         <el-descriptions-item label="商品销量">
-          {{ form.saleCount }}</el-descriptions-item
+          {{ form.saleCount }} {{ form.unit }}</el-descriptions-item
         >
         <el-descriptions-item label="商品销售额(元)">
           {{ form.salePrice }}</el-descriptions-item
         >
+        <el-descriptions-item label="商品退款金额(元)">
+          {{ form.applyRefundAmount }}</el-descriptions-item
+        >
         <el-descriptions-item label="商品状态">
           {{
             form.spuStatus == 2

+ 1 - 1
src/views/marketing/components/user-dialog.vue

@@ -145,7 +145,7 @@ export default {
       queryParams: {
         browseFlag: "",
         pageNo: 1,
-        pageSize: 5,
+        pageSize: 10,
         orderFlag: "",
         key: "",
         pushStatus: "",