my_invitation_receive_detail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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 class="operation" v-if="Info.operateStatus!=='拒绝'&&Info.operateStatus!=='同意'">
  57. <view class="operationRefuseBtn" @click="refuse">拒绝</view>
  58. <view class="operationConfirmBtn" @click="agree">同意</view>
  59. </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. },
  93. async toRead(id){
  94. const queryObj = {
  95. id
  96. }
  97. const { data: result } = await uni.$http.get('/education/invite-info/modifyStatusToHold',queryObj)
  98. },
  99. async refuse(){
  100. const queryObj = {
  101. id: this.Info.id
  102. }
  103. const { data: result } = await uni.$http.get('/education/invite-info/refuse',queryObj)
  104. if (result.code == 20000) {
  105. uni.$showMsg('拒绝邀请成功')
  106. this.Info.operateStatus = '拒绝'
  107. setTimeout(() => {
  108. uni.navigateTo({
  109. url: '/subpkg/my/invitation/my_invitation_receive'
  110. }, 3000)
  111. })
  112. }
  113. },
  114. async agree(){
  115. const queryObj = {
  116. id: this.Info.id
  117. }
  118. const { data: result } = await uni.$http.get('/education/invite-info/agree',queryObj)
  119. if (result.message == '该需求已锁,请30分钟后查看' || result.message == '该需求已下架' || result.message == '同意失败,请稍后在试' || result.message == '该课程已下架' || result.message == '该课程已锁,请30分钟后查看') {
  120. return uni.$showMsg(result.message)
  121. }
  122. const identify = result.data.identify
  123. if ('教员' === identify) {
  124. uni.$showMsg('已通知对方完成支付')
  125. this.Info.operateStatus = '同意'
  126. setTimeout(() => {
  127. uni.navigateTo({
  128. url: '/subpkg/my/invitation/my_invitation_receive'
  129. }, 3000)
  130. })
  131. }
  132. if ('学员' === identify) {
  133. const infos = result.data.info
  134. uni.navigateTo({
  135. url: '/subpkg/my/order/my_order_detail?orderId=' + encodeURIComponent(infos.orderId)
  136. })
  137. }
  138. }
  139. }
  140. }
  141. </script>
  142. <!-- 设置页面背景 -->
  143. <style lang="scss">
  144. page{
  145. height: 100%;
  146. // background-color: #FFF;
  147. }
  148. </style>
  149. <style lang="scss" scoped>
  150. /* 设置背景 */
  151. .wrapper{
  152. width: 100%;
  153. height: 100%;
  154. //background-color: #FFF2CC;
  155. padding: 20rpx;
  156. }
  157. /* 上方邀请号和照片 */
  158. .above{
  159. display: flex;
  160. width: 95%;
  161. justify-content: space-between;
  162. }
  163. /* 上方、中间左侧文字 */
  164. .aboveTitle,
  165. .midTitle,
  166. .bottomTitle{
  167. padding-bottom: 20rpx;
  168. }
  169. /* 设置链接样式 */
  170. .toLink{
  171. color: skyblue;
  172. text-decoration: underline;
  173. }
  174. /* 需求号和课程号状态 */
  175. .needState{
  176. padding-left: 30rpx;
  177. color: red;
  178. font-weight: bold;
  179. }
  180. /* 头像 */
  181. .headerPortrait{
  182. width: 200rpx;
  183. }
  184. /* 设置操作状态字体 */
  185. .operateState{
  186. font-weight: bold;
  187. color: red;
  188. }
  189. .bottomWrapper{
  190. margin-top: 140rpx;
  191. }
  192. /* 底部按钮 */
  193. .operation{
  194. display: flex;
  195. justify-content: space-around;
  196. margin-top: 120rpx;
  197. }
  198. /* 按钮 */
  199. .operationRefuseBtn,
  200. .operationConfirmBtn{
  201. width: 160rpx;
  202. height: 60rpx;
  203. line-height: 60rpx;
  204. text-align: center;
  205. // border: 1rpx solid #5B9BD5;
  206. border-radius: 30rpx;
  207. font-size: 40rpx;
  208. // background-color: #5B9BD5;
  209. color: white;
  210. }
  211. .operationConfirmBtn{
  212. background-color: #35b882;
  213. }
  214. .operationRefuseBtn{
  215. background-color: #3ed598;
  216. }
  217. </style>