Browse Source

:hatching_chick:feat: 路径+公告

Ritchie 1 year ago
parent
commit
b5e5e59cad

+ 2 - 2
.gitignore

@@ -1,7 +1,7 @@
 .DS_Store
 node_modules
-/shenze
-shenze.zip
+/sz-stock
+sz-stock.zip
 package-lock.json
 
 # local env files

+ 1 - 1
package.json

@@ -4,7 +4,7 @@
   "private": true,
   "scripts": {
     "start": "vue-cli-service serve",
-    "dev": "vue-cli-service serve --port 4200",
+    "dev": "vue-cli-service serve --port 4300",
     "serve": "vue-cli-service serve",
     "build": "vue-cli-service build --mode production",
     "buildDev": "vue-cli-service build --mode development",

+ 3 - 3
src/components/TinymceEditor/index.vue

@@ -45,14 +45,14 @@ const emit = defineEmits(['input'])
 const myTinyInit = reactive({
   width: '100%',
   height: 500, // 默认高度
-  language_url: '/shenze/tinymce/langs/zh_CN.js', // 配置汉化
+  language_url: '/sz-stock/tinymce/langs/zh_CN.js', // 配置汉化
   language: 'zh_CN', // 语言标识
   branding: false, // 不显示右下角logo
   auto_update: false, // 不进行自动更新
   resize: true, // 可以调整大小
   menubar: false, // 菜单栏
-  skin_url: '/shenze/tinymce/skins/ui/oxide', // 手动引入CSS
-  content_css: '/shenze/tinymce/skins/content/default/content.css', // 手动引入CSS
+  skin_url: '/sz-stock/tinymce/skins/ui/oxide', // 手动引入CSS
+  content_css: '/sz-stock/tinymce/skins/content/default/content.css', // 手动引入CSS
   toolbar_mode: 'wrap',
   // selector: 'textarea',
   plugins: props.plugins, // 插件

+ 6 - 4
src/components/commom/kDialog/index.vue

@@ -15,12 +15,14 @@
           </div>
           <slot name="content"></slot>
           <div :class="(cancelBtnTxt&&confirmBtnTxt)?'flex-row justify-between':'l-flex-center'" class="block6">
-            <div v-if="cancelBtnTxt" class="mod7 flex-col" @click="cancelClk">
+            <!-- 下次再看 -->
+            <!-- <div v-if="cancelBtnTxt" class="mod7 flex-col" @click="cancelClk">
               <span class="info5">{{ cancelBtnTxt }}</span>
-            </div>
-            <div v-if="confirmBtnTxt" class="mod8 flex-col" @click="confirmClk">
+            </div> -->
+            <!-- 不再显示 -->
+            <!-- <div v-if="confirmBtnTxt" class="mod8 flex-col" @click="confirmClk">
               <span class="info6">{{ confirmBtnTxt }}</span>
-            </div>
+            </div> -->
           </div>
         </div>
       </div>

+ 6 - 7
src/service/home/index.js

@@ -16,14 +16,13 @@ export function getListStockInfoForMonth() {
     return axios.get(`/index/listStockInfoForMonth`);
 }
 
-// 获取首页统计
-export function getStatistics(params) {
-    return axios.post(`/ORDER-SERVER/tOrder/getStatistics?${stringToUrl(params)}`, params);
-}
-// 获取设备列表
-export function getEquipmentList(params) {
-    return axios.get(`/SZWL-SERVER/tEquipment/listEquipment?${stringToUrl(params)}`);
+
+// 获取公告
+export function getPageNotice(params) {
+    return axios.get(`/notificationInfo/pageNotificationInfo`, { params });
 }
+
+
 // 获取商家列表
 export function getAdminList(params) {
     return axios.get(`/SZWL-SERVER/tAdmin/getAdminList?${stringToUrl(params)}`);

+ 2 - 38
src/service/user.js

@@ -1,42 +1,6 @@
 import axios from '../utils/axios';
-import { stringToUrl } from '@/common/js/utils';
-// 注册
-export function register(params) {
-  return axios.post('/SZWL-SERVER/user/register', params);
-}
-// 发送验证码
-export function sentRegisterCode(params) {
-  return axios.post(`/SZWL-SERVER/tMessageCode/sentRegisterCode?${stringToUrl(params)}`, params);
-}
-// 获取已有关联上级的名称
-export function tAdminGetRelation(params) {
-  return axios.get(`/SZWL-SERVER/tAdmin/getRelationAdminUsername?${stringToUrl(params)}`, params);
-}
-// 添加关联上级
-// export function tAdminSetRelationAdmin(params) {
-//   return axios.get(`/SZWL-SERVER/tAdmin/setRelationAdmin?${stringToUrl(params)}`, params);
-// }
-// 三级联动获取地址
-export function Api_getArea(params) {
-  return axios.get(`/SZWL-SERVER/tArea/getArea`, {params});
-}
-// 地址回显
-export function Api_getAreaDetail(params) {
-  return axios.get(`/SZWL-SERVER/tArea/getById`, {params});
-}
-// 是否海外用户
-export function getIfForeign(adminId) {
-  return axios.get(`/SZWL-SERVER/tAdmin/getIfForeign/${adminId}`);
-}
-// 批量修改支付平台
-export function updatePayPlatform(params) {
-  return axios.get(`/SZWL-SERVER/tAdmin/updatePayPlatform?${stringToUrl(params)}`, params);
-} 
+
 // 添加公告
 export function addNotice(params) {
-  return axios.post(`/SZWL-SERVER/tNotice/addNotice`, params);
+  return axios.post(`/notificationInfo/addNotification`, params);
 }
-// 修改DIY功能使用密码
-export function updateDIYPassword(params) {
-  return axios.get(`/SZWL-SERVER/tEquipment/updateDIYPassword?${stringToUrl(params)}`, params);
-} 

+ 2 - 2
src/styles/home/homeRank5.less

@@ -87,7 +87,7 @@
     .buy-box {
       margin: auto;
       border-radius: 10px;
-      background-color:	#f8f7ff;
+      background-color:	#f6f6fd;
       padding: 15px;
       width: 95%;
       max-width: 600px;
@@ -110,7 +110,7 @@
       margin: auto;
       margin-top: 1px;
       border-radius: 10px;
-      background-color: #f8f7ff;
+      background-color: #f6f6fd;
       padding: 15px;
       width: 95%;
       max-width: 600px;

+ 1 - 1
src/styles/trading/index.less

@@ -693,7 +693,7 @@
       margin: auto;
       margin-top: 1px;
       border-radius: 10px;
-      background-color: #f8f7ff;
+      background-color: #f6f6fd;
       padding: 15px;
       width: 95%;
       max-width: 600px;

+ 25 - 38
src/views/announcement/index.vue

@@ -14,7 +14,7 @@
   </div>
 </template>
 
-<script>
+<script setup>
 import { ref } from "vue";
 import sHeader from "@/components/SimpleHeader";
 import TinymceEditor from "../../components/TinymceEditor/index";
@@ -23,47 +23,34 @@ import { useI18n } from "vue-i18n";
 import { useRouter } from "vue-router";
 import { showFailToast, showSuccessToast } from "vant";
 
+const { t } = useI18n();
+const router = useRouter();
+const title = ref("");
+const content = ref("");
 
-export default {
-  components: { sHeader, TinymceEditor },
-  setup() {
-    const { t } = useI18n();
-    const router = useRouter();
-    const title = ref("");
-    const content = ref("");
+const inputContent = (newVal) => {
+  // console.log(newVal)
+  content.value = newVal;
+}
 
-    const inputContent = (newVal) => {
-      // console.log(newVal)
-      content.value = newVal;
-    }
+const sumbitNotice = async () => {
+  let params = {
+    title: title.value,
+    content: content.value
+  };
+  const { data } = await addNotice(params)
+  if (data.code == "00000") {
+    // console.log(data);
+    showSuccessToast(t('announcement.successfully'));
+    setTimeout(() => {
+      router.push("/home");
+    }, 1500);
+  } else {
+    showFailToast(`${t('announcement.failed')} ${data.message}`);
+  }
+}
 
-    const sumbitNotice = async () => {
-      let addParams = {
-        "title": title.value,
-        "note": content.value
-      };
-      console.log("addParams", addParams)
-      const { data } = await addNotice(addParams)
-      if (data.code == "00000") {
-        // console.log(data);
-        showSuccessToast(t('announcement.successfully'));
-        setTimeout(() => {
-          router.push("/home");
-        }, 1500);
-      } else {
-        showFailToast(`${t('announcement.failed')} ${data.message}`);
-      }
-    }
 
-    // 引入语言
-    return {
-      inputContent,
-      title,
-      content,
-      sumbitNotice
-    };
-  },
-};
 </script>
 
 <style lang="less" scoped>

+ 32 - 45
src/views/home/HomeIndex.vue

@@ -8,16 +8,16 @@
         <van-notice-bar @click="noticeClk" mode="link" :scrollable="true" color="rgba(64,77,116,1)" left-icon="volume-o"
           :text="noticeContent.title" />
       </template> -->
-      <!-- <template> -->
+      <template v-if="noticeContent">
         <van-notice-bar @click="noticeClk" mode="link" :scrollable="true" color="rgba(64,77,116,1)" left-icon="volume-o"
-          text="这里是关于SUNZEE内部交易系统的公告说明!" />
-      <!-- </template> -->
+          :text="noticeContent.centent" />
+      </template>
       <!-- 灰线 -->
       <!-- <div class="intervalRow"></div> -->
+      <!-- 用户名 -->
       <div class="nameDeviceRow flex-col">
         <span class="txt3">{{ userName }}</span>
         <div class="l-flex-RC">
-
         </div>
       </div>
       <!-- 行情数据 -->
@@ -29,18 +29,8 @@
           </div>
         </div>
       </div>
-      <!-- 时间选择 -->
-      <!-- <date-select-list @update="update($event)"></date-select-list> -->
-      <!-- 类型选择 -->
-      <!-- <typeSelectList v-if="showDataDiv" :isHome="true" @upselectdata="upselectdata($event)"></typeSelectList> -->
-
-      <!-- <div class="o-plr-8 o-pt-10">
-        <div class="outer5 flex-col" @click="pushOrderCenter">
-          // 收入总额,销售量,订单数
-        </div>
-      </div> -->
-      <!-- 时间范围 -->
-      <div class="c-text-c c-text-18">
+      
+      <div class="c-text-c c-text-18" style="color: #39a6fe;font-weight: bold ;">
         月K线图
       </div>
       <!-- ECharts -->
@@ -108,9 +98,9 @@
     </div>
     <!-- 新闻通知弹窗 -->
     <kDialog :dialogTitle="$t('home.notificationPop.notification')" :cancelBtnTxt="$t('home.notificationPop.nextTime')"
-      :confirmBtnTxt="$t('home.notificationPop.roger')" ref="kDialogRef" @confirmclk="confirmClk">
+      :confirmBtnTxt="$t('home.notificationPop.roger')" ref="kDialogRef" >
       <template #content>
-        <div class="o-w" style="max-height: 50vh; overflow-y: auto" v-html="noticeContent.note"></div>
+        <div class="o-w" style="max-height: 50vh; overflow-y: auto" v-html="noticeContent.content"></div>
       </template>
     </kDialog>
 
@@ -126,41 +116,38 @@ import sHeader from "@/components/SimpleHeader";
 import { getLoginUser, styleUrl } from "@/common/js/utils";
 import {
   getListStockInfoForMonth,
-  Api_getNotice,
-  Api_getUpdateNotice,
+  // Api_getNotice,
+  getPageNotice,
+  // Api_getUpdateNotice,
   getTop5List,
 } from "../../service/home";
-import { showToast } from "vant";
+// import { showToast } from "vant";
 
 
 const buyTop5List = ref([]);
 const sellTop5List = ref([]);
 
-// const getTop5ListFunc = async () => {
-//   const { data } = await   getTop5List();
-
-//   if (data.code === '00000') {
-//     console.log("buyTop5List >>", buyTop5List);
-//   }
-// }
 
 async function getTop5Func() {
   const { data } = await getTop5List()
   if (data.code === '00000') {
-    console.log("buyTop5List >>", data.data.buyTopList);
-    console.log("sellTop5List >>", data.data.sellTopList);
     buyTop5List.value = data.data.buyTopList
     sellTop5List.value = data.data.sellTopList
   }
 }
 
-
 const noticeContent = ref({});
 // 获取公告
 const getNotice = () => {
-  Api_getNotice({ adminId: user.id }).then((res) => {
-    noticeContent.value = res.data.data || {};
-  });
+  
+  const params = {
+    current: 1,
+    size: 10
+  }
+  getPageNotice(params).then((res)=>{
+    noticeContent.value = res.data.data.records[0] || {};
+  })
+  
 };
 // 通知弹窗
 const kDialogRef = ref(null);
@@ -169,17 +156,17 @@ const noticeClk = () => {
   kDialogRef.value.openDialog();
 };
 // 点击右侧按钮
-const confirmClk = (e) => {
-  console.log(e, 2222);
-  Api_getUpdateNotice({
-    adminId: user.id,
-  }).then((res) => {
-    showToast(res.data.message);
-    setTimeout(() => {
-      getNotice();
-    }, 500);
-  });
-};
+// const confirmClk = (e) => {
+//   console.log(e, 2222);
+//   Api_getUpdateNotice({
+//     adminId: user.id,
+//   }).then((res) => {
+//     showToast(res.data.message);
+//     setTimeout(() => {
+//       getNotice();
+//     }, 500);
+//   });
+// };
 const firstLogin = ref(true);
 const user = getLoginUser();
 const userName = ref(user.userName);

+ 1 - 1
src/views/login/LoginIndex.vue

@@ -118,7 +118,7 @@ export default {
         localStorage.setItem('firstLogin', true);
 
         // 需要刷新页面,否则 axios.js 文件里的 token 不会被重置
-        window.location.href = '/shenze/';
+        window.location.href = '/sz-stock/';
         setTimeout(() => {
           router.push("/home");
         }, 200);

+ 0 - 1
src/views/user/UserIndex.vue

@@ -128,7 +128,6 @@
             </div>
           </div>
 
-
           <!-- 首页通知 -->
           <div class="taskListRow flex-col" @click="pushPageList('/announcement')">
             <div class="taskIcon announcementIcon"></div>

+ 2 - 2
vue.config.js

@@ -1,6 +1,6 @@
 module.exports = {
-  outputDir: "shenze",
-  publicPath: "/shenze",
+  outputDir: "sz-stock",
+  publicPath: "/sz-stock",
   // publicPath: '/sunzee-stock',
   assetsDir: "static",
   css: {