Browse Source

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
提交 注意事项

1004749546@qq.com 4 years ago
parent
commit
c4d8dd3901
3 changed files with 103 additions and 8 deletions
  1. 10 6
      pages.json
  2. 74 0
      pages/agreement/agreement.vue
  3. 19 2
      pages/getOrder/getOrder.vue

+ 10 - 6
pages.json

@@ -51,14 +51,18 @@
 			"style": {
 				"navigationBarTitleText": "准备洗车"
 			}
-		}
-	    ,{
-            "path" : "pages/work/success/success",
-            "style" : {
+		}, {
+			"path": "pages/work/success/success",
+			"style": {
 				"navigationBarTitleText": "归位成功"
 			}
-        }
-    ],
+		}, {
+			"path": "pages/agreement/agreement",
+			"style": {
+				"navigationBarTitleText": "注意事项及服务协议"
+			}
+		}
+	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "uni-app",

+ 74 - 0
pages/agreement/agreement.vue

@@ -0,0 +1,74 @@
+<template>
+	<view class="content">
+		<view class="page-content">
+			<view class="page-care">
+				<text class="title">-注意事项-</text>
+				<u-image width="100%" height="1200rpx" mode="aspectFit" src="/static/img/zysx.png"></u-image>
+			</view>
+			<view class="page-care agreement">
+				<text class="title">-服务协议-</text>
+			</view>
+		</view>
+		<view class="footer" @click="goBack">
+			我以阅读并同意无人洗车《注意事项及服务协议》
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		components: {
+		},
+		data() {
+			return {
+				
+			}
+		},
+		onLoad(option) {
+			
+		},
+		methods: {
+			// 点击已阅读返回上一页
+			goBack () {
+				// 出发已阅读事件
+				uni.$emit('read',{msg:'read'})
+				uni.navigateBack()
+			}
+			
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	page{
+		height: 100%;
+	}
+	.content{
+		padding: 0;
+		width: 100%;
+		height: 100%;
+		display: flex;
+		flex-direction: column;
+		.page-content{
+			flex: 1;
+			overflow-y: scroll;
+		}
+		.title{
+			font-size: 30rpx;
+			font-weight: 600;
+		}
+		.page-care{
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+		}
+		.footer{
+			width: 100%;
+			text-align: center;
+			line-height: 100rpx;
+			background-color: rgb(255,0,0);
+			color: #fff;
+		}
+	}
+</style>

+ 19 - 2
pages/getOrder/getOrder.vue

@@ -58,7 +58,7 @@
 							<u-radio shape="square" :disabled="isRead!='read'" name="read" active-color="red" icon-size="28" label-size="28">
 								点击阅读并同意
 								<text>无人洗车</text>
-								<text>《注意事项及服务协议》</text>
+								<text @click="intoAgreement">《注意事项及服务协议》</text>
 							</u-radio>
 						</u-radio-group>
 					</view>
@@ -110,7 +110,15 @@
 			}
 		},
 		onLoad(option) {
-			
+			// 注册全局监听事件
+			uni.$once('read', this.read)
+		},
+		onUnload() {
+			uni.removeStorageSync('stepIndex')
+		},
+		onShow() {
+			const index = uni.getStorageSync('stepIndex')
+			this.stepIndex = index ? index : 0
 		},
 		methods: {
 			// 选择服务项目
@@ -120,6 +128,15 @@
 			// 下一步
 			nextStep() {
 				this.stepIndex = this.stepIndex===0 ? 1 : 2
+				uni.setStorageSync('stepIndex', this.stepIndex)
+			},
+			read (e) {
+				this.isRead = e.msg
+			},
+			intoAgreement () {
+				uni.navigateTo({
+					url: '/pages/agreement/agreement'
+				})
 			}
 			
 		}