courseItem.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view class="courselist-item">
  3. <view class="courselist-con x-start" @click="toCourseDetail(info)">
  4. <view class="courselist-img">
  5. <image :src="info.thumbnail" mode="aspectFill"></image>
  6. </view>
  7. <view class="courselist-con-r">
  8. <view @click.passive.stop>
  9. <text class="more-t">{{info.title}}</text>
  10. </view>
  11. <view class="courselist-desc one-t" v-show="from != 'course'">{{info.courseName}}</view>
  12. <view :class="from == 'course' ? 'courselist-con-timebox ':'courselist-con-timebox x-f'">
  13. <view class="x-f acea-row"><u-icon class="icon" name="file-text" color="#999"
  14. size="20"></u-icon>{{info.createTime}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="courselist-footer x-f">
  19. <view class="courselist-footer-item x-c" @click="openShare"><u-icon
  20. name="share-square" color="#1677ff" size="18"></u-icon>分享课程</view>
  21. </view>
  22. <!-- 分享弹窗 -->
  23. <u-popup :show="showShare" :closeOnClickOverlay="true" :round='20' @close="closeShare" @open="openShare">
  24. <view class="sharePop x-ac">
  25. <view class="sharePop-item y-f" @click="sendInput()">
  26. <image src="@/static/images/link_icon.png" mode="aspectFill"></image>
  27. <view style="font-weight: bold;margin-bottom: 4px;">发送课程</view>
  28. <view style="font-size: 12px;color: #888;">一键发送到输入框</view>
  29. </view>
  30. </view>
  31. </u-popup>
  32. </view>
  33. </template>
  34. <script>
  35. import {
  36. createRoomLink
  37. } from '@/api/courseManage'
  38. export default {
  39. props: {
  40. activeTab: {
  41. type: [Number, String],
  42. default: 0
  43. },
  44. // 来源
  45. from: {
  46. type: String,
  47. default: 'live'
  48. },
  49. info: {
  50. type: Object,
  51. default: () => {
  52. return {}
  53. }
  54. },
  55. },
  56. data() {
  57. return {
  58. showShare: false,
  59. type: 1,
  60. }
  61. },
  62. onLoad() {},
  63. mounted() {
  64. },
  65. methods: {
  66. toCourseDetail(info) {
  67. uni.navigateTo({
  68. url:'/pages/course/courseVideo?videoId='+info.videoId
  69. })
  70. },
  71. openShare() {
  72. this.showShare = true
  73. console.log(this.info)
  74. //this.getlink('preload'); // 提前加载链接
  75. },
  76. closeShare() {
  77. this.showShare = false
  78. // console.log('open');
  79. },
  80. sendInput(){
  81. var corpId=uni.getStorageSync("corpId");
  82. var qwUserId=uni.getStorageSync("qwUserId");
  83. const param = {
  84. videoId:this.info.videoId,
  85. corpId:corpId,
  86. qwUserId:qwUserId,
  87. courseId:this.info.courseId,
  88. title:this.info.title
  89. }
  90. createRoomLink(param).then(res => {
  91. console.log(res)
  92. if(res.code==200){
  93. jWeixin.invoke('sendChatMessage', {
  94. msgtype:"news", //消息类型,必填
  95. enterChat: true,
  96. news:
  97. {
  98. link: res.news.link, //H5消息页面url 必填
  99. title: res.news.title, //H5消息标题
  100. desc: res.news.desc, //H5消息摘要
  101. imgUrl: res.news.imgUrl, //H5消息封面图片URL
  102. }
  103. }, function(res) {
  104. console.log("发送成功")
  105. console.log(res)
  106. uni.showToast({
  107. title: "发送成功",
  108. });
  109. })
  110. }
  111. else{
  112. uni.showToast({
  113. title: res.msg,
  114. });
  115. }
  116. })
  117. },
  118. }
  119. }
  120. </script>
  121. <style scoped lang="scss">
  122. .imgshe {
  123. display: flex;
  124. flex-direction: row-reverse
  125. }
  126. .point-box {
  127. height: 100%;
  128. width: 100%;
  129. .xu-box {
  130. border: #f5f5f5 4rpx dashed;
  131. padding: 20rpx 20rpx;
  132. }
  133. }
  134. .codeimg {
  135. position: absolute;
  136. z-index: 99999;
  137. left: 40rpx;
  138. top: 40rpx;
  139. }
  140. #codeurl {
  141. position: relative;
  142. }
  143. ::v-deep {
  144. .model .u-fade-enter-active {
  145. z-index: 10075 !important;
  146. }
  147. }
  148. .sharePop {
  149. background-color: #fff;
  150. padding: 20px 0;
  151. // padding-bottom: 100px;
  152. border-radius: 20px 20px 0 0;
  153. &-item {
  154. padding: 0 10px;
  155. box-sizing: border-box;
  156. font-family: PingFang SC, PingFang SC;
  157. font-weight: 400;
  158. font-size: 14px;
  159. display: inline-flex !important;
  160. image {
  161. height: 48px;
  162. width: 48px;
  163. margin-bottom: 10px;
  164. }
  165. }
  166. }
  167. .setTimebox {
  168. font-family: PingFang SC, PingFang SC;
  169. font-weight: 400;
  170. font-size: 14px;
  171. }
  172. .timetip {
  173. font-family: PingFang SC, PingFang SC;
  174. font-weight: 400;
  175. font-size: 14px;
  176. color: #2979ff;
  177. text-align: center;
  178. margin-bottom: 5px;
  179. }
  180. .courselist {
  181. font-family: PingFang SC, PingFang SC;
  182. font-weight: 400;
  183. font-size: 14px;
  184. &-item {
  185. width: 100%;
  186. border-radius: 14px;
  187. background-color: #fff;
  188. overflow: hidden;
  189. margin-bottom: 10px;
  190. }
  191. &-con {
  192. padding: 10px 10px 5px 10px;
  193. font-size: 12px;
  194. color: #777;
  195. }
  196. &-con-r {
  197. flex: 1;
  198. overflow: hidden;
  199. .more-t {
  200. flex: 1;
  201. font-size: 14px;
  202. color: #222;
  203. display: inline;
  204. }
  205. image {
  206. width: 20px;
  207. height: 20px;
  208. }
  209. .btn_icon {
  210. font-size: 14px;
  211. color: #1677ff;
  212. display: inline-flex;
  213. align-items: center;
  214. }
  215. }
  216. &-img {
  217. width: 110px;
  218. height: 70px;
  219. border-radius: 10px;
  220. overflow: hidden;
  221. flex-shrink: 0;
  222. margin-right: 10px;
  223. position: relative;
  224. image {
  225. height: 100%;
  226. width: 100%;
  227. }
  228. .status {
  229. position: absolute;
  230. top: 0;
  231. left: 0;
  232. z-index: 2;
  233. height: 21px;
  234. padding: 0 5px;
  235. box-sizing: border-box;
  236. line-height: 21px;
  237. border-radius: 10px 0 10px 0;
  238. text-align: center;
  239. color: #fff;
  240. background-color: #08ce36;
  241. }
  242. }
  243. &-desc {
  244. flex: 1;
  245. margin-top: 7px;
  246. }
  247. &-con-timebox {
  248. margin-top: 7px;
  249. flex-wrap: wrap;
  250. .acea-row {
  251. margin-right: 12px;
  252. margin-bottom: 5px;
  253. flex-wrap: nowrap;
  254. }
  255. .icon {
  256. margin-right: 5px;
  257. }
  258. }
  259. &-footer {
  260. padding: 5px;
  261. font-size: 14px;
  262. &-item {
  263. flex: 1;
  264. text-align: center;
  265. color: #1677ff;
  266. padding: 6px;
  267. box-sizing: border-box;
  268. }
  269. .shishi {
  270. border-left: 1px solid #f5f5f5;
  271. }
  272. .shuju {
  273. border-radius: 5px;
  274. border: 1px solid #1677ff;
  275. }
  276. }
  277. }
  278. </style>