authentication.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view style="height: 100%;">
  3. <view v-if="agreeFlag" :style="'margin-top: ' + (height * 2 - 2) + 'rpx; height: calc(100vh - ' + (height * 2 - 2) + 'rpx)'">
  4. <view class="userinfo">
  5. <image class="userinfo-avatar" src="/assets/image/pro_icon.png" mode="cover"></image>
  6. </view>
  7. <view class="usermotto">
  8. <view class="account">
  9. <text class="title">医院IP/端口:</text>
  10. <input class="text-input" v-model="hospUrlIP" type="text" />
  11. </view>
  12. <view class="account">
  13. <text class="title">工号/手机号:</text>
  14. <input class="text-input" v-model="wxUserValue" type="number" />
  15. </view>
  16. <view class="account">
  17. <text class="title">密码:</text>
  18. <input class="text-input" v-model="wxUserValuePass" type="text" confirm-type="done" password />
  19. </view>
  20. <view class="bottomBtn">
  21. <text @tap="confirm" class="applyBtn">登录</text>
  22. </view>
  23. <text @tap="agreemeetOpen" class="user-agreement">《用户隐私协议》</text>
  24. </view>
  25. <view class="usermotto">
  26. <text class="user-motto">{{ motto }}</text>
  27. </view>
  28. </view>
  29. <scroll-view :scroll-y="true" style="height: 100%; width: 100%;" v-if="!agreeFlag">
  30. <text style="font-size: 40rpx; font-weight: 700; margin-top: 100rpx; display: block; text-align: center">隐私协议</text>
  31. <text :decode="true" style="padding: 0 20rpx; display: block; line-height: 35px">
  32. 1.开发者处理的信息 根据法律规定,开发者仅处理实现小程序功能所必要的信息。 为了身份识别,开发者将在获取你的明示同意后,收集你的微信昵称、头像。
  33. 为了身份验证,开发者将在获取你的明示同意后,收集你的手机号。 2.你的权益 2.1&emsp;关于收集你的手机号,你可以通过以下路径:小程序主页右上角“...” — “设置” —
  34. “小程序已获取的信息” — 点击特定信息 — 点击“通知开发者删除”,开发者承诺收到通知后将删除信息。
  35. 2.2&emsp;关于你的个人信息,你可以通过以下方式与开发者联系,行使查阅、复制、更正、删除等法定权利。
  36. 2.3&emsp;若你在小程序中注册了账号,你可以通过以下方式与开发者联系,申请注销你在小程序中使用的账号。在受理你的申请后,开发者承诺在十五个工作日内完成核查和处理,并按照法律法规要求处理你的相关信息。
  37. 电话:15884411612 3.开发者对信息的存储 3.1&emsp;开发者承诺,除法律法规另有规定外,开发者对你的信息的保存期限应当为实现处理目的所必要的最短时间。 4.信息的使用规则
  38. 4.1&emsp;开发者将会在本指引所明示的用途内使用收集的信息
  39. 4.2&emsp;如开发者使用你的信息超出本指引目的或合理范围,开发者必须在变更使用目的或范围前,再次以通知方式告知并征得你的明示同意。 5.信息对外提供
  40. 5.1&emsp;开发者承诺,不会主动共享或转让你的信息至任何第三方,如存在确需共享或转让时,开发者应当直接征得或确认第三方征得你的单独同意。
  41. 5.2&emsp;开发者承诺,不会对外公开披露你的信息,如必须公开披露时,开发者应当向你告知公开披露的目的、披露信息的类型及可能涉及的信息,并征得你的单独同意。
  42. 6.你认为开发者未遵守上述约定,或有其他的投诉建议、或未成年人个人信息保护相关问题,可通过以下方式与开发者联系;或者向微信进行投诉。 电话 : 15884411612
  43. </text>
  44. <button style="width: 100%; background-color: rgb(48, 118, 250); padding: 10rpx; color: white" type="default" @tap.stop.prevent="agree">已阅读并同意</button>
  45. </scroll-view>
  46. </view>
  47. </template>
  48. <script setup>
  49. import { onLaunch, onShow } from '@dcloudio/uni-app'
  50. import { ref, onMounted, onUnmounted, computed } from 'vue';
  51. import Aes from '../../config/Aes';
  52. import { $http } from '../../config/https';
  53. // 获取应用实例
  54. const app = getApp();
  55. // 响应式数据
  56. const hospUrlIP = ref('http://10.1.?.29:8090');
  57. // const hospUrlIP = ref('https://np.h03.p0551.com');
  58. const wxUserValue = ref('');
  59. const wxUserValuePass = ref('');
  60. const motto = ref('请确保设备在医院内网环境下使用!');
  61. const userInfo = ref({});
  62. const agreeFlag = ref(true);
  63. // 导航栏数据
  64. const navbarData = ref({
  65. background: '',
  66. title: '登录移动护理',
  67. height: '100',
  68. bottom: true,
  69. isGoBack: true,
  70. cleanPat: 'Y'
  71. });
  72. // 计算高度
  73. const height = ref(app.globalData.height * 2 + 20);
  74. // 页面加载时
  75. onMounted(() => {
  76. // 可以在这里处理页面初始化逻辑
  77. const storageUrl = uni.getStorageSync('appUrlAddress');
  78. if (storageUrl) {
  79. hospUrlIP.value = storageUrl;
  80. }
  81. });
  82. // 页面显示时
  83. onShow(() => {
  84. const storageUrl = uni.getStorageSync('appUrlAddress');
  85. if (storageUrl) {
  86. hospUrlIP.value = storageUrl;
  87. }
  88. });
  89. const confirm = () => {
  90. const currentHospUrl = hospUrlIP.value;
  91. const userName = wxUserValue.value;
  92. const passWord = wxUserValuePass.value;
  93. uni.setStorageSync('appUrlAddress', currentHospUrl);
  94. const data = {
  95. params: [
  96. {
  97. userName,
  98. passWord: Aes.Encrypt(passWord)
  99. }
  100. ]
  101. };
  102. $http.post('urlDeault', this , {
  103. code: '1001',
  104. data: data,
  105. success: (res) => {
  106. if (res.errorCode === '0') {
  107. uni.setStorageSync('userData', res.result[0]);
  108. uni.showToast({
  109. title: '登录成功',
  110. icon: 'none'
  111. });
  112. setTimeout(() => {
  113. uni.redirectTo({
  114. url: '../index/index'
  115. });
  116. }, 1000);
  117. }
  118. }
  119. });
  120. };
  121. const agreemeetOpen = () => {
  122. agreeFlag.value = false;
  123. };
  124. const agree = () => {
  125. agreeFlag.value = true;
  126. };
  127. </script>
  128. <style scoped>
  129. .userinfo {
  130. display: flex;
  131. flex-direction: column;
  132. align-items: center;
  133. padding-top: 200rpx;
  134. }
  135. .userinfo-avatar {
  136. width: 128rpx;
  137. height: 138rpx;
  138. margin: 20rpx;
  139. }
  140. .userinfo-nickname {
  141. color: #809aff;
  142. }
  143. .usermotto {
  144. display: flex;
  145. flex-direction: column;
  146. align-items: center;
  147. margin-top: 30px;
  148. }
  149. .user-motto {
  150. color: red;
  151. }
  152. .applyBtn {
  153. display: block;
  154. text-align: center;
  155. padding: 15rpx 110rpx;
  156. letter-spacing: 4px;
  157. font-size: 32rpx;
  158. color: #fff;
  159. background: dodgerblue;
  160. margin: 35rpx 14rpx !important;
  161. border-radius: 20px;
  162. }
  163. .account {
  164. font-size: 32rpx;
  165. height: 88rpx;
  166. padding-left: 50rpx;
  167. line-height: 88rpx;
  168. border-bottom: 2rpx solid #ebedf0e0;
  169. }
  170. .account .title {
  171. width: 200rpx;
  172. height: 100%;
  173. display: inline-block;
  174. }
  175. .account .text-input {
  176. display: inline-block;
  177. width: calc(100% - 220rpx);
  178. font-size: 30rpx;
  179. vertical-align: sub;
  180. }
  181. .bottomBtn {
  182. display: flex;
  183. }
  184. .user-agreement {
  185. font-size: 22rpx;
  186. color: rgb(61, 95, 245);
  187. }
  188. </style>