ui库和web端产品库合并版本(还需修复细节)
This commit is contained in:
		
							
								
								
									
										41
									
								
								ui/packages/wx/AiOpenData.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								ui/packages/wx/AiOpenData.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | ||||
| <template> | ||||
|   <ww-open-data class="AiOpenData" :type="type" :openid="oid"/> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import {mapActions} from "vuex" | ||||
|  | ||||
| export default { | ||||
|   name: "AiOpenData", | ||||
|   props: { | ||||
|     /** | ||||
|      * open-data 的类型,详情参见具体:https://work.weixin.qq.com/api/doc/90001/90143/91958 | ||||
|      * @values departmentName,userName | ||||
|      */ | ||||
|     type: String, | ||||
|     /** | ||||
|      * 数据ID,根据type取值而定 | ||||
|      */ | ||||
|     openid: {default: ""}, | ||||
|   }, | ||||
|   computed: { | ||||
|     oid() { | ||||
|       /** | ||||
|        * 后端返回格式(cropId|userId) | ||||
|        */ | ||||
|       return this.openid?.toString()?.split("|")?.[1] || this.openid || "" | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     ...mapActions(['initOpenData']) | ||||
|   }, | ||||
|   watch: { | ||||
|     openid: { | ||||
|       handler(v) { | ||||
|         v && this.initOpenData() | ||||
|       }, | ||||
|       immediate: true | ||||
|     } | ||||
|   }, | ||||
| } | ||||
| </script> | ||||
		Reference in New Issue
	
	Block a user