|
@@ -11,7 +11,8 @@
|
|
|
<view class="value icon">
|
|
|
<view class="title">头像</view>
|
|
|
<view class="label">
|
|
|
- <u-avatar :text="form.name" shape="square" fontSize="40" randomBgColor></u-avatar>
|
|
|
+ <u-avatar :text="formatName(form.nickname||'证')" shape="square" fontSize="20"
|
|
|
+ randomBgColor></u-avatar>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="remark">
|
|
@@ -30,11 +31,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="value other">
|
|
|
- <view class="title">性别</view>
|
|
|
+ <view class="title">身份证号码</view>
|
|
|
<view class="label">
|
|
|
- <picker name="sex" @change="sexChange" :value="index" :range="sexList" range-key="dictLabel">
|
|
|
- <view class="picker">{{form.sex||'请选择性别'}}</view>
|
|
|
- </picker>
|
|
|
+ <input name="card" class="input" :value="form.card" placeholder="请输入身份证号码" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="value other">
|
|
@@ -57,51 +56,32 @@
|
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
|
// 请求接口
|
|
|
const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
|
|
|
- const $config = getCurrentInstance()?.appContext.config.globalProperties.$config;
|
|
|
- const $apifile = getCurrentInstance()?.appContext.config.globalProperties.$apifile;
|
|
|
// openid
|
|
|
const openid = computed(() => {
|
|
|
return uni.getStorageSync('openid');
|
|
|
})
|
|
|
// 基本信息
|
|
|
- const config = ref({ logoUrl: '' });
|
|
|
+ const config = ref({ logo: '' });
|
|
|
// 用户信息
|
|
|
- const form = ref({ icon: '', city: '', sex: '', nickname: '', phone: '' });
|
|
|
+ const form = ref({});
|
|
|
// 字典表
|
|
|
const sexList = ref([]);
|
|
|
onLoad(async () => {
|
|
|
- await searchOther();
|
|
|
await searchConfig();
|
|
|
await search();
|
|
|
- uni.$on('setCity', function (city) {
|
|
|
- form.value.city = city
|
|
|
- })
|
|
|
})
|
|
|
- // 查询其他信息
|
|
|
- const searchOther = async () => {
|
|
|
- let res;
|
|
|
- };
|
|
|
// config信息
|
|
|
const searchConfig = async () => {
|
|
|
config.value = uni.getStorageSync('config');
|
|
|
};
|
|
|
// 查询
|
|
|
const search = async () => {
|
|
|
-
|
|
|
- };
|
|
|
- // 处理字典表数据
|
|
|
- const toData = (value, list) => {
|
|
|
- if (value) return value = list[value].dictLabel
|
|
|
- };
|
|
|
- // 性别选择
|
|
|
- const sexChange = (e) => {
|
|
|
- const data = sexList.value[e.detail.value]
|
|
|
- if (data) form.value.sex = data.dictLabel
|
|
|
+ const res = await $api(`login/wxapp/${openid.value}`, 'POST', {});
|
|
|
+ if (res.errcode == '0') form.value = res.data
|
|
|
};
|
|
|
// 保存
|
|
|
const formSubmit = async (e) => {
|
|
|
let data = e.detail.value;
|
|
|
- data.icon = form.value.icon;
|
|
|
data = delEmptyQueryNodes(data);
|
|
|
console.log(data);
|
|
|
};
|
|
@@ -114,6 +94,9 @@
|
|
|
});
|
|
|
return obj;
|
|
|
};
|
|
|
+ const formatName = (str) => {
|
|
|
+ if (str) return str.substr(0, 1) + new Array(str.length).join('');
|
|
|
+ };
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.content {
|