detail.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view v-if="pageloading">
  3. <view class="bg-white" style="min-height: 100vh;">
  4. <view class="cu-card case vitembox">
  5. <view class="cu-item shadow">
  6. <view class="image">
  7. <video v-if="video!==null" id="myVideo" class="myVideo" :src="video.videourl" @error="videoErrorCallback" enable-danmu controls></video>
  8. <!-- <image :src="video.imageurl" mode="widthFix"></image> -->
  9. </view>
  10. <view class="text-content padding-lr padding-top-xs text-lg">{{video.title}}</view>
  11. <view class="cu-list menu-avatar">
  12. <view class="cu-item" style="border-bottom: 0rpx;">
  13. <view class="cu-avatar round lg" :style="'background-image:url('+video.worker.tilpic+');'"></view>
  14. <view class="content flex-sub">
  15. <view class="text-grey">{{video.worker.title}}</view>
  16. <view class="text-gray text-sm flex justify-between">
  17. <view>{{video.createtime}}</view>
  18. <view class="text-gray text-right basis-xs text-sm" @tap="goShop(video.workerid)">
  19. <text class="cuIcon-shop margin-right-xs text-lg"></text>
  20. 进店
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  33. var _this;
  34. export default {
  35. components: {
  36. uniLoadMore
  37. },
  38. data() {
  39. return {
  40. pageloading: false,
  41. video: null
  42. }
  43. },
  44. onLoad: function(option) {
  45. _this = this;
  46. var videoid = option.videoid || 0;
  47. _this.$req.ajax({
  48. path: "video/getvideo",
  49. title: "加载中...",
  50. data: {
  51. videoid: videoid
  52. }
  53. }).then((data) => {
  54. _this.video = data.video;
  55. _this.pageloading = true;
  56. }).catch((err) => {
  57. uni.showModal({
  58. title: '信息提示',
  59. content: err,
  60. showCancel: false
  61. });
  62. });
  63. },
  64. onShareAppMessage: function(res) {
  65. return {
  66. title: _this.video.title,
  67. path: "/pages/video/detail?videoid=" + _this.video.id
  68. }
  69. },
  70. methods: {
  71. goShop: function(workerid) {
  72. uni.navigateTo({
  73. url: '/pages/worker/shop?workerid=' + workerid
  74. });
  75. },
  76. videoErrorCallback: function(e) {
  77. uni.showModal({
  78. content: e.target.errMsg,
  79. showCancel: false
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .myVideo{ width: 750rpx; height: calc(100vh - 130px); }
  87. .cu-card>.cu-item{ margin: 0rpx; border-radius: 0rpx; }
  88. .cu-list.menu-avatar>.cu-item:after{ border-bottom: 0rpx; }
  89. </style>