details.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view>
  3. <view class="top">
  4. <view class="blessing">
  5. {{hong_bao_detail.msg}}
  6. </view>
  7. <view class="money" v-if="user_get.money">
  8. {{user_get.money}}
  9. </view>
  10. <view class="face" :style="{'border-radius':radius}">
  11. <image :src="staticPhoto + own_user_info.face" :lazy-load="true"></image>
  12. </view>
  13. <view class="username">
  14. {{own_user_info.nickname}}的红包
  15. </view>
  16. </view>
  17. <view class="info">
  18. 已领取{{hong_bao_detail.number - hong_bao_detail.sy_number}}/{{hong_bao_detail.number }}个,共{{(hong_bao_detail.money - hong_bao_detail.sy_money).toFixed(2)}}/{{hong_bao_detail.money}}元
  19. </view>
  20. <view class="list">
  21. <view class="row" v-for="(row,index) in list" :key="index">
  22. <view class="left">
  23. <image :src="staticPhoto+row.user_info.face"></image>
  24. </view>
  25. <view class="right">
  26. <view class="r1">
  27. <view class="username">
  28. {{row.user_info.username}}
  29. </view>
  30. <view class="money">
  31. {{row.money}}元
  32. </view>
  33. </view>
  34. <view class="r2">
  35. <view class="time">
  36. {{row.time}}
  37. </view>
  38. <view class="lucky" v-if="row.is_best">
  39. 手气王
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import _get from '../../../common/_get';
  49. import _hook from '../../../common/_hook';
  50. import _data from '../../../common/_data';
  51. export default {
  52. data() {
  53. return {
  54. hong_bao_detail:{},
  55. user_get:{},
  56. own_user_info:{},
  57. list:{},
  58. blessing:"恭喜发财",
  59. money:0.01,
  60. username:"大黑哥",
  61. receivedNumber:8,
  62. SumNumber:10,
  63. receivedMoney:5.43,
  64. SumMoney:10,
  65. receivedList:[
  66. {username:"大黑哥", face:"/static/img/im/face/face_6.jpg",time:"2019-04-12 12:54:12",money:0.01,islucky:false},
  67. {username:"路人甲", face:"/static/img/im/face/face_5.jpg",time:"2019-04-12 12:54:13",money:1.82,islucky:true},
  68. {username:"高级黑", face:"/static/img/im/face/face_4.jpg",time:"2019-04-12 12:55:10",money:0.23,islucky:false},
  69. {username:"低级黑", face:"/static/img/im/face/face_3.jpg",time:"2019-04-12 12:56:10",money:0.56,islucky:false},
  70. {username:"大明哥", face:"/static/img/im/face/face_2.jpg",time:"2019-04-12 12:56:15",money:0.96,islucky:false},
  71. {username:"小姐姐", face:"/static/img/im/face/face_1.jpg",time:"2019-04-12 12:56:17",money:1.02,islucky:false},
  72. {username:"大哥哥", face:"/static/img/im/face/face_7.jpg",time:"2019-04-12 12:56:19",money:0.05,islucky:false},
  73. {username:"抢红包", face:"/static/img/im/face/face_8.jpg",time:"2019-04-12 12:56:22",money:0.78,islucky:false}
  74. ],
  75. //动画效果
  76. radius:'100% 100% 0 0',
  77. pageParams:{
  78. }
  79. };
  80. },
  81. computed:{
  82. staticPhoto() {
  83. return _data.staticPhoto();
  84. },
  85. },
  86. onShow(){
  87. let _this = this;
  88. _hook.routeSonHook();
  89. _get.getHongBaoDetail(_this.pageParams,function (res) {
  90. _this.list = res.list;
  91. _this.own_user_info = res.own_user_info;
  92. _this.hong_bao_detail = res.hong_bao_detail;
  93. _this.user_get = res.user_get;
  94. });
  95. },
  96. onLoad(options) {
  97. let _this = this;
  98. _this.pageParams = options
  99. },
  100. onPageScroll(e) {
  101. //e.scrollTop;
  102. if(e.scrollTop>100){return;}
  103. let radiusTmp = 100 - e.scrollTop;
  104. this.radius = radiusTmp+'% '+radiusTmp+'% 0 0';
  105. }
  106. }
  107. </script>
  108. <style lang="scss">
  109. view{
  110. display: flex;
  111. flex-wrap: wrap;
  112. }
  113. .top{
  114. width: 100%;
  115. background-color: #cf3c35;
  116. flex-wrap: wrap;
  117. .blessing,.money{
  118. width: 100%;
  119. color: #f8d757;
  120. padding: 20upx 0;
  121. justify-content: center;
  122. font-size: 34upx;
  123. }
  124. .money{
  125. font-size: 100upx;
  126. }
  127. .face{
  128. background-color: #fff;
  129. justify-content: center;
  130. width: 100%;
  131. height: 130upx;
  132. margin-top: 65upx;
  133. border-radius: 100% 100% 0 0;
  134. transition: border-radius .15s;
  135. image{
  136. width: 130upx;
  137. height: 130upx;
  138. border-radius: 100%;
  139. margin-top: -65upx;
  140. }
  141. }
  142. .username{
  143. width: 100%;
  144. justify-content: center;
  145. background-color: #fff;
  146. margin-top: -50upx;
  147. font-size: 38upx;
  148. }
  149. }
  150. .info{
  151. margin-top: 30upx;
  152. width: 96%;
  153. height: 50upx;
  154. padding-left: 4%;
  155. font-size: 28upx;
  156. color: #999;
  157. border-bottom: solid 1upx #dfdfdf;
  158. }
  159. .list{
  160. width: 100%;
  161. .row{
  162. width: 92%;
  163. padding: 0 4%;
  164. height: 120upx;
  165. border-bottom: solid 1upx #dfdfdf;
  166. justify-content:flex-start;
  167. flex-wrap: nowrap;
  168. .left{
  169. flex-shrink: 0;
  170. width: 100upx;
  171. height: 120upx;
  172. justify-content: flex-start;
  173. align-items: center;
  174. image{
  175. width: 80upx;
  176. height: 80upx;
  177. border-radius: 100%;
  178. }
  179. }
  180. .right{
  181. width: 100%;
  182. height: 150upx;
  183. .r1{
  184. width: 100%;
  185. height: 75upx;
  186. justify-content: space-between;
  187. align-items: center;
  188. font-size: 34upx;
  189. }
  190. .r2{
  191. width: 100%;
  192. height: 75upx;
  193. justify-content: space-between;
  194. font-size: 26upx;
  195. .time{
  196. color: #8F8F94;
  197. }
  198. .lucky{
  199. padding: 3upx 8upx;
  200. border-radius: 5upx;
  201. background-color: #F8D757;
  202. align-items: center;
  203. height: 30upx;
  204. font-size: 24upx;
  205. color: #CF3C35;
  206. }
  207. }
  208. }
  209. }
  210. }
  211. </style>