当前位置:网站首页>Wechat applet catchtap = "todetail" event problem
Wechat applet catchtap = "todetail" event problem
2022-04-23 09:03:00 【Accpdaiyekun】
const app = getApp()
const util = require('/../../../utils/util.js')
Component({
options: {
addGlobalClass: true // Be sure to add this sentence , Otherwise there is no style
},
data: {
tbaseurl:app.globalData.apiUrl,
cardCur: 0,
isCard:false,
swiperList: [{
id: 0,
type: 'image',
url: app.globalData.apiUrl + 'Uploads/homeimg/img001.jpg'
}, {
id: 1,
type: 'image',
url: app.globalData.apiUrl + 'Uploads/homeimg/img002.jpg'
}, {
id: 2,
type: 'image',
url: app.globalData.apiUrl + 'Uploads/homeimg/img003.jpg'
}, {
id: 3,
type: 'image',
url: app.globalData.apiUrl + 'Uploads/homeimg/img004.jpg'
}, {
id: 4,
type: 'image',
url: app.globalData.apiUrl + 'Uploads/homeimg/img005.jpg'
}, {
id: 5,
type: 'image',
url: app.globalData.apiUrl + 'Uploads/homeimg/img006.jpg'
}, {
id: 6,
type: 'image',
url: app.globalData.apiUrl + 'Uploads/homeimg/img007.jpg'
}],
toplists:[]// copy
},
methods: {
GetWan: function () {
var that=this;
wx.request({
url: app.globalData.apiUrl + 'WxXcx/XcxWn/GetListTopNum',
data: {
LoginKey: wx.getStorageSync('loginKey'),
},
method: 'GET',
header: {
'content-type': 'application/json'
},
success: function (res) {
//debugger;
var tempdata=res.data.data;
that.setData({
toplists:tempdata
})
}
})
},
toDetail(e) {// Jump to the details page
var currid = e.currentTarget.dataset.currid; // Get subscript
// Get the title
wx.navigateTo({
// Keep this page , Jump to another page
url: '/pages/component/Document/detail?Id=' + currid, // Page Jump url+ value
})
}
},
lifetimes: {
// Life cycle function , It can be a function , Or one in methods The method name defined in the amount to page onload
attached: function () {
// debugger;
this.GetWan();
}, // amount to page Inside onLoad
moved: function () {},
detached: function () {},
},
// Life cycle function , It can be a function , Or one in methods The method name defined in the
ready: function () {
},
pageLifetimes: {
show() {
}
},
})
component Under components catchtap event problem .
The solution is methods discharge toDetail The method will do
版权声明
本文为[Accpdaiyekun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230721028972.html
边栏推荐
- 错误: 找不到或无法加载主类
- 深度学习框架中的自动微分及高阶导数
- Study notes of deep learning (8)
- 小程序报错:Cannot read property 'currentTarget' of undefined
- 【原创】使用System.Text.Json对Json字符串进行格式化
- How does kubernetes use harbor to pull private images
- valgrind和kcachegrind使用運行分析
- Strength comparison vulnerability of PHP based on hash algorithm
- cadence的工艺角仿真、蒙特卡洛仿真、PSRR
- I don't understand time, timestamp and time zone. Look at this article
猜你喜欢

在sqli-liabs学习SQL注入之旅(第十一关~第二十关)

论文阅读《Multi-View Depth Estimation by Fusing Single-View Depth Probability with Multi-View Geometry》

ATSS(CVPR2020)

What is augmented reality technology? Where can it be used?

ONEFLOW learning notes: from functor to opexprinter

Valgrind et kcachegrind utilisent l'analyse d'exécution

共享办公室,提升入驻体验

Star Trek强势来袭 开启元宇宙虚拟与现实的梦幻联动

The crawler returns null when parsing with XPath. The reason why the crawler cannot get the corresponding element and the solution

BK3633 规格书
随机推荐
node安装
Use include in databinding
First principle mind map
The K neighbors of each sample are obtained by packet switching
Introduction to matlab
Valgrind and kcache grind use run analysis
Star Trek's strong attack opens the dream linkage between metacosmic virtual reality
npm ERR! network
Notes d'apprentissage oneflow: de functor à opexprinterpreter
还原二叉树 (25 分)
How to read excel table to database
Latex paper typesetting operation
数字政府建设中政务中台中的技术创新点
Taxable income
Rembg split mask
Single chip microcomputer nixie tube stopwatch
Go language self-study series | golang method
Wechat: get the owner of a single tag
Flink reads MySQL and PgSQL at the same time, and the program will get stuck without logs
[boutique] using dynamic agent to realize unified transaction management II