myself.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view class="content">
  3. <view class="person">
  4. <image class="person_touxiang" v-if="touxiang=='' || touxiang==null" src="../../static/my/touxiang.png"></image>
  5. <image class="person_touxiang" v-else :src="touxiang"></image>
  6. <text class="person_name">{{cardName}}</text>
  7. <text class="person_phone">{{cardNum}}</text>
  8. <text class="person_identity">
  9. <text v-if="cardIdentity=='0'">其他</text>
  10. <text v-if="cardIdentity=='1'">学生</text>
  11. <text v-if="cardIdentity=='4'">教职工</text>
  12. <text v-if="cardIdentity=='5'">校友</text>
  13. <text v-if="cardIdentity=='7'">临时人员</text>
  14. </text>
  15. </view>
  16. <!-- 第二部分,我的订单 -->
  17. <view class="my_order">
  18. <view class="order_title">我的订单</view>
  19. <view class="order_all" @click="navigateToAll">全部></view>
  20. <view class="item-list">
  21. <view class="item-list-one" @click="navigateToDaizhifu">
  22. <image src="../../static/my/no_zhifu.svg" class="img-btn"></image>
  23. <text class="list-txt">待支付</text>
  24. </view>
  25. <view class="item-list-one" @click="navigateToDairuzhu">
  26. <image src="../../static/my/dairuzhu.svg" class="img-btn"></image>
  27. <text class="list-txt">待入住</text>
  28. </view>
  29. <view class="item-list-one" @click="navigateToYiruzhu">
  30. <image src="../../static/my/yiruzhu.svg" class="img-btn"></image>
  31. <text class="list-txt">已入住</text>
  32. </view>
  33. <view class="item-list-one" @click="navigateToYiquxiao">
  34. <image src="../../static/my/yiquxiao.svg" class="img-btn"></image>
  35. <text class="list-txt">已取消</text>
  36. </view>
  37. </view>
  38. <view class="item-list">
  39. <view class="item-list-one" @click="navigateToDaijiezhang">
  40. <image src="../../static/my/no_pay.svg" class="img-btn"></image>
  41. <text class="list-txt">待结账</text>
  42. </view>
  43. <view class="item-list-one" @click="navigateToYiwancheng">
  44. <image src="../../static/my/wancheng.svg" class="img-btn"></image>
  45. <text class="list-txt">已完成</text>
  46. </view>
  47. </view>
  48. </view>
  49. <!-- 第三部分,我的服务 -->
  50. <view class="my_help">
  51. <view class="help_title">我的服务</view>
  52. <view class="item-list">
  53. <view class="item-list-one" @click="telphone(phone)">
  54. <image src="../../static/my/person_phone.svg" class="img-btn"></image>
  55. <text class="list-txt">人工热线</text>
  56. </view>
  57. <!-- -->
  58. <view class="item-list-one" @click="navigateToLiucheng" v-if="cardIdentity=='7'">
  59. <image src="../../static/my/liucheng.png" class="img-btn"></image>
  60. <text class="list-txt">流程管理</text>
  61. </view>
  62. <!-- v-if="cardIdentity=='4'" -->
  63. <view class="item-list-one" @click="navigateToLiucheng2">
  64. <image src="../../static/my/liucheng.png" class="img-btn"></image>
  65. <text class="list-txt">教师流程</text>
  66. </view>
  67. <view class="item-list-one" @click="navigateToLiucheng3" v-if="manager=='1'">
  68. <image src="../../static/my/liucheng.png" class="img-btn"></image>
  69. <text class="list-txt">管理员流程</text>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import {
  77. getuserinfo
  78. } from '../../utils/api_hotel.js'
  79. export default {
  80. data() {
  81. return {
  82. phone:'0791-82293574',//客服热线电话
  83. cardName:localStorage.getItem('name'),//用户名
  84. cardIdentity:localStorage.getItem('department'),//身份
  85. cardNum:localStorage.getItem('telephone'),//卡号
  86. touxiang:localStorage.getItem('user_head'),
  87. manager:localStorage.getItem('manager'),//1管理员,0不是管理员
  88. }
  89. },
  90. onLoad() {
  91. },
  92. onShow() {
  93. // this.getUserInfo()
  94. },
  95. mounted() {
  96. },
  97. methods: {
  98. // 授权获取code
  99. handleAuthCode() {
  100. alert('aaa')
  101. let authCode = this.handleUrlCode().code(); // 截取页面code
  102. let appId = 'wxd87cbe1db0437303'; // 微信公众号的AppId
  103. let scope = 'snsapi_userinfo' // 授权
  104. let redirectUri = 'https%3A%2F%2Fchtech.ncjti.edu.cn%2Fhotel%2Fh5%2F%23%2Fpages%2Fmyself%2Fmyself';//回调地址
  105. let path = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appId +
  106. '&redirect_uri=' + redirectUri + '&response_type=code&scope=' + scope +
  107. '&state=STATE#wechat_redirect';
  108. if (authCode == null || authCode == '' || authCode == undefined) {
  109. alert('a')
  110. window.location.href = path;
  111. } else {
  112. alert('b')
  113. // this.handleOpenId(authCode);
  114. }
  115. },
  116. // 获取用户信息
  117. getUserInfo() {
  118. let _self = this
  119. var data="?userId="+localStorage.getItem('usersId')
  120. getuserinfo(data).then((res) => {
  121. if (res.success) {
  122. _self.cardName=res.data.userName
  123. _self.cardNum=res.data.phone
  124. _self.cardIdentity=res.data.idCardInformation
  125. _self.touxiang=res.data.headImage
  126. return;
  127. } else {
  128. console.log('获取用户信息失败')
  129. }
  130. }).catch((err) => {
  131. this.$message.error(err.message)
  132. });
  133. },
  134. //跳转到全部订单
  135. navigateToAll(){
  136. uni.navigateTo({
  137. url:"../my_orderlist/my_orderlist?Inv=6"
  138. })
  139. },
  140. //跳转到待支付订单
  141. navigateToDaizhifu(){
  142. uni.navigateTo({
  143. url: "../my_orderlist/my_orderlist?Inv=1",
  144. })
  145. },
  146. //跳转到待入住订单
  147. navigateToDairuzhu(){
  148. uni.navigateTo({
  149. url: "../my_orderlist/my_orderlist?Inv=3"
  150. })
  151. },
  152. //跳转到已入住订单
  153. navigateToYiruzhu(){
  154. uni.navigateTo({
  155. url: "../my_orderlist/my_orderlist?Inv=4"
  156. })
  157. },
  158. //跳转到已取消订单
  159. navigateToYiquxiao(){
  160. uni.navigateTo({
  161. url: "../my_orderlist/my_orderlist?Inv=9"
  162. })
  163. },
  164. //跳转到待结账订单
  165. navigateToDaijiezhang(){
  166. uni.navigateTo({
  167. url: "../my_orderlist/my_orderlist?Inv=5"
  168. })
  169. },
  170. //跳转到已完成订单
  171. navigateToYiwancheng(){
  172. uni.navigateTo({
  173. url: "../my_orderlist/my_orderlist?Inv=8"
  174. })
  175. },
  176. //拨打人工热线
  177. telphone(phone){
  178. uni.makePhoneCall({ phoneNumber: phone }) // 传参带入号码即可
  179. },
  180. //跳转到临时人员流程管理
  181. navigateToLiucheng(){
  182. uni.navigateTo({
  183. url: "../liuchengO/liu_other"
  184. })
  185. },
  186. //跳转到流程管理
  187. navigateToLiucheng2(){
  188. uni.navigateTo({
  189. url: "../liuchengTeacher/liu_teach"
  190. // url: "../liuchengO/liu_other"
  191. // url:"../liuchengManger/liu_manage"
  192. })
  193. },
  194. //跳转到流程管理
  195. navigateToLiucheng3(){
  196. uni.navigateTo({
  197. // url: "../liuchengTeacher/liu_teach"
  198. // url: "../liuchengO/liu_other"
  199. url:"../liuchengManger/liu_manage"
  200. })
  201. },
  202. //跳转到房间报修
  203. navigateToBaoxiu(){
  204. window.location.href='https://jtishfw.ncjti.edu.cn/baoxiu/repair-h5/#/'
  205. }
  206. }
  207. }
  208. </script>
  209. <style>
  210. @import url("./css/myself.css");
  211. </style>