index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <view class="page" :style="{'height':(h)+'px'}">
  3. <c-nav-bar title="我的" bgColor="transparent" :titleStyle="titleStyle" :showIcon="false"></c-nav-bar>
  4. <view class="bg" :style="{'padding-top':(mt+30)+'px'}">
  5. <view class="account">
  6. <image :src="avatar" mode="aspectFill"></image>
  7. <text>{{name}}</text>
  8. <u-icon name="arrow-right" color="#ffffff" size="28"></u-icon>
  9. </view>
  10. </view>
  11. <view class="orders box">
  12. <view class="o_top">
  13. <text>订单管理</text>
  14. <view @click="toTurn('/pagesMy/orderList/orderList')">
  15. <text>全部</text>
  16. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  17. </view>
  18. </view>
  19. <view class="o_menus">
  20. <view v-for="(item,index) in menus" :key="index" @click="specifiedOrder(index)">
  21. <image :src="item.img"></image>
  22. <text>{{item.title}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="menu box" @click="toTurn('/pagesMy/stayInfo/roomPosition')">
  27. <text>酒店民宿信息</text>
  28. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  29. </view>
  30. <navigator url="/pages/my/roomType">
  31. <view class="menu box">
  32. <text>房型管理</text>
  33. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  34. </view>
  35. </navigator>
  36. <view class="menu box" @tap="toTurn('/pagesMy/code/index')">
  37. <text>预订二维码</text>
  38. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  39. </view>
  40. <!-- 退出登录按钮 -->
  41. <view class="logout" @tap="logout">
  42. <text>退出登录</text>
  43. </view>
  44. <Tabbar :tabbarIndex="3"></Tabbar>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. titleStyle: {
  52. fontSize: '34rpx',
  53. fontWeight: "bold",
  54. color: '#FFFFFF'
  55. },
  56. avatar: 'https://fsy.shengsi.gov.cn/file/20240107/d61321708599457bbcca1c089154e635.png',
  57. name: '未知',
  58. menus: [{
  59. img: 'https://fsy.shengsi.gov.cn/file/20240107/83bca90dfb3f4b1fba36115dc7269219.png',
  60. title: '待确认',
  61. path: ''
  62. },
  63. {
  64. img: 'https://fsy.shengsi.gov.cn/file/20240107/7e7825255bbc4d06ae5d75e7bb23db71.png',
  65. title: '未支付',
  66. path: ''
  67. },
  68. {
  69. img: 'https://fsy.shengsi.gov.cn/file/20240107/c368a627821244929ab6477acb46fb15.png',
  70. title: '已预订',
  71. path: ''
  72. },
  73. {
  74. img: 'https://fsy.shengsi.gov.cn/file/20240107/656b5cc9e9514a08a3f2abd86d86b4ca.png',
  75. title: '已取消',
  76. path: ''
  77. }
  78. ]
  79. }
  80. },
  81. mounted() {
  82. if (uni.getStorageSync('userInfo')) {
  83. this.name = uni.getStorageSync('userInfo').realName;
  84. this.avatar = uni.getStorageSync('userInfo').headUrl;
  85. }
  86. },
  87. methods: {
  88. specifiedOrder(index) {
  89. uni.navigateTo({
  90. url: '/pagesMy/orderList/orderList?Type=' + index
  91. })
  92. },
  93. toTurn(url) {
  94. uni.navigateTo({
  95. url
  96. })
  97. },
  98. // 退出登录
  99. logout() {
  100. uni.showModal({
  101. title: '温馨提示',
  102. content: '确定要退出登录吗?',
  103. success: (res) => {
  104. if (res.confirm) {
  105. // 清除缓存数据
  106. uni.clearStorageSync();
  107. // 跳转到登录页
  108. uni.reLaunch({
  109. url: '/pages/login/index'
  110. });
  111. }
  112. }
  113. });
  114. }
  115. }
  116. }
  117. </script>
  118. <style scoped lang="less">
  119. .page {
  120. background: #F3F4F4;
  121. padding-bottom: 40rpx;
  122. box-sizing: border-box;
  123. overflow-y: auto;
  124. .bg {
  125. width: 100%;
  126. height: 412rpx;
  127. padding: 0 60rpx;
  128. background: url(https://fsy.shengsi.gov.cn/file/20240107/fc66824bcef14a3b9e19f8b966a128c7.png) no-repeat;
  129. background-size: 100% 100%;
  130. box-sizing: border-box;
  131. position: relative;
  132. z-index: 1;
  133. .account {
  134. display: flex;
  135. align-items: center;
  136. image {
  137. width: 96rpx;
  138. height: 96rpx;
  139. border-radius: 50rpx;
  140. }
  141. text {
  142. font-size: 40rpx;
  143. font-family: PingFang SC, PingFang SC;
  144. font-weight: 800;
  145. color: #FFFFFF;
  146. margin: 0 20rpx;
  147. }
  148. }
  149. }
  150. .box {
  151. width: calc(100% - 60rpx);
  152. margin: 0 30rpx;
  153. padding: 30rpx;
  154. box-sizing: border-box;
  155. background: #FFFFFF;
  156. border-radius: 10rpx 10rpx 10rpx 10rpx;
  157. }
  158. .orders {
  159. margin-top: -25rpx;
  160. position: relative;
  161. z-index: 2;
  162. .o_top {
  163. display: flex;
  164. align-items: center;
  165. justify-content: space-between;
  166. &>text {
  167. font-size: 32rpx;
  168. font-family: PingFang SC, PingFang SC;
  169. font-weight: 800;
  170. color: #333333;
  171. }
  172. &>view {
  173. display: flex;
  174. align-items: center;
  175. &>text {
  176. font-size: 24rpx;
  177. font-family: PingFang SC, PingFang SC;
  178. font-weight: 400;
  179. color: #999999;
  180. margin-right: 10rpx;
  181. }
  182. }
  183. }
  184. .o_menus {
  185. margin-top: 30rpx;
  186. padding-top: 30rpx;
  187. border-top: 1rpx solid #F1F1F1;
  188. display: flex;
  189. align-items: center;
  190. justify-content: space-around;
  191. flex-wrap: wrap;
  192. &>view {
  193. width: 25%;
  194. display: flex;
  195. flex-direction: column;
  196. align-items: center;
  197. image {
  198. width: 64rpx;
  199. height: 64rpx;
  200. }
  201. text {
  202. font-size: 24rpx;
  203. font-family: PingFang SC, PingFang SC;
  204. font-weight: 400;
  205. color: #1F2425;
  206. margin-top: 10rpx;
  207. }
  208. }
  209. }
  210. }
  211. .menu {
  212. margin-top: 30rpx;
  213. display: flex;
  214. align-items: center;
  215. justify-content: space-between;
  216. text {
  217. font-size: 30rpx;
  218. font-family: PingFang SC, PingFang SC;
  219. font-weight: 400;
  220. color: #333333;
  221. }
  222. }
  223. .logout {
  224. margin: 30rpx;
  225. padding: 30rpx;
  226. background-color: #fff;
  227. border-radius: 10rpx;
  228. display: flex;
  229. justify-content: center;
  230. align-items: center;
  231. text {
  232. font-size: 32rpx;
  233. font-family: PingFang SC, PingFang SC;
  234. font-weight: bold;
  235. color: #FF5757;
  236. line-height: 36rpx;
  237. }
  238. }
  239. }
  240. ::v-deep .bottomBg {
  241. background: transparent !important;
  242. }
  243. </style>