index.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
  1. <template>
  2. <div class="user-content mobile-content">
  3. <div class="user-name">
  4. <img src="/images/component/default.png"/>
  5. <div class="user-info">
  6. <p v-text="userInfo.data.userName"></p>
  7. <p>{{enterpriseInfo.enName}}<a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a></p>
  8. <ul class="en-list" v-show="showEnterpriseToggle">
  9. <li class="menu-item"
  10. v-for="en in sortEnterprises"
  11. v-if="en.uu != enterpriseInfo.uu"
  12. v-bind:key="en.uu">
  13. <a @click="switchEnterprise(en)">{{ en.enName }}</a>
  14. </li>
  15. <li class="menu-item" v-if="enterpriseInfo.uu">
  16. <a @click="switchEnterprise({uu: 0})"><span v-text="userInfo.data.userName"></span>(个人账户)</a>
  17. </li>
  18. </ul>
  19. </div>
  20. <a v-if="isVendor" v-text="userType === 'saler' ? '切换至买家中心' : '切换至卖家中心'" @click="switchType"></a>
  21. </div>
  22. <ul class="switch-list" v-if="userType !== 'saler'">
  23. <li :class="{active: activeType == 'seek'}" @click="activeType = 'seek'" v-text="userType === 'saler' ? '求购询价' : '我的求购'"></li>
  24. <li :class="{active: activeType == 'comp'}" @click="activeType = 'comp'">器件收藏</li>
  25. <li :class="{active: activeType == 'store'}" @click="activeType = 'store'">店铺关注</li>
  26. </ul>
  27. <ul class="switch-list" v-if="userType !== 'buyer'">
  28. <li :class="{active: activeType == 'oppor'}" @click="activeType = 'oppor'">我的商机</li>
  29. <li :class="{active: activeType == 'provider'}" @click="activeType = 'provider'">产品管理</li>
  30. <li :class="{active: activeType == 'mystore'}" @click="activeType = 'mystore'">我的店铺</li>
  31. </ul>
  32. <!-- 买家中心 我的求购 -->
  33. <div v-if="activeType == 'seek' || activeType == 'oppor'">
  34. <div class="seek">
  35. <ul class="seek-type" v-if="userType !== 'saler'">
  36. <li :class="{active: seekType == 'wait'}" @click="switchSeek('wait')"><div>待报价</div></li>
  37. <li :class="{active: seekType == 'done'}" @click="switchSeek('done')"><div>已报价</div></li>
  38. <!--<li :class="{active: seekType == 'accept'}" @click="switchSeek('accept')"><div>已采纳</div></li>-->
  39. </ul>
  40. <ul class="seek-type" v-if="userType === 'saler'">
  41. <li :class="{active: seekType == 'wait'}" style="border-top: 0px" @click="switchSeek('wait')"><div>全部</div></li>
  42. <li :class="{active: seekType == 'done'}" style="border-top: 0px" @click="switchSeek('done')"><div>已报价</div></li>
  43. </ul>
  44. </div>
  45. <div class="search-content">
  46. <input type="text" placeholder="请输入您要查找的型号或品牌" v-model="seekKeyword" @keyup.13="searchSeek" ref="searchSeekInput" @focus="inputGetFocus()" @blur="blur()">
  47. <span @click="searchSeek" >
  48. <i class="iconfont icon-sousuo"></i>
  49. </span>
  50. </div>
  51. <seek-list :userType="userType" :seekType="seekType" :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
  52. </div>
  53. <!-- /end 买家中心 我的求购 -->
  54. <!-- 买家中心 店铺关注 -->
  55. <div class="shop-list" v-bind:key="item.id" v-if="activeType == 'store'" v-for="item in focusPage.content" @click="goStoreDetail(item.storeInfo.uuid)">
  56. <h3>{{item.storeName}}</h3>
  57. <div class="list-item">
  58. <div class="item-img">
  59. <img :src="getBackground(item.storeInfo.type)" />
  60. <img :src="item.storeInfo.logoUrl || '/images/component/default.png'">
  61. </div>
  62. <div class="list-item-phone">
  63. <p>电话:<span>{{item.storeInfo.enterprise ? item.storeInfo.enterprise.enTel : '-'}}</span></p>
  64. <p>传真:<span>{{item.storeInfo.enterprise ? item.storeInfo.enterprise.enFax : '-'}}</span></p>
  65. <p>联系商家:<a @click="selectStoreInfo(item, $event)">点击查看</a></p>
  66. <i class="iconfont icon-shoucang" @click="cancelFocus('store', item, $event)"></i>
  67. </div>
  68. </div>
  69. </div>
  70. <!-- /end 买家中心 店铺关注 -->
  71. <!-- 买家中心 器件收藏 -->
  72. <div class="detail-brand" v-bind:key="index" v-for="(item, index) in collectSave.content" v-if="activeType == 'comp'" @click="goComponentDetail(item.componentinfo.uuid)">
  73. <a>
  74. <div class="brand-item">
  75. <p>型号:<span>{{item.componentinfo.code}}</span></p>
  76. <p>品牌:<span>{{item.componentinfo.brand.nameCn}}</span></p>
  77. <p>产品描述:<span>{{item.componentinfo.kind.nameCn}}</span></p>
  78. <i class="iconfont icon-shoucang" @click="cancelFocus('product', item, $event)"></i>
  79. </div>
  80. </a>
  81. </div>
  82. <!--/end 买家中心 器件收藏 -->
  83. <!-- 卖家中心 我的店铺 -->
  84. <div v-if="activeType == 'mystore'" class="mystore">
  85. <div ></div>
  86. </div>
  87. <!-- /end 卖家中心 我的店铺 -->
  88. <!-- 卖家中心 产品管理 -->
  89. <div v-if="activeType == 'provider'" class="provider">
  90. <div class="seek">
  91. <ul class="seek-type" >
  92. <li :class="{active: providerType == 'enterprise'}" style="width: 33.3%" @click="switchprovide('enterprise')"><div>企业产品库</div></li>
  93. <li :class="{active: providerType == 'person'}" style="width: 33.3%" @click="switchprovide('person')"><div>个人产品库</div></li>
  94. <li :class="{active: providerType == 'onLine'}" style="width: 33.3%" @click="switchprovide('onLine')"><div>在售产品</div></li>
  95. </ul>
  96. </div>
  97. <div class="search-content" style="border-bottom: 1px solid #f5f5f5;padding-bottom: 0.25rem">
  98. <input type="text" placeholder="请输入您要查找的型号或品牌" v-model="seekKeyword" @keyup.13="searchSeek" ref="searchSeekInput" @focus="inputGetFocus()" @blur="blur()">
  99. <span @click="searchSeek" >
  100. <i class="iconfont icon-sousuo"></i>
  101. </span>
  102. </div>
  103. <div v-bind:key="index" v-for="(item, index) in GetEnterpriseListData" class="providerList">
  104. <div v-if="providerType !== 'onLine'">
  105. <div class="top">
  106. <div class="icon" :class="item.standard ? 'standed' : 'istanded'"></div>
  107. <div class="text">
  108. {{item.pcmpcode}}
  109. </div>
  110. </div>
  111. <div class="content">
  112. <div class="fl">
  113. <div class="linetext">类目(产品名称):{{item.kinden || '-'}}</div>
  114. <div class="linetext">品牌:{{item.pbranden}}</div>
  115. <div class="linetext">单位:PCS</div>
  116. </div>
  117. <div class="fr" :class="providerType == 'enterprise' && item.batchCount > 0 ? '' : 'addtop'" >
  118. <div class="look" v-if="item.batchCount && providerType == 'enterprise'">查看产品</div>
  119. <div class="add" v-if="providerType == 'enterprise'">加入个人产品</div>
  120. <div class="delete" v-if="providerType == 'person'">删除</div>
  121. </div>
  122. </div>
  123. </div>
  124. <div v-else>
  125. <div class="top top2">
  126. <div class="icon" :class="item.standard ? 'standed' : 'istanded'"></div>
  127. <div class="text">
  128. {{item.code}}
  129. </div>
  130. <div class="pms">
  131. <!--{{(storeInfo.uuid != 'undefind' && item.storeid == storeInfo.uuid && storeInfo.storeName.indexOf('优软测试二') < 0 && storeInfo.storeName.indexOf('优软商城') < 0) ? '自营' : '寄售'}}-->
  132. </div>
  133. </div>
  134. <div class="middle">
  135. <div class="list">
  136. <div class="name">类目(产品名称):</div>
  137. <div class="text">SSSASCSCSEWQA</div>
  138. </div>
  139. <div class="list">
  140. <div class="fl">
  141. <div class="name">品牌:</div>
  142. <div class="text">SSSASCSCSEWQA</div>
  143. </div>
  144. <div class="fr">
  145. <div class="name">交期(天):</div>
  146. <div class="text">20-30</div>
  147. </div>
  148. </div>
  149. <div class="list">
  150. <div class="fl">
  151. <div class="name">包装数量:</div>
  152. <div class="text">1000</div>
  153. </div>
  154. <div class="fr">
  155. <div class="name">库存:</div>
  156. <div class="text">568</div>
  157. </div>
  158. </div>
  159. <div class="list">
  160. <div class="fl">
  161. <div class="name">包装方式:</div>
  162. <div class="text">其他</div>
  163. </div>
  164. <div class="fr">
  165. <div class="name">起订量:</div>
  166. <div class="text">22220</div>
  167. </div>
  168. </div>
  169. <div class="list">
  170. <div class="name">生成日期:</div>
  171. <div class="text">2815-24-32</div>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <!--<div v-else v-bind:key="index" v-for="(item, index) in GetEnterpriseListData" class="providerList">-->
  177. <!---->
  178. <!--</div>-->
  179. </div>
  180. <!-- /end 卖家中心 产品管理 -->
  181. <div class="none-state" v-if="(activeType != 'seek') && ((collectSave.totalElements == 0 && activeType == 'comp') || (focusPage.totalElements == 0 && activeType == 'store') || (collectSave.totalElements == 0 && focusPage.totalElements == 0))">
  182. <img src="/images/mobile/@2x/empty-collect.png">
  183. <p v-text="getRemindText()"></p>
  184. <nuxt-link to="/">返回首页</nuxt-link>
  185. </div>
  186. <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
  187. <div class="mobile-modal" v-if="showStoreInfo">
  188. <div class="mobile-modal-box">
  189. <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
  190. <div class="mobile-modal-content">
  191. <div v-if="checkInfo(storeInfo.enAddress || storeInfo.address)">商家地址:{{storeInfo.enAddress || storeInfo.address}}</div>
  192. <!--<div class="content-line link-url">在线咨询</div>-->
  193. <div v-if="checkInfo(storeInfo.enTel)">致电:<a :href="'tel:' + storeInfo.enTel" target="_blank" class="content-line link-url">{{storeInfo.enTel}}</a></div>
  194. <div v-if="checkInfo(storeInfo.enEmail)">邮件:<a :href="'mailto:' + storeInfo.enEmail" target="_blank" class="content-line link-url">{{storeInfo.enEmail}}</a></div>
  195. </div>
  196. </div>
  197. </div>
  198. <page-loading v-show="showLoading"></page-loading>
  199. <loading v-show="isSearchSearchingMore"></loading>
  200. <div v-if="purchaseManList && false"></div>
  201. <div v-if="purchaseManListFetching && false"></div>
  202. <div v-if="EnterpriseList && false"></div>
  203. </div>
  204. </template>
  205. <script>
  206. import SeekList from '~components/mobile/applyPurchase/SeekList.vue'
  207. import {RemindBox, Loading} from '~components/mobile/common'
  208. import PageLoading from '~components/common/loading/PageLoading.vue'
  209. export default {
  210. layout: 'mobile',
  211. middleware: 'authenticated',
  212. data () {
  213. return {
  214. userName: '',
  215. count: '',
  216. page: '',
  217. type: '',
  218. activeType: 'seek',
  219. collectResult: '取消成功',
  220. timeoutCount: 0,
  221. showStoreInfo: false,
  222. storeInfo: {},
  223. seekType: 'wait',
  224. showLoading: false,
  225. seekKeyword: '',
  226. isSearchSearchingMore: false,
  227. isChange: false,
  228. seekPage: 1,
  229. seekSize: 10,
  230. purchaseManListData: [],
  231. isDataChange: false,
  232. showEnterpriseToggle: false,
  233. providerType: 'enterprise',
  234. GetEnterpriseListData: []
  235. }
  236. },
  237. components: {
  238. RemindBox,
  239. SeekList,
  240. PageLoading,
  241. Loading
  242. },
  243. fetch ({ store, route }) {
  244. let user = store.state.option.user.data
  245. let params = {
  246. pageNumber: 1,
  247. pageSize: 10,
  248. state: (!route.query.type || route.query.type === 'buyer') ? 'todo' : null
  249. }
  250. if (user.enterprise.uu) {
  251. params.enUU = user.enterprise.uu
  252. } else {
  253. params.userUU = user.userUU
  254. }
  255. return Promise.all([
  256. store.dispatch('product/saveStores', { count: 100, page: 1, type: 'component' }),
  257. store.dispatch('shop/StoreFocusPage', { count: 100, page: 1 }),
  258. store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadPurchaseManList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
  259. ])
  260. },
  261. watch: {
  262. '$route.query': {
  263. handler: function (val, old) {
  264. this.switchSeek('wait')
  265. }
  266. },
  267. 'activeType': {
  268. handler: function (val, old) {
  269. if (val === 'provider') {
  270. this.seekPage = 1
  271. this.GetEnterpriseListData = []
  272. this.GetEnterpriseList()
  273. }
  274. }
  275. }
  276. },
  277. mounted: function () {
  278. this.$nextTick(() => {
  279. window.addEventListener('scroll', this.scroll, false)
  280. document.body.addEventListener('click', () => {
  281. this.setShowEnterpriseToggle(false)
  282. }, false)
  283. })
  284. },
  285. methods: {
  286. // 切换当前企业
  287. switchEnterprise (en) {
  288. this.showEnterpriseToggle = false
  289. this.$http.get(`/user/authentication/${en.uu}`).then(() => {
  290. this.isChange = true
  291. this.$store.dispatch('loadUserInfo').then(() => {
  292. if (this.userType === 'saler') {
  293. this.$router.push('/mobile/user?type=buyer')
  294. } else {
  295. this.reloadData()
  296. }
  297. })
  298. })
  299. },
  300. setShowEnterpriseToggle (flag, e) {
  301. if (e) {
  302. e.stopPropagation()
  303. }
  304. this.showEnterpriseToggle = flag
  305. },
  306. cancelFocus: function (type, item, event) {
  307. event.stopPropagation()
  308. if (type === 'store') {
  309. this.$http.post('/trade/storeFocus/delete/storeId', [item.storeid])
  310. .then(response => {
  311. this.$store.dispatch('shop/StoreFocusPage', { count: 100, page: 1 })
  312. this.timeoutCount++
  313. })
  314. } else {
  315. // /trade/collection/
  316. this.$http.delete('/trade/collection/' + item.id)
  317. .then(response => {
  318. this.$store.dispatch('product/saveStores', { count: 100, page: 1, type: 'component' })
  319. this.timeoutCount++
  320. })
  321. }
  322. },
  323. getBackground: function (type) {
  324. let url = ''
  325. if (type === 'AGENCY') {
  326. url += '/images/mobile/@2x/shop/agency.png'
  327. } else if (type === 'DISTRIBUTION') {
  328. url += '/images/mobile/@2x/shop/distribution.png'
  329. } else if (type === 'ORIGINAL_FACTORY') {
  330. url += '/images/mobile/@2x/shop/original_factory.png'
  331. } else if (type === 'CONSIGNMENT') {
  332. url = '/images/mobile/@2x/shop/consignment.png'
  333. }
  334. return url
  335. },
  336. goStoreDetail: function (uuid) {
  337. this.$router.push('/mobile/shop/' + uuid)
  338. },
  339. goComponentDetail: function (uuid) {
  340. this.$router.push('/mobile/brand/componentDetail/' + uuid)
  341. },
  342. getRemindText: function () {
  343. if (this.activeType === 'comp') {
  344. return '抱歉,暂无器件收藏'
  345. } else if (this.activeType === 'store') {
  346. return '抱歉,暂无店铺关注'
  347. }
  348. },
  349. selectStoreInfo: function (store, event) {
  350. event.stopPropagation()
  351. this.storeInfo = store.storeInfo.enterprise || {}
  352. this.showStoreInfo = true
  353. },
  354. checkInfo: function (str) {
  355. return str && str.trim() !== ''
  356. },
  357. switchSeek: function (type) {
  358. this.seekType = type
  359. this.showLoading = true
  360. this.seekKeyword = ''
  361. this.isChange = true
  362. this.seekPage = 1
  363. this.reloadData()
  364. },
  365. switchType: function () {
  366. if (this.userType === 'buyer') {
  367. this.activeType = 'oppor'
  368. } else {
  369. this.activeType = 'seek'
  370. }
  371. this.seekKeyword = ''
  372. this.$router.push('/mobile/user' + (this.userType === 'saler' ? '?type=buyer' : '?type=saler'))
  373. },
  374. searchSeek: function () {
  375. this.isChange = true
  376. this.reloadData()
  377. },
  378. reloadData: function () {
  379. let type = this.seekType
  380. let user = this.$store.state.option.user.data
  381. let params = {
  382. pageNumber: 1,
  383. pageSize: 10,
  384. keyword: this.seekKeyword || null
  385. }
  386. if (user.enterprise.uu) {
  387. params.enUU = user.enterprise.uu
  388. } else {
  389. params.userUU = user.userUU
  390. }
  391. if (this.userType !== 'saler') {
  392. if (type === 'wait') {
  393. params.state = 'todo'
  394. this.$store.dispatch('applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
  395. } else if (type === 'done') {
  396. params._state = 'done'
  397. this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', params)
  398. } else {
  399. params._state = 'done'
  400. this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', params)
  401. }
  402. } else {
  403. if (this.activeType === 'provider') {
  404. if (this.providerType === 'enterprise') {
  405. this.GetEnterpriseList()
  406. } else if (this.providerType === 'person') {
  407. this.GetPersonList()
  408. } else if (this.providerType === 'onLine') {
  409. this.GetOnlineList()
  410. }
  411. } else {
  412. if (type === 'wait') {
  413. this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise.uu, keyword: this.seekKeyword})
  414. } else if (type === 'done') {
  415. this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}, overdue: 1})
  416. } else {
  417. this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}, overdue: 1})
  418. }
  419. }
  420. }
  421. },
  422. scroll: function () {
  423. let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
  424. if (this.$refs.searchSeekInput && this.$store.state.mobile.InputGetFocus) {
  425. this.$refs.searchSeekInput.blur()
  426. }
  427. if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && this.activeType === 'provider' && !this.isSearchSearchingMore && this.seekPage < this.EnterprisePage) {
  428. this.getMoreSearch()
  429. } else if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && this.activeType !== 'provider' && !this.isSearchSearchingMore && this.seekPage < this.allPage) {
  430. this.getMoreSearch()
  431. }
  432. },
  433. blur: function() {
  434. setTimeout(() => {
  435. this.$store.dispatch('mobile/SetInputGetFocus', false)
  436. }, 300)
  437. },
  438. inputGetFocus: function() {
  439. setTimeout(() => {
  440. this.$store.dispatch('mobile/SetInputGetFocus', true)
  441. }, 300)
  442. },
  443. getMoreSearch: function () {
  444. this.seekPage++
  445. this.isSearchSearchingMore = true
  446. this.reloadData()
  447. },
  448. // 获取当前企业产品库
  449. GetEnterpriseList: function() {
  450. let params = {
  451. _status: 'all',
  452. count: 20,
  453. isStandard: true,
  454. keyword: this.seekKeyword || '',
  455. page: this.seekPage,
  456. sorting: { id: 'DESC' },
  457. type: 'all'
  458. }
  459. this.$store.dispatch('mobile/GetEnterpriseList', params)
  460. },
  461. // 获取当前个人产品库
  462. GetPersonList: function() {
  463. let params = {
  464. _status: 'all',
  465. count: 20,
  466. isStandard: true,
  467. keyword: this.seekKeyword || '',
  468. page: this.seekPage,
  469. sorting: { id: 'DESC' },
  470. type: 'all'
  471. }
  472. this.$store.dispatch('mobile/GetPersonList', params)
  473. },
  474. // 获取当前在售产品
  475. GetOnlineList: function() {
  476. let params = {
  477. count: 10,
  478. keyword: this.seekKeyword || '',
  479. page: this.seekPage,
  480. sorting: { 'createdDate': 'DESC' },
  481. status: '601-602'
  482. }
  483. this.$store.dispatch('mobile/GetOnlineList', params)
  484. },
  485. // 产品管理切换
  486. switchprovide: function(type) {
  487. this.providerType = type
  488. this.seekPage = 1
  489. this.GetEnterpriseListData = []
  490. if (type === 'enterprise') {
  491. this.GetEnterpriseList()
  492. } else if (type === 'person') {
  493. this.GetPersonList()
  494. } else if (type === 'onLine') {
  495. this.GetOnlineList()
  496. }
  497. }
  498. },
  499. computed: {
  500. collectSave () {
  501. return this.$store.state.product.common.collectList.data
  502. },
  503. userInfo () {
  504. return this.$store.state.option.user
  505. },
  506. enterpriseInfo () {
  507. if (this.userInfo.data.enterprises) {
  508. let ens = this.userInfo.data.enterprises.slice()
  509. if (ens && ens.length) {
  510. for (let i = 0; i < ens.length; i++) {
  511. if (ens[i].current) {
  512. return ens[i]
  513. }
  514. }
  515. }
  516. return {enName: this.userInfo.data.userName + '(个人账户)'}
  517. } else {
  518. return ''
  519. }
  520. },
  521. sortEnterprises () {
  522. if (this.user.data.enterprises) {
  523. let ens = this.user.data.enterprises.slice()
  524. if (ens && ens.length) {
  525. ens.sort(function (a, b) {
  526. return b.lastLoginTime - a.lastLoginTime
  527. })
  528. }
  529. return ens
  530. } else {
  531. return ''
  532. }
  533. },
  534. isVendor () {
  535. return this.enterpriseInfo.isVendor === 313
  536. },
  537. userType () {
  538. this.activeType = this.$route.query.type === 'saler' ? 'oppor' : 'seek'
  539. return this.$route.query.type
  540. },
  541. focusPage () {
  542. return this.$store.state.shop.storeInfo.focusPage.data
  543. },
  544. purchase () {
  545. return this.$store.state.applyPurchase.purchaseManList.purchaseManList
  546. },
  547. purchaseManList () {
  548. let list = this.purchase.data.content.slice()
  549. if (this.isChange) {
  550. this.purchaseManListData = []
  551. this.seekPage = 1
  552. this.isChange = false
  553. this.isDataChange = true
  554. } else {
  555. this.purchaseManListData = this.purchaseManListData.concat(list)
  556. this.isSearchSearchingMore = false
  557. this.isDataChange = false
  558. }
  559. // console.log(this.purchaseManListData)
  560. return this.purchase.data.content
  561. },
  562. allPage () {
  563. return Math.floor(this.purchase.data.totalElements / this.purchase.data.size) + Math.floor(this.purchase.data.totalElements % this.purchase.data.size > 0 ? 1 : 0)
  564. },
  565. purchaseManListFetching () {
  566. this.showLoading = false
  567. return this.purchase.fetching
  568. },
  569. Enterprise() {
  570. if (this.providerType === 'enterprise') {
  571. return this.$store.state.mobile.enterpriseList.data
  572. } else if (this.providerType === 'person') {
  573. return this.$store.state.mobile.personList.data
  574. } else if (this.providerType === 'onLine') {
  575. return this.$store.state.mobile.onLineList.data
  576. }
  577. },
  578. EnterprisePage() {
  579. if (this.providerType === 'enterprise') {
  580. return this.$store.state.mobile.enterpriseList.data.totalPages
  581. } else if (this.providerType === 'person') {
  582. return this.$store.state.mobile.personList.data.totalPages
  583. } else if (this.providerType === 'onLine') {
  584. return this.$store.state.mobile.onLineList.data.totalPages
  585. }
  586. },
  587. EnterpriseList () {
  588. if (this.Enterprise.content) {
  589. let list = this.Enterprise.content.slice()
  590. this.GetEnterpriseListData = this.GetEnterpriseListData.concat(list)
  591. this.isSearchSearchingMore = false
  592. return this.Enterprise.content
  593. } else {
  594. return ''
  595. }
  596. }
  597. }
  598. }
  599. </script>
  600. <style scoped lang="scss">
  601. .user-content{
  602. margin-bottom: .98rem;
  603. .none-state{
  604. text-align: center;
  605. padding:1.5rem 0;
  606. background: #fff;
  607. margin-top:.1rem;
  608. width:100%;
  609. img{
  610. margin:0 auto;
  611. width: 4.08rem;
  612. height: 2.62rem;
  613. }
  614. p {
  615. font-size: .32rem;
  616. color: #999;
  617. margin: 1.19rem 0 0 0;
  618. }
  619. a {
  620. display: block;
  621. font-size: .28rem;
  622. color: #fff;
  623. width: 1.88rem;
  624. height: .54rem;
  625. line-height: .54rem;
  626. background: #418bf6;
  627. margin: .7rem auto 0;
  628. border-radius: .05rem;
  629. }
  630. }
  631. .user-name{
  632. height: 1.8rem;
  633. padding: .28rem 0 .28rem .34rem;
  634. background: #fff;
  635. width: 100%;
  636. position: relative;
  637. img{
  638. display: inline-block;
  639. width: 1.25rem;
  640. height: 1.25rem;
  641. border: 1px solid #c5dbfc;
  642. border-radius: .05rem;
  643. vertical-align: middle;
  644. }
  645. .user-info {
  646. margin-left:.25rem;
  647. display: inline-block;
  648. vertical-align: middle;
  649. position: relative;
  650. p{
  651. font-size:.3rem;
  652. margin:0;
  653. display: block;
  654. overflow: hidden;
  655. text-overflow: ellipsis;
  656. white-space: nowrap;
  657. max-width: 3.92rem;
  658. &:nth-child(2) {
  659. position: relative;
  660. margin-top: .2rem;
  661. padding-right: .7rem;
  662. a {
  663. position: absolute;
  664. right: 0;
  665. }
  666. }
  667. }
  668. .en-list {
  669. position: absolute;
  670. max-width: 8rem;
  671. max-height: 3rem;
  672. overflow-y: auto;
  673. border-radius: .05rem;
  674. .menu-item {
  675. height: .6rem;
  676. line-height: .6rem;
  677. font-size: .3rem;
  678. padding: 0 .2rem;
  679. overflow: hidden;
  680. white-space: nowrap;
  681. text-overflow: ellipsis;
  682. background: rgba(0, 0, 0, .6);
  683. &:active, &:focus, &:hover {
  684. background: #7d7d7d;
  685. }
  686. a {
  687. color: #fff;
  688. }
  689. }
  690. }
  691. }
  692. > a {
  693. font-size: .24rem;
  694. position: absolute;
  695. top: .45rem;
  696. right: .1rem;
  697. color: #3f84f6;
  698. border: 1px solid #3f84f6;
  699. border-radius: .2rem;
  700. padding: .06rem .12rem;
  701. }
  702. }
  703. .shop-list {
  704. background:#fff;
  705. border-bottom: .1rem solid #dfe2e4;
  706. padding: .14rem 0 .14rem 0;
  707. h3{
  708. font-size: .32rem;
  709. line-height: .4rem;
  710. margin: 0 0 0 .27rem;
  711. overflow: hidden;
  712. text-overflow: ellipsis;
  713. white-space: nowrap;
  714. padding-top: .1rem;
  715. position: relative;
  716. top: .1rem;
  717. }
  718. .list-item{
  719. width:6.77rem;
  720. margin-left:.39rem;
  721. .item-img{
  722. width:2.4rem;
  723. vertical-align: middle;
  724. display: inline-block;
  725. img{
  726. &:nth-child(2) {
  727. width:2.4rem;
  728. height:1.69rem;
  729. border: 1px solid #eee;
  730. }
  731. &:nth-child(1) {
  732. position:absolute;
  733. width:.65rem;
  734. height:.33rem;
  735. }
  736. }
  737. }
  738. .list-item-phone{
  739. width:3.95rem;
  740. padding:.18rem 0;
  741. position:relative;
  742. display: inline-block;
  743. vertical-align: middle;
  744. margin-left: .26rem;
  745. p{
  746. font-size:.28rem;
  747. line-height: .67rem;
  748. margin:0;
  749. overflow: hidden;
  750. text-overflow: ellipsis;
  751. white-space: nowrap;
  752. width: 3.2rem;
  753. }
  754. i{
  755. display:block;
  756. position:absolute;
  757. top: -.06rem;
  758. right: -.18rem;
  759. font-size:.5rem;
  760. color:#ff7800;
  761. width: .6rem;
  762. height: .6rem;
  763. text-align: center;
  764. line-height: .6rem;
  765. }
  766. }
  767. }
  768. &:active {
  769. background: #e1e1e1;
  770. }
  771. }
  772. .detail-brand{
  773. background: #fff;
  774. width:100%;
  775. min-height:1.5rem;
  776. padding:.2rem 0;
  777. border-bottom: .1rem solid #dfe2e4;
  778. &:nth-child(1) {
  779. margin-top:.1rem;
  780. }
  781. .brand-item{
  782. width:7rem;
  783. margin:0 auto;
  784. border-radius:.1rem;
  785. background: #fff;
  786. padding:.2rem;
  787. position:relative;
  788. &:active{
  789. background: #e1e1e1;
  790. }
  791. p{
  792. font-size:.28rem;
  793. line-height:.4rem;
  794. color:#333;
  795. margin:0;
  796. }
  797. i{
  798. display:block;
  799. position:absolute;
  800. top:.2rem;
  801. right:.1rem;
  802. font-size:.5rem;
  803. color:#ff7800;
  804. width: .6rem;
  805. height: .6rem;
  806. line-height: .6rem;
  807. text-align: center;
  808. }
  809. }
  810. div.active{
  811. background: #d4d;
  812. }
  813. }
  814. .collect-list-type {
  815. background: #fff;
  816. border-bottom: 1px solid #acacac;
  817. p {
  818. font-size: .32rem;
  819. margin: 0 0 0 .13rem;
  820. width: .92rem;
  821. text-align: center;
  822. line-height: .5rem;
  823. border-bottom: .06rem solid #418bf6;
  824. }
  825. }
  826. ul.switch-list {
  827. li {
  828. display: inline-block;
  829. width: 2.5rem;
  830. height: .63rem;
  831. line-height: .63rem;
  832. text-align: center;
  833. font-size: .28rem;
  834. color: #666;
  835. background: #fff;
  836. border: 1px solid #b4b4b4;
  837. border-right: none;
  838. &.active {
  839. background: #0067e7;
  840. border: 1px solid #0067e7;
  841. color: #fff;
  842. }
  843. &:first-child {
  844. border-left: none;
  845. }
  846. &:last-child {
  847. border-right: none;
  848. }
  849. }
  850. &.vendor-switch {
  851. li {
  852. width: 50%;
  853. }
  854. }
  855. }
  856. .seek {
  857. .seek-type {
  858. margin-top: .15rem;
  859. li {
  860. font-size: .28rem;
  861. color: #666;
  862. display: inline-block;
  863. width: 50%;
  864. text-align: center;
  865. div {
  866. border-bottom: 1px solid #c1c4c9;
  867. margin: 0 auto;
  868. height: .46rem;
  869. line-height: .46rem;
  870. }
  871. &.active {
  872. color: #3f84f6;
  873. div {
  874. border-color: #3f84f6;
  875. }
  876. }
  877. }
  878. }
  879. }
  880. .search-content {
  881. text-align: center;
  882. padding: .25rem 0 0 0;
  883. input {
  884. border: 1px solid #376ff3;
  885. }
  886. span {
  887. height: .46rem;
  888. line-height: .46rem;
  889. }
  890. }
  891. }
  892. .providerList {
  893. border-top: 1px solid #e0e0e4;
  894. border-bottom: 1px solid #e0e0e4;
  895. margin-bottom: 0.24rem;
  896. .top {
  897. &.top2 {
  898. .text {
  899. width: 5.4rem;
  900. }
  901. }
  902. .icon {
  903. width: 0.6rem;
  904. height: 0.36rem;
  905. margin-top: 0.27rem;
  906. float: left;
  907. background-size: 100%;
  908. background-repeat: no-repeat;
  909. margin-right: 0.12rem;
  910. &.istanded{
  911. background-image: url('/images/mobile/@2x/istanded.png')
  912. }
  913. &.standed{
  914. background-image: url('/images/mobile/@2x/standed.png')
  915. }
  916. }
  917. .text {
  918. float: left;
  919. width: 6.3rem;
  920. overflow: hidden;
  921. text-overflow: ellipsis;
  922. white-space: nowrap;
  923. }
  924. padding: 0 0.24rem;
  925. background: #f5f9fd;
  926. height: 0.9rem;
  927. line-height: 0.9rem;
  928. color: #0067e7;
  929. font-size: 0.3rem;
  930. &::after{
  931. clear: both;
  932. display: block;
  933. content: ' ';
  934. visibility: hidden;
  935. zoom: 1;
  936. }
  937. }
  938. .content {
  939. padding: 0.24rem 0.24rem;
  940. background: #fff;
  941. .linetext {
  942. margin-bottom: 0.24rem;
  943. &:nth-last-of-type(1){
  944. margin-bottom: 0rem;
  945. }
  946. }
  947. .fl {
  948. float: left;
  949. border-right: 1px dashed #e0e0e4;
  950. width: 4.88rem;
  951. }
  952. .fr {
  953. float: right;
  954. margin: 0.18rem 0.24rem;
  955. margin-right: 0rem;
  956. font-size: 0.2rem;
  957. &.addtop {
  958. margin-top: 0.6rem
  959. }
  960. div {
  961. width: 1.9rem;
  962. height: 0.5rem;
  963. text-align: center;
  964. line-height: 0.5rem;
  965. border-radius: 3px;
  966. &.look{
  967. background: #0067e7;
  968. color: #fff;
  969. }
  970. &.add{
  971. background: #fff;
  972. color: #0067e7;
  973. border: 1px solid #0067e7;
  974. }
  975. &.delete{
  976. background: #fff;
  977. color: #f70415;
  978. border: 1px solid #f70415;
  979. }
  980. }
  981. div:nth-child(1){
  982. margin-bottom: 0.26rem
  983. }
  984. }
  985. &::after{
  986. clear: both;
  987. display: block;
  988. content: ' ';
  989. visibility: hidden;
  990. zoom: 1;
  991. }
  992. }
  993. .middle {
  994. padding: 0.24rem 0.24rem;
  995. background: #fff;
  996. .pms {
  997. color: #f57710;
  998. border: 1px solid #f57710;
  999. border-radius: 50%;
  1000. background: #fff;
  1001. font-size: 0.2rem;
  1002. padding: 0.2rem 0.3rem;
  1003. }
  1004. .list {
  1005. margin-bottom: 0.12rem;
  1006. &::after{
  1007. clear: both;
  1008. display: block;
  1009. content: ' ';
  1010. visibility: hidden;
  1011. zoom: 1;
  1012. }
  1013. .fl {
  1014. width: 4.4rem;
  1015. float: left;
  1016. overflow: hidden;
  1017. text-overflow: ellipsis;
  1018. white-space: nowrap;
  1019. }
  1020. .fr {
  1021. text-align: left;
  1022. width: 2.6rem;
  1023. overflow: hidden;
  1024. text-overflow: ellipsis;
  1025. white-space: nowrap;
  1026. }
  1027. .name {
  1028. color: #666;
  1029. font-size: 0.3rem;
  1030. display: inline-block;
  1031. }
  1032. .text {
  1033. display: inline-block;
  1034. color: #999;
  1035. font-size: 0.3rem
  1036. }
  1037. }
  1038. }
  1039. }
  1040. </style>