Kaynağa Gözat

订单管理优化,商品列表、查询接口完成

ltx529596 4 yıl önce
ebeveyn
işleme
d696f69ed3

+ 2 - 1
src/pages.json

@@ -79,7 +79,8 @@
       "style": {
         "navigationBarTitleText": "商品管理",
         "navigationBarTextStyle": "black",
-        "navigationBarBackgroundColor":"#ffffff"
+        "navigationBarBackgroundColor":"#ffffff",
+        "enablePullDownRefresh": true
       }
     },
 		{

+ 0 - 4
src/pages/index/index.vue

@@ -518,10 +518,6 @@ export default {
         });
     },
 
-   
-
-   
-
     // 商品销售走势
     async shopSellTrend() {
       if (this.shopID === 0) {

+ 60 - 181
src/pages/order/order.vue

@@ -9,7 +9,7 @@
             placeholder-style="color:#a3a8a8;font-size:10px;"
             placeholder="请输入订单号或手机号"
             class="cellphone"
-            v-model="orderbynumber"
+            v-model="params.buyPhone"
           />
           <text class="txt" @tap="orderByNum">搜索</text>
         </view>
@@ -199,8 +199,6 @@ export default {
       isactive: 1,
       more: 'loading', // more  loading noMore
 
-      isByQuery: 'pay', // 定义一个按照上面条件查询订单的类型  phone:手机号或订单号  time: 时间  shop: 商品  pay: 支付
-
       date: moment().format('YYYY-MM-DD'),
       yesdate: moment().subtract(1, 'day').format('YYYY-MM-DD'),
       dateArr: [],
@@ -219,12 +217,23 @@ export default {
       orderbyphone: '',
       orderbytime: [],
       orderbyshop: '',
+
+      soleStatus: 1, // 触底状态
+
+      params: {
+        orderFlag: 'pay',
+        pageNum: 1,
+        pageSize: 10,
+        ordersNo: '',
+        buyPhone: '',
+        shopId: '',
+        overTimeArray:[]
+      },
     };
   },
 
   // 下拉刷新page.json中要配置
   onPullDownRefresh() {
-    this.isByQuery = 'pay';
     this.startdate = '';
     this.enddate = '';
     this.sunday = 0;
@@ -235,15 +244,11 @@ export default {
   },
   // 页面触底加载
   onReachBottom() {
-    this.more = 'more';
-    if (this.isByQuery === 'pay') {
+    if (this.soleStatus === 1) {
+      if (this.more === 'noMore') {
+        return;
+      }
       this.loadMoreList();
-    } else if (this.isByQuery === 'time') {
-      this.getByTimeOrderMore();
-    } else if (this.isByQuery === 'shop') {
-      this.getByShopIdMore();
-    } else if (this.isByQuery === 'phone') {
-      this.getByPhoneMore()
     }
   },
   onLoad() {
@@ -263,179 +268,56 @@ export default {
             18716571247
     */
 
+    // 打开日历
     openTime() {
       this.$refs.calendar.open();
     },
     // 确认时间后
     confirm(e) {
+      this.more = 'loading'
       this.loading = true;
-      this.orderList = [];
+
       this.startdate = e.range.before;
       this.enddate = e.range.after;
       this.sunday = e.range.data.length;
-      this.dateArr.push(this.startdate, this.enddate);
+      
+      this.params.overTimeArray.push(this.startdate, this.enddate);
 
-      this.$http
-        .post('/orders/proList', {
-          orderFlag: this.orderFlag,
-          pageNum: this.pageNum,
-          pageSize: this.pageSize,
-          overTimeArray: this.dateArr,
-        })
-        .then((res) => {
-          if (res.data.list.length > 0) {
-            this.orderList = res.data.list;
-            if (res.data.nextPage === 0) {
-              this.more = 'noMore';
-            }
-          } else {
-            this.$mHelper.toast('该时间段内无订单信息');
-            this.more = 'noMore';
-          }
-          this.loading = false;
-        });
-    },
-    // 按照时间查询更多
-    getByTimeOrderMore() {
-      this.pageNum++;
-      this.$http
-        .post('/orders/proList', {
-          orderFlag: this.orderFlag,
-          pageNum: this.pageNum,
-          pageSize: this.pageSize,
-          overTimeArray: this.dateArr,
-        })
-        .then((res) => {
-          console.log(res);
-          if (res.data.list.length != 0) {
-            if (this.pages <= res.data.pages) {
-              this.orderList = this.orderList.concat(res.data.list);
-            }
-          } else if (res.data.list.length === 0) {
-            this.more = 'noMore';
-          }
-          this.loading = false;
-        });
+      this.getOrderList()
+      
     },
-
+   
     // 根据订单号或者手机号查询
     orderByNum() {
-      this.isByQuery = 'phone';
-      this.orderList = []
-      let num = '';
-      const pattern = /^1[345678]\d{9}$/;
-      if (pattern.test(this.orderbynumber)) {
-        num = this.orderbynumber;
-        this.orderbyphone = num;
-        this.orderbynumber = '';
-      } else {
-        this.orderbyphone = '';
-      }
-      this.$http
-        .post('/orders/proList', {
-          orderFlag: this.orderFlag,
-          pageNum: this.pageNum,
-          pageSize: this.pageSize,
-          buyPhone: this.orderbyphone,
-          ordersNo: this.orderbynumber,
-        })
-        .then((res) => {
-          console.log(res);
-          if (res.data.list.length > 0) {
-            this.orderList = res.data.list;
-          } else {
-            this.orderList = [];
-            this.more = 'noMore';
-            this.$mHelper.toast('当前未查询到相关订单!');
-          }
-        })
-        .catch((error) => {
-          this.$mHelper.toast('请输入有效的手机号或者订单号');
-        });
-    },
-    getByPhoneMore() {
-      this.pageNum++;
+      this.more = 'loading';
       let num = '';
       const pattern = /^1[345678]\d{9}$/;
-      if (pattern.test(this.orderbynumber)) {
-        num = this.orderbynumber;
-        this.orderbyphone = num;
-        this.orderbynumber = '';
+      if (pattern.test(this.params.buyPhone)) {
+        num = this.params.buyPhone;
+        this.params.buyPhone = num;
+        this.params.ordersNo = '';
+        this.getOrderList();
       } else {
-        this.orderbyphone = '';
+        this.params.buyPhone = '';
+        this.getOrderList();
       }
-      this.$http
-        .post('/orders/proList', {
-          orderFlag: this.orderFlag,
-          pageNum: this.pageNum,
-          pageSize: this.pageSize,
-          buyPhone: this.orderbyphone,
-          ordersNo: this.orderbynumber,
-        })
-        .then(async (res) => {
-          if (res.data.list.length != 0) {
-            if (this.pages <= res.data.pages) {
-              this.orderList = this.orderList.concat(res.data.list);
-            }
-          } else if (res.data.list.length === 0) {
-            this.more = 'noMore';
-          }
-        });
     },
+
     // 商铺选择
     bindPickerChange(e) {
-      this.isByQuery = 'shop';
-      this.loading = true;
-      this.orderList = [];
-      this.shopID = null;
+      this.more = 'loading';
       this.index = e.detail.value;
-      this.shopID = this.shopArray[this.index].id;
-      this.$http
-        .post('/orders/proList', {
-          orderFlag: this.orderFlag,
-          pageNum: this.pageNum,
-          pageSize: this.pageSize,
-          shopId: this.shopID,
-        })
-        .then((res) => {
-          if (res.data.list.length > 0) {
-            this.orderList = res.data.list;
-          } else {
-            this.$mHelper.toast('该店铺暂无订单');
-            this.more = 'noMore';
-          }
-          this.loading = false;
-        });
-    },
-    // 根据店铺查询更多订单
-    getByShopIdMore() {
-      this.pageNum++;
-      this.$http
-        .post('/orders/proList', {
-          orderFlag: this.orderFlag,
-          pageNum: this.pageNum,
-          pageSize: this.pageSize,
-          shopId: this.shopID,
-        })
-        .then(async (res) => {
-          if (res.data.list.length != 0) {
-            if (this.pages <= res.data.pages) {
-              this.orderList = this.orderList.concat(res.data.list);
-            }
-          } else if (res.data.list.length === 0) {
-            this.more = 'noMore';
-          }
-        });
+      this.params.shopId = this.shopArray[this.index].id;
+      this.getOrderList();
     },
 
     // tab
     changeTab(type, falg) {
-      this.isByQuery = 'pay';
-      this.index = 0
+      this.more = 'loading';
+      this.params.pageNum = 1;
       this.isactive = type;
-      this.orderFlag = falg;
+      this.params.orderFlag = falg;
       this.getOrderList();
-      console.log(this.orderFlag);
     },
     // 跳转详情
     todetail() {
@@ -452,42 +334,39 @@ export default {
     },
     // 订单列表
     async getOrderList() {
+      this.soleStatus = 1;
+      this.orderList = [];
       this.loading = true;
-      this.isByQuery = 'pay';
-      let listarr = [];
       await this.$http
-        .post('/orders/proList', {
-          pageNum: this.pageNum,
-          pageSize: this.pageSize,
-          orderFlag: this.orderFlag,
-        })
+        .post('/orders/proList', this.params)
         .then(async (res) => {
           console.log(res);
-          if (res.data) {
-            listarr = res.data.list;
-            this.orderList = listarr;
-            this.pages = res.data.pages;
-            this.pageTotal = res.data.total;
-            this.loading = false;
+          if (res.data.list.length > 0) {
+            this.orderList = res.data.list;
+            if (res.data.nextPage === 0) {
+              this.more = 'noMore';
+            }
+          } else {
+            this.more = 'noMore';
           }
+          this.loading = false;
         });
     },
     // 上拉加载
     async loadMoreList() {
-      this.pageNum++;
+      this.params.pageNum++;
       await this.$http
-        .post('/orders/proList', {
-          pageNum: this.pageNum,
-          pageSize: this.pageSize,
-          orderFlag: this.orderFlag,
-        })
+        .post('/orders/proList', this.params)
         .then(async (res) => {
-          if (res.data.list.length != 0) {
-            if (this.pages <= res.data.pages) {
-              this.orderList = this.orderList.concat(res.data.list);
+          console.log(res);
+          if (res.data.list.length > 0) {
+            this.orderList = this.orderList.concat(res.data.list);
+            if (res.data.nextPage === 0) {
+              this.more = 'noMore';
             }
-          } else if (res.data.list.length === 0) {
+          } else {
             this.more = 'noMore';
+            return;
           }
         });
     },

+ 551 - 383
src/pages/shop/shop.vue

@@ -1,398 +1,566 @@
 <!-- shop -->
 <template>
-	<view class="shop">
-		<view class="header-warp">
-			<view class="header-search">
-				<view class="uni-list-cell">
-					<view class="uni-list-cell-db">
-						<picker @change="bindPickerChange" :value="index" :range="array">
-							<view class="uni-input">{{ array[index] }}</view>
-						</picker>
-						<image src="../../static/images/garydownicon.png" mode="" class="icon"></image>
-					</view>
-				</view>
-				<view class="search">
-					<input type="text" placeholder-style="color:#a3a8a8;font-size:10px;" placeholder="请输入商品名称" class="cellphone" />
-					<text class="txt">搜索</text>
-				</view>
-				<view class="btn-time">
-					<image src="../../static/images/addicon.png" class="timeicon"></image>
-				</view>
-			</view>
-			<view class="header-bar">
-				<view class="item" @tap="changeTab(1)" :class="{ active: isactive === 1 }">
-					<view class="ordertype">待上架</view>
-					<view class="heng"></view>
-				</view>
-				<view class="item" @tap="changeTab(2)" :class="{ active: isactive === 2 }">
-					<view class="ordertype">已上架</view>
-					<view class="heng"></view>
-				</view>
-				<view class="item" @tap="changeTab(3)" :class="{ active: isactive === 3 }">
-					<view class="ordertype">已下架</view>
-					<view class="heng"></view>
-				</view>
-				<view class="line"></view>
-			</view>
-		</view>
-		<view style="height: 192upx;"></view>
-		<view class="order-content" v-if="isactive === 1">
-			<view class="order-list">
-				<view class="order-title">
-					<text class="ordernum">仙女山成人票</text>
-				</view>
-				<view class="order-detail">
-
-					<view class="left">
-						<image src="" mode="" class="img"></image>
-					</view>
-
-					<view class="center">
-						<view class="shop-detail door">所属店铺:仙女山</view>
-						<view class="shop-detail type">类型:门票</view>
-						<view class="shop-detail putaway">上下架状态:已下架状态</view>
-						<view class="shop-detail status">状态:审核通过</view>
-					</view>
-
-					<view class="right">¥<text class="price">180</text></view>
-
-				</view>
-				<view class="operate">
-					<view class="btn stick" id="one" @tap="sticktop($event)">置顶</view>
-					<view class="btn sold">下架</view>
-					<view class="btn compile" @tap="topage">编辑</view>
-					<view class="btn delete">删除</view>
-				</view>
-			</view>
-			<view class="order-list">
-				<view class="order-title">
-					<text class="ordernum">仙女山成人票</text>
-				</view>
-				<view class="order-detail">
-
-					<view class="left">
-						<image src="" mode="" class="img"></image>
-					</view>
-
-					<view class="center">
-						<view class="shop-detail door">所属店铺:仙女山</view>
-						<view class="shop-detail type">类型:门票</view>
-						<view class="shop-detail putaway">上下架状态:已下架状态</view>
-						<view class="shop-detail status">状态:审核通过</view>
-					</view>
-
-					<view class="right">¥<text class="price">180</text></view>
-
-				</view>
-				<view class="operate">
-					<view class="btn stick" @tap="sticktop($event)">置顶</view>
-					<view class="btn sold">下架</view>
-					<view class="btn compile" @tap="topage">编辑</view>
-					<view class="btn delete">删除</view>
-				</view>
-			</view>
-			<view class="order-list">
-				<view class="order-title">
-					<text class="ordernum">仙女山成人票</text>
-				</view>
-				<view class="order-detail">
-
-					<view class="left">
-						<image src="" mode="" class="img"></image>
-					</view>
-
-					<view class="center">
-						<view class="shop-detail door">所属店铺:仙女山</view>
-						<view class="shop-detail type">类型:门票</view>
-						<view class="shop-detail putaway">上下架状态:已下架状态</view>
-						<view class="shop-detail status">状态:审核通过</view>
-					</view>
-
-					<view class="right">¥<text class="price">180</text></view>
-
-				</view>
-				<view class="operate">
-					<view class="btn stick" @tap="sticktop($event)">置顶</view>
-					<view class="btn sold">下架</view>
-					<view class="btn compile" @tap="topage">编辑</view>
-					<view class="btn delete">删除</view>
-				</view>
-			</view>
-			<view class="order-list">
-				<view class="order-title">
-					<text class="ordernum">仙女山成人票</text>
-				</view>
-				<view class="order-detail">
-
-					<view class="left">
-						<image src="" mode="" class="img"></image>
-					</view>
-
-					<view class="center">
-						<view class="shop-detail door">所属店铺:仙女山</view>
-						<view class="shop-detail type">类型:门票</view>
-						<view class="shop-detail putaway">上下架状态:已下架状态</view>
-						<view class="shop-detail status">状态:审核通过</view>
-					</view>
-
-					<view class="right">¥<text class="price">180</text></view>
-
-				</view>
-				<view class="operate">
-					<view class="btn stick" @tap="sticktop($event)">置顶</view>
-					<view class="btn sold">下架</view>
-					<view class="btn compile" @tap="topage">编辑</view>
-					<view class="btn delete">删除</view>
-				</view>
-			</view>
-		</view>
-	</view>
+  <view class="shop">
+    <view class="header-warp">
+      <view class="header-search">
+        <view class="uni-list-cell">
+          <view class="uni-list-cell-db">
+            <picker
+              @change="bindPickerChange"
+              :value="index"
+              :range="shopArray"
+              range-key="name"
+            >
+              <view class="uni-input">{{ shopArray[index].name }}</view>
+            </picker>
+            <image
+              src="../../static/images/garydownicon.png"
+              mode=""
+              class="icon"
+            ></image>
+          </view>
+        </view>
+        <view class="search">
+          <input
+            type="text"
+            placeholder-style="color:#a3a8a8;font-size:10px;"
+            placeholder="请输入商品名称"
+            class="cellphone"
+						v-model="params.name"
+          />
+          <text class="txt" @tap="searchByname">搜索</text>
+        </view>
+        <view class="btn-time">
+          <image src="../../static/images/addicon.png" class="timeicon" @tap="addShop"></image>
+        </view>
+      </view>
+      <view class="header-bar">
+        <view
+          class="item"
+          @tap="changeTabByStatus(1, '1')"
+          :class="{ active: isactive === 1 }"
+        >
+          <view class="ordertype">待审核</view>
+          <view class="heng"></view>
+        </view>
+        <view
+          class="item"
+          @tap="changeTab(2, '1')"
+          :class="{ active: isactive === 2 }"
+        >
+          <view class="ordertype">已上架</view>
+          <view class="heng"></view>
+        </view>
+        <view
+          class="item"
+          @tap="changeTab(3, '0')"
+          :class="{ active: isactive === 3 }"
+        >
+          <view class="ordertype">已下架</view>
+          <view class="heng"></view>
+        </view>
+        <view class="line"></view>
+      </view>
+    </view>
+    <view style="height: 192upx;"></view>
+    <view class="order-content" v-if="isactive === 1">
+      <view class="order-list" v-for="(item, index) in shoplist" :key="index">
+        <view class="order-title">
+          <text class="ordernum">{{ item.name }}</text>
+        </view>
+        <view class="order-detail">
+          <view class="left">
+            <image :src="item.icon" class="img"></image>
+          </view>
+          <view class="center">
+            <view class="shop-detail door">所属店铺:{{ item.shopName }}</view>
+            <view class="shop-detail type">类型:{{ item.typeName }}</view>
+            <view class="shop-detail putaway"
+              >上下架状态:{{ item.upDown | putaway }}</view
+            >
+            <view class="shop-detail status"
+              >状态:{{ item.status | state }}</view
+            >
+          </view>
+
+          <view class="right"
+            >¥<text class="price">{{ item.price }}</text></view
+          >
+        </view>
+        <view class="operate">
+          <view class="btn stick" id="one" @tap="sticktop($event)">置顶</view>
+          <view class="btn sold">下架</view>
+          <view class="btn compile" @tap="topage">编辑</view>
+          <view class="btn delete">删除</view>
+        </view>
+      </view>
+    </view>
+    <view class="order-content" v-if="isactive === 2">
+      <view class="order-list" v-for="(item, index) in shoplist" :key="index">
+        <view class="order-title">
+          <text class="ordernum">{{ item.name }}</text>
+        </view>
+        <view class="order-detail">
+          <view class="left">
+            <image :src="item.icon" class="img"></image>
+          </view>
+          <view class="center">
+            <view class="shop-detail door">所属店铺:{{ item.shopName }}</view>
+            <view class="shop-detail type">类型:{{ item.typeName }}</view>
+            <view class="shop-detail putaway"
+              >上下架状态:{{ item.upDown | putaway }}</view
+            >
+            <view class="shop-detail status"
+              >状态:{{ item.status | state }}</view
+            >
+          </view>
+
+          <view class="right"
+            >¥<text class="price">{{ item.price }}</text></view
+          >
+        </view>
+        <view class="operate">
+          <view class="btn stick" id="one" @tap="sticktop($event)">置顶</view>
+          <view class="btn sold">下架</view>
+          <view class="btn compile" @tap="topage">编辑</view>
+          <view class="btn delete">删除</view>
+        </view>
+      </view>
+    </view>
+    <view class="order-content" v-if="isactive === 3">
+      <view class="order-list" v-for="(item, index) in shoplist" :key="index">
+        <view class="order-title">
+          <text class="ordernum">{{ item.name }}</text>
+        </view>
+        <view class="order-detail">
+          <view class="left">
+            <image :src="item.icon" class="img"></image>
+          </view>
+          <view class="center">
+            <view class="shop-detail door">所属店铺:{{ item.shopName }}</view>
+            <view class="shop-detail type">类型:{{ item.typeName }}</view>
+            <view class="shop-detail putaway"
+              >上下架状态:{{ item.upDown | putaway }}</view
+            >
+            <view class="shop-detail status"
+              >状态:{{ item.status | state }}</view
+            >
+          </view>
+
+          <view class="right"
+            >¥<text class="price">{{ item.price }}</text></view
+          >
+        </view>
+        <view class="operate">
+          <view class="btn stick" id="one" @tap="sticktop($event)">置顶</view>
+          <view class="btn sold">下架</view>
+          <view class="btn compile" @tap="topage">编辑</view>
+          <view class="btn delete">删除</view>
+        </view>
+      </view>
+    </view>
+
+    <uni-load-more :status="more"> </uni-load-more>
+    <rf-loading v-if="loading"></rf-loading>
+  </view>
 </template>
 
 <script>
-	export default {
-		name: 'order',
-		components: {},
-		data() {
-			//这里存放数据
-			return {
-				array: ['门店', '美国', '巴西', '日本'],
-				index: 0,
-				isactive: 1,
-			};
-		},
-		//方法集合
-		methods: {
-			bindPickerChange: function(e) {
-				console.log('picker发送选择改变,携带值为', e.target.value);
-				this.index = e.target.value;
-			},
-
-			// tab
-			changeTab(type) {
-				this.isactive = type;
-			},
-
-			// 置顶
-			sticktop(e) {
-				console.log(e.target);
-
-			},
-
-			// 跳转详情
-			topage() {
-				console.log(1);
-				this.$mRouter.push({
-					route: '/pages/shop/shopdetail'
-				})
-			}
-		},
-	};
-</script>
-<style lang="scss" scoped>
-	.shop {
-		background-color: #f4f4f4;
-
-		.header-warp {
-			width: 100%;
-			background-color: #fff;
-			padding: 15upx 33upx 0;
-			position: fixed;
-			z-index: 99;
-
-			.header-search {
-				display: flex;
-				align-items: center;
-
-				.uni-list-cell {
-					width: 92upx;
-
-					.uni-list-cell-db {
-						height: 80upx;
-						font-size: 28upx;
-						display: flex;
-						justify-content: center;
-						align-items: center;
-						background-color: #fff;
-						color: #8f8f8f;
-
-						.icon {
-							width: 17upx;
-							height: 12upx;
-							margin-left: 10upx;
-						}
-					}
-				}
-
-				.search {
-					flex: 1;
-					display: flex;
-					align-items: center;
-					height: 80upx;
-					margin-left: 20upx;
-					background-color: #f7f7f7;
-					border-radius: 10upx;
-
-					.cellphone {
-						flex: 1;
-						height: 100%;
-						color: $titleColor;
-						padding-left: 20upx;
-					}
-
-					.search-holder {
-						color: #f00;
-					}
-
-					.txt {
-						height: 72upx;
-						width: 90upx;
-						text-align: center;
-						line-height: 72upx;
-						color: #a95cff;
-						font-size: 28upx;
-					}
-				}
-
-				.btn-time {
-					margin-left: 20upx;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-					.timeicon {
-						width: 48upx;
-						height: 48upx;
-					}
-
-				}
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+export default {
+  name: 'order',
+  components: { uniLoadMore },
+  data() {
+    //这里存放数据
+    return {
+      scenicID: 0, // 景区id 唯一(一个账号代表一个景区)
+      loading: false,
+      more: 'loading', // more  loading noMore
+      shopArray: [{ name: '全部', id: 0 }],
+      shopID: 0,
+      index: 0,
+
+			isactive: 1,
+			soleStatus: 1,  // 触底状态
+
+      shoplist: [],
+
+      // 列表参数
+      pagenum: 1,
+			pagesize: 10,
+      putAwat: '1', // 已上架1;已下架0
+      status: '1', // 待审核:1,审核通过:2,审核未通过:3
+			params: {
+				pageNum: 1,
+				pageSize: 10,
+				mid: 0,   // 景区id
+				status: '1',  // 审核状态
+				upDown: '',   // 上下架状态
+				shopId: '',   // 商铺id 选择框
+				name: ''
 			}
-
-			.header-bar {
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				position: relative;
-
-				.item {
-					position: relative;
-					width: 33.33%;
-					height: 99upx;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-					flex-direction: column;
-
-					.ordertype {
-						position: relative;
-						font-size: 30upx;
-						letter-spacing: 3upx;
-						color: #7a7c7c;
-					}
-
-					.heng {
-						position: absolute;
-						display: none;
-						bottom: 0;
-						width: 40upx;
-						height: 6upx;
-						border-radius: 4upx;
-						background-color: #a95cff;
-					}
-				}
-
-				.active .ordertype {
-					color: #a95cff;
-				}
-
-				.active .heng {
-					display: block;
-				}
+    };
+  },
+  filters: {
+    putaway(val) {
+      if (val === '0') {
+        return '已下架';
+      } else if (val === '1') {
+        return '已上架';
+      }
+    },
+    state(val) {
+      if (val === '1') {
+        return '待审核';
+      } else if (val === '2') {
+        return '审核通过';
+      } else if (val === '3') {
+        return '审核未通过';
+      }
+    },
+  },
+  // 下拉刷新
+  onPullDownRefresh() {},
+  // 上拉加载
+	onReachBottom() {
+		if (this.soleStatus === 1) {
+			if (this.more === 'noMore') {
+				return
 			}
+			this.getMoreByStatus()
 		}
-
-		.order-content {
-			padding: 24upx 32upx 0;
-
-			.order-list {
-				background-color: #fff;
-				border-radius: 10upx;
-				padding: 30upx 24upx 33upx;
-				margin-bottom: 24upx;
-
-				.order-title {
-					border-bottom: 1px solid $bordrColor;
-					display: flex;
-					justify-content: space-between;
-					align-items: center;
-					padding-bottom: 22upx;
-
-					.ordernum {
-						font-size: 34upx;
-						color: $titleColor;
-					}
-
+	},
+	
+  onLoad() {
+    this.getShopList();
+    this.getShopMessage();
+  },
+  //方法集合
+  methods: {
+		// 新增商品
+		addShop(){
+			this.$mRouter.push({route: '/pages/shop/shopdetail'})
+		},
+		// 根据名字搜索
+		searchByname() {
+			this.params.pageNum =1
+			this.getTicketShopList()
+			console.log(this.params.name);
+		},
+    // 选择商铺
+    bindPickerChange(e) {
+			this.params.pageNum = 1
+      this.shopID = null;
+      this.index = e.detail.value;
+			this.params.shopId= this.shopArray[this.index].id;
+			console.log(this.params.shopId);
+			this.getTicketShopList()
+    },
+    // 获取店铺列表
+    async getShopList() {
+      await this.$http.get('/homePage/getShopByMerId').then((res) => {
+        if (res.data && res.code === 200) {
+          let newarr = [{ name: '全部', id: 0 }];
+          this.shopArray = newarr.concat(res.data);
+        }
+      });
+    },
+    // 商家信息
+    async getShopMessage() {
+      await this.$http.get('/getUserInfo').then(async (res) => {
+				if (res.data) {
+					this.params.mid = res.data.id;
+					this.getTicketShopList()
 				}
+      });
+		},
+		// 待审核tab切换
+		changeTabByStatus(type, status) {
+			this.shoplist = []
+			this.params.pageNum = 1
+			this.isactive = type
+			this.params.status = status
+			delete this.params.upDown
+			this.getTicketShopList()
+		},
+    // tab
+    changeTab(type,putaway) {
+      this.more = 'noMore'
+			this.params.pageNum = 1
+			this.isactive = type;
+			this.params.upDown = putaway
+			delete this.params.status
+			this.getTicketShopList()
+    },
+    // 置顶
+    sticktop(e) {
+      console.log(e.target);
+    },
+    // 跳转详情
+    topage() {
+      console.log(1);
+      this.$mRouter.push({
+        route: '/pages/shop/shopdetail',
+      });
+    },
+    // 商品列表(待审核状态)
+    async getTicketShopList() {
+			this.soleStatus = 1
+			this.shoplist = []
+
+			// 判断tab切换的条件
+			if (this.params.upDown === '1' || this.params.upDown === '0') {
+				delete this.params.status
+			} else {
+				delete this.params.upDown
+			}
 
-				.order-detail {
-					margin-top: 24upx;
-					display: flex;
-					justify-content: center;
-					.left{
-						.img{
-							width: 120upx;
-							height: 120upx;
-							border-radius: 5upx;
-							background-color: pink;
+      await this.$http
+        .get('/goods/list', this.params)
+        .then((res) => {
+					console.log(res);
+          if (res.data.list.length > 0) {
+						this.shoplist = res.data.list;
+						console.log(this.shoplist);
+						if (res.data.nextPage === 0) {
+							this.more = 'noMore'
 						}
+          } else {
+						this.more ='noMore'
 					}
-					.center {
-						width: 370upx;
-						margin-left: 25upx;
-						.shop-detail {
-							font-size: 26upx;
-							color: #7a7a7a;
-							margin-top: 7upx;
-							&:first-child{
-								margin-top: 0;
-							}
-						}
-					}
-					.right{
-						flex: 1;
-						color: #ff6a5e;
-						.price{
-							font-size: 30upx;
+        });
+    },
+    // 更多(待审核状态)
+    async getMoreByStatus() {
+			this.params.pageNum++;
+			let listArr =[]
+				// 判断tab切换的条件
+			if (this.params.upDown === '1' || this.params.upDown === '0') {
+				delete this.params.status
+			} else {
+				delete this.params.upDown
+			}
+      await this.$http
+        .get('/goods/list', this.params)
+        .then((res) => {
+					console.log(res);
+          if (res.data.list.length > 0) {
+						listArr = res.data.list
+						this.shoplist = this.shoplist.concat(listArr)
+						if (res.data.nextPage === 0) {
+							this.more = 'noMore'
 						}
+          } else {
+						this.more = 'noMore'
+						return
 					}
-				}
-
-				.operate {
-					border-top: 1px solid #e7e7e7;
-					padding-top: 24upx;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-					margin-top: 10upx;
-					.btn {
-						width: 160upx;
-						height: 58upx;
-						border: 1upx solid #7a7c7c;
-						border-radius: 6upx;
-						margin-right: 22upx;
-						text-align: center;
-						line-height: 58upx;
-						font-size: 28upx;
-						color: #7a7c7c;
-						letter-spacing: 3upx;
-					}
-					.delete {
-						margin-right: 0;
-						background-color: #ff6a5e;
-						color: #FFFFFF;
-						border: none;
-					}
-				}
-			}
-		}
-	}
+        });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.shop {
+  background-color: #f4f4f4;
+
+  .header-warp {
+    width: 100%;
+    background-color: #fff;
+    padding: 15upx 33upx 0;
+    position: fixed;
+    z-index: 99;
+
+    .header-search {
+      display: flex;
+      align-items: center;
+
+      .uni-list-cell {
+        width: 92upx;
+
+        .uni-list-cell-db {
+          height: 80upx;
+          font-size: 28upx;
+          display: flex;
+          justify-content: center;
+          align-items: center;
+          background-color: #fff;
+          color: #8f8f8f;
+
+          .icon {
+            width: 17upx;
+            height: 12upx;
+            margin-left: 10upx;
+          }
+        }
+      }
+
+      .search {
+        flex: 1;
+        display: flex;
+        align-items: center;
+        height: 80upx;
+        margin-left: 20upx;
+        background-color: #f7f7f7;
+        border-radius: 10upx;
+
+        .cellphone {
+          flex: 1;
+          height: 100%;
+          color: $titleColor;
+          padding-left: 20upx;
+        }
+
+        .search-holder {
+          color: #f00;
+        }
+
+        .txt {
+          height: 72upx;
+          width: 90upx;
+          text-align: center;
+          line-height: 72upx;
+          color: #a95cff;
+          font-size: 28upx;
+        }
+      }
+
+      .btn-time {
+        margin-left: 20upx;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        .timeicon {
+          width: 48upx;
+          height: 48upx;
+        }
+      }
+    }
+
+    .header-bar {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      position: relative;
+
+      .item {
+        position: relative;
+        width: 33.33%;
+        height: 99upx;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        flex-direction: column;
+
+        .ordertype {
+          position: relative;
+          font-size: 30upx;
+          letter-spacing: 3upx;
+          color: #7a7c7c;
+        }
+
+        .heng {
+          position: absolute;
+          display: none;
+          bottom: 0;
+          width: 40upx;
+          height: 6upx;
+          border-radius: 4upx;
+          background-color: #a95cff;
+        }
+      }
+
+      .active .ordertype {
+        color: #a95cff;
+      }
+
+      .active .heng {
+        display: block;
+      }
+    }
+  }
+
+  .order-content {
+    padding: 24upx 32upx 0;
+
+    .order-list {
+      background-color: #fff;
+      border-radius: 10upx;
+      padding: 30upx 24upx 33upx;
+      margin-bottom: 24upx;
+
+      .order-title {
+        border-bottom: 1px solid $bordrColor;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding-bottom: 22upx;
+
+        .ordernum {
+          font-size: 34upx;
+          color: $titleColor;
+        }
+      }
+
+      .order-detail {
+        margin-top: 24upx;
+        display: flex;
+        justify-content: center;
+        .left {
+          .img {
+            width: 120upx;
+            height: 120upx;
+            border-radius: 5upx;
+            background-color: pink;
+          }
+        }
+        .center {
+          width: 370upx;
+          margin-left: 25upx;
+          .shop-detail {
+            font-size: 26upx;
+            color: #7a7a7a;
+            margin-top: 7upx;
+            &:first-child {
+              margin-top: 0;
+            }
+          }
+        }
+        .right {
+          flex: 1;
+          color: #ff6a5e;
+          .price {
+            font-size: 30upx;
+          }
+        }
+      }
+
+      .operate {
+        border-top: 1px solid #e7e7e7;
+        padding-top: 24upx;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        margin-top: 10upx;
+        .btn {
+          width: 160upx;
+          height: 58upx;
+          border: 1upx solid #7a7c7c;
+          border-radius: 6upx;
+          margin-right: 22upx;
+          text-align: center;
+          line-height: 58upx;
+          font-size: 28upx;
+          color: #7a7c7c;
+          letter-spacing: 3upx;
+        }
+        .delete {
+          margin-right: 0;
+          background-color: #ff6a5e;
+          color: #ffffff;
+          border: none;
+        }
+      }
+    }
+  }
+}
 </style>

+ 2 - 2
src/pages/shop/shopdetail.vue

@@ -13,14 +13,14 @@
       <!-- 商品类型 -->
       <view class="shoptype detail-list noborder">
         <view class="menu">
-          <view class="title">所属店铺</view>
+          <view class="title">商品类型</view>
           <image src="../../static/images/moreicon.png" class="more"></image>
         </view>
       </view>
       <!-- 商品名称 -->
       <view class="shopname detail-list">
         <view class="menu">
-          <view class="title">所属店铺</view>
+          <view class="title">商品名称</view>
           <image src="../../static/images/moreicon.png" class="more"></image>
         </view>
       </view>