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 32a7f6de
authored
Oct 08, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'fix_dev_v4.29.0' into 'develop'
bug修复 See merge request
!178
2 parents
bdf400b3
11f6cccc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
31 deletions
components/Goods/Goods.js
pages/loading/loading.js
tabWorkOrder/pages/additionRecordOrder/additionRecordOrder.js
components/Goods/Goods.js
View file @
32a7f6d
...
@@ -172,7 +172,7 @@ Component({
...
@@ -172,7 +172,7 @@ Component({
if
(
!
chooseList
.
length
)
return
wx
.
$util
.
showToast
(
'请勾选商品'
)
if
(
!
chooseList
.
length
)
return
wx
.
$util
.
showToast
(
'请勾选商品'
)
let
thisPage
=
wx
.
$router
.
getPageInstance
()
let
thisPage
=
wx
.
$router
.
getPageInstance
()
//
thisPage.setGoodsTotal&&thisPage.setGoodsTotal(chooseList)
thisPage
.
setGoodsTotal
&&
thisPage
.
setGoodsTotal
(
chooseList
)
// console.log(chooseList)
// console.log(chooseList)
thisPage
.
setData
({
thisPage
.
setData
({
goodsList
:
chooseList
goodsList
:
chooseList
...
...
pages/loading/loading.js
View file @
32a7f6d
...
@@ -57,9 +57,12 @@ Page({
...
@@ -57,9 +57,12 @@ Page({
if
((
userInfo
?.
shopMerchantId
??
''
)
===
''
&&
!
userInfo
?.
isSuper
)
return
wx
.
$router
.
reLaunch
(
'pages.accountItems'
)
if
((
userInfo
?.
shopMerchantId
??
''
)
===
''
&&
!
userInfo
?.
isSuper
)
return
wx
.
$router
.
reLaunch
(
'pages.accountItems'
)
// 未选择场景
// 未选择场景
if
((
userInfo
?.
sceneType
??
''
)
===
''
)
return
wx
.
$router
.
reLaunch
(
'pages.sceneIndex'
)
if
((
userInfo
?.
sceneType
??
''
)
===
''
)
return
wx
.
$router
.
reLaunch
(
'pages.sceneIndex'
)
if
(
!
((
userInfo
?.
sceneType
??
''
)
===
''
))
return
wx
.
$router
.
reLaunch
(
constantData
?.
pageUrl
[
userInfo
?.
sceneType
],
{
resetStoreList
:
true
})
// 登录了更新用户权限
// 登录了更新用户权限
app
.
gobalCheckYqdSuper
(
userInfo
)
app
.
gobalCheckYqdSuper
(
userInfo
)
if
(
!
((
userInfo
?.
sceneType
??
''
)
===
''
))
return
wx
.
$router
.
reLaunch
(
constantData
?.
pageUrl
[
userInfo
?.
sceneType
],
{
resetStoreList
:
true
})
})
})
}
}
})
})
\ No newline at end of file
\ No newline at end of file
tabWorkOrder/pages/additionRecordOrder/additionRecordOrder.js
View file @
32a7f6d
...
@@ -231,35 +231,35 @@ Page({
...
@@ -231,35 +231,35 @@ Page({
this
.
setGoodsTotal
(
goodsList
)
this
.
setGoodsTotal
(
goodsList
)
},
},
// 屏蔽不用
// 屏蔽不用
setGoodsTotal
(
goodsList
)
{
//
setGoodsTotal(goodsList) {
let
{
totalFee
}
=
this
.
data
//
let { totalFee } = this.data
let
total
=
0
//
let total = 0
// goodsList.map(i => (total += i.count * i.price))
//
// goodsList.map(i => (total += i.count * i.price))
goodsList
.
map
(
i
=>
{
//
goodsList.map(i => {
const
totalPrice
=
NP
.
times
(
i
.
count
,
i
.
price
)
//
const totalPrice = NP.times(i.count, i.price)
total
=
NP
.
plus
(
total
,
totalPrice
)
//
total = NP.plus(total, totalPrice)
})
//
})
// 用来解决小数相减导致精度问题
//
// 用来解决小数相减导致精度问题
// total = this.accMul(total, 100)
//
// total = this.accMul(total, 100)
total
=
NP
.
times
(
total
,
100
)
//
total = NP.times(total, 100)
// total = parseFloat(total.toFixed(2))
//
// total = parseFloat(total.toFixed(2))
// console.log(total * 100)
//
// console.log(total * 100)
// console.log(totalFee)
//
// console.log(totalFee)
// console.log(totalFee * 100)
//
// console.log(totalFee * 100)
// 计算差价格 没有就归0 100是用来解决小数相减导致精度问题
//
// 计算差价格 没有就归0 100是用来解决小数相减导致精度问题
// console.log(this.accMul(total, 100))
//
// console.log(this.accMul(total, 100))
// 解决数据精度丢失问题
//
// 解决数据精度丢失问题
// let priceSpread = goodsList.length ? parseFloat((total - totalFee).toFixed(2)) : 0
//
// let priceSpread = goodsList.length ? parseFloat((total - totalFee).toFixed(2)) : 0
let
priceSpread
=
goodsList
.
length
?
NP
.
minus
(
total
,
totalFee
)
:
0
//
let priceSpread = goodsList.length ? NP.minus(total, totalFee) : 0
// console.log(priceSpread)
//
// console.log(priceSpread)
this
.
setData
({
//
this.setData({
priceSpread
:
priceSpread
,
//
priceSpread: priceSpread,
// total: wx.$util.decimal(total, 2)
//
// total: wx.$util.decimal(total, 2)
// total
//
// total
})
//
})
},
//
},
// accSub(arg1, arg2) {
// accSub(arg1, arg2) {
// let r1, r2, m, n
// let r1, r2, m, n
...
...
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