微信小程序之文本输出
和轮播图相似首先建立一个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 是输入文本

浙公网安备 33010602011771号