Prechádzať zdrojové kódy

修改用户协议和隐私协议

zs 1 rok pred
rodič
commit
1884d71c1e
3 zmenil súbory, kde vykonal 353 pridanie a 246 odobranie
  1. 244 234
      pages.json
  2. 49 12
      pages/register/index.vue
  3. 60 0
      pagesOther/other/agree.vue

+ 244 - 234
pages.json

@@ -1,111 +1,111 @@
-{
-	"pages": [{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "系统页"
-			}
-		},
-		{
-			"path": "pages/login/index",
-			"style": {
-				"navigationBarTitleText": "登录"
-			}
-		},
-		{
-			"path": "pages/register/index",
-			"style": {
-				"navigationBarTitleText": "注册"
-			}
-		},
-		{
-			"path": "pages/home/index",
-			"style": {
-				"navigationBarTitleText": "首页",
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-			"path": "pages/good/index",
-			"style": {
-				"navigationBarTitleText": "全部商品",
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-			"path": "pages/market/index",
-			"style": {
-				"navigationBarTitleText": "购物车"
-			}
-		},
-		{
-			"path": "pages/my/index",
-			"style": {
-				"navigationBarTitleText": "我的"
-			}
-		}
-	],
-	"subPackages": [ //分包配置
-		{
-			"root": "pagesMy",
-			"pages": [ //分包
-				{
-					"path": "order/index",
-					"style": {
-						"navigationBarTitleText": "订单",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "order/order",
-					"style": {
-						"navigationBarTitleText": "订单管理",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "order/detail",
-					"style": {
-						"navigationBarTitleText": "订单详情"
-					}
-				},
-				{
-					"path": "repair/index",
-					"style": {
-						"navigationBarTitleText": "维修",
-						"enablePullDownRefresh": true
-					}
+{
+	"pages": [{
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "系统页"
+			}
+		},
+		{
+			"path": "pages/login/index",
+			"style": {
+				"navigationBarTitleText": "登录"
+			}
+		},
+		{
+			"path": "pages/register/index",
+			"style": {
+				"navigationBarTitleText": "注册"
+			}
+		},
+		{
+			"path": "pages/home/index",
+			"style": {
+				"navigationBarTitleText": "首页",
+				"enablePullDownRefresh": true
+			}
+		},
+		{
+			"path": "pages/good/index",
+			"style": {
+				"navigationBarTitleText": "全部商品",
+				"enablePullDownRefresh": true
+			}
+		},
+		{
+			"path": "pages/market/index",
+			"style": {
+				"navigationBarTitleText": "购物车"
+			}
+		},
+		{
+			"path": "pages/my/index",
+			"style": {
+				"navigationBarTitleText": "我的"
+			}
+		}
+	],
+	"subPackages": [ //分包配置
+		{
+			"root": "pagesMy",
+			"pages": [ //分包
+				{
+					"path": "order/index",
+					"style": {
+						"navigationBarTitleText": "订单",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "order/order",
+					"style": {
+						"navigationBarTitleText": "订单管理",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "order/detail",
+					"style": {
+						"navigationBarTitleText": "订单详情"
+					}
+				},
+				{
+					"path": "repair/index",
+					"style": {
+						"navigationBarTitleText": "维修",
+						"enablePullDownRefresh": true
+					}
 				},
 				{
 					"path": "repair/detail",
 					"style": {
 						"navigationBarTitleText": "维修详情"
 					}
-				},
-				{
-					"path": "account/index",
-					"style": {
-						"navigationBarTitleText": "账号设置",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "account/info",
-					"style": {
-						"navigationBarTitleText": "账号详情"
-					}
-				},
-				{
-					"path": "account/update",
-					"style": {
-						"navigationBarTitleText": "修改密码"
-					}
-				},
-				{
-					"path": "user/index",
-					"style": {
-						"navigationBarTitleText": "用户管理",
-						"enablePullDownRefresh": true
-					}
+				},
+				{
+					"path": "account/index",
+					"style": {
+						"navigationBarTitleText": "账号设置",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "account/info",
+					"style": {
+						"navigationBarTitleText": "账号详情"
+					}
+				},
+				{
+					"path": "account/update",
+					"style": {
+						"navigationBarTitleText": "修改密码"
+					}
+				},
+				{
+					"path": "user/index",
+					"style": {
+						"navigationBarTitleText": "用户管理",
+						"enablePullDownRefresh": true
+					}
 				},
 				{
 					"path": "refund/index",
@@ -113,60 +113,60 @@
 						"navigationBarTitleText": "申请退货",
 						"enablePullDownRefresh": true
 					}
-				},
-				{
-					"path": "buyExamine/index",
-					"style": {
-						"navigationBarTitleText": "采购审批",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "collectionExamin/index",
-					"style": {
-						"navigationBarTitleText": "回款审批",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "maintenance/index",
-					"style": {
-						"navigationBarTitleText": "维修记录",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "record/index",
-					"style": {
-						"navigationBarTitleText": "回款记录",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "goods/index",
-					"style": {
-						"navigationBarTitleText": "商品管理",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "goods/add",
-					"style": {
-						"navigationBarTitleText": "新增商品"
-					}
-				},
-				{
-					"path": "spec/index",
-					"style": {
-						"navigationBarTitleText": "商品规格",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "spec/add",
-					"style": {
-						"navigationBarTitleText": "新增规格"
-					}
+				},
+				{
+					"path": "buyExamine/index",
+					"style": {
+						"navigationBarTitleText": "采购审批",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "collectionExamin/index",
+					"style": {
+						"navigationBarTitleText": "回款审批",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "maintenance/index",
+					"style": {
+						"navigationBarTitleText": "维修记录",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "record/index",
+					"style": {
+						"navigationBarTitleText": "回款记录",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "goods/index",
+					"style": {
+						"navigationBarTitleText": "商品管理",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "goods/add",
+					"style": {
+						"navigationBarTitleText": "新增商品"
+					}
+				},
+				{
+					"path": "spec/index",
+					"style": {
+						"navigationBarTitleText": "商品规格",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "spec/add",
+					"style": {
+						"navigationBarTitleText": "新增规格"
+					}
 				},
 				{
 					"path": "statistics/index",
@@ -174,81 +174,91 @@
 						"navigationBarTitleText": "回款统计",
 						"enablePullDownRefresh": true
 					}
-				}
-			]
-		},
-		{
-			"root": "pagesGoods",
-			"pages": [ //分包
-				{
-					"path": "index/index",
-					"style": {
-						"navigationBarTitleText": "商品详情"
-					}
-				},
-				{
-					"path": "sort/index",
-					"style": {
-						"navigationBarTitleText": "商品分类",
-						"enablePullDownRefresh": true
-					}
-				},
-				{
-					"path": "shop/index",
-					"style": {
-						"navigationBarTitleText": "店铺",
-						"enablePullDownRefresh": true
-					}
-				}
-			]
-		}
-	],
-	"globalStyle": {
-		"pageOrientation": "portrait",
-		"navigationBarTitleText": "耗材小程序",
-		"navigationBarTextStyle": "white",
-		"navigationBarBackgroundColor": "#007AFF",
-		"backgroundColor": "#F8F8F8",
-		"backgroundColorTop": "#F4F5F6",
-		"backgroundColorBottom": "#F4F5F6"
-	},
-	"tabBar": {
-		"color": "#7A7E83",
-		"selectedColor": "#007AFF",
-		"borderStyle": "black",
-		"backgroundColor": "#F8F8F8",
-		"list": [{
-				"pagePath": "pages/home/index",
-				"iconPath": "static/home.png",
-				"selectedIconPath": "static/homeHL.png",
-				"text": "首页"
-			},
-			{
-				"pagePath": "pages/good/index",
-				"iconPath": "static/good.png",
-				"selectedIconPath": "static/goodHL.png",
-				"text": "全部商品"
-			},
-			{
-				"pagePath": "pages/market/index",
-				"iconPath": "static/shop.png",
-				"selectedIconPath": "static/shopHL.png",
-				"text": "购物车"
-			},
-			{
-				"pagePath": "pages/my/index",
-				"iconPath": "static/my.png",
-				"selectedIconPath": "static/myHL.png",
-				"text": "我的"
-			}
-		]
-	},
-	"condition": { //模式配置,仅开发期间生效
-		"current": 0, //当前激活的模式(list 的索引项)
-		"list": [{
-			"name": "系统首页", //模式名称
-			"path": "pages/index/index", //启动页面,必选
-			"query": "" //启动参数,在页面的onLoad函数里面得到
-		}]
-	}
-}
+				}
+			]
+		},
+		{
+			"root": "pagesGoods",
+			"pages": [ //分包
+				{
+					"path": "index/index",
+					"style": {
+						"navigationBarTitleText": "商品详情"
+					}
+				},
+				{
+					"path": "sort/index",
+					"style": {
+						"navigationBarTitleText": "商品分类",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "shop/index",
+					"style": {
+						"navigationBarTitleText": "店铺",
+						"enablePullDownRefresh": true
+					}
+				}
+			]
+		},
+		{
+			"root": "pagesOther",
+			"pages": [{
+				"path": "other/agree",
+				"style": {
+					"navigationBarTitleText": "用户协议",
+					"enablePullDownRefresh": false
+				}
+			}]
+		}
+	],
+	"globalStyle": {
+		"pageOrientation": "portrait",
+		"navigationBarTitleText": "耗材小程序",
+		"navigationBarTextStyle": "white",
+		"navigationBarBackgroundColor": "#007AFF",
+		"backgroundColor": "#F8F8F8",
+		"backgroundColorTop": "#F4F5F6",
+		"backgroundColorBottom": "#F4F5F6"
+	},
+	"tabBar": {
+		"color": "#7A7E83",
+		"selectedColor": "#007AFF",
+		"borderStyle": "black",
+		"backgroundColor": "#F8F8F8",
+		"list": [{
+				"pagePath": "pages/home/index",
+				"iconPath": "static/home.png",
+				"selectedIconPath": "static/homeHL.png",
+				"text": "首页"
+			},
+			{
+				"pagePath": "pages/good/index",
+				"iconPath": "static/good.png",
+				"selectedIconPath": "static/goodHL.png",
+				"text": "全部商品"
+			},
+			{
+				"pagePath": "pages/market/index",
+				"iconPath": "static/shop.png",
+				"selectedIconPath": "static/shopHL.png",
+				"text": "购物车"
+			},
+			{
+				"pagePath": "pages/my/index",
+				"iconPath": "static/my.png",
+				"selectedIconPath": "static/myHL.png",
+				"text": "我的"
+			}
+		]
+	},
+	"condition": { //模式配置,仅开发期间生效
+		"current": 0, //当前激活的模式(list 的索引项)
+		"list": [{
+			"name": "系统首页", //模式名称
+			"path": "pages/index/index", //启动页面,必选
+			"query": "" //启动参数,在页面的onLoad函数里面得到
+		}]
+	}
+}

+ 49 - 12
pages/register/index.vue

@@ -28,6 +28,14 @@
 			</uni-forms>
 			<button class="button" type="primary" @click="submit('valiForm')">注册</button>
 		</view>
+		<view class="two">
+			<checkbox-group @change="changeAgree">
+				<label>
+					<checkbox :checked="agree" />
+					<text @tap.stop="toAgree()">我已阅读并同意“用户协议”和“隐私政策”</text>
+				</label>
+			</checkbox-group>
+		</view>
 	</view>
 </template>
 
@@ -79,7 +87,9 @@
 				roleList: [],
 				genderList: [],
 				streetList: [],
-				commList: []
+				commList: [],
+				// 用户协议
+				agree: true,
 			}
 		},
 		async onLoad() {
@@ -144,23 +154,44 @@
 				const that = this;
 				that.$set(that.form, `community`, community);
 			},
+			// 同意隐私协议
+			changeAgree() {
+				const that = this;
+				let agree = true;
+				if (that.agree) agree = false;
+				that.$set(that, `agree`, agree);
+			},
+			// 查看隐私协议
+			toAgree() {
+				const that = this;
+				uni.navigateTo({
+					url: `/pagesOther/other/agree`
+				})
+			},
 			// 注册
 			submit(ref) {
 				const that = this;
 				that.$refs[ref].validate().then(async params => {
-					that.form.create_time = moment().format('YYYY-MM-DD HH:mm:ss');
-					const res = await that.$api(`/User`, 'POST', that.form);
-					if (res.errcode == '0') {
-						uni.showToast({
-							title: '注册信息成功',
-							icon: 'none'
-						})
-						uni.navigateBack({
-							delta: 1
-						})
+					if (agree) {
+						that.form.create_time = moment().format('YYYY-MM-DD HH:mm:ss');
+						const res = await that.$api(`/User`, 'POST', that.form);
+						if (res.errcode == '0') {
+							uni.showToast({
+								title: '注册信息成功',
+								icon: 'none'
+							})
+							uni.navigateBack({
+								delta: 1
+							})
+						} else {
+							uni.showToast({
+								title: res.errmsg,
+								icon: 'none'
+							})
+						}
 					} else {
 						uni.showToast({
-							title: res.errmsg,
+							title: '请阅读并同意用户协议和隐私政策',
 							icon: 'none'
 						})
 					}
@@ -234,5 +265,11 @@
 				font-size: var(--font14Size);
 			}
 		}
+
+		.two {
+			width: 100vw;
+			text-align: center;
+			font-size: var(--font12Size);
+		}
 	}
 </style>

+ 60 - 0
pagesOther/other/agree.vue

@@ -0,0 +1,60 @@
+<template>
+	<mobile-frame>
+		<view class="main">
+			<view class="one">
+				<rich-text :nodes="info.agree"></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) {
+						res.agree = res.agree.replace(/\<img/gi, '<img class="rich-img"');
+						that.$set(that, `info`, res.data);
+					}
+				} catch (err) {
+					uni.showToast({
+						title: err.errmsg,
+						icon: 'error',
+						duration: 2000
+					});
+				}
+			}
+		}
+	}
+</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>