pay.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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 || '188.00' }}
  10. </view>
  11. <view class="title">住房信息</view>
  12. <view class="info">
  13. <view class="info_time">
  14. {{ info.startTimeMonth || 8 }}月{{ info.startTimeDay || 2 }}日
  15. <text class="gap">星期{{ info.startTimeWeek || '三' }}</text>
  16. <view class="time_line"></view>
  17. <view class="time_num">{{ info.nightNum || 1 }}晚</view>
  18. <view class="time_line"></view>
  19. <view class="gap">{{ info.endTimeMonth || 8 }}月{{ info.endTimeDay || 3 }}日</view>
  20. <text>星期{{ info.endTimeWeek || '四' }}</text>
  21. </view>
  22. <view class="info_msg">大床房</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">16-20㎡</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. // 1 支付成功 2 支付失败
  67. uni.navigateTo({
  68. url: '/pages/payStatus/payStatus?status=1'
  69. })
  70. } else {
  71. uni.showToast({
  72. title: '请选择支付方式',
  73. icon: 'none'
  74. })
  75. }
  76. },
  77. // 点击支付方式回调
  78. handleChange() {
  79. this.isChecked = !this.isChecked
  80. },
  81. // 倒计时变化时触发
  82. change(e) {
  83. // console.log(e)
  84. },
  85. // 倒计时结束回调
  86. finish() {
  87. uni.showModal({
  88. title: '提示',
  89. content: '订单已超过可支付时间,请重新下单',
  90. showCancel: false,
  91. success: (res) => {
  92. if (res.confirm) {
  93. uni.switchTab({
  94. url: '/pages/home/home'
  95. })
  96. }
  97. }
  98. })
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .container {
  105. position: relative;
  106. box-sizing: border-box;
  107. padding: 0 20rpx 160rpx;
  108. min-height: 100vh;
  109. background-color: #f2f3f5;
  110. .countDown {
  111. display: flex;
  112. justify-content: center;
  113. align-items: center;
  114. height: 70rpx;
  115. color: #808080;
  116. font-size: 24rpx;
  117. }
  118. .price {
  119. display: flex;
  120. justify-content: center;
  121. align-items: center;
  122. height: 65rpx;
  123. font-size: 50rpx;
  124. font-weight: bold;
  125. text {
  126. font-size: 28rpx;
  127. }
  128. }
  129. .title {
  130. margin-top: 14rpx;
  131. color: #808080;
  132. font-size: 24rpx;
  133. }
  134. .info {
  135. display: flex;
  136. flex-direction: column;
  137. box-sizing: border-box;
  138. padding: 0 30rpx;
  139. margin-top: 18rpx;
  140. width: 100%;
  141. border-radius: 15rpx;
  142. background-color: #fff;
  143. .info_time {
  144. display: flex;
  145. align-items: center;
  146. margin-top: 20rpx;
  147. font-size: 32rpx;
  148. font-weight: bold;
  149. .time_line {
  150. width: 17rpx;
  151. height: 1rpx;
  152. background-color: #096562;
  153. }
  154. .time_num {
  155. box-sizing: border-box;
  156. padding: 0 15rpx;
  157. height: 46rpx;
  158. line-height: 46rpx;
  159. font-size: 24rpx;
  160. font-weight: 400;
  161. border-radius: 66rpx;
  162. border: 1rpx solid #096562;
  163. background-color: #f0f2f5;
  164. }
  165. .gap {
  166. margin: 0 10rpx;
  167. }
  168. text {
  169. font-size: 24rpx;
  170. font-weight: 400;
  171. }
  172. }
  173. .info_msg {
  174. margin-top: 15rpx;
  175. font-size: 28rpx;
  176. font-weight: bold;
  177. }
  178. .info_type {
  179. display: flex;
  180. flex-wrap: wrap;
  181. margin-top: 15rpx;
  182. .type_item {
  183. box-sizing: border-box;
  184. padding: 0 15rpx;
  185. margin-right: 20rpx;
  186. height: 41rpx;
  187. line-height: 41rpx;
  188. font-size: 24rpx;
  189. color: #fff;
  190. border-radius: 34rpx;
  191. background-color: #096562;
  192. }
  193. }
  194. .info_tag {
  195. display: flex;
  196. flex-wrap: wrap;
  197. margin: 18rpx 0 30rpx;
  198. color: #808080;
  199. font-size: 24rpx;
  200. .tag_item {
  201. margin-right: 20rpx;
  202. }
  203. }
  204. }
  205. .way {
  206. .way_item {
  207. display: flex;
  208. align-items: center;
  209. box-sizing: border-box;
  210. padding: 0 30rpx;
  211. margin-top: 18rpx;
  212. height: 100rpx;
  213. font-size: 28rpx;
  214. border-radius: 15rpx;
  215. background-color: #fff;
  216. img {
  217. width: 40rpx;
  218. height: 40rpx;
  219. }
  220. .way_text {
  221. margin-left: 18rpx;
  222. }
  223. .way_radio {
  224. margin-left: auto;
  225. transform: scale(0.9);
  226. }
  227. }
  228. }
  229. .btn {
  230. position: fixed;
  231. bottom: 40rpx;
  232. display: flex;
  233. justify-content: center;
  234. align-items: center;
  235. width: 710rpx;
  236. height: 96rpx;
  237. color: #fff;
  238. font-size: 32rpx;
  239. border-radius: 64rpx;
  240. background-color: #096562;
  241. }
  242. }
  243. </style>