当前位置:网站首页>Click Cancel to return to the previous page and modify the parameter value of the previous page, let pages = getcurrentpages() let prevpage = pages [pages. Length - 2] / / the data of the previous pag
Click Cancel to return to the previous page and modify the parameter value of the previous page, let pages = getcurrentpages() let prevpage = pages [pages. Length - 2] / / the data of the previous pag
2022-04-23 17:47:00 【Youyoujing】
Realization function :
Personal center :
List to be visited :
Details page to be visited :
1. Other pages return Personal center page , Need to retrieve data , Update page content ;
2. Details page to be visited , After completing the follow-up , Point return , Back to the waiting list , Retrieve data , Update the data of the list to be visited .
Code implementation :
1. Personal center page :
<view class="iconbox" bindtap="daizhuifang">
<image class="iconimg" mode="widthFix" src="../../images/kehuxitong/xsicon04.png" />
<view class="icontxt"> To be followed up </view>
<view class="daizhuikh" wx:if="{
{daizhuikh}}">{
{daizhuikh}}</view> <!-- Here are the unread numbers displayed -->
</view>
/** * Life cycle function -- Monitor page display */
// onLoad Called when the page loads , You can get parameters , adopt options.
// onShow Call... When the page is displayed .
onShow: function() {
// Refresh the page display and update the data ;
// console.log(this.data.token);
// console.log(this.data.type);
wx.showLoading({
title: ' Loading ...',
mask: true,
})
this.getcard()
this.getCollectiondata()
this.gethistorydata()
if (this.data.type == 1) {
this.getmarketArticle(0)
this.getmarketArticle(1)
this.getmarketArticle(2)
this.getmarketArticle(3)
this.getmarketLoupanList()
// this.getgetUserInfo();
this.getgetCardIsStatus()
this.getgetMemberCount()
this.getsecondManageCount()
console.log('onshow')
// this.getgetManageUserList();
}
setTimeout(() => {
wx.hideLoading()
}, 500)
// if (this.data.token != '') {
// this.setData({
// token: false
// })
// }
},
2. Waiting list page :
/** * Life cycle function -- Monitor page display */
onShow: function() {
wx.stopPullDownRefresh() // Stop the pull-down refresh effect when the refresh is complete
this.getgetTagsList()
if (this.data.isaddkehu) {
// isaddkehu The parameter is transmitted from the details page to be followed up , Update the page if there is a value , Otherwise, do not update the list page ;
console.log('isaddkehu')
this.setData({
nomore: 0,
isLoadInterface: false,
pagecount: 1,
page: 1,
kehulistarr: [],
})
this.getgetManageUserList()
this.setData({
isaddkehu: false,
})
}
},
3. Details page to be visited :
// After submitting for follow-up , perform
setTimeout(() => {
let pages = getCurrentPages() // Data for the current page ,
let prevPage = pages[pages.length - 2] // The data on the previous page
prevPage.setData({
isaddkehu: true, // Modify the parameter value on the previous page
})
// console.log(pages);
// wx.navigateBack({
// delta: 1
// })
}, 1000)
thus , On the previous page onShow We can judge this in the future isaddkehu Whether the parameter value has been modified , You can know whether to update the data .
版权声明
本文为[Youyoujing]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230550531985.html
边栏推荐
- [二叉数] 二叉树的最大深度+N叉树的最大深度
- Why do some people say SCM is simple and I have to learn it so hard?
- Commonly used functions -- spineros:: and spineros::)
- Router object, route object, declarative navigation, programmed navigation
- Sword finger offer 03 Duplicate number in array
- 102. 二叉树的层序遍历
- 2022 tea artist (primary) examination simulated 100 questions and simulated examination
- 1217_ Generating target files using scons
- 470. Rand10() is implemented with rand7()
- 给 el-dialog 增加拖拽功能
猜你喜欢
Tell the truth of TS
PC uses wireless network card to connect to mobile phone hotspot. Why can't you surf the Internet
Detailed deployment of flask project
48. Rotate image
JS parsing and execution process
Future 用法详解
双指针进阶--leetcode题目--盛最多水的容器
394. String decoding - auxiliary stack
Why do some people say SCM is simple and I have to learn it so hard?
双闭环直流调速系统matlab/simulink仿真
随机推荐
JS implementation private attribute
The JS timestamp of wechat applet is converted to / 1000 seconds. After six hours and one day, this Friday option calculates the time
干货 | 快速抽取缩略图是怎么练成的?
土地覆盖/利用数据产品下载
48. Rotate image
開期貨,開戶雲安全還是相信期貨公司的軟件?
Uniapp custom search box adaptation applet alignment capsule
C1小笔记【任务训练篇一】
41. The first missing positive number
MySQL advanced index [classification, performance analysis, use, design principles]
Entity Framework core captures database changes
Exercise: even sum, threshold segmentation and difference (two basic questions of list object)
386. 字典序排数(中等)-迭代-全排列
102. Sequence traversal of binary tree
01 - get to know the advantages of sketch sketch
Summary of common server error codes
Applet learning notes (I)
Special effects case collection: mouse planet small tail
2022年茶艺师(初级)考试模拟100题及模拟考试
2022制冷与空调设备运行操作判断题及答案