从 xghmall(云闪付版湘工游)迁移民票模块,改造为微信公众号 H5: - 技术栈沿用 uni-app + Vue2 + uView(含定制版日历组件) - 登录/支付独立成层(common/auth.js、common/pay.js): 一期假登录(测试手机号)+ 模拟支付,后端微信接口就绪后只换这两处 - 登录页重写:短信验证码 + 公众号网页授权(code 换用户信息)预留 - 门票列表页为入口页(进页必须登录),加订单悬浮按钮 - 支付成功页接通:查看订单/继续逛逛 + 订单状态轮询 - 详情页定位导航改用 uni.openLocation + 高德网页兜底 - 出行人页:身份证 18 位格式校验,删除死的删除按钮,修正证件类型回显笔误 - 清理云闪付 SDK、支付宝授权、死页面引用等残留 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
90 lines
2.3 KiB
Vue
90 lines
2.3 KiB
Vue
<template>
|
||
<text class="u-link" @tap.stop="openLink" :style="{
|
||
color: color,
|
||
fontSize: fontSize + 'rpx',
|
||
borderBottom: underLine ? `1px solid ${lineColor ? lineColor : color}` : 'none',
|
||
paddingBottom: underLine ? '0rpx' : '0'
|
||
}">
|
||
<slot></slot>
|
||
</text>
|
||
</template>
|
||
|
||
<script>
|
||
/**
|
||
* link 超链接
|
||
* @description 该组件为超链接组件,在不同平台有不同表现形式:在APP平台会通过plus环境打开内置浏览器,在小程序中把链接复制到粘贴板,同时提示信息,在H5中通过window.open打开链接。
|
||
* @tutorial https://www.uviewui.com/components/link.html
|
||
* @property {String} color 文字颜色(默认#606266)
|
||
* @property {String Number} font-size 字体大小,单位rpx(默认28)
|
||
* @property {Boolean} under-line 是否显示下划线(默认false)
|
||
* @property {String} href 跳转的链接,要带上http(s)
|
||
* @property {String} line-color 下划线颜色,默认同color参数颜色
|
||
* @property {String} mp-tips 各个小程序平台把链接复制到粘贴板后的提示语(默认“链接已复制,请在浏览器打开”)
|
||
* @example <u-link href="http://www.uviewui.com">蜀道难,难于上青天</u-link>
|
||
*/
|
||
export default {
|
||
name: "u-link",
|
||
props: {
|
||
// 文字颜色
|
||
color: {
|
||
type: String,
|
||
default: '#2979ff'
|
||
},
|
||
// 字体大小,单位rpx
|
||
fontSize: {
|
||
type: [String, Number],
|
||
default: 28
|
||
},
|
||
// 是否显示下划线
|
||
underLine: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
// 要跳转的链接
|
||
href: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
// 小程序中复制到粘贴板的提示语
|
||
mpTips: {
|
||
type: String,
|
||
default: '链接已复制,请在浏览器打开'
|
||
},
|
||
// 下划线颜色
|
||
lineColor: {
|
||
type: String,
|
||
default: ''
|
||
}
|
||
},
|
||
methods: {
|
||
openLink() {
|
||
// #ifdef APP-PLUS
|
||
plus.runtime.openURL(this.href)
|
||
// #endif
|
||
// #ifdef H5
|
||
window.open(this.href)
|
||
// #endif
|
||
// #ifdef MP
|
||
uni.setClipboardData({
|
||
data: this.href,
|
||
success: () => {
|
||
uni.hideToast();
|
||
this.$nextTick(() => {
|
||
this.$u.toast(this.mpTips);
|
||
})
|
||
}
|
||
});
|
||
// #endif
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
@import "../../libs/css/style.components.scss";
|
||
|
||
.u-link {
|
||
line-height: 1;
|
||
}
|
||
</style>
|