index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view>
  3. <u-navbar title="兑奖" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
  4. <view class="process">
  5. <view class="flex box-wrap">
  6. <view class="flex box">
  7. <image :src="picUrlArr[0]" mode=""></image>
  8. <view class="box-title">
  9. <view class="txt">{{ info.title }}</view>
  10. <view class="id">序列号:{{ info.serialNo }}</view>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="flex btn-wrap">
  15. <view class="btn" @click="toChoice">立即刮开兑奖</view>
  16. <view class="btn" @click="put">暂不兑奖</view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import env from '../../config/env.js'
  23. import $http from '@/utils/request.js'
  24. export default {
  25. data() {
  26. return {
  27. id: '',
  28. info: {},
  29. picUrlArr: []
  30. };
  31. },
  32. onLoad(options) {
  33. this.id = options.id
  34. this.getDetail()
  35. },
  36. methods: {
  37. getDetail() {
  38. uni.showLoading({
  39. title: '加载中'
  40. });
  41. $http.post('/api/v1/mp/user/ticket/query', {
  42. orderId: this.id,
  43. }).then(res => {
  44. uni.hideLoading();
  45. if (res.code == 0) {
  46. this.info = res.data
  47. let picUrlArr = res.data.picUrl.split(',')
  48. picUrlArr.forEach(item => {
  49. this.picUrlArr.push(env.filePublic + item)
  50. })
  51. }
  52. }).catch(() => {
  53. uni.hideLoading();
  54. })
  55. },
  56. put() {
  57. uni.navigateBack({
  58. delta: 1
  59. })
  60. },
  61. toChoice() {
  62. uni.redirectTo({
  63. url: `/pages/choice/index?id=${ this.info.ticketId }`
  64. })
  65. },
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .process {
  71. width: 100%;
  72. min-height: calc(100vh - 44px - var(--status-bar-height));
  73. background: url(https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/background.png) center center;
  74. }
  75. .box-wrap {
  76. padding: 140rpx 0 120rpx;
  77. .box {
  78. flex-direction: column;
  79. justify-content: flex-start;
  80. position: relative;
  81. width: 540rpx;
  82. height: 820rpx;
  83. background-color: rgba(255, 255, 255, 0.75);
  84. border-radius: 10rpx;
  85. image {
  86. width: 480rpx;
  87. height: 630rpx;
  88. padding-top: 40rpx;
  89. }
  90. &-title {
  91. margin-top: 20rpx;
  92. .txt {
  93. text-align: center;
  94. font-size: 36rpx;
  95. font-weight: bold;
  96. line-height: 50rpx;
  97. margin-bottom: 16rpx;
  98. }
  99. .id {
  100. line-height: 40rpx;
  101. text-align: center;
  102. color: #888787;
  103. }
  104. }
  105. }
  106. }
  107. .btn-wrap {
  108. flex-direction: column;
  109. .btn {
  110. width: 400rpx;
  111. height: 80rpx;
  112. font-size: 36rpx;
  113. line-height: 80rpx;
  114. border-radius: 20rpx;
  115. background-color: rgba(235, 112, 9, 100);
  116. color: #FFFFFF;
  117. text-align: center;
  118. margin-bottom: 40rpx;
  119. }
  120. .btn:last-child {
  121. background-color: #FFFFFF;
  122. color: rgba(235, 112, 9, 100);
  123. border: 1px solid rgba(235, 112, 9, 100);
  124. }
  125. }
  126. </style>