pageHead.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view>
  3. <view class="top-view">
  4. <u-grid>
  5. <u-grid-item>
  6. <u-icon v-if="showBack" name="arrow-left" size="40rpx" @click="goBack()"
  7. style="align-self: flex-start;margin-left: 15rpx;"></u-icon>
  8. </u-grid-item>
  9. <u-grid-item custom-style="opacity:1">
  10. <text class="btn-text">{{ pageTitle }}</text>
  11. </u-grid-item>
  12. <u-grid-item v-if="showLogout" custom-style="opacity:1">
  13. <image class="logout-icon" style=" width:34rpx;height:34rpx;" src="~@/static/img/logout.png" @click="showLogoutDialog()">
  14. </image>
  15. </u-grid-item>
  16. <u-grid-item v-if="showHistory" custom-style="opacity:1">
  17. <image class="logout-icon" style=" width:34rpx;height:34rpx;" src="~@/static/img/doct.png" @click="jumpPage()">
  18. </image>
  19. </u-grid-item>
  20. <u-grid-item v-if="!showHistory&&!showLogout" custom-style="opacity:1">
  21. </u-grid-item>
  22. </u-grid>
  23. </view>
  24. <view>
  25. <!-- <uni-popup ref="alertDialog" type="dialog">
  26. <uni-popup-dialog type="info" cancelText="返回" confirmText="确认" title="提示" content="是否确认退出?"
  27. @confirm="logout()"></uni-popup-dialog>
  28. </uni-popup> -->
  29. <!-- 确认弹窗 -->
  30. <uni-popup ref="alertDialog" background-color="#fff" borderRadius="10px 10px 10px 10px" style="width: 90%;">
  31. <view class="popup-content" style="padding: 20rpx 40rpx" >
  32. <view style="text-align: center;margin: 50rpx 0 50rpx">
  33. <img class="button-icon" src="@/static/img/approve/warning.png" alt="" />
  34. <text style="color: rgba(0, 0, 0, 0.85);font-size: 18px;font-weight: 600">是否确认退出?</text>
  35. </view>
  36. <view class="flex-center mt32" style="margin-bottom: 30rpx;">
  37. <view class="button-left-one flex-center-middle" @click="$refs.alertDialog.close()">
  38. <img class="button-icon" src="@/static/img/approve/reject.png" alt="" />
  39. <view class="reject-text">取消</view>
  40. </view>
  41. <view style="width: 50rpx;"></view>
  42. <view class="button-right-one flex-center-middle" @click="logout()">
  43. <img class="button-icon" src="@/static/img/approve/pass.png" alt="" />
  44. <view class="pass-text">确定</view>
  45. </view>
  46. </view>
  47. </view>
  48. </uni-popup>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. name: "pageHead",
  55. props: {
  56. showBack: false,
  57. showLogout: false,
  58. pageTitle: null,
  59. showHistory:false,
  60. },
  61. data() {
  62. return {}
  63. },
  64. methods: {
  65. jumpPage(){
  66. this.$emit("jumpHistory")
  67. },
  68. logout() {
  69. const app = this
  70. app.$store.dispatch('Logout').then(res => {
  71. uni.reLaunch({
  72. url: '/pages/login/index'
  73. })
  74. })
  75. },
  76. showLogoutDialog() {
  77. this.$refs.alertDialog.open()
  78. },
  79. goBack() {
  80. uni.navigateBack({
  81. delta: 1
  82. });
  83. },
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .top-view {
  89. font-size: 30 rpx;
  90. font-weight: 700;
  91. line-height: 45px;
  92. background-color: white;
  93. height: 45px;
  94. }
  95. .logout-icon {
  96. align-self: flex-end;
  97. margin-right: 20px;
  98. }
  99. .flex-center {
  100. display: flex;
  101. align-items: center;
  102. justify-content: center;
  103. }
  104. .flex-center-middle {
  105. display: flex;
  106. align-items: center;
  107. justify-content: center;
  108. }
  109. .popup-content {
  110. padding: 20rpx 20rpx;
  111. .return_content{
  112. width: 92%;
  113. padding: 20rpx 28rpx;
  114. background: #EFF2F6;
  115. border-radius: 4px;
  116. }
  117. .return_title{
  118. font-family: PingFangSC, PingFang SC;
  119. font-weight: 600;
  120. font-size: 16px;
  121. color: rgba(0,0,0,0.85);
  122. margin-bottom: 10rpx;
  123. }
  124. .button-icon {
  125. width: 28rpx;
  126. height: 28rpx;
  127. margin-right: 8rpx;
  128. }
  129. .button-left {
  130. width: 350rpx;
  131. height: 84rpx;
  132. background: #FFF8F8;
  133. border-radius: 200rpx 0rpx 0rpx 200rpx;
  134. box-shadow: 0px 2px 8px 0px #DFDFDF;
  135. .reject-text {
  136. font-size: 32rpx;
  137. color: #E60114;
  138. line-height: 44rpx;
  139. }
  140. }
  141. .button-right {
  142. width: 350rpx;
  143. height: 84rpx;
  144. background: linear-gradient(90deg, #DC0736 0%, #E60114 100%);
  145. border-radius: 0rpx 200rpx 200rpx 0rpx;
  146. box-shadow: 0px 2px 8px 0px #DFDFDF;
  147. .pass-text {
  148. font-size: 32rpx;
  149. color: #FFFFFF;
  150. line-height: 44rpx;
  151. }
  152. }
  153. .button-left-one {
  154. width: 220rpx;
  155. height: 84rpx;
  156. background: #FFF8F8;
  157. border-radius: 200rpx;
  158. box-shadow: 0px 2px 8px 0px #DFDFDF;
  159. .reject-text {
  160. font-size: 32rpx;
  161. color: #E60114;
  162. line-height: 44rpx;
  163. }
  164. }
  165. .button-right-one {
  166. width: 220rpx;
  167. height: 84rpx;
  168. background: linear-gradient(90deg, #DC0736 0%, #E60114 100%);
  169. border-radius: 200rpx;
  170. box-shadow: 0px 2px 8px 0px #DFDFDF;
  171. .pass-text {
  172. font-size: 32rpx;
  173. color: #FFFFFF;
  174. line-height: 44rpx;
  175. }
  176. }
  177. }
  178. </style>