|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <web-view :src="url"></web-view>
|
|
|
|
|
|
+ <web-view :src="url" @message="handleGetMessage"></web-view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -7,12 +7,31 @@ import {h5BaseUrl} from '@/utils/config'
|
|
export default {
|
|
export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
- url:''
|
|
|
|
|
|
+ url:'',
|
|
|
|
+ msgObj:{}
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onShareAppMessage() {
|
|
|
|
+ let paramsStr=''
|
|
|
|
+ for(const key in this.msgObj.params){
|
|
|
|
+ if(!paramsStr){
|
|
|
|
+ paramsStr=`${key}=${this.msgObj.params[key]}`
|
|
|
|
+ }else{
|
|
|
|
+ paramsStr=`${paramsStr}&${key}=${this.msgObj.params[key]}`
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ title:this.msgObj.title||'持仓分析详情',
|
|
|
|
+ path:`/pages/positionAnalysis/detail?${paramsStr}&from=share`,
|
|
|
|
+ imageUrl:this.msgObj.shareImg||''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(options){
|
|
onLoad(options){
|
|
const queryObj={
|
|
const queryObj={
|
|
- id:0,
|
|
|
|
|
|
+ classify_name:options.classify_name,
|
|
|
|
+ classify_type:options.classify_type,
|
|
|
|
+ exchange:options.exchange,
|
|
token:this.$store.state.user.token||uni.getStorageSync("token"),
|
|
token:this.$store.state.user.token||uni.getStorageSync("token"),
|
|
timestamp:new Date().getTime(),//防止缓存
|
|
timestamp:new Date().getTime(),//防止缓存
|
|
}
|
|
}
|
|
@@ -26,10 +45,21 @@ export default {
|
|
}
|
|
}
|
|
console.log('拼接字符串:',queryObjStr);
|
|
console.log('拼接字符串:',queryObjStr);
|
|
this.url=`${h5BaseUrl}/hzyb/chart/positionanalysis?${queryObjStr}#wechat_redirect`
|
|
this.url=`${h5BaseUrl}/hzyb/chart/positionanalysis?${queryObjStr}#wechat_redirect`
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 获取到用户点击转发时从h5页面传来的参数
|
|
|
|
+ handleGetMessage(e){
|
|
|
|
+ const data=e.detail.data[e.detail.data.length-1]
|
|
|
|
+ console.log('h5传来的数据',data);
|
|
|
|
+ this.msgObj=data
|
|
|
|
+ }
|
|
|
|
+ },
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style>
|
|
<style>
|
|
-
|
|
|
|
|
|
+page{
|
|
|
|
+ padding-bottom: constant(safe-area-inset-bottom);
|
|
|
|
+ padding-bottom: env(safe-area-inset-bottom);
|
|
|
|
+}
|
|
</style>
|
|
</style>
|