myself.vue 4.2 KB

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