index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <view class="content">
  3. <u-navbar
  4. title="票夹"
  5. bgColor="#DCF9FF"
  6. :autoBack="false"
  7. :fixed="true"
  8. >
  9. <view slot="left"></view>
  10. </u-navbar>
  11. <!-- 曲面背景 -->
  12. <view class="ticket_bg">
  13. </view>
  14. <view class="ticket">
  15. <view class="now_ticket" v-for="data in ticketList" @click="toDetail(data)">
  16. <view class="flex-between" style="padding: 10px">
  17. <view class="info-left">
  18. <view class="item">
  19. <text style="font-size: 20px;color: #FFFFFF;font-weight: bold">{{data.title}}</text>
  20. <text style="font-size: 15px;color: #FFFFFFE5">
  21. {{ data.date }} {{ data.openStartTime }}-{{ data.openEndTime }}
  22. </text>
  23. </view>
  24. </view>
  25. <!-- <view :class="[data.state == 1 ? 'info-right-default' :(data.state == 2 ?'info-right' : 'info-right-gray'), 'flex']">
  26. <view class="circle flex">
  27. {{data.state | matchState}}
  28. </view>
  29. </view>-->
  30. </view>
  31. <view class="flex-between list-item__footer">
  32. <view class="item">
  33. <text style="font-size: 14px;color: #FFFFFFCC">共{{data.ticketNum}}张</text>
  34. </view>
  35. <view class="item">
  36. <text style="font-size: 14px;color: #FFFFFFCC;margin-right: 10px">未检票 {{ data.ticketNum - data.checkedTickets }}</text>
  37. <text style="font-size: 14px;color: #FFFFFFCC">已检票 {{ data.checkedTickets }}</text>
  38. </view>
  39. </view>
  40. </view>
  41. <text style="color: #333333;padding: 0px 15px;box-sizing: border-box;display: inline-block;margin-top: 15px;">历史票</text>
  42. <view class="list-item" v-for="data in dataList" @click="toDetail(data)">
  43. <view class="flex-between" style="padding: 10px">
  44. <view class="info-left">
  45. <view class="item">
  46. <text style="font-size: 20px;color: #222222;font-weight: bold">{{data.title}}</text>
  47. <text style="font-size: 15px;color: #606266">
  48. {{ data.date }} {{ data.openStartTime }}-{{ data.openEndTime }}
  49. </text>
  50. </view>
  51. </view>
  52. <view :class="[data.state == 1 ? 'info-right-default' :(data.state == 2 ?'info-right' : 'info-right-gray'), 'flex']">
  53. <view class="circle flex">
  54. {{data.state | matchState}}
  55. </view>
  56. </view>
  57. </view>
  58. <view class="flex-between list-item__footer">
  59. <view class="item">
  60. <text style="font-size: 14px;color: #7B7F86">共{{data.ticketNum}}张</text>
  61. </view>
  62. <view class="item">
  63. <text style="font-size: 14px;color: #7B7F86;margin-right: 10px">未检票 {{ data.ticketNum - data.checkedTickets }}</text>
  64. <text style="font-size: 14px;color: #7B7F86">已检票 {{ data.checkedTickets }}</text>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. export default {
  73. components: {},
  74. data() {
  75. return {
  76. userInfo: {},
  77. ticketList: [
  78. {
  79. title: '兰花街1、2、3',
  80. date: '2024.05.08',
  81. openStartTime: '08:00',
  82. openEndTime: '20:00',
  83. state: 2,
  84. ticketState: 3,
  85. ticketNum: 3,
  86. checkedTickets: 0
  87. }
  88. ],
  89. dataList: [
  90. {
  91. title: '兰花街1、2、3',
  92. date: '2024.05.08',
  93. openStartTime: '08:00',
  94. openEndTime: '20:00',
  95. state: 3,
  96. ticketState: 1,
  97. ticketNum: 2,
  98. checkedTickets: 1
  99. },
  100. {
  101. title: '兰花街1、2、3',
  102. date: '2024.05.08',
  103. openStartTime: '08:00',
  104. openEndTime: '20:00',
  105. state: 4,
  106. ticketState: 2,
  107. ticketNum: 1,
  108. checkedTickets: 1
  109. }
  110. ],
  111. };
  112. },
  113. filters: {
  114. matchState(code) {
  115. switch (code) {
  116. case 1:
  117. return '未出票';
  118. case 2:
  119. return '已出票';
  120. case 3:
  121. return '已结束';
  122. case 4:
  123. return '已退票';
  124. }
  125. }
  126. },
  127. onLoad() {
  128. console.log('onLoad')
  129. },
  130. onShow() {
  131. console.log('onShow');
  132. this.userInfo = uni.getStorageSync('userInfo')
  133. this.userInfo = {
  134. ...this.userInfo,
  135. phone: '18322568765'
  136. };
  137. // this.isLogin = this.userInfo.username ? true : false;
  138. console.log('onShow', this.isLogin, 'XXX');
  139. },
  140. methods: {
  141. toDetail(item) {
  142. console.log('toDetail', item)
  143. uni.navigateTo({
  144. url: '/pages/ticket/detail?info=' + JSON.stringify(item)
  145. });
  146. },
  147. }
  148. };
  149. </script>
  150. <style lang="scss" scoped>
  151. .content {
  152. width: 100vw;
  153. background: rgba(243, 244, 246, 1);
  154. //overflow: hidden;
  155. position: relative;
  156. .ticket {
  157. width: 100%;
  158. top: 64px;
  159. position: relative;
  160. &_bg {
  161. position: absolute;
  162. top: 44px;
  163. z-index: 0;
  164. width: 100%;
  165. height: 130px;
  166. overflow: hidden;
  167. &::after {
  168. content: '';
  169. position: absolute;
  170. width: 160%;
  171. height: 100%;
  172. background: linear-gradient(179.48deg, #DCF9FF 0.45%, rgba(207, 254, 242, 0) 99.55%);
  173. left: -30%;
  174. border-radius: 0 0 50% 50%;
  175. }
  176. }
  177. .now_ticket {
  178. margin-top: 10px;
  179. //height: 120px;
  180. width: calc(100% - 30px);
  181. margin-left: 15px;
  182. border-radius: 8px;
  183. //box-shadow: 0px 0px 8px 0px #D2DBEE80;
  184. font-size: 16px;
  185. box-sizing: border-box;
  186. overflow: hidden;
  187. background: radial-gradient(circle at left 90px, transparent 5px, #01DCEA 0,#01DCEA 100%) left top / 50% 100% no-repeat,
  188. radial-gradient(circle at right 90px, transparent 5px, #01DCEA 0,#01DCEA 100%) right top / 50% 100% no-repeat !important;
  189. filter: drop-shadow(3px 0px 6px #56A0CA29);
  190. &__footer {
  191. height: 40px;
  192. //padding: 0 20px;
  193. box-sizing: border-box;
  194. position: relative;
  195. width: calc(100% - 20px);
  196. margin-left: 10px;
  197. &:before {
  198. content: '';
  199. position: absolute;
  200. //border-top: 2px dashed transparent; /* 虚线的颜色和宽度 */
  201. background: linear-gradient(transparent,transparent) padding-box,
  202. repeating-linear-gradient(90deg,#FFFFFF80 0, #FFFFFF80 8px,transparent 0,transparent 13px);
  203. width: 100%;
  204. height: 2px;
  205. top: 0;
  206. }
  207. }
  208. .info {
  209. &-left {
  210. height: 100%;
  211. display: flex;
  212. flex-direction: column;
  213. justify-content: center;
  214. width: calc(100% - 55px);
  215. min-height: 70px;
  216. .item {
  217. display: flex;
  218. flex-direction: column;
  219. }
  220. }
  221. }
  222. }
  223. .list-item {
  224. margin-top: 10px;
  225. //height: 120px;
  226. background: white;
  227. width: calc(100% - 30px);
  228. margin-left: 15px;
  229. border-radius: 8px;
  230. //box-shadow: 0px 0px 8px 0px #D2DBEE80;
  231. font-size: 16px;
  232. box-sizing: border-box;
  233. overflow: hidden;
  234. background: radial-gradient(circle at left 94px, transparent 5px, white 0,white 100%) left top / 50% 100% no-repeat,
  235. radial-gradient(circle at right 94px, transparent 5px, white 0,white 100%) right top / 50% 100% no-repeat;
  236. filter: drop-shadow(3px 0px 6px #56A0CA29);
  237. &__footer {
  238. height: 40px;
  239. //padding: 0 20px;
  240. box-sizing: border-box;
  241. position: relative;
  242. width: calc(100% - 20px);
  243. margin-left: 10px;
  244. &:before {
  245. content: '';
  246. position: absolute;
  247. //border-top: 2px dashed transparent; /* 虚线的颜色和宽度 */
  248. background: linear-gradient(transparent,transparent) padding-box,
  249. repeating-linear-gradient(90deg,#F3F4F6 0, #F3F4F6 8px,transparent 0,transparent 13px);
  250. width: 100%;
  251. height: 2px;
  252. top: 0;
  253. }
  254. }
  255. .info {
  256. &-left {
  257. height: 100%;
  258. display: flex;
  259. flex-direction: column;
  260. justify-content: center;
  261. width: calc(100% - 55px);
  262. min-height: 70px;
  263. .item {
  264. display: flex;
  265. flex-direction: column;
  266. }
  267. }
  268. &-right {
  269. width: 70px;
  270. height: 70px;
  271. background: #fff;
  272. border: 2.5px solid #D0F4FF;
  273. border-radius: 50%;
  274. .circle {
  275. width: 54px;
  276. height: 54px;
  277. background: #D0F4FF;
  278. border-radius: 50%;
  279. flex-shrink: 0;
  280. color: #48CEF9;
  281. display: flex;
  282. justify-content: center;
  283. align-items: center;
  284. transform: rotate(-15deg);
  285. font-size: 14px;
  286. }
  287. }
  288. &-right-default {
  289. width: 70px;
  290. height: 70px;
  291. background: #fff;
  292. border: 2.5px solid #E8F0FC;
  293. border-radius: 50%;
  294. .circle {
  295. width: 54px;
  296. height: 54px;
  297. background: #E8F0FC;
  298. border-radius: 50%;
  299. flex-shrink: 0;
  300. color: #A7B7D1;
  301. display: flex;
  302. justify-content: center;
  303. align-items: center;
  304. transform: rotate(-15deg);
  305. font-size: 14px;
  306. }
  307. }
  308. &-right-gray {
  309. width: 70px;
  310. height: 70px;
  311. background: #fff;
  312. border: 2.5px solid #EDF1F6;
  313. border-radius: 50%;
  314. .circle {
  315. width: 54px;
  316. height: 54px;
  317. background: #EDF1F6;
  318. border-radius: 50%;
  319. flex-shrink: 0;
  320. color: #B2BCCB;
  321. display: flex;
  322. justify-content: center;
  323. align-items: center;
  324. transform: rotate(-15deg);
  325. font-size: 14px;
  326. }
  327. }
  328. }
  329. }
  330. }
  331. }
  332. </style>