courseItem.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="courselist-item">
  3. <view class="courselist-con x-start">
  4. <view class="courselist-img">
  5. <view class="status">进行中</view>
  6. <image src="https://sg-mmyy-oss.yjfzy.com/sgs/image/20241102/e07b38daf749cb02e9f5ce69c57b44ea.png" mode="aspectFill"></image>
  7. </view>
  8. <view class="courselist-con-r">
  9. <view>
  10. <text class="more-t">7.明医有话说-杜老师给您讲讲抑郁</text>
  11. <view class="btn_icon" style="margin-left: 5px;">ID
  12. <image src="@/static/images/copy_icon.png" mode="aspectFill"></image>
  13. </view>
  14. </view>
  15. <view class="courselist-desc one-t" v-show="from != 'course'">明医有话说 2.0-2.0-明医10301111111111</view>
  16. <view :class="from == 'course' ? 'courselist-con-timebox ':'courselist-con-timebox x-f'">
  17. <view class="x-f acea-row"><u-icon class="icon" name="file-text" color="#999" size="20"></u-icon>12月28日 00:00-23:59</view>
  18. <view class="x-f acea-row"><u-icon class="icon" name="clock" color="#999" size="16"></u-icon>44分36秒</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="courselist-footer x-f">
  23. <view class="courselist-footer-item x-c" v-show="activeTab !=2" @click="handleShare"><u-icon name="share-square" color="#1677ff" size="18"></u-icon>分享课程</view>
  24. <view class="courselist-footer-item x-c shishi" v-show="activeTab == 1" @click="handleStatistics"><u-icon name="share-square" color="#1677ff" size="18"></u-icon>实时统计</view>
  25. <view class="courselist-footer-item x-c shuju" v-show="activeTab == 2" @click="handleStatistics"><u-icon name="share-square" color="#1677ff" size="18"></u-icon>数据统计</view>
  26. </view>
  27. <!-- 分享弹窗 -->
  28. <u-popup :show="showShare" :closeOnClickOverlay="true" :round='20' @close="closeShare" @open="openShare">
  29. <view class="sharePop x-ac">
  30. <view class="sharePop-item y-f">
  31. <image src="@/static/images/poster_icon.png" mode="aspectFill"></image>
  32. <view style="font-weight: bold;margin-bottom: 4px;">生成海报</view>
  33. <view style="font-size: 12px;color: #888;">保存海报美观宣传</view>
  34. </view>
  35. <view class="sharePop-item y-f" @click="copyLink">
  36. <image src="@/static/images/link_icon.png" mode="aspectFill"></image>
  37. <view style="font-weight: bold;margin-bottom: 4px;">复制链接</view>
  38. <view style="font-size: 12px;color: #888;">生成链接一键复制</view>
  39. </view>
  40. </view>
  41. </u-popup>
  42. <!-- 设置链接有效时长弹窗 -->
  43. <u-modal :show="setTimeShow"content='content' class="model" @confirm="confirmTime">
  44. <view class="setTimebox">
  45. <view class="timetip">不传默认以系统参数为准</view>
  46. <view class="x-f">
  47. <text style="margin-right: 20px;">链接有效时长(分钟)</text>
  48. <u-input
  49. fontSize="14px"
  50. placeholder="链接有效时长"
  51. border="none"
  52. v-model="time"
  53. maxlength="5"
  54. ></u-input>
  55. </view>
  56. </view>
  57. </u-modal>
  58. <!-- <u-popup :show="setTimeShow" :round="10" mode="center" @close="close" @open="open" :zIndex="10078">
  59. <view class="timePop">
  60. <view>不传默认以系统参数为准</view>
  61. <text>人生若只如初见,何事秋风悲画扇</text>
  62. </view>
  63. </u-popup> -->
  64. </view>
  65. </template>
  66. <script>
  67. export default {
  68. props: {
  69. activeTab: {
  70. type: [Number,String],
  71. default: 0
  72. },
  73. // 来源
  74. from: {
  75. type: String,
  76. default: 'live'
  77. },
  78. },
  79. data() {
  80. return {
  81. showShare: false,
  82. setTimeShow: false,
  83. time: "",
  84. }
  85. },
  86. methods: {
  87. handleShare() {
  88. this.showShare = true
  89. },
  90. closeShare() {
  91. this.showShare = false
  92. // console.log('open');
  93. },
  94. openShare() {
  95. // this.showShare = false
  96. // console.log('close');
  97. },
  98. copyLink(){
  99. this.setTimeShow = true
  100. },
  101. confirmTime() {
  102. this.setTimeShow = false
  103. this.showShare = false
  104. },
  105. handleStatistics() {
  106. uni.navigateTo({
  107. url: '/pages/courseManage/statistics'
  108. })
  109. }
  110. }
  111. }
  112. </script>
  113. <style scoped lang="scss">
  114. ::v-deep {
  115. .model .u-fade-enter-active {
  116. z-index: 10075 !important;
  117. }
  118. }
  119. .sharePop{
  120. background-color: #fff;
  121. padding: 50px 0;
  122. border-radius: 20px 20px 0 0;
  123. &-item {
  124. padding: 0 10px;
  125. box-sizing: border-box;
  126. font-family: PingFang SC, PingFang SC;
  127. font-weight: 400;
  128. font-size: 14px;
  129. display: inline-flex !important;
  130. image {
  131. height: 48px;
  132. width: 48px;
  133. margin-bottom: 10px;
  134. }
  135. }
  136. }
  137. .setTimebox {
  138. font-family: PingFang SC, PingFang SC;
  139. font-weight: 400;
  140. font-size: 14px;
  141. }
  142. .timetip {
  143. font-family: PingFang SC, PingFang SC;
  144. font-weight: 400;
  145. font-size: 14px;
  146. color: #2979ff;
  147. text-align: center;
  148. margin-bottom: 5px;
  149. }
  150. .courselist{
  151. font-family: PingFang SC, PingFang SC;
  152. font-weight: 400;
  153. font-size: 14px;
  154. &-item {
  155. width: 100%;
  156. border-radius: 14px;
  157. background-color: #fff;
  158. overflow: hidden;
  159. margin-bottom: 10px;
  160. }
  161. &-con {
  162. padding: 10px 10px 5px 10px;
  163. font-size: 12px;
  164. color: #777;
  165. }
  166. &-con-r{
  167. flex: 1;
  168. overflow: hidden;
  169. .more-t {
  170. flex: 1;
  171. font-size: 14px;
  172. color: #222;
  173. display: inline;
  174. }
  175. image {
  176. width: 20px;
  177. height: 20px;
  178. }
  179. .btn_icon {
  180. font-size: 14px;
  181. color: #1677ff;
  182. display: inline-flex;
  183. align-items: center;
  184. }
  185. }
  186. &-img {
  187. width: 110px;
  188. height: 70px;
  189. border-radius: 10px;
  190. overflow: hidden;
  191. flex-shrink: 0;
  192. margin-right: 10px;
  193. position: relative;
  194. image {
  195. height: 100%;
  196. width: 100%;
  197. }
  198. .status {
  199. position: absolute;
  200. top: 0;
  201. left: 0;
  202. z-index: 2;
  203. height: 21px;
  204. padding: 0 5px;
  205. box-sizing: border-box;
  206. line-height: 21px;
  207. border-radius: 10px 0 10px 0;
  208. text-align: center;
  209. color: #fff;
  210. background-color: #08ce36;
  211. }
  212. }
  213. &-desc {
  214. flex: 1;
  215. margin-top: 7px;
  216. }
  217. &-con-timebox {
  218. margin-top: 7px;
  219. flex-wrap: wrap;
  220. .acea-row {
  221. margin-right: 12px;
  222. margin-bottom: 5px;
  223. flex-wrap: nowrap;
  224. }
  225. .icon {
  226. margin-right: 5px;
  227. }
  228. }
  229. &-footer {
  230. padding: 5px;
  231. font-size: 14px;
  232. &-item {
  233. flex: 1;
  234. text-align: center;
  235. color: #1677ff;
  236. padding: 6px;
  237. box-sizing: border-box;
  238. }
  239. .shishi {
  240. border-left: 1px solid #f5f5f5;
  241. }
  242. .shuju {
  243. border-radius: 5px;
  244. border: 1px solid #1677ff;
  245. }
  246. }
  247. }
  248. </style>