- 个人订阅号发布的文章在订阅号内不显示?
我昨天发布了一个原创文章,但在订阅号下面只显示上一次的文章,不显示这次文章。 链接https://mp.weixin.qq.com/s?__biz=MzU2MDQxMzg1Ng==&mid=2247483784&idx=1&sn=2dc8424bddbcec5aa119442da1b6acb5&chksm=fc092c47cb7ea551ee10124339043a25f7b2c2c8897b59b2e6bbf0cad577941a7f62e20ed800&token=257010656&lang=zh_CN#rd
2022-01-26 - WXML取不到data 中某一个对象
- 当前 Bug 的表现(可附上截图) [图片] - 预期表现 其它数据取出来了,就url没有 - 复现路径 - 提供一个最简复现 Demo [代码]<[代码][代码]view[代码] [代码]wx:for[代码][代码]=[代码][代码]"{{goods}}"[代码] [代码]wx:key[代码][代码]=[代码][代码]"{{index}}"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]> 商品图: [代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]wx:for[代码][代码]=[代码][代码]"{{item.url}}"[代码] [代码]wx:for-item[代码][代码]=[代码][代码]"{{url}}"[代码] [代码]wx:key[代码][代码]=[代码][代码]"{{index}}"[代码] [代码]>{{url.tempFileURL}} </[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码] [代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"classify-detail"[代码][代码]> [代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]""[代码][代码]>数量: {{item.goodAmount}}</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]""[代码][代码]>名称: {{item.goodName}}</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]""[代码][代码]>价格: {{item.goodPrice}}</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"classify-footer"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]button[代码] [代码]size[代码][代码]=[代码][代码]"mini"[代码] [代码]class[代码][代码]=[代码][代码]"classify-btn"[代码] [代码]data-index[代码][代码]=[代码][代码]"{{index}}"[代码] [代码]bindtap[代码][代码]=[代码][代码]"deleteGoods"[代码][代码]>删除</[代码][代码]button[代码][代码]> [代码][代码] [代码][代码]</[代码][代码]view[代码][代码]> [代码][代码]</[代码][代码]view[代码][代码]>[代码] [代码]// page/admin/goodsMgr/goodsMgr.js[代码][代码]const db = wx.cloud.database();[代码][代码]Page({[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面的初始数据[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]images:[],[代码][代码] [代码][代码]goodName:[代码][代码]''[代码][代码],[代码][代码] [代码][代码]goodPrice:[代码][代码]''[代码][代码],[代码][代码] [代码][代码]goodAmount:[代码][代码]''[代码][代码],[代码][代码] [代码][代码]fileID:[],[代码][代码] [代码][代码]goods:[][代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面加载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码](options) {[代码][代码] [代码][代码]this[代码][代码].getGoods();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面显示[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onShow: [代码][代码]function[代码] [代码]() {[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]onNameChange:[代码][代码]function[代码][代码](event){ [代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]goodName:event.detail[代码][代码] [代码][代码]}) [代码][代码] [代码][代码]},[代码][代码] [代码][代码]onPriceChange:[代码][代码]function[代码][代码](event){ [代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]goodPrice:event.detail[代码][代码] [代码][代码]}) [代码][代码] [代码][代码]},[代码][代码] [代码][代码]onAmountChange:[代码][代码]function[代码][代码](event){ [代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]goodAmount:event.detail[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]uploadPicture:[代码][代码]function[代码][代码](event){[代码][代码] [代码][代码]wx.chooseImage({[代码][代码] [代码][代码]count: 5,[代码][代码] [代码][代码]sizeType: [[代码][代码]'original'[代码][代码], [代码][代码]'compressed'[代码][代码]],[代码][代码] [代码][代码]sourceType: [[代码][代码]'album'[代码][代码], [代码][代码]'camera'[代码][代码]],[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]// tempFilePath可以作为img标签的src属性显示图片[代码][代码] [代码][代码]const tempFilePaths = res.tempFilePaths;[代码][代码] [代码][代码]console.log(tempFilePaths);[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]images: [代码][代码]this[代码][代码].data.images.concat(tempFilePaths)[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]submit:[代码][代码]function[代码][代码](event){[代码][代码] [代码][代码]wx.showLoading({[代码][代码] [代码][代码]title: [代码][代码]'上传中'[代码][代码],[代码][代码] [代码][代码]}); [代码] [代码] [代码][代码]let promiseArr=[];[代码][代码] [代码][代码]for[代码][代码](let i=0; i<[代码][代码]this[代码][代码].data.images.length ;i++){[代码][代码] [代码][代码]let item = [代码][代码]this[代码][代码].data.images[i];[代码][代码] [代码][代码]let suffix = /\.\w+$/.exec(item)[0];[代码][代码] [代码][代码]promiseArr.push([代码][代码]new[代码] [代码]Promise((resolve, reject) => {[代码][代码] [代码][代码]wx.cloud.uploadFile({[代码][代码] [代码][代码]cloudPath: [代码][代码]new[代码] [代码]Date().toLocaleDateString() + [代码][代码]'/'[代码] [代码]+[代码][代码]new[代码] [代码]Date().getTime() + suffix,[代码][代码] [代码][代码]filePath: item, [代码][代码]// 文件路径[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]// get resource ID[代码][代码] [代码][代码]console.log(res.fileID)[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]fileID: [代码][代码]this[代码][代码].data.fileID.concat(res.fileID)[代码][代码] [代码][代码]});[代码][代码] [代码][代码]resolve();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: err => {[代码][代码] [代码][代码]// handle error[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}));[代码][代码] [代码][代码]}[代码][代码] [代码][代码]Promise.all(promiseArr).then(res =>{[代码][代码] [代码][代码]db.collection([代码][代码]'goods'[代码][代码]).add({ [代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]goodName: [代码][代码]this[代码][代码].data.goodName,[代码][代码] [代码][代码]goodPrice:[代码][代码]this[代码][代码].data.goodPrice,[代码][代码] [代码][代码]goodAmount:[代码][代码]this[代码][代码].data.goodAmount,[代码][代码] [代码][代码]fileID:[代码][代码]this[代码][代码].data.fileID [代码][代码] [代码][代码]}[代码][代码] [代码][代码]}).then(res =>{[代码][代码] [代码][代码]wx.hideLoading();[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'成功'[代码][代码],[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](res => {[代码][代码] [代码][代码]wx.hideLoading();[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'评价失败'[代码][代码],[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}, [代码][代码] [代码][代码]//Goods[代码][代码] [代码][代码]getGoods: [代码][代码]function[代码] [代码](e) { [代码][代码] [代码][代码]// 查询当前用户所有的 counters[代码][代码] [代码][代码]db.collection([代码][代码]'goods'[代码][代码]).where({[代码][代码] [代码] [代码] [代码][代码]}).get({[代码][代码] [代码][代码]success: res => { [代码][代码] [代码][代码]console.log([代码][代码]'[数据库] [查询记录] 成功: '[代码][代码], res) [代码][代码] [代码][代码]// 查询存储图片url 有效期2小时[代码][代码] [代码][代码]for[代码][代码](let i =0 ;i < res.data.length; i++){[代码][代码] [代码][代码]wx.cloud.getTempFileURL({[代码][代码] [代码][代码]fileList: res.data[i].fileID,[代码][代码] [代码][代码]success: urlres => { [代码][代码] [代码][代码]res.data[i][[代码][代码]'url'[代码][代码]] = urlres.fileList;[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: console.error[代码][代码] [代码][代码]}) [代码][代码] [代码][代码]} [代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]goods: res.data [代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log([代码][代码]this[代码][代码].data.goods);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: err => {[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]icon: [代码][代码]'none'[代码][代码],[代码][代码] [代码][代码]title: [代码][代码]'查询记录失败'[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.error([代码][代码]'[数据库] [查询记录] 失败:'[代码][代码], err)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]//---------------delete------------------------------[代码][代码] [代码][代码]deleteGoods: [代码][代码]function[代码] [代码](e) {[代码][代码] [代码] [代码] [代码][代码]console.log(e)[代码][代码] [代码][代码]debugger[代码][代码] [代码][代码]let goods = [代码][代码]this[代码][代码].data.goods;[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]goods: goods,[代码][代码] [代码][代码]}) [代码][代码] [代码][代码]this[代码][代码].syngoodDB();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]//--------------syngoodDB------------------------[代码][代码] [代码][代码]syngoodDB: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]const db = wx.cloud.database();[代码][代码] [代码][代码]const _ = db.command;[代码][代码] [代码][代码]var[代码] [代码]gooddbid = [代码][代码]this[代码][代码].data.gooddbid;[代码][代码] [代码][代码]db.collection([代码][代码]'data1'[代码][代码]).doc(gooddbid).update({[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]//默认是更新 style.color 字段为 'blue' 而不是把 style 字段更新为 { color: 'blue' } 对象:[代码][代码] [代码][代码]//如果需要替换更新一条记录,可以在记录上使用 set 方法,替换更新意味着用传入的对象替换指定的记录:[代码][代码] [代码][代码]data: _.set([代码][代码]this[代码][代码].data.goods)[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]console.log([代码][代码]'[数据库] [更新记录] 成功:'[代码][代码], gooddbid);[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'[数据库][更新记录] 成功:'[代码] [代码]+ gooddbid,[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: err => {[代码][代码] [代码][代码]icon: [代码][代码]'none'[代码][代码],[代码][代码] [代码][代码]console.log([代码][代码]'[数据库] [更新记录] 失败:'[代码][代码], err)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}, [代码][代码]})[代码]
2019-06-17