sudoku.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view class="box">
  3. <view class="lottery-box">
  4. <navigator class="my-list" url="/cloud/winningNews/index">
  5. 我的奖品
  6. </navigator>
  7. <image class="bg-image"
  8. src="https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202405281716860202553Be55ba55.webp" />
  9. <view class="lottery">
  10. <view>
  11. <LuckyGrid ref="myLucky" width="590rpx" height="590rpx" :prizes="prizes" :buttons="buttons"
  12. :defaultStyle="defaultStyle" @start="startCallBack" @end="endCallBack" />
  13. </view>
  14. </view>
  15. </view>
  16. <view class="winners-list">
  17. <image class="image"
  18. src="https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202405281716863577428B1faf5081.webp"
  19. mode="widthFix" />
  20. <view class="content">
  21. <view class="title">
  22. <view class="text">
  23. 抽奖名单
  24. </view>
  25. </view>
  26. <swiper class="swiper" autoplay easing-function="linear" interval="1000" duration="1000" circular vertical
  27. display-multiple-items="7">
  28. <swiper-item v-for="(item, index) in 20" :key="index">
  29. <view class="swiper-item u-line-2">
  30. {{ item }}df sdf 、
  31. </view>
  32. </swiper-item>
  33. </swiper>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import LuckyGrid from '@/components/@lucky-canvas/uni/lucky-grid'
  40. export default {
  41. components: { LuckyGrid },
  42. props: {
  43. sa_awardid: {
  44. type: [Number || String]
  45. },
  46. shareuserid: {
  47. type: [Number || String]
  48. }
  49. },
  50. data() {
  51. return {
  52. prizes: [
  53. { x: 0, y: 0, borderRadius: '20rpx' },
  54. { x: 2, y: 0, borderRadius: '20rpx' },
  55. { x: 0, y: 2, borderRadius: '20rpx' },
  56. { x: 2, y: 2, borderRadius: '20rpx' },
  57. { x: 1, y: 0, borderRadius: '20rpx' },
  58. { x: 2, y: 1, borderRadius: '20rpx' },
  59. { x: 1, y: 2, borderRadius: '20rpx' },
  60. { x: 0, y: 1, borderRadius: '20rpx' },
  61. ],
  62. buttons: [{
  63. background: 'rgba(0,0,0,0)',
  64. x: 1, y: 1,
  65. imgs: [{
  66. src: 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202405281716861339513B3a575413.webp',
  67. width: '183.34rpx',
  68. height: '183.34rpx',
  69. }],
  70. }],
  71. defaultStyle: {
  72. background: '#FFFFFF',
  73. width: '183.34rpx',
  74. height: '183.34rpx',
  75. },
  76. usableCount: 0,
  77. }
  78. },
  79. methods: {
  80. init() {
  81. console.log("this.sa_awardid", this.sa_awardid)
  82. this.$Http.basic({
  83. "id": 20240514131402,
  84. content: {
  85. "sa_awardid": this.sa_awardid,
  86. "where": {
  87. "condition": "",
  88. "type": ""
  89. }
  90. }
  91. }).then(res => {
  92. console.log("奖品列表", res)
  93. if (this.cutoff(res.msg)) return;
  94. })
  95. this.$Http.basic({
  96. "classname": "sysmanage.develop.datafunction.datafunction",
  97. "method": "execute",
  98. "content": {
  99. "functionname": "queryAwardCount",
  100. "parameter": {
  101. "sa_awardid": this.sa_awardid
  102. }
  103. }
  104. }).then(res => {
  105. console.log("抽奖可用次数", res)
  106. if (this.cutoff(res.msg)) return;
  107. this.usableCount = res.data.length ? res.data[0].count : 0;
  108. })
  109. },
  110. startCallBack() {
  111. console.log("开始抽奖")
  112. this.$refs.myLucky.play()
  113. setTimeout(() => {
  114. // 假设后端返回的中奖索引是0
  115. const index = 0
  116. // 调用stop停止旋转并传递中奖索引
  117. this.$refs.myLucky.stop(index)
  118. }, 3000)
  119. },
  120. endCallBack(prize) {
  121. console.log("抽到的奖品", prize)
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .box {
  128. width: 100vw;
  129. min-height: 100vh;
  130. background: linear-gradient(90deg, #FE5A46 0%, #F11F46 100%);
  131. .lottery-box {
  132. position: relative;
  133. width: 100vw;
  134. height: 511px;
  135. .my-list {
  136. position: absolute;
  137. top: 20px;
  138. left: 0;
  139. width: 86px;
  140. height: 40px;
  141. line-height: 40px;
  142. text-align: center;
  143. background: linear-gradient(180deg, #FAD96D 0%, #FFC300 4%, #FFCD2B 16%, #FFDF77 42%, #FFD241 70%, #FFC300 94%, #FC9228 100%);
  144. border-radius: 0px 20px 20px 0px;
  145. font-family: Source Han Sans SC, Source Han Sans SC;
  146. font-weight: bold;
  147. font-size: 14px;
  148. color: #C30D23;
  149. z-index: 2;
  150. }
  151. .bg-image {
  152. position: absolute;
  153. width: 100vw;
  154. height: 511px;
  155. top: 0;
  156. left: 0;
  157. z-index: 1;
  158. vertical-align: bottom;
  159. }
  160. .lottery {
  161. position: absolute;
  162. width: 100%;
  163. z-index: 2;
  164. top: 140px;
  165. }
  166. }
  167. .winners-list {
  168. width: 100vw;
  169. display: flex;
  170. flex-direction: column;
  171. align-items: center;
  172. padding-bottom: 20px;
  173. .image {
  174. width: 355px;
  175. }
  176. .title {
  177. position: relative;
  178. width: 80px;
  179. height: 29px;
  180. margin: 0 auto;
  181. .text {
  182. position: absolute;
  183. top: 0px;
  184. left: 0;
  185. width: 80px;
  186. line-height: 29px;
  187. text-align: center;
  188. font-family: Source Han Sans SC, Source Han Sans SC;
  189. font-weight: bold;
  190. font-size: 20px;
  191. color: #333333;
  192. z-index: 2;
  193. }
  194. }
  195. .title::after {
  196. content: '';
  197. position: absolute;
  198. bottom: 0px;
  199. left: 0;
  200. width: 80px;
  201. height: 8px;
  202. background: #FAD96D;
  203. border-radius: 5px;
  204. z-index: 1;
  205. }
  206. .content {
  207. background: #fff;
  208. padding: 0 15px 20px;
  209. width: 669.7672675rpx;
  210. box-sizing: border-box;
  211. .swiper {
  212. width: 100%;
  213. height: 300px;
  214. margin-top: 20px;
  215. .swiper-item {
  216. width: 100%;
  217. height: 40px;
  218. text-align: center;
  219. line-height: 20px;
  220. font-family: Source Han Sans SC, Source Han Sans SC;
  221. font-size: 14px;
  222. color: #666666;
  223. overflow: hidden;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. </style>