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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
14 deletions
components/Goods/Goods.js
config.js
tabWorkOrder/pages/additionRecordOrder/additionRecordOrder.js
components/Goods/Goods.js
View file @
099ca34
...
@@ -170,11 +170,11 @@ Component({
...
@@ -170,11 +170,11 @@ 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(chooseList)
// console.log(chooseList)
thisPage
.
setData
({
thisPage
.
setData
({
goodsList
:
chooseList
goodsList
:
chooseList
})
})
thisPage
.
setGoodsTotal
(
chooseList
)
console
.
log
(
chooseList
)
this
.
setData
({
this
.
setData
({
show
:
false
show
:
false
...
...
config.js
View file @
099ca34
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
* 3生产环境
* 3生产环境
* 4预发布
* 4预发布
*/
*/
let
index
=
2
let
index
=
3
const
accountInfo
=
wx
.
getAccountInfoSync
()
const
accountInfo
=
wx
.
getAccountInfoSync
()
const
systemInfo
=
wx
.
getSystemInfoSync
()
const
systemInfo
=
wx
.
getSystemInfoSync
()
...
...
tabWorkOrder/pages/additionRecordOrder/additionRecordOrder.js
View file @
099ca34
...
@@ -58,7 +58,7 @@ Page({
...
@@ -58,7 +58,7 @@ Page({
},
},
selectPayType
:
2
,
selectPayType
:
2
,
remark
:
''
,
remark
:
''
,
customerCouponId
:
''
,
customerCouponId
:
''
},
},
goodsList
:
[],
goodsList
:
[],
goodsData
:
[],
goodsData
:
[],
...
@@ -148,7 +148,7 @@ Page({
...
@@ -148,7 +148,7 @@ Page({
orderObj
,
orderObj
,
goodsList
goodsList
})
})
this
.
setGoodsTotal
(
goodsList
)
//
this.setGoodsTotal(goodsList)
}
}
}
}
this
.
setData
({
this
.
setData
({
...
@@ -217,7 +217,7 @@ Page({
...
@@ -217,7 +217,7 @@ Page({
this
.
showToast
(
'单价不可低于商品最低价'
)
this
.
showToast
(
'单价不可低于商品最低价'
)
}
}
let
{
goodsList
}
=
this
.
data
let
{
goodsList
}
=
this
.
data
this
.
setGoodsTotal
(
goodsList
)
//
this.setGoodsTotal(goodsList)
},
},
priceBlur
(
e
)
{
priceBlur
(
e
)
{
let
{
index
,
item
}
=
e
.
currentTarget
.
dataset
let
{
index
,
item
}
=
e
.
currentTarget
.
dataset
...
@@ -227,16 +227,16 @@ Page({
...
@@ -227,16 +227,16 @@ Page({
})
})
let
{
goodsList
}
=
this
.
data
let
{
goodsList
}
=
this
.
data
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
)
...
@@ -249,7 +249,7 @@ Page({
...
@@ -249,7 +249,7 @@ Page({
// 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
,
...
@@ -302,7 +302,7 @@ Page({
...
@@ -302,7 +302,7 @@ Page({
this
.
setData
({
this
.
setData
({
goodsList
goodsList
})
})
this
.
setGoodsTotal
(
goodsList
)
//
this.setGoodsTotal(goodsList)
},
},
submit
(
i
)
{
submit
(
i
)
{
// 判断手机号是否用配置的默认值
// 判断手机号是否用配置的默认值
...
@@ -439,6 +439,7 @@ Page({
...
@@ -439,6 +439,7 @@ Page({
}
}
}
else
{
}
else
{
this
.
showToast
(
message
)
this
.
showToast
(
message
)
throw
message
}
}
})
})
.
finally
(()
=>
{
.
finally
(()
=>
{
...
@@ -687,7 +688,7 @@ Page({
...
@@ -687,7 +688,7 @@ Page({
goodsList
:
chooseList
,
goodsList
:
chooseList
,
first
:
false
first
:
false
})
})
this
.
setGoodsTotal
(
chooseList
)
//
this.setGoodsTotal(chooseList)
},
},
getSetting
()
{
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