index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view>
  3. <!-- #ifdef MP-ALIPAY -->
  4. <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="购买成功" leftIconSize="0">
  5. </u-navbar>
  6. <!-- #endif -->
  7. <!-- #ifndef MP-ALIPAY -->
  8. <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="购买成功"></u-navbar>
  9. <!-- #endif -->
  10. <view class="purchase">
  11. <image class="imgOne" src="https://mp-public-test-1307117429.cos.ap-shanghai.myqcloud.com/v2/buy_suc.png"
  12. mode="scaleToFill"></image>
  13. <image class="imgTwo" :src="picUrl" mode="scaleToFill"></image>
  14. </view>
  15. <view class="package">
  16. <button @click="toProcess()">立即抽奖</button>
  17. <text>已购买的商品请稍后在“我的”-“仓库”中进行查看和提货</text>
  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. boxId: 0,
  28. orderId: 0,
  29. picUrl: '',
  30. }
  31. },
  32. onLoad(opthios) {
  33. this.boxId = opthios.boxId
  34. this.orderId = opthios.orderId
  35. this.getPicUrl()
  36. },
  37. methods: {
  38. getPicUrl() {
  39. $http.post('/api/v1/mp/user/mall/ticket/detail', {
  40. boxId: this.boxId,
  41. noToken: true
  42. }).then(res => {
  43. if (res.code == 0) {
  44. this.picUrl = env.filePublic + res.data.picUrl.split(',')[0]
  45. }
  46. })
  47. },
  48. // 线上立即刮票成功,跳转到刮奖过程
  49. toProcess() {
  50. uni.navigateTo({
  51. url: `/packagePrize/rolling/animation?boxId=${ this.boxId }&orderId=${ this.orderId }&isTry=0`
  52. })
  53. //线上抽奖动画
  54. // uni.navigateTo({
  55. // url: `/packagePrize/rolling/index?boxId=${ this.boxId }&orderId=${ this.orderId }&isTry=0`
  56. // })
  57. },
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .purchase {
  63. position: relative;
  64. padding-top: 100rpx;
  65. width: 592rpx;
  66. height: 788rpx;
  67. margin: 0 auto;
  68. .imgOne {
  69. width: 100%;
  70. height: 100%;
  71. }
  72. .imgTwo {
  73. z-index: 10;
  74. width: 100%;
  75. width: 520rpx;
  76. height: 430rpx;
  77. position: absolute;
  78. top: 320rpx;
  79. left: 36rpx;
  80. }
  81. }
  82. .package {
  83. margin-top: 100rpx;
  84. text-align: center;
  85. button {
  86. margin: 0 auto;
  87. width: 666rpx;
  88. height: 98rpx;
  89. background: linear-gradient(180deg, #FEA052 0%, #FF8D2F 100%);
  90. border-radius: 56rpx;
  91. color: #fff;
  92. }
  93. text {
  94. margin-top: 54rpx;
  95. display: inline-block;
  96. width: 570rpx;
  97. color: #666666;
  98. font-size: 26rpx;
  99. line-height: 32rpx;
  100. letter-spacing: 1px;
  101. }
  102. }
  103. </style>