|
@@ -1,152 +0,0 @@
|
|
|
-// pages/yxnaJfh.js
|
|
|
-import {
|
|
|
- imgUrl
|
|
|
-} from "../api/request"
|
|
|
-
|
|
|
-Page({
|
|
|
-
|
|
|
- /**
|
|
|
- * 页面的初始数据
|
|
|
- */
|
|
|
- data: {
|
|
|
- // 图片前缀
|
|
|
- imgUrl: imgUrl,
|
|
|
- // 专辑列表
|
|
|
- albumList: ['张三专辑', '李四专辑', '李二专辑', 'XXX专辑', 'AAA专辑'],
|
|
|
- // 专辑标题
|
|
|
- albumTitle: [],
|
|
|
- // 默认选中
|
|
|
- currentTab: 0,
|
|
|
- // 专辑详细
|
|
|
- albumInfo: {
|
|
|
- url: 'album.png',
|
|
|
- name: '张三',
|
|
|
- introduction: '专辑有论文专辑、音乐专辑等。论文专辑是指期刊的某一期专门对某一个大家关注的领域、问题、事件进行集中报道、讨论。',
|
|
|
- albumList: [{
|
|
|
- url: 'album-list.png',
|
|
|
- date: '2019 10/24',
|
|
|
- detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸'
|
|
|
- },
|
|
|
- {
|
|
|
- url: 'album-list.png',
|
|
|
- date: '2019 10/24',
|
|
|
- detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸'
|
|
|
- }, {
|
|
|
- url: 'album-list.png',
|
|
|
- date: '2019 10/24',
|
|
|
- detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸'
|
|
|
- }, {
|
|
|
- url: 'album-list.png',
|
|
|
- date: '2019 10/24',
|
|
|
- detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸'
|
|
|
- }, {
|
|
|
- url: 'album-list.png',
|
|
|
- date: '2019 10/24',
|
|
|
- detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸'
|
|
|
- }, {
|
|
|
- url: 'album-list.png',
|
|
|
- date: '2019 10/24',
|
|
|
- detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸南岸'
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- },
|
|
|
- getAlbumTitle() {
|
|
|
- let temp = [];
|
|
|
- let album = this.data.albumList[this.data.currentTab];
|
|
|
- for (let index = 0; index < album.length; index++) {
|
|
|
- temp.push(album.substr(index, 1));
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- albumTitle: temp
|
|
|
- })
|
|
|
- },
|
|
|
- // 切换专辑
|
|
|
- tabNav(e) {
|
|
|
- let currentTab = e.currentTarget.dataset.index
|
|
|
- this.setData({
|
|
|
- currentTab
|
|
|
- })
|
|
|
- this.getAlbumTitle();
|
|
|
- },
|
|
|
- // 切换专辑
|
|
|
- handleSwiper(e) {
|
|
|
- let {
|
|
|
- current,
|
|
|
- source
|
|
|
- } = e.detail
|
|
|
- if (source === 'autoplay' || source === 'touch') {
|
|
|
- const currentTab = current
|
|
|
- this.setData({
|
|
|
- currentTab
|
|
|
- })
|
|
|
- }
|
|
|
- this.getAlbumTitle();
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
- */
|
|
|
- onLoad(options) {
|
|
|
- this.getAlbumTitle();
|
|
|
- },
|
|
|
- toYXNADetailInfo(){
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/albumDetail/albumDetail',
|
|
|
- })
|
|
|
- },
|
|
|
- toYXNAEdit(){
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/albumEdit/albumEdit',
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
- */
|
|
|
- onReady() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面显示
|
|
|
- */
|
|
|
- onShow() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面隐藏
|
|
|
- */
|
|
|
- onHide() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面卸载
|
|
|
- */
|
|
|
- onUnload() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
- */
|
|
|
- onPullDownRefresh() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 页面上拉触底事件的处理函数
|
|
|
- */
|
|
|
- onReachBottom() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 用户点击右上角分享
|
|
|
- */
|
|
|
- onShareAppMessage() {
|
|
|
-
|
|
|
- }
|
|
|
-})
|