123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- {extend name="public/base"/}
- {block name="css"}
- {/block}
- {block name="body"}
- <van-nav-bar
- class="nav-theme"
- :fixed="true"
- :placeholder="true"
- left-text="返回"
- left-arrow
- @click-left="onBack"
- >
- <template #title>
- <span class="text-white">修改密码</span>
- </template>
- </van-nav-bar>
- <van-form @submit="onSubmit">
- <van-cell-group>
- <van-field
- v-model="form.old_password"
- required
- type="password"
- label="原始密码"
- placeholder="请输入原始密码"
- :rules="[{ required: true, message: '请输入原始密码' }]"
- ></van-field>
- <van-field
- v-model="form.new_password"
- required
- type="password"
- label="新密码"
- placeholder="请输入新密码"
- :rules="[{ required: true, message: '请输入新密码' }]"
- ></van-field>
- <van-field
- v-model="form.confirm_password"
- required
- type="password"
- label="确认密码"
- placeholder="请输入确认密码"
- :rules="[{ required: true, message: '请输入确认密码' }]"
- ></van-field>
- </van-cell-group>
- <div style="margin: 16px;">
- <van-button round block type="primary" native-type="submit">
- 提交
- </van-button>
- </div>
- </van-form>
- {/block}
- {block name="script"}
- <script>
- function v_setup() {
- let base = {};
- base.form = Vue.reactive({
- old_password: '',
- new_password: '',
- confirm_password: '',
- });
- base.onBack = () => {
- location.href = "{:url('index/index')}";
- };
- //表单提交
- base.onSubmit = () => {
- postJson('/my/passwordPost',base.form).then(() => {
- vant.showDialog({
- title: '提示',
- message: '修改成功',
- }).then(() => {
- location.href = "{:url('index/index')}";
- });
- });
- };
- return base;
- }
- </script>
- {/block}
|