my-invite.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view>
  3. <!-- 蒙层 -->
  4. <view class="maskWrapper" v-if="isShowInvite && item11.length != 0">
  5. <view class="requireText">
  6. <text>请您从下方列表中,选中一条课程或需求信息,作为邀请的具体内容,发给对方!</text>
  7. </view>
  8. <scroll-view class="scrollVertical" scroll-y>
  9. <radio-group class="chooseList">
  10. <view v-for="(item, index) in item11" :key="index">
  11. <radio class="chooseDetail" @click="clickRadio(item)">
  12. <view class="courseTitle">
  13. <text>课程号</text>
  14. <text class="courseDetail" v-if="item.courseId">{{item.courseId}}</text>
  15. <text class="courseDetail" v-if="item.requireId">{{item.requireId}}</text>
  16. </view>
  17. <view class="courseTitle">
  18. <text>辅导科目</text>
  19. <text class="courseDetail" v-if="item.subject">{{item.subject}}</text>
  20. <text class="courseDetail" v-else>{{item.subjectBig}}/{{item.subjectSmall}}</text>
  21. </view>
  22. </radio>
  23. </view>
  24. </radio-group>
  25. </scroll-view>
  26. <view class="commitAndCancel">
  27. <view class="cancel" @click="cancelChosed">取消</view>
  28. <view class="commit" @click="commitChosed">发送</view>
  29. </view>
  30. </view>
  31. <view class="maskWrapper" v-else-if="isShowInvite && item11.length == 0">
  32. <view class="requireText">
  33. <text>您尚未发布课程信息或需求信息,暂不能使用邀请功能。请您先发布课程信息或需求信息并成功上架后再试</text>
  34. </view>
  35. <view class="commitAndCancel">
  36. <view class="cancel-publish" @click="cancelChosed">取消</view>
  37. <view class="commit-publish" @click="toNav">去发布</view>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. name:"my-invite",
  45. data() {
  46. return {
  47. };
  48. },
  49. props: {
  50. isShowInvite: {
  51. type: Boolean,
  52. default: false
  53. },
  54. item11: {
  55. type: Array
  56. }
  57. },
  58. methods: {
  59. cancelChosed() {
  60. this.$emit("cancelChosed")
  61. },
  62. commitChosed() {
  63. this.$emit("commitChosed")
  64. },
  65. clickRadio(course) {
  66. this.$emit("clickRadio", course)
  67. },
  68. // “去发布”按钮
  69. toNav(){
  70. // 获取页面栈
  71. var pages = getCurrentPages()
  72. var page = pages[pages.length - 1]
  73. console.log(page)
  74. if(page.route.includes('course')){
  75. //判断:路径中包含course,跳转到需求发布页面
  76. uni.navigateTo({
  77. url:'/subpkg/student/require/student_require_add'
  78. })
  79. }else if(page.route.includes('require')){
  80. //判断:路径中包含require,跳转到课程发布页面
  81. uni.navigateTo({
  82. url:'/subpkg/teacher/course/teacher_course_add'
  83. })
  84. }
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. /* 以下是蒙层样式 */
  91. .maskWrapper{
  92. z-index: 999;
  93. // margin-left: -20rpx;
  94. padding-left: 20rpx;
  95. position: fixed;
  96. height: 55%;
  97. bottom: 0;
  98. background-color: #D1D1D1;
  99. border-top-left-radius: 30rpx;
  100. border-top-right-radius: 30rpx;
  101. }
  102. /* 可滚动区域 */
  103. .scrollVertical{
  104. height: 76%;
  105. }
  106. /* 选项区 */
  107. .chooseList{
  108. display: flex;
  109. flex-direction: column;
  110. }
  111. /* 单个选项样式 */
  112. .chooseDetail{
  113. width: 94%;
  114. padding: 10rpx;
  115. margin: 10rpx 0;
  116. border: 1rpx solid gray;
  117. border-radius: 20rpx;
  118. background-color: #fff;
  119. }
  120. /* 设置选项与圆圈的距离 */
  121. .courseTitle{
  122. margin-left: 30rpx;
  123. }
  124. /* 课程号、辅导科目详情 */
  125. .courseDetail{
  126. margin-left: 20rpx;
  127. font-weight: bold;
  128. }
  129. /* 底部按钮 */
  130. .commitAndCancel{
  131. display: flex;
  132. width: 100%;
  133. justify-content: space-around;
  134. position: fixed;
  135. bottom: 40rpx;
  136. }
  137. .cancel,
  138. .commit{
  139. font-size: 40rpx;
  140. padding: 10rpx 60rpx;
  141. border-radius: 40rpx;
  142. color: white;
  143. }
  144. .commit{
  145. background-color: #35b882;
  146. }
  147. .cancel{
  148. background-color: #3ed598;
  149. }
  150. .requireText{
  151. margin-top: 20rpx;
  152. }
  153. .cancel-publish,
  154. .commit-publish{
  155. font-size: 40rpx;
  156. padding: 10rpx 30rpx;
  157. border-radius: 40rpx;
  158. color: white;
  159. text-align: center;
  160. height: 60rpx;
  161. line-height: 60rpx;
  162. width: 120rpx;
  163. }
  164. .cancel-publish{
  165. background-color: #3ed598;
  166. }
  167. .commit-publish{
  168. background-color: #35b882;
  169. }
  170. </style>