Commit cff491a7 by zhangxw

众筹尾款 门店收款需求开发

1 parent d00b8b7c
Showing 32 changed files with 920 additions and 171 deletions
...@@ -94,8 +94,8 @@ ...@@ -94,8 +94,8 @@
padding: 30rpx 0 72rpx; padding: 30rpx 0 72rpx;
} }
.fixed-remark { .fixed-remark {
background: #F7F7F7; background: #F4F5F7;
border: 2rpx solid #C3C3C3; border: 2rpx solid #EFF0F2;
border-radius: 12rpx; border-radius: 12rpx;
width: 522rpx; width: 522rpx;
height: 260rpx; height: 260rpx;
......
...@@ -50,5 +50,9 @@ module.exports = { ...@@ -50,5 +50,9 @@ module.exports = {
/**改变支付订单状态 */ /**改变支付订单状态 */
createPayOrder(data) { createPayOrder(data) {
return api.post('dj.api.smartcarlife.payOrder.create', data) return api.post('dj.api.smartcarlife.payOrder.create', data)
},
/** 修改订单备注 */
updateOrderRemark(data) {
return api.post('dj.api.smartcarlife.order.updateRemark', data)
} }
} }
...@@ -88,6 +88,9 @@ Component({ ...@@ -88,6 +88,9 @@ Component({
console.log(target) console.log(target)
this.triggerEvent('showPickerSelect', target) this.triggerEvent('showPickerSelect', target)
break break
case 'remarkPopup':
this.triggerEvent('showMask')
break
default: default:
break break
} }
......
...@@ -43,12 +43,19 @@ ...@@ -43,12 +43,19 @@
</view> </view>
<!-- picker --> <!-- picker -->
<view class="picker" wx:if="{{item.type == 'select'}}"> <view class="picker" wx:if="{{item.type == 'select'}}">
<image class="arrow" src="/components/images/arrow-x.png" /> <image class="arrow" src="/components/images/arrow-x.png" />
<view class="text-hide" wx:if="{{formData[item.optionName]}}"> <view class="text-hide" wx:if="{{formData[item.optionName]}}">
{{formData[item.optionName]}} {{formData[item.optionName]}}
</view> </view>
<text class="placeholder" wx:else>请选择</text> <text class="placeholder" wx:else>请选择</text>
</view> </view>
<!-- 备注 -->
<view class="remarks_box" wx:if="{{item.type == 'remarkPopup'}}">
<view class="text-hide" wx:if="{{formData[item.name]}}">
{{formData[item.name]}}
</view>
<text class="placeholder" wx:else>请输入</text>
</view>
</gl-cell> </gl-cell>
</view> </view>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
color: #C3C3C3; color: #C3C3C3;
} }
.picker { .picker,.remarks_box{
display: flex; display: flex;
flex-direction: row-reverse; flex-direction: row-reverse;
height: 80rpx; height: 80rpx;
......
...@@ -26,7 +26,11 @@ Component({ ...@@ -26,7 +26,11 @@ Component({
title: String, title: String,
orderInfo: Object, orderInfo: Object,
pickerObj: Object, pickerObj: Object,
isAdditionRecordOrder: Boolean isAdditionRecordOrder: Boolean,
popupHeight: {
type: String,
value: '60%'
}
}, },
/** /**
...@@ -73,7 +77,7 @@ Component({ ...@@ -73,7 +77,7 @@ Component({
orderInfo['crowdFundingPrice'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice / 100 || 0)}` orderInfo['crowdFundingPrice'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice / 100 || 0)}`
// 筛选交易流水号 补录用订单总价 关联尾款单(有定金支付时间 用尾款 没有支付时间 用订单总价) // 筛选交易流水号 补录用订单总价 关联尾款单(有定金支付时间 用尾款 没有支付时间 用订单总价)
if (isAdditionRecordOrder) { if (isAdditionRecordOrder) {
orderInfo['tailPayment'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice / 100 || 0)}` // orderInfo['tailPayment'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice / 100 || 0)}`
orderInfo['totalFee'] = arr[0]?.crowdFundingPrice || 0 orderInfo['totalFee'] = arr[0]?.crowdFundingPrice || 0
} else { } else {
orderInfo['totalFee'] = (arr[0]?.crowdFundingPrice - arr[0]?.activityPrice) || 0 orderInfo['totalFee'] = (arr[0]?.crowdFundingPrice - arr[0]?.activityPrice) || 0
......
<!--packageCrowdFunding/components/PickerSelect/PickerSelect.wxml--> <!--packageCrowdFunding/components/PickerSelect/PickerSelect.wxml-->
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="60%"> <popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="{{popupHeight || '60%'}}">
<view class="sub-title text-center">{{title}}</view> <view class="sub-title text-center">{{title}}</view>
<scroll-view class="picker_select_box" scroll-y enhanced="{{true}}" show-scrollbar="{{false}}"> <scroll-view class="picker_select_box" scroll-y enhanced="{{true}}" show-scrollbar="{{false}}">
<block wx:for="{{optionList}}" wx:key="index"> <block wx:for="{{optionList}}" wx:key="index">
......
import Api from '../../api' import Api from '../../api'
import api from "../../api";
Component({ Component({
options: { options: {
...@@ -110,7 +109,9 @@ Component({ ...@@ -110,7 +109,9 @@ Component({
selectData: ['客户姓名','订单编号','手机号'], // 下拉列表的数据 selectData: ['客户姓名','订单编号','手机号'], // 下拉列表的数据
selectIndex: 0, // 选择的下拉列表下标 selectIndex: 0, // 选择的下拉列表下标
showSelect: false, // 下拉框 showSelect: false, // 下拉框
confirmFlag: false confirmFlag: false,
remarkType: '', // 备注类型 1备注 2 退款原因
selectItem: {} // 修改备注的订单对象
}, },
methods: { methods: {
init() { init() {
...@@ -149,9 +150,9 @@ Component({ ...@@ -149,9 +150,9 @@ Component({
this.getList() this.getList()
}, },
remarkCancel() { remarkCancel() {
this.setData({ this.setData({
showRemark: false, showRemark: false,
}) })
}, },
tabClick(e) { tabClick(e) {
let {searchObj} = this.data let {searchObj} = this.data
...@@ -186,6 +187,14 @@ Component({ ...@@ -186,6 +187,14 @@ Component({
} }
}) })
}, },
// 复制文案
copyData(e) {
const {target, flag} = e.currentTarget.dataset
let copyItem = flag == 1 ? `${target.customerName}\t${target.customerPhone}` : target.subOrderCode
wx.setClipboardData({
data: copyItem
})
},
getList(isReset = false) { getList(isReset = false) {
this.setData({ this.setData({
...@@ -245,24 +254,55 @@ Component({ ...@@ -245,24 +254,55 @@ Component({
} }
}) })
}, },
showMask(e) {
const { item } = e.currentTarget.dataset || {}
this.setData({
showRemark: true,
remarkType: 1,
selectItem: item
})
},
// 备注确认
remarkConfirm(e) { remarkConfirm(e) {
let value = e.detail let value = e.detail
let refundRemark = value // 备注类型 remarkType 1备注 2退款原因
const {subOrderCodeCopy} = this.data const {subOrderCodeCopy, remarkType, list, selectItem} = this.data
if (remarkType == 1) {
if (value) {
wx.showLoading()
Api.updateOrderRemark({
orderCode: selectItem?.subOrderCode,
remark: value
}).then(res => {
wx.hideLoading()
let { code } = res
if (code == 0) {
// 将订单项备注值回填 不请求接口刷新页面
list.forEach(val => {
if (val.subOrderCode == selectItem.subOrderCode) {
val.remark = value
}
})
this.setData({list})
}
})
}
} else {
let params = { let params = {
orderCode: subOrderCodeCopy, orderCode: subOrderCodeCopy,
refundRemark refundRemark: value
} }
wx.showLoading()
Api.markAsRefunded(params).then(res => { Api.markAsRefunded(params).then(res => {
if (res.code == 0) { wx.hideLoading()
console.log(res) if (res.code == 0) {
wx.$util.showToast('退款成功!') wx.$util.showToast('退款成功!')
this.getList() this.getList()
} else { } else {
wx.$util.showToast(res.message || '接口异常') wx.$util.showToast(res.message || '接口异常')
} }
}) })
}
}, },
handleClickBtn(e) { handleClickBtn(e) {
const {target} = e.currentTarget.dataset const {target} = e.currentTarget.dataset
...@@ -276,20 +316,20 @@ Component({ ...@@ -276,20 +316,20 @@ Component({
const {goodsId: shopmallGoodsId, subOrderCode} = target const {goodsId: shopmallGoodsId, subOrderCode} = target
let params = { let params = {
subOrderCode, subOrderCode,
orderPaySource: 1, orderPaySource: 1, // 订单支付源(1.正常付尾款,2关联尾款单,3未收款新增,4已收款补录)
shopmallGoodsId, shopmallGoodsId,
selectPayType:1, selectPayType:1, // 支付方式(1:线上微信支付,2:线下收款,3:POS机收款, 4:支付宝支付) 默认使用微信支付
updatedBy: accountName updatedBy: accountName
} }
if (confirmFlag) return if (confirmFlag) return
wx.$util.showLoading() wx.$util.showLoading()
this.setData({confirmFlag: true}) this.setData({confirmFlag: true})
api.createPayOrderAPI(params).then(res => { Api.createPayOrderAPI(params).then(res => {
let {code, data, message} = res let {code, data, message} = res
wx.$util.hideLoading() wx.$util.hideLoading()
if (code == '0') { if (code == '0') {
// wx.$router.reLaunch // wx.$router.reLaunch
wx.$router.go('activityPay', {orderCode: target.subOrderCode, paramsActivityPrice: target.payedDate ? target.activityPrice : '', paramsActivityId: target.activityId, supplementOrderFlag: target.supplementOrderFlag}) wx.$router.go('activityPay', {orderCode: target.subOrderCode, paramsActivityPrice: target.payedDate ? target.activityPrice : '', paramsActivityId: target.activityId, supplementOrderFlag: target.supplementOrderFlag, orderPaySource: 1, goodsNumber: target.goodsNumber || 1, shopmallGoodsId})
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
confirmFlag: false confirmFlag: false
...@@ -302,35 +342,13 @@ Component({ ...@@ -302,35 +342,13 @@ Component({
}) })
} }
}) })
// wx.$router.go('activityPay',{orderCode:target.subOrderCode})
} }
if (target.tailOrderStatus == 1 || target.tailOrderStatus == 4) { // 已支付或退定金状态 if (target.tailOrderStatus == 1 || target.tailOrderStatus == 4) { // 已支付或退定金状态
this.setData({ this.setData({
showRemark: true, showRemark: true,
}) remarkType: 2
// wx.showModal({ })
// title: '温馨提示',
// content: '请确定将此订单状态标记为已退款',
// showCancel: true,
// confirmText: '确定',
// confirmColor: '#3582EE',
// success(res) {
// if (res.confirm) {
// Api.markAsRefunded({orderCode: subOrderCode}).then(res => {
// if (res.code == 0){
// console.log(res)
// wx.$util.showToast('退款成功!')
// this.getList()
// }else{
// wx.$util.showToast(res.message || '接口异常')
// }
// })
// }
// }
// })
} }
}, },
search() { search() {
this.setData({ this.setData({
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
<view class="header-cust"> <view class="header-cust">
<view class="cust-name">{{item.customerName}}</view> <view class="cust-name">{{item.customerName}}</view>
<view class="cust-phone">{{item.customerPhone}}</view> <view class="cust-phone">{{item.customerPhone}}</view>
<image class="copy-icon" bindtap="copyData" data-target="{{item}}" data-flag="1" src="../../images/copy-text.png" mode=""/>
</view> </view>
<view class="header-status"> <view class="header-status">
<view wx:if="{{ item.tailOrderStatus =='1'}}"> <view wx:if="{{ item.tailOrderStatus =='1'}}">
...@@ -90,8 +91,16 @@ ...@@ -90,8 +91,16 @@
<view class="order"> <view class="order">
<view class="order-label">{{i.label}} </view> <view class="order-label">{{i.label}} </view>
<view class="order-value"> <view class="order-value">
<block wx:if="{{i.type == 'price' && item[i.key]}}">¥{{filter.priceFilter(item[i.key])}}</block> <block wx:if="{{i.type == 'price' && (item[i.key]+'')}}">¥{{filter.priceFilter(item[i.key])}}</block>
<block wx:else>{{item[i.key] || ''}}</block> <block wx:else>
<view wx:if="{{i.key == 'subOrderCode'}}" class="ordercode-class">
{{item[i.key] || ''}}
<image class="copy-icon" bindtap="copyData" data-target="{{item}}" data-flag="2" src="../../images/copy-text.png" mode=""/>
</view>
<view wx:else>
{{item[i.key] || ''}}
</view>
</block>
</view> </view>
</view> </view>
</block> </block>
...@@ -108,6 +117,15 @@ ...@@ -108,6 +117,15 @@
<block>{{item['refundRemark']}}</block> <block>{{item['refundRemark']}}</block>
</view> </view>
</view> </view>
<view class="order refund_text">
<view class="order-label">备注 </view>
<view bindtap="showMask" class="order-value" data-item="{{item}}">
<view wx:if="{{item.remark}}">
<block>{{item['remark']}}</block>
</view>
<view class="placeholder_class" wx:if="{{!item.remark}}">点击添加备注</view>
</view>
</view>
</view> </view>
</view> </view>
...@@ -137,11 +155,12 @@ ...@@ -137,11 +155,12 @@
</view> </view>
<remark-popup wx:if="{{showRemark}}" <remark-popup wx:if="{{showRemark}}"
title="退款备注" title="{{remarkType == 1 ? '备注' : '退款备注'}}"
show="{{showRemark}}" show="{{showRemark}}"
required="{{true}}" required="{{true}}"
maxlength="100" maxlength="{{remarkType == 1 ? 30 : 100}}"
value="{{remarkType == 1 ? selectItem.remark : ''}}"
bindcancel="remarkCancel" bindcancel="remarkCancel"
bindconfirm="remarkConfirm" bindconfirm="remarkConfirm"
placeholder="请填写退款备注" /> placeholder="请填写内容,最多{{remarkType == 1 ? 30 : 100}}个字" />
...@@ -204,6 +204,12 @@ ...@@ -204,6 +204,12 @@
margin-left: 24rpx; margin-left: 24rpx;
} }
.item-header .header-cust .copy-icon{
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
.list .icon-sex { .list .icon-sex {
width: 24rpx; width: 24rpx;
height: 24rpx; height: 24rpx;
...@@ -445,6 +451,30 @@ ...@@ -445,6 +451,30 @@
align-items: center; align-items: center;
} }
.list .item .refund_text .order-value{
text-overflow:ellipsis;
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.list .item .refund_text .order-value .placeholder_class{
color: #C8C8C8;
}
.list .item .order .order-value .ordercode-class{
display: flex;
align-items: center;
}
.list .item .order .order-value .ordercode-class .copy-icon{
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
.list .item .order .order-value .order-value-item:first-of-type { .list .item .order .order-value .order-value-item:first-of-type {
max-width: 70%; max-width: 70%;
} }
......
var priceFilter = function (num) { var priceFilter = function (num) {
// 处理金额分转元并补零 // 处理金额分转元并补零
var pow = Math.pow(10, 2) var pow = Math.pow(10, 2)
console.log((Math.round(num / 100 * pow) / pow).toFixed(2), '-------')
return (Math.round(num / 100 * pow) / pow).toFixed(2) return (Math.round(num / 100 * pow) / pow).toFixed(2)
} }
module.exports = { module.exports = {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// import { centsToyuan } from "~/utils/format"; // import { centsToyuan } from "~/utils/format";
import constantData from './constant/data' import constantData from './constant/data'
import { getOrderDetail, createPayOrder, createPayOrderAPI, getSamePriceGoodsAPI } from '../../api' import { getOrderDetail, createPayOrder, createPayOrderAPI, getSamePriceGoodsAPI, updateOrderRemark } from '../../api'
import { createQrcodeImage } from '~/api/api' import { createQrcodeImage, uploadImg } from '~/api/api'
import qrcode from '~/utils/lib/wxqrcode' import qrcode from '~/utils/lib/wxqrcode'
let time = null let time = null
Page({ Page({
...@@ -17,11 +17,12 @@ Page({ ...@@ -17,11 +17,12 @@ Page({
showStatus: false, showStatus: false,
wxqrcode: '', wxqrcode: '',
posqrcode: '', posqrcode: '',
orderPaySource: 3, //1微信 3pos selectPayType: 1, // 支付方式(1:线上微信支付,2:线下收款,3:POS机收款, 4:支付宝支付)
supplementOrderFlag: '', supplementOrderFlag: '',
payItems: [ payItems: [
{ id: 1, name: '微信支付', icon: 'pay-wechat' }, { id: 1, name: '微信支付', icon: 'wxPay' },
{ id: 3, name: 'POS机', icon: 'pay-pos' } { id: 3, name: 'POS机', icon: 'posPay' },
{ id: 2, name: '门店收款', icon: 'storePay' },
], ],
timer: null, timer: null,
orderList: [ orderList: [
...@@ -54,9 +55,19 @@ Page({ ...@@ -54,9 +55,19 @@ Page({
{ {
name: '订单编号', name: '订单编号',
value: 'subOrderCode' value: 'subOrderCode'
},
{
name: '备注',
value: 'remark',
handle: 'input'
} }
], ],
paramsActivityPrice: '' paramsActivityPrice: '',
showRemark: false,
customOutTradeNo: '', // 门店收款交易流水号
customPayVoucher: '', // 门店收款付款凭证
textAreaValue: '', // 备注回显
goodsNumber: 1 // 购买商品数量 默认购买一个
}, },
// 生成小程序码 // 生成小程序码
createWxQrcode() { createWxQrcode() {
...@@ -79,10 +90,10 @@ Page({ ...@@ -79,10 +90,10 @@ Page({
}) })
}, },
async posPay(outTradeNo) { async posPay(outTradeNo) {
let { posqrcode } = this.data // let { posqrcode } = this.data
// 没有生成过二维码 // // 没有生成过二维码
if (!posqrcode) { // if (!posqrcode) {
// console.log(text) // console.log(text)
let size = 0 let size = 0
try { try {
...@@ -99,36 +110,160 @@ Page({ ...@@ -99,36 +110,160 @@ Page({
this.setData({ this.setData({
posqrcode: _img posqrcode: _img
}) })
// }
},
input(e) {
let { value } = e.detail
let val = value.replace(/[^a-zA-Z0-9]/g, '')
this.setData({
customOutTradeNo: val
})
},
// 上传付款凭证
upLoad() {
let _this = this
wx.chooseImage({
count: 1,
success(res) {
let [tempFiles] = res.tempFilePaths
let imgType = tempFiles.split('.')[1]
let type = imgType == 'unknown' ? 'jpg' : imgType
wx.getFileSystemManager().readFile({
filePath: tempFiles, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success(_res) {
wx.$util.showLoading('上传中...')
uploadImg({
file: `${type}@${_res.data}`
})
.then(img => {
wx.$util.hideLoading()
let { code, data, message } = img
if (code == 0) {
_this.setData({
customPayVoucher: data
})
} else {
wx.$util.showToast(message)
}
})
}
})
}
})
},
// 门店收款确认
confirm() {
let { customOutTradeNo, customPayVoucher, orderCode, orderPaySource, shopmallGoodsId, orderDetail } = this.data
if (!customOutTradeNo) {
return wx.$util.showToast('请输入交易流水号')
}
if (!customPayVoucher) {
return wx.$util.showToast('请上传付款凭证')
}
wx.showModal({
title: '门店收款确认',
content: '确定将此订单标记为门店收款',
complete: (res) => {
if (res.confirm) {
let {accountName} = wx.$util.getUserInfo()
let params = {
subOrderCode: orderCode,
orderPaySource: orderPaySource,
shopmallGoodsId: shopmallGoodsId,
selectPayType:2, // 线下收款 (门店收款)
updatedBy: accountName,
outTradeNo: customOutTradeNo, // 交易流水号
payVoucher: customPayVoucher, // 付款凭证
remark: orderDetail?.remark // 备注
}
wx.showLoading()
createPayOrderAPI(params).then(async res => {
let {code, data, message} = res
wx.hideLoading()
if (code == '0') {
wx.$router.back()
} else {
wx.$util.showToast(message || '接口异常')
}
})
}
}
})
},
// 添加备注
showMask() {
let { orderDetail } = this.data
this.setData({
showRemark: true,
textAreaValue: orderDetail?.remark || ''
})
},
remarkCancel() {
this.setData({
showRemark: false,
})
},
remarkConfirm(e) {
let remark = e.detail
let { orderCode } = this.data
if (remark) {
wx.showLoading()
updateOrderRemark({
orderCode: orderCode,
remark: remark
}).then(res => {
wx.hideLoading()
let { code } = res
if (code == 0) {
this.getDetail()
}
})
} }
}, },
// 多商品切换商品 重新生成支付订单 // 多商品切换商品 重新生成支付订单
changeGoods(e) { changeGoods(e) {
if (time) clearInterval(time) if (time) clearInterval(time)
let { orderCode } = this.data let { orderCode, orderPaySource, selectPayType, textAreaValue } = this.data
let value = e?.detail || {} let value = e?.detail || {}
let {accountName} = wx.$util.getUserInfo() let {accountName} = wx.$util.getUserInfo()
this.setData({
shopmallGoodsId: value.specialGoodsId
})
if (selectPayType == 2) return // 门店收款 切换商品无需创建订单
let params = { let params = {
subOrderCode: orderCode, subOrderCode: orderCode,
orderPaySource: 1, orderPaySource: orderPaySource, // 订单支付源 (1.正常付尾款,2关联尾款单,3未收款新增,4已收款补录)
shopmallGoodsId: value.specialGoodsId, shopmallGoodsId: value.specialGoodsId,
selectPayType:1, selectPayType: selectPayType, // 支付方式(1:线上微信支付,2:线下收款,3:POS机收款, 4:支付宝支付)
updatedBy: accountName updatedBy: accountName,
remark: textAreaValue // 备注
} }
wx.$util.showLoading() wx.$util.showLoading()
createPayOrderAPI(params).then(res => { createPayOrderAPI(params).then(async res => {
let {code, data, message} = res let {code, data, message} = res
wx.$util.hideLoading() wx.$util.hideLoading()
if (code == '0') { if (code == '0') {
this.getDetail() // 创建支付单 刷新pos机支付二维码
if (selectPayType == 3) {
let result = await createPayOrder({
orderCode,
payType: selectPayType
})
let { resCode, data } = result
if (resCode != 0) return
this.posPay(data.outTradeNo)
}
this.getDetail()
} else { } else {
wx.$util.showToast(message || '接口异常') wx.$util.showToast(message || '接口异常')
} }
}) })
}, },
initOrderInfo() { initOrderInfo() {
const { orderObj, orderList, paramsActivityPrice, paramsActivityId } = this.data const { orderObj, orderList, paramsActivityPrice, paramsActivityId, goodsNumber } = this.data
// 商品 // 商品 (购买多个商品数量 定金过滤 总定价/购买数量)
getSamePriceGoodsAPI({actId: paramsActivityId, activityPrice: paramsActivityPrice}).then(res => { getSamePriceGoodsAPI({actId: paramsActivityId, activityPrice: paramsActivityPrice ? (paramsActivityPrice / goodsNumber) : ''}).then(res => {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
if (data && orderObj?.shopFormList) { if (data && orderObj?.shopFormList) {
...@@ -177,6 +312,7 @@ Page({ ...@@ -177,6 +312,7 @@ Page({
} }
let payDate = copyData?.payDate let payDate = copyData?.payDate
copyData.payDate = payDate ? wx.$util.tsFormatTime(payDate, 'Y年M月D日 h:m:s') : '' copyData.payDate = payDate ? wx.$util.tsFormatTime(payDate, 'Y年M月D日 h:m:s') : ''
// 众筹商品ID(弹窗选择商品使用)
orderInfo.shopmallGoodsId = copyData.goodsId || '' orderInfo.shopmallGoodsId = copyData.goodsId || ''
this.setData({ this.setData({
orderDetail: copyData, orderDetail: copyData,
...@@ -221,15 +357,15 @@ Page({ ...@@ -221,15 +357,15 @@ Page({
}, },
async handleTab(e) { async handleTab(e) {
console.log(e.target.dataset) console.log(e.target.dataset)
const { id: orderPaySource } = e.target.dataset.item const { id: selectPayType } = e.target.dataset.item
let { orderCode } = this.data let { orderCode } = this.data
this.setData({ this.setData({
orderPaySource selectPayType
}) })
if (orderPaySource == 3) { if (selectPayType == 3) { // pos机支付
let result = await createPayOrder({ let result = await createPayOrder({
orderCode, orderCode,
payType: orderPaySource payType: selectPayType
}) })
let { code, data } = result let { code, data } = result
if (code != 0) return if (code != 0) return
...@@ -238,7 +374,7 @@ Page({ ...@@ -238,7 +374,7 @@ Page({
this.createWxQrcode() this.createWxQrcode()
} }
// orderPaySource == 3 ? this.posPay(outTradeNo) : this.createWxQrcode() // selectPayType == 3 ? this.posPay(outTradeNo) : this.createWxQrcode()
}, },
back() { back() {
wx.$router.back() wx.$router.back()
...@@ -251,26 +387,22 @@ Page({ ...@@ -251,26 +387,22 @@ Page({
}, },
onRoute(options) { onRoute(options) {
console.log(options) console.log(options)
// 先模拟数据 let { orderCode, orderPaySource, selectPayType, outTradeNo, paramsActivityPrice, paramsActivityId, supplementOrderFlag, goodsNumber, shopmallGoodsId } = options
// options = {
// orderCode: 'S2304101345174444',
// orderPaySource: 1
// }
// selectPayType
let { orderCode, selectPayType: orderPaySource = 1, outTradeNo, paramsActivityPrice, paramsActivityId, supplementOrderFlag } = options
this.setData({ this.setData({
orderCode, orderCode,
orderPaySource, orderPaySource, // 订单支付源(1.正常付尾款,2关联尾款单,3未收款新增,4已收款补录)
paramsActivityPrice, paramsActivityPrice, // 定金金额
paramsActivityId, paramsActivityId,
supplementOrderFlag supplementOrderFlag,
selectPayType: selectPayType || 1, // 支付方式(1:线上微信支付,2:线下收款,3:POS机收款, 4:支付宝支付)
goodsNumber: goodsNumber || 1, // 商品购买数量
shopmallGoodsId // 商品id(转化加商品ID orderdetail中的goodsId是众筹商品id)
}) })
this.initOrderInfo() this.initOrderInfo()
// 获取支付订单详情 // 获取支付订单详情
this.getDetail() this.getDetail()
orderPaySource == 3 ? this.posPay(outTradeNo) : this.createWxQrcode() selectPayType == 3 ? this.posPay(outTradeNo) : this.createWxQrcode()
// let { orderCode, selectPayType } = options
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
......
...@@ -22,8 +22,8 @@ page { ...@@ -22,8 +22,8 @@ page {
color: #fff; color: #fff;
.imgBox image { .imgBox image {
width: 18rpx; width: 22rpx;
height: 34rpx; height: 32rpx;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
...@@ -40,7 +40,6 @@ page { ...@@ -40,7 +40,6 @@ page {
} }
} }
} }
.box { .box {
...@@ -69,7 +68,7 @@ page { ...@@ -69,7 +68,7 @@ page {
overflow: hidden; overflow: hidden;
border-radius: 16rpx 16rpx 0 0; border-radius: 16rpx 16rpx 0 0;
overflow: hidden; overflow: hidden;
flex-shrink: 0;
.tab-item { .tab-item {
flex: 1; flex: 1;
display: flex; display: flex;
...@@ -85,20 +84,95 @@ page { ...@@ -85,20 +84,95 @@ page {
} }
} }
} }
.pay-box{
flex-shrink: 0;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
.tab-title {
margin: 36rpx 0;
}
.tab-title { .tab-qrcode {
margin: 36rpx 0; width: 430rpx;
} height: 430rpx;
}
.tab-qrcode { .tab-desc {
width: 430rpx; margin-top: 20rpx;
height: 430rpx; font-size: 24rpx;
color: #666666;
}
} }
.input-box{
.tab-desc { flex-shrink: 0;
margin-top: 20rpx; width: 100%;
font-size: 24rpx; height: 100%;
color: #666666; padding: 38rpx 44rpx;
box-sizing: border-box;
.input-item{
display: flex;
margin-bottom: 36rpx;
.label{
flex-shrink: 0;
width: 150rpx;
height: 68rpx;
line-height: 68rpx;
font-size: 24rpx;
text-align: right;
margin-right: 16rpx;
color: #222222;
}
.input_content{
box-sizing: border-box;
flex-shrink: 0;
width: 456rpx;
height: 68rpx;
border: 2rpx solid #DCDCDC;
border-radius: 8rpx;
padding: 0 20rpx;
display: flex;
align-items: center;
input {
width: 100%;
height: 100%;
}
}
.payVoucher_image{
width: 456rpx;
height: 316rpx;
border: 2rpx dashed #999999;
border-radius: 20rpx;
}
.camera-box{
flex-shrink: 0;
width: 460rpx;
height: 320rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png');
background-size: 100% 100%;
position: relative;
.camera-icon{
width: 96rpx;
height: 96rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
}
.confirm-btn{
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: #FFFFFF;
width: 100%;
height: 88rpx;
background: #3582EE;
border-radius: 12rpx;
}
} }
} }
...@@ -157,6 +231,7 @@ page { ...@@ -157,6 +231,7 @@ page {
} }
&:last-child { &:last-child {
width: calc(100% - 200rpx);
color: #1B233D; color: #1B233D;
} }
...@@ -173,6 +248,17 @@ page { ...@@ -173,6 +248,17 @@ page {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
&.placeholder_class{
color: #C8C8C8;
}
&.remark-text{
text-overflow:ellipsis;
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
} }
} }
......
...@@ -16,32 +16,64 @@ ...@@ -16,32 +16,64 @@
<view class=" box"> <view class=" box">
<view class="tab-head"> <view class="tab-head">
<view <view
class="tab-item {{orderPaySource === item.id?'active':'' }}" class="tab-item {{selectPayType === item.id?'active':'' }}"
wx:for="{{payItems}}" wx:for="{{payItems}}"
wx:key="index" wx:key="index"
data-item="{{item}}" data-item="{{item}}"
catchtap="handleTab"> catchtap="handleTab">
<gl-image <gl-image
class="btn_icon" class="btn_icon"
data-item="{{item}}" data-item="{{item}}"
webp webp
src="/miniProgram/wxPay.png" src="/miniProgram/{{item.icon}}.png"></gl-image>
wx:if="{{item.id==1}}" />
<gl-image
class="btn_icon"
data-item="{{item}}"
webp
src="/miniProgram/posPay.png"
wx:else></gl-image>
{{item.name}} {{item.name}}
</view> </view>
</view> </view>
<view class="tab-title">{{orderDetail.merchantName}}</view> <!-- 微信/pos机支付 -->
<view class="tab-qrcode"> <block wx:if="{{selectPayType == 1 || selectPayType == 3}}">
<image src="{{orderPaySource==1?wxqrcode:posqrcode}}" mode="widthFix" /> <view class="pay-box">
</view> <view class="tab-title">{{orderDetail.merchantName}}</view>
<view class="tab-desc" hidden="{{orderPaySource==3}}">请让客户打开微信扫描上方付款码进行支付</view> <view class="tab-qrcode">
<view class="tab-desc" hidden="{{orderPaySource==1}}">请使用POS机扫描此码,再向客户收款</view> <image src="{{selectPayType==1?wxqrcode:posqrcode}}" mode="widthFix" />
</view>
<view class="tab-desc" hidden="{{selectPayType==3}}">请让客户打开微信扫描上方付款码进行支付</view>
<view class="tab-desc" hidden="{{selectPayType==1}}">请使用POS机扫描此码,再向客户收款</view>
</view>
</block>
<!-- 门店收款 -->
<block wx:if="{{selectPayType == 2}}">
<view class="input-box">
<view class="input-item">
<view class="label">交易流水号</view>
<view class="input_content">
<input
type="text"
bindinput="input"
value="{{customOutTradeNo}}"
maxlength="32" />
</view>
</view>
<view class="input-item">
<view class="label">上传付款凭证</view>
<view bindtap="upLoad">
<block wx:if="{{customPayVoucher}}">
<image class="payVoucher_image" src="{{customPayVoucher}}" />
</block>
<block wx:else>
<view class="camera-box">
<gl-image
class="camera-icon"
webp
src="/miniProgram/camera-icon.png"></gl-image>
</view>
</block>
</view>
</view>
<view class="confirm-btn" bindtap="confirm">确定</view>
</view>
</block>
</view> </view>
<!-- <view class="infoBox"> --> <!-- <view class="infoBox"> -->
<!-- <activity-info orderInfo="{{orderDetail}}" /> --> <!-- <activity-info orderInfo="{{orderDetail}}" /> -->
...@@ -57,6 +89,10 @@ ...@@ -57,6 +89,10 @@
<view class="money" wx:elif="{{item.handle == 'money'}}"> <view class="money" wx:elif="{{item.handle == 'money'}}">
¥{{orderDetail[item.value] || 0}} ¥{{orderDetail[item.value] || 0}}
</view> </view>
<view wx:elif="{{item.handle == 'input'}}" bindtap="showMask">
<view class="placeholder_class" wx:if="{{!orderDetail[item.value]}}">点击添加备注</view>
<view class="remark-text" wx:else>{{orderDetail[item.value]}}</view>
</view>
<view wx:else>{{orderDetail[item.value] || ''}}</view> <view wx:else>{{orderDetail[item.value] || ''}}</view>
</view> </view>
</view> </view>
...@@ -66,6 +102,15 @@ ...@@ -66,6 +102,15 @@
pickerObj="{{pickerObj}}" pickerObj="{{pickerObj}}"
orderInfo="{{orderInfo}}" orderInfo="{{orderInfo}}"
bindconfirm="changeGoods" /> bindconfirm="changeGoods" />
<remark-popup wx:if="{{showRemark}}"
title="备注"
show="{{showRemark}}"
required="{{true}}"
maxlength="30"
value="{{textAreaValue}}"
bindcancel="remarkCancel"
bindconfirm="remarkConfirm"
placeholder="请填写内容,最多30个字" />
<!-- <view class="page-box isFullSucreen"> <!-- <view class="page-box isFullSucreen">
<view class="img-bg"> <view class="img-bg">
<glsx-image webp src="store-assistant/visitor_bg.png" /> <glsx-image webp src="store-assistant/visitor_bg.png" />
......
...@@ -11,7 +11,14 @@ Page({ ...@@ -11,7 +11,14 @@ Page({
orderInfo: {}, orderInfo: {},
orderNoPopup: false, orderNoPopup: false,
activityName: '', activityName: '',
activityId: '' activityId: '',
navBarHeight: 0
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
}, },
/** /**
...@@ -21,7 +28,7 @@ Page({ ...@@ -21,7 +28,7 @@ Page({
// 推荐人 // 推荐人
let { orderObj, orderInfo } = this.data let { orderObj, orderInfo } = this.data
if (app.globalData?.staffListRange && orderObj?.orderFormList) { if (app.globalData?.staffListRange && orderObj?.orderFormList) {
orderObj.orderFormList[orderObj.orderFormList.length - 1].optionList = app.globalData.staffListRange orderObj.orderFormList[orderObj.orderFormList.findIndex(v => v.name == 'uuid')].optionList = app.globalData.staffListRange
} }
// 商品 // 商品
if (app.globalData?.crowdFundingShopInfo && orderObj?.shopFormList) { if (app.globalData?.crowdFundingShopInfo && orderObj?.shopFormList) {
...@@ -34,9 +41,9 @@ Page({ ...@@ -34,9 +41,9 @@ Page({
orderObj.shopFormList[0].readonly = true orderObj.shopFormList[0].readonly = true
orderInfo.shopmallGoodsId = app.globalData?.crowdFundingShopInfo[0]?.goodsId || '' orderInfo.shopmallGoodsId = app.globalData?.crowdFundingShopInfo[0]?.goodsId || ''
orderInfo.goodsName = app.globalData?.crowdFundingShopInfo[0]?.goodsName || '' orderInfo.goodsName = app.globalData?.crowdFundingShopInfo[0]?.goodsName || ''
orderInfo.activityPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.activityPrice / 100 || 0)}` orderInfo.depositPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.activityPrice / 100 || 0)}` // 定金金额
orderInfo.crowdFundingPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice / 100 || 0)}` orderInfo.crowdFundingPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice / 100 || 0)}` // 众筹价
orderInfo.tailPayment = `¥${this.priceFilter((app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice - app.globalData?.crowdFundingShopInfo[0]?.activityPrice) / 100 || 0)}` orderInfo.tailPayment = `¥${this.priceFilter((app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice - app.globalData?.crowdFundingShopInfo[0]?.activityPrice) / 100 || 0)}` // 尾款
orderInfo['totalFee'] = app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice || 0 orderInfo['totalFee'] = app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice || 0
orderInfo.goodsId = app.globalData?.crowdFundingShopInfo[0]?.goodsId orderInfo.goodsId = app.globalData?.crowdFundingShopInfo[0]?.goodsId
} }
...@@ -68,6 +75,24 @@ Page({ ...@@ -68,6 +75,24 @@ Page({
}) })
}, },
// 添加备注
showMask() {
this.setData({
showRemark: true,
})
},
remarkCancel() {
this.setData({
showRemark: false,
})
},
remarkConfirm(e) {
let remark = e.detail
let { orderInfo } = this.data
orderInfo.remark = remark
this.setData({orderInfo})
},
// 自定义picker选择器 // 自定义picker选择器
showPickerSelect(e) { showPickerSelect(e) {
this.setData({ this.setData({
...@@ -103,7 +128,8 @@ Page({ ...@@ -103,7 +128,8 @@ Page({
shopmallGoodsId: orderInfo.goodsId, shopmallGoodsId: orderInfo.goodsId,
orderPaySource: 4, orderPaySource: 4,
activityId: activityId, activityId: activityId,
activityName: activityName activityName: activityName,
remark: orderInfo?.remark // 备注
} }
wx.$util.showLoading() wx.$util.showLoading()
api.createFullPayOrderAPI(params).then(res => { api.createFullPayOrderAPI(params).then(res => {
......
<!--packageCrowdFunding/pages/additionRecordOrder/additionRecordOrder.wxml--> <!--packageCrowdFunding/pages/additionRecordOrder/additionRecordOrder.wxml-->
<view class="addition-record-order"> <view class="addition-record-order">
<view class="title">订单信息</view> <view class="title">订单信息</view>
<view class="content-box"> <scroll-view scroll-y class="content-box" style="height: calc(100vh - 220rpx);">
<view class="box"> <view class="box">
<gl-form formData="{{orderInfo}}" bindshowPickerSelect="showPickerSelect" formDataList="{{orderObj.shopFormList}}"></gl-form> <gl-form formData="{{orderInfo}}" bindshowPickerSelect="showPickerSelect" formDataList="{{orderObj.shopFormList}}"></gl-form>
</view> </view>
<view class="box"> <view class="box">
<gl-form bindshowOrderNoPopup="showOrderNoPopup" bindshowPickerSelect="showPickerSelect" formData="{{orderInfo}}" dataAttrName="orderInfo" formDataList="{{orderObj.orderFormList}}"></gl-form> <gl-form bindshowOrderNoPopup="showOrderNoPopup" bindshowPickerSelect="showPickerSelect" bindshowMask="showMask" formData="{{orderInfo}}" dataAttrName="orderInfo" formDataList="{{orderObj.orderFormList}}"></gl-form>
</view> </view>
</view> </scroll-view>
<view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}"> <view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn" bindtap="confirm">确定</view> <view class="btn" bindtap="confirm">确定</view>
</view> </view>
...@@ -25,3 +25,12 @@ ...@@ -25,3 +25,12 @@
orderInfo="{{orderInfo}}" orderInfo="{{orderInfo}}"
isAdditionRecordOrder="true" isAdditionRecordOrder="true"
/> />
<remark-popup wx:if="{{showRemark}}"
title="备注"
show="{{showRemark}}"
required="{{true}}"
value="{{orderInfo.remark}}"
maxlength="30"
bindcancel="remarkCancel"
bindconfirm="remarkConfirm"
placeholder="请填写内容,最多30个字" />
...@@ -68,9 +68,14 @@ const orderObj = { ...@@ -68,9 +68,14 @@ const orderObj = {
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'uuid', optionId: 'uuid',
optionName: 'staffName', optionName: 'staffName'
},
{
label: '备注',
name: 'remark',
type: 'remarkPopup',
noBorder: true noBorder: true
} },
] ]
} }
......
...@@ -42,6 +42,11 @@ Page({ ...@@ -42,6 +42,11 @@ Page({
{ {
name: '订单编号', name: '订单编号',
value: 'subOrderCode' value: 'subOrderCode'
},
{
name: '备注',
value: 'remark',
handle: 'input'
} }
], ],
confirmFlag: false confirmFlag: false
...@@ -57,8 +62,8 @@ Page({ ...@@ -57,8 +62,8 @@ Page({
}, },
initOrderInfo() { initOrderInfo() {
const {orderObj, orderList, orderInfo} = this.data const {orderObj, orderList, orderInfo} = this.data
// 商品 // 商品 (购买多个商品数量 定金过滤 总定价/购买数量)
api.getSamePriceGoodsAPI({actId: orderInfo.activityId, activityPrice: orderInfo.payedDate ? orderInfo.activityPrice : ''}).then(res => { api.getSamePriceGoodsAPI({actId: orderInfo.activityId, activityPrice: orderInfo.payedDate ? (orderInfo.activityPrice / orderInfo?.goodsNumber) : ''}).then(res => {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
if (data && orderObj?.shopFormList) { if (data && orderObj?.shopFormList) {
...@@ -90,6 +95,35 @@ Page({ ...@@ -90,6 +95,35 @@ Page({
pickerObj: this.data.orderObj.shopFormList[0] pickerObj: this.data.orderObj.shopFormList[0]
}) })
}, },
// 添加备注
showMask() {
this.setData({
showRemark: true,
})
},
remarkCancel() {
this.setData({
showRemark: false,
})
},
// 修改备注
remarkConfirm(e) {
let remark = e.detail
let { orderInfo } = this.data
if (remark) {
api.updateOrderRemark({
orderCode: orderInfo?.subOrderCode,
remark: remark
}).then(res => {
let { code } = res
if (code == 0) {
// 直接更新订单备注字段
orderInfo.remark = remark
this.setData({orderInfo})
}
})
}
},
confirm() { confirm() {
const {orderInfo, confirmFlag} = this.data const {orderInfo, confirmFlag} = this.data
// console.log(orderInfo, orderListInfo) // console.log(orderInfo, orderListInfo)
...@@ -169,6 +203,7 @@ Page({ ...@@ -169,6 +203,7 @@ Page({
list.tailPayment = list.supplementOrderFlag == 1 ? `¥${this.priceFilter(list.crowdFundingPrice || 0)}` : `¥${this.priceFilter(list.tailPayment || 0)}` list.tailPayment = list.supplementOrderFlag == 1 ? `¥${this.priceFilter(list.crowdFundingPrice || 0)}` : `¥${this.priceFilter(list.tailPayment || 0)}`
list.shopmallGoodsId = list.goodsId || '' list.shopmallGoodsId = list.goodsId || ''
list.payedDateStr = list.payedDate ? wx.$util.tsFormatTime(list.payedDate, 'Y年M月D日 h:m:s') : '' list.payedDateStr = list.payedDate ? wx.$util.tsFormatTime(list.payedDate, 'Y年M月D日 h:m:s') : ''
list.goodsNumber = list.goodsNumber || 1
this.setData({ this.setData({
orderInfo: list orderInfo: list
}) })
......
...@@ -143,6 +143,12 @@ ...@@ -143,6 +143,12 @@
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
&.remark-text{
width: calc(100% - 200rpx);
.placeholder_class{
color: #C8C8C8;
}
}
} }
} }
......
...@@ -36,6 +36,10 @@ ...@@ -36,6 +36,10 @@
<view wx:if="{{item.isMark}}" class="mark-text" bindtap="showPopup"> <view wx:if="{{item.isMark}}" class="mark-text" bindtap="showPopup">
<text class="goods_name_class">{{orderInfo[item.value] || '请选择商品'}}</text><text> ></text> <text class="goods_name_class">{{orderInfo[item.value] || '请选择商品'}}</text><text> ></text>
</view> </view>
<view wx:elif="{{item.handle == 'input'}}" class="remark-text" bindtap="showMask">
<text class="placeholder_class" wx:if="{{!orderInfo[item.value]}}">点击添加备注</text>
<text wx:else>{{orderInfo[item.value]}}</text>
</view>
<view wx:else>{{orderInfo[item.value] || ''}}</view> <view wx:else>{{orderInfo[item.value] || ''}}</view>
</view> </view>
</view> </view>
...@@ -58,3 +62,12 @@ ...@@ -58,3 +62,12 @@
orderInfo="{{orderInfo}}" orderInfo="{{orderInfo}}"
isAdditionRecordOrder="{{!orderInfo.payedDate}}" isAdditionRecordOrder="{{!orderInfo.payedDate}}"
/> />
<remark-popup wx:if="{{showRemark}}"
title="备注"
show="{{showRemark}}"
required="{{true}}"
value="{{orderInfo.remark}}"
maxlength="30"
bindcancel="remarkCancel"
bindconfirm="remarkConfirm"
placeholder="请填写内容,最多30个字" />
// packageCrowdFunding/pages/newOrder/components/paymentVoucherPopup.js
import { uploadImg } from '~/api/api'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function(n) {
if (n) {
this.setData({
outTradeNo: '',
payVoucher: ''
})
}
}
},
},
/**
* 组件的初始数据
*/
data: {
outTradeNo: '',
payVoucher: ''
},
/**
* 组件的方法列表
*/
methods: {
input(e) {
let { value } = e.detail
let val = value.replace(/[^a-zA-Z0-9]/g, '')
this.setData({
outTradeNo: val
})
},
// 上传付款凭证
upLoad() {
let _this = this
wx.chooseImage({
count: 1,
success(res) {
let [tempFiles] = res.tempFilePaths
let imgType = tempFiles.split('.')[1]
let type = imgType == 'unknown' ? 'jpg' : imgType
wx.getFileSystemManager().readFile({
filePath: tempFiles, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success(_res) {
wx.$util.showLoading('上传中...')
uploadImg({
file: `${type}@${_res.data}`
})
.then(img => {
wx.$util.hideLoading()
console.log(img)
let { code, data, message } = img
if (code == 0) {
_this.setData({
payVoucher: data
})
} else {
wx.$util.showToast(message)
}
})
}
})
}
})
},
confirm() {
let { outTradeNo, payVoucher } = this.data
if (!outTradeNo) {
return wx.$util.showToast('请输入交易流水号')
}
if (!payVoucher) {
return wx.$util.showToast('请上传付款凭证')
}
this.triggerEvent('payVoucherConfirm', {outTradeNo, payVoucher})
},
cancel() {
this.setData({
show: false
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageCrowdFunding/pages/newOrder/components/paymentVoucherPopup.wxss */
.input-box{
flex-shrink: 0;
width: 100%;
height: 100%;
padding: 38rpx 44rpx;
box-sizing: border-box;
.input-item{
display: flex;
margin-bottom: 36rpx;
.label{
flex-shrink: 0;
width: 150rpx;
height: 68rpx;
line-height: 68rpx;
font-size: 24rpx;
text-align: right;
margin-right: 16rpx;
color: #222222;
}
.input_content{
box-sizing: border-box;
flex-shrink: 0;
width: 456rpx;
height: 68rpx;
border: 2rpx solid #DCDCDC;
border-radius: 8rpx;
padding: 0 20rpx;
display: flex;
align-items: center;
input {
width: 100%;
height: 100%;
}
}
.payVoucher_image{
width: 456rpx;
height: 316rpx;
border: 2rpx dashed #999999;
border-radius: 20rpx;
}
.camera-box{
flex-shrink: 0;
width: 460rpx;
height: 320rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/pay-voucher-bg.png');
background-size: 100% 100%;
position: relative;
.camera-icon{
width: 96rpx;
height: 96rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageCrowdFunding/pages/newOrder/components/paymentVoucherPopup.wxml-->
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="750rpx" title="上传付款凭证">
<view class="input-box">
<view class="input-item">
<view class="label">交易流水号</view>
<view class="input_content">
<input
type="text"
bindinput="input"
value="{{outTradeNo}}"
maxlength="32" />
</view>
</view>
<view class="input-item">
<view class="label">上传付款凭证</view>
<view bindtap="upLoad">
<block wx:if="{{payVoucher}}">
<image class="payVoucher_image" src="{{payVoucher}}" />
</block>
<block wx:else>
<view class="camera-box">
<gl-image
class="camera-icon"
webp
src="/miniProgram/camera-icon.png"></gl-image>
</view>
</block>
</view>
</view>
</view>
</popup>
...@@ -2,7 +2,8 @@ const formRule = { ...@@ -2,7 +2,8 @@ const formRule = {
shopmallGoodsId: [{ required: true, message: '请选择商品' }], shopmallGoodsId: [{ required: true, message: '请选择商品' }],
customerName: [{ required: true, message: '客户名称不能为空' }], customerName: [{ required: true, message: '客户名称不能为空' }],
customerPhone: [{ required: true, message: '客户手机号不能为空' }], customerPhone: [{ required: true, message: '客户手机号不能为空' }],
userId: [{ required: true, message: '推荐人不能为空' }] userId: [{ required: true, message: '推荐人不能为空' }],
payType: [{ required: true, message: '请选择支付方式' }]
} }
const orderObj = { const orderObj = {
...@@ -33,7 +34,31 @@ const orderObj = { ...@@ -33,7 +34,31 @@ const orderObj = {
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'userId', optionId: 'userId',
optionName: 'employeeName', optionName: 'employeeName'
},
{
label: '备注',
name: 'remark',
type: 'remarkPopup'
},
{
label: '支付方式',
pickerTitle: '支付方式',
name: 'payType',
type: 'select',
optionList: [{
payType: 'wechat',
confValue: '微信支付'
}, {
payType: 'pos',
confValue: 'POS机支付'
}, {
payType: 'store',
confValue: '门店收款'
}],
optionId: 'payType',
optionName: 'confValue',
height: '40%',
noBorder: true noBorder: true
} }
], ],
......
...@@ -12,13 +12,23 @@ Page({ ...@@ -12,13 +12,23 @@ Page({
formRule: constantData.formRule, formRule: constantData.formRule,
orderInfo: {}, orderInfo: {},
dataAttrName: 'orderInfo', dataAttrName: 'orderInfo',
confirmFlag: false confirmFlag: false,
showRemark: false,
showPaymentVoucherVisible: false,
navBarHeight: 0,
popupHeight: ''
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) {}, onLoad(options) {},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
back() { back() {
wx.$router.back() wx.$router.back()
}, },
...@@ -36,7 +46,6 @@ Page({ ...@@ -36,7 +46,6 @@ Page({
let { orderObj, orderInfo } = this.data let { orderObj, orderInfo } = this.data
// 商品 // 商品
if (app.globalData?.crowdFundingShopInfo && orderObj?.shopFormList) { if (app.globalData?.crowdFundingShopInfo && orderObj?.shopFormList) {
console.log(app.globalData?.crowdFundingShopInfo?.length)
if (app.globalData?.crowdFundingShopInfo?.length > 1) { if (app.globalData?.crowdFundingShopInfo?.length > 1) {
// 多商品 // 多商品
orderObj.shopFormList[1].optionList = app.globalData?.crowdFundingShopInfo.map(item => { orderObj.shopFormList[1].optionList = app.globalData?.crowdFundingShopInfo.map(item => {
...@@ -53,7 +62,7 @@ Page({ ...@@ -53,7 +62,7 @@ Page({
} }
} }
if (app.globalData?.staffListRange && orderObj?.orderFormList) { if (app.globalData?.staffListRange && orderObj?.orderFormList) {
orderObj.orderFormList[orderObj.orderFormList.length - 1].optionList = app.globalData.staffListRange.map(item => { orderObj.orderFormList[orderObj.orderFormList.findIndex(v => v.name == 'employeeName')].optionList = app.globalData.staffListRange.map(item => {
item.employeeName = item.staffName item.employeeName = item.staffName
item.userId = item.uuid item.userId = item.uuid
return item return item
...@@ -67,23 +76,22 @@ Page({ ...@@ -67,23 +76,22 @@ Page({
return (Math.round(num * pow) / pow).toFixed(2) return (Math.round(num * pow) / pow).toFixed(2)
}, },
confirm(e) { confirm(e) {
const { target } = e.currentTarget.dataset
var { formRule, orderInfo, confirmFlag } = this.data var { formRule, orderInfo, confirmFlag } = this.data
// let thisPage = this.$router.getCurrentPage()
// let thisPage = wx.$router.getPageInstance()
// console.log(thisPage.data['orderInfo']['actualSalesPersonId'])
// if (!thisPage.data['orderInfo']['referrerId']) {
// wx.$util.showToast('请选择推荐人')
// return
// }
let validObj = fn.checkRequired(orderInfo, formRule) let validObj = fn.checkRequired(orderInfo, formRule)
if (validObj) { if (validObj) {
wx.$util.showToast(validObj.message) wx.$util.showToast(validObj.message)
return return
} }
if (confirmFlag) return if (confirmFlag) return
// 门店收款
if (orderInfo?.payType == 'store') {
this.setData({
showPaymentVoucherVisible: true
})
return
}
let { default4SStoreInfo_crowdFunding: merchantInfo } = wx.$util.getUserInfo() let { default4SStoreInfo_crowdFunding: merchantInfo } = wx.$util.getUserInfo()
const selectPayType = target == 'wechat' ? 1 : 3 const selectPayType = orderInfo?.payType == 'wechat' ? 1 : orderInfo?.payType == 'pos' ? 3 : ''
const orderObj = wx.$util.deepClone(orderInfo) const orderObj = wx.$util.deepClone(orderInfo)
delete orderObj.activityPrice delete orderObj.activityPrice
delete orderObj.crowdFundingPrice delete orderObj.crowdFundingPrice
...@@ -92,7 +100,7 @@ Page({ ...@@ -92,7 +100,7 @@ Page({
let params = { let params = {
...orderObj, ...orderObj,
selectPayType, selectPayType,
orderPaySource: 3, orderPaySource: 3, // 订单支付源(1.正常付尾款,2关联尾款单,3未收款新增,4已收款补录)
merchantId: merchantInfo.merchantId, merchantId: merchantInfo.merchantId,
merchantName: merchantInfo.merchantName merchantName: merchantInfo.merchantName
} }
...@@ -109,7 +117,7 @@ Page({ ...@@ -109,7 +117,7 @@ Page({
let { code, data, message } = res let { code, data, message } = res
if (code == '0') { if (code == '0') {
// 新增未收款单 付全款金额 // 新增未收款单 付全款金额
wx.$router.redirectTo('activityPay', { orderCode: data.subOrderCode, selectPayType, outTradeNo: data.outTradeNo || data?.payOrder?.outTradeNo, paramsActivityId: orderInfo.activityId, supplementOrderFlag: 1 }) wx.$router.redirectTo('activityPay', { orderCode: data.subOrderCode, selectPayType, outTradeNo: data.outTradeNo || data?.payOrder?.outTradeNo, paramsActivityId: orderInfo.activityId, supplementOrderFlag: 1, orderPaySource: 3, shopmallGoodsId: orderInfo.shopmallGoodsId })
setTimeout(() => { setTimeout(() => {
// 防止页面跳转慢 重复点击 // 防止页面跳转慢 重复点击
this.setData({ this.setData({
...@@ -129,14 +137,90 @@ Page({ ...@@ -129,14 +137,90 @@ Page({
}) })
}) })
}, },
payVoucherConfirm(e) {
let obj = e?.detail
let { orderInfo } = this.data
wx.showModal({
title: '门店收款确认',
content: '确定将此订单标记为门店收款',
complete: (res) => {
if (res.confirm) {
let { default4SStoreInfo_crowdFunding: merchantInfo } = wx.$util.getUserInfo()
const selectPayType = orderInfo?.payType == 'wechat' ? 1 : orderInfo?.payType == 'pos' ? 3 : 2
const orderObj = wx.$util.deepClone(orderInfo)
delete orderObj.activityPrice
delete orderObj.crowdFundingPrice
delete orderObj.tailPayment
delete orderObj.specialGoodsId
let params = {
...orderObj,
selectPayType,
orderPaySource: 3,
merchantId: merchantInfo.merchantId,
merchantName: merchantInfo.merchantName,
outTradeNo: obj.outTradeNo,
payVoucher: obj.payVoucher
}
this.setData({
confirmFlag: true
})
wx.showLoading()
api
.createFullPayOrderAPI(params)
.then(res => {
console.log(res, 'res')
wx.hideLoading()
let { code, data, message } = res
if (code == '0') {
wx.$router.back()
this.setData({
confirmFlag: false
})
} else {
wx.$util.showToast(message || '接口异常')
this.setData({
confirmFlag: false
})
}
})
.finally(() => {
this.setData({
confirmFlag: false
})
})
}
}
})
this.setData({
showPaymentVoucherVisible: false
})
},
// 自定义picker选择器 // 自定义picker选择器
showPickerSelect(e) { showPickerSelect(e) {
this.setData({ this.setData({
showPickerSelect: true, showPickerSelect: true,
pickerTitle: e?.detail?.pickerTitle, pickerTitle: e?.detail?.pickerTitle,
pickerObj: e?.detail || {} pickerObj: e?.detail || {},
popupHeight: e?.detail?.height || ''
}) })
}, },
// 添加备注
showMask() {
this.setData({
showRemark: true,
})
},
remarkCancel() {
this.setData({
showRemark: false,
})
},
remarkConfirm(e) {
let remark = e.detail
let { orderInfo } = this.data
orderInfo.remark = remark
this.setData({orderInfo})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
"navigationBarTitleText": "新增订单", "navigationBarTitleText": "新增订单",
"usingComponents": { "usingComponents": {
"gl-form": "/packageCrowdFunding/components/GLForm/GLForm", "gl-form": "/packageCrowdFunding/components/GLForm/GLForm",
"picker-select": "/packageCrowdFunding/components/PickerSelect/PickerSelect" "picker-select": "/packageCrowdFunding/components/PickerSelect/PickerSelect",
"payment-voucher-popup": "./components/paymentVoucherPopup"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }
...@@ -12,18 +12,19 @@ ...@@ -12,18 +12,19 @@
</navigation-bar> </navigation-bar>
<view class="addition-record-order"> <view class="addition-record-order">
<view class="title">订单信息</view> <view class="title">订单信息</view>
<view class="content-box"> <scroll-view scroll-y class="content-box" style="height: calc(100vh - {{navBarHeight}}px - 250rpx);">
<view class="box"> <view class="box">
<gl-form formData="{{orderInfo}}" dataAttrName="orderInfo" bindshowPickerSelect="showPickerSelect" formDataList="{{orderObj.shopFormList}}"></gl-form> <gl-form formData="{{orderInfo}}" dataAttrName="orderInfo" bindshowPickerSelect="showPickerSelect" formDataList="{{orderObj.shopFormList}}"></gl-form>
</view> </view>
<view class="box"> <view class="box">
<gl-form bindshowOrderNoPopup="showOrderNoPopup" dataAttrName="orderInfo" bindshowPickerSelect="showPickerSelect" formData="{{orderInfo}}" formDataList="{{orderObj.orderFormList}}"></gl-form> <gl-form bindshowOrderNoPopup="showOrderNoPopup" dataAttrName="orderInfo" bindshowPickerSelect="showPickerSelect" bindshowMask="showMask" formData="{{orderInfo}}" formDataList="{{orderObj.orderFormList}}"></gl-form>
</view> </view>
</view> </scroll-view>
<view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}"> <view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn" bindtap="confirm" data-target="wechat">微信支付</view> <!-- <view class="btn" bindtap="confirm" data-target="wechat">微信支付</view>
<view class="btn-lucency" bindtap="confirm" data-target="pos">POS机支付</view> <view class="btn-lucency" bindtap="confirm" data-target="pos">POS机支付</view> -->
<view class="btn" bindtap="confirm">确定</view>
</view> </view>
</view> </view>
<picker-select <picker-select
...@@ -31,4 +32,15 @@ ...@@ -31,4 +32,15 @@
title="请选择{{pickerTitle}}" title="请选择{{pickerTitle}}"
pickerObj="{{pickerObj}}" pickerObj="{{pickerObj}}"
orderInfo="{{orderInfo}}" orderInfo="{{orderInfo}}"
popupHeight="{{popupHeight}}"
/> />
<remark-popup wx:if="{{showRemark}}"
title="备注"
show="{{showRemark}}"
required="{{true}}"
value="{{orderInfo.remark}}"
maxlength="30"
bindcancel="remarkCancel"
bindconfirm="remarkConfirm"
placeholder="请填写内容,最多30个字" />
<payment-voucher-popup wx:if="{{showPaymentVoucherVisible}}" show="{{showPaymentVoucherVisible}}" bindpayVoucherConfirm="payVoucherConfirm" />
<!--packageCrowdFunding/pages/paidOrder/paidOrder.wxml--> <!--packageCrowdFunding/pages/paidOrder/paidOrder.wxml-->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{true}}" bindback="back" bindshowMenuPopup="showMenuPopup"> <navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{true}}" bindback="back" bindshowMenuPopup="showMenuPopup">
<view class="navigation-title" bindtap="showStorePicker"> <view class="navigation-title" bindtap="showStorePicker" wx:if="{{storeListRange.length}}">
<view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo_crowdFunding && userInfo.default4SStoreInfo_crowdFunding.merchantName}}</view> <view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo_crowdFunding && userInfo.default4SStoreInfo_crowdFunding.merchantName}}</view>
<view class="arrow"> <view class="arrow">
<image src="/images/back.png"/> <image src="/images/back.png"/>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
showMenu="{{true}}" showMenu="{{true}}"
bindback="back" bindback="back"
bindshowMenuPopup="showMenuPopup"> bindshowMenuPopup="showMenuPopup">
<view class="navigation-title" bindtap="showStorePicker"> <view class="navigation-title" bindtap="showStorePicker" wx:if="{{storeListRange.length}}">
<view class="navigation-title-text text-hide"> <view class="navigation-title-text text-hide">
{{userInfo && userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName}} {{userInfo && userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName}}
</view> </view>
......
<!--subvehicleConversion/pages/index/index.wxml--> <!--subvehicleConversion/pages/index/index.wxml-->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{true}}" bindshowMenuPopup="showMenuPopup" navStyle="{{navStyle}}"> <navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{true}}" bindshowMenuPopup="showMenuPopup" navStyle="{{navStyle}}">
<view class="navigation-title" bindtap="showStorePicker"> <view class="navigation-title" bindtap="showStorePicker" wx:if="{{storeListRange.length}}">
<view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo_newCarConversion && userInfo.default4SStoreInfo_newCarConversion.merchantName}}</view> <view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo_newCarConversion && userInfo.default4SStoreInfo_newCarConversion.merchantName}}</view>
<view class="arrow"> <view class="arrow">
<image src="/images/back.png"/> <image src="/images/back.png"/>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!