<template>
	<view style="visibility: hidden;">
		<view class="phone-password-lli" :myflag="myflag" :change:myflag="PSLLI.doPasswordlli(password)"></view>
	</view>
</template>

<script>
	export default {
		name: "password-lli",
		props: {
			password: {
				type: [String,Number],
				default: ''
			}
		},
		data() {
			return {
				myflag: 0
			};
		},
		methods: {
			lliPassword() {
				this.myflag++
			},
			getPassword(data) {
				this.$emit('lli-password',data);
			}
		}
	}
</script>

<script module="PSLLI" lang="renderjs">
	export default {
		methods: {
			doPasswordlli(password) {
				if (window.lli && this.$ownerInstance) {
					this.$ownerInstance.callMethod('getPassword', window.lli.encode(password))
				}
			}
		},
		mounted() {
			if (window.lli && typeof window.lli.encode === 'function') {
			} else {
				const script = document.createElement('script')
				script.src = '/mdist/static/encode.js'
				// #ifdef H5
				script.src = '/mdist/static/encode.js'
				// #endif
				
				// #ifdef APP-PLUS
				script.src = 'static/encode.js'
				// #endif
				
				document.head.appendChild(script)
			}
		},
	}
</script>