代码讲解<script> import wPicker from "@/components/w-picker/w-picker.vue"; import xiaEditor from '@/components/xia-editor/xia-editor'; import multipleSelect from "@/components/momo-multipleSelect/momo-multipleSelect"; export default { data() { return { cross:'', ruleForm: { xuehao: '', xueshengxingming: '', biaoti: '', tupian: '', liaotianneirong: '', fasongshijian: '', wodexuehao: '', wodexingming: '', shhf: '', }, xuehaoOptions: [], xuehaoIndex: 0, // 登录用户信息 user: {}, ro:{ xuehao : false, xueshengxingming : false, biaoti : false, tupian : false, liaotianneirong : false, fasongshijian : false, wodexuehao : false, wodexingming : false, shhf : false, }, } }, components: { wPicker, xiaEditor, multipleSelect }, computed: { baseUrl() { return this.$base.url; }, }, async onLoad(options) { this.ruleForm.fasongshijian = this.$utils.getCurDateTime(); let table = uni.getStorageSync("nowTable"); // 获取用户信息 let res = await this.$api.session(table); this.user = res.data; // ss读取 this.ruleForm.wodexuehao = this.user.xuehao this.ro.wodexuehao = true; this.ruleForm.wodexingming = this.user.xueshengxingming this.ro.wodexingming = true; // 下2 res = await this.$api.option(`xuesheng`,`xuehao`,{}); this.xuehaoOptions = res.data; // 如果有登录,获取登录后保存的userid this.ruleForm.userid = uni.getStorageSync("userid") if (options.refid) { // 如果上一级页面传递了refid,获取改refid数据信息 this.ruleForm.refid = options.refid; this.ruleForm.nickname = uni.getStorageSync("nickname"); } // 如果是更新操作
时间: 2024-02-14 20:19:58 浏览: 139
这是一个 Vue.js 的组件,其中引用了三个子组件:w-picker、xiaEditor 和 multipleSelect。在 data 中定义了一些变量,包括 cross、ruleForm、xuehaoOptions 等。其中 ruleForm 包含了一些表单数据,如 xuehao、xueshengxingming、biaoti 等。通过 computed 属性定义了 baseUrl 变量,通过 async onLoad 方法获取用户信息、选项等数据,并进行相应的赋值和判断。如果 options.refid 存在,则将其赋值给 ruleForm.refid,并将 nickname 读取出来。最后,根据更新操作进行相应的处理。
阅读全文