bindEnterprise.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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 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. font-size: .23rem;
  200. border: 1px solid $base-color;
  201. border-radius: 0;
  202. border-bottom-left-radius: .14rem;
  203. border-top-left-radius: .14rem;
  204. }
  205. i {
  206. width: .85rem;
  207. height: $input-height;
  208. line-height: $input-height;
  209. text-align: center;
  210. color: #fff;
  211. font-size: .26rem;
  212. margin-left: -.01rem;
  213. background: $base-color;
  214. font-style: normal;
  215. vertical-align: baseline;
  216. margin-top: .01rem;
  217. border-bottom-right-radius: .14rem;
  218. border-top-right-radius: .14rem;
  219. }
  220. }
  221. .result {
  222. color: $base-color;
  223. font-size: .28rem;
  224. margin-top: .52rem;
  225. p {
  226. padding-left: 1rem;
  227. .title {
  228. width: 1.68rem;
  229. text-align: right;
  230. vertical-align: top;
  231. }
  232. .content {
  233. color: rgba(102, 102, 102, .89);
  234. margin-left: .4rem;
  235. width: 3.5rem;
  236. word-break: break-all;
  237. }
  238. }
  239. .no-open {
  240. text-align: center;
  241. color: rgba(102, 102, 102, .89);
  242. span {
  243. color: rgba(255, 0, 0, .89);
  244. }
  245. }
  246. }
  247. .operation {
  248. text-align: center;
  249. font-size: .32rem;
  250. a {
  251. display: block;
  252. width: 6.59rem;
  253. height: .77rem;
  254. line-height: .77rem;
  255. text-align: center;
  256. color: #fff;
  257. background: $base-color;
  258. margin: .58rem auto .27rem;
  259. border-radius: .08rem;
  260. }
  261. span {
  262. color: rgba(51, 51, 51, .89);
  263. }
  264. }
  265. .block-storeinfo {
  266. margin: 0.48rem 0.2rem 0;
  267. padding-bottom: 0.2rem;
  268. img {
  269. width: 2.18rem;
  270. height: 1.73rem;
  271. }
  272. .pull-left-info {
  273. font-size: 0.28rem;
  274. color: #3f84f6;
  275. }
  276. .pull-left-btn {
  277. color: #fff;
  278. font-size: 0.32rem;
  279. width: 3.1rem;
  280. height: 0.58rem;
  281. text-align: center;
  282. line-height: 0.58rem;
  283. border-radius: 5px;
  284. background: #3f84f6;
  285. margin-top: 0.3rem;
  286. }
  287. }
  288. .block-wrap_moreinfo {
  289. font-size: 0.34rem;
  290. color: #333;
  291. text-align: center;
  292. padding-top: 0.4rem;
  293. margin-bottom: 0.2rem;
  294. }
  295. .block-wrap_morelist {
  296. color: #3f84f6;
  297. font-size: 0.32rem;
  298. border: 0.01rem solid #3f84f6;
  299. text-align: center;
  300. width: 3.1rem;
  301. height: 0.58rem;
  302. line-height: 0.58rem;
  303. border-radius: 5px;
  304. margin: 0 auto;
  305. }
  306. .mobile-modal-box {
  307. top: 1.66rem;
  308. left: 3%;
  309. right: 3%;
  310. width: 7rem;
  311. bottom: 1.66rem;
  312. margin: 0 auto;
  313. }
  314. .mobile-modal-headerjilu {
  315. background: #f3f3f3;
  316. padding: .18rem 0;
  317. width: 100%;
  318. overflow: hidden;
  319. height: 90%;
  320. .record-wrap {
  321. font-size: 0.28rem;
  322. padding: 0 .18rem;
  323. .record-title {
  324. height: 28px;
  325. line-height: 28px;
  326. background: #8eb0f5;
  327. border: 1px solid #e8e8e8;
  328. color: #fff;
  329. }
  330. ul {
  331. li {
  332. border-bottom: 1px solid #e8e8e8;
  333. height: 30px;
  334. &:nth-child(even) {
  335. background: #edf2fd;
  336. }
  337. &:nth-child(odd) {
  338. background: #f7f9fe;
  339. }
  340. span {
  341. line-height: 26px;
  342. position: relative;
  343. top: 2px;
  344. &.green-text {
  345. color: #379b1d;
  346. }
  347. &.red-text {
  348. color: #f51c24;
  349. }
  350. }
  351. }
  352. }
  353. span {
  354. overflow: hidden;
  355. text-overflow: ellipsis;
  356. white-space: nowrap;
  357. display: inline-block;
  358. text-align: center;
  359. &:nth-child(1) {
  360. width: 2.6rem;
  361. }
  362. &:nth-child(2) {
  363. width: 1.1rem;
  364. }
  365. &:nth-child(3) {
  366. width: 1.84rem;
  367. }
  368. &:nth-child(4) {
  369. width: 1.04rem;
  370. }
  371. }
  372. }
  373. }
  374. }
  375. </style>