1 |
- {"version":3,"sources":["webpack:///./src/assets/images/alter.png","webpack:///./src/views/user/PersonalData.vue?b8c3","webpack:///src/views/user/PersonalData.vue","webpack:///./src/views/user/PersonalData.vue?299a","webpack:///./src/views/user/PersonalData.vue"],"names":["module","exports","render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","_l","item","index","key","class","uid","userInfo","ref","refInFor","attrs","headers","url","on","imageuploaded","avatar","_e","_s","nickname","phone","$event","switchAccounts","directives","name","rawName","value","expression","domProps","target","composing","$set","user_type","submit","isWeixin","logout","staticRenderFns","components","VueCoreImageUpload","data","$store","state","app","token","currentAccounts","switchUserInfo","userIndex","watch","$route","n","dispatch","computed","mounted","getUserInfo","methods","length","undefined","cookie","$dialog","loading","close","commit","$emit","location","reload","i","that","res","status","confirm","mes","opts","component"],"mappings":"iGAAAA,EAAOC,QAAU,8hF,yCCAjB,IAAIC,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,MAAM,CAACE,YAAY,WAAW,CAACF,EAAG,MAAM,CAACE,YAAY,SAAS,CAACN,EAAIO,GAAG,YAAYH,EAAG,MAAM,CAACE,YAAY,YAAYN,EAAIQ,GAAIR,EAAkB,gBAAE,SAASS,EAAKC,GAAO,OAAON,EAAG,MAAM,CAACO,IAAID,EAAMJ,YAAY,oCAAoCM,MAAMH,EAAKI,MAAQb,EAAIc,SAASD,IAAM,KAAO,IAAI,CAACT,EAAG,MAAM,CAACE,YAAY,uCAAuC,CAACF,EAAG,MAAM,CAACE,YAAY,WAAW,CAAEG,EAAKI,MAAQb,EAAIc,SAASD,IAAKT,EAAG,qBAAqB,CAACW,IAAI,QAAQC,UAAS,EAAKV,YAAY,kBAAkBW,MAAM,CAAC,MAAO,EAAM,SAAW,KAAK,QAAUjB,EAAIkB,QAAQ,gBAAgB,QAAQ,aAAc,EAAM,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gAAAABJRU5ErkJggg==\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"personal-data\"},[_c('div',{staticClass:\"wrapper\"},[_c('div',{staticClass:\"title\"},[_vm._v(\"管理我的账号\")]),_c('div',{staticClass:\"wrapList\"},_vm._l((_vm.switchUserInfo),function(item,index){return _c('div',{key:index,staticClass:\"item acea-row row-between-wrapper\",class:item.uid === _vm.userInfo.uid ? 'on' : ''},[_c('div',{staticClass:\"picTxt acea-row row-between-wrapper\"},[_c('div',{staticClass:\"pictrue\"},[(item.uid === _vm.userInfo.uid)?_c('VueCoreImageUpload',{ref:\"upImg\",refInFor:true,staticClass:\"btn btn-primary\",attrs:{\"crop\":false,\"compress\":\"80\",\"headers\":_vm.headers,\"max-file-size\":5242880,\"credentials\":false,\"inputAccept\":\"image/*\",\"inputOfFile\":\"file\",\"url\":_vm.url},on:{\"imageuploaded\":_vm.imageuploaded}},[_c('div',{staticClass:\"pictrue\"},[_c('img',{attrs:{\"src\":item.avatar}})])]):_c('div',{staticClass:\"pictrue\"},[_c('img',{attrs:{\"src\":item.avatar}})]),(item.uid === _vm.userInfo.uid)?_c('img',{staticClass:\"alter\",attrs:{\"src\":require(\"@assets/images/alter.png\")}}):_vm._e()],1),_c('div',{staticClass:\"text\"},[_c('div',{staticClass:\"name line1\"},[_vm._v(_vm._s(item.nickname))]),_c('div',{staticClass:\"phone\"},[_vm._v(\"绑定手机号:\"+_vm._s(item.phone))])])]),(item.uid === _vm.userInfo.uid)?_c('div',{staticClass:\"currentBnt acea-row row-center-wrapper font-color-red\"},[_vm._v(\"\\n 当前账号\\n \")]):_c('div',{staticClass:\"bnt font-color-red acea-row row-center-wrapper\",on:{\"click\":function($event){return _vm.switchAccounts(index)}}},[_vm._v(\"\\n 使用账号\\n \")])])}),0)]),_c('div',{staticClass:\"list\"},[_c('div',{staticClass:\"item acea-row row-between-wrapper\"},[_c('div',[_vm._v(\"昵称\")]),_c('div',{staticClass:\"input\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.userInfo.nickname),expression:\"userInfo.nickname\"}],attrs:{\"type\":\"text\"},domProps:{\"value\":(_vm.userInfo.nickname)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.userInfo, \"nickname\", $event.target.value)}}})])]),_c('div',{staticClass:\"item acea-row row-between-wrapper\"},[_c('div',[_vm._v(\"ID号\")]),_c('div',{staticClass:\"input acea-row row-between-wrapper\"},[_c('input',{staticClass:\"id\",attrs:{\"type\":\"text\",\"disabled\":\"\"},domProps:{\"value\":_vm.userInfo.uid}}),_c('span',{staticClass:\"iconfont icon-suozi\"})])]),(!_vm.userInfo.phone)?_c('div',[_c('router-link',{staticClass:\"item acea-row row-between-wrapper\",attrs:{\"to\":'/user/binding'}},[_c('div',[_vm._v(\"绑定手机号\")]),_c('div',{staticClass:\"input\"},[_vm._v(\"\\n 点击绑定手机号\"),_c('span',{staticClass:\"iconfont icon-xiangyou\"})])])],1):(_vm.userInfo.phone)?_c('div',{staticClass:\"item acea-row row-between-wrapper\"},[_c('div',[_vm._v(\"手机号码\")]),_c('div',{staticClass:\"input acea-row row-between-wrapper\"},[_c('div',{staticClass:\"input acea-row row-between-wrapper\"},[_c('input',{staticClass:\"id\",attrs:{\"type\":\"text\",\"disabled\":\"\"},domProps:{\"value\":_vm.userInfo.phone}}),_c('span',{staticClass:\"iconfont icon-suozi\"})])])]):_vm._e(),(_vm.userInfo.phone && _vm.userInfo.user_type === 'h5')?_c('div',[_c('router-link',{staticClass:\"item acea-row row-between-wrapper\",attrs:{\"to\":'/change_password'}},[_c('div',[_vm._v(\"密码\")]),_c('div',{staticClass:\"input\"},[_vm._v(\"\\n 点击修改密码\"),_c('span',{staticClass:\"iconfont icon-xiangyou\"})])])],1):_vm._e()]),_c('div',{staticClass:\"modifyBnt bg-color-red\",on:{\"click\":_vm.submit}},[_vm._v(\"保存修改\")]),(!_vm.isWeixin)?_c('div',{staticClass:\"logOut cart-color acea-row row-center-wrapper\",on:{\"click\":_vm.logout}},[_vm._v(\"\\n 退出登录\\n \")]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <div class=\"personal-data\">\r\n <div class=\"wrapper\">\r\n <div class=\"title\">管理我的账号</div>\r\n <div class=\"wrapList\">\r\n <div\r\n class=\"item acea-row row-between-wrapper\"\r\n :class=\"item.uid === userInfo.uid ? 'on' : ''\"\r\n v-for=\"(item, index) in switchUserInfo\"\r\n :key=\"index\"\r\n >\r\n <div class=\"picTxt acea-row row-between-wrapper\">\r\n <div class=\"pictrue\">\r\n <VueCoreImageUpload\r\n class=\"btn btn-primary\"\r\n :crop=\"false\"\r\n compress=\"80\"\r\n @imageuploaded=\"imageuploaded\"\r\n :headers=\"headers\"\r\n :max-file-size=\"5242880\"\r\n :credentials=\"false\"\r\n inputAccept=\"image/*\"\r\n inputOfFile=\"file\"\r\n :url=\"url\"\r\n ref=\"upImg\"\r\n v-if=\"item.uid === userInfo.uid\"\r\n >\r\n <div class=\"pictrue\">\r\n <img :src=\"item.avatar\" />\r\n </div>\r\n </VueCoreImageUpload>\r\n <div class=\"pictrue\" v-else>\r\n <img :src=\"item.avatar\" />\r\n </div>\r\n <img\r\n src=\"@assets/images/alter.png\"\r\n class=\"alter\"\r\n v-if=\"item.uid === userInfo.uid\"\r\n />\r\n </div>\r\n <div class=\"text\">\r\n <div class=\"name line1\">{{ item.nickname }}</div>\r\n <div class=\"phone\">绑定手机号:{{ item.phone }}</div>\r\n </div>\r\n </div>\r\n <div\r\n class=\"currentBnt acea-row row-center-wrapper font-color-red\"\r\n v-if=\"item.uid === userInfo.uid\"\r\n >\r\n 当前账号\r\n </div>\r\n <div\r\n class=\"bnt font-color-red acea-row row-center-wrapper\"\r\n v-else\r\n @click=\"switchAccounts(index)\"\r\n >\r\n 使用账号\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"list\">\r\n <div class=\"item acea-row row-between-wrapper\">\r\n <div>昵称</div>\r\n <div class=\"input\">\r\n <input type=\"text\" v-model=\"userInfo.nickname\" />\r\n </div>\r\n </div>\r\n <div class=\"item acea-row row-between-wrapper\">\r\n <div>ID号</div>\r\n <div class=\"input acea-row row-between-wrapper\">\r\n <input type=\"text\" :value=\"userInfo.uid\" disabled class=\"id\" /><span\r\n class=\"iconfont icon-suozi\"\r\n ></span>\r\n </div>\r\n </div>\r\n <div v-if=\"!userInfo.phone\">\r\n <router-link\r\n :to=\"'/user/binding'\"\r\n class=\"item acea-row row-between-wrapper\"\r\n >\r\n <div>绑定手机号</div>\r\n <div class=\"input\">\r\n 点击绑定手机号<span class=\"iconfont icon-xiangyou\"></span>\r\n </div>\r\n </router-link>\r\n </div>\r\n <div class=\"item acea-row row-between-wrapper\" v-else-if=\"userInfo.phone\">\r\n <div>手机号码</div>\r\n <div class=\"input acea-row row-between-wrapper\">\r\n <div class=\"input acea-row row-between-wrapper\">\r\n <input\r\n type=\"text\"\r\n :value=\"userInfo.phone\"\r\n disabled\r\n class=\"id\"\r\n /><span class=\"iconfont icon-suozi\"></span>\r\n </div>\r\n </div>\r\n </div>\r\n <div v-if=\"userInfo.phone && userInfo.user_type === 'h5'\">\r\n <router-link\r\n :to=\"'/change_password'\"\r\n class=\"item acea-row row-between-wrapper\"\r\n >\r\n <div>密码</div>\r\n <div class=\"input\">\r\n 点击修改密码<span class=\"iconfont icon-xiangyou\"></span>\r\n </div>\r\n </router-link>\r\n </div>\r\n </div>\r\n <div class=\"modifyBnt bg-color-red\" @click=\"submit\">保存修改</div>\r\n <div\r\n class=\"logOut cart-color acea-row row-center-wrapper\"\r\n @click=\"logout\"\r\n v-if=\"!isWeixin\"\r\n >\r\n 退出登录\r\n </div>\r\n </div>\r\n</template>\r\n<script>\r\nimport { mapGetters } from \"vuex\";\r\nimport { trim, VUE_APP_API_URL, isWeixin } from \"@utils\";\r\nimport VueCoreImageUpload from \"vue-core-image-upload\";\r\nimport { postUserEdit, getLogout, switchH5Login, getUser } from \"@api/user\";\r\nimport { clearAuthStatus } from \"@libs/wechat\";\r\nimport cookie from \"@utils/store/cookie\";\r\nimport store from \"@/store\";\r\nimport dayjs from \"dayjs\";\r\n\r\nexport default {\r\n name: \"PersonalData\",\r\n components: {\r\n VueCoreImageUpload\r\n },\r\n data: function() {\r\n return {\r\n url: `${VUE_APP_API_URL}/upload/image`,\r\n headers: {\r\n \"Authori-zation\": \"Bearer \" + this.$store.state.app.token\r\n },\r\n avatar: \"\",\r\n isWeixin: false,\r\n currentAccounts: 0,\r\n switchUserInfo: [],\r\n userIndex: 0\r\n };\r\n },\r\n watch: {\r\n $route(n) {\r\n if (n.name === \"PersonalData\") this.$store.dispatch(\"USERINFO\", true);\r\n }\r\n },\r\n computed: mapGetters([\"userInfo\"]),\r\n mounted: function() {\r\n this.avatar = this.userInfo.avatar;\r\n this.isWeixin = isWeixin();\r\n this.getUserInfo();\r\n },\r\n methods: {\r\n switchAccounts: function(index) {\r\n let that = this;\r\n this.userIndex = index;\r\n let userInfo = this.switchUserInfo[this.userIndex];\r\n if (this.switchUserInfo.length <= 1) return true;\r\n if (userInfo === undefined)\r\n return this.$dialog.toast({ mes: \"切换的账号不存在\" });\r\n if (userInfo.user_type === \"h5\") {\r\n switchH5Login()\r\n .then(({ data }) => {\r\n that.$dialog.loading.close();\r\n const expires_time = dayjs(data.expires_time);\r\n store.commit(\"LOGIN\", data.token, expires_time);\r\n that.$emit(\"changeswitch\", false);\r\n location.reload();\r\n })\r\n .catch(err => {\r\n that.$dialog.loading.close();\r\n return that.$dialog.toast({ mes: err });\r\n });\r\n } else {\r\n cookie.set(\"loginType\", \"wechat\", 60);\r\n this.$dialog.loading.close();\r\n this.$store.commit(\"LOGOUT\");\r\n clearAuthStatus();\r\n this.$emit(\"changeswitch\", false);\r\n location.reload();\r\n }\r\n },\r\n getUserInfo: function() {\r\n let that = this;\r\n getUser().then(res => {\r\n let switchUserInfo = res.data.switchUserInfo;\r\n for (let i = 0; i < switchUserInfo.length; i++) {\r\n if (switchUserInfo[i].uid == that.userInfo.uid) that.userIndex = i;\r\n if (\r\n !that.isWeixin &&\r\n switchUserInfo[i].user_type != \"h5\" &&\r\n switchUserInfo[i].phone === \"\"\r\n )\r\n switchUserInfo.splice(i, 1);\r\n }\r\n that.$set(this, \"switchUserInfo\", switchUserInfo);\r\n });\r\n },\r\n imageuploaded(res) {\r\n if (res.status !== 200)\r\n return this.$dialog.error(res.msg || \"上传图片失败\");\r\n if (this.switchUserInfo[this.userIndex] === undefined) return;\r\n this.$set(this.switchUserInfo[this.userIndex], \"avatar\", res.data.url);\r\n },\r\n\r\n submit: function() {\r\n let userInfo = this.switchUserInfo[this.userIndex];\r\n postUserEdit({\r\n nickname: trim(this.userInfo.nickname),\r\n avatar: userInfo.avatar\r\n }).then(\r\n res => {\r\n this.$store.dispatch(\"USERINFO\", true);\r\n this.$dialog.success(res.msg);\r\n this.$router.go(-1);\r\n },\r\n error => {\r\n this.$dialog.error(error.msg);\r\n }\r\n );\r\n },\r\n logout: function() {\r\n this.$dialog.confirm({\r\n mes: \"确认退出登录?\",\r\n opts: () => {\r\n getLogout()\r\n .then(res => {\r\n this.$store.commit(\"LOGOUT\");\r\n clearAuthStatus();\r\n location.href = location.origin;\r\n console.log(res);\r\n })\r\n .catch(err => {\r\n console.log(err);\r\n });\r\n }\r\n });\r\n }\r\n }\r\n};\r\n</script>\r\n","import mod from \"-!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../../../node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/index.js??vue-loader-options!./PersonalData.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../../../node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/index.js??vue-loader-options!./PersonalData.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./PersonalData.vue?vue&type=template&id=d1dcdf80&\"\nimport script from \"./PersonalData.vue?vue&type=script&lang=js&\"\nexport * from \"./PersonalData.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}
|