lyy@qq.com 1 年間 前
コミット
5e04ff7001

+ 459 - 0
css/style.css

@@ -0,0 +1,459 @@
+.background-gradient {
+  background-image: linear-gradient(to right, #F54319, #FF6D20);
+}
+* {
+  margin: 0;
+  padding: 0;
+}
+
+.pageBg {
+  background-color: rgb(244, 245, 249);
+  padding-bottom: 30rpx;
+  position: relative;
+  min-height: calc(100vh);
+}
+
+.margin0px {
+  margin: 0 !important;
+}
+
+.padding0px {
+  padding: 0 !important;
+}
+
+
+
+.text-left {
+  text-align: left !important;
+}
+
+.text-right {
+  text-align: right !important;
+}
+
+.text-center {
+  text-align: center !important;
+}
+
+.fl {
+  float: left;
+}
+
+.fr {
+  float: right;
+}
+
+/* 清除浮动 */
+.clearfix:after {
+  content: "";
+  display: block;
+  visibility: hidden;
+  clear: both;
+  height: 0;
+}
+
+.clearfix {
+  /* 为了照顾ie6浏览器*/
+  zoom: 1;
+}
+
+.ml5px {
+  margin-left: 10rpx !important;
+}
+
+.ml10px {
+  margin-left: 20rpx !important;
+}
+
+.ml15px {
+  margin-left: 30rpx !important;
+}
+
+.ml20px {
+  margin-left: 40rpx !important;
+}
+
+.ml40px {
+  margin-left: 80rpx !important;
+}
+
+.mr5px {
+  margin-right: 10rpx !important;
+}
+
+.mr10px {
+  margin-right: 20rpx !important;
+}
+
+.mr15px {
+  margin-right: 30rpx !important;
+}
+
+.mr20px {
+  margin-right: 40rpx !important;
+}
+
+.mt5px {
+  margin-top: 10rpx !important;
+}
+
+.mt10px {
+  margin-top: 20rpx !important;
+}
+
+.mt15px {
+  margin-top: 30rpx !important;
+}
+
+.mt20px {
+  margin-top: 40rpx !important;
+}
+
+.mt40px {
+  margin-top: 80rpx !important;
+}
+
+.mt50px {
+  margin-top: 100rpx !important;
+}
+
+.mt140px {
+  margin-top: 280rpx !important;
+}
+
+.mt28px {
+  margin-top: 56rpx !important;
+}
+
+.mb5px {
+  margin-bottom: 10rpx !important;
+}
+
+.mb10px {
+  margin-bottom: 20rpx !important;
+}
+
+.mb15px {
+  margin-bottom: 40rpx !important;
+}
+
+.mb20px {
+  margin-bottom: 40rpx !important;
+}
+
+.mb60px {
+  margin-bottom: 120rpx !important;
+}
+
+.pb20px {
+  padding-bottom: !40rpx;
+}
+
+.fz12px {
+  font-size: 24rpx !important;
+}
+
+.fz14px {
+  font-size: 28rpx !important;
+}
+
+.fz16px {
+  font-size: 32rpx !important;
+}
+
+.fz18px {
+  font-size: 36rpx !important;
+}
+
+.fz20px {
+  font-size: 40rpx !important;
+}
+
+.fz22px {
+  font-size: 44rpx !important;
+}
+
+.fz24px {
+  font-size: 48rpx !important;
+}
+
+.fz26px {
+  font-size: 52rpx !important;
+}
+
+.fz30px {
+  font-size: 60rpx !important;
+}
+
+.fz32px {
+  font-size: 64rpx !important;
+}
+
+.fz34px {
+  font-size: 68rpx !important;
+}
+
+.fz36px {
+  font-size: 72rpx !important;
+}
+
+.fz38px {
+  font-size: 76rpx !important;
+}
+
+.fz40px {
+  font-size: 80rpx !important;
+}
+
+.w5 {
+  width: 5% !important;
+}
+
+.w10 {
+  width: 10% !important;
+}
+
+.w15 {
+  width: 15% !important;
+}
+
+.w20 {
+  width: 20% !important;
+}
+
+.w25 {
+  width: 25% !important;
+}
+
+.w30 {
+  width: 30% !important;
+}
+
+.w35 {
+  width: 35% !important;
+}
+
+.w40 {
+  width: 40% !important;
+}
+
+.w45 {
+  width: 45% !important;
+}
+
+.w50 {
+  width: 50% !important;
+}
+
+.w55 {
+  width: 55% !important;
+}
+
+.w60 {
+  width: 60% !important;
+}
+
+.w65 {
+  width: 65% !important;
+}
+
+.w70 {
+  width: 70% !important;
+}
+
+.w75 {
+  width: 75% !important;
+}
+
+.w80 {
+  width: 80% !important;
+}
+
+.w85 {
+  width: 85% !important;
+}
+
+.w90 {
+  width: 90% !important;
+}
+
+.w95 {
+  width: 95% !important;
+}
+
+.w100 {
+  width: 100% !important;
+}
+
+.lineHeight28px {
+  line-height: 56rpx !important;
+}
+
+.lineHeight32px {
+  line-height: 64rpx !important;
+}
+
+.lineHeight40px {
+  line-height: 80rpx !important;
+}
+
+/* 更改 elemtui table 的默认样式 */
+.el-table td,
+.el-table th {
+  padding: 20rpx 0 !important;
+}
+
+.has-gutter th,
+.el-table__fixed-header-wrapper tr th {
+  background: rgba(68, 81, 176, 0.08) !important;
+  /* color: #47a1fc; */
+}
+
+.content {
+  padding: 40rpx 5%;
+}
+
+.v-step {
+  z-index: 9999;
+}
+
+.contentHeader {
+  line-height: 80rpx;
+  border-bottom: 2rpx solid #aaa;
+  padding-bottom: 20rpx;
+}
+
+.invalidColor {
+  color: #ccc;
+}
+
+.invalidColor100 {
+  color: #979797;
+}
+
+.warnColor {
+  color: #E6A23C;
+}
+
+.successColor {
+  color: #67C23A;
+}
+
+.failColor {
+  color: #F56C6C;
+}
+
+.rose0 {
+  color: red;
+}
+
+.sky0 {
+  color: #f0f9ff;
+}
+
+.sky5 {
+  color: #0ea5e9;
+}
+
+.pageWrap {
+  position: relative;
+  min-height: 500px;
+  background: #fff;
+  padding: 40rpx 100rpx;
+}
+
+.positionClass {
+  position: absolute;
+  bottom: 50rpx;
+  right: 10%
+}
+
+/* 修改 elementUI 弹框的头部样式 */
+.el-dialog__header .el-dialog__title {
+  display: block;
+  font-size: 40rpx;
+  border-bottom: 2rpx solid #bbbbbb;
+  padding-bottom: 20rpx;
+  font-weight: bold;
+}
+
+.el-dialog__body {
+  padding: 20px 40rpx 40rpx;
+}
+
+/* 文字超出部分显示省略号 */
+.overHide {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.fontcolor {
+  /*提示语:字的颜色*/
+  color: #ff9800;
+}
+
+.contain {
+  display: inline-block;
+  width: 100%;
+  padding: 0 30rpx;
+  box-sizing: border-box;
+  margin: auto;
+  position: relative;
+}
+
+.contain1 {
+  width: 100%;
+  box-sizing: border-box;
+  display: inline-block;
+  padding: 0 10%;
+}
+
+.subpageContain {
+  padding: 80rpx 10%;
+}
+
+/*超出一行显示省略号*/
+.ellipsis1 {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  line-clamp: 1;
+  -webkit-box-orient: vertical;
+  word-break: break-all;
+}
+
+/*超出两行显示省略号*/
+.ellipsis2 {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  line-clamp: 2;
+  -webkit-box-orient: vertical;
+  word-break: break-all;
+}
+
+.isIphoneX {
+  padding-bottom: 60rpx;
+}
+
+.ellipsis {
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+}
+
+.ellipsis-2 {
+  word-break: break-all;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+  overflow: hidden;
+}
+
+.inlineBlock {
+  display: inline-block;
+}

+ 6 - 0
package.json

@@ -0,0 +1,6 @@
+{
+  "dependencies": {
+    "uview-ui": "^2.0.36",
+    "vuex": "^4.0.2"
+  }
+}

+ 95 - 0
pages/bindPhone/bindPhone.vue

@@ -0,0 +1,95 @@
+<template>
+  <view>
+    <u-notify ref="uNotify"></u-notify>
+    <view class="logoBox text-center">
+      <view class="logo">
+        <!-- <u--image :showLoading="true" shape="circle" :src="getFilePath(logo)" width="100px" height="100px"></u--image> -->
+      </view>
+      <view class="">欢迎加入{{appName}}</view>
+    </view>
+    <view class="invalidColor fz14px text-center mb20px">申请获取您的微信绑定手机号</view>
+    <view class="contain">
+      <u-button text="一键注册" type="success" openType="getPhoneNumber" @getphonenumber="decryptPhoneNumber"></u-button>
+    </view>
+  </view>
+</template>
+
+<script>
+  // import {
+  //   logo
+  // } from '../../env/dev';
+  export default {
+    data() {
+      return {
+        // logo: this.logo,
+        // appName: this.appName
+		appName: '餐车活动'
+      };
+    },
+    onLoad(options) { // 监听页面加载
+    },
+    onUnload() { // 监听页面卸载
+
+    },
+    onShow() { // 监听页面显示
+
+    },
+    onHide() { // 监听页面隐藏
+
+    },
+    onReachBottom() { // 上拉触底
+
+    },
+    methods: {
+      async decryptPhoneNumber(e) {
+        // 获取手机号
+        let result = await this.$request('post', '/userinfo/auth/getWxPhone', {
+          code: e.detail.code,
+          appid: this.appId
+        })
+        if (!result) {
+          uni.showToast({
+            title: '授权失败',
+            icon: 'success'
+          })
+          return
+        }
+        const code = await new Promise((resolve) => {
+          uni.login({
+            success: (res) => {
+              resolve(res.code)
+            },
+            fail: () => {
+              resolve(false)
+            }
+          })
+        })
+        // 注册
+        const res = await this.$request('post', '/userinfo/auth/bindPhone', {
+          code,
+          appid: this.appId,
+          phone: result.msg
+        })
+        if (res) {
+          uni.showToast({
+            title: '注册成功',
+            icon: 'success'
+          })
+          uni.setStorageSync("token", res.data.token);
+          await this.getUser()
+          uni.navigateBack(-1)
+        }
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .logoBox {
+    margin: 200rpx 0 300rpx;
+
+    .logo {
+      display: inline-block;
+    }
+  }
+</style>

+ 174 - 0
pages/diningCar/diningCar.vue

@@ -0,0 +1,174 @@
+<template>
+	<view>
+		<view class="boxWarp mb20px">
+			<view class="box linear2" style="height:100vh;">
+				<view class="boxContent2" style="margin-top:50%;">
+					<view class="clearfix" style="margin-bottom: 10px;">
+						<text class="fz26px" style="font-weight: bold;">当前餐车名</text>
+						<u-line dashed></u-line>
+					</view>
+					<view class="flex-container">
+						<text class="flex-item">营业状态</text>
+						<u-tag class="flex-item tag-item" plain text="营业中" size="mini"></u-tag>
+					</view>
+					<text>客服电话:18011111111</text>
+				</view>
+				<view class="footer">
+					<u-button type="primary" shape="circle" text="拨打客服电话"
+						color="linear-gradient(to right, #F54319, #FF6D20)" @click="call()"></u-button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import request from '@/utils/request.js'
+	export default {
+		data() {
+			return {
+				img: 'https://cdn.uviewui.com/uview/album/1.jpg',
+				orderinfo: {},
+				dinList: {}
+			}
+		},
+		created() {
+			this.fatchDing()
+		},
+		methods: {
+			call() {
+				if (this.orderinfo.shopCall) {
+					uni.makePhoneCall({
+						phoneNumber: this.orderinfo.shopCall
+					});
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '暂无商家电话'
+					})
+				}
+			},
+			fatchDing() {
+				//const result = await this.$request('get', '/diningCar/{id}')
+				const result = this.$request('get', '/diningCar')
+				if (result) {
+					this.dinList = result.data
+				}
+			}
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.font {
+		font-family: "CustomFont";
+		color: #fff;
+	}
+
+	.flex-container {
+		display: flex;
+		align-items: center;
+		/* 垂直居中 */
+		justify-content: flex-start;
+		/* 水平左对齐 */
+	}
+
+	.flex-item {
+		/* 根据需要设置text的宽度 */
+		width: 100%;
+		/* 或者其他适当的宽度 */
+	}
+
+	.tag-item {
+		margin-left: auto;
+		/* 将标签推到右边 */
+	}
+
+	.box {
+		padding: 20rpx 0;
+		// background-image: linear-gradient(#00a551 10%, #fff 30%);
+		border-bottom-left-radius: 30rpx;
+		border-bottom-right-radius: 30rpx;
+		background-position: top;
+		box-shadow: 0 0 5px 2px #ebebeb;
+		background-repeat: no-repeat;
+	}
+
+	.linear2 {
+		// background-image: linear-gradient(#00a551 20%, #fff 50%);
+		background-image: url('https://cdn.uviewui.com/uview/album/1.jpg');
+	}
+
+	.boxText {
+		font-size: 28rpx;
+		line-height: 40rpx;
+		color: #c8c9cc;
+	}
+
+	.tabFlexBox {
+		display: flex;
+		text-align: center;
+		// background-color: #fff;
+		padding-bottom: 10rpx;
+	}
+
+	.tabFlexBox .tabFlexBoxItem {
+		flex: 1;
+		position: relative;
+	}
+
+	.tabFlexBox .tabFlexBoxItem .tabFlexBoxItemTitle {
+		font-size: 36rpx;
+		font-weight: bold;
+		line-height: 80rpx;
+	}
+
+	.tabFlexBox .tabFlexBoxItem .tabFlexBoxItemDes {
+		color: #c8c9cc;
+		font-size: 28rpx;
+		line-height: 40rpx;
+		display: inline-block;
+		padding: 0 20rpx;
+	}
+
+	.tabFlexBox .tabFlexBoxItem .tabFlexBoxItemLine {
+		width: 1px;
+		height: 50rpx;
+		background-color: #c8c9cc;
+		position: absolute;
+		top: 50%;
+		transform: translateY(-50%);
+		right: 0;
+	}
+
+	.tabFlexBox .tabFlexBoxItem.active .tabFlexBoxItemTitle {
+		color: #00a551;
+		font-size: 40rpx;
+	}
+
+	.tabFlexBox .tabFlexBoxItem.active .tabFlexBoxItemDes {
+		background-color: #00a551;
+		border-radius: 20rpx;
+		color: #fff;
+	}
+
+	.boxContent2 {
+		border-radius: 60rpx;
+		background-color: #fff;
+		padding: 40rpx;
+	}
+
+	.carList {
+		display: flex;
+		// flex-wrap: wrap;
+	}
+
+	.footer {
+		flex-direction: column;
+		position: fixed;
+		left: 5px;
+		right: 5px;
+		bottom: 10px;
+	}
+</style>

+ 86 - 0
pages/diningList/diningList.vue

@@ -0,0 +1,86 @@
+<template>
+	<view class="mt20px">
+		<view class="contain">
+			<view class="box" style="height: 80px;">
+				<view class="container">
+					<view class="text-container">
+						<view>当前餐车名称</view>
+					</view>
+					<view class="icon-container">
+						<u-icon name="plus-circle" size="24"></u-icon>
+						<u-icon name="info-circle" size="24" @click="btnIC"></u-icon>
+					</view>
+				</view>
+				<view style="width: 50px;">
+					<u-tag plain text="营业中" type="success" size="mini"></u-tag>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		methods: {
+			btnIC() {
+				uni.navigateTo({
+					url: `/pages/diningCar/diningCar`
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.box {
+		padding: 20rpx 20rpx 0;
+		// background-image: linear-gradient(#00a551 10%, #fff 30%);
+		border-bottom-left-radius: 30rpx;
+		border-bottom-right-radius: 30rpx;
+		background-position: top;
+		box-shadow: 0 0 5px 2px #ebebeb;
+		background-repeat: no-repeat;
+		border-radius: 20rpx;
+		background-color: #fff;
+	}
+
+	.box:hover {
+	  border: 1px solid #2979ff; /* 鼠标悬停时显示边框 */
+	}
+	
+	.box:active {
+	  border: 1px solid #0056b3; /* 鼠标按下时显示另一种边框颜色 */
+	}
+
+	.container {
+		display: flex;
+		/* 使用 Flexbox 布局 */
+		justify-content: space-between;
+		/* 子元素之间留有空白 */
+	}
+
+	.text-container {
+		flex: 1;
+		/* 文本占满剩余空间 */
+	}
+
+	.icon-container {
+		display: flex;
+		/* 使用 Flexbox 布局 */
+		flex-direction: row;
+		/* 水平排列子元素 */
+		justify-content: flex-end;
+		/* 子元素右对齐 */
+
+	}
+
+	.icon-container u-icon {
+		margin-right: 15px;
+		/* 设置图标之间的间距 */
+	}
+</style>

+ 22 - 0
pages/index/home.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style lang="less">
+
+</style>

+ 51 - 0
pages/login/login.vue

@@ -0,0 +1,51 @@
+<template>
+	<view>
+		<u-button @click="loginUse">点击登录</u-button>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				infoData: {}
+			}
+		},
+		methods: {
+			loginUse() {
+				let that = this;
+				wx.login({
+					success: function(e) {
+						console.log('数据:', e)
+
+						uni.request({
+							url: 'http://36.137.224.81:8030/auth/miniLogin?tenantId=000000&code=' + e
+								.code,
+							header: {
+								"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", //
+								// "Content-Type": "application/json;charset=UTF-8", //
+							},
+							method: 'post',
+							success: res => {
+								console.log('登录成功:', res)
+								uni.hideLoading()
+								if (res.data.code == 200) {
+									that.infoData = res.data.data
+								}
+
+							},
+							fail: err => {
+								uni.hideLoading()
+							}
+						})
+					}
+				})
+			}
+
+		}
+	}
+</script>
+
+<style>
+
+</style>