123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <view>
- <back></back>
- <image src="https://chenglantimes.com/prod-api/profile/upload/2024/08/27/1724751981292.jpg" mode="widthFix" style="width: 100%"></image>
- <view class="bg">
- <image src="https://chenglantimes.com/prod-api/profile/upload/2025/01/02/1735784855953.jpg" mode="widthFix" class="llg animated fadeInDown"></image>
- <view class="xy">
- <u-checkbox-group class="checkbox" v-model="item.checked">
- <u-checkbox size="15" shape="circle" label="我已阅读并同意" labelSize="14" name="true"></u-checkbox>
- </u-checkbox-group>
- <text class="a" @click="go('/pages/other/agreement?title=用户协议')">《用户协议》</text>
- <text>和</text>
- <text class="a" @click="go('/pages/other/agreement?title=隐私政策')">《隐私政策》</text>
- </view>
- <button class="btn" @click="getUserProfile()" :disabled="disabled">用户登录</button>
- </view>
- <view class="doctor" @click="go('/pages/user/loginDoctor')">
- <view class="login">
- <text class="icon"></text>
- <text>医生登录</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- item: {},
- disabled: false //防止重复点击
- };
- },
- methods: {
- getUserProfile() {
- let rule = [{ name: 'checked', checkType: 'notnull', errorMsg: '请同意并勾选协议' }];
- if (!this.verify.check(this.item, rule)) {
- uni.showModal({ content: this.verify.error, showCancel: false });
- return false;
- }
- this.disabled = true;
- let code = '';
- uni.login({
- provider: 'weixin',
- success: (res) => {
- code = res.code;
- }
- });
- //获取用户信息
- uni.getUserProfile({
- desc: '用于完善会员资料',
- lang: 'zh_CN',
- provider: 'weixin',
- success: (info) => {
- let item = info.userInfo;
- item.code = code;
- this.http.request({
- url: '/app/user/login',
- data: item,
- method: 'POST',
- success: (res) => {
- this.disabled = false;
- uni.setStorageSync('user', res.data.data);
- uni.navigateBack();
- },
- fail: (res) => {
- this.disabled = false;
- }
- });
- },
- fail: (res) => {
- this.disabled = false;
- }
- });
- },
- go(url) {
- uni.navigateTo({ url: url });
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background-color: white;
- }
- .bg {
- padding: 30px;
- position: relative;
- margin-top: -30px;
- background-color: white;
- border-radius: 25px 25px 0px 0px;
- text-align: center;
- .llg{
- margin: 0 auto;
- border-radius: 25px;
- margin-bottom: 15px;
- width: 100%;
- height: 222px;
- }
- }
- .doctor {
- position: fixed;
- width: 100%;
- bottom: 10px;
- .login {
- text-align: center;
- padding: 20px;
- color: $font-c;
- .icon {
- padding-right: 5px;
- }
- }
- }
- </style>
|