- date里面的某个值再分割成数组显示(已解决)
RT。我从数据库取出了数组,但现在我想把数组中的某个值再次分割成一个数组分别显示到页面中,请问哪位大神知道怎么做? 我从数据库取出的数据如下: [{0: "彭德怀", 1: "2018.12.22", 2: "浓情腊八中国风喜庆海报",…}] 0:{0: "彭德怀", 1: "2018.12.22", 2: "浓情腊八中国风喜庆海报",…} 0:"彭德怀" 1:"2018.12.22" 2:"浓情腊八中国风喜庆海报" 3:"http://pic2.sc.chinaz.com/files/pic/psd1/201812/psd27892.jpg" 4:"<a href='http://fjdx.sc.chinaz.net/Files/DownLoad/psd1/201812/psd27892.rar' target="_blank">福建电信下载</a>" 5:"36291a" 6:"浓情腊八中国风喜庆海报适用于腊八节海报设计" 7:"中国风,腊八,腊八节,中华食味,腊月,传统节日,腊八粥,浓情腊八,猪年快乐" 8:"庆典节日PSD素材" 9:"24" 10:"0" 11:"0" 12:"0" 13:"0" 14:"usertouxiang/pengdiehua.jpg" biaoqian:"中国风,腊八,腊八节,中华食味,腊月,传统节日,腊八粥,浓情腊八,猪年快乐" cais:"0" psd_id:"36291a" psd_leibie:"庆典节日PSD素材" psd_miaoshu:"浓情腊八中国风喜庆海报适用于腊八节海报设计" psd_name:"浓情腊八中国风喜庆海报" psd_spic:"http://pic2.sc.chinaz.com/files/pic/psd1/201812/psd27892.jpg" psd_time:"2018.12.22" psd_user:"彭德怀" psd_xiazai:"http://fjdx.sc.chinaz.net/Files/DownLoad/psd1/201812/psd27892.rar" scs:"0" shares:"0" user_touxiang:"usertouxiang/pengdiehua.jpg" views:"24" zans:"0" 现在我想把此数组中的biaoqian重新按,号分割成一个数组并显示到页面中。 wxml的代码: <view id="container"> <view class="bmbox"> <ul class="bs_show_box" wx:for="{{psdinfo}}" wx:fir-item="item" wx:key="psdInfoId"> <li class="list_show_li"> <view class="list_show_user border_r"> <image class="list_show_user_touxiang" src="https://www.bbjteam.com/{{item.user_touxiang}}"></image> <navigator herf=""><text>{{item.psd_user}}\n{{item.psd_time}}</text></navigator> <view class="clearfix"></view> </view> <view class="list_show_share border_r"> <text>分享\n<block id="share_cishu"></block>{{item.shares}}次</text> </view> <view class="list_show_liulan border_r"> <text>浏览\n<block>{{item.views}}</block>次</text> </view> <view class="list_show_zan border_r"> <view class="zan"> <span class='bbjicon bbjicon-thumbs-up' id="zan_btn"></span> <text>赞\n(<block id="zan_cishu">{{item.zans}}</block>次)</text> <block class="zan_num">+1</block> </view> <view class="cai"> <span class='bbjicon bbjicon-thumbs-down' id="cai"></span> <text>踩\n(<block id="cai_cishu">{{item.cais}}</block>次)</text> </view> </view> <view class="list_show_sc"> <span class='bbjicon bbjicon-heart' id="sc"></span> <text>收藏\n(<block id="sc_cishu">{{item.scs}}</block>次)</text> </view> <view class="clearfix"></view> </li> <li><image src='{{item.psd_spic}}' ></image></li> <li>因为文件太大,请复制一下链接到浏览器下载:</li> <li> <view class="tblin_items_btn" bindtap="copyTBL">一键复制下载地址</view></li> <!-- <li><button type="primary" bindtap="DownLoadFile">复制下载地址</button></li> --> <li class='list_show_biaoqian'>相关标签: {{item.biaoqian}}</li> <li><text>注:本网站所有文件解压密码:www.bbjteam.com\n 本网站部分资源来自网络,如有侵权,请联系站长删除。\n 联系方式:QQ1343448308,TEL15361501239\n 如发现链接无法下载,或者展示图片无法显示,也请联系站长。</text> </li> </ul> </view> <view class="clearfix"></view> </view> js代码: onLoad: function (options) { this.setData({ id: options.id }); var ids = this.data.id; var that = this; wx.request({ url: 'https://www.bbjteam.com/xiaochenxu/bbjteam/index.psdinfo.php', method: 'POST', data: { ids: ids }, header: { 'content-type': 'application/x-www-form-urlencoded' }, success: function (res) { that.setData({ psdinfo: res.data, }); wx.setNavigationBarTitle({ title: that.data.psdinfo[0].psd_name, }) } }) } 页面目前效果图: [图片] 想要实现效果: [图片]
2018-12-24 - 数据库取出数据改变页面title(已解决)
RT,求大神解答。 数据库取出的数据如下: [{0: "彭德怀", 1: "2018.08.30", 2: "中秋佳节促销海报设计",…}] 0:{0: "彭德怀", 1: "2018.08.30", 2: "中秋佳节促销海报设计",…} 0:"彭德怀" 1:"2018.08.30" 2:"中秋佳节促销海报设计" 3:"http://pic2.sc.chinaz.com/files/pic/psd1/201808/psd27155.jpg" 4:"<a href='http://fjdx.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">福建电信下载</a> ↵<a href='http://xmdx.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">厦门电信下载</a> ↵<a href='http://gddx.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">广东电信下载</a> ↵<a href='http://jsdx.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">江苏电信下载</a> ↵<a href='http://fjlt.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">福建联通下载</a> ↵<a href='http://zjlt.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">浙江联通下载</a> ↵<a href='http://xmlt.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">厦门联通下载</a> ↵<a href='http://gdlt.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">广东联通下载</a> ↵<a href='http://fjyd.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">福建移动下载</a> ↵<a href='http://sxyd.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">山西移动下载</a> ↵<a href='http://xmyd.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">厦门移动下载</a> ↵<a href='http://zjyd.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">浙江移动下载</a>" 5:"36291" 6:"中秋佳节促销海报设计适用于中秋节海报设计" 7:"中秋节,中秋海报,月饼,中秋佳节,喜庆,节日素材,活动海报,促销海报,海报设计" 8:"庆典节日PSD素材" 9:"24" 10:"0" 11:"0" 12:"0" 13:"0" 14:"usertouxiang/pengdiehua.jpg" biaoqian:"中秋节,中秋海报,月饼,中秋佳节,喜庆,节日素材,活动海报,促销海报,海报设计" cais:"0" psd_id:"36291" psd_leibie:"庆典节日PSD素材" psd_miaoshu:"中秋佳节促销海报设计适用于中秋节海报设计" psd_name:"中秋佳节促销海报设计" psd_spic:"http://pic2.sc.chinaz.com/files/pic/psd1/201808/psd27155.jpg" psd_time:"2018.08.30" psd_user:"彭德怀" psd_xiazai:"<a href='http://fjdx.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">福建电信下载</a> ↵<a href='http://xmdx.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">厦门电信下载</a> ↵<a href='http://gddx.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">广东电信下载</a> ↵<a href='http://jsdx.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">江苏电信下载</a> ↵<a href='http://fjlt.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">福建联通下载</a> ↵<a href='http://zjlt.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">浙江联通下载</a> ↵<a href='http://xmlt.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">厦门联通下载</a> ↵<a href='http://gdlt.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">广东联通下载</a> ↵<a href='http://fjyd.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">福建移动下载</a> ↵<a href='http://sxyd.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">山西移动下载</a> ↵<a href='http://xmyd.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">厦门移动下载</a> ↵<a href='http://zjyd.sc.chinaz.com/Files/DownLoad/psd1/201808/psd27155.rar' target="_blank">浙江移动下载</a>" scs:"0" shares:"0" user_touxiang:"usertouxiang/pengdiehua.jpg" views:"24" zans:"0" js部分代码如下: Page({ data: { id: '', ids: '', idss: '' }, onLoad: function (options) { this.setData({ id: options.id }); // var idss=this.date.id; var ids = this.data.id; var that = this; wx.request({ url: 'https://www.bbjteam.com/xiaochenxu/bbjteam/index.psdinfo.php', method: 'POST', data: { ids: ids }, header: { 'content-type': 'application/x-www-form-urlencoded' }, success: function (res) { that.setData({ psdinfo: res.data, }); wx.setNavigationBarTitle({ title: that.data.psdinfo.psd_name }) } }) } }) 运行报错: setNavigationBarTitle:fail parameter error: parameter.title should be String instead of Undefined; 请问大神这个应该如何解决?
2018-12-23 - <rich-text a标签无法跳转
RT,求大神解答。 数据库取出的数据如下: <a href="https://pan.baidu.com/s/1jhM3-ShQISUXpEFn9tzI2A" target="_blank">百度网盘下载</a> wxml部分代码如下: <rich-text nodes="{{item.books_xiazai}}"></rich-text> (ps:{{item.books_xiazai}}就是数据库数据) 测试结果页面后a点击无效果,请问大神这个应该如何解决?
2018-12-22 - 从数据库取出的含image的数据无法显示图片问题(已解决)
RT,求大神解答。折腾一下午了。杯具。 数据库取出的数据如下: 很唯美的漂亮的一组摄影作品<image src="https://s1.ax1x.com/2018/11/30/Fma6oQ.jpg"></image> <image src="https://s1.ax1x.com/2018/11/30/FmaBsf.jpg"></image> <image src="https://s1.ax1x.com/2018/11/30/FmaDL8.jpg" ></image> <image src="https://s1.ax1x.com/2018/11/30/Fma0QP.jpg" ></image> <image src="https://s1.ax1x.com/2018/11/30/Fmadzt.jpg" ></image> <image src="https://s1.ax1x.com/2018/11/30/Fmaydg.jpg" ></image> <image src="https://s1.ax1x.com/2018/11/30/FmaseS.jpg" ></image> <image src="https://s1.ax1x.com/2018/11/30/FmahQ0.jpg" ></image> <image src="https://s1.ax1x.com/2018/11/30/Fmagij.jpg" ></image> <image src="https://s1.ax1x.com/2018/11/30/FmaWzq.jpg" ></image> <image src="https://s1.ax1x.com/2018/11/30/Fma2Js.jpg" ></image> <image src="https://s1.ax1x.com/2018/11/30/FmaRWn.jpg"> 这些数据是从我的网站数据库取出来的。pc端网站取出来就能直接显示,但是小程序就是不能显示。 (ps:小程序取出的数据通过把img标签转换成image的) php将img转换成image代码: while($alldsselectrow2=mysql_fetch_array($alldsselect2)) { $img=$alldsselectrow2['ds_content']; $imgs=str_replace("<img","<image",$img); $imgss=str_replace("/>","></image>",$imgs); $alldsselectrow2['ds_content']=$imgss; $jzcontent[]=$alldsselectrow2; } echo json_encode($jzcontent); wxml部分代码如下: <li>{{item.ds_content}}</li> <li class='list_show_biaoqian'>相关标签: {{item.biaoqian}}</li> <li>注:本网站所有文件解压密码:www.bbjteam.com\n 本网站部分资源来自网络,如有侵权,请联系站长删除。\n 联系方式:QQ1343448308,TEL15361501239\n 如发现链接无法下载,或者展示图片无法显示,也请联系站长。 </li> (ps:{{item.ds_content}}就是数据库数据) 测试结果页面如下: [图片]
2018-12-21