myself.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="content">
  3. <view class="person">
  4. <view class="person-left">
  5. <image class="person_touxiang" v-if="touxiang == ''" src="../../static/my/touxiang.svg"></image>
  6. <image class="person_touxiang" v-else :src="touxiang"></image>
  7. <view class="person-info">
  8. <view>
  9. <text class="person_name">{{ cardName }}</text>
  10. <text class="person_identity">{{ cardIdentity }}</text>
  11. </view>
  12. <text class="person_phone">{{cardNum}}</text>
  13. </view>
  14. </view>
  15. <view class="person-right">
  16. <button @tap="shouquan()">重新授权</button>
  17. </view>
  18. </view>
  19. <!-- 第二部分,我的订单 -->
  20. <view class="my_order">
  21. <view class="order_title">我的订单</view>
  22. <view class="order_all" @tap="navigateToDingdan(0)">全部></view>
  23. <view class="item-list">
  24. <view class="item-list-one" @tap="navigateToDingdan(1)">
  25. <image src="../../static/my/no_zhifu.svg" class="img-btn"></image>
  26. <text class="list-txt">待支付</text>
  27. </view>
  28. <view class="item-list-one" @tap="navigateToDingdan(2)">
  29. <image src="../../static/my/dairuzhu.svg" class="img-btn"></image>
  30. <text class="list-txt">已支付</text>
  31. </view>
  32. <view class="item-list-one" @tap="navigateToDingdan(3)">
  33. <image src="../../static/my/yiruzhu.svg" class="img-btn"></image>
  34. <text class="list-txt">已入住</text>
  35. </view>
  36. <view class="item-list-one" @tap="navigateToDingdan(4)">
  37. <image src="../../static/my/yiquxiao.svg" class="img-btn"></image>
  38. <text class="list-txt">已取消</text>
  39. </view>
  40. <view class="item-list-one" @tap="navigateToDingdan(7)">
  41. <image src="../../static/my/dairuzhu.svg" class="img-btn"></image>
  42. <text class="list-txt">退款中</text>
  43. </view>
  44. <view class="item-list-one" @tap="navigateToDingdan(5)">
  45. <image src="../../static/my/wancheng.svg" class="img-btn"></image>
  46. <text class="list-txt">已退款</text>
  47. </view>
  48. <view class="item-list-one" @tap="navigateToDingdan(6)">
  49. <image src="../../static/my/wancheng.svg" class="img-btn"></image>
  50. <text class="list-txt">已退房</text>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 第三部分,我的服务 -->
  55. <view class="my_help">
  56. <view class="help_title">我的服务</view>
  57. <view class="item-list-service">
  58. <view class="item-list-one" @tap="telphone()">
  59. <image src="../../static/my/person_phone.svg" class="img-btn"></image>
  60. <text class="list-txt">人工热线</text>
  61. </view>
  62. <view class="item-list-one" @tap="navigateToXuzhi">
  63. <image src="../../static/my/xuzhi.svg" class="img-btn"></image>
  64. <text class="list-txt">入住须知</text>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import { accredit } from '@/static/shared.js';
  72. export default {
  73. data() {
  74. return {
  75. phone: '19807957890', //客服热线电话
  76. cardName: '', //用户名
  77. cardIdentity: '', //身份
  78. cardNum: '', //卡号
  79. touxiang: '',
  80. }
  81. },
  82. onLoad() {
  83. // 获取用户信息
  84. this.getUserInfo()
  85. },
  86. methods: {
  87. // 授权
  88. shouquan() {
  89. accredit()
  90. },
  91. // 跳转到入住须知
  92. navigateToXuzhi() {
  93. uni.navigateTo({
  94. url: "/pages/ruzhuxuzhi/ruzhuxuzhi",
  95. });
  96. },
  97. // 获取用户信息
  98. getUserInfo() {
  99. var that = this
  100. var tempCardNumber = that.$utils.getEncryptedData('cardNumber')
  101. if (that.$utils.isEmpty(tempCardNumber)) {
  102. uni.showToast({
  103. title: '用户卡号为空'
  104. });
  105. return;
  106. }
  107. that.cardNumber = tempCardNumber;
  108. that.$myRequest({
  109. url: '/hotelReservation/zhotel/appuser.action?card_number=' + that.cardNumber,
  110. }).then(res => {
  111. // console.log(res);
  112. let data = res.data.data
  113. if (res.data.code === 200) {
  114. that.cardName = data.user_name
  115. that.cardPhone = data.user_phone
  116. that.cardNum = data.card_number
  117. if (data.identity_type === 0) {
  118. that.cardIdentity = '其它'
  119. } else if (data.identity_type === 1) {
  120. that.cardIdentity = '学生'
  121. } else if (data.identity_type === 4) {
  122. that.cardIdentity = '教职工'
  123. } else if (data.identity_type === 5) {
  124. that.cardIdentity = '校友'
  125. } else if (data.identity_type === 6) {
  126. that.cardIdentity = '访客'
  127. } else {
  128. that.cardIdentity = '临时人员'
  129. }
  130. } else {
  131. alert('未获得用户数据')
  132. }
  133. });
  134. },
  135. // 跳转到订单
  136. navigateToDingdan(index) {
  137. uni.navigateTo({
  138. url: "/pages/my_orderlist/my_orderlist?Inv=" + index,
  139. })
  140. },
  141. // 拨打人工热线
  142. telphone() {
  143. var that = this
  144. uni.makePhoneCall({
  145. phoneNumber: that.phone
  146. }) // 传参带入号码即可
  147. },
  148. // 跳转到房间报修
  149. navigateToBaoxiu() {
  150. window.location.href = 'https://jtishfw.ncjti.edu.cn/baoxiu/repair-h5/#/'
  151. }
  152. }
  153. }
  154. </script>
  155. <style>
  156. @import url("./css/myself.css");
  157. </style>