Commit 59bf190c by zhangxw

门店收款 多凭证交易流水号需求开发

1 parent da3c2141
...@@ -98,7 +98,8 @@ ...@@ -98,7 +98,8 @@
"gl-image": "components/GlImage/index", "gl-image": "components/GlImage/index",
"van-field": "@vant/weapp/field/index", "van-field": "@vant/weapp/field/index",
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index" "van-dialog": "@vant/weapp/dialog/index",
"van-uploader": "@vant/weapp/uploader/index"
}, },
"preloadRule": { "preloadRule": {
"pages/tabWorkOrder/pages/index/index": { "pages/tabWorkOrder/pages/index/index": {
......
...@@ -5,6 +5,9 @@ Component({ ...@@ -5,6 +5,9 @@ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
options: {
styleIsolation: 'shared', // 自定义覆盖vant样式
},
properties: { properties: {
show: Boolean, show: Boolean,
orderType: { orderType: {
...@@ -62,8 +65,8 @@ Component({ ...@@ -62,8 +65,8 @@ Component({
textareaValue: '', textareaValue: '',
routerBack: null, routerBack: null,
outTradeNo: '', outTradeNo: '',
payVoucher: '', wxqrcode: '',
wxqrcode: '' payVoucherList: []
}, },
/** 组件生命周期 */ /** 组件生命周期 */
...@@ -137,17 +140,17 @@ Component({ ...@@ -137,17 +140,17 @@ Component({
}, },
input(e) { input(e) {
let { value } = e.detail let { value } = e.detail
let val = value.replace(/[^a-zA-Z0-9]/g, '') let val = value.replace(/[^\a-\z\A-\Z0-9\.\,\?\<\>\。\,\-\——\=\;\;\/\'\"\’\‘\?\“\”\@\!\!\+\$]/g, '')
this.setData({ this.setData({
outTradeNo: val outTradeNo: val
}) })
}, },
upLoad() { // 上传付款凭证
upLoad(event) {
let _this = this let _this = this
wx.chooseImage({ let { payVoucherList } = _this.data
count: 1, const { file } = event.detail
success(res) { let tempFiles = file?.url
let [tempFiles] = res.tempFilePaths
let imgType = tempFiles.split('.')[1] let imgType = tempFiles.split('.')[1]
let type = imgType == 'unknown' ? 'jpg' : imgType let type = imgType == 'unknown' ? 'jpg' : imgType
wx.getFileSystemManager().readFile({ wx.getFileSystemManager().readFile({
...@@ -164,8 +167,9 @@ Component({ ...@@ -164,8 +167,9 @@ Component({
console.log(img) console.log(img)
let { code, data, message } = img let { code, data, message } = img
if (code == 0) { if (code == 0) {
payVoucherList.push({url: data})
_this.setData({ _this.setData({
payVoucher: data payVoucherList
}) })
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
...@@ -173,7 +177,15 @@ Component({ ...@@ -173,7 +177,15 @@ Component({
}) })
} }
}) })
} },
// 删除上传
deletePayVoucher(e) {
let { index } = e?.detail
let _this = this
let { payVoucherList } = _this.data
payVoucherList.splice(index, 1)
this.setData({
payVoucherList
}) })
}, },
changeOrderSource(e) { changeOrderSource(e) {
...@@ -187,20 +199,19 @@ Component({ ...@@ -187,20 +199,19 @@ Component({
}) })
}, },
confirm(e) { confirm(e) {
let { orderType, outTradeNo, payVoucher, textareaValue, orderTypeList } = this.data let { orderType, outTradeNo, payVoucherList, textareaValue, orderTypeList } = this.data
// debugger // debugger
console.log(wx.$router) console.log(wx.$router)
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
if (orderType == 2) { if (orderType == 2) {
console.log(payVoucher, outTradeNo) if (payVoucherList.length && outTradeNo) {
if (payVoucher && outTradeNo) {
thisPage.setData({ thisPage.setData({
outTradeNo, outTradeNo,
payVoucher payVoucherList
}) })
thisPage.createPayOrder() thisPage.createPayOrder()
} else { } else {
wx.$util.showToast('订单号或付款凭证不能为空!') wx.$util.showToast('交易流水号或付款凭证不能为空!')
} }
} else if (orderType == 0) { } else if (orderType == 0) {
if (textareaValue) { if (textareaValue) {
......
<view class="order-popup" wx:if="{{show}}" catchtouchmove="noScroll"> <view class="order-popup" wx:if="{{show}}" catchtouchmove="noScroll">
<view class="order-popup-bg" bindtap="close" /> <view class="order-popup-bg" bindtap="close" />
<view class="order-popup-content"> <view class="order-popup-content">
<view class="title" wx:if="{{orderType == 2}}">上传付款凭证</view>
<view class="order-popup-close" bindtap="close"> <view class="order-popup-close" bindtap="close">
<image src="../images/order-close.png" /> <image src="../images/order-close.png" />
</view> </view>
<!-- 4s店 开始 --> <!-- 4s店 开始 -->
<block wx:if="{{orderType == 2}}"> <block wx:if="{{orderType == 2}}">
<view class="title">上传付款凭证</view>
<view class="input-item"> <view class="input-item">
交易流水号
<view class="input-box"> <view class="input-box">
<input <input
type="text" type="text"
class="input"
bindinput="input" bindinput="input"
value="{{outTradeNo}}" value="{{outTradeNo}}"
maxlength="32" /> placeholder="输入交易流水号"
placeholder-class="outTradeNo_placeholder"
maxlength="100" />
</view> </view>
</view> </view>
<view class="camera-box" bindtap="upLoad"> <view class="upload-content">
<block wx:if="{{payVoucher}}"> <view class="title-text">上传图片</view>
<image src="{{payVoucher}}" /> <view class="upload-box">
</block> <van-uploader
<block wx:else> file-list="{{ payVoucherList }}"
<view class="camera-icon"> max-count="9"
<image src="../images/order-camera.png" /> deletable
preview-size="160rpx"
bind:after-read="upLoad"
bind:delete="deletePayVoucher"
>
</van-uploader>
</view> </view>
</block>
</view> </view>
<view class="btn" bindtap="confirm">确定</view> <view class="btn" bindtap="confirm">确定</view>
</block> </block>
<!-- 4s店 end --> <!-- 4s店 end -->
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
width: 82.9%; width: calc(100% - 128rpx);
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10); box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.10);
border-radius: 16rpx; border-radius: 16rpx;
...@@ -70,10 +70,10 @@ ...@@ -70,10 +70,10 @@
} }
.order-popup-content .title { .order-popup-content .title {
padding: 70rpx 0 32rpx; padding: 26rpx 0 32rpx;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
font-weight: 700; font-weight: 600;
text-align: center; text-align: center;
} }
...@@ -121,18 +121,18 @@ ...@@ -121,18 +121,18 @@
.order-popup-content .input-item { .order-popup-content .input-item {
display: flex; display: flex;
padding: 0 50rpx;
align-items: center; align-items: center;
font-size: 24rpx; font-size: 24rpx;
color: #333333; color: #333333;
justify-content: space-between; padding: 0 48rpx;
} }
.order-popup-content .input-box { .order-popup-content .input-box {
width: 370rpx; width: 100%;
height: 60rpx; height: 64rpx;
border: 2rpx solid #C3C3C3; border: 2rpx solid #EFF0F2;
border-radius: 8rpx; border-radius: 8rpx;
background: #F4F5F7;
box-sizing: border-box; box-sizing: border-box;
padding: 0 20rpx; padding: 0 20rpx;
display: flex; display: flex;
...@@ -144,6 +144,62 @@ ...@@ -144,6 +144,62 @@
height: 100%; height: 100%;
} }
.order-popup-content .input-box .input .outTradeNo_placeholder{
color: #B6B6B8;
font-size: 24rpx;
}
.order-popup-content .upload-content{
display: flex;
flex-flow: column;
padding: 24rpx 48rpx;
}
.order-popup-content .upload-content .title-text{
font-weight: 500;
font-size: 28rpx;
color: #282829;
margin-bottom: 18rpx;
}
.van-uploader .van-uploader__wrapper {
display: flex;
flex-wrap: wrap;
gap: 22rpx;
}
.van-uploader .van-uploader__wrapper .van-uploader__upload{
order: -1;
}
.van-uploader .van-uploader__wrapper .van-uploader__preview,.van-uploader__upload{
margin: 0;
border-radius: 8rpx;
/* width: 160rpx !important;
height: 160rpx !important; */
position: relative;
}
.van-uploader .van-uploader__wrapper .van-uploader__preview image{
border-radius: 8rpx;
/* width: 160rpx !important;
height: 160rpx !important; */
}
.van-uploader .van-uploader__wrapper .van-uploader__preview .van-uploader__preview-delete{
width: 36rpx;
height: 36rpx;
background-color: rgba(0, 0, 0, 1);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: -8rpx;
right: -8rpx;
}
.van-uploader .van-uploader__wrapper .van-uploader__preview .van-uploader__preview-delete .van-uploader__preview-delete-icon{
font-size: 36rpx;
transform: scale(.7);
}
.van-uploader .van-uploader__wrapper .van-uploader__preview .van-uploader__preview-delete::after{
width: 0;
}
.order-popup-content .camera-box { .order-popup-content .camera-box {
margin: 30rpx auto 40rpx; margin: 30rpx auto 40rpx;
width: 522rpx; width: 522rpx;
......
...@@ -129,6 +129,12 @@ class Router { ...@@ -129,6 +129,12 @@ class Router {
query query
} }
} }
/**跳转至H5 */
jumpH5(url) {
wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(url)}`
})
}
/**页面跳转 /**页面跳转
* *
*/ */
......
...@@ -12,8 +12,9 @@ export default { ...@@ -12,8 +12,9 @@ export default {
recordId:29 recordId:29
}, },
{ {
name: '商品排行', name: '趋势分析',
url: '' url: 'http://baidu.com',
isH5: true
}, },
{ {
name: '员工排名', name: '员工排名',
...@@ -55,8 +56,13 @@ export default { ...@@ -55,8 +56,13 @@ export default {
icon: 'none' icon: 'none'
}) })
} else { } else {
console.log(item.url) if (item.isH5) {
wx.$router.jumpH5(item.url)
} else {
wx.$router.go(item.url) wx.$router.go(item.url)
}
console.log(item.url)
item.recordId&&wx.$util.pointRecord(item.recordId) item.recordId&&wx.$util.pointRecord(item.recordId)
} }
// 暂未上线,敬请期待 // 暂未上线,敬请期待
......
...@@ -138,14 +138,14 @@ Page({ ...@@ -138,14 +138,14 @@ Page({
let { let {
orderInfo: { selectPayType, orderCode }, orderInfo: { selectPayType, orderCode },
outTradeNo, outTradeNo,
payVoucher payVoucherList
} = this.data } = this.data
let obj = { let obj = {
orderCode, orderCode,
payType: selectPayType payType: selectPayType
} }
if (payVoucher && outTradeNo) { if (payVoucherList && outTradeNo) {
obj.payVoucher = payVoucher obj.payVoucherList = payVoucherList.map(v => {return v?.url})
obj.outTradeNo = outTradeNo obj.outTradeNo = outTradeNo
} }
wx.$util.showLoading() wx.$util.showLoading()
......
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
orderType="{{orderInfo.selectPayType }}" orderType="{{orderInfo.selectPayType }}"
wx:if="{{showPopup}}" wx:if="{{showPopup}}"
show="{{showPopup}}" show="{{showPopup}}"
qrCode="{{orderInfo.payOrder.outTradeNo}}" qrCode="{{orderInfo.payOrder.outTradeNo || ''}}"
price="{{orderInfo.total_price}}" price="{{orderInfo.total_price}}"
orderCode="{{orderInfo.orderCode}}" /> orderCode="{{orderInfo.orderCode}}" />
<artificer-select-popup <artificer-select-popup
......
...@@ -423,11 +423,11 @@ Page({ ...@@ -423,11 +423,11 @@ Page({
}, },
previewImage(e) { previewImage(e) {
let { url } = e.currentTarget.dataset let { url, index } = e.currentTarget.dataset
console.log(url) console.log(url)
wx.previewImage({ wx.previewImage({
urls: [url], urls: url,
current: url current: url[index]
}) })
}, },
/** /**
......
...@@ -100,9 +100,11 @@ ...@@ -100,9 +100,11 @@
<block wx:if="{{orderInfo.selectPayType == 2}}"> <block wx:if="{{orderInfo.selectPayType == 2}}">
<view class="cell"> <view class="cell">
<view class="label">付款凭证:</view> <view class="label">付款凭证:</view>
<view class="value" bindtap="previewImage" data-url="{{orderInfo.payOrder.payVoucher}}"> <view class="image-box">
<view class="value" bindtap="previewImage" wx:for="{{orderInfo.payVoucherList}}" wx:key="index" data-index="{{index}}" data-url="{{orderInfo.payVoucherList}}">
<view class="image"> <view class="image">
<image src="{{orderInfo.payOrder.payVoucher}}" /> <image src="{{item}}" />
</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -211,6 +211,12 @@ page { ...@@ -211,6 +211,12 @@ page {
width: 180rpx; width: 180rpx;
} }
.box .cell .image-box{
display: flex;
flex-flow: wrap;
gap: 10rpx;
}
.box .cell .value { .box .cell .value {
color: #333333; color: #333333;
max-width: 370rpx; max-width: 370rpx;
...@@ -219,8 +225,8 @@ page { ...@@ -219,8 +225,8 @@ page {
} }
.box .cell .value .image { .box .cell .value .image {
width: 150rpx; width: 140rpx;
height: 150rpx; height: 140rpx;
} }
.customer.box .cell .value { .customer.box .cell .value {
......
...@@ -363,12 +363,12 @@ Page({ ...@@ -363,12 +363,12 @@ Page({
}, },
previewImage(e) { previewImage(e) {
let { url } = e.currentTarget.dataset let { url, index } = e.currentTarget.dataset
// if (url.includes('http')) { // if (url.includes('http')) {
wx.previewImage({ wx.previewImage({
urls: [url], urls: url,
current: url current: url[index]
}) })
}, },
/** /**
......
...@@ -82,9 +82,11 @@ ...@@ -82,9 +82,11 @@
<block wx:if="{{orderInfo.selectPayType == 2}}"> <block wx:if="{{orderInfo.selectPayType == 2}}">
<view class="cell"> <view class="cell">
<view class="label">付款凭证:</view> <view class="label">付款凭证:</view>
<view class="value" bindtap="previewImage" data-url="{{orderInfo.payOrder.payVoucher}}"> <view class="image-box">
<view class="value" bindtap="previewImage" wx:for="{{orderInfo.payVoucherList}}" wx:key="index" data-index="{{index}}" data-url="{{orderInfo.payVoucherList}}">
<view class="image"> <view class="image">
<image src="{{orderInfo.payOrder.payVoucher}}" /> <image src="{{item}}" />
</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -118,6 +118,12 @@ page { ...@@ -118,6 +118,12 @@ page {
width: 180rpx; width: 180rpx;
} }
.box .cell .image-box{
display: flex;
flex-flow: wrap;
gap: 10rpx;
}
.box .cell .value { .box .cell .value {
color: #333333; color: #333333;
max-width: 370rpx; max-width: 370rpx;
...@@ -126,8 +132,8 @@ page { ...@@ -126,8 +132,8 @@ page {
} }
.box .cell .value .image { .box .cell .value .image {
width: 150rpx; width: 140rpx;
height: 150rpx; height: 140rpx;
} }
.customer.box .cell .value { .customer.box .cell .value {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!