startLottery-zkx.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <template>
  2. <div class="bgDiv">
  3. <el-container>
  4. <!-- <el-header style="height:150px">Header</el-header> -->
  5. <el-container>
  6. <el-aside width="720px" style="text-align:left;padding:0;">
  7. <div class="leftRegion leftRegionA ">
  8. <H1 style="text-align:center">抽奖活动</H1>
  9. <div class="leftMain">
  10. <el-form ref="form" :model="formModel" label-width="80px">
  11. <el-form-item label="活动">
  12. <el-select v-model="formModel.activityId" placeholder="请选择" style="width:420px"
  13. size="mini" @change="handleChange">
  14. <el-option v-for="item in activityList" :key="item.id" :label="item.name"
  15. :value="item.id">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="奖项">
  20. <el-select v-model="formModel.awardId" placeholder="请选择" style="width:160px"
  21. size="mini">
  22. <el-option v-for="item in awardInfoList" :key="item.id" :label="item.name"
  23. :value="item.id">
  24. <span style="float: left">{{ item.name }}</span>
  25. <span
  26. style="float: right; color: #8492a6; font-size: 13px">数量:{{ item.num }}</span>
  27. </el-option>
  28. </el-select>
  29. </el-form-item>
  30. </el-form>
  31. <div style="text-align:center">
  32. <span>
  33. <el-button type="primary" @click="handleSubmit"
  34. :loading="submitting">开始抽奖</el-button>
  35. <el-button>重新开始</el-button>
  36. </span>
  37. </div>
  38. <div class="imgDiv">
  39. <el-image style="width: 150px; height: 150px"
  40. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
  41. fit="fit">
  42. </el-image>
  43. </div>
  44. </div>
  45. </div>
  46. </el-aside>
  47. <el-main>
  48. <div class="leftRegion leftRegionB">
  49. <div style="text-align:center;margin-bottom:30px">中奖名单</div>
  50. <div style="width:100%;margin-top: 24px;">
  51. <span>一等奖:1人</span>
  52. <el-divider></el-divider>
  53. <div style="margin-bottom:30px;">
  54. <div class="imgText">
  55. <el-image style="width: 80px; height: 80px"
  56. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  57. <div style="font-size:12px">13588888888</div>
  58. </div>
  59. <div class="imgText">
  60. <el-image style="width: 80px; height: 80px"
  61. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  62. <div style="font-size:12px">13588888888</div>
  63. </div>
  64. </div>
  65. </div>
  66. <div style="width:100%;margin-top: 24px;">
  67. <span>一等奖:1人</span>
  68. <el-divider></el-divider>
  69. <div style="margin-bottom:30px;">
  70. <div class="imgText">
  71. <el-image style="width: 80px; height: 80px"
  72. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  73. <div style="font-size:12px">13588888888</div>
  74. </div>
  75. <div class="imgText">
  76. <el-image style="width: 80px; height: 80px"
  77. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  78. <div style="font-size:12px">13588888888</div>
  79. </div>
  80. </div>
  81. </div>
  82. <div style="width:100%;margin-top: 24px;">
  83. <span>一等奖:1人</span>
  84. <el-divider></el-divider>
  85. <div style="margin-bottom:30px;">
  86. <div class="imgText">
  87. <el-image style="width: 80px; height: 80px"
  88. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  89. <div style="font-size:12px">13588888888</div>
  90. </div>
  91. <div class="imgText">
  92. <el-image style="width: 80px; height: 80px"
  93. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  94. <div style="font-size:12px">13588888888</div>
  95. </div>
  96. <div class="imgText">
  97. <el-image style="width: 80px; height: 80px"
  98. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  99. <div style="font-size:12px">13588888888</div>
  100. </div>
  101. <div class="imgText">
  102. <el-image style="width: 80px; height: 80px"
  103. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  104. <div style="font-size:12px">13588888888</div>
  105. </div>
  106. <div class="imgText">
  107. <el-image style="width: 80px; height: 80px"
  108. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  109. <div style="font-size:12px">13588888888</div>
  110. </div>
  111. <div class="imgText">
  112. <el-image style="width: 80px; height: 80px"
  113. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  114. <div style="font-size:12px">13588888888</div>
  115. </div>
  116. <div class="imgText">
  117. <el-image style="width: 80px; height: 80px"
  118. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  119. <div style="font-size:12px">13588888888</div>
  120. </div>
  121. <div class="imgText">
  122. <el-image style="width: 80px; height: 80px"
  123. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  124. <div style="font-size:12px">13588888888</div>
  125. </div>
  126. <div class="imgText">
  127. <el-image style="width: 80px; height: 80px"
  128. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  129. <div style="font-size:12px">13588888888</div>
  130. </div>
  131. <div class="imgText">
  132. <el-image style="width: 80px; height: 80px"
  133. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  134. <div style="font-size:12px">13588888888</div>
  135. </div>
  136. <div class="imgText">
  137. <el-image style="width: 80px; height: 80px"
  138. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  139. <div style="font-size:12px">13588888888</div>
  140. </div>
  141. <div class="imgText">
  142. <el-image style="width: 80px; height: 80px"
  143. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  144. <div style="font-size:12px">13588888888</div>
  145. </div>
  146. <div class="imgText">
  147. <el-image style="width: 80px; height: 80px"
  148. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  149. <div style="font-size:12px">13588888888</div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. </el-main>
  155. </el-container>
  156. </el-container>
  157. <div v-show="submitting" class=" lotteryRegion" :class="{
  158. lotteryResultsNum:lotteryResultsNum,
  159. lotteryProcess: !lotteryResultsNum
  160. }">
  161. <div class="l-title">中奖结果</div>
  162. <div class="l-title2">中奖结果</div>
  163. <div class="l-results">
  164. <div class="l-imgText" v-for="(item,i) in lotteryResultsNum?20:1" :key="i">
  165. <el-image class="l-imgText-img"
  166. src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
  167. <div class="l-imgText-t" style="">135****8888</div>
  168. </div>
  169. </div>
  170. <div class="l-button-group">
  171. <el-button>重新开始</el-button>
  172. </div>
  173. </div>
  174. </div>
  175. </template>
  176. <script>
  177. import startLotteryApi from "@/api/business/startLottery";
  178. export default {
  179. data() {
  180. return {
  181. submitting: true,
  182. lotteryResultsNum: true, //抽奖人数 多 or 少
  183. formModel: {},
  184. activityList: [],
  185. awardInfoList: [],
  186. }
  187. },
  188. created() {
  189. var self = this;
  190. startLotteryApi.list().then(function(response) {
  191. var jsonData = response.data;
  192. if (jsonData.result) {
  193. if (jsonData.data != null && jsonData.data != "") {
  194. self.activityList = jsonData.data;
  195. }
  196. }
  197. });
  198. },
  199. methods: {
  200. handleChange(val) {
  201. var self = this;
  202. var formData = new FormData();
  203. formData.append("activityId", val);
  204. self.awardInfoList = [];
  205. startLotteryApi.findByActivityId(formData).then(function(response) {
  206. var jsonData = response.data;
  207. if (jsonData.result) {
  208. if (jsonData.data != null && jsonData.data != "") {
  209. self.awardInfoList = jsonData.data;
  210. }
  211. }
  212. });
  213. },
  214. handleSubmit() {
  215. }
  216. }
  217. }
  218. </script>
  219. <style lang="scss">
  220. /* lotteryRegion */
  221. .lotteryRegion {
  222. position: fixed;
  223. top: 50%;
  224. left: 50%;
  225. transform: translate(-50%, -50%);
  226. width: 800px;
  227. height: 720px;
  228. border-radius: 10px;
  229. background-color: rgba(0, 0, 0, 0.75);
  230. text-align: center;
  231. box-shadow: 0px 0px 6px 10px rgba(0, 0, 0, 0.15);
  232. border: 3px solid rgba(255, 255, 255, 1);
  233. padding: 40px;
  234. }
  235. .l-title {
  236. font-size: 36px;
  237. }
  238. .l-title2 {
  239. font-size: 24px;
  240. }
  241. .l-results {
  242. margin-top: 72px;
  243. }
  244. .l-imgText {
  245. //margin: 0 32px 32px 0 ;
  246. }
  247. //大图
  248. .lotteryProcess {
  249. .l-imgText-img {
  250. width: 240px;
  251. height: 240px
  252. }
  253. .l-imgText-t {
  254. font-size: 28px;
  255. margin-top: 20px;
  256. }
  257. }
  258. //小图
  259. .lotteryResultsNum {
  260. .l-results {
  261. display: flex;
  262. flex-wrap: wrap;
  263. justify-content: flex-start;
  264. height: 400px;
  265. overflow: hidden;
  266. overflow-y: auto;
  267. }
  268. .l-imgText-img {
  269. width: 100px;
  270. height: 100px;
  271. }
  272. .l-imgText-t {
  273. font-size: 18px;
  274. }
  275. .l-imgText {
  276. margin: 0 24px 24px 0;
  277. }
  278. }
  279. .l-button-group {
  280. margin-top: 70px;
  281. }
  282. /* zkx */
  283. .bgDiv {
  284. background-image: url('../../public/bg2.jpg');
  285. background-size: 100% 100%;
  286. /* 这会让图片在水平方向上铺满,垂直方向上保持原始比例 */
  287. background-repeat: repeat-x;
  288. /* 这会在水平方向上平铺 */
  289. color: #ffffff;
  290. height: 100%;
  291. }
  292. .leftRegion {
  293. background-color: rgba(20, 0, 98, 0.5);
  294. padding: 20px;
  295. border: 2px solid rgba(255, 255, 255, 1);
  296. border-radius: 10px;
  297. height: 800px;
  298. margin: 40px;
  299. }
  300. .leftRegionA {
  301. width: 600px;
  302. }
  303. .leftRegionB {
  304. margin: 40px 40px 40px 0;
  305. display: flex;
  306. flex-direction: column;
  307. overflow: hidden;
  308. overflow-y: auto;
  309. }
  310. .el-main {
  311. /* //height: 500px; */
  312. overflow: auto;
  313. text-align: left;
  314. padding: 0px;
  315. margin: 0px
  316. }
  317. /* zkx */
  318. .el-header,
  319. .el-footer {
  320. text-align: center;
  321. line-height: 60px;
  322. }
  323. .el-aside {
  324. text-align: center;
  325. padding: 10px
  326. }
  327. body>.el-container {
  328. margin-bottom: 40px;
  329. }
  330. .el-container:nth-child(5) .el-aside,
  331. .el-container:nth-child(6) .el-aside {
  332. line-height: 260px;
  333. }
  334. .el-container:nth-child(7) .el-aside {
  335. line-height: 320px;
  336. }
  337. .leftMain {
  338. margin-top: 30px
  339. }
  340. .imgDiv {
  341. margin-top: 50px;
  342. text-align: center
  343. }
  344. .el-form-item__label {
  345. color: #ffffff
  346. }
  347. .imgText {
  348. float: left;
  349. margin-left: 20px
  350. }
  351. </style>