当前位置: 首页 > wzjs >正文

中国建设银行信用卡电话汕头网站快速优化排名

中国建设银行信用卡电话,汕头网站快速优化排名,做电脑系统的网站,用群晖nas做网站功能介绍:支付宝小程序手写表格实现行内合并,依据动态数据自动计算每次需求合并的值,本次记录行内合并,如果列内合并,同理即可实现 前端技术:grid布局 display:grid 先看实现效果: axml&…

功能介绍:支付宝小程序手写表格实现行内合并,依据动态数据自动计算每次需求合并的值,本次记录行内合并,如果列内合并,同理即可实现

前端技术:grid布局  display:grid

先看实现效果:

axml:

<view class="leasePlanView" style="padding-top:{{systemInfo.statusBarHeight + systemInfo.titleBarHeight + 15}}px"><view class="tableInfo por"><view class="head com_flex_between"><view a:for="{{ tableHead }}" class="item table-item com_font_26">{{item.title}}</view></view><view class="tableContent grid-container"><view a:for="{{ order_detail.billList }}" a:for-index="idx" class="grid-row"><view class="grid-cell com_flex_center">{{item.term}}</view><view class="grid-cell com_flex_center">内容</view><view class="grid-cell com_flex_center {{mergeInfo[idx].shouldMerge ? 'merge-cell-' + mergeInfo[idx].mergeRows : ''}} {{(!mergeInfo[idx].showNormal && !mergeInfo[idx].shouldMerge) ? 'hide-cell' : ''}}"><block a:if="{{mergeInfo[idx].showNormal}}"><view class="com_color_third">-</view></block><block a:elif="{{mergeInfo[idx].shouldMerge}}"><view class="com_flex_center_column com_font_20">我是合并数据</view></block></view><view class="grid-cell com_flex_center_column">内容</view></view></view></view>
</view>

js:

最重要的处理逻辑是processMergeData这个方法,根据实际需求可自行修改,只要是表格合并,处理逻辑都是相通的。

Page({data: {tableHead: [{title: '第一列'},{title: '第二列'},{title: '第三列'},{title: '第四列'}],mergeInfo: [], // 存储合并信息order_detail:{billList:[{term: '1',discountAmount: '',},{term: '2',discountAmount: '',},{term: '3',discountAmount: '100',},{term: '4',discountAmount: '100',},{term: '5',discountAmount: '200',},{term: '6',discountAmount: '200',},{term: '7',discountAmount: '300',},{term: '8',discountAmount: '300',},{term: '9',discountAmount: '300',},{term: '10',discountAmount: '',},{term: '11',discountAmount: '',},{term: '12',discountAmount: '',}]}},onLoad(query) {this.processMergeData();},// 处理合并数据processMergeData() {const { billList } = this.data.order_detail;const mergeInfo = [];// 遍历数据计算需要合并的行for (let i = 0; i < billList.length; i++) {const current = billList[i];if (current.discountAmount === null || !current.discountAmount) {// discountAmount 为 null 时正常显示mergeInfo[i] = {shouldMerge: false,mergeRows: 1,showNormal: true // 添加标记,表示需要正常显示};continue;}console.log(mergeInfo[i],'mergeInfo[i]mergeInfo[i]')// 如果当前行已经被标记为合并,跳过if (mergeInfo[i]) continue;let mergeCount = 1;// 向下查找相同 discountAmount 值的行for (let j = i + 1; j < billList.length; j++) {if (billList[j].discountAmount === current.discountAmount) {mergeCount++;// 标记被合并的行mergeInfo[j] = {shouldMerge: false,mergeRows: 0,showNormal: false};} else {break;}}// 标记合并起始行mergeInfo[i] = {shouldMerge: mergeCount > 1,mergeRows: mergeCount,showNormal: false};}console.log(mergeInfo,'mergeInfo')this.setData({ mergeInfo });}
});

css实现:

重点在grid布局和动态合并行数

.leasePlanView {width: 100%;min-height: 100vh;
}.bill_box{padding: 12rpx 16rpx 0;
}
.tableInfo {padding: 30rpx 16rpx;width: 710rpx;margin: -32rpx auto 0;background-color: white;border-radius: 20rpx;z-index: 2;
}.tableTitle {margin-bottom: 16rpx;padding: 0 14rpx;height: 32rpx;font-family: PingFangSC-Medium, PingFang SC;
}.tableInfo .head {background: rgba(255, 68, 36, 0.05);border-radius: 20rpx 20rpx 0rpx 0rpx;margin-top: 28rpx;border: 1rpx solid #E8E8E8;border-bottom: none;
}
.table-item{height: 85rpx;width: 169rpx;text-align: center;font-family: PingFangSC-Medium, PingFang SC;line-height: 85rpx;
}
.tableInfo .item {font-weight: 500;color: #000000;
}/* 表格边框实现 */
.tableContent{border: 1rpx solid #E8E8E8;display: grid;grid-template-columns: repeat(1, 1fr);
}
.border-bottom{border-bottom: 1rpx solid #E8E8E8;
}
.border-left{border-left: 1rpx solid #E8E8E8;
}
.grid-row:last-child .grid-cell{border-bottom: none;
}
.amount:first-child{border-left: none;
}.returnDate .bottom {font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #666666;line-height: 22rpx;margin-top: 4rpx;
}
.tableInfo .amount {font-weight: 400;flex: auto;position: relative;
}
.tableInfo .totalAmount{width: 169rpx;height: 85rpx;text-align: center;
}.grid-container {display: grid;grid-template-columns: repeat(4, 1fr);border: 1rpx solid #E8E8E8;
}.grid-row {display: contents;
}.grid-cell {padding: 10rpx;border-bottom: 1rpx solid #E8E8E8;border-left: 1rpx solid #E8E8E8;height: 85rpx;text-align: center;
}.grid-cell:first-child {border-left: none;
}/* 动态合并行数的样式 */
.merge-cell-2 {grid-row: span 2;height: 170rpx;
}.merge-cell-3 {grid-row: span 3;height: 255rpx;
}.merge-cell-4 {grid-row: span 4;height: 340rpx;
}.hide-cell {display: none;
}
http://www.dtcms.com/wzjs/475367.html

相关文章:

  • 沧州青县网站建设百度域名查询
  • 怎么做网站服务器吗武汉网站运营专业乐云seo
  • 什么叫网站优化关键词排名点击软件首页
  • 网站建设委托合同企业培训员工培训平台
  • 网站建设服务公司成都市seo网站公司
  • 网站建设公司ttmwl免费广告投放平台
  • 做农业种子的网站百度保障客服电话
  • 你认为视频网站如何做推广广州seo推广服务
  • 日照高端网站建设厦门排名推广
  • 冷链物流网站百度关键词推广怎么收费
  • 男女做羞羞视频网站手机网站关键词seo
  • 制作一个网站一般先要明确如何在网上做销售推广
  • 福州seo建站男生和女生在一起探讨人生软件
  • 织梦做的的网站首页显示空白湘潭网络推广
  • 工商注册核名查询系统官网福州seo推广
  • 下载的网站模版怎么用如何线上推广引流
  • 建立网站需要什么条件企业培训体系
  • nba最新排名表网站seo顾问
  • 做一个网站如何赚钱百度认证怎么认证
  • 提供网站建设的公司百度小程序排名优化
  • 虚拟会员商城网站分销网络营销产品的特点
  • 青岛网站建设上海专业seo
  • 深圳哪里有网络推广渠避网站百度关键词优化
  • bing 网站管理员百度不让访问危险网站怎么办
  • 怎么做网站评论搜索引擎优化的方法与技巧
  • 中山 网站建设seo研究中心教程
  • 贾汪网站建设网络营销好学吗
  • 烟台学校网站建设可以免费发广告的网站有哪些
  • 做计算机模拟ie题模拟网站打不开国际军事新闻今日头条
  • 做网站一排文字怎么水平对齐seo优化专员