yigePayCenter.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view>
  3. <u-navbar leftIconColor="#2AABB0" title="" :autoBack="true" placeholder>
  4. <view slot="center" class="navCenter">
  5. <image src="/static/staticPay/icon1.png" mode=""></image>
  6. <view>宜格收银台</view>
  7. </view>
  8. </u-navbar>
  9. <view class="garyArea">
  10. <view class="garyArea_val">¥0.00</view>
  11. <view class="garyArea_lab">付款金额</view>
  12. </view>
  13. <view class="btnArea">
  14. <view class="btnArea_title">支付方式</view>
  15. <view class="btnArea_item" @click="activeFun(1)">
  16. <view class="btnArea_item_l">
  17. <image src="/static/staticPay/icon3.png" mode=""></image>
  18. <view>微信支付</view>
  19. </view>
  20. <view class="btnArea_item_r" :class="{active:activeIndex==1}">
  21. <view></view>
  22. </view>
  23. </view>
  24. <view class="btnArea_item" @click="activeFun(0)">
  25. <view class="btnArea_item_l">
  26. <image src="/static/staticPay/icon2.png" mode=""></image>
  27. <view>支付宝</view>
  28. </view>
  29. <view class="btnArea_item_r " :class="{active:activeIndex==0}">
  30. <view></view>
  31. </view>
  32. </view>
  33. <view class="btnArea_btn" @click="clickBtn()">
  34. 确认支付 {{time}}
  35. </view>
  36. <view class="btnArea_tig">
  37. 请在
  38. <text>20</text>
  39. 分钟内完成付款,否则订单失效
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {
  48. time:"00.20.00",
  49. activeIndex:1
  50. }
  51. },
  52. onLoad() {
  53. console.log(uni.$u.config.v);
  54. this.clock()
  55. },
  56. methods: {
  57. activeFun(index){
  58. this.activeIndex=index;
  59. },
  60. clickBtn(){
  61. uni.showToast({
  62. icon:"none",
  63. title: '请在APP中发起支付',
  64. duration: 2000
  65. });
  66. },
  67. clock(times = 1200) {
  68. //页面加载时设置需要倒计时的秒数,计算小时
  69. var shi = parseInt(times / 3600);
  70. if (shi < 10) {
  71. shi = "0" + shi
  72. }
  73. //计算分钟
  74. var fen = parseInt((times % 3600) / 60);
  75. if (fen < 10) {
  76. fen = "0" + fen
  77. }
  78. //计算秒
  79. var miao = (times % 3600) % 60;
  80. if (miao < 10) {
  81. miao = "0" + miao
  82. }
  83. this.time=shi+':'+fen + ":" + miao
  84. let timeout
  85. if (times > 0) {
  86. times=times - 1
  87. //定时1秒,然后调用自身clock方法
  88. timeout = setTimeout(() => {
  89. this.clock(times);
  90. }, 1000);
  91. } else {
  92. clearTimeout(timeout)
  93. return
  94. }
  95. },
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .navCenter {
  101. display: flex;
  102. align-items: center;
  103. image {
  104. width: 43rpx;
  105. height: 44rpx;
  106. margin-right: 6rpx;
  107. }
  108. >view {
  109. font-size: 36rpx;
  110. color: #1A1A1A;
  111. font-weight: 700;
  112. }
  113. }
  114. .garyArea {
  115. background: #F5F5F5;
  116. padding: 70rpx 0 90rpx 0;
  117. .garyArea_val {
  118. font-size: 50rpx;
  119. color: #2AABB0;
  120. font-weight: 700;
  121. ;
  122. text-align: center;
  123. }
  124. .garyArea_lab {
  125. font-size: 28rpx;
  126. color: #666666;
  127. text-align: center;
  128. }
  129. }
  130. .btnArea {
  131. padding: 54rpx 60rpx;
  132. border-radius: 40rpx 40rpx 0 0;
  133. position: relative;
  134. background: #FFFFFF;
  135. top: -40rpx;
  136. .btnArea_title {
  137. font-size: 32rpx;
  138. color: #333333;
  139. font-weight: 700;
  140. margin-bottom: 50rpx;
  141. }
  142. .btnArea_item {
  143. display: flex;
  144. justify-content: space-between;
  145. align-items: center;
  146. margin-top: 30rpx;
  147. .btnArea_item_l {
  148. font-size: 28rpx;
  149. color: #666666;
  150. display: flex;
  151. align-items: center;
  152. image {
  153. width: 58rpx;
  154. height: 58rpx;
  155. margin-right: 20rpx;
  156. }
  157. }
  158. .btnArea_item_r {
  159. width: 36rpx;
  160. height: 36rpx;
  161. border: 1rpx solid #B3B3B3;
  162. border-radius: 50%;
  163. >view {
  164. display: none;
  165. }
  166. }
  167. .active {
  168. border-color: rgb(28,167,175);
  169. display: flex;
  170. align-items: center;
  171. justify-content: center;
  172. >view {
  173. display: block;
  174. width: 18rpx;
  175. height: 18rpx;
  176. border-radius: 50%;
  177. background: rgb(28,167,175);
  178. }
  179. }
  180. }
  181. .btnArea_btn {
  182. width: 630rpx;
  183. height: 90rpx;
  184. background: linear-gradient(#29b2a2 0%, #2aa7bd 100%);
  185. border-radius: 45rpx;
  186. margin: 100rpx auto 0;
  187. text-align: center;
  188. line-height: 90rpx;
  189. font-size: 32rpx;
  190. color: #FFFFFF;
  191. }
  192. .btnArea_tig {
  193. font-size: 24rpx;
  194. color: #808080;
  195. margin-top: 26rpx;
  196. text-align: center;
  197. letter-spacing: 2rpx;
  198. font-weight: 600;
  199. text {
  200. color: #FF0000;
  201. }
  202. }
  203. }
  204. </style>