my_invitation_receive_detail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view>
  3. <view class="wrapper">
  4. <!-- 上方邀请号和照片 -->
  5. <view class="above">
  6. <view>
  7. <view class="aboveTitle">
  8. <text>邀请号:</text>
  9. <text>{{Info.id}}</text>
  10. </view>
  11. <view class="aboveTitle">
  12. <text>对方:</text>
  13. <text>{{Info.fromUname}}</text>
  14. </view>
  15. </view>
  16. <!-- 头像 -->
  17. <image v-if="Info.sex === null" class="headerPortrait" mode="widthFix" :src="Info.imgUrl"></image>
  18. <image v-else-if="Info.sex === '男' " class="headerPortrait" mode="widthFix" src="/static/boy.png"></image>
  19. <image v-else-if="Info.sex === '女' " class="headerPortrait" mode="widthFix" src="/static/girl.png"></image>
  20. </view>
  21. <!-- 中间详细信息 -->
  22. <view>
  23. <view class="midTitle">
  24. <text>对方ID:</text>
  25. <text>{{Info.fromUid}}</text>
  26. </view>
  27. <view class="midTitle">
  28. <text>需求号:</text>
  29. <text class="toLink" @click="toNeedDetail" style="color: rebeccapurple;">{{Info.requireId}}</text>
  30. <text class="needState">{{needState}}</text>
  31. </view>
  32. <view class="midTitle">
  33. <text>课程号:</text>
  34. <text class="toLink" @click="toCourseDetail" style="color: red;">{{Info.courseId}}</text>
  35. <text class="needState">{{courseState}}</text>
  36. </view>
  37. <view class="midTitle">
  38. <text>需求金额:</text>
  39. <text>{{Info.requireSalary}}</text>
  40. </view>
  41. <view class="midTitle">
  42. <text>邀请内容:</text>
  43. <text>{{Info.requireDetail}}</text>
  44. </view>
  45. </view>
  46. <view class="bottomWrapper">
  47. <view class="bottomTitle">
  48. <text>邀请日期:</text>
  49. <text>{{Info.datetime}}</text>
  50. </view>
  51. <view class="bottomTitle">
  52. <text>我方操作状态:</text>
  53. <text class="operateState">{{Info.operateStatus}}</text>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="operation" v-if="Info.operateStatus!=='拒绝'&&Info.operateStatus!=='同意'">
  58. <view class="operationRefuseBtn" @click="refuse">拒绝</view>
  59. <view class="operationConfirmBtn" @click="agree">同意</view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. import {mapMutations} from 'vuex'
  65. export default {
  66. data() {
  67. return {
  68. Info:[],
  69. };
  70. },
  71. onLoad(option) {
  72. if (option.id !== undefined) {
  73. const id = decodeURIComponent(option.id)
  74. this.getInvitationDetail(id)
  75. this.toRead(id)
  76. }
  77. },
  78. methods:{
  79. toNeedDetail() {
  80. uni.navigateTo({
  81. url: '/subpkg/student/require/student_require_all_detail?requireId=' + encodeURIComponent(this.Info.requireId)
  82. })
  83. },
  84. toCourseDetail() {
  85. uni.navigateTo({
  86. url: '/subpkg/teacher/course/teacher_course_all_detail?courseId=' + encodeURIComponent(this.Info.courseId)
  87. })
  88. },
  89. async getInvitationDetail(id) {
  90. const { data: result } = await uni.$http.get('/education/invite-info/getInvitationDetail', {inviteId: id})
  91. this.Info = result.data.one
  92. //console.log(this.Info)
  93. },
  94. async toRead(id){
  95. const queryObj = {
  96. id
  97. }
  98. const { data: result } = await uni.$http.get('/education/invite-info/modifyStatusToHold',queryObj)
  99. },
  100. async refuse(){
  101. const queryObj = {
  102. id: this.Info.id
  103. }
  104. const { data: result } = await uni.$http.get('/education/invite-info/refuse',queryObj)
  105. if (result.code == 20000) {
  106. uni.$showMsg('拒绝邀请成功')
  107. this.Info.operateStatus = '拒绝'
  108. setTimeout(() => {
  109. uni.navigateTo({
  110. url: '/subpkg/my/invitation/my_invitation_receive'
  111. }, 3000)
  112. })
  113. }
  114. },
  115. async agree(){
  116. const queryObj = {
  117. id: this.Info.id
  118. }
  119. const { data: result } = await uni.$http.get('/education/invite-info/agree',queryObj)
  120. if (result.message == '该需求已锁,请30分钟后查看' || result.message == '该需求已下架' || result.message == '同意失败,请稍后在试' || result.message == '该课程已下架' || result.message == '该课程已锁,请30分钟后查看') {
  121. return uni.$showMsg(result.message)
  122. }
  123. const identify = result.data.identify
  124. if ('教员' === identify) {
  125. uni.$showMsg('已通知对方完成支付')
  126. this.Info.operateStatus = '同意'
  127. setTimeout(() => {
  128. uni.navigateTo({
  129. url: '/subpkg/my/invitation/my_invitation_receive'
  130. }, 3000)
  131. })
  132. }
  133. if ('学员' === identify) {
  134. const infos = result.data.info
  135. uni.navigateTo({
  136. url: '/subpkg/my/order/my_order_detail?orderId=' + encodeURIComponent(infos.orderId)
  137. })
  138. }
  139. }
  140. }
  141. }
  142. </script>
  143. <!-- 设置页面背景 -->
  144. <style lang="scss">
  145. page{
  146. height: 100%;
  147. // background-color: #FFF;
  148. }
  149. </style>
  150. <style lang="scss" scoped>
  151. /* 设置背景 */
  152. .wrapper{
  153. padding: 30rpx;
  154. margin: 30rpx;
  155. border-radius: 30rpx;
  156. background-color: #FFF;
  157. font-size: 30rpx;
  158. }
  159. /* 上方邀请号和照片 */
  160. .above{
  161. display: flex;
  162. // width: 95%;
  163. justify-content: space-between;
  164. }
  165. /* 上方、中间左侧文字 */
  166. .aboveTitle,
  167. .midTitle,
  168. .bottomTitle{
  169. padding-bottom: 20rpx;
  170. }
  171. /* 设置链接样式 */
  172. .toLink{
  173. color: skyblue;
  174. text-decoration: underline;
  175. }
  176. /* 需求号和课程号状态 */
  177. .needState{
  178. padding-left: 30rpx;
  179. color: red;
  180. font-weight: bold;
  181. }
  182. /* 头像 */
  183. .headerPortrait{
  184. width: 200rpx;
  185. border-radius: 30rpx;
  186. }
  187. /* 设置操作状态字体 */
  188. .operateState{
  189. font-weight: bold;
  190. color: red;
  191. }
  192. .bottomWrapper{
  193. margin-top: 140rpx;
  194. }
  195. /* 底部按钮 */
  196. .operation{
  197. display: flex;
  198. justify-content: space-around;
  199. margin-top: 60rpx;
  200. }
  201. /* 按钮 */
  202. .operationRefuseBtn,
  203. .operationConfirmBtn{
  204. width: 200rpx;
  205. height: 80rpx;
  206. line-height: 80rpx;
  207. text-align: center;
  208. // border: 1rpx solid #5B9BD5;
  209. border-radius: 50rpx;
  210. font-size: 30rpx;
  211. // background-color: #5B9BD5;
  212. color: white;
  213. }
  214. .operationConfirmBtn{
  215. background-color: #35b882;
  216. }
  217. .operationRefuseBtn{
  218. background-color: #3ed598;
  219. }
  220. </style>