1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <template>
- <view class="body">
- <!-- 公共组件-每个页面必须引入 -->
- <public-module></public-module>
- <block v-for="(item,index) in list" :key="index">
- <my-list-item :item="item" :index="index" @weixinMsg="weixinMsg" :someData="status"></my-list-item>
- </block>
- </view>
- </template>
- <script>
- import {
- mapState
- } from "vuex"
- import myListItem from "@/components/modules/my/my-list-item.vue";
- export default {
- components: {
- myListItem
- },
- data() {
- return {
- list: [{
- icon: "",
- name: "修改密码",
- clicktype: "navigateTo",
- url: "/pages/set/password",
- text: "去设置",
- auth: true
- },
- {
- icon: "",
- name: "修改手机号",
- clicktype: "navigateTo",
- url: "/pages/set/mobile",
- text: '',
- auth: true
- },
- {
- icon: "",
- name: "微信",
- clicktype: "weixin",
- url: "",
- text: '未绑定',
- },
- ],
- status: false,
- }
- },
- async onLoad() {
- this.list[1].text = this.userInfo.sysUser.mobile;
- this.bindingStatus();
- },
- computed: {
- ...mapState(["userInfo"])
- },
- methods: {
- async bindingStatus() {
- let res = await this.$http.get("/user/isBindWechat")
- if (res.code == '200') {
- this.list[2].text = "已绑定"
- this.status = true;
- } else {
- this.status = false;
- }
- },
- weixinMsg(res) {
- if (res.code == '200') {
- uni.showToast({
- title: res.msg,
- icon: "success"
- });
- this.bindingStatus();
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- });
- }
- },
- }
- }
- </script>
- <style>
- </style>
|