瀏覽代碼

用户登录查看用户协议和隐私协议

zs 1 年之前
父節點
當前提交
5f71490b4e

+ 6 - 0
pages.json

@@ -88,6 +88,12 @@
 						"navigationBarTitleText": "提交订单",
 						"navigationBarBackgroundColor": "#007AFF"
 					}
+				},
+				{
+					"path": "other/agree",
+					"style": {
+						"navigationBarTitleText": "用户协议"
+					}
 				}
 			]
 		},

+ 4 - 5
pagesIndex/login/index.vue

@@ -39,8 +39,8 @@
 			return {
 				openid: '',
 				form: {},
-				// 用协议
-				agree: true,
+				// 用协议
+				agree: false,
 				// 注册账号信息
 				user: {},
 				// 弹框
@@ -197,15 +197,14 @@
 			// 同意隐私协议
 			changeAgree() {
 				const that = this;
-				let agree = true;
-				if (that.agree) agree = false;
+				let agree = !that.agree
 				that.$set(that, `agree`, agree);
 			},
 			// 查看隐私协议
 			toAgree() {
 				const that = this;
 				uni.navigateTo({
-					url: `/pagesOther/other/agree`
+					url: `/pagesIndex/other/agree`
 				})
 			},
 		},

+ 0 - 1
pagesIndex/order/index.vue

@@ -158,7 +158,6 @@
 				let info = {
 					skip: that.skip,
 					limit: that.limit,
-					status: that.tabs.active,
 					user: that.user._id,
 				}
 				if (status != '-1') info.status = status

+ 70 - 0
pagesIndex/other/agree.vue

@@ -0,0 +1,70 @@
+<template>
+	<mobile-frame>
+		<view class="main">
+			<view class="one">
+				<rich-text :nodes="formatRichText(info.agreement)"></rich-text>
+				<rich-text :nodes="formatRichText(info.secret)"></rich-text>
+			</view>
+		</view>
+	</mobile-frame>
+</template>
+
+<script>
+	export default {
+		components: {},
+		data() {
+			return {
+				info: {}
+			};
+		},
+		onShow: function() {
+			const that = this;
+			that.search();
+		},
+		methods: {
+			search() {
+				const that = this;
+				try {
+					const res = uni.getStorageSync('config');
+					if (res) that.$set(that, `info`, res);
+				} catch (err) {
+					uni.showToast({
+						title: err.errmsg,
+						icon: 'error',
+						duration: 2000
+					});
+				}
+			},
+			// 处理富文本
+			formatRichText(html) {
+				if (html) {
+					// 富文本内容格式化
+					return html && html.replace(/<img[^>]*>/gi, function(match, capture) {
+						// 查找所有的 img 元素
+						return match.replace(/style=".*"/gi, '').replace(/style='.*'/gi,
+							'')
+						// 删除找到的所有 img 元素中的 style 属性
+					}).replace(/\<img/gi, '<img style="width:100%;"') // 对 img 元素增加 style 属性,并设置宽度为 100%
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			padding: 2vw;
+
+			.rich-img {
+				width: 100% !important;
+				display: block;
+			}
+		}
+	}
+</style>

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesIndex/login/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesIndex/order/index.js.map


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pagesIndex/other/agree.js.map


+ 2 - 1
unpackage/dist/dev/mp-weixin/app.json

@@ -17,7 +17,8 @@
         "order/index",
         "order/detail",
         "order/info",
-        "order/order"
+        "order/order",
+        "other/agree"
       ]
     },
     {

+ 5 - 0
unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -45187,6 +45187,11 @@ var _default = {
         "navigationBarTitleText": "提交订单",
         "navigationBarBackgroundColor": "#007AFF"
       }
+    }, {
+      "path": "other/agree",
+      "style": {
+        "navigationBarTitleText": "用户协议"
+      }
     }]
   }, {
     "root": "pagesMy",

+ 4 - 5
unpackage/dist/dev/mp-weixin/pagesIndex/login/index.js

@@ -153,8 +153,8 @@ var _default = {
     return {
       openid: '',
       form: {},
-      // 用协议
-      agree: true,
+      // 用协议
+      agree: false,
       // 注册账号信息
       user: {},
       // 弹框
@@ -405,15 +405,14 @@ var _default = {
     // 同意隐私协议
     changeAgree: function changeAgree() {
       var that = this;
-      var agree = true;
-      if (that.agree) agree = false;
+      var agree = !that.agree;
       that.$set(that, "agree", agree);
     },
     // 查看隐私协议
     toAgree: function toAgree() {
       var that = this;
       uni.navigateTo({
-        url: "/pagesOther/other/agree"
+        url: "/pagesIndex/other/agree"
       });
     }
   }

+ 0 - 1
unpackage/dist/dev/mp-weixin/pagesIndex/order/index.js

@@ -354,7 +354,6 @@ var _default = {
                 info = {
                   skip: that.skip,
                   limit: that.limit,
-                  status: that.tabs.active,
                   user: that.user._id
                 };
                 if (status != '-1') info.status = status;

File diff suppressed because it is too large
+ 239 - 0
unpackage/dist/dev/mp-weixin/pagesIndex/other/agree.js


+ 4 - 0
unpackage/dist/dev/mp-weixin/pagesIndex/other/agree.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "用户协议",
+  "usingComponents": {}
+}

+ 1 - 0
unpackage/dist/dev/mp-weixin/pagesIndex/other/agree.wxml

@@ -0,0 +1 @@
+<mobile-frame vue-id="509a356c-1" bind:__l="__l" vue-slots="{{['default']}}"><view class="main"><view class="one"><rich-text nodes="{{$root.m0}}"></rich-text><rich-text nodes="{{$root.m1}}"></rich-text></view></view></mobile-frame>

+ 17 - 0
unpackage/dist/dev/mp-weixin/pagesIndex/other/agree.wxss

@@ -0,0 +1,17 @@
+@charset "UTF-8";
+/* 水平间距 */
+/* 水平间距 */
+.main {
+  display: flex;
+  flex-direction: column;
+  width: 100vw;
+  height: 100vh;
+}
+.main .one {
+  padding: 2vw;
+}
+.main .one .rich-img {
+  width: 100% !important;
+  display: block;
+}
+