Commit f4410bf1 by luyt

feat:参数

1 parent 6a2962d7
......@@ -91,7 +91,7 @@ Page({
onRoute(options) {
// console.log("options: ", options);
//选中场景的index,和产品的index
let { actNum, activeNavIdx, apiData } = options;
let { actNum, activeNavIdx, apiData} = options;
this.setData({
actNum,
activeNavIdx,
......@@ -100,7 +100,7 @@ Page({
});
let apiDataJson = JSON.stringify(apiData)
let item = apiData[actNum]?.productList[activeNavIdx];
this.shareQuery = `sceneCode=${apiData[actNum].sceneCode}&productCode=${item?.productCode}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&apiData=${apiDataJson}`;
this.shareQuery = `sceneCode=${apiData[actNum].sceneCode}&productCode=${item?.productCode}&isShare=${true}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&apiData=${apiDataJson}`;
this.shareTrackData = {
sceneCode: apiData[actNum]?.sceneCode,
productCode: item?.productCode,
......@@ -256,9 +256,11 @@ Page({
* 生命周期函数--监听页面加载 ()
*/
onLoad(options) {
console.log('options: ', options);
// actNum,activeNavIdx isShare
// 扫码进来
let { actNum, activeNavIdx, isShare, merchantId } = options;
console.log('isShare: ', isShare);
if (merchantId) {
this.setData({
isShow: false,
......@@ -276,7 +278,7 @@ Page({
// 发请求
let senceItem = senceData[actNum];
let item = senceData[actNum]?.productList[activeNavIdx];
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&productCode=${item?.productCode}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}`;
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&productCode=${item?.productCode}&isShare=${isShare}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}`;
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
productCode: item?.productCode,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!