index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. <template>
  2. <view class="center">
  3. <view class="box-title"><image src="../../static/img/index7.png" mode=""></image></view>
  4. <view class="box-body">
  5. <view class="navBox">
  6. <view class="navBox-left">
  7. <!-- <view class="navBox-item" @click="nav('./node')"><image src="../../static/img/index2.png" style="width: 385rpx; height: 398rpx;" mode=""></image></view> -->
  8. <view class="navBox-item" @click="node()"><image src="../../static/img/index2.png" style="width: 385rpx; height: 398rpx;" mode=""></image></view>
  9. </view>
  10. <view class="navBox-right">
  11. <view class="navBox-item" @click="nav('./convert')"><image src="../../static/img/index3.png" style="width: 385rpx; height: 216rpx; " mode=""></image></view>
  12. <!-- <view class="navBox-item" @click="nav('/pages/index/appointment')">
  13. <image src="../../static/img/index6.png" style="width: 339rpx; height: 170rpx; margin-top: -12rpx;" mode=""></image>
  14. </view> -->
  15. <view class="navBox-item" @click="node()">
  16. <image src="../../static/img/index6.png" style="width: 339rpx; height: 170rpx; margin-top: -12rpx;" mode=""></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="shopBox" v-for="(item,index) in list" :key="index">
  21. <view class="shopBox-top">
  22. <view class="left"><image src="../../static/img/index4.png" mode=""></image></view>
  23. <view class="between" style="margin-left: -340rpx;">
  24. <text id="one">{{item.name}}</text>
  25. <text id="two">{{item.lun}}轮</text>
  26. </view>
  27. <text id="three">预约中</text>
  28. </view>
  29. <view class="shopBox-between">
  30. <view class="number">
  31. <text class="number-left">{{1*item.cost}}</text>
  32. <text class="number-right">{{item.cost_money_type}}/份</text>
  33. </view>
  34. <view class="quotient"><text class="quotient-children">每轮限购1组,每组限购一份</text></view>
  35. </view>
  36. <image :src="item.background_image" style="width: 635rpx; height: 170rpx; margin: 40rpx 0;" mode=""></image>
  37. <view class="shopBox-bottom">
  38. <view class="forward">
  39. <view class="forward-left"></view>
  40. <view class="forward-right">每组分数:&nbsp {{item.join_number}}份</view>
  41. </view>
  42. <view class="consume">
  43. GAS消耗:
  44. <text>{{1*item.ticket}}{{item.ticket_money_type}}</text>
  45. </view>
  46. <view class="appointmentTime">
  47. 预约时间:
  48. <text>{{ item.start }}-{{ item.end}}</text>
  49. </view>
  50. <view class="lotteryTime">
  51. 开奖时间:
  52. <text>{{item.jiang}}</text>
  53. </view>
  54. </view>
  55. <view class="btn-box flex">
  56. <view class="submit1">查看更多</view>
  57. <view class="submit" @click="buy(item)">预购</view>
  58. </view>
  59. </view>
  60. </view>
  61. <u-popup v-model="show" mode="bottom" border-radius="40" height="868rpx" :closeable="true">
  62. <view class="yugo">
  63. <view class="zhu">
  64. 注:每轮限购1组,每组限购1份
  65. <span class="zhu-right">
  66. 最多可预约:
  67. <span class="zhu-num">1份</span>
  68. </span>
  69. </view>
  70. <view class="info-main">
  71. <view class="info-box">
  72. <view class="info-left">预约份数:</view>
  73. <view class="info-right"><u-number-box :max="max" v-model="value" @change="valChange"></u-number-box></view>
  74. </view>
  75. <view class="info-box">
  76. <view class="info-left">预约金额:</view>
  77. <view class="info-right">{{money}}</view>
  78. </view>
  79. <view class="info-box">
  80. <view class="info-left">预约手续费:</view>
  81. <view class="info-right">{{souxu}}</view>
  82. </view>
  83. </view>
  84. <view class="btn" @click="submit()">确定</view>
  85. </view>
  86. </u-popup>
  87. <u-popup v-model="show1" mode="center" width="548rpx" border-radius="14">
  88. <view class="psw-wrapper">
  89. <view class="psw-title">请输入支付密码</view>
  90. <input type="password" v-model="password" class="psw-ipt" />
  91. <view class="psw-btn">
  92. <text @click="cancel">取消</text>
  93. <text class="psw-qd" @click="pswQd">确定</text>
  94. </view>
  95. </view>
  96. </u-popup>
  97. </view>
  98. </template>
  99. <script>
  100. import { lala,lalaDetial,buylala } from '@/api/product.js'
  101. import {getTime} from '@/utils/rocessor.js'
  102. export default {
  103. data() {
  104. return {
  105. show: false, //支付数量
  106. show1: false, //支付密码
  107. password: '',
  108. value: 1,
  109. list:[],
  110. money:'',//预约金额
  111. souxu:'',//预约手续费
  112. id:'',//购买产品
  113. max:1
  114. };
  115. },
  116. //页面加载即刻发生
  117. onShow() {
  118. this.loadDate();
  119. },
  120. onLoad() {
  121. this.loadDate();
  122. },
  123. methods: {
  124. async loadDate() {
  125. const obj = this;
  126. lala(
  127. {
  128. page:1,
  129. limit:10,
  130. }).then(({data}) => {
  131. obj.list = data.list.data
  132. obj.list.forEach((e,index) => {
  133. lalaDetial({page:1,limit:1},e.id)
  134. .then(les =>{
  135. console.log(les)
  136. let end = getTime(les.data.next_pink - les.data.close_join*60);
  137. let start = getTime(les.data.next_pink - les.data.close_join*60 - 2*60*60);
  138. let jiang = getTime(les.data.next_pink);
  139. e.end = end;
  140. e.start = start;
  141. e.jiang = jiang;
  142. // les.data.next_pink
  143. if('history_list' in les.data){
  144. e.lun = 1*les.data.history_list[0].group_num+1
  145. }else{
  146. e.lun = 1
  147. }
  148. obj.$set(e,'childList',les.data)
  149. // e.childList = les.data
  150. console.log(obj.list,"1111111")
  151. })
  152. })
  153. })
  154. },
  155. nav(url) {
  156. uni.navigateTo({
  157. url: url
  158. });
  159. },
  160. buy(item) {
  161. this.money = (1*item.cost) + item.cost_money_type;
  162. this.souxu = item.ticket+item.ticket_money_type;
  163. this.id = item.id;
  164. this.show = true;
  165. },
  166. valChange(e) {
  167. console.log(e);
  168. if(this.value > 1){
  169. e.value = 1
  170. this.value = 1;
  171. console.log(this.value)
  172. this.$api.msg("每组限购一份");
  173. }
  174. },
  175. submit() {
  176. if(this.value == 0){
  177. this.$api.msg("预约份数不能为0")
  178. }
  179. else{
  180. this.show = false;
  181. this.show1 = true;
  182. }
  183. },
  184. cancel() {
  185. this.show1 = false;
  186. },
  187. pswQd() {
  188. buylala({
  189. trade_psw: this.password
  190. },this.id).then(e => {
  191. console.log(e)
  192. }).catch(e => {
  193. console.log(e)
  194. })
  195. },
  196. node(){
  197. this.$api.msg("敬请期待")
  198. }
  199. }
  200. };
  201. </script>
  202. <style lang="scss">
  203. .center {
  204. height: auto;
  205. min-height: 100%;
  206. background-color: #ffffff;
  207. }
  208. .box-title {
  209. position: relative;
  210. z-index: 1;
  211. width: 100%;
  212. height: 436rpx;
  213. image {
  214. width: 100%;
  215. height: 436rpx;
  216. }
  217. }
  218. .box-body {
  219. display: flex;
  220. flex-direction: column;
  221. justify-content: space-around;
  222. width: 100%;
  223. height: 100%;
  224. position: relative;
  225. z-index: 10;
  226. margin-top: -40rpx;
  227. border-top-left-radius: 40rpx;
  228. border-top-right-radius: 40rpx;
  229. background: #f8fbfe;
  230. .navBox {
  231. display: flex;
  232. justify-content: space-around;
  233. .navBox-left {
  234. // margin: 20rpx 5rpx 10rpx 10rpx;
  235. margin: 20rpx -24rpx 0 0;
  236. mar .navBox-item {
  237. image {
  238. width: 100%;
  239. height: 100%;
  240. }
  241. }
  242. }
  243. .navBox-right {
  244. margin: 20rpx 0 0 -24rpx;
  245. // margin: 20rpx 10rpx 5rpx 5rpx;
  246. .navBox-item {
  247. display: flex;
  248. flex-direction: column;
  249. align-items: center;
  250. image {
  251. }
  252. }
  253. }
  254. }
  255. .shopBox {
  256. padding: 0 30rpx;
  257. margin-top: 45rpx;
  258. width: 690rpx;
  259. // height: 770rpx;
  260. background: #ffffff;
  261. box-shadow: 0rpx 0rpx 17rpx 0rpx rgba(0, 0, 0, 0.05);
  262. border-radius: 10px;
  263. margin: 0 auto;
  264. .shopBox-top {
  265. margin-top: 26rpx;
  266. display: flex;
  267. justify-content: space-between;
  268. align-items: center;
  269. image {
  270. height: 46rpx;
  271. width: 48rpx;
  272. }
  273. #one {
  274. font-size: 34rpx;
  275. font-family: PingFang SC;
  276. font-weight: bold;
  277. color: #0f253a;
  278. }
  279. #two {
  280. margin-left: 11rpx;
  281. font-size: 26rpx;
  282. font-family: PingFang SC;
  283. font-weight: 500;
  284. color: #6d7c88;
  285. }
  286. #three {
  287. font-size: 26rpx;
  288. font-family: PingFang SC;
  289. font-weight: 500;
  290. color: #ff4c4c;
  291. }
  292. }
  293. .shopBox-between {
  294. margin-top: 20rpx;
  295. display: flex;
  296. justify-content: space-between;
  297. align-items: center;
  298. .number {
  299. .number-left {
  300. font-size: 40rpx;
  301. font-family: PingFang SC;
  302. font-weight: bold;
  303. color: #44969d;
  304. }
  305. .number-right {
  306. font-size: 24rpx;
  307. font-family: PingFang SC;
  308. font-weight: bold;
  309. color: #44969d;
  310. }
  311. }
  312. .quotient {
  313. .quotient-children {
  314. font-size: 24rpx;
  315. font-family: PingFang SC;
  316. font-weight: 500;
  317. color: #6d7c88;
  318. }
  319. }
  320. }
  321. .forward {
  322. display: flex;
  323. justify-content: space-between;
  324. align-items: center;
  325. .forward-left {
  326. font-size: 26rpx;
  327. font-family: PingFang SC;
  328. font-weight: 500;
  329. color: #44969d;
  330. }
  331. .forward-right {
  332. font-size: 24rpx;
  333. font-family: PingFang SC;
  334. font-weight: 500;
  335. color: #6d7c88;
  336. }
  337. }
  338. .consume,
  339. .appointmentTime,
  340. .lotteryTime {
  341. margin: 12rpx 0;
  342. font-size: 26rpx;
  343. font-family: PingFang SC;
  344. font-weight: 400;
  345. color: #6d7c88;
  346. }
  347. .consume > text,
  348. .appointmentTime > text,
  349. .lotteryTime > text {
  350. font-size: 10rpx;
  351. font-family: PingFang SC;
  352. font-weight: 500;
  353. color: #000000;
  354. }
  355. .submit {
  356. width:295rpx;
  357. height: 70rpx;
  358. background: linear-gradient(90deg, #60bab0, #45969b);
  359. border-radius: 35rpx;
  360. font-size: 32rpx;
  361. font-family: PingFang SC;
  362. font-weight: 500;
  363. color: #ffffff;
  364. text-align: center;
  365. line-height: 70rpx;
  366. margin: 40rpx 10rpx;
  367. }
  368. .submit1 {
  369. width:295rpx;
  370. height: 70rpx;
  371. border: 1px solid #60bab0;
  372. background: #fff;
  373. border-radius: 35rpx;
  374. font-size: 32rpx;
  375. font-family: PingFang SC;
  376. font-weight: 500;
  377. color: #60bab0;
  378. text-align: center;
  379. line-height: 70rpx;
  380. margin: 40rpx 10rpx;
  381. }
  382. }
  383. }
  384. .yugo {
  385. padding-top: 80rpx;
  386. position: relative;
  387. height: 100%;
  388. .zhu {
  389. height: 112rpx;
  390. border-top: 1px #eeeeee solid;
  391. border-bottom: 1px #eeeeee solid;
  392. line-height: 112rpx;
  393. padding: 0 32rpx;
  394. font-size: 28rpx;
  395. font-family: PingFang SC;
  396. font-weight: 500;
  397. color: #6d7c88;
  398. .zhu-right {
  399. display: inline-block;
  400. padding-left: 60rpx;
  401. }
  402. .zhu-num {
  403. color: #000000;
  404. }
  405. }
  406. .info-main {
  407. padding: 0 32rpx;
  408. .info-box {
  409. padding-top: 22rpx;
  410. display: flex;
  411. justify-content: space-between;
  412. align-items: center;
  413. .info-left {
  414. font-size: 28rpx;
  415. font-family: PingFang SC;
  416. font-weight: 500;
  417. color: #6d7c88;
  418. }
  419. .info-right {
  420. font-size: 28rpx;
  421. font-family: PingFang SC;
  422. font-weight: 500;
  423. color: #0f253a;
  424. }
  425. }
  426. }
  427. .btn {
  428. position: absolute;
  429. bottom: 50rpx;
  430. left: 50%;
  431. margin-left: -342rpx;
  432. width: 684rpx;
  433. height: 86rpx;
  434. background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
  435. border-radius: 10rpx;
  436. text-align: center;
  437. line-height: 86rpx;
  438. font-size: 36rpx;
  439. font-family: PingFang SC;
  440. font-weight: 500;
  441. color: #ffffff;
  442. }
  443. }
  444. .psw-wrapper {
  445. width: 548rpx;
  446. height: 344rpx;
  447. background-color: #FFFFFF;
  448. .psw-title {
  449. width: 100%;
  450. font-size: 35rpx;
  451. padding: 43rpx 0 49rpx;
  452. text-align: center;
  453. font-weight: 800;
  454. }
  455. .psw-ipt {
  456. display: block;
  457. background-color: #dce3ed;
  458. height: 90rpx;
  459. width: 464rpx;
  460. padding-left: 30rpx;
  461. margin: 0 auto;
  462. font-size: 80rpx;
  463. }
  464. .psw-btn text{
  465. display: inline-block;
  466. text-align: center;
  467. width: 50%;
  468. padding-top: 29rpx;
  469. font-size: 35rpx;
  470. }
  471. .psw-qd {
  472. color:#45969B;
  473. }
  474. }
  475. </style>