bindEnterprise.vue 11 KB

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