py il y a 2 ans
Parent
commit
b9a28b7943

+ 12 - 0
common/css/common.css

@@ -176,6 +176,9 @@ image {
 .fs-36{
 	font-size: 36rpx;
 }
+.fs-38{
+	font-size: 38rpx;
+}
 .fs-40{
 	font-size: 40rpx;
 }
@@ -361,6 +364,9 @@ image {
 .p-t-10 {
 	padding-top: 10rpx;
 }
+.p-t-20{
+	padding-top: 20rpx;
+}
 .p-b-20 {
 	padding-bottom: 20rpx;
 }
@@ -387,6 +393,9 @@ image {
 .m-24{
 	margin: 24rpx;
 }
+.mt-4{
+	margin-top: 4rpx;
+}
 .mt-5{
 	margin-top: 5rpx;
 }
@@ -452,6 +461,9 @@ image {
 .mb-8{
 	margin-bottom: 8rpx;
 }
+.mb-10{
+	margin-bottom: 10rpx;
+}
 .mb-12{
 	margin-bottom: 12rpx;
 }

+ 34 - 27
pages-takeout/replace-mod/select-site.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="select-site-box iPhone-bottom flex-common-css box-border-box">
 		<Nav title='选择站点'></Nav>
-		
+
 		<scroll-view class="scroll-view-css box-border-box p-24" scroll-y="true" @scrolltolower="scrolltolower">
-			<view class="list-item" :class="site_id == item.site_id?'s-b':''"
-			v-for="(item,i) in list" :key="i" @click="selectFun(item)">
+			<view class="list-item align-items-center" :class="site_id == item.site_id?'s-b':''" v-for="(item,i) in list" :key="i"
+				@click="selectFun(item)">
 				<view class="list-item-s">
 					<image v-if="site_id == item.site_id" src="@/static/img/common/y-select.png" mode=""></image>
 					<image v-else src="@/static/img/common/n-select.png" mode=""></image>
@@ -21,37 +21,41 @@
 
 <script>
 	import tools from "@/service/tools";
-	import {getExpressSite} from '@/api/express.js';
+	import {
+		getExpressSite
+	} from '@/api/express.js';
 	export default {
-		data(){
-			return{
-				site_id:'',
-				list:[],
+		data() {
+			return {
+				site_id: '',
+				list: [],
 			}
 		},
 		onLoad(e) {
 			this.site_id = Number(e.site_id);
 			this.getExpressSite();
 		},
-		methods:{
-			getExpressSite(){
+		methods: {
+			getExpressSite() {
 				let school_id = uni.getStorageSync('school_id');
-				getExpressSite({school_id:school_id}).then((res)=>{
-					if(res.code === 1){
+				getExpressSite({
+					school_id: school_id
+				}).then((res) => {
+					if (res.code === 1) {
 						this.list = res.data
 					}
 				})
 			},
-			selectFun(item){
+			selectFun(item) {
 				this.site_id = item.site_id;
-				
-				uni.setStorageSync('site_id',item.site_id)
-				uni.setStorageSync('site_name',item.name)
+
+				uni.setStorageSync('site_id', item.site_id)
+				uni.setStorageSync('site_name', item.name)
 				uni.setStorageSync('site_address', item.city_name + item.address)
 				uni.setStorageSync('site_logo', item.logo)
-				
+
 				uni.reLaunch({
-					url:'/pages-takeout/replace-take'
+					url: '/pages-takeout/replace-take'
 				})
 			},
 		},
@@ -59,38 +63,41 @@
 </script>
 
 <style scoped lang="scss">
-	.select-site-box{
-		.list-item{
+	.select-site-box {
+		.list-item {
 			width: 100%;
 			min-height: 162rpx;
 			background: #FFFFFF;
 			border-radius: 20rpx 20rpx 20rpx 20rpx;
-			
 			margin-bottom: 20rpx;
 			box-sizing: border-box;
 			padding: 24rpx 32rpx 20rpx 80rpx;
 			position: relative;
-			display: flex;
-			.img-1{
+
+			.img-1 {
 				width: 80rpx;
 				height: 80rpx;
 				border-radius: 8rpx;
 				margin-right: 20rpx;
 			}
-			.w-490{
+
+			.w-490 {
 				width: 490rpx;
 			}
-			.list-item-s{
+
+			.list-item-s {
 				position: absolute;
 				left: 24rpx;
 				top: 45%;
-				image{
+
+				image {
 					width: 32rpx;
 					height: 32rpx;
 				}
 			}
 		}
-		.s-b{
+
+		.s-b {
 			border: 2rpx solid #41ABF5;
 		}
 	}

+ 290 - 209
pages-takeout/replace-take.vue

@@ -1,87 +1,101 @@
 <template>
 	<view class="replace-take-box iPhone-bottom flex-common-css box-border-box bgc-f">
-		
-		<view class="nav-box">
-			<image class="bg-img" src="@/static/img/takeout/dq-bg.png" mode="scaleToFill"></image>
-			<Nav :leftShow='false' :customNav='true' bgckgroundBox='transparent'>
-				<template>
-					<view slot="custom" class="align-items-center">
-						<uni-icons type="left" size="20" @click="toBack()"></uni-icons>
-						<view class="w-390 text-overflow-ellipsis-one fs-36 fw-400">{{schoolData.school_name}}</view>
-					</view>
-				</template>
-			</Nav>
-			<view :class="addressData.id?'bottom-124':''" class="address-box align-items-center box-border-box plr-24" @click="selectFun()">
-				<view v-if="!addressData.site_id" class="address-1 flex-justify-space align-items-center">
-					<view class="align-items-center">
-						<image class="qu-image" src="@/static/img/takeout/qu-icon.png" mode=""></image>
-						<view class="fw-600 fs-40">请选择站点</view>
-					</view>
-					<image class="address-box-right" src="@/static/img/toRight.png" mode=""></image>
-				</view>
-				<view v-else class="address-2 flex-justify-space align-items-center">
-					<view class="display-flex">
-						<image class="address-img mr-20" :src="addressData.site_logo" mode="scaleToFill"></image>
-						<view class="">
-							<view class="w-474 fs-40 fw-600 mb-4">{{addressData.site_name}}</view>
-							<view class="w-474 fw-400 fs-26 fc-9">{{addressData.site_address}}</view>
+		<scroll-view :scroll-y="true" class="scroll-view-css" @scroll="scroll">
+			<view class="list-box">
+				<view class="nav-box">
+					<image class="bg-img" src="@/static/img/takeout/dq-bg.png" mode="scaleToFill"></image>
+					<Nav :leftShow='false' :customNav='true' :bgckgroundBox='bgckgroundBox'>
+						<template>
+							<view slot="custom" class="align-items-center">
+								<uni-icons type="left" size="20" @click="toBack()"></uni-icons>
+								<view class="w-390 text-overflow-ellipsis-one fs-36 fw-400">{{schoolData.school_name}}
+								</view>
+							</view>
+						</template>
+					</Nav>
+					<view :class="addressData.id?'bottom-124':''"
+						class="address-box align-items-center box-border-box plr-24" @click="selectFun()">
+						<view v-if="!addressData.site_id" class="address-1 flex-justify-space align-items-center">
+							<view class="align-items-center">
+								<image class="qu-image" src="@/static/img/takeout/qu-icon.png" mode=""></image>
+								<view class="fw-600 fs-40">请选择站点</view>
+							</view>
+							<image class="address-box-right" src="@/static/img/toRight.png" mode=""></image>
+						</view>
+						<view v-else class="address-2 flex-justify-space align-items-center">
+							<view class="display-flex">
+								<image class="address-img mr-20" :src="addressData.site_logo" mode="scaleToFill">
+								</image>
+								<view class="">
+									<view class="w-474 fs-40 fw-600 mb-8">{{addressData.site_name}}</view>
+									<view class="w-474 fw-400 fs-26 fc-9">{{addressData.site_address}}</view>
+								</view>
+							</view>
+							<image class="address-box-right" src="@/static/img/toRight.png" mode=""></image>
 						</view>
 					</view>
-					<image class="address-box-right" src="@/static/img/toRight.png" mode=""></image>
 				</view>
-			</view>
-		</view>
-		
-		
-		<view class="scroll-view-css list-box box-border-box plr-24">
-			<view class="mb-32" :class="addressData.id?'h-120':'h-60'"></view>
-			
-			<view class="list-box-b mb-48">
-				<view class="fs-36 fw-600 mb-22">快递类型</view>
-				<view class="list-item flex-justify-space" v-for="(item,i) in list" :key="i">
-					<image :src="item.serve_image" mode="scaleToFill"></image>
-					<view class="flex-1">
-						<view class="fs-32 fw-600 mb-32 ">{{item.serve_name}}</view>
-						<view class="fs-24 fw-400 mb-32 fc-9">{{item.serve_desc}}</view>
-						<!-- <view class="fs-24 fw-400 mb-4 fc-9">销量2801</view> -->
-						<view class="flex-justify-space">
-							<view class="">
-								<span class="fw-4 fc-FB3D03 fs-24">¥</span>
-								<span class="fw-b fc-FB3D03 fs-40">{{item.price}}</span>
-								<span class="fw-400 fc-9 fs-24">/份</span>
-							</view>
-							<view class="display-flex align-items-center">
-								<view v-if="item.number > 0" class="right-only-right-red fw-500 text-align-center fs-36 fc-f" @click="redNumber(1,item)">-</view>
-								<view v-if="item.number > 0" class="right-only-right-2 text-align-center fs-28 fw-400">{{item.number}}</view>
-								<view class="right-only-right-add fw-500 text-align-center fs-36 fc-f" @click="addNumber(1,item)">+</view>
+				<view class="mb-32" :class="addressData.id?'h-120':'h-60'"></view>
+
+				<view class="list-box-b mb-48 box-border-box plr-24">
+					<view class="fs-36 fw-600 mb-22">快递类型</view>
+					<view class="list-item flex-justify-space" v-for="(item,i) in list" :key="i">
+						<image class="item_img" :src="item.serve_image" mode="scaleToFill"></image>
+						<view class="flex-1">
+							<view class="fs-32 fw-600 mb-32 ">{{item.serve_name}}</view>
+							<view class="fs-24 fw-400 mb-32 fc-9">{{item.serve_desc}}</view>
+							<!-- <view class="fs-24 fw-400 mb-4 fc-9">销量2801</view> -->
+							<view class="flex-justify-space">
+								<view class="">
+									<span class="fw-4 fc-FB3D03 fs-24">¥</span>
+									<span class="fw-b fc-FB3D03 fs-40">{{item.price}}</span>
+									<span class="fw-400 fc-9 fs-24">/份</span>
+								</view>
+								<view class="display-flex align-items-center">
+									<image v-if="item.number > 0" class="wh44" src="@/static/img/takeout/j.png" mode=""
+										@click="redNumber(1,item)"></image>
+									<!-- <view v-if="item.number > 0" class="right-only-right-red fw-500 fs-36 fc-f align-items-center flex-justify-center" @click="redNumber(1,item)">-</view> -->
+									<view v-if="item.number > 0"
+										class="right-only-right-2 text-align-center fs-28 fw-400">{{item.number}}</view>
+									<!-- <view class="right-only-right-add fw-500 fs-36 fc-f align-items-center flex-justify-center" @click="addNumber(1,item)">+</view> -->
+									<image class="wh44" src="@/static/img/takeout/add.png" mode=""
+										@click="addNumber(1,item)"></image>
+								</view>
 							</view>
 						</view>
 					</view>
 				</view>
-			</view>
-			
-			<view class="">
-				<view class="fs-36 fw-600 mb-22">取件码({{pickup_code.length}})</view>
-				<view class="mb-20" v-for="(item,i) in pickup_code" :key="i">
-					<input class="input-num" v-model="item.code" type="text" placeholder="未输入取件码" placeholder-class="input-p">
+
+				<view class="box-border-box plr-24">
+					<view v-show="cardData.total_num>0" class="fs-36 fw-600 mb-22">取件码({{pickup_code.length}})</view>
+					<view class="mb-20" v-for="(item,i) in pickup_code" :key="i">
+						<input class="input-num" v-model="item.code" type="text" maxlength="20" placeholder="未输入取件码"
+							placeholder-class="input-p fc-FB3D03">
+					</view>
 				</view>
 			</view>
-		</view>
-		
-		<view class="shop-buttom-money box-border-box" >
+		</scroll-view>
+
+
+		<view class="shop-buttom-money box-border-box">
 			<view class="shop-buttom-money-1 flex-justify-space align-items-center">
 				<image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill" @click="openBuyCrad()"></image>
-				<view class="shop-buttom-num fs-24 fc-f text-align-center" @click="openBuyCrad()">{{cardData.total_num}}</view>
+				<view v-show="cardData.total_num>0" class="shop-buttom-num fs-24 fc-f text-align-center"
+					@click="openBuyCrad()">{{cardData.total_num}}</view>
 				<view class="" @click="openBuyCrad()">
 					<span class="fw-600 fs-24 fc-f">¥</span>
 					<span class="fw-600 fs-44 fc-f">{{cardData.total_price||0}}</span>
 				</view>
-				<view class="shop-buttom-money-2 text-align-center fs-32 fc-f fw-600" @click="createOrder()">去结算</view>
+				<view v-if="cardData.total_num>0" class="shop-buttom-money-2 text-align-center fs-32 fc-f fw-600"
+					@click="createOrder()">去结算</view>
+				<view v-else class="fs-32 fc-f fw-600 mr-36">
+					暂未选择
+				</view>
 			</view>
 		</view>
-		
-		
-		
+
+
+
 		<uni-popup ref="popupBuy" type="bottom" style="z-index: 200;">
 			<view class="buy-card flex-index-css">
 				<view class="buy-card-top box-border-box plr-32 flex-justify-space align-items-center">
@@ -97,233 +111,272 @@
 				</view>
 				<view class="scroll-view-css box-border-box p-32">
 					<view class="buy-card-item display-flex" v-for="(item,i) in cardData.goods_list" :key="i">
-						<image :src="item.serve_image" mode="aspectFill"></image>
+						<image class="item_img" :src="item.serve_image" mode="aspectFill"></image>
 						<view class="flex-1">
 							<view class="w-514 text-overflow-ellipsis-one fs-34 fw-600 mb-12">{{item.serve_name}}</view>
-							<view class="w-514 text-overflow-ellipsis-one fs-24 fw-400 fc-9 mb-18">{{item.serve_desc}}</view>
-							
+							<view class="w-514 text-overflow-ellipsis-one fs-24 fw-400 fc-9 mb-18">{{item.serve_desc}}
+							</view>
+
 							<view class="flex-justify-space">
 								<view class="">
 									<span class="fs-24 fc-FB3D03 fw-400">¥</span>
 									<span class="fs-40 fc-FB3D03 fw-b">{{item.price}}</span>
 								</view>
 								<view class="display-flex align-items-center">
-									<view class="right-only-right-red fw-500 text-align-center fs-36 fc-f" @click="redNumber(2,item)">-</view>
-									<view class="right-only-right-2 text-align-center fs-28 fw-400">{{item.number}}</view>
-									<view class="right-only-right-add fw-500 text-align-center fs-36 fc-f" @click="addNumber(2,item)">+</view>
+									<image class="wh44" src="@/static/img/takeout/j.png" mode=""
+										@click="redNumber(2,item)"></image>
+									<!-- <view class="right-only-right-red fw-500 fs-36 fc-f align-items-center flex-justify-center" @click="redNumber(2,item)">-</view> -->
+									<view class="right-only-right-2 text-align-center fs-28 fw-400">{{item.number}}
+									</view>
+									<!-- <view class="right-only-right-add fw-500 fs-36 fc-f align-items-center flex-justify-center" @click="addNumber(2,item)">+</view> -->
+									<image class="wh44" src="@/static/img/takeout/add.png" mode=""
+										@click="addNumber(2,item)"></image>
 								</view>
 							</view>
 						</view>
 					</view>
 				</view>
-				
-				<view class="shop-buttom-money box-border-box" >
+
+				<view class="shop-buttom-money box-border-box">
 					<view class="shop-buttom-money-1 flex-justify-space align-items-center">
-						<image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill" @click="closeCardBox()"></image>
-						<view class="shop-buttom-num fs-24 fc-f text-align-center" @click="closeCardBox()">{{cardData.total_num}}</view>
+						<image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill" @click="closeCardBox()">
+						</image>
+						<view class="shop-buttom-num fs-24 fc-f text-align-center" @click="closeCardBox()">
+							{{cardData.total_num}}</view>
 						<view class="" @click="closeCardBox()">
 							<view class="">
 								<span class="fw-600 fs-24 fc-f">¥</span>
 								<span class="fw-600 fs-44 fc-f">{{cardData.total_price||0}}</span>
 							</view>
 						</view>
-						<view class="shop-buttom-money-2 text-align-center fs-32 fc-f fw-600" @click="createOrder()">去结算</view>
+						<view class="shop-buttom-money-2 text-align-center fs-32 fc-f fw-600" @click="createOrder()">去结算
+						</view>
 					</view>
 				</view>
 			</view>
 		</uni-popup>
-		
+
 	</view>
 </template>
 
 <script>
 	import tools from "@/service/tools";
-	import {getExpressServe} from '@/api/express.js';
-	import {setShopIngAdd,setShopIngNumber,setShopIngDel,getShopIngList} from '@/api/shopping.js'
-	
+	import {
+		getExpressServe
+	} from '@/api/express.js';
+	import {
+		setShopIngAdd,
+		setShopIngNumber,
+		setShopIngDel,
+		getShopIngList
+	} from '@/api/shopping.js'
+
 	export default {
-		data(){
-			return{
-				schoolData:{
-					school_id:'',
-					school_name:'',
+		data() {
+			return {
+				schoolData: {
+					school_id: '',
+					school_name: '',
 				},
-				addressData:{
-					site_id:'',
-					site_name:'',
-					site_address:'',
-					site_logo:'',
+				addressData: {
+					site_id: '',
+					site_name: '',
+					site_address: '',
+					site_logo: '',
 				},
-				list:[],
-				
-				isAJAX:false,
-				
-				pickup_code:[],
-				
-				cardData:{
-					goods_list:[],
-					total_num:0,
-					total_price:0,
+				list: [],
+				bgckgroundBox: 'transparent',
+				isAJAX: false,
+
+				pickup_code: [],
+
+				cardData: {
+					goods_list: [],
+					total_num: 0,
+					total_price: 0,
 				},
-				
-				isInitial:true,
+
+				isInitial: true,
 			}
 		},
 		onShow() {
 			this.list = [];
 			this.pickup_code = [];
 			this.cardData = {
-				goods_list:[],
-				total_num:0,
-				total_price:0,
-			},
-			
-			this.schoolData.school_id = uni.getStorageSync('school_id');
+					goods_list: [],
+					total_num: 0,
+					total_price: 0,
+				},
+				this.schoolData.school_id = uni.getStorageSync('school_id');
 			this.schoolData.school_name = uni.getStorageSync('school_name');
-			
 			this.addressData.site_id = uni.getStorageSync('site_id');
 			this.addressData.site_name = uni.getStorageSync('site_name');
 			this.addressData.site_address = uni.getStorageSync('site_address');
 			this.addressData.site_logo = uni.getStorageSync('site_logo');
-			
 			this.isInitial = true;
 			this.getList();
 		},
-		methods:{
-			getList(){
-				getExpressServe({school_id: this.schoolData.school_id}).then((res)=>{
-					if(res.code === 1){
+		methods: {
+			scroll(e) {
+				if (e.detail.scrollTop > 1) {
+					this.bgckgroundBox = '#fff';
+				} else {
+					this.bgckgroundBox = 'transparent';
+				}
+			},
+			getList() {
+				getExpressServe({
+					school_id: this.schoolData.school_id
+				}).then((res) => {
+					if (res.code === 1) {
 						this.list = res.data;
-						this.list.forEach((v)=>{
+						this.list.forEach((v) => {
 							v.number = 0
 						})
 						this.getCard();
 					}
 				})
 			},
-			getCard(){
-				getShopIngList({type:2}).then((res)=>{
-					if(res.code === 1){
+			getCard() {
+				getShopIngList({
+					type: 2
+				}).then((res) => {
+					if (res.code === 1) {
 						this.cardData = res.data;
-						if(this.cardData.total_num > 0){
+						if (this.cardData.total_num > 0) {
 							for (let i = 0; i < this.list.length; i++) {
 								for (let n = 0; n < this.cardData.goods_list.length; n++) {
-									if(this.list[i].id == this.cardData.goods_list[n].goods_id){
-										this.list[i].number = this.cardData.goods_list[n]. number;
+									if (this.list[i].id == this.cardData.goods_list[n].goods_id) {
+										this.list[i].number = this.cardData.goods_list[n].number;
 										break
-									}else{
+									} else {
 										this.list[i].number = 0
 									}
 								}
 							}
 							// 初始设置code 输入框数量
-							if(this.isInitial){
+							if (this.isInitial) {
 								for (let i = 0; i < this.cardData.total_num; i++) {
-									let obj = {code:''};
+									let obj = {
+										code: ''
+									};
 									this.pickup_code.push(obj);
 								}
 							}
-						}else{
-							this.list.forEach(t=>{
+						} else {
+							this.list.forEach(t => {
 								t.number = 0;
 							})
 						}
 					}
 				})
 			},
-			toBack(){
+			toBack() {
 				tools.leftClick()
 			},
-			selectFun(){
+			selectFun() {
 				uni.navigateTo({
-					url:'pages-takeout/replace-mod/select-site?site_id=' + this.addressData.site_id
+					url: 'pages-takeout/replace-mod/select-site?site_id=' + this.addressData.site_id
 				})
 			},
-			closeCardBox(){
+			closeCardBox() {
 				this.$refs.popupBuy.close();
 			},
-			openBuyCrad(){
-				if(!this.addressData.site_id){
+			openBuyCrad() {
+				if (!this.addressData.site_id) {
 					return tools.error('请选择站点')
 				}
-				if(this.pickup_code.length == 0){
+				if (this.pickup_code.length == 0) {
 					return tools.error('请选择商品')
 				}
 				this.$refs.popupBuy.open()
 			},
-			createOrder(){
-				if(this.pickup_code.length == 0){
+			createOrder() {
+				if (this.pickup_code.length == 0) {
 					return tools.error('请选择商品')
 				}
-				let flag = this.pickup_code.every((item)=>{return item.code});
-				if(flag){
+				let flag = this.pickup_code.every((item) => {
+					return item.code
+				});
+				if (flag) {
 					let arr = [];
-					this.pickup_code.forEach((v)=>{
+					this.pickup_code.forEach((v) => {
 						arr.push(v.code)
 					})
 					let pickup_code = arr.join(',')
-					uni.setStorageSync('isConfirmAddressFlag',false);
+					uni.setStorageSync('isConfirmAddressFlag', false);
 					uni.navigateTo({
-						url:'pages-takeout/confirm-order?pickup_code=' + pickup_code + '&type=2'
+						url: 'pages-takeout/confirm-order?pickup_code=' + pickup_code + '&type=2'
 					})
-				}else{
+				} else {
 					tools.error('请输入取件码')
 				}
 			},
 			// 增加
-			addNumber(type,item){
-				if(this.isAJAX){
+			addNumber(type, item) {
+				if (this.isAJAX) {
 					return
 				}
 				this.isAJAX = true;
-				let id = type == 1?item.id:item.goods_id;
-				setShopIngAdd({type:2,goods_id:id}).then((res)=>{
-					if(res.code === 1){
+				let id = type == 1 ? item.id : item.goods_id;
+				setShopIngAdd({
+					type: 2,
+					goods_id: id
+				}).then((res) => {
+					if (res.code === 1) {
 						this.isAJAX = false;
 						item.number += 1;
-						let obj = {code:''};
+						let obj = {
+							code: ''
+						};
 						this.pickup_code.push(obj);
 						this.$forceUpdate();
 						this.isInitial = false;
 						this.getCard();
-					}else{
+					} else {
 						this.isAJAX = false;
 						tools.error('添加操作失败')
 					}
 				})
 			},
 			// 减少
-			redNumber(type,item){
-				if(item.number > 0){
-					if(this.isAJAX){
+			redNumber(type, item) {
+				if (item.number > 0) {
+					if (this.isAJAX) {
 						return
 					}
 					this.isAJAX = true;
-					let id = type == 1?item.id:item.goods_id;
-					setShopIngNumber({type:2,goods_id:id,operation:2}).then((res)=>{
-						if(res.code === 1){
+					let id = type == 1 ? item.id : item.goods_id;
+					setShopIngNumber({
+						type: 2,
+						goods_id: id,
+						operation: 2
+					}).then((res) => {
+						if (res.code === 1) {
 							this.isAJAX = false;
 							item.number -= 1;
 							this.pickup_code.pop();
 							this.$forceUpdate();
 							this.isInitial = false;
 							this.getCard();
-						}else{
+						} else {
 							this.isAJAX = false;
 							tools.error('减少操作失败')
 						}
 					})
-				}else{
+				} else {
 					tools.error('已无可减少商品')
 				}
 			},
-			cardAllDel(){
-				setShopIngDel({type:2}).then((res)=>{
-					if(res.code === 1){
+			cardAllDel() {
+				setShopIngDel({
+					type: 2
+				}).then((res) => {
+					if (res.code === 1) {
 						this.pickup_code = [];
 						this.isInitial = false;
 						this.getCard();
-					}else{
+					} else {
 						tools.error('清空失败')
 					}
 				})
@@ -333,50 +386,60 @@
 </script>
 
 <style scoped lang="scss">
-	.replace-take-box{
-		.h-80{
+	.wh44 {
+		width: 44rpx;
+		height: 44rpx;
+	}
+
+	.replace-take-box {
+		.h-80 {
 			width: 470rpx;
 			height: 88rpx;
 		}
-		.right-only-right-red{
+
+		.right-only-right-red {
 			box-sizing: border-box;
 			width: 44rpx;
 			height: 44rpx;
-			line-height: 40rpx;
 			border-radius: 12rpx;
 			border: 1rpx solid #41ABF5;
 			color: #41ABF5;
 		}
-		.right-only-right-add{
-			box-sizing: border-box;
+
+		.right-only-right-add {
 			width: 44rpx;
 			height: 44rpx;
-			line-height: 40rpx;
-			background: linear-gradient( 117deg, #57CAFF 0%, #41ABF5 100%);
+			background: linear-gradient(117deg, #57CAFF 0%, #41ABF5 100%);
 			border-radius: 12rpx;
 		}
-		.right-only-right-2{
+
+		.right-only-right-2 {
 			min-width: 50rpx;
 		}
-		.w-514{
+
+		.w-514 {
 			width: 514rpx;
 		}
-		.buy-card{
+
+		.buy-card {
 			z-index: 200;
 			height: 828rpx;
 			background-color: #fff;
 			border-radius: 24rpx 24rpx 0rpx 0rpx;
-			.buy-card-top{
+
+			.buy-card-top {
 				width: 100%;
 				height: 92rpx;
 				background: #FCF5DB;
 				border-radius: 24rpx 24rpx 0rpx 0rpx;
 			}
-			.buy-card-item{
+
+			.buy-card-item {
 				width: 100%;
 				height: 176rpx;
 				margin-bottom: 32rpx;
-				image{
+
+				.item_img {
 					width: 152rpx;
 					height: 152rpx;
 					border-radius: 12rpx;
@@ -384,24 +447,29 @@
 				}
 			}
 		}
-		
-		.h-120{
+
+		.h-120 {
 			height: 120rpx;
 		}
-		.h-60{
+
+		.h-60 {
 			height: 60rpx;
 		}
-		.w-474{
+
+		.w-474 {
 			width: 474rpx;
 		}
-		.w-390{
+
+		.w-390 {
 			width: 390rpx;
 			margin-left: 38rpx;
 		}
-		.nav-box{
+
+		.nav-box {
 			height: 490rpx;
 			position: relative;
-			.bg-img{
+
+			.bg-img {
 				position: absolute;
 				top: 0;
 				left: 0;
@@ -409,10 +477,12 @@
 				height: 490rpx;
 				// z-index: -1;
 			}
-			.bottom-124{
+
+			.bottom-124 {
 				bottom: -124rpx !important;
 			}
-			.address-box{
+
+			.address-box {
 				z-index: 100;
 				position: absolute;
 				bottom: -64rpx;
@@ -420,41 +490,47 @@
 				box-sizing: border-box;
 				width: 702rpx;
 				min-height: 136rpx;
-				background: linear-gradient( 182deg, #F1F9FF 0%, #FFFFFF 100%);
-				box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(172,210,235,0.19);
+				background: linear-gradient(182deg, #F1F9FF 0%, #FFFFFF 100%);
+				box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(172, 210, 235, 0.19);
 				border-radius: 20rpx;
 				border-image: linear-gradient(167deg, rgba(255, 255, 255, 1), rgba(208, 236, 255, 0.61)) 2 2;
-				.address-1{
+
+				.address-1 {
 					width: 100%;
-					.qu-image{
+
+					.qu-image {
 						width: 40rpx;
 						height: 49rpx;
 						margin: 10rpx 10rpx 0 0;
 					}
-					
+
 				}
-				.address-2{
+
+				.address-2 {
 					box-sizing: border-box;
-					padding:32rpx 0;
+					padding: 32rpx 0;
 				}
-				.address-img{
+
+				.address-img {
 					width: 100rpx;
 					height: 100rpx;
 					border-radius: 8rpx;
 				}
-				.address-box-right{
+
+				.address-box-right {
 					width: 32rpx;
 					height: 32rpx;
 				}
 			}
 		}
-		
-		.shop-buttom-money{
+
+		.shop-buttom-money {
 			width: 100%;
 			height: 140rpx;
-			background: rgba(255,255,255,0.8);
+			background: rgba(255, 255, 255, 0.8);
 			padding: 20rpx 24rpx;
-			.shop-buttom-money-1{
+
+			.shop-buttom-money-1 {
 				width: 100%;
 				height: 100%;
 				background: #333333;
@@ -463,14 +539,16 @@
 				padding-left: 136rpx;
 				// padding-right: 32rpx;
 				position: relative;
-				image{
+
+				image {
 					position: absolute;
 					bottom: 0;
 					left: 8rpx;
 					width: 128rpx;
 					height: 128rpx;
 				}
-				.shop-buttom-num{
+
+				.shop-buttom-num {
 					width: 32rpx;
 					height: 32rpx;
 					line-height: 32rpx;
@@ -480,7 +558,8 @@
 					top: 36rpx;
 					left: 82rpx;
 				}
-				.shop-buttom-money-2{
+
+				.shop-buttom-money-2 {
 					width: 200rpx;
 					height: 100rpx;
 					line-height: 100rpx;
@@ -489,25 +568,26 @@
 				}
 			}
 		}
-		
-		.list-box{
-			.list-box-b{
+
+		.list-box {
+			.list-box-b {
 				border-bottom: 1rpx solid #f9f9f9;
 			}
-			.list-item{
+
+			.list-item {
 				width: 100%;
 				min-height: 100rpx;
 				margin-bottom: 50rpx;
-				
-				image{
+
+				.item_img {
 					width: 200rpx;
 					height: 200rpx;
 					border-radius: 20rpx;
 					margin-right: 20rpx;
 				}
 			}
-			
-			.input-num{
+
+			.input-num {
 				width: 100%;
 				height: 92rpx;
 				box-sizing: border-box;
@@ -516,12 +596,13 @@
 				border-radius: 20rpx;
 				font-size: 32rpx;
 			}
-			.input-p{
+
+			.input-p {
 				font-weight: 400;
 				font-size: 28rpx;
 				color: #FB3D03;
 			}
 		}
-		
+
 	}
 </style>

+ 55 - 20
pages/index/index.vue

@@ -1,12 +1,13 @@
 <template>
 	<view class="index-box">
-		<image class="bg-img" src="@/static/img/index/index-bg.png" mode="aspectFit"></image>
+		<image class="bg-img" src="@/static/img/index/index-bg.png" mode="scaleToFill"></image>
 
-		<view class="">
-			<Nav :leftShow='false' :customNav='true' :bgckgroundBox='bgckgroundBox'>
+		<view class="nav-z">
+			<Nav class="" :leftShow='false' :customNav='true' :bgckgroundBox='bgckgroundBox'>
 				<template>
 					<view slot="custom" class="align-items-center" @click="toSelectSchool()">
-						<uni-icons type="location-filled" size="20"></uni-icons>
+						<!-- <uni-icons type="location-filled" size="20"></uni-icons> -->
+						<image class="wh-40" src="@/static/img/index/dw.png" mode=""></image>
 						<view class="fs-32 w-220 fw-600 ml-10 text-overflow-ellipsis-one">{{schoolData.school_name||''}}
 						</view>
 						<image class="nav-icon ml-10" src="@/static/img/index/index-right.png" mode="aspectFit"></image>
@@ -16,10 +17,11 @@
 		</view>
 
 		<!-- 搜索 -->
-		<view class="index-search box-border-box" @click="toUrl(1)"
+		<view class="index-search box-border-box mt-4" @click="toUrl(1)"
 			:style="[{'top': BarH + 'px','background':bgckgroundSearch}]">
 			<view class="index-search-box box-border-box align-items-center">
-				<uni-icons type="search" size="20" color="#000"></uni-icons>
+				<!-- <uni-icons type="search" size="20" color="#000"></uni-icons> -->
+				<image class="wh32" src="@/static/img/index/ss.png" mode=""></image>
 				<view class="fs-28 fc-9 ml-10">搜索店铺名称或者商品名称</view>
 				<view class="fs-28 fc-f index-search-box-buttom">搜索</view>
 			</view>
@@ -28,13 +30,14 @@
 
 		<view class="index-box-1 ">
 			<!-- 轮播 -->
-			<view class="box-border-box plr-24">
-				<swiper class="swiper mb-32 " circular indicator-dots indicator-active-color="#4FB3EF" :autoplay="true"
-					:interval="3000" :duration="500">
-					<swiper-item v-for="(item,i) in bannerList" :key="i">
-						<image class="swiper-item" :src="item.image" mode="aspectFill"></image>
-					</swiper-item>
-				</swiper>
+			<view class="box-border-box plr-24 mb-32">
+				<uni-swiper-dot :info="bannerList" mode="dot" :dotsStyles="dotStyle">
+					<swiper class="swiper">
+						<swiper-item v-for="(item,i) in bannerList" :key="i">
+							<image class="swiper-item" :src="item.image" mode="aspectFill"></image>
+						</swiper-item>
+					</swiper>
+				</uni-swiper-dot>
 			</view>
 
 
@@ -60,7 +63,7 @@
 							<view class="tz-swiper-item">{{item.title}}</view>
 						</swiper-item>
 					</swiper>
-					<image class="image-2" src="@/static/img/toRight.png" mode="scaleToFill"></image>
+					<!-- <image class="image-2" src="@/static/img/toRight.png" mode="scaleToFill"></image> -->
 				</view>
 			</view>
 
@@ -257,7 +260,16 @@
 				goodsList: [],
 				total: 0,
 				page: 1,
-				couponData: []
+				couponData: [],
+				dotStyle: {
+					width: 6,
+					bottom: 6,
+					backgroundColor: 'rgba(51, 51, 51,0.3)',
+					border: '1px rgba(51, 51, 51,0.3) solid',
+					color: '#fff',
+					selectedBackgroundColor: 'rgba(79, 179, 239,0.9)',
+					selectedBorder: '1px rgba(255, 255, 255,0.9) solid'
+				}
 			}
 		},
 
@@ -337,7 +349,6 @@
 		},
 		mounted() {
 			this.couponHome()
-			this.$refs.popup.open()
 			uni.hideTabBar()
 		},
 		methods: {
@@ -347,7 +358,10 @@
 					operate_id: operate_id
 				}).then((res) => {
 					if (res.code == 1) {
-						this.couponData = res.data
+						if (res.data.length > 0) {
+							this.couponData = res.data
+							this.$refs.popup.open()
+						}
 					}
 				})
 			},
@@ -475,12 +489,29 @@
 	}
 </script>
 <style lang="scss" scoped>
-	.item-box{
+	.wh32 {
+		width: 32rpx;
+		height: 32rpx;
+	}
+
+	.nav-z {
+		position: relative;
+		z-index: 1 !important;
+	}
+
+	.wh-40 {
+		width: 40rpx;
+		height: 40rpx;
+	}
+
+	.item-box {
 		margin-bottom: 20rpx;
 	}
+
 	.item-box:last-child {
 		margin: 0;
 	}
+
 	.roll-pop {
 		position: relative;
 		width: 100vw;
@@ -490,6 +521,7 @@
 			width: 100%;
 			height: 202rpx;
 		}
+
 		.tc-bot {
 			width: 100%;
 			height: 178rpx;
@@ -510,6 +542,7 @@
 		padding: 0 82rpx 0 92rpx;
 		box-sizing: border-box;
 		position: relative;
+
 		.tc-content {
 			position: absolute;
 			left: 0;
@@ -528,11 +561,11 @@
 
 		.bg-img {
 			width: 100%;
-			height: 1220rpx;
+			height: 900rpx;
 			position: absolute;
 			top: 0;
 			left: 0;
-			z-index: -1;
+			z-index: -2;
 		}
 
 		.nav-icon {
@@ -625,6 +658,8 @@
 						width: 444rpx;
 						height: 66rpx;
 						line-height: 66rpx;
+						color: #666;
+						font-size: 30rpx;
 					}
 				}
 			}

BIN
static/img/index/dw.png


BIN
static/img/index/ss.png


BIN
static/img/takeout/add.png


BIN
static/img/takeout/j.png