Commit 9af79ac9 by yixinjj

Merge branch 'v1.0.7' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.7

2 parents 73664db4 30d78114
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<script> <script>
var wv;
import checkUpdate from "@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js"; import checkUpdate from "@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js";
import { mapState } from "vuex"; import { mapState } from "vuex";
export default { export default {
computed: { computed: {
...mapState("audio", ["isEnd", "isStart"]), ...mapState("audio", ["isEnd", "isStart"]),
}, },
onLoad() {},
onLaunch: async function () { onLaunch: async function () {
setTimeout(() => { setTimeout(() => {
plus.screen.unlockOrientation(); //解除锁定屏幕方向 plus.screen.unlockOrientation(); //解除锁定屏幕方向
...@@ -41,6 +43,9 @@ export default { ...@@ -41,6 +43,9 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
body {
overflow: hidden;
}
page { page {
font-size: 28rpx; font-size: 28rpx;
height: 100%; height: 100%;
...@@ -102,4 +107,11 @@ button::after { ...@@ -102,4 +107,11 @@ button::after {
.button-hover { .button-hover {
transform: translate(1rpx, 1rpx); transform: translate(1rpx, 1rpx);
} }
.webview-container {
position: absolute;
width: 100rpx;
height: 100rpx;
top: 0rpx;
left: 0rpx;
}
</style> </style>
...@@ -50,18 +50,16 @@ const imgToBase64 = (list, urlKey) => { ...@@ -50,18 +50,16 @@ const imgToBase64 = (list, urlKey) => {
let arr = [], let arr = [],
newList = JSON.parse(JSON.stringify(list)) newList = JSON.parse(JSON.stringify(list))
list.map((e, index) => { list.map((e, index) => {
if(!(urlKey ? e[urlKey] : e).startsWith('https')) return resolve(list) if (!e[urlKey]) return resolve(list)
if (!e[urlKey].startsWith('https')) return resolve(list)
uni.request({ uni.request({
url: urlKey ? e[urlKey] : e, url: urlKey ? e[urlKey] : e,
method: 'GET', method: 'GET',
responseType: 'arraybuffer', responseType: 'arraybuffer',
success: (res) => { success: (res) => {
const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}` const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}`
if (urlKey) { newList[index][urlKey] = base64
newList[index][urlKey] = base64 newList[index][`original_${urlKey}`] = e[urlKey]
newList[index][`original_${urlKey}`] = e[urlKey]
}
else newList[index] = base64
arr.push(e) arr.push(e)
if (arr.length === list.length) resolve(newList) if (arr.length === list.length) resolve(newList)
}, },
......
<template> <template>
<view <view class="container" @click="handleTouchStart">
class="container"
@click="handleTouchStart"
>
<view :class="['home', { show: !id }]"> <view :class="['home', { show: !id }]">
<view class="bg"> <view class="bg">
<view class="top"> <view class="top">
<view <view class="top-one" :style="randomize"></view>
class="top-one"
:style="randomize"
></view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view <view class="bottom-one" :style="randomize"></view>
class="bottom-one" <view class="bottom-two" :style="randomize"></view>
:style="randomize" <view class="bottom-three" :style="randomize"></view>
></view>
<view
class="bottom-two"
:style="randomize"
></view>
<view
class="bottom-three"
:style="randomize"
></view>
</view> </view>
</view> </view>
<view class="left-side"> <view class="left-side">
...@@ -39,26 +24,22 @@ ...@@ -39,26 +24,22 @@
@click="changeIndex(index)" @click="changeIndex(index)"
> >
<view class="icon-box"> <view class="icon-box">
<view :class="[ <view
:class="[
'sprite-icon', 'sprite-icon',
`icon-${i.icon}${tabIndex == index ? '-active' : ''}`, `icon-${i.icon}${tabIndex == index ? '-active' : ''}`,
]"></view> ]"
></view>
</view> </view>
{{ i.label }} {{ i.label }}
</view> </view>
</template> </template>
</view> </view>
<view class="left-footer"> <view class="left-footer">
<view <view class="btn" @click="$refs.kfRef.open()">
class="btn"
@click="$refs.kfRef.open()"
>
<view class="sprite-icon icon-feedback"></view> <view class="sprite-icon icon-feedback"></view>
</view> </view>
<view <view class="btn" @click="$refs.settingRef.open()">
class="btn"
@click="$refs.settingRef.open()"
>
<view class="sprite-icon icon-setting"></view> <view class="sprite-icon icon-setting"></view>
</view> </view>
</view> </view>
...@@ -66,10 +47,7 @@ ...@@ -66,10 +47,7 @@
<view class="right-side"> <view class="right-side">
<template v-if="tabIndex == 0"> <template v-if="tabIndex == 0">
<view class="right-content"> <view class="right-content">
<view <view class="start" @click="$emit('start')">
class="start"
@click="$emit('start')"
>
<image <image
class="start-btn" class="start-btn"
src="../../assets/images/home/start.gif" src="../../assets/images/home/start.gif"
...@@ -121,21 +99,13 @@ ...@@ -121,21 +99,13 @@
:isFooter="false" :isFooter="false"
> >
<view class="footer"> <view class="footer">
<view <view class="footer-btn confirm flex" @click="$emit('openStep')">
class="footer-btn confirm flex"
@click="$emit('openStep')"
>
<template v-if="finishDoneText"> <template v-if="finishDoneText">
{{finishDoneText}} {{ finishDoneText }}
</template>
<template v-else>
完成接待<text>(推荐)</text>
</template> </template>
<template v-else> 完成接待<text>(推荐)</text> </template>
</view> </view>
<view <view class="footer-btn cancel flex" @click="$emit('backHome')">
class="footer-btn cancel flex"
@click="$emit('backHome')"
>
仍要退出<text>(不推荐)</text> 仍要退出<text>(不推荐)</text>
</view> </view>
</view> </view>
...@@ -145,10 +115,7 @@ ...@@ -145,10 +115,7 @@
<!-- 客服弹框 --> <!-- 客服弹框 -->
<kf-box ref="kfRef" /> <kf-box ref="kfRef" />
<!-- 设置弹框 --> <!-- 设置弹框 -->
<setting-box <setting-box ref="settingRef" @stopAudio="stopAudio" />
ref="settingRef"
@stopAudio="stopAudio"
/>
<slot name="content" /> <slot name="content" />
</view> </view>
</template> </template>
...@@ -165,10 +132,10 @@ export default { ...@@ -165,10 +132,10 @@ export default {
finishDoneText: String, finishDoneText: String,
finishContene: { finishContene: {
type: String, type: String,
default: '当前操作视为强制退出接待,若需正常流程完成接待请点击“完成接待”' default: "当前操作视为强制退出接待,若需正常流程完成接待请点击“完成接待”",
} },
}, },
data () { data() {
return { return {
userInfo: {}, userInfo: {},
tabs: [ tabs: [
...@@ -182,18 +149,18 @@ export default { ...@@ -182,18 +149,18 @@ export default {
}, },
], ],
tabIndex: 0, tabIndex: 0,
dateKey: null dateKey: null,
}; };
}, },
mounted () { mounted() {
const userInfo = uni.$storage.get("userInfo") || {}; const userInfo = uni.$storage.get("userInfo") || {};
this.userInfo = userInfo this.userInfo = userInfo;
setInterval(() => { setInterval(() => {
this.dateKey = Date.now(); this.dateKey = Date.now();
}, 5e3); }, 5e3);
}, },
computed: { computed: {
randomize () { randomize() {
let { dateKey } = this; let { dateKey } = this;
const maxX = uni.getSystemInfoSync().windowWidth - 300, const maxX = uni.getSystemInfoSync().windowWidth - 300,
maxY = uni.getSystemInfoSync().windowHeight - 100, maxY = uni.getSystemInfoSync().windowHeight - 100,
...@@ -201,18 +168,18 @@ export default { ...@@ -201,18 +168,18 @@ export default {
y = Math.floor(Math.random() * maxY); y = Math.floor(Math.random() * maxY);
return `transform:translate(${x}px,${y}px);${dateKey};`; return `transform:translate(${x}px,${y}px);${dateKey};`;
}, },
previewRef () { previewRef() {
return this.$refs.previewRef return this.$refs.previewRef;
},
finishRef() {
return this.$refs.finish;
}, },
finishRef () {
return this.$refs.finish
}
}, },
methods: { methods: {
changeIndex (index) { changeIndex(index) {
if (this.tabIndex == index) return if (this.tabIndex == index) return;
this.tabIndex = index; this.tabIndex = index;
this.$emit("changeTab", index) this.$emit("changeTab", index);
}, },
}, },
}; };
......
...@@ -19,11 +19,12 @@ ...@@ -19,11 +19,12 @@
* @param {string} accessKeySecret - OSS 访问密钥 secret * @param {string} accessKeySecret - OSS 访问密钥 secret
* @param {string} stsToken - 安全令牌服务(STS)令牌,用于临时访问 OSS 存储桶 * @param {string} stsToken - 安全令牌服务(STS)令牌,用于临时访问 OSS 存储桶
* @param {string} fileName - 要上传的文件名 * @param {string} fileName - 要上传的文件名
* @param {string} filePath - 要上传的文件所在路径
* @param {Object} options - (可选)包含上传器配置的对象,如 region * @param {Object} options - (可选)包含上传器配置的对象,如 region
* @throws {Error} 如果缺少必要的参数,将抛出错误 * @throws {Error} 如果缺少必要的参数,将抛出错误
*/ */
window.msgFromUniapp = function (accessKeyId, accessKeySecret, stsToken, fileName, options = {}) { window.msgFromUniapp = function (accessKeyId, accessKeySecret, stsToken, fileName, filePath, options = {}) {
if (!accessKeyId || !accessKeySecret || !stsToken || !fileName) { if (!accessKeyId || !accessKeySecret || !stsToken || !fileName || !filePath) {
throw new Error('accessKeyId,accessKeySecret,stsToken,fileName is required') throw new Error('accessKeyId,accessKeySecret,stsToken,fileName is required')
} }
try { try {
...@@ -55,6 +56,7 @@ ...@@ -55,6 +56,7 @@
} }
}); });
} }
}
// }, false); // }, false);
</script> </script>
</body> </body>
......
...@@ -14,8 +14,7 @@ class OSSUpLoader { ...@@ -14,8 +14,7 @@ class OSSUpLoader {
/** /**
* 本地保存文件路径(待上传文件路径) * 本地保存文件路径(待上传文件路径)
*/ */
filePath = filePath;
"file:///storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/doc/";
/** /**
* 从STS服务获取的临时访问密钥(AccessKey ID和AccessKey Secret)。 * 从STS服务获取的临时访问密钥(AccessKey ID和AccessKey Secret)。
*/ */
...@@ -83,7 +82,7 @@ class OSSUpLoader { ...@@ -83,7 +82,7 @@ class OSSUpLoader {
partSize = this.partSize, partSize = this.partSize,
parallel = this.parallel, parallel = this.parallel,
timeout = this.timeout, timeout = this.timeout,
filePath = this.filePath, filePath,
retryCountMax = this.retryCountMax, retryCountMax = this.retryCountMax,
retryInterval = this.retryInterval, retryInterval = this.retryInterval,
ossFolder = this.ossFolder, ossFolder = this.ossFolder,
......
...@@ -44,7 +44,7 @@ import { index } from "./env"; ...@@ -44,7 +44,7 @@ import { index } from "./env";
// } // }
Vue.prototype.$permision = permision; Vue.prototype.$permision = permision;
import sentryInit from "@/utils/sentryConfig/sentryInit"; import sentryInit from "@/utils/sentryConfig/sentryInit";
if (index == 3) { if (index == 5) {
const sentry = sentryInit(); const sentry = sentryInit();
Vue.prototype.$sendSentry = function (e) { Vue.prototype.$sendSentry = function (e) {
sentry.captureException(e); sentry.captureException(e);
......
...@@ -33,7 +33,6 @@ export default { ...@@ -33,7 +33,6 @@ export default {
const url = ["pages/equity/index", "pages/boutique/index"]; const url = ["pages/equity/index", "pages/boutique/index"];
if (url.includes(route)) return; if (url.includes(route)) return;
this.initTime(); this.initTime();
// this.checkVoice();
}, },
computed: { computed: {
...mapState("audio", ["receptionStatus", "booksList", "audioInfo"]), ...mapState("audio", ["receptionStatus", "booksList", "audioInfo"]),
...@@ -58,7 +57,7 @@ export default { ...@@ -58,7 +57,7 @@ export default {
"setBooks", "setBooks",
"setAudioInfo", "setAudioInfo",
]), ]),
//关闭提示 // //关闭提示
tipCancel() { tipCancel() {
this.stopAudio(); this.stopAudio();
this.setReceptionStatus(0); this.setReceptionStatus(0);
...@@ -76,6 +75,14 @@ export default { ...@@ -76,6 +75,14 @@ export default {
this.times = 0; this.times = 0;
this.$refs.tipBox?.close(); this.$refs.tipBox?.close();
}, },
closeAudio() {
this.times = 0;
clearInterval(this.timer);
this.timer = null;
this.stopAudio("abnormal");
this.setReceptionStatus(0);
this.setAudioInfo({ endReasonType: 1 });
},
getParams() { getParams() {
const { shopMerchantId, phone, sceneType } = uni.$storage.get("userInfo"), const { shopMerchantId, phone, sceneType } = uni.$storage.get("userInfo"),
{ customerName, phoneNumber, salesUuid, carModel, staffName } = { customerName, phoneNumber, salesUuid, carModel, staffName } =
...@@ -144,20 +151,22 @@ export default { ...@@ -144,20 +151,22 @@ export default {
console.log(res); console.log(res);
}, },
}); });
this.handleSave(saveResult); this.handleSave(saveResult[1].savedFilePath);
}); });
}, },
handleSave(file) { handleSave(file) {
if (this.audioInfo.audioStatus == "end") { const audioList = [...this.audioInfo.audioList, file];
this.saveRecord(); if (file) {
this.setBooks([]);
this.$store.dispatch("clearCustomerInfo");
this.setReceptionStatus(1);
this.setAudioInfo({ endReasonType: 0, audioStatus: "finish" });
} else {
const audioList = [...this.audioInfo.audioList, file];
this.setAudioInfo({ audioList }); this.setAudioInfo({ audioList });
} }
if (this.audioInfo.audioStatus != "end") {
return;
}
this.saveRecord();
this.setBooks([]);
this.$store.dispatch("clearCustomerInfo");
this.setReceptionStatus(1);
this.setAudioInfo({ endReasonType: 0, audioStatus: "finish" });
}, },
/**保存记录*/ /**保存记录*/
saveRecord() { saveRecord() {
...@@ -175,6 +184,7 @@ export default { ...@@ -175,6 +184,7 @@ export default {
}, },
...recordList, ...recordList,
]; ];
console.log(recordList, "recordList");
uni.$storage.set("recordList", JSON.stringify(recordList)); uni.$storage.set("recordList", JSON.stringify(recordList));
}, },
//结束接待 //结束接待
...@@ -189,6 +199,15 @@ export default { ...@@ -189,6 +199,15 @@ export default {
// }); // });
// return; // return;
// } // }
if (status == "abnormal") {
this.setAudioInfo({ audioStatus: "abnormal" });
recorderManager.stop();
return;
}
if (this.audioInfo.audioStatus == "abnormal") {
this.handleSave();
return;
}
if (this.audioInfo.audioStatus != "start") { if (this.audioInfo.audioStatus != "start") {
return; return;
} }
...@@ -226,8 +245,8 @@ export default { ...@@ -226,8 +245,8 @@ export default {
this.$refs.tipBox?.open(); this.$refs.tipBox?.open();
} }
if (this.times >= this.timeout) { if (this.times >= this.timeout) {
//结束接待 //关闭录音
this.tipCancel(); this.closeAudio();
clearInterval(this.timer); clearInterval(this.timer);
} }
}, 1000 * 10); }, 1000 * 10);
......
...@@ -3,18 +3,44 @@ const UPLOAD_STATUS = { ...@@ -3,18 +3,44 @@ const UPLOAD_STATUS = {
success: 1, success: 1,
fail: 2, fail: 2,
}; };
import upload from "@/utils/ossUploadFile/uploadFile.js"; let wv, getResult;
import utils from "@/utils/utils.js"; import { uploadFile, getOssToken } from "@/utils/ossUploadFile/uploadFile.js";
import config from "@/config.js";
export default { export default {
onLoad() {
// #ifdef APP-PLUS
// wv = plus.webview.create("", "custom-webview", {
// plusrequire: "none", //禁止远程网页使用plus的API,有些使用mui制作的网页可能会监听plus.key,造成关闭页面混乱,可以通过这种方式禁止
// "uni-app": "none", //不加载uni-app渲染层框架,避免样式冲突
// top: uni.getSystemInfoSync().statusBarHeight + 44, //放置在titleNView下方。如果还想在webview上方加个地址栏的什么的,可以继续降低TOP值
// });
// wv.loadURL("/hybrid/html/index.html");
// var currentWebview = this.$scope.$getAppWebview(); //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
// currentWebview.append(wv); //一定要append到当前的页面里!!!才能跟随当前页面一起做动画,一起关闭
// setTimeout(function () {
// wv.setStyle({ top: "100%", height: 300 });
// }, 1000); //如果是首页的onload调用时需要延时一下,二级页面无需延时,可直接获取
// // #endif
},
mounted() { mounted() {
// this.checkRecord(); var currentWebview = this.$scope.$getAppWebview(); //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
// setInterval(() => { setTimeout(function () {
wv = currentWebview.children()[0];
wv.setStyle({ top: "100%", height: 300 });
}, 1000); //如果是页面初始化调用时,需要延时一下
// console.log(88);
// // this.checkRecord();
// setTimeout(() => {
// this.checkRecord(); // this.checkRecord();
// }, 1000 * 60 * 10); // }, 1000 * 6);
}, },
methods: { methods: {
handlerMessage(result) {
console.log(result);
getResult = result;
},
checkRecord() { checkRecord() {
utils.isNetWork().then(async (res) => { uni.$isNetWork().then(async (res) => {
let recordList = JSON.parse(uni.$storage.get("recordList") || "[]"); let recordList = JSON.parse(uni.$storage.get("recordList") || "[]");
console.log(recordList, "recordList"); console.log(recordList, "recordList");
for (let i = 0; i < recordList.length; i++) { for (let i = 0; i < recordList.length; i++) {
...@@ -22,6 +48,20 @@ export default { ...@@ -22,6 +48,20 @@ export default {
} }
}); });
}, },
getFilePath() {
return new Promise((resolve) => {
plus.io.requestFileSystem(plus.io.PRIVATE_DOC, function (fs) {
resolve(fs.root.fullPath);
});
});
},
setTimeoutResult() {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(getResult);
}, 1000);
});
},
/**上传记录*/ /**上传记录*/
async handleRerord(val) { async handleRerord(val) {
let recordList = JSON.parse(uni.$storage.get("recordList") || "[]"); let recordList = JSON.parse(uni.$storage.get("recordList") || "[]");
...@@ -31,14 +71,38 @@ export default { ...@@ -31,14 +71,38 @@ export default {
let recordUrlList = val.recordUrlList; let recordUrlList = val.recordUrlList;
// 上传失败的记录 // 上传失败的记录
for (let i of recordUrlList) { for (let i of recordUrlList) {
console.log(i.status == UPLOAD_STATUS.fail);
if (i.status == UPLOAD_STATUS.fail) { if (i.status == UPLOAD_STATUS.fail) {
const filePath = i.file; const filePath = i.file.split("/").pop();
console.log(filePath, "filePath"); const { lsaccessKeySecret, securityToken, lsaccessKeyId } =
const result = await this.checkFileUpload(filePath); await getOssToken();
if (!(result instanceof Error)) { console.log(lsaccessKeySecret, securityToken, lsaccessKeyId);
i.status = UPLOAD_STATUS.success; const rootPath = await this.getFilePath();
i.file = result; wv.evalJS(
`msgFromUniapp('${lsaccessKeyId}','${lsaccessKeySecret}','${securityToken}','${filePath}','file://${rootPath}uniapp_save/')`
);
for (let k = 0; k < 100; k++) {
const result = await this.setTimeoutResult();
if (result) {
if (result.detail.data[0].code == 0) {
uni.removeSavedFile({
filePath: i.file,
complete: function (res) {
console.log(res);
},
});
i.status = UPLOAD_STATUS.success;
i.file = config.OSS_DOMAIN + "/" + config.FOLDER + filePath;
}
getResult = "";
break;
}
} }
// const result = await this.checkFileUpload(filePath);
// if (!(result instanceof Error)) {
// i.status = UPLOAD_STATUS.success;
// i.file = result;
// }
} }
} }
// 判断是否全部上传成功 // 判断是否全部上传成功
...@@ -60,7 +124,7 @@ export default { ...@@ -60,7 +124,7 @@ export default {
let errorMsg = ""; let errorMsg = "";
while (attempt < 2) { while (attempt < 2) {
try { try {
const result = await upload(tempFilePath); const result = await uploadFile(tempFilePath);
// 上传成功 // 上传成功
return result; return result;
} catch (error) { } catch (error) {
......
...@@ -22,13 +22,7 @@ ...@@ -22,13 +22,7 @@
"disableSwipeBack": true "disableSwipeBack": true
} }
}, },
{
"path": "pages/equity/informationEntry",
"style": {
"navigationBarTitleText": "信息录入",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/equity/detail/detail", "path": "pages/equity/detail/detail",
"style": { "style": {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-06-20 11:32:52 * @Date: 2024-06-20 11:32:52
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-06-24 11:10:47 * @LastEditTime: 2024-06-26 16:28:12
--> -->
<template> <template>
<view class="layout" @click.prevent="touch"> <view class="layout" @click.prevent="touch">
...@@ -301,11 +301,16 @@ export default { ...@@ -301,11 +301,16 @@ export default {
.item-text { .item-text {
position: absolute; position: absolute;
left: 24rpx; left: 0;
bottom: 24rpx; bottom: 0;
font-size: 30rpx; font-size: 30rpx;
color: #ffffff; color: #ffffff;
line-height: 44rpx; width: 100%;
height: 122rpx;
padding: 44rpx 22rpx 22rpx;
background-image: linear-gradient(180deg, #00000000 0%, #000000 100%);
border-radius: 0 0 24rpx 24rpx;
line-height: 66rpx;
} }
.details-container { .details-container {
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="end-text" v-if="historyList.length > 0 && isEnd">我是一个有底线的人</view>
</scroll-view> </scroll-view>
</template> </template>
<template v-else> <template v-else>
...@@ -39,7 +40,7 @@ ...@@ -39,7 +40,7 @@
<view class="no-data-text">暂无数据</view> <view class="no-data-text">暂无数据</view>
</view> </view>
</template> </template>
<view class="end-text" v-if="historyList.length > 0 && isEnd">我是一个有底线的人</view>
</view> </view>
</template> </template>
...@@ -55,7 +56,10 @@ export default { ...@@ -55,7 +56,10 @@ export default {
data() { data() {
return { return {
historyList: [], historyList: [],
isEnd: false isEnd: false,
currentPage: 1,
shopMerchantId: '',
goodsName: 'M5'
} }
}, },
watch: { watch: {
...@@ -108,6 +112,7 @@ export default { ...@@ -108,6 +112,7 @@ export default {
}, },
pageonReachBottom() { pageonReachBottom() {
console.log('xiala ') console.log('xiala ')
this.getQuotationList(false, true)
}, },
// 脱敏 // 脱敏
nameHide(name) { nameHide(name) {
...@@ -213,9 +218,10 @@ export default { ...@@ -213,9 +218,10 @@ export default {
} }
} }
.end-text { .end-text {
width: 100%;
color: #999; color: #999;
text-align: center; text-align: center;
margin: 50rpx 0; padding: 50rpx 0;
} }
.no-data { .no-data {
position: absolute; position: absolute;
......
<template>
<view class="layout">
<view class="bg">
<!-- <image src="../../../assets/images/media/bg-6.webp" /> -->
</view>
<view class="content">
<view class="title">{{ title || "历史成交记录" }}</view>
<template v-if="list.length && shopMerchantId">
<Tabs :list="list" @tabclick="tabclick" ref="tabs" />
</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
v-if="item.ownerGender"
:class="[
'sex-avatar sprite-icon',
`icon-${sexType[item.ownerGender]}`,
]"
></view>
</view>
<view class="goods-name">{{ item.goodsName }}</view>
<view class="card-info">
<view>车架号</view>
<view>{{ item.carVin || "-" }}</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>
<view
:class="[
'pay-type sprite-icon',
`icon-${payType[item.payType]}`,
]"
></view>
</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>
</view>
</template>
<script type="text/ecmascript-6">
import utils from '@/utils/utils';
import Tabs from './Tabs.vue';
export default {
name: 'Media_6',
props: {
show: Boolean,
title: String
},
components: { Tabs },
data () {
return {
list: [
{
tabName: '问界 M5',
value: 'M5'
},
{
tabName: '问界 M7',
value: 'M7'
},
{
tabName: '问界 M9',
value: 'M9'
}
],
historyList: [],
payType: {
1: 'icon-weixin',
2: 'icon-shop'
},
sexType: {
'男': 'icon-male',
'女': 'icon-female'
},
goodsName: 'M5',
shopMerchantId: '',
currentPage: 1,
isEnd: false
}
},
watch: {
show (n) {
if (n) this.init()
},
watchStatus: {
immediate: true,
handler (newval) {
this.$refs?.tabs?.tabClick(0)
}
},
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
},
mounted () {
if (this.show) this.init()
// const { shopMerchantId } = uni.$storage.get("userInfo");
// this.shopMerchantId = shopMerchantId
// this.getQuotationList();
},
methods: {
format (dateTimeStr) {
return utils.convertDateTimeFormat(dateTimeStr, '/')
},
accDiv (val) {
return utils.accDiv(val, 100)
},
init () {
const { shopMerchantId } = uni.$storage.get("userInfo");
this.shopMerchantId = shopMerchantId
this.getQuotationList();
},
async getQuotationList (isSwitch = false, next = false) {
const { goodsName, shopMerchantId, currentPage } = this
if (next) this.currentPage++
const data = await uni.$api.commonApi.getQuotationList({
currentPage,
pageSize: 18,
merchantId: shopMerchantId,
orderStatus: 3,
goodsName
})
if (isSwitch) {
this.historyList = data.list
this.isEnd = false
} else {
if (data.list.length > 0) {
this.historyList = this.historyList.concat(data.list)
this.isEnd = false
} else {
if (this.historyList.length > 9) this.isEnd = true
}
}
},
tabclick (index) {
this.goodsName = this.list[index].value
this.currentPage = 1
this.getQuotationList(true)
},
// 脱敏
nameHide (name) {
return name.substring(0, 1) + '**';
// if (name.length == 2) {
// name = name.substring(0, 1) + '*'; // 截取name 字符串截取第一个字符,
// return name; // 张三显示为张*
// } else if (name.length == 3) {
// name = name.substring(0, 1) + '*' + name.substring(2, 3); // 截取第一个和第三个字符
// return name; // 李思思显示为李*思
// } else if (name.length > 3) {
// name = name.substring(0, 1) + '*' + '*' + name.substring(3, name.length); // 截取第一个和大于第4个字符
// return name; // 王五哈哈显示为王**哈
// }
}
}
}
</script>
<style scoped lang="scss">
.layout {
padding-top: 192rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 240rpx;
image {
width: 100%;
height: 100%;
}
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-size: 40rpx;
line-height: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
.card-list {
position: relative;
margin: 0 72rpx;
display: grid;
grid-template-columns: repeat(3, 664rpx);
grid-template-rows: 0fr;
justify-content: center;
grid-gap: 32rpx;
min-height: calc(100vh - 416rpx);
.card-item {
margin: 16rpx auto;
padding: 24rpx 40rpx;
width: 664rpx;
// height: 440rpx;
background: #ffffff;
border: 2rpx solid #dce0e6;
border-radius: 16rpx;
height: 448rpx;
.name {
display: flex;
align-items: center;
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
margin-bottom: 16rpx;
.sex-avatar {
width: 32rpx;
height: 32rpx;
margin-left: 8rpx;
}
}
.goods-name {
margin-bottom: 16rpx;
font-weight: 500;
font-size: 32rpx;
color: #2c66f7;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.card-info {
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #999999;
line-height: 32rpx;
margin-bottom: 16rpx;
.pay-type {
width: 32rpx;
height: 32rpx;
}
.price {
font-weight: 600;
font-size: 36rpx;
color: #14cc68;
}
}
}
}
}
}
.end-text {
color: #999;
text-align: center;
margin: 50rpx 0;
}
.no-data {
position: absolute;
left: 50%;
top: 30%;
transform: translate(-50%, -50%);
&-img {
width: 640rpx;
height: 272rpx;
}
&-text {
font-size: 32rpx;
color: #999999;
text-align: center;
margin-top: 24rpx;
}
}
</style>
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
'问界M7': 1, '问界M7': 1,
'问界M9': 2 '问界M9': 2
}[this.customerInfo.carModel] }[this.customerInfo.carModel]
return this.carTypeList[name || 0] return this.carTypeList[name || 0].url
} }
}, },
methods: { methods: {
......
...@@ -6,7 +6,20 @@ ...@@ -6,7 +6,20 @@
* @LastEditTime: 2024-04-18 11:24:22 * @LastEditTime: 2024-04-18 11:24:22
--> -->
<template> <template>
<view class="information-entry"> <view class="information-entry" v-if="showPayPage">
<view class="nav-bar">
<view
class="back"
@click="$emit('update:showPayPage', false)"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
<view class="title">信息录入</view>
</view>
<view class="information-tips">建议同步采集凭证,若接待工作繁忙可在提单环节再进行补充。</view> <view class="information-tips">建议同步采集凭证,若接待工作繁忙可在提单环节再进行补充。</view>
<view class="information-box"> <view class="information-box">
<view <view
...@@ -50,24 +63,11 @@ ...@@ -50,24 +63,11 @@
</view> </view>
<view <view
class="information-done" class="information-done"
@click="done()" @click="$emit('finish')"
>完成接待</view> >完成接待</view>
<!-- <uni-popup ref="preview" type="center" border-radius="10px 10px 0 0"> <!-- <uni-popup ref="preview" type="center" border-radius="10px 10px 0 0">
<image class="preview-img" :src="previewImg" mode="aspectFit" /> <image class="preview-img" :src="previewImg" mode="aspectFit" />
</uni-popup> --> </uni-popup> -->
<MessageBox
ref="tipBox"
@cancel="tipCancel"
@confirm="tipConfirm"
content="系统检测到您在当前页面停留较久,是否仍在客户接待中?"
cancelBtnText="否"
confirmBtnText="是"
></MessageBox>
<finish-step
ref="stepRef"
@submit="submit"
/>
<update-box />
</view> </view>
</template> </template>
<script> <script>
...@@ -88,12 +88,11 @@ const INFO_LIST = [ ...@@ -88,12 +88,11 @@ const INFO_LIST = [
title: "客户延保合同", title: "客户延保合同",
}, },
]; ];
import myClick from "@/mixin/click";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import FinishStep from "@/components/FinishStep.vue";
export default { export default {
components: { FinishStep }, props: {
mixins: [myClick], showPayPage: Boolean
},
data () { data () {
return { return {
infoList: JSON.parse(JSON.stringify(INFO_LIST)), infoList: JSON.parse(JSON.stringify(INFO_LIST)),
...@@ -101,19 +100,13 @@ export default { ...@@ -101,19 +100,13 @@ export default {
isPreview: false, isPreview: false,
}; };
}, },
onLoad (options) {
const text = options.text;
uni.setNavigationBarTitle({
title: text,
});
},
watch: { watch: {
watchBooksList: { watchBooksList: {
immediate: true, immediate: true,
handler (newValue) { handler (newValue) {
console.log(newValue,'===') console.log(newValue, '===')
if(newValue.length) this.infoList = newValue if (newValue.length) this.infoList = newValue
else this.infoList = JSON.parse(JSON.stringify(INFO_LIST)) else this.infoList = JSON.parse(JSON.stringify(INFO_LIST))
}, },
} }
}, },
...@@ -122,14 +115,6 @@ export default { ...@@ -122,14 +115,6 @@ export default {
return this.$store.state.audio.booksList return this.$store.state.audio.booksList
} }
}, },
onBackPress () {
// this.infoList = this.infoList.map((item) => {
// if (item.imgUrl) {
// delete item.imgUrl;
// }
// return item;
// });
},
methods: { methods: {
...mapMutations("audio", ["setBooks"]), ...mapMutations("audio", ["setBooks"]),
// 上传图 // 上传图
...@@ -168,20 +153,6 @@ export default { ...@@ -168,20 +153,6 @@ export default {
this.infoList[index].imgUrl = '' this.infoList[index].imgUrl = ''
this.setBooks(utils.deepClone(this.infoList)) this.setBooks(utils.deepClone(this.infoList))
}, },
// 完成接待按钮
done () {
this.$refs.stepRef.open();
},
submit () {
this.$refs.stepRef.close();
this.stopAudio();
// this.infoList = INFO_LIST.map((item) => delete item.imgUrl);
setTimeout(() => {
uni.reLaunch({
url: "/pages/equity/index",
});
}, 1500);
},
// 预览图片 // 预览图片
preview (index) { preview (index) {
this.isPreview = true; this.isPreview = true;
...@@ -214,6 +185,33 @@ export default { ...@@ -214,6 +185,33 @@ export default {
position: relative; position: relative;
background-color: #fff; background-color: #fff;
height: 100vh; height: 100vh;
z-index: 998;
box-sizing: border-box;
padding-top: 72px;
.nav-bar {
position: fixed;
width: 100%;
height: 96rpx;
left: 0;
top: 48rpx;
z-index: 9;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
}
}
.information-tips { .information-tips {
background: rgba(44, 102, 247, 0.1); background: rgba(44, 102, 247, 0.1);
color: #2c66f7; color: #2c66f7;
......
...@@ -163,9 +163,10 @@ export default { ...@@ -163,9 +163,10 @@ export default {
// delta: 1, // delta: 1,
// }); // });
// this.stopAudio(); // this.stopAudio();
uni.navigateTo({ // uni.navigateTo({
url: `/pages/equity/informationEntry`, // url: `/pages/equity/informationEntry`,
}); // });
this.$emit('jumpPay')
this.close(); this.close();
}, },
}, },
......
...@@ -60,35 +60,42 @@ ...@@ -60,35 +60,42 @@
<view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view> <view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view>
</view> </view>
</template> </template>
<pay-pop ref="pay"></pay-pop> <pay-pop
ref="pay"
@jumpPay="showPayPage = true"
></pay-pop>
<finish-step <finish-step
ref="stepRef" ref="stepRef"
@submit="done" @submit="done"
/> />
<informationEntry
:showPayPage.sync="showPayPage"
@finish="open"
/>
</view> </view>
</template> </template>
<script> <script>
import ToolBox from "@/components/ToolBox.vue"; import ToolBox from "@/components/ToolBox.vue";
import Reception from "./components/Reception.vue"; import Reception from "./components/Reception.vue";
import MediaComponent from "./components/MediaComponent.vue"; import MediaComponent from "./components/MediaComponent.vue";
import Media_6 from "./components/Media_6.vue";
import History from "./components/History.vue"; import History from "./components/History.vue";
import ThreeGuarantees from "./components/ThreeGuarantees.vue"; import ThreeGuarantees from "./components/ThreeGuarantees.vue";
import Guarantee from './components/Guarantee.vue'; import Guarantee from './components/Guarantee.vue';
import payPop from "./components/payPop.vue"; import payPop from "./components/payPop.vue";
import FinishStep from '@/components/FinishStep.vue'; import FinishStep from '@/components/FinishStep.vue';
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import informationEntry from './components/informationEntry.vue'
export default { export default {
components: { components: {
ToolBox, ToolBox,
Reception, Reception,
MediaComponent, MediaComponent,
Media_6,
payPop, payPop,
FinishStep, FinishStep,
Guarantee, Guarantee,
History, History,
ThreeGuarantees ThreeGuarantees,
informationEntry
}, },
props: { props: {
id: [String, Number], id: [String, Number],
...@@ -105,7 +112,8 @@ export default { ...@@ -105,7 +112,8 @@ export default {
startX: null, startX: null,
startY: null, startY: null,
screenWidth: null, screenWidth: null,
scaleValueObject: {} scaleValueObject: {},
showPayPage: false
}; };
}, },
computed: { computed: {
...@@ -155,6 +163,7 @@ export default { ...@@ -155,6 +163,7 @@ export default {
this.$emit('back') this.$emit('back')
}, },
done (e) { done (e) {
this.showPayPage = false
this.$refs.toolRef.hide() this.$refs.toolRef.hide()
this.$refs.stepRef.close() this.$refs.stepRef.close()
this.$emit('done', e) this.$emit('done', e)
...@@ -183,7 +192,7 @@ export default { ...@@ -183,7 +192,7 @@ export default {
isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 3, isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 3,
index = toolList.findIndex(item => item.id == id) index = toolList.findIndex(item => item.id == id)
if (Math.abs(this.startY - touch.pageY) > 100) return if (Math.abs(this.startY - touch.pageY) > 100) return
if(!scaleValueObject[id]) scaleValueObject[id] = 1 if (!scaleValueObject[id]) scaleValueObject[id] = 1
if (isDistanceSignificant && index != -1 && scaleValueObject[id] == 1) { if (isDistanceSignificant && index != -1 && scaleValueObject[id] == 1) {
const nextId = this.getNextId(index, toolList, startX, halfScreenWidth) const nextId = this.getNextId(index, toolList, startX, halfScreenWidth)
this.$emit('update:id', nextId) this.$emit('update:id', nextId)
...@@ -199,8 +208,8 @@ export default { ...@@ -199,8 +208,8 @@ export default {
return index === 0 ? toolList[toolList.length - 1].id : toolList[index - 1].id; return index === 0 ? toolList[toolList.length - 1].id : toolList[index - 1].id;
} }
}, },
scale(e){ scale (e) {
let {id} = this let { id } = this
this.scaleValueObject[id] = e this.scaleValueObject[id] = e
} }
}, },
......
...@@ -100,7 +100,16 @@ const getPolicyBase64 = function () { ...@@ -100,7 +100,16 @@ const getPolicyBase64 = function () {
const policyBase64 = base64.encode(JSON.stringify(policyText)); const policyBase64 = base64.encode(JSON.stringify(policyText));
return policyBase64; return policyBase64;
}; };
const getOssToken = async function () {
console.log("getOssToken");
const { lsaccessKeySecret, securityToken, lsaccessKeyId } =
await uni.$api.commonApi.getToken({});
return {
lsaccessKeySecret,
securityToken,
lsaccessKeyId,
};
};
// 生成签名 // 生成签名
const getSignature = function (policyBase64) { const getSignature = function (policyBase64) {
return new Promise(async (reslove) => { return new Promise(async (reslove) => {
...@@ -144,4 +153,4 @@ const getSignature = function (policyBase64) { ...@@ -144,4 +153,4 @@ const getSignature = function (policyBase64) {
}); });
}; };
module.exports = uploadFile; module.exports = { uploadFile, getOssToken };
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!