从 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>
85 lines
2.6 KiB
Vue
85 lines
2.6 KiB
Vue
<template>
|
|
<view class="u-line" :style="[lineStyle]">
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
/**
|
|
* line 线条
|
|
* @description 此组件一般用于显示一根线条,用于分隔内容块,有横向和竖向两种模式,且能设置0.5px线条,使用也很简单
|
|
* @tutorial https://www.uviewui.com/components/line.html
|
|
* @property {String} color 线条的颜色(默认#e4e7ed)
|
|
* @property {String} length 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带rpx单位的值等
|
|
* @property {String} direction 线条的方向,row-横向,col-竖向(默认row)
|
|
* @property {String} border-style 线条的类型,solid-实线,dashed-方形虚线,dotted-圆点虚线(默认solid)
|
|
* @property {Boolean} hair-line 是否显示细线条(默认true)
|
|
* @property {String} margin 线条与上下左右元素的间距,字符串形式,如"30rpx"
|
|
* @example <u-line color="red"></u-line>
|
|
*/
|
|
export default {
|
|
name: 'u-line',
|
|
props: {
|
|
color: {
|
|
type: String,
|
|
default: '#e4e7ed'
|
|
},
|
|
// 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带rpx单位的值等
|
|
length: {
|
|
type: String,
|
|
default: '100%'
|
|
},
|
|
// 线条方向,col-竖向,row-横向
|
|
direction: {
|
|
type: String,
|
|
default: 'row'
|
|
},
|
|
// 是否显示细边框
|
|
hairLine: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
// 线条与上下左右元素的间距,字符串形式,如"30rpx"、"20rpx 30rpx"
|
|
margin: {
|
|
type: String,
|
|
default: '0'
|
|
},
|
|
// 线条的类型,solid-实线,dashed-方形虚线,dotted-圆点虚线
|
|
borderStyle: {
|
|
type: String,
|
|
default: 'solid'
|
|
}
|
|
},
|
|
computed: {
|
|
lineStyle() {
|
|
let style = {};
|
|
style.margin = this.margin;
|
|
// 如果是水平线条,边框高度为1px,再通过transform缩小一半,就是0.5px了
|
|
if(this.direction == 'row') {
|
|
// 此处采用兼容分开写,兼容nvue的写法
|
|
style.borderBottomWidth = '1px';
|
|
style.borderBottomStyle = this.borderStyle;
|
|
style.width = this.$u.addUnit(this.length);
|
|
if(this.hairLine) style.transform = 'scaleY(0.5)';
|
|
} else {
|
|
// 如果是竖向线条,边框宽度为1px,再通过transform缩小一半,就是0.5px了
|
|
style.borderLeftWidth = '1px';
|
|
style.borderLeftStyle = this.borderStyle;
|
|
style.height = this.$u.addUnit(this.length);
|
|
if(this.hairLine) style.transform = 'scaleX(0.5)';
|
|
}
|
|
style.borderColor = this.color;
|
|
return style;
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
@import "../../libs/css/style.components.scss";
|
|
|
|
.u-line {
|
|
vertical-align: middle;
|
|
}
|
|
</style>
|