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

183 lines
5.6 KiB

6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
4 months ago
6 months ago
6 months ago
3 months ago
6 months ago
3 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
3 months ago
6 months ago
3 months ago
3 months ago
3 months ago
6 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
6 months ago
4 months ago
6 months ago
4 months ago
3 months ago
4 months ago
3 months ago
6 months ago
3 months ago
4 months ago
6 months ago
6 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 @click="onNavigator" 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('config_privacy')"></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,getSessionKey } from "@/common/api.js"
  55. export default {
  56. name : 'Auth',
  57. data() {
  58. return {
  59. checked:[],
  60. show:false,
  61. sysList:[],
  62. code:""
  63. }
  64. },
  65. mounted() {
  66. this.onSysText()
  67. this.onSessionKey()
  68. },
  69. filter:{
  70. },
  71. methods: {
  72. onSessionKey(){
  73. // let that = this
  74. // uni.login({
  75. // success(res) {
  76. // that.code = res.code
  77. // getSessionKey({code:that.code}).then(response=>{
  78. // uni.setStorageSync('sessionKey',response.result)
  79. // }).catch(error=>{
  80. // })
  81. // }
  82. // })
  83. },
  84. getValueByName(name) {
  85. const item = this.sysList.find((item) => item.paramCode == name);
  86. return item ? item.value : "";
  87. },
  88. onSysText(){
  89. let that = this
  90. let params={}
  91. // getSysText(params).then(response=>{
  92. // that.sysList=response.result
  93. // uni.setStorageSync('sysList', response.result)
  94. // }).catch(error=>{
  95. // })
  96. },
  97. checkboxChange(n) {
  98. console.log('change', n);
  99. },
  100. onCancel(){
  101. this.show=false;
  102. this.checked=[];
  103. },
  104. onAgree(){
  105. this.show=false;
  106. this.checked=['1'];
  107. },
  108. onLogin(event){
  109. console.info(event)
  110. let that = this
  111. if(that.checked.length==0){
  112. return uni.showToast({
  113. icon: "none",
  114. title: "请勾选隐私协议"
  115. })
  116. }
  117. uni.showLoading({
  118. title: '登录中...'
  119. })
  120. uni.login({
  121. success(res) {
  122. console.info(res.code)
  123. if(res.errMsg != "login:ok"){
  124. return
  125. }
  126. let params={
  127. code : res.code,
  128. encryptedData: event.detail.encryptedData,
  129. headimgurl:event.detail.userInfo.avatarUrl,
  130. iv:event.detail.iv,
  131. nickName:event.detail.userInfo.nickName,
  132. session_key:uni.getStorageSync('sessionKey'),
  133. shareId:uni.getStorageSync('userId'),
  134. vid:""
  135. }
  136. appletLogin(params).then((response) => {
  137. let result = response.result
  138. console.info(`appletLogin`,result)
  139. uni.hideLoading()
  140. uni.setStorageSync('token', result.token)
  141. uni.setStorageSync('userInfo', result.userInfo)
  142. if(!result.userInfo.headImage && !result.userInfo.nickName && !result.userInfo.phone){
  143. uni.navigateTo({
  144. url:"/pages/login/index"
  145. })
  146. }else{
  147. uni.navigateTo({
  148. url:"/pages/identity/index"
  149. })
  150. }
  151. }).catch((error) =>{
  152. })
  153. }
  154. })
  155. },
  156. onNavigator(){
  157. uni.switchTab({
  158. url:"/pages/home/index"
  159. })
  160. },
  161. handleOpenPrivacyContract() {
  162. // 打开隐私协议页面
  163. wx.openPrivacyContract({
  164. success: () => {}, // 打开成功
  165. fail: () => {}, // 打开失败
  166. complete: () => {}
  167. })
  168. }
  169. }
  170. }
  171. </script>
  172. <style scoped lang="scss">
  173. </style>