index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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="goUseRights">
  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" @click="goUseCoupons">
  52. <view class="block_3 ">
  53. <text lines="1" class="text_15">优惠券</text>
  54. <view>
  55. <view class="flex-row justify-between" v-if="coupons.length>0">
  56. <view class="flex-row">
  57. <text class="text-group_5" v-for="(iter,i) in coupons" :key="i">{{iter.name}}:-¥{{iter.discountsPrice}}</text>
  58. </view>
  59. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  60. </view>
  61. <view v-else class="image-text_4 ">
  62. <text class="text-group_4">未选择</text>
  63. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="flex-row justify-center">
  69. <view class="submitButton" @click="addChildProject">确定</view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. components: {
  78. },
  79. data() {
  80. return {
  81. coupons:[],
  82. couponIds:'',
  83. tabIndex: 3,
  84. projects:{},
  85. serviceStationId:'',
  86. orderId:'',
  87. serviceProject:{},
  88. serviceProjectId:'',
  89. }
  90. },
  91. onLoad(e) {
  92. this.orderId=e.orderId
  93. this.serviceStationId=e.serviceStationId
  94. this.getStationById(e.serviceStationId)
  95. uni.$off('getUseCoupons')
  96. uni.$on('getUseCoupons',this.getUseCoupons)
  97. },
  98. methods: {
  99. goUseRights(){
  100. uni.navigateTo({
  101. url:'/storePages/useRights/index'
  102. })
  103. },
  104. getUseCoupons(e){
  105. console.log('++++++++getUseCoupons+++++++++++++++',e)
  106. this.coupons= e
  107. this.couponIds = ''
  108. for (let eElement of e) {
  109. this.couponIds += eElement.id + ','
  110. }
  111. if (this.couponIds.length>0){
  112. this.couponIds = this.couponIds.substring(0,this.couponIds.length-1)
  113. }
  114. },
  115. goUseCoupons(){
  116. if (this.serviceProjectId.length === 0){
  117. uni.$u.toast('请先选择服务项目')
  118. return
  119. }
  120. uni.navigateTo({
  121. url: '/orderPages/useCoupons/index?standardPrice='+this.serviceProject.standardPrice
  122. })
  123. },
  124. clickItem(item){
  125. this.serviceProjectId = item.id
  126. this.serviceProject = item
  127. },
  128. addChildProject(){
  129. if (this.id === ''){
  130. uni.$u.toast("请选择服务项目")
  131. }
  132. this.$api.addChildProject({
  133. orderId:this.orderId,
  134. serviceProjectId:this.serviceProjectId,
  135. servicePersonId:this.projects.personId,
  136. serviceStationId:this.serviceStationId,
  137. couponIds:this.couponIds
  138. }).then(res=>{
  139. uni.navigateTo({
  140. url:'/orderPages/orderDetail/index?id='+ this.orderId
  141. })
  142. })
  143. },
  144. getStationById(qeCode){
  145. this.$api.getStationById({
  146. stationId:qeCode
  147. }).then(res=>{
  148. console.log('++++++++getStationById+++++++++++',res)
  149. this.projects=res.data.data
  150. })
  151. }
  152. }
  153. }
  154. </script>
  155. <style scoped lang="scss">
  156. @import '/common/css/common.css';
  157. @import './index.rpx.scss';
  158. </style>