|
@@ -2,18 +2,6 @@
|
|
|
|
|
|
import { api_shopProduct } from "../../api/login";
|
|
|
import { debounce } from '../../utils/util'
|
|
|
-// 定义节流函数
|
|
|
-// function throttle(func: any, delay: any) {
|
|
|
-// let timer: any = null;
|
|
|
-// return function () {
|
|
|
-// if (!timer) {
|
|
|
-// func.apply(this, arguments);
|
|
|
-// timer = setTimeout(() => {
|
|
|
-// timer = null;
|
|
|
-// }, delay);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
// 获取应用实例
|
|
|
const app = getApp<IAppOption>()
|
|
|
// pages/orders/orders.ts
|
|
@@ -36,8 +24,8 @@ Page({
|
|
|
'https://oss.dayaedu.com/ktyq/1732175006625.png',
|
|
|
'https://oss.dayaedu.com/ktyq/1732175021350.png',
|
|
|
'https://oss.dayaedu.com/ktyq/1732175031878.png',
|
|
|
- 'https://oss.dayaedu.com/ktyq/1732175041724.png',
|
|
|
- 'https://oss.dayaedu.com/ktyq/1732507279822.png'
|
|
|
+ 'https://oss.dayaedu.com/ktyq/1732617269723.png',
|
|
|
+ 'https://oss.dayaedu.com/ktyq/1732617388991.png'
|
|
|
],
|
|
|
serviceShow: true,
|
|
|
scrollTop: 0,
|
|
@@ -57,6 +45,7 @@ Page({
|
|
|
scrollIntoViewType: false,
|
|
|
headerHeight: 0, // 头部的高度
|
|
|
initialScrollHeight: 0, // 滚动高度
|
|
|
+ isFromPreviewImage: false,
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -219,26 +208,47 @@ Page({
|
|
|
onPreivewBannerImg(e: { currentTarget: { dataset: any } }) {
|
|
|
wx.previewImage({
|
|
|
current: e.currentTarget.dataset.src,
|
|
|
- urls: this.data.imgList
|
|
|
+ urls: this.data.imgList,
|
|
|
+ success: () => {
|
|
|
+ this.setData({
|
|
|
+ isFromPreviewImage: true
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
onPreivewGoodsImg(e: { currentTarget: { dataset: any } }) {
|
|
|
wx.previewImage({
|
|
|
current: e.currentTarget.dataset.src,
|
|
|
- urls: this.data.goodsImgList
|
|
|
+ urls: this.data.goodsImgList,
|
|
|
+ success: () => {
|
|
|
+ this.setData({
|
|
|
+ isFromPreviewImage: true
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
onPreivewGoods(e: { currentTarget: { dataset: any } }) {
|
|
|
wx.previewImage({
|
|
|
current: e.currentTarget.dataset.src,
|
|
|
- urls: [e.currentTarget.dataset.src]
|
|
|
+ urls: [e.currentTarget.dataset.src],
|
|
|
+ success: () => {
|
|
|
+ this.setData({
|
|
|
+ isFromPreviewImage: true
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow() {
|
|
|
- this.onInit()
|
|
|
+ if(!this.data.isFromPreviewImage) {
|
|
|
+ this.onInit()
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ isFromPreviewImage: false
|
|
|
+ })
|
|
|
+ }
|
|
|
this.setData({
|
|
|
serviceShow: true
|
|
|
})
|