PersonalMaterial.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <div class="personal-material">
  3. <a @click="goLastPage">&lt;返回上一层</a>
  4. <div class="personal-material-header">
  5. <p><i class="fa fa-exclamation-circle"></i>抱歉,您的账户未绑定企业,暂无卖家权限!</p>
  6. <a @click="setShowApplyRecord(true)">查看申请记录</a>
  7. </div>
  8. <div class="personal-material-content">
  9. <div class="is-open-store">
  10. <p><img src="/images/material/arrow-right-blue.png" alt="">所属企业已开店</p>
  11. <div>
  12. <p>绑定企业</p>
  13. <div class="search-content">企业全称:<input type="text" class="form-control" v-model="keyword" placeholder="请输入企业全称" @keyup.13="onSearchEnterprise"><span @click="onSearchEnterprise">检测</span></div>
  14. <div class="result-content" v-if="showSearchResultStatus == 1">
  15. <p v-text="enInfo.name"></p>
  16. <div class="result-text">
  17. <span>管理员</span>
  18. <span v-text="enInfo.adminName"></span>
  19. </div>
  20. <div class="result-text">
  21. <span>营业执照号</span>
  22. <span v-text="enInfo.businessCode"></span>
  23. </div>
  24. <a href="javascript:void(0)" @click="bindEnterprise">申请绑定</a>
  25. <div class="result-remind">管理员审核通过后成功绑定</div>
  26. </div>
  27. <p class="no-result-content" v-if="showSearchResultStatus == 2">
  28. {{enName}} <span>(未开店)</span>
  29. </p>
  30. </div>
  31. </div>
  32. <div class="not-open-store">
  33. <p><img src="/images/material/arrow-right-yellow.png" alt="">所属企业未开店</p>
  34. <div>
  35. <div class="fl">
  36. <img src="/images/material/car.png" alt="">
  37. <ul>
  38. <li>免费入驻 不赚差价</li>
  39. <li>库存寄售 极速上架</li>
  40. <li>定量广告 限时免费</li>
  41. </ul>
  42. </div>
  43. <div class="fr">
  44. <img src="/images/material/house.png" alt="">
  45. <div>
  46. <p>请点击下方按钮开设新的店铺</p>
  47. <a href="/register-saler">开设新店铺</a>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="modal-wrap" v-show="showRemindBox || showApplyRecord"></div>
  54. <div class="com-del-box" v-if="showRemindBox">
  55. <div class="title">
  56. <i @click="goLastPage"></i>
  57. </div>
  58. <p><img src="/images/material/check.png" alt="">绑定申请提交成功!</p>
  59. <div class="result">审批结果将以短信通知,请保持手机通畅。</div>
  60. <div class="remind">弹窗将在 <span v-text="timer + '秒'"></span> 后自动关闭</div>
  61. </div>
  62. <div class="apply-record" v-if="showApplyRecord">
  63. <div class="title">申请记录 <img src="/images/material/apply-close.png" alt="" @click="setShowApplyRecord(false)"></div>
  64. <div class="record-wrap">
  65. <div class="record-title">
  66. <span>企业名称</span>
  67. <span>管理员</span>
  68. <span>申请时间</span>
  69. <span>状态</span>
  70. </div>
  71. <ul>
  72. <li v-for="item in applyList">
  73. <span>{{item.enName}}</span>
  74. <span>{{item.adminName}}</span>
  75. <span>{{item.date | date}}</span>
  76. <span :class="{'green-text': item.status == 311, 'red-text': item.status == 317}">{{item.status | status}}</span>
  77. </li>
  78. </ul>
  79. </div>
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. export default {
  85. data () {
  86. return {
  87. showApplyRecord: false,
  88. showRemindBox: false,
  89. // 0=>初始状态,1=>有搜索结果,2=>搜索结果为空
  90. showSearchResultStatus: 0,
  91. keyword: '',
  92. enName: '',
  93. enInfo: {},
  94. timer: 5,
  95. applyList: []
  96. }
  97. },
  98. computed: {
  99. user () {
  100. return this.$store.state.option.user
  101. }
  102. },
  103. filters: {
  104. date: function (input) {
  105. const d = new Date(input)
  106. const year = d.getFullYear()
  107. const monthTemp = d.getMonth() + 1
  108. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  109. const hour = d.getHours() < 10 ? '0' + d.getHours() : '' + d.getHours()
  110. const minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : '' + d.getMinutes()
  111. const seconds = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
  112. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
  113. return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
  114. },
  115. status: function (status) {
  116. switch (status) {
  117. case 311:
  118. return '待审核'
  119. case 316:
  120. return '已通过'
  121. case 317:
  122. return '未通过'
  123. default:
  124. break
  125. }
  126. }
  127. },
  128. methods: {
  129. goLastPage: function () {
  130. window.history.back(-1)
  131. },
  132. onSearchEnterprise: function () {
  133. if (this.keyword) {
  134. this.$http.get('/basic/enterprise/findByName/' + encodeURIComponent(this.keyword)).then(response => {
  135. if (response.data) {
  136. this.enInfo = response.data
  137. this.showSearchResultStatus = 1
  138. } else {
  139. this.enName = this.keyword
  140. this.showSearchResultStatus = 2
  141. }
  142. })
  143. }
  144. },
  145. bindEnterprise: function () {
  146. this.$http.get('/basic/enterprise/applyUserSpace', {params: {phone: this.user.data.userTel, enName: this.enInfo.name, businessCode: this.enInfo.businessCode}})
  147. .then(response => {
  148. if (response.data.data === 'success') {
  149. this.showSearchResultStatus = 0
  150. this.keyword = ''
  151. this.showRemindBox = true
  152. this.startInterval()
  153. } else {
  154. this.$message.error(response.data.data)
  155. }
  156. }, err => {
  157. console.log(err)
  158. this.$message.error('系统错误')
  159. })
  160. },
  161. startInterval: function () {
  162. this.timer = 5
  163. let _this = this
  164. let interval = setInterval(() => {
  165. _this.timer --
  166. if (_this.timer === 0) {
  167. clearInterval(interval)
  168. this.showRemindBox = false
  169. this.goLastPage()
  170. }
  171. }, 1000)
  172. },
  173. setShowApplyRecord: function (flag) {
  174. if (flag) {
  175. this.$http.get('/basic/enterprise/findApplyInfo', {params: {phone: this.user.data.userTel}})
  176. .then(responses => {
  177. this.applyList = responses.data
  178. this.showApplyRecord = flag
  179. }, err => {
  180. console.log(err)
  181. this.$message.error('系统错误')
  182. })
  183. } else {
  184. this.showApplyRecord = flag
  185. }
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss" scoped>
  191. .personal-material {
  192. width: 1190px;
  193. margin: 0 auto;
  194. p {
  195. margin: 0;
  196. }
  197. a {
  198. color: #5078cb;
  199. }
  200. > a {
  201. line-height: 71px;
  202. position: relative;
  203. right: 105px;
  204. }
  205. .personal-material-header {
  206. height: 111px;
  207. line-height: 111px;
  208. border: 1px solid #ebeaea;
  209. position: relative;
  210. margin-bottom: 19px;
  211. p {
  212. color: #5078cb;
  213. font-size: 22px;
  214. text-align: center;
  215. i {
  216. margin-right: 20px;
  217. }
  218. }
  219. a {
  220. position: absolute;
  221. right: 11px;
  222. bottom: 14px;
  223. display: inline-block;
  224. line-height: normal;
  225. }
  226. }
  227. .personal-material-content {
  228. border: 1px solid #ebeaea;
  229. margin-bottom: 147px;
  230. padding: 0 95px;
  231. > div {
  232. padding: 0 50px;
  233. border-radius: 3px;
  234. > p {
  235. height: 81px;
  236. line-height: 81px;
  237. font-size: 16px;
  238. font-weight: bold;
  239. img {
  240. margin-right: 4px;
  241. }
  242. }
  243. }
  244. .is-open-store {
  245. padding-bottom: 29px;
  246. border-bottom: 1px solid #d5d5d5;
  247. > div {
  248. min-height: 140px;
  249. border: 1px solid #5078cb;
  250. > p {
  251. font-weight: bold;
  252. font-size: 18px;
  253. margin: 26px 0;
  254. text-align: center;
  255. }
  256. .search-content {
  257. text-align: center;
  258. input {
  259. width: 290px;
  260. display: inline-block;
  261. height: 30px;
  262. border: {
  263. top-left-radius: 3px;
  264. bottom-left-radius: 3px;
  265. top-right-radius: 0;
  266. bottom-right-radius: 0;
  267. }
  268. border-top-left-radius: 3px;
  269. border-bottom-left-radius: 3px;
  270. border: 1px solid #cdcdcd;
  271. margin-left: 10px;
  272. }
  273. span {
  274. display: inline-block;
  275. width: 87px;
  276. height: 30px;
  277. line-height: 31px;
  278. text-align: center;
  279. color: #fff;
  280. background: #5078cb;
  281. margin-left: -1px;
  282. border-top-right-radius: 3px;
  283. border-bottom-right-radius: 3px;
  284. cursor: pointer;
  285. }
  286. }
  287. .result-content {
  288. padding: 0 0 0 221px;
  289. p {
  290. height: 41px;
  291. line-height: 41px;
  292. font-size: 16px;
  293. font-weight: bold;
  294. margin: 24px 0 0 0;
  295. width: 376px;
  296. border-bottom: 1px solid #e6e5e4;
  297. padding-left: 8px;
  298. }
  299. .result-text {
  300. padding-left: 8px;
  301. span {
  302. &:first-child {
  303. display: inline-block;
  304. width: 111px;
  305. color: #666;
  306. }
  307. }
  308. &:first-of-type {
  309. margin: 15px 0 21px 0;
  310. }
  311. }
  312. > a {
  313. display: inline-block;
  314. width: 201px;
  315. height: 40px;
  316. line-height: 40px;
  317. text-align: center;
  318. border-radius: 3px;
  319. background: #5078cb;
  320. color: #fff;
  321. margin: 37px 0 16px 130px;
  322. }
  323. .result-remind {
  324. margin: 0 0 18px 146px;
  325. color: #666;
  326. }
  327. }
  328. .no-result-content {
  329. font-size: 16px;
  330. margin: 26px 0 38px 220px;
  331. text-align: left;
  332. span {
  333. color: #f00707;
  334. font-weight: normal;
  335. }
  336. }
  337. }
  338. }
  339. .not-open-store {
  340. margin-bottom: 62px;
  341. > div {
  342. height: 171px;
  343. border: 1px solid #ff8522;
  344. .fl {
  345. list-style: inside;
  346. color: #ff8522;
  347. height: 130px;
  348. width: 391px;
  349. margin-top: 25px;
  350. border-right: 1px dashed #fce3cf;
  351. img {
  352. margin: 11px 0 0 16px;
  353. }
  354. ul {
  355. list-style: inside;
  356. color: #ff8522;
  357. float: right;
  358. margin: 19px 61px 0 0;
  359. li {
  360. margin-bottom: 20px;
  361. white-space: nowrap;
  362. &:nth-child(2) {
  363. margin-left: 10px;
  364. }
  365. &:nth-child(3) {
  366. margin-left: 29px;
  367. }
  368. }
  369. }
  370. }
  371. .fr {
  372. width: 504px;
  373. img {
  374. margin: 45px 0 0 62px;
  375. }
  376. div {
  377. float: right;
  378. margin-right: 140px;
  379. margin-top: 44px;
  380. text-align: center;
  381. p {
  382. margin-bottom: 29px;
  383. }
  384. a {
  385. display: inline-block;
  386. width: 124px;
  387. height: 32px;
  388. color: #fff;
  389. font-size: 14px;
  390. text-align: center;
  391. line-height: 32px;
  392. background: #ff8522;
  393. border-radius: 3px;
  394. cursor: pointer;
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. .com-del-box {
  402. text-align: center;
  403. -webkit-box-shadow: none;
  404. -moz-box-shadow: none;
  405. box-shadow: none;
  406. border-radius: 3px;
  407. > p {
  408. margin-top: 20px;
  409. margin-bottom: 10px;
  410. color: #5078cb;
  411. img {
  412. position: relative;
  413. bottom: 2px;
  414. margin-right: 8px;
  415. }
  416. }
  417. .result {
  418. color: #333;
  419. margin-bottom: 24px;
  420. }
  421. .remind {
  422. font-size: 12px;
  423. color: #666;
  424. span {
  425. color: #f40d0d;
  426. }
  427. }
  428. }
  429. .apply-record {
  430. position: fixed;
  431. top: 23%;
  432. left: 31%;
  433. z-index: 10;
  434. width: 577px;
  435. height: 239px;
  436. background: #fff;
  437. .title {
  438. height: 40px;
  439. line-height: 40px;
  440. text-align: center;
  441. font-size: 16px;
  442. color: #333;
  443. img {
  444. float: right;
  445. margin: 10px 11px 0 0;
  446. cursor: pointer;
  447. }
  448. }
  449. }
  450. .record-wrap {
  451. padding: 0 18px;
  452. .record-title {
  453. height: 28px;
  454. line-height: 28px;
  455. background: #8eb0f5;
  456. border: 1px solid #e8e8e8;
  457. color: #fff;
  458. }
  459. ul {
  460. max-height: 150px;
  461. overflow-y: auto;
  462. overflow-x: hidden;
  463. li {
  464. border-bottom: 1px solid #e8e8e8;
  465. height: 30px;
  466. &:nth-child(even) {
  467. background: #edf2fd;
  468. }
  469. &:nth-child(odd) {
  470. background: #f7f9fe;
  471. }
  472. span {
  473. line-height: 26px;
  474. position: relative;
  475. top: 2px;
  476. &.green-text {
  477. color: #379b1d;
  478. }
  479. &.red-text {
  480. color: #f51c24;
  481. }
  482. }
  483. }
  484. }
  485. span {
  486. overflow: hidden;
  487. text-overflow: ellipsis;
  488. white-space: nowrap;
  489. display: inline-block;
  490. text-align: center;
  491. &:nth-child(1) {
  492. width: 220px;
  493. padding: 0 10px 0 22px;
  494. }
  495. &:nth-child(2) {
  496. width: 68px;
  497. }
  498. &:nth-child(3) {
  499. width: 165px;
  500. }
  501. &:nth-child(4) {
  502. width: 82px;
  503. }
  504. }
  505. }
  506. }
  507. </style>