diff --git a/txtDubbing/txtDubbing.js b/txtDubbing/txtDubbing.js new file mode 100644 index 0000000..15f1a16 --- /dev/null +++ b/txtDubbing/txtDubbing.js @@ -0,0 +1,98 @@ +// miniprogram/pages/txtDubbing/txtDubbing.js + +Page({ + + /** + * 页面的初始数据 + */ + data: { + list:[] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + wx.request({ + url:'https://6475-dunning-bar-enr-3e46z-1300499016.tcb.qcloud.la/txt/%E7%99%BD%E9%9B%AA%E5%85%AC%E4%B8%BB.txt?sign=818727931597dc72ea2db421b0577e3b&t=1578100879', + header: { 'cntent-type':'application/json;charset=utf-8'}, + success: (res)=> { + console.log(res.data); + var json = res.data; + this.setData({ + list: res.data, + }); + /* + if(typeof json !='object'){ + if (json != null) { + json = json.replace("\ufeff", "") + var ob = JSON.parse(json); + wx.setStorageSync('list', ob.list); + } + }else{ + wx.setStorageSync('list', json.list); + } + */ + } + /* + this.setData({ + list: res.data, + }) + try { + wx.setStorageSync('list', json) + } catch (e) { + };//和页面进行绑定可以动态的渲染到页面 + */ + }) + } , + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, +}) diff --git a/txtDubbing/txtDubbing.json b/txtDubbing/txtDubbing.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/txtDubbing/txtDubbing.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/txtDubbing/txtDubbing.wxml b/txtDubbing/txtDubbing.wxml new file mode 100644 index 0000000..fff768a --- /dev/null +++ b/txtDubbing/txtDubbing.wxml @@ -0,0 +1,13 @@ + + + + + {{list}} + + + + + + + + diff --git a/txtDubbing/txtDubbing.wxss b/txtDubbing/txtDubbing.wxss new file mode 100644 index 0000000..ff8f2b8 --- /dev/null +++ b/txtDubbing/txtDubbing.wxss @@ -0,0 +1 @@ +/* miniprogram/pages/txtDubbing/txtDubbing.wxss */ \ No newline at end of file