PersonalMaterial.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  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. onSearchEnterprise: function () {
  130. if (this.keyword) {
  131. this.$http.get('/basic/enterprise/findByName/' + encodeURIComponent(this.keyword)).then(response => {
  132. if (response.data) {
  133. this.enInfo = response.data
  134. this.showSearchResultStatus = 1
  135. } else {
  136. this.enName = this.keyword
  137. this.showSearchResultStatus = 2
  138. }
  139. })
  140. }
  141. },
  142. bindEnterprise: function () {
  143. this.$http.get('/basic/enterprise/applyUserSpace', {params: {phone: this.user.data.userTel, enName: this.enInfo.name, businessCode: this.enInfo.businessCode}})
  144. .then(response => {
  145. if (response.data.data === 'success') {
  146. this.showSearchResultStatus = 0
  147. this.keyword = ''
  148. this.showRemindBox = true
  149. this.startInterval()
  150. } else {
  151. this.$message.error(response.data.data)
  152. }
  153. }, err => {
  154. console.log(err)
  155. this.$message.error('系统错误')
  156. })
  157. },
  158. startInterval: function () {
  159. this.timer = 5
  160. let _this = this
  161. let interval = setInterval(() => {
  162. _this.timer --
  163. if (_this.timer === 0) {
  164. clearInterval(interval)
  165. this.showRemindBox = false
  166. this.goLastPage()
  167. }
  168. }, 1000)
  169. },
  170. setShowApplyRecord: function (flag) {
  171. if (flag) {
  172. this.$http.get('/basic/enterprise/findApplyInfo', {params: {phone: this.user.data.userTel}})
  173. .then(responses => {
  174. this.applyList = responses.data
  175. this.showApplyRecord = flag
  176. }, err => {
  177. console.log(err)
  178. this.$message.error('系统错误')
  179. })
  180. } else {
  181. this.showApplyRecord = flag
  182. }
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang="scss" scoped>
  188. .com-del-box {
  189. z-index: 100;
  190. margin: -155px 0 0 -155px
  191. }
  192. .personal-material {
  193. width: 1190px;
  194. margin: 0 auto;
  195. p {
  196. margin: 0;
  197. }
  198. a {
  199. color: #5078cb;
  200. }
  201. > a {
  202. line-height: 71px;
  203. }
  204. .personal-material-header {
  205. height: 111px;
  206. line-height: 111px;
  207. border: 1px solid #ebeaea;
  208. position: relative;
  209. margin-bottom: 19px;
  210. p {
  211. color: #5078cb;
  212. font-size: 22px;
  213. text-align: center;
  214. i {
  215. margin-right: 20px;
  216. }
  217. }
  218. a {
  219. position: absolute;
  220. right: 11px;
  221. bottom: 14px;
  222. display: inline-block;
  223. line-height: normal;
  224. }
  225. }
  226. .personal-material-content {
  227. border: 1px solid #ebeaea;
  228. margin-bottom: 147px;
  229. padding: 0 95px;
  230. > div {
  231. padding: 0 50px;
  232. border-radius: 3px;
  233. > p {
  234. height: 81px;
  235. line-height: 81px;
  236. font-size: 16px;
  237. font-weight: bold;
  238. img {
  239. margin-right: 4px;
  240. }
  241. }
  242. }
  243. .is-open-store {
  244. padding-bottom: 29px;
  245. border-bottom: 1px solid #d5d5d5;
  246. > div {
  247. min-height: 140px;
  248. border: 1px solid #5078cb;
  249. > p {
  250. font-weight: bold;
  251. font-size: 18px;
  252. margin: 26px 0;
  253. text-align: center;
  254. }
  255. .search-content {
  256. text-align: center;
  257. input {
  258. width: 290px;
  259. display: inline-block;
  260. height: 30px;
  261. border: {
  262. top-left-radius: 3px;
  263. bottom-left-radius: 3px;
  264. top-right-radius: 0;
  265. bottom-right-radius: 0;
  266. }
  267. border-top-left-radius: 3px;
  268. border-bottom-left-radius: 3px;
  269. border: 1px solid #cdcdcd;
  270. margin-left: 10px;
  271. }
  272. span {
  273. display: inline-block;
  274. width: 87px;
  275. height: 30px;
  276. line-height: 31px;
  277. text-align: center;
  278. color: #fff;
  279. background: #5078cb;
  280. margin-left: -1px;
  281. border-top-right-radius: 3px;
  282. border-bottom-right-radius: 3px;
  283. cursor: pointer;
  284. }
  285. }
  286. .result-content {
  287. padding: 0 0 0 221px;
  288. p {
  289. height: 41px;
  290. line-height: 41px;
  291. font-size: 16px;
  292. font-weight: bold;
  293. margin: 24px 0 0 0;
  294. width: 376px;
  295. border-bottom: 1px solid #e6e5e4;
  296. padding-left: 8px;
  297. }
  298. .result-text {
  299. padding-left: 8px;
  300. span {
  301. &:first-child {
  302. display: inline-block;
  303. width: 111px;
  304. color: #666;
  305. }
  306. }
  307. &:first-of-type {
  308. margin: 15px 0 21px 0;
  309. }
  310. }
  311. > a {
  312. display: inline-block;
  313. width: 201px;
  314. height: 40px;
  315. line-height: 40px;
  316. text-align: center;
  317. border-radius: 3px;
  318. background: #5078cb;
  319. color: #fff;
  320. margin: 37px 0 16px 130px;
  321. }
  322. .result-remind {
  323. margin: 0 0 18px 146px;
  324. color: #666;
  325. }
  326. }
  327. .no-result-content {
  328. font-size: 16px;
  329. margin: 26px 0 38px 220px;
  330. text-align: left;
  331. span {
  332. color: #f00707;
  333. font-weight: normal;
  334. }
  335. }
  336. }
  337. }
  338. .not-open-store {
  339. margin-bottom: 62px;
  340. > div {
  341. height: 171px;
  342. border: 1px solid #ff8522;
  343. .fl {
  344. list-style: inside;
  345. color: #ff8522;
  346. height: 130px;
  347. width: 391px;
  348. margin-top: 25px;
  349. border-right: 1px dashed #fce3cf;
  350. img {
  351. margin: 11px 0 0 16px;
  352. }
  353. ul {
  354. list-style: inside;
  355. color: #ff8522;
  356. float: right;
  357. margin: 19px 61px 0 0;
  358. li {
  359. margin-bottom: 20px;
  360. white-space: nowrap;
  361. &:nth-child(2) {
  362. margin-left: 10px;
  363. }
  364. &:nth-child(3) {
  365. margin-left: 29px;
  366. }
  367. }
  368. }
  369. }
  370. .fr {
  371. width: 504px;
  372. img {
  373. margin: 45px 0 0 62px;
  374. }
  375. div {
  376. float: right;
  377. margin-right: 140px;
  378. margin-top: 44px;
  379. text-align: center;
  380. p {
  381. margin-bottom: 29px;
  382. }
  383. a {
  384. display: inline-block;
  385. width: 124px;
  386. height: 32px;
  387. color: #fff;
  388. font-size: 14px;
  389. text-align: center;
  390. line-height: 32px;
  391. background: #ff8522;
  392. border-radius: 3px;
  393. cursor: pointer;
  394. }
  395. }
  396. }
  397. }
  398. }
  399. }
  400. .com-del-box {
  401. text-align: center;
  402. -webkit-box-shadow: none;
  403. -moz-box-shadow: none;
  404. box-shadow: none;
  405. border-radius: 3px;
  406. > p {
  407. margin-top: 20px;
  408. margin-bottom: 10px;
  409. color: #5078cb;
  410. img {
  411. position: relative;
  412. bottom: 2px;
  413. margin-right: 8px;
  414. }
  415. }
  416. .result {
  417. color: #333;
  418. margin-bottom: 24px;
  419. }
  420. .remind {
  421. font-size: 12px;
  422. color: #666;
  423. span {
  424. color: #f40d0d;
  425. }
  426. }
  427. }
  428. .apply-record {
  429. position: fixed;
  430. top: 23%;
  431. left: 31%;
  432. z-index: 102;
  433. width: 577px;
  434. height: 239px;
  435. background: #fff;
  436. .title {
  437. height: 40px;
  438. line-height: 40px;
  439. text-align: center;
  440. font-size: 16px;
  441. color: #333;
  442. img {
  443. float: right;
  444. margin: 10px 11px 0 0;
  445. cursor: pointer;
  446. }
  447. }
  448. }
  449. .record-wrap {
  450. padding: 0 18px;
  451. .record-title {
  452. height: 28px;
  453. line-height: 28px;
  454. background: #8eb0f5;
  455. border: 1px solid #e8e8e8;
  456. color: #fff;
  457. }
  458. ul {
  459. max-height: 150px;
  460. overflow-y: auto;
  461. overflow-x: hidden;
  462. li {
  463. border-bottom: 1px solid #e8e8e8;
  464. height: 30px;
  465. &:nth-child(even) {
  466. background: #edf2fd;
  467. }
  468. &:nth-child(odd) {
  469. background: #f7f9fe;
  470. }
  471. span {
  472. line-height: 26px;
  473. position: relative;
  474. top: 2px;
  475. &.green-text {
  476. color: #379b1d;
  477. }
  478. &.red-text {
  479. color: #f51c24;
  480. }
  481. }
  482. }
  483. }
  484. span {
  485. overflow: hidden;
  486. text-overflow: ellipsis;
  487. white-space: nowrap;
  488. display: inline-block;
  489. text-align: center;
  490. &:nth-child(1) {
  491. width: 220px;
  492. padding: 0 10px 0 22px;
  493. }
  494. &:nth-child(2) {
  495. width: 68px;
  496. }
  497. &:nth-child(3) {
  498. width: 165px;
  499. }
  500. &:nth-child(4) {
  501. width: 82px;
  502. }
  503. }
  504. }
  505. }
  506. </style>