index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view>
  3. <u-navbar title="幸运数字" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
  4. <view class="lucky">
  5. <view class="lucky-number">
  6. <view class="flex lucky-number-circle">
  7. <view class="title">幸运数字</view>
  8. <view class="num" v-if="info.status == 1">?</view>
  9. <view class="">{{ info.plainLuckyNum }}</view>
  10. </view>
  11. </view>
  12. <view class="lucky-title">
  13. <view class="txt">{{ info.title }}</view>
  14. <view class="id">盲票序列号:{{ info.serialNo }}</view>
  15. </view>
  16. <view class="flex lucky-btn">
  17. <view class="pay" @click="pay">支付{{ info.facePrice / 100 }}元 立即查看</view>
  18. </view>
  19. </view>
  20. <pay-popup :pay-show="payShow" :pay-info="payInfo" @close="close" />
  21. </view>
  22. </template>
  23. <script>
  24. import env from '../../config/env.js'
  25. import $http from '@/utils/request.js'
  26. import PayPopup from '../../components/pay-popup/pay-popup.vue'
  27. export default {
  28. components:{
  29. PayPopup
  30. },
  31. data() {
  32. return {
  33. serialNo: '',
  34. info: '',
  35. payInfo: {},
  36. payShow: false
  37. };
  38. },
  39. onLoad(options) {
  40. this.serialNo = options.id
  41. this.getDetail()
  42. },
  43. methods: {
  44. getDetail() {
  45. $http.post('/api/v1/mp/user/ticket/queryLuckyNum', {
  46. serialNo: 'T2200044-0003-0000021',
  47. noToken: true
  48. }).then(res => {
  49. console.log(res);
  50. if (res.code == 0) {
  51. this.info = res.data
  52. }
  53. })
  54. },
  55. close() {
  56. this.payShow = false
  57. },
  58. pay(){
  59. let data = {
  60. couponIds: [],
  61. autoCoupon: 1,
  62. boxId: this.info.boxId,
  63. ticketId: this.info.ticketId,
  64. orderNum: 1
  65. }
  66. $http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
  67. console.log(res);
  68. if (res.code == 0) {
  69. let info = {
  70. ... res.data,
  71. picUrl: env.filePublic + picUrl,
  72. }
  73. this.payInfo = info
  74. this.payShow = true
  75. console.log(info);
  76. }
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .lucky {
  84. width: 100%;
  85. height: calc(100vh - 50px);
  86. background: url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic3.zhimg.com%2F50%2Fv2-a6f5c8b5b66fe87e4e79c1fc82a61a36_hd.jpg&refer=http%3A%2F%2Fpic3.zhimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1649658373&t=f216ee4825d5b36e62aa3a490516bfb1) center center;
  87. &-number {
  88. padding-top: 400rpx;
  89. &-circle{
  90. box-sizing: border-box;
  91. flex-direction: column;
  92. width: 336rpx;
  93. height: 336rpx;
  94. background-color: $uni-bg-color;
  95. border-radius: 50%;
  96. margin: auto;
  97. .title{
  98. margin-bottom: 20rpx;
  99. }
  100. .num{
  101. font-size: 100rpx;
  102. }
  103. }
  104. }
  105. &-title{
  106. margin-top: 40rpx;
  107. margin-bottom: 70rpx;
  108. .txt{
  109. text-align: center;
  110. font-size: 36rpx;
  111. font-weight: bold;
  112. line-height: 50rpx;
  113. margin-bottom: 8rpx;
  114. }
  115. .id{
  116. line-height: 40rpx;
  117. text-align: center;
  118. }
  119. }
  120. &-btn{
  121. .pay{
  122. width: 400rpx;
  123. height: 60rpx;
  124. line-height: 60rpx;
  125. border-radius: 8rpx;
  126. background-color: rgba(235, 112, 9, 100);
  127. color: #FFFFFF;
  128. text-align: center;
  129. }
  130. }
  131. }
  132. </style>