index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  1. <template>
  2. <div class="user-content mobile-content">
  3. <user-header @switchEnAction="updateEnterpriseInfo"></user-header>
  4. <ul class="switch-list">
  5. <li :class="{active: activeType === 'store'}" @click="swtichTab('store')">店铺管理</li>
  6. <li :class="{active: activeType === 'Account'}" @click="swtichTab('Account')">账户管理</li>
  7. </ul>
  8. <!-- 店铺管理 -->
  9. <template v-if="activeType === 'store'">
  10. <template v-if="storeInfo.storeName">
  11. <div class="topinfo clearfix">
  12. <div class="pull-left">
  13. 店铺信息
  14. </div>
  15. <div class="pull-right" @click="updateInfo()" v-show="storeState === 'look'">
  16. <img src="/images/vendor/updateinfo.png"/>
  17. 编辑
  18. </div>
  19. </div>
  20. <ul class="infoul">
  21. <li class="clearfix" :class="{border: storeState !== 'look'}">
  22. <div class="name pull-left" :class="{update: storeState !== 'look'}">店铺名称:</div>
  23. <div class="text pull-left" v-if="storeState === 'look'">
  24. {{storeInfo.storeName || '-'}}
  25. </div>
  26. <div v-else class="text pull-left">
  27. <input v-model="storeInfo.storeName" type="text"/>
  28. </div>
  29. </li>
  30. <li class="clearfix" :class="{border: storeState !== 'look'}">
  31. <div class="name pull-left" :class="{update: storeState !== 'look'}">简介:</div>
  32. <div class="text pull-left clearfix" v-if="storeState === 'look'">
  33. {{Islook ? dealWithText(storeInfo.description) : dealWithText()}}
  34. <a class="pull-right" @click="dealWithText2('open')" v-show="Islook">
  35. 全部<img src="/images/store/default/openblack.png"/>
  36. </a>
  37. <a class="pull-right upload" @click="dealWithText2('hide')" v-show="!hidelook">
  38. 收起<img src="/images/store/default/openblack.png"/>
  39. </a>
  40. </div>
  41. <div class="text pull-left" v-else>
  42. <textarea v-model="storeInfo.description">
  43. </textarea>
  44. </div>
  45. </li>
  46. <li class="clearfix" :class="{border: storeState !== 'look'}">
  47. <div class="name pull-left" :class="{update: storeState !== 'look'}">企业地址:</div>
  48. <div class="text pull-left" v-if="storeState === 'look'">
  49. {{storeInfo.enterprise.address || '-'}}
  50. </div>
  51. <div v-else class="text pull-left">
  52. <input v-model="storeInfo.enterprise.address" type="text"/>
  53. </div>
  54. </li>
  55. <li class="clearfix" :class="{border: storeState !== 'look'}">
  56. <div class="name pull-left" :class="{update: storeState !== 'look'}">电话:</div>
  57. <div class="text pull-left" v-if="storeState === 'look'">
  58. {{storeInfo.enterprise.enTel || '暂无信息'}}
  59. </div>
  60. <div v-else class="text pull-left">
  61. <input v-model="storeInfo.enterprise.enTel" type="text"/>
  62. </div>
  63. </li>
  64. <li class="clearfix" :class="{border: storeState !== 'look'}">
  65. <div class="name pull-left" :class="{update: storeState !== 'look'}">传真:</div>
  66. <div class="text pull-left" v-if="storeState === 'look'">
  67. {{storeInfo.enterprise.enFax || '暂无信息'}}
  68. </div>
  69. <div v-else class="text pull-left">
  70. <input v-model="storeInfo.enterprise.enFax" type="text"/>
  71. </div>
  72. </li>
  73. <li class="clearfix" :class="{border: storeState !== 'look'}">
  74. <div class="name pull-left" :class="{update: storeState !== 'look'}">手机:</div>
  75. <div class="text pull-left" v-if="storeState === 'look'">
  76. {{storeInfo.enterprise.enPhone || '暂无信息'}}
  77. </div>
  78. <div v-else class="text pull-left">
  79. <input v-model="storeInfo.enterprise.enPhone" type="text"/>
  80. </div>
  81. </li>
  82. <li class="clearfix" :class="{border: storeState !== 'look'}">
  83. <div class="name pull-left" :class="{update: storeState !== 'look'}">微信:</div>
  84. <div class="text pull-left" v-if="storeState === 'look'">
  85. {{storeInfo.enterprise.enWeixin || '暂无信息'}}
  86. </div>
  87. <div v-else class="text pull-left">
  88. <input v-model="storeInfo.enterprise.enWeixin" type="text"/>
  89. </div>
  90. </li>
  91. <li class="clearfix" :class="{border: storeState !== 'look'}">
  92. <div class="name pull-left" :class="{update: storeState !== 'look'}">QQ:</div>
  93. <div class="text pull-left" v-if="storeState === 'look'">
  94. {{storeInfo.enterprise.enQQ || '暂无信息'}}
  95. </div>
  96. <div v-else class="text pull-left">
  97. <input v-model="storeInfo.enterprise.enQQ" type="text"/>
  98. </div>
  99. </li>
  100. </ul>
  101. <div class="control clearfix" v-if="storeState !== 'look'">
  102. <div class="cancel" @click="storeInfosave('cancel')" >取消</div>
  103. <div class="save" @click="storeInfosave()">保存</div>
  104. </div>
  105. </template>
  106. <template v-else>
  107. <div class="none-state">
  108. <img src="/images/mobile/@2x/empty-collect.png">
  109. <p v-text="getRemindText"></p>
  110. <nuxt-link to="/">返回首页</nuxt-link>
  111. </div>
  112. </template>
  113. </template>
  114. <!-- /end 店铺管理 -->
  115. <!-- 账户管理 -->
  116. <template v-else>
  117. <div class="topinfo clearfix" v-if="enterpriseInfo.enName">
  118. <div class="pull-left">
  119. 企业信息
  120. </div>
  121. <div class="pull-right" @click="updateInfo()" v-show="storeState === 'look'">
  122. <img src="/images/vendor/updateinfo.png"/>
  123. 编辑
  124. </div>
  125. </div>
  126. <ul class="infoul infoul2" v-if="enterpriseInfo.enName">
  127. <li class="clearfix" :class="{noupdate: storeState !== 'look'}">
  128. <div class="name pull-left" :class="{update: storeState !== 'look'}" >企业名称:</div>
  129. <div class="text pull-left" :class="{update: storeState !== 'look'}">
  130. {{enterpriseInfo.enName || '-'}}
  131. </div>
  132. </li>
  133. <li class="clearfix" :class="{noupdate: storeState !== 'look', border: storeState !== 'look'}">
  134. <div class="name pull-left" :class="{update: storeState !== 'look'}">营业执照号:</div>
  135. <div class="text pull-left" :class="{update: storeState !== 'look'}">
  136. {{enterpriseInfo.enBussinessCode || '-'}}
  137. </div>
  138. </li>
  139. <li class="clearfix" :class="{border: storeState !== 'look'}">
  140. <div class="name pull-left" :class="{update: storeState !== 'look'}">注册地址:</div>
  141. <div class="text pull-left" v-if="storeState === 'look'">
  142. {{enterpriseInfo.enAddress || '-'}}
  143. </div>
  144. <div v-else class="text pull-left">
  145. <input v-model="enterpriseInfo.enAddress" type="text"/>
  146. </div>
  147. </li>
  148. <li class="clearfix" :class="{border: storeState !== 'look'}">
  149. <div class="name pull-left" :class="{update: storeState !== 'look'}">官网地址:</div>
  150. <div class="text pull-left" v-if="storeState === 'look'">
  151. {{enterpriseInfo.enUrl || '-'}}
  152. </div>
  153. <div v-else class="text pull-left">
  154. <input v-model="enterpriseInfo.enUrl" type="text"/>
  155. </div>
  156. </li>
  157. <li class="clearfix" :class="{border: storeState !== 'look'}">
  158. <div class="name pull-left" :class="{update: storeState !== 'look'}">所属行业:</div>
  159. <div class="text pull-left" v-if="storeState === 'look'">
  160. {{enterpriseInfo.enIndustry || '-'}}
  161. </div>
  162. <div v-else class="text pull-left clearfix" @click="isShowTypeAlert = true">
  163. <input v-model="enterpriseInfo.enIndustry" type="text" style="width: 4.5rem" readonly/>
  164. <div class="moreIcon pull-right">
  165. <img src="/images/store/default/moreicon.png" />
  166. </div>
  167. </div>
  168. </li>
  169. <li class="clearfix" :class="{border: storeState !== 'look'}">
  170. <div class="name pull-left" :class="{update: storeState !== 'look'}" style="margin-top: 0.04rem;">经营范围:</div>
  171. <div class="text pull-left" v-if="storeState === 'look'" >
  172. <span v-for="item in scopeLabel" class="label">
  173. {{item}}
  174. </span>
  175. <span class="text pull-left nolabel" v-if="scopeLabel.length == 0">
  176. 无标签信息
  177. </span>
  178. </div>
  179. <div v-else class="text pull-left">
  180. <label v-for="item in scopeLabel" class="labelKuang" v-show="AddBtnShow">
  181. <span class="Updatelabel">
  182. {{item}}
  183. </span>
  184. <span class="updatespan"@click="addBtn(item)">删除</span>
  185. </label>
  186. <span class="addBtn" v-show="AddBtnShow" @click="addBtn()"></span>
  187. <div class="commit" v-show="!AddBtnShow">
  188. <input type="text" placeholder="请输入不大于10个字符" class="inputText" v-model="labelText"/>
  189. <button @click="saveLabel()">确定</button>
  190. </div>
  191. </div>
  192. </li>
  193. </ul>
  194. <template v-if="storeState === 'look'">
  195. <div class="topinfo clearfix" style="color: #999;background: #fafafa" :class="{noborder: enterpriseInfo.enName}">
  196. 个人信息
  197. </div>
  198. <ul class="infoul infoul2" style="color: #999;background: #fafafa">
  199. <li class="clearfix">
  200. <div class="name pull-left">用户名:</div>
  201. <div class="text pull-left">
  202. {{userInfo.userName || '-'}}
  203. </div>
  204. </li>
  205. <li class="clearfix">
  206. <div class="name pull-left">手机:</div>
  207. <div class="text pull-left">
  208. {{userInfo.userTel || '-'}}
  209. </div>
  210. </li>
  211. <li class="clearfix">
  212. <div class="name pull-left">邮箱:</div>
  213. <div class="text pull-left">
  214. {{userInfo.userEmail || '-'}}
  215. </div>
  216. </li>
  217. </ul>
  218. <div class="topinfo clearfix" style="color: #999;border-top: 1px solid #d9d9d9;background: #fafafa" v-if = "admininfo.userName">
  219. 管理员信息
  220. </div>
  221. <ul class="infoul infoul2" style="color: #999;background: #fafafa" v-if="admininfo.userName">
  222. <li class="clearfix">
  223. <div class="name pull-left">姓名:</div>
  224. <div class="text pull-left">
  225. {{admininfo.userName || '-'}}
  226. </div>
  227. </li>
  228. <li class="clearfix">
  229. <div class="name pull-left">手机号:</div>
  230. <div class="text pull-left">
  231. {{admininfo.userTel || '-'}}
  232. </div>
  233. </li>
  234. <li class="clearfix">
  235. <div class="name pull-left">邮箱:</div>
  236. <div class="text pull-left">
  237. {{admininfo.userEmail || '-'}}
  238. </div>
  239. </li>
  240. </ul>
  241. </template>
  242. <div class="control clearfix" v-if="storeState !== 'look'">
  243. <div class="cancel" @click="storeInfosave('cancel')">取消</div>
  244. <div class="save" @click="storeInfosave()">保存</div>
  245. </div>
  246. </template>
  247. <!-- /end 账户管理 -->
  248. <!-- 选择行业弹窗 -->
  249. <div class="mobile-modal" v-show="isShowTypeAlert">
  250. <div class="modal-content">
  251. <div class="content-title">
  252. 所属行业
  253. <i class="el-icon-close" @click="isShowTypeAlert = false"></i>
  254. </div>
  255. <div class="content-title-label clearfix" >
  256. <div v-for="(item, index) in ContentTitleArray" @click="chooseTitle(index)">
  257. <a :class="{active: index === titleActive}">{{item}}</a>
  258. </div>
  259. </div>
  260. <div class="content-info" v-if="TypeListShow.firstListShow">
  261. <div v-for="(item, index) in TypeList.firstList" class="content-info-item" :class="{active: index === TypeListActive.firstListActive}" @click="chooseItem('firstList', item, index)" >
  262. {{item}}<img src="/images/mobile/@2x/getlabel_icon.png" v-show="index === TypeListActive.firstListActive"/>
  263. </div>
  264. </div>
  265. <div class="content-info" v-if="TypeListShow.secondsListShow">
  266. <div v-for="(item, index) in TypeList.secondsList" class="content-info-item" :class="{active: index === TypeListActive.secondsListActive}" @click="chooseItem('secondsList', item, index)" >
  267. {{item}}
  268. <img src="/images/mobile/@2x/getlabel_icon.png" v-show="index === TypeListActive.secondsListActive"/>
  269. </div>
  270. </div>
  271. <div class="content-info" v-if="TypeListShow.threetListShow">
  272. <div v-for="(item, index) in TypeList.threetList" class="content-info-item" :class="{active: index === TypeListActive.threetListActive}" @click="chooseItem('threetList', item, index)" >
  273. {{item}}
  274. <img src="/images/mobile/@2x/getlabel_icon.png" v-show="index === TypeListActive.threetListActive"/>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. <!-- /end 选择行业弹窗 -->
  280. <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
  281. <!--<loading v-show="isSearchSearchingMore"></loading>-->
  282. <div v-if="enterprise && false"></div>
  283. <div v-if="storeI && false"></div>
  284. </div>
  285. </template>
  286. <script>
  287. import { userHeader, RemindBox, Loading } from '~components/mobile/common'
  288. export default {
  289. layout: 'mobile',
  290. middleware: 'authenticated',
  291. data () {
  292. return {
  293. activeType: 'store',
  294. splitText: '', // 省略号文本
  295. normalText: '', // 原来文本
  296. Islook: true,
  297. storeState: 'look',
  298. admininfo: {}, // 管理员信息
  299. AddBtnShow: true,
  300. labelText: '',
  301. scopeLabel: [],
  302. ContentTitleArray: [], // 行业数组
  303. isSearchSearchingMore: false,
  304. collectResult: '',
  305. timeoutCount: 0,
  306. isShowTypeAlert: false, // 是否现在所属行业弹窗
  307. TypeList: {
  308. firstList: [],
  309. secondsList: [],
  310. threetList: []
  311. },
  312. TypeListActive: {
  313. firstListActive: '',
  314. secondsListActive: '',
  315. threetListActive: ''
  316. },
  317. TypeListShow: {
  318. firstListShow: true,
  319. secondsListShow: false,
  320. threetListShow: false
  321. },
  322. TypeObj: {},
  323. enterpriseInfo: {},
  324. hidelook: true,
  325. titleActive: '',
  326. storeInfo: {}
  327. }
  328. },
  329. components: {
  330. userHeader,
  331. RemindBox,
  332. Loading
  333. },
  334. fetch ({ store, route }) {
  335. return Promise.all([
  336. store.dispatch('loadStoreStatus', { op: 'check' })
  337. ])
  338. // let user = store.state.option.user.data
  339. },
  340. mounted: function () {
  341. this.$nextTick(() => {
  342. this.$http.get('/data/profession.json').then(response => {
  343. this.TypeObj = response.data
  344. for (let i of Object.keys(response.data)) {
  345. this.TypeList.firstList.push(i)
  346. }
  347. })
  348. })
  349. },
  350. computed: {
  351. getRemindText: function () {
  352. return '您的账户暂未开通卖家中心,请前往pc端申请开通!'
  353. },
  354. storeI() {
  355. let str = JSON.stringify(this.$store.state.option.storeStatus.data)
  356. this.storeInfo = JSON.parse(str)
  357. return ''
  358. },
  359. enterprise() {
  360. // return this.$store.state.supplier.material.enUser.data
  361. let str = JSON.stringify(this.$store.state.supplier.material.enUser.data)
  362. this.enterpriseInfo = JSON.parse(str)
  363. return ''
  364. },
  365. userInfo() {
  366. return this.$store.state.option.user.data
  367. }
  368. },
  369. methods: {
  370. chooseTitle(key) {
  371. if (key === 0) {
  372. this.TypeListShow = {
  373. firstListShow: true,
  374. secondsListShow: false,
  375. threetListShow: false
  376. }
  377. this.titleActive = 0
  378. } else if (key === 1) {
  379. this.TypeListShow = {
  380. firstListShow: false,
  381. secondsListShow: true,
  382. threetListShow: false
  383. }
  384. this.titleActive = 1
  385. } else if (key === 2) {
  386. this.TypeListShow = {
  387. firstListShow: false,
  388. secondsListShow: true,
  389. threetListShow: false
  390. }
  391. this.titleActive = 2
  392. }
  393. },
  394. chooseItem(listIndex, key, index) {
  395. if (listIndex === 'firstList') {
  396. this.TypeListActive.firstListActive = index
  397. this.ContentTitleArray[0] = key
  398. this.TypeList.secondsList = []
  399. this.titleActive = 0
  400. if (this.TypeObj[key] instanceof Array) {
  401. this.TypeList.secondsList = this.TypeObj[key]
  402. } else {
  403. for (let i of Object.keys(this.TypeObj[key])) {
  404. this.TypeList.secondsList.push(i)
  405. }
  406. }
  407. this.TypeListShow = {
  408. firstListShow: false,
  409. secondsListShow: true,
  410. threetListShow: false
  411. }
  412. this.TypeListActive.secondsListActive = ''
  413. this.TypeListActive.threetListActive = ''
  414. for (let i = 1; i < this.ContentTitleArray.length; i++) {
  415. this.ContentTitleArray.splice(i, 1)
  416. }
  417. } else if (listIndex === 'secondsList') {
  418. this.TypeList.threetList = []
  419. this.TypeListActive.secondsListActive = index
  420. this.TypeListActive.threetListActive = ''
  421. this.ContentTitleArray[1] = key
  422. this.titleActive = 1
  423. if (this.TypeObj[this.ContentTitleArray[0]][key] instanceof Array) {
  424. this.TypeList.threetList = this.TypeObj[this.ContentTitleArray[0]][key] ? this.TypeObj[this.ContentTitleArray[0]][key] : []
  425. }
  426. for (let i = 2; i < this.ContentTitleArray.length; i++) {
  427. this.ContentTitleArray.splice(i, 1)
  428. }
  429. if (this.TypeList.threetList.length > 0) {
  430. this.TypeListShow = {
  431. firstListShow: false,
  432. secondsListShow: false,
  433. threetListShow: true
  434. }
  435. } else {
  436. this.enterpriseInfo.enIndustry = key
  437. this.isShowTypeAlert = false
  438. this.TypeListShow = {
  439. firstListShow: true,
  440. secondsListShow: false,
  441. threetListShow: false
  442. }
  443. }
  444. } else if (listIndex === 'threetList') {
  445. this.titleActive = 2
  446. this.TypeListActive.threetListActive = index
  447. this.ContentTitleArray[2] = key
  448. this.enterpriseInfo.enIndustry = key
  449. this.isShowTypeAlert = false
  450. this.TypeListShow = {
  451. firstListShow: true,
  452. secondsListShow: false,
  453. threetListShow: false
  454. }
  455. }
  456. },
  457. addBtn(text) {
  458. if (text !== undefined) {
  459. this.scopeLabel = []
  460. let ms = this.enterpriseInfo.enBusinessScope.split(',')
  461. let _newArr = ms.slice()
  462. for (let j = 0; j < ms.length; j++) {
  463. if (ms[j].trim() === text) {
  464. _newArr.splice(j, 1)
  465. }
  466. }
  467. this.enterpriseInfo.enBusinessScope = _newArr.join(',')
  468. this.scopeLabel = this.enterpriseInfo.enBusinessScope.split(',')
  469. return false
  470. }
  471. this.AddBtnShow = false
  472. },
  473. saveLabel() {
  474. if (this.labelText === '') {
  475. this.AddBtnShow = true
  476. return false
  477. }
  478. if (this.labelText.length > 10) {
  479. this.collectResult = '标签文字不能超过10个字'
  480. this.timeoutCount++
  481. return false
  482. }
  483. this.AddBtnShow = true
  484. if (this.IsChange !== '' && this.IsChange !== undefined) {
  485. let ms = this.enterpriseInfo.enBusinessScope.split(',')
  486. for (let j = 0; j < ms.length; j++) {
  487. if (ms[j].trim() === this.IsChange) {
  488. ms[j] = this.labelText
  489. }
  490. }
  491. this.enterpriseInfo.enBusinessScope = ms.join(',')
  492. } else {
  493. if (!this.enterpriseInfo.enBusinessScope) {
  494. this.enterpriseInfo.enBusinessScope = this.labelText
  495. } else {
  496. this.enterpriseInfo.enBusinessScope += ',' + this.labelText
  497. }
  498. }
  499. this.labelText = ''
  500. this.IsChange = ''
  501. this.scopeLabel = this.enterpriseInfo.enBusinessScope.split(',')
  502. // this.enterpriseInfo.enBusinessScope.push(this.labelText)
  503. },
  504. swtichTab(_tp) {
  505. this.activeType = _tp
  506. this.storeState = 'look'
  507. this.isSearchSearchingMore = true
  508. this.updateEnterpriseInfo()
  509. },
  510. updateEnterpriseInfo() {
  511. this.enterpriseInfo = {}
  512. this.hidelook = true
  513. this.Islook = true
  514. this.admininfo = {}
  515. this.labelText = ''
  516. this.normalText = ''
  517. this.clearInfo()
  518. // let str = JSON.stringify(this.$store.state.supplier.material.enUser.data)
  519. // this.enterpriseInfo = JSON.parse(str)
  520. this.$store.dispatch('loadStoreStatus', { op: 'check' }).then(() => {
  521. if (this.storeInfo.enUU) {
  522. this.$store.dispatch('supplier/loadEnUser', {enUU: this.storeInfo.enUU, filter: 'enUU'}).then(() => {
  523. this.scopeLabel = this.enterpriseInfo.enBusinessScope ? this.enterpriseInfo.enBusinessScope.split(',') : []
  524. if (!this.enterpriseInfo.enAdminuu) {
  525. this.isSearchSearchingMore = false
  526. return false
  527. }
  528. this.$http.get(`/basic/user/getUserByUU?uu=${this.enterpriseInfo.enAdminuu}`).then(res => {
  529. this.admininfo = res.data
  530. this.isSearchSearchingMore = false
  531. })
  532. })
  533. }
  534. })
  535. },
  536. updateInfo() {
  537. this.storeState = 'update'
  538. },
  539. dealWithText2(tp) {
  540. if (tp === 'open') {
  541. this.Islook = false
  542. this.hidelook = false
  543. } else {
  544. this.Islook = true
  545. this.hidelook = true
  546. }
  547. },
  548. dealWithText(_T) {
  549. if (_T !== undefined) {
  550. // 文本处理
  551. this.normalText = _T
  552. if (_T.length < 140) {
  553. this.Islook = false
  554. return _T
  555. } else {
  556. this.Islook = true
  557. return _T.substr(0, 140) + '...'
  558. }
  559. } else {
  560. this.Islook = false
  561. return this.normalText
  562. }
  563. },
  564. scroll: function () {
  565. // let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
  566. if (this.$refs.searchSeekInput && this.$store.state.mobile.InputGetFocus) {
  567. this.$refs.searchSeekInput.blur()
  568. }
  569. },
  570. blur: function() {
  571. setTimeout(() => {
  572. this.$store.dispatch('mobile/SetInputGetFocus', false)
  573. }, 300)
  574. },
  575. inputGetFocus: function() {
  576. setTimeout(() => {
  577. this.$store.dispatch('mobile/SetInputGetFocus', true)
  578. }, 300)
  579. },
  580. storeInfosave(_tp) {
  581. if (_tp === 'cancel') {
  582. this.clearInfo()
  583. this.scopeLabel = []
  584. let str = JSON.stringify(this.$store.state.supplier.material.enUser.data)
  585. this.enterpriseInfo = JSON.parse(str)
  586. if (this.enterpriseInfo.enBusinessScope) {
  587. this.scopeLabel = this.enterpriseInfo.enBusinessScope.split(',')
  588. }
  589. return
  590. }
  591. if (this.activeType === 'store') {
  592. if (!this.storeInfo) {
  593. this.collectResult = '店铺信息不能为空'
  594. this.timeoutCount++
  595. return false
  596. }
  597. if (!this.storeInfo.description || this.storeInfo.description === '') {
  598. this.collectResult = '店铺简介信息不能为空'
  599. this.timeoutCount++
  600. return false
  601. }
  602. if (!this.storeInfo.enterprise) {
  603. this.collectResult = '企业信息不能为空'
  604. this.timeoutCount++
  605. return false
  606. }
  607. if (!this.storeInfo.enterprise.address || this.storeInfo.enterprise.address === '') {
  608. this.collectResult = '企业地址不能为空'
  609. this.timeoutCount++
  610. return false
  611. }
  612. if (!this.storeInfo.enterprise.enTel || this.storeInfo.enterprise.enTel === '') {
  613. this.collectResult = '请输入正确的电话号码'
  614. this.timeoutCount++
  615. return false
  616. }
  617. if (!/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(this.storeInfo.enterprise.enPhone) && this.storeInfo.enterprise.enPhone) {
  618. this.collectResult = '请输入正确的手机号码'
  619. this.timeoutCount++
  620. return false
  621. }
  622. if (!/^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$/.test(this.storeInfo.enterprise.enWeixin) && this.storeInfo.enterprise.enWeixin) {
  623. this.collectResult = '请输入正确的微信号'
  624. this.timeoutCount++
  625. return false
  626. }
  627. if (!/^[1-9][0-9]{4,10}$/.test(this.storeInfo.enterprise.enQQ) && this.storeInfo.enterprise.enQQ) {
  628. this.collectResult = '请输入正确的QQ号'
  629. this.timeoutCount++
  630. return false
  631. }
  632. let kay = {
  633. description: this.storeInfo.description,
  634. enterprise: this.storeInfo.enterprise,
  635. storeName: this.storeInfo.storeName,
  636. storeShortName: this.storeInfo.storeShortName
  637. }
  638. this.$http.put(`/store-service/stores/${this.storeInfo.uuid}?kind=BASIC_INFO`, kay).then(res => {
  639. this.collectResult = '保存成功'
  640. this.timeoutCount++
  641. this.storeState = 'look'
  642. }).catch(err => {
  643. this.collectResult = err.response.data
  644. this.timeoutCount++
  645. let str = JSON.stringify(this.$store.state.option.storeStatus.data)
  646. this.storeInfo = JSON.parse(str)
  647. })
  648. } else {
  649. if (!this.enterpriseInfo.enAddress) {
  650. this.collectResult = '企业地址不能为空'
  651. this.timeoutCount++
  652. return false
  653. }
  654. if (!this.enterpriseInfo.enUrl) {
  655. this.collectResult = '官网地址不能为空'
  656. this.timeoutCount++
  657. return false
  658. }
  659. this.$http.post(`/basic/enterprise/${this.storeInfo.enUU}/updateInfo`, this.enterpriseInfo).then(res => {
  660. this.collectResult = '保存成功'
  661. this.timeoutCount++
  662. this.storeState = 'look'
  663. }).catch(err => {
  664. this.collectResult = err.response.data
  665. this.timeoutCount++
  666. let str = JSON.stringify(this.$store.state.supplier.material.enUser.data)
  667. this.enterpriseInfo = JSON.parse(str)
  668. })
  669. }
  670. },
  671. clearInfo() {
  672. this.storeState = 'look'
  673. this.labelText = ''
  674. this.IsChange = ''
  675. this.AddBtnShow = true
  676. }
  677. }
  678. }
  679. </script>
  680. <style scoped lang="scss">
  681. .user-content{
  682. margin-bottom: 0rem;
  683. padding-bottom: 0.98rem;
  684. ul.switch-list {
  685. li {
  686. display: inline-block;
  687. width: 50%;
  688. height: .63rem;
  689. line-height: .63rem;
  690. text-align: center;
  691. font-size: .28rem;
  692. color: #666;
  693. background: #fff;
  694. border: 1px solid #b4b4b4;
  695. border-right: none;
  696. &.active {
  697. background: #0067e7;
  698. border: 1px solid #0067e7;
  699. color: #fff;
  700. }
  701. &:first-child {
  702. border-left: none;
  703. }
  704. &:last-child {
  705. border-right: none;
  706. }
  707. }
  708. &.vendor-switch {
  709. li {
  710. width: 50%;
  711. }
  712. }
  713. }
  714. .topinfo {
  715. color: #333;
  716. font-size: 0.28rem;
  717. height: 0.8rem;
  718. line-height: 0.8rem;
  719. padding: 0 0.24rem;
  720. border-bottom: 0.01rem solid #d9d9d9;
  721. .pull-right {
  722. color: #999;
  723. font-size: 0.26rem;
  724. img {
  725. width: 0.34rem;
  726. height: 0.34rem;
  727. }
  728. }
  729. }
  730. .infoul {
  731. .upload {
  732. img {
  733. transform: rotate(180deg);
  734. }
  735. }
  736. color: #666;
  737. font-size: 0.28rem;
  738. li {
  739. padding: 0.15rem 0.05rem;
  740. line-height: 1.3;
  741. &.border {
  742. border-bottom: 0.01rem solid #d9d9d9;
  743. }
  744. &.noupdate {
  745. background: #fafafa;
  746. color: #999;
  747. }
  748. }
  749. .name {
  750. width: 1.6rem;
  751. text-align: right;
  752. }
  753. .text {
  754. width: 5.4rem;
  755. }
  756. .update {
  757. padding: 0.06rem 0 0.06rem 0rem;
  758. }
  759. input {
  760. width: 5.4rem;
  761. border: 0px solid #b4b4b4;
  762. padding: 0.06rem 0 0.06rem 0.12rem;
  763. }
  764. textarea{
  765. width: 5.4rem;
  766. padding: 0.06rem 0 0.06rem 0.12rem;
  767. min-height: 5rem;
  768. resize: none;
  769. border: 0px solid #b4b4b4;
  770. }
  771. }
  772. .control {
  773. width: 90%;
  774. margin: 0.15rem auto 0.4rem;
  775. height: .88rem;
  776. line-height: 0.88rem;
  777. }
  778. .save {
  779. border-radius: 3px;
  780. width: 48%;
  781. color: #fff;
  782. text-align: center;
  783. height: .88rem;
  784. line-height: 0.88rem;
  785. background: #3e82f5;
  786. float: right;
  787. }
  788. .cancel {
  789. border-radius: 3px;
  790. width: 48%;
  791. background: #acabab;
  792. color: #fff;
  793. text-align: center;
  794. height: .88rem;
  795. line-height: 0.88rem;
  796. float: left;
  797. }
  798. .infoul2 {
  799. .name {
  800. width: 1.7rem;
  801. }
  802. .text {
  803. width: 5.3rem;
  804. }
  805. input {
  806. width: 5.3rem;
  807. }
  808. .nolabel {
  809. position: relative;
  810. width: auto;
  811. text-align: center;
  812. color: #666;
  813. font-size: 0.24rem;
  814. display: inline-block;
  815. vertical-align: top;
  816. padding: 2px 4px;
  817. margin: 0.02rem 3px 0px;
  818. background: #f2f3f7;
  819. border-radius: 5px;
  820. }
  821. .label {
  822. max-width: 3rem;
  823. padding: 2px 4px;
  824. margin: 0.08rem 3px 0 3px;
  825. background: #5078cb;
  826. border-radius: 5px;
  827. text-align: center;
  828. color: #fff;
  829. font-size: 0.24rem;
  830. display: inline-block;
  831. vertical-align: top;
  832. }
  833. .labelKuang {
  834. background: #fff;
  835. border: 1px solid #b4b4b4;
  836. border-radius: 3px;
  837. overflow: hidden;
  838. height: 0.53rem;
  839. line-height: 0.53rem;
  840. display: inline-block;
  841. vertical-align: top;
  842. margin: 0px 3px 3px 3px;
  843. font-size: 0px;
  844. }
  845. .Updatelabel {
  846. padding: 0 4px;
  847. color: #666;
  848. font-size: 0.26rem;
  849. height: 100%;
  850. display: inline-block;
  851. vertical-align: top;
  852. max-width: 3rem;
  853. }
  854. .updatespan {
  855. background: #b5b5b5;
  856. color: #fff;
  857. font-size: 0.26rem;
  858. padding:0 2px;
  859. height: 100%;
  860. display: inline-block;
  861. vertical-align: top;
  862. }
  863. .addBtn {
  864. background-image: url('/images/mobile/@2x/addBtn.png');
  865. background-size: 100% 100%;
  866. width: 1.4rem;
  867. height: 0.54rem;
  868. display: inline-block;
  869. vertical-align: middle;
  870. }
  871. .commit {
  872. }
  873. .inputText {
  874. width: 4.4rem;
  875. border-top-left-radius: 3px;
  876. border-bottom-left-radius: 3px;
  877. border: 1px solid #b4b4b4;
  878. height: 0.62rem;
  879. line-height: 0.62rem;
  880. vertical-align: top;
  881. display: inline-block;
  882. }
  883. button {
  884. display: inline-block;
  885. height: 0.62rem;
  886. width: 0.8rem;
  887. line-height: 0.62rem;
  888. font-size: 14px;
  889. font-weight: 400;
  890. text-align: center;
  891. background-color: #3f84f6;
  892. border: 1px solid #3f84f6;
  893. color: #fff;
  894. border-top-right-radius: 3px;
  895. border-bottom-right-radius: 3px;
  896. vertical-align: top;
  897. margin-left: -0.1rem;
  898. }
  899. .moreIcon {
  900. margin-top: 0.06rem;
  901. position: relative;
  902. img {
  903. width: 0.17rem;
  904. height: 0.3rem;
  905. }
  906. &:after {
  907. position: absolute;
  908. left: -10px;
  909. right: -10px;
  910. top: -10px;
  911. bottom: -10px;
  912. content: ' '
  913. }
  914. }
  915. }
  916. .noborder {
  917. border-top: 1px solid #d9d9d9;
  918. }
  919. .modal-content {
  920. position: absolute;
  921. height: 10rem;
  922. bottom: 0px;
  923. left: 0px;
  924. background: #fff;
  925. width: 100%;
  926. border-radius: 0px;
  927. box-shadow: 0 -9px 9px rgba(0,0,0,.5);
  928. .content-title {
  929. color: #666;
  930. font-size: .3rem;
  931. text-align: center;
  932. height: 1rem;
  933. line-height: 1rem;
  934. position: relative;
  935. i {
  936. font-size: 0.3rem;
  937. color: #999;
  938. position: absolute;
  939. right: 0.3rem;
  940. top: 50%;
  941. margin-top: -0.15rem;
  942. }
  943. }
  944. .content-title-label {
  945. color: #3f84f6;
  946. font-size: 0.28rem;
  947. height: 0.5rem;
  948. line-height: 0.5rem;
  949. border-bottom: 0.01rem solid #999;
  950. div {
  951. width: 33.3%;
  952. float: left;
  953. text-align: center;
  954. a {
  955. height: 0.5rem;
  956. line-height: 0.5rem;
  957. color: #333 !important;
  958. display: inline-block;
  959. width: 80%;
  960. overflow: hidden;
  961. text-overflow: ellipsis;
  962. white-space: nowrap;
  963. &.active {
  964. color: #3e82f5 !important;
  965. border-bottom: 1px solid #3e82f5;
  966. }
  967. }
  968. }
  969. }
  970. .content-info {
  971. overflow-y: auto;
  972. height: 8.5rem;
  973. width: 100%;
  974. .content-info-item {
  975. height: 0.86rem;
  976. line-height: 0.86rem;
  977. color: #333;
  978. font-size: 0.28rem;
  979. padding-left: 0.3rem;
  980. &.active {
  981. color: #3f84f6 !important
  982. }
  983. img {
  984. width: 0.3rem;
  985. height: 0.18rem;
  986. margin-left: 0.3rem;
  987. }
  988. }
  989. }
  990. }
  991. .none-state{
  992. text-align: center;
  993. padding:1.5rem 0;
  994. background: #fff;
  995. margin-top:.1rem;
  996. width:100%;
  997. img{
  998. margin:0 auto;
  999. width: 4.08rem;
  1000. height: 2.62rem;
  1001. }
  1002. p {
  1003. font-size: .32rem;
  1004. color: #999;
  1005. margin: 1.19rem 0 0 0;
  1006. }
  1007. a {
  1008. display: block;
  1009. font-size: .28rem;
  1010. color: #fff;
  1011. width: 1.88rem;
  1012. height: .54rem;
  1013. line-height: .54rem;
  1014. background: #418bf6;
  1015. margin: .7rem auto 0;
  1016. border-radius: .05rem;
  1017. }
  1018. }
  1019. }
  1020. </style>