加油站付款小程序,打印小票
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
4.5 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. <template>
  2. <view class="payment">
  3. <uni-nav-bar dark :fixed="true" background-color="#00aaff" :border="false" status-bar title="加油" />
  4. <view class="container">
  5. <uni-section title="油号" type="line" titleFontSize="34rpx"></uni-section>
  6. <view class="select-oil">
  7. <view class="oil-item">
  8. <view class="oil active-oil">
  9. <!-- <view class="unit"></view> -->
  10. <view class="number">#95</view>
  11. </view>
  12. </view>
  13. </view>
  14. <uni-section title="输入金额" type="line" titleFontSize="34rpx"></uni-section>
  15. <view class="money-input">
  16. <image src="../../static/payment/money.png" mode="widthFix"></image>
  17. <input v-model="form.money" @focus="focus" placeholder="请输入加油金额" type="number" />
  18. </view>
  19. <view v-if="form.money" class="tip">
  20. 折后共计{{ form.money * 0.99 }}
  21. </view>
  22. <view class="select-money">
  23. <view v-for="item in 3" class="money-item">
  24. <view @click="selectMoney(item * 100,item)" :class="{ 'active-money' : index == item }"
  25. class="money">
  26. <view class="unit"></view>
  27. <view class="number">{{ item * 100 }}</view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="sumit">提交订单</view>
  32. </view>
  33. <PrivacyAgreementPoup ref="showPrivacy"></PrivacyAgreementPoup>
  34. <uni-fab ref="fab" :content="content" :horizontal="horizontal" :vertical="vertical" :direction="direction"
  35. @trigger="clickMenu" />
  36. </view>
  37. </template>
  38. <script setup>
  39. import {
  40. onShow
  41. } from "@dcloudio/uni-app"
  42. import {
  43. reactive,
  44. ref
  45. } from "vue";
  46. import PrivacyAgreementPoup from "../../components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue";
  47. import api from '@/utils/api.js'
  48. const form = reactive({
  49. money: ''
  50. })
  51. const index = ref(0)
  52. const showPrivacy = ref()
  53. const content = reactive([{
  54. iconPath: '/static/payment/wedding-celebration.png',
  55. text: '婚庆服务',
  56. active: false,
  57. path : '/pages/weddingCelebration/weddingCelebration'
  58. }
  59. ])
  60. const horizontal = ref('right')
  61. const vertical = ref('bottom')
  62. const direction = ref('vertical')
  63. //生命周期
  64. onShow(() => {
  65. // if (wx.onNeedPrivacyAuthorization) {
  66. // console.log('onNeedPrivacyAuthorization');
  67. // wx.onNeedPrivacyAuthorization(resolve => {
  68. // console.log('onNeedPrivacyAuthorization');
  69. // this.resolvePrivacyAuthorization = resolve
  70. // showPrivacy.value.init(resolve)
  71. // })
  72. // }
  73. // uni.login({
  74. // success(res) {
  75. // console.log(res);
  76. // if (res.errMsg != "login:ok") {
  77. // return
  78. // }
  79. // api('wxLogin', {
  80. // code: res.code
  81. // }, res => {
  82. // if (res.code != 200) {
  83. // return
  84. // }
  85. // // state.userInfo = res.result.userInfo
  86. // // uni.setStorageSync('token', res.result.token)
  87. // if (state.userInfo) {
  88. // }
  89. // })
  90. // }
  91. // })
  92. })
  93. //用户选择加油金额
  94. function selectMoney(money, item) {
  95. form.money = money
  96. index.value = item
  97. }
  98. //输入框获得焦点
  99. function focus() {
  100. }
  101. //用户点击了悬浮按钮
  102. function clickMenu({ item }){
  103. uni.navigateTo({
  104. url: item.path
  105. })
  106. }
  107. </script>
  108. <style scoped>
  109. .payment {
  110. height: 100vh;
  111. background: #F1F5F8;
  112. width: 750rpx;
  113. margin: 0 auto;
  114. }
  115. .container {
  116. width: 96%;
  117. margin: 0rpx auto;
  118. border-radius: 20rpx;
  119. box-sizing: border-box;
  120. padding: 20rpx;
  121. overflow: hidden;
  122. background: white;
  123. margin-top: 20rpx;
  124. }
  125. .money-input {
  126. display: flex;
  127. align-items: center;
  128. background: #F6F7FB;
  129. padding: 30rpx 10rpx;
  130. border-radius: 20rpx;
  131. }
  132. .tip {
  133. color: #00aaff;
  134. margin-top: 10rpx;
  135. }
  136. .money-input image {
  137. width: 45rpx;
  138. }
  139. .money-input input {
  140. font-size: 36rpx;
  141. }
  142. .select-oil,
  143. .select-money {
  144. display: flex;
  145. justify-content: space-between;
  146. flex-wrap: wrap;
  147. margin: 30rpx 0rpx;
  148. }
  149. .select-oil {
  150. margin: 0;
  151. }
  152. .select-oil .oil-item,
  153. .select-money .money-item {
  154. width: 32.33%;
  155. background: #F1F5F8;
  156. border-radius: 20rpx;
  157. margin-bottom: 20rpx;
  158. overflow: hidden;
  159. }
  160. .select-oil .oil,
  161. .select-money .money {
  162. display: flex;
  163. align-items: center;
  164. justify-content: center;
  165. padding: 30rpx 0rpx;
  166. box-sizing: border-box;
  167. color: #5D5C61;
  168. }
  169. .select-oil .active-oil,
  170. .select-money .active-money {
  171. background: #00aaff;
  172. color: white;
  173. }
  174. .select-money .unit {
  175. font-size: 26rpx;
  176. }
  177. .select-money .number {
  178. font-size: 34rpx;
  179. }
  180. .sumit {
  181. background: #33a5fc;
  182. color: white;
  183. font-size: 36rpx;
  184. display: flex;
  185. align-items: center;
  186. justify-content: center;
  187. height: 80rpx;
  188. border-radius: 20rpx;
  189. }
  190. </style>