|
@@ -27,11 +27,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- init(options){
|
|
|
- this.pdf_id = Number(options.pdf_id)
|
|
|
- this.getPDFDetail()
|
|
|
+ async init(options){
|
|
|
+ if(options.scene){
|
|
|
+ const res=await apiGetSceneToParams({scene_key:options.scene})
|
|
|
+ if(res.code==200){
|
|
|
+ const obj=JSON.parse(res.data)
|
|
|
+ this.pdf_id = Number(obj.pdf_id)
|
|
|
+ this.getPDFDetail()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
getPDFDetail(){
|
|
|
+ if(!this.pdf_id){
|
|
|
+ uni.showToast({
|
|
|
+ title: '未找到PDF',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
apiGetPDFDetail({pdf_id:this.pdf_id}).then(res=>{
|
|
|
if(res.code!==200) return
|
|
|
this.pdf_name=res.data.pdf_name||''
|