Commit efedd386 by 前端

修改bug

1 parent dfe9ccd3
......@@ -15,14 +15,14 @@ export default {
},
onShow: function () {},
onHide: function () {
// if (this.isStart && !this.isEnd) {
// console.log("录音");
// const recorderManager = uni.getRecorderManager();
// recorderManager.stop();
// recorderManager.start({
// duration: 10000,
// });
// }
if (this.isStart && !this.isEnd) {
console.log("录音");
const recorderManager = uni.getRecorderManager();
recorderManager.stop();
recorderManager.start({
duration: 10000,
});
}
},
};
</script>
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-10 16:15:05
* @LastEditTime: 2024-04-10 20:36:46
* @FilePath: \gl_tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -12,11 +12,10 @@ import { mapMutations, mapState } from "vuex";
export default {
data() {
return {
endReasonType: 0,
voicePath: "",
timer: null,
times: 0,
timeout: 600, //十分钟提示
timeout: 590, //十分钟提示
reaction: 10,
};
},
......@@ -28,6 +27,7 @@ export default {
...mapState("audio", [
"isEnd",
"receptionStatus",
"endReasonType",
"booksList",
"audioList",
"isStart",
......@@ -52,6 +52,7 @@ export default {
methods: {
...mapMutations("audio", [
"setReceptionStatus",
"setReasonType",
"setAudioStart",
"setAudioList",
"setAudioEnd",
......@@ -59,8 +60,13 @@ export default {
]),
//关闭提示
tipCancel() {
this.times = 0;
this.stopAudio();
this.setReceptionStatus(0);
this.setReasonType(1);
this.$refs.tipBox.close();
uni.reLaunch({
url: "/pages/home/home",
});
},
//结束提示
tipConfirm() {
......@@ -74,7 +80,7 @@ export default {
},
//保存录音记录及其他信息
async uploadVoice(tempFilePath) {
const { merchantId, phone } = uni.$storage.get("userInfo"),
const { shopMerchantId, phone } = uni.$storage.get("userInfo"),
{ customerName, phoneNumber, salesUuid, carModel } =
this.$store.state.user.customerInfo,
receptionCustomerPaySourceList = this.booksList.map((item) => {
......@@ -86,7 +92,7 @@ export default {
}),
params = {
carModel,
endReasonType: this.endReasonType,
endReasonType: this.endReasonType, //原因 1.异常 0.正常
customerName,
phoneNumber,
loginPhone: phone,
......@@ -96,7 +102,7 @@ export default {
receptionStartTime: this.receptionStartTime,
receptionEndTime: this.receptionEndTime,
receptionCustomerPaySourceList, //1.付款凭证文件路径 2.客户购车发票文件路径 3.客户延保合同文件路径
merchantId,
merchantId: shopMerchantId,
};
this.setBooks([]);
console.log(params);
......@@ -105,8 +111,8 @@ export default {
console.log(res);
});
this.$store.dispatch("clearCustomerInfo");
this.endReasonType = 0;
this.setReceptionStatus(1);
this.setReasonType(0);
uni.$storage.set("storageFile", "");
},
//开始录音
......@@ -116,7 +122,7 @@ export default {
this.setAudioList([]);
this.setAudioEnd(false);
recorderManager.start({
duration: 10000,
duration: 600000,
});
recorderManager.onStop(async (res) => {
if (!this.isEnd) {
......@@ -147,9 +153,8 @@ export default {
}
if (this.times >= this.reaction + this.timeout) {
//结束接待
this.stopAudio();
this.endReasonType = 1;
this.$refs.tipBox.close();
this.tipCancel();
clearInterval(this.timer);
}
}, 1000);
},
......
......@@ -7,10 +7,7 @@
<view class="title">问界·交车告知书</view>
<view class="form">
<template v-for="(i, index) in formObject">
<view
class="form-item"
:key="index"
>
<view class="form-item" :key="index">
<view class="label">{{ i.label }}</view>
<view class="value">
<template v-if="i.type == 'input'">
......@@ -23,16 +20,9 @@
/>
</template>
<template v-else>
<view
class="select"
@click="showPopup(i.popKey)"
>
{{customerInfo[i.key]}}
<uni-icons
class="arrow"
type="down"
:size="16"
></uni-icons>
<view class="select" @click="showPopup(i.popKey)">
{{ customerInfo[i.key] }}
<uni-icons class="arrow" type="down" :size="16"></uni-icons>
</view>
</template>
</view>
......@@ -40,10 +30,7 @@
</template>
</view>
<template v-for="(i, index) in views">
<view
class="view"
:key="index"
>
<view class="view" :key="index">
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
......@@ -63,7 +50,7 @@
<view class="select-box">
<view
class="select-item"
:class="{ checked:carBrand == item.name }"
:class="{ checked: carBrand == item.name }"
@click="selectCar(item)"
v-for="(item, index) in carBrandList"
:key="index"
......@@ -83,7 +70,7 @@
<view
class="select-item"
:class="{ checked: customerInfo.carModel == item.name }"
@click="handleSelect(item,'carBoxVisible')"
@click="handleSelect(item, 'carBoxVisible')"
v-for="(item, index) in carlist"
:key="index"
>
......@@ -102,7 +89,7 @@
<view
class="select-item"
:class="{ checked: customerInfo.salesUuid == item.uuid }"
@click="handleSelect(item,'employeeBoxVisible')"
@click="handleSelect(item, 'employeeBoxVisible')"
v-for="(item, index) in employeeList"
:key="index"
>
......@@ -220,7 +207,7 @@ export default {
top: 0;
width: 100%;
height: 432rpx;
image{
image {
width: 100%;
height: 100%;
}
......
......@@ -9,53 +9,56 @@
<Tabs :list="list" @tabclick="tabclick" />
</template>
<view class="card-list">
<template v-if="historyList.length > 0">
<view class="card-item" v-for="item in historyList" :key="item.id">
<view class="name">{{ nameHide(item.customerName) }}</view>
<view class="goods-name">{{ item.goodsName }}</view>
<view class="card-info"
><view>车架号</view><view>{{ item.carVin || 4654651 }}</view></view
>
<view class="card-info"
><view>工单号</view><view>{{ item.payId }}</view></view
>
<view class="card-info"
><view>订单时间</view>
<view>{{ format(item.createdTime) }}</view>
</view
>
<view class="card-info"
><view>交易流水号</view><view>{{ item.transactionNo }}</view></view
>
<view class="card-info"
><view>支付方式</view
><glsx-image
class="pay-type"
:src="`media/${payType[item.payType]}.png`"
/></view>
<view class="card-info"
><view>实收金额</view
><view class="price">¥{{ item.equityPrice }}</view></view
>
</view>
</template>
<template v-else>
<view class="no-data">
<glsx-image
class="no-data-img"
src="media/no-data.png"
mode="scaleToFill"
/>
<view class="no-data-text">暂无数据</view>
</view>
</template>
<template v-if="historyList.length > 0">
<view class="card-item" v-for="item in historyList" :key="item.id">
<view class="name">{{ nameHide(item.customerName) }}</view>
<view class="goods-name">{{ item.goodsName }}</view>
<view class="card-info"
><view>车架号</view
><view>{{ item.carVin || 4654651 }}</view></view
>
<view class="card-info"
><view>工单号</view><view>{{ item.payId }}</view></view
>
<view class="card-info"
><view>订单时间</view>
<view>{{ format(item.createdTime) }}</view>
</view>
<view class="card-info"
><view>交易流水号</view
><view>{{ item.transactionNo }}</view></view
>
<view class="card-info"
><view>支付方式</view
><glsx-image
class="pay-type"
:src="`media/${payType[item.payType]}.png`"
/></view>
<view class="card-info"
><view>实收金额</view
><view class="price">¥{{ accDiv(item.equityPrice) }}</view></view
>
</view>
</template>
<template v-else>
<view class="no-data">
<glsx-image
class="no-data-img"
src="media/no-data.png"
mode="scaleToFill"
/>
<view class="no-data-text">暂无数据</view>
</view>
</template>
<!-- <uni-grid :column="3" :show-border="false" :square="false">
<uni-grid-item v-for="item in historyList" :key="item.id"> -->
<!-- </uni-grid-item>
</uni-grid> -->
</view>
<view class="end-text" v-if="historyList.length > 0 && isEnd">我是一个有底线的人</view>
<view class="end-text" v-if="historyList.length > 0 && isEnd"
>我是一个有底线的人</view
>
</view>
</view>
</template>
......@@ -113,6 +116,9 @@ export default {
format(dateTimeStr) {
return utils.convertDateTimeFormat(dateTimeStr, '/')
},
accDiv(val) {
return utils.accDiv(val, 100)
},
init(){
const { shopMerchantId } = uni.$storage.get("userInfo");
this.shopMerchantId = shopMerchantId
......@@ -139,7 +145,7 @@ export default {
if (this.historyList.length > 9) this.isEnd = true
}
}
},
tabclick(index) {
this.goodsName = this.list[index].value
......@@ -174,7 +180,7 @@ export default {
top: 0;
width: 100%;
height: 176rpx;
image{
image {
width: 100%;
height: 100%;
}
......@@ -254,7 +260,7 @@ export default {
transform: translate(-50%, -50%);
&-img {
width: 640rpx;
height: 272rpx;
height: 272rpx;
}
&-text {
font-size: 32rpx;
......
......@@ -12,7 +12,7 @@
<uni-icons type="left" :size="32"></uni-icons>
</view>
</view>
<view :class="['view', { showView: id == 1 }]">
<media_1 :views="media[1]" :penSwitch="type != 'preview' && drawStatus" />
</view>
......@@ -35,9 +35,7 @@
<template v-if="type != 'preview'">
<tool-box :type="type" @choose="choose" @finish="open" />
<view class="pen-box" @click="drawStatus = !drawStatus">
<image
:src="!drawStatus ? defaulePen : activePen"
/>
<image :src="!drawStatus ? defaulePen : activePen" />
</view>
</template>
<MessageBox
......@@ -103,8 +101,8 @@ export default {
},
drawStatus: false,
finishVisible: false,
defaulePen: require('../../assets/images/media/pen.png'),
activePen: require('../../assets/images/media/pen-active.png'),
defaulePen: require("../../assets/images/media/pen.png"),
activePen: require("../../assets/images/media/pen-active.png"),
};
},
onLoad(options) {
......@@ -114,10 +112,10 @@ export default {
this.getFindSoureDetail(options.id);
},
onBackPress(options) {
if (options.from === 'backbutton') {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
if (this.type != "preview") this.$refs.finish.open()
if (this.type != "preview") this.$refs.finish.open();
return true;
}
// 其他情况允许正常返回
......@@ -148,7 +146,6 @@ export default {
},
// 完成接待
done() {
this.$store.dispatch("clearCustomerInfo");
this.stopAudio();
uni.navigateBack();
this.setReceptionStatus(0);
......@@ -196,7 +193,7 @@ export default {
.showView {
z-index: 1;
display: block;
animation: show-view-left 0.15s ;
animation: show-view-left 0.15s;
}
.pen-box {
position: fixed;
......@@ -208,17 +205,17 @@ export default {
box-shadow: 0 4px 12px 0 #00000033;
border-radius: 16rpx;
overflow: hidden;
image{
image {
width: 100%;
height: 100%;
}
}
@keyframes show-view-left {
0%{
0% {
transform: translateX(1000%);
box-shadow: 0 8rpx 22rpx 0 #00000029;
}
100%{
100% {
transform: translateX(0);
box-shadow: 0 8rpx 22rpx 0 #00000029;
}
......
......@@ -2,8 +2,8 @@
* @Description: 首页
* @Author: huyue
* @Date: 2024-04-07 14:39:40
* @LastEditors: huyue
* @LastEditTime: 2024-04-10 17:00:04
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-10 19:56:12
-->
<template>
<view class="container" @click="handleTouchStart()">
......@@ -102,6 +102,8 @@ export default {
},
mounted() {
this.userInfo = uni.$storage.get("userInfo");
},
onShow() {
this.getSoure();
},
methods: {
......@@ -142,7 +144,7 @@ export default {
uni.navigateTo({
url: `../detail/detail?type=preview&id=${id}`,
});
this.$refs.previewRef.close()
this.$refs.previewRef.close();
},
},
};
......
......@@ -108,7 +108,7 @@
<view class="select-box">
<view
class="select-item"
:class="{ checked:carBrand == item.name }"
:class="{ checked: carBrand == item.name }"
@click="selectCar(item)"
v-for="(item, index) in carBrandList"
:key="index"
......@@ -156,7 +156,11 @@
</view>
</MessageBox>
<uni-popup ref="successRef" type="message">
<uni-popup-message type="success" message="保存成功" :duration="1500"></uni-popup-message>
<uni-popup-message
type="success"
message="保存成功"
:duration="1500"
></uni-popup-message>
</uni-popup>
</view>
</template>
......@@ -226,9 +230,9 @@ export default {
employeeList: [],
f_key: Date.now(),
errorTip: false,
carBrand: '',
carBrand: "",
carBrandList: [],
isPreview: false
isPreview: false,
};
},
onLoad(options) {
......@@ -244,12 +248,12 @@ export default {
},
onShow() {
if (!this.isPreview) {
this.infoList = this.infoList.map(item => {
this.infoList = this.infoList.map((item) => {
if (item.imgUrl) {
delete item.imgUrl
delete item.imgUrl;
}
return item
})
return item;
});
}
},
methods: {
......@@ -285,17 +289,19 @@ export default {
this.infoList = INFO_LIST.map((item) => delete item.imgUrl);
} else {
let userInfo = uni.$storage.get("userInfo");
uni.$api.commonApi.getMerchantCarBrandList([userInfo.shopMerchantId]).then(({ data }) => {
let list = data[0].carBrandList,
carBrandList = []
list.map(e => {
e.childs.map(i => {
i.brandId = e.id
carBrandList.push(i)
})
})
this.carBrandList = carBrandList
})
uni.$api.commonApi
.getMerchantCarBrandList([userInfo.shopMerchantId])
.then(({ data }) => {
let list = data[0].carBrandList,
carBrandList = [];
list.map((e) => {
e.childs.map((i) => {
i.brandId = e.id;
carBrandList.push(i);
});
});
this.carBrandList = carBrandList;
});
uni.$api.commonApi
.getEmployeeList({
merchantId: userInfo.shopMerchantId,
......@@ -318,12 +324,12 @@ export default {
this.setBooks(utils.deepClone(this.infoList));
this.stopAudio();
this.infoList = INFO_LIST.map((item) => delete item.imgUrl);
this.$refs.successRef.open()
this.$refs.successRef.open();
setTimeout(() => {
uni.reLaunch({
url: "/pages/home/home",
});
}, 1500)
url: "/pages/home/home",
});
}, 1500);
}
} catch (error) {
console.log(error);
......@@ -345,13 +351,19 @@ export default {
urls: [this.infoList[index].imgUrl],
longPressActions: {
// itemList: ['发送给朋友', '保存图片', '收藏'],
success: function(data) {
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
success: function (data) {
console.log(
"选中了第" +
(data.tapIndex + 1) +
"个按钮,第" +
(data.index + 1) +
"张图片"
);
},
fail: function(err) {
fail: function (err) {
console.log(err.errMsg);
}
}
},
},
});
// this.$refs.preview.open("center");
},
......@@ -362,7 +374,7 @@ export default {
this.formData.salesUuid = item.uuid;
this.formData.staffName = item.staffName;
} else {
this.$refs.carBrandListVisible.close()
this.$refs.carBrandListVisible.close();
this.formData.carModel = item.name;
}
this.$store.dispatch("setCustomerInfo", this.formData);
......@@ -380,17 +392,20 @@ export default {
this.f_key = Date.now();
this.errorTip = false;
},
selectCar (e) {
uni.showLoading()
this.carBrand = e.name
uni.$api.commonApi.getCarBrandsList({
brandId: e.brandId,
childBrandId: e.id
}).then(res => {
uni.hideLoading()
this.carlist = res
this.$refs.carBoxVisible.open()
}).catch(() => uni.hideLoading())
selectCar(e) {
uni.showLoading();
this.carBrand = e.name;
uni.$api.commonApi
.getCarBrandsList({
brandId: e.brandId,
childBrandId: e.id,
})
.then((res) => {
uni.hideLoading();
this.carlist = res;
this.$refs.carBoxVisible.open();
})
.catch(() => uni.hideLoading());
},
},
};
......
......@@ -15,6 +15,7 @@ export default {
audioList: [],
isStart: false,
receptionStatus: 1,
endReasonType: 0,
isEnd: false,
receptionStartTime: "",
receptionEndTime: "",
......@@ -24,6 +25,9 @@ export default {
setReceptionStatus(state, data) {
state.receptionStatus = data;
},
setReasonType(state, data) {
state.endReasonType = data;
},
setAudioList(state, data) {
state.audioList = data;
},
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 17:16:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-10 10:08:58
* @LastEditTime: 2024-04-10 20:34:11
* @FilePath: \gl_tape\utils\utils.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -35,7 +35,24 @@ function deepClone(value) {
}
return result;
}
//精确除法
function accDiv(arg1, arg2) {
var t1 = 0,
t2 = 0,
r1,
r2;
try {
t1 = arg1.toString().split(".")[1].length;
} catch (e) {}
try {
t2 = arg2.toString().split(".")[1].length;
} catch (e) {}
r1 = Number(arg1.toString().replace(".", ""));
r2 = Number(arg2.toString().replace(".", ""));
return (r1 / r2) * Math.pow(10, t2 - t1);
}
export default {
convertDateTimeFormat,
deepClone,
accDiv,
};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!