合同小程序前端代码仓库
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.

76 lines
3.5 KiB

3 months ago
  1. const __sfc__ = defineComponent({
  2. data() {
  3. return {
  4. username: '',
  5. password: '',
  6. agreed: false
  7. };
  8. },
  9. methods: {
  10. handleAgreementChange(e) {
  11. this.agreed = e.detail.value.includes('agree');
  12. },
  13. handleLogin() {
  14. if (!this.agreed) {
  15. uni.showToast({
  16. title: '请先同意用户协议和隐私政策',
  17. icon: 'none'
  18. });
  19. return;
  20. }
  21. // 这里可以添加登录逻辑
  22. uni.showToast({
  23. title: '登录成功',
  24. icon: 'success'
  25. });
  26. }
  27. }
  28. });
  29. export default __sfc__
  30. function GenPagesIndexIndex1Render(this: InstanceType<typeof __sfc__>): any | null {
  31. const _ctx = this
  32. const _cache = this.$.renderCache
  33. const _component_checkbox = resolveComponent("checkbox")
  34. const _component_label = resolveComponent("label")
  35. const _component_checkbox_group = resolveComponent("checkbox-group")
  36. return createElementVNode("view", utsMapOf({ class: "container" }), [
  37. createElementVNode("view", utsMapOf({ class: "form" }), [
  38. createElementVNode("input", utsMapOf({
  39. class: "input",
  40. type: "text",
  41. placeholder: "请输入您的账号",
  42. modelValue: _ctx.username,
  43. onInput: ($event: InputEvent) => {(_ctx.username) = $event.detail.value}
  44. }), null, 40 /* PROPS, NEED_HYDRATION */, ["modelValue", "onInput"]),
  45. createElementVNode("input", utsMapOf({
  46. class: "input",
  47. type: "password",
  48. placeholder: "请输入您的密码",
  49. modelValue: _ctx.password,
  50. onInput: ($event: InputEvent) => {(_ctx.password) = $event.detail.value}
  51. }), null, 40 /* PROPS, NEED_HYDRATION */, ["modelValue", "onInput"]),
  52. createElementVNode("view", utsMapOf({ class: "agreement" }), [
  53. createVNode(_component_checkbox_group, utsMapOf({ onChange: _ctx.handleAgreementChange }), utsMapOf({
  54. default: withSlotCtx((): any[] => [
  55. createVNode(_component_label, null, utsMapOf({
  56. default: withSlotCtx((): any[] => [
  57. createVNode(_component_checkbox, utsMapOf({ value: "agree" })),
  58. " 阅读并同意《用户协议》和《隐私政策》 "
  59. ]),
  60. _: 1 /* STABLE */
  61. }))
  62. ]),
  63. _: 1 /* STABLE */
  64. }), 8 /* PROPS */, ["onChange"])
  65. ]),
  66. createElementVNode("button", utsMapOf({
  67. class: "button",
  68. onClick: _ctx.handleLogin
  69. }), "登录", 8 /* PROPS */, ["onClick"])
  70. ])
  71. ])
  72. }
  73. const GenPagesIndexIndex1Styles = [utsMapOf([["container", padStyleMapOf(utsMapOf([["display", "flex"], ["justifyContent", "center"], ["alignItems", "center"], ["backgroundColor", "#f5f5f5"]]))], ["form", padStyleMapOf(utsMapOf([["width", "80%"], ["backgroundColor", "#ffffff"], ["paddingTop", 20], ["paddingRight", 20], ["paddingBottom", 20], ["paddingLeft", 20], ["borderRadius", 8], ["boxShadow", "0 2px 10px rgba(0, 0, 0, 0.1)"]]))], ["input", padStyleMapOf(utsMapOf([["width", "100%"], ["height", 40], ["marginBottom", 15], ["paddingTop", 10], ["paddingRight", 10], ["paddingBottom", 10], ["paddingLeft", 10], ["borderWidth", 1], ["borderStyle", "solid"], ["borderColor", "#cccccc"], ["borderRadius", 4]]))], ["agreement", padStyleMapOf(utsMapOf([["marginBottom", 15]]))], ["button", padStyleMapOf(utsMapOf([["width", "100%"], ["height", 40], ["backgroundColor", "#007aff"], ["color", "#ffffff"], ["borderWidth", "medium"], ["borderStyle", "none"], ["borderColor", "#000000"], ["borderRadius", 4], ["fontSize", 16]]))]])]