From c9c263dc43ad90f95f24a036cee9e6b47afb596c Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期六, 21 十二月 2024 18:44:20 +0800 Subject: [PATCH] 新建盐城德森项目 --- uni_modules/uni-link/components/uni-link/uni-link.vue | 256 +++++++++++++++++++++++++------------------------- 1 files changed, 128 insertions(+), 128 deletions(-) diff --git a/uni_modules/uni-link/components/uni-link/uni-link.vue b/uni_modules/uni-link/components/uni-link/uni-link.vue index 27c5468..8d72003 100644 --- a/uni_modules/uni-link/components/uni-link/uni-link.vue +++ b/uni_modules/uni-link/components/uni-link/uni-link.vue @@ -1,128 +1,128 @@ -<template> - <a v-if="isShowA" class="uni-link" :href="href" - :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}" - :style="{color,fontSize:fontSize+'px'}" :download="download"> - <slot>{{text}}</slot> - </a> - <!-- #ifndef APP-NVUE --> - <text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}" - :style="{color,fontSize:fontSize+'px'}" @click="openURL"> - <slot>{{text}}</slot> - </text> - <!-- #endif --> - <!-- #ifdef APP-NVUE --> - <text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}" - :style="{color,fontSize:fontSize+'px'}" @click="openURL"> - {{text}} - </text> - <!-- #endif --> -</template> - -<script> - /** - * Link 澶栭儴缃戦〉瓒呴摼鎺ョ粍浠� - * @description uni-link鏄竴涓閮ㄧ綉椤佃秴閾炬帴缁勪欢锛屽湪灏忕▼搴忓唴澶嶅埗url锛屽湪app鍐呮墦寮�澶栭儴娴忚鍣紝鍦╤5绔墦寮�鏂扮綉椤� - * @tutorial https://ext.dcloud.net.cn/plugin?id=1182 - * @property {String} href 鐐瑰嚮鍚庢墦寮�鐨勫閮ㄧ綉椤祏rl - * @property {String} text 鏄剧ず鐨勬枃瀛� - * @property {String} downlaod H5骞冲彴涓嬭浇鏂囦欢鍚� - * @property {Boolean} showUnderLine 鏄惁鏄剧ず涓嬪垝绾� - * @property {String} copyTips 鍦ㄥ皬绋嬪簭绔鍒堕摼鎺ユ椂鏄剧ず鐨勬彁绀鸿 - * @property {String} color 閾炬帴鏂囧瓧棰滆壊 - * @property {String} fontSize 閾炬帴鏂囧瓧澶у皬 - * @example * <uni-link href="https://ext.dcloud.net.cn" text="https://ext.dcloud.net.cn"></uni-link> - */ - export default { - name: 'uniLink', - props: { - href: { - type: String, - default: '' - }, - text: { - type: String, - default: '' - }, - download: { - type: String, - default: '' - }, - showUnderLine: { - type: [Boolean, String], - default: true - }, - copyTips: { - type: String, - default: '宸茶嚜鍔ㄥ鍒剁綉鍧�锛岃鍦ㄦ墜鏈烘祻瑙堝櫒閲岀矘璐磋缃戝潃' - }, - color: { - type: String, - default: '#999999' - }, - fontSize: { - type: [Number, String], - default: 14 - } - }, - computed: { - isShowA() { - // #ifdef H5 - this._isH5 = true; - // #endif - if ((this.isMail() || this.isTel()) && this._isH5 === true) { - return true; - } - return false; - } - }, - created() { - this._isH5 = null; - }, - methods: { - isMail() { - return this.href.startsWith('mailto:'); - }, - isTel() { - return this.href.startsWith('tel:'); - }, - openURL() { - // #ifdef APP-PLUS - if (this.isTel()) { - this.makePhoneCall(this.href.replace('tel:', '')); - } else { - plus.runtime.openURL(this.href); - } - // #endif - // #ifdef H5 - window.open(this.href) - // #endif - // #ifdef MP - uni.setClipboardData({ - data: this.href - }); - uni.showModal({ - content: this.copyTips, - showCancel: false - }); - // #endif - }, - makePhoneCall(phoneNumber) { - uni.makePhoneCall({ - phoneNumber - }) - } - } - } -</script> - -<style> - /* #ifndef APP-NVUE */ - .uni-link { - cursor: pointer; - } - - /* #endif */ - .uni-link--withline { - text-decoration: underline; - } -</style> +<template> + <a v-if="isShowA" class="uni-link" :href="href" + :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}" + :style="{color,fontSize:fontSize+'px'}" :download="download"> + <slot>{{text}}</slot> + </a> + <!-- #ifndef APP-NVUE --> + <text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}" + :style="{color,fontSize:fontSize+'px'}" @click="openURL"> + <slot>{{text}}</slot> + </text> + <!-- #endif --> + <!-- #ifdef APP-NVUE --> + <text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}" + :style="{color,fontSize:fontSize+'px'}" @click="openURL"> + {{text}} + </text> + <!-- #endif --> +</template> + +<script> + /** + * Link 澶栭儴缃戦〉瓒呴摼鎺ョ粍浠� + * @description uni-link鏄竴涓閮ㄧ綉椤佃秴閾炬帴缁勪欢锛屽湪灏忕▼搴忓唴澶嶅埗url锛屽湪app鍐呮墦寮�澶栭儴娴忚鍣紝鍦╤5绔墦寮�鏂扮綉椤� + * @tutorial https://ext.dcloud.net.cn/plugin?id=1182 + * @property {String} href 鐐瑰嚮鍚庢墦寮�鐨勫閮ㄧ綉椤祏rl + * @property {String} text 鏄剧ず鐨勬枃瀛� + * @property {String} downlaod H5骞冲彴涓嬭浇鏂囦欢鍚� + * @property {Boolean} showUnderLine 鏄惁鏄剧ず涓嬪垝绾� + * @property {String} copyTips 鍦ㄥ皬绋嬪簭绔鍒堕摼鎺ユ椂鏄剧ず鐨勬彁绀鸿 + * @property {String} color 閾炬帴鏂囧瓧棰滆壊 + * @property {String} fontSize 閾炬帴鏂囧瓧澶у皬 + * @example * <uni-link href="https://ext.dcloud.net.cn" text="https://ext.dcloud.net.cn"></uni-link> + */ + export default { + name: 'uniLink', + props: { + href: { + type: String, + default: '' + }, + text: { + type: String, + default: '' + }, + download: { + type: String, + default: '' + }, + showUnderLine: { + type: [Boolean, String], + default: true + }, + copyTips: { + type: String, + default: '宸茶嚜鍔ㄥ鍒剁綉鍧�锛岃鍦ㄦ墜鏈烘祻瑙堝櫒閲岀矘璐磋缃戝潃' + }, + color: { + type: String, + default: '#999999' + }, + fontSize: { + type: [Number, String], + default: 14 + } + }, + computed: { + isShowA() { + // #ifdef H5 + this._isH5 = true; + // #endif + if ((this.isMail() || this.isTel()) && this._isH5 === true) { + return true; + } + return false; + } + }, + created() { + this._isH5 = null; + }, + methods: { + isMail() { + return this.href.startsWith('mailto:'); + }, + isTel() { + return this.href.startsWith('tel:'); + }, + openURL() { + // #ifdef APP-PLUS + if (this.isTel()) { + this.makePhoneCall(this.href.replace('tel:', '')); + } else { + plus.runtime.openURL(this.href); + } + // #endif + // #ifdef H5 + window.open(this.href) + // #endif + // #ifdef MP + uni.setClipboardData({ + data: this.href + }); + uni.showModal({ + content: this.copyTips, + showCancel: false + }); + // #endif + }, + makePhoneCall(phoneNumber) { + uni.makePhoneCall({ + phoneNumber + }) + } + } + } +</script> + +<style> + /* #ifndef APP-NVUE */ + .uni-link { + cursor: pointer; + } + + /* #endif */ + .uni-link--withline { + text-decoration: underline; + } +</style> -- Gitblit v1.9.1