index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <div>
  3. <div class="com-mobile-header">
  4. <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
  5. <p>个人中心
  6. <span @click="showLogout = true">退出</span>
  7. </p>
  8. </div>
  9. <div class="mobile-user mobile-fix-content">
  10. <nuxt-link to="/mobile/user/info/personal" tag="div" class="line img-line">
  11. <div class="img-wrap">
  12. <img :src="user.data.imageUrl ? user.data.imageUrl : '/images/component/default.png'" alt="" class="photo"/>
  13. </div>
  14. <span>{{user.data.userName}}</span>
  15. <span class="tel">{{user.data.userTel}}</span>
  16. <span class="edit" to="/mobile/user/info/personal">
  17. <img src="/images/mobile/user/edit.png" alt=""/>
  18. </span>
  19. </nuxt-link>
  20. <div class="line" @click="showLogin=true">
  21. <div class="img-wrap">
  22. <img src="/images/mobile/user/icon_01.png" alt="">
  23. </div>
  24. <!-- <span>公司</span>-->
  25. <i class="iconfont icon-xiangyou"></i>
  26. <span class="l-right">{{currentEnName}}</span>
  27. </div>
  28. <div class="line" @click="go('/mobile/user/storeinfo')" v-if="storeStatus.uuid">
  29. <div class="img-wrap">
  30. <img src="/images/mobile/user/icon_02.png" alt="">
  31. </div>
  32. <span>店铺信息</span>
  33. <i class="iconfont icon-xiangyou"></i>
  34. </div>
  35. <div class="line" @click="go('/mobile/user/storeinfo')" v-else>
  36. <div class="img-wrap">
  37. <img src="/images/mobile/user/apply-store.png" alt="">
  38. </div>
  39. <span>开店申请</span>
  40. <i class="iconfont icon-xiangyou"></i>
  41. </div>
  42. <div class="line block-line" @click="go('/mobile/user/enterpriseinfo')">
  43. <div class="img-wrap">
  44. <img src="/images/mobile/user/icon_03.png" alt="">
  45. </div>
  46. <span>企业信息</span>
  47. <i class="iconfont icon-xiangyou"></i>
  48. <div class="border-line"></div>
  49. </div>
  50. <!--<nuxt-link to="/mobile/user/info/personal" tag="div" class="line block-line">-->
  51. <!--<div class="img-wrap">-->
  52. <!--<img src="/images/mobile/user/icon_04.png" alt="">-->
  53. <!--</div>-->
  54. <!--<span>个人信息</span>-->
  55. <!--<i class="iconfont icon-xiangyou"></i>-->
  56. <!--<div class="border-line"></div>-->
  57. <!--</nuxt-link>-->
  58. <div @click="go('/mobile/user/info/admin')" class="line block-line">
  59. <div class="img-wrap">
  60. <img src="/images/mobile/user/icon_05.png" alt="">
  61. </div>
  62. <span>管理员信息</span>
  63. <i class="iconfont icon-xiangyou"></i>
  64. <div class="border-line"></div>
  65. </div>
  66. <div class="deleteKuang" v-if="showLogout">
  67. <div class="kuangContent">
  68. <div class="title">系统提示</div>
  69. <div class="titleinfo">是否退出登录</div>
  70. <!--<div class="info" v-show="isUploadpro">*存在已上架信息</div>-->
  71. <div class="K_btn">
  72. <div class="cancelBtn" @click="showLogout = false">取消</div>
  73. <div class="answerBtn" @click="logout()">确定</div>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="mobile-modal" v-if="showLogin" @click="showLogin=false">
  78. <div class="modal-content" @click="stopPro($event)">
  79. <p>公司选择 <i class="iconfont icon-guanbi1" @click="showLogin=false"></i></p>
  80. <ul>
  81. <li class="active" @click="switchEnterprise(user.data.enterprise)">
  82. <a>{{ currentEnName }}</a>
  83. <i class="iconfont icon-xuanzhong"></i>
  84. </li>
  85. <li
  86. v-for="en in sortEnterprises"
  87. v-if="en.uu != user.data.enterprise.uu"
  88. v-bind:key="en.uu"
  89. @click="switchEnterprise(en)">
  90. <a>{{ en.enName }}</a>
  91. </li>
  92. <li v-if="user.data.enterprise.uu" @click="switchEnterprise({uu: 0})">
  93. <a><span v-text="user.data.userName"></span>(个人账户)</a>
  94. </li>
  95. </ul>
  96. </div>
  97. </div>
  98. <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
  99. </div>
  100. </div>
  101. </template>
  102. <script>
  103. import { RemindBox } from '~components/mobile/common'
  104. export default {
  105. layout: 'mobileNoHeader',
  106. middleware: 'authenticated',
  107. data () {
  108. return {
  109. showLogout: false,
  110. showLogin: false,
  111. timeoutCount: 0,
  112. collectResult: '',
  113. applyStatus: ''
  114. }
  115. },
  116. components: {
  117. RemindBox
  118. },
  119. fetch ({store}) {
  120. return Promise.all([
  121. store.dispatch('loadStoreStatus', {op: 'check'})
  122. ])
  123. },
  124. computed: {
  125. storeStatus () {
  126. return this.$store.state.option.storeStatus.data
  127. }
  128. },
  129. methods: {
  130. switchEnterprise(en) {
  131. this.$http.get(`/user/authentication/${en.uu || 0}`).then(() => {
  132. this.$store.dispatch('loadUserInfo').then(() => {
  133. this.showLogin = false
  134. this.$store.dispatch('loadStoreStatus', {op: 'check'})
  135. })
  136. })
  137. },
  138. logout () {
  139. this.$http.get('/logout/crossBefore', {params: {returnUrl: window.location.protocol + '//' + window.location.host}}).then(response => {
  140. if (response.data) {
  141. window.location.href = response.data.logoutUrl + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
  142. }
  143. })
  144. },
  145. stopPro (e) {
  146. if (e) {
  147. e.stopPropagation()
  148. }
  149. },
  150. go: function (url) {
  151. if (url === '/mobile/user/storeinfo') {
  152. if (this.storeStatus.uuid) {
  153. this.$router.push(url)
  154. } else {
  155. console.log(this.applyStatus)
  156. if (this.applyStatus === 'PREPARE') {
  157. this.setRemindText('您的申请已提交,请耐心工作人员审核(2-3个工作日)')
  158. } else {
  159. // 您的申请已提交,请耐心工作人员审核(2-3个工作日)
  160. this.$router.push('/mobile/store')
  161. }
  162. // this.setRemindText('请先前往pc端申请开店')
  163. }
  164. } else if (!this.user.data.enterprise.uu || this.user.data.enterprise.isVendor !== 313) {
  165. this.setRemindText('请先前往pc端完善企业信息')
  166. } else {
  167. this.$router.push(url)
  168. }
  169. },
  170. setRemindText: function (str) {
  171. this.collectResult = str
  172. this.timeoutCount++
  173. }
  174. },
  175. created() {
  176. if (!this.storeStatus) {
  177. this.$http.get('/store-service/applications?status=normal').then(res => {
  178. this.applyStatus = res.data.data.status
  179. })
  180. }
  181. }
  182. }
  183. </script>
  184. <style lang="scss" scoped>
  185. .mobile-user {
  186. background: #f1f3f6;
  187. .line {
  188. height: 1.17rem;
  189. background: #fff;
  190. line-height: 1.17rem;
  191. font-size: .28rem;
  192. padding: 0 .24rem 0 .26rem;
  193. width: 7.1rem;
  194. margin: .3rem auto 0;
  195. .img-wrap {
  196. width: .8rem;
  197. margin: 0 .26rem 0 0;
  198. display: inline-block;
  199. img {
  200. max-width: .8rem;
  201. max-height: .8rem;
  202. }
  203. img.photo {
  204. width: 1.27rem;
  205. height: 1.27rem;
  206. }
  207. }
  208. span.edit img{
  209. float: right;
  210. margin-top: .43rem;
  211. width: .3rem;
  212. height: .3rem;
  213. }
  214. span.tel{
  215. margin-left: .2rem;
  216. }
  217. .l-right {
  218. color: #666;
  219. margin-right: .35rem;
  220. max-width: 4.8rem;
  221. text-align: right;
  222. overflow: hidden;
  223. text-overflow: ellipsis;
  224. white-space: nowrap;
  225. }
  226. i {
  227. float: right;
  228. color: #c1c1c6;
  229. font-size: .28rem;
  230. }
  231. &.img-line {
  232. padding-left: .16rem;
  233. .img-wrap {
  234. width: .9rem;
  235. margin: 0 .16rem 0 0;
  236. img {
  237. max-width: .9rem;
  238. max-height: .9rem;
  239. border-radius: 100%;
  240. border: 1px solid #acc;
  241. }
  242. }
  243. }
  244. &.block-line {
  245. margin-top: 0;
  246. position: relative;
  247. .border-line {
  248. width: 6.62rem;
  249. position: absolute;
  250. top: 0;
  251. height: 1px;
  252. background: #d9d9d9;
  253. }
  254. }
  255. }
  256. }
  257. .deleteKuang {
  258. position: fixed;
  259. background: rgba(0,0,0,0.5);
  260. top: 0;
  261. left: 0;
  262. right: 0;
  263. bottom: 0;
  264. z-index: 9999;
  265. .kuangContent {
  266. border-radius: 5px;
  267. background: #fff;
  268. width: 5rem;
  269. position: absolute;
  270. left: 50%;
  271. top: 50%;
  272. transform: translate3d(-50%, -50%, 0);
  273. overflow: hidden;
  274. .titleinfo {
  275. font-size: .3rem;
  276. color: #666;
  277. text-align: center;
  278. margin-top: 0.5rem;
  279. margin-bottom: 0.1rem;
  280. }
  281. .title {
  282. background: #5078cb;
  283. height: .7rem;
  284. line-height: .7rem;
  285. font-size: .3rem;
  286. color: #fff;
  287. text-align: center;
  288. }
  289. .info {
  290. color: #f00;
  291. text-align: center;
  292. }
  293. .K_btn {
  294. margin-top: 0.4rem;
  295. line-height: 0.7rem;
  296. height: 0.7rem;
  297. &::after{
  298. clear: both;
  299. display: block;
  300. content: ' ';
  301. visibility: hidden;
  302. zoom: 1;
  303. }
  304. div {
  305. float: left;
  306. width: 50%;
  307. font-size: 0.3rem;
  308. text-align: center;
  309. &.cancelBtn {
  310. background: #b4b5b9;
  311. color: #333;
  312. }
  313. &.answerBtn {
  314. background: #5078cb;
  315. color: #fff;
  316. }
  317. }
  318. }
  319. }
  320. }
  321. .modal-content {
  322. position: absolute;
  323. height: 5.32rem;
  324. bottom: .98rem;
  325. left: 0;
  326. background: #fff;
  327. width: 100%;
  328. border-radius: 0;
  329. box-shadow: 0 -9px 9px rgba(0,0,0,.5);
  330. p {
  331. height: .88rem;
  332. line-height: .88rem;
  333. text-align: center;
  334. font-size: .3rem;
  335. background: #f6f5f5;
  336. i {
  337. position: absolute;
  338. right: 0;
  339. color: #bebebe;
  340. font-size: .24rem;
  341. margin-right: .35rem;
  342. }
  343. }
  344. ul {
  345. height: 4.4rem;
  346. overflow-y: auto;
  347. li {
  348. height: 1rem;
  349. line-height: 1rem;
  350. padding: 0 .23rem 0 .4rem;
  351. border-bottom: 1px solid #e5e6eb;
  352. overflow: hidden;
  353. text-overflow: ellipsis;
  354. white-space: nowrap;
  355. &:hover, &:active, &:focus {
  356. background: #f7f7f7;
  357. }
  358. a {
  359. display: inline-block;
  360. color: #666;
  361. font-size: .28rem;
  362. }
  363. i {
  364. color: #3f84f6;
  365. float: right;
  366. font-size: .24rem;
  367. }
  368. &.active {
  369. a {
  370. color: #3f84f6;
  371. border-bottom: 1px solid #3f84f6;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. </style>