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