Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dde6c79d
authored
Apr 13, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
f7dda912
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
61 deletions
tabWorkOrder/pages/createOrder/createOrder.js
utils/util.js
tabWorkOrder/pages/createOrder/createOrder.js
View file @
dde6c79
...
@@ -1335,6 +1335,67 @@ Page({
...
@@ -1335,6 +1335,67 @@ Page({
// 添加埋点
// 添加埋点
wx
.
$track
.
setTrackData
(
0
,
'submit_order'
,
{},
''
,
1
)
wx
.
$track
.
setTrackData
(
0
,
'submit_order'
,
{},
''
,
1
)
},
},
/** 扫码 / scene 礼券:需在路由策略 setData 写入 scene 之后调用(见 onRoute) */
applyCouponFromScene
(
userInfo
,
sceneRaw
)
{
if
(
!
sceneRaw
)
return
let
scene
=
decodeURIComponent
(
sceneRaw
)
if
(
userInfo
.
userType
==
2
)
{
let
id
=
scene
.
split
(
'='
)[
1
]
api
.
getCouponDeatil
({
id
})
.
then
(
info
=>
{
let
{
code
,
data
,
message
}
=
info
if
(
code
==
0
)
{
if
(
data
.
usedFlag
==
'Y'
)
{
wx
.
showModal
({
content
:
'该礼券已被使用'
,
confirmText
:
'知道了'
,
confirmColor
:
'#347BFF'
,
showCancel
:
false
,
success
(
res
)
{
if
(
res
.
confirm
)
wx
.
$router
.
back
()
}
})
return
}
this
.
setOrderObj
(
data
)
api
.
getOrderByCustomerCouponId
({
customerCouponId
:
id
})
.
then
(
res
=>
{
let
{
code
,
data
,
message
}
=
res
if
(
code
==
0
)
{
this
.
setData
({
[
'orderObj.orderCode'
]:
data
.
orderCode
})
}
else
{
this
.
showToast
(
message
)
}
})
}
else
{
this
.
showToast
(
message
)
}
})
}
else
{
wx
.
showModal
({
title
:
'温馨提示'
,
content
:
'您的账号无法完成此操作'
,
confirmText
:
'知道了'
,
confirmColor
:
'#347BFF'
,
showCancel
:
false
,
success
(
res
)
{
if
(
res
.
confirm
)
{
wx
.
$util
.
refreshPageData
()
wx
.
$router
.
go
(
'index'
)
}
}
})
}
},
init
(
userInfo
)
{
init
(
userInfo
)
{
let
{
scene
,
orderObj
}
=
this
.
data
let
{
scene
,
orderObj
}
=
this
.
data
if
(
!
orderObj
.
sellerMerchantName
)
{
if
(
!
orderObj
.
sellerMerchantName
)
{
...
@@ -1346,67 +1407,8 @@ Page({
...
@@ -1346,67 +1407,8 @@ Page({
orderObj
orderObj
})
})
}
}
// console.log(this.data)
// console.log(scene);
if
(
scene
)
{
if
(
scene
)
{
scene
=
decodeURIComponent
(
scene
)
this
.
applyCouponFromScene
(
userInfo
,
scene
)
if
(
userInfo
.
userType
==
2
)
{
let
id
=
scene
.
split
(
'='
)[
1
]
api
.
getCouponDeatil
({
id
})
.
then
(
info
=>
{
let
{
code
,
data
,
message
}
=
info
if
(
code
==
0
)
{
if
(
data
.
usedFlag
==
'Y'
)
{
wx
.
showModal
({
content
:
'该礼券已被使用'
,
confirmText
:
'知道了'
,
confirmColor
:
'#347BFF'
,
showCancel
:
false
,
success
(
res
)
{
if
(
res
.
confirm
)
wx
.
$router
.
back
()
}
})
return
}
this
.
setOrderObj
(
data
)
api
.
getOrderByCustomerCouponId
({
customerCouponId
:
id
})
.
then
(
res
=>
{
let
{
code
,
data
,
message
}
=
res
if
(
code
==
0
)
{
this
.
setData
({
[
'orderObj.orderCode'
]:
data
.
orderCode
})
}
else
{
this
.
showToast
(
message
)
}
})
}
else
{
this
.
showToast
(
message
)
}
})
}
else
{
wx
.
showModal
({
title
:
'温馨提示'
,
content
:
'您的账号无法完成此操作'
,
confirmText
:
'知道了'
,
confirmColor
:
'#347BFF'
,
showCancel
:
false
,
success
(
res
)
{
if
(
res
.
confirm
)
{
wx
.
$util
.
refreshPageData
()
wx
.
$router
.
go
(
'index'
)
}
}
})
}
}
}
},
},
async
getSelectOrderGoodsList
(
merchantId
)
{
async
getSelectOrderGoodsList
(
merchantId
)
{
...
@@ -2295,6 +2297,10 @@ Page({
...
@@ -2295,6 +2297,10 @@ Page({
try
{
try
{
const
routeContext
=
new
RouteContext
(
this
)
const
routeContext
=
new
RouteContext
(
this
)
await
routeContext
.
execute
(
res
)
await
routeContext
.
execute
(
res
)
if
(
res
&&
res
.
scene
)
{
const
userInfo
=
this
.
data
.
userInfo
||
wx
.
$util
.
getUserInfo
()
if
(
userInfo
)
this
.
applyCouponFromScene
(
userInfo
,
res
.
scene
)
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'onRoute execution failed:'
,
error
)
console
.
error
(
'onRoute execution failed:'
,
error
)
// Fallback: 至少保证页面不白屏
// Fallback: 至少保证页面不白屏
...
...
utils/util.js
View file @
dde6c79
...
@@ -263,7 +263,7 @@ const pointRecord = clickEventType => {
...
@@ -263,7 +263,7 @@ const pointRecord = clickEventType => {
* @returns {Function} - 返回一个经过防抖处理的函数。
* @returns {Function} - 返回一个经过防抖处理的函数。
*/
*/
const
debounce
=
(
func
,
delay
,
immediate
)
=>
{
const
debounce
=
(
func
,
delay
,
immediate
)
=>
{
console
.
log
(
delay
);
//
console.log(delay);
let
timeoutId
;
// 用于保存定时器ID
let
timeoutId
;
// 用于保存定时器ID
return
function
(...
args
)
{
return
function
(...
args
)
{
...
...
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