1 line
20 KiB
Plaintext
1 line
20 KiB
Plaintext
{"version":3,"sources":["uni-app:///main.js","webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/pages/my/index.vue?d8c0","webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/pages/my/index.vue?bcd6","webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/pages/my/index.vue?8cd1","webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/pages/my/index.vue?2471","uni-app:///pages/my/index.vue","webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/components/uni-footer/index.vue?2092","webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/components/uni-footer/index.vue?0312","webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/components/uni-footer/index.vue?b5df","webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/components/uni-footer/index.vue?55a3","uni-app:///components/uni-footer/index.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page"],"mappings":"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","file":"pages/my/index.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pages/my/index.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./index.vue?vue&type=template&id=4dcceeb0&scoped=true&\"\nvar renderjs\nimport script from \"./index.vue?vue&type=script&setup=true&lang=js&\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=js&\"\nimport style0 from \"./index.scss?vue&type=style&index=0&id=4dcceeb0&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\runtime\\\\componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"4dcceeb0\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pages/my/index.vue\"\nexport default component.exports","export * from \"-!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--16-0!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-uni-app-loader\\\\page-meta.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./index.vue?vue&type=template&id=4dcceeb0&scoped=true&\"","var render = function () {}\nvar staticRenderFns = []\nvar recyclableRender\nvar components\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./index.vue?vue&type=script&setup=true&lang=js&\"; export default mod; export * from \"-!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./index.vue?vue&type=script&setup=true&lang=js&\"","<!-- 我的页面 -->\r\n<template>\r\n\t<view class=\"my\">\r\n\t\t<!-- banner图 -->\r\n\t\t<view class=\"banner\">\r\n\t\t\t<!-- 头像用户名 -->\r\n\t\t\t<view class=\"headBox\" @click=\"toLogin\">\r\n\t\t\t\t<image :src=\"avatarUrl\" />\r\n\t\t\t\t<view class=\"userName\">{{nickName}}</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 地址簿,实名认证,专属快递员 -->\r\n\t\t<view class=\"list-top\">\r\n\t\t\t<view class=\"list-item\" @click=\"handleToAddress\">\r\n\t\t\t\t<view class=\"left\">\r\n\t\t\t\t\t<image class=\"icon\" src='../../static/my-address.png' />\r\n\t\t\t\t\t<view class=\"label\">地址簿</view>\r\n\t\t\t\t</view>\r\n\r\n\t\t\t\t<image class=\"arrow\" src='../../static/icon15.png' />\r\n\t\t\t</view>\r\n\t\t\t<view class=\"list-item\" @click=\"handleTorealName\">\r\n\t\t\t\t<view class=\"left\">\r\n\t\t\t\t\t<image class=\"icon\" src='../../static/my-name.png' />\r\n\t\t\t\t\t<view class=\"label\">实名认证</view>\r\n\t\t\t\t</view>\r\n\r\n\t\t\t\t<image class=\"arrow\" src='../../static/icon15.png' />\r\n\t\t\t</view>\r\n\t\t\t<view class=\"list-item\" @click=\"handleSecondQi\">\r\n\t\t\t\t<view class=\"left\">\r\n\t\t\t\t\t<image class=\"icon\" src='../../static/my-send.png' />\r\n\t\t\t\t\t<view class=\"label\">专属快递员</view>\r\n\t\t\t\t</view>\r\n\r\n\t\t\t\t<image class=\"arrow\" src='../../static/icon15.png' />\r\n\t\t\t</view>\r\n\t\t</view>\r\n\r\n\t\t<view class=\"list-bottom\" v-if=\"token\">\r\n\t\t\t<picker mode=\"selector\" @change=\"changeSex\" :value=\"sex\" :range=\"sexList\">\r\n\t\t\t\t<view class=\"list-item\">\r\n\t\t\t\t\t<view class=\"label\">性别</view>\r\n\t\t\t\t\t<image class=\"arrow\" src='../../static/icon15.png' />\r\n\t\t\t\t</view>\r\n\t\t\t</picker>\r\n\t\t\t<picker mode=\"date\" :value=\"birthday\" :start=\"startDate\" :end=\"endDate\" @change=\"getDateChange\">\r\n\t\t\t\t<view class=\"list-item\">\r\n\t\t\t\t\t<view class=\"label\">生日</view>\r\n\t\t\t\t\t<image class=\"arrow\" src='../../static/icon15.png' />\r\n\t\t\t\t</view>\r\n\t\t\t</picker>\r\n\t\t</view>\r\n\t</view>\r\n\t<!-- footer -->\r\n\t<UniFooter :pagePath=\"'pages/my/index'\"></UniFooter>\r\n\t<!-- end -->\r\n</template>\r\n\r\n<script setup>\r\n\timport {\r\n\t\tref,\r\n\t\treactive,\r\n\t\tonMounted\r\n\t} from 'vue';\r\n\timport {\r\n\t\tgetUserInfo,\r\n\t\tgetRealNameStatusApi,\r\n\t\tupdateUserInfo\r\n\t} from '@/pages/api/my.js';\r\n\timport {\r\n\t\thandleSecondQi\r\n\t} from '@/utils/index.js'\r\n\t// import { useStore } from 'vuex';\r\n\tconst token = ref()\r\n\tconst sexList = reactive(['女', '男'])\r\n\tlet nickName = ref('')\r\n\tlet avatarUrl = ref('')\r\n\tlet startDate = ref()\r\n\tlet endDate = ref()\r\n\tlet idCard = ref('')\r\n\tlet name = ref('')\r\n\tlet sex = ref(1)\r\n\tlet birthday = ref('1995-09-01')\r\n\tconst alertDialog = ref()\r\n\tconst isRealNameAuth = ref(false)\r\n\t// 底部导航\r\n\timport UniFooter from '@/components/uni-footer/index.vue';\r\n\tonMounted(() => {\r\n\t\tstartDate.value = getDate('start')\r\n\t\tendDate.value = getDate('end')\r\n\t\tbaseUserInfo()\r\n\t\ttoken.value = uni.getStorageSync('token')\r\n\t\tnickName.value = uni.getStorageSync('nickName') || '神领用户'\r\n\t\tavatarUrl.value = uni.getStorageSync('avatarUrl') || '../../static/defaultHeadImg.png'\r\n\t\t// test()\r\n\t})\r\n\r\n\tconst baseUserInfo = () => {\r\n\t\tgetUserInfo().then((res) => {\r\n\t\t\tconsole.log(res, 'res')\r\n\t\t\tisRealNameAuth.value = Boolean(res.data.idCardNoVerify)\r\n\t\t\tidCard.value = res.data.idCard || ''\r\n\t\t\tname.value = res.data.name\r\n\t\t\tsex.value = res.data.sex \r\n\t\t\tbirthday.value = res.data.birthday \r\n\t\t})\r\n\t}\r\n\tconst getUserInfoFunc = () => {\r\n\t\tuni.getUserProfile({\r\n\t\t\tdesc: 'Wexin',\r\n\t\t\tsuccess: (res) => {\r\n\t\t\t\tnickName.value = res.userInfo.nickName\r\n\t\t\t\tavatarUrl.value = res.userInfo.avatarUrl\r\n\t\t\t\tuni.setStorageSync('nickName', res.userInfo.nickName);\r\n\t\t\t\tuni.setStorageSync('avatarUrl', res.userInfo.avatarUrl);\r\n\t\t\t\tconsole.log(res, '个人信息')\r\n\t\t\t},\r\n\t\t\tfail: () => {\r\n\t\t\t\tuni.showToast({\r\n\t\t\t\t\ttitle: \"个人信息获取失败\",\r\n\t\t\t\t\ticon: 'none',\r\n\t\t\t\t\tduration: 1000\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\tconst getDate = (type) => {\r\n\t\tconst date = new Date()\r\n\t\tlet year = date.getFullYear()\r\n\t\tlet month = date.getMonth() + 1\r\n\t\tlet day = date.getDate()\r\n\t\tif (type === \"start\") {\r\n\t\t\tyear = year - 60\r\n\t\t} else {\r\n\t\t\tyear = year + 2\r\n\t\t}\r\n\t\tmonth = month > 9 ? month : \"0\" + month\r\n\t\tday = day > 9 ? day : '0' + day\r\n\t\treturn `${year}-${month}-${day}`\r\n\r\n\t}\r\n\tconst toLogin = () => {\r\n\t\tif (uni.getStorageSync('token')) {\r\n\t\t\tgetUserInfoFunc()\r\n\t\t} else {\r\n\t\t\tuni.navigateTo({\r\n\t\t\t\turl: '/pages/login/index'\r\n\t\t\t});\r\n\t\t}\r\n\r\n\r\n\t}\r\n\t//跳转到地址簿\r\n\tconst handleToAddress = () => {\r\n\t\tuni.navigateTo({\r\n\t\t\turl: '/pages/address/index?type=address'\r\n\t\t});\r\n\t}\r\n\t//跳转到实名认证页面\r\n\tconst handleTorealName = () => {\r\n\t\tif (isRealNameAuth.value) {\r\n\t\t\tuni.navigateTo({\r\n\t\t\t\turl: '/subPages/authentication-success/index?name=' + name.value + '&idCard=' + idCard.value\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tuni.navigateTo({\r\n\t\t\t\turl: '/subPages/realName-authentication/index'\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tconst getDateChange = (e) => {\r\n\t\tconsole.log(e, 'getDateChange')\r\n\t\tupdateUserInfo({\r\n\t\t\tbirthday: e.detail.value\r\n\t\t}).then((res) => {\r\n\t\t\tbaseUserInfo()\r\n\t\t\tconsole.log(res, 'res')\r\n\t\t})\r\n\t}\r\n\r\n\tconst changeSex = (e) => {\r\n\t\tconsole.log(e, 'changeSex')\r\n\t\tupdateUserInfo({\r\n\t\t\tsex: Number(e.detail.value)\r\n\t\t}).then((res) => {\r\n\t\t\tbaseUserInfo()\r\n\t\t\tconsole.log(res, 'res')\r\n\t\t})\r\n\t}\r\n</script>\r\n<style src=\"./index.scss\" lang=\"scss\" scoped></style>\r\n\r\n","import { render, staticRenderFns, recyclableRender, components } from \"./index.vue?vue&type=template&id=08c444d6&scoped=true&\"\nvar renderjs\nimport script from \"./index.vue?vue&type=script&setup=true&lang=js&\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\runtime\\\\componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"08c444d6\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"components/uni-footer/index.vue\"\nexport default component.exports","export * from \"-!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--16-0!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-uni-app-loader\\\\page-meta.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./index.vue?vue&type=template&id=08c444d6&scoped=true&\"","var components\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./index.vue?vue&type=script&setup=true&lang=js&\"; export default mod; export * from \"-!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./index.vue?vue&type=script&setup=true&lang=js&\"","<template>\r\n\t<!-- 公用底部 -->\r\n\t<view class=\"footBox\">\r\n\t\t<view class=\"uni-tabbar\">\r\n\t\t\t<view class=\"tabbar-item\" :class=\"currentPage === index ? 'active' : ''\" v-for=\"(item, index) in tabbar\" :key=\"index\" @tap=\"changeTab(item, index)\">\r\n\t\t\t\t<view v-if=\"true\" class=\"uni-tabbar__bd\">\r\n\t\t\t\t\t<view class=\"uni-tabbar__icon\" v-if=\"item.pagePath !== ''\">\r\n\t\t\t\t\t\t<image v-if=\"currentPage === index\" class=\"item-img\" :src=\"item.selectedIconPath\" />\r\n\t\t\t\t\t\t<image v-else class=\"item-img\" :src=\"item.iconPath\" />\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view v-else class=\"qrCode\"><image :src=\"item.iconPath\" /></view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"uni-tabbar__label\" v-if=\"item.text !== ''\">{{ item.text }}</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t</view>\r\n\t<!-- end -->\r\n</template>\r\n\r\n<script setup>\r\nimport { ref, reactive, onMounted, nextTick, watch } from 'vue';\r\nimport { useStore } from 'vuex';\r\n// 获取父组件值、方法\r\nconst props = defineProps({\r\n\tpagePath: {\r\n\t\ttype: String,\r\n\t\tdefault: ''\r\n\t}\r\n});\r\n// ------定义变量------\r\nconst store = useStore();//vuex获取储存数据\r\nconst currentPage = ref(store.state.footStatus); //获取储存的当前tab状态\r\nlet tabbar = ref([\r\n\t{\r\n\t\tpagePath: '/pages/index/index',\r\n\t\ticonPath: '../../static/jikuaidi.png',\r\n\t\tselectedIconPath: '../../static/jikuaidiActive.png',\r\n\t\ttext: '寄快递'\r\n\t},\r\n\t{\r\n\t\tpagePath: '/pages/pickup/index',\r\n\t\ticonPath: '../../static/chakuaidi.png',\r\n\t\tselectedIconPath: '../../static/chakuaidiActive.png',\r\n\t\ttext: '查快递'\r\n\t},\r\n\t// {\r\n\t// \tpagePath: '',\r\n\t// \ticonPath: 'static/qrcode.png',\r\n\t// \tselectedIconPath: 'static/qrcode.png',\r\n\t// \ttext: ''\r\n\t// },\r\n\t{\r\n\t\tpagePath: '/pages/my/index',\r\n\t\ticonPath: '../../static/wode.png',\r\n\t\tselectedIconPath: '../../static/wodeActive.png',\r\n\t\ttext: '我的'\r\n\t},\r\n\t// {\r\n\t// \tpagePath: '/pages/my/index',\r\n\t// \ticonPath: 'static/user.png',\r\n\t// \tselectedIconPath: 'static/userActive.png',\r\n\t// \ttext: '我的'\r\n\t// }\r\n]);\r\nonMounted(()=>{\r\n\tconsole.log(store.state,'store.state')\r\n})\r\n// ------方法------\r\n// 触发tab事件\r\nconst changeTab = (item, index) => {\r\n\tconsole.log(item, index,'底部')\r\n\tstore.commit('setFootStatus',index)\r\n\tif (item.text !== '') {\r\n\t\tcurrentPage.value = index;\r\n\t\t// 页面跳转\r\n\t\tuni.redirectTo({\r\n\t\t\turl: item.pagePath,\r\n\t\t\tsuccess: e => {},\r\n\t\t\tfail: () => {}\r\n\t\t});\r\n\t}\r\n};\r\n</script>\r\n<style lang=\"scss\" scoped></style>\r\n"],"sourceRoot":""} |