pay.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view class="container">
  3. <view class="countDown">
  4. 交易剩余时间
  5. <uv-count-down :time="countDownTime" format="mm:ss" @change="change" @finish="finish"></uv-count-down>
  6. </view>
  7. <view class="price">
  8. <text>¥</text>
  9. {{ info.price + '.00' || '188.00' }}
  10. </view>
  11. <view class="title">住房信息</view>
  12. <view class="info">
  13. <view class="info_time">
  14. {{ info.detaliInfo.startTimeMonth || 8 }}月{{ info.detaliInfo.startTimeDay || 2 }}日
  15. <text class="gap">星期{{ info.detaliInfo.startTimeWeek || '三' }}</text>
  16. <view class="time_line"></view>
  17. <view class="time_num">{{ info.detaliInfo.nightNum || 1 }}晚</view>
  18. <view class="time_line"></view>
  19. <view class="gap">{{ info.detaliInfo.endTimeMonth || 8 }}月{{ info.detaliInfo.endTimeDay || 3 }}日</view>
  20. <text>星期{{ info.detaliInfo.endTimeWeek || '四' }}</text>
  21. </view>
  22. <view class="info_msg">{{ info.detaliInfo.item.hName }}</view>
  23. <view class="info_type">
  24. <view class="type_item">包吃住型</view>
  25. <view class="type_item">包吃住型</view>
  26. <view class="type_item">包吃住型</view>
  27. </view>
  28. <view class="info_tag">
  29. <view class="tag_item">{{ info.detaliInfo.item.hAreas }}㎡</view>
  30. <view class="tag_item">双人床</view>
  31. <view class="tag_item">窗户位于走廊/窗户较小</view>
  32. </view>
  33. </view>
  34. <view class="title">支付方式</view>
  35. <view class="way">
  36. <view class="way_item" @click="handleChange">
  37. <img src="../../static/index/wxPay.png" />
  38. <view class="way_text">微信支付</view>
  39. <radio class="way_radio" :checked="isChecked" />
  40. </view>
  41. </view>
  42. <!-- 提交订单区域 -->
  43. <view class="btn" @click="handleSub">支付</view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. isChecked: true,
  51. info: {},
  52. // 倒计时时间(毫秒)
  53. countDownTime: 1000 * 60 * 15
  54. }
  55. },
  56. onLoad(options) {
  57. if (options.info) {
  58. this.info = JSON.parse(options.info)
  59. }
  60. console.log(this.info)
  61. },
  62. methods: {
  63. // 点击支付按钮回调
  64. handleSub() {
  65. if (this.isChecked) {
  66. // const res = await this.$myRequest({
  67. // url: '/mhotel/abkcreateOrder.action',
  68. // data: {
  69. // houseId: this.info.detaliInfo.item.id,
  70. // startTime: this.info.detaliInfo.queryStartTime,
  71. // endTime: this.info.detaliInfo.queryEndTime,
  72. // houseOrderNumber: this.info.houseOrderNumber,
  73. // userName: this.info.userName,
  74. // userPhone: this.info.userPhone,
  75. // userId: uni.getStorageSync('userInfo').id
  76. // }
  77. // })
  78. // console.log(res)
  79. // 1 支付成功 2 支付失败
  80. // uni.navigateTo({
  81. // url: '/pages/payStatus/payStatus?status=1'
  82. // })
  83. } else {
  84. uni.showToast({
  85. title: '请选择支付方式',
  86. icon: 'none'
  87. })
  88. }
  89. },
  90. // 点击支付方式回调
  91. handleChange() {
  92. this.isChecked = !this.isChecked
  93. },
  94. // 倒计时变化时触发
  95. change(e) {
  96. // console.log(e)
  97. },
  98. // 倒计时结束回调
  99. finish() {
  100. uni.showModal({
  101. title: '提示',
  102. content: '订单已超过可支付时间,请重新下单',
  103. showCancel: false,
  104. success: (res) => {
  105. if (res.confirm) {
  106. uni.switchTab({
  107. url: '/pages/home/home'
  108. })
  109. }
  110. }
  111. })
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .container {
  118. position: relative;
  119. box-sizing: border-box;
  120. padding: 0 20rpx 160rpx;
  121. min-height: 100vh;
  122. background-color: #f2f3f5;
  123. .countDown {
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. height: 70rpx;
  128. color: #808080;
  129. font-size: 24rpx;
  130. }
  131. .price {
  132. display: flex;
  133. justify-content: center;
  134. align-items: center;
  135. height: 65rpx;
  136. font-size: 50rpx;
  137. font-weight: bold;
  138. text {
  139. font-size: 28rpx;
  140. }
  141. }
  142. .title {
  143. margin-top: 14rpx;
  144. color: #808080;
  145. font-size: 24rpx;
  146. }
  147. .info {
  148. display: flex;
  149. flex-direction: column;
  150. box-sizing: border-box;
  151. padding: 0 30rpx;
  152. margin-top: 18rpx;
  153. width: 100%;
  154. border-radius: 15rpx;
  155. background-color: #fff;
  156. .info_time {
  157. display: flex;
  158. align-items: center;
  159. margin-top: 20rpx;
  160. font-size: 32rpx;
  161. font-weight: bold;
  162. .time_line {
  163. width: 17rpx;
  164. height: 1rpx;
  165. background-color: #096562;
  166. }
  167. .time_num {
  168. box-sizing: border-box;
  169. padding: 0 15rpx;
  170. height: 46rpx;
  171. line-height: 46rpx;
  172. font-size: 24rpx;
  173. font-weight: 400;
  174. border-radius: 66rpx;
  175. border: 1rpx solid #096562;
  176. background-color: #f0f2f5;
  177. }
  178. .gap {
  179. margin: 0 10rpx;
  180. }
  181. text {
  182. font-size: 24rpx;
  183. font-weight: 400;
  184. }
  185. }
  186. .info_msg {
  187. margin-top: 15rpx;
  188. font-size: 28rpx;
  189. font-weight: bold;
  190. }
  191. .info_type {
  192. display: flex;
  193. flex-wrap: wrap;
  194. margin-top: 15rpx;
  195. .type_item {
  196. box-sizing: border-box;
  197. padding: 0 15rpx;
  198. margin-right: 20rpx;
  199. height: 41rpx;
  200. line-height: 41rpx;
  201. font-size: 24rpx;
  202. color: #fff;
  203. border-radius: 34rpx;
  204. background-color: #096562;
  205. }
  206. }
  207. .info_tag {
  208. display: flex;
  209. flex-wrap: wrap;
  210. margin: 18rpx 0 30rpx;
  211. color: #808080;
  212. font-size: 24rpx;
  213. .tag_item {
  214. margin-right: 20rpx;
  215. }
  216. }
  217. }
  218. .way {
  219. .way_item {
  220. display: flex;
  221. align-items: center;
  222. box-sizing: border-box;
  223. padding: 0 30rpx;
  224. margin-top: 18rpx;
  225. height: 100rpx;
  226. font-size: 28rpx;
  227. border-radius: 15rpx;
  228. background-color: #fff;
  229. img {
  230. width: 40rpx;
  231. height: 40rpx;
  232. }
  233. .way_text {
  234. margin-left: 18rpx;
  235. }
  236. .way_radio {
  237. margin-left: auto;
  238. transform: scale(0.9);
  239. }
  240. }
  241. }
  242. .btn {
  243. position: fixed;
  244. bottom: 40rpx;
  245. display: flex;
  246. justify-content: center;
  247. align-items: center;
  248. width: 710rpx;
  249. height: 96rpx;
  250. color: #fff;
  251. font-size: 32rpx;
  252. border-radius: 64rpx;
  253. background-color: #096562;
  254. }
  255. }
  256. </style>