当前位置:   article > 正文

小程序 懒加载功能实现_mp-loading

mp-loading

参考方案一:

主要是来自知友提供的代码思路

原文链接:https://zhuanlan.zhihu.com/p/162904380

他的实现思路是:在页面可以使用onPageScroll来监听滚动条的位置

缺点:组件中是无法使用的 另外 页面中使用了overflow发现无法监听滚动条的位置

我使用了该思路 并加入了从后端请求数据的步骤 供大家参考

index.js

  1. const utils = require('../utils/utils')
  2. const app = getApp()
  3. Page({
  4. data: {
  5. first:[
  6. {
  7. Id: 1,
  8. Number: 'BN23656326561',
  9. CreateTime: '2021/04/21 08:12:56',
  10. RegionName: 'XXXXX',
  11. Address: '一号研发楼'
  12. },
  13. {
  14. Id: 2,
  15. Number: 'BN23656326562',
  16. CreateTime: '2021/04/21 08:12:56',
  17. RegionName: 'XXXXX',
  18. Address: '一号研发楼'
  19. },
  20. {
  21. Id: 3,
  22. Number: 'BN23656326563',
  23. CreateTime: '2021/04/21 08:12:56',
  24. RegionName: 'XXXXX',
  25. Address: '一号研发楼'
  26. },
  27. {
  28. Id: 4,
  29. Number: 'BN23656326564',
  30. CreateTime: '2021/04/21 08:12:56',
  31. RegionName: 'XXXXX',
  32. Address: '一号研发楼'
  33. },
  34. {
  35. Id: 5,
  36. Number: 'BN23656326565',
  37. CreateTime: '2021/04/21 08:12:56',
  38. RegionName: 'XXXXX',
  39. Address: '一号研发楼'
  40. },
  41. {
  42. Id: 6,
  43. Number: 'BN23656326566',
  44. CreateTime: '2021/04/21 08:12:56',
  45. RegionName: 'XXXXX',
  46. Address: '一号研发楼'
  47. },
  48. {
  49. Id: 7,
  50. Number: 'BN23656326567',
  51. CreateTime: '2021/04/21 08:12:56',
  52. RegionName: 'XXXXX',
  53. Address: '一号研发楼'
  54. },
  55. {
  56. Id: 8,
  57. Number: 'BN23656326568',
  58. CreateTime: '2021/04/21 08:12:56',
  59. RegionName: 'XXXXX',
  60. Address: '一号研发楼'
  61. },
  62. {
  63. Id: 9,
  64. Number: 'BN23656326569',
  65. CreateTime: '2021/04/21 08:12:56',
  66. RegionName: 'XXXXX',
  67. Address: '一号研发楼'
  68. },
  69. {
  70. Id: 10,
  71. Number: 'BN23656326510',
  72. CreateTime: '2021/04/21 08:12:56',
  73. RegionName: 'XXXXX',
  74. Address: '一号研发楼'
  75. },
  76. ],
  77. second:[
  78. {
  79. Id: 11,
  80. Number: 'BN23656326565',
  81. CreateTime: '2021/04/21 08:12:56',
  82. RegionName: 'XXXXX',
  83. Address: '一号研发楼'
  84. },
  85. {
  86. Id: 12,
  87. Number: 'BN23656326566',
  88. CreateTime: '2021/04/21 08:12:56',
  89. RegionName: 'XXXXX',
  90. Address: '一号研发楼'
  91. },
  92. {
  93. Id: 13,
  94. Number: 'BN23656326565',
  95. CreateTime: '2021/04/21 08:12:56',
  96. RegionName: 'XXXXX',
  97. Address: '一号研发楼'
  98. },
  99. {
  100. Id: 14,
  101. Number: 'BN23656326566',
  102. CreateTime: '2021/04/21 08:12:56',
  103. RegionName: 'XXXXX',
  104. Address: '一号研发楼'
  105. },
  106. {
  107. Id: 15,
  108. Number: 'BN23656326565',
  109. CreateTime: '2021/04/21 08:12:56',
  110. RegionName: 'XXXXX',
  111. Address: '一号研发楼'
  112. },
  113. {
  114. Id: 16,
  115. Number: 'BN23656326566',
  116. CreateTime: '2021/04/21 08:12:56',
  117. RegionName: 'XXXXX',
  118. Address: '一号研发楼'
  119. },
  120. {
  121. Id: 17,
  122. Number: 'BN23656326565',
  123. CreateTime: '2021/04/21 08:12:56',
  124. RegionName: 'XXXXX',
  125. Address: '一号研发楼'
  126. },
  127. {
  128. Id: 18,
  129. Number: 'BN23656326566',
  130. CreateTime: '2021/04/21 08:12:56',
  131. RegionName: 'XXXXX',
  132. Address: '一号研发楼'
  133. },
  134. {
  135. Id: 19,
  136. Number: 'BN23656326565',
  137. CreateTime: '2021/04/21 08:12:56',
  138. RegionName: 'XXXXX',
  139. Address: '一号研发楼'
  140. },
  141. {
  142. Id: 20,
  143. Number: 'BN23656326566',
  144. CreateTime: '2021/04/21 08:12:56',
  145. RegionName: 'XXXXX',
  146. Address: '一号研发楼'
  147. },
  148. ],
  149. pagenum: 1,
  150. pagesize: 10,
  151. total: 12,
  152. loading: true,
  153. finishedLoading: false,
  154. windowHeight:'',
  155. pageScroll: false
  156. },
  157. onLoad: function(option){
  158. // console.log("onLoad")
  159. let that = this
  160. wx.getSystemInfo({
  161. success: function(res){
  162. that.setData({
  163. windowHeight: res.windowHeight
  164. })
  165. }
  166. })
  167. },
  168. // 调用滚动条获取位置信息
  169. onPageScroll: function(e){
  170. // console.log(e)
  171. if(e&&this.data.pageScroll == false){
  172. this.setData({
  173. pageScroll: true
  174. })
  175. }
  176. let that = this
  177. if(that.data.detail[that.data.detail.length - 1].hide){
  178. return false
  179. }
  180. wx.getSystemInfo({
  181. success: function(res){
  182. that.setData({
  183. windowHeight: res.windowHeight + e.scrollTop
  184. })
  185. }
  186. })
  187. // console.log(this.data.windowHeight,e.scrollTop)
  188. var start = (that.data.pagenum - 1) * that.data.pagesize
  189. for(let i = start; i < that.data.detail.length; i++){
  190. if(that.data.detail[i].height <= that.data.windowHeight){
  191. that.data.detail[i].hide = true
  192. }else{
  193. that.data.detail[i].hide = false
  194. }
  195. }
  196. that.setData({
  197. detail: that.data.detail
  198. })
  199. if(that.data.detail[that.data.detail.length-1].hide){
  200. if(that.data.detail.length<that.data.total){
  201. that.setData({
  202. pagenum: that.data.pagenum+1,
  203. loading: true
  204. })
  205. // 再次获取新的值
  206. var data = that.initial()
  207. }else{
  208. that.setData({
  209. finishedLoading: true
  210. })
  211. }
  212. }
  213. },
  214. onShow() {
  215. // console.log("onShow")
  216. // 等待 获取从后端传过来的值
  217. var data = this.initial()
  218. },
  219. async initial(){
  220. this.setData({
  221. pageScroll: false
  222. })
  223. const params = {
  224. PageNum: this.data.pagenum,
  225. PageSize: this.data.pagesize
  226. }
  227. await this.realIni(params)
  228. },
  229. getData(val){
  230. var that = this
  231. if(val.PageNum == 1){
  232. let list = that.data.first
  233. return new Promise((resolve, reject) => {
  234. setTimeout(() => {
  235. that.setData({
  236. detail: that.data.first,
  237. loading: false
  238. })
  239. resolve(list)
  240. }, 2000)
  241. })
  242. }else{
  243. var list = utils.deepCloneArr(that.data.detail)//深拷贝副本
  244. list.push(...that.data.second)
  245. return new Promise((resolve, reject) => {
  246. setTimeout(() => {
  247. that.setData({
  248. loading: false,
  249. detail: list
  250. })
  251. resolve(list)
  252. }, 3000)
  253. })
  254. }
  255. },
  256. async realIni(val) {
  257. const result = await this.getData(val)
  258. var that = this
  259. if(that.data.loading==false){
  260. var start = (that.data.pagenum - 1) * that.data.pagesize
  261. for(let i = start;i < result.length;i++){
  262. // console.log('#curr'+ i)
  263. wx.createSelectorQuery().select('#curr'+ i).boundingClientRect(function(rect){
  264. // console.log(rect,rect.top)
  265. result[i].height = rect.top
  266. // console.log(result[i].height , that.data.windowHeight)
  267. if(result[i].height <= that.data.windowHeight){
  268. result[i].hide = true
  269. }else{
  270. result[i].hide = false
  271. }
  272. if(i==(result.length -1)){
  273. that.setData({
  274. detail: result
  275. })
  276. }
  277. }).exec()
  278. }
  279. }
  280. }
  281. })

其中utils.js里面的深拷贝函数

  1. // 对象深拷贝函数
  2. const deepCloneArr = function(initalArr) {
  3. var list = [];
  4. list = JSON.parse(JSON.stringify(initalArr));
  5. return list;
  6. }
  7. // 将深拷贝函数暴露出去
  8. module.exports = {
  9. deepCloneArr
  10. }

index.json

  1. {
  2. "usingComponents": {
  3. "mp-loading": "weui-miniprogram/loading/loading"
  4. }
  5. }

index.wxml 

  1. <view class="work {{pageScroll ? 'work-long': 'work-v'}}">
  2. <view class="work-header">
  3. <text>固定</text>
  4. </view>
  5. <view class="work-header-t">
  6. </view>
  7. <view class="lazyload">
  8. <view wx:for="{{detail}}" wx:key="index" class="undeal-item {{item.hide?'animation':''}}" id="curr{{index}}">
  9. <view wx:if="{{item.hide}}">
  10. <view class="undeal-item-info">
  11. <view class="undeal-item-info-oneline">
  12. <view class="undeal-item-info-left">
  13. <view class="undeal-item-info-left-label">编号</view>
  14. <view class="undeal-item-info-left-value">{{item.Number}}</view>
  15. </view>
  16. <view class="undeal-item-info-right">
  17. <text class="undeal-item-info-right-label">创建时间</text>
  18. <text class="undeal-item-info-right-value">{{item.CreateTime}}</text>
  19. </view>
  20. </view>
  21. <view class="undeal-item-info-twoline">
  22. <view class="undeal-item-info-left">
  23. <text class="undeal-item-info-left-label item-label-style">所属区域</text>
  24. <text class="undeal-item-info-left-value item-style">{{item.RegionName}}</text>
  25. </view>
  26. <view class="undeal-item-info-left">
  27. <text class="undeal-item-info-left-label item-label-style">目的地</text>
  28. <text class="undeal-item-info-left-value item-style">{{item.Address}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <mp-loading wx:if="{{!finishedLoading}}" class="loading-style" type="dot-gray" show="{{loading}}"></mp-loading>
  35. <text wx:else class="loading-txt">已经到底了...</text>
  36. </view>
  37. </view>

index.css

  1. .work{
  2. width: 100vw;
  3. height: auto;
  4. position: relative;
  5. background-color: #F2F2F2;
  6. }
  7. .work-v{
  8. height: 100vh;
  9. }
  10. .work-long{
  11. height: 100%;
  12. }
  13. .work-header{
  14. position: fixed;
  15. /* position: sticky ; */
  16. top: 0;
  17. width: 100%;
  18. height: 120rpx;
  19. z-index: 1000;
  20. float: left;
  21. /* top: 0rpx; */
  22. left: 0;
  23. background-color: red;
  24. padding: 19rpx 40rpx 4rpx 40rpx;
  25. }
  26. .work-header-t{
  27. width: 100%;
  28. height: 120rpx;
  29. }
  30. .lazyload{
  31. width: 100%;
  32. height: 100%;
  33. background-color: pink;
  34. /* 失效 */
  35. /* height: calc(100vh - 120rpx); */
  36. /* overflow-y: scroll; */
  37. padding-bottom: calc(env(safe-area-inset-bottom) / 2);
  38. }
  39. .center{
  40. width: 100%;
  41. margin: 30rpx 10% 0;
  42. float: left;
  43. font-size: 26rpx;
  44. height: 200rpx;
  45. background-color: #fff;
  46. }
  47. .animation{
  48. animation: center 1s;
  49. }
  50. @keyframes center{
  51. from{
  52. transform: scale(0.5);
  53. }
  54. to{
  55. transform: scale(1);
  56. }
  57. }
  58. /* 基本信息 */
  59. .undeal-item{
  60. height: 240rpx;
  61. margin-top: 10rpx;
  62. background-color: #fff;
  63. }
  64. .undeal-item-info{
  65. padding: 0 26rpx 0rpx 38rpx;
  66. display: flex;
  67. flex-direction: column;
  68. }
  69. .undeal-item-info-oneline,
  70. .undeal-item-info-twoline{
  71. margin-top: 16rpx ;
  72. font-size: 22rpx;
  73. display: flex;
  74. justify-content: space-between;
  75. }
  76. .undeal-item-info-oneline{
  77. color: #237AE4;
  78. }
  79. .undeal-item-info-left{
  80. flex: 1;
  81. display: flex;
  82. }
  83. .undeal-item-info-right{
  84. flex: 1;
  85. display: flex;
  86. }
  87. .undeal-item-info-left-label{
  88. width: 110rpx;
  89. }
  90. .undeal-item-info-right-label{
  91. width: 120rpx;
  92. }
  93. .undeal-item-info-left-value,
  94. .undeal-item-info-right-value{
  95. justify-content: flex-end;
  96. }
  97. .item-label-style{
  98. color: #666;
  99. }
  100. .item-style{
  101. color: #333;
  102. }
  103. /* loading样式 */
  104. .loading-style{
  105. display: block;
  106. padding-top: 40rpx;
  107. padding-bottom: 40rpx;
  108. }
  109. .loading-txt{
  110. font-size: 20rpx;
  111. padding-bottom: 10rpx;
  112. text-align: center;
  113. display: flex;
  114. align-items: center;
  115. justify-content: center;
  116. color: #666;
  117. background-color: lightgray;
  118. }

对于上述方案有固定的头部区域,滚动条还是可以穿过,观感很不好

因此,带来第二种方案

参考方案二:

主要实现思路是:在需要懒加载的区域引入微信官方文档中的scroll-view组件

参考链接:https://developers.weixin.qq.com/miniprogram/dev/component/scroll-view.html

lazyr.js

  1. const utils = require('../../utils/utils')
  2. const app = getApp()
  3. Component({
  4. /**
  5. * 组件的属性列表
  6. */
  7. properties: {
  8. },
  9. /**
  10. * 组件的初始数据
  11. */
  12. data: {
  13. first:[
  14. {
  15. Id: 1,
  16. Number: 'BN23656326561',
  17. CreateTime: '2021/04/21 08:12:56',
  18. RegionName: 'XXXXX',
  19. Address: '一号研发楼'
  20. },
  21. {
  22. Id: 2,
  23. Number: 'BN23656326562',
  24. CreateTime: '2021/04/21 08:12:56',
  25. RegionName: 'XXXXX',
  26. Address: '一号研发楼'
  27. },
  28. {
  29. Id: 3,
  30. Number: 'BN23656326563',
  31. CreateTime: '2021/04/21 08:12:56',
  32. RegionName: 'XXXXX',
  33. Address: '一号研发楼'
  34. },
  35. {
  36. Id: 4,
  37. Number: 'BN23656326564',
  38. CreateTime: '2021/04/21 08:12:56',
  39. RegionName: 'XXXXX',
  40. Address: '一号研发楼'
  41. },
  42. {
  43. Id: 5,
  44. Number: 'BN23656326565',
  45. CreateTime: '2021/04/21 08:12:56',
  46. RegionName: 'XXXXX',
  47. Address: '一号研发楼'
  48. },
  49. {
  50. Id: 6,
  51. Number: 'BN23656326566',
  52. CreateTime: '2021/04/21 08:12:56',
  53. RegionName: 'XXXXX',
  54. Address: '一号研发楼'
  55. },
  56. {
  57. Id: 7,
  58. Number: 'BN23656326567',
  59. CreateTime: '2021/04/21 08:12:56',
  60. RegionName: 'XXXXX',
  61. Address: '一号研发楼'
  62. },
  63. {
  64. Id: 8,
  65. Number: 'BN23656326568',
  66. CreateTime: '2021/04/21 08:12:56',
  67. RegionName: 'XXXXX',
  68. Address: '一号研发楼'
  69. },
  70. {
  71. Id: 9,
  72. Number: 'BN23656326569',
  73. CreateTime: '2021/04/21 08:12:56',
  74. RegionName: 'XXXXX',
  75. Address: '一号研发楼'
  76. },
  77. {
  78. Id: 10,
  79. Number: 'BN23656326510',
  80. CreateTime: '2021/04/21 08:12:56',
  81. RegionName: 'XXXXX',
  82. Address: '一号研发楼'
  83. },
  84. ],
  85. second:[
  86. {
  87. Id: 11,
  88. Number: 'BN23656326565',
  89. CreateTime: '2021/04/21 08:12:56',
  90. RegionName: 'XXXXX',
  91. Address: '一号研发楼'
  92. },
  93. {
  94. Id: 12,
  95. Number: 'BN23656326566',
  96. CreateTime: '2021/04/21 08:12:56',
  97. RegionName: 'XXXXX',
  98. Address: '一号研发楼'
  99. },
  100. {
  101. Id: 13,
  102. Number: 'BN23656326565',
  103. CreateTime: '2021/04/21 08:12:56',
  104. RegionName: 'XXXXX',
  105. Address: '一号研发楼'
  106. },
  107. {
  108. Id: 14,
  109. Number: 'BN23656326566',
  110. CreateTime: '2021/04/21 08:12:56',
  111. RegionName: 'XXXXX',
  112. Address: '一号研发楼'
  113. },
  114. {
  115. Id: 15,
  116. Number: 'BN23656326565',
  117. CreateTime: '2021/04/21 08:12:56',
  118. RegionName: 'XXXXX',
  119. Address: '一号研发楼'
  120. },
  121. {
  122. Id: 16,
  123. Number: 'BN23656326566',
  124. CreateTime: '2021/04/21 08:12:56',
  125. RegionName: 'XXXXX',
  126. Address: '一号研发楼'
  127. },
  128. {
  129. Id: 17,
  130. Number: 'BN23656326565',
  131. CreateTime: '2021/04/21 08:12:56',
  132. RegionName: 'XXXXX',
  133. Address: '一号研发楼'
  134. },
  135. {
  136. Id: 18,
  137. Number: 'BN23656326566',
  138. CreateTime: '2021/04/21 08:12:56',
  139. RegionName: 'XXXXX',
  140. Address: '一号研发楼'
  141. },
  142. {
  143. Id: 19,
  144. Number: 'BN23656326565',
  145. CreateTime: '2021/04/21 08:12:56',
  146. RegionName: 'XXXXX',
  147. Address: '一号研发楼'
  148. },
  149. {
  150. Id: 20,
  151. Number: 'BN23656326566',
  152. CreateTime: '2021/04/21 08:12:56',
  153. RegionName: 'XXXXX',
  154. Address: '一号研发楼'
  155. },
  156. ],
  157. query:'',
  158. pagenum: 1,
  159. pagesize: 10,
  160. total: 20,
  161. loading: true,
  162. finishedLoading: false,
  163. recycleList: [],
  164. // 查询的触发标志
  165. flag: '',
  166. windowHeight: '',
  167. areaInfo: {},
  168. currentStatus: 0,
  169. pageScroll: false
  170. },
  171. lifetimes: {
  172. attached: function () {
  173. this.setData({
  174. pagenum: 1,
  175. recycleList: [],
  176. loading: true,
  177. finishedLoading: false
  178. })
  179. var that = this
  180. wx.getSystemInfo({
  181. success: function(res){
  182. that.setData({
  183. windowHeight: res.windowHeight
  184. })
  185. }
  186. })
  187. },
  188. ready: function(){
  189. console.log("ready")
  190. var inidetail = this.initial()
  191. },
  192. moved: function () {
  193. },
  194. detached: function () {
  195. },
  196. },
  197. /* 组件的方法列表 */
  198. methods: {
  199. async initial(){
  200. const params = {
  201. PageNum: this.data.pagenum,
  202. PageSize: this.data.pagesize
  203. }
  204. await this.realIni(params)
  205. },
  206. getData(val){
  207. var that = this
  208. if(val.PageNum == 1){
  209. let list = that.data.first
  210. return new Promise((resolve, reject) => {
  211. setTimeout(() => {
  212. that.setData({
  213. loading: false,
  214. recycleList: that.data.first
  215. })
  216. resolve(that.data.recycleList)
  217. }, 2000)
  218. })
  219. }else{
  220. // var list = utils.deepCloneArr(that.data.detail)//深拷贝副本
  221. // list.push(...that.data.second)
  222. return new Promise((resolve, reject) => {
  223. setTimeout(() => {
  224. let list = utils.deepCloneArr(that.data.recycleList)
  225. list.push(...that.data.second)
  226. that.setData({
  227. loading: false,
  228. recycleList: list
  229. })
  230. resolve(list)
  231. }, 3000)
  232. })
  233. }
  234. },
  235. async realIni(val) {
  236. const result = await this.getData(val)
  237. console.log(result)
  238. },
  239. getScroll:function(e){
  240. let that = this
  241. if(that.data.recycleList.length<that.data.total){
  242. that.setData({
  243. pagenum: that.data.pagenum+1,
  244. loading: true
  245. })
  246. // 再次获取新的值
  247. var data = that.initial()
  248. }else{
  249. if(!that.data.finishedLoading){
  250. that.setData({
  251. finishedLoading: true
  252. })
  253. }
  254. }
  255. },
  256. }
  257. })

lazyr.json

  1. {
  2. "component": true,
  3. "usingComponents": {
  4. "mp-loading": "weui-miniprogram/loading/loading"
  5. }
  6. }

lazyr.wxml

  1. <view class="work">
  2. <view class="work-header-f">
  3. <view class="work-header">
  4. <text>固定</text>
  5. </view>
  6. <view class="work-header-t">
  7. </view>
  8. </view>
  9. <view wx:if="{{ total > 0}}">
  10. <scroll-view scroll-y="true" style='height:calc(100vh - 130rpx)'
  11. class="{{ total>pagesize? '' : 'lazyload'}}"
  12. bindscrolltolower="getScroll">
  13. <view wx:for="{{recycleList}}" wx:key="index" class="undeal-item list_item_box" id="undeal{{id}}">
  14. <view class="undeal-item-info">
  15. <view class="undeal-item-info-oneline">
  16. <view class="undeal-item-info-left">
  17. <view class="undeal-item-info-left-label">编号</view>
  18. <view class="undeal-item-info-left-value">{{item.Number}}</view>
  19. </view>
  20. <view class="undeal-item-info-right">
  21. <text class="undeal-item-info-right-label">创建时间</text>
  22. <text class="undeal-item-info-right-value">{{item.CreateTime}}</text>
  23. </view>
  24. </view>
  25. <view class="undeal-item-info-twoline">
  26. <view class="undeal-item-info-left">
  27. <text class="undeal-item-info-left-label item-label-style">所属区域</text>
  28. <text class="undeal-item-info-left-value item-style">{{item.RegionName}}</text>
  29. </view>
  30. <view class="undeal-item-info-left">
  31. <text class="undeal-item-info-left-label item-label-style">目的地</text>
  32. <text class="undeal-item-info-left-value item-style">{{item.Address}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <mp-loading wx:if="{{!finishedLoading}}" class="loading-style" type="dot-gray" show="{{loading}}"></mp-loading>
  38. <text wx:else class="loading-txt">已经到底了...</text>
  39. </scroll-view>
  40. </view>
  41. <view wx:else class="nodatab {{currentStatus == 0? '': 'lazyload-p'}}">
  42. <text>暂无内容</text>
  43. </view>
  44. </view>

lazyr.wxss

  1. .work{
  2. margin-top: 0rpx;
  3. height: 100vh;
  4. background-color: lightgray;
  5. }
  6. .work-header{
  7. width: 100%;
  8. height: 120rpx;
  9. position: fixed;
  10. z-index: 1000;
  11. float: left;
  12. top: 0rpx;
  13. left: 0;
  14. background-color: red;
  15. padding: 19rpx 40rpx 4rpx 40rpx;
  16. }
  17. .work-header-t{
  18. width: 100%;
  19. height: 120rpx;
  20. }
  21. .lazyload{
  22. height: 100% !important;
  23. width: 100%;
  24. padding-bottom: calc(env(safe-area-inset-bottom) / 2);
  25. }
  26. /* 基本信息 */
  27. .undeal-item{
  28. width: 100%;
  29. height: 240rpx;
  30. margin-top: 10rpx;
  31. background-color: #fff;
  32. }
  33. .undeal-item-info{
  34. padding: 0 26rpx 0rpx 38rpx;
  35. display: flex;
  36. flex-direction: column;
  37. }
  38. .undeal-item-info-oneline,
  39. .undeal-item-info-twoline{
  40. margin-top: 16rpx ;
  41. font-size: 22rpx;
  42. display: flex;
  43. justify-content: space-between;
  44. }
  45. .undeal-item-info-oneline{
  46. color: #237AE4;
  47. }
  48. .undeal-item-info-left{
  49. flex: 1;
  50. display: flex;
  51. }
  52. .undeal-item-info-right{
  53. flex: 1;
  54. display: flex;
  55. }
  56. .undeal-item-info-left-label{
  57. width: 110rpx;
  58. }
  59. .undeal-item-info-right-label{
  60. width: 120rpx;
  61. }
  62. .undeal-item-info-left-value,
  63. .undeal-item-info-right-value{
  64. justify-content: flex-end;
  65. }
  66. .item-label-style{
  67. color: #666;
  68. }
  69. .item-style{
  70. color: #333;
  71. }
  72. /* loading样式 */
  73. .loading-style{
  74. display: block;
  75. padding-top: 40rpx;
  76. padding-bottom: 40rpx;
  77. }
  78. .loading-txt{
  79. font-size: 20rpx;
  80. padding-bottom: 10rpx;
  81. text-align: center;
  82. display: flex;
  83. align-items: center;
  84. justify-content: center;
  85. color: #666;
  86. background-color: lightgray;
  87. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/321313
推荐阅读
相关标签
  

闽ICP备14008679号