提交 63425095 编写于 作者: huangwensu's avatar huangwensu

组件获取协议页面域名

上级 4c4c2032
...@@ -11,14 +11,28 @@ Vue.use(PicaH5Agreement); ...@@ -11,14 +11,28 @@ Vue.use(PicaH5Agreement);
```html ```html
// template need popup // template need popup
<van-popup v-model="show"> <van-popup v-model="isShowAgreement" :close-on-click-overlay="false">
<pica-h5-agreement <pica-h5-agreement
:close="true" :close="true"
:base-url="baseUrl" :base-url="baseUrl"
:agreement-token="agreementToken"
:agreement-page-url="agreementPageUrl"
@sign-agreement="signAgreement"
/> />
</van-popup> </van-popup>
``` ```
```javascript
// 代码
export default {
methods: {
signAgreement() {
this.isShowAgreement = false;
}
}
}
```
###### 2. options ###### 2. options
...@@ -26,9 +40,16 @@ Vue.use(PicaH5Agreement); ...@@ -26,9 +40,16 @@ Vue.use(PicaH5Agreement);
| --------- | ---------------------- | -------- | -------- | | --------- | ---------------------- | -------- | -------- |
| baseUrl | 接口域名 | string | 空 | | baseUrl | 接口域名 | string | 空 |
| close | 是否显示 close 符号 | boolean | false | | close | 是否显示 close 符号 | boolean | false |
| agreementToken | 需要传的token | string | '' |
| agreementPageUrl | 需要传的协议页面的地址域名 | string | '' |
| signAgreement | 同意协议后的回调 | function | () => {} |
> baseUrl: > baseUrl:
> dev : http://dev-sc.yunqueyi.com > dev : http://dev-sc.yunqueyi.com
> test1: http://test1-sc.yunqueyi.com > test1: http://test1-sc.yunqueyi.com
> uat: http://uat-sc.yunqueyi.com > uat: http://uat-sc.yunqueyi.com
> agreementPageUrl:
> dev : https://dev-scale.yunqueyi.com
> test1: https://test1-scale.yunqueyi.com
> uat: https://uat-scale.yunqueyi.com
...@@ -22,6 +22,10 @@ export default { ...@@ -22,6 +22,10 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
agreementPageUrl: {
type: String,
default: ''
},
close: { close: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -33,7 +37,7 @@ export default { ...@@ -33,7 +37,7 @@ export default {
} }
}, },
created() { created() {
}, },
methods: { methods: {
readAndAgree() { readAndAgree() {
...@@ -48,8 +52,8 @@ export default { ...@@ -48,8 +52,8 @@ export default {
} }
}) })
}, },
gotoAgreement() { gotoAgreement() { //https://dev-scale.yunqueyi.com/hypertensionscale
window.location.href = 'http://10.177.10.217:8080/loginAgreement'; window.location.href = `${this.agreementPageUrl}/loginAgreement?token=${this.agreementToken}&pageUrl=${window.location.href}`;
} }
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册