微信小程序之文本输出
时间:2019-03-20 14:27:24
收藏:0
阅读:813
和轮播图相似首先建立一个wtml
<view class=‘‘> <text>文本输出:</text> <block wx:for="{{custom_data}}" wx:key="*this"> <text>{{item.notification}}</text> </block>
</view>
接下来是js,
wx.request({ // 获取后台输入的文本
url: ,
data: {
custom_server:,
},
success: function (res) {
let arr=res.data;
var data=arr.data;
that.setData({
custom_data: data,
});
}
})
后台PHPSQL查找文本内容
$config=M(‘info‘)->find(); $arr[‘notification‘]=$config[‘notification‘];
前台HTML的输入略过,notification 是输入文本
评论(0)