detail.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <view class="app-container">
  3. <u-navbar
  4. title="订单详情"
  5. bgColor="#01DCEA"
  6. :fixed="true"
  7. :autoBack="false"
  8. :titleStyle="{color: '#fff'}"
  9. leftIconColor="#fff"
  10. leftIconSize="28"
  11. @leftClick="handleLeftClick"
  12. >
  13. </u-navbar>
  14. <view class="app-container-item flex-column-center">
  15. <view class="top-ticket flex-between">
  16. <view class="title">{{ detailInfo.state | matchState}}</view>
  17. <view class="btn" v-if="detailInfo.state == '2' || detailInfo.state == '3'" @click="toTicketDetails">
  18. <text class="iconfont icon-ticket"
  19. style="font-size: 14px;margin-right: 5px"></text>
  20. 查看票夹
  21. </view>
  22. </view>
  23. <view class="item-card">
  24. <view style="color: #1D2633;font-size: 20px;font-weight: bold;margin-bottom: 15px">
  25. {{detailInfo.title}}
  26. </view>
  27. <view class="time flex-between">
  28. <view style="background: #E7F9FD;color: #2ABED2;padding: 2px 12px;border-radius: 14px">
  29. 时间<text style="margin-left: 20px">{{ detailInfo.date }} {{ detailInfo.openStartTime }}-{{ detailInfo.openEndTime }}</text>
  30. </view>
  31. <text style="color: #7B7F86;font-size: 13px">
  32. 共{{detailInfo.swiperItem && detailInfo.swiperItem.length}}张
  33. </text>
  34. </view>
  35. </view>
  36. <view class="item-card">
  37. <text style="font-size: 16px;font-weight: bold">游玩人</text>
  38. <view class="id-card">
  39. <view class="id-card_item" v-for="(item,index) in detailInfo.swiperItem" :key="index">
  40. <text>{{ item.username }}</text>
  41. <text>【身份证】{{ item.idNumber }}</text>
  42. </view>
  43. </view>
  44. <text style="font-size: 16px;font-weight: bold">联系方式</text>
  45. <view class="id-card">
  46. <view class="id-card_item">
  47. <text>18322568765</text>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="item-card">
  52. <text v-if="detailInfo.state == '1' || detailInfo.state == '2' || detailInfo.state == '3'" style="font-size: 16px;font-weight: bold">订单服务</text>
  53. <view class="service-card flex-between" v-if="detailInfo.state == '1' || detailInfo.state == '2' || detailInfo.state == '3'" >
  54. <view class="service-card_item">
  55. <text class="iconfont icon-refund-ticket"
  56. style="font-size: 18px;margin-right: 5px;color: #01DCEA"></text>{{detailInfo.state == '3'?'当前退票服务已停止':'订单退票'}}
  57. </view>
  58. <view class="service-card_item" v-if="detailInfo.state == '1' || detailInfo.state == '2'" @click="handleRefundTicket">去申请</view>
  59. </view>
  60. <text style="font-size: 16px;font-weight: bold">订单信息</text>
  61. <view class="order-card">
  62. <view class="order-card_item">
  63. <text>订单编号:L240516144032021</text>
  64. <text>创建时间:2024-05-16 14:40:32</text>
  65. <text v-if="detailInfo.state == '4'">退票时间:2024-05-16 14:40:32</text>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <u-modal closeOnClickOverlay :show="ticketModal.show" :title="ticketModal.title">
  71. <view style="color: #333333;font-size: 18px;font-weight: 500">
  72. 确定提交退票申请吗?
  73. </view>
  74. <template #confirmButton>
  75. <view class="modal_btn flex-between">
  76. <view class="modal_btn_cancel" @click="onClose">
  77. 取消
  78. </view>
  79. <view class="modal_btn_ok" @click="onConfirm">
  80. 确定
  81. </view>
  82. </view>
  83. </template>
  84. </u-modal>
  85. </view>
  86. </template>
  87. <script>
  88. export default {
  89. components: {},
  90. data() {
  91. return {
  92. ticketModal: {
  93. show: false,
  94. title: '',
  95. },
  96. userInfo: {},
  97. detailInfo: {},
  98. loading: true,
  99. isLogin: true,
  100. picUrl: this.$require,
  101. content: `<p>1、票型有效期:仅限游玩当日有效。</p> <p>2、检票方式:刷脸(开通快速入园后)、刷 身份证(原件)、刷二维码或现场手输身份证号入园。</p> <p>3、退改规则:一经检票,不得退票。</p> <p>4、实名制一证一票。门票仅限入园1次,不可重复入园。</p> <p>5、禁止携带宠物入园。</p>`
  102. };
  103. },
  104. filters: {
  105. matchState(code) {
  106. switch (code) {
  107. case 1:
  108. return '未出票';
  109. case 2:
  110. return '已出票';
  111. case 3:
  112. return '已结束';
  113. case 4:
  114. return '已退票';
  115. }
  116. }
  117. },
  118. onLoad(options) {
  119. this.detailInfo = {
  120. ...JSON.parse(options.info),
  121. // 轮播图 二维码区域
  122. swiperItem: [{
  123. username: '刘琳琳',
  124. // 姓名
  125. idNumber: '430822199903010465',
  126. // 身份证号
  127. avatar: '',
  128. qrCodeUrl: '',
  129. isQuickEntry: false,
  130. isUse: false // 是否使用
  131. }, {
  132. username: '刘琳X',
  133. // 姓名
  134. idNumber: '430822199903010464',
  135. // 身份证号
  136. avatar: '',
  137. qrCodeUrl: '',
  138. isQuickEntry: true,
  139. isUse: false // 是否使用
  140. }, {
  141. username: '刘琳Y',
  142. // 姓名
  143. idNumber: '430822199903010463',
  144. // 身份证号
  145. avatar: '',
  146. qrCodeUrl: '',
  147. isQuickEntry: false,
  148. isUse: false // 是否使用
  149. }]
  150. };
  151. console.log('onLoad', this.detailInfo)
  152. },
  153. onShow() {
  154. this.userInfo = uni.getStorageSync('userInfo')
  155. this.userInfo = {
  156. ...this.userInfo,
  157. phone: '18322568765'
  158. };
  159. // this.isLogin = this.userInfo.username ? true : false;
  160. },
  161. methods: {
  162. toTicketDetails() {
  163. uni.navigateTo({
  164. url: '/pages/ticket/detail?info=' + JSON.stringify(this.detailInfo)
  165. });
  166. },
  167. handleLeftClick() {
  168. //获取页面栈的长度
  169. const canNavBack = getCurrentPages()
  170. //判断是否刷新了浏览器,刷新了浏览器,页面栈只有当前一个
  171. if (canNavBack && canNavBack.length > 1) {
  172. uni.navigateBack({
  173. delta: 1
  174. })
  175. } else {
  176. history.back()
  177. }
  178. },
  179. getGuideInfo() {
  180. // this.isLogin = true;
  181. },
  182. /**
  183. * 退票申请
  184. */
  185. handleRefundTicket() {
  186. this.ticketModal.show = true;
  187. },
  188. onClose() {
  189. this.ticketModal.show = false;
  190. },
  191. onConfirm() {
  192. this.ticketModal.show = false;
  193. }
  194. }
  195. };
  196. </script>
  197. <style lang="scss" scoped>
  198. .app-container {
  199. width: 100vw;
  200. position: relative;
  201. height: 100vh;
  202. &-item {
  203. position: absolute;
  204. top: 44px;
  205. width: 100%;
  206. .top-ticket {
  207. background: #01DCEA;
  208. height: 80px;
  209. width: 100%;
  210. padding: 0 20px;
  211. box-sizing: border-box;
  212. .title {
  213. color: #fff;
  214. font-size: 24px;
  215. font-weight: bold;
  216. }
  217. .btn {
  218. padding: 4px 16px;
  219. background: #fff;
  220. font-size: 14px;
  221. border-radius: 16px;
  222. color: #00B6CE;
  223. }
  224. }
  225. .item-card {
  226. background: #fff;
  227. color: #333;
  228. box-sizing: border-box;
  229. padding: 15px 10px;
  230. border-radius: 8px;
  231. width: calc(100vw - 30px);
  232. margin-top: 15px;
  233. .id-card{
  234. //height: 50px;
  235. &_item {
  236. display: flex;
  237. flex-direction: column;
  238. padding: 10px 20px;
  239. font-size: 14px;
  240. color: #333333;
  241. text {
  242. height: 26px;
  243. line-height: 26px;
  244. }
  245. &:not(:last-child) {
  246. border-bottom: 1px solid #EDF1F6;
  247. }
  248. }
  249. }
  250. .service-card{
  251. //height: 50px;
  252. &_item {
  253. display: flex;
  254. flex-direction: row;
  255. justify-content: center;
  256. align-items: flex-end;
  257. padding: 10px 20px;
  258. font-size: 14px;
  259. color: #333333;
  260. text {
  261. height: 26px;
  262. line-height: 26px;
  263. }
  264. &:nth-child(2) {
  265. border: 1px solid #E7EBF4;
  266. padding: 2px 16px;
  267. border-radius: 14px;
  268. color: #636B85;
  269. }
  270. }
  271. }
  272. .order-card{
  273. //height: 50px;
  274. &_item {
  275. display: flex;
  276. flex-direction: column;
  277. padding: 10px 20px;
  278. font-size: 14px;
  279. color: #7B7F86;
  280. text {
  281. height: 26px;
  282. line-height: 26px;
  283. }
  284. }
  285. }
  286. }
  287. }
  288. }
  289. .modal_btn {
  290. &_cancel {
  291. height: 44px;
  292. line-height: 44px;
  293. border-radius: 4px;
  294. background: #fff;
  295. color: #01DCEA;
  296. width: calc((100% - 20px) / 2);
  297. border: 1px solid #01DCEA;
  298. text-align: center;
  299. }
  300. &_ok {
  301. height: 44px;
  302. line-height: 44px;
  303. border-radius: 4px;
  304. color: #fff;
  305. background: #01DCEA;
  306. width: calc((100% - 10px) / 2);
  307. border: 1px solid #01DCEA;
  308. text-align: center;
  309. }
  310. }
  311. </style>