Ver Fonte

Merge branch 'group'

py há 2 anos atrás
pai
commit
d1bd4bc728

+ 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');

+ 3 - 1
api/alumni.js

@@ -30,4 +30,6 @@ export const alumnInfo = (data) => request(newsUrl + 'info', 'post', { ...data }
 // 自己发布的帖子
 export const alumnMyAlumni = (data) => request(newsUrl + 'my_alumni', 'post', { ...data },false)
 // 删除帖子
-export const alumniDel = (data) => request(newsUrl + 'del', 'post', { ...data },false)
+export const alumniDel = (data) => request(newsUrl + 'del', 'post', { ...data },false)
+// 获取热门帖子列表
+export const alumniHeatList = (data) => request(newsUrl + 'heat_list', 'post', { ...data },false)

+ 3 - 1
api/category.js

@@ -8,4 +8,6 @@ export const getTicket = (data) => request(newsUrl + 'ticket', 'post', { ...data
 // 校友圈话题分类
 export const getTopic = (data) => request(newsUrl + 'topic', 'post', { ...data },false)
 // 干洗分类
-export const getLaundry = (data) => request(newsUrl + 'laundry', 'post', { ...data },false)
+export const getLaundry = (data) => request(newsUrl + 'laundry', 'post', { ...data },false)
+// 获取团购分类
+export const getGroup = (data) => request(newsUrl + 'group', 'post', { ...data },false)

+ 8 - 0
common/css/common.css

@@ -298,6 +298,10 @@ image {
 	color: #57CAFF;
 }
 
+.fc-96ECFB {
+	color: #96ECFB;
+}
+
 .fc-FB3D03 {
 	color: #ff3422;
 }
@@ -371,6 +375,10 @@ image {
 	background-color: #FCE7E2;
 }
 
+.bgc-F5F5F6 {
+	background-color: #F5F5F6;
+}
+
 .bgc-F4F5F7 {
 	background-color: #F4F5F7;
 }

+ 2 - 1
manifest.json

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

+ 238 - 138
pages-buy/group.vue

@@ -1,39 +1,47 @@
 <template>
 	<view class="group-box iPhone-bottom box-border-box flex-common-css">
-		<Nav title='团购专区'></Nav>
-		<scroll-view :scroll-y="true" class="scroll-view-css">
-			<image class="head-img" src="@/static/img/buy/group-bg.png" mode="scaleToFill"></image>
-			<view class="box-border-box content-b">
-				<view class="box-card box-border-box mb-20" v-for="(item,i) in list" :key="i" @click="todet(item)">
-					<image class="goods-img mb-16" :src="item.cover_img" mode="aspectFill"></image>
-					<view class="text-overflow-ellipsis fs-32 fw-600 mb-20 w-100100">
-						{{item.title}}
+		<Nav class="nav-b" title='团购专区'></Nav>
+		<scroll-view :scroll-y="true" class="scroll-view-box" @scroll='scroll' @scrolltolower="scrolltolower"
+			:scroll-top='scroll_top' :scroll-with-animation="false">
+			<view class="">
+				<view class="p-12-24 box-border-box class-b">
+					<view class="display-flex p-24 box-border-box nav-list bgc-f b-rad-16 mb-12">
+						<view class="text-align-center nav-item" v-for="(item,i) in navList" :key="i"
+							@click="selectType(item.id)">
+							<image class="nav-img" :src="item.img" mode="scaleToFill"></image>
+							<view class="fs-24 w-96" :class="navId == item.id?'fw-600 fc-41ABF5':'fw-400'">{{item.name}}
+							</view>
+						</view>
 					</view>
-					<view class="mb-40 flex-justify-space align-items-center">
-						<view class="jd-f">
-							<view class="jd-1"></view>
-							<view class="jd-2" :style="{width:setWidth(item.number,item.sales)+'rpx'}"></view>
+				</view>
+				<view class="p-12-24 box-border-box sift-box align-items-center" :class="siftType?'bgc-f':''">
+					<view class="mr-20 sift-item align-items-center flex-justify-center"
+						:class="[{'bgc-F5F5F6':siftType},{'bgc-f':!siftType},{'siftClass':siftClassID === 1}]"
+						@click="siftClick(1)">
+						<view class="" :class="[{'fc-41ABF5':siftClassID === 1}]">
+							{{siftDistance}}
 						</view>
-						<view class="">
-							<span class="fs-24 fc-9">已团</span>
-							<span class="fs-24 ">{{item.sales}}件</span>
-							<span class="fs-24 fc-9">/剩</span>
-							<span class="fs-24 ">{{item.number - item.sales}}</span>
+					</view>
+					<view class="mr-12 sift-item align-items-center flex-justify-center"
+						:class="[{'bgc-F5F5F6':siftType},{'bgc-f':!siftType},{'siftClass':siftClassID === 2}]"
+						@click="siftClick(2)">
+						<view class="" :class="[{'fc-41ABF5':siftClassID === 2}]">
+							{{siftSort}}
 						</view>
 					</view>
 
-					<view class="info-box display-flex">
-						<view class="flex-1">
-							<span class="fs-28 fc-FB3D03 fw-400">团购价¥</span>
-							<span class="fs-40 fc-FB3D03 fw-600">{{item.price}}</span>
-						</view>
-						<view class="info-box-qiang">
-							<image class="qiang-img" src="@/static/img/buy/qiang.png" mode="scaleToFill"></image>
-							<view class="jiang-box fc-65420c fs-24 fw-600">直降</view>
-							<view class="jiang-box-1 fs-24 fc-65420c fw-600">¥{{item.line_price - item.price}}</view>
-							<image class="jiang-img" src="@/static/img/buy/x-jt.png" mode="scaleToFill"></image>
+				</view>
+				<view class="pop-box" :style="[{'top': pop_top + 'px'}]" :class="[{'pop-box-z':pop_type}]">
+					<view class="pop-content" :class="pop_type?'pop-box-true':'pop-box-false'">
+						<view class="">
+							1111111111111111111000000000000000000000000000000000000000000000000000000000
 						</view>
 					</view>
+					<view v-show="pop_type" class="pop-mask" @click="pop_type = !pop_type"></view>
+				</view>
+				<view class="p-12-24 box-border-box">
+					<view class="h-200" v-for="(item,index) in 10">
+					</view>
 				</view>
 			</view>
 		</scroll-view>
@@ -46,15 +54,34 @@
 	} from '@/api/groupOrder.js';
 	import tools from "@/service/tools";
 	import EnBlank from "@/components/en-utils/en-blank/en-blank";
+	import {
+		getGroup
+	} from "@/api/category.js"
 	export default {
 		components: {
 			EnBlank
 		},
 		data() {
 			return {
+				navId: 0,
+				navList: [{
+					name: "全部",
+					id: 0,
+					img: require('@/static/img/buy/t-all.png')
+				}],
+				siftType: false, // 粘性状态
+				siftClassID: 0, // 粘性样式Id
+				scrollTopNum: 0, //当前滚动条高度
+				scroll_top: 0, //滚动条高度
+				pop_top: 0, // pop距头部距离
+				pop_type: false,
+				pop_type_two: false,
+				navListHeight: '', //头部模块高度
+				siftDistance: '附近', //距离筛选
+				siftSort: '距离优先', //排序筛选
 				page: 1,
 				total: 0,
-				list: [],
+				list: []
 			}
 		},
 		onReachBottom() {
@@ -64,12 +91,81 @@
 			}
 		},
 		onShow() {
+			this.getGroup()
 			this.page = 1;
 			this.list = [];
 			this.getList();
 		},
-		mounted() {},
+		onLoad() {},
+		mounted() {
+			this.getHeight()
+		},
 		methods: {
+			siftClick(num) {
+				this.scroll_top = this.scrollTopNum
+				this.$nextTick(function() {
+					this.scroll_top = this.navListHeight
+				});
+				setTimeout(() => {
+					this.siftClassID = num
+					this.pop_type = true
+				}, 400)
+			},
+			scroll(e) {
+				this.scrollTopNum = e.detail.scrollTop
+				if (e.detail.scrollTop > (this.navListHeight - 1)) {
+					this.siftType = true
+				} else {
+					this.siftType = false
+				}
+			},
+			getHeight() {
+				const query = uni.createSelectorQuery().in(this);
+				query.select('.class-b').boundingClientRect(data => {
+					if (data) {
+						// data.height 就是元素的高度
+						this.navListHeight = data.height
+					}
+				}).exec()
+				let Hone = 0
+				uni.getSystemInfo({
+					success: (e) => {
+						let statusBarH = e.statusBarHeight + 10
+						let custom = 0;
+						custom = wx.getMenuButtonBoundingClientRect()
+						let customBarH = custom.height;
+						Hone = statusBarH + customBarH;
+					}
+				})
+				let HTwo = 0
+				const navT = uni.createSelectorQuery().in(this);
+				navT.select('.sift-box').boundingClientRect(data => {
+					if (data) {
+						// data.height 就是元素的高度
+						HTwo = data.height
+						console.log(HTwo, '222222222');
+					}
+				}).exec();
+				setTimeout(() => {
+					this.pop_top = Number(Hone) + Number(HTwo)
+					console.log(this.pop_top, '-----------');
+				}, 500)
+			},
+			scrolltolower(e) {
+				console.log(e);
+			},
+			getGroup() {
+				let operate_id = uni.getStorageSync('operate_id');
+				let school_id = uni.getStorageSync('school_id');
+				getGroup({
+					operate_id: operate_id,
+					school_id: school_id
+				}).then((res) => {
+					if (res.code === 1) {
+						this.navList = [...this.navList, ...res.data]
+					}
+				})
+			},
 			getList() {
 				let school_id = uni.getStorageSync('school_id');
 				groupList({
@@ -82,127 +178,131 @@
 					}
 				})
 			},
-
-			setWidth(total, num) {
-				let w = 0
-				let tH = 434;
-				w = (tH / total * num).toFixed(0)
-				console.log(w);
-				return w
-			},
 			todet(item) {
 				uni.navigateTo({
 					url: '/pages-buy/group-det?id=' + item.id
 				})
-			},
+			}
 		},
 	}
 </script>
 
 <style scoped lang="scss">
-	.content-b {
-		padding: 0 24rpx 24rpx;
-	}
-
-	.jd-f {
-		position: relative;
-		width: 434rpx;
-		height: 18rpx;
-
-		.jd-1 {
-			position: absolute;
-			top: 0;
-			left: 0;
-			width: 434rpx;
-			height: 18rpx;
-			background: #FEE0E0;
-			border-radius: 200rpx 200rpx 200rpx 200rpx;
-			z-index: 10;
-		}
-
-		.jd-2 {
-			position: absolute;
-			top: 0;
-			left: 0;
-			height: 18rpx;
-			background: linear-gradient(90deg, #FF545D 0%, #FF4B84 100%);
-			// background-color: #FF2652;
-			border-radius: 200rpx 200rpx 200rpx 200rpx;
-			z-index: 12;
-		}
-	}
-
-
-	.group-box {
-		background-color: #EF2864;
-		height: 100vh;
-
-		.head-img {
-			width: 100%;
-			height: 422rpx;
-		}
-
-		.box-card {
-			width: 100%;
-			min-height: 100rpx;
-			background: #FFFFFF;
-			padding: 16rpx;
-			box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(51, 51, 51, 0.1);
-			border-radius: 20rpx;
-
-			.goods-img {
-				width: 100%;
-				height: 452rpx;
-				border-radius: 20rpx;
-				// margin-top: 24rpx;
-			}
+	.pop-box {
+		width: 100%;
+		// height: 100vh;
+		height: 84rpx;
+		position: fixed;
+		left: 0;
+		top: 0;
+		overflow: hidden;
+		// z-index: -1;
+		// transition: all 0.3s ease-in-out;
+	}
+	// .pop-box-z {
+	// 	z-index: 2;
+	// 	transition: all 0.3s ease-in-out;
+	// }
+	.pop-box-true {
+		// display: block;
+		// transition: all .3s inherit;
+		/* 定义过渡效果 */
+		transition: transform 0.3s ease-in-out;
+		transform: translateY(0);
+	}
 
-			.info-box {
-				width: 100%;
-				height: 72rpx;
-				background: #FEE0E0;
-				border-radius: 20rpx;
-				line-height: 72rpx;
-				padding-left: 14rpx;
-				box-sizing: border-box;
-
-				.info-box-qiang {
-					width: 148rpx;
-					height: 72rpx;
-					background: #F63E36;
-					border-radius: 0rpx 20rpx 20rpx 0rpx;
-					position: relative;
-
-					.qiang-img {
-						width: 60rpx;
-						height: 60rpx;
-						margin: 6rpx 22rpx 0 auto;
-					}
+	.pop-box-false {
+		// display: none;
+		transition: transform 0.3s ease-in-out;
+		transform: translateY(-100%);
+	}
 
-					.jiang-box {
-						position: absolute;
-						top: -30rpx;
-						left: -22rpx;
-						z-index: 20;
-					}
+	.pop-content {
+		width: 100%;
+		height: 500rpx;
+		background: #fff;
+		border-radius: 0 0 20rpx 20rpx;
+		position: absolute;
+		left: 0;
+		// top: var(--pop_top)px;
+		z-index: 10;
+		// transition: all .3s inherit;
+		/* 定义过渡效果 */
+		/* 初始平移状态 */
+	}
 
-					.jiang-box-1 {
-						position: absolute;
-						top: 0rpx;
-						left: -30rpx;
-						z-index: 20;
-					}
+	.pop-mask {
+		width: 100%;
+		height: 100%;
+		background: rgba(0, 0, 0, .5);
+		position: absolute;
+		left: 0;
+		// top: 0;
+	}
 
-					.jiang-img {
-						position: absolute;
-						width: 120rpx;
-						height: 90rpx;
-						left: -60rpx;
-						bottom: 0;
-						z-index: 11;
-					}
-				}
-			}
-		}
+	.siftClass {
+		color: #41ABF5;
+		border: 1rpx solid #41ABF5;
+		background: #deeffb;
+		box-sizing: border-box;
+	}
+
+	.h-200 {
+		width: 100%;
+		height: 200px;
+		margin-bottom: 20px;
+		background: rebeccapurple;
+	}
+
+	.scroll-view-box {
+		overflow: auto;
+	}
+
+	.sift-box {
+		position: sticky;
+		top: 0;
+		left: 0;
+		z-index: 200;
+		overflow-x: scroll;
+	}
+
+	.sift-content-box {
+		width: 100%;
+		height: 300rpx;
+		position: absolute;
+		top: 74rpx;
+		left: 0;
+	}
+
+	.sift-item {
+		min-width: 150rpx;
+		max-width: 280rpx;
+		height: 60rpx;
+		line-height: 60rpx;
+		border-radius: 8rpx;
+		transition: all .5s ease;
+	}
+
+	.group-box {}
+
+	.nav-list {
+		overflow-x: scroll;
+	}
+
+	.nav-item {
+		width: 96rpx;
+		height: 126rpx;
+		margin-right: 48rpx;
+	}
+
+	.nav-img {
+		width: 80rpx;
+		height: 80rpx;
+		border-radius: 5px;
+		margin: 0 auto 12rpx auto;
+	}
+
+	.w-96 {
+		// width: 96rpx;
 	}
 </style>

+ 0 - 2
pages-my/my-publish.vue

@@ -610,9 +610,7 @@
 		line-height: 88rpx;
 		background: linear-gradient(284deg, #0290FC 0%, #01D8FF 100%);
 	}
-
 	.pop-box {
-
 		width: 100%;
 		height: 50vh;
 		background-color: #fff;

+ 5 - 1
pages-my/notice/list.vue

@@ -35,8 +35,12 @@
 		},
 		methods: {
 			getList() {
+				let operate_id = uni.getStorageSync('operate_id');
+				let school_id = uni.getStorageSync('school_id');
 				noticeList({
-					page: this.page
+					page: this.page,
+					operate_id: operate_id,
+					school_id: school_id
 				}).then((res) => {
 					if (res.code === 1) {
 						this.list = [...this.list, ...res.data.items];

+ 4 - 1
pages-my/set-user-name.vue

@@ -3,7 +3,7 @@
 		<Nav title="昵称" titleColor="#333" bgckgroundBox='#fff'></Nav>
 		<scroll-view :scroll-y="true" class="scroll-view-css">
 			<view class="content-box box-border-box">
-				<input v-model="fromData.nickname" class="uni-input mb-16 fs-28" focus placeholder="请输入昵称" maxlength="20" />
+				<input v-model="fromData.nickname" class="uni-input mb-16 fs-28" type="nickname" placeholder="请输入昵称" maxlength="20" @change="getNickname" />
 				<view class="fs-24 fc-9 mb-80">
 					昵称由中文、英文、数字、组合
 				</view>
@@ -40,6 +40,9 @@
 					}
 				})
 			},
+			getNickname(e) {
+				this.fromData.nickname = e.detail.value
+			},
 			save(){
 				if(this.isAJAX){
 					return

+ 17 - 1
pages-my/user-info.vue

@@ -2,7 +2,8 @@
 	<view class="flex-common-css bgc-f">
 		<Nav title="个人资料" titleColor="#333" bgckgroundBox='#fff'></Nav>
 		<scroll-view :scroll-y="true" class="scroll-view-css">
-			<view class="user-img-box b-rad-50" @click="goToUrl(0)">
+			<view class="user-img-box b-rad-50">
+				<button class="but-box" open-type="chooseAvatar" @chooseavatar='chooseavatar'></button>
 				<image class="user-img b-rad-50" :src="userInfoData.head_img" mode="aspectFill"></image>
 				<image class="set-iimg" src="@/static/img/my/pen.png" mode=""></image>
 			</view>
@@ -80,6 +81,10 @@
 			this.commonApplet()
 		},
 		methods: {
+			chooseavatar(e) {
+				this.userUpdate(e.detail.avatarUrl)
+				console.log(e);
+			},
 			commonApplet() {
 				commonApplet().then((res) => {
 					if (res.code == 1) {
@@ -160,6 +165,17 @@
 		margin: 98rpx auto 0;
 	}
 
+	.but-box {
+		width: 144rpx;
+		height: 144rpx;
+		position: absolute;
+		left: 0;
+		top: 0;
+		background: transparent;
+		border: none;
+		border-radius: 50%;
+	}
+
 	.user-img {
 		width: 100%;
 		height: 100%;

+ 72 - 26
pages-takeout/shop-mod/menu.vue

@@ -10,17 +10,19 @@
 				</view>
 			</view>
 		</scroll-view>
-		<scroll-view :scroll-y="true" :scroll-with-animation='true' :scroll-into-view="idMark" @scroll="menuScroll">
+		<scroll-view :scroll-y="true" :scroll-with-animation='true' :scroll-into-view="idMarkTwo" @scroll="menuScroll">
 			<view class="menu-box-right">
 				<view class="menu-box-only" v-for="(item,i) in categoryData" :key="i" :id="'scroll'+ item.type">
 					<view class="mb-32 fs-30">{{item.name}}</view>
-					<view class="menu-list flex-justify-space" v-for="(info,k) in item.list" :key="k">
+					<view class="menu-list flex-justify-space" v-for="(info,k) in item.list" :key="k"
+						:id="'scroll'+ info.goods_id">
 						<image class="flex-shrink0 goods_img" :src="info.goods_image" mode="scaleToFill"></image>
 						<view class="menu-list-right flex-direction flex-justify-space">
 							<view class="mb-8">
 								<view class="mb-4 goods-name text-overflow-ellipsis fs-32 fw-600">{{info.goods_name}}
 								</view>
-								<view class="text-overflow-ellipsis-one fw-400 fc-9 fs-24 mb-2 goods-name" v-if="info.spec_type == 1">
+								<view class="text-overflow-ellipsis-one fw-400 fc-9 fs-24 mb-2 goods-name"
+									v-if="info.spec_type == 1">
 									{{info.goods_desc}}
 								</view>
 								<view class="fw-400 fc-9 fs-24">月销{{info.sales}}</view>
@@ -152,6 +154,7 @@
 		data() {
 			return {
 				idMark: '', //滚动自适应参数
+				idMarkTwo: '', //滚动自适应参数
 				type: 1, //分类标识
 				typeList: [],
 				categoryData: [],
@@ -198,7 +201,6 @@
 			this.operate_id = uni.getStorageSync('operate_id')
 			this.getShopGoods();
 			this.getShopIngList(true);
-
 		},
 		methods: {
 			setSpecNum(type) {
@@ -222,8 +224,6 @@
 						// 加
 						++this.popData.num;
 					}
-
-
 				}
 
 			},
@@ -348,47 +348,79 @@
 				}).then(res => {
 					if (res.code === 1) {
 						this.categoryData = res.data
-						if (this.categoryData.length > 0) {
+						const category_id = uni.getStorageSync('category_id')
+						const goods_id = uni.getStorageSync('goods_id')
+						if (category_id.type && category_id.type != 'undefined') {
+							console.log('走跳转');
+							this.selectType(category_id, goods_id)
+						} else {
+							console.log('没走跳转');
 							this.selectType(this.categoryData[0])
 						}
+						// if (this.categoryData.length > 0) {
+						// 	this.selectType(this.categoryData[0])
+						// }
 						this.categoryData.forEach(categoryItem => {
 							categoryItem.list.forEach(goodsItem => {
 								goodsItem.payNum = 0
 								goodsItem.spec = []
 							})
 						})
-						// console.log(res)
 						setTimeout(() => {
 							this.setGoodsNum()
 						}, 1000)
 					}
 				})
 			},
-			selectType(item) {
+			selectType(item, itemTwo) {
+				console.log(item, itemTwo);
 				if (this.type != item.type) {
 					this.type = item.type;
 					this.idMark = 'scroll' + item.type
+					if (itemTwo) {
+						this.idMarkTwo = 'scroll' + itemTwo.goodsId
+					} else {
+						this.idMarkTwo = this.idMark
+					}
 					this.$forceUpdate()
 				}
 			},
 			menuScroll(e) {
 				let _this = this;
 				let query = uni.createSelectorQuery().in(this);
-				// console.log(e.detail, '%%%%%%%%%%');
-				query.selectAll(".menu-box-only").boundingClientRect(data => {
-					data.forEach((v) => {
-						if (data[this.categoryData.length - 1].top <= 392) {
-							return
-						}
-						// console.log(data[this.categoryData.length - 1].top, '^^^^^^^^^^^^^^');
-						// console.log(v.top, '^^^^^^^^^^^^^^');
-						if (v.top < 332 && v.top > 0) {
-							_this.idMark = v.id;
-							let arr = v.id.split('scroll');
-							_this.type = Number(arr[1]);
-						}
-					})
-				}).exec();
+				const goods_id = uni.getStorageSync('goods_id')
+				console.log(goods_id, "))))))))))))");
+				if (goods_id.goodsId && goods_id.goodsId != 'undefined') {
+					query.selectAll(".menu-list").boundingClientRect(data => {
+						data.forEach((v) => {
+							if (data[this.categoryData.length - 1].top <= 392) {
+								return
+							}
+							if (v.top < 332 && v.top > 0) {
+								// _this.idMark = v.id;
+								let arr = v.id.split('scroll');
+							}
+						})
+						uni.setStorageSync('category_id', '')
+						uni.setStorageSync('goods_id', '')
+					}).exec();
+				} else {
+					query.selectAll(".menu-box-only").boundingClientRect(data => {
+						// console.log(data);
+						data.forEach((v) => {
+							if (data[this.categoryData.length - 1].top <= 392) {
+								return
+							}
+							// console.log(data[this.categoryData.length - 1].top, '^^^^^^^^^^^^^^');
+							// console.log(v.top, '^^^^^^^^^^^^^^');
+							if (v.top < 332 && v.top > 0) {
+								// _this.idMark = v.id;
+								let arr = v.id.split('scroll');
+								_this.type = Number(arr[1]);
+							}
+						})
+					}).exec();
+				}
 			},
 			addred(type, i, k, item) {
 				if (this.isAjax) {
@@ -483,6 +515,12 @@
 							++item.num;
 						}
 						this.getShopIngList()
+					} else if (res.code === 2) {
+						tools.error(res.msg)
+						if (item) {
+							++item.num;
+						}
+						this.getShopIngList()
 					} else {
 						tools.error(res.msg)
 					}
@@ -509,9 +547,17 @@
 							} else {
 								--item.num;
 							}
-
 						}
-
+						this.getShopIngList()
+					} else if (res.code === 2) {
+						tools.error(res.msg)
+						if (item) {
+							if (operation === 2) {
+								++item.num;
+							} else {
+								--item.num;
+							}
+						}
 						this.getShopIngList()
 					} else {
 						tools.error(res.msg)

+ 15 - 2
pages-takeout/shop.vue

@@ -102,7 +102,7 @@
 							<view class="w-514 text-overflow-ellipsis-one fs-34 fw-600 mb-12">
 								{{goods.goods_name}}
 							</view>
-							<view class="w-514 text-overflow-ellipsis-one fs-24 fw-400 fc-9 mb-18">{{goods.goods_attr}}
+							<view class="w-514 text-overflow-ellipsis-one fs-24 fw-400 mb-18" :class="goods.status_str?'fc-FD5C02':'fc-9'">{{goods.status_str?goods.status_str:goods.goods_attr}}
 							</view>
 							<view class="flex-justify-space">
 								<view class="">
@@ -256,8 +256,17 @@
 		},
 		onLoad(e) {
 			if (e) {
+				console.log(e, '^^^^^^^');
 				this.shop_id = e.shop_id
 				this.operate_id = uni.getStorageSync('operate_id')
+				const item = {
+					type: Number(e.category_id)
+				}
+				const goodsId = {
+					goodsId: Number(e.goods_id)
+				}
+				uni.setStorageSync('category_id', item)
+				uni.setStorageSync('goods_id', goodsId)
 				this.shopInfo()
 			}
 		},
@@ -312,6 +321,10 @@
 					if (res.code == 1) {
 						this.isAjax = false
 						this.getShopIngList()
+					} else if (res.code === 2) {
+						tools.error(res.msg)
+						this.isAjax = false
+						this.getShopIngList()
 					} else {
 						tools.error(res.msg)
 						this.isAjax = false
@@ -396,7 +409,7 @@
 				this.$refs.popupBuy.open()
 			},
 			createOrder() {
-				
+				this.$refs.popupBuy.close()
 			},
 			openCoupon() {
 				this.$refs.popupCoupon.open()

+ 1 - 1
pages.json

@@ -425,7 +425,7 @@
 		"current": 0,
 		"list": [{
 				"name": "列表调试",
-				"path": "pages-position/Internship-position",
+				"path": "pages-buy/group",
 				"query": ""
 			},
 			{

+ 122 - 39
pages/index/index.vue

@@ -16,8 +16,7 @@
 			</Nav>
 		</view>
 		<!-- 搜索 -->
-		<view class="index-search box-border-box mt-4" @click="toUrl(1)"
-			:style="[{'top': BarH + 'px','background':bgckgroundSearch}]">
+		<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">
 				<image class="wh32" src="@/static/img/index/ss.png" mode=""></image>
 				<view class="fs-28 fc-9 ml-10">搜索店铺名称或者商品名称</view>
@@ -28,7 +27,7 @@
 			<!-- 轮播 -->
 			<view class="box-border-box plr-24 mb-32">
 				<uni-swiper-dot :info="bannerList" mode="dot" :dotsStyles="dotStyle" :current="current">
-					<swiper class="swiper" @change="change">
+					<swiper class="swiper" @change="change" :autoplay='true' :circular='true' interval="4000">
 						<swiper-item v-for="(item,i) in bannerList" :key="i">
 							<image class="swiper-item" :src="item.image" mode="aspectFill" @click="bannerClock(item)">
 							</image>
@@ -51,12 +50,28 @@
 			<!-- 通知 -->
 			<view class="box-border-box plrb-24">
 				<view class="msg-box align-items-center box-border-box">
-					<image class="image-1" src="@/static/img/index/index-tz.png" mode="scaleToFill"></image>
-					<view class="box-1 fs-20 fc-41ABF5">公告</view>
-					<swiper class="tz-swiper" :vertical="true" circular :autoplay="true" :interval="3000"
-						:duration="500">
-						<swiper-item v-for="(item,i) in noticeList" :key="i" @click="toNoticeDet(item)">
-							<view class="tz-swiper-item">{{item.title}}</view>
+					<view class="rebang-box align-items-center flex-justify-center" @click="goSchool()">
+						<view class="rebang fs-32 fc-f">
+							校园热榜
+						</view>
+						<view class="sj-box"></view>
+					</view>
+					<!-- <image class="image-1" src="@/static/img/index/index-tz.png" mode="scaleToFill"></image> -->
+					<!-- <view class="box-1 fs-20 fc-41ABF5">公告</view> -->
+					<swiper class="tz-swiper p-16 box-border-box" :vertical="true" circular :autoplay="true"
+						:interval="3000" :duration="500">
+						<swiper-item v-for="(item,i) in noticeList" :key="i" @click="toNoticeDet(item)"
+							class="align-items-center flex-justify-space">
+							<view class="fs-30 fc-3 text-overflow-ellipsis mr-16">
+								<span
+									class="fc-FE9E11 fs-30">{{i+1 >= 10?'':'0'}}{{i+1}}</span>{{'&nbsp;' + '&nbsp;' + item.content}}
+							</view>
+							<view class="align-items-center">
+								<image src="@/static/img/my/rd.png" mode="" class="rd-img"></image>
+								<view class="fs-26 fc-96ECFB">
+									+{{item.heat}}
+								</view>
+							</view>
 						</swiper-item>
 					</swiper>
 					<!-- <image class="image-2" src="@/static/img/toRight.png" mode="scaleToFill"></image> -->
@@ -195,6 +210,9 @@
 	</view>
 </template>
 <script>
+	import {
+		alumniHeatList
+	} from '@/api/alumni.js'
 	import enBlankVue from "@/components/en-utils/en-blank/en-blank.vue";
 	import tools from "@/service/tools";
 	import {
@@ -314,24 +332,24 @@
 		},
 
 		onShow() {
-			// let lon = uni.getStorageSync('lon');
-			// let lat = uni.getStorageSync('lat');
-			// if (!lon || !lat) {
-			// 	uni.getLocation({
-			// 		type: "gcj02",
-			// 		success: (res) => {
-			// 			if (res.errMsg === 'getLocation:ok') {
-			// 				uni.setStorageSync('lon', res.longitude);
-			// 				uni.setStorageSync('lat', res.latitude);
-			// 			} else {
-			// 				tools.error('位置授权失败,请检查是否开始授权')
-			// 			}
-			// 		},
-			// 		fail: (res) => {
-			// 			tools.error('位置授权失败,请检查是否开始授权')
-			// 		},
-			// 	})
-			// }
+			let lon = uni.getStorageSync('lon');
+			let lat = uni.getStorageSync('lat');
+			if (!lon || !lat) {
+				uni.getLocation({
+					type: "gcj02",
+					success: (res) => {
+						if (res.errMsg === 'getLocation:ok') {
+							uni.setStorageSync('lon', res.longitude);
+							uni.setStorageSync('lat', res.latitude);
+						} else {
+							tools.error('位置授权失败,请检查是否开始授权')
+						}
+					},
+					fail: (res) => {
+						tools.error('位置授权失败,请检查是否开始授权')
+					},
+				})
+			}
 			let school_id = uni.getStorageSync('school_id');
 			let operate_id = uni.getStorageSync('operate_id');
 			let school_name = uni.getStorageSync('school_name');
@@ -346,7 +364,8 @@
 			}
 			this.commonApplet()
 			this.getBanner();
-			this.getNotice();
+			// this.getNotice();
+			this.alumniHeatList()
 			this.getSeckillGoods();
 			this.getTakeaway();
 			let userToken = uni.getStorageSync('token')
@@ -417,7 +436,12 @@
 				})
 			},
 			commonPopNotice() {
-				commonPopNotice().then((res) => {
+				let operate_id = uni.getStorageSync('operate_id');
+				let school_id = uni.getStorageSync('school_id');
+				commonPopNotice({
+					operate_id: operate_id,
+					school_id: school_id
+				}).then((res) => {
 					const noticeId = uni.getStorageSync('notice_id');
 					if (res.code === 1) {
 						if (res.data.id) {
@@ -530,6 +554,11 @@
 					})
 				}
 			},
+			goSchool() {
+				uni.navigateTo({
+					url: '/pages-school/school-circle'
+				})
+			},
 			receive(item, index) {
 				receiveCoupon({
 					grant_id: item.grant_id,
@@ -566,14 +595,34 @@
 				this.$refs.popup.close()
 			},
 			getBanner() {
-				getBanner().then((res) => {
+				let operate_id = uni.getStorageSync('operate_id');
+				let school_id = uni.getStorageSync('school_id');
+				getBanner({
+					operate_id: operate_id,
+					school_id: school_id
+				}).then((res) => {
 					if (res.code === 1) {
 						this.bannerList = res.data;
 					}
 				})
 			},
+			alumniHeatList() {
+				let school_id = uni.getStorageSync('school_id');
+				alumniHeatList({
+					school_id: school_id
+				}).then((res) => {
+					if (res.code === 1) {
+						this.noticeList = res.data;
+					}
+				})
+			},
 			getNotice() {
-				getNotice().then((res) => {
+				let operate_id = uni.getStorageSync('operate_id');
+				let school_id = uni.getStorageSync('school_id');
+				getNotice({
+					operate_id: operate_id,
+					school_id: school_id
+				}).then((res) => {
 					if (res.code === 1) {
 						this.noticeList = res.data;
 					}
@@ -679,7 +728,8 @@
 				}).then((res) => {
 					if (res.code == 1) {
 						uni.navigateTo({
-							url: '/pages-takeout/shop?shop_id=' + item.shop_id
+							url: '/pages-takeout/shop?shop_id=' + item.shop_id + '&category_id=' + item
+								.category_id + '&goods_id=' + item.goods_id
 						})
 					} else {
 						tools.error(res.msg)
@@ -688,13 +738,42 @@
 			},
 			toNoticeDet(item) {
 				uni.navigateTo({
-					url: '/pages-my/notice/info?id=' + item.id
+					url: '/pages-school/circle-info?news_id=' + item.news_id
 				})
 			},
 		},
 	}
 </script>
 <style lang="scss" scoped>
+	.w-10 {
+		width: 10rpx;
+	}
+
+	.rebang-box {
+		width: 160rpx;
+		height: 130rpx;
+		background: #53C4FD;
+		border-radius: 20rpx 0 0 20rpx;
+		padding: 0 10rpx 0 0;
+		position: relative;
+	}
+
+	.sj-box {
+		width: 0;
+		height: 0;
+		border-top: 20rpx solid transparent;
+		border-right: 20rpx solid #F3F3F3;
+		border-left: 20rpx solid transparent;
+		border-bottom: 20rpx solid transparent;
+		position: absolute;
+		right: -2rpx;
+		top: calc(50% - 20rpx);
+	}
+
+	.rebang {
+		width: 64rpx;
+	}
+
 	.h-60-vh {
 		max-height: 60vh;
 	}
@@ -845,7 +924,7 @@
 
 			.msg-box {
 				width: 100%;
-				height: 66rpx;
+				// height: 66rpx;
 				background: #F7F8FC;
 				border-radius: 12rpx;
 				padding: 0 14rpx;
@@ -873,13 +952,12 @@
 				}
 
 				.tz-swiper {
-					width: 444rpx;
-					height: 66rpx;
+					width: 100%;
+					height: 130rpx;
+					background: #F3F3F3;
+					border-radius: 0 20rpx 20rpx 0;
 
 					.tz-swiper-item {
-						width: 444rpx;
-						height: 66rpx;
-						line-height: 66rpx;
 						color: #666;
 						font-size: 30rpx;
 					}
@@ -1146,4 +1224,9 @@
 		height: 60rpx;
 		line-height: 60rpx;
 	}
+
+	.rd-img {
+		width: 40rpx;
+		height: 40rpx;
+	}
 </style>

+ 4 - 2
pages/order/index.vue

@@ -248,7 +248,9 @@
 			};
 		},
 		onShow() {
-			uni.showTabBar()
+			setTimeout(() => {
+				uni.showTabBar()
+			}, 400)
 			let orderPayType = uni.getStorageSync('orderPayType')
 			let orderInfoType = uni.getStorageSync('orderInfoType')
 			console.log(orderPayType, 'orderPayType');
@@ -257,7 +259,7 @@
 				this.selectType(orderPayType)
 				console.log('固定type');
 			} else if (orderInfoType) {
-				
+
 			} else {
 				this.resetList();
 			}