Feat:预览旅居团购协议
This commit is contained in:
@@ -215,6 +215,10 @@ export function getJiaLouProductReplyCount(params) {
|
|||||||
return request.get('/travel/product/reply/count', params, {login: true})
|
return request.get('/travel/product/reply/count', params, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getTravelGroupOrderAgreement() {
|
||||||
|
return request.get('/travel/travelGroupOrderAgreement', {}, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管家列表
|
* 管家列表
|
||||||
* merId int 商户ID
|
* merId int 商户ID
|
||||||
|
|||||||
@@ -193,7 +193,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view>联系商家</view>
|
<view>联系商家</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="buy-btn" @click="bookNow">
|
<view class="buy-btn" @click="handleBuyClick">
|
||||||
<view>
|
<view>
|
||||||
<u-icon :name="webUrl + '/home/icon-cart.png'" size="24"></u-icon>
|
<u-icon :name="webUrl + '/home/icon-cart.png'" size="24"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
@@ -201,10 +201,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <Calendar ref="calendar"
|
|
||||||
:minDay="detail.minBookingDays"
|
|
||||||
@dateSelected="handleDateSelected"
|
|
||||||
></Calendar> -->
|
|
||||||
<DateRangePicker
|
<DateRangePicker
|
||||||
ref="dateRangePicker"
|
ref="dateRangePicker"
|
||||||
:show="showDatePicker"
|
:show="showDatePicker"
|
||||||
@@ -214,19 +210,41 @@
|
|||||||
@input="handleDateSelected"
|
@input="handleDateSelected"
|
||||||
>
|
>
|
||||||
</DateRangePicker>
|
</DateRangePicker>
|
||||||
|
<u-popup
|
||||||
|
:show="showAgreementPopup"
|
||||||
|
mode="center"
|
||||||
|
round="16"
|
||||||
|
:safe-area-inset-bottom="false"
|
||||||
|
>
|
||||||
|
<view class="agreement-popup">
|
||||||
|
<view class="agreement-header">
|
||||||
|
<text class="agreement-title">{{ agreementTitle }}</text>
|
||||||
|
<text class="iconfont icon-guanbi agreement-close" @click="closeAgreement"></text>
|
||||||
|
</view>
|
||||||
|
<scroll-view scroll-y class="agreement-body">
|
||||||
|
<u-parse :content="agreementContent"></u-parse>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="agreement-actions">
|
||||||
|
<button class="agreement-btn agree" @click="confirmAgreement">我同意</button>
|
||||||
|
<button class="agreement-btn cancel" @click="closeAgreement">返回</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getJiaLouProductDetail, getJiaLouCalendar,getJiaLouBookingRules, getJiaLouProductReply } from '@/api/qianxian'
|
import { getJiaLouProductDetail, getJiaLouCalendar,getJiaLouBookingRules, getJiaLouProductReply, getTravelGroupOrderAgreement } from '@/api/qianxian'
|
||||||
import {getGiftCardSendBackground} from "@/api/gift"
|
import {getGiftCardSendBackground} from "@/api/gift"
|
||||||
import DateRangePicker from '@/components/DateRangePicker/DateRangePicker.vue'
|
import DateRangePicker from '@/components/DateRangePicker/DateRangePicker.vue'
|
||||||
import UserEvaluation from '@/components/UserEvaluation'
|
import UserEvaluation from '@/components/UserEvaluation'
|
||||||
|
import uParse from '@/uni_modules/uview-ui/components/u-parse/u-parse.vue'
|
||||||
export default {
|
export default {
|
||||||
name: 'GroupBuyDetails',
|
name: 'GroupBuyDetails',
|
||||||
components: {
|
components: {
|
||||||
DateRangePicker,
|
DateRangePicker,
|
||||||
UserEvaluation
|
UserEvaluation,
|
||||||
|
uParse
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -246,7 +264,11 @@ export default {
|
|||||||
reviewPage: 1,
|
reviewPage: 1,
|
||||||
reviewLimit: 5,
|
reviewLimit: 5,
|
||||||
reviewLoading: false,
|
reviewLoading: false,
|
||||||
reviewLoadEnd: false
|
reviewLoadEnd: false,
|
||||||
|
showAgreementPopup: false,
|
||||||
|
agreementTitle: '团购协议',
|
||||||
|
agreementContent: '',
|
||||||
|
enableAgreement: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -260,12 +282,12 @@ export default {
|
|||||||
this.id = (query && query.id) || ''
|
this.id = (query && query.id) || ''
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
this.fetchReviewList(true)
|
this.fetchReviewList(true)
|
||||||
// this.getCalendar()
|
|
||||||
getJiaLouBookingRules(this.id).then(res => {
|
getJiaLouBookingRules(this.id).then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
this.rules = res.data || ''
|
this.rules = res.data || ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.getOrderAgreement()
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (!this.reviewLoadEnd) {
|
if (!this.reviewLoadEnd) {
|
||||||
@@ -393,6 +415,32 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
async getOrderAgreement() {
|
||||||
|
try {
|
||||||
|
const res = await getTravelGroupOrderAgreement()
|
||||||
|
if (res && res.status === 200 && res.data) {
|
||||||
|
const data = res.data
|
||||||
|
this.agreementTitle = data.agreementTitle || '团购协议'
|
||||||
|
this.agreementContent = data.agreementContent || ''
|
||||||
|
this.enableAgreement = !!this.agreementContent
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleBuyClick() {
|
||||||
|
if (this.enableAgreement && this.agreementContent) {
|
||||||
|
this.showAgreementPopup = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.bookNow()
|
||||||
|
},
|
||||||
|
closeAgreement() {
|
||||||
|
this.showAgreementPopup = false
|
||||||
|
},
|
||||||
|
confirmAgreement() {
|
||||||
|
this.showAgreementPopup = false
|
||||||
|
this.bookNow()
|
||||||
|
},
|
||||||
bookNow() {
|
bookNow() {
|
||||||
if(!this.dateRange[0] || !this.dateRange[1]){
|
if(!this.dateRange[0] || !this.dateRange[1]){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -668,6 +716,70 @@ export default {
|
|||||||
.package-item{
|
.package-item{
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
}
|
}
|
||||||
|
.agreement-popup {
|
||||||
|
width: 620rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 40rpx 32rpx 32rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.agreement-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.agreement-title {
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.agreement-close {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #999;
|
||||||
|
padding: 10rpx;
|
||||||
|
}
|
||||||
|
.agreement-body {
|
||||||
|
height: 600rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
background: #f8f8f8;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.agreement-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 20rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.agreement-btn {
|
||||||
|
flex: 1;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
margin: 0;
|
||||||
|
&::after { border: none; }
|
||||||
|
}
|
||||||
|
.agreement-btn.agree {
|
||||||
|
background: #E53935;
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 4rpx 12rpx rgba(229, 57, 53, 0.3);
|
||||||
|
}
|
||||||
|
.agreement-btn.cancel {
|
||||||
|
background: #f5f5f5;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
.date-item{
|
.date-item{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
Reference in New Issue
Block a user