|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
<view class="page">
|
|
|
- <view class="block_2 flex-row justify-start" v-for="(item,index) in projects.projectVos" :key="index" @click="clickItem(item.id)">
|
|
|
+ <view class="block_2 flex-row justify-start" v-for="(item,index) in projects.projectVos" :key="index" @click="clickItem(item)">
|
|
|
|
|
|
<view class="flex-col justify-center ">
|
|
|
<u-icon v-if="item.id === serviceProjectId" name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
|
|
|
@@ -43,10 +43,19 @@
|
|
|
<view class="flex-row justify-center" @click="goUseCoupons">
|
|
|
<view class="block_3 ">
|
|
|
<text lines="1" class="text_15">优惠券</text>
|
|
|
- <view class="image-text_4">
|
|
|
- <text lines="1" class="text-group_4">未选择</text>
|
|
|
- <u-icon name="arrow-right" color="#666" size="18"></u-icon>
|
|
|
+ <view>
|
|
|
+ <view class="flex-row justify-between" v-if="coupons.length>0">
|
|
|
+ <view class="flex-row">
|
|
|
+ <text class="text-group_5" v-for="(iter,i) in coupons" :key="i">{{iter.name}}:-¥{{iter.discountsPrice}}</text>
|
|
|
+ </view>
|
|
|
+ <u-icon name="arrow-right" color="#666" size="18"></u-icon>
|
|
|
+ </view>
|
|
|
+ <view v-else class="image-text_4 ">
|
|
|
+ <text class="text-group_4">未选择</text>
|
|
|
+ <u-icon name="arrow-right" color="#666" size="18"></u-icon>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -65,30 +74,55 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- title: 'Hello',
|
|
|
+ coupons:[],
|
|
|
+ couponIds:'',
|
|
|
tabIndex: 3,
|
|
|
projects:{},
|
|
|
serviceStationId:'',
|
|
|
orderId:'',
|
|
|
- serviceProjectId:''
|
|
|
+ serviceProject:{},
|
|
|
+ serviceProjectId:'',
|
|
|
}
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
this.orderId=e.orderId
|
|
|
this.serviceStationId=e.serviceStationId
|
|
|
this.getStationById(e.serviceStationId)
|
|
|
+
|
|
|
+ uni.$off('getUseCoupons')
|
|
|
+ uni.$on('getUseCoupons',this.getUseCoupons)
|
|
|
+
|
|
|
},
|
|
|
+
|
|
|
methods: {
|
|
|
|
|
|
+ getUseCoupons(e){
|
|
|
+ console.log('++++++++getUseCoupons+++++++++++++++',e)
|
|
|
+ this.coupons= e
|
|
|
+ this.couponIds = ''
|
|
|
+ for (let eElement of e) {
|
|
|
+ this.couponIds += eElement.id + ','
|
|
|
+ }
|
|
|
+ if (this.couponIds.length>0){
|
|
|
+ this.couponIds = this.couponIds.substring(0,this.couponIds.length-1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
goUseCoupons(){
|
|
|
+ if (this.serviceProjectId.length === 0){
|
|
|
+ uni.$u.toast('请先选择服务项目')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
uni.navigateTo({
|
|
|
- url: 'orderPages/useCoupons/index'
|
|
|
+ url: '/orderPages/useCoupons/index?standardPrice='+this.serviceProject.standardPrice
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
- clickItem(id){
|
|
|
- this.serviceProjectId = id
|
|
|
+ clickItem(item){
|
|
|
+ this.serviceProjectId = item.id
|
|
|
+ this.serviceProject = item
|
|
|
},
|
|
|
|
|
|
addChildProject(){
|
|
|
@@ -100,7 +134,7 @@ export default {
|
|
|
serviceProjectId:this.serviceProjectId,
|
|
|
servicePersonId:this.projects.personId,
|
|
|
serviceStationId:this.serviceStationId,
|
|
|
- couponIds:''
|
|
|
+ couponIds:this.couponIds
|
|
|
}).then(res=>{
|
|
|
uni.navigateTo({
|
|
|
url:'/orderPages/orderDetail/index?id='+ this.orderId
|