zpj пре 2 година
родитељ
комит
d9928ea5f2

+ 2 - 2
.env.dev.js

@@ -1,6 +1,6 @@
 const config = {
-	baseUrl: '',
-	socketUrl: '',
+	baseUrl: 'http://test-userapi.sjzkeji.com',
+	socketUrl: 'http://test-userapi.sjzkeji.com',
     appName:'开发环境'
 }
 module.exports = config;

+ 2 - 2
.env.prod.js

@@ -1,6 +1,6 @@
 const config = {
-    baseUrl: '',
-    socketUrl: '',
+    baseUrl: 'http://test-userapi.sjzkeji.com',
+    socketUrl: 'http://test-userapi.sjzkeji.com',
     appName:'正式环境'
 }
 module.exports = config;

+ 6 - 0
api/category.js

@@ -0,0 +1,6 @@
+import {request} from '../service/ajax.js'
+
+const newsUrl = '/api/category/'
+// 用户注册登陆
+export const getTakeaway = (data) => request(newsUrl + 'takeaway', 'post', { ...data },false)
+

+ 8 - 5
api/common.js

@@ -1,8 +1,11 @@
 import {request} from '../service/ajax.js'
 
 const commonUrl = '/api/common/'
-// 发送短信
-export const commonSend = (data) => request(commonUrl + 'send', 'post', { ...data })
-// 获取sts
-export const getSts = (data) => request(commonUrl + 'sts', 'post', { ...data })
-
+// 获取协议
+export const getAgreement = (data) => request(commonUrl + 'agreement', 'post', { ...data })
+// 获取学校
+export const getSchoolList = (data) => request(commonUrl + 'school', 'post', { ...data })
+// 获取首页公告
+export const getNotice = (data) => request(commonUrl + 'notice', 'post', { ...data })
+// 获取轮播图
+export const getBanner = (data) => request(commonUrl + 'banner', 'post', { ...data })

+ 11 - 0
api/goods.js

@@ -0,0 +1,11 @@
+import {request} from '../service/ajax.js'
+
+const newsUrl = '/api/goods/'
+// 用户注册登陆
+export const getGoodsList = (data) => request(newsUrl + 'list', 'post', { ...data },false)
+// 搜索商品列表
+export const getSearch = (data) => request(newsUrl + 'search', 'post', { ...data },false)
+// 获取搜索历史内容
+export const getSearchList = (data) => request(newsUrl + 'search_list', 'post', { ...data },false)
+// 删除搜索历史
+export const delSearch = (data) => request(newsUrl + 'del_search', 'post', { ...data },false)

+ 0 - 6
api/login.js

@@ -1,6 +0,0 @@
-import {request} from '../service/ajax.js'
-
-const newsUrl = '/api/user/'
-// 登陆
-export const login = (data) => request(newsUrl + 'login', 'post', { ...data },false)
-export const resetPwd = (data) => request(newsUrl + 'resetpwd', 'post', { ...data },false)

+ 6 - 0
api/member.js

@@ -0,0 +1,6 @@
+import {request} from '../service/ajax.js'
+
+const newsUrl = '/api/member/'
+// 用户注册登陆
+export const appletLogin = (data) => request(newsUrl + 'appletLogin', 'post', { ...data },false)
+

+ 7 - 0
api/notice.js

@@ -0,0 +1,7 @@
+import {request} from '../service/ajax.js'
+
+const newsUrl = '/api/notice/'
+// 获取公告列表
+export const noticeList = (data) => request(newsUrl + 'list', 'post', { ...data },false)
+// 获取公告详情
+export const noticeInfo = (data) => request(newsUrl + 'info', 'post', { ...data },false)

+ 5 - 0
api/seckill.js

@@ -0,0 +1,5 @@
+import {request} from '../service/ajax.js'
+
+const newsUrl = '/api/seckill/'
+// 秒杀商品
+export const getSeckillGoods = (data) => request(newsUrl + 'goods', 'post', { ...data },false)

+ 0 - 58
api/task.js

@@ -1,58 +0,0 @@
-import {request} from '@/service/ajax.js'
-
-const newsUrl = '/api/task/'
-// 获取基本信息
-export const getTaskType = (data) => request(newsUrl + 'type', 'post', { ...data },false)
-export const getTaskTypeInfo = (data) => request(newsUrl + 'type-info', 'post', { ...data },true)
-//获取任务基本选项信息
-export const getTaskOptions = (data) => request(newsUrl + 'options', 'post', { ...data },true)
-//获取联系人关系
-export const getTaskRelations = (data) => request(newsUrl + 'relations', 'post', { ...data },true)
-export const getClientInfo = (data) => request(newsUrl + 'client', 'post', { ...data },true)
-export const addTask = (data) => request(newsUrl + 'add', 'post', { ...data },true)
-// 任务详情
-export const getTaskDetail = (data) => request(newsUrl + 'detail', 'post', { ...data },true)
-//任务接单
-export const takeTask = (data) => request(newsUrl + 'take', 'post', { ...data },true)
-//审核
-export const auditTask = (data) => request(newsUrl + 'audit', 'post', { ...data },true)
-export const setMsg = (data) => request(newsUrl + 'add-msg', 'post', { ...data },true)
-export const getMsgList = (data) => request(newsUrl + 'msg-list', 'post', { ...data },false)
-export const getExecuteList = (data) => request(newsUrl + 'execute-list', 'post', { ...data },false)
-export const setExecute = (data) => request(newsUrl + 'set-execute', 'post', { ...data },false)
-export const getTaskStage = (data) => request(newsUrl + 'stage', 'post', { ...data },false)
-export const setExecuteTask = (data) => request(newsUrl + 'execute', 'post', { ...data },true)
-//获取可接单列表
-export const getTaskReceiving = (data) => request(newsUrl + 'receiving', 'post', { ...data },false)
-export const getTaskList = (data) => request(newsUrl + 'task-list', 'post', { ...data },false)
-export const endTask = (data) => request(newsUrl + 'end', 'post', { ...data },false)
-export const cancellation = (data) => request(newsUrl + 'cancellation', 'post', { ...data },false)
-export const delTask = (data) => request(newsUrl + 'del', 'post', { ...data },false)
-export const getStageList = (data) => request(newsUrl + 'stage-list', 'post', { ...data },false)
-export const getStageUser = (data) => request(newsUrl + 'stage-user', 'post', { ...data },false)
-export const getBusinessStageList = (data) => request(newsUrl + 'business-stage', 'post', { ...data },false)
-export const getBusinessCache = (data) => request(newsUrl + 'get-cache', 'post', { ...data },false)
-export const setBusinessCache = (data) => request(newsUrl + 'set-cache', 'post', { ...data },false)
-export const delBusinessCache = (data) => request(newsUrl + 'del-cache', 'post', { ...data },true)
-
-// 草稿Api
-export const addDraft = (data) => request(newsUrl + 'draft-add', 'post', { ...data },true)
-export const getDraftList = (data) => request(newsUrl + 'draft-list', 'post', { ...data },true)
-export const getDraftItem = (data) => request(newsUrl + 'draft-item', 'post', { ...data },true)
-export const delDraft = (data) => request(newsUrl + 'draft-del', 'post', { ...data },true)
-//阶段操作
-export const setStageOperate = (data) => request(newsUrl + 'operate', 'post', { ...data },true)
-export const getReturnedBankList = (data) => request(newsUrl + 'banks', 'post', { ...data },true)
-//录入数据校验
-export const verifyBusinessModuleKey = (data) => request(newsUrl + 'verify', 'post', { ...data },true)
-
-export const getWeekList = (data) => request(newsUrl + 'week', 'post', { ...data },true)
-export const getDayBacklogList = (data) => request(newsUrl + 'backlog', 'post', { ...data },true)
-export const setDayBacklog = (data) => request(newsUrl + 'status', 'post', { ...data },true)
-export const getProductData = (data) => request(newsUrl + 'product-data', 'post', { ...data },true)
-export const setPostLoan = (data) => request(newsUrl + 'set-loan', 'post', { ...data },true)
-
-
-// 贷后管理列表
-export const getLoanList = (data) => request(newsUrl + 'loan-list', 'post', { ...data },true)
-export const getAdjust = (data) => request(newsUrl + 'adjust', 'post', { ...data },true)

+ 0 - 6
api/weChat.js

@@ -1,6 +0,0 @@
-import { request } from '@/service/ajax'
-// 商品模块路由
-const url = '/api/weChat/'
-// 猜你喜欢
-export const getWxJsSign = (data) => request(url + 'js-config', 'post', { ...data })
-

+ 4 - 5
components/en-utils/en-blank/en-blank.vue

@@ -1,9 +1,7 @@
 <template>
 	<view class="blank-page" v-if="showBlank">
 		<view class="blank-img-box">
-			<text class="iconfont">
-				&#xe614;
-			</text>
+			<image src="@/static/img/blank/no-goods.png" mode=""></image>
 		</view>
 		<view class="blank-text">
 			<text>{{message}}</text>
@@ -71,8 +69,9 @@
 		display: flex;
 		justify-content: center;
 		width: 100%;
-		.iconfont{
-		  font-size: 200rpx;
+		image{
+			width: 200rpx;
+			height: 200rpx;
 		}
 	}
 

+ 1 - 1
manifest.json

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

+ 85 - 17
pages-address/select-school.vue

@@ -1,29 +1,34 @@
 <template>
 	<view class="select-school-index iPhone-bottom flex-common-css box-border-box">
-		<Nav title='选择学校'></Nav>
+		<Nav  :leftShow='leftShow' title='选择学校'></Nav>
 		
 		<view class="bgc-f box-border-box p-24 mb-28">
 			<view class="head-search mb-32">
-				<input type="text" placeholder="搜索学校名称">
-				<view class="fs-28 fc-f index-search-box-buttom">搜索</view>
+				<input v-model="fromData.search" type="text" placeholder="搜索学校名称">
+				<view class="fs-28 fc-f index-search-box-buttom" @click="search()">搜索</view>
 			</view>
 			
-			<view class="head-address display-flex">
+			<view class="head-address display-flex" v-if="schoolData.school_name">
 				<uni-icons type="location-filled" size="24"></uni-icons>
 				<view class="ml-16">
-					<view class="fs-36 fw-600 mb-12">四川外语大学重南岸翻译学校(綦江校区)</view>
-					<view class="fs-28 fw-400" @click="openPop()">楼栋1</view>
+					<view class="fs-36 fw-600 mb-12">{{schoolData.school_name||''}}</view>
 				</view>
 			</view>
 		</view>
 		
-		<scroll-view scroll-y="true" class="scroll-view-css bgc-f box-border-box plr-32">
-			<view class="item-box fs-32 fw-400" v-for="(item,i) in 20" :key="i">
-				四川外国语大学重庆南方翻译学院(渝北校区)四川外国语大学重庆南方翻译学院
+		<view class="box-border-box p-24 fs-28 fc-9 bgc-f">其他学校</view>
+		
+		<view class="scroll-view-css" v-if="list.length == 0">
+			<EnBlank message="没有找到你搜索的学校"></EnBlank>
+		</view>
+		<scroll-view v-else scroll-y="true" class="scroll-view-css bgc-f box-border-box plr-32" @scrolltolower="scrolltolower">
+			
+			<view class="item-box fs-32 fw-400" v-for="(item,i) in list" :key="i" @click="selectSchool(item)">
+				{{item.school_name}}
 			</view>
 		</scroll-view>
 		
-		<uni-popup ref="popup" type="bottom">
+		<!-- <uni-popup ref="popup" type="bottom">
 			<view class="pop-coupon box-border-box p-24">
 				<view class="text-align-center fs-36 fw-600 box-title mb-32">
 					请选择楼栋
@@ -37,32 +42,95 @@
 				<view class="scroll-view-css">
 					<view class="item-box item-box-f fs-32 fw-400" 
 					v-for="(item,i) in 20" :key="i" :class="id == i?'fc-41ABF5':''">
-						<!-- <image src="@/static/img/common/n-select.png" mode=""></image> -->
 						<image src="@/static/img/common/y-select.png" mode=""></image>
 						楼栋1
 					</view>
 				</view>
 			</view>
-		</uni-popup>
+		</uni-popup> -->
 	</view>
 </template>
 
 <script>
+	import EnBlank from '@/components/en-utils/en-blank/en-blank.vue';
+ 	import {getSchoolList} from '@/api/common.js';
+	import tools from "@/service/tools";
 	export default {
+		components:{EnBlank},
 		data(){
 			return{
+				indexType:1,//1首页 2校友圈
+				leftShow:true,
 				id:0,
+				
+				total:0,
+				list:[],
+				fromData:{
+					search:'',
+					page:1,
+				},
+				schoolData:{
+					school_name:'',
+				},
 			}
 		},
+		onLoad(e) {
+			this.indexType = Number(e.type);
+		},
 		onShow() {
-			
+			let school_id = uni.getStorageSync('school_id');
+			let operate_id = uni.getStorageSync('operate_id');
+			let school_name = uni.getStorageSync('school_name');
+			if(!school_id||!operate_id){
+				this.leftShow = false;
+			}else{
+				this.leftShow = true;
+				this.schoolData.school_name = school_name;
+			}
+			this.list = [];
+			this.fromData.page = 1;
+			this.fromData.search = '';
+			this.getList();
 		},
 		methods:{
-			openPop(){
-				this.$refs.popup.open()
+			getList(){
+				getSchoolList(this.fromData).then((res)=>{
+					if(res.code === 1){
+						this.list = [...this.list,...res.data.items];
+						this.total = res.data.total;
+					}
+				})
 			},
-			closePop(){
-				this.$refs.popup.close()
+			scrolltolower(){
+				if(this.list.length < this.total){
+					this.fromData.page += 1;
+					this.getList();
+				}
+			},
+			
+			search(){
+				this.list = [];
+				this.fromData.page = 1;
+				this.getList();
+			},
+			
+			selectSchool(item){
+				uni.setStorageSync('school_id',item.school_id);
+				uni.setStorageSync('operate_id',item.operate_id);
+				uni.setStorageSync('school_name',item.school_name);
+				if(this.leftShow){
+					if(type == 1){
+						uni.switchTab({
+							url:'/pages/index/index'
+						})
+					}else{
+						// 跳转校友圈
+					}
+				}else{
+					uni.switchTab({
+						url:'/pages/index/index'
+					})
+				}
 			},
 		},
 	}

+ 42 - 0
pages-my/notice/info.vue

@@ -0,0 +1,42 @@
+<template>
+	<view class="notice-net iPhone-bottom flex-common-css box-border-box">
+		<Nav title='通知详情' bgckgroundBox='#fff'></Nav>
+		
+		<view class="scroll-view-css box-border-box p-32">
+			<view class="fs-40 fw-600 mb-12">{{obj.title||''}}</view>
+			<view class="fs-24 fw-400 mb-18">{{obj.created_date||''}}</view>
+			<view class="fs-30 fw-400" v-html="obj.content"></view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {noticeInfo} from '@/api/notice.js';
+	export default {
+		data(){
+			return{
+				id:'',
+				obj:{},
+			}
+		},
+		onLoad(e) {
+			this.id = e.id;
+			this.getInfo();
+		},
+		methods:{
+			getInfo(){
+				noticeInfo({id:this.id}).then((res)=>{
+					if(res.code === 1){
+						this.obj = res.data;
+					}
+				})
+			},
+		},
+	}
+</script>
+
+<style scoped lang="scss">
+	.notice-net{
+		background-color: #fff;
+	}
+</style>

+ 70 - 0
pages-my/notice/list.vue

@@ -0,0 +1,70 @@
+<template>
+	<view class="notice-list iPhone-bottom flex-common-css box-border-box">
+		<Nav title='搜索' bgckgroundBox='#fff'></Nav>
+		
+		<scroll-view scroll-y="true" class="scroll-view-css box-border-box p-24" @scrolltolower="scrolltolower">
+			<view class="card-box box-border-box p-24" v-for="(item,i) in list" :key="i" @click="toDet(item)">
+				<view class="text-overflow-ellipsis fs-32 fw-600 mb-8">{{item.title}}</view>
+				<view class="fs-24 fw-400 fc-9 p-b-20 b-b-F9F9F9 mb-24">{{item.created_date}}</view>
+				<view class="flex-justify-space align-items-center">
+					<view class="fs-28 fw-400 fc-9">查看详情</view>
+					<image src="@/static/img/toRight.png" mode=""></image>
+				</view>
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+	import {noticeList} from '@/api/notice.js';
+	export default {
+		data(){
+			return{
+				list:[],
+				total:0,
+				page:1,
+			}
+		},
+		onShow() {
+			this.page = 1;
+			this.list = [];
+			this.getList();
+		},
+		methods:{
+			getList(){
+				noticeList({page:this.page}).then((res)=>{
+					if(res.code === 1){
+						this.list = [...this.list,...res.data.items];
+						this.total = res.data.total;
+					}
+				})
+			},
+			scrolltolower(){
+				if(this.list.length < this.total){
+					this.page += 1;
+					this.getList();
+				}
+			},
+			toDet(item){
+				uni.navigateTo({
+					url: '/pages-my/notice/info?id=' +item.id
+				})
+			},
+		},
+	}
+</script>
+
+<style scoped lang="scss">
+	.notice-list{
+		.card-box{
+			width: 100%;
+			min-height: 224rpx;
+			background: #FFFFFF;
+			border-radius: 16rpx;
+		}
+		image{
+			width: 32rpx;
+			height: 32rpx;
+		}
+	}
+</style>

+ 17 - 1
pages.json

@@ -319,13 +319,29 @@
 					"style": {
 						"navigationBarTitleText": "平台资质"
 					}
+				},
+				{
+					"path": "notice/list",
+					"style": {
+						"navigationBarTitleText": "通知公告"
+					}
+				},
+				{
+					"path": "notice/info",
+					"style": {
+						"navigationBarTitleText": "公告详情"
+					}
 				}
 			]
 		}
 	],
 	"preloadRule":{
 		"pages/index/index":{
-			"network": "wifi",
+			"network": "all",
+			"packages": ["pages-address"]
+		},
+		"pages/login/index":{
+			"network": "all",
 			"packages": ["pages-address"]
 		}
 	},

+ 130 - 41
pages/index/index.vue

@@ -7,7 +7,7 @@
 				<template>
 					<view slot="custom" class="align-items-center" @click="toScroll()">
 						<uni-icons type="location-filled" size="20"></uni-icons>
-						<view class="fs-32 fw-600 ml-10">重庆邮电大学...</view>
+						<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>
 					</view>
 				</template>
@@ -29,8 +29,8 @@
 			<!-- 轮播 -->
 			<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 3" :key="i">
-						<view class="swiper-item">A</view>
+					<swiper-item v-for="(item,i) in bannerList" :key="i">
+						<image class="swiper-item" :src="item.image" mode="aspectFill"></image>
 					</swiper-item>
 				</swiper>
 			</view>
@@ -53,8 +53,8 @@
 					<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 3" :key="i">
-							<view class="tz-swiper-item">AAAAAAAAAAAAAAAAAAAAA</view>
+						<swiper-item v-for="(item,i) in noticeList" :key="i" @click="toNoticeDet(item)">
+							<view class="tz-swiper-item">{{item.title}}</view>
 						</swiper-item>
 					</swiper>
 					<image class="image-2" src="@/static/img/toRight.png" mode="scaleToFill"></image>
@@ -63,18 +63,18 @@
 			
 			
 			<!-- 限时秒杀 -->
-			<view class="box-border-box plr-24">
+			<view class="box-border-box plr-24" v-if="seckillGoodsList.length > 0">
 				<view class="xsms-box mb-32">
 					<image class="image-title" src="@/static/img/index/index-xsms.png" mode="scaleToFill"></image>
 					<view class="xsms-box-list-f box-border-box plr-12">
 						<view class="xsms-box-list display-flex ">
-							<view class="xsms-box-list-item box-border-box p-8" v-for="(item,i) in 10" :key="i">
-								<image class="xsms-box-list-item-img-1 mb-4" src="../../static/img/my/bg.png" mode="scaleToFill"></image>
-								<view class="text-overflow-ellipsis-one fs-26 mb-4">AAAAAAAAAAAAAAAAAAAAAA</view>
+							<view class="xsms-box-list-item box-border-box p-8" v-for="(item,i) in seckillGoodsList" :key="i" @click="toShop(item)">
+								<image class="xsms-box-list-item-img-1 mb-4" :src="item.goods_image" mode="aspectFill"></image>
+								<view class="text-overflow-ellipsis-one fs-26 mb-4">{{item.goods_name}}</view>
 								<view class="mb-4">
-									<span class="fs-20 fw-b fc-FB3D03">¥</span><span class="fs-32 fw-b fc-FB3D03">29.99</span>
+									<span class="fs-20 fw-b fc-FB3D03">¥</span><span class="fs-32 fw-b fc-FB3D03">{{item.seckill_money}}</span>
 								</view>
-								<view class="fs-20 fc-9 text-line-through">¥3300</view>
+								<view class="fs-20 fc-9 text-line-through">¥{{item.line_price}}</view>
 								<image class="xsms-box-list-item-img-2" src="@/static/img/index/index-q.png" mode="scaleToFill"></image>
 							</view>
 						</view>
@@ -85,36 +85,37 @@
 			
 			<!-- 类型选择 -->
 			<view class="type-list-box display-flex" :style="[{'background':bgckgroundType}]">
-				<view class="type-item-box view-nowrap" :class="type==item.id?'s-type':'n-type'" v-for="(item,i) in typeList" :key="i">{{item.name}}</view>
+				<view class="type-item-box view-nowrap" :class="category_id==item.id?'s-type':'n-type'" 
+				v-for="(item,i) in typeList" :key="i" @click="selectType(item.id)">{{item.name}}</view>
 			</view>
 			<!-- 商品列表 -->
 			<view class="box-border-box plr-24">
-				<view class="goos-list-box box-border-box p-24 display-flex" v-for="(item,i) in 10">
-					<image class="left-img" src="../../static/img/my/bg.png" mode="scaleToFill"></image>
+				<view class="goos-list-box box-border-box p-24 display-flex" v-for="(item,i) in goodsList" :key="i" @click="toShop(item)">
+					<image class="left-img" :src="item.shop_logo" mode="aspectFill"></image>
 					<view class="flex-1">
 						<view class="align-items-center mb-8">
-							<view class="right-box-title fs-32 fw-600 text-overflow-ellipsis-one">蜜雪冰城(重工页店)122332323232323232323232</view>
+							<view class="right-box-title fs-32 fw-600 text-overflow-ellipsis-one">{{item.shop_name}}</view>
 							<image class="right-box-title-img" src="@/static/img/toRight.png" mode=""></image>
 						</view>
 						<view class="align-items-center mb-8">
 							<image class="img-x mr-12" src="@/static/img/my/wdpj.png" mode=""></image>
-							<view class="fs-26 fw-600 fc-FF7F00 mr-12">4.5分</view>
-							<view class="fc-6 fs-24 mr-12">| 预计38分钟 |</view>
-							<view class="fc-6 fs-24 mr-12">855人购买</view>
+							<view class="fs-26 fw-600 fc-FF7F00 mr-12">{{item.shop_score}}分</view>
+							<view class="fc-6 fs-24 mr-12">| 预计{{item.delivery_time}}分钟 |</view>
+							<view class="fc-6 fs-24 mr-12">{{item.shop_sales}}人购买</view>
 						</view>
 						<view class="align-items-center flex-wrap-wrap">
-							<view class="quan-list display-flex mr-12 mb-12" v-for="(item,i) in 3" :key="i">
+							<view class="quan-list display-flex mr-12 mb-12" v-for="(info1,index1) in item.coupon" :key="index1">
 								<view class="quan-list-1 fs-24 fc-f">券</view>
-								<view class="quan-list-2 fs-24 fc-FB3D03">10元</view>
+								<view class="quan-list-2 fs-24 fc-FB3D03">{{info1.money}}元</view>
 							</view>
 						</view>
 						<view class="goods-items-list display-flex">
-							<view class="goods-items-list-box" v-for="(info,i) in 10">
-								<image class="mb-12" src="@/static/img/my/bg.png" mode=""></image>
-								<view class="mb-8 fw-600 text-overflow-ellipsis-one fs-26">AAAAAAAAAAAAAA</view>
+							<view class="goods-items-list-box" v-for="(info2,index2) in item.goods" :key="index2">
+								<image class="mb-12" :src="info2.goods_image" mode="aspectFill"></image>
+								<view class="mb-8 fw-600 text-overflow-ellipsis-one fs-26">{{info2.goods_name}}</view>
 								<view class="">
 									<span class="fs-24 fc-FB3D03">¥</span>
-									<span class="fs-32 fc-FB3D03 fw-b">3.99</span>
+									<span class="fs-32 fc-FB3D03 fw-b">{{info2.price}}</span>
 								</view>
 							</view>
 						</view>
@@ -127,6 +128,10 @@
 </template>
 <script>
   import tools from "@/service/tools";
+  import {getNotice,getBanner,} from '@/api/common.js';
+  import {getSeckillGoods} from '@/api/seckill.js'
+  import {getTakeaway} from '@/api/category.js';
+  import {getGoodsList} from '@/api/goods.js';
   export default {
 		data() {
 			return {
@@ -146,16 +151,43 @@
 					{name:"回收",img:require('@/static/img/index/index-hs.png'),},
 					{name:"实习岗位",img:require('@/static/img/index/index-sxgw.png'),},
 				],
-				typeList:[
-					{name:"全部",id:-1},
-					{name:"奶茶甜点",id:0},
-					{name:"快餐便当",id:1},
-					{name:"火锅麻辣烫",id:2},
-					{name:"龙虾汉堡",id:3},
-					{name:"棋牌娱乐",id:4},
-				],
-				type:-1,
+				
+				schoolData:{
+					school_name:'',
+				},
+				noticeList:[],
+				bannerList:[],
+				seckillGoodsList:[],
+				
+				typeList:[],//分类数组
+				category_id:0, //分类id
+				
+				goodsList:[],
+				total:0,
+				page:1,
+			}
+		},
+		
+		onShow() {
+			let school_id = uni.getStorageSync('school_id');
+			let operate_id = uni.getStorageSync('operate_id');
+			let school_name = uni.getStorageSync('school_name');
+			if(!school_id||!operate_id){
+				setTimeout(()=>{
+					uni.reLaunch({
+						url:'/pages-address/select-school?type=1'
+					})
+				},1000)
+			}else{
+				this.schoolData.school_name = school_name;
 			}
+			this.getBanner();
+			this.getNotice();
+			this.getSeckillGoods();
+			this.getTakeaway();
+			this.page = 1;
+			this.goodsList = [];
+			this.getGoodsList();
 		},
 		onPageScroll(e) {
 			if(e.scrollTop>1){
@@ -174,6 +206,10 @@
 		},
 		onReachBottom() {
 			console.log('触底刷新');
+			if(this.goodsList.length < this.total){
+				this.page += 1;
+				this.getGoodsList();
+			}
 		},
 		created() {
 			uni.getSystemInfo({
@@ -182,17 +218,58 @@
 			    let custom = 0;
 			    custom = wx.getMenuButtonBoundingClientRect()	  
 			    let customBarH = custom.height;
-				
-				console.log(statusBarH);
-				console.log(customBarH);
 				this.BarH = statusBarH + customBarH;
 			  }
 			})
-		},
-		mounted() {
-      
 		},
 		methods: {
+			getBanner(){
+				getBanner().then((res)=>{
+					if(res.code === 1){
+						this.bannerList = res.data;
+					}
+				})
+			},
+			getNotice(){
+				getNotice().then((res)=>{
+					if(res.code === 1){
+						this.noticeList = res.data;
+					}
+				})
+			},
+			getSeckillGoods(){
+				let operate_id = uni.getStorageSync('operate_id');
+				getSeckillGoods({operate_id:operate_id}).then((res)=>{
+					if(res.code === 1){
+						this.seckillGoodsList = res.data
+					}
+				})
+			},
+			getTakeaway(){
+				getTakeaway().then((res)=>{
+					if(res.code === 1){
+						this.typeList = res.data;
+						this.typeList.unshift({name:"全部",id:0})
+					}
+				})
+			},
+			getGoodsList(){
+				let operate_id = uni.getStorageSync('operate_id');
+				getGoodsList({page:this.page,operate_id:operate_id,category_id:this.category_id}).then((res)=>{
+					if(res.code === 1){
+						this.goodsList = [...this.goodsList,...res.data.items];
+						this.total = res.data.total;
+					}
+				})
+			},
+			selectType(id){
+				if(this.category_id != id){
+					this.category_id = id;
+					this.page = 1;
+					this.goodsList = [];
+					this.getGoodsList();
+				}
+			},
 			toUrl(type){
 				if(type === 1){
 					// 去搜索
@@ -238,11 +315,24 @@
 					url:'/pages-address/select-school'
 				})
 			},
+			toShop(item){
+				uni.navigateTo({
+					url:'/pages-takeout/shop?shop_id=' + item.shop_id
+				})
+			},
+			toNoticeDet(item){
+				uni.navigateTo({
+					url: '/pages-my/notice/info?id=' +item.id
+				})
+			},
 		},
 	}
 </script>
 <style lang="scss" scoped>
 	.index-box{
+		.w-220{
+			width: 220rpx;
+		}
 		position: relative;
 		.bg-img{
 			width: 100%;
@@ -267,7 +357,6 @@
 					width: 702rpx;
 					height: 220rpx;
 					border-radius: 20rpx;
-					background-color: skyblue;
 				}
 			}
 			.nav-list{
@@ -401,7 +490,7 @@
 			
 			.goos-list-box{
 				width: 100%;
-				min-height: 428rpx;
+				min-height: 100rpx;
 				background: #FFFFFF;
 				box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51,51,51,0.1);
 				border-radius: 20rpx;

+ 33 - 9
pages/index/search-list.vue

@@ -7,8 +7,8 @@
 			<view class="input-icon">
 				<uni-icons type="search" size="18" color="#999"></uni-icons>
 			</view>
-			<input v-model="search" type="text" placeholder="店铺名称或者商品名称">
-			<view class="input-buttom fs-28 fc-f fw-500" @click="toList()">搜索</view>
+			<input v-model="fromData.search" type="text" placeholder="店铺名称或者商品名称">
+			<view class="input-buttom fs-28 fc-f fw-500" @click="search()">搜索</view>
 		</view>
 		
 
@@ -50,22 +50,46 @@
 </template>
 
 <script>
+	import {getSearch} from '@/api/goods.js';
 	export default {
 		data(){
 			return{
-				search:'',
+				fromData:{
+					search:'',
+					operate_id:'',
+					page:1,
+				},
+				list:[],
+				total:0,
+				
 			}
 		},
 		onLoad(e) {
-			console.log(e);
-			this.search = e.search
-		},
-		onShow() {
-			
+			this.fromData.operate_id = uni.getStorageSync('operate_id');
+			this.fromData.search = e.search
+			this.fromData.page = 1;
+			this.list = [];
+			this.getList()
 		},
 		methods:{
+			search(){
+				this.fromData.page = 1;
+				this.list = [];
+				this.getList();
+			},
+			getList(){
+				getSearch(this.fromData).then((res)=>{
+					if(res.code === 1){
+						this.list = [...this.list,...res.data.items];
+						this.total = res.data.total;
+					}
+				})
+			},
 			scrolltolower(){
-				console.log('触底刷新');
+				if(this.list.length < this.total){
+					this.fromData.page += 1;
+					this.getList();
+				}
 			},
 		},
 	}

+ 26 - 10
pages/index/search-record.vue

@@ -12,19 +12,19 @@
 		</view>
 		
 		<view class="scroll-view-css bgc-f seacrh-info box-border-box p-32">
-			<view class="flex-justify-space mb-32" v-if="list.length > 0">
+			<view class="flex-justify-space mb-32">
 				<view class="fs-32 fw-600 fc-3">搜索历史</view>
-				<view class="align-items-center">
+				<view class="align-items-center" v-if="list.length > 0">
 					<view @click="isOpen=!isOpen" class="">{{isOpen?'收起':'展开'}}</view>
 					<view @click="isOpen=!isOpen" :class="isOpen?'down':'up'">
 						<uni-icons type="right" size="14" color="#999"></uni-icons>
 					</view>
 					<view class="view-x"></view>
-					<uni-icons @click="list = []" type="trash" size="18" color="#999"></uni-icons>
+					<uni-icons @click="delList()" type="trash" size="18" color="#999"></uni-icons>
 				</view>
 			</view>
 			<view :class="!isOpen?'hide-h':''" class="flex-wrap-wrap mb-50" v-if="list.length > 0">
-				<view class="fs-28 list-item text-overflow-ellipsis-one" @click="toList(item.name)" v-for="(item,i) in list" :key="i">{{item.name}}</view>
+				<view class="fs-28 list-item text-overflow-ellipsis-one" @click="toList(item)" v-for="(item,i) in list" :key="i">{{item}}</view>
 			</view>
 			
 		
@@ -33,21 +33,27 @@
 </template>
 
 <script>
+	import tools from "@/service/tools";
+	import {getSearchList,delSearch} from '@/api/goods.js';
 	export default {
 		data(){
 			return{
 				search:'',
 				isOpen:false,
-				list:[{name:'土猪',},{name:'土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪',},{name:'土猪',},
-				{name:'土猪',},{name:'土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪',},{name:'土猪',},
-				{name:'土猪',},{name:'土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪',},{name:'土猪',},
-				{name:'土猪',},{name:'土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪土猪',},{name:'土猪土猪',},{name:'土猪',},],
+				list:[],
 			}
 		},
 		onShow() {
-			
+			this.getList()
 		},
 		methods:{
+			getList(){
+				getSearchList().then((res)=>{
+					if(res.code === 1){
+						this.list = res.data.my_search;
+					}
+				})
+			},
 			toList(name){
 				let search = '';
 				if(name){
@@ -55,11 +61,21 @@
 				}else{
 					search = this.search;
 				}
-				
+				if(!search){
+					return tools.error('请输入搜索内容')
+				}
 				uni.navigateTo({
 					url:"pages/index/search-list?search=" + search
 				})
 			},
+			delList(){
+				delSearch().then((res)=>{
+					if(res.code === 1){
+						tools.success('删除成功');
+						this.list = [];
+					}
+				})
+			},
 		},
 	}
 </script>

+ 297 - 40
pages/login/index.vue

@@ -1,54 +1,311 @@
 <template>
-  <view class="login">
-    登录页
-    <view class="logIn" @click="logIn">
-      登录
+  <view class="permission">
+    <Nav :leftShow='false' title="君子校园"></Nav>
+    <view class="user-permission">
+     <view class="head">
+		  <view class="head-button" >				
+			<image src="@/static/img/logo/logo.png" class="head-img" mode=""></image>
+			<view class="head-text">君子校园</view>
+		  </view>
+      </view>
+	  
+	  <view class="hint-box">
+		  <view class="hint-title">该程序将获取以下授权:</view>
+		  <view class="hint-info">获取你的公开信息(昵称,头像等)</view>
+		  <view class="hint-info">获取你的小程序唯一标示用于账户授权登陆</view>
+		</view>
+	  
+	  <view class="hint">
+	  		<view class="hint-left-circle" @click.stop="isFlag = !isFlag">
+	  			<view v-if="!isFlag" class="hint-circle"></view>
+	  			<image v-else  class="hint-img" src="@/static/img/common/y-select.png" mode=""></image>
+	  		</view>
+	  		<view class="hint-text-1" @click.stop="isFlag = !isFlag">我已阅读并同意</view>
+	  		<view class="hint-text-2" @click="isPop = true;html = member_agreement">《用户服务》</view>
+			<view class="hint-text-2" @click="isPop = true;html = privacy_protocol">《隐私协议》</view>
+	  </view>
+	  
+	  
+      <view class="button">
+        <view class="common permission-login" @click="login">微信授权登录</view>
+        <view class="common permission-cancel" @click="noLogin">暂不登录</view>
+      </view>
     </view>
+	
+	
+	<view v-if="isPop" class="pop-view">
+		<view class="pop-view-box">
+			<view class="pop-info" v-html="html"></view>
+			<view class="pop-botton">
+				<view style="background-color: #3169FA;color: white;" class=" " @click="setCheck(1)">确定</view>
+				<view style="color: #3169FA;" class="" @click="setCheck()">取消</view>
+			</view>
+		</view>
+	</view>
   </view>
 </template>
+
 <script>
-  import tools from '@/service/tools.js';
+import tools from "@/service/tools";
+import { appletLogin } from "@/api/member";
+import {getAgreement} from "@/api/common.js";
+
+export default {
+  data() {
+    return {
+		isFlag: false,
+		isAjax: false,
+		
+		from: {
+			code: "",
+		},
+		isPop:false,
+		html:'',
+		member_agreement:'',//用户协议
+		privacy_protocol:'',//隐私协议
+    };
+  },
+  onLoad() {
+    
+  },
+  mounted() {
+  	this.getPrivacyInfo()
+  },
+  methods: {
+	getPrivacyInfo(){
+		getAgreement().then((res)=>{
+			if(res.code === 1){
+				this.member_agreement = res.data.member_agreement;
+				this.privacy_protocol = res.data.privacy_protocol;
+			}
+		})
+	},
 	
-  export default {
-    data() {
-      return {
+	setCheck(type){
+		if(type === 1){
+			this.isFlag = false
+		}
+		this.isPop = false
+	},
 
+    login() {
+	  if(!this.isFlag){
+		return tools.error("请先勾选协议");
+	  }
+      if (this.isAjax) {
+        return false;
       }
+      this.isAjax = true;
+	  
+	  uni.login({
+	    provider: "weixin",
+	    success: (loginRes) => {
+		  this.from.code = loginRes.code;
+		  this.getUserInfo();
+	    },
+	    fail: (loginRes) => {
+	      this.isAjax = false;
+	      tools.error("获取授权信息失败");
+	    },
+	  });
     },
-    mounted() {
-
+    noLogin() {
+      uni.switchTab({
+        url: "/pages/index/index",
+      });
     },
-    methods: {
-      logIn() {
-        uni.login({
-        	provider:'weixin',
-			success:(res)=>{
-				if(res.errMsg === 'login:ok'){
-					console.log(res);
-				}else{
-					tools.error('失败')
-				}
-			},
-			fail:(res)=>{
-				tools.error('失败')
-			}
-        })
-      },
+    async getUserInfo() {
+      const res = await appletLogin(this.from);
+      if (res.code == 1) {
+       uni.setStorageSync('token',res.data.token)
+	   uni.setStorageSync('m_id',res.data.m_id)
+		tools.success("授权成功");
+        setTimeout(() => {
+          uni.switchTab({
+            url: "/pages/index/index",
+          });
+        }, 1000); 
+      } else {
+        this.isAjax = false;
+        tools.error(res.msg);
+      }
     },
-  }
+  },
+};
 </script>
-<style lang="scss" scoped>
-  .login {
-    width: 100%;
-    min-height: 100vh;
-    background: #fff;
 
-    .logIn {
-      width: 50%;
-      height: 40px;
-      text-align: center;
-      margin: 0 auto;
-      line-height: 40px;
-    }
+<style scoped lang="scss">
+.permission {
+  width: 100vw;
+  height: 100vh;
+  background-color: #fff;
+  position: relative;
+   
+   .hint {
+   	margin-top: 20rpx;
+   	display: flex;
+   	height: 34rpx;
+   	.hint-left-circle{
+   		width: 32rpx;
+   		height: 32rpx;
+   		margin-right: 18rpx;
+   		.hint-circle{
+   			width: 30rpx;
+   			height: 30rpx;
+   			border-radius: 50%;
+   			background-color: #fff;
+   			border: 2rpx solid #D9D9D9;
+   		}
+   		.hint-img{
+   			width: 32rpx;
+   			height: 32rpx;
+   			border-radius: 50%;
+   		}
+   	}
+   	.hint-text-1,.hint-text-2{
+   		font-size: 24rpx;
+   		font-weight: 400;
+   	}
+   	.hint-text-1{
+   		color: #999999;
+   	}
+   	.hint-text-2{
+   		color: #ED301D;
+   	}
+   }
+   
+  .hint-box {
+          margin-top: 140rpx;
+          margin-bottom: 20rpx;
+  
+          .hint-title {
+            font-size: 28rpx;
+          }
+  
+          .hint-info {
+            font-size: 24rpx;
+            color: #6f6f6f;
+            margin-top: 12rpx;
+          }
+        }
+  
+  .pop-view{
+  	width: 100%;
+  	height: 100vh;
+  	position: absolute;
+  	top:0;
+  	left: 0;
+  	background: rgba(0, 0, 0, 0.5);
+  	.pop-view-box{
+		display: flex;
+		flex-direction: column;
+		
+  		margin: 400rpx auto;
+  		width: 80vw;
+  		height: 50vh;
+  		overflow: scroll;
+  		background-color: #fff;
+  		border-radius: 10rpx;
+  		box-sizing: border-box;
+  		padding: 20rpx 40rpx;
+  		.pop-info{
+			flex: 1;
+			overflow: auto;
+		}
+  		.pop-botton{
+  			display: flex;
+  			justify-content: space-between;
+  			margin-top: 20rpx;
+  			box-sizing: border-box;
+  			padding: 0 130rpx;
+  			view{
+  				width: 100rpx;
+  				height: 50rpx;
+  				line-height: 50rpx;
+  				text-align: center;
+  				font-size: 30rpx;
+  				border:2rpx solid #3169FA;
+  				border-radius: 10rpx;
+  				margin: 0 10rpx;
+  			}
+  		}
+  	}
+  }
+  
+  
+  .user-permission {
+    position: absolute;
+    top: 40%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    width: 100%;
+    padding: 0 36rpx;
+    box-sizing: border-box;
+	.head {
+	  display: flex;
+	  flex-direction: column;
+	  align-items: center;
+	  button::after{
+		  border-color: #fff !important;
+	  }
+		.head-button{
+			background-color: #fff;
+			padding: 0;
+		}
+		.head-text{
+			text-align: center;
+			margin-top: 16rpx;
+			font-weight: 400;
+			color: #333333;
+			font-size: 28rpx;
+		}
+	  .head-img {
+	    width: 120rpx;
+	    height: 120rpx;
+	    border-radius: 50%;
+		margin: 0 auto;
+	  }
+	}
+	.user-name-view{
+		display: flex;
+		margin-top: 100rpx;
+		.user-name{
+			font-weight: 400;
+			color: #333333;
+			font-size: 32rpx;
+		}
+		.user-input{
+			width: 568rpx;
+			border-bottom: 1rpx solid #D9D9D9;
+			font-size: 32rpx;
+			padding-bottom: 16rpx;
+		}
+	}
+	
+	.button {
+	  margin-top: 60rpx;
+	  .common {
+	    width: 100%;
+	    height: 88rpx;
+	    line-height: 88rpx;
+	    text-align: center;
+	    border-radius: 200rpx;
+	  }
+	  .permission-login {
+	    background: #41ABF5;
+	    color: #fff;
+	    &:active {
+	      background-color: #41ABF5;
+	    }
+	  }
+	  .permission-cancel {
+	    margin-top: 40rpx;
+	    background: rgb(247, 247, 247);
+	    &:active {
+	      background-color: rgb(238, 238, 238);
+	    }
+	  }
+	}
   }
-</style>
+}
+</style>

+ 18 - 0
pages/me/index.vue

@@ -68,6 +68,19 @@
 							<image class="to-right" src="@/static/img/toRight.png" mode=""></image>
 						</view>
 					</view>
+					
+					<view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(12)">
+						<view class="item-left align-items-center">
+							<image class="item-img" src="@/static/img/my/gong-gao-icon.png" mode=""></image>
+							<view class="fs-32 fc-3">
+								通知公告
+							</view>
+						</view>
+						<view class="item-right align-items-center">
+							<image class="to-right" src="@/static/img/toRight.png" mode=""></image>
+						</view>
+					</view>
+					
 					<view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(7)">
 						<view class="item-left align-items-center">
 							<image class="item-img" src="@/static/img/my/lxkf.png" mode=""></image>
@@ -203,6 +216,11 @@
 					uni.navigateTo({
 						url: '/pages-my/about-us'
 					})
+				} else if (type == 12) {
+					// 系统通知
+					uni.navigateTo({
+						url: '/pages-my/notice/list'
+					})
 				}
 			}
 		},

+ 1 - 1
pages/order/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="flex-common-css iPhone-bottom flex-common-css box-border-box">
-		<Nav title="订单" leftIconColor="#333" titleColor="#333"></Nav>
+		<Nav :leftShow='false' title="订单" leftIconColor="#333" titleColor="#333"></Nav>
 		
 		<view class="nav-box box-border-box bgc-f display-flex">
 			<view class="nav-item" :class="type == item.id?'fs-36 fw-600':'fs-34 fw-400'" 

+ 8 - 5
service/ajax.js

@@ -1,5 +1,7 @@
 import tools from "@/service/tools";
-let BASE_URL =''
+
+
+let BASE_URL  = process.uniEnv.baseUrl;
 
 
 /**
@@ -7,8 +9,8 @@ let BASE_URL =''
  */
 export const request = (url, method, data, show = false) => {
   let token=uni.getStorageSync('token')
-  // data.token = token;
-  // data.m_id = uni.getStorageSync('m_id')
+  data.token = token;
+  data.m_id = uni.getStorageSync('m_id')
   if (show) {
     tools.showLoading();
   }
@@ -17,7 +19,6 @@ export const request = (url, method, data, show = false) => {
   }
   return new Promise((resolve, reject) => {
     // 封装主体:网络请求
-    console.log(url)
     uni.request({
       url:BASE_URL+  url,
       data: data,
@@ -35,7 +36,9 @@ export const request = (url, method, data, show = false) => {
             uni.reLaunch({
               url: '/pages/login/index'
             });
-          } else {
+          } else if (res.data.code * 1 === 403) {
+           tools.error('请求过快!!')
+          }else {
             resolve(res.data)
           }
         }else if(res.statusCode === 401){

+ 7 - 9
service/router.js

@@ -4,7 +4,6 @@ import tools from "@/service/tools";
 const router = createRouter({
     platform: process.env.VUE_APP_PLATFORM,
     routerErrorEach:({type,level,...args})=>{
-        // console.log({type,level,...args})
         // #ifdef APP-PLUS
         if(type===3){
             router.$lockStatus=false;
@@ -15,10 +14,10 @@ const router = createRouter({
     routes: [...ROUTES]
 });
 //全局路由前置守卫
-const whiteList = ['/pages/login/index']
+const whiteList = ['/pages/login/index','/pages/index/index','/pages/order/index','/pages/me/index']
 
 router.beforeEach((to, from, next) => {
-    // let userToken=''
+    let userToken = uni.getStorageSync('token')
     // if (to.query.token ) {
     //     userToken = to.query.token;
     //     uni.setStorageSync('token',userToken)
@@ -27,12 +26,11 @@ router.beforeEach((to, from, next) => {
     // }
     
 
-    // if(whiteList.indexOf(to.path)<0 && !userToken){
-    //     next('/pages/login/index')
-    // }else {
-    //     next();
-    // }
-	next()
+    if(whiteList.indexOf(to.path)<0 && !userToken){
+        next('/pages/login/index')
+    }else {
+		next()
+    }
 });
 // 全局路由后置守卫
 router.afterEach((to, from) => {

BIN
static/img/blank/no-goods.png


BIN
static/img/logo/logo.png


BIN
static/img/my/gong-gao-icon.png