当前位置:   article > 正文

vue中分叉式步骤条_vue分叉式步骤条

vue分叉式步骤条

  1. <!--
  2. * @Author: xiaohe
  3. * @LastEditors: xiaohe
  4. -->
  5. <template>
  6. <div class="step">
  7. <template v-for="(item, index) in stepArray">
  8. <div v-if="item.id != 5" :key="item.id" class="step_box">
  9. <div class="step_icon" :id="getIcon(item.id)">
  10. {{ indexNum > item.id ? "" : item.id }}
  11. </div>
  12. <div class="step_text">
  13. <div :class="getText(item.id)">
  14. {{ item.label }}
  15. </div>
  16. <div class="step_time">
  17. 2022-12-08 12:45:11
  18. </div>
  19. <div
  20. v-show="index != 7"
  21. :class="getBorder(item.id)"
  22. :style="{ '--myColor1': item.widthStr }"
  23. ></div>
  24. </div>
  25. </div>
  26. <div :key="item.id" class="step_boxs" v-else>
  27. <div class="step_box_list">
  28. <div class="top_left border_pan" :id="getBorderPay(5)">
  29. <div class="top_wc">
  30. <div class="pay_step" :id="getIcon(5)">
  31. {{ indexNum > 5 ? "" : 5 }}
  32. </div>
  33. <div class="pay_text">
  34. <div :class="getText(5)">支付完成</div>
  35. <div class="step_time">
  36. 2022-12-08 12:45:11
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="bom_left border_span" :id="getBorderPay(6)">
  42. <div class="top_qy">
  43. <div class="pay_step" :id="getIcon(6)">
  44. {{ indexNum > 6 ? "" : 6 }}
  45. </div>
  46. <div class="pay_text">
  47. <div :class="getText(6)">签约,保函确认完成</div>
  48. <div class="step_time">
  49. 2022-12-08 12:45:11
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="pay_ing" :id="indexNum > 6 ? 'pay_ing' : ''"></div>
  56. </div>
  57. </template>
  58. </div>
  59. </template>
  60. <script>
  61. export default {
  62. props: ["indexProNum", "infoJson"],
  63. computed: {
  64. indexNum() {
  65. return this.indexProNum;
  66. }
  67. },
  68. components: {},
  69. data() {
  70. return {
  71. stepArray: [
  72. {
  73. label: "提交订单",
  74. id: 1,
  75. widthStr: "68px",
  76. key: "" // 时间字段
  77. },
  78. {
  79. widthStr: "100px",
  80. key: "",
  81. label: "初审",
  82. id: 2
  83. },
  84. {
  85. widthStr: "52px",
  86. key: "",
  87. label: "确认投保单",
  88. id: 3
  89. },
  90. {
  91. widthStr: "55px",
  92. key: "",
  93. label: "核心初审",
  94. id: 4
  95. },
  96. {
  97. widthStr: "",
  98. label: "支付完成",
  99. id: 5
  100. },
  101. // {
  102. // widthStr: "",
  103. // label: "签约,保函确认完成",
  104. // id: 6
  105. // },
  106. {
  107. widthStr: "68px",
  108. key: "",
  109. label: "核心终审",
  110. id: 7
  111. },
  112. {
  113. widthStr: "",
  114. key: "",
  115. label: "开具保函",
  116. id: 8
  117. }
  118. ]
  119. };
  120. },
  121. mounted() {},
  122. methods: {
  123. // 圆框
  124. getIcon(id) {
  125. // 选中
  126. if (id == this.indexNum) {
  127. return "step_icon_cur";
  128. }
  129. // 未完成
  130. if (id > this.indexNum) {
  131. return "step_icon_mo";
  132. }
  133. // 已完成
  134. if (id < this.indexNum) {
  135. return "step_icon_active";
  136. }
  137. },
  138. // 文字
  139. getText(id) {
  140. // 选中
  141. if (id == this.indexNum) {
  142. return "start_cur";
  143. }
  144. // 未完成
  145. if (id > this.indexNum) {
  146. return "start_mo";
  147. }
  148. // 已完成
  149. if (id < this.indexNum) {
  150. return "start_active";
  151. }
  152. },
  153. // 边框
  154. getBorder(id) {
  155. // 已完成
  156. if (id < this.indexNum) {
  157. return "step_active_border";
  158. } else {
  159. return "step_mo_border";
  160. }
  161. },
  162. getBorderPay(id) {
  163. if (id == this.indexNum || id < this.indexNum) {
  164. return "pay_step_active_border";
  165. } else {
  166. return "";
  167. }
  168. }
  169. }
  170. };
  171. </script>
  172. <style lang="scss" scoped>
  173. .step {
  174. width: 100%;
  175. padding: 50px;
  176. display: flex;
  177. margin-top: 60px;
  178. // 已完成
  179. #step_icon_active {
  180. background: url("~@/assets/images/step.png") no-repeat;
  181. background-position: center;
  182. background-size: cover;
  183. color: none !important;
  184. }
  185. // 选中
  186. #step_icon_cur {
  187. width: 36px;
  188. height: 36px;
  189. background: #0570ff;
  190. border-radius: 50%;
  191. font-size: 16px;
  192. font-family: Helvetica Neue-Regular, Helvetica Neue;
  193. font-weight: 400;
  194. color: #ffffff;
  195. text-align: center;
  196. line-height: 36px;
  197. }
  198. // 未选中
  199. #step_icon_mo {
  200. width: 36px;
  201. height: 36px;
  202. border-radius: 50%;
  203. opacity: 1;
  204. font-size: 16px;
  205. font-family: Helvetica Neue-Regular, Helvetica Neue;
  206. font-weight: 400;
  207. text-align: center;
  208. line-height: 36px;
  209. color: #999999;
  210. border: 1px solid #dcdde6;
  211. }
  212. // 已完成
  213. .start_active {
  214. font-size: 16px;
  215. font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  216. font-weight: 400;
  217. color: #333333;
  218. }
  219. // 选中
  220. .start_cur {
  221. font-size: 16px;
  222. font-family: Microsoft YaHei-Bold, Microsoft YaHei;
  223. font-weight: bold;
  224. color: #333333;
  225. }
  226. // 未选中
  227. .start_mo {
  228. font-size: 16px;
  229. font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  230. font-weight: 400;
  231. color: #999999;
  232. }
  233. .step_time {
  234. font-size: 12px;
  235. font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  236. font-weight: 400;
  237. color: #999999;
  238. margin-top: 7px;
  239. }
  240. .step_box {
  241. display: flex;
  242. width: 200px;
  243. position: relative;
  244. margin-right: 10px;
  245. .step_icon {
  246. width: 36px;
  247. height: 36px;
  248. margin-right: 16px;
  249. }
  250. .step_text {
  251. padding-top: 8px;
  252. }
  253. // 选中的border
  254. .step_active_border {
  255. width: var(--myColor1);
  256. height: 1px;
  257. border: 1px solid #0570ff;
  258. position: absolute;
  259. right: 0px;
  260. top: 15px;
  261. }
  262. // 未选中的border
  263. .step_mo_border {
  264. width: var(--myColor1);
  265. height: 1px;
  266. border: 1px solid #dcdde6;
  267. position: absolute;
  268. right: 0px;
  269. top: 15px;
  270. }
  271. }
  272. .step_boxs {
  273. width: 330px;
  274. height: 140px;
  275. position: relative;
  276. .pay_ing {
  277. width: 50px;
  278. height: 0px;
  279. opacity: 1;
  280. border: 1px solid #dcdde6;
  281. position: absolute;
  282. top: 17px;
  283. right: 10px;
  284. }
  285. #pay_ing {
  286. border: 1px solid #0570ff;
  287. }
  288. .step_box_list {
  289. position: absolute;
  290. top: -53px;
  291. left: -11px;
  292. .pay_step {
  293. width: 36px;
  294. height: 36px;
  295. }
  296. .border_pan {
  297. display: block;
  298. position: absolute;
  299. top: 0;
  300. right: 0;
  301. width: 46px;
  302. height: 70px;
  303. .top_wc {
  304. width: 200px;
  305. position: absolute;
  306. left: 55px;
  307. top: -17px;
  308. display: flex;
  309. }
  310. }
  311. .pay_text {
  312. margin-left: 16px;
  313. }
  314. .border_span {
  315. display: block;
  316. position: absolute;
  317. top: 70px;
  318. right: 0;
  319. width: 46px;
  320. height: 70px;
  321. .top_qy {
  322. width: 200px;
  323. position: absolute;
  324. left: 55px;
  325. bottom: -17px;
  326. display: flex;
  327. }
  328. }
  329. .top_left {
  330. top: 1px;
  331. left: 1px;
  332. border-top: 2px solid #dcdde6;
  333. border-left: 2px solid #dcdde6;
  334. border-top-left-radius: 22px;
  335. }
  336. .bom_left {
  337. bottom: 1px;
  338. left: 1px;
  339. border-bottom: 2px solid #dcdde6;
  340. border-left: 2px solid #dcdde6;
  341. border-bottom-left-radius: 22px;
  342. }
  343. #pay_step_active_border {
  344. // border-top: 2px solid #0570ff;
  345. // border-left: 2px solid #0570ff;
  346. border-color: #0570ff;
  347. }
  348. }
  349. }
  350. }
  351. </style>

 

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

闽ICP备14008679号