|
|
@@ -52,15 +52,23 @@
|
|
|
import { ref } from 'vue';
|
|
|
import headImg from "@/static/images/mine/headImg.jpg";
|
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
|
+ import { getUserInfo } from '@/api/mine.js'
|
|
|
import { useUserStore } from '@/store/user.js'
|
|
|
const userStore = useUserStore()
|
|
|
- const userInfo = userStore.user
|
|
|
+ const userInfo = ref({})
|
|
|
// 监听页面加载
|
|
|
onLoad((options) => {
|
|
|
- // 获取传入的标题参数
|
|
|
- const name = userInfo.name;
|
|
|
- const useId = userInfo.useId;
|
|
|
- console.log('useId', useId);
|
|
|
+ console.log('options.useId', options.useId);
|
|
|
+ console.log('options', !options.useId);
|
|
|
+ if (!options.useId) {
|
|
|
+ // 获取传入的标题参数
|
|
|
+ userInfo.value = userStore.user
|
|
|
+ } else {
|
|
|
+ getUserInfo(options.useId).then((res) => {
|
|
|
+ userInfo.value = res.returnParams[0]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ const name = userInfo.value.name;
|
|
|
if (name) {
|
|
|
// 设置导航栏标题
|
|
|
uni.setNavigationBarTitle({
|
|
|
@@ -68,23 +76,6 @@
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
- // 定义个人信息数据
|
|
|
- // const userInfo = ref({
|
|
|
- // name: "张三",
|
|
|
- // department: [{
|
|
|
- // departmentName: "研发部",
|
|
|
- // position: '软件开发工程师'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // departmentName: "业务部",
|
|
|
- // position: '销售经理'
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // phone: "13579543684",
|
|
|
- // email: "",
|
|
|
- // gender: "男",
|
|
|
- // birthday: "2000-01-10"
|
|
|
- // });
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|