bindEnterprise.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <div class="mobile-fix-content mobile-center" v-if="!showInfo">
  3. <div class="block-wrap seek-operation">
  4. <div class="block-wrap_moreinfo">抱歉,您的账户未绑定企业,暂无卖家权限</div>
  5. <div class="block-wrap_morelist" @click="setShowApplyRecord(true)">查看申请记录</div>
  6. </div>
  7. <div class="block-wrap seek-operation">
  8. <p><i></i>所属企业已开店</p>
  9. <div class="search-wrap">
  10. <span>企业全称:</span>
  11. <input type="text" class="form-control" v-model="keyword" placeholder="请输入企业全称" @keyup.13="onSearchEnterprise">
  12. <i class="inline-block" @click="onSearchEnterprise">检测</i>
  13. </div>
  14. <div class="result">
  15. <template v-if="showSearchResultStatus === 1">
  16. <p><span class="title inline-block">管理员:</span><span class="content inline-block">{{enInfo.name}}</span></p>
  17. <p><span class="title inline-block">营业执照号:</span><span class="content inline-block">{{enInfo.businessCode}}</span></p>
  18. </template>
  19. <template v-if="showSearchResultStatus === 2">
  20. <p class="no-open">{{enName}}<span>(未开店)</span></p>
  21. </template>
  22. </div>
  23. </div>
  24. <div class="operation" v-show="showSearchResultStatus !== 0">
  25. <template v-if="showSearchResultStatus === 1">
  26. <a @click="bindEnterprise">提交申请</a>
  27. <p>管理员审核通过后成功绑定</p>
  28. </template>
  29. <template v-if="showSearchResultStatus === 2">
  30. <a>开设新店铺</a>
  31. </template>
  32. </div>
  33. <div class="block-wrap seek-operation" v-if="!showInfo">
  34. <p><i></i>所属企业未开店</p>
  35. <div class="clearfix block-storeinfo">
  36. <div class="pull-left">
  37. <img src="/images/material/house.png"/>
  38. </div>
  39. <div class="pull-right">
  40. <div class="pull-left-info">请点击下方按钮开设新的店铺</div>
  41. <nuxt-link class="pull-left-btn" tag="div" to="/mobile/store">开设新店铺</nuxt-link>
  42. </div>
  43. </div>
  44. </div>
  45. <remind-box :title="remindText" :timeoutCount="remindTimerCount"></remind-box>
  46. <div class="mobile-modal" v-show="showApplyRecord">
  47. <div class="mobile-modal-box">
  48. <div class="mobile-modal-header">申请记录<i class="icon-guanbi iconfont" @click="setShowApplyRecord(false)"></i></div>
  49. <div class="mobile-modal-headerjilu" ref="mobileModalBox">
  50. <div>
  51. <div class="record-wrap">
  52. <div class="record-title">
  53. <span>企业名称</span>
  54. <span>管理员</span>
  55. <span>申请时间</span>
  56. <span>状态</span>
  57. </div>
  58. <ul>
  59. <li v-for="item in applyList">
  60. <span>{{item.enName}}</span>
  61. <span>{{item.adminName}}</span>
  62. <span>{{item.date | date}}</span>
  63. <span :class="{'green-text': item.status === 311, 'red-text': item.status === 317}">{{item.status | status}}</span>
  64. </li>
  65. </ul>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import { RemindBox } from '~components/mobile/common'
  75. export default {
  76. layout: 'mobile',
  77. props: {
  78. showInfo: {
  79. default: true
  80. }
  81. },
  82. middleware: 'authenticated',
  83. data () {
  84. return {
  85. applyList: [],
  86. showApplyRecord: false,
  87. keyword: '',
  88. enInfo: {},
  89. remindText: '',
  90. remindTimerCount: 0,
  91. enName: '',
  92. showSearchResultStatus: 0
  93. }
  94. },
  95. components: {
  96. RemindBox
  97. },
  98. mounted() {
  99. let keyword = this.$route.query.name || ''
  100. let businessCode = this.$route.query.businessCode || ''
  101. let showStatus = parseInt(this.$route.query.showStatus) || ''
  102. this.keyword = keyword
  103. this.enInfo.name = keyword
  104. this.enInfo.businessCode = businessCode
  105. this.showSearchResultStatus = showStatus
  106. this.$nextTick(() => {
  107. // document.addEventListener('click', this.checkCurrencySelect)
  108. this._initscroll()
  109. })
  110. },
  111. methods: {
  112. setShowApplyRecord: function (flag) {
  113. if (flag) {
  114. this.$http.get('/basic/enterprise/findApplyInfo', {params: {phone: this.user.data.userTel}})
  115. .then(responses => {
  116. this.applyList = responses.data
  117. this.showApplyRecord = flag
  118. this._initscroll()
  119. }, err => {
  120. console.log(err)
  121. this.$message.error('系统错误')
  122. })
  123. } else {
  124. this.showApplyRecord = flag
  125. }
  126. },
  127. onSearchEnterprise: function () {
  128. if (this.keyword) {
  129. this.$http.get('/basic/enterprise/findByName/' + encodeURIComponent(this.keyword)).then(response => {
  130. if (response.data) {
  131. this.enInfo = response.data
  132. this.showSearchResultStatus = 1
  133. } else {
  134. this.enName = this.keyword
  135. this.showSearchResultStatus = 2
  136. }
  137. })
  138. }
  139. },
  140. bindEnterprise: function () {
  141. this.$http.get('/basic/enterprise/applyUserSpace', {params: {phone: this.user.data.userTel, enName: this.enInfo.name, businessCode: this.enInfo.businessCode}})
  142. .then(response => {
  143. if (response.data.data === 'success') {
  144. this.keyword = ''
  145. this.showSearchResultStatus = 0
  146. this.setRemindText('绑定申请提交成功!审批结果将以短信通知,请保持手机通畅。')
  147. setTimeout(() => {
  148. this.$router.push('/mobile/user')
  149. }, 3000)
  150. } else {
  151. this.setRemindText(response.data.data)
  152. }
  153. }, err => {
  154. console.log(err)
  155. this.setRemindText('系统错误')
  156. })
  157. },
  158. setRemindText: function (str) {
  159. this.remindText = str
  160. this.remindTimerCount++
  161. }
  162. },
  163. filters: {
  164. status: function (status) {
  165. switch (status) {
  166. case 311:
  167. return '待审核'
  168. case 316:
  169. return '已通过'
  170. case 317:
  171. return '未通过'
  172. default:
  173. break
  174. }
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="scss" scoped>
  180. @import '~assets/scss/mobileCenter';
  181. $input-height: .58rem;
  182. $base-color: #3f84f6;
  183. .mobile-center {
  184. .seek-operation {
  185. height: auto;
  186. padding-bottom: .59rem;
  187. }
  188. .search-wrap {
  189. padding-top: .48rem;
  190. padding-left: .12rem;
  191. span {
  192. font-size: .28rem;
  193. color: $base-color;
  194. }
  195. input {
  196. width: 4.2rem;
  197. height: $input-height;
  198. font-size: .23rem;
  199. border: 1px solid $base-color;
  200. border-radius: 0;
  201. border-bottom-left-radius: .14rem;
  202. border-top-left-radius: .14rem;
  203. }
  204. i {
  205. width: .85rem;
  206. height: $input-height;
  207. line-height: $input-height;
  208. text-align: center;
  209. color: #fff;
  210. font-size: .26rem;
  211. margin-left: -.01rem;
  212. background: $base-color;
  213. font-style: normal;
  214. vertical-align: baseline;
  215. margin-top: .01rem;
  216. border-bottom-right-radius: .14rem;
  217. border-top-right-radius: .14rem;
  218. }
  219. }
  220. .result {
  221. color: $base-color;
  222. font-size: .28rem;
  223. margin-top: .52rem;
  224. p {
  225. padding-left: 1rem;
  226. .title {
  227. width: 1.68rem;
  228. text-align: right;
  229. vertical-align: top;
  230. }
  231. .content {
  232. color: rgba(102, 102, 102, .89);
  233. margin-left: .4rem;
  234. width: 3.5rem;
  235. word-break: break-all;
  236. }
  237. }
  238. .no-open {
  239. text-align: center;
  240. color: rgba(102, 102, 102, .89);
  241. span {
  242. color: rgba(255, 0, 0, .89);
  243. }
  244. }
  245. }
  246. .operation {
  247. text-align: center;
  248. font-size: .32rem;
  249. a {
  250. display: block;
  251. width: 6.59rem;
  252. height: .77rem;
  253. line-height: .77rem;
  254. text-align: center;
  255. color: #fff;
  256. background: $base-color;
  257. margin: .58rem auto .27rem;
  258. border-radius: .08rem;
  259. }
  260. span {
  261. color: rgba(51, 51, 51, .89);
  262. }
  263. }
  264. .block-storeinfo {
  265. margin: 0.48rem 0.2rem 0;
  266. padding-bottom: 0.2rem;
  267. img {
  268. width: 2.18rem;
  269. height: 1.73rem;
  270. }
  271. .pull-left-info {
  272. font-size: 0.28rem;
  273. color: #3f84f6;
  274. }
  275. .pull-left-btn {
  276. color: #fff;
  277. font-size: 0.32rem;
  278. width: 3.1rem;
  279. height: 0.58rem;
  280. text-align: center;
  281. line-height: 0.58rem;
  282. border-radius: 5px;
  283. background: #3f84f6;
  284. margin-top: 0.3rem;
  285. }
  286. }
  287. .block-wrap_moreinfo {
  288. font-size: 0.34rem;
  289. color: #333;
  290. text-align: center;
  291. padding-top: 0.4rem;
  292. margin-bottom: 0.2rem;
  293. }
  294. .block-wrap_morelist {
  295. color: #3f84f6;
  296. font-size: 0.32rem;
  297. border: 0.01rem solid #3f84f6;
  298. text-align: center;
  299. width: 3.1rem;
  300. height: 0.58rem;
  301. line-height: 0.58rem;
  302. border-radius: 5px;
  303. margin: 0 auto;
  304. }
  305. .mobile-modal-box {
  306. top: 1.66rem;
  307. left: 3%;
  308. right: 3%;
  309. width: 7rem;
  310. bottom: 1.66rem;
  311. margin: 0 auto;
  312. }
  313. .mobile-modal-headerjilu {
  314. background: #f3f3f3;
  315. padding: .18rem 0;
  316. width: 100%;
  317. overflow: hidden;
  318. height: 90%;
  319. .record-wrap {
  320. padding: 0 .18rem;
  321. .record-title {
  322. height: 28px;
  323. line-height: 28px;
  324. background: #8eb0f5;
  325. border: 1px solid #e8e8e8;
  326. color: #fff;
  327. }
  328. ul {
  329. max-height: 150px;
  330. overflow-y: auto;
  331. overflow-x: hidden;
  332. li {
  333. border-bottom: 1px solid #e8e8e8;
  334. height: 30px;
  335. &:nth-child(even) {
  336. background: #edf2fd;
  337. }
  338. &:nth-child(odd) {
  339. background: #f7f9fe;
  340. }
  341. span {
  342. line-height: 26px;
  343. position: relative;
  344. top: 2px;
  345. &.green-text {
  346. color: #379b1d;
  347. }
  348. &.red-text {
  349. color: #f51c24;
  350. }
  351. }
  352. }
  353. }
  354. span {
  355. overflow: hidden;
  356. text-overflow: ellipsis;
  357. white-space: nowrap;
  358. display: inline-block;
  359. text-align: center;
  360. &:nth-child(1) {
  361. width: 2.6rem;
  362. }
  363. &:nth-child(2) {
  364. width: 1.1rem;
  365. }
  366. &:nth-child(3) {
  367. width: 1.84rem;
  368. }
  369. &:nth-child(4) {
  370. width: 1.04rem;
  371. }
  372. }
  373. }
  374. }
  375. }
  376. </style>