Vuetify —— 使用步骤条组件 v-stepper

在这里插入图片描述

<template>
  <div>
    <v-card elevation="0" style="border:1px solid #EAEBEE">
      <v-card-title class="text-body-1 mx-2" style="height:70px"
        >绑定</v-card-title
      >
      <v-divider></v-divider>
      <v-stepper v-model="e1">
        <v-stepper-header>
          <v-stepper-step :complete="e1 > 1" step="1">
            步骤1
          </v-stepper-step>

          <v-divider style="flex:1"></v-divider>

          <v-stepper-step :complete="e1 > 2" step="2">
            步骤2
          </v-stepper-step>
        </v-stepper-header>

        <v-stepper-items class="py-8">
          <v-stepper-content step="1">
            <v-card elevation="0" height="260" class="mb-10">
              <!-- 微信二维码展示 -->
              <!-- WECHAT_RZKC登录 -->
              <div class="d-flex flex-column align-center">
                <div class="darken-3 mb-4 text-center">
                  微信扫码绑定
                </div>
                <div style="position:relative;">
                  <!-- 扫码成功 -->
                  <div
                    v-if="scanSuccess"
                    class="px-1 py-1 text-caption d-flex flex-column justify-center"
                    style="width:160px;height:160px;overflow:hidden;background:#fff;opacity:.9;border:1px solid #000;position:absolute;top:0;left:0"
                  >
                    <v-icon size="50" color="#07c160">mdi-check-circle</v-icon>
                    <div class="text-center text-button">
                      扫码成功
                    </div>
                  </div>
                  <!-- 二维码已过期 -->
                  <div
                    v-if="isValid"
                    class="px-1 py-1 text-caption d-flex flex-column justify-center"
                    style="width:160px;height:160px;overflow:hidden;background:#fff;opacity:.9;border:1px solid #000;position:absolute;top:0;left:0"
                  >
                    <v-icon size="50" color="#F5A623">mdi-alert-circle</v-icon>
                    <div class="text-center text-button mt-2">
                      二维码已过期
                      <span
                        @click="toRefresh"
                        class="blue--text"
                        style="cursor: pointer;"
                        >刷新</span
                      >
                    </div>
                  </div>
                  <!-- 绑定失败  -->
                  <div
                    v-if="rzkcCode"
                    class="px-1 py-1 text-caption d-flex flex-column justify-center"
                    style="width:160px;height:160px;overflow:hidden;background:#fff;opacity:.9;border:1px solid #000;position:absolute;top:0;left:0"
                  >
                    <v-icon size="50" color="#F5A623">mdi-alert-circle</v-icon>
                    <div class="text-center text-button mt-2">
                      绑定失败
                      <span
                        @click="toRefresh"
                        class="blue--text"
                        style="cursor: pointer;"
                        >再试一次</span
                      >
                    </div>
                  </div>
                  <div
                    class="px-1 py-1 text-caption d-flex flex-row justify-center"
                    style="width:160px;height:160px;overflow:hidden;border:1px solid #000;background:#fff;"
                    id="wechat_code"
                    ref="wechat_code"
                  ></div>
                </div>

                <div
                  class="mt-2 d-flex flex-row justify-center"
                  style="color:#777;"
                >
                  请使用微信扫码
                </div>
              </div>
            </v-card>
          </v-stepper-content>

          <v-stepper-content step="2">
            <v-card elevation="0" class="mb-10" height="260px">
              <div class="d-flex flex-column align-center">
                <div class="text-center">
                  微信账号绑定
                </div>
                <v-sheet
                  color="white"
                  elevation="2"
                  height="80"
                  width="80"
                  class="mt-4 rounded-circle"
                >
                  <v-img
                    contain
                    width="80"
                    height="80"
                    class="rounded-circle"
                    :src="
                      headimgurl == null
                        ? require('@/assets/avatar.png')
                        : headimgurl
                    "
                  ></v-img>
                </v-sheet>
                <div
                  class=" mt-6 text-subtitle-1 text-center"
                  v-if="login_name || nickname || fullname"
                >
                  你好,{{ login_name || nickname || fullname }}
                </div>
                <div class="mt-6 text-subtitle-1 text-center">
                  <div>你即将绑定此微信账号</div>
                  <div>后续可以使用此微信账号登录</div>
                </div>
              </div>
            </v-card>
            <div class="d-flex justify-center">
              <v-btn color="primary" @click="doBind">
                完成
              </v-btn>

              <v-btn class="ml-4" text @click="cancelBind">
                上一步
              </v-btn>
            </div>
          </v-stepper-content>
        </v-stepper-items>
      </v-stepper>
    </v-card>
  </div>
</template>

export default {
  name: "Binding",
  data() {
    return {
      e1: "1"
    };
  }
};
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
非常抱歉,我之前的回答有误,uView2 中没有 `u-stepper` 步进器组件。 不过,你可以使用 `u-number-box` 数字框组件来实现步进器的功能。以下是一个示例: ```vue <template> <u-popup :visible.sync="showPopup" :position="'bottom'"> <div class="popup-header">科技风格页面弹窗</div> <div class="popup-body"> <u-form @submit.prevent="onSubmit"> <u-form-item label="标题"> <u-input v-model="form.title" placeholder="请输入标题"></u-input> </u-form-item> <u-form-item label="下拉列表"> <u-select v-model="form.select" :options="options"></u-select> </u-form-item> <u-form-item label="步进器"> <u-number-box v-model="form.stepper" :min="1" :max="10"></u-number-box> </u-form-item> <u-button type="primary" native-type="submit">确认</u-button> </u-form> </div> </u-popup> </template> <script> export default { data() { return { showPopup: false, form: { title: '', select: '', stepper: 1 }, options: [ { label: '选项1', value: '1' }, { label: '选项2', value: '2' }, { label: '选项3', value: '3' } ] } }, methods: { onSubmit() { // 提交表单 console.log(this.form) // 关闭弹窗 this.showPopup = false } } } </script> <style> .popup-header { font-size: 16px; font-weight: bold; padding: 16px; border-bottom: 1px solid #ddd; } .popup-body { padding: 16px; } </style> ``` 在这个示例中,我们使用了 `u-number-box` 数字框组件来代替步进器,并设置了 `min` 和 `max` 属性来限制数字范围。其他组件使用方法和上一个示例相同。 再次感谢您的指正,希望这次回答能够帮到您。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值