Commit 1104b2f7 by 前端

接待

1 parent 7d4d90fb
...@@ -11,25 +11,15 @@ module.exports = { ...@@ -11,25 +11,15 @@ module.exports = {
// 查询接待素材 // 查询接待素材
findSoureList() { findSoureList() {
return http.post({ return http.post({
<<<<<<< HEAD
method: "dj.api.smartcarlife.recepiton.soure.findSoureList", method: "dj.api.smartcarlife.recepiton.soure.findSoureList",
sessionId: "b5e0a471-a2cd-4020-a522-72bcd68d6da7",
=======
method: 'dj.api.smartcarlife.recepiton.soure.findSoureList',
>>>>>>> 79001e1604b966c94fa05e300a023cc7b6fc1f1a
projectName: "boutique", projectName: "boutique",
}); });
}, },
// 查询门店支付配置 // 查询门店支付配置
findPayInfo(data) { findPayInfo(data) {
return http.post({ return http.post({
<<<<<<< HEAD
method: method:
"dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId", "dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId",
sessionId: "b5e0a471-a2cd-4020-a522-72bcd68d6da7",
=======
method: 'dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId',
>>>>>>> 79001e1604b966c94fa05e300a023cc7b6fc1f1a
projectName: "boutique", projectName: "boutique",
...data, ...data,
}); });
...@@ -38,16 +28,18 @@ module.exports = { ...@@ -38,16 +28,18 @@ module.exports = {
saveRecCustomer(data) { saveRecCustomer(data) {
return http.post({ return http.post({
method: "dj.api.smartcarlife.recepiton.customer.saveRecCustomer", method: "dj.api.smartcarlife.recepiton.customer.saveRecCustomer",
sessionId: "b5e0a471-a2cd-4020-a522-72bcd68d6da7",
projectName: "boutique", projectName: "boutique",
...data, ...data,
}); });
}, },
getToken(data) { getToken(data) {
return http.post({ return http.post(
method: "dj.api.mindworkplate.badge.getToken", {
projectName: "mindworkplate", method: "dj.api.smartcarlife.recepiton.customer.oss.getToken",
sessionId: "2ae39c60-60c9-4096-901a-68da57068cd9", projectName: "boutique",
}); },
false,
"test"
);
}, },
}; };
import sign from './sign.js' import sign from "./sign.js";
import { import {
secretKey, secretKey,
pathEnum, pathEnum,
domain, domain,
djDomain, djDomain,
merchantDomain, merchantDomain,
djSecretKey djSecretKey,
} from '../../env' } from "../../env";
const HOST = { const HOST = {
scrm: domain, scrm: domain,
dj: djDomain, dj: djDomain,
merchant: merchantDomain merchant: merchantDomain,
} test: "http://192.168.3.226:9711",
};
class Request { class Request {
get (params, returnAll = false, hostType) { get(params, returnAll = false, hostType) {
return this.request('GET', params, returnAll, hostType) return this.request("GET", params, returnAll, hostType);
} }
post (params, returnAll = false, hostType) { post(params, returnAll = false, hostType) {
return this.request('POST', params, returnAll, hostType) return this.request("POST", params, returnAll, hostType);
} }
fetch (method, data, returnAll = true, hostType) { fetch(method, data, returnAll = true, hostType) {
return this.post({ return this.post(
{
method, method,
...data, ...data,
}, returnAll, hostType) },
returnAll,
hostType
);
} }
request (RequestMethods, params, returnAll, hostType = 'dj') { request(RequestMethods, params, returnAll, hostType = "dj") {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let header = RequestMethods === 'POST' ? { let header =
'content-type': 'application/x-www-form-urlencoded' RequestMethods === "POST"
} : { ? {
'Cache-Control': 'no-cache' "content-type": "application/x-www-form-urlencoded",
} }
let projectName = params.projectName : {
if (!projectName) projectName = this.getRopProject(params.method) "Cache-Control": "no-cache",
const path = pathEnum[projectName] };
params = this.getData(params, hostType) let projectName = params.projectName;
if (!projectName) projectName = this.getRopProject(params.method);
const path = pathEnum[projectName];
params = this.getData(params, hostType);
uni.request({ uni.request({
url: `${HOST[hostType]}${path}router?method=${params.method}`, url: `${HOST[hostType]}${path}router?method=${params.method}`,
data: params, data: params,
method: RequestMethods, method: RequestMethods,
header, header,
dataType: 'json', dataType: "json",
responseType: 'text', responseType: "text",
success (response) { success(response) {
/**业务代码 */ /**业务代码 */
let { let {
data: { data: { code, message },
code, data,
message } = response;
},
data
} = response
if (returnAll) { if (returnAll) {
resolve(data) resolve(data);
return return;
} }
if (code == 20 || code == 21) { if (code == 20 || code == 21) {
uni.hideLoading() uni.hideLoading();
uni.reLaunch({ uni.reLaunch({
url: '/pages/common/login' url: "/pages/common/login",
}) });
} else { } else {
if (code == '0') { if (code == "0") {
resolve(data.data) resolve(data.data);
} else { } else {
uni.showToast({ uni.showToast({
title: message || '系统异常', title: message || "系统异常",
icon: 'none' icon: "none",
}) });
} }
} }
}, },
fail (error) { fail(error) {
uni.hideLoading() uni.hideLoading();
console.error(`接口异常:`, error) console.error(`接口异常:`, error);
uni.showToast({ uni.showToast({
title: typeof error == 'string' ? error : JSON.stringify(error) || '系统异常', title:
icon: 'error' typeof error == "string"
}) ? error
reject(error) : JSON.stringify(error) || "系统异常",
icon: "error",
});
reject(error);
}, },
complete () { complete() {
uni.stopPullDownRefresh() uni.stopPullDownRefresh();
} },
}) });
}) });
} }
getData (params, hostType = 'scrm') { getData(params, hostType = "scrm") {
let projectName = params.projectName let projectName = params.projectName;
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method);
else delete params.projectName else delete params.projectName;
let appKey = '48e5e13229b82c1b4e6e8c96151f0637' let appKey = "48e5e13229b82c1b4e6e8c96151f0637";
let secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' let secret = "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b";
if (secretKey[projectName]) { if (secretKey[projectName]) {
appKey = secretKey[projectName].appKey appKey = secretKey[projectName].appKey;
secret = secretKey[projectName].secret secret = secretKey[projectName].secret;
} }
if (hostType == 'dj') { if (hostType == "dj") {
appKey = djSecretKey.appKey appKey = djSecretKey.appKey;
secret = djSecretKey.secret secret = djSecretKey.secret;
} }
let { let { sessionId } = uni.$storage.get();
sessionId let noSignAttr = [];
} = uni.$storage.get() if (!params.sessionId && sessionId) params.sessionId = sessionId;
let noSignAttr = []
if (!params.sessionId && sessionId) params.sessionId = sessionId
if (params.delSessionId) { if (params.delSessionId) {
delete params.sessionId delete params.sessionId;
delete params.delSessionId delete params.delSessionId;
} }
if (params.noSignAttr) { if (params.noSignAttr) {
noSignAttr = params.noSignAttr noSignAttr = params.noSignAttr;
delete params.noSignAttr delete params.noSignAttr;
} }
params.v = '1.0.0' params.v = "1.0.0";
params.format = 'json' params.format = "json";
params.locale = 'zh_CN' params.locale = "zh_CN";
params.source = 'app' params.source = "app";
params.appKey = appKey params.appKey = appKey;
return sign(params, secret, noSignAttr) return sign(params, secret, noSignAttr);
} }
getRopProject (method) { getRopProject(method) {
const projectName = method.split('.')[2] const projectName = method.split(".")[2];
return projectName return projectName;
} }
uni_request ({ uni_request({
url, url,
method = 'GET', method = "GET",
data = {}, data = {},
header = {}, header = {},
dataType = 'json', dataType = "json",
responseType = "text" responseType = "text",
}) { }) {
return new Promise((resolve) => { return new Promise((resolve) => {
uni.request({ uni.request({
...@@ -141,13 +147,12 @@ class Request { ...@@ -141,13 +147,12 @@ class Request {
header, header,
dataType, dataType,
responseType, responseType,
success (response) { success(response) {
resolve(response.data) resolve(response.data);
} },
}) });
}) });
} }
} }
export default new Request()
\ No newline at end of file \ No newline at end of file
export default new Request();
{ {
"name" : "生意助手", "name": "生意助手",
"appid" : "__UNI__D3BD3DF", "appid": "__UNI__D3BD3DF",
"description" : "", "description": "",
"versionName" : "1.0.0", "versionName": "1.0.0",
"versionCode" : "100", "versionCode": "100",
"transformPx" : false, "transformPx": false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus": {
"usingComponents" : true, "bounce": "none",
"nvueStyleCompiler" : "uni-app", "usingComponents": true,
"compilerVersion" : 3, "nvueStyleCompiler": "uni-app",
"screenOrientation" : "landscape", "compilerVersion": 3,
"splashscreen" : { "screenOrientation": "landscape",
"alwaysShowBeforeRender" : true, "splashscreen": {
"waiting" : true, "alwaysShowBeforeRender": true,
"autoclose" : true, "waiting": true,
"delay" : 0 "autoclose": true,
"delay": 0
}, },
/* 模块配置 */ /* 模块配置 */
"modules" : {}, "modules": {},
/* 应用发布信息 */ /* 应用发布信息 */
"distribute" : { "distribute": {
/* android打包配置 */ /* android打包配置 */
"android" : { "android": {
"permissions" : [ "permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
...@@ -45,34 +46,34 @@ ...@@ -45,34 +46,34 @@
] ]
}, },
/* ios打包配置 */ /* ios打包配置 */
"ios" : {}, "ios": {},
/* SDK配置 */ /* SDK配置 */
"sdkConfigs" : { "sdkConfigs": {
"ad" : {} "ad": {}
} }
} }
}, },
/* 快应用特有相关 */ /* 快应用特有相关 */
"quickapp" : {}, "quickapp": {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin": {
"appid" : "wx79d1ff39bee3d047", "appid": "wx79d1ff39bee3d047",
"setting" : { "setting": {
"urlCheck" : false "urlCheck": false
}, },
"usingComponents" : true "usingComponents": true
}, },
"mp-alipay" : { "mp-alipay": {
"usingComponents" : true "usingComponents": true
}, },
"mp-baidu" : { "mp-baidu": {
"usingComponents" : true "usingComponents": true
}, },
"mp-toutiao" : { "mp-toutiao": {
"usingComponents" : true "usingComponents": true
}, },
"uniStatistics" : { "uniStatistics": {
"enable" : false "enable": false
}, },
"vueVersion" : "2" "vueVersion": "2"
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48 * @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-08 17:19:52 * @LastEditTime: 2024-04-08 18:23:05
* @FilePath: \gl_tape\mixin\click.js * @FilePath: \gl_tape\mixin\click.js
* @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
*/ */
...@@ -34,13 +34,13 @@ export default { ...@@ -34,13 +34,13 @@ export default {
this.checkVoice(); this.checkVoice();
recorderManager.onStop((res) => { recorderManager.onStop((res) => {
recording = false; recording = false;
receptionEndTime = utils.convertDateTimeFormat(new Date()); receptionEndTime = utils.convertDateTimeFormat(new Date(), "/");
uni.$storage.set("storageFile", res.tempFilePath); uni.$storage.set("storageFile", res.tempFilePath);
this.uploadVoice(res.tempFilePath); this.uploadVoice(res.tempFilePath);
}); });
recorderManager.onStart(() => { recorderManager.onStart(() => {
recording = true; recording = true;
receptionStartTime = utils.convertDateTimeFormat(new Date()); receptionStartTime = utils.convertDateTimeFormat(new Date(), "/");
}); });
}, },
methods: { methods: {
...@@ -49,13 +49,20 @@ export default { ...@@ -49,13 +49,20 @@ export default {
if (file) this.uploadVoice(file); if (file) this.uploadVoice(file);
}, },
async uploadVoice(tempFilePath) { async uploadVoice(tempFilePath) {
const result = await upload(tempFilePath); console.log(88888, 99);
uni.$api const result = await upload(tempFilePath),
.commonApi({ { phone, merchantId, uuid, name } = uni.$storage.get("userInfo");
carPurchaseInvoice: result, uni.$api.commonApi
.saveRecCustomer({
carModel: "问界",
customerName: name,
phoneNumber: phone,
loginPhone: phone,
salesUuid: uuid,
recordUrl: result,
receptionStartTime, receptionStartTime,
receptionEndTime, receptionEndTime,
merchantId: uni.$storage.get("merchantId"), merchantId,
}) })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
...@@ -68,7 +75,7 @@ export default { ...@@ -68,7 +75,7 @@ export default {
recorderManager.start(); recorderManager.start();
}, },
//结束录音 //结束录音
pause() { stopAudio() {
recorderManager.stop(); recorderManager.stop();
}, },
//监听点击事件 //监听点击事件
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @Description: 首页 * @Description: 首页
* @Author: huyue * @Author: huyue
* @Date: 2024-04-07 14:39:40 * @Date: 2024-04-07 14:39:40
* @LastEditors: huyue * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-08 16:44:42 * @LastEditTime: 2024-04-08 17:42:37
--> -->
<template> <template>
<view class="container"> <view class="container">
...@@ -20,7 +20,11 @@ ...@@ -20,7 +20,11 @@
</view> </view>
<view class="left-footer"> <view class="left-footer">
<view class="logout"> <view class="logout">
<glsx-image class="icon-logout" src="home/icon-logout.png" mode="scaleToFill" /> <glsx-image
class="icon-logout"
src="home/icon-logout.png"
mode="scaleToFill"
/>
<view>退出</view> <view>退出</view>
</view> </view>
<view class="store-addr"> <view class="store-addr">
...@@ -37,36 +41,44 @@ ...@@ -37,36 +41,44 @@
<!-- 右侧内容 --> <!-- 右侧内容 -->
<view class="home-title">客户接待</view> <view class="home-title">客户接待</view>
<view class="start"> <view class="start">
<glsx-image class="icon-start" src="home/icon-handshake.png" mode="scaleToFill" /> <glsx-image
<view class="start-text">开始接待</view> class="icon-start"
src="home/icon-handshake.png"
mode="scaleToFill"
/>
<view class="start-text" @click="startAudio()">开始接待</view>
</view> </view>
<!-- 各模块入口list --> <!-- 各模块入口list -->
<view class="module-list"> <view class="module-list">
<view class="module-item" v-for="item in moduleList" :key="item.id" @click="toDetail(item)"> <view
<image class="module-item"
class="module-img" v-for="item in moduleList"
:src="item.thumbnail" :key="item.id"
mode="scaleToFill" @click="toDetail(item)"
/> >
<view class="module-name">{{item.title}}</view> <image class="module-img" :src="item.thumbnail" mode="scaleToFill" />
<view class="module-name">{{ item.title }}</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import myClick from "@/mixin/click";
export default { export default {
mixins: [myClick],
data() { data() {
return { return {
moduleList: [ moduleList: [
{ {
id: 1, id: 1,
sort: 1, sort: 1,
thumbnail: "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png", thumbnail:
"https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png",
title: "问界三包政策", title: "问界三包政策",
type: 1, type: 1,
} },
] ],
}; };
}, },
onLoad(options) { onLoad(options) {
...@@ -74,18 +86,18 @@ export default { ...@@ -74,18 +86,18 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: text, title: text,
}); });
this.getSoure() this.getSoure();
}, },
methods: { methods: {
async getSoure() { async getSoure() {
this.moduleList = await uni.$api.commonApi.findSoureList() this.moduleList = await uni.$api.commonApi.findSoureList();
}, },
toDetail(item) { toDetail(item) {
// this.$Router.push({name:'detail'}) // this.$Router.push({name:'detail'})
uni.navigateTo({ uni.navigateTo({
url: `../detail/detail?id=${item.id}` url: `../detail/detail?id=${item.id}`,
}) });
} },
}, },
}; };
</script> </script>
...@@ -97,7 +109,7 @@ export default { ...@@ -97,7 +109,7 @@ export default {
.left-side { .left-side {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: #F8F9F9; background-color: #f8f9f9;
.user-info { .user-info {
width: 220rpx; width: 220rpx;
box-sizing: border-box; box-sizing: border-box;
...@@ -118,7 +130,7 @@ export default { ...@@ -118,7 +130,7 @@ export default {
} }
.user-position { .user-position {
font-size: 20rpx; font-size: 20rpx;
color: #9B9B9E; color: #9b9b9e;
margin-top: 8rpx; margin-top: 8rpx;
} }
.left-footer { .left-footer {
...@@ -128,12 +140,12 @@ export default { ...@@ -128,12 +140,12 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: #FFFFFF; background-color: #ffffff;
border: 2rpx solid #EEEEEE; border: 2rpx solid #eeeeee;
border-radius: 16rpx; border-radius: 16rpx;
font-size: 28rpx; font-size: 28rpx;
margin: 0 30rpx; margin: 0 30rpx;
color: #6C6C70; color: #6c6c70;
padding: 18rpx 32rpx; padding: 18rpx 32rpx;
} }
.icon-logout { .icon-logout {
...@@ -153,7 +165,7 @@ export default { ...@@ -153,7 +165,7 @@ export default {
.addr-text { .addr-text {
width: 152rpx; width: 152rpx;
font-size: 24rpx; font-size: 24rpx;
color: #6C6C70; color: #6c6c70;
word-wrap: break-word; word-wrap: break-word;
white-space: normal; white-space: normal;
line-height: 32rpx; line-height: 32rpx;
...@@ -162,7 +174,7 @@ export default { ...@@ -162,7 +174,7 @@ export default {
} }
.right-side { .right-side {
flex: 1; flex: 1;
background-color: #FFFFFF; background-color: #ffffff;
padding: 0 60rpx; padding: 0 60rpx;
.home-title { .home-title {
margin: 26rpx auto; margin: 26rpx auto;
...@@ -174,7 +186,7 @@ export default { ...@@ -174,7 +186,7 @@ export default {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-image: linear-gradient(90deg, #48A6FF 0%, #2C66F7 100%); background-image: linear-gradient(90deg, #48a6ff 0%, #2c66f7 100%);
border-radius: 40rpx; border-radius: 40rpx;
margin: 40rpx 0 60rpx; margin: 40rpx 0 60rpx;
.icon-start { .icon-start {
...@@ -185,7 +197,7 @@ export default { ...@@ -185,7 +197,7 @@ export default {
.start-text { .start-text {
font-weight: 600; font-weight: 600;
font-size: 48rpx; font-size: 48rpx;
color: #FFFFFF; color: #ffffff;
line-height: 44rpx; line-height: 44rpx;
} }
} }
...@@ -203,11 +215,10 @@ export default { ...@@ -203,11 +215,10 @@ export default {
.module-name { .module-name {
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #292D33; color: #292d33;
text-align: center; text-align: center;
} }
} }
} }
} }
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 17:16:46 * @Date: 2024-04-08 17:16:46
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-08 17:18:40 * @LastEditTime: 2024-04-08 18:10:47
* @FilePath: \gl_tape\utils\utils.js * @FilePath: \gl_tape\utils\utils.js
* @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
*/ */
...@@ -15,7 +15,7 @@ function convertDateTimeFormat(dateTimeStr, separator = "-") { ...@@ -15,7 +15,7 @@ function convertDateTimeFormat(dateTimeStr, separator = "-") {
const minutes = ("0" + date.getMinutes()).slice(-2); const minutes = ("0" + date.getMinutes()).slice(-2);
const seconds = ("0" + date.getSeconds()).slice(-2); const seconds = ("0" + date.getSeconds()).slice(-2);
return `${month}${separator}${day}${separator}${year} ${hours}:${minutes}:${seconds}`; return `${year}${separator}${month}${separator}${day} ${hours}:${minutes}:${seconds}`;
} }
export default { export default {
convertDateTimeFormat, convertDateTimeFormat,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!