Commit 722689bc by 胡悦

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

2 parents fc7c4fbe 7d443748
......@@ -50,15 +50,16 @@ const imgToBase64 = (list, urlKey) => {
let arr = [],
newList = JSON.parse(JSON.stringify(list))
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({
url: urlKey ? e[urlKey] : e,
method: 'GET',
responseType: 'arraybuffer',
success: (res) => {
const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}`
if (urlKey) newList[index][urlKey] = base64
else newList[index] = base64
newList[index][urlKey] = base64
newList[index][`original_${urlKey}`] = e[urlKey]
arr.push(e)
if (arr.length === list.length) resolve(newList)
},
......
<template>
<cover-view class="webview-container">
<web-view
@message="handlerMessage"
ref="webview"
src="/hybrid/html/index.html"
></web-view>
</cover-view>
</template>
<script>
export default {
data() {
return {};
},
};
</script>
<style></style>
import WebView from "./WebView";
export default {
install(Vue, options) {
// 添加 Vue 实例方法
Vue.prototype.$webView = function (el) {
// 创建组件构造函数
const Constructor = Vue.extend(WebView);
// 创建组件实例
const instance = new Constructor();
// 手动挂载组件到元素
instance.$mount();
// 插入到页面中
el.appendChild(instance.$el);
};
},
};
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>file upload oss</title>
</head>
<body>
<script src="js/uni.webview.1.5.5.js"></script>
<script src="js/aliyun-oss-sdk-6.18.1.min.js"></script>
<script src="js/OSSUpLoader.js"></script>
<script>
// document.addEventListener('UniAppJSBridgeReady', function(){
window.msgFromUniapp = function(accessKeyId, accessKeySecret, stsToken, fileName, options = {}) {
if (!accessKeyId || !accessKeySecret || !stsToken || !fileName) {
throw new Error('accessKeyId,accessKeySecret,stsToken,fileName is required')
}
const opt = Object.assign({ accessKeyId,accessKeySecret,stsToken }, options)
let uploader = new OSSUpLoader(opt)
uploader.upload(fileName, function(result) {
uni.postMessage({
data: {
...result,
fileName
}
});
uploader.destroy()
uploader = null
})
}
// }, false);
</script>
</body>
</html>
\ No newline at end of file
class OSSUpLoader {
/**
* yourRegion填写Bucket所在地域。以华东1(杭州)为例,yourRegion填写为oss-cn-hangzhou。
*/
region = "oss-cn-shenzhen";
/**
* 填写Bucket名称。
*/
bucket = 'glsk-oss';
/**
* 文件类型
*/
mime = "audio/mpeg";
/**
* 本地保存文件路径(待上传文件路径)
*/
filePath = 'file:///storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/doc/'
/**
* 从STS服务获取的临时访问密钥(AccessKey ID和AccessKey Secret)。
*/
accessKeyId;
/**
* 从STS服务获取的安全令牌(SecurityToken)。
*/
accessKeySecret;
/**
* 从STS服务获取的安Token。
*/
stsToken;
/**
* OSS 文件上传实例
*/
client = null;
/**
* 上传并发数
*/
parallel = 4;
/**
* 设置分片大小。500kb。
*/
partSize = 500;
/**
* 最小文件大小
*/
minPartSize = 100;
/**
* 超时时间:默认60s
*/
timeout = 60 * 1000;
// headers,
/**
* 自定义元数据,通过HeadObject接口可以获取Object的元数据。
*/
meta = {};
/**
* 初始化重传次数
*/
retryCount = 0;
/**
* 失败重传次数
*/
retryCountMax = 3;
/**
* 失败重传间隔
*/
retryInterval = 3 * 1000
currentCheckpoint;
/**
* OSS文件夹
*/
ossFolder='quality/';
/**
* 构造函数
*/
constructor({
region = this.region,
bucket = this.bucket,
accessKeyId,
accessKeySecret,
stsToken,
mime = this.mime,
partSize = this.partSize,
parallel = this.parallel,
timeout = this.timeout,
filePath = this.filePath,
retryCountMax = this.retryCountMax,
retryInterval = this.retryInterval,
ossFolder = this.ossFolder
}) {
if (partSize && partSize < this.minPartSize) {
throw new Error(common.constants.CODE.FILE_PART_SIZE_TOO_SMALL)
}
this.mime = mime
this.partSize = partSize
this.parallel = parallel
this.filePath = filePath
this.retryCountMax = retryCountMax
this.retryInterval = retryInterval
this.ossFolder = ossFolder
//实例化OSS
this.client = new OSS({
region,
bucket,
accessKeyId,
accessKeySecret,
stsToken,
});
}
/**文件上传函数(外部调用)
* @param {Object} fileName 文件名
* @param {Object} callback 回调函数
*/
upload(fileName, callback) {
this._pathToFile(this.filePath + fileName, function(result) {
if (result.code === common.constants.CODE.FILE_PATH_TRANSFORM_SUCCESS) {
this._upload(fileName, result.data.file, callback)
} else {
callback(result)
}
}.bind(this))
}
/**文件上传(内部方法)
* @param {Object} fileName 文件名
* @param {Object} file 文件
* @param {Object} callback 回调函数
*/
_upload(fileName, file, callback) {
this.client.multipartUpload(this.ossFolder+fileName, file, {
// 获取分片上传进度、断点和返回值。
progress: (p, checkpoint, res) => {
this.currentCheckpoint = checkpoint;
console.log(p);
},
// 设置并发上传的分片数量。
parallel: this.parallel,
//分片大小(kb) 最小为100kb 默认500kb
partSize: 1024 * this.partSize,
timeout: this.timeout,
mime: this.mime,
}).then((res) => {
// console.log(JSON.stringify(res),res.status,res.status==200)
if (res.res.statusCode == 200) {
// console.log('upload success: %j', JSON.stringify(res));
this.currentCheckpoint = null;
this.retryCount = 0
callback(common.genCallBacks('FILE_UPLOAD_OSS_SUCCESS', {
errFromOSS: res
}))
} else {
callback(common.genCallBacks('FILE_UPLOAD_OSS_FAIL', {
errMsg: `OSS返回错误 状态码: ${res.status}`,
errFromOSS: res
}))
}
}).catch(err => {
console.error(err);
console.log(`err.name : ${err.name}`);
console.log(`err.message : ${err.message}`);
// if (err.name.toLowerCase().indexOf('connectiontimeout') !== -1) {
// timeout retry
if (this.retryCount < this.retryCountMax) {
this.retryCount++;
console.error(`retryCount : ${this.retryCount}`);
setTimeout(() => {
this._upload(fileName, file, callback);
}, this.retryInterval)
} else {
callback(common.genCallBacks('FILE_UPLOAD_OSS_TIMEOUT_OR_OTHER', {
errMsg: err.message,
err
}))
}
// }
})
}
/**将文件路径转成文件对象
* @param {Object} filePath 文件路径
* @param {Object} callback 回调函数
*/
_pathToFile(filePath, callback) {
window.webkitURL = window.webkitURL || window.URL;
var xhr = new XMLHttpRequest();
xhr.open("GET", filePath, true);
xhr.responseType = "blob";
xhr.onload = function() {
if (this.status == 200) {
var file = this.response
callback(common.genCallBacks('FILE_PATH_TRANSFORM_SUCCESS', {
file
}))
} else {
callback(common.genCallBacks('FILE_PATH_TRANSFORM_FAIL'))
}
};
xhr.onerror = function(errType, errMsg) {
callback(common.genCallBacks('FILE_PATH_REQUEST_FAIL', {
errType,
errMsg
}))
};
xhr.send();
}
destroy(){
this.retryCount = 0
this.client = null
}
};
const common = {
constants: {
CODE: {
FILE_PATH_TRANSFORM_SUCCESS: 0,
FILE_PATH_REQUEST_FAIL: 1,
FILE_PATH_TRANSFORM_FAIL: 2,
FILE_UPLOAD_OSS_SUCCESS: 0,
FILE_UPLOAD_OSS_FAIL: 3,
FILE_UPLOAD_OSS_TIMEOUT_OR_OTHER: 4
},
MESSAGE: {
FILE_PATH_TRANSFORM_SUCCESS: '文件转换成功',
FILE_PATH_REQUEST_FAIL: '文件转换请求失败',
FILE_PATH_TRANSFORM_FAIL: '文件转换失败',
FILE_UPLOAD_OSS_SUCCESS: '文件上传至OSS成功',
FILE_UPLOAD_OSS_FAIL: '文件上传至OSS失败',
FILE_UPLOAD_OSS_TIMEOUT_OR_OTHER: '文件上传至OSS超时或其他错误',
FILE_PART_SIZE_TOO_SMALL:'分片大小不能小于100kb'
}
},
genCallBacks(key, data = {}) {
const {
CODE,
MESSAGE
} = common.constants
return {
code: CODE[key],
message: MESSAGE[key],
data
}
}
}
\ No newline at end of file
This diff could not be displayed because it is too large.
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).uni=n()}(this,(function(){"use strict";try{var e={};Object.defineProperty(e,"passive",{get:function(){!0}}),window.addEventListener("test-passive",null,e)}catch(e){}var n=Object.prototype.hasOwnProperty;function i(e,i){return n.call(e,i)}var t=[];function o(){return window.__dcloud_weex_postMessage||window.__dcloud_weex_}function a(){return window.__uniapp_x_postMessage||window.__uniapp_x_}var r=function(e,n){var i={options:{timestamp:+new Date},name:e,arg:n};if(a()){if("postMessage"===e){var r={data:n};return window.__uniapp_x_postMessage?window.__uniapp_x_postMessage(r):window.__uniapp_x_.postMessage(JSON.stringify(r))}var d={type:"WEB_INVOKE_APPSERVICE",args:{data:i,webviewIds:t}};window.__uniapp_x_postMessage?window.__uniapp_x_postMessageToService(d):window.__uniapp_x_.postMessageToService(JSON.stringify(d))}else if(o()){if("postMessage"===e){var s={data:[n]};return window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessage(s):window.__dcloud_weex_.postMessage(JSON.stringify(s))}var w={type:"WEB_INVOKE_APPSERVICE",args:{data:i,webviewIds:t}};window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessageToService(w):window.__dcloud_weex_.postMessageToService(JSON.stringify(w))}else{if(!window.plus)return window.parent.postMessage({type:"WEB_INVOKE_APPSERVICE",data:i,pageId:""},"*");if(0===t.length){var u=plus.webview.currentWebview();if(!u)throw new Error("plus.webview.currentWebview() is undefined");var g=u.parent(),v="";v=g?g.id:u.id,t.push(v)}if(plus.webview.getWebviewById("__uniapp__service"))plus.webview.postMessageToUniNView({type:"WEB_INVOKE_APPSERVICE",args:{data:i,webviewIds:t}},"__uniapp__service");else{var c=JSON.stringify(i);plus.webview.getLaunchWebview().evalJS('UniPlusBridge.subscribeHandler("'.concat("WEB_INVOKE_APPSERVICE",'",').concat(c,",").concat(JSON.stringify(t),");"))}}},d={navigateTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("navigateTo",{url:encodeURI(n)})},navigateBack:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.delta;r("navigateBack",{delta:parseInt(n)||1})},switchTab:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("switchTab",{url:encodeURI(n)})},reLaunch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("reLaunch",{url:encodeURI(n)})},redirectTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("redirectTo",{url:encodeURI(n)})},getEnv:function(e){a()?e({uvue:!0}):o()?e({nvue:!0}):window.plus?e({plus:!0}):e({h5:!0})},postMessage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r("postMessage",e.data||{})}},s=/uni-app/i.test(navigator.userAgent),w=/Html5Plus/i.test(navigator.userAgent),u=/complete|loaded|interactive/;var g=window.my&&navigator.userAgent.indexOf(["t","n","e","i","l","C","y","a","p","i","l","A"].reverse().join(""))>-1;var v=window.swan&&window.swan.webView&&/swan/i.test(navigator.userAgent);var c=window.qq&&window.qq.miniProgram&&/QQ/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var p=window.tt&&window.tt.miniProgram&&/toutiaomicroapp/i.test(navigator.userAgent);var _=window.wx&&window.wx.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var m=window.qa&&/quickapp/i.test(navigator.userAgent);var f=window.ks&&window.ks.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var l=window.tt&&window.tt.miniProgram&&/Lark|Feishu/i.test(navigator.userAgent);var E=window.jd&&window.jd.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var x=window.xhs&&window.xhs.miniProgram&&/xhsminiapp/i.test(navigator.userAgent);for(var S,h=function(){window.UniAppJSBridge=!0,document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady",{bubbles:!0,cancelable:!0}))},y=[function(e){if(s||w)return window.__uniapp_x_postMessage||window.__uniapp_x_||window.__dcloud_weex_postMessage||window.__dcloud_weex_?document.addEventListener("DOMContentLoaded",e):window.plus&&u.test(document.readyState)?setTimeout(e,0):document.addEventListener("plusready",e),d},function(e){if(_)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.wx.miniProgram},function(e){if(c)return window.QQJSBridge&&window.QQJSBridge.invoke?setTimeout(e,0):document.addEventListener("QQJSBridgeReady",e),window.qq.miniProgram},function(e){if(g){document.addEventListener("DOMContentLoaded",e);var n=window.my;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(v)return document.addEventListener("DOMContentLoaded",e),window.swan.webView},function(e){if(p)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(m){window.QaJSBridge&&window.QaJSBridge.invoke?setTimeout(e,0):document.addEventListener("QaJSBridgeReady",e);var n=window.qa;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(f)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.ks.miniProgram},function(e){if(l)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(E)return window.JDJSBridgeReady&&window.JDJSBridgeReady.invoke?setTimeout(e,0):document.addEventListener("JDJSBridgeReady",e),window.jd.miniProgram},function(e){if(x)return window.xhs.miniProgram},function(e){return document.addEventListener("DOMContentLoaded",e),d}],M=0;M<y.length&&!(S=y[M](h));M++);S||(S={});var P="undefined"!=typeof uni?uni:{};if(!P.navigateTo)for(var b in S)i(S,b)&&(P[b]=S[b]);return P.webView=S,P}));
......@@ -16,7 +16,9 @@ import GlsxImage from "./components/GlsxImage";
import MessageBox from "./components/MessageBox/index";
import wnCanvas from "./components/Canvas/wn-canvas";
import UpdateBox from "./components/UpdateBox";
import webView from "./components/WebView";
import utils from "./utils/utils";
Vue.use(webView);
Vue.component("GlsxImage", GlsxImage);
Vue.component("MessageBox", MessageBox);
Vue.component("wnCanvas", wnCanvas);
......
......@@ -13,7 +13,6 @@ const UPLOAD_STATUS = {
success: 1,
fail: 2,
};
import upload from "@/utils/ossUploadFile/uploadFile.js";
import { mapMutations, mapState } from "vuex";
import utils from "@/utils/utils.js";
export default {
......@@ -162,14 +161,19 @@ export default {
},
/**保存记录*/
saveRecord() {
const recordUrlList = this.audioInfo.audioList;
const recordUrlList = this.audioInfo.audioList.map((i) => {
return {
status: UPLOAD_STATUS.fail,
file: i,
};
});
let recordList = JSON.parse(uni.$storage.get("recordList") || "[]");
recordList = [
...recordList,
{
...this.getParams(),
recordUrlList,
},
...recordList,
];
uni.$storage.set("recordList", JSON.stringify(recordList));
},
......@@ -221,7 +225,7 @@ export default {
if (this.times >= this.timeout) {
this.$refs.tipBox?.open();
}
if (this.times >= this.reaction + this.timeout) {
if (this.times >= this.timeout) {
//结束接待
this.tipCancel();
clearInterval(this.timer);
......
......@@ -22,13 +22,7 @@
"disableSwipeBack": true
}
},
{
"path": "pages/equity/informationEntry",
"style": {
"navigationBarTitleText": "信息录入",
"enablePullDownRefresh": false
}
},
{
"path": "pages/equity/detail/detail",
"style": {
......
<template>
<view class="layout">
<view class="bg"></view>
<view
class="login"
:key="dateKey"
>
<view class="login" :key="dateKey">
<view class="title">登录</view>
<view class="sub-title">手机号码登录</view>
<view class="input">
......@@ -16,15 +13,8 @@
@blur="input($event, 'mobile')"
/>
<template v-if="mobile">
<view
class="icon"
@click="mobile = ''"
>
<icon
type="clear"
size="16"
color="#000"
> </icon>
<view class="icon" @click="mobile = ''">
<icon type="clear" size="16" color="#000"> </icon>
</view>
</template>
</view>
......@@ -37,31 +27,19 @@
@blur="input($event, 'code')"
/>
<template v-if="code">
<view
class="icon"
@click="code = ''"
>
<icon
type="clear"
size="16"
color="#000"
> </icon>
<view class="icon" @click="code = ''">
<icon type="clear" size="16" color="#000"> </icon>
</view>
</template>
<view
:class="['code-btn', `${count ? 'code-disabled' : ''}`]"
@click="getSmsCode"
>{{ count ? `重新发送(${count}s)` : "获取验证码" }}</view>
>{{ count ? `重新发送(${count}s)` : "获取验证码" }}</view
>
</view>
<button
class="btn"
@click="login"
>登录</button>
<button class="btn" @click="login">登录</button>
<view class="form-footer">
<view
class="autoLogin"
@click="readingStatus = !readingStatus"
>
<view class="autoLogin" @click="readingStatus = !readingStatus">
<uni-icons
:type="`${readingStatus ? 'checkbox-filled' : 'circle'}`"
:size="18"
......@@ -69,10 +47,7 @@
></uni-icons>
我已阅读并同意<text @click.stop="jumpUrl()">《用户隐私协议》</text>
</view>
<view
class="autoLogin"
@click="noSignIn = !noSignIn"
>
<view class="autoLogin" @click="noSignIn = !noSignIn">
<uni-icons
:type="`${noSignIn ? 'checkbox-filled' : 'circle'}`"
:size="18"
......
<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 {
'问界M7': 1,
'问界M9': 2
}[this.customerInfo.carModel]
return this.carTypeList[name || 0]
return this.carTypeList[name || 0].url
}
},
methods: {
......
......@@ -20,26 +20,40 @@
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/icon-car.webp"
/>
<view class="container">
<view class="left-tab" >
<view class="tab-item" v-for="item in list" :key="item.id" @click="tabChange(item)" :class="[item.id == activeIndex ? 'active' : '']">{{item.name}}</view>
<view class="left-tab">
<view
class="tab-item"
v-for="item in list"
:key="item.id"
@click="tabChange(item)"
:class="[item.id == activeIndex ? 'active' : '']"
>{{item.name}}</view>
</view>
<view class="content">
<template v-if="activeIndex == 2">
<image
:key="imgKey" :class="direction"
:key="imgKey"
:class="direction"
class="content-image"
:src="`https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/${list[activeIndex - 1].urlName}-${tabIndex}.webp`"
:src="viewsImg()"
/>
<view class="content-tab">
<view class="tab-item" @click="tabSwitch(1)"></view>
<view class="tab-item" @click="tabSwitch(2)"></view>
<view
class="tab-item"
@click="tabSwitch(1)"
></view>
<view
class="tab-item"
@click="tabSwitch(2)"
></view>
</view>
</template>
<template v-else>
<image
:key="imgKey" :class="direction"
:key="imgKey"
:class="direction"
class="content-image"
:src="`https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/${list[activeIndex - 1].urlName}.webp`"
:src="viewsImg()"
/>
</template>
</view>
......@@ -83,22 +97,29 @@ export default {
tabIndex: 1
}
},
mounted () {
},
methods: {
tabChange(item) {
tabChange (item) {
if (this.activeIndex === id) return
const { id } = item
this.direction = ''
console.log(id, this.activeIndex,' !!!!!!!!!!')
console.log(id, this.activeIndex, ' !!!!!!!!!!')
this.direction = id > this.activeIndex ? 'bottom' : 'top'
this.activeIndex = id
this.imgKey = Date.now()
},
tabSwitch(val) {
tabSwitch (val) {
console.log(val)
if (val == this.tabIndex) return
this.tabIndex = val
},
viewsImg () {
let { activeIndex, tabIndex } = this
if (activeIndex == 3) activeIndex = 4
if (activeIndex == 2) return this.views[tabIndex].detailUrl
return this.views[activeIndex - 1].detailUrl
}
}
}
......@@ -142,21 +163,21 @@ export default {
// justify-content: center;
width: 100%;
height: 312rpx;
background: #F2F5FF;
background: #f2f5ff;
border: 4rpx solid hsl(0, 80%, 100%);
box-shadow: inset 0 0 16rpx 0 #FFFFFF;
box-shadow: inset 0 0 16rpx 0 #ffffff;
border-radius: 32rpx;
margin-bottom: 48rpx;
font-weight: 500;
font-size: 40rpx;
color: #1A1A1A;
color: #1a1a1a;
&:last-child {
margin-bottom: 0;
}
&.active {
color: #fff;
background-image: linear-gradient(180deg, #6795FF 0%, #4A84F9 100%);
box-shadow: 16px 16px 24px 0 #849dc240, inset 0 0 16px 0 #FFFFFF;
background-image: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%);
box-shadow: 16px 16px 24px 0 #849dc240, inset 0 0 16px 0 #ffffff;
}
}
}
......
......@@ -6,7 +6,20 @@
* @LastEditTime: 2024-04-18 11:24:22
-->
<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-box">
<view
......@@ -50,24 +63,11 @@
</view>
<view
class="information-done"
@click="done()"
@click="$emit('finish')"
>完成接待</view>
<!-- <uni-popup ref="preview" type="center" border-radius="10px 10px 0 0">
<image class="preview-img" :src="previewImg" mode="aspectFit" />
</uni-popup> -->
<MessageBox
ref="tipBox"
@cancel="tipCancel"
@confirm="tipConfirm"
content="系统检测到您在当前页面停留较久,是否仍在客户接待中?"
cancelBtnText="否"
confirmBtnText="是"
></MessageBox>
<finish-step
ref="stepRef"
@submit="submit"
/>
<update-box />
</view>
</template>
<script>
......@@ -88,12 +88,11 @@ const INFO_LIST = [
title: "客户延保合同",
},
];
import myClick from "@/mixin/click";
import { mapMutations } from "vuex";
import FinishStep from "@/components/FinishStep.vue";
export default {
components: { FinishStep },
mixins: [myClick],
props: {
showPayPage: Boolean
},
data () {
return {
infoList: JSON.parse(JSON.stringify(INFO_LIST)),
......@@ -101,19 +100,13 @@ export default {
isPreview: false,
};
},
onLoad (options) {
const text = options.text;
uni.setNavigationBarTitle({
title: text,
});
},
watch: {
watchBooksList: {
immediate: true,
handler (newValue) {
console.log(newValue,'===')
if(newValue.length) this.infoList = newValue
else this.infoList = JSON.parse(JSON.stringify(INFO_LIST))
console.log(newValue, '===')
if (newValue.length) this.infoList = newValue
else this.infoList = JSON.parse(JSON.stringify(INFO_LIST))
},
}
},
......@@ -122,14 +115,6 @@ export default {
return this.$store.state.audio.booksList
}
},
onBackPress () {
// this.infoList = this.infoList.map((item) => {
// if (item.imgUrl) {
// delete item.imgUrl;
// }
// return item;
// });
},
methods: {
...mapMutations("audio", ["setBooks"]),
// 上传图
......@@ -168,20 +153,6 @@ export default {
this.infoList[index].imgUrl = ''
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) {
this.isPreview = true;
......@@ -214,6 +185,33 @@ export default {
position: relative;
background-color: #fff;
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 {
background: rgba(44, 102, 247, 0.1);
color: #2c66f7;
......
......@@ -163,9 +163,10 @@ export default {
// delta: 1,
// });
// this.stopAudio();
uni.navigateTo({
url: `/pages/equity/informationEntry`,
});
// uni.navigateTo({
// url: `/pages/equity/informationEntry`,
// });
this.$emit('jumpPay')
this.close();
},
},
......
......@@ -60,35 +60,42 @@
<view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view>
</view>
</template>
<pay-pop ref="pay"></pay-pop>
<pay-pop
ref="pay"
@jumpPay="showPayPage = true"
></pay-pop>
<finish-step
ref="stepRef"
@submit="done"
/>
<informationEntry
:showPayPage.sync="showPayPage"
@finish="open"
/>
</view>
</template>
<script>
import ToolBox from "@/components/ToolBox.vue";
import Reception from "./components/Reception.vue";
import MediaComponent from "./components/MediaComponent.vue";
import Media_6 from "./components/Media_6.vue";
import History from "./components/History.vue";
import ThreeGuarantees from "./components/ThreeGuarantees.vue";
import Guarantee from './components/Guarantee.vue';
import payPop from "./components/payPop.vue";
import FinishStep from '@/components/FinishStep.vue';
import { mapMutations } from "vuex";
import informationEntry from './components/informationEntry.vue'
export default {
components: {
ToolBox,
Reception,
MediaComponent,
Media_6,
payPop,
FinishStep,
Guarantee,
History,
ThreeGuarantees
ThreeGuarantees,
informationEntry
},
props: {
id: [String, Number],
......@@ -105,7 +112,8 @@ export default {
startX: null,
startY: null,
screenWidth: null,
scaleValueObject: {}
scaleValueObject: {},
showPayPage: false
};
},
computed: {
......@@ -155,6 +163,7 @@ export default {
this.$emit('back')
},
done (e) {
this.showPayPage = false
this.$refs.toolRef.hide()
this.$refs.stepRef.close()
this.$emit('done', e)
......@@ -183,7 +192,7 @@ export default {
isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 3,
index = toolList.findIndex(item => item.id == id)
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) {
const nextId = this.getNextId(index, toolList, startX, halfScreenWidth)
this.$emit('update:id', nextId)
......@@ -199,8 +208,8 @@ export default {
return index === 0 ? toolList[toolList.length - 1].id : toolList[index - 1].id;
}
},
scale(e){
let {id} = this
scale (e) {
let { id } = this
this.scaleValueObject[id] = e
}
},
......
......@@ -85,6 +85,7 @@ export default {
const mock_data = uni.$storage.get('mock_data') || {}
this.moduleList = mock_data.moduleList || []
this.toolList = mock_data.toolList || []
this.get_Vehicle_Sales_Data()
},
onShow () {
const userInfo = uni.$storage.get("userInfo")
......@@ -107,12 +108,24 @@ export default {
init () {
this.getSoure();
this.findPayInfo();
},
/**获取车型&销售数据 */
get_Vehicle_Sales_Data () {
const userInfo = uni.$storage.get("userInfo"),
storageCarBrandList = uni.$storage.get('carBrandList'),
storageEmployeeList = uni.$storage.get('employeeList'),
{ shopMerchantId } = userInfo
if (storageCarBrandList) this.$store.dispatch("setCarBrandsList", storageCarBrandList);
if (storageEmployeeList) this.$store.dispatch("setEmployeeList", storageEmployeeList);
/**获取销售人员 */
uni.$api.commonApi
.getEmployeeList({
merchantId: shopMerchantId,
})
.then((res) => {
this.$store.dispatch("setEmployeeList", res || []);
uni.$storage.set('employeeList', res || [])
});
/**获取品牌车型 */
uni.$api.commonApi
.getMerchantCarBrandList([shopMerchantId])
......@@ -139,24 +152,14 @@ export default {
}
})
}
})
/**获取销售人员 */
uni.$api.commonApi
.getEmployeeList({
merchantId: shopMerchantId,
})
.then((res) => {
this.$store.dispatch("setEmployeeList", res || []);
uni.$storage.set('employeeList', res || [])
});
},
// 查询素材
async getSoure () {
const { moduleList, toolList } = await uni.$api.systemApi.getMockData(true);
await moduleList.map(async e => {
if (e.receptionSourceDetailList) e.receptionSourceDetailList = await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList, 'detailUrl')
if (e.carTypeList) e.carTypeList = await uni.$api.systemApi.imgToBase64(e.carTypeList)
if (e.carTypeList) e.carTypeList = await uni.$api.systemApi.imgToBase64(e.carTypeList, 'url')
})
this.moduleList = moduleList
this.toolList = toolList
......
......@@ -15,9 +15,10 @@ export const STORAGE_OBJECTkEY = {
customerInfo: "customerInfo",
noSignInUuid: "noSignInUuid",
noviceGuideStatus: "noviceGuideStatus",
carBrandList:'carBrandList',
employeeList:'employeeList',
carBrandList: "carBrandList",
employeeList: "employeeList",
recordList: "recordList",
recordSuccessList: "recordSuccessList",
};
// export const IMG_VERSION = async () => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!