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 099ca345
authored
Jun 28, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
代码合并冲突
2 parents
0c8e71df
0e3cd5ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
components/Goods/Goods.js
config.js
tabWorkOrder/pages/additionRecordOrder/additionRecordOrder.js
components/Goods/Goods.js
View file @
099ca34
...
...
@@ -168,14 +168,14 @@ Component({
let
{
goodsList
}
=
this
.
data
if
(
goodsList
.
length
<
1
)
return
if
(
!
chooseList
.
length
)
return
wx
.
$util
.
showToast
(
'请勾选商品'
)
let
thisPage
=
wx
.
$router
.
getPageInstance
()
// thisPage.setGoodsTotal(chooseList)
// console.log(chooseList)
thisPage
.
setData
({
goodsList
:
chooseList
})
thisPage
.
setGoodsTotal
(
chooseList
)
console
.
log
(
chooseList
)
this
.
setData
({
show
:
false
})
...
...
config.js
View file @
099ca34
...
...
@@ -11,7 +11,7 @@
* 3生产环境
* 4预发布
*/
let
index
=
2
let
index
=
3
const
accountInfo
=
wx
.
getAccountInfoSync
()
const
systemInfo
=
wx
.
getSystemInfoSync
()
...
...
tabWorkOrder/pages/additionRecordOrder/additionRecordOrder.js
View file @
099ca34
...
...
@@ -58,7 +58,7 @@ Page({
},
selectPayType
:
2
,
remark
:
''
,
customerCouponId
:
''
,
customerCouponId
:
''
},
goodsList
:
[],
goodsData
:
[],
...
...
@@ -148,7 +148,7 @@ Page({
orderObj
,
goodsList
})
this
.
setGoodsTotal
(
goodsList
)
//
this.setGoodsTotal(goodsList)
}
}
this
.
setData
({
...
...
@@ -217,7 +217,7 @@ Page({
this
.
showToast
(
'单价不可低于商品最低价'
)
}
let
{
goodsList
}
=
this
.
data
this
.
setGoodsTotal
(
goodsList
)
//
this.setGoodsTotal(goodsList)
},
priceBlur
(
e
)
{
let
{
index
,
item
}
=
e
.
currentTarget
.
dataset
...
...
@@ -227,16 +227,16 @@ Page({
})
let
{
goodsList
}
=
this
.
data
this
.
setGoodsTotal
(
goodsList
)
//
this.setGoodsTotal(goodsList)
},
setGoodsTotal
(
goodsList
)
{
let
{
totalFee
}
=
this
.
data
let
total
=
0
// goodsList.map(i => (total += i.count * i.price))
goodsList
.
map
(
i
=>
{
const
totalPrice
=
NP
.
times
(
i
.
count
,
i
.
price
)
total
=
NP
.
plus
(
total
,
totalPrice
)
}
)
goodsList
.
map
(
i
=>
{
const
totalPrice
=
NP
.
times
(
i
.
count
,
i
.
price
)
total
=
NP
.
plus
(
total
,
totalPrice
)
})
// 用来解决小数相减导致精度问题
// total = this.accMul(total, 100)
total
=
NP
.
times
(
total
,
100
)
...
...
@@ -249,7 +249,7 @@ Page({
// console.log(this.accMul(total, 100))
// 解决数据精度丢失问题
// 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)
this
.
setData
({
priceSpread
:
priceSpread
,
...
...
@@ -302,7 +302,7 @@ Page({
this
.
setData
({
goodsList
})
this
.
setGoodsTotal
(
goodsList
)
//
this.setGoodsTotal(goodsList)
},
submit
(
i
)
{
// 判断手机号是否用配置的默认值
...
...
@@ -439,6 +439,7 @@ Page({
}
}
else
{
this
.
showToast
(
message
)
throw
message
}
})
.
finally
(()
=>
{
...
...
@@ -687,7 +688,7 @@ Page({
goodsList
:
chooseList
,
first
:
false
})
this
.
setGoodsTotal
(
chooseList
)
//
this.setGoodsTotal(chooseList)
},
getSetting
()
{
...
...
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