Commit d0922c80 by cen

fix: 公共弹窗自定义

1 parent dc1a2119
......@@ -231,5 +231,17 @@ module.exports = {
/**根据订单号获取订单详情(含套餐) */
getPackageGoodsDetail(data) {
return http.post({ method: 'dj.api.smartcarlife.order.packageGoodsDetail', projectName: 'boutique', ...data })
},
/** 根据订单号获取订单详情 */
getOrderDetail(data) {
return http.post({ method: 'dj.api.smartcarlife.order.detail', projectName: 'boutique', ...data })
},
/**改变支付订单状态 */
createPayOrder(data) {
return http.post({ method: 'dj.api.smartcarlife.payOrder.create', projectName: 'boutique', ...data })
},
/** 修改订单备注 */
updateOrderRemark(data) {
return http.post({ method: 'dj.api.smartcarlife.order.updateRemark', projectName: 'boutique', ...data })
}
}
......@@ -3,16 +3,21 @@
<page-meta :page-style="'overflow:' + (show ? 'hidden' : 'visible')"></page-meta>
<uni-popup :class="popupClass" ref="publishPopup" :type="type" @change="change" :is-mask-click="isMaskClick" :safe-area="safeArea" :showClose="showClose">
<!-- 顶部标题栏插槽 -->
<slot name="header">
<view class="popup-top-box flex align-center">
<slot name="header" ></slot>
<view class="popup-top-box flex align-center" v-if="showTitle">
<text class="popup-top-box-title">{{ title }}</text>
<uni-icons @click="closePopup" class="icon-close" type="closeempty"></uni-icons>
</view>
</slot>
<!-- 主要内容插槽 -->
<slot name="content"></slot>
<!-- 底部插槽 -->
<slot name="footer"></slot>
<!-- 底部插槽 插槽有内容就优先自定义内容-->
<slot name="footer">
<view class="footer-box flex justify-center">
<view class="cancle-btn btn" @click.stop="closePopup">取消</view>
<view class="sure-btn btn" @click.stop="confirm">确认</view>
</view>
</slot>
</uni-popup>
</template>
......@@ -43,7 +48,12 @@ export default {
title: {
type: String,
default: ''
}
},
showTitle:{
type: Boolean,
default: true
},
},
data() {
return {
......@@ -51,7 +61,7 @@ export default {
}
},
methods: {
open() {
open(callback) {
this.$refs.publishPopup.open()
},
change(e) {
......@@ -60,6 +70,9 @@ export default {
closePopup() {
this.$refs.publishPopup.close()
this.$emit('close')
},
confirm() {
this.$emit('confirm')
}
}
}
......@@ -92,4 +105,31 @@ export default {
font-size: toRpx(24);
font-weight: 600;
}
.footer-box {
width: 100%;
height: toRpx(164);
background-color: #fff;
position: absolute;
border-radius: 0 0 toRpx(42) toRpx(42);
bottom: 0;
.btn {
width: 40%;
height: toRpx(80);
border-radius: toRpx(48);
opacity: 1;
line-height: toRpx(80);
text-align: center;
color: rgba(26, 26, 26, 0.6);
font-size: toRpx(32);
font-weight: 500;
}
.cancle-btn {
background: #f0f1f5;
}
.sure-btn {
color: #fff;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
margin-left: toRpx(32);
}
}
</style>
......@@ -249,30 +249,6 @@ export default {
}
this.$refs.recordOrderPopup.open()
// this.uni.showModal({
// show: true,
// title: '请选择录单入口',
// tabTitleShow: false,
// success: async res => {
// // 跳转新增订单页面 并带特定参数
// console.log(item, 'showSelectType')
// if (this.selectType == 1) {
// if (await this.inspectionOfProhibitionBill()) return
// wx.$router.go('tabWorkOrder.createOrder', {
// scene,
// ...item
// })
// } else {
// wx.$router.go('tabWorkOrder.defeatOrder', {
// scene,
// ...item,
// isExpiredTraffic: this.selectType == 3
// })
// }
// },
// error: () => {}
// })
},
// 获取轻改录单配置是否启用流量失效
......@@ -294,10 +270,13 @@ export default {
if (this.selectType == 1) {
console.log(await this.inspectionOfProhibitionBill())
if (await this.inspectionOfProhibitionBill()) return
this.$emit('jump', 'CreateOrder')
this.$emit('jump', 'CreateOrder', this.orderCardDetail)
} else {
this.$emit('jump', 'DefeatOrder')
}
},
cancelSelection() {
this.$refs.recordOrderPopup.closePopup()
}
}
}
......
......@@ -6,6 +6,16 @@
<text class="fs-16 fw-7">等待客户付款</text>
<text class="fs-13 ml-12">点击下一步,锁定并生成工单码。</text>
</view>
<view v-if="!isErrorOrder && (orderInfo.selectPayType == 2 || orderInfo.selectPayType == 5 || orderInfo.selectPayType == 6 || orderInfo.selectPayType == 7)" class="box date-box box-shell flex justify-between align-center">
<view class="date-box-label">
收款时间
<text class="required">*</text>
</view>
<view class="flex justify-between align-center">
<view class="date-box-value">{{ successDate }}</view>
<view class="handlerBtn" @click="toshowDateModal">编辑</view>
</view>
</view>
<!-- 商品信息 -->
<view class="box-shell">
<view class="box-shell-title">商品信息</view>
......@@ -55,7 +65,7 @@
<view v-else>{{ orderInfo[item.key] || '' }}</view>
</view>
</view>
<view v-if="item.copy" class="copy-btn" @click="copyText">
<view v-if="item.copy" class="copy-btn" @click="setCopyData(orderInfo[item.key])">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
</view>
......@@ -90,10 +100,10 @@
<view class="label">{{ item.label }}</view>
<view class="value" :style="{ color: item.color || '#333' }">
<view v-if="item.arr">
<view v-if="orderInfo[item.arr[1]]">
<view v-if="orderInfo[item.arr[1]]" class="flex">
<view v-for="(i, ind) in item.arr" :key="ind">
<view class="value-item text-hide">
<text v-if="ind == 1">|</text>
<text v-if="ind == 1" class="lineText">|</text>
{{ orderInfo[i] }}
</view>
</view>
......@@ -102,12 +112,9 @@
<view v-else>
{{ item.enum ? item.enum[orderInfo[item.key]] : orderInfo[item.key] || '' }}
</view>
<view v-if="item.copy">
<view class="copy" @click="setCopyData">
<!-- 复制 -->
<!-- <image src="{{IMG_URL}}copy_icon_gapy.png" class="copyImage" binderror="" bindload=""></image> -->
</view>
</view>
</view>
<view v-if="item.copy" class="copy-btn" @click="setCopyData(orderInfo[item.key])">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
</view>
</view>
......@@ -122,16 +129,32 @@
</view>
<view class="flex align-center footer-box justify-center">
<view class="edit btn">修改</view>
<view class="confirm btn">确认</view>
<view class="edit btn" @clcik="edit">修改</view>
<view class="confirm btn" @click="confirm">确认</view>
</view>
</view>
<PublishPopup ref="tipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false" @confirm="confirmTips">
<template #content>
<view>
<image class="tipsPopupBg" src="@/assets/images/boutique/tipsPopupBg.png" />
<view class="title">重要提示</view>
<view class="tipsConent">
<view>请检查店内是否配备POS机,确认信息后该工单将无法撤销或修改!</view>
<view>若4S店已向车主收款,请返回修改支付方式为</view>
<text>"门店收款"</text>
</view>
</view>
</template>
</PublishPopup>
<OrderPopup :orderType="orderInfo.selectPayType" v-if="showPopup" :show="showPopup" :qrCode="orderInfo.payOrder.outTradeNo || ''" :price="orderInfo.total_price" :orderCode="orderInfo.orderCode" />
</view>
</template>
<script>
import utils from '@/utils/utils'
import order_mixins from '../../order_mixins.js'
import dayjs from 'dayjs'
import PublishPopup from '@/components/PublishPopup.vue'
import OrderPopup from '@/components/OrderPopup/index.vue'
export default {
name: 'OrderConfirm',
props: {
......@@ -140,6 +163,9 @@ export default {
default: () => ({})
}
},
components: {
PublishPopup
},
data() {
return {
...order_mixins.data,
......@@ -150,7 +176,9 @@ export default {
},
mounted() {
this.getPositionList()
this.getDetail('250819144103724')
// 250819144103724
this.getDetail('250818205800944')
this.successDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
},
methods: {
replaceItemText(item) {
......@@ -298,11 +326,135 @@ export default {
async getPositionList() {
const res = await uni.$api.boutiqueApi.getPositionList({})
this.positionTypeList = res
},
setCopyData(e) {
utils.setCopyData(`${e}`)
},
confirm() {
this.checkPayType()
},
edit() {
this.$emit('jump', 'CreateOrder', this.orderInfo)
},
checkPayType() {
let _this = this
// 微信支付
if (this.orderInfo.selectPayType == 1) {
// _this.setData({
// showPopup: true,
// });
_this.getDetail(this.orderInfo.orderCode)
if (!time) {
time = setInterval(() => {
_this.getDetail(_this.orderInfo.orderCode)
}, 5 * 1000)
}
return false
}
// pos机支付
if (this.orderInfo.selectPayType == 3) {
if (this.orderInfo.status == 1) {
this.$refs.tipsPopup.open()
} else {
_this.createPayOrder()
}
} else {
console.log('支付完成')
if (!this.successDate && !this.isErrorOrder && this.orderInfo.selectPayType != 0) return uni.showToast({ title: this.orderInfo.selectPayType == 2 ? '请选择4S店收款时间' : '请选择嘀加收款时间' })
this.showPopup = true
}
},
confirmTips() {
this.createPayOrder()
},
createPayOrder() {
let {
orderInfo: { selectPayType, orderCode, payeeType },
outTradeNo,
payVoucherList,
successDate,
isErrorOrder
} = this
let obj = {
orderCode,
payType: selectPayType,
payeeType: payeeType
}
// 支付方式 2:门店收款 5:嘀加收款 6:对公转账 7:其它收款
if ([2, 5, 6, 7].includes(Number(selectPayType)) && !isErrorOrder) {
obj.successDate = new Date(successDate).format('yyyy-MM-dd hh:mm:ss')
}
if (payVoucherList?.length && outTradeNo) {
obj.payVoucherList = payVoucherList.map(v => {
return v?.url
})
obj.outTradeNo = outTradeNo
}
console.log(obj)
uni.showLoading()
// 状态更新 需刷新工单列表和预约管理列表
utils.refreshPageData()
uni.$api.boutiqueApi.createPayOrder(obj).then(res => {
console.log(res)
let { code, data, message } = res
if (code == 0) {
wx.hideLoading()
console.log(`类型为:${selectPayType}`)
if (selectPayType == 3 || selectPayType == 1) {
this.setData({
['orderInfo.payOrder.outTradeNo']: data.outTradeNo,
showPopup: true
})
this.getDetail(orderCode)
if (!time) {
time = setInterval(() => {
// console.log('6666666666')
this.getDetail(orderCode)
}, 5 * 1000)
}
} else {
wx.$router.redirectTo('orderDetail', data)
}
} else {
wx.$util.showToast(message)
}
})
}
}
}
</script>
<style scoped lang="scss">
// Popup样式
::v-deep .tipsPopup .uni-popup__wrapper {
width: toRpx(848);
height: toRpx(744);
border-radius: toRpx(42);
background: rgb(255, 255, 255) !important;
.tipsPopupBg {
border-radius: toRpx(42) toRpx(42) 0 0;
width: 100%;
height: toRpx(244);
}
.title {
color: #333333;
font-size: toRpx(40);
font-weight: 500;
text-align: center;
margin-top: toRpx(48);
}
.tipsConent {
color: #666666;
font-size: toRpx(32);
font-weight: 400;
padding: toRpx(16) toRpx(64);
line-height: toRpx(48);
text {
color: #347bff;
}
}
}
.order-confirm {
position: relative;
height: 100%;
......@@ -348,6 +500,43 @@ export default {
.py-8 {
padding: toRpx(8) 0;
}
.date-box {
display: flex;
align-items: center;
position: relative;
}
.date-box-label {
font-weight: 400;
font-size: toRpx(28);
color: #333333;
}
.date-box-value {
font-weight: 500;
font-size: toRpx(40);
color: #333333;
}
.required {
color: #f00;
margin-left: toRpx(8);
}
.handlerBtn {
color: #4673ff;
font-size: toRpx(26);
font-weight: 400;
margin-left: toRpx(8);
}
.copy-btn {
display: flex;
align-items: center;
color: #808291;
.copy {
margin-right: toRpx(8);
margin-left: toRpx(20);
}
}
.top-tips {
width: 100%;
height: toRpx(48);
......@@ -422,6 +611,9 @@ export default {
}
.order-info {
.value .value-item text {
margin: 0 toRpx(6);
}
.label {
width: toRpx(156);
color: #999999;
......
......@@ -238,6 +238,24 @@ const showNoAccess = () => {
icon: 'error'
})
}
/**设置粘贴板内容 */
const setCopyData = (data, callBack) => {
console.log(data, 'setCopyData')
uni.setClipboardData({
data: data,
success(res) {
console.log(res, 'setCopyData')
if (callBack && typeof callBack === 'function') callBack(res)
}
})
}
/** 刷新工单管理 预约管理数据 */
const refreshPageData = notRefreshOrder => {
if (!notRefreshOrder) getApp().globalData.orderListRefresh = true
getApp().globalData.dateListRefresh = true
getApp().globalDataorderListDateListScreenRefresh = true
}
export default {
compareVersions,
convertDateTimeFormat,
......@@ -255,5 +273,7 @@ export default {
getViewInfo,
setPrice,
decimal,
showNoAccess
showNoAccess,
setCopyData,
refreshPageData
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!