index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. <template>
  2. <div class="mobile-center">
  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 inline-block">{{currentEnName}}</span>
  27. </div>
  28. <div class="block-wrap seek-operation">
  29. <p><i></i>更多信息</p>
  30. <ul>
  31. <li @click="go('/mobile/user/storeinfo')" v-if="storeStatus.uuid">
  32. <img src="/images/mobile/user/icon_02.png" alt="">
  33. <p>店铺信息</p>
  34. </li>
  35. <li @click="go('/mobile/user/storeinfo')" v-else>
  36. <img src="/images/mobile/user/apply-store.png" alt="">
  37. <p>开店申请</p>
  38. </li>
  39. <li @click="go('/mobile/center/user/invoice?type=frompage')">
  40. <img src="/images/mobile/user/fapiao.png" alt="">
  41. <p>开票信息</p>
  42. </li>
  43. <li @click="go('/mobile/center/vendor/payCenter?switchType=account&type=frompage')">
  44. <img src="/images/mobile/user/shoukuan.png" alt="">
  45. <p>收款账户</p>
  46. </li>
  47. <li @click="go('/mobile/center/user/payCenter?switchType=account&type=frompage')">
  48. <img src="/images/mobile/user/fukuang.png" alt="">
  49. <p>付款账户</p>
  50. </li>
  51. <li @click="go('/mobile/user/address')">
  52. <img src="/images/mobile/user/icon_06.png" alt="">
  53. <p>收货地址</p>
  54. </li>
  55. </ul>
  56. </div>
  57. <div class="block-wrap seek-operation">
  58. <p><i></i>更多信息</p>
  59. <ul>
  60. <li @click="go('/mobile/user/enterpriseinfo')">
  61. <img src="/images/mobile/user/icon_03.png" alt="">
  62. <p>企业信息</p>
  63. </li>
  64. <li @click="go('/mobile/user/info/admin')">
  65. <img src="/images/mobile/user/icon_05.png" alt="">
  66. <p>管理员信息</p>
  67. </li>
  68. <li @click="go('/mobile/user/staff')">
  69. <img src="/images/mobile/center/vendor/onsale.png" alt="">
  70. <p>员工管理</p>
  71. </li>
  72. </ul>
  73. </div>
  74. <!--<div class="mobile-user mobile-fix-content">-->
  75. <!--<nuxt-link to="/mobile/user/info/personal" tag="div" class="line img-line">-->
  76. <!--<div class="img-wrap">-->
  77. <!--<img :src="user.data.imageUrl ? user.data.imageUrl : '/images/component/default.png'" alt="" class="photo"/>-->
  78. <!--</div>-->
  79. <!--<span>{{user.data.userName}}</span>-->
  80. <!--<span class="tel">{{user.data.userTel}}</span>-->
  81. <!--<span class="edit" to="/mobile/user/info/personal">-->
  82. <!--<img src="/images/mobile/user/edit.png" alt=""/>-->
  83. <!--</span>-->
  84. <!--</nuxt-link>-->
  85. <!--<div class="line" @click="showLogin=true">-->
  86. <!--<div class="img-wrap">-->
  87. <!--<img src="/images/mobile/user/icon_01.png" alt="">-->
  88. <!--</div>-->
  89. <!--<i class="iconfont icon-xiangyou"></i>-->
  90. <!--<span class="l-right inline-block">{{currentEnName}}</span>-->
  91. <!--</div>-->
  92. <!--<div class="line" @click="go('/mobile/user/storeinfo')" v-if="storeStatus.uuid">-->
  93. <!--<div class="img-wrap">-->
  94. <!--<img src="/images/mobile/user/icon_02.png" alt="">-->
  95. <!--</div>-->
  96. <!--<span>店铺信息</span>-->
  97. <!--<i class="iconfont icon-xiangyou"></i>-->
  98. <!--</div>-->
  99. <!--<div class="line" @click="go('/mobile/user/storeinfo')" v-else>-->
  100. <!--<div class="img-wrap">-->
  101. <!--<img src="/images/mobile/user/apply-store.png" alt="">-->
  102. <!--</div>-->
  103. <!--<span>开店申请</span>-->
  104. <!--<i class="iconfont icon-xiangyou"></i>-->
  105. <!--</div>-->
  106. <!--<div class="line block-line" @click="go('/mobile/user/enterpriseinfo')">-->
  107. <!--<div class="img-wrap">-->
  108. <!--<img src="/images/mobile/user/icon_03.png" alt="">-->
  109. <!--</div>-->
  110. <!--<span>企业信息</span>-->
  111. <!--<i class="iconfont icon-xiangyou"></i>-->
  112. <!--<div class="border-line"></div>-->
  113. <!--</div>-->
  114. <!--<nuxt-link to="/mobile/user/info/personal" tag="div" class="line block-line">-->
  115. <!--<div class="img-wrap">-->
  116. <!--<img src="/images/mobile/user/icon_04.png" alt="">-->
  117. <!--</div>-->
  118. <!--<span>个人信息</span>-->
  119. <!--<i class="iconfont icon-xiangyou"></i>-->
  120. <!--<div class="border-line"></div>-->
  121. <!--</nuxt-link>-->
  122. <!--<div @click="go('/mobile/user/info/admin')" class="line block-line">-->
  123. <!--<div class="img-wrap">-->
  124. <!--<img src="/images/mobile/user/icon_05.png" alt="">-->
  125. <!--</div>-->
  126. <!--<span>管理员信息</span>-->
  127. <!--<i class="iconfont icon-xiangyou"></i>-->
  128. <!--<div class="border-line"></div>-->
  129. <!--</div>-->
  130. <!--<div @click="go('/mobile/user/address')" class="line block-line">-->
  131. <!--<div class="img-wrap">-->
  132. <!--<img src="/images/mobile/user/icon_06.png" alt="">-->
  133. <!--</div>-->
  134. <!--<span>收货地址信息</span>-->
  135. <!--<i class="iconfont icon-xiangyou"></i>-->
  136. <!--<div class="border-line"></div>-->
  137. <!--</div>-->
  138. <div class="deleteKuang" v-if="showLogout">
  139. <div class="kuangContent">
  140. <div class="title">系统提示</div>
  141. <div class="titleinfo">是否退出登录</div>
  142. <!--<div class="info" v-show="isUploadpro">*存在已上架信息</div>-->
  143. <div class="K_btn">
  144. <div class="cancelBtn" @click="showLogout = false">取消</div>
  145. <div class="answerBtn" @click="logout()">确定</div>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="mobile-modal" v-if="showLogin" @click="showLogin=false">
  150. <div class="modal-content" @click="stopPro($event)">
  151. <p>公司选择 <i class="iconfont icon-guanbi1" @click="showLogin=false"></i></p>
  152. <ul>
  153. <li class="active" @click="switchEnterprise(user.data.enterprise)">
  154. <a>{{ currentEnName }}</a>
  155. <i class="iconfont icon-xuanzhong"></i>
  156. </li>
  157. <li
  158. v-for="en in sortEnterprises"
  159. v-if="en.uu != user.data.enterprise.uu"
  160. v-bind:key="en.uu"
  161. @click="switchEnterprise(en)">
  162. <a>{{ en.enName }}</a>
  163. </li>
  164. <li v-if="user.data.enterprise.uu" @click="switchEnterprise({uu: 0})">
  165. <a><span v-text="user.data.userName"></span>(个人账户)</a>
  166. </li>
  167. </ul>
  168. </div>
  169. </div>
  170. <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
  171. </div>
  172. </div>
  173. </template>
  174. <script>
  175. import { RemindBox } from '~components/mobile/common'
  176. export default {
  177. layout: 'mobileNoHeader',
  178. middleware: 'authenticated',
  179. data () {
  180. return {
  181. showLogout: false,
  182. showLogin: false,
  183. timeoutCount: 0,
  184. collectResult: '',
  185. applyStatus: ''
  186. }
  187. },
  188. components: {
  189. RemindBox
  190. },
  191. fetch ({store}) {
  192. return Promise.all([
  193. store.dispatch('loadStoreStatus', {op: 'check'})
  194. ])
  195. },
  196. computed: {
  197. storeStatus () {
  198. return this.$store.state.option.storeStatus.data
  199. }
  200. },
  201. methods: {
  202. switchEnterprise(en) {
  203. this.$http.get(`/user/authentication/${en.uu || 0}`).then(() => {
  204. this.$store.dispatch('loadUserInfo').then(() => {
  205. this.showLogin = false
  206. this.$store.dispatch('loadStoreStatus', {op: 'check'})
  207. this.$http.get('/store-service/applications?status=normal').then(res => {
  208. if (res.data.success) {
  209. this.applyStatus = res.data.data ? res.data.data.status : ''
  210. } else {
  211. this.applyStatus = 'error'
  212. }
  213. })
  214. })
  215. })
  216. // 切换帐套用
  217. this.$jsonp(`${process.env.ssoUrl}/sso/login/change/userspace?spaceUU=${en.uu}`, {timeout: 5000, name: 'successCallback'}, (err) => {
  218. console.log(err)
  219. })
  220. },
  221. logout () {
  222. this.$http.get('/logout/crossBefore', {params: {returnUrl: window.location.protocol + '//' + window.location.host}}).then(response => {
  223. if (response.data) {
  224. window.location.href = response.data.logoutUrl + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
  225. }
  226. })
  227. },
  228. stopPro (e) {
  229. if (e) {
  230. e.stopPropagation()
  231. }
  232. },
  233. go: function (url) {
  234. if (url === '/mobile/user/storeinfo') {
  235. if (this.storeStatus.uuid) {
  236. this.$router.push(url)
  237. } else {
  238. if (this.applyStatus === 'PREPARE') {
  239. this.setRemindText('您的申请已提交,请耐心等待工作人员审核(2-3个工作日)')
  240. } else {
  241. if (!this.$store.state.option.user.data.enterprise.uu) {
  242. // 进入个人绑定企业页面
  243. this.$router.push('/mobile/store/register')
  244. } else {
  245. this.$router.push('/mobile/store')
  246. }
  247. }
  248. }
  249. } else if (url === '/mobile/user/address' || url === '/mobile/center/user/payCenter?switchType=account&type=frompage' || url === '/mobile/center/user/invoice?type=frompage') {
  250. this.$router.push(url)
  251. } else if (!this.user.data.enterprise.uu || this.user.data.enterprise.isVendor !== 313) {
  252. this.setRemindText('请点击【开店申请】完善信息')
  253. } else {
  254. this.$router.push(url)
  255. }
  256. },
  257. setRemindText: function (str) {
  258. this.collectResult = str
  259. this.timeoutCount++
  260. }
  261. },
  262. created() {
  263. if (!this.storeStatus) {
  264. this.$http.get('/store-service/applications?status=normal').then(res => {
  265. this.applyStatus = res.data.data ? res.data.data.status : ''
  266. })
  267. }
  268. }
  269. }
  270. </script>
  271. <style lang="scss" scoped>
  272. @import '~assets/scss/mobileCenter';
  273. .mobile-center{
  274. .collect-block {
  275. height: auto;
  276. }
  277. }
  278. .mobile-user {
  279. background: #f1f3f6;
  280. .line {
  281. height: 1.17rem;
  282. background: #fff;
  283. line-height: 1.17rem;
  284. font-size: .28rem;
  285. padding: 0 .24rem 0 .26rem;
  286. width: 7.1rem;
  287. margin: .3rem auto 0;
  288. .img-wrap {
  289. width: .8rem;
  290. margin: 0 .26rem 0 0;
  291. display: inline-block;
  292. img {
  293. max-width: .8rem;
  294. max-height: .8rem;
  295. }
  296. img.photo {
  297. width: 1.27rem;
  298. height: 1.27rem;
  299. }
  300. }
  301. span.edit img{
  302. float: right;
  303. margin-top: .43rem;
  304. width: .3rem;
  305. height: .3rem;
  306. }
  307. span.tel{
  308. margin-left: .2rem;
  309. }
  310. .l-right {
  311. color: #666;
  312. margin-right: .35rem;
  313. max-width: 4.8rem;
  314. text-align: right;
  315. overflow: hidden;
  316. text-overflow: ellipsis;
  317. white-space: nowrap;
  318. }
  319. i {
  320. float: right;
  321. color: #c1c1c6;
  322. font-size: .28rem;
  323. }
  324. &.img-line {
  325. padding-left: .16rem;
  326. .img-wrap {
  327. width: .9rem;
  328. margin: 0 .16rem 0 0;
  329. img {
  330. max-width: .9rem;
  331. max-height: .9rem;
  332. border-radius: 100%;
  333. border: 1px solid #acc;
  334. }
  335. }
  336. }
  337. &.block-line {
  338. margin-top: 0;
  339. position: relative;
  340. .border-line {
  341. width: 6.62rem;
  342. position: absolute;
  343. top: 0;
  344. height: 1px;
  345. background: #d9d9d9;
  346. }
  347. }
  348. }
  349. }
  350. .deleteKuang {
  351. position: fixed;
  352. background: rgba(0,0,0,0.5);
  353. top: 0;
  354. left: 0;
  355. right: 0;
  356. bottom: 0;
  357. z-index: 9999;
  358. .kuangContent {
  359. border-radius: 5px;
  360. background: #fff;
  361. width: 5rem;
  362. position: absolute;
  363. left: 50%;
  364. top: 50%;
  365. transform: translate3d(-50%, -50%, 0);
  366. overflow: hidden;
  367. .titleinfo {
  368. font-size: .3rem;
  369. color: #666;
  370. text-align: center;
  371. margin-top: 0.5rem;
  372. margin-bottom: 0.1rem;
  373. }
  374. .title {
  375. background: #5078cb;
  376. height: .7rem;
  377. line-height: .7rem;
  378. font-size: .3rem;
  379. color: #fff;
  380. text-align: center;
  381. }
  382. .info {
  383. color: #f00;
  384. text-align: center;
  385. }
  386. .K_btn {
  387. margin-top: 0.4rem;
  388. line-height: 0.7rem;
  389. height: 0.7rem;
  390. &::after{
  391. clear: both;
  392. display: block;
  393. content: ' ';
  394. visibility: hidden;
  395. zoom: 1;
  396. }
  397. div {
  398. float: left;
  399. width: 50%;
  400. font-size: 0.3rem;
  401. text-align: center;
  402. &.cancelBtn {
  403. background: #b4b5b9;
  404. color: #333;
  405. }
  406. &.answerBtn {
  407. background: #5078cb;
  408. color: #fff;
  409. }
  410. }
  411. }
  412. }
  413. }
  414. .modal-content {
  415. position: absolute;
  416. height: 5.32rem;
  417. bottom: .98rem;
  418. left: 0;
  419. background: #fff;
  420. width: 100%;
  421. border-radius: 0;
  422. box-shadow: 0 -9px 9px rgba(0,0,0,.5);
  423. p {
  424. height: .88rem;
  425. line-height: .88rem;
  426. text-align: center;
  427. font-size: .3rem;
  428. background: #f6f5f5;
  429. i {
  430. position: absolute;
  431. right: 0;
  432. color: #bebebe;
  433. font-size: .24rem;
  434. margin-right: .35rem;
  435. }
  436. }
  437. ul {
  438. height: 4.4rem;
  439. overflow-y: auto;
  440. li {
  441. height: 1rem;
  442. line-height: 1rem;
  443. padding: 0 .23rem 0 .4rem;
  444. border-bottom: 1px solid #e5e6eb;
  445. overflow: hidden;
  446. text-overflow: ellipsis;
  447. white-space: nowrap;
  448. &:hover, &:active, &:focus {
  449. background: #f7f7f7;
  450. }
  451. a {
  452. display: inline-block;
  453. color: #666;
  454. font-size: .28rem;
  455. }
  456. i {
  457. color: #3f84f6;
  458. float: right;
  459. font-size: .24rem;
  460. }
  461. &.active {
  462. a {
  463. color: #3f84f6;
  464. border-bottom: 1px solid #3f84f6;
  465. }
  466. }
  467. }
  468. }
  469. }
  470. </style>