替换人脸拍照

This commit is contained in:
wangxiaowei
2026-02-02 02:37:58 +08:00
parent 1d773081ea
commit 18e0423699
4 changed files with 117 additions and 83 deletions

View File

@ -106,18 +106,13 @@
</view>
</view>
</view>
<!-- <view class="d-f a-i-c open-light" @click="buyLight" v-if="detail.order_status == 1 || detail.order_status == 2">
<image style="width: 48rpx;height: 48rpx;" src="https://xh.stnav.com/uploads/sport/light.png" ></image>
<view>购买灯光</view>
</view> -->
</template>
</view>
</view>
</view>
<!-- 购买灯光 -->
<view class="cg-order" style="margin-bottom: 20rpx;" v-if="detail.order_status == 1 || detail.order_status == 2 && ballType == 1">
<view class="cg-order" style="margin-bottom: 20rpx;" v-if="(detail.order_status == 1 || detail.order_status == 2 || detail.order_status == 3) && ballType == 1">
<view class="cg-order-title d-f a-i-c open-light">
<!-- <image style="width: 48rpx;height: 48rpx;" src="https://xh.stnav.com/uploads/sport/light.png" ></image> -->
<view>购买灯光</view>
@ -129,9 +124,9 @@
v-for="(item2, index2) in item"
:key="index2"
:class="isSelected(index, index2) ? 'date-time-btn' : 'date-time-btn-normal'"
@click="toggleSelect(index, index2, item2.room_id)"
@click="toggleSelect(index, index2, item2.room_id, item2.light_status)"
>
{{ item2.start_time }}-{{ item2.end_time }}
{{ item2.light_status == 1 ? '已购买' : `${item2.start_time}-${item2.end_time}`}}
</view>
</view>
</view>
@ -338,35 +333,6 @@
</view>
</Popup>
<!-- 开灯弹窗 -->
<Popup :show="openLightPopup" radius="16rpx">
<view class="light-popup">
<view class="title">提示</view>
<view class="desc">
<view class="rule">请选择要开灯的场地</view>
<scroll-view scroll-y="true" enhanced="true" :show-scrollbar="false" style="height: 500rpx;">
<view class="desc" v-for="(item, index) in detail.trade" :key="index">
<view class="fb" style="margin: 20rpx 0;">{{ index }}</view>
<view class="date-grid">
<view
:class="isSelected(index, index2) ? 'date-time-btn' : 'date-time-btn-normal'"
v-for="(item2, index2) in item"
:key="index2"
@click="toggleSelect(index, index2, item2.room_id)"
>
{{ item2.start_time }}-{{ item2.end_time }}
</view>
</view>
</view>
</scroll-view>
</view>
<view class="btn">
<view class="btn1" @click="openLightPopup = false">取消</view>
<view class="btn2" @click="getSelectedContent">确定</view>
</view>
</view>
</Popup>
<!-- 会员卡选择弹窗 -->
<Popup :show="balancePopup" :width='750' :padding="0" type="bottom" backgroundColor="#fff" radius="32rpx 32rpx 0 0">
<view class="ww100 box-s-b pop-improt typeof pr">
@ -481,8 +447,9 @@
userBalance: {},
currentType: '', // 选择的会员卡类型
userAccount: 0,
userDiscount: 0
userDiscount: 0,
lightDateTime: '',
lightPrice: 0,
};
},
onLoad(e) {
@ -829,12 +796,36 @@
return this.selectedTimes.some(sel => sel.group === groupIdx && sel.idx === idx);
},
toggleSelect(groupIdx, idx, roomId) {
toggleSelect(groupIdx, idx, roomId, status) {
if (status == 1) {
uni.showToast({
icon: 'none',
title: '已支付过灯光费用',
mask: false,
duration: 1000
});
return;
}
const found = this.selectedTimes.findIndex(sel => sel.group === groupIdx && sel.idx === idx);
if (found > -1) {
this.selectedTimes.splice(found, 1);
} else {
this.selectedTimes.push({ group: groupIdx, idx, roomId });
let self = this
self.loadding = true
self._post(
'ground.ground/groundRoomDetails',
{
app_id: self.getAppId(),
id: roomId, // 场馆包间ID
},
function(res) {
console.log("🚀 ~ res:", res)
self.detail.trade[groupIdx][idx].light_price = res.data.lists.set_light_price
self.selectedTimes.push({ group: groupIdx, idx, roomId });
}
)
self.loadding = false
}
},
@ -848,19 +839,31 @@
const result = [];
const trade = self.detail.trade || [];
const roomMap = {};
self.lightDateTime = ''
self.lightPrice = 0
self.selectedTimes.forEach(sel => {
if (!roomMap[sel.roomId]) roomMap[sel.roomId] = [];
// 获取时间段
const item = trade[sel.group] && trade[sel.group][sel.idx];
console.log("🚀 ~ item:", item)
if (item) {
roomMap[sel.roomId].push(`${item.start_time}-${item.end_time}`);
self.lightDateTime = item.day_time
self.lightPrice += parseFloat(item.light_price)
}
});
Object.keys(roomMap).forEach(roomId => {
result.push({ room_id: roomId, arr: roomMap[roomId].join(',') });
});
self.content = result;
console.log("🚀 ~ item lightDateTime:", self.lightDateTime)
console.log("🚀 ~ item lightPrice:", self.lightPrice)
console.log("🚀 ~ self.content:", self.content)
if (self.detail.light_order == 1) {
uni.showModal({
title: '提示',
@ -915,12 +918,15 @@
uni.showLoading({
title: '正在处理'
});
console.log(123123)
self._post(
'order.GroundOrder/addLightStoreOrder', {
order_id: self.order_id,
room_id: '',
ground_id: self.detail.ground_id,
content: JSON.stringify(self.content)
content: JSON.stringify(self.content),
day_time: self.lightDateTime,
light_price: self.lightPrice,
},
function(res) {
uni.hideLoading();