PersonalMaterial.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  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. }
  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. }
  203. .personal-material-header {
  204. height: 111px;
  205. line-height: 111px;
  206. border: 1px solid #ebeaea;
  207. position: relative;
  208. margin-bottom: 19px;
  209. p {
  210. color: #5078cb;
  211. font-size: 22px;
  212. text-align: center;
  213. i {
  214. margin-right: 20px;
  215. }
  216. }
  217. a {
  218. position: absolute;
  219. right: 11px;
  220. bottom: 14px;
  221. display: inline-block;
  222. line-height: normal;
  223. }
  224. }
  225. .personal-material-content {
  226. border: 1px solid #ebeaea;
  227. margin-bottom: 147px;
  228. padding: 0 95px;
  229. > div {
  230. padding: 0 50px;
  231. border-radius: 3px;
  232. > p {
  233. height: 81px;
  234. line-height: 81px;
  235. font-size: 16px;
  236. font-weight: bold;
  237. img {
  238. margin-right: 4px;
  239. }
  240. }
  241. }
  242. .is-open-store {
  243. padding-bottom: 29px;
  244. border-bottom: 1px solid #d5d5d5;
  245. > div {
  246. min-height: 140px;
  247. border: 1px solid #5078cb;
  248. > p {
  249. font-weight: bold;
  250. font-size: 18px;
  251. margin: 26px 0;
  252. text-align: center;
  253. }
  254. .search-content {
  255. text-align: center;
  256. input {
  257. width: 290px;
  258. display: inline-block;
  259. height: 30px;
  260. border: {
  261. top-left-radius: 3px;
  262. bottom-left-radius: 3px;
  263. top-right-radius: 0;
  264. bottom-right-radius: 0;
  265. }
  266. border-top-left-radius: 3px;
  267. border-bottom-left-radius: 3px;
  268. border: 1px solid #cdcdcd;
  269. margin-left: 10px;
  270. }
  271. span {
  272. display: inline-block;
  273. width: 87px;
  274. height: 30px;
  275. line-height: 31px;
  276. text-align: center;
  277. color: #fff;
  278. background: #5078cb;
  279. margin-left: -1px;
  280. border-top-right-radius: 3px;
  281. border-bottom-right-radius: 3px;
  282. cursor: pointer;
  283. }
  284. }
  285. .result-content {
  286. padding: 0 0 0 221px;
  287. p {
  288. height: 41px;
  289. line-height: 41px;
  290. font-size: 16px;
  291. font-weight: bold;
  292. margin: 24px 0 0 0;
  293. width: 376px;
  294. border-bottom: 1px solid #e6e5e4;
  295. padding-left: 8px;
  296. }
  297. .result-text {
  298. padding-left: 8px;
  299. span {
  300. &:first-child {
  301. display: inline-block;
  302. width: 111px;
  303. color: #666;
  304. }
  305. }
  306. &:first-of-type {
  307. margin: 15px 0 21px 0;
  308. }
  309. }
  310. > a {
  311. display: inline-block;
  312. width: 201px;
  313. height: 40px;
  314. line-height: 40px;
  315. text-align: center;
  316. border-radius: 3px;
  317. background: #5078cb;
  318. color: #fff;
  319. margin: 37px 0 16px 130px;
  320. }
  321. .result-remind {
  322. margin: 0 0 18px 146px;
  323. color: #666;
  324. }
  325. }
  326. .no-result-content {
  327. font-size: 16px;
  328. margin: 26px 0 38px 220px;
  329. text-align: left;
  330. span {
  331. color: #f00707;
  332. font-weight: normal;
  333. }
  334. }
  335. }
  336. }
  337. .not-open-store {
  338. margin-bottom: 62px;
  339. > div {
  340. height: 171px;
  341. border: 1px solid #ff8522;
  342. .fl {
  343. list-style: inside;
  344. color: #ff8522;
  345. height: 130px;
  346. width: 391px;
  347. margin-top: 25px;
  348. border-right: 1px dashed #fce3cf;
  349. img {
  350. margin: 11px 0 0 16px;
  351. }
  352. ul {
  353. list-style: inside;
  354. color: #ff8522;
  355. float: right;
  356. margin: 19px 61px 0 0;
  357. li {
  358. margin-bottom: 20px;
  359. white-space: nowrap;
  360. &:nth-child(2) {
  361. margin-left: 10px;
  362. }
  363. &:nth-child(3) {
  364. margin-left: 29px;
  365. }
  366. }
  367. }
  368. }
  369. .fr {
  370. width: 504px;
  371. img {
  372. margin: 45px 0 0 62px;
  373. }
  374. div {
  375. float: right;
  376. margin-right: 140px;
  377. margin-top: 44px;
  378. text-align: center;
  379. p {
  380. margin-bottom: 29px;
  381. }
  382. a {
  383. display: inline-block;
  384. width: 124px;
  385. height: 32px;
  386. color: #fff;
  387. font-size: 14px;
  388. text-align: center;
  389. line-height: 32px;
  390. background: #ff8522;
  391. border-radius: 3px;
  392. cursor: pointer;
  393. }
  394. }
  395. }
  396. }
  397. }
  398. }
  399. .com-del-box {
  400. text-align: center;
  401. -webkit-box-shadow: none;
  402. -moz-box-shadow: none;
  403. box-shadow: none;
  404. border-radius: 3px;
  405. > p {
  406. margin-top: 20px;
  407. margin-bottom: 10px;
  408. color: #5078cb;
  409. img {
  410. position: relative;
  411. bottom: 2px;
  412. margin-right: 8px;
  413. }
  414. }
  415. .result {
  416. color: #333;
  417. margin-bottom: 24px;
  418. }
  419. .remind {
  420. font-size: 12px;
  421. color: #666;
  422. span {
  423. color: #f40d0d;
  424. }
  425. }
  426. }
  427. .apply-record {
  428. position: fixed;
  429. top: 23%;
  430. left: 31%;
  431. z-index: 102;
  432. width: 577px;
  433. height: 239px;
  434. background: #fff;
  435. .title {
  436. height: 40px;
  437. line-height: 40px;
  438. text-align: center;
  439. font-size: 16px;
  440. color: #333;
  441. img {
  442. float: right;
  443. margin: 10px 11px 0 0;
  444. cursor: pointer;
  445. }
  446. }
  447. }
  448. .record-wrap {
  449. padding: 0 18px;
  450. .record-title {
  451. height: 28px;
  452. line-height: 28px;
  453. background: #8eb0f5;
  454. border: 1px solid #e8e8e8;
  455. color: #fff;
  456. }
  457. ul {
  458. max-height: 150px;
  459. overflow-y: auto;
  460. overflow-x: hidden;
  461. li {
  462. border-bottom: 1px solid #e8e8e8;
  463. height: 30px;
  464. &:nth-child(even) {
  465. background: #edf2fd;
  466. }
  467. &:nth-child(odd) {
  468. background: #f7f9fe;
  469. }
  470. span {
  471. line-height: 26px;
  472. position: relative;
  473. top: 2px;
  474. &.green-text {
  475. color: #379b1d;
  476. }
  477. &.red-text {
  478. color: #f51c24;
  479. }
  480. }
  481. }
  482. }
  483. span {
  484. overflow: hidden;
  485. text-overflow: ellipsis;
  486. white-space: nowrap;
  487. display: inline-block;
  488. text-align: center;
  489. &:nth-child(1) {
  490. width: 220px;
  491. padding: 0 10px 0 22px;
  492. }
  493. &:nth-child(2) {
  494. width: 68px;
  495. }
  496. &:nth-child(3) {
  497. width: 165px;
  498. }
  499. &:nth-child(4) {
  500. width: 82px;
  501. }
  502. }
  503. }
  504. }
  505. </style>