1. Preview, save and identify QR codes with parameters after rendering multiple images in a loop
wxml page
<view wx:for=“{{imgalist}}” wx:for-item=“image” class=“previewimg”> <image src=“{{image}}” data-src=“{{image}}” bindtap=“previewImage”></image> </view> jspage Page({ data: { imgalist: [‘/video/','/video/'], }, previewImage: function (e) { ({ current: , // http link for the currently displayed imageurls: // List of pictures that need to be previewed}) }, })
2. Preview, save and identify single image QR code with parameters
<!–pages/dis_dil/dis_d5.wxml–> <text class=‘search_no'>Click to save and share the QR code</text> <view class=‘view_img' > <image class=‘img' bindtap=“previewImage” src=‘{{scene}}'></image></view> // pages/dis_dil/dis_d5.js var app = getApp(); Page({ data: { scene: ” }, onLoad: function (options) { var that = this var scene_img = ” //Address of the image added here({ scene: scene_img }) }, previewImage: function (e) { ({ urls: (‘,') // http link for previewed images Use split to convert strings into arrays. Otherwise, there will be an error}) } })
Summarize
The above is the WeChat mini program introduced by the editor to you. Click on the picture to achieve long press and hold preview, save, identify QR code with parameters, forwarding and other functions. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support for my website!
If you think this article is helpful to you, please reprint it. Please indicate the source, thank you!