用工小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
5.4 KiB

7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
4 months ago
7 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
7 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
  1. <template>
  2. <view class="se-pos se-h-vh-100">
  3. <view class="se-flex se-pt-200 se-flex-h-c se-flex-ff-cw">
  4. <image class="se-w-150 se-h-150" src="@/static/image/logo.png" mode=""></image>
  5. <view class="se-flex se-flex-h-c se-fs-34 se-fw-6 se-c-black se-mt-40">
  6. 智选猎头
  7. </view>
  8. </view>
  9. <view class="se-pb-200 se-pos-cb se-w-p-100">
  10. <button @getuserinfo="onLogin" open-type="getUserInfo"
  11. class="se-mx-80 se-br-40 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-32 se-c-white se-bgc-green">
  12. <image class="se-w-45 se-h-35" src="@/static/image/wechat.png" mode=""></image>
  13. <text class="se-ml-10">微信登录</text>
  14. </button>
  15. <!-- <view class="se-mx-80 se-br-40 se-mt-40 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-32 se-c-66 se-bgc-f5">
  16. <text>手机验证码登录</text>
  17. </view> -->
  18. <view class="se-mx-80 se-br-40 se-mt-40 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-24 se-c-33">
  19. <u-checkbox-group @change="checkboxChange" v-model="checked">
  20. <u-checkbox name="1" activeColor="#07C160" label-size="12" shape="circle"
  21. label="阅读并同意"></u-checkbox>
  22. </u-checkbox-group>
  23. <text class="se-c-green" @click="show=true">隐私政策</text>
  24. <text class="se-c-green" @click="show=true">服务条款</text>
  25. </view>
  26. </view>
  27. <u-popup :show="show" :custom-style="{alignItems:'center'}" mode="center" bg-color="transparent">
  28. <view class="se-w-600 se-bgc-white se-br-40 se-p-40">
  29. <view class="se-flex se-flex-h-c">
  30. <image class="se-a-80" src="@/static/image/6588.png" mode=""></image>
  31. </view>
  32. <view class="se-flex se-flex-h-c se-fs-34 se-fw-6 se-c-black se-mt-40">
  33. 服务协议和隐私权政策
  34. </view>
  35. <view class="se-lh-40 se-mt-40 se-fs-24 se-c-99">
  36. <u-parse :content="getValueByName('yszc')"></u-parse>
  37. <!-- <text>请您务必审慎阅读充分理解用户协议和隐私政策各条款包括但不限于用户注意事项用户行为规范以及为了向你提供服务而收集使用存储你个人信息的情况等你可阅读</text>
  38. <text class="se-c-black se-fw-6" @click="handleOpenPrivacyContract()">用工平台小程序用户服务协议</text>
  39. <text></text>
  40. <text class="se-c-black se-fw-6" @click="handleOpenPrivacyContract()">用工平台小程序平台隐私权政策</text>
  41. <text>了解详细信息如你同意请点击下方按钮开始接受我们的服务</text> -->
  42. </view>
  43. <view class="se-flex se-flex-h-sb se-mt-40">
  44. <view @click="onCancel"
  45. class="se-br-20 se-flex-1 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-32 se-c-66 se-bgc-f5">
  46. <text>不同意</text>
  47. </view>
  48. <view @click="onAgree"
  49. class="se-br-20 se-ml-20 se-flex-1 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-32 se-c-white se-bgc-green">
  50. <text class="se-ml-10">同意</text>
  51. </view>
  52. </view>
  53. </view>
  54. </u-popup>
  55. </view>
  56. </template>
  57. <script>
  58. import {
  59. appletLogin,
  60. userInfo,
  61. getSysText
  62. } from "@/common/api.js"
  63. export default {
  64. name: 'Auth',
  65. data() {
  66. return {
  67. checked: [],
  68. show: false,
  69. sysList: []
  70. }
  71. },
  72. mounted() {
  73. this.onSysText()
  74. },
  75. filter: {
  76. },
  77. methods: {
  78. getValueByName(name) {
  79. const item = this.sysList.find((item) => item.name == name);
  80. return item ? item.value : "";
  81. },
  82. onSysText() {
  83. let that = this
  84. let params = {}
  85. getSysText(params).then(response => {
  86. that.sysList = response.result
  87. uni.setStorageSync('sysList', response.result)
  88. }).catch(error => {
  89. })
  90. },
  91. checkboxChange(n) {
  92. console.log('change', n);
  93. },
  94. onCancel() {
  95. this.show = false;
  96. this.checked = [];
  97. },
  98. onAgree() {
  99. this.show = false;
  100. this.checked = ['1'];
  101. },
  102. onLogin(event) {
  103. console.info('登陆', event)
  104. let that = this
  105. if (that.checked.length == 0) {
  106. return uni.showToast({
  107. icon: "none",
  108. title: "请勾选隐私协议"
  109. })
  110. }
  111. uni.showLoading({
  112. title: '登录中...'
  113. })
  114. uni.login({
  115. success(res) {
  116. console.info(res.code)
  117. if (res.errMsg != "login:ok") {
  118. return
  119. }
  120. let params = {
  121. code: res.code,
  122. encryptedData: event.detail.encryptedData,
  123. headimgurl: event.detail.userInfo.avatarUrl,
  124. iv: event.detail.iv,
  125. nickName: event.detail.userInfo.nickName,
  126. session_key: "",
  127. shareId: uni.getStorageSync('userId'),
  128. vid: ""
  129. }
  130. appletLogin(params).then((response) => {
  131. console.info(`response`, response)
  132. uni.hideLoading()
  133. uni.setStorageSync('token', response.result.token)
  134. uni.setStorageSync('company', response.result.company)
  135. uni.setStorageSync('boss', response.result.boss)
  136. uni.setStorageSync('worker', response.result.worker)
  137. uni.setStorageSync('userInfo', response.result.userInfo)
  138. userInfo({}).then(response => {
  139. if (!response.result.headImage && !response.result.nickName) {
  140. uni.navigateTo({
  141. url: "/pages/login/index"
  142. })
  143. } else {
  144. uni.navigateTo({
  145. url: "/pages/identity/index"
  146. })
  147. }
  148. }).catch(err => {
  149. })
  150. }).catch((error) => {
  151. })
  152. }
  153. })
  154. },
  155. handleOpenPrivacyContract() {
  156. // 打开隐私协议页面
  157. wx.openPrivacyContract({
  158. success: () => {}, // 打开成功
  159. fail: () => {}, // 打开失败
  160. complete: () => {}
  161. })
  162. }
  163. }
  164. }
  165. </script>
  166. <style scoped lang="scss">
  167. </style>