times.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. content_id : {
  22. type : String,
  23. value : null
  24. },
  25. width : {
  26. type : String,
  27. default : '100%'
  28. },
  29. code : {
  30. type : String,
  31. default : ''
  32. },
  33. param : {},
  34. index : 0,
  35. times : 0,
  36. },
  37. data() {
  38. return {
  39. fetch : {},
  40. }
  41. },
  42. mounted() {
  43. this.fetch = this.param;
  44. },
  45. methods:{
  46. getData : function() {
  47. this.$emit('getTimes');
  48. },
  49. getInfo : function(t) {
  50. //触底刷新
  51. },
  52. go : function(times) {
  53. var self = this;
  54. this.Dever.alert('正在进入' + times.name);
  55. // 要拿到最新的page_id
  56. this.Dever.post('app/collection/?l=api.getPageId', {code:this.code,times_id:times.id}, function(t) {
  57. self.Dever.location('dream/view?code=' + t.code);
  58. })
  59. },
  60. },
  61. }
  62. </script>
  63. <style>
  64. .slide-image {
  65. }
  66. </style>