payment.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view>
  3. <!-- 弹窗 v-model双向绑定值 mode弹出位置 border-radius弹出层圆角-->
  4. <u-popup
  5. v-model="popupShow"
  6. mode="center"
  7. border-radius="14"
  8. width="80%"
  9. height="40%"
  10. close-icon-pos="top-left"
  11. :closeable="true"
  12. close-icon-color="#333333" >
  13. <view style="padding: 0 10%;height: 100%;width: 100%;">
  14. <!-- 标题占20% -->
  15. <view style="height: 20%;width: auto;">
  16. <text style="font-size: 30rpx;font-weight: bold;display: flex;justify-content: center;align-items: flex-end;height: 100%;">超级妈力</text>
  17. </view>
  18. <!-- 金额占30% -->
  19. <view style="height: 30%;width: auto;border-bottom: 1rpx solid #EFEFEF;">
  20. <text style="font-size: 78rpx;font-weight: 700;display: flex;justify-content: center;align-items: center;height: 100%;">¥{{norderAmount}}</text>
  21. </view>
  22. <!-- 支付方式占20% -->
  23. <view style="height: 20%;width: auto;">
  24. <view style="font-size: 30rpx;display: flex;align-items: center;height: 100%;">
  25. <text v-if="value=='钱包余额支付'">余额支付 (余额¥50.00元)</text>
  26. <text v-else>微信支付</text>
  27. </view>
  28. </view>
  29. <!-- 按钮占25% -->
  30. <view style="height: 25%;width: auto;">
  31. <view style="display: flex;justify-content: center;align-items: center;height: 100%;">
  32. <u-button type="primary" style="width: 100%;" @click="payment">确认支付</u-button>
  33. </view>
  34. </view>
  35. </view>
  36. </u-popup>
  37. <uni-list :border="false">
  38. <image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/caixian.png" style="width: 100%; height: 5rpx; background-color: #FFFFFF;"></image>
  39. <uni-list-item :border="false">
  40. <view slot="header" style="color:#666666 ; font-size: 28rpx;">
  41. <text v-if="product_type == '1' ">{{doctorName}} 电话咨询</text>
  42. <text v-if="product_type == '2' ">疫苗图文咨询</text>
  43. <text v-if="product_type == '3' ">门诊预约</text>
  44. <text v-if="product_type == '4' ">疫苗接种预约</text>
  45. <text v-if="product_type == '5' ">儿保预约</text>
  46. <text v-if="product_type == '6' ">服务包</text>
  47. <text v-if="product_type == '7' ">充值</text>
  48. </view>
  49. <view slot="footer" style="color:#FF4F61 ;font-weight: 500;">
  50. {{orderAmount}}
  51. </view>
  52. </uni-list-item>
  53. <!-- 线条 -->
  54. <u-line color="#EFEFEF" />
  55. <uni-list-item :border="false" :link="true">
  56. <view slot="header" style="color:#666666 ; font-size: 28rpx;">
  57. 优惠券
  58. </view>
  59. <view slot="footer" style="font-size: 30rpx;">
  60. {{coupon}}
  61. </view>
  62. </uni-list-item>
  63. </uni-list>
  64. <u-gap height="20" bg-color="#F6F6F6"></u-gap>
  65. <uni-list :border="false">
  66. <uni-list-item :border="false">
  67. <view slot="header" style="font-size: 28rpx; font-weight: 500;color: #666666;">支付方式</view>
  68. </uni-list-item>
  69. <!-- 加一个单选 -->
  70. <u-radio-group v-model="value" v-for="(item, index) in paymenMethod">
  71. <uni-list-item :border="false" @click="value=item.name" :clickable="true">
  72. <view slot="header">
  73. <text style="font-size: 28rpx;font-weight: 400;color: #333333;">{{item.name}}</text>
  74. <text v-if="item.name=='钱包余额支付' " style="font-size: 28rpx;font-weight: 500;">{{money}}</text>
  75. </view>
  76. <view slot="footer">
  77. <u-radio @change="radioChange" :key="index" :name="item.name" :disabled="item.disabled">
  78. </u-radio>
  79. </view>
  80. </uni-list-item>
  81. <u-line color="#EFEFEF" />
  82. </u-radio-group>
  83. </uni-list>
  84. <!-- 按钮 -->
  85. <view class="cu-bar bg-white tabbar border shop" style="position: fixed; bottom: 0; z-index: 99;width: 100%;">
  86. <view class="" style="width:75%;">
  87. <text style="padding-left: 30rpx;font-size: 32rpx;">合计:</text>
  88. <text style="padding-left: 20rpx;font-size: 36;font-weight: 500;color: #FF4F61;">{{orderAmount}}</text>
  89. </view>
  90. <view class="submit text-white" @click="popupShow=true" style="background-color: rgb(11,115,186); font-size: 32rpx;">确认支付</view>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. export default {
  96. data() {
  97. return {
  98. //医生名称
  99. doctorName: '',
  100. ndoctorName: '渣渣宝',
  101. //订单金额
  102. orderAmount: '',
  103. norderAmount: 19.9,
  104. //优惠券
  105. coupon: '不使用优惠券',
  106. //钱包余额
  107. money: '',
  108. nmoney: 0.00,
  109. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  110. value: '微信支付',
  111. paymenMethod: [{
  112. name: '微信支付',
  113. disabled: false
  114. }, {
  115. name: '钱包余额支付',
  116. disabled: false
  117. }],
  118. //弹出层控制
  119. popupShow:false,
  120. //订单类型
  121. product_type:'1'
  122. }
  123. },
  124. methods: {
  125. // 选中某个单选框时,由radio时触发
  126. radioChange(e) {
  127. console.log(e);
  128. },
  129. // 选中任一radio时,由radio-group触发
  130. radioGroupChange(e) {
  131. // console.log(e);
  132. },
  133. //充值
  134. recharge(e) {
  135. },
  136. click(e) {
  137. console.log(e)
  138. },
  139. //点击确认支付
  140. payment(e){
  141. uni.navigateTo({
  142. url: '/pages/order/order'
  143. });
  144. }
  145. },
  146. onShow() {
  147. this.orderAmount = this.norderAmount + "元"
  148. this.money = " ¥" + this.nmoney + "元"
  149. },
  150. onHide() {
  151. this.popupShow = false
  152. }
  153. }
  154. </script>
  155. <style>
  156. /* 支付文字 */
  157. .paymentText {
  158. height: 60rpx;
  159. width: auto;
  160. background-color: #FFFFFF;
  161. padding: 30rpx 0 0 30rpx;
  162. font-size: 24rpx;
  163. }
  164. </style>