可以参考我这个试试 this.data.listData.sort(this.compare('time')) compare: function (property) { return function (a, b) { var value1 = Date.parse(a[property]); var value2 = Date.parse(b[property]); return value2 - value1; } },
可以排序的表格如何写?做小程序才没几天,求助[图片] 最多写出这样一个表格,排序是不会,求大佬解答 <view class="table"> <view class="tr bg-w"> <view class="th" bindtap="sortT">Time</view> <view class="th">Status</view> <view class="th ">Method</view> </view> <block wx:for="{{listData}}" wx:key="{{time}}"> <view class="tr bg-g" wx:if="{{index % 2 == 0}}"> <view class="td">{{item.time}}</view> <view class="td">{{item.status}}</view> <view class="td">{{item.method}}</view> </view> <view class="tr" wx:else> <view class="td">{{item.time}}</view> <view class="td">{{item.status}}</view> <view class="td">{{item.method}}</view> </view> </block> </view> .table { border: 0px solid darkgray; padding: 20rpx 10rpx; } .tr { display: flex; width: 100%; justify-content: center; height: 3rem; align-items: center; } .td { width:50%; justify-content: center; text-align: center; } .bg-w{ background: #0089dd; opacity: 0.6; } .bg-g{ background: #E6F3F9; } .th { width: 50%; justify-content: center; background: #0089bb; color: #fff; display: flex; height: 3rem; align-items: center; } Page({ data:{ listData: [ { "time": "time1", "status": "status1", "method": "method1" }, { "time": "time2", "status": "status2", "method": "method2" }, { "time": "time3", "status": "status3", "method": "method3" }, { "time": "time4", "status": "status4", "method": "method4" }, { "time": "time5", "status": "status5", "method": "method5" }, { "time": "time6", "status": "status6", "method": "method6" } ] }, onLoad: function () { console.log('onLoad') }, onShow(){ }, sortT:function (e) { } })
2020-03-05我猜你没有解密
为什么无法获取到unionid?小程序appid:wx4eeb5c29b71c93cb 微信公众号appid:wxf0b5b8b777b14171 开放平台id:gh_e9d58ab7be0b 小程序和公号都已经绑定了开放平台,并且都已经完成了认证,也是按照这篇文档里说明的方式来操作的: https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 但是始终无法获取到unionid,不知道是什么原因……
2020-03-05这是啥神仙操作,传参的话把参数绑全局变量多简便噢
switchTab的成功回调中调用navigateTo,显示调用成功,实际页面不跳转[图片]
2020-03-04亮代码看看?
wx.navigateBack 返回上一页是在onshow里设置setData 页面没有渲染成功?wx.navigateBack, 微信开发者工具 ,调试基础库2.10.2
2020-03-04tabbar页面就是app.json配置的tabbar 跳tabbar页面要用wx.switchTab
tabbar 页面是什么意思?如何在程序中进入API中有关wx.navigateTo函数说: 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。 请问tabbar 页面就是指在app.json中tabBar list中指定的页面吗? 如果在程序中需要跳转到此页面,怎么做呢?让用户自己点击不是个好方法吧?
2020-03-04好奇这是怎么弄的 微信打开是拼多多...
长链接转短链接的结果,有时候生成的短链接会100%转到拼多多广告页https://developers.weixin.qq.com/doc/offiaccount/Account_Management/URL_Shortener.html 如题: 长链接转短链接的结果,有时候生成的短链接会100%转到拼多多广告页。电脑端打开没问题,移动端打开100%转到广告页。有时候转到了拼多多,有时候转到了别的广告页,甚至是色情页面。 我们的产品是面对k12,对这些东西很敏感,麻烦尽快查看处理。需要例子的话,可以私下提供 盼复
2020-03-04建议看一遍教学视频
{{ }}表示什么意思?例如: data-index = '{{index}}'
2020-03-04你这代码有点看不懂app.json有tabbar了 然后自定义一个组件 那页面的json没导入 "usingComponents": { "tab-bar": "/custom-tab-bar/index" }
页面向tabBar组件传值?https://developers.weixin.qq.com/s/ZsEfOAmq7Ofa。我在预约页面点击按钮,弹到一个新页面,新页面自定义组件我<tab-bar selected="{{1}}"> </tab-bar>传的是1,应该选中为1,可是还是选中0第一个页面
2020-03-04在success和fail回调打印下看下回调信息试试
一套代码,showToast,showModel 在iOS端无法弹出请问怎么解决?测试的时候就发现这个问题,以为审核通过就没问题了,结果发现还是有问题 下图左Android,右iOS,Android预约比赛后有弹窗,但是iOS没有,showModel ,showToast都不行. [图片][图片] 小程序码 [图片]
2020-03-04看下在回调打印一下试试有没有报错
Android下微信分享跳转到选择分享给谁,点击分享给谁都没反应?接入微信的登录、支付、和分享,使用的wechat-sdk-android-without-mta:5.5.8这个SDK。 Android端cocos接入。登录和支付已经正常。 但只有分享功能可以跳到选择分享给谁的界面,但点击分享给谁都没反应。 private void wxShare(final String params) { Log.e(TAG, "ShareWX 333"); try { JSONObject json = new JSONObject(params); if(null == json) { Log.e(TAG, "ShareWX 444"); Toast.makeText(this, "WWWWWWQQQQQQQQ", Toast.LENGTH_SHORT).show(); return; } WXWebpageObject webpage = new WXWebpageObject(); webpage.webpageUrl = "http://www.qq.com"; Log.e(TAG, "ShareWX 555"); WXMediaMessage msg = new WXMediaMessage(webpage); msg.title = "WebPage Title Very Long"; msg.description = "WebPage Description Very Long"; Log.e(TAG, "ShareWX 666"); // int thumbSize = 150; // Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.send_img); // Bitmap thumbBmp = Bitmap.createScaledBitmap(bmp, thumbSize, thumbSize, true); // bmp.recycle(); // msg.thumbData = Util.bmpToByteArray(thumbBmp, true); msg.thumbData = null; SendMessageToWX.Req req = new SendMessageToWX.Req(); req.transaction = buildTransaction("webpage"); req.message = msg; String scene = SendMessageToWX.Req.WXSceneSession; Log.e(TAG, "ShareWX 777"); api.sendReq(req); Log.e(TAG, "ShareWX 888"); } catch (JSONException e) { Log.e(TAG, e.getMessage()); Toast.makeText(this, "分享数据异常: " + e, Toast.LENGTH_SHORT).show(); } } 分享代码附近的日志: 03-04 12:35:54.720 D/JniHelper(24777): JniHelper::getJavaVM(), pthread_self() = -845010576 03-04 12:35:54.721 E/MicroMsg.WXEntryActivity(24777): ShareWX 1 03-04 12:35:54.721 E/MicroMsg.WXEntryActivity(24777): ShareWX 2 03-04 12:35:54.721 E/MicroMsg.WXEntryActivity(24777): ShareWX 333 03-04 12:35:54.721 E/MicroMsg.WXEntryActivity(24777): ShareWX 555 03-04 12:35:54.721 E/MicroMsg.WXEntryActivity(24777): ShareWX 666 03-04 12:35:54.721 E/MicroMsg.WXEntryActivity(24777): ShareWX 777 03-04 12:35:54.721 D/MicroMsg.SDK.WXMsgImplComm(24777): ignore wechat app signature validation 03-04 12:35:54.721 I/MicroMsg.SDK.WXApiImplV10(24777): sendReq, req type = 2 03-04 12:35:54.734 D/ (24777): addLayerName, tid:24799 03-04 12:35:54.745 I/AppFASManager( 1987): set fas when standby protected app list changed : 03-04 12:35:54.750 D/ (24777): addLayerName, tid:24799 03-04 12:35:54.773 V/ActivityManager( 1174): Successfully start provider ContentProviderRecord{fc50043 u0 com.tencent.mm/.plugin.base.stub.WXCommProvider} launchingApp=null caller pid= 24777 03-04 12:35:54.774 I/NetworkPolicy( 1174): updateRuleForRestrictBackgroundUL(10493): isForeground=true, isBlacklisted=false, isWhitelisted=true, isRestrictedByAdmin=false, oldRule=0 (NONE), newRule=1 (ALLOW_METERED), newUidRules=1 (ALLOW_METERED), oldUidRules=0 (NONE), mRestrictBackground=false 03-04 12:35:54.782 I/MicroMsg.SDK.WXApiImplV10(24777): getTokenFromWX token is OpenSdkToken@1583296554779 03-04 12:35:54.783 D/MicroMsg.SDK.MMessageAct(24777): send, targetPkgName = com.tencent.mm, targetClassName = com.tencent.mm.plugin.base.stub.WXEntryActivity 03-04 12:35:54.784 D/ (24777): addLayerName, tid:24799 03-04 12:35:54.784 I/AISched FPS( 604): currentfps 60,detected fps 60,flag 0,high 12,low 8,sleepPercent 0.775324,old 8,new 8 03-04 12:35:54.788 I/ActivityManager( 1174): START u0 {flg=0x18000000 hwFlg=0x10 cmp=com.tencent.mm/.plugin.base.stub.WXEntryActivity (has extras)} from uid 10512 03-04 12:35:54.789 I/ActivityManager( 1174): ActivityRecord info: ActivityInfo{cb0904a com.tencent.mm.plugin.base.stub.WXEntryActivity} 03-04 12:35:54.793 I/PF_FREQ_GRP( 613): [recordLimitCmd:65] [GPU] end limit freq 550000000 ~ 767000000 03-04 12:35:54.794 I/PG_ash ( 1987): front pkg : com.tencent.mm launcher: false 03-04 12:35:54.794 I/PG_ash ( 1987): above launcher front pkgs: [com.rockgame.kmall, com.tencent.mm] 03-04 12:35:54.800 D/ (24777): addLayerName, tid:24799 03-04 12:35:54.831 V/ActivityManager( 1174): addChild: attaching stackId=38 to displayId=0 position=6 03-04 12:35:54.831 V/ActivityManager( 1174): positionChild stackId=38 to top. 03-04 12:35:54.849 V/ActivityManager( 1174): positionChild stackId=38 to top. 03-04 12:35:54.851 V/WindowManager( 1174): addAppToken: AppWindowToken{36f6716 token=Token{df28431 ActivityRecord{1e7c8d8 u0 com.tencent.mm/.plugin.base.stub.WXEntryActivity t39}}} controller={TaskWindowContainerController taskId=39} at 2147483647 03-04 12:35:54.866 D/ (24777): addLayerName, tid:24799 03-04 12:35:54.867 D/ ( 620): doWinFrameOptStatusRecog begin to recog Layer result=2 03-04 12:35:54.867 I/StatusBarDisable( 1174): setFlags what=0 which=1 pkg=Window{fc9159e u0 com.rockgame.kmall/com.rockgame.kmall.wxapi.WXEntryActivity} 03-04 12:35:54.868 D/MicroMsg.SDK.MMessageAct(24777): send mm message, intent=Intent { flg=0x18000000 cmp=com.tencent.mm/.plugin.base.stub.WXEntryActivity (has extras) } 03-04 12:35:54.868 E/MicroMsg.WXEntryActivity(24777): ShareWX 888 03-04 12:35:54.884 D/ (24777): addLayerName, tid:24799 03-04 12:35:54.887 D/Cocos2dxActivity(24777): onPause() 03-04 12:35:54.887 D/ZrHung.AppEyeUiProbe(24777): stop checker. 03-04 12:35:54.888 V/ActivityManager( 1174): Making visible and scheduling visibility: ActivityRecord{1e7c8d8 u0 com.tencent.mm/.plugin.base.stub.WXEntryActivity t39} 03-04 12:35:54.888 I/NetworkPolicy( 1174): updateRuleForRestrictBackgroundUL(10493): isForeground=false, isBlacklisted=false, isWhitelisted=true, isRestrictedByAdmin=false, oldRule=1 (ALLOW_METERED), newRule=0 (NONE), newUidRules=0 (NONE), oldUidRules=1 (ALLOW_METERED), mRestrictBackground=false 03-04 12:35:54.888 D/HwPhoneWindowManager( 1174): sensorRotation = -1 lastRotation:0 03-04 12:35:54.890 W/ActivityThread(19164): handleWindowVisibility: no activity for token android.os.BinderProxy@bed77d3 03-04 12:35:54.897 I/AppFastHibernation( 1987): rev F_Z exception for visible pkg: com.tencent.mm 03-04 12:35:54.898 D/ (24777): addLayerName, tid:24799 03-04 12:35:54.913 W/HwActivityManagerServiceEx( 1174): appSwitch from: com.rockgame.kmall to: com.tencent.mm 03-04 12:35:54.913 W/HwActivityManagerServiceEx( 1174): HwActivityNotifier end call for appSwitch under user 0 cost 0 03-04 12:35:54.913 D/AssistantService-1000102( 1905): registerHwActivityNotifier call fromPackage:com.rockgame.kmall, toPackage:com.tencent.mm 03-04 12:35:54.914 D/AssistantService-1000102( 1905): handleMessage app switch fromPackage:com.rockgame.kmall, toPackage:com.tencent.mm 03-04 12:35:54.914 D/HwGameAssistantController( 1174): UPDATE: mCurFgPkg=com.tencent.mm, mCurFgPid=19164, mCurIsGame=false 03-04 12:35:54.914 D/HwGameAssistantController( 1174): getGameList: [] 03-04 12:35:54.914 D/AssistantService-1000102( 1905): package:com.rockgame.kmall inAppAssistant:false 03-04 12:35:54.914 D/ZrHung.AppEyeFocusWindow( 1174): FocusWindowErrorScene CheckFreezeScreen 03-04 12:35:54.914 D/ZrHung.AppEyeTransparentWindow( 1174): TransparentWindow cancelCheckFreezeScreen 03-04 12:35:54.914 D/AssistantService-1000102( 1905): package:com.tencent.mm inAppAssistant:false 03-04 12:35:54.914 D/ScenarioService( 1987): front pkg : com.tencent.mm launcher: false 03-04 12:35:54.914 D/ScenarioService( 1987): new above launcher front pkgs: [com.rockgame.kmall, com.tencent.mm] 03-04 12:35:54.914 I/AppManager( 1987): handleAppFrontEvent: com.tencent.mm 03-04 12:35:54.914 D/ZrHung.AppEyeUiProbe(19164): notify runnable to start. 03-04 12:35:54.914 D/ZrHung.AppEyeUiProbe(19164): restart watching
2020-03-04