myself.vue 4.0 KB

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