Browse Source

供货商

shish 5 năm trước cách đây
mục cha
commit
c3e67b9e86
1 tập tin đã thay đổi với 63 bổ sung45 xóa
  1. 63 45
      ghsApp/src/admin/ghs/shop.vue

+ 63 - 45
ghsApp/src/admin/ghs/shop.vue

@@ -1,3 +1,65 @@
+<template>
+	<div class="app-content">
+		<view class="list-box">
+			<view v-if="!$util.isEmpty(list.data)">
+				<view class="flex list" v-for="(item, index) in list.data" :key="index">
+						<image :src="item.img"></image>
+					<view class="list-msg">
+							<view>{{item.name}}</view>
+							<text>累积消费 {{item.expendAmount}}</text>
+					</view>
+				</view>
+			</view>
+			<block v-else>
+				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+			</block>
+		</view>
+	</div>
+</template>
+<script>
+	import { getList } from "@/api/ghs"
+	import AppWrapperEmpty from '@/components/app-wrapper-empty'
+	import { list } from '@/mixins'
+	export default {
+		components: {AppWrapperEmpty,},
+		name: 'ghs-shop',
+		mixins: [list],
+		data() {
+			return {
+			}
+		},
+		onLoad() {
+		},
+		onShow() {
+
+		},
+		onPullDownRefresh() {
+			this.resetList()
+			this._list().then(res => {
+				uni.stopPullDownRefresh()
+			})
+		},
+		onReachBottom() {
+			if (!this.list.finished) {
+				this._list().then(res => {
+					uni.stopPullDownRefresh()
+				})
+			} else {
+				uni.stopPullDownRefresh()
+			}
+		},
+		methods: {
+			async init() {
+				this._list()
+			},
+			_list(){
+				return getList({ type: 0 }).then(res => {
+					this.completes(res)
+				});
+			}
+		}
+	}
+</script>
 <style lang="scss" scoped>
 	.app-content{
 		.flex{display: flex;align-items: center;}
@@ -33,48 +95,4 @@
 			}
 		}
 	}
-</style>
-<template>
-	<div class="app-content">
-			<view class="list-box">
-				<view class="flex list" v-if="list.length>0" v-for="res in list">
-						<image :src="res.img"></image>
-					<view class="list-msg">
-							<view>{{res.name}}</view>
-							<text>累积消费{{res.money}}</text>
-					</view>
-				</view>
-				<block v-else>
-					<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
-				</block>
-			</view>
-	</div>
-</template>
-
-<script>
-	import { getList } from "@/api/ghs";
-	import AppWrapperEmpty from '@/components/app-wrapper-empty'
-	export default {
-		components: {AppWrapperEmpty,},
-		name: 'ghs-shop',
-		data() {
-			return {
-				list:[],
-			}
-		},
-		onLoad() {
-		},
-		onShow() {
-			this._getList();
-		},
-		methods: {
-			_getList(){
-				getList({ type: 0 }).then(res => {
-					this.list = res
-				});
-			},
-		}
-	}
-</script>
-
-
+</style>