index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. <template>
  2. <u-popup :show="popupShow" bgColor="transparent" :safeAreaInsetBottom="false" :closeOnClickOverlay="type!=3" @close="close">
  3. <view class="popupBox">
  4. <view class="popupBox_title">
  5. <image src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img4.png" mode="" />
  6. <view>
  7. <view class="popupBox_title_l">限时特惠</view>
  8. <view class="popupBox_title_r">
  9. <text class="popupBox_title_r_l" v-if="details.originalPriceShow">¥{{details.originalPrice}}</text>
  10. <text class="popupBox_title_r_r">¥{{details.sellingPrice}}</text>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="popupBox_list">
  15. <view class="popupBox_border mb18" v-if="type!=3">
  16. <view class="list_info">
  17. <image :src="details.coverImage||details.businessImage||shopDetails.logo" mode="" />
  18. <view class="list_info_r">
  19. <view class="list_info_r_title">{{details.title}}</view>
  20. <view class="list_info_r_hint">{{details.costIncluded}}</view>
  21. <view class="list_info_r_num">已售 {{details.salesVolume}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. <scroll-view class="scroll" scroll-y="true">
  26. <view class="scroll_box">
  27. <view class="popupBox_border">
  28. <view class="list_item">
  29. <img src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img5.png" alt="">
  30. <view class="list_item_title">购买须知</view>
  31. <view class="list_item_1" v-for="(v,i) in details.businessProductNotesList" :key="i">
  32. <view class="list_item_1_title">{{v.noteTitle}}</view>
  33. <view class="list_item_1_text">{{v.noteContent}}</view>
  34. </view>
  35. <!-- <view class="list_item_1">
  36. <view class="list_item_1_title">送兑换豆</view>
  37. <view class="list_item_1_text">{{details.giftPointScore}}</view>
  38. </view> -->
  39. <!-- <view class="list_item_1">
  40. <view class="list_item_1_title">出票速度</view>
  41. <view class="list_item_1_text">平均一秒出票。</view>
  42. </view>
  43. <view class="list_item_1">
  44. <view class="list_item_1_title">出票速度</view>
  45. <view class="list_item_1_text">凭【核销码】可进入</view>
  46. </view>
  47. <view class="list_item_1">
  48. <view class="list_item_1_title">随时退</view>
  49. <view class="list_item_1_text">未使用可随时申请全额退款。</view>
  50. </view>
  51. <view class="list_item_1">
  52. <view class="list_item_1_title">玩后再付</view>
  53. <view class="list_item_1_text">该商品可享受玩后再付特权,下单时选玩后再付,可享0元下单,游玩后自动计入账单,下月出账后再还款。(此服务不影响商品退改政策,订单退改规则仍以产品购买须知为准,如因退改发生手续费的,将在您操作退款时立即计入账单。)</view>
  54. </view> -->
  55. </view>
  56. </view>
  57. <view class="popupBox_border" v-if="type!=3">
  58. <view class="list_item">
  59. <img src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img5.png" alt="">
  60. <view class="list_item_title">使用说明</view>
  61. <view class="list_item_1">
  62. <view class="list_item_1_text1"><text>入园时间:</text>
  63. <view>{{details.enteringParkTime}}</view>
  64. </view>
  65. <view class="list_item_1_text1"><text>入园地址:</text>
  66. <view>{{details.enteringParkAddress}}</view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="popupBox_border" v-if="type!=3">
  72. <view class="list_item">
  73. <img src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img5.png" alt="">
  74. <view class="list_item_title">费用说明</view>
  75. <view class="list_item_1">
  76. <view class="list_item_1_text1"><text>费用包含:</text>
  77. <view>{{details.costIncluded}}</view>
  78. </view>
  79. <view class="list_item_1_text1" v-if="details.costDescription"><text>详细说明:</text>
  80. <view>{{details.costDescription}}</view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="footCls">
  87. <view v-if="homeFootObj.first"> <text class="iconfont icon-dunpai-anquan"></text> {{homeFootObj.first}}
  88. </view>
  89. <view v-if="homeFootObj.second">{{homeFootObj.second}}</view>
  90. </view>
  91. </scroll-view>
  92. <view class="btnBox" v-if="type==1">
  93. <view class="btnBox_l">
  94. <div>
  95. <view class="btnBox_l_val">¥
  96. <text>{{dealPrice(details.sellingPrice,0)}}</text>.{{dealPrice(details.sellingPrice,1)}}
  97. </view>
  98. <view class="btnBox_l_lab unline" v-if="details.originalPriceShow">
  99. ¥{{details.originalPrice}}</view>
  100. </div>
  101. <view class="btnBox_l_val btnBox_l_beans" v-if="details.giftPointScore&&parseInt(details.giftPointScore)>0">
  102. <!-- 送礼包兑换豆{{parseInt(details.giftPointScore)}}个 -->
  103. 赠送{{parseInt(details.giftPointScore)}}元礼包商城商品
  104. </view>
  105. </view>
  106. <view class="btnBox_r">
  107. <view v-if="!collectStatus" @click="collect()"> <text class="iconfont icon-shoucang"></text>
  108. </view>
  109. <view class="collect" v-else @click="collect()">
  110. <image src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img46.png" mode="" />
  111. </view>
  112. <button open-type="share">
  113. <view class="shareBtn"> <text class="iconfont icon-fenxiang"></text></view>
  114. </button>
  115. <view class="btn" @click="goConfirmOrder(details)">购买</view>
  116. </view>
  117. </view>
  118. <view class="btnBox" v-if="type==3">
  119. <view class="btn-box" @click="closeFun()" :class="{active:tiems<=0}"><text v-if="tiems>0">({{tiems}})</text> 我已知晓</view>
  120. </view>
  121. </view>
  122. </view>
  123. </u-popup>
  124. </template>
  125. <script>
  126. import {
  127. userCollectAdd,
  128. userCollectDel,
  129. getUserCollect,
  130. homeFoot
  131. } from "@/api/home.js"
  132. export default {
  133. data () {
  134. return {
  135. popupShow: false,
  136. details: {
  137. sellingPrice: 0.00
  138. },
  139. shopDetails: {},
  140. tiems: 3,
  141. collectObj: {},
  142. collectStatus: false,
  143. timer: null,
  144. timer1: null,
  145. homeFootObj: {}
  146. }
  147. },
  148. props: {
  149. type: {
  150. type: String | Number,
  151. default: 1
  152. }
  153. },
  154. mounted() {
  155. console.log('aaaa')
  156. this.getHomeFoot()
  157. },
  158. onUnload () {
  159. this.timer && clearInterval(this.timer);
  160. },
  161. methods: {
  162. open (val, shopDetails) {
  163. this.details = val;
  164. if (!this.details.businessProductNotesList) {
  165. this.details.businessProductNotesList = this.details.productNotesList
  166. }
  167. console.log(this.details, this.details.sellingPrice, shopDetails)
  168. this.shopDetails = shopDetails;
  169. this.popupShow = true;
  170. if (this.type == 3) {
  171. this.timer = setInterval(() => {
  172. this.tiems--;
  173. if (this.tiems == 0) {
  174. // this.tiems = 5;
  175. clearInterval(this.timer);
  176. }
  177. }, 1000)
  178. }
  179. if (this.type == 1) {
  180. this.getCollectStatus()
  181. }
  182. },
  183. // 获取底部文案
  184. getHomeFoot () {
  185. homeFoot().then(res => {
  186. this.homeFootObj = res.data
  187. })
  188. },
  189. dealPrice (val, index) {
  190. if (val) {
  191. let arr = val.split(".");
  192. return arr[index]
  193. }
  194. },
  195. closeFun () {
  196. if (this.tiems <= 0) {
  197. this.close();
  198. }
  199. },
  200. // 获取收藏状态
  201. getCollectStatus () {
  202. let params = {
  203. entityId: this.details.businessProductId,
  204. entityType: 1
  205. }
  206. getUserCollect(params).then(res => {
  207. this.collectObj = res.data;
  208. this.collectStatus = res.data ? true : false;
  209. this.timer1 = setTimeout(() => {
  210. clearTimeout(this.timer1)
  211. this.timer1 = null
  212. }, 2000)
  213. })
  214. },
  215. // 收藏
  216. collect () {
  217. if (this.timer1) {
  218. uni.$u.toast('操作过于频繁,请稍后再试')
  219. return
  220. }
  221. if (this.collectStatus) {
  222. userCollectDel(this.collectObj.id).then(res => {
  223. this.collectStatus = false;
  224. uni.showToast({
  225. title: '取消收藏成功!',
  226. duration: 1500
  227. });
  228. })
  229. } else {
  230. let param = {
  231. entityType: 1,
  232. entityId: this.details.businessProductId
  233. }
  234. userCollectAdd(param).then(res => {
  235. this.collectStatus = true;
  236. uni.showToast({
  237. title: '收藏成功!',
  238. duration: 1500
  239. });
  240. this.getCollectStatus()
  241. })
  242. }
  243. },
  244. close () {
  245. this.popupShow = false;
  246. this.$emit('close')
  247. },
  248. goConfirmOrder (item) {
  249. console.log(this.shopDetails)
  250. uni.navigateTo({
  251. url: '/pages/home/confirmOrder?logo=' + this.shopDetails.logo + '&businessName=' +
  252. encodeURIComponent(this.shopDetails.businessName) + '&businessId=' + this.shopDetails
  253. .businessId + '&businessProductId=' + item.businessProductId
  254. })
  255. }
  256. },
  257. }
  258. </script>
  259. <style lang='scss' scoped>
  260. .popupBox {
  261. position: relative;
  262. .popupBox_title {
  263. width: 100%;
  264. position: absolute;
  265. top: -93rpx;
  266. z-index: 10;
  267. > image {
  268. width: 720rpx;
  269. height: 204rpx;
  270. }
  271. > view {
  272. display: flex;
  273. align-items: center;
  274. padding: 75rpx 0 0 30rpx;
  275. position: absolute;
  276. top: 0;
  277. left: 0;
  278. .popupBox_title_l {
  279. font-size: 48rpx;
  280. color: #ffffff;
  281. font-family: FZCuYuan-M03;
  282. margin-right: 100rpx;
  283. }
  284. .popupBox_title_r {
  285. .popupBox_title_r_l {
  286. font-size: 26rpx;
  287. color: #ffffff;
  288. text-decoration: line-through;
  289. }
  290. .popupBox_title_r_r {
  291. font-size: 32rpx;
  292. color: #ffffff;
  293. font-family: FZCuYuan-M03;
  294. text-decoration: none;
  295. }
  296. }
  297. }
  298. }
  299. .popupBox_list {
  300. padding: 60rpx 0rpx 0;
  301. background: linear-gradient(180deg, #c90700 0%, #ffe8e6 58%, #ffffff 32%);
  302. border-radius: 40rpx 40rpx 0rpx 0rpx;
  303. /* background-size: 100% 1900rpx; */
  304. background-size: 100% 1500rpx;
  305. /* background-position-y: -300rpx; */
  306. background-position-y: -167rpx;
  307. background-repeat: no-repeat;
  308. background-color: #ffffff;
  309. .scroll {
  310. max-height: 50vh;
  311. position: relative;
  312. z-index: 20;
  313. .scroll_box {
  314. /* padding-bottom: 30rpx; */
  315. }
  316. }
  317. .popupBox_border {
  318. width: 702rpx;
  319. margin: 10rpx auto 0;
  320. background: linear-gradient(180deg, #fb2715, #ff0901);
  321. border-radius: 30rpx;
  322. background-size: 702rpx 226rpx;
  323. margin-bottom: 28rpx;
  324. padding: 6rpx;
  325. position: relative;
  326. margin-top: 10rpx;
  327. z-index: 11;
  328. }
  329. .list_info {
  330. display: flex;
  331. background: #fff5f3;
  332. padding: 20rpx 30rpx;
  333. border-radius: 30rpx;
  334. max-height: 200rpx;
  335. overflow: auto;
  336. image {
  337. width: 154rpx;
  338. height: 154rpx;
  339. background: rgba(0, 0, 0, 0);
  340. border-radius: 12rpx;
  341. margin-right: 24rpx;
  342. flex-shrink: 0;
  343. }
  344. .list_info_r {
  345. .list_info_r_title {
  346. font-size: 26rpx;
  347. color: #242424;
  348. font-family: FZCuYuan-M03;
  349. padding-top: 10rpx;
  350. }
  351. .list_info_r_hint {
  352. font-size: 24rpx;
  353. color: #1a1a1a;
  354. margin-top: 8rpx;
  355. }
  356. .list_info_r_num {
  357. font-size: 22rpx;
  358. color: #666666;
  359. margin-top: 20rpx;
  360. }
  361. }
  362. }
  363. .list_item {
  364. background: #fff5f3;
  365. padding: 20rpx 30rpx;
  366. border-radius: 30rpx;
  367. position: relative;
  368. > image {
  369. width: 55rpx;
  370. height: 77rpx;
  371. position: absolute;
  372. top: -8rpx;
  373. left: -16rpx;
  374. z-index: 100;
  375. }
  376. .list_item_title {
  377. font-size: 36rpx;
  378. color: #fa353b;
  379. font-family: FZCuYuan-M03;
  380. padding-left: 27rpx;
  381. margin-bottom: 20rpx;
  382. }
  383. .list_item_1 {
  384. &:first-child {
  385. .list_item_1_title {
  386. margin-top: 0 !important;
  387. }
  388. }
  389. .list_item_1_title {
  390. font-size: 26rpx;
  391. color: #242424;
  392. font-family: FZCuYuan-M03;
  393. margin: 10rpx 0 10rpx;
  394. }
  395. .list_item_1_text {
  396. font-size: 24rpx;
  397. color: #666666;
  398. line-height: 36rpx;
  399. text {
  400. font-size: 24rpx;
  401. color: #1a1a1a;
  402. }
  403. }
  404. .list_item_1_text1 {
  405. font-size: 24rpx;
  406. color: #666666;
  407. line-height: 36rpx;
  408. display: flex;
  409. text {
  410. font-size: 24rpx;
  411. color: #1a1a1a;
  412. display: inline-block;
  413. flex-shrink: 0;
  414. }
  415. }
  416. }
  417. }
  418. }
  419. }
  420. .btnBox {
  421. display: flex;
  422. align-items: center;
  423. justify-content: space-between;
  424. width: 100%;
  425. padding: 35rpx 30rpx;
  426. /* background: transparent; */
  427. background: #ffffff;
  428. box-sizing: border-box;
  429. .btnBox_l {
  430. > div {
  431. display: flex;
  432. align-items: baseline;
  433. }
  434. .btnBox_l_lab {
  435. font-size: 28rpx;
  436. color: #1a1a1a;
  437. }
  438. .unline {
  439. font-size: 26rpx;
  440. color: #808080;
  441. text-decoration: line-through;
  442. }
  443. .btnBox_l_val {
  444. display: flex;
  445. align-items: baseline;
  446. font-size: 22rpx;
  447. color: #ff0000;
  448. font-family: FZCuYuan-M03;
  449. text {
  450. font-size: 42rpx;
  451. font-family: FZCuYuan-M03;
  452. }
  453. }
  454. .btnBox_l_beans {
  455. margin-left: 20rpx;
  456. }
  457. }
  458. .btn-box {
  459. width: 90%;
  460. height: 80rpx;
  461. border-radius: 40rpx;
  462. font-size: 32rpx;
  463. color: #ffffff;
  464. text-align: center;
  465. line-height: 80rpx;
  466. margin: auto;
  467. background: #999999;
  468. }
  469. .active {
  470. background: #fb0b03;
  471. }
  472. }
  473. .btnBox_r {
  474. display: flex;
  475. align-items: center;
  476. button {
  477. padding: 0;
  478. background: transparent;
  479. border: none;
  480. &:after {
  481. border: none;
  482. }
  483. }
  484. > view {
  485. width: 55rpx;
  486. height: 55rpx;
  487. border-radius: 50%;
  488. background: rgba(0, 0, 0, 0.7);
  489. display: flex;
  490. justify-content: center;
  491. align-items: center;
  492. margin-right: 25rpx;
  493. &:last-child {
  494. margin-right: 0rpx;
  495. }
  496. text {
  497. color: #fff;
  498. font-size: 36rpx;
  499. }
  500. }
  501. .shareBtn {
  502. width: 55rpx;
  503. height: 55rpx;
  504. border-radius: 50%;
  505. background: rgba(0, 0, 0, 0.7);
  506. display: flex;
  507. justify-content: center;
  508. align-items: center;
  509. &:first-child {
  510. margin-right: 25rpx;
  511. }
  512. text {
  513. color: #fff;
  514. font-size: 36rpx;
  515. }
  516. }
  517. .collect {
  518. text-align: center;
  519. image {
  520. width: 33rpx;
  521. height: 30rpx;
  522. margin-top: 4rpx;
  523. }
  524. }
  525. > .btn {
  526. width: 200rpx;
  527. height: 80rpx;
  528. background: #fb0b03;
  529. border-radius: 40rpx;
  530. font-size: 32rpx;
  531. color: #ffffff;
  532. text-align: center;
  533. line-height: 80rpx;
  534. }
  535. }
  536. .footCls {
  537. font-size: 24rpx;
  538. color: #cccccc;
  539. text-align: center;
  540. background: #ffffff;
  541. padding-top: 20rpx;
  542. .iconfont {
  543. vertical-align: middle;
  544. }
  545. }
  546. .mb18 {
  547. margin-bottom: 18rpx !important;
  548. }
  549. </style>