How does WeChat Mini Programs get the index of adjacent elements

when the item function is selected in the check box in WeChat Mini Programs"s shopping cart, you need to get the index of the adjacent element and the parent element
now the console.log is undefined

how can I get the index of adjacent elements and parent elements?

the figure is as follows:


Mini Program does not directly support DOM traversal, so the original DOM-based operations are not available.

Mini Program is the MVVM framework, and the original operation can be replaced by data manipulation. In other words, you should calculate the other index you want through the index of the current object.



1.index
2.index 
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea3dd6-1c8e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea3dd6-1c8e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?