safe.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="body">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <block v-for="(item,index) in list" :key="index">
  6. <my-list-item :item="item" :index="index" @weixinMsg="weixinMsg" :someData="status"></my-list-item>
  7. </block>
  8. </view>
  9. </template>
  10. <script>
  11. import {
  12. mapState
  13. } from "vuex"
  14. import myListItem from "@/components/modules/my/my-list-item.vue";
  15. export default {
  16. components: {
  17. myListItem
  18. },
  19. data() {
  20. return {
  21. list: [{
  22. icon: "",
  23. name: "修改密码",
  24. clicktype: "navigateTo",
  25. url: "/pages/set/password",
  26. text: "去设置",
  27. auth: true
  28. },
  29. {
  30. icon: "",
  31. name: "修改手机号",
  32. clicktype: "navigateTo",
  33. url: "/pages/set/mobile",
  34. text: '',
  35. auth: true
  36. },
  37. {
  38. icon: "",
  39. name: "微信",
  40. clicktype: "weixin",
  41. url: "",
  42. text: '未绑定',
  43. },
  44. ],
  45. status: false,
  46. }
  47. },
  48. async onLoad() {
  49. this.list[1].text = this.userInfo.sysUser.mobile;
  50. let res = await this.$http.get("/user/isBindWechat")
  51. if (res.code == '200') {
  52. this.list[2].text = "已绑定"
  53. this.status = true;
  54. this.list[2].text
  55. } else {
  56. this.status = false;
  57. }
  58. },
  59. computed: {
  60. ...mapState(["userInfo"])
  61. },
  62. methods: {
  63. weixinMsg(mag) {
  64. uni.showToast({
  65. title: mag.msg,
  66. icon: "none"
  67. });
  68. },
  69. }
  70. }
  71. </script>
  72. <style>
  73. </style>