Sfoglia il codice sorgente

保持更新

master
Eddie 3 anni fa
parent
commit
59e2e04b5c
3 ha cambiato i file con 46 aggiunte e 13 eliminazioni
  1. +10
    -2
      pages/detailContent/detailContent.js
  2. +1
    -1
      pages/detailContent/detailContent.wxml
  3. +35
    -10
      pages/pageSerchDetail/pageSerchDetail.js

+ 10
- 2
pages/detailContent/detailContent.js Vedi File

@@ -33,6 +33,15 @@ Page({
},


getImg( ev){
wx.previewImage({
current: '',
urls: [ev.currentTarget.dataset.img]
})
},


// 右滑翻页
onbolwerRight: function () {
console.log(this.data.searchData[this.data.searchData.length - 1])
@@ -143,8 +152,7 @@ Page({


initOn: function (params) {
// const eventChannel = this.getOpenerEventChannel()
console.log(params ,'params')

// eventChannel.on('acceptDataFromOpenerPage', (data, list, paginate, finData) => {

let isItem = 0;


+ 1
- 1
pages/detailContent/detailContent.wxml Vedi File

@@ -14,7 +14,7 @@
<swiper class="swiper" current="{{ isItem }}" bindchange="onSwiperItem">
<block wx:for="{{searchData}}" wx:key="index">
<swiper-item>
<view class="imageUrl-box">
<view class="imageUrl-box" bindtap="getImg" data-img="{{ item.img }}">
<view class="itemTitle">色号:{{item.name}}</view>
<image class="imageUrl" src="{{ item.img }}"></image>
</view>


+ 35
- 10
pages/pageSerchDetail/pageSerchDetail.js Vedi File

@@ -11,6 +11,8 @@ Page({
data: {
searchData: [],
paginate: null,
p: 1,
total: 0,
},
skipSearch: function () {
wx.navigateTo({
@@ -22,26 +24,40 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.init(JSON.parse(options.param))
this.data.finData = (JSON.parse(options.param))
this.init()
wx.setNavigationBarTitle({
title: JSON.parse(options.param).name
})
},

init: function (params) {
init: function () {
utils.http({
url: '/manicureApi/Index/finishedProduct',
method: 'GET',
data: {
color_id: params.id,
color_id: this.data.finData.id,
p: this.data.p,
limit: 40,
}
}).then(res => {
this.setData({
searchData: res.data.lists,
}, () => {
this.data.paginate = res.data.paginate
this.data.finData = params
})

if (this.data.p >= 2) {
this.setData({
searchData: this.data.searchData.concat(res.data.lists),
}, () => {
this.data.paginate = res.data.paginate
})
} else {
this.setData({
searchData: res.data.lists,
total: res.data.paginate.total
}, () => {
this.data.paginate = res.data.paginate
})
}

})
},

@@ -105,7 +121,16 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

if (this.data.searchData.length < this.data.total ) {
this.data.p ++
this.init()
} else {
wx.showToast({
title: '已经到底了~',
duration: 2000,
icon: 'none',
})
}
},

/**


Caricamento…
Annulla
Salva