Kaynağa Gözat

新增-app查看商铺

linbl 1 yıl önce
ebeveyn
işleme
19f13da633
3 değiştirilmiş dosya ile 171 ekleme ve 1 silme
  1. 19 1
      pages.json
  2. 74 0
      pages/shop/detail.vue
  3. 78 0
      pages/shop/shop.vue

+ 19 - 1
pages.json

@@ -507,7 +507,25 @@
 			}
 
 		}
-	],
+	    ,{
+            "path" : "pages/shop/shop",
+            "style" :
+            {
+                "navigationBarTitleText": "商铺列表",
+                "enablePullDownRefresh": true
+            }
+
+        }
+        ,{
+            "path" : "pages/shop/detail",
+            "style" :
+            {
+                "navigationBarTitleText": "商铺详情",
+                "enablePullDownRefresh": false
+            }
+
+        }
+    ],
 	"tabBar": {
 		"color": "#7A7E83",
 		"selectedColor": "#4581fb",

+ 74 - 0
pages/shop/detail.vue

@@ -0,0 +1,74 @@
+<template>
+	<view>
+		<view class="cmain">
+			<view class="box order_detail">
+				<u-divider text="商铺信息"></u-divider>
+				<view class="item">
+					<text class="label">商铺编号</text>
+					<text class="desc">{{item.shopNo}}</text>
+				</view>
+				<view class="item">
+					<text class="label">商铺名称</text>
+					<text class="desc">{{item.shopName}}</text>
+				</view>
+				<view class="item">
+					<text class="label">铺主</text>
+					<text class="desc">{{item.ownerName}}</text>
+				</view>
+				<view class="item">
+					<text class="label">互市区</text>
+					<text class="desc">{{item.tradeAreaName}}</text>
+				</view>
+				<view class="item">
+					<text class="label">区域</text>
+					<text class="desc">{{item.area}}</text>
+				</view>
+				<view class="item">
+					<text class="label">经营范围</text>
+					<text class="desc">{{item.bnsScope}}</text>
+				</view>
+				<view class="item">
+					<text class="label">有效期</text>
+					<text class="desc">{{item.expiry}}</text>
+				</view>
+				<view class="item">
+					<text class="label">店铺地址</text>
+					<text class="desc">{{item.shopAddr}}</text>
+				</view>
+				<view class="item">
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				item: {}
+			}
+		},
+		onLoad(e) {
+			if(e.id) {
+				this.http.request({
+					url: '/level-one-server/app/TbShop/getDetailById',
+					data: { id: e.id },
+					success: res=> {
+						this.item = res.data.data;
+					}
+				})
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+
+<style lang="scss">
+	page {
+		background-color: $pg;
+	}
+</style>

+ 78 - 0
pages/shop/shop.vue

@@ -0,0 +1,78 @@
+<template>
+	<view>
+		<view class="goodsManageList">
+			<view class="item" v-for="(item, index) in list" :key="index" >
+				<view class="top">
+					<view class="title omit">{{ item.shopName }}</view>
+					<view class="state">
+						<text style="color: lightskyblue;font-weight: bold;" @click="detail(item.id)">详情></text>
+					</view>
+					<view class="clear"></view>
+				</view>
+				<view class="con">
+					<view style="float: left;margin-right: 10px;">铺主:{{item.ownerName}}</view>
+					<view style="">编号:{{item.shopNo}}</view>
+					<view class="tradeAreaName">{{ item.tradeAreaName }}</view>
+					<view class="date">区域:{{ item.area }}</view>
+				</view>
+				<view class="clear"></view>
+			</view>
+			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+			<u-empty v-if="!loadMore && list.length == 0"></u-empty>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				list: [],
+				loadMore: true,
+				param: { pageNo: 1, pageSize: 10 },
+			}
+		},
+		onLoad() {
+			this.getData();
+		},
+		methods: {
+			getData() {
+				this.http.request({
+					url: '/level-one-server/app/TbShop/getAppList',
+					success: res=> {
+						this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
+						this.list.push(...res.data.data);
+					}
+				})
+			},
+			detail(id) {
+				uni.navigateTo({ url: '/pages/shop/detail?id=' + id });
+			},
+			//刷新数据
+			refresh() {
+				this.loadMore = true;
+				this.param.pageNo = 1;
+				this.list = [];
+				this.getData();
+			}
+		},
+		//下拉刷新
+		onPullDownRefresh() {
+			setTimeout(() => {
+				this.refresh();
+				uni.stopPullDownRefresh();
+			}, 1000);
+		},
+		//上拉加载
+		onReachBottom() {
+			if (this.loadMore) {
+				this.param.pageNo++;
+				this.getData();
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>