index.vue 35 KB

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