Commit 7b268dcd by cen

fix: 修改订单类型

1 parent c4338a5e
<template> <template>
<view class="container" @click="handleTouchStart"> <view class="container" @click="handleTouchStart">
<view :class="['home', { show: !id && showHome }]"> <view :class="['home', { show: !id && showHome }]">
<left-side :userInfo="userInfo" :tabIndex.sync="tabIndex" ref="leftBox" @changeTab="changeTab" <left-side :userInfo="userInfo" :tabIndex.sync="tabIndex" ref="leftBox" @changeTab="changeTab" @stopAudio="stopAudio" @showReadCountTips="showReadCountTips" @closeTips="closeTips" @closeActivityCenter="closeActivityCenter" />
@stopAudio="stopAudio" @showReadCountTips="showReadCountTips" @closeTips="closeTips"
@closeActivityCenter="closeActivityCenter" />
<view class="tips-box" :style="tipsObject.style" @click.stop="closeTips">{{ tipsObject.text }}</view> <view class="tips-box" :style="tipsObject.style" @click.stop="closeTips">{{ tipsObject.text }}</view>
<view class="right-side"> <view class="right-side">
<view :class="['app-content-box right-content', { 'show-content-box': tabIndex == 0 }]"> <view :class="['app-content-box right-content', { 'show-content-box': tabIndex == 0 }]">
...@@ -21,9 +19,7 @@ ...@@ -21,9 +19,7 @@
<slot name="swiperCustom" /> <slot name="swiperCustom" />
</template> </template>
<template v-else> <template v-else>
<swiper-component :moduleList="moduleList" @click="swiperClick" :stopAutoPlay="previewOff" <swiper-component :moduleList="moduleList" @click="swiperClick" :stopAutoPlay="previewOff" :imgKey="bannerKey" :loadComplete="loadComplete" :noDataObject="swiperNoDataObject"></swiper-component>
:imgKey="bannerKey" :loadComplete="loadComplete"
:noDataObject="swiperNoDataObject"></swiper-component>
</template> </template>
</view> </view>
</view> </view>
...@@ -46,8 +42,7 @@ ...@@ -46,8 +42,7 @@
<component :is="'Point'" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" /> <component :is="'Point'" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" />
</view> </view>
<template v-if="tabIndex != 0 && tabIndex != 99"> <template v-if="tabIndex != 0 && tabIndex != 99">
<component :is="componentName" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" <component :is="componentName" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" :isPermissionFunction="isPermission" />
:isPermissionFunction="isPermission" />
</template> </template>
</view> </view>
<view class="store-addr" v-if="footerBox"> <view class="store-addr" v-if="footerBox">
...@@ -62,9 +57,7 @@ ...@@ -62,9 +57,7 @@
<component :is="pointComponentName" @backHome="backHome" @jump="jump" :transfer="transfer" /> <component :is="pointComponentName" @backHome="backHome" @jump="jump" :transfer="transfer" />
</view> </view>
<!-- 未点击开始接待,弹窗 --> <!-- 未点击开始接待,弹窗 -->
<MessageBox ref="previewRef" @confirm="previewHandler('preview', true)" :popupW="704" <MessageBox ref="previewRef" @confirm="previewHandler('preview', true)" :popupW="704" content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」" confirmBtnText="预览素材" @cancel="previewHandler('previewCancel')" @close="previewHandler('previewClose')"></MessageBox>
content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」" confirmBtnText="预览素材" @cancel="previewHandler('previewCancel')"
@close="previewHandler('previewClose')"></MessageBox>
<!-- 停留弹框 --> <!-- 停留弹框 -->
<!-- <MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox> --> <!-- <MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox> -->
<!-- 退出弹框 --> <!-- 退出弹框 -->
...@@ -101,24 +94,17 @@ ...@@ -101,24 +94,17 @@
></web-view> --> ></web-view> -->
<!-- 学习中心 等级考试弹窗 --> <!-- 学习中心 等级考试弹窗 -->
<StudyPopup :show.sync="showStudyPopup" title="开始您的学习之旅" <StudyPopup :show.sync="showStudyPopup" title="开始您的学习之旅" :topImage="require('@/assets/images/common/study-center-bg.png')" :topImageWidth="848" :topImageHeight="248">
:topImage="require('@/assets/images/common/study-center-bg.png')" :topImageWidth="848" :topImageHeight="248"> <StudyPopupContent cardTitle="个性化学习路径" description="根据您当前的学习情况,我们将为您定制专属的学习计划,帮助您高效提升技能,实现职业突破。" :listItems="['基于当前能力水平评估', '结合岗位发展目标制定', '定期跟踪学习进度和效果']" tipText="true" :courseName="courseInfo.title" buttonText="开始测评" @cancel="handleStudyPopupCancel" @button-click="handleStartAssessment" />
<StudyPopupContent cardTitle="个性化学习路径" description="根据您当前的学习情况,我们将为您定制专属的学习计划,帮助您高效提升技能,实现职业突破。"
:listItems="['基于当前能力水平评估', '结合岗位发展目标制定', '定期跟踪学习进度和效果']" tipText="true" :courseName="courseInfo.title"
buttonText="开始测评" @cancel="handleStudyPopupCancel" @button-click="handleStartAssessment" />
</StudyPopup> </StudyPopup>
<!-- 考试提交确认弹窗 --> <!-- 考试提交确认弹窗 -->
<StudyPopup :show.sync="showExamPopup" title="" :width="848" :height="examPopInfo.isExamLoading ? 740 : 656" <StudyPopup :show.sync="showExamPopup" title="" :width="848" :height="examPopInfo.isExamLoading ? 740 : 656" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248">
:topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248"> <ExamSubmitPopup :isLoading="examPopInfo.isExamLoading" :showError="examPopInfo.showError" :confirmText="examPopInfo.confirmText" @cancel="handleExamCancel" @confirm="handleExamConfirm" />
<ExamSubmitPopup :isLoading="examPopInfo.isExamLoading" :showError="examPopInfo.showError"
:confirmText="examPopInfo.confirmText" @cancel="handleExamCancel" @confirm="handleExamConfirm" />
</StudyPopup> </StudyPopup>
<!-- 学习中心权限弹窗 --> <!-- 学习中心权限弹窗 -->
<StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870" <StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden">
:topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248"
style="overflow: hidden">
<StudyCenterPermissionPopup :lockReason="lockReason" @confirm="handleStudyPermissionConfirm" /> <StudyCenterPermissionPopup :lockReason="lockReason" @confirm="handleStudyPermissionConfirm" />
</StudyPopup> </StudyPopup>
<activity-popup ref="activityPopup" @JumpActivityCenter="JumpActivityCenter"></activity-popup> <activity-popup ref="activityPopup" @JumpActivityCenter="JumpActivityCenter"></activity-popup>
...@@ -126,9 +112,7 @@ ...@@ -126,9 +112,7 @@
<uni-popup-message type="error" :message="errorMsg" :duration="1500"></uni-popup-message> <uni-popup-message type="error" :message="errorMsg" :duration="1500"></uni-popup-message>
</uni-popup> </uni-popup>
<!-- 异常订单锁单 --> <!-- 异常订单锁单 -->
<ErrorOrderPopup :show.sync="showErrorOrderPopup" title="" :width="848" :height="870" <ErrorOrderPopup :show.sync="showErrorOrderPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden">
:topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248"
style="overflow: hidden">
<view> <view>
<view class="error-order-title">异常订单提醒</view> <view class="error-order-title">异常订单提醒</view>
<view class="error-order-content">存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!</view> <view class="error-order-content">存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!</view>
...@@ -138,9 +122,7 @@ ...@@ -138,9 +122,7 @@
<!-- <view class="footer-btn cancel" @click="showErrorOrderPopup=false"> <!-- <view class="footer-btn cancel" @click="showErrorOrderPopup=false">
取消 取消
</view> --> </view> -->
<view class="footer-btn sure flex-1" @click="showErrorOrderPopup=false"> <view class="footer-btn sure flex-1" @click="showErrorOrderPopup = false">好的</view>
好的
</view>
</view> </view>
</template> </template>
</ErrorOrderPopup> </ErrorOrderPopup>
...@@ -184,7 +166,7 @@ import ErrorOrderPopup from '@/components/ErrorOrderPopup.vue' ...@@ -184,7 +166,7 @@ import ErrorOrderPopup from '@/components/ErrorOrderPopup.vue'
import { FileUploadManager, UploadService } from '@/utils/recordManager/index.js' import { FileUploadManager, UploadService } from '@/utils/recordManager/index.js'
export default { export default {
// mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin], // mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin],
mixins: [recorder, versionCheck, interceptionMixin], mixins: [recorder, versionCheck, interceptionMixin],
components: { components: {
ReceptionCenter, ReceptionCenter,
StudyCenter, StudyCenter,
...@@ -277,7 +259,7 @@ export default { ...@@ -277,7 +259,7 @@ export default {
uni.$off('levelStudyPopup') uni.$off('levelStudyPopup')
uni.$off('pageBack') uni.$off('pageBack')
}, },
async mounted() { async mounted() {
uni.$logger.local.info('levelStudyPopup 开始监听mounted') uni.$logger.local.info('levelStudyPopup 开始监听mounted')
uni.$on('levelStudyPopup', obj => { uni.$on('levelStudyPopup', obj => {
uni.$logger.local.info('接收到学习弹窗事件', obj) uni.$logger.local.info('接收到学习弹窗事件', obj)
...@@ -325,7 +307,7 @@ export default { ...@@ -325,7 +307,7 @@ export default {
}, },
activityWindowPopStatus() { activityWindowPopStatus() {
return this.$store.getters.activityWindowPopStatus return this.$store.getters.activityWindowPopStatus
}, }
}, },
watch: { watch: {
activityWindowPopStatus: { activityWindowPopStatus: {
...@@ -340,9 +322,9 @@ export default { ...@@ -340,9 +322,9 @@ export default {
created() { created() {
// 监听自定义事件 // 监听自定义事件
uni.$on('pageBack', () => { uni.$on('pageBack', () => {
this.$refs.leftBox.getMessageInfo(); this.$refs.leftBox.getMessageInfo()
this.$refs.messageRef.getMessageSummary() this.$refs.messageRef.getMessageSummary()
}); })
}, },
methods: { methods: {
// 处理开始测评(参考 detail.vue 的实现) // 处理开始测评(参考 detail.vue 的实现)
...@@ -749,10 +731,10 @@ export default { ...@@ -749,10 +731,10 @@ export default {
} }
this.$refs.leftBox.handleActivityCenter() this.$refs.leftBox.handleActivityCenter()
}, },
handleErrorOrderPopupSure(){ handleErrorOrderPopupSure() {
let pageName = { let pageName = {
0: 'equity', 0: 'equity',
1: 'boutique', 1: 'boutique'
}[this.sceneType] }[this.sceneType]
uni.navigateTo({ uni.navigateTo({
url: `/pages/${pageName}/tool/index?componentName=OrderManagement` url: `/pages/${pageName}/tool/index?componentName=OrderManagement`
...@@ -1037,8 +1019,8 @@ export default { ...@@ -1037,8 +1019,8 @@ export default {
.error-order-title { .error-order-title {
text-align: center; text-align: center;
color: #333333; color: #333333;
font-size: toRpx(40); font-size: toRpx(40);
font-weight: 500; font-weight: 500;
} }
.error-order-content { .error-order-content {
text-align: center; text-align: center;
...@@ -1051,7 +1033,7 @@ export default { ...@@ -1051,7 +1033,7 @@ export default {
margin-top: toRpx(64); margin-top: toRpx(64);
margin-bottom: toRpx(48); margin-bottom: toRpx(48);
width: 100%; width: 100%;
.cancel{ .cancel {
height: toRpx(88); height: toRpx(88);
border-radius: toRpx(64); border-radius: toRpx(64);
opacity: 1; opacity: 1;
...@@ -1063,7 +1045,7 @@ export default { ...@@ -1063,7 +1045,7 @@ export default {
font-size: toRpx(32); font-size: toRpx(32);
font-weight: 400; font-weight: 400;
} }
.sure{ .sure {
height: toRpx(88); height: toRpx(88);
border-radius: toRpx(64); border-radius: toRpx(64);
opacity: 1; opacity: 1;
......
...@@ -23,6 +23,8 @@ export default { ...@@ -23,6 +23,8 @@ export default {
methods: { methods: {
async getList () { async getList () {
const params = this.params const params = this.params
let flag = null
let hasStorage = !!(uni && uni.$storage && uni.$storage.get)
// 默认支持所有订单类型 // 默认支持所有订单类型
let data = [ let data = [
{ name: '正常订单', value: '1' }, { name: '正常订单', value: '1' },
...@@ -34,9 +36,52 @@ export default { ...@@ -34,9 +36,52 @@ export default {
// 基于门店配置控制是否只允许“正常订单” // 基于门店配置控制是否只允许“正常订单”
try { try {
const flag = uni?.$storage?.get && uni.$storage.get('createAllGoodsFlag') // 1)优先从本地缓存读取(CreateOrder / EquityCreateOrder 入口会写入)
// createAllGoodsFlag = 0:只能选择正常订单 if (hasStorage) {
if (flag === 0 || flag === '0') { const rawFlag = uni.$storage.get('createAllGoodsFlag')
if (rawFlag !== undefined && rawFlag !== null) {
flag = String(rawFlag)
}
}
// 2)本地没有时,实时调轻改/权益配置接口兜底一次(避免先打开弹窗再拿到配置的竞态)
if (flag === null) {
const userInfo = hasStorage ? uni.$storage.get('userInfo') : null
// merchantId 来源:userInfo > 父组件传入的 data(如 orderObj).merchantId > params.merchantId
const merchantId =
(userInfo && (userInfo.shopMerchantId || userInfo.merchantId)) ||
(this.data && this.data.merchantId) ||
(params && params.merchantId)
if (merchantId) {
// 轻改接口
if (uni?.$api?.boutiqueApi?.getShopMerchantPointConfig) {
try {
const res = await uni.$api.boutiqueApi.getShopMerchantPointConfig({ merchantId })
if (res && res.createAllGoodsFlag !== undefined && res.createAllGoodsFlag !== null) {
flag = String(res.createAllGoodsFlag)
uni.$storage.set('createAllGoodsFlag', res.createAllGoodsFlag)
}
} catch (err) {
console.warn('fetch createAllGoodsFlag failed in OrderTypePopup (boutique)', err)
}
}
// 若轻改未返回 createAllGoodsFlag,再试权益接口(同一弹窗可能用于权益页)
if (flag === null && uni?.$api?.equityApi?.getShopMerchantPointConfig) {
try {
const res = await uni.$api.equityApi.getShopMerchantPointConfig({ merchantId })
if (res && res.createAllGoodsFlag !== undefined && res.createAllGoodsFlag !== null) {
flag = String(res.createAllGoodsFlag)
uni.$storage.set('createAllGoodsFlag', res.createAllGoodsFlag)
}
} catch (err) {
console.warn('fetch createAllGoodsFlag failed in OrderTypePopup (equity)', err)
}
}
}
}
// 3)有 flag 且不为 1 时,只允许“正常订单”
if (flag !== null && flag !== '1') {
data = [{ name: '正常订单', value: '1' }] data = [{ name: '正常订单', value: '1' }]
} }
} catch (e) { } catch (e) {
...@@ -44,6 +89,8 @@ export default { ...@@ -44,6 +89,8 @@ export default {
console.warn('read createAllGoodsFlag failed', e) console.warn('read createAllGoodsFlag failed', e)
} }
// 打开弹窗时输出:当前 createAllGoodsFlag 值、本次展示的订单类型
console.log('[OrderTypePopup] createAllGoodsFlag:', flag, '| 订单类型:', (data || []).map(i => i.name).join('、'))
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (list) { initData (list) {
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 2 const index = 1
/** /**
* *
0本地 0本地
......
...@@ -947,7 +947,7 @@ export default { ...@@ -947,7 +947,7 @@ export default {
// 单商品 // 单商品
const sellPrice = parseFloat(e.goods.sellPrice || 0) const sellPrice = parseFloat(e.goods.sellPrice || 0)
const number = parseInt(e.goods.number || 1) const number = parseInt(e.goods.number || 1)
const finalPrice = e.goods.finalPrice !== undefined && e.goods.finalPrice !== null && !isNaN(parseFloat(e.goods.finalPrice)) ? parseFloat(e.goods.finalPrice) : this.calculateFinalPrice(e.goods, sellPrice, number, obj.orderTypeCode) const finalPrice = this.calculateFinalPrice(e.goods, sellPrice, number, obj.orderTypeCode)
const discountFields = this.calculateDiscountFields(e.goods, sellPrice, number, obj.orderTypeCode) const discountFields = this.calculateDiscountFields(e.goods, sellPrice, number, obj.orderTypeCode)
const unitFinalPrice = finalPrice / number const unitFinalPrice = finalPrice / number
subGoodsList.push({ subGoodsList.push({
...@@ -968,7 +968,7 @@ export default { ...@@ -968,7 +968,7 @@ export default {
e.packageGoods.goodsList.forEach(g => { e.packageGoods.goodsList.forEach(g => {
const sellPrice = parseFloat(g.sellPrice || 0) const sellPrice = parseFloat(g.sellPrice || 0)
const number = parseInt(e.packageGoods.number || 1) const number = parseInt(e.packageGoods.number || 1)
const finalPrice = g.finalPrice !== undefined && g.finalPrice !== null && !isNaN(parseFloat(g.finalPrice)) ? parseFloat(g.finalPrice) : this.calculateFinalPrice(g, sellPrice, number, obj.orderTypeCode) const finalPrice = this.calculateFinalPrice(g, sellPrice, number, obj.orderTypeCode)
const discountFields = this.calculateDiscountFields(g, sellPrice, number, obj.orderTypeCode) const discountFields = this.calculateDiscountFields(g, sellPrice, number, obj.orderTypeCode)
const unitFinalPrice = finalPrice / number const unitFinalPrice = finalPrice / number
subGoodsList.push({ subGoodsList.push({
...@@ -992,7 +992,7 @@ export default { ...@@ -992,7 +992,7 @@ export default {
const goods = e.multipleSpecificationsGoods.goods const goods = e.multipleSpecificationsGoods.goods
const sellPrice = parseFloat(goods.sellPrice || 0) const sellPrice = parseFloat(goods.sellPrice || 0)
const number = parseInt(e.multipleSpecificationsGoods.number || 1) const number = parseInt(e.multipleSpecificationsGoods.number || 1)
const finalPrice = goods.finalPrice !== undefined && goods.finalPrice !== null && !isNaN(parseFloat(goods.finalPrice)) ? parseFloat(goods.finalPrice) : this.calculateFinalPrice(goods, sellPrice, number, obj.orderTypeCode) const finalPrice = this.calculateFinalPrice(goods, sellPrice, number, obj.orderTypeCode)
const discountFields = this.calculateDiscountFields(goods, sellPrice, number, obj.orderTypeCode) const discountFields = this.calculateDiscountFields(goods, sellPrice, number, obj.orderTypeCode)
const unitFinalPrice = finalPrice / number const unitFinalPrice = finalPrice / number
subGoodsList.push({ subGoodsList.push({
......
...@@ -686,6 +686,10 @@ export default { ...@@ -686,6 +686,10 @@ export default {
// deliveryCell.hidden = false // deliveryCell.hidden = false
// } // }
} }
// 订单类型配置:createAllGoodsFlag = 1 显示全部类型;0 仅正常订单
if (res.createAllGoodsFlag !== undefined && res.createAllGoodsFlag !== null) {
uni.$storage.set('createAllGoodsFlag', res.createAllGoodsFlag)
}
}, },
// 判断二级流量方 // 判断二级流量方
async getSubShopMerchantList (merchantId) { async getSubShopMerchantList (merchantId) {
......
<template> <template>
<view class="detail-box"> <view class="detail-box">
<view class="nav-bar"> <view class="nav-bar">
<view <view class="back" @click="backPage">
class="back" <uni-icons type="left" :size="20" color="#000"></uni-icons>
@click="backPage"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view> </view>
<view class="title">展业工具</view> <view class="title">展业工具</view>
</view> </view>
...@@ -17,23 +10,9 @@ ...@@ -17,23 +10,9 @@
<view class="detail-left"> <view class="detail-left">
<view class="common-title">展业</view> <view class="common-title">展业</view>
<view class="content"> <view class="content">
<image <image class="banner" src="../../../assets/images/common/tool_banner.png" mode="scaleToFill" />
class="banner"
src="../../../assets/images/common/tool_banner.png"
mode="scaleToFill"
/>
<template v-if="toolComponentName === 'DailyReport'"> <template v-if="toolComponentName === 'DailyReport'">
<uni-calendar <uni-calendar ref="calendar" :clearDate="false" :endDate="endDate" :showMonth="false" @monthSwitch="currentMonth = `${$event.year}-${$event.month}`" @change="currentDate = $event.fulldate" backgroundColor="transparent" :selected="selectedDays" :date="currentDate" />
ref="calendar"
:clearDate="false"
:endDate="endDate"
:showMonth="false"
@monthSwitch="currentMonth = `${$event.year}-${$event.month}`"
@change="currentDate = $event.fulldate"
backgroundColor="transparent"
:selected="selectedDays"
:date="currentDate"
/>
</template> </template>
<template v-else-if="toolComponentName === 'WageAppeal'"> <template v-else-if="toolComponentName === 'WageAppeal'">
<MonthCalendar @confirm="confirmMonth"></MonthCalendar> <MonthCalendar @confirm="confirmMonth"></MonthCalendar>
...@@ -44,49 +23,24 @@ ...@@ -44,49 +23,24 @@
</view> </view>
</view> </view>
<view class="detail-right"> <view class="detail-right">
<component <component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" :currentDate="currentDate" :currentMonth="currentMonth" :lastMonth="lastMonth" @setCalendarSelected="selectedDays = $event" :enterType="enterType" />
:is="toolComponentName"
@jump="jump"
:transmission-of-data="transmissionOfData"
:currentDate="currentDate"
:currentMonth="currentMonth"
:lastMonth="lastMonth"
@setCalendarSelected="selectedDays = $event"
:enterType="enterType"
/>
</view> </view>
</view> </view>
<NoticePopup <NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
ref="notice"
title="重要提示"
text="当前页面暂未保存,是否确认退出"
type="warning"
></NoticePopup>
<!-- 学习中心权限弹窗 --> <!-- 学习中心权限弹窗 -->
<StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden"> <StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden">
<StudyCenterPermissionPopup :lockReason="lockReason" @confirm="handleStudyPermissionConfirm" /> <StudyCenterPermissionPopup :lockReason="lockReason" @confirm="handleStudyPermissionConfirm" />
</StudyPopup> </StudyPopup>
<!-- 异常订单锁单弹窗,样式与车险工具页保持一致 --> <!-- 异常订单锁单弹窗,样式与车险工具页保持一致 -->
<ErrorOrderPopup <ErrorOrderPopup :show.sync="showErrorOrderPopup" title="" :width="848" :height="870" :topImage="require('@/assets/images/common/warning-notice.png')" :topImageWidth="848" :topImageHeight="248" style="overflow: hidden">
:show.sync="showErrorOrderPopup"
title=""
:width="848"
:height="870"
:topImage="require('@/assets/images/common/warning-notice.png')"
:topImageWidth="848"
:topImageHeight="248"
style="overflow: hidden"
>
<view> <view>
<view class="error-order-title">异常订单提醒</view> <view class="error-order-title">异常订单提醒</view>
<view class="error-order-content">存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!</view> <view class="error-order-content">存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!</view>
</view> </view>
<template #footer> <template #footer>
<view class="flex justify-between error-order-footer"> <view class="flex justify-between error-order-footer">
<view class="footer-btn sure flex-1" @click="showErrorOrderPopup = false"> <view class="footer-btn sure flex-1" @click="showErrorOrderPopup = false">好的</view>
好的
</view>
</view> </view>
</template> </template>
</ErrorOrderPopup> </ErrorOrderPopup>
...@@ -129,7 +83,7 @@ export default { ...@@ -129,7 +83,7 @@ export default {
MonthCalendar, MonthCalendar,
ErrorOrderPopup ErrorOrderPopup
}, },
data () { data() {
return { return {
toolComponentName: '', toolComponentName: '',
transmissionOfData: null, transmissionOfData: null,
...@@ -143,10 +97,10 @@ export default { ...@@ -143,10 +97,10 @@ export default {
// 异常订单锁单弹窗 // 异常订单锁单弹窗
showErrorOrderPopup: false, showErrorOrderPopup: false,
abnormalOrderCount: 0, abnormalOrderCount: 0,
enterType: '', enterType: ''
} }
}, },
onLoad (options) { onLoad(options) {
if (options.componentName) this.toolComponentName = options.componentName if (options.componentName) this.toolComponentName = options.componentName
if (options.currentDate) this.setCurrentDate(options.currentDate) if (options.currentDate) this.setCurrentDate(options.currentDate)
if (options.enterType) this.enterType = options.enterType if (options.enterType) this.enterType = options.enterType
...@@ -167,20 +121,20 @@ export default { ...@@ -167,20 +121,20 @@ export default {
} }
}) })
}, },
onUnload () { onUnload() {
uni.$off('showErrorOrderPopup') uni.$off('showErrorOrderPopup')
}, },
methods: { methods: {
setCurrentDate (currentDate) { setCurrentDate(currentDate) {
this.currentDate = currentDate this.currentDate = currentDate
this.currentMonth = dayjs(currentDate).format('YYYY-MM') this.currentMonth = dayjs(currentDate).format('YYYY-MM')
}, },
async entranceClick (item) { async entranceClick(item) {
if(this.toolComponentName == item.name) return if (this.toolComponentName == item.name) return
const noInterceptPage = ['DailyReport'] const noInterceptPage = ['DailyReport']
// 原禁止提单inspectionOfProhibitionBill方法被替换getLimitRecord // 原禁止提单inspectionOfProhibitionBill方法被替换getLimitRecord
// if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return // if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()))) return if (!noInterceptPage.includes(item.name) && (await this.checkDailyReport())) return
// 提示去学习中心弹窗 // 提示去学习中心弹窗
const res = await this.getLimitRecord() const res = await this.getLimitRecord()
if (res.lockOrder) { if (res.lockOrder) {
...@@ -229,11 +183,11 @@ export default { ...@@ -229,11 +183,11 @@ export default {
// 打开弹窗 // 打开弹窗
this.$refs.notice.open() this.$refs.notice.open()
}, },
backPage () { backPage() {
uni.navigateBack() uni.navigateBack()
}, },
// name:跳转组件名,val:跳转参数 // name:跳转组件名,val:跳转参数
jump (name, val) { jump(name, val) {
this.toolComponentName = name this.toolComponentName = name
console.log(this.toolComponentName, val) console.log(this.toolComponentName, val)
if (val) { if (val) {
...@@ -254,7 +208,7 @@ export default { ...@@ -254,7 +208,7 @@ export default {
// 确认选择的月份 // 确认选择的月份
confirmMonth(month) { confirmMonth(month) {
this.lastMonth = month this.lastMonth = month
}, }
} }
} }
</script> </script>
...@@ -305,8 +259,8 @@ export default { ...@@ -305,8 +259,8 @@ export default {
.error-order-title { .error-order-title {
text-align: center; text-align: center;
color: #333333; color: #333333;
font-size: toRpx(40); font-size: toRpx(40);
font-weight: 500; font-weight: 500;
} }
.error-order-content { .error-order-content {
text-align: center; text-align: center;
...@@ -319,7 +273,7 @@ export default { ...@@ -319,7 +273,7 @@ export default {
margin-top: toRpx(64); margin-top: toRpx(64);
margin-bottom: toRpx(48); margin-bottom: toRpx(48);
width: 100%; width: 100%;
.cancel{ .cancel {
height: toRpx(88); height: toRpx(88);
border-radius: toRpx(64); border-radius: toRpx(64);
opacity: 1; opacity: 1;
...@@ -331,7 +285,7 @@ export default { ...@@ -331,7 +285,7 @@ export default {
font-size: toRpx(32); font-size: toRpx(32);
font-weight: 400; font-weight: 400;
} }
.sure{ .sure {
height: toRpx(88); height: toRpx(88);
border-radius: toRpx(64); border-radius: toRpx(64);
opacity: 1; opacity: 1;
......
...@@ -44,5 +44,6 @@ export const STORAGE_OBJECTKEY = { ...@@ -44,5 +44,6 @@ export const STORAGE_OBJECTKEY = {
studyCenterPermission: 'studyCenterPermission', studyCenterPermission: 'studyCenterPermission',
caseInfo: 'caseInfo', caseInfo: 'caseInfo',
boutique_YQorderSetting: 'boutique_YQorderSetting', boutique_YQorderSetting: 'boutique_YQorderSetting',
sessionId:'sessionId' sessionId: 'sessionId',
createAllGoodsFlag: 'createAllGoodsFlag'
} }
...@@ -232,10 +232,11 @@ const decimal = (num, fixed) => { ...@@ -232,10 +232,11 @@ const decimal = (num, fixed) => {
/** 向上取整,保留 fixed 位小数(默认2位),用于商品价格、总价等 */ /** 向上取整,保留 fixed 位小数(默认2位),用于商品价格、总价等 */
const ceilDecimal = (num, fixed = 2) => { const ceilDecimal = (num, fixed = 2) => {
const n = Number(num) const n = Number(num)
if (isNaN(n)) return 0 if (isNaN(n) || n === 0) return 0
const pow = Math.pow(10, fixed) const pow = Math.pow(10, fixed)
// 避免浮点误差导致的边界问题(如 1.005、256.693 等) // 先乘 pow 再减极小量后 ceil,避免 1.01 等已整步长的数被浮点误差多进一位成 1.02
return Math.ceil((n + Number.EPSILON) * pow) / pow const tolerance = 1e-10
return Math.ceil((n * pow) - tolerance) / pow
} }
const setPrice = price => { const setPrice = price => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!