| | |
| | | |
| | | <script> |
| | | import TopBar from "@/components/TopBar.vue"; |
| | | import { getSessionId, userAction } from "@/api/userAction.js"; |
| | | import { |
| | | getCategoryList, |
| | | getGoodsList, |
| | |
| | | order: 'asc', |
| | | sort: 'goodsSort' |
| | | }, |
| | | pageSessionNo:"", |
| | | sendOnShow:false, |
| | | actionParam:{ |
| | | sessionId:'', |
| | | actionType:"PAGE", |
| | | joinType:"SELF", |
| | | pageCode:"SHOPPING_SQUARE", |
| | | pageParams:"{}", |
| | | pageStatus:"JOIN", |
| | | pageType:"LIST" |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | console.log(this.maxPages) |
| | | } |
| | | }, |
| | | onUnload() { |
| | | let param = this.actionParam; |
| | | if (this.sendOnShow)return |
| | | param.pageStatus = "LEAVE" |
| | | userAction(param) |
| | | }, |
| | | onHide() { |
| | | this.startHidenTime = Date.now() |
| | | let param = this.actionParam; |
| | | this.sendOnShow = true; |
| | | param.pageStatus = "LEAVE" |
| | | userAction(param) |
| | | }, |
| | | onShow() { |
| | | getSessionId().then(res=>{ |
| | | this.pageSessionNo = res.data.data |
| | | if(this.pageSessionNo){ |
| | | let param = this.actionParam; |
| | | param.sessionId = this.pageSessionNo |
| | | userAction(param) |
| | | } |
| | | }) |
| | | }, |
| | | async onLoad(options) { |
| | | this.actionParam.pageParams = JSON.stringify(options) |
| | | |
| | | async onLoad() { |
| | | await this.getCartList(); |
| | | // 获取状态栏高度 |
| | | const systemInfo = uni.getSystemInfoSync(); |