This commit is contained in:
aihe 2024-06-14 23:43:50 +08:00
parent 1bd6ca373f
commit 69bcdcd2b9
17 changed files with 63 additions and 7 deletions

View File

@ -1,4 +1,4 @@
import getCdnUrl from "./getCdnUrl.js"
import getCdnUrl, { getCdnRoot } from "./getCdnUrl.js"
import { authCodeEnum } from "./authCode"
const dateTypeEnum = {
@ -74,6 +74,18 @@ const dealBtnMap = {
}
const audioTypeEnum = {
confirmation: getCdnRoot('tone/confirmation.mp3'),
correct: getCdnRoot('tone/correct.mp3'),
dotexist: getCdnRoot('tone/dotexist.mp3'),
networkError: getCdnRoot('tone/network-error.mp3'),
orderException: getCdnRoot('tone/order-exception.mp3'),
printCancel: getCdnRoot('tone/print-cancel.mp3'),
printFail: getCdnRoot('tone/print-fail.mp3'),
printSuccess: getCdnRoot('tone/print-success.mp3'),
repetitive: getCdnRoot('tone/repetitive.mp3'),
}
export {
addressNameCodeMap,
dateRangeList,
@ -82,4 +94,5 @@ export {
dateTypeEnum,
dateTypeList,
authCodeEnum,
audioTypeEnum,
}

View File

@ -1,3 +1,7 @@
export default (path)=> {
return `/static/images/${path}`
}
export const getCdnRoot = (path)=> {
return `/static/${path}`
}

View File

@ -1,5 +1,6 @@
import dayjs from "dayjs"
import { showToast } from "@/common/untool"
import { showToast, playAudio } from "@/common/untool"
import { audioTypeEnum } from "@/common/enum"
export const scanTypeEnum = {
lanShou: 10, // 揽收
@ -35,8 +36,20 @@ export const ansScanResponse = ({ res, title })=> {
let bl = false
if(result == "success") {
bl = true
playAudio(audioTypeEnum.correct)
title && showToast(`${title}成功`)
} else {
switch (resItem?.message){
case '重复扫描':
playAudio(audioTypeEnum.repetitive)
break;
case '运单号不存在':
playAudio(audioTypeEnum.dotexist)
break;
default:
playAudio(audioTypeEnum.networkError)
break;
}
showToast(resItem?.message || `${title}失败`)
}
return {

View File

@ -266,6 +266,17 @@ const reloadCurrentPage = (_thisPage)=> {
});
}
const playAudio = (src)=> {
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = src
innerAudioContext.onPlay(() => {
console.log('开始播放===');
});
innerAudioContext.onError((res) => {
console.log("playAudio onError ======", res);
});
}
export {
reLaunch,
@ -288,4 +299,5 @@ export {
promiseTimeout,
setNavigationBarTitle,
reloadCurrentPage,
playAudio
}

View File

@ -89,7 +89,7 @@
</u-row>
</view>
<view class="pt-20">
<u-textarea v-model="modelInfo.feeRemaker" border="surround" height="120" placeholder="费用备注"
<u-textarea v-model="modelInfo.feeRemark" border="surround" height="120" placeholder="费用备注"
maxlength="50" count></u-textarea>
</view>
</view>

View File

@ -64,7 +64,7 @@
<u-row justify="between">
<u-row>
<text class="clr-sub pr-10">费用备注</text>
<text>{{modelInfo.feeRemaker || '-'}}</text>
<text>{{modelInfo.feeRemark || '-'}}</text>
</u-row>
</u-row>
</view>

View File

@ -23,6 +23,12 @@
</view>
</u-row>
<u-row custom-style="margin-top:20rpx;">
<view style="flex: 1;">
<tpx-select v-model:value="submitParam.dispatchOrSendManCode" v-model:resObject="paiRes" :getListFun="getRSDStaffList" :transKeyVal="{valKey: 'empCode',titleKey: 'empName'}" placeholder="请选择派件员" mode="drop"></tpx-select>
</view>
</u-row>
<view class="mt-20">
<bpe-goodphoto-tmp title="签收拍照" :value="submitParam" filedName="picUrl"></bpe-goodphoto-tmp>
</view>
@ -51,6 +57,7 @@
import dayjs from "dayjs"
import * as apiService from "@/common/api"
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
import { checkParams } from "@/common/validate"
export default {
components:{ BpeGoodphotoTmp },
@ -72,8 +79,14 @@
signMan: "",
picUrl: '',
remark: "",
scanDate: ""
dispatchOrSendManCode: ""
},
submitValidConfig: {
signMan: { required: true, requiredMsg: '签收人不能为空' },
// dispatchOrSendManCode: { required: true, requiredMsg: '请选择派件员' },
billCode: { required: true, requiredMsg: '运单号不能为空' },
},
paiRes: { list: [] },
}
},
onShareAppMessage() {
@ -88,7 +101,7 @@
},
methods: {
getRSDStaffList: apiService.getRSDStaffList,
initData() {
this.submitParam.billCode = this.queryOption.billCode || this.queryOption.orderSn
},
@ -96,6 +109,7 @@
}),
async handleSubmit() {
await checkParams(this.submitParam, this.submitValidConfig)
this.submitParam.picUrl = this.submitParam.picUrl?.join?.(",") || ''
let scnParam = getScanParams(scanTypeEnum.qianShou, { ...this.submitParam })
let res = await apiService.scanRecord({...scnParam, _loading: true})

View File

@ -67,7 +67,7 @@ export const getOrderModels = () => {
blOverLong: undefined,
blOverWeight: undefined,
overWeightNumber: undefined,
feeRemaker: undefined, // 付款方式-其他-备注
feeRemark: undefined, // 付款方式-其他-备注
realValue: undefined,
blDispFd: undefined,
transferCode: undefined,

Binary file not shown.

BIN
static/tone/correct.mp3 Normal file

Binary file not shown.

BIN
static/tone/dotexist.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
static/tone/print-fail.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
static/tone/repetitive.mp3 Normal file

Binary file not shown.