|
@@ -1,6 +1,9 @@
|
|
|
<script setup lang="ts">
|
|
|
-import {computed, ref} from "vue";
|
|
|
+import {computed, onMounted, ref} from "vue";
|
|
|
import {DataCenter} from "../DataCenter.ts";
|
|
|
+import {Tools} from "../Tools.ts";
|
|
|
+import {LocalModels} from "../LocalModels.ts";
|
|
|
+import {Network} from "../Network.ts";
|
|
|
|
|
|
let dateModeTexts = ["新历", "农历"]
|
|
|
let knowTimeTexts = ["知道时辰", "不知道时辰"]
|
|
@@ -17,6 +20,9 @@ let chengshi = ref("-")
|
|
|
let diqu = ref("-")
|
|
|
let chengshiOptions = ref([])
|
|
|
let diquOptions = ref([])
|
|
|
+let userName = ref("")
|
|
|
+let isMan = ref(true)
|
|
|
+let userNameCompt = ref()
|
|
|
|
|
|
function range(min: number, max: number) {
|
|
|
let result = []
|
|
@@ -57,12 +63,77 @@ let getShengFens = computed(function () {
|
|
|
})
|
|
|
|
|
|
function applyInfo() {
|
|
|
- console.log(document.URL)
|
|
|
+ let query = window.location.search
|
|
|
+ let params = new URLSearchParams(query)
|
|
|
+ let openId = params.get("user")?.trim()
|
|
|
+ if (openId.length == 0) {
|
|
|
+ Tools.showMessage("获取用户信息失败,请退出页面重试")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let uName = userName.value.trim()
|
|
|
+ if (uName.length == 0) {
|
|
|
+ Tools.showMessage("请填写用户姓名")
|
|
|
+ userNameCompt.value?.focus()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ let request = new LocalModels.UserRequest()
|
|
|
+ request.open_id = openId
|
|
|
+ request.user_name = uName
|
|
|
+ request.is_man = isMan.value
|
|
|
+ request.born_year = curYear.value
|
|
|
+ request.born_month = curMonth.value
|
|
|
+ request.born_day = curDay.value
|
|
|
+ request.know_time = knowTimeValue.value
|
|
|
+ request.born_hour = curHour.value
|
|
|
+ request.born_minute = curMin.value
|
|
|
+ request.born_sheng = shengfen.value
|
|
|
+ request.born_shi = chengshi.value
|
|
|
+ request.born_qu = diqu.value
|
|
|
+ Network.applyUserInfo(request, function () {
|
|
|
+ console.log("over")
|
|
|
+ })
|
|
|
+ //todo
|
|
|
}
|
|
|
|
|
|
+function checkWxOpenId() {
|
|
|
+ if (DataCenter.wxOpenId == null) {
|
|
|
+ let url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf01ec97b45a4bc49&redirect_uri=https://yixuefrp.cxhy.cn/test&response_type=code&scope=snsapi_base&state=999#wechat_redirect"
|
|
|
+ window.location.href = url
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(function () {
|
|
|
+ checkWxOpenId()
|
|
|
+})
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
+ <!--姓名、性别-->
|
|
|
+ <el-row style="width: 100%">
|
|
|
+ <el-row align="middle" style="margin-top: 10px;">
|
|
|
+ <el-col :span="4">姓名</el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-input ref="userNameCompt" v-model="userName"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row align="middle" style="margin-top: 10px;">
|
|
|
+ <el-col :span="4"></el-col>
|
|
|
+ <el-col :span="18" align="left">
|
|
|
+ <el-switch
|
|
|
+ v-model="isMan"
|
|
|
+ class="ml-2"
|
|
|
+ inline-prompt
|
|
|
+ size="large"
|
|
|
+ style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949; margin-right: 20px"
|
|
|
+ active-text="男"
|
|
|
+ inactive-text="女"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
<el-row align="middle" style="margin-top: 10px">
|
|
|
<el-col :span="4"></el-col>
|
|
|
<el-col :span="18">
|