|
@@ -2,21 +2,24 @@
|
|
|
<view class="content">
|
|
|
<view class="card-list">
|
|
|
<view class="card-label">{{memberInfo.typeValue}}</view>
|
|
|
- <view class="card-num">¥{{memberInfo.originalAmount}}</view>
|
|
|
+ <view class="card-num">¥{{memberInfo.originalAmount ? memberInfo.originalAmount : 0}}</view>
|
|
|
<view class="card-icon iconfont iconzu4931"></view>
|
|
|
</view>
|
|
|
<u-form :model="form" label-width="140" style="width: 100%; float: left;">
|
|
|
+ <u-form-item label="选择场馆" :right-icon="venueEdit ? 'arrow-right' : ''" required @click.native="venueShow = venueEdit ? true : false">
|
|
|
+ <text>{{venueName}}</text>
|
|
|
+ </u-form-item>
|
|
|
<u-form-item label="使用时间">
|
|
|
<text>{{memberInfo.startDate + '~' + memberInfo.endDate}}</text>
|
|
|
</u-form-item>
|
|
|
<u-form-item label="优惠金额" right-icon="arrow-right" @click.native="couponShow = true">
|
|
|
<text>{{couponId ? '-¥' + memberInfo.discountsAmount : ''}}</text>
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="学员姓名" right-icon="arrow-right" required @click.native="studentShow = true">
|
|
|
+ <u-form-item label="学员姓名" :right-icon="studentEdit ? 'arrow-right' : ''" required @click.native="studentShow = studentEdit ? true : false">
|
|
|
<text>{{studentName}}</text>
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="实际金额" @click.native="studentShow = true">
|
|
|
- <text>{{'¥' + memberInfo.realPayAmount}}</text>
|
|
|
+ <u-form-item label="实际金额">
|
|
|
+ <text>{{'¥' + (memberInfo.realPayAmount ? memberInfo.realPayAmount : 0)}}</text>
|
|
|
</u-form-item>
|
|
|
<u-form-item label="家长名称" required>
|
|
|
<u-input v-model="form.parentName" placeholder="请输入家长姓名" />
|
|
@@ -45,6 +48,16 @@
|
|
|
<view class="handle-fix-box">
|
|
|
<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="toPay()">确定支付¥{{memberInfo.realPayAmount}}</u-button>
|
|
|
</view>
|
|
|
+ <u-popup v-model="venueShow" mode="bottom" border-radius="30">
|
|
|
+ <scroll-view scroll-y class="student-box">
|
|
|
+ <u-card :title="item.studentName" title-size="32" :head-style="cardStyle" :head-border-bottom="false" :show-foot="false"
|
|
|
+ margin="10px" borderRadius="20" v-for="(item, index) in venueList" :key="index" @click="selectVenue(item)">
|
|
|
+ <view class="student-card" slot="body">
|
|
|
+ <view class="class-info-text">{{item.venueName}}</view>
|
|
|
+ </view>
|
|
|
+ </u-card>
|
|
|
+ </scroll-view>
|
|
|
+ </u-popup>
|
|
|
<u-popup v-model="studentShow" mode="bottom" border-radius="30">
|
|
|
<scroll-view scroll-y class="student-box">
|
|
|
<u-card :title="item.studentName" title-size="32" :head-style="cardStyle" :head-border-bottom="false" :show-foot="false"
|
|
@@ -77,8 +90,9 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- memberCardId: '',
|
|
|
+ memberCardType: '',
|
|
|
memberInfo: {
|
|
|
+ id: '',
|
|
|
originalAmount: '',
|
|
|
discountsAmount: '',
|
|
|
realPayAmount: '',
|
|
@@ -86,12 +100,18 @@
|
|
|
endDate: '',
|
|
|
startDate: '',
|
|
|
},
|
|
|
+ venueEdit: true,
|
|
|
+ venueId: '',
|
|
|
+ venueName: '',
|
|
|
+ venueShow: false,
|
|
|
+ venueList: [],
|
|
|
couponId: '',
|
|
|
couponShow: false,
|
|
|
couponList: [],
|
|
|
cardStyle: {
|
|
|
fontWeight: 'bold'
|
|
|
},
|
|
|
+ studentEdit: true,
|
|
|
studentId: '',
|
|
|
studentName: '',
|
|
|
studentShow: false,
|
|
@@ -111,10 +131,32 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- this.memberCardId = options.id
|
|
|
- this.getMemberInfo()
|
|
|
+ if (options.venueId) {
|
|
|
+ this.venueEdit = false
|
|
|
+ this.venueId = options.venueId
|
|
|
+ this.venueName = options.venueName
|
|
|
+ }
|
|
|
+ if (options.studentId) {
|
|
|
+ this.studentEdit = false
|
|
|
+ this.studentId = options.studentId
|
|
|
+ this.studentName = options.studentName
|
|
|
+ }
|
|
|
+ this.memberCardType = options.memberCardType
|
|
|
+ if (this.venueId) {
|
|
|
+ this.getMemberInfo(1)
|
|
|
+ } else {
|
|
|
+ this.memberInfo.typeValue = options.typeValue
|
|
|
+ }
|
|
|
},
|
|
|
onShow() {
|
|
|
+ NET.request(API.getAllVenueList, uni.getStorageSync('locationData'), 'POST').then(res => {
|
|
|
+ this.venueList = res.data
|
|
|
+ }).catch(error => {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: error.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ })
|
|
|
NET.request(API.getAllStudentList, {}, 'POST').then(res => {
|
|
|
this.studentList = res.data
|
|
|
}).catch(error => {
|
|
@@ -126,7 +168,6 @@
|
|
|
},
|
|
|
onReady() {
|
|
|
NET.request(API.getParentInfo, {}, 'POST').then(res => {
|
|
|
- debugger
|
|
|
this.form.parentName = res.data.parentName
|
|
|
this.form.sex = res.data.sex
|
|
|
}).catch(error => {
|
|
@@ -138,21 +179,17 @@
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取数据
|
|
|
- getMemberInfo() {
|
|
|
+ getMemberInfo(type) {
|
|
|
NET.request(API.getMemberCardInfo, {
|
|
|
- id: this.memberCardId
|
|
|
+ type: this.memberCardType,
|
|
|
+ venueId: this.venueId,
|
|
|
+ couponId: this.couponId,
|
|
|
+ studentId: this.studentId
|
|
|
}, 'POST').then(res => {
|
|
|
this.memberInfo = res.data
|
|
|
- }).catch(error => {
|
|
|
- this.$refs.uTips.show({
|
|
|
- title: error.message,
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- })
|
|
|
- NET.request(API.getUsableCouponList, {
|
|
|
- id: this.memberCardId
|
|
|
- }, 'POST').then(res => {
|
|
|
- this.couponList = res.data.row
|
|
|
+ if (type == 1) {
|
|
|
+ this.getCouponList()
|
|
|
+ }
|
|
|
}).catch(error => {
|
|
|
this.$refs.uTips.show({
|
|
|
title: error.message,
|
|
@@ -160,16 +197,14 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- // 更新数据
|
|
|
- refreshMemberInfo() {
|
|
|
- NET.request(API.getMemberCardInfoAfterCoupon, {
|
|
|
- memberId: this.memberCardId,
|
|
|
- couponId: this.couponId,
|
|
|
+ // 获取优惠券
|
|
|
+ getCouponList() {
|
|
|
+ this.couponId = ''
|
|
|
+ NET.request(API.getUsableCouponList, {
|
|
|
+ id: this.memberInfo.id,
|
|
|
studentId: this.studentId
|
|
|
}, 'POST').then(res => {
|
|
|
- this.memberInfo = res.data
|
|
|
- this.couponShow = false
|
|
|
- this.studentShow = false
|
|
|
+ this.couponList = res.data.row
|
|
|
}).catch(error => {
|
|
|
this.$refs.uTips.show({
|
|
|
title: error.message,
|
|
@@ -180,13 +215,22 @@
|
|
|
// 选择优惠券
|
|
|
selectCoupon(item) {
|
|
|
this.couponId = item.id
|
|
|
- this.refreshMemberInfo()
|
|
|
+ this.couponShow = false
|
|
|
+ this.getMemberInfo(2)
|
|
|
+ },
|
|
|
+ // 选择场馆
|
|
|
+ selectVenue(item) {
|
|
|
+ this.venueId = item.id
|
|
|
+ this.venueName = item.venueName
|
|
|
+ this.venueShow = false
|
|
|
+ this.getMemberInfo(1)
|
|
|
},
|
|
|
// 选择学员
|
|
|
selectStudent(item) {
|
|
|
this.studentId = item.studentId
|
|
|
this.studentName = item.studentName
|
|
|
- this.refreshMemberInfo()
|
|
|
+ this.studentShow = false
|
|
|
+ this.getMemberInfo(1)
|
|
|
},
|
|
|
// 设置性别
|
|
|
setSex(index) {
|
|
@@ -216,7 +260,7 @@
|
|
|
return
|
|
|
}
|
|
|
uni.navigateTo({
|
|
|
- url: '/pagesMain/contractInfo?memberCardId=' + this.memberCardId + '&couponId=' + this.couponId + '&studentId=' +
|
|
|
+ url: '/pagesMain/contractInfo?memberCardId=' + this.memberInfo.id + '&couponId=' + this.couponId + '&studentId=' +
|
|
|
this.studentId + '&realPayAmount=' + this.memberInfo.realPayAmount + '&parentName=' + this.form.parentName +
|
|
|
'&sex=' + this.form.sex
|
|
|
});
|