ss 1 年之前
当前提交
d847fbb702

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+unpackage

+ 186 - 0
App.vue

@@ -0,0 +1,186 @@
+<script>
+	export default {
+		globalData: {  
+			serverUrl: 'http://hhq.jya-tech.com/api/h5/',
+			uploadServerUrl: 'http://hhq.jya-tech.com/api/h5/',
+			appId: 'wx2ee796cea8882441',
+			redirectUri: 'http://hhqs.jya-tech.com/shop/#/pages/index/wechat',
+			storagePre: 'shop_',
+			host: 'http://hhqs.jya-tech.com/shop/',
+			userinfo:{}
+		},
+		onLaunch: function() {
+			console.log('onLaunch')
+			var app = getApp();
+			var orgId = this.getUrlCode('orgId');
+			console.log('2222222',orgId);
+			if(orgId){
+				uni.setStorageSync(app.globalData.storagePre+'orgId',orgId);
+				app.globalData.userinfo.orgId = orgId;
+			}else{
+				orgId = uni.getStorageSync(app.globalData.storagePre+'orgId');
+				if(orgId){
+					app.globalData.userinfo.orgId = orgId;
+				}else{
+					uni.showToast({
+						title: '参数错误',
+						icon: 'none',
+						duration: 2000
+					})
+				}
+			}
+			console.log('33333333',app.globalData);
+			let token = uni.getStorageSync(app.globalData.storagePre+'token');
+			if(token){
+				app.globalData.userinfo.token = token;
+				app.globalData.userinfo.userId = uni.getStorageSync(app.globalData.storagePre+'userId');
+			}
+			// app.globalData.userinfo.token = '1914162463525';
+			// app.globalData.userinfo.userId = 1;
+		},
+		onShow: function() {
+			console.log('App Show')
+		},
+		onHide: function() {
+			console.log('App Hide')
+		},
+		methods: {
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+			checkLogin: function(){
+				var app = getApp();
+				var token = app.globalData.userinfo.token;
+				if(!token){
+					uni.reLaunch({ //关闭所有页面,跳转到闪屏页
+						url: '/pages/index/wechat'
+					})
+				}
+			},
+			checkCode:function(code){
+			    if(code == -100){
+					uni.showToast({
+						title: '登录超时,请重新登录',
+						icon: 'none',
+						duration: 2000
+					})
+					uni.setStorageSync(app.globalData.storagePre+'token','');
+					setTimeout(function(){
+						uni.reLaunch({ //关闭所有页面,打开到应用内的某个页面
+							url: '/pages/index/wechat'
+						})
+					},2000);
+					return false;
+			    }
+			    return true;
+			},
+			ajax: function(params){
+			    if (!params.type) {
+					var type = 'POST';
+			    }else{
+					var type = params.type;
+			    }
+			    if (!params.apiname) {
+					var apiname = '1';
+			    } else {
+					var apiname = params.apiname;
+			    }
+			    if (!params.data) {
+					var data = [];
+			    }else{
+					var data = params.data;
+			    }
+			    var app = getApp();
+			    var token = app.globalData.userinfo.token;
+				var userId = app.globalData.userinfo.userId;
+			    if (!token || token == undefined) { //未登录
+					uni.showToast({
+						title: '未登录',
+						icon: 'none',
+						duration: 2000
+					});
+					uni.setStorageSync(app.globalData.storagePre+'token','');
+					setTimeout(function () {
+						uni.reLaunch({ //关闭所有页面,跳转到闪屏页
+							url: '/pages/index/wechat'
+						})
+					}, 2000);
+			      return false;
+			    }
+			    data['token'] = token;
+
+				let orgId = uni.getStorageSync(app.globalData.storagePre+'orgId');
+		
+				data['orgId'] = orgId?orgId:0;
+			    data['userId'] = userId?userId:0;
+			    uni.showLoading({
+					title: '加载中',
+					mask: true
+			    });
+			    
+			    uni.request({
+					url: params.url,
+					data: data,
+					method: type,
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					success: function (res) {
+						uni.hideLoading();
+						uni.stopPullDownRefresh();
+						var ret = app.checkCode(res.data.code); //检查token是否失效
+						if(ret == false){
+							return false;
+						}
+			
+						if (res.data.code == 0) {
+							if (app.ajaxReadyCallback) { //在onShow中调用数据的,添加在onShow方法内,防止不同页面覆盖
+								res.data['apiname'] = apiname;
+								app.ajaxReadyCallback(res)
+							}
+						} else {
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					},
+					fail: function (err) {
+						uni.hideLoading();
+						uni.showToast({
+							title: '请求失败',
+							icon: 'none',
+							duration: 2000
+						})
+					}
+			    })
+			}
+		}
+		
+		
+	}
+</script>
+
+<style>
+	/*每个页面公共css */
+	page{
+		background-color: #F3F3F3;
+	}
+	.no-data{
+		width: 100%;
+		height: auto;
+		margin: 0 auto;
+		margin-top: 20%;
+		text-align: center;
+	}
+	.no-data image{
+		width: 430rpx;
+		height: 316rpx;
+	}
+	.no-data .no-data-text{
+		color: #C5C8D9;
+		font-size: 25rpx;
+	}
+	
+</style>

文件差异内容过多而无法显示
+ 1 - 0
common/util/jweixin.js


+ 71 - 0
common/util/wechat.js

@@ -0,0 +1,71 @@
+var jweixin = require('./jweixin.js');
+
+var serverUrl = "http://hhq.jya-tech.com/api/h5/";
+
+export default {
+    //判断是否在微信中
+    isWechat: function() {
+        var ua = window.navigator.userAgent.toLowerCase();
+        if (ua.match(/micromessenger/i) == 'micromessenger') {
+            // console.log('是微信客户端')
+            return true;
+        } else {
+            // console.log('不是微信客户端')
+            return false;
+        }
+    },
+    initJssdk:function(callback){
+		var surl = encodeURIComponent(window.location.href.split('#')[0]); // 当前地址
+		uni.request({
+		    url: serverUrl + 'Oauth/jssdk',
+			data: {url:surl},
+			method: 'POST',
+			header: {
+				'content-type': 'application/x-www-form-urlencoded'
+			},
+		    success: function (res) {
+		        console.log(res)
+		        if(res.data.code == 0) {					
+					jweixin.config({
+					    debug: res.data.data.debug,
+					    appId: res.data.data.appid,
+					    timestamp: res.data.data.timestamp,
+					    nonceStr: res.data.data.noncestr,
+					    signature: res.data.data.signature,
+					    jsApiList: res.data.data.jsapilist,
+					});
+					//配置完成后,再执行分享等功能
+					if (callback) {
+					    callback(res.data);
+					}
+		        }
+		    },
+			fail: function (err) {
+				console.log(err);
+			}
+		})
+    },
+    //在需要定位页面调用
+    location: function(callback) {
+        if (!this.isWechat()) {
+            console.log('不是微信客户端')
+            return;
+        }
+
+        this.initJssdk(function(res) {
+            jweixin.ready(function() {
+                console.info('定位ready')
+                jweixin.getLocation({
+                    type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
+                    success: function (res) {
+                        console.log(res);
+                        callback(res)
+                    },
+                    fail:function(res){
+                        console.log(res)
+                    },
+                });
+            });
+        });
+    }
+}

+ 96 - 0
components/uni-icons/icons.js

@@ -0,0 +1,96 @@
+export default {
+	'contact': '\ue100',
+	'person': '\ue101',
+	'personadd': '\ue102',
+	'contact-filled': '\ue130',
+	'person-filled': '\ue131',
+	'personadd-filled': '\ue132',
+	'phone': '\ue200',
+	'email': '\ue201',
+	'chatbubble': '\ue202',
+	'chatboxes': '\ue203',
+	'phone-filled': '\ue230',
+	'email-filled': '\ue231',
+	'chatbubble-filled': '\ue232',
+	'chatboxes-filled': '\ue233',
+	'weibo': '\ue260',
+	'weixin': '\ue261',
+	'pengyouquan': '\ue262',
+	'chat': '\ue263',
+	'qq': '\ue264',
+	'videocam': '\ue300',
+	'camera': '\ue301',
+	'mic': '\ue302',
+	'location': '\ue303',
+	'mic-filled': '\ue332',
+	'speech': '\ue332',
+	'location-filled': '\ue333',
+	'micoff': '\ue360',
+	'image': '\ue363',
+	'map': '\ue364',
+	'compose': '\ue400',
+	'trash': '\ue401',
+	'upload': '\ue402',
+	'download': '\ue403',
+	'close': '\ue404',
+	'redo': '\ue405',
+	'undo': '\ue406',
+	'refresh': '\ue407',
+	'star': '\ue408',
+	'plus': '\ue409',
+	'minus': '\ue410',
+	'circle': '\ue411',
+	'checkbox': '\ue411',
+	'close-filled': '\ue434',
+	'clear': '\ue434',
+	'refresh-filled': '\ue437',
+	'star-filled': '\ue438',
+	'plus-filled': '\ue439',
+	'minus-filled': '\ue440',
+	'circle-filled': '\ue441',
+	'checkbox-filled': '\ue442',
+	'closeempty': '\ue460',
+	'refreshempty': '\ue461',
+	'reload': '\ue462',
+	'starhalf': '\ue463',
+	'spinner': '\ue464',
+	'spinner-cycle': '\ue465',
+	'search': '\ue466',
+	'plusempty': '\ue468',
+	'forward': '\ue470',
+	'back': '\ue471',
+	'left-nav': '\ue471',
+	'checkmarkempty': '\ue472',
+	'home': '\ue500',
+	'navigate': '\ue501',
+	'gear': '\ue502',
+	'paperplane': '\ue503',
+	'info': '\ue504',
+	'help': '\ue505',
+	'locked': '\ue506',
+	'more': '\ue507',
+	'flag': '\ue508',
+	'home-filled': '\ue530',
+	'gear-filled': '\ue532',
+	'info-filled': '\ue534',
+	'help-filled': '\ue535',
+	'more-filled': '\ue537',
+	'settings': '\ue560',
+	'list': '\ue562',
+	'bars': '\ue563',
+	'loop': '\ue565',
+	'paperclip': '\ue567',
+	'eye': '\ue568',
+	'arrowup': '\ue580',
+	'arrowdown': '\ue581',
+	'arrowleft': '\ue582',
+	'arrowright': '\ue583',
+	'arrowthinup': '\ue584',
+	'arrowthindown': '\ue585',
+	'arrowthinleft': '\ue586',
+	'arrowthinright': '\ue587',
+	'pulldown': '\ue588',
+	'closefill': '\ue589',
+	'sound': '\ue590',
+	'scan': '\ue612'
+}

文件差异内容过多而无法显示
+ 57 - 0
components/uni-icons/uni-icons.vue


+ 224 - 0
components/uni-nav-bar/uni-nav-bar.vue

@@ -0,0 +1,224 @@
+<template>
+	<view class="uni-navbar">
+		<view :class="{ 'uni-navbar--fixed': fixed, 'uni-navbar--shadow': shadow, 'uni-navbar--border': border }" :style="{ 'background-color': backgroundColor }"
+		 class="uni-navbar__content">
+			<uni-status-bar v-if="statusBar" />
+			<view :style="{ color: color,backgroundColor: backgroundColor }" class="uni-navbar__header uni-navbar__content_view">
+				<view @tap="onClickLeft" class="uni-navbar__header-btns uni-navbar__header-btns-left uni-navbar__content_view">
+					<view class="uni-navbar__content_view" v-if="leftIcon.length">
+						<uni-icons :color="color" :type="leftIcon" size="24" />
+					</view>
+					<view :class="{ 'uni-navbar-btn-icon-left': !leftIcon.length }" class="uni-navbar-btn-text uni-navbar__content_view"
+					 v-if="leftText.length">
+						<text :style="{ color: color, fontSize: '14px' }">{{ leftText }}</text>
+					</view>
+					<slot name="left" />
+				</view>
+				<view class="uni-navbar__header-container uni-navbar__content_view">
+					<view class="uni-navbar__header-container-inner uni-navbar__content_view" v-if="title.length">
+						<text class="uni-nav-bar-text" :style="{color: color }">{{ title }}</text>
+					</view>
+					<!-- 标题插槽 -->
+					<slot />
+				</view>
+				<view :class="title.length ? 'uni-navbar__header-btns-right' : ''" @tap="onClickRight" class="uni-navbar__header-btns uni-navbar__content_view">
+					<view class="uni-navbar__content_view" v-if="rightIcon.length">
+						<uni-icons :color="color" :type="rightIcon" size="24" />
+					</view>
+					<!-- 优先显示图标 -->
+					<view class="uni-navbar-btn-text uni-navbar__content_view" v-if="rightText.length && !rightIcon.length">
+						<text class="uni-nav-bar-right-text">{{ rightText }}</text>
+					</view>
+					<slot name="right" />
+				</view>
+			</view>
+		</view>
+		<view class="uni-navbar__placeholder" v-if="fixed">
+			<uni-status-bar v-if="statusBar" />
+			<view class="uni-navbar__placeholder-view" />
+		</view>
+	</view>
+</template>
+
+<script>
+	import uniStatusBar from "../uni-status-bar/uni-status-bar.vue";
+	import uniIcons from "../uni-icons/uni-icons.vue";
+
+	export default {
+		name: "UniNavBar",
+		components: {
+			uniStatusBar,
+			uniIcons
+		},
+		props: {
+			title: {
+				type: String,
+				default: ""
+			},
+			leftText: {
+				type: String,
+				default: ""
+			},
+			rightText: {
+				type: String,
+				default: ""
+			},
+			leftIcon: {
+				type: String,
+				default: ""
+			},
+			rightIcon: {
+				type: String,
+				default: ""
+			},
+			fixed: {
+				type: [Boolean, String],
+				default: false
+			},
+			color: {
+				type: String,
+				default: "#000000"
+			},
+			backgroundColor: {
+				type: String,
+				default: "#FFFFFF"
+			},
+			statusBar: {
+				type: [Boolean, String],
+				default: false
+			},
+			shadow: {
+				type: [String, Boolean],
+				default: false
+			},
+			border: {
+				type: [String, Boolean],
+				default: true
+			}
+		},
+        mounted() {
+          if(uni.report && this.title !== '') {
+              uni.report('title', this.title)
+          }
+        },
+		methods: {
+			onClickLeft() {
+				this.$emit("clickLeft");
+			},
+			onClickRight() {
+				this.$emit("clickRight");
+			}
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	$nav-height: 44px;
+	.uni-nav-bar-text {
+		/* #ifdef APP-PLUS */
+		font-size: 34rpx;
+		/* #endif */
+		/* #ifndef APP-PLUS */
+		font-size: $uni-font-size-lg;
+		/* #endif */
+	}
+	.uni-nav-bar-right-text {
+		font-size: $uni-font-size-base;
+	}
+
+	.uni-navbar {
+		width: 750rpx;
+	}
+
+	.uni-navbar__content {
+		position: relative;
+		width: 750rpx;
+		background-color: $uni-bg-color;
+		overflow: hidden;
+	}
+
+	.uni-navbar__content_view {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		align-items: center;
+		flex-direction: row;
+		// background-color: #FFFFFF;
+	}
+
+	.uni-navbar__header {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		width: 750rpx;
+		height: $nav-height;
+		line-height: $nav-height;
+		font-size: 16px;
+		// background-color: #ffffff;
+	}
+
+	.uni-navbar__header-btns {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-wrap: nowrap;
+		width: 120rpx;
+		padding: 0 6px;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.uni-navbar__header-btns-left {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		width: 150rpx;
+		justify-content: flex-start;
+	}
+
+	.uni-navbar__header-btns-right {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		width: 150rpx;
+		padding-right: 30rpx;
+		justify-content: flex-end;
+	}
+
+	.uni-navbar__header-container {
+		flex: 1;
+	}
+
+	.uni-navbar__header-container-inner {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex: 1;
+		align-items: center;
+		justify-content: center;
+		font-size: $uni-font-size-base;
+	}
+
+
+	.uni-navbar__placeholder-view {
+		height: $nav-height;
+	}
+
+	.uni-navbar--fixed {
+		position: fixed;
+		z-index: 998;
+	}
+
+	.uni-navbar--shadow {
+		/* #ifndef APP-NVUE */
+		box-shadow: 0 1px 6px #ccc;
+		/* #endif */
+	}
+
+	.uni-navbar--border {
+		border-bottom-width: 1rpx;
+		border-bottom-style: solid;
+		border-bottom-color: $uni-border-color;
+	}
+</style>

+ 25 - 0
components/uni-status-bar/uni-status-bar.vue

@@ -0,0 +1,25 @@
+<template>
+	<view :style="{ height: statusBarHeight }" class="uni-status-bar">
+		<slot />
+	</view>
+</template>
+
+<script>
+	var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
+	export default {
+		name: 'UniStatusBar',
+		data() {
+			return {
+				statusBarHeight: statusBarHeight
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.uni-status-bar {
+		width: 750rpx;
+		height: 20px;
+		// height: var(--status-bar-height);
+	}
+</style>

二进制
images/avatar.png


二进制
images/dingwei.png


二进制
images/edit.png


二进制
images/errorbg.png


二进制
images/goods.jpg


二进制
images/jiantouxia.png


二进制
images/jiantouyou.png


二进制
images/minu.png


二进制
images/no_data.png


二进制
images/plus.png


二进制
images/user.png


二进制
images/userbg.png


+ 16 - 0
main.js

@@ -0,0 +1,16 @@
+import Vue from 'vue'
+import App from './App'
+
+import wechat from './common/util/wechat'
+if(wechat.isWechat()){
+    Vue.prototype.$wechat = wechat;
+}
+
+Vue.config.productionTip = false
+
+App.mpType = 'app'
+
+const app = new Vue({
+    ...App
+})
+app.$mount()

+ 98 - 0
manifest.json

@@ -0,0 +1,98 @@
+{
+    "name" : "慧后勤陪护",
+    "appid" : "__UNI__033BEA7",
+    "description" : "",
+    "versionName" : "1.0.0",
+    "versionCode" : "100",
+    "transformPx" : false,
+    /* 5+App特有相关 */
+    "app-plus" : {
+        "usingComponents" : true,
+        "nvueCompiler" : "uni-app",
+        "compilerVersion" : 3,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
+        },
+        /* 模块配置 */
+        "modules" : {},
+        /* 应用发布信息 */
+        "distribute" : {
+            /* android打包配置 */
+            "android" : {
+                "permissions" : [
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            /* ios打包配置 */
+            "ios" : {},
+            /* SDK配置 */
+            "sdkConfigs" : {}
+        }
+    },
+    /* 快应用特有相关 */
+    "quickapp" : {},
+    /* 小程序特有相关 */
+    "mp-weixin" : {
+        "appid" : "",
+        "setting" : {
+            "urlCheck" : false
+        },
+        "usingComponents" : true
+    },
+    "mp-alipay" : {
+        "usingComponents" : true
+    },
+    "mp-baidu" : {
+        "usingComponents" : true
+    },
+    "mp-toutiao" : {
+        "usingComponents" : true
+    },
+    "uniStatistics" : {
+        "enable" : false
+    },
+    "h5" : {
+        "title" : "慧后勤点餐",
+        "router" : {
+            "mode" : "hash",
+            "base" : "/shop/"
+        },
+        "devServer" : {
+            "https" : true,
+            "port" : 80
+        },
+        "optimization" : {
+            "treeShaking" : {
+                "enable" : true
+            }
+        },
+        "sdkConfigs" : {
+            "maps" : {}
+        },
+        "domain" : "http://h5.bosenzhihui.com"
+    }
+}

+ 93 - 0
pages.json

@@ -0,0 +1,93 @@
+{
+	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+		{
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "首页",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/index/wechat",
+			"style": {
+				"navigationBarTitleText": "登录",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/index/order",
+			"style": {
+				"navigationBarTitleText": "确认订单",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/user/index",
+			"style": {
+				"navigationBarTitleText": "我的",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/address/index",
+			"style": {
+				"navigationBarTitleText": "收货地址",
+				"enablePullDownRefresh": true,
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/address/select",
+			"style": {
+				"navigationBarTitleText": "选择收货地址",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/address/add",
+			"style": {
+				"navigationBarTitleText": "新增收货地址",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/order/index",
+			"style": {
+				"navigationBarTitleText": "我的订单",
+				"enablePullDownRefresh": true,
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/order/detail",
+			"style": {
+				"navigationBarTitleText": "订单详情",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		}
+	],
+	"globalStyle": {
+		"navigationBarTextStyle": "white",
+		"navigationBarTitleText": "柏森点餐",
+		"navigationBarBackgroundColor": "#50ACF9",
+		"backgroundColor": "#50ACF9"
+	}
+}

+ 388 - 0
pages/address/add.vue

@@ -0,0 +1,388 @@
+<template>
+	<view>
+		<view class="address-box">
+			<view class="address-box-list">
+				<view class="address-box-label">
+					姓名
+				</view>
+				<view class="address-box-input">
+					<input v-model="name" placeholder="请输入" type="text">
+				</view>
+			</view>
+			<view class="address-box-list">
+				<view class="address-box-label">
+					手机号
+				</view>
+				<view class="address-box-input">
+					<input v-model="phone" placeholder="请输入" type="tel">
+				</view>
+			</view>	
+			<!-- <view class="address-box-list">
+				<view class="address-box-label">
+					地址
+				</view>
+				<view class="address-box-input">
+					<picker mode="multiSelector" @change="bindChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex" :range="multiArray">
+						<view class="uni-input" v-if="selectAddr.length > 0">{{addrStr}}</view>
+						<view class="uni-input" v-if="selectAddr.length == 0" style="color:grey;">{{addrStr}}</view>
+					</picker>
+				</view>
+			</view> -->
+			<view class="address-box-list">
+				<view class="address-box-label">
+					详细地址
+				</view>
+				<view class="address-box-input">
+					<input v-model="content" placeholder="请输入" type="text">
+				</view>
+			</view>
+			
+		</view>
+		
+		<view class="address-btn" @click="saveBtn">
+			保 存
+		</view>
+		<view v-if="id > 0" class="address-btn-del" @click="delAddr">
+			删 除
+		</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				id: 0,
+				name: '',
+				phone: '',
+				content: '',
+				// addressId1: 0,
+				// addressId2: 0,
+				multiArray: [],
+				multiArray2: [],
+				multiIndex: [0, 0],
+				addrStr: '请选择',
+				selectAddr: [],
+				addrs: [],
+				// addrs: [
+				// 	{
+				// 		id: 1,
+				// 		name: '亚洲',
+				// 		pid: 0
+				// 	},
+				// 	{
+				// 		id: 2,
+				// 		name: '欧洲',
+				// 		pid: 0
+				// 	},
+				// 	{
+				// 		id: 3,
+				// 		name: '中国',
+				// 		pid: 1
+				// 	},
+				// 	{
+				// 		id: 4,
+				// 		name: '日本',
+				// 		pid: 1
+				// 	},
+				// 	{
+				// 		id: 5,
+				// 		name: '英国',
+				// 		pid: 2
+				// 	},
+				// 	{
+				// 		id: 6,
+				// 		name: '法国',
+				// 		pid: 2
+				// 	}
+				// ]
+			}
+		},
+		onLoad(option) {
+			this.id = option.id?option.id:0;
+			if(this.id > 0){
+				uni.setNavigationBarTitle({
+				    title: '编辑收货地址'
+				});
+				this.getAddrDetail();
+			}
+			// this.getAddr();
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'addr'){
+					this.addrs = res.data.data;
+					that.initAddr();
+				} else if (apiname == 'addrDetail'){
+					this.name = res.data.data.name;
+					this.phone = res.data.data.phone;
+					this.content = res.data.data.content;
+					// this.addressId1 = res.data.data.addressId1;
+					// this.addressId2 = res.data.data.addressId2;
+					// this.selectAddr = [this.addressId1,this.addressId2];
+					this.formatSelect();
+				} else if (apiname == 'saveAddr') {
+					uni.showToast({
+						title: '保存成功',
+						icon: 'none',
+						duration: 2000
+					})
+					setTimeout(function(){
+						uni.navigateBack({
+						    delta: 1
+						});
+					},1000);
+				} else if (apiname == 'delAddr'){
+					uni.showToast({
+						title: '删除成功',
+						icon: 'none',
+						duration: 2000
+					})
+					setTimeout(function(){
+						uni.navigateBack({
+						    delta: 1
+						});
+					},1000);
+				}
+			}
+		},
+		methods: {
+			/* formatSelect(){
+				const address = [];
+				this.selectAddr.forEach((item) => {
+					this.addrs.forEach((item2) => {
+						if(item == item2.id){
+							address.push(item2.name);
+						}
+					});
+				});
+				
+				if(address.length > 0){
+					this.addrStr = address.join(',');
+				}else{
+					this.addrStr = '请选择';
+				}
+				this.addressId1 = this.selectAddr[0];
+				this.addressId2 = this.selectAddr[1];
+				console.log(address,this.addrStr,this.selectAddr);
+			},
+			initAddr(){
+				const arra1 = [];
+				const arra2 = [];
+				const arrb1 = [];
+				const arrb2 = [];
+				this.addrs.forEach((item) => {
+					if(item.pid == 0){
+						arra1.push(item.name);
+						arrb1.push(item.id);
+					}
+				});
+				this.addrs.forEach((item) => {
+					if(item.pid == arrb1[0]){
+						arra2.push(item.name);
+						arrb2.push(item.id);
+					}
+				});
+				this.multiArray.push(arra1);
+				this.multiArray.push(arra2);
+				this.multiArray2.push(arrb1);
+				this.multiArray2.push(arrb2);
+				
+				this.formatSelect();
+			},
+			changeAddr(id){
+				const arra1 = this.multiArray[0];
+				const arra2 = [];
+				const arrb1 = this.multiArray2[0];
+				const arrb2 = [];
+				this.addrs.forEach((item) => {
+					if(item.pid == id){
+						arra2.push(item.name);
+						arrb2.push(item.id);
+					}
+				});
+				this.multiArray = [];
+				this.multiArray2 = [];
+				this.multiArray.push(arra1);
+				this.multiArray.push(arra2);
+				this.multiArray2.push(arrb1);
+				this.multiArray2.push(arrb2);
+			},
+			bindMultiPickerColumnChange: function(e) {
+				console.log(e);
+				console.log('修改的列为:' + e.detail.column + ',值为:' + e.detail.value);
+				this.multiIndex[e.detail.column] = e.detail.value;
+				switch (e.detail.column) {
+					case 0: //拖动第1列
+						this.changeAddr(this.multiArray2[0][this.multiIndex[0]]);
+						this.multiIndex.splice(1, 1, 0) //将multiIndex数据中的第2列初始化
+						this.selectAddr[0] = this.multiArray2[0][this.multiIndex[0]];
+						this.selectAddr[1] = this.multiArray2[1][this.multiIndex[1]];
+						break
+					case 1: //拖动第2列
+						this.selectAddr[1] = this.multiArray2[1][this.multiIndex[1]];
+						break
+				}
+				console.log(this.selectAddr,this.multiIndex);
+				this.formatSelect();
+				this.$forceUpdate();
+			},
+			bindChange: function(e){
+				this.multiIndex = e.detail.value;
+				this.selectAddr[0] = this.multiArray2[0][this.multiIndex[0]];
+				this.selectAddr[1] = this.multiArray2[1][this.multiIndex[1]];
+				this.formatSelect();
+			}, */
+			// getAddr(){
+			// 	app.ajax({
+			// 		url: app.globalData.serverUrl + 'shopAddress/getAddress',
+			// 		type: 'POST',
+			// 		apiname: 'addr'
+			// 	});
+			// },
+			getAddrDetail(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'shopAddress/detail',
+					type: 'POST',
+					apiname: 'addrDetail',
+					data: {
+						id: this.id
+					}
+				});
+			},
+			delAddr(){
+				var that = this;
+				uni.showModal({
+				    title: '提示',
+				    content: '确定要删除此地址吗?',
+				    success: function (res) {
+				        if (res.confirm) {
+				            app.ajax({
+				            	url: app.globalData.serverUrl + 'shopAddress/del',
+				            	type: 'POST',
+				            	apiname: 'delAddr',
+				            	data: {
+				            		id: that.id
+				            	}
+				            });
+				        } else if (res.cancel) {
+				            console.log('用户点击取消');
+				        }
+				    }
+				});
+			},
+			saveBtn(){
+				if(!this.name){
+					uni.showToast({
+						title: '请填写姓名',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.phone){
+					uni.showToast({
+						title: '请填写手机号',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				// if(!this.addressId1||!this.addressId2){
+				// 	uni.showToast({
+				// 		title: '请选择地址',
+				// 		icon: 'none',
+				// 		duration: 2000
+				// 	})
+				// 	return;
+				// }
+				if(!this.content){
+					uni.showToast({
+						title: '请填写详细地址',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				
+				let param = {
+					id: this.id,
+					name: this.name,
+					phone: this.phone,
+					// address_id1: this.addressId1,
+					// address_id2: this.addressId2,
+					content: this.content
+				}
+				let url = app.globalData.serverUrl + 'shopAddress/add';
+				if(this.id > 0){
+					url = app.globalData.serverUrl + 'shopAddress/update';
+				}
+				app.ajax({
+					url: url,
+					type: 'POST',
+					apiname: 'saveAddr',
+					data: param
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.address-box{
+		background-color: #FFFFFF;
+		padding: 0 20rpx;
+		margin-top: 20rpx;
+	}
+	.address-box-list{
+		height: 90rpx;
+		line-height: 90rpx;
+		border-bottom: 1rpx solid #f2f2f2;
+	}
+	.address-box-list:last-child{
+		border: 0;
+	}
+	.address-box-label{
+		display: inline-block;
+		width: 150rpx;
+		height: 100%;
+		float: left;
+	}
+	.address-box-input{
+		display: inline-block;
+		width: 550rpx;
+		height: 100%;
+		float: right;
+	}
+	.address-box-input input{
+		height: 70rpx;
+		margin-top: 10rpx;
+	}
+	
+	.address-btn{
+		width: 700rpx;
+		height: 70rpx;
+		line-height: 70rpx;
+		color: #FFFFFF;
+		background-color: $theme-color;
+		border-radius: 10rpx;
+		margin: 50rpx auto 20rpx auto;
+		text-align: center;
+	}
+	
+	.address-btn-del{
+		width: 700rpx;
+		height: 70rpx;
+		line-height: 70rpx;
+		color: $theme-color;
+		background-color: #FFFFFF;
+		border: 1rpx solid $theme-color;
+		border-radius: 10rpx;
+		margin: 10rpx auto;
+		text-align: center;
+	}
+</style>

+ 252 - 0
pages/address/index.vue

@@ -0,0 +1,252 @@
+<template>
+	<view>
+		<view class="address-box">
+			<template v-if="addrs.length > 0 && type == 0">
+				<view v-for="(item,index) in addrs" :key="index" class="address-box-list">
+					<view class="address-box-left">
+						<text class="address-box-title">{{item.name}}  {{item.phone}}</text>
+						<text class="address-box-desc">{{item.content}}</text>
+					</view>
+					<view class="address-box-right" @click="handleEdit(item)">
+						<image src="../../images/edit.png"></image>
+					</view>
+				</view>
+			</template>
+			
+			<template v-if="addrs.length > 0 && type == 1">
+				<radio-group @change="radioChange">
+					<view class="address-box-list" v-for="(item, index) in addrs" :key="index">
+						<label>
+							<view class="address-box-select">
+								<radio :value="item.id" :checked="item.id === current" />
+							</view>
+							<view class="address-box-left2">
+								<text class="address-box-title">{{item.name}}  {{item.phone}}</text>
+								<text class="address-box-desc">{{item.address1}} {{item.address2}} {{item.room}}</text>
+							</view>
+						</label>
+						<view class="address-box-right" @click="handleEdit(item)">
+							<image src="../../images/edit.png"></image>
+						</view>
+					</view>
+				</radio-group>
+			</template>
+			
+			
+			
+			
+			
+			<view v-if="addrs.length == 0" class="no-data">
+				<image src="../../images/no_data.png" mode=""></image>
+				<view class="no-data-text">
+					空空如也~
+				</view>
+			</view>
+		</view>
+		
+		<view class="bottom-btn" @click="handleAdd">
+			新增收货地址
+		</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				addrs: [],
+				page: 1,
+				size: 20,
+				flag: 0,
+				type: 0,
+				current: 0
+			}
+		},
+		onLoad(option) {
+			var that = this;
+			this.type = option.type?option.type:0;
+			if(this.type == 1){
+				uni.setNavigationBarTitle({
+				    title: '选择地址'
+				});
+				
+				const eventChannel = this.getOpenerEventChannel()
+				// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
+				eventChannel.on('acceptDataFromOpenerPage', function(data) {
+					that.current = data.addressId;
+				})
+			}
+			
+		},
+		onShow(){
+			var that = this;
+
+			this.flag = 0;
+			this.page = 1;
+			this.getAddress();
+			
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'addr'){
+					that.addrs = res.data.data;
+					if (that.addrs.length < that.size) {
+						that.flag = 1;
+					} else {
+						that.page++;
+					}
+				}
+			}
+		},
+		onPullDownRefresh() {
+			this.flag = 0;
+			this.page = 1;
+			this.getAddress();
+		},
+		onReachBottom() { //上拉加载
+			console.log('11111111');
+		    this.getAddress();
+		},
+		methods: {
+			handleAdd(){
+				uni.navigateTo({
+				    url: '/pages/address/add'
+				});
+			},
+			handleEdit(obj){
+				uni.navigateTo({
+				    url: '/pages/address/add?id='+obj.id
+				});
+			},
+			getAddress(){
+				if(this.flag == 1){
+					return;
+				}
+				app.ajax({
+					url: app.globalData.serverUrl + 'shopAddress/list',
+					type: 'POST',
+					apiname: 'addr',
+					data: {
+						page: this.page,
+						size: this.size
+					}
+				});
+			},
+			radioChange(evt) {
+				this.addrs.forEach((item,index) => {
+					if (item.id === evt.detail.value) {
+						this.current = item.id;
+						const eventChannel = this.getOpenerEventChannel()
+						eventChannel.emit('acceptDataFromOpenedPage', item);
+						uni.navigateBack({
+						    delta: 1
+						});
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.address-box{
+		padding-bottom: 100rpx;
+	}
+	.address-nodata{
+		margin-top: 150rpx;
+		text-align: center;
+		font-size: 32rpx;
+		color: #666666;
+	}
+	.address-box-list{
+		background-color: #FFFFFF;
+		margin: 10rpx 0;
+		padding: 10rpx 20rpx;
+		overflow: hidden;
+	}
+	.address-box-left{
+		display: inline-block;
+		width: 630rpx;
+		height: auto;
+		float: left;
+	}
+	.address-box-left .address-box-title{
+		display: inline-block;
+		width: 100%;
+		height: 30rpx;
+		line-height: 30rpx;
+		color: #3E3E3E;
+		font-size: 32rpx;
+	}
+	.address-box-left .address-box-desc{
+		display: inline-block;
+		width: 100%;
+		height: 30rpx;
+		line-height: 30rpx;
+		color: #949494;
+		font-size: 28rpx;
+	}
+	.address-box-right{
+		display: inline-block;
+		width: 60rpx;
+		height: auto;
+		float: right;
+		text-align: center;
+	}
+	.address-box-right image{
+		width: 40rpx;
+		height: 40rpx;
+		vertical-align: middle;
+		margin-top: 20rpx;
+	}
+	
+	.address-box-left2{
+		display: inline-block;
+		width: 570rpx;
+		height: auto;
+		float: left;
+	}
+	.address-box-left2 .address-box-title{
+		display: inline-block;
+		width: 100%;
+		height: 30rpx;
+		line-height: 30rpx;
+		color: #3E3E3E;
+		font-size: 32rpx;
+	}
+	.address-box-left2 .address-box-desc{
+		display: inline-block;
+		width: 100%;
+		height: 30rpx;
+		line-height: 30rpx;
+		color: #949494;
+		font-size: 28rpx;
+	}
+	
+	.bottom-btn{
+		width: 100%;
+		height: 98rpx;
+		line-height: 98rpx;
+		background-color: $theme-color;
+		color: #FFFFFF;
+		text-align: center;
+		position: fixed;
+		z-index: 100;
+		left: 0;
+		bottom: 0;
+	}
+	
+	.address-box-select{
+		display: inline-block;
+		width: 60rpx;
+		height: auto;
+		float: left;
+	}
+	.address-box-select radio{
+		width: 40rpx;
+		height: 40rpx;
+		// vertical-align: middle;
+		margin-top: 20rpx;
+	}
+</style>

+ 161 - 0
pages/address/select.vue

@@ -0,0 +1,161 @@
+<template>
+	<view>
+		<view class="address-box">
+			
+			<radio-group @change="radioChange">
+				<view class="address-box-list" v-for="(item, index) in items" :key="item.value">
+					<label>
+						<view class="address-box-select">
+							<radio :value="item.value" :checked="index === current" />
+						</view>
+						<view class="address-box-left2">
+							<text class="address-box-title">{{item.name}}  </text>
+							<text class="address-box-desc">asd asdsa dasda sdad asdas</text>
+						</view>
+					</label>
+					<view class="address-box-right">
+						<image src="../../images/edit.png"></image>
+					</view>
+				</view>
+			</radio-group>
+			
+			
+			
+			<view class="address-nodata">
+				还没有添加收货地址哦~
+			</view>
+		</view>
+		
+		<view class="bottom-btn">
+			新增收货地址
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				title: 'radio 单选框',
+				items: [{
+						value: 'USA',
+						name: '美国'
+					},
+					{
+						value: 'CHN',
+						name: '中国',
+						checked: 'true'
+					},
+					{
+						value: 'BRA',
+						name: '巴西'
+					},
+					{
+						value: 'JPN',
+						name: '日本'
+					},
+					{
+						value: 'ENG',
+						name: '英国'
+					},
+					{
+						value: 'FRA',
+						name: '法国'
+					},
+				],
+				current: 0
+			}
+		},
+		onLoad() {
+
+		},
+		methods: {
+			radioChange(evt) {
+				for (let i = 0; i < this.items.length; i++) {
+					if (this.items[i].value === evt.detail.value) {
+						this.current = i;
+						break;
+					}
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.address-box{
+		padding-bottom: 100rpx;
+	}
+	.address-nodata{
+		margin-top: 150rpx;
+		text-align: center;
+		font-size: 32rpx;
+		color: #666666;
+	}
+	.address-box-list{
+		background-color: #FFFFFF;
+		margin: 10rpx 0;
+		padding: 10rpx 20rpx;
+		overflow: hidden;
+	}
+	.address-box-left2{
+		display: inline-block;
+		width: 570rpx;
+		height: auto;
+		float: left;
+	}
+	.address-box-left2 .address-box-title{
+		display: inline-block;
+		width: 100%;
+		height: 30rpx;
+		line-height: 30rpx;
+		color: #3E3E3E;
+		font-size: 32rpx;
+	}
+	.address-box-left2 .address-box-desc{
+		display: inline-block;
+		width: 100%;
+		height: 30rpx;
+		line-height: 30rpx;
+		color: #949494;
+		font-size: 28rpx;
+	}
+	.address-box-right{
+		display: inline-block;
+		width: 60rpx;
+		height: auto;
+		float: right;
+		text-align: center;
+	}
+	.address-box-right image{
+		width: 40rpx;
+		height: 40rpx;
+		vertical-align: middle;
+		margin-top: 20rpx;
+	}
+	.address-box-select{
+		display: inline-block;
+		width: 60rpx;
+		height: auto;
+		float: left;
+	}
+	.address-box-select radio{
+		width: 40rpx;
+		height: 40rpx;
+		// vertical-align: middle;
+		margin-top: 20rpx;
+	}
+	
+	.bottom-btn{
+		width: 100%;
+		height: 98rpx;
+		line-height: 98rpx;
+		background-color: $theme-color;
+		color: #FFFFFF;
+		text-align: center;
+		position: fixed;
+		z-index: 100;
+		left: 0;
+		bottom: 0;
+	}
+</style>

+ 674 - 0
pages/index/index.vue

@@ -0,0 +1,674 @@
+<template>
+	<view>
+		<view class="nav-header">
+			<view class="nav-header-left">
+				<text class="nav-header-left-text">{{orgName}}</text>
+			<!-- 	<image class="nav-header-left-icons1" src="../../images/dingwei.png"></image> -->
+				<!-- <text class="nav-header-left-text" @click="getLocation">{{orgName}}</text> -->
+				<!-- <image class="nav-header-left-icons2" src="../../images/jiantouxia.png"></image> -->
+			</view>
+			<view class="nav-header-right">
+				<image src="../../images/user.png" @click="goUser"></image>
+			</view>
+		</view>
+		
+		<view class="calendar-box">
+			<template v-for="(item,index) in date">
+				<view :key="index" class="calendar-box-list" :class="curDay == item.date?'cur':''" @click="selectDate(item)">
+					<view class="calendar-box-list-l1">{{item.week}}</view>
+					<view class="calendar-box-list-l2">{{item.day}}</view>
+				</view>
+			</template>
+		</view>
+		
+		<view class="subnav-box">
+			<template v-for="(item,index) in types">
+				<view class="subnav-box-list" :class="curType == item.id?'cur':''" @click="selectType(item)">{{item.name}}</view>
+			</template>
+		</view>
+		
+		<view class="main">
+			<view class="main-cate">
+				<template v-for="(item,index) in cate">
+					<view :key="index" class="main-cate-list" :class="item.id == curCate?'cur':''" @click="selectCate(item)">
+						{{item.name}}
+					</view>
+				</template>
+			</view>
+			<view class="main-goods">
+				
+				<template v-if="goods.length > 0">
+					<view class="main-goods-cate">
+						{{curCateText}}
+					</view>
+					<view class="main-goods-list" v-for="(item,index) in goods" :key="index">
+						<view class="main-goods-img">
+							<image v-if="item.imageLoad" :src="item.img" @error="onErrorImg(item)" @load="onSuccessImg(item)" mode="aspectFill"></image>
+							<image v-if="!item.imageLoad" src="../../images/errorbg.png" mode="aspectFill"></image>
+						</view>
+						<view class="main-goods-box">
+							<view class="main-goods-title">
+								{{item.title}}
+							</view>
+							<view class="main-goods-desc">
+								{{item.description}}
+							</view>
+							<view class="main-goods-nums">
+								<text class="main-goods-price">¥{{item.price}}</text>
+								<image v-if="item.nums > 0" src="../../images/minu.png" @click="minuGoods(item)"></image>
+								<text v-if="item.nums > 0">{{item.nums}}</text>
+								<image src="../../images/plus.png" @click="plusGoods(item)"></image>
+							</view>
+						</view>
+					</view>
+				</template>
+				<template v-else>
+					<view class="no-data">
+						<image src="../../images/no_data.png" mode=""></image>
+						<view class="no-data-text">
+							空空如也~
+						</view>
+					</view>
+				</template>
+				
+				<view>
+					<br>
+				</view>
+			</view>
+		</view>
+		
+		<view class="bottom-box">
+			<view class="bottom-box-icon">
+				<image src="../../images/plus.png"></image>
+				<view v-if="cart > 0" class="bottom-box-count">
+					{{cart}}
+				</view>
+			</view>
+			<view class="bottom-box-text">
+				<text v-if="totalPrice > 0">总价:¥{{totalPrice}}元</text>
+			</view>
+			<view class="bottom-box-btn" @click="goOrder">
+				确认订单
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				orgId: '',
+				orgName: '',
+				date: [],
+				curDay: '',
+				cate: [],
+				curCate: 0,
+				curCateText: '',
+				curType: 0,
+				types: [],
+				goods: [],
+				cart: 0,
+				totalPrice: 0
+			}
+		},
+		onLoad() {
+			var orgId = this.getUrlCode('orgId');
+			console.log('sssss1',orgId);
+			if(orgId){
+				uni.setStorageSync(app.globalData.storagePre+'orgId',orgId);
+				app.globalData.userinfo.orgId = orgId;
+			}else{
+				orgId = uni.getStorageSync(app.globalData.storagePre+'orgId');
+				if(orgId){
+					app.globalData.userinfo.orgId = orgId;
+				}else{
+					uni.showToast({
+						title: '参数错误',
+						icon: 'none',
+						duration: 2000
+					})
+				}
+			}
+			
+			console.log('sssss',orgId);
+			
+			app.checkLogin();
+			
+			this.orgId = uni.getStorageSync(app.globalData.storagePre+'orgId');
+			this.orgName = uni.getStorageSync(app.globalData.storagePre+'orgName');
+		
+		},
+		onShow() {
+			this.cart = 0;
+			this.totalPrice = 0;
+			
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'shop'){
+					that.orgId = res.data.data.orgId;
+					that.orgName = res.data.data.name;
+					uni.setStorageSync(app.globalData.storagePre+'orgId',res.data.data.orgId);
+					uni.setStorageSync(app.globalData.storagePre+'orgName',res.data.data.name);
+					that.getDate();
+				} else if (apiname == 'date') {
+					that.date = res.data.data;
+					that.curDay = that.date[0].date;
+					that.getType();
+				} else if (apiname == 'types') {
+					that.types = res.data.data;
+					that.curType = that.types[0].id;
+					that.getCate();
+				} else if (apiname == 'cate') {
+					that.cate = res.data.data;
+					this.cart = 0;
+					this.totalPrice = 0;
+					if(that.cate.length > 0){
+						that.cate.forEach((item) => {
+							const info = item;
+							info.goods.forEach((item2) => {
+								const info2 = item2;
+								info2.nums = 0;
+								info2.imageLoad = true;
+							})
+						})
+						that.curCate = that.cate[0].id;
+						that.curCateText = that.cate[0].name;
+						that.goods = that.cate[0].goods;
+					}
+				}else if(apiname == 'orgInfo'){
+				
+					that.orgId = res.data.data.orgId;
+					that.orgName = res.data.data.name;
+					uni.setStorageSync(app.globalData.storagePre+'orgName',res.data.name);					
+					that.getDate();
+				}
+			}
+			this.getLocation();
+		},
+		methods: {
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+			goUser(){
+				uni.navigateTo({
+				    url: '/pages/user/index'
+				});
+			},
+			goOrder(){
+				const selectGoods = [];
+				this.cate.forEach((item) => {
+					item.goods.forEach((item2) => {
+						if(item2.nums > 0){
+							selectGoods.push(item2);
+						}
+					})
+				});
+				try {
+					const data = {
+						goods: selectGoods,
+						type: this.curType,
+						day: this.curDay
+					}
+					if(data.goods.length == 0 || !data.type || !data.day){
+						uni.showToast({
+							title: '未选择商品',
+							icon: 'none',
+							duration: 2000
+						});
+						return;
+					}
+			
+				    uni.setStorageSync(app.globalData.storagePre+'orderData',JSON.stringify(data));
+				    uni.navigateTo({
+				        url: '/pages/index/order'
+				    });
+				} catch (e) {
+				    uni.showToast({
+				    	title: '操作失败,请重试',
+				    	icon: 'none',
+				    	duration: 2000
+				    })
+				}
+			},
+			getLocation(){
+			
+				app.ajax({
+					url: app.globalData.serverUrl + 'org/info',
+					type: 'POST',
+					apiname: 'orgInfo',
+					
+				});
+				// 	this.orgName = "定位中...";
+				// 	// let lat = 34.747486;
+				// 	// let lng = 113.666841;
+				
+				// 	let that = this;
+					
+				// 	if (this.$wechat && this.$wechat.isWechat()) {//获取定位经纬度
+				// 		 this.$wechat.location(function (res) {
+				// 			console.log(res)
+				// 			let lat = res.latitude; // 纬度,浮点数,范围为90 ~ -90
+				// 			let lng = res.longitude; // 经度,浮点数,范围为180 ~ -180。
+							
+				// 			that.getShop(lat,lng);
+							
+					
+				// 			//根据经纬度,解析区域,提示用户输入
+				// 		 });
+				// 	}
+				
+				// that.getShop(lat,lng);
+			},
+			getOrg(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'org/info',
+					type: 'POST',
+					apiname: 'orgInfo',
+					
+				});
+			},
+			// getShop(lat,lng){
+			// 	app.ajax({
+			// 		url: app.globalData.serverUrl + 'org/info',
+			// 		type: 'POST',
+			// 		apiname: 'shop',
+			// 		data: {
+			// 			lat: lat,
+			// 			lng: lng
+			// 		}
+			// 	});
+			// },
+			getDate(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'shopDay/date',
+					type: 'POST',
+					apiname: 'date'
+				});
+			},
+			getType(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'shopDay/types',
+					type: 'POST',
+					apiname: 'types',
+					data: {
+						day: this.curDay
+					}
+				});
+			},
+			getCate(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'shopDay/cate',
+					type: 'POST',
+					apiname: 'cate',
+					data: {
+						type: this.curType
+					}
+				});
+			},
+			// getGoods(){
+			// 	app.ajax({
+			// 		url: app.globalData.serverUrl + 'server/shopDay/goods',
+			// 		type: 'POST',
+			// 		apiname: 'goods',
+			// 		data: {
+			// 			type: this.curType,
+			// 			cate_id: this.curCate
+			// 		}
+			// 	});
+			// },
+			selectDate(item){
+				this.curDay = item.date;
+				this.goods = [];
+				this.cate = [];
+				this.formatGoods();
+				this.getType();
+			},
+			selectType(item){
+				this.curType = item.id;
+				this.goods = [];
+				this.cate = [];
+				this.formatGoods();
+				this.getCate();
+			},
+			selectCate(item){
+				this.curCate = item.id;
+				this.curCateText = item.name;
+				this.goods = item.goods;
+				this.formatGoods();
+				// this.getGoods();
+			},
+			plusGoods(obj){
+				this.goods.forEach((item) => {
+					const info = item;
+					if(info.id == obj.id){
+						if(info.nums < 200){
+							info.nums++;
+						}
+					}
+				})
+				this.formatGoods();
+			},
+			minuGoods(obj){
+				this.goods.forEach((item) => {
+					const info = item;
+					if(info.id == obj.id){
+						if(info.nums > 0){
+							info.nums--;
+						}
+					}
+				})
+				this.formatGoods();
+			},
+			onErrorImg(item){
+				this.$set(item, 'imageLoad', false);
+				this.$forceUpdate();
+			},
+			onSuccessImg(item){
+				this.$set(item, 'imageLoad', true);
+				this.$forceUpdate();
+			},
+			formatGoods(){
+				this.cart = 0;
+				this.totalPrice = 0;
+				
+				this.cate.forEach((item) => {
+					const info = item;
+					if(item.id == this.curCate){
+						info.goods = this.goods;
+					}
+				});
+				
+				this.cate.forEach((item) => {
+					const info = item;
+					info.goods.forEach((item2) => {
+						this.cart += item2.nums;
+						this.totalPrice += item2.nums*parseFloat(item2.price);
+					});
+				});
+				
+				this.$forceUpdate();
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	page{
+		background-color: #FFFFFF;
+	}
+	.nav-header {
+		background-color: $theme-color;
+		height: 44px;
+		line-height: 44px;
+		width: 100%;
+		overflow: hidden;
+		color: #FFFFFF;
+	}
+	.nav-header-left{
+		display: inline-block;
+		width: 500rpx;
+		height: 100%;
+		float: left;
+		padding-left: 20rpx;
+	}
+	.nav-header-left-icons1{
+		width: 38rpx;
+		height: 38rpx;
+		vertical-align: middle;
+	}
+	.nav-header-left-text{
+		vertical-align: middle;
+		font-size: 34rpx;
+		padding: 0 15rpx;
+		max-width: 450rpx;
+	}
+	.nav-header-left-icons2{
+		width: 24rpx;
+		height: 14rpx;
+		vertical-align: middle;
+	}
+	.nav-header-right{
+		display: inline-block;
+		width: 150rpx;
+		height: 100%;
+		float: right;
+		text-align: right;
+		padding-right: 20rpx;
+	}
+	.nav-header-right image{
+		width: 38rpx;
+		height: 38rpx;
+		vertical-align: middle;
+	}
+	
+	.calendar-box{
+		text-align: center;
+		overflow: hidden;
+		font-size: 32rpx;
+		background-color: #F5FBFF;
+	}
+	.calendar-box-list{
+		width: 107rpx;
+		height: 114rpx;
+		float: left;
+		padding-top: 6rpx;
+	}
+	.calendar-box-list .calendar-box-list-l1{
+		width: 100%;
+		height: 50rpx;
+		line-height: 50rpx;
+	}
+	.calendar-box-list .calendar-box-list-l2{
+		display: inline-block;
+		width: 50rpx;
+		height: 50rpx;
+		line-height: 50rpx;
+		border-radius: 50%;
+	}
+	.calendar-box-list.cur .calendar-box-list-l1{
+		color: $theme-color;
+	}
+	.calendar-box-list.cur .calendar-box-list-l2{
+		color: #FFFFFF;
+		background-color: $theme-color;
+		border-radius: 50%;
+	}
+	
+	.subnav-box{
+		color: #333333;
+		font-size: 32rpx;
+		text-align: center;
+		font-weight: 400;
+		overflow: hidden;
+		background-color: #FFFFFF;
+		// border-bottom: 1rpx solid #F3F3F3;
+	}
+	.subnav-box .subnav-box-list{
+		display: inline-block;
+		width: 120rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		float: left;
+		position: relative;
+	}
+	.subnav-box .subnav-box-list.cur{
+		font-weight: bold;
+	}
+	.subnav-box .cur::after{
+		content: '';
+		position: absolute;
+		z-index: 10;
+		width: 30rpx;
+		height: 4rpx;
+		bottom: 0;
+		left: 50%;
+		margin-left: -15rpx;
+		background-color: $theme-color;
+	}
+	
+	.bottom-box{
+		width: 100%;
+		height: 100rpx;
+		line-height:100rpx;
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		background-color: #DDDDDD;
+		overflow: hidden;
+		z-index: 100;
+	}
+	.bottom-box .bottom-box-btn{
+		display: inline-block;
+		width: 196rpx;
+		height: 100%;
+		background-color: $theme-color;
+		font-size: 38rpx;
+		color: #FFFFFF;
+		float: right;
+		text-align: center;
+	}
+	.bottom-box .bottom-box-icon{
+		display: inline-block;
+		width: 140rpx;
+		height: 100%;
+		position: relative;
+		text-align: center;
+		float: left;
+	}
+	.bottom-box .bottom-box-icon image{
+		width: 64rpx;
+		height: 64rpx;
+		border-radius: 50%;
+		vertical-align: middle;
+	}
+	.bottom-box .bottom-box-icon .bottom-box-count{
+		min-width: 34rpx;
+		height: 34rpx;
+		line-height: 34rpx;
+		background-color: #FF541F;
+		color: #FFFFFF;
+		border-radius: 17rpx;
+		position: absolute;
+		z-index: 10;
+		right: 10rpx;
+		top: 10rpx;
+		font-size: 24rpx;
+		padding: 0 5rpx;
+	}
+	.bottom-box .bottom-box-text{
+		width: 410rpx;
+		height: 100%;
+		color: #949494;
+		font-size: 34rpx;
+		font-weight: 400;
+		float: left;
+	}
+	
+	.main{
+		position: fixed;
+		top: 290rpx;
+		left: 0;
+		right: 0;
+		bottom: 100rpx;
+		z-index: 10;
+		background-color: #FFFFFF;
+	}
+	.main .main-cate{
+		width: 180rpx;
+		height: 100%;
+		background-color: #F3F3F3;
+		float: left;
+		text-align: center;
+		color: #333333;
+		font-size: 30rpx;
+		overflow: auto;
+	}
+	.main .main-cate .main-cate-list{
+		height: 90rpx;
+		line-height: 90rpx;
+	}
+	.main .main-cate .main-cate-list.cur{
+		background-color: #FFFFFF;
+	}
+	
+	.main .main-goods{
+		width: 530rpx;
+		height: 100%;
+		background-color: #FFFFFF;
+		float: right;
+		// padding-right: 20rpx;
+		overflow: auto;
+		// padding-top: 10rpx;
+		// padding-bottom: 30rpx;
+		padding: 20rpx;
+	}
+	.main-goods-cate{
+		font-size: 30rpx;
+		line-height: 40rpx;
+		color: #333333;
+		font-weight: bold;
+	}
+	
+	.main-goods-list{
+		width: 530rpx;
+		height: 150rpx;
+		margin: 20rpx 0;
+	}
+	.main-goods-list .main-goods-img{
+		width: 150rpx;
+		height: 150rpx;
+		float: left;
+	}
+	.main-goods-list .main-goods-img image{
+		width: 100%;
+		height: 100%;
+	}
+	
+	.main-goods-box{
+		width: 360rpx;
+		height: 100%;
+		float: right;
+	}
+	.main-goods-title{
+		display: block;
+		font-size: 30rpx;
+		font-weight: bold;
+		line-height: 50rpx;
+		color: #333333;
+	}
+	.main-goods-desc{
+		line-height: 30rpx;
+		height: 60rpx;
+		font-size: 24rpx;
+		color: #333333;
+	}
+	
+	.main-goods-nums{
+		height: 40rpx;
+		line-height: 40rpx;
+		text-align: right;
+	}
+	.main-goods-price{
+		width: 100rpx;
+		display: inline-block;
+		float: left;
+		font-size: 28rpx;
+		color: #FF541F;
+		text-align: left;
+		padding: 0 !important;
+	}
+	.main-goods-nums image{
+		width: 44rpx;
+		height: 44rpx;
+		vertical-align: middle;
+	}
+	.main-goods-nums text{
+		padding: 0 20rpx;
+		vertical-align: middle;
+	}
+	
+</style>

+ 321 - 0
pages/index/order.vue

@@ -0,0 +1,321 @@
+<template>
+	<view>
+		<view class="address-box" @click="selectAddr">
+			<view class="address-box-left">
+				<view v-if="!address" class="address-box-unselect">选择收货地址</view>
+				<view v-if="address" class="address-box-select">
+					<view class="address-box-select-text1">
+						{{address.address1}}{{address.address2}}{{address.room}}
+					</view>
+					<view class="address-box-select-text2">
+						{{address.name}}  {{address.phone}}
+					</view>
+				</view>
+			</view>
+			<view class="address-box-right">
+				<image src="../../images/jiantouyou.png"></image>
+			</view>
+		</view>
+		
+		<view class="main">
+			<view class="order-box-list">
+				<view class="order-box-header">
+					<text class="order-box-title">{{orgName}}</text>
+					<text class="order-box-desc"></text>
+				</view>
+				<view v-for="(item,index) in goods" :key="index" class="order-box-body">
+					<view class="order-box-body-left">
+						<image v-if="item.imageLoad" :src="item.img" @error="onErrorImg(item)" @load="onSuccessImg(item)" mode="aspectFill"></image>
+						<image v-if="!item.imageLoad" src="../../images/errorbg.png" mode="aspectFill"></image>
+					</view>
+					<view class="order-box-body-middle">
+						<text class="order-box-body-desc">{{item.title}}</text>
+						<text class="order-box-body-cate">x{{item.nums}}</text>
+					</view>
+					<view class="order-box-body-right">
+						¥{{(item.nums*parseFloat(item.price)).toFixed(2)}}
+					</view>
+				</view>
+				<view class="order-box-footer">
+					合计 ¥{{totalPrice}}元
+				</view>
+			</view>
+		</view>
+		
+		<view class="order-btn" @click="addOrder">提交订单</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				goods: [],
+				totalPrice: 0,
+				orgName: '',
+				deliveryTime: null,
+				address: null,
+				type: 0
+			}
+		},
+		onLoad() {
+			this.orgName = uni.getStorageSync(app.globalData.storagePre+'orgName');
+			this.getAddr();
+		},
+		onShow() {
+			var that = this;
+			
+			try {
+			    const orderData =JSON.parse(uni.getStorageSync(app.globalData.storagePre+'orderData'));
+				const selectGoods = orderData.goods;
+				this.deliveryTime = orderData.day;
+				this.type = orderData.type;
+			    if (selectGoods.length > 0) {
+			        this.goods = selectGoods;
+					console.log(3333,orderData.goods,orderData);
+					this.formatGoods();
+			    }else{
+					console.log(2222);
+					uni.navigateBack({
+					    delta: 1
+					});
+				}
+			} catch (e) {
+				console.log(1111,e);
+			    uni.navigateBack({
+			        delta: 1
+			    });
+			}
+			
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'addr'){
+					that.address = res.data.data;
+				} else if (apiname == 'order') {
+					uni.showToast({
+						title: '下单成功',
+						icon: 'none',
+						duration: 2000
+					})
+					setTimeout(function(){
+						uni.navigateTo({
+						    url: '/pages/order/index'
+						});
+					},1000);
+				}
+			}
+		},
+		methods: {
+			formatGoods(){
+				this.totalPrice = 0;
+				this.goods.forEach((item) => {
+					this.totalPrice += item.nums*parseFloat(item.price);
+				});
+			},
+			getAddr(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'shopAddress/addressOne',
+					type: 'POST',
+					apiname: 'addr'
+				});
+			},
+			addOrder(){
+				const garr = [];
+				this.goods.forEach((item) => {
+					garr.push({
+						id: item.id,
+						nums: item.nums						
+					});
+				})
+				app.ajax({
+					url: app.globalData.serverUrl + 'shopOrder/addOrder',
+					type: 'POST',
+					apiname: 'order',
+					data: {
+						address_id: this.address.id,
+						delivery_time: this.deliveryTime,
+						type: this.type,
+						json: JSON.stringify(garr)
+					}
+				});
+			},
+			selectAddr(){
+				var that = this;
+				uni.navigateTo({
+					url: '/pages/address/index?type=1',
+					events: {
+						// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
+						acceptDataFromOpenedPage: function(data) {
+							console.log('jieshou:',data)
+							that.address = data;
+						}
+					},
+					success: function(res) {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit('acceptDataFromOpenerPage', { addressId: that.address?that.address.id:0 })
+					}
+				})
+			},
+			onErrorImg(item){
+				this.$set(item, 'imageLoad', false);
+				this.$forceUpdate();
+			},
+			onSuccessImg(item){
+				this.$set(item, 'imageLoad', true);
+				this.$forceUpdate();
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.order-btn{
+		width: 673rpx;
+		height: 72rpx;
+		border-radius: 10rpx;
+		color: #FFFFFF;
+		background-color: $theme-color;
+		line-height: 72rpx;
+		font-size: 38rpx;
+		text-align: center;
+		margin: 0 auto;
+		margin-top: 40rpx;
+	}
+	.address-box{
+		width: 680rpx;
+		height: 90rpx;
+		margin: 20rpx auto;
+		background-color: #FFFFFF;
+		border-radius: 10rpx;
+		padding: 10rpx 20rpx;
+	}
+	.address-box-left{
+		display: inline-block;
+		width: 630rpx;
+		height: 90rpx;
+		float: left;
+	}
+	.address-box-unselect{
+		width: 100%;
+		height: 90rpx;
+		line-height: 90rpx;
+	}
+	.address-box-select{
+		width: 100%;
+		height: 90rpx;
+		line-height: 45rpx;
+	}
+	.address-box-select-text1{
+		color: #333333;
+		font-size: 34rpx;
+		height: 45rpx;
+		overflow: hidden;
+		text-overflow: ellipsis;  /* 超出部分省略号 */
+		display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
+		-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
+		-webkit-line-clamp: 1; /** 显示的行数 **/
+	}
+	.address-box-select-text2{
+		color: #949494;
+		font-size: 28rpx;
+		height: 45rpx;
+		overflow: hidden;
+		text-overflow: ellipsis;  /* 超出部分省略号 */
+		display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
+		-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
+		-webkit-line-clamp: 1; /** 显示的行数 **/
+	}
+	.address-box-right{
+		display: inline-block;
+		width: 20rpx;
+		height: 90rpx;
+		line-height: 90rpx;
+		text-align: right;
+		float: right;
+	}
+	.address-box-right image{
+		width: 14rpx;
+		height: 24%;
+		vertical-align: middle;
+	}
+	
+	.order-box-list{
+		width: 680rpx;
+		height: auto;
+		border-radius: 8rpx;
+		margin: 15rpx auto;
+		background-color: #FFFFFF;
+		padding: 20rpx;
+		overflow: hidden;
+	}
+	.order-box-header{
+		width: 680rpx;
+		height: 78rpx;
+		line-height: 78rpx;
+		border-bottom: 1rpx solid #F6F6F6;
+	}
+	.order-box-title{
+		display: inline-block;
+		width: 500rpx;
+		height: 100%;
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+	.order-box-desc{
+		display: inline-block;
+		width: 180rpx;
+		text-align: right;
+		height: 100%;
+		color: #949494;
+		font-size: 30rpx;
+	}
+	.order-box-body{
+		padding: 20rpx 0 30rpx 0;
+		overflow: hidden;
+	}
+	.order-box-body-left{
+		display: inline-block;
+		width: 88rpx;
+		height: 88rpx;
+		float: left;
+	}
+	.order-box-body-left image{
+		width: 100%;
+		height: 100%;
+		border-radius: 10rpx;
+	}
+	.order-box-body-middle{
+		display: inline-block;
+		width: 420rpx;
+		float: left;
+		padding-left: 20rpx;
+	}
+	.order-box-body-right{
+		display: inline-block;
+		width: 140rpx;
+		height: 88rpx;
+		line-height: 88rpx;
+		float: right;
+		text-align: right;
+	}
+	.order-box-body-desc{
+		display: inline-block;
+		width: 100%;
+		font-size: 30rpx;
+		font-weight: bold;
+		color: #333333;
+	}
+	.order-box-body-cate{
+		display: inline-block;
+		width: 100%;
+		font-size: 24rpx;
+		color: #949494;
+	}
+	.order-box-footer{
+		border-top: 1rpx solid #F6F6F6;
+		padding: 20rpx;
+		text-align: right;
+	}
+</style>

+ 112 - 0
pages/index/wechat.vue

@@ -0,0 +1,112 @@
+<template>
+	<view>
+		<view v-if="msg" class="error-box">
+			{{msg}}
+		</view>
+		<view v-if="msg" class="order-btn" @click="goBack">返回</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				msg: ''
+			}
+		},
+		onLoad() {
+			let code = this.getUrlCode('code')
+			if(code) {
+				this.getOpenidAndUserinfo(code)
+			}else{
+				this.getCode ();
+			}
+		
+		},
+		methods: {
+			getCode () {
+				if(this.isWechat()) {
+					// 截取地址中的code,如果没有code就去微信授权,如果已经获取到code了就直接把code传给后台获取openId
+					let code = this.getUrlCode('code');
+					let type = this.getUrlCode('type');
+					if (code === null || code === '') {
+						console.log('ssssssggg',code,type);
+						window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+app.globalData.appId+'&redirect_uri=' + encodeURIComponent(app.globalData.redirectUri) + '&response_type=code&scope=snsapi_userinfo&state='+type+'#wechat_redirect'
+						// redirect_uri是授权成功后,跳转的url地址,微信会帮我们跳转到该链接,并且通过?的形式拼接code,这里需要用encodeURIComponent对链接进行处理。
+						// 如果配置参数一一对应,那么此时已经通过回调地址刷新页面后,你就会再地址栏中看到code了。
+						// http://127.0.0.1/pages/views/profile/login/login?code=001BWV4J1lRzz00H4J1J1vRE4J1BWV4q&state=1
+					}
+				}
+			},
+			
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+			
+			isWechat() {
+				return String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger";
+			},
+			
+			getOpenidAndUserinfo(code) {
+				let that = this;
+			    uni.request({
+			        url: app.globalData.serverUrl + 'Oauth/checkCode',
+					data: {code: code},
+					method: 'GET',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+			        success: function (res) {
+			            console.log('通过code获取openid和accessToken', res)
+			            if(res.data.code == 0) {
+							var app = getApp();
+			                uni.setStorageSync(app.globalData.storagePre+'token', res.data.data.token);
+							uni.setStorageSync(app.globalData.storagePre+'userId', res.data.data.userId);
+							app.globalData.userinfo.token = res.data.data.token;
+							app.globalData.userinfo.userId = res.data.data.userId;
+							uni.reLaunch({ //关闭所有页面,跳转到闪屏页
+								url: '/pages/index/index'
+							})
+			            }else{
+							that.msg = res.data.message;
+						}
+			        },
+					fail: function (err) {
+						console.log(err);
+						that.msg = '登录失败';
+					}
+			    })
+			},
+			
+			goBack(){
+				uni.reLaunch({ //关闭所有页面,跳转到闪屏页
+					url: '/pages/index/wechat'
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.error-box{
+		font-size: 40rpx;
+		color: #333333;
+		text-align: center;
+		margin-top: 180rpx;
+		margin-bottom: 80rpx;
+	}
+	
+	.order-btn{
+		width: 673rpx;
+		height: 72rpx;
+		border-radius: 10rpx;
+		color: #FFFFFF;
+		background-color: $theme-color;
+		line-height: 72rpx;
+		font-size: 38rpx;
+		text-align: center;
+		margin: 0 auto;
+		margin-top: 40rpx;
+	}
+</style>

+ 278 - 0
pages/order/detail.vue

@@ -0,0 +1,278 @@
+<template>
+	<view>
+		<view class="main" v-if="info">
+			<view class="order-box-list">
+				<view class="order-box-header">
+					<text class="order-box-title">{{info.orgName}}</text>
+					<text class="order-box-desc" v-if="info.status == 1">已预约</text>
+					<text class="order-box-desc" v-if="info.status == 2">已取消</text>
+				</view>
+				<view v-for="(item,index) in info.goods" :key="index" class="order-box-body">
+					<view class="order-box-body-left">
+						<image :src="item.goodsImg"></image>
+					</view>
+					<view class="order-box-body-middle">
+						<text class="order-box-body-desc">{{item.goodsName}}</text>
+						<text class="order-box-body-cate">x{{item.nums}}</text>
+					</view>
+					<view class="order-box-body-right">
+						¥{{(item.nums*item.price).toFixed(2)}}
+					</view>
+				</view>
+				<view class="order-box-footer">
+					合计 ¥{{info.amount}}
+				</view>
+			</view>
+		
+			<view class="box">
+				<view class="box-title">配送信息</view>
+				<view class="box-body">
+					<view class="box-list">
+						<text class="box-list-label">姓名</text>
+						<text class="box-list-body">{{info.name}}</text>
+					</view>
+					<view class="box-list">
+						<text class="box-list-label">电话</text>
+						<text class="box-list-body">{{info.phone}}</text>
+					</view>
+					<view class="box-list">
+						<text class="box-list-label">配送时间</text>
+						<text class="box-list-body">{{info.deliveryTime}}</text>
+					</view>
+					<view class="box-list">
+						<text class="box-list-label">配送地址</text>
+						<text class="box-list-body">{{info.address}}</text>
+					</view>
+				</view>
+			</view>
+			<view class="box">
+				<view class="box-title">订单信息</view>
+				<view class="box-body">
+					<view class="box-list">
+						<text class="box-list-label">订单编号</text>
+						<text class="box-list-body">{{info.orderSn}}</text>
+					</view>
+					<view class="box-list">
+						<text class="box-list-label">下单日期</text>
+						<text class="box-list-body">{{info.createTime}}</text>
+					</view>
+				</view>
+			</view>
+			
+			
+			<view class="uni-list">
+				<radio-group @change="radioChange">
+					<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items" :key="item.value">
+						<view>
+							<radio :value="item.value" :checked="index === current" />
+						</view>
+						<view>{{item.name}}</view>
+					</label>
+				</radio-group>
+			</view>
+			
+			<view v-if="info.cancel == 1" class="cancel-btn" @click="cancelOrder">
+				取消订单
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				id: 0,
+				info: null,
+			}
+		},
+		onLoad(option) {
+			this.id = option.id?option.id:0;
+			this.getDetail();
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'order'){
+					this.info = res.data.data;
+					
+				} else if (apiname == 'cancel'){
+					that.getDetail();
+				}
+			}
+		},
+		methods: {
+			getDetail(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'shopOrder/orderDetails',
+					type: 'POST',
+					apiname: 'order',
+					data: {
+						id: this.id
+					}
+				});
+			},
+			cancelOrder(){
+				var that = this;
+				uni.showModal({
+				    title: '提示',
+				    content: '确定要取消此订单吗?',
+				    success: function (res) {
+				        if (res.confirm) {
+				            app.ajax({
+				            	url: app.globalData.serverUrl + 'shopOrder/cancel',
+				            	type: 'POST',
+				            	apiname: 'cancel',
+				            	data: {
+				            		id: that.id
+				            	}
+				            });
+				        } else if (res.cancel) {
+				            console.log('用户点击取消');
+				        }
+				    }
+				});
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	
+	.box{
+		width: 680rpx;
+		height: auto;
+		border-radius: 8rpx;
+		margin: 15rpx auto;
+		background-color: #FFFFFF;
+		padding: 10rpx 20rpx;
+		overflow: hidden;
+	}
+	.box-title{
+		width: 680rpx;
+		height: 78rpx;
+		line-height: 78rpx;
+		border-bottom: 1rpx solid #F6F6F6;
+		color: #333333;
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+	.box-body{
+		overflow: hidden;
+	}
+	.box-list{
+		overflow: hidden;
+		padding: 20rpx 0;
+	}
+	.box-list-label{
+		display: inline-block;
+		width: 130rpx;
+		height: auto;
+		float: left;
+		color: #949494;
+		font-size: 30rpx;
+	}
+	.box-list-body{
+		display: inline-block;
+		width: 500rpx;
+		height: auto;
+		float: right;
+		color: #333333;
+		font-size: 30rpx;
+		text-align: right;
+	}
+	
+	
+	
+	.order-box-list{
+		width: 680rpx;
+		height: auto;
+		border-radius: 8rpx;
+		margin: 15rpx auto;
+		background-color: #FFFFFF;
+		padding: 10rpx 20rpx;
+		overflow: hidden;
+	}
+	.order-box-header{
+		width: 680rpx;
+		height: 78rpx;
+		line-height: 78rpx;
+		border-bottom: 1rpx solid #F6F6F6;
+	}
+	.order-box-title{
+		display: inline-block;
+		width: 500rpx;
+		height: 100%;
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+	.order-box-desc{
+		display: inline-block;
+		width: 180rpx;
+		text-align: right;
+		height: 100%;
+		color: #949494;
+		font-size: 30rpx;
+	}
+	.order-box-body{
+		padding: 20rpx 0 30rpx 0;
+		overflow: hidden;
+	}
+	.order-box-body-left{
+		display: inline-block;
+		width: 88rpx;
+		height: 88rpx;
+		float: left;
+	}
+	.order-box-body-left image{
+		width: 100%;
+		height: 100%;
+		border-radius: 10rpx;
+	}
+	.order-box-body-middle{
+		display: inline-block;
+		width: 380rpx;
+		float: left;
+		padding-left: 20rpx;
+	}
+	.order-box-body-right{
+		display: inline-block;
+		width: 180rpx;
+		height: 88rpx;
+		line-height: 88rpx;
+		text-align: right;
+		float: right;
+	}
+	.order-box-body-desc{
+		display: inline-block;
+		width: 100%;
+		font-size: 30rpx;
+		font-weight: bold;
+		color: #333333;
+	}
+	.order-box-body-cate{
+		display: inline-block;
+		width: 100%;
+		font-size: 24rpx;
+		color: #949494;
+	}
+	.order-box-footer{
+		border-top: 1rpx solid #F6F6F6;
+		padding: 20rpx;
+		text-align: right;
+	}
+	
+	.cancel-btn{
+		width: 700rpx;
+		height: 70rpx;
+		line-height: 70rpx;
+		color: #FFFFFF;
+		background-color: #d9534f;
+		border-radius: 10rpx;
+		margin: 50rpx auto 20rpx auto;
+		text-align: center;
+	}
+</style>

+ 173 - 0
pages/order/index.vue

@@ -0,0 +1,173 @@
+<template>
+	<view>
+		<view class="order-box">
+			<view v-for="(item,index) in list" :key="index" class="order-box-list" @click="goDetail(item.id)">
+				<view class="order-box-header">
+					<text class="order-box-title">{{item.name}}</text>
+					<text class="order-box-desc" v-if="item.status == 1">已预约</text>
+					<text class="order-box-desc" v-if="item.status == 2">已取消</text>
+				</view>
+				<view class="order-box-body">
+					<view class="order-box-body-left">
+						<image :src="item.goodsImg"></image>
+					</view>
+					<view class="order-box-body-right">
+						<text class="order-box-body-desc">下单时间:{{item.createTime}}</text>
+						<text class="order-box-body-cate" v-if="item.cate == 1">早餐</text>
+						<text class="order-box-body-cate" v-if="item.cate == 2">午餐</text>
+						<text class="order-box-body-cate" v-if="item.cate == 3">晚餐</text>
+						<text class="order-box-body-cate" v-if="item.cate == 4">当日餐</text>
+					</view>
+				</view>
+			</view>
+			
+			<view v-if="list.length == 0" class="no-data">
+				<image src="../../images/no_data.png" mode=""></image>
+				<view class="no-data-text">
+					空空如也~
+				</view>
+			</view>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				list: [],
+				page: 1,
+				size: 10,
+				flag: 0
+			}
+		},
+		onLoad() {
+
+		},
+		onShow(){
+			var that = this;
+		
+			this.flag = 0;
+			this.page = 1;
+			this.getOrder();
+			
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'order'){
+					that.list = res.data.data;
+					if (that.list.length < that.size) {
+						that.flag = 1;
+					} else {
+						that.page++;
+					}
+				}
+			}
+		},
+		onPullDownRefresh() {
+			this.flag = 0;
+			this.page = 1;
+			this.getOrder();
+		},
+		onReachBottom() { //上拉加载
+		    this.getOrder();
+		},
+		methods: {
+			goDetail(id){
+				uni.navigateTo({
+				    url: "/pages/order/detail?id=" + id
+				});
+			},
+			getOrder(){
+				if(this.flag == 1){
+					return;
+				}
+				app.ajax({
+					url: app.globalData.serverUrl + 'shopOrder/orderList',
+					type: 'POST',
+					apiname: 'order',
+					data: {
+						page: this.page,
+						size: this.size
+					}
+				});
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.order-box{
+		padding-bottom: 30rpx;
+	}
+	.order-nodata{
+		margin-top: 150rpx;
+		text-align: center;
+		font-size: 32rpx;
+		color: #666666;
+	}
+	
+	.order-box-list{
+		width: 680rpx;
+		height: auto;
+		border-radius: 8rpx;
+		margin: 15rpx auto;
+		background-color: #FFFFFF;
+		padding: 20rpx;
+		overflow: hidden;
+	}
+	.order-box-header{
+		width: 680rpx;
+		height: 78rpx;
+		line-height: 78rpx;
+		border-bottom: 1rpx solid #F6F6F6;
+	}
+	.order-box-title{
+		display: inline-block;
+		width: 500rpx;
+		height: 100%;
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+	.order-box-desc{
+		display: inline-block;
+		width: 180rpx;
+		text-align: right;
+		height: 100%;
+		color: #949494;
+		font-size: 30rpx;
+	}
+	.order-box-body{
+		padding: 20rpx 0 30rpx 0;
+	}
+	.order-box-body-left{
+		display: inline-block;
+		width: 88rpx;
+		height: 88rpx;
+		float: left;
+	}
+	.order-box-body-left image{
+		width: 100%;
+		height: 100%;
+		border-radius: 10rpx;
+	}
+	.order-box-body-right{
+		display: inline-block;
+		width: 580rpx;
+		float: right;
+	}
+	.order-box-body-desc{
+		display: inline-block;
+		width: 100%;
+		font-size: 28rpx;
+		color: #949494;
+	}
+	.order-box-body-cate{
+		display: inline-block;
+		width: 100%;
+		font-size: 24rpx;
+		color: $theme-color;
+	}
+</style>

+ 154 - 0
pages/user/index.vue

@@ -0,0 +1,154 @@
+<template>
+	<view>
+		<view class="user-bg"> 
+			<image src="../../images/userbg.png"></image>
+		</view>
+		
+		<view class="user-top">
+			<view class="user-info">
+				<view class="user-info-avatar">
+					<image v-if="imgLoad" :src="img" @error="onErrorImg" @load="onSuccessImg"></image>
+					<image v-if="!imgLoad" src="../../images/avatar.png"></image>
+				</view>
+				<view class="user-info-nick">{{nickName}}</view>
+			</view>
+			
+			<view class="menu-box">
+				<view class="menu-box-list" @click="goAddress">
+					<text class="menu-box-list-text">收货地址</text>
+					<image class="menu-box-list-right" src="../../images/jiantouyou.png"></image>
+				</view>
+				<view class="menu-box-list" @click="goOrder">
+					<text class="menu-box-list-text">我的订单</text>
+					<image class="menu-box-list-right" src="../../images/jiantouyou.png"></image>
+				</view>
+				<view class="menu-box-list" @click="goIndex">
+					<text class="menu-box-list-text">去订餐</text>
+					<image class="menu-box-list-right" src="../../images/jiantouyou.png"></image>
+				</view>
+			</view>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				nickName: '',
+				img: '',
+				imgLoad: true
+			}
+		},
+		onLoad() {
+			this.getUserInfo();
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				this.nickName = res.data.data.nickname;
+				this.img = res.data.data.img;
+			}
+		},
+		methods: {
+			goAddress(){
+				uni.navigateTo({
+				    url: '/pages/address/index'
+				});
+			},
+			goOrder(){
+				uni.navigateTo({
+				    url: '/pages/order/index'
+				});
+			},
+			goIndex(){
+				uni.navigateTo({
+				    url: '/pages/index/index'
+				});
+			},
+			getUserInfo(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'shopUser/userInfo',
+					type: 'POST',
+					apiname: 'user'
+				});
+			},
+			onErrorImg(item){
+				this.imgLoad = false;
+				this.$forceUpdate();
+			},
+			onSuccessImg(item){
+				this.imgLoad = true;
+				this.$forceUpdate();
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.user-bg{
+		position: absolute;
+		width: 750rpx;
+		height: 475rpx;
+		top: 0;
+		left: 0;
+		z-index: 1;
+	}
+	.user-bg image{
+		width: 100%;
+		height: 100%;
+	}
+	.user-top{
+		position: absolute;
+		width: 100%;
+		height: 100%;
+		top: 0;
+		left: 0;
+		z-index: 2;
+	}
+	.user-info{
+		overflow: hidden;
+		padding-top: 80rpx;
+		padding-bottom: 40rpx;
+		text-align: center;
+		color: #FFFFFF;
+	}
+	.user-info-avatar{
+		overflow: hidden;
+	}
+	.user-info-avatar image{
+		width: 128rpx;
+		height: 128rpx;
+		// border: 4rpx solid #FFFFFF;
+		border-radius: 66rpx;
+	}
+	.menu-box{
+		width: 687rpx;
+		height: auto;
+		border-radius: 10rpx;
+		background-color: #FFFFFF;
+		margin: 0 auto;
+		padding: 0 15rpx;
+	}
+	.menu-box .menu-box-list{
+		height: 108rpx;
+		line-height: 108rpx;
+		border-bottom: 1px solid #CCCCCC;
+	}
+	.menu-box .menu-box-list .menu-box-list-text{
+		display: inline-block;
+		width: 660rpx;
+		vertical-align: middle;
+	}
+	.menu-box .menu-box-list .menu-box-list-right{
+		width: 12rpx;
+		height: 22rpx;
+		vertical-align: middle;
+	}
+	.menu-box .menu-box-list:last-child{
+		border: 0;
+	}
+	
+</style>

二进制
static/home2.png


二进制
static/logo.png


二进制
static/user2.png


+ 78 - 0
uni.scss

@@ -0,0 +1,78 @@
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+
+/* 颜色变量 */
+
+/* 行为相关颜色 */
+$uni-color-primary: #007aff;
+$uni-color-success: #4cd964;
+$uni-color-warning: #f0ad4e;
+$uni-color-error: #dd524d;
+
+/* 文字基本颜色 */
+$uni-text-color:#333;//基本色
+$uni-text-color-inverse:#fff;//反色
+$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
+$uni-text-color-placeholder: #808080;
+$uni-text-color-disable:#c0c0c0;
+
+/* 背景颜色 */
+$uni-bg-color:#ffffff;
+$uni-bg-color-grey:#f8f8f8;
+$uni-bg-color-hover:#f1f1f1;//点击状态颜色
+$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
+
+/* 边框颜色 */
+$uni-border-color:#c8c7cc;
+
+/* 尺寸变量 */
+
+/* 文字尺寸 */
+$uni-font-size-sm:24rpx;
+$uni-font-size-base:28rpx;
+$uni-font-size-lg:32rpx;
+
+/* 图片尺寸 */
+$uni-img-size-sm:40rpx;
+$uni-img-size-base:52rpx;
+$uni-img-size-lg:80rpx;
+
+/* Border Radius */
+$uni-border-radius-sm: 4rpx;
+$uni-border-radius-base: 6rpx;
+$uni-border-radius-lg: 12rpx;
+$uni-border-radius-circle: 50%;
+
+/* 水平间距 */
+$uni-spacing-row-sm: 10px;
+$uni-spacing-row-base: 20rpx;
+$uni-spacing-row-lg: 30rpx;
+
+/* 垂直间距 */
+$uni-spacing-col-sm: 8rpx;
+$uni-spacing-col-base: 16rpx;
+$uni-spacing-col-lg: 24rpx;
+
+/* 透明度 */
+$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
+
+/* 文章场景相关 */
+$uni-color-title: #2C405A; // 文章标题颜色
+$uni-font-size-title:40rpx;
+$uni-color-subtitle: #555555; // 二级标题颜色
+$uni-font-size-subtitle:36rpx;
+$uni-color-paragraph: #3F536E; // 文章段落颜色
+$uni-font-size-paragraph:30rpx;
+
+$theme-color: #50ACF9; // 主题色