You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

182 lines
3.6 KiB

9 months ago
  1. <!-- 抽奖弹框 -->
  2. <template>
  3. <view class="prizeDraw">
  4. <uni-popup ref="popup">
  5. <view class="popup-content">
  6. <view class="title">{{ $t('page.prizeDraw.title') }}</view>
  7. <view class="project">
  8. <view class="img-box">
  9. <image :src="orderInfo.image" mode="widthFix"></image>
  10. </view>
  11. <view class="project-base">
  12. <view class="project-name">{{ orderInfo.subTitle }}</view>
  13. </view>
  14. </view>
  15. <view class="todoy-info">
  16. <view class="todoy-info-main">
  17. <view class="today-info-l">
  18. <view class="today-income">{{ $t('page.prizeDraw.recharge') }}</view>
  19. <div class="money">
  20. <text class="number">{{ orderInfo.price }}</text>
  21. <text class="unit">{{ $t('page.prizeDraw.unit') }}</text>
  22. </div>
  23. </view>
  24. <div class="booking-info-r">
  25. <view class="booking-income">{{ $t('page.prizeDraw.commission') }}</view>
  26. <div class="booking-data">
  27. <text class="number">{{ orderInfo.giveMoney + $t('page.prizeDraw.unit') }}</text>
  28. </div>
  29. </div>
  30. </view>
  31. </view>
  32. <view class="order-time">
  33. <view class="title">{{ $t('page.prizeDraw.time') }}</view>
  34. <div class="content">{{ orderInfo.createTime }}</div>
  35. </view>
  36. <view class="order-number">
  37. <div class="title">{{ $t('page.prizeDraw.number') }}</div>
  38. <div class="content">{{ orderInfo.id }}</div>
  39. </view>
  40. <div @click="orderPay" class="submit">{{ $t('page.prizeDraw.submit') }}</div>
  41. </view>
  42. </uni-popup>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. type: 'center',
  50. orderInfo : {},
  51. userInfo : {}, //用户信息
  52. }
  53. },
  54. methods: {
  55. toggle(order) {
  56. this.getUserInfo()
  57. this.orderInfo = order
  58. this.$refs.popup.open(this.type)
  59. },
  60. //用户点击确定按钮(创建订单)
  61. orderPay(){
  62. this.$emit('orderPay',this.orderInfo.id)
  63. },
  64. //获取用户信息
  65. getUserInfo() {
  66. this.request('userInfo').then(res => {
  67. if (res.code == 200) {
  68. this.userInfo = res.result.userInfo
  69. }
  70. })
  71. },
  72. //关闭
  73. close(){
  74. this.$refs.popup.close(this.type)
  75. }
  76. },
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .prizeDraw {
  81. .popup-content {
  82. width: 700rpx;
  83. margin: 0rpx auto;
  84. background: white;
  85. border-radius: 20rpx;
  86. box-sizing: border-box;
  87. padding: 20rpx;
  88. .title {
  89. font-size: 32rpx;
  90. }
  91. .project {
  92. display: flex;
  93. align-items: center;
  94. flex-wrap: wrap;
  95. min-height: 150rpx;
  96. .img-box {
  97. width: 25%;
  98. margin-right: 2%;
  99. image {
  100. width: 100%;
  101. }
  102. }
  103. .project-base {
  104. width: 73%;
  105. }
  106. }
  107. }
  108. .todoy-info {
  109. box-sizing: border-box;
  110. height: 140rpx;
  111. .todoy-info-main {
  112. display: flex;
  113. flex-wrap: wrap;
  114. height: 100%;
  115. // background-color: rgba(0, 208, 234, 0.1);
  116. border-radius: 20rpx;
  117. margin: 20rpx 0rpx;
  118. box-sizing: border-box;
  119. padding: 0rpx 30rpx;
  120. .today-info-l,
  121. .booking-info-r {
  122. display: flex;
  123. flex-direction: column;
  124. justify-content: center;
  125. width: 50%;
  126. font-size: 28rpx;
  127. .today-income,
  128. .booking-income {
  129. // color: #8e8e98;
  130. }
  131. .money,
  132. .booking-data {
  133. font-weight: bold;
  134. margin-top: 10rpx;
  135. }
  136. }
  137. }
  138. }
  139. .order-time,
  140. .order-number {
  141. display: flex;
  142. justify-content: space-between;
  143. margin-top: 30rpx;
  144. font-size: 30rpx;
  145. }
  146. .submit{
  147. height: 80rpx;
  148. border-radius: 100rpx;
  149. background-color: #f33;
  150. color: white;
  151. font-size: 30rpx;
  152. display: flex;
  153. justify-content: center;
  154. align-items: center;
  155. margin-top: 30rpx;
  156. }
  157. }
  158. </style>