【uniapp小程序】打印列表UI模板

╰半橙微兮° 2023-10-11 23:29 74阅读 0赞

这是一个云打印项目,首页查询接口渲染设备,设备是否在线是通过redis进行判断的,当设备在线时可以通过在线的驱动软件打印用户提交的文档,自动处理无需人工干预
在这里插入图片描述

今天主要是分享一下,文件列表界面,由于UI太丑于是我换了下,如图所示:

在这里插入图片描述
在这里插入图片描述

框架为uView2.0,代码如下:

  1. <template>
  2. <view>
  3. <view class="container">
  4. <!-- 页面内容 -->
  5. <!-- 遮罩层 -->
  6. <u-popup
  7. :safeAreaInsetBottom="true"
  8. :safeAreaInsetTop="true"
  9. :mode="popupData.mode"
  10. :show="show"
  11. :round="popupData.round"
  12. :overlay="popupData.overlay"
  13. :borderRadius="popupData.borderRadius"
  14. :closeable="popupData.closeable"
  15. :closeOnClickOverlay="popupData.closeOnClickOverlay"
  16. @close="close"
  17. >
  18. <view class="u-popup-slot">
  19. <u-grid :border="true">
  20. <u-grid-item
  21. @click="click('1')"
  22. customStyle="padding-top: 10px; padding-bottom: 10px">
  23. <image src="/static/file_word.png" mode="" style="width: 100rpx;height: 100rpx;"></image>
  24. <text class="grid-text">word打印</text>
  25. </u-grid-item>
  26. <u-grid-item
  27. @click="click('1')"
  28. customStyle="padding-top: 10px; padding-bottom: 10px">
  29. <image src="/static/PDF.png" mode="" style="width: 100rpx;height: 100rpx;"></image>
  30. <text class="grid-text">pdf打印</text>
  31. </u-grid-item>
  32. <u-grid-item
  33. @click="click('1')"
  34. customStyle="padding-top: 10px; padding-bottom: 10px">
  35. <image src="/static/EXCEL.png" mode="" style="width: 100rpx;height: 100rpx;"></image>
  36. <text class="grid-text">excel打印</text>
  37. </u-grid-item>
  38. <u-grid-item
  39. @click="click('1')"
  40. customStyle="padding-top: 10px; padding-bottom: 10px">
  41. <image src="/static/tupian.png" mode="" style="width: 100rpx;height: 100rpx;"></image>
  42. <text class="grid-text">照片打印</text>
  43. </u-grid-item>
  44. <u-grid-item
  45. @click="click('1')"
  46. customStyle="padding-top: 10px; padding-bottom: 10px">
  47. <image src="/static/other.png" mode="" style="width: 100rpx;height: 100rpx;"></image>
  48. <text class="grid-text">本地文件</text>
  49. </u-grid-item>
  50. <u-grid-item
  51. @click="click('1')"
  52. customStyle="padding-top: 10px; padding-bottom: 10px">
  53. <image src="/static/wendangwenjian.png" mode="" style="width: 100rpx;height: 100rpx;"></image>
  54. <text class="grid-text">腾讯文档</text>
  55. </u-grid-item>
  56. </u-grid>
  57. </view>
  58. </u-popup>
  59. <!-- 遮罩层 -->
  60. <!-- 悬浮图标 -->
  61. <view class="float-icon" :style="{right: right + 'px', bottom: bottom + 'px'}" @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd">
  62. <image src="/static/biaoge-tijiao.png" style="width: 50rpx;height: 50rpx;"></image>
  63. </view>
  64. <!-- 悬浮图标 -->
  65. <view class="card">
  66. <!-- 卡片内容 -->
  67. <view class="top_" >
  68. <view class="zuo_">
  69. <image src="/static/file_word.png" mode="" style="width: 150rpx;height: 165rpx;"></image>
  70. </view>
  71. <view class="you_">
  72. <view>
  73. 大学生训练项目创业书.docx
  74. </view>
  75. <view style="display: flex;flex-direction: row;">
  76. <!-- -->
  77. <u-tag text="黑白" style="width: 100rpx;margin-left: 10rpx;height: 50rpx;">
  78. </u-tag>
  79. <u-tag
  80. text="标签"
  81. type="warning"
  82. style="width: 100rpx;margin-left: 10rpx;height: 50rpx;">
  83. >
  84. </u-tag>
  85. </view>
  86. <view>
  87. <view class="dayin_set">
  88. <view class="dayin_set_zuo">
  89. <image src="/static/shezhitianchong.png" mode="" style="width: 45rpx;height: 45rpx;"></image>
  90. <text>打印设置</text>
  91. </view>
  92. <view class="dayin_set_you">
  93. <image src="/static/yulan.png" mode="" style="width: 45rpx;height: 45rpx;"></image>
  94. <text>预览</text>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="u-demo-block__content">
  101. <u-line-progress
  102. height="8"
  103. :showText="false"
  104. :percentage="percentage6"
  105. activeColor="#3c9cff"
  106. inactiveColor="#f3f4f6"
  107. >
  108. </u-line-progress>
  109. </view>
  110. <view class="xia_">
  111. <text>总15页</text>
  112. <text style="margin-left: 370rpx;">打印份数:2份</text>
  113. <text style="margin-left: 20rpx;color: red;">取消打印</text>
  114. </view>
  115. </view>
  116. </view>
  117. <!-- 页面内容 -->
  118. <view class="bottom-bar">
  119. <text>费用:¥0.4</text>
  120. <!-- 底部视图 -->
  121. <view style="display: flex;flex-direction: row;">
  122. <u-button
  123. text="确认支付"
  124. size="normal"
  125. type="primary"
  126. style="width: 100rpx;"
  127. ></u-button>
  128. <u-button
  129. text="模拟支付完成"
  130. size="normal"
  131. type="success"
  132. style="width: 100rpx;"
  133. ></u-button>
  134. </view>
  135. </view>
  136. </view>
  137. </view>
  138. </template>
  139. <script>
  140. export default {
  141. data() {
  142. return {
  143. percentage6: 50,
  144. // 悬浮按钮
  145. startX: 0,
  146. startY: 0,
  147. moveX: 0,
  148. moveY: 0,
  149. right: 20,
  150. bottom: 100,
  151. // 悬浮按钮
  152. // 遮罩层
  153. show: false,
  154. popupData: {
  155. overlay: true,
  156. mode: 'center',
  157. round: 10,
  158. borderRadius: '',
  159. closeable: true,
  160. closeOnClickOverlay: true
  161. },
  162. // 遮罩层
  163. }
  164. },
  165. methods: {
  166. click(name) {
  167. uni.showToast({
  168. title:name
  169. })
  170. this.$refs.uToast.success(`点击了第${
  171. name}个`)
  172. },
  173. close() {
  174. this.show = false
  175. // console.log('close');
  176. },
  177. touchStart(e) {
  178. this.startX = e.touches[0].clientX
  179. this.startY = e.touches[0].clientY
  180. },
  181. touchMove(e) {
  182. this.moveX = e.touches[0].clientX - this.startX
  183. this.moveY = e.touches[0].clientY - this.startY
  184. this.right -= this.moveX
  185. this.bottom -= this.moveY
  186. this.startX = e.touches[0].clientX
  187. this.startY = e.touches[0].clientY
  188. },
  189. touchEnd(e) {
  190. // do something
  191. // this.$token.toast("1",2000);
  192. uni.$u.sleep().then(() => {
  193. this.show = !this.show
  194. })
  195. this.percentage6 = uni.$u.range(0, 100, this.percentage6 + 10)
  196. },
  197. },
  198. }
  199. </script>
  200. <style>
  201. /* 悬浮按钮 */
  202. .float-icon {
  203. position: fixed;
  204. width: 50px;
  205. height: 50px;
  206. border-radius: 25px;
  207. background-color: #83deff;
  208. display: flex;
  209. justify-content: center;
  210. align-items: center;
  211. z-index: 999;
  212. }
  213. /* 悬浮按钮 */
  214. /* 卡片部分 */
  215. .card {
  216. width: 650rpx;
  217. height: 250rpx;
  218. background-color: #fff;
  219. border-radius: 5px;
  220. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  221. padding: 16px;
  222. margin: auto;
  223. margin-top: 20rpx;
  224. }
  225. .top_{
  226. width: 650rpx;
  227. height: 180rpx;
  228. display: flex;
  229. flex-direction: row;
  230. /* background-color: red; */
  231. }
  232. .xia_{
  233. margin-top: 20rpx;
  234. width: 650rpx;
  235. height: 40rpx;
  236. display: flex;
  237. flex-direction: row;
  238. /* background-color: yellow; */
  239. font-size: 0.65em;
  240. }
  241. .zuo_{
  242. width: 180rpx;
  243. height: 175rpx;
  244. display: flex;
  245. flex-direction: column;
  246. /* background-color: yellowgreen; */
  247. }
  248. .you_{
  249. width: 468rpx;
  250. height: 175rpx;
  251. display: flex;
  252. flex-direction: column;
  253. /* background-color: bisque; */
  254. }
  255. .dayin_set{
  256. height: 70rpx;
  257. /* background-color: red; */
  258. display: flex;
  259. flex-direction: row;
  260. align-items: center;
  261. justify-content: center;
  262. width: 469rpx;
  263. }
  264. .dayin_set_zuo{
  265. width: 200rpx;
  266. height: 50rpx;
  267. color: white;
  268. border-radius: 15rpx;
  269. justify-content: center;
  270. background-color: #52B1E2;
  271. display: flex;
  272. flex-direction: row;
  273. align-items: center;
  274. }
  275. .dayin_set_you{
  276. width: 150rpx;
  277. height: 50rpx;
  278. justify-content: center;
  279. color: white;
  280. border-radius: 15rpx;
  281. background-color: #52B1E2;
  282. display: flex;
  283. flex-direction: row;
  284. align-items: center;
  285. margin-left: 110rpx;
  286. }
  287. /* 卡片部分 */
  288. /* 遮罩层 */
  289. .u-popup-slot {
  290. width: 700rpx;
  291. height: 500rpx;
  292. display: flex;
  293. flex-direction: column;
  294. align-items: center;
  295. justify-content: center;
  296. }
  297. /* 九宫格 */
  298. .swiper {
  299. height: 220px;
  300. }
  301. .grid-text {
  302. font-size: 14px;
  303. color: #909399;
  304. padding: 10rpx 0 20rpx 0rpx;
  305. /* #ifndef APP-PLUS */
  306. box-sizing: border-box;
  307. /* #endif */
  308. }
  309. /* 板块 */
  310. .container {
  311. display: flex;
  312. flex-direction: column;
  313. height: 100%;
  314. }
  315. .bottom-bar {
  316. position: fixed;
  317. bottom: 0;
  318. left: 0;
  319. width: 100%;
  320. height: 65px;
  321. background-color: #F3F3F6;
  322. /* 其他样式 */
  323. }
  324. </style>

发表评论

表情:
评论列表 (有 0 条评论,74人围观)

还没有评论,来说两句吧...

相关阅读

    相关 uniapp程序订单页面UI

    之前用模板写了订单页面,由于需求改了导致这个页面做更新麻烦,弄了一下午,索性全部删除了自己写了,上面的tabs用的是b-ui框架写的,其他的都是原生写法。根据我的需求,通...

    相关 程序 程序列表模板

    小程序列表模板 今天做小程序列表页面 百度搜了一圈也没有一个模板 今天花了两个小时自己做了一个 放图 ! 中间的隔离线在手机显示的时候颜色比较浅 截图上面显示的比较深