Commit 0d04cd01 by cen

feat: 新增pos机支付弹窗

1 parent 8f4a7cf2
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<page-meta :page-style="'overflow:' + (show ? 'hidden' : 'visible')"></page-meta> <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"> <uni-popup :class="popupClass" ref="publishPopup" :type="type" @change="change" :is-mask-click="isMaskClick" :safe-area="safeArea" :showClose="showClose">
<!-- 顶部标题栏插槽 --> <!-- 顶部标题栏插槽 -->
<slot name="header" ></slot> <slot name="header">
<view class="popup-top-box flex align-center" v-if="showTitle"> <view class="popup-top-box flex align-center" v-if="showTitle">
<text class="popup-top-box-title">{{ title }}</text> <text class="popup-top-box-title">{{ title }}</text>
<uni-icons @click="closePopup" class="icon-close" type="closeempty"></uni-icons> <uni-icons @click="closePopup" class="icon-close" type="closeempty"></uni-icons>
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
<slot name="content"></slot> <slot name="content"></slot>
<!-- 底部插槽 插槽有内容就优先自定义内容--> <!-- 底部插槽 插槽有内容就优先自定义内容-->
<slot name="footer"> <slot name="footer">
<view class="footer-box flex justify-center"> <view class="footer-box flex justify-center" v-if="isShowFooter">
<view class="cancle-btn btn" @click.stop="closePopup">取消</view> <view class="cancle-btn btn" @click.stop="closePopup">{{ cancelText }}</view>
<view class="sure-btn btn" @click.stop="confirm">确认</view> <view class="sure-btn btn" @click.stop="confirm">{{ confirmText }}</view>
</view> </view>
</slot> </slot>
</uni-popup> </uni-popup>
...@@ -49,11 +49,22 @@ export default { ...@@ -49,11 +49,22 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
showTitle:{ showTitle: {
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowFooter: {
type: Boolean,
default: true
},
cancelText: {
type: String,
default: '取消'
},
confirmText: {
type: String,
default: '确定'
}
}, },
data() { data() {
return { return {
...@@ -83,7 +94,7 @@ export default { ...@@ -83,7 +94,7 @@ export default {
font-size: toRpx(36); font-size: toRpx(36);
font-weight: 500; font-weight: 500;
text-align: center; text-align: center;
padding: toRpx(32);
.popup-top-box-title { .popup-top-box-title {
flex: 1; flex: 1;
} }
...@@ -131,5 +142,5 @@ export default { ...@@ -131,5 +142,5 @@ export default {
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
margin-left: toRpx(32); margin-left: toRpx(32);
} }
} }
</style> </style>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</view> </view>
<view v-if="orderCardDetail.subOrderList.length > 2" class="goods-more"> <view v-if="orderCardDetail.subOrderList.length > 2" class="goods-more">
<text @click="showAllGoodsList"> <text @click.stop="showAllGoodsList">
{{ orderCardDetail.showAllGoodsListFlag ? '收起' : '查看全部' }} {{ orderCardDetail.showAllGoodsListFlag ? '收起' : '查看全部' }}
</text> </text>
(共{{ orderCardDetail.subOrderList.length }}件) (共{{ orderCardDetail.subOrderList.length }}件)
...@@ -219,13 +219,13 @@ export default { ...@@ -219,13 +219,13 @@ export default {
if (name == 'CreateOrder' && (await this.inspectionOfProhibitionBill())) return /**禁止提单 */ if (name == 'CreateOrder' && (await this.inspectionOfProhibitionBill())) return /**禁止提单 */
// 是微信支付直接跳转确认页面 // 是微信支付直接跳转确认页面
if (userType == 2 && item?.selectPayType == 1) { if (userType == 2 && item?.selectPayType == 1) {
this.$emit('jump', 'ConfirmOrder') this.$emit('jump', 'ConfirmOrder', this.orderCardDetail)
} else if (userType == 2) { } else if (userType == 2) {
item item
? this.showSelectType({ ? this.showSelectType({
item item
}) })
: this.$emit('jump', name) : this.$emit('jump', name, this.orderCardDetail)
} else { } else {
utils.showNoAccess() utils.showNoAccess()
} }
...@@ -234,10 +234,9 @@ export default { ...@@ -234,10 +234,9 @@ export default {
} }
// 已支付加已施工 // 已支付加已施工
} else if (item.constructionFlag == 'Y' && item.status != 10) { } else if (item.constructionFlag == 'Y' && item.status != 10) {
// wx.$router.go('tabWorkOrder.constructionOrderDetail', item) this.$emit('jump', name, this.orderCardDetail)
// this.$emit('jump', name, item)
} else { } else {
this.$emit('jump', name) this.$emit('jump', name, this.orderCardDetail)
} }
}, },
// 确定是否要显示 // 确定是否要显示
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
<text>{{ item.tabName }}</text> <text>{{ item.tabName }}</text>
<text class="num">{{ item.num }}</text> <text class="num">{{ item.num }}</text>
</view> </view>
<view>
筛选
<view class="sprite-icon icon-filter"></view>
</view>
</view> </view>
<view class="px-48"> <view class="px-48">
<view class="tips" v-if="waitInputCount"> <view class="tips" v-if="waitInputCount">
...@@ -119,6 +123,7 @@ ...@@ -119,6 +123,7 @@
</scroll-view> </scroll-view>
</template> </template>
</PublishPopup> </PublishPopup>
<order-screen ref="test" @onConfirm="回调" />
</view> </view>
</template> </template>
...@@ -130,12 +135,14 @@ import OrderCard from '../../components/OrderCard' ...@@ -130,12 +135,14 @@ import OrderCard from '../../components/OrderCard'
import PublishPopup from '@/components/PublishPopup.vue' import PublishPopup from '@/components/PublishPopup.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import utils from '@/utils/utils' import utils from '@/utils/utils'
import OrderScreen from '@/components/OrderScreen/index.vue'
export default { export default {
name: 'OrderManagement', name: 'OrderManagement',
mixins: [ZPMixin, interceptionMixin], mixins: [ZPMixin, interceptionMixin],
components: { components: {
OrderCard, OrderCard,
PublishPopup PublishPopup,
OrderScreen
}, },
data() { data() {
return { return {
......
<template>
<view class="upload-proof-of-payment">
<view class="common-title">上传付款凭证</view>
<view class="px-48">
<view class="box-shell">
<view class="flex align-center justify-between box-flow">
<view class="box-label">
交易流水号
<text class="required">*</text>
</view>
<input v-model="outTradeNo" class="uni-input" maxlength="100" placeholder="请输入" />
</view>
<view class="payment">
<view class="payment-label">
付款凭证
<text class="required">*</text>
</view>
<view class="upload-box flex flex-wrap">
<view class="upload-item" @click="selectImg"></view>
<view v-for="(item, index) in payVoucherList" :key="index" class="previewImageList">
<image :src="item"></image>
<view class="close-box" @click="deleteImg(index)">
<uni-icons class="icon-close" type="closeempty" color="#ffffff"></uni-icons>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="uploadBtn" @click="confirm">确定提交</view>
</view>
</template>
<script>
import { uploadFile } from '@/utils/ossUploadFile/uploadFile.js'
export default {
name: 'UploadProofOfPayment',
props: {
transmissionOfData: {
type: Object,
default: () => null
}
},
data() {
return {
payVoucherList: [],
outTradeNo: ''
}
},
mounted() {
console.log(this.transmissionOfData, 'console.log(this.transmissionOfData)')
},
methods: {
selectImg() {
let _this = this
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: function (res) {
console.log(res)
_this.upLoad(res)
}
})
},
// 上传付款凭证
async upLoad(event) {
console.log(event)
let _this = this
const { tempFilePaths } = event
let url = await uploadFile(tempFilePaths[0])
this.payVoucherList.push(url)
},
confirm(e) {
console.log(this.transmissionOfData)
let { outTradeNo, payVoucherList } = this
if (payVoucherList.length && outTradeNo) {
this.createPayOrder()
} else {
uni.showToast({ title: '交易流水号或付款凭证不能为空!', icon: 'none' })
}
},
deleteImg(index) {
this.payVoucherList.splice(index, 1)
},
createPayOrder() {
const { orderCode, payType, payeeType } = this.transmissionOfData
let obj = {
orderCode,
payType: payType,
payeeType: payeeType
}
if (this.payVoucherList?.length && this.outTradeNo) {
obj.payVoucherList = this.payVoucherList.map(v => {
return v?.url
})
obj.outTradeNo = this.outTradeNo
}
console.log(obj)
uni.$api.boutiqueApi.createPayOrder(obj).then(data => {
uni.showToast({ title: '提交成功', icon: 'success' })
this.$emit('jump', 'OrderDetail', data)
})
}
}
}
</script>
<style scoped lang="scss">
.px-48 {
padding: 0 toRpx(48);
}
.upload-proof-of-payment {
width: 100%;
height: 100%;
position: relative;
.box-shell {
width: 100%;
border-radius: toRpx(16);
background: #ffffff;
padding: toRpx(24) toRpx(32);
margin-top: toRpx(16);
.box-flow {
border-bottom: toRpx(2) solid #f7f7f6;
padding-bottom: toRpx(28);
.box-label {
font-weight: 400;
font-size: toRpx(28);
color: #333333;
}
.required {
color: #f00;
margin-left: toRpx(8);
}
.uni-input {
text-align: right;
.uni-input-placeholder {
font-size: toRpx(28);
font-weight: 400;
}
}
}
.payment {
.payment-label {
font-weight: 400;
font-size: toRpx(28);
color: #333333;
margin-top: toRpx(32);
margin-bottom: toRpx(24);
.required {
color: #f00;
margin-left: toRpx(8);
}
}
.upload-box {
gap: toRpx(20);
.upload-item {
width: toRpx(320) !important;
height: toRpx(240) !important;
border-radius: toRpx(12);
background: url('@/assets/images/boutique/uploadImage.png') no-repeat;
background-size: 100% 100%;
}
.previewImageList {
position: relative;
image {
width: toRpx(320) !important;
height: toRpx(240) !important;
border-radius: toRpx(12);
}
.close-box {
width: toRpx(36);
height: toRpx(36);
position: absolute;
top: - toRpx(12);
right: - toRpx(12);
background: rgba(0, 0, 0, 0.6);
border-radius: 50%;
text-align: center;
line-height: toRpx(40);
}
.icon-close {
font-size: toRpx(12);
}
}
}
}
}
.uploadBtn {
width: 80%;
height: toRpx(80);
border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: toRpx(28);
font-weight: 500;
position: absolute;
bottom: toRpx(20);
margin: 0 auto;
left: 0;
right: 0;
text-align: center;
line-height: toRpx(80);
}
}
</style>
...@@ -32,6 +32,8 @@ import DailyReport from './components/DailyReport.vue' ...@@ -32,6 +32,8 @@ import DailyReport from './components/DailyReport.vue'
import DefeatOrder from './components/DefeatOrder.vue' import DefeatOrder from './components/DefeatOrder.vue'
import OrderManagement from './components/OrderManagement.vue' import OrderManagement from './components/OrderManagement.vue'
import ConfirmOrder from './components/ConfirmOrder.vue' import ConfirmOrder from './components/ConfirmOrder.vue'
import OrderDetail from './components/OrderDetail.vue'
import UploadProofOfPayment from './components/UploadProofOfPayment.vue'
import NoticePopup from './components/NoticePopup.vue' import NoticePopup from './components/NoticePopup.vue'
export default { export default {
components: { components: {
...@@ -41,7 +43,9 @@ export default { ...@@ -41,7 +43,9 @@ export default {
DefeatOrder, DefeatOrder,
OrderManagement, OrderManagement,
ConfirmOrder, ConfirmOrder,
NoticePopup NoticePopup,
UploadProofOfPayment,
OrderDetail
}, },
data() { data() {
return { return {
...@@ -66,7 +70,8 @@ export default { ...@@ -66,7 +70,8 @@ export default {
} }
// 配置弹窗按钮 // 配置弹窗按钮
this.$refs.notice.buttons = [{ this.$refs.notice.buttons = [
{
text: '确认退出', text: '确认退出',
type: 'default', type: 'default',
callback: () => { callback: () => {
...@@ -77,13 +82,15 @@ export default { ...@@ -77,13 +82,15 @@ export default {
} }
this.$refs.notice.close() this.$refs.notice.close()
} }
}, { },
{
text: '继续编辑', text: '继续编辑',
type: 'primary', type: 'primary',
callback: () => { callback: () => {
this.$refs.notice.close() this.$refs.notice.close()
} }
}] }
]
// 打开弹窗 // 打开弹窗
this.$refs.notice.open() this.$refs.notice.open()
......
...@@ -256,6 +256,7 @@ const refreshPageData = notRefreshOrder => { ...@@ -256,6 +256,7 @@ const refreshPageData = notRefreshOrder => {
getApp().globalData.dateListRefresh = true getApp().globalData.dateListRefresh = true
getApp().globalDataorderListDateListScreenRefresh = true getApp().globalDataorderListDateListScreenRefresh = true
} }
export default { export default {
compareVersions, compareVersions,
convertDateTimeFormat, convertDateTimeFormat,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!