浏览代码

用户协议跳转

yuxingxing 2 年之前
父节点
当前提交
2ad93ff3a0
共有 2 个文件被更改,包括 20 次插入17 次删除
  1. 15 12
      pages/users/privacy/index.vue
  2. 5 5
      pages/users/register/index.vue

+ 15 - 12
pages/users/privacy/index.vue

@@ -1,11 +1,19 @@
 <template>
 	<view class="content">
-		<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
+		<!-- <jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser> -->
+		<web-view :src="docUrl"></web-view>
+		<!-- <text   class="html-text-box" v-html="noticeList.noticeContent" ></text> -->
 	</view>
 </template>
 
 <script>
+	import {
+		HTTP_REQUEST_URL
+	} from '@/config/app';
 	import parser from "@/components/jyf-parser/jyf-parser";
+	import {
+		getDoc,
+	} from '@/api/home.js';
 	import {
 		getUserAgreement,
 	} from '@/api/user.js';
@@ -20,21 +28,16 @@
 					table: 'width:100%',
 					video: 'width:100%'
 				},
+				docUrl: '',
 				content: ``
 			}
 		},
 		onLoad(options) {
-			getUserAgreement(options.type).then(res => {
-				this.content = res.data.content
-				uni.setNavigationBarTitle({
-					title: res.data.title
-				});
-			}).catch(err => {
-				that.$util.Tips({
-					title: err
-				});
-			})
-		}
+			uni.setNavigationBarTitle({
+				title: options.title
+			});
+			this.docUrl = HTTP_REQUEST_URL + '/doc/'+ options.type
+		},
 		
 	}
 </script>

+ 5 - 5
pages/users/register/index.vue

@@ -78,10 +78,10 @@
 				<checkbox-group @change='ChangeIsDefault'>
 					<checkbox :class="inAnimation ? 'trembling' : ''" @animationend='inAnimation = false'
 						:checked="protocol ? true : false" />{{ $t(`已同意`) }} <text class="main-color"
-						@click="privacy(4)">{{ $t(`《注册协议》`) }}</text>
+						@click="privacy('2.html','注册协议')">{{ $t(`《注册协议》`) }}</text>
 						<text class="main-color"
-						@click="privacy(4)">{{ $t(`《商城须知》`) }}</text>
-					<text class="main-color" @click="privacy(3)">{{ $t(`《隐私政策》`) }}</text>
+						@click="privacy('3.html','商城须知')">{{ $t(`《商城须知》`) }}</text>
+					<text class="main-color" @click="privacy('1.html','隐私政策')">{{ $t(`《隐私政策》`) }}</text>
 				</checkbox-group>
 			</view>
 			<view class="logon" @click="loginMobile" v-if="current !== 0">{{ $t(`同意协议注册`) }}</view>
@@ -211,9 +211,9 @@ export default {
 		ChangeIsDefault(e) {
 			this.$set(this, 'protocol', !this.protocol);
 		},
-		privacy(type) {
+		privacy(type,title) {
 			uni.navigateTo({
-				url: "/pages/users/privacy/index?type=" + type
+				url: "/pages/users/privacy/index?type=" + type+"&title=" + title
 			})
 		},
 		// IOS 版本号判断