times.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template name="times">
  2. <view>
  3. <view class="cu-timeline" v-for="(v,k) in fetch.times" :key="v.id">
  4. <view class="cu-time">{{v.name}}</view>
  5. <view class="cu-item" :class="v1.id == times ? 'text-blue' : ''" v-for="(v1,k1) in v.child" :key="v1.id" :style="{backgroundImage: v1.icon}">
  6. <view class="content" :style="{color:v1.color,backgroundColor:v1.bgcolor}" @click="go(v1)">
  7. <view class="cu-capsule radius">
  8. <view class="cu-tag bg-cyan">{{v1.name}}</view>
  9. </view>
  10. <view class="margin-top" v-if="v1.desc&& !v1.pic">{{v1.desc}}</view>
  11. <view class="margin-top" v-if="v1.pic && !v1.desc"><image :src="v1.pic" mode="widthFix" class="slide-image" style="height:auto"></image></view>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: "times",
  20. props: {
  21. info_id : {
  22. type : String,
  23. value : null
  24. },
  25. content_id : {
  26. type : String,
  27. value : null
  28. },
  29. page_id : {
  30. type : String,
  31. value : null
  32. },
  33. parent_page_id : {
  34. type : String,
  35. value : null
  36. },
  37. width : {
  38. type : String,
  39. default : '100%'
  40. },
  41. param : {},
  42. index : 0,
  43. times : 0,
  44. },
  45. data() {
  46. return {
  47. }
  48. },
  49. created() {
  50. this.fetch = this.param;
  51. },
  52. methods:{
  53. getData : function() {
  54. var info = {
  55. info_id : this.info_id,
  56. page_id : this.page_id,
  57. parent_page_id : this.parent_page_id,
  58. }
  59. this.$emit('getTimes', info);
  60. },
  61. go : function(times) {
  62. var self = this;
  63. this.Dever.alert('正在进入' + times.name);
  64. // 要拿到最新的page_id
  65. this.Dever.post('app/collection/?l=api.getPageId', {id:self.info_id,times:times.id}, function(t) {
  66. self.Dever.location('dream/view?id=' + self.info_id + '&page_id='+t.id+'&index=0&times=' + times.id);
  67. })
  68. },
  69. },
  70. }
  71. </script>
  72. <style>
  73. .slide-image {
  74. }
  75. </style>