shish 4 лет назад
Родитель
Сommit
de26c794d8

+ 9 - 10
ghsApp/src/utils/util.js

@@ -4,18 +4,17 @@ import { getMiniAppUrl, isWxBrowser } from "@/utils/common";
 // 是否为空
 const isEmpty = val => {
 	if (val instanceof Array) {
-		if (val.length === 0) return true;
+		if (val.length === 0){
+			return true
+		}
 	} else if (val instanceof Object) {
-		if (!Object.keys(val).length) return true;
+		if (Object.keys(val).length == 0){
+			return true
+		}
 	} else {
-		if (
-			val === "null" ||
-			val === null ||
-			val === "undefined" ||
-			val === undefined ||
-			val === ""
-		)
-			return true;
+		if ( val === "null" || val === null || val === "undefined" || val === undefined || val === "" || JSON.stringify(val) == "[]"){
+			return true
+		}
 		return false;
 	}
 	return false;

+ 13 - 60
hdApp/src/admin/home/member.vue

@@ -2,70 +2,30 @@
   <div class="app-main app-content">
     <block v-if="!$util.isEmpty(list.data)">
       <block v-for="(item,index) in list.data" :key="index">
-        <tui-list-cell
-          :arrow="true"
-          @click="pageTo({
-					url: '/admin/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">
             <img :src="item.avatar" class="tui-msg-pic" mode="widthFix" />
             <div class="tui-msg-item">
-
               <div class="tui-msg-name">
                 <div class="tui-user-name">{{item.name}}</div>
-
                 <appVipModule class="level-img" :vipImg="`${constant.imgUrl}/retail/member/grade/member.png`" />
-
-                <!-- <appVipModule
-                  v-if="item.member > 0"
-                  class="level-img"
-                  :vipImg="`${constant.imgUrl}/retail/member/grade/${item.userAsset.member}.png`"
-                />
-                <template v-else>
-                  <appVipModule
-                    v-if="item.mobile == ''"
-                    class="level-img"
-                    :vipImg="`${constant.imgUrl}/retail/member/grade/customer.png`"
-                  />
-
-                  <appVipModule
-                    v-else
-                    class="level-img"
-                    :vipImg="`${constant.imgUrl}/retail/member/grade/member.png`"
-                  />
-                  
-                </template> -->
-
-
               </div>
-
               <div class="tui-msg-content">
                 <span>{{item.visitTime}}</span>
               </div>
             </div>
           </div>
-
           <div class="tui-msg-right">
-            <badge-module
-              type="danger"
-              :dot="item.level==3?true:false"
-              v-if="item.messageNum>0"
-            >{{item.messageNum}}</badge-module>
+            <badge-module type="danger" :dot="item.level==3?true:false" v-if="item.messageNum>0" >{{item.messageNum}}</badge-module>
           </div>
         </tui-list-cell>
       </block>
     </block>
     <block v-else>
-      <app-wrapper-empty :is-empty="$util.isEmpty(list.data)" />
+      <app-wrapper-empty :is-empty="true" />
     </block>
-    <!-- <kd-entrance></kd-entrance> -->
   </div>
 </template>
-
 <script>
 import AppTabs from "@/components/plugin/tabs";
 import TuiListCell from "@/components/plugin/list-cell";
@@ -74,7 +34,7 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import appVipModule from "@/components/module/app-vip";
 import AppTag from '@/components/module/app-tag.vue'
 import { list } from "@/mixins";
-import { getClass, getList } from "@/api/member";
+import { getList } from "@/api/member";
 export default {
   name: "admin-memebr",
   components: {
@@ -92,44 +52,38 @@ export default {
   },
   onPullDownRefresh() {
     this.resetList();
-    this._list().then(res => {
+    this.getOrderList().then(res => {
       uni.stopPullDownRefresh();
     });
   },
   onReachBottom() {
     if (!this.list.finished) {
-      this._list().then(res => {
+      this.getOrderList().then(res => {
         uni.stopPullDownRefresh();
       });
     } else {
       uni.stopPullDownRefresh();
     }
   },
-  onLoad(option) {
-    // this.init()
+  onLoad() {
   },
   methods: {
     init() {
-      this._list();      
+      this.getOrderList();      
     },
-    // 列表
-    _list() {
-      return getList({
-        search: "",
-        page: this.list.page,
-        ...this.form
-      }).then(res => {
-        this.completes(res)
+    getOrderList() {
+      return getList({ search: "", page: this.list.page, ...this.form }).then(res => {
+        if(res.code == 1){
+          this.completes(res)
+        }
       });
     },
-    // 跳转
     detail(item) {
       this.$util.pageTo("/admin/member/detail");
     }
   }
 };
 </script>
-
 <style lang="scss" scoped>
 .app-content {
   padding-top: 22upx;
@@ -146,7 +100,6 @@ export default {
     @include disFlex(center, center);
   }
 }
-// list
 .tui-msg-box {
   display: flex;
   align-items: center;

+ 14 - 118
hdApp/src/components/app-wrapper-empty.vue

@@ -1,72 +1,35 @@
 <template>
-	<div class="app-empty" :style="{'height: 100%;': !!isEmpty }">
-		<div class="app-empty-center" :style="{'text-align: center;': !!isEmpty}">
-			<slot v-if="!isEmpty" name="empty_body" />
-			<slot v-if="isEmpty && !isLoading" name="empty_content">
-				<div class="app-empty__img" :style="{width: pictureWidth}">
-					<img :src="src" mode="widthFix" />
-				</div>
-				<div class="app-empty__title">
-					<template v-if="isTitle">
-						<span :class="[type==='noData'?'empty_noData':'']">{{ title }}</span>
-						<span>{{ content }}</span>
-					</template>
-					<slot v-else name="empty_title"></slot>
-				</div>
-			</slot>
-			<slot v-else>
-				<div>
-					<div class="foot-layout" v-if="finished">
-						<div class="foot-text">{{finishedText}}</div>
-					</div>
-					<div class="foot-layout" v-if="isLoading">
-						<div class="foot-text">
-							<div class="loading"></div>加载中
-						</div>
-					</div>
-				</div>
-			</slot>
-			<slot name="footer" />
+	<div class="app-empty">
+		<div class="app-empty-center">
+			<div class="app-empty__img">
+				<image :src="`${this.$constant.imgUrl}/retail/common/img_nodata.png`" mode="widthFix"></image>
+			</div>
+			<div class="app-empty-title">
+				<span class="empty_noData">{{ title }}</span>
+			</div>
 		</div>
 	</div>
 </template>
-
 <script>
 export default {
 	name: 'AppWrapperEmpty',
 	props: {
-		/**
-			 * type()
-			 * search (搜索)
-			 * noData (无数据)
-			 */
 		type: {
 			type: String,
 			default: 'noData'
 		},
-
-		// 图片宽度
-		pictureWidth: {
-			type: String,
-			default: '400upx'
-		},
-
 		pictureHeight: {
 			type: String,
 			default: ''
 		},
-
 		title: {
 			type: String,
-			default: ''
+			default: '暂无数据'
 		},
-
-		// 是否垂直居中
 		content: {
 			type: String,
 			default: ''
 		},
-
 		isEmpty: {
 			type: Boolean,
 			default: false
@@ -79,63 +42,41 @@ export default {
 			type: Boolean,
 			default: false
 		},
-		finishedText: {
-			type: String,
-			default: '没有更多了'
-		},
 		isTitle: {
 			type: Boolean,
 			default: true
 		}
 	},
 	computed: {
-		src() {
-			if (this.img) {
-				return this.img
-			} else if (this.type == 'search') {
-				return `${this.$constant.imgUrl}/retail/common/img_noorder.png`
-			} else if (this.type == 'billing') {
-				return `${this.$constant.imgUrl}/ghs/common/img_nodata.png`
-			} else {
-				return `${this.$constant.imgUrl}/retail/common/img_nodata.png`
-			}
-		}
 	},
 	data() {
 		return {}
 	}
 }
 </script>
-
 <style lang="scss" scoped>
 	.app-empty {
 		width: 100%;
 		display: flex;
 		align-items: center;
-
 		& .app-empty-center {
 			width: 100%;
-			margin-bottom: 80upx;
 		}
-
 		& .app-empty__img {
 			width: 100%;
+			margin-top:100upx;
 			text-align: center;
-			margin: 116upx auto 50upx;
 			& image {
-				width: 500upx;
-				max-width: 100%;
-				height: auto;
+				margin:0 auto;
+				width: 180upx;
 			}
 		}
-
-		& .app-empty__title {
+		& .app-empty-title {
 			display: flex;
 			flex-direction: column;
 			align-items: center;
 			font-size: 32upx;
-			color: #666666;
-
+			color: #cccccc;
 			& span {
 				font-weight: 400;
 
@@ -150,49 +91,4 @@ export default {
 			}
 		}
 	}
-	.foot-divider {
-		height: 1px;
-		background-color: #dcdada;
-		width: 63upx;
-		margin: 0 22upx;
-	}
-
-	.foot-text {
-		font-size: 26upx;
-		color: #a1a1a1;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-	}
-
-	.foot-layout {
-		display: flex;
-		flex-direction: row;
-		justify-content: center;
-		align-items: center;
-		height: 115upx;
-	}
-
-	.loading {
-		display: inline-block;
-		margin-right: 12upx;
-		vertical-align: middle;
-		width: 14upx;
-		height: 14upx;
-		background: 0 0;
-		border-radius: 50%;
-		border: 2upx solid #e9eaec;
-		border-color: #e9eaec #e9eaec #e9eaec #f4a738;
-		animation: btn-spin 0.6s linear;
-		animation-iteration-count: infinite;
-	}
-
-	@keyframes btn-spin {
-		0% {
-			transform: rotate(0);
-		}
-		100% {
-			transform: rotate(360deg);
-		}
-	}
 </style>

+ 9 - 10
hdApp/src/utils/util.js

@@ -4,18 +4,17 @@ import { getMiniAppUrl, isWxBrowser } from "@/utils/common";
 // 是否为空
 const isEmpty = val => {
 	if (val instanceof Array) {
-		if (val.length === 0) return true;
+		if (val.length === 0){
+			return true
+		}
 	} else if (val instanceof Object) {
-		if (!Object.keys(val).length) return true;
+		if (Object.keys(val).length == 0){
+			return true
+		}
 	} else {
-		if (
-			val === "null" ||
-			val === null ||
-			val === "undefined" ||
-			val === undefined ||
-			val === ""
-		)
-			return true;
+		if ( val === "null" || val === null || val === "undefined" || val === undefined || val === "" || JSON.stringify(val) == "[]"){
+			return true
+		}
 		return false;
 	}
 	return false;