Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
swx_weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2023-03-01 14:42:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
28a4a0b63c1aa627abab0ba74307bb59574adde8
28a4a0b6
1 parent
a2d49d06
改成长按显示图片
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
src/pages/activityDetail/index.vue
src/pages/activityDetail/index.vue
View file @
28a4a0b
<!--
* @Date: 2022-09-26 14:36:57
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-03-01 1
1:20:02
* @LastEditTime: 2023-03-01 1
4:38:49
* @FilePath: /swx/src/pages/activityDetail/index.vue
* @Description: 活动详情页
-->
...
...
@@ -182,11 +182,33 @@ onMounted(async () => {
nickname.value = data.user.nickname;
avatar.value = data.user.avatar ? data.user.avatar : 'http://gyzs.onwall.cn/tou%402x.png';
}
// 给每张图片添加
长按
事件
// 给每张图片添加
查看
事件
nextTick(() => {
var imgs = $('#taro_html').children('.h5-p').children('.h5-img');
imgs.forEach(function (img) {
$(img).attr('show-menu-by-longpress', true)
// $(img).attr('show-menu-by-longpress', true)
$(img).on('longpress', function (e) {
Taro.previewImage({
// 需要预览的图片链接列表
urls: [$(img).attr('src')],
// 为当前显示图片的链接/索引值
current: $(img).attr('src'),
// 图片指示器样式
indicator:'default',
// 是否可循环预览
loop:false,
// 长按图片显示操作菜单,如不填默认为保存相册
// longPressActions:{
// itemList:[this.l('发送给朋友'),this.l]
// },
success: res => {
console.warn('res', res);
},
fail: err => {
console.error('err', err);
}
})
})
})
})
})
...
...
Please
register
or
login
to post a comment