PersonalMaterial.vue 14 KB

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