Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9d3daf15
authored
Oct 24, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix:本地数据与线上数据合并问题
1 parent
643d6712
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
pages/checkProduct/checkProduct.js
pages/checkProduct/checkProduct.js
View file @
9d3daf1
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
const
navStyle
=
"background-color: #fff"
;
const
navStyle
=
"background-color: #fff"
;
import
{
senceData
}
from
"~/pages/tab/index/constant/data"
;
import
{
senceData
}
from
"~/pages/tab/index/constant/data"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
productBysceneApi
}
from
'~/api/index.js'
import
Draw
from
"~/utils/Draw.js"
;
import
Draw
from
"~/utils/Draw.js"
;
import
{
createQrCodeApi
,
sceneByIdApi
}
from
"~/api/checkProduct.js"
;
import
{
createQrCodeApi
,
sceneByIdApi
}
from
"~/api/checkProduct.js"
;
import
utils
from
"~/utils/util.js"
;
import
utils
from
"~/utils/util.js"
;
...
@@ -93,6 +94,45 @@ Page({
...
@@ -93,6 +94,45 @@ Page({
isShow
:
true
,
isShow
:
true
,
});
});
},
},
//如果是直接查看页面,获取合成apiData
getData
()
{
console
.
log
(
123456
)
// 看产品
productBysceneApi
().
then
(
res
=>
{
let
{
code
,
data
}
=
res
if
(
code
==
0
&&
data
)
{
// this.setData({
// apiData: data
// })
this
.
compositionData
(
senceData
,
data
)
// this.getFirstSenceIndex();
}
})
},
//接口数据,本地数据对接
compositionData
(
localData
,
apiData
)
{
localData
.
forEach
((
item
,
index
)
=>
{
apiData
.
forEach
((
inner
,
idx
)
=>
{
if
(
item
.
name
==
inner
.
stage
)
{
item
.
sceneStatus
=
inner
.
sceneStatus
item
.
productList
.
forEach
((
outChild
,
outIndex
)
=>
{
inner
.
productList
.
forEach
((
innerChild
,
innerIndex
)
=>
{
if
(
outChild
.
proName
==
innerChild
.
productName
)
{
outChild
.
productStatus
=
innerChild
.
productStatus
}
})
})
}
})
})
// console.log('localData, apiData: ', localData);
this
.
setData
({
senceData
:
localData
})
},
//接受跳转的路由参数(小程序页面跳转)
//接受跳转的路由参数(小程序页面跳转)
onRoute
(
options
)
{
onRoute
(
options
)
{
console
.
log
(
"分享options: "
,
options
);
console
.
log
(
"分享options: "
,
options
);
...
@@ -280,6 +320,7 @@ Page({
...
@@ -280,6 +320,7 @@ Page({
* 生命周期函数--监听页面加载 (扫码,分享链接)
* 生命周期函数--监听页面加载 (扫码,分享链接)
*/
*/
async onLoad(options) {
async onLoad(options) {
this.getData()
console.log("分享options12255565: ", options);
console.log("分享options12255565: ", options);
// actNum,activeNavIdx isShare
// actNum,activeNavIdx isShare
if (!options || utils.isEmptyObj(options)) return;
if (!options || utils.isEmptyObj(options)) return;
...
...
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