能不能把你上面代码整理一下 搞成一个代码片段 这样看的头疼 https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
想实现图片轮播并且跳转页面实现不了,是因为swiperImg组的问题吗?还是因为wxss求大佬解答index.wxml <view class="main"> <swiper indicator-dots="true" autoplay="true" interval="{{interval}}" duration="{{duration}}" circular="true"> <swiper-item wx:for="{{swiperImg}}" wx:key=''> <navigator url="{{item.url}}"> <image src="{{item.img}}" class="slide-image" width="100%"/> </navigator> </swiper-item> </swiper> <view class='notice'> <view class="left"> <text class='iconfont icon-labagonggao voice'></text> <view class="left-box"> <view class="left-text"></view> <view class='content-box'> <view class='content-text' animation="{{animationData}}"><text id="text">{{text}}</text></view> </view> <view class="right-text"></view> </view> </view> <view class="right" bindtap="goApp"> <!-- <image class="app" mode="aspectFit" src="/assets/images/app.png" style="width:{{widthrpx}}rpx" bindload="imageLoad"></image> --> </view> </view> <view class="search"> <navigator url="search/search"> <view class="search-text"> <icon class="weui-icon-search_in-box search-icon" type="search" size="14"></icon> 搜 索 </view> </navigator> </view> <view class="selected"> <view class="select-title"><text>精选主题</text></view> <view class="select-top"> <view class="select-top-small"> <navigator url="list/list"> <image src="/image/s1.png"></image> </navigator> </view> <view class="select-top-small"> <navigator url="list/list"> <image src="/image/s2.png"></image> </navigator> </view> </view> <view class="select-bottom"> <navigator url="list/list"> <image src="/image/s3.png"></image> </navigator> </view> </view> <view class="newest"> <view class="newest-title"><text>最近新品</text></view> <view class="newest-box"> <view class="newest-list"> <navigator url="details/details"> <image src="/image/s111.png"></image> <view class="newest-text"><text>真姬菇 150g</text></view> <view class="newest-text"><text>¥ 9.9</text></view> </navigator> </view> <view class="newest-list"> <navigator url="bydetails/bydetails"> <image src="/image/s5.png"></image> <view class="newest-text"><text>白玉菇 150g</text></view> <view class="newest-text"><text>¥ 9.9</text></view> </navigator> </view> <view class="newest-list"> <navigator url="lrdetails/lrdetails"> <image src="/image/s6.png"></image> <view class="newest-text"><text>鹿茸菇 150g</text></view> <view class="newest-text"><text>¥ 19.9</text></view> </navigator> </view> <view class="newest-list"> <navigator url="yddetails/yddetails"> <image src="/image/s4.png"></image> <view class="newest-text"><text>羊肚菌 10g</text></view> <view class="newest-text"><text>¥ 29.9</text></view> </navigator> </view> <view class="newest-list"> <navigator url="ccdetails/ccdetails"> <image src="/image/s7.png"></image> <view class="newest-text"><text>虫草花 150g</text></view> <view class="newest-text"><text>¥ 29.9</text></view> </navigator> </view> <view class="newest-list"> <navigator url="details/details"> <image src="/image/s8.png"></image> <view class="newest-text"><text>姬松茸 150g</text></view> <view class="newest-text"><text>¥ 19.9</text></view> </navigator> </view> <view class="newest-list"> <navigator url="hshdetails/hshdetails"> <image src="/image/s9.png"></image> <view class="newest-text"><text>灰树花 150g</text></view> <view class="newest-text"><text>¥ 29.9</text></view> </navigator> </view> <view class="newest-list"> <navigator url="ngdetails/ngdetails"> <image src="/image/s11.png"></image> <view class="newest-text"><text>牛肝菌 10g</text></view> <view class="newest-text"><text>¥ 29.9</text></view> </navigator> </view> <view class="newest-list"> <navigator url="xqjdetails/xqjdetails"> <image src="/image/s12.png"></image> <view class="newest-text"><text>绣球菌 150g</text></view> <view class="newest-text"><text>¥ 19.9</text></view> </navigator> </view> </view> </view> </view> index.js Page({ data: { swiperImg: [ {img:"/image/b1.jpg", url:'../component/bydetails/bydetails'}, {img:"/image/b2.jpg", url:'../component/details/details'}, {img:"/image/b3.jpg", url:'../component/ccdetails/ccdetails'} ], indicatorDots: false, autoplay: false, interval: 3000, duration: 800, text: "新人有优惠", animation: null, timer: null, textWidth: 0, wrapWidth: 0 }, onShow() { this.initAnimation(this.data.text) }, onHide() { this.destroyTimer() this.setData({ timer: null }) }, onUnload() { this.destroyTimer() this.setData({ timer: null }) }, destroyTimer() { if (this.data.timer) { clearTimeout(this.data.timer); } }, /** * 开启公告字幕滚动动画 * @param {String} text 公告内容 * @return {[type]} */ initAnimation(text) { let that = this this.data.duration = 15000 this.data.animation = wx.createAnimation({ duration: this.data.duration, timingFunction: 'linear' }) let query = wx.createSelectorQuery() query.select('.content-box').boundingClientRect() query.select('#text').boundingClientRect() query.exec((rect) => { that.setData({ wrapWidth: rect[0].width, textWidth: rect[1].width }, () => { this.startAnimation() }) }) }, // 定时器动画 startAnimation() { //reset // this.data.animation.option.transition.duration = 0 const resetAnimation = this.data.animation.translateX(this.data.wrapWidth).step({ duration: 0 }) this.setData({ animationData: resetAnimation.export() }) // this.data.animation.option.transition.duration = this.data.duration const animationData = this.data.animation.translateX(-this.data.textWidth).step({ duration: this.data.duration }) setTimeout(() => { this.setData({ animationData: animationData.export() }) }, 100) const timer = setTimeout(() => { this.startAnimation() }, this.data.duration) this.setData({ timer }) } }) index.wxss @import '../common/common.wxss'; .search{ padding: 20rpx; } .search-text{ display: flex; justify-content: center; align-items: center; height: 50rpx; color: #aaa; text-align: center; border: 1px solid #ddd; border-radius: 20rpx; } .search-text icon{ margin-right: 10rpx; } swiper { height: 421.5rpx; } swiper-item image { width: 100%; height: 100%; } .select-title,.newest-title{ width: 100%; padding:30rpx 0; height: 40rpx; color: #AB956D; text-align: center; } .select-top-small{ width: 375rpx; height: 375rpx; float: left; } .select-bottom,.select-top{ width: 100%; height: 375rpx; } .select-top-small image,.select-bottom image,.select-top-small navigator,.select-bottom navigator{ display: block; width: 100%; height: 100%; } .newest-box{ padding:0 40rpx; } .newest-box .newest-list{ display: inline-block; width: 325rpx; height: 325rpx; margin:0 20rpx 20rpx 0; border-radius: 10px; text-align: center; background: #f5f6f5; } .newest-box .newest-list:nth-child(2n){ margin-right: 0; } .newest-box .newest-list image{ width: 175rpx; height: 175rpx; margin: 20rpx 0 10rpx; } .newest-box .newest-list .newest-text{ font-size: 32rpx; }
2021-05-12提供一个复现代码片段呗
wx.addFileToFavorites收藏文件后无法打开文件?[图片] [图片] 文件收藏成功后,但没有正确的保存文件,请问如何修改了?
2021-05-12链接后面加一个时间戳
webView 缓存?webView 缓存:一般多长时间会自动更新。
2021-05-12怎样设置的
小程序input组件 placeholder设置text-align:right;真机不生效?小程序input组件 placeholder设置text-align:right;开发者工具有效,到了真机就不生效了!?
2021-05-12看一下报什么错误信息呐
关于wx.uploadfile失败问题?我贴下两用方式的代码,用node方式就可以上传,微信uploadfile就不可以,请老师帮看看,谢谢 uploadBusiMaterial() { let that = this console.log(that.data.files[0]) wx.uploadFile({ filePath: that.data.files[0], header: { 'Content-Type': 'multipart/form-data' }, method: 'POST', name: 'name', url: 'http://192.168.3.41:9000/proxy/upload', formData: { 'uid': '3336', 'type': 'doc', 'folder_name': '个人网盘' }, success(res) { console.log(res) } }) }, Node方式 let form = new FormData() form.append('file', fs.createReadStream(path))//'file'是服务器接受的key form.append('uid','3336') form.append('type','doc') form.append('folder_name', '个人网盘') // let boundaryKey = '----' + new Date().getTime() // 用于标识请求数据段 let options = { host: '192.199.32.106', // 远端服务器域名 port: 44, // 远端服务器端口号 method: 'POST', path: '/WebDiskServerDemo/upload', // 上传服务路径 headers: form.getHeaders() } console.log(form.getHeaders()) let req = http.request(options, function(res){ res.setEncoding('utf8') res.on('data', function(chunk) { console.log('body: ' + chunk) }) res.on('end', function() { console.log('res end.') }) }) form.pipe(req)
2021-05-11不是提示了 这个没配置啊[图片]
配置了自己的域名还是不在以下 request 合法域名列表中?[图片][图片][图片] 我思索我啥也没配置错呀,求大佬告诉我一下,端口也配了,数据还是加载不了
2021-05-11变黑能播放吗?
IOS真机:video标签poster值改了之后不显示,这是bug?video标签,poster和src都是变量,更换视频后src赋值正常,poster没了,视频区域变成了黑色块 只有第一次赋值时正常显示,图片没有问题,用Cavnas image能加载成功的 这是一个bug吗?
2021-05-11https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html[图片]
新授权获取个人微信信息接口,获取不到unionid通过新授权接口获取到code iv encryptedData 这三个参数传递给后端,获取不到unionid,只能获取到openid和nickname等一些信息, 前端授权接口没改之前是可以拿到的,改了之后一直拿不到
2021-05-11看一下是否有报错
wx.showToast加定时器依旧不显示提示信息?请问是哪里出了问题?只要加上跳转页面,wx.showToast就没办法好好显示,加上定时器延长时间也无法显示 [图片]
2021-05-11分包呐 主包就放tab的页面 其他的都放在分包内
taro 微信小程序开发 代码包超过2048kb导致不能上传和真机调试问题?这种怎么解决
2021-05-11