Skip to content

Commit 5b1d56e

Browse files
committed
update: 合并代码
1 parent 1d74bcd commit 5b1d56e

58 files changed

Lines changed: 1143 additions & 344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/uLink.vue

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<template>
2+
<view style="text-decoration:underline" :href="href" @click="openURL()" :inWhiteList="inWhiteList"> {{text}} </view>
3+
</template>
4+
5+
<script>
6+
export default {
7+
name: 'u-link',
8+
props: ['href', 'text', 'inWhiteList'],
9+
onLoad() {
10+
11+
},
12+
methods: {
13+
openURL() {
14+
// #ifdef APP-PLUS
15+
plus.runtime.openURL(this.href) //这里默认使用外部浏览器打开而不是内部web-view组件打开
16+
// #endif
17+
// #ifdef H5
18+
window.open(this.href)
19+
// #endif
20+
// #ifdef MP
21+
if (typeof(this.inWhiteList) != "undefined" && this.inWhiteList == true) { //如果在小程序的网址白名单中,会走内置webview打开,否则会复制网址提示在外部浏览器打开
22+
uni.navigateTo({
23+
url: '/pages/component/web-view/web-view?url=' + this.href,
24+
success: res => {},
25+
fail: () => {},
26+
complete: () => {}
27+
});
28+
} else {
29+
uni.setClipboardData({
30+
data: this.href
31+
})
32+
uni.showModal({
33+
content: '本网址无法直接在小程序内打开。已自动复制网址,请在手机浏览器里粘贴该网址',
34+
showCancel: false
35+
})
36+
}
37+
// #endif
38+
}
39+
},
40+
41+
}
42+
</script>
43+
44+
<style>
45+
46+
</style>

pages.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -707,12 +707,6 @@
707707
"navigationBarTitleText": "二维码生成"
708708
}
709709
},
710-
{
711-
"path": "crop/crop",
712-
"style": {
713-
"navigationBarTitleText": "图片裁剪"
714-
}
715-
},
716710
// #ifndef MP-ALIPAY || MP-TOUTIAO
717711
{
718712
"path": "echarts/echarts",
@@ -1028,6 +1022,17 @@
10281022
"navigationBarTitleText": "表单校验"
10291023
}
10301024
}
1025+
// #ifdef APP-PLUS || MP-WEIXIN
1026+
, {
1027+
"path": "vant-button/vant-button",
1028+
"style": {
1029+
"navigationBarTitleText": "微信自定义组件示例",
1030+
"usingComponents": {
1031+
"van-button": "/wxcomponents/vant/button/index"
1032+
}
1033+
}
1034+
}
1035+
// #endif
10311036
]
10321037
}
10331038
],

0 commit comments

Comments
 (0)