|
@@ -39,15 +39,24 @@
|
|
|
|
|
|
|
|
<view class="tabBarLineHeight"></view>
|
|
<view class="tabBarLineHeight"></view>
|
|
|
|
|
|
|
|
- <view class="bottomView ">
|
|
|
|
|
|
|
+ <view class="bottomView">
|
|
|
|
|
|
|
|
- <view class="flex-row justify-center" @click="goUseRights">
|
|
|
|
|
|
|
+ <view class="ticketView flex-row">
|
|
|
|
|
+ <view class="ticketBtn" :class="{'ticketColor': ticketBtnIndex === 1}" @click="clickTicketBtn(1)">
|
|
|
|
|
+ <text>使用权益券</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="ticketBtn" :class="{'ticketColor': ticketBtnIndex === 2}" @click="clickTicketBtn(2)">
|
|
|
|
|
+ <text>使用优惠券</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view v-if="ticketBtnIndex === 1" class="flex-row justify-center" @click="goUseRights">
|
|
|
<view class="block_3 ">
|
|
<view class="block_3 ">
|
|
|
<text lines="1" class="text_15">权益卡</text>
|
|
<text lines="1" class="text_15">权益卡</text>
|
|
|
<view>
|
|
<view>
|
|
|
- <view class="flex-row justify-between" v-if="coupons.length>0">
|
|
|
|
|
|
|
+ <view class="flex-row justify-between" v-if="equitys.length>0">
|
|
|
<view class="flex-row">
|
|
<view class="flex-row">
|
|
|
- <text class="text-group_5" v-for="(iter,i) in coupons" :key="i">{{iter.name}}:-¥{{iter.discountsPrice}}</text>
|
|
|
|
|
|
|
+ <text class="text-group_5" v-for="(iter,i) in equitys" :key="i">{{iter.description}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<u-icon name="arrow-right" color="#666" size="18"></u-icon>
|
|
<u-icon name="arrow-right" color="#666" size="18"></u-icon>
|
|
|
</view>
|
|
</view>
|
|
@@ -60,8 +69,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- <view class="flex-row justify-center" @click="goUseCoupons">
|
|
|
|
|
|
|
+ <view v-if="ticketBtnIndex === 2" class="flex-row justify-center" @click="goUseCoupons">
|
|
|
<view class="block_3 ">
|
|
<view class="block_3 ">
|
|
|
<text lines="1" class="text_15">优惠券</text>
|
|
<text lines="1" class="text_15">优惠券</text>
|
|
|
<view>
|
|
<view>
|
|
@@ -96,6 +104,7 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
coupons:[],
|
|
coupons:[],
|
|
|
|
|
+ equitys:[],
|
|
|
couponIds:'',
|
|
couponIds:'',
|
|
|
tabIndex: 3,
|
|
tabIndex: 3,
|
|
|
projects:{},
|
|
projects:{},
|
|
@@ -103,23 +112,40 @@ export default {
|
|
|
orderId:'',
|
|
orderId:'',
|
|
|
serviceProject:{},
|
|
serviceProject:{},
|
|
|
serviceProjectId:'',
|
|
serviceProjectId:'',
|
|
|
|
|
+ serviceObjectId:'',
|
|
|
|
|
+ ticketBtnIndex:1
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
|
this.orderId=e.orderId
|
|
this.orderId=e.orderId
|
|
|
this.serviceStationId=e.serviceStationId
|
|
this.serviceStationId=e.serviceStationId
|
|
|
|
|
+ this.serviceObjectId=e.serviceObjectId
|
|
|
this.getStationById(e.serviceStationId)
|
|
this.getStationById(e.serviceStationId)
|
|
|
|
|
|
|
|
uni.$off('getUseCoupons')
|
|
uni.$off('getUseCoupons')
|
|
|
uni.$on('getUseCoupons',this.getUseCoupons)
|
|
uni.$on('getUseCoupons',this.getUseCoupons)
|
|
|
|
|
+ uni.$on('getEquity',this.getEquity)
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
+ clickTicketBtn(ticketBtnIndex){
|
|
|
|
|
+ this.ticketBtnIndex =ticketBtnIndex
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getEquity(e){
|
|
|
|
|
+ this.equitys =e
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
goUseRights(){
|
|
goUseRights(){
|
|
|
|
|
+
|
|
|
|
|
+ if (this.serviceProjectId.length === 0){
|
|
|
|
|
+ uni.$u.toast('请先选择服务项目')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url:'/storePages/useRights/index'
|
|
|
|
|
|
|
+ url:'/storePages/useRights/index?serviceProjectId=' + this.serviceProjectId + '&serviceObjectId=' + this.serviceObjectId
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -140,7 +166,6 @@ export default {
|
|
|
uni.$u.toast('请先选择服务项目')
|
|
uni.$u.toast('请先选择服务项目')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: '/orderPages/useCoupons/index?standardPrice='+this.serviceProject.standardPrice
|
|
url: '/orderPages/useCoupons/index?standardPrice='+this.serviceProject.standardPrice
|
|
|
})
|
|
})
|
|
@@ -148,20 +173,41 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
clickItem(item){
|
|
clickItem(item){
|
|
|
|
|
+ if (this.equitys.length>0){
|
|
|
|
|
+ if (item.id != this.equitys[0].serviceObjectId){
|
|
|
|
|
+ this.equitys=[]
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.serviceProjectId = item.id
|
|
this.serviceProjectId = item.id
|
|
|
this.serviceProject = item
|
|
this.serviceProject = item
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
addChildProject(){
|
|
addChildProject(){
|
|
|
- if (this.id === ''){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (this.ticketBtnIndex === 1){
|
|
|
|
|
+ this.couponIds=''
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (this.ticketBtnIndex === 2){
|
|
|
|
|
+ this.equitys=[]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!this.serviceProjectId){
|
|
|
uni.$u.toast("请选择服务项目")
|
|
uni.$u.toast("请选择服务项目")
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ let userEquityCardId
|
|
|
|
|
+ if (this.equitys.length>0){
|
|
|
|
|
+ userEquityCardId = this.equitys[0].id
|
|
|
}
|
|
}
|
|
|
this.$api.addChildProject({
|
|
this.$api.addChildProject({
|
|
|
orderId:this.orderId,
|
|
orderId:this.orderId,
|
|
|
serviceProjectId:this.serviceProjectId,
|
|
serviceProjectId:this.serviceProjectId,
|
|
|
servicePersonId:this.projects.personId,
|
|
servicePersonId:this.projects.personId,
|
|
|
serviceStationId:this.serviceStationId,
|
|
serviceStationId:this.serviceStationId,
|
|
|
- couponIds:this.couponIds
|
|
|
|
|
|
|
+ couponIds:this.couponIds,
|
|
|
|
|
+ userEquityCardId:userEquityCardId
|
|
|
}).then(res=>{
|
|
}).then(res=>{
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url:'/orderPages/orderDetail/index?id='+ this.orderId
|
|
url:'/orderPages/orderDetail/index?id='+ this.orderId
|