用工小程序前端代码
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.

169 lines
5.4 KiB

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