index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view class="page">
  3. <view :style="{'height':height}">
  4. <scroll-view :style="{'height':height}" scroll-y>
  5. <view class="block_2 flex-row justify-start " v-for="(item,index) in projects.projectVos" :key="index" @click="clickItem(item)" >
  6. <view class="flex-col justify-center ">
  7. <u-icon v-if="item.id === serviceProjectId" name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
  8. <u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
  9. </view>
  10. <view class="outView ">
  11. <text lines="1" class="text_3">{{item.serviceName}}</text>
  12. <view class="group_2 ">
  13. <view class="image-text_2">
  14. <u-icon name="server-man" size="16"></u-icon>
  15. <text lines="1" class="text-group_2">服务人员:</text>
  16. <text lines="1" class="text_5">{{projects.personName}}</text>
  17. </view>
  18. <!-- <view class="group_3">-->
  19. <!-- <u-icon name="clock" size="16"></u-icon>-->
  20. <!-- <text lines="1" class="text-group_2">服务时间:</text>-->
  21. <!-- <text lines="1" decode="true" class="text_5">2023-8-14&nbsp;12:33:55</text>-->
  22. <!-- </view>-->
  23. </view>
  24. <view class="text-wrapper_3 flex-row justify-start">
  25. <text lines="1" class="text_7">标准价:</text>
  26. <text lines="1" class="text_8">¥{{item.standardPrice}}</text>
  27. <!-- <text lines="1" class="text_9 text_7">会员价:</text>-->
  28. <!-- <text lines="1" class="text_8">¥{{item.memberPrice}}</text>-->
  29. </view>
  30. <view class="box_4"></view>
  31. </view>
  32. </view>
  33. </scroll-view>
  34. </view>
  35. <!-- <view class="tabBarLineHeight"></view>-->
  36. <view class="bottomView">
  37. <!-- <view class="ticketView flex-row">-->
  38. <!-- <view class="ticketBtn" :class="{'ticketColor': ticketBtnIndex === 1}" @click="clickTicketBtn(1)">-->
  39. <!-- <text>使用权益券</text>-->
  40. <!-- </view>-->
  41. <!-- <view class="ticketBtn" :class="{'ticketColor': ticketBtnIndex === 2}" @click="clickTicketBtn(2)">-->
  42. <!-- <text>使用优惠券</text>-->
  43. <!-- </view>-->
  44. <!-- </view>-->
  45. <!-- <view v-if="ticketBtnIndex === 1" class="flex-row justify-center" @click="goUseRights">-->
  46. <!-- <view class="block_3 ">-->
  47. <!-- <text lines="1" class="text_15">权益卡</text>-->
  48. <!-- <view>-->
  49. <!-- <view class="flex-row justify-between" v-if="equitys.length>0">-->
  50. <!-- <view class="flex-row">-->
  51. <!-- <text class="text-group_5" v-for="(iter,i) in equitys" :key="i">{{iter.description}}</text>-->
  52. <!-- </view>-->
  53. <!-- <u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
  54. <!-- </view>-->
  55. <!-- <view v-else class="image-text_4 ">-->
  56. <!-- <text class="text-group_4">未选择</text>-->
  57. <!-- <u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
  58. <!-- </view>-->
  59. <!-- </view>-->
  60. <!-- </view>-->
  61. <!-- </view>-->
  62. <!-- <view v-if="ticketBtnIndex === 2" class="flex-row justify-center" @click="goUseCoupons">-->
  63. <!-- <view class="block_3 ">-->
  64. <!-- <text lines="1" class="text_15">优惠券</text>-->
  65. <!-- <view>-->
  66. <!-- <view class="flex-row justify-between" v-if="coupons.length>0">-->
  67. <!-- <view class="flex-row">-->
  68. <!-- <text class="text-group_5" v-for="(iter,i) in coupons" :key="i">{{iter.name}}:-¥{{iter.discountsPrice}}</text>-->
  69. <!-- </view>-->
  70. <!-- <u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
  71. <!-- </view>-->
  72. <!-- <view v-else class="image-text_4 ">-->
  73. <!-- <text class="text-group_4">未选择</text>-->
  74. <!-- <u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
  75. <!-- </view>-->
  76. <!-- </view>-->
  77. <!-- </view>-->
  78. <!-- </view>-->
  79. <view class="selectType flex-row justify-between" @click="popupClick">
  80. <text>请选择优惠方式</text>
  81. <text class="text-group_5" v-if="ticketBtnIndex === 1" v-for="(iter,i) in equitys" :key="i">{{iter.title}}</text>
  82. <text class="text-group_5" v-if="ticketBtnIndex === 2" v-for="(iter,i) in coupons" :key="i">{{iter.name}}:-¥{{iter.discountsPrice}}</text>
  83. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  84. </view>
  85. <view class="flex-row justify-center">
  86. <view class="submitButton" @click="addChildProject">确定</view>
  87. </view>
  88. </view>
  89. <uni-popup ref="popup" type="bottom" >
  90. <view class="popupView flex-row justify-around">
  91. <view class="flex-col justify-center" @click="goUseRights">
  92. <view class="flex-row justify-center">
  93. <u-icon name="/static/me/u694.png" color="#666" size="40"></u-icon>
  94. </view>
  95. <view class="imageText flex-row justify-center">
  96. <text>88卡用户</text>
  97. </view>
  98. </view>
  99. <view class="flex-col justify-center " @click="goUseCoupons">
  100. <view class="flex-row justify-center">
  101. <u-icon name="/static/me/u687.png" color="#666" size="40"></u-icon>
  102. </view>
  103. <view class="imageText flex-row justify-center">
  104. <text>优惠券</text>
  105. </view>
  106. </view>
  107. </view>
  108. </uni-popup>
  109. </view>
  110. </template>
  111. <script>
  112. export default {
  113. components: {
  114. },
  115. data() {
  116. return {
  117. height:'',
  118. coupons:[],
  119. equitys:[],
  120. couponIds:'',
  121. tabIndex: 3,
  122. projects:{},
  123. serviceStationId:'',
  124. orderId:'',
  125. serviceProject:{},
  126. serviceProjectId:'',
  127. serviceObjectId:'',
  128. ticketBtnIndex:1
  129. }
  130. },
  131. onLoad(e) {
  132. // 判断Openid是否为空
  133. let sysInfo=uni.getSystemInfoSync();
  134. this.height= sysInfo.windowHeight -120 +'px';
  135. this.orderId=e.orderId
  136. this.serviceStationId=e.serviceStationId
  137. this.serviceObjectId=e.serviceObjectId
  138. this.getStationById(e.serviceStationId)
  139. uni.$off('getUseCoupons')
  140. uni.$on('getUseCoupons',this.getUseCoupons)
  141. uni.$on('getEquity',this.getEquity)
  142. },
  143. methods: {
  144. popupClick(){
  145. this.$refs.popup.open()
  146. },
  147. clickTicketBtn(ticketBtnIndex){
  148. this.ticketBtnIndex =ticketBtnIndex
  149. },
  150. getEquity(e){
  151. this.equitys =e
  152. },
  153. goUseRights(){
  154. this.$refs.popup.close()
  155. if (this.serviceProjectId.length === 0){
  156. uni.$u.toast('请先选择服务项目')
  157. return
  158. }
  159. this.ticketBtnIndex = 1
  160. uni.navigateTo({
  161. url:'/storePages/useRights/index?serviceProjectId=' + this.serviceProjectId + '&serviceObjectId=' + this.serviceObjectId
  162. })
  163. },
  164. getUseCoupons(e){
  165. console.log('++++++++getUseCoupons+++++++++++++++',e)
  166. this.coupons= e
  167. this.couponIds = ''
  168. for (let eElement of e) {
  169. this.couponIds += eElement.id + ','
  170. }
  171. if (this.couponIds.length>0){
  172. this.couponIds = this.couponIds.substring(0,this.couponIds.length-1)
  173. }
  174. },
  175. goUseCoupons(){
  176. this.$refs.popup.close()
  177. if (this.serviceProjectId.length === 0){
  178. uni.$u.toast('请先选择服务项目')
  179. return
  180. }
  181. this.ticketBtnIndex = 2
  182. uni.navigateTo({
  183. url: '/orderPages/useCoupons/index?standardPrice='+this.serviceProject.standardPrice
  184. })
  185. },
  186. clickItem(item){
  187. if (this.equitys.length>0){
  188. if (item.id != this.equitys[0].serviceObjectId){
  189. this.equitys=[]
  190. }
  191. }
  192. this.serviceProjectId = item.id
  193. this.serviceProject = item
  194. },
  195. addChildProject(){
  196. if (this.ticketBtnIndex === 1){
  197. this.couponIds=''
  198. }
  199. if (this.ticketBtnIndex === 2){
  200. this.equitys=[]
  201. }
  202. if (!this.serviceProjectId){
  203. uni.$u.toast("请选择服务项目")
  204. return
  205. }
  206. let userEquityCardId
  207. if (this.equitys.length>0){
  208. userEquityCardId = this.equitys[0].id
  209. }
  210. this.$api.addChildProject({
  211. orderId:this.orderId,
  212. serviceProjectId:this.serviceProjectId,
  213. servicePersonId:this.projects.personId,
  214. serviceStationId:this.serviceStationId,
  215. couponIds:this.couponIds,
  216. userEquityCardId:userEquityCardId
  217. }).then(res=>{
  218. uni.navigateBack({
  219. delta:1
  220. })
  221. })
  222. },
  223. getStationById(qeCode){
  224. this.$api.getStationById({
  225. stationId:qeCode
  226. }).then(res=>{
  227. console.log('++++++++getStationById+++++++++++',res)
  228. this.projects=res.data.data
  229. })
  230. }
  231. }
  232. }
  233. </script>
  234. <style scoped lang="scss">
  235. @import '/common/css/common.css';
  236. @import './index.rpx.scss';
  237. </style>