py 2 gadi atpakaļ
vecāks
revīzija
3df37fec08
4 mainītis faili ar 26 papildinājumiem un 13 dzēšanām
  1. 2 2
      .env.js
  2. 1 1
      manifest.json
  3. 22 9
      pages-takeout/takeout.vue
  4. 1 1
      pages/index/index.vue

+ 2 - 2
.env.js

@@ -3,8 +3,8 @@ let ENV_CONFIG = null;
 
 if (nodeEnv === 'development') {
     //开发环境
-    // ENV_CONFIG = require('.env.prod.js');
-	ENV_CONFIG = require('.env.dev.js');
+    ENV_CONFIG = require('.env.prod.js');
+	// ENV_CONFIG = require('.env.dev.js');
 } else {
     //生产环境
     ENV_CONFIG = require('.env.prod.js');

+ 1 - 1
manifest.json

@@ -99,7 +99,7 @@
             "https" : false,
             "proxy" : {
                 "/api" : {
-                    "target" : "https://test-userapi.sjzkeji.com",
+                    "target" : "https://userapi.sjzkeji.com",
                     "changeOrigin" : true,
                     "secure" : false,
                     "pathRewrite" : {

+ 22 - 9
pages-takeout/takeout.vue

@@ -12,7 +12,8 @@
 								<view class="input-icon s-left">
 									<uni-icons type="search" size="22" color="#999"></uni-icons>
 								</view>
-								<input v-model="search" type="text" @confirm='searchClick' confirm-type="search" placeholder="请输入商家或者商品名称">
+								<input v-model="search" type="text" @confirm='searchClick' confirm-type="search"
+									placeholder="请输入商家或者商品名称">
 							</view>
 						</view>
 					</view>
@@ -25,7 +26,8 @@
 					<view class="input-icon">
 						<uni-icons type="search" size="22" color="#999"></uni-icons>
 					</view>
-					<input v-model="search" type="text" @confirm='searchClick' confirm-type="search" placeholder="请输入商家或者商品名称">
+					<input v-model="search" type="text" @confirm='searchClick' confirm-type="search"
+						placeholder="请输入商家或者商品名称">
 					<view class="fs-28 fc-f index-search-box-buttom" @click="searchClick">搜索</view>
 				</view>
 				<!-- 			<view class="p-24 box-border-box">
@@ -38,8 +40,9 @@
 				<view class="box-border-box plr-24">
 					<view class="shop-box mb-32 box-border-box p-16">
 						<image class="shop-box-bg" src="@/static/img/takeout/bg.png" mode="scaleToFill"></image>
-						<swiper class="swiper-tj" easing-function="easeInOutCubic" :circular='true' :current='BanenerCurrent'
-							@change="onSwiperChange" :autoplay="true" :interval="3000" :duration="500">
+						<swiper class="swiper-tj" easing-function="easeInOutCubic" :circular='true'
+							:current='BanenerCurrent' @change="onSwiperChange" :autoplay="true" :interval="3000"
+							:duration="500">
 							<swiper-item v-for="(item,i) in topShopData" :key="i" @click="toShop(item)">
 								<view class="swiper-item display-flex">
 									<view class="left-img-box">
@@ -97,8 +100,7 @@
 				</view>
 
 
-
-				<view class="box-border-box plr-24 mt-24">
+				<scroll-view :scroll-y="true" class="box-border-box plr-24 mt-24" @scrolltolower="scrollList">
 					<EnBlank :customSrc='true' v-if="listData<= 0">
 						<template v-slot:blankImg>
 							<image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
@@ -146,7 +148,10 @@
 							</view>
 						</view>
 					</view>
-				</view>
+				</scroll-view>
+				<!-- 				<view class="box-border-box plr-24 mt-24">
+
+				</view> -->
 			</view>
 		</scroll-view>
 	</view>
@@ -164,7 +169,7 @@
 		getTakeaway
 	} from "@/api/category.js"
 	import {
-	  shopInfo
+		shopInfo
 	} from "@/api/shop.js"
 	import tools from "@/service/tools";
 	export default {
@@ -181,7 +186,8 @@
 				topShopData: [],
 				page: 1,
 				listData: [],
-				navList: []
+				navList: [],
+				listTotal: 0
 			}
 		},
 		mounted() {
@@ -216,7 +222,13 @@
 					this.isScroll = false;
 				}
 			},
+			scrollList() {},
 			scrolltolower() {
+				console.log(this.listTotal, this.listData.length);
+				if (this.listTotal > this.listData.length) {
+					++this.page
+					this.getGoodsList()
+				}
 				console.log('触底');
 			},
 			toShop(item) {
@@ -255,6 +267,7 @@
 					if (res.code == 1) {
 						if (res.data.items.length > 0) {
 							this.listData.push(...res.data.items)
+							this.listTotal = res.data.total
 						}
 					}
 				})

+ 1 - 1
pages/index/index.vue

@@ -374,7 +374,7 @@
 					if (res.code == 1) {
 						this.navList.forEach((v, k) => {
 							v.appletAudit = 0
-							if (v.type == 8 || v.type == 9 || v.type == 10 || v.type == 11) {
+							if (v.type == 8 || v.type == 7 || v.type == 9 || v.type == 10 || v.type == 11) {
 								v.appletAudit = res.data
 							}
 						})