123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- <template>
- <view>
- <view class="wrapper">
- <!-- 上方邀请号和照片 -->
- <view class="above">
- <view>
- <view class="aboveTitle">
- <text>邀请号:</text>
- <text>{{Info.id}}</text>
- </view>
- <view class="aboveTitle">
- <text>对方:</text>
- <text>{{Info.fromUname}}</text>
- </view>
- </view>
- <!-- 头像 -->
- <image v-if="Info.sex === null" class="headerPortrait" mode="widthFix" :src="Info.imgUrl"></image>
- <image v-else-if="Info.sex === '男' " class="headerPortrait" mode="widthFix" src="/static/boy.png"></image>
- <image v-else-if="Info.sex === '女' " class="headerPortrait" mode="widthFix" src="/static/girl.png"></image>
- </view>
- <!-- 中间详细信息 -->
- <view>
- <view class="midTitle">
- <text>对方ID:</text>
- <text>{{Info.fromUid}}</text>
- </view>
- <view class="midTitle">
- <text>需求号:</text>
- <text class="toLink" @click="toNeedDetail" style="color: rebeccapurple;">{{Info.requireId}}</text>
- <text class="needState">{{needState}}</text>
- </view>
- <view class="midTitle">
- <text>课程号:</text>
- <text class="toLink" @click="toCourseDetail" style="color: red;">{{Info.courseId}}</text>
- <text class="needState">{{courseState}}</text>
- </view>
- <view class="midTitle">
- <text>需求金额:</text>
- <text>{{Info.requireSalary}}</text>
- </view>
- <view class="midTitle">
- <text>邀请内容:</text>
- <text>{{Info.requireDetail}}</text>
- </view>
- </view>
- <view class="bottomWrapper">
- <view class="bottomTitle">
- <text>邀请日期:</text>
- <text>{{Info.datetime}}</text>
- </view>
- <view class="bottomTitle">
- <text>我方操作状态:</text>
- <text class="operateState">{{Info.operateStatus}}</text>
- </view>
- </view>
- </view>
-
- <view class="operation" v-if="Info.operateStatus!=='拒绝'&&Info.operateStatus!=='同意'">
- <view class="operationRefuseBtn" @click="refuse">拒绝</view>
- <view class="operationConfirmBtn" @click="agree">同意</view>
- </view>
- </view>
- </template>
- <script>
- import {mapMutations} from 'vuex'
- export default {
- data() {
- return {
- Info:[],
- };
- },
- onLoad(option) {
- if (option.id !== undefined) {
- const id = decodeURIComponent(option.id)
- this.getInvitationDetail(id)
- this.toRead(id)
- }
- },
- methods:{
- toNeedDetail() {
- uni.navigateTo({
- url: '/subpkg/student/require/student_require_all_detail?requireId=' + encodeURIComponent(this.Info.requireId)
- })
- },
- toCourseDetail() {
- uni.navigateTo({
- url: '/subpkg/teacher/course/teacher_course_all_detail?courseId=' + encodeURIComponent(this.Info.courseId)
- })
- },
- async getInvitationDetail(id) {
- const { data: result } = await uni.$http.get('/education/invite-info/getInvitationDetail', {inviteId: id})
- this.Info = result.data.one
- //console.log(this.Info)
- },
- async toRead(id){
- const queryObj = {
- id
- }
- const { data: result } = await uni.$http.get('/education/invite-info/modifyStatusToHold',queryObj)
- },
- async refuse(){
- const queryObj = {
- id: this.Info.id
- }
- const { data: result } = await uni.$http.get('/education/invite-info/refuse',queryObj)
- if (result.code == 20000) {
- uni.$showMsg('拒绝邀请成功')
- this.Info.operateStatus = '拒绝'
- setTimeout(() => {
- uni.navigateTo({
- url: '/subpkg/my/invitation/my_invitation_receive'
- }, 3000)
- })
- }
- },
- async agree(){
- const queryObj = {
- id: this.Info.id
- }
- const { data: result } = await uni.$http.get('/education/invite-info/agree',queryObj)
- if (result.message == '该需求已锁,请30分钟后查看' || result.message == '该需求已下架' || result.message == '同意失败,请稍后在试' || result.message == '该课程已下架' || result.message == '该课程已锁,请30分钟后查看') {
- return uni.$showMsg(result.message)
- }
- const identify = result.data.identify
- if ('教员' === identify) {
- uni.$showMsg('已通知对方完成支付')
- this.Info.operateStatus = '同意'
- setTimeout(() => {
-
- uni.navigateTo({
- url: '/subpkg/my/invitation/my_invitation_receive'
- }, 3000)
- })
- }
- if ('学员' === identify) {
- const infos = result.data.info
- uni.navigateTo({
- url: '/subpkg/my/order/my_order_detail?orderId=' + encodeURIComponent(infos.orderId)
- })
- }
- }
- }
- }
- </script>
- <!-- 设置页面背景 -->
- <style lang="scss">
- page{
- height: 100%;
- // background-color: #FFF;
- }
- </style>
- <style lang="scss" scoped>
- /* 设置背景 */
- .wrapper{
- padding: 30rpx;
- margin: 30rpx;
- border-radius: 30rpx;
- background-color: #FFF;
- font-size: 30rpx;
- }
- /* 上方邀请号和照片 */
- .above{
- display: flex;
- // width: 95%;
- justify-content: space-between;
- }
- /* 上方、中间左侧文字 */
- .aboveTitle,
- .midTitle,
- .bottomTitle{
- padding-bottom: 20rpx;
- }
- /* 设置链接样式 */
- .toLink{
- color: skyblue;
- text-decoration: underline;
- }
- /* 需求号和课程号状态 */
- .needState{
- padding-left: 30rpx;
- color: red;
- font-weight: bold;
- }
- /* 头像 */
- .headerPortrait{
- width: 200rpx;
- border-radius: 30rpx;
- }
- /* 设置操作状态字体 */
- .operateState{
- font-weight: bold;
- color: red;
- }
- .bottomWrapper{
- margin-top: 140rpx;
- }
- /* 底部按钮 */
- .operation{
- display: flex;
- justify-content: space-around;
- margin-top: 60rpx;
- }
- /* 按钮 */
- .operationRefuseBtn,
- .operationConfirmBtn{
- width: 200rpx;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- // border: 1rpx solid #5B9BD5;
- border-radius: 50rpx;
- font-size: 30rpx;
- // background-color: #5B9BD5;
- color: white;
- }
- .operationConfirmBtn{
- background-color: #35b882;
- }
- .operationRefuseBtn{
- background-color: #3ed598;
- }
- </style>
|