index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="page">
  3. <view class="row-list flex-row justify-start" v-for="(item,index) in 10" :key="index">
  4. <view class="h-text flex-col justify-center ">
  5. <view class="money">
  6. <text>¥100</text>
  7. </view>
  8. <view class="desc">
  9. <text>权益券</text>
  10. </view>
  11. </view>
  12. <view class="h-center-content flex-col ">
  13. <view class="h-value">
  14. <text>门店通用</text>
  15. </view>
  16. <view class="title">
  17. 使用平台:<text>全平台</text>
  18. </view>
  19. <view class="title">
  20. 使用次数:3
  21. </view>
  22. <view class="title">
  23. 到期时间:2023-12-12
  24. </view>
  25. </view>
  26. <view class="h-right-content flex-col justify-center ">
  27. <picker @change="bindPickerChange" mode='selector' range-key="nickName" :value="serviceObjectIndex" :range="serviceObjectList">
  28. <view class="btn" @click="payRights(item)">
  29. <text>购买</text>
  30. </view>
  31. </picker>
  32. </view>
  33. </view>
  34. <uni-popup ref="popup" :catchtouchmove="true" :animation="false" type="bottom">
  35. <view class=" payView">
  36. <view class="flex-row justify-between">
  37. <text class="payType">请选择支付方式</text>
  38. <image class="x" src="/static/common/ox.png" @click="closePayPopup"></image>
  39. </view>
  40. <view class="payTitle">
  41. <text>选择微信支付或余额支付</text>
  42. </view>
  43. <view class="payItem flex-row justify-between" @click="payItem(1)">
  44. <view class="flex-row">
  45. <u-icon name="/static/me/u701.png" color="#38db38" size="36"></u-icon>
  46. <view class="payName flex-col justify-center">
  47. <text>余额支付</text>
  48. <text class="balance">可以余额¥{{userInfo.balance || 0}}</text>
  49. </view>
  50. </view>
  51. <view class="flex-col justify-center">
  52. <view v-if="curServiceTab === 1" >
  53. <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
  54. </view>
  55. <view v-else>
  56. <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="payItem flex-row justify-between" @click="payItem(2)">
  61. <view class="flex-row">
  62. <u-icon name="weixin-circle-fill" color="#38db38" size="36"></u-icon>
  63. <view class="payName flex-col justify-center">
  64. <text>微信支付</text>
  65. </view>
  66. </view>
  67. <view class="flex-col justify-center">
  68. <view v-if="curServiceTab === 2" >
  69. <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
  70. </view>
  71. <view v-else>
  72. <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="commitBtn" @click="commonGeneralOrder">
  77. <text>确定</text>
  78. </view>
  79. </view>
  80. </uni-popup>
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. data() {
  86. return {
  87. curServiceTab:1,
  88. orderRights:{},
  89. userInfo:{},
  90. serviceObjectList:[],
  91. serviceObjectIndex:0
  92. };
  93. },
  94. onLoad(option) {
  95. this.userInfo = uni.getStorageSync('userInfo')
  96. this.listServiceObject()
  97. },
  98. methods: {
  99. bindPickerChange(e){
  100. console.log(e)
  101. },
  102. // 查询服务对像信息列表
  103. listServiceObject(){
  104. this.$api.listServiceObject(this.reqParm).then((res)=>{
  105. this.serviceObjectList = res.data.data
  106. })
  107. },
  108. closePayPopup(){
  109. this.$refs.popup.close()
  110. },
  111. payItem(num){
  112. if (this.userInfo.balance < this.price){
  113. return
  114. }
  115. this.curServiceTab = num
  116. },
  117. payRights(item){
  118. this.orderRights = item
  119. }
  120. },
  121. };
  122. </script>
  123. <style lang="scss" scoped>
  124. @import '/common/css/common.css';
  125. @import './index.rpx.scss';
  126. </style>