- 从首页点击进入第二页面,第二个页面点击返回,想看到首页最新页面,怎么触发首页更新呢?
请大侠帮忙一下,谢谢!
2022-04-04 - radio单选,点击文字也能勾上,但不生效,只是勾上,不想文字也勾上,咋办?
js radiocon: function (e) { this.setData({ check: !this.data.check }) // anonymous = this.data.check; // console.log("用户打勾的是 ", this.data.check) }, wxml <radio checked='{{check}}' id="radios" bindtap='radiocon'></radio><label for="radios">匿名</label> wxss /* 单选框样式 */ /* 初始样式 */ radio .wx-radio-input{ width: 32rpx; height: 32rpx; border-radius: 0 } /* 选中后的 背景样式 ( 背景 边框 ) */ radio .wx-radio-input.wx-radio-input-checked{ width: 32rpx; /* 选中后对勾大小,不要超过背景的尺寸 */ height: 32rpx; /* 选中后对勾大小,不要超过背景的尺寸 */ background:white!important; } /* 选中后的 对勾样式 */ radio .wx-radio-input.wx-radio-input-checked::before{ width: 32rpx; /* 选中后对勾大小,不要超过背景的尺寸 */ height: 32rpx; /* 选中后对勾大小,不要超过背景的尺寸 */ line-height: 32rpx; text-align: center; font-size:36rpx; /* 对勾大小 */ color:black; /* 对勾颜色 */ background: white; transform:translate(-50%, -50%) scale(1); -webkit-transform:translate(-50%, -50%) scale(1); }
2022-04-03 - 怎么判断是视频呢,根据文件后缀.mp4?
我看大部分视频都是.mp4,有没有方法可以判断是否是视频呢?
2022-03-29 - <video,这是视频标签,有啥标签可以兼容视频和图片呢?
有啥标签可以包括视频和图片呢?
2022-03-29 - /my/searchUserinfo.js" is not defined?
调试时,发现sources里面没有这个js脚本,请教大侠帮忙看看 VM5570 WAService.js:2 Error: module "pages/my/searchUserinfo.js" is not defined at p (VM5570 WAService.js:2) at <anonymous>:5106:7 at doWhenAllScriptLoaded (<anonymous>:5505:21) at Object.scriptLoaded (<anonymous>:5533:5) at Object.<anonymous> (<anonymous>:5558:22)(env: Windows,mp,1.05.2201240; lib: 2.22.0) [图片]
2022-03-27 - 变量自增为_.inc(1),自减的_.inc(-1),这样不行?
else if (event.a == 6) { const doc = await db.collection('act_list').where({ tid: event.tid }).update({ data: { signnum: _.inc(-1), } }) return { doc } }
2022-03-24 - 怎么让活动时间左边的图标跟它保持一个水平线,调整半天也不行,求教,谢谢,怎么处理呢?
<view style="margin-top: 30rpx;margin-bottom: 30rpx;"> <view> <image src="image/clock.png" style="padding-top: 50rpx;width:40rpx;height:40rpx;margin-right: 15rpx;"></image>活动时间:{{words[0].acttime}} </view> [图片] </view>
2022-03-22 - 请教onReachBottom页面向下滑动到底部,然后页面卡住了,请教,谢谢,为什么呢?
功能是发帖后,然后展示帖,展示帖可以向下滑动,然后滑到下面就卡住了。 js部分代码 Page({ data: {}, e(t, "hasMoreData", !0), 。。。 onReachBottom: function () { this.data.hasMoreData ? (this.setData({ reachBottom: !0 }), this.ShowBbs1("")) : this.setData({ morestr: "没有更多了" }); }, wxml代码 <template name="txt"> <view class="content"> <text space="nbsp" userSelect="true">{{item.data}}</text> </view> <view style="height:5px;"></view> </template> <template name="img"> <view> <image bindload="imageLoad" bindtap="previewImage" data-index="{{item.orders}}" data-src="{{item.data}}" lazyLoad="{{true}}" src="{{item.datas}}" style="width:{{images[item.orders].width}}rpx; height:{{images[item.orders].height}}rpx;"></image> </view> </template> <scroll-view> <view class="body" wx:if="{{loaded}}"> <view hidden="true"> <input name="current" value="{{current}}"></input> <input name="maxorder" value="{{maxorder}}"></input> <input name="followk" value="{{followk}}"></input> <input name="tid" value="{{tid}}"></input> <input name="tel" value="{{tel}}"></input> </view> <view class="card"> <view class="topic"> <text space="nbsp" userSelect="true">{{words[0].subject}}</text> </view> <view class="flex" style="width:98%;margin-top:10rpx;" wx:for="{{words[0].img_arr}}" wx:for-item="item" wx:key="key"> <image src="{{item}}"></image> </view> <view class="userinfo"> <view class="userpic"> <image src="{{words[0].avatar}}" style="width:60rpx;height:60rpx;border-radius:50rpx;"></image> </view> <view class="username"> <view class="author">{{words[0].author}} <text class="level" style="background-color:{{words[0].namecolor}};">{{words[0].userlevel}}</text> </view> <view class="userlevel"> <view class="date">{{words[0].dateline}}</view> <view wx:if="{{adminrole || words[0].isauthor}}"> <button bindtap="delMybbs" class="reply" hoverClass="none" id="{{words[0].tid}}">删除</button> </view> <view class="views">跟帖:{{words[0].replies}}条</view> <view class="views">浏览:{{words[0].views}}次</view> </view> </view> </view> <view class="line"></view> <view style="height:5px;"></view> <view bindlongtap="bingLongTap" bindtouchend="bindTouchEnd" bindtouchstart="bindTouchStart" class="flex" data-title="{{words.subject}}" id="{{words.tid}}" style="width:100%"> <view class="content"> <view class="content">报名时间:{{words[0].signtime}}</view> <view class="content">活动时间:{{words[0].acttime}}</view> <view class="content">活动地点:{{words[0].actplace}}</view> <view class="content">活动人数:{{words[0].signnum}}</view> <view class="content">联系电话:{{words[0].contactphone}}</view> <view class="content">活动费用:{{words[0].cost}}</view> <view class="content">{{words[0].message}}</view> </view> </view> </view> <view class="h_line"></view> <view data-num="{{index}}" style="display:flex;width:96%;background-color:#fff;flex-direction:column;padding:10rpx;margin-left:10rpx;margin-top:10rpx;" wx:for="{{contentlist}}" wx:key="key"> <view class="userinfo" style="margin-left:10rpx;"> <view class="userpic"> <image mode="widthFix" src="{{item.avatar}}" style="padding:0rpx;width:60rpx;height:60rpx;border-radius:50rpx;"></image> </view> <view class="username" style="margin-top:16rpx;"> <view class="author" style="color:#4a6495">{{item.author}} <text class="level" style="background-color:{{item.namecolor}};">{{item.userlevel}}</text> </view> </view> </view> <view bindlongtap="DelBbs" bindtouchend="bindTouchEnd" bindtouchstart="bindTouchStart" data-title="{{item.subject}}" id="{{item.id}}" style="padding-left:70rpx;"> <view class="pid_str" wx:if="{{item.parent_id != item.ancestor_id}}"> <view style="width:100%">{{item.subject}}</view> <view style="width:100%">{{item.subject2}}</view> </view> <view class="content"> <view style="width:100%">{{item.message}}</view> </view> <view class="flex" style="width:94%;margin-top:10rpx;" wx:for="{{item.img_arr}}" wx:for-item="item2" wx:key="key"> <image src="{{item2}}"></image> </view> <view class="flex" style="width:95%"> <view wx:for="{{item.title}}" wx:for-index="idx" wx:for-item="item1" wx:key="key"> <view wx:if="{{item1.type=='img'}}"> <image bindload="imageLoad1" bindtap="previewImage" class="content-img" data-index="{{item1.orders}}" data-src="{{item1.data}}" src="{{item1.datas}}" style="width:{{images[item1.orders].width}}rpx; height:{{images[item1.orders].height}}rpx;"></image> </view> <view style="margin-left:5rpx;margin-right:5rpx;" wx:elif="{{item1.type=='mote'}}"> <image bindload="imageLoad1" class="content-img" data-index="{{item1.orders}}" data-src="{{item1.data}}" src="{{item1.datas}}" style="width:{{images[item1.orders].width}}rpx; height:{{images[item1.orders].height}}rpx;"></image> </view> <view wx:else> <view class="content_r"> <text space="nbsp" userSelect="true">{{item1.data}}</text> </view> <view style="height:5px;"></view> </view> </view> </view> <view class="flex" style="width:95%"> <view wx:for="{{item.content}}" wx:for-index="idx" wx:for-item="item1" wx:key="key"> <view wx:if="{{item1.type=='img'}}"> <image bindload="imageLoad1" bindtap="previewImage" class="content-img" data-index="{{item1.orders}}" data-src="{{item1.data}}" src="{{item1.datas}}" style="width:{{images[item1.orders].width}}rpx; height:{{images[item1.orders].height}}rpx;"></image> </view> <view style="margin-left:5rpx;margin-right:5rpx;" wx:elif="{{item1.type=='mote'}}"> <image bindload="imageLoad1" class="content-img" data-index="{{item1.orders}}" data-src="{{item1.data}}" src="{{item1.datas}}" style="width:{{images[item1.orders].width}}rpx; height:{{images[item1.orders].height}}rpx;"></image> </view> <view wx:else> <view class="content_r"> <text space="nbsp" userSelect="true">{{item1.data}}</text> </view> <view style="height:5px;"></view> </view> </view> </view> <view class="r_date"> <view class="lou">#{{index+2}}</view> <view>{{item.dateline}}</view> <button bindtap="reply" class="reply" hoverClass="none" id="{{item.tid}}">回复</button> <view wx:if="{{adminrole || item.isauthor}}"> <button bindtap="delMybbs" class="reply" hoverClass="none" id="{{item.tid}}">删除</button> </view> </view> </view> <view class="line"></view> </view> <view wx:if="{{reachBottom}}"> <view style="padding:10rpx;height:50rpx;text-align:center;">{{morestr}}</view> </view> <view id="bottom" style="height:200rpx;"></view> </view> </scroll-view> <view bindtap="hide_bg" class="page_bg" wx:if="{{block}}"> <view class="btn_bg" wx:if="{{block}}"> <view wx:for="{{infos.tels}}" wx:key="key"> <button bindtap="tel" class="sp_tit" id="{{item.number}}">拨打 {{item.number}} </button> </view> </view> </view> <view id="recordWrapper"></view> <view class="bottom" wx:if="{{loaded}}"> <view > <view class="input"> <button bindtap="reply" class="input_txt_left" hoverClass="none" id="{{words[0].tid}}"> <image src="image/input.png" style="vertical-align:middle;width:36rpx;height:42rpx;"></image> <text> 回复楼主 已有{{words.replies}}条回复</text> </button> <button class="share" id="{{words[0].tid}}" openType="share"> <image src="image/share.png" style="vertical-align:middle;width:45rpx;height:40rpx;"></image> </button> </view> </view> </view>
2022-03-21 - remove删除不成功,执行删除操作成功了,就是数据库数据没被删除?
wx.cloud.callFunction({ name:'update_bbs_list', data:{ a: 4, tid: a, }, success:res=>{ console.log("success update_bbs_list delete bbs",res); wx.showToast({ title: '删除成功', icon: 'success', duration: 1000 }) }, fail: function() { console.log("fail update_bbs_list delete bbs "); }, 下面云函数部分逻辑 else if (event.a == 4) { try { return await db.collection('bbs_list').where({ tid: event.tid }).remove() } catch (e) { console.error(e) } }
2022-03-20 - 请教云函数中条件变量不等于输入变量,怎么写呢?
我是想where条件里面 authorId不等于输入的event.authorId,我下面那样写感觉不对, !event.authorId取非了,感觉真假了,请教大侠怎么解决authorId不等于输入的event.authorId else if (event.a == 3) { const doc = await db.collection('bbs_list').where( _.and([ { tid : event.tid, }, { authorId: !event.authorId, } ])).update({ data: { views: _.inc(1), } }) return { doc } }
2022-03-17