myself.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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-service">
  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 class="item-list-one" @tap="navigateToXuzhi">
  57. <image src="../../static/my/xuzhi.svg" class="img-btn"></image>
  58. <text class="list-txt">入住须知</text>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. export default {
  66. data() {
  67. return {
  68. phone: '19807957890', //客服热线电话
  69. cardName: '', //用户名
  70. cardIdentity: '', //身份
  71. cardNum: '', //卡号
  72. touxiang: '',
  73. }
  74. },
  75. onLoad() {
  76. // 获取用户信息
  77. this.getUserInfo()
  78. },
  79. methods: {
  80. // 跳转到入住须知
  81. navigateToXuzhi() {
  82. uni.navigateTo({
  83. url: "/pages/ruzhuxuzhi/ruzhuxuzhi",
  84. });
  85. },
  86. // 获取用户信息
  87. getUserInfo() {
  88. var that = this
  89. var tempCardNumber = that.$utils.getEncryptedData('cardNumber')
  90. if (that.$utils.isEmpty(tempCardNumber)) {
  91. uni.showToast({
  92. title: '用户卡号为空'
  93. });
  94. return;
  95. }
  96. that.cardNumber = tempCardNumber;
  97. that.$myRequest({
  98. url: '/hotelReservation/zhotel/appuser.action?card_number=' + that.cardNumber,
  99. }).then(res => {
  100. // console.log(res);
  101. let data = res.data.data
  102. if (res.data.code === 200) {
  103. that.cardName = data.user_name
  104. that.cardPhone = data.user_phone
  105. that.cardNum = data.card_number
  106. if (data.identity_type === 0) {
  107. that.cardIdentity = '其它'
  108. } else if (data.identity_type === 1) {
  109. that.cardIdentity = '学生'
  110. } else if (data.identity_type === 4) {
  111. that.cardIdentity = '教职工'
  112. } else if (data.identity_type === 5) {
  113. that.cardIdentity = '校友'
  114. } else if (data.identity_type === 6) {
  115. that.cardIdentity = '访客'
  116. } else {
  117. that.cardIdentity = '临时人员'
  118. }
  119. } else {
  120. alert('未获得用户数据')
  121. }
  122. });
  123. },
  124. // 跳转到订单
  125. navigateToDingdan(index) {
  126. uni.navigateTo({
  127. url: "/pages/my_orderlist/my_orderlist?Inv=" + index,
  128. })
  129. },
  130. // 拨打人工热线
  131. telphone() {
  132. var that = this
  133. uni.makePhoneCall({
  134. phoneNumber: that.phone
  135. }) // 传参带入号码即可
  136. },
  137. // 跳转到房间报修
  138. navigateToBaoxiu() {
  139. window.location.href = 'https://jtishfw.ncjti.edu.cn/baoxiu/repair-h5/#/'
  140. }
  141. }
  142. }
  143. </script>
  144. <style>
  145. @import url("./css/myself.css");
  146. </style>