litian
2024-06-26 ccda9ec2fe70d8f51ef184eafc04b78d22dfbabd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const util = require("./components/util"); // 引入封装过的加载提示
import {
  loginInfo
} from "../../../../../../assets/js/login";
const app = getApp();
Component({
  properties: {
    treeList: {
      type: Array,
      value: [],
    },
    bookInfo: {
      type: Object,
      value: {},
    },
    tab: {
      type: String,
      value: "",
    },
    openIds: {
      type: Array,
      value: [],
    },
  },
  data: {},
  ready() {},
 
  onLoad() {
    console.log(this.properties.openIds, "1111")
  },
 
  methods: {
 
    // 节点展开
    handleChange(e) {
      console.log(e, 123)
      this.setData({
        openIds: e.detail.value,
      });
    },
    goTest(e) {
      console.log(e, 234)
      const value = e.currentTarget.dataset;
      var myEventDetail = {
        value,
      };
      this.triggerEvent("goTest", myEventDetail);
 
    },
    // 跳转音视频播放器
    goPlayer(e) {
      // 检查登录状态
      const token = wx.getStorageSync(app.config.tokenKey);
      if (token) {
        const item = e.currentTarget.dataset.item;
        const parent = e.currentTarget.dataset.parent;
        console.log('item', item);
        const parentProductLinkPath = parent ?
          parent.productLinkPath :
          wx.getStorageSync("teachResourcesPath");
        const parentName = parent ? parent.name : "教学资源";
        let url;
        wx.navigateTo({
          url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`,
        });
 
      }
    },
  },
});