index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="content">
  3. <view class="page">
  4. <view class="block_2 flex-row justify-start" v-for="(item,index) in projects.projectVos" :key="index" @click="clickItem(item)">
  5. <view class="flex-col justify-center ">
  6. <u-icon v-if="item.id === serviceProjectId" name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
  7. <u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
  8. </view>
  9. <view class="outView ">
  10. <text lines="1" class="text_3">{{item.serviceName}}</text>
  11. <view class="group_2 ">
  12. <view class="image-text_2">
  13. <u-icon name="server-man" size="16"></u-icon>
  14. <text lines="1" class="text-group_2">服务人员:</text>
  15. <text lines="1" class="text_5">{{projects.personName}}</text>
  16. </view>
  17. <!-- <view class="group_3">-->
  18. <!-- <u-icon name="clock" size="16"></u-icon>-->
  19. <!-- <text lines="1" class="text-group_2">服务时间:</text>-->
  20. <!-- <text lines="1" decode="true" class="text_5">2023-8-14&nbsp;12:33:55</text>-->
  21. <!-- </view>-->
  22. </view>
  23. <view class="text-wrapper_3 flex-row justify-start">
  24. <text lines="1" class="text_7">标准价:</text>
  25. <text lines="1" class="text_8">¥{{item.standardPrice}}</text>
  26. <!-- <text lines="1" class="text_9 text_7">会员价:</text>-->
  27. <!-- <text lines="1" class="text_8">¥{{item.memberPrice}}</text>-->
  28. </view>
  29. <view class="box_4"></view>
  30. </view>
  31. </view>
  32. <view class="tabBarLineHeight"></view>
  33. <view class="bottomView ">
  34. <view class="flex-row justify-center" @click="goUseCoupons">
  35. <view class="block_3 ">
  36. <text lines="1" class="text_15">优惠券</text>
  37. <view>
  38. <view class="flex-row justify-between" v-if="coupons.length>0">
  39. <view class="flex-row">
  40. <text class="text-group_5" v-for="(iter,i) in coupons" :key="i">{{iter.name}}:-¥{{iter.discountsPrice}}</text>
  41. </view>
  42. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  43. </view>
  44. <view v-else class="image-text_4 ">
  45. <text class="text-group_4">未选择</text>
  46. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="flex-row justify-center">
  52. <view class="submitButton" @click="addChildProject">确定</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. components: {
  61. },
  62. data() {
  63. return {
  64. coupons:[],
  65. couponIds:'',
  66. tabIndex: 3,
  67. projects:{},
  68. serviceStationId:'',
  69. orderId:'',
  70. serviceProject:{},
  71. serviceProjectId:'',
  72. }
  73. },
  74. onLoad(e) {
  75. this.orderId=e.orderId
  76. this.serviceStationId=e.serviceStationId
  77. this.getStationById(e.serviceStationId)
  78. uni.$off('getUseCoupons')
  79. uni.$on('getUseCoupons',this.getUseCoupons)
  80. },
  81. methods: {
  82. getUseCoupons(e){
  83. console.log('++++++++getUseCoupons+++++++++++++++',e)
  84. this.coupons= e
  85. this.couponIds = ''
  86. for (let eElement of e) {
  87. this.couponIds += eElement.id + ','
  88. }
  89. if (this.couponIds.length>0){
  90. this.couponIds = this.couponIds.substring(0,this.couponIds.length-1)
  91. }
  92. },
  93. goUseCoupons(){
  94. if (this.serviceProjectId.length === 0){
  95. uni.$u.toast('请先选择服务项目')
  96. return
  97. }
  98. uni.navigateTo({
  99. url: '/orderPages/useCoupons/index?standardPrice='+this.serviceProject.standardPrice
  100. })
  101. },
  102. clickItem(item){
  103. this.serviceProjectId = item.id
  104. this.serviceProject = item
  105. },
  106. addChildProject(){
  107. if (this.id === ''){
  108. uni.$u.toast("请选择服务项目")
  109. }
  110. this.$api.addChildProject({
  111. orderId:this.orderId,
  112. serviceProjectId:this.serviceProjectId,
  113. servicePersonId:this.projects.personId,
  114. serviceStationId:this.serviceStationId,
  115. couponIds:this.couponIds
  116. }).then(res=>{
  117. uni.navigateTo({
  118. url:'/orderPages/orderDetail/index?id='+ this.orderId
  119. })
  120. })
  121. },
  122. getStationById(qeCode){
  123. this.$api.getStationById({
  124. stationId:qeCode
  125. }).then(res=>{
  126. console.log('++++++++getStationById+++++++++++',res)
  127. this.projects=res.data.data
  128. })
  129. }
  130. }
  131. }
  132. </script>
  133. <style scoped lang="scss">
  134. @import '/common/css/common.css';
  135. @import './index.rpx.scss';
  136. </style>