yuyuechang.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <view class="content">
  3. <view class="top-bg">
  4. <image src="../../static/img/yuyue-top.jpg" mode="widthFix"></image>
  5. </view>
  6. <!-- <view class="changci-top flex">
  7. <view class="djs-wrap flex">
  8. 倒计时:
  9. <uni-countdown
  10. color="#C6914E"
  11. background-color="#F6EFDF"
  12. :show-day="false"
  13. :day="0"
  14. :hour="0"
  15. :minute="0"
  16. :second="0"
  17. ></uni-countdown>
  18. </view>
  19. <view class="user-info">
  20. <view class="" style="text-align: right;">
  21. 消费账户:{{userInfo.now_money*1 || '0'}}
  22. </view>
  23. <view class="" style="text-align: right;">
  24. 广告值: {{userInfo.aid_val*1 || '0'}}
  25. </view>
  26. </view>
  27. </view> -->
  28. <view class="" v-for="item in area">
  29. <view class="good-tit flex" >
  30. <view class="tit-left flex">
  31. <image src="../../static/icon/red-tit.png" mode=""></image>{{item.name}}
  32. </view>
  33. <view class="tit-right">
  34. 实付金额:{{item.low}} ~ {{ item.high }}
  35. </view>
  36. </view>
  37. <view class="good-list flex" @click="status==2?goumai(item):''">
  38. <image src="../../static/icon/red-gift.png" mode="widthFix" v-for="itemg in 35"></image>
  39. </view>
  40. </view>
  41. <uni-popup ref="popupyyok" type="center">
  42. <view class="popupyyok-wrap">
  43. <image :src="good.image" mode=""></image>
  44. <view class="clamp2" style="padding: 20rpx 80rpx;color: #999999;font-size: 26rpx;">
  45. {{good.name}}
  46. </view>
  47. <view class="" style="font-size: 35rpx;font-weight: bold;color: #333333;">
  48. {{good.price}}
  49. </view>
  50. <view class="btn" @click="zhifu">
  51. 立即支付
  52. </view>
  53. </view>
  54. </uni-popup >
  55. </view>
  56. </template>
  57. <script>
  58. import { section, purchase,zfpay,see_order } from '@/api/index.js'
  59. import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
  60. import { mapState, mapMutations } from 'vuex';
  61. export default {
  62. components: {
  63. uniCountdown
  64. },
  65. data() {
  66. return {
  67. ccid: '',
  68. area: [],
  69. good: {},
  70. status: 2,//1购买了商品2未购买商品
  71. }
  72. },
  73. computed: {
  74. ...mapState('user',['userInfo'])
  75. },
  76. onLoad(opt) {
  77. this.ccid = opt.id
  78. this.see_order()
  79. this.section()
  80. },
  81. methods: {
  82. see_order() {
  83. let obj = this
  84. see_order({
  85. id: obj.ccid
  86. }).then(res => {
  87. console.log(res.data.status)
  88. obj.status = res.data.status
  89. if(res.data.status == 1) {
  90. obj.good = res.data.order
  91. }
  92. })
  93. },
  94. section() {
  95. let obj = this
  96. section({
  97. id: obj.ccid
  98. }).then(res => {
  99. console.log(res)
  100. obj.area = res.data
  101. })
  102. },
  103. goumai(item) {
  104. let obj = this
  105. purchase({
  106. id: obj.ccid,
  107. s_id: item.id
  108. }).then(res => {
  109. console.log(res)
  110. obj.good = res.data
  111. obj.$refs.popupyyok.open()
  112. })
  113. },
  114. zhifu() {
  115. let obj = this
  116. zfpay({
  117. order_id: obj.good.order_id
  118. }).then(res => {
  119. obj.$api.msg('支付成功')
  120. obj.$refs.popupyyok.close()
  121. })
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .changci-top {
  128. background-color: #fff;
  129. padding:0 25rpx;
  130. height: 100rpx;
  131. .djs-wrap {
  132. padding-left: 25rpx;
  133. }
  134. }
  135. .good-tit {
  136. // margin-top: 20rpx;
  137. background-color: #fff;
  138. padding: 20rpx;
  139. .tit-left {
  140. flex-shrink: 0;
  141. image {
  142. height: 36rpx;
  143. width: 36rpx;
  144. border-radius: 50%;
  145. margin-right: 10rpx;
  146. }
  147. }
  148. .tit-right {
  149. text-align: right;
  150. }
  151. }
  152. .good-list {
  153. flex-wrap: wrap;
  154. background-color: #fff;
  155. padding: 20rpx;
  156. // justify-content: flex-start;
  157. image {
  158. width: 80rpx;
  159. margin-left: 15rpx;
  160. }
  161. }
  162. .popupyyok-wrap {
  163. height: 707rpx;
  164. width: 551rpx;
  165. background-color: #fff;
  166. border-radius: 20rpx;
  167. text-align: center;
  168. // position: relative;
  169. image {
  170. width: 100%;
  171. height: 429rpx;
  172. }
  173. .btn {
  174. position: absolute;
  175. bottom: 10rpx;
  176. left: 0;
  177. right: 0;
  178. margin: auto;
  179. width: 295rpx;
  180. line-height: 69rpx;
  181. border-radius: 34rpx;
  182. background: #303030;
  183. color: #F8DABA;
  184. font-size: 35rpx;
  185. color: #F8DABA;
  186. }
  187. }
  188. .top-bg {
  189. width: 750rpx;
  190. margin-bottom: 20rpx;
  191. image {
  192. width: 100%;
  193. }
  194. }
  195. </style>