Эх сурвалжийг харах

1. 花掌柜首页--今日概况修改
2. 今日访客页面实现正常获取数据

shizhongqi 10 сар өмнө
parent
commit
f47dee1d23

+ 8 - 11
ghsApp/src/admin/custom/visit.vue

@@ -93,28 +93,25 @@ export default {
 		uni.removeStorageSync('newClient');
 		uni.removeStorageSync('newClient');
 	},
 	},
   methods: {
   methods: {
-    selectCurrent(item){
-
-    },
     init() {
     init() {
       if(!this.no_shop_show_model) {
       if(!this.no_shop_show_model) {
         this.getVisit();
         this.getVisit();
       }
       }
     },
     },
     searchFn(e) {
     searchFn(e) {
-        this.resetList();
-        this.seekVal = e;
-        this.getVisit();
+      this.resetList();
+      this.seekVal = e;
+      this.getVisit();
     },
     },
     getVisit() {
     getVisit() {
       return getVisit({
       return getVisit({
         page: this.list.page
         page: this.list.page
       }).then((res) => {
       }).then((res) => {
-          this.completes(res);
-          if (this.$util.isEmpty(res.data)){
-            return false;
-          }
-        });
+        this.completes(res);
+        if (this.$util.isEmpty(res.data)){
+          return false;
+        }
+      });
     },
     },
     change(e) {
     change(e) {
       if (this.tabIndex == e.index) {
       if (this.tabIndex == e.index) {

+ 12 - 17
hdApp/src/admin/custom/visit.vue

@@ -2,7 +2,7 @@
   <div class="app-main app-content">
   <div class="app-main app-content">
     <block v-if="!$util.isEmpty(list.data)">
     <block v-if="!$util.isEmpty(list.data)">
       <block v-for="(item, index) in list.data" :key="index">
       <block v-for="(item, index) in list.data" :key="index">
-        <tui-list-cell :arrow="true" @click="pageTo({url:'/pagesClient/member/detail',query: {id: item.id,},})">
+        <tui-list-cell :arrow="true" @click="pageTo({url:'/admin/member/detail', query: {id: item.id,},})">
           <div class="tui-msg-box">
           <div class="tui-msg-box">
             <img :src="item.avatar" class="tui-msg-pic" mode="widthFix" />
             <img :src="item.avatar" class="tui-msg-pic" mode="widthFix" />
             <div class="tui-msg-item">
             <div class="tui-msg-item">
@@ -56,7 +56,7 @@ import appVipModule from "@/components/module/app-vip";
 import AppTag from "@/components/module/app-tag.vue";
 import AppTag from "@/components/module/app-tag.vue";
 import AppSearchModule from "@/components/module/app-search";
 import AppSearchModule from "@/components/module/app-search";
 import { list } from "@/mixins";
 import { list } from "@/mixins";
-import { getVisit } from "@/api/member";
+import { getVisit } from "@/api/custom";
 export default {
 export default {
   name: "customVisit",
   name: "customVisit",
   components: {
   components: {
@@ -90,31 +90,26 @@ export default {
   },
   },
   onLoad(option) {},
   onLoad(option) {},
 	onShow(){
 	onShow(){
-		uni.removeStorageSync('newClient');
+		//uni.removeStorageSync('newClient');
 	},
 	},
   methods: {
   methods: {
-    selectCurrent(item){
-
-    },
     init() {
     init() {
-      if(!this.no_shop_show_model) {
-        this.getVisit();
-      }
+      this.getVisit();
     },
     },
     searchFn(e) {
     searchFn(e) {
-        this.resetList();
-        this.seekVal = e;
-        this.getVisit();
+      this.resetList();
+      this.seekVal = e;
+      this.getVisit();
     },
     },
     getVisit() {
     getVisit() {
       return getVisit({
       return getVisit({
         page: this.list.page
         page: this.list.page
       }).then((res) => {
       }).then((res) => {
-          this.completes(res);
-          if (this.$util.isEmpty(res.data)){
-            return false;
-          }
-        });
+        this.completes(res);
+        if (this.$util.isEmpty(res.data)){
+          return false;
+        }
+      });
     },
     },
     change(e) {
     change(e) {
       if (this.tabIndex == e.index) {
       if (this.tabIndex == e.index) {

+ 56 - 31
hdApp/src/admin/home/workbench.vue

@@ -22,14 +22,14 @@
             <view class="red-mind" v-if="unReadMsgNum>0">{{ unReadMsgNum>9?'9+':unReadMsgNum }}</view>
             <view class="red-mind" v-if="unReadMsgNum>0">{{ unReadMsgNum>9?'9+':unReadMsgNum }}</view>
           </view>
           </view>
 
 
-          <view class="today-income-section" @click="pageTo({url:'/admin/stat/kdIncome'})">
+          <view class="today-income-section" @click.stop="pageTo({url:'/admin/stat/kdIncome'})">
             <view class="income-label">收入</view>
             <view class="income-label">收入</view>
             <view class="income-value">
             <view class="income-value">
               <text class="income-number">{{ $util.numberFormat(data.todayData.income) }}</text>
               <text class="income-number">{{ $util.numberFormat(data.todayData.income) }}</text>
             </view>
             </view>
           </view>
           </view>
 
 
-          <view class="today-stats" @click="pageTo({url:'/admin/custom/visit'})">
+          <view class="today-stats" @click.stop="pageTo({url:'/admin/custom/visit'})">
             <view class="stat-item">
             <view class="stat-item">
               <view class="stat-content">
               <view class="stat-content">
                 <view class="stat-label">访客</view>
                 <view class="stat-label">访客</view>
@@ -37,22 +37,47 @@
               </view>
               </view>
             </view>
             </view>
 
 
-            <navigator url="/admin/home/order" open-type="switchTab" class="stat-item">
+            <navigator
+              url="/admin/home/order"
+              open-type="switchTab"
+              class="stat-item"
+              @click.stop="pageTo({url:'/admin/home/order'})"
+            >
               <view class="stat-content">
               <view class="stat-content">
                 <view class="stat-label">订单</view>
                 <view class="stat-label">订单</view>
                 <view class="stat-value">{{ $util.numberFormat(data.todayData.order) || 0 }}</view>
                 <view class="stat-value">{{ $util.numberFormat(data.todayData.order) || 0 }}</view>
               </view>
               </view>
             </navigator>
             </navigator>
 
 
-            <view class="stat-item">
+            <view class="stat-item" @click.stop="">
               <view class="stat-content">
               <view class="stat-content">
                 <view class="stat-label">昨日收入</view>
                 <view class="stat-label">昨日收入</view>
-                <view class="stat-value">{{ $util.numberFormat(yesterdayIncome) || 0 }}</view>
+                <view class="stat-value">{{ $util.numberFormat(data.yesterdayIncome) || 0 }}</view>
+              </view>
+            </view>
+          </view>
+        </view>
+      </template>
+      <template v-else>
+        <view class="today-overview-card">
+          <view class="today-header">
+            <view class="today-title">今日概况</view>
+            <zui-svg-icon icon="home-message" color="#FFFFFF" :width="32" :height="29" @click.native="pageTo({url:'/admin/chat/list'})" />
+            <view class="red-mind" v-if="unReadMsgNum>0">{{ unReadMsgNum>9?'9+':unReadMsgNum }}</view>
+          </view>
+
+          <view class="today-stats" @click="pageTo({url:'/admin/custom/visit'})">
+            <view class="stat-item">
+              <view class="stat-content">
+                <view class="stat-label">访客</view>
+                <view class="stat-value">{{ $util.numberFormat(data.todayData.visit) || 0 }}</view>
               </view>
               </view>
             </view>
             </view>
+
           </view>
           </view>
         </view>
         </view>
       </template>
       </template>
+      
       <view class="module-com news-wrap">
       <view class="module-com news-wrap">
         <view class="news-list" v-for="(item, index) in data.notice" :key="index" @click="noticeFn(item)" >
         <view class="news-list" v-for="(item, index) in data.notice" :key="index" @click="noticeFn(item)" >
           <view class="news-left">
           <view class="news-left">
@@ -584,13 +609,14 @@ export default {
   onShow () {
   onShow () {
       this.unReadMsgNum = 0; // 重置未读消息数
       this.unReadMsgNum = 0; // 重置未读消息数
     
     
-      if(this.backAction == 'login'){
-        this.init()
-      }
-      if(this.backAction == 'cacelMask'){
-        this.init()
-        this.backAction = ''
-      }
+      this.init();
+      // if(this.backAction == 'login'){
+      //   this.init()
+      // }
+      // if(this.backAction == 'cacelMask'){
+      //   this.init()
+      //   this.backAction = ''
+      // }
 
 
       // 判断是否登录
       // 判断是否登录
       if(!this.$util.isEmpty(this.loginInfo.admin) && this.loginInfo.admin.currentShopId > 0){
       if(!this.$util.isEmpty(this.loginInfo.admin) && this.loginInfo.admin.currentShopId > 0){
@@ -598,7 +624,7 @@ export default {
             this.handleLoginStyle(this.loginInfo.onlyCg)
             this.handleLoginStyle(this.loginInfo.onlyCg)
           }
           }
 
 
-          this.getUnReadMsgCount()
+          // this.getUnReadMsgCount()
           this.showShopName()
           this.showShopName()
       }
       }
   },
   },
@@ -690,25 +716,24 @@ export default {
 			// #endif
 			// #endif
 		},
 		},
     init () {
     init () {
-        this.getGHSList()
-
-        // #ifdef MP-WEIXIN
-        this.isMini = 1
-        // #endif
+      this.getGHSList()
 
 
-        let that = this
-        consoleIndex({isMini:this.isMini}).then(res => {
-          this.data = res.data
-          this.lookMoney = res.data.lookMoney
-        })
+      // #ifdef MP-WEIXIN
+      this.isMini = 1
+      // #endif
+      
+      consoleIndex({isMini:this.isMini}).then(res => {
+        this.data = res.data
+        this.lookMoney = res.data.lookMoney
+      })
 
 
-        getStat().then(res=>{
-          if(res.code == 1){
-            that.overview = res.data.overview
-          }
-        })
-        this.showShopName()
-        this.getUnReadMsgCount()
+      getStat().then(res=>{
+        if(res.code == 1){
+          this.overview = res.data.overview
+        }
+      })
+      this.showShopName()
+      this.getUnReadMsgCount()
     },
     },
     handleLoginStyle(onlyCg){
     handleLoginStyle(onlyCg){
       if(Number(onlyCg) == 1){
       if(Number(onlyCg) == 1){
@@ -1134,7 +1159,7 @@ export default {
 .today-overview-card {
 .today-overview-card {
   background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
   background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
   padding: 0;
   padding: 0;
-  margin: 0 0 20upx 0;
+  margin: 0 0 -20upx 0;
   overflow: hidden;
   overflow: hidden;
   
   
   .today-header {
   .today-header {

+ 4 - 0
hdApp/src/api/custom/index.js

@@ -43,4 +43,8 @@ export const debtRecordList = data => {
 
 
 export const modifyBirthday = data => {
 export const modifyBirthday = data => {
 	return https.get('/custom/modify-birthday', data)
 	return https.get('/custom/modify-birthday', data)
+}
+
+export const getVisit = data => {
+	return https.get('/custom/get-visit', data)
 }
 }

+ 1 - 1
hdApp/src/pages.json

@@ -59,7 +59,7 @@
 				{"path": "debtChange","style": {"navigationBarTitleText": "欠款变动明细"}},
 				{"path": "debtChange","style": {"navigationBarTitleText": "欠款变动明细"}},
 				{"path": "rechargeChange","style": {"navigationBarTitleText": "充值记录"}},
 				{"path": "rechargeChange","style": {"navigationBarTitleText": "充值记录"}},
 				{"path": "levelChange","style": {"navigationBarTitleText": "等级变动记录"}},
 				{"path": "levelChange","style": {"navigationBarTitleText": "等级变动记录"}},
-				{"path": "visit","style": {"navigationBarTitleText": "等级变动记录"}}
+				{"path": "visit","style": {"navigationBarTitleText": "今日访客"}}
 			]
 			]
 		},
 		},
 		{
 		{