Skip to content

Commit

Permalink
fix(engine): click the next or prev not working; (zh) 修正预览弹窗中,点击上一页和下…
Browse files Browse the repository at this point in the history
…一页失败的问题
  • Loading branch information
ly525 committed Dec 15, 2019
1 parent ef1278e commit 3eab119
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions back-end/h5-api/views/engine.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: ly525
* @Date: 2019-12-04 20:24:04
* @LastEditors: ly525
* @LastEditTime: 2019-12-14 21:46:23
* @LastEditTime: 2019-12-15 16:39:33
* @FilePath: /luban-h5/back-end/h5-api/views/engine.ejs
* @Github: https://github.com/ly525/luban-h5
* @Description: 手机端预览模板
Expand Down Expand Up @@ -275,9 +275,18 @@
},
});
function title(str) {
if (str.length <= 1) return str.toUpperCase()
return str.slice(0,1).toUpperCase() + str.slice(1)
}
function displayMessage ({ origin, data }) {
if (['next', 'prev'].includes(data) && origin === window.location.origin) {
document.querySelector(`.swiper-button-${data}`).click()
// 不采用下面的原因:在移动端和小屏幕上,会移除:.swiper-button-prev, .swiper-button-next 按钮
// document.querySelector(`.swiper-button-${data}`).click()
var action = `slide${title(data)}`
mySwiper[action]()
}
}
Expand Down

0 comments on commit 3eab119

Please sign in to comment.