index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039
  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个字符" maxlength="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. if (_newArr.length === 0) {
  468. this.scopeLabel = []
  469. } else {
  470. this.enterpriseInfo.enBusinessScope = _newArr.join(',')
  471. this.scopeLabel = this.enterpriseInfo.enBusinessScope.split(',')
  472. }
  473. return false
  474. }
  475. this.AddBtnShow = false
  476. },
  477. saveLabel() {
  478. if (this.labelText === '') {
  479. this.AddBtnShow = true
  480. return false
  481. }
  482. if (this.labelText.length > 10) {
  483. this.collectResult = '标签文字不能超过10个字'
  484. this.timeoutCount++
  485. return false
  486. }
  487. this.AddBtnShow = true
  488. if (this.IsChange !== '' && this.IsChange !== undefined) {
  489. let ms = this.enterpriseInfo.enBusinessScope.split(',')
  490. for (let j = 0; j < ms.length; j++) {
  491. if (ms[j].trim() === this.IsChange) {
  492. ms[j] = this.labelText
  493. }
  494. }
  495. this.enterpriseInfo.enBusinessScope = ms.join(',')
  496. } else {
  497. if (!this.enterpriseInfo.enBusinessScope) {
  498. this.enterpriseInfo.enBusinessScope = this.labelText
  499. } else {
  500. this.enterpriseInfo.enBusinessScope += ',' + this.labelText
  501. }
  502. }
  503. this.labelText = ''
  504. this.IsChange = ''
  505. this.scopeLabel = this.enterpriseInfo.enBusinessScope.split(',')
  506. // this.enterpriseInfo.enBusinessScope.push(this.labelText)
  507. },
  508. swtichTab(_tp) {
  509. this.activeType = _tp
  510. this.storeState = 'look'
  511. this.isSearchSearchingMore = true
  512. this.updateEnterpriseInfo()
  513. },
  514. updateEnterpriseInfo() {
  515. this.enterpriseInfo = {}
  516. this.hidelook = true
  517. this.Islook = true
  518. this.admininfo = {}
  519. this.labelText = ''
  520. this.normalText = ''
  521. this.clearInfo()
  522. // let str = JSON.stringify(this.$store.state.supplier.material.enUser.data)
  523. // this.enterpriseInfo = JSON.parse(str)
  524. this.$store.dispatch('loadStoreStatus', { op: 'check' }).then(() => {
  525. if (this.storeInfo.enUU) {
  526. this.$store.dispatch('supplier/loadEnUser', {enUU: this.storeInfo.enUU, filter: 'enUU'}).then(() => {
  527. this.scopeLabel = this.enterpriseInfo.enBusinessScope ? this.enterpriseInfo.enBusinessScope.split(',') : []
  528. if (!this.enterpriseInfo.enAdminuu) {
  529. this.isSearchSearchingMore = false
  530. return false
  531. }
  532. this.$http.get(`/basic/user/getUserByUU?uu=${this.enterpriseInfo.enAdminuu}`).then(res => {
  533. this.admininfo = res.data
  534. this.isSearchSearchingMore = false
  535. })
  536. })
  537. }
  538. })
  539. },
  540. updateInfo() {
  541. this.storeState = 'update'
  542. this.Islook = true
  543. this.hidelook = true
  544. },
  545. dealWithText2(tp) {
  546. if (tp === 'open') {
  547. this.Islook = false
  548. this.hidelook = false
  549. } else {
  550. this.Islook = true
  551. this.hidelook = true
  552. }
  553. },
  554. dealWithText(_T) {
  555. if (_T !== undefined) {
  556. // 文本处理
  557. this.normalText = _T
  558. if (_T.length < 140) {
  559. this.Islook = false
  560. return _T
  561. } else {
  562. this.Islook = true
  563. return _T.substr(0, 140) + '...'
  564. }
  565. } else {
  566. this.Islook = false
  567. return this.normalText
  568. }
  569. },
  570. scroll: function () {
  571. // let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
  572. if (this.$refs.searchSeekInput && this.$store.state.mobile.InputGetFocus) {
  573. this.$refs.searchSeekInput.blur()
  574. }
  575. },
  576. blur: function() {
  577. setTimeout(() => {
  578. this.$store.dispatch('mobile/SetInputGetFocus', false)
  579. }, 300)
  580. },
  581. inputGetFocus: function() {
  582. setTimeout(() => {
  583. this.$store.dispatch('mobile/SetInputGetFocus', true)
  584. }, 300)
  585. },
  586. storeInfosave(_tp) {
  587. if (_tp === 'cancel') {
  588. this.clearInfo()
  589. this.scopeLabel = []
  590. let str = JSON.stringify(this.$store.state.supplier.material.enUser.data)
  591. this.enterpriseInfo = JSON.parse(str)
  592. if (this.enterpriseInfo.enBusinessScope) {
  593. this.scopeLabel = this.enterpriseInfo.enBusinessScope.split(',')
  594. }
  595. return
  596. }
  597. if (this.activeType === 'store') {
  598. if (!this.storeInfo) {
  599. this.collectResult = '店铺信息不能为空'
  600. this.timeoutCount++
  601. return false
  602. }
  603. if (!this.storeInfo.description || this.storeInfo.description === '') {
  604. this.collectResult = '店铺简介信息不能为空'
  605. this.timeoutCount++
  606. return false
  607. }
  608. if (!this.storeInfo.enterprise) {
  609. this.collectResult = '企业信息不能为空'
  610. this.timeoutCount++
  611. return false
  612. }
  613. if (!this.storeInfo.enterprise.address || this.storeInfo.enterprise.address === '') {
  614. this.collectResult = '企业地址不能为空'
  615. this.timeoutCount++
  616. return false
  617. }
  618. if (!this.storeInfo.enterprise.enTel || this.storeInfo.enterprise.enTel === '') {
  619. this.collectResult = '请输入正确的电话号码'
  620. this.timeoutCount++
  621. return false
  622. }
  623. if (!/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(this.storeInfo.enterprise.enPhone) && this.storeInfo.enterprise.enPhone) {
  624. this.collectResult = '请输入正确的手机号码'
  625. this.timeoutCount++
  626. return false
  627. }
  628. if (!/^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$/.test(this.storeInfo.enterprise.enWeixin) && this.storeInfo.enterprise.enWeixin) {
  629. this.collectResult = '请输入正确的微信号'
  630. this.timeoutCount++
  631. return false
  632. }
  633. if (!/^[1-9][0-9]{4,10}$/.test(this.storeInfo.enterprise.enQQ) && this.storeInfo.enterprise.enQQ) {
  634. this.collectResult = '请输入正确的QQ号'
  635. this.timeoutCount++
  636. return false
  637. }
  638. let kay = {
  639. description: this.storeInfo.description,
  640. enterprise: this.storeInfo.enterprise,
  641. storeName: this.storeInfo.storeName,
  642. storeShortName: this.storeInfo.storeShortName
  643. }
  644. this.$http.put(`/store-service/stores/${this.storeInfo.uuid}?kind=BASIC_INFO`, kay).then(res => {
  645. this.collectResult = '保存成功'
  646. this.timeoutCount++
  647. this.storeState = 'look'
  648. }).catch(err => {
  649. this.collectResult = err.response.data
  650. this.timeoutCount++
  651. let str = JSON.stringify(this.$store.state.option.storeStatus.data)
  652. this.storeInfo = JSON.parse(str)
  653. })
  654. } else {
  655. if (!this.enterpriseInfo.enAddress) {
  656. this.collectResult = '企业地址不能为空'
  657. this.timeoutCount++
  658. return false
  659. }
  660. if (!this.enterpriseInfo.enUrl) {
  661. this.collectResult = '官网地址不能为空'
  662. this.timeoutCount++
  663. return false
  664. }
  665. this.$http.post(`/basic/enterprise/${this.storeInfo.enUU}/updateInfo`, this.enterpriseInfo).then(res => {
  666. this.collectResult = '保存成功'
  667. this.timeoutCount++
  668. this.storeState = 'look'
  669. }).catch(err => {
  670. this.collectResult = err.response.data
  671. this.timeoutCount++
  672. let str = JSON.stringify(this.$store.state.supplier.material.enUser.data)
  673. this.enterpriseInfo = JSON.parse(str)
  674. })
  675. }
  676. },
  677. clearInfo() {
  678. this.storeState = 'look'
  679. this.labelText = ''
  680. this.IsChange = ''
  681. this.AddBtnShow = true
  682. }
  683. }
  684. }
  685. </script>
  686. <style scoped lang="scss">
  687. .user-content{
  688. margin-bottom: 0rem;
  689. padding-bottom: 0.98rem;
  690. ul.switch-list {
  691. li {
  692. display: inline-block;
  693. width: 50%;
  694. height: .63rem;
  695. line-height: .63rem;
  696. text-align: center;
  697. font-size: .28rem;
  698. color: #666;
  699. background: #fff;
  700. border: 1px solid #b4b4b4;
  701. border-right: none;
  702. &.active {
  703. background: #0067e7;
  704. border: 1px solid #0067e7;
  705. color: #fff;
  706. }
  707. &:first-child {
  708. border-left: none;
  709. }
  710. &:last-child {
  711. border-right: none;
  712. }
  713. }
  714. &.vendor-switch {
  715. li {
  716. width: 50%;
  717. }
  718. }
  719. }
  720. .topinfo {
  721. color: #333;
  722. font-size: 0.28rem;
  723. height: 0.8rem;
  724. line-height: 0.8rem;
  725. padding: 0 0.24rem;
  726. border-bottom: 0.01rem solid #d9d9d9;
  727. .pull-right {
  728. color: #999;
  729. font-size: 0.26rem;
  730. img {
  731. width: 0.34rem;
  732. height: 0.34rem;
  733. }
  734. }
  735. }
  736. .infoul {
  737. .upload {
  738. img {
  739. transform: rotate(180deg);
  740. }
  741. }
  742. color: #666;
  743. font-size: 0.28rem;
  744. li {
  745. padding: 0.15rem 0.05rem;
  746. line-height: 1.3;
  747. &.border {
  748. border-bottom: 0.01rem solid #d9d9d9;
  749. }
  750. &.noupdate {
  751. background: #fafafa;
  752. color: #999;
  753. }
  754. }
  755. .name {
  756. width: 1.6rem;
  757. text-align: right;
  758. }
  759. .text {
  760. width: 5.4rem;
  761. }
  762. .update {
  763. padding: 0.06rem 0 0.06rem 0rem;
  764. }
  765. input {
  766. width: 5.4rem;
  767. border: 0px solid #b4b4b4;
  768. padding: 0.06rem 0 0.06rem 0.12rem;
  769. }
  770. textarea{
  771. width: 5.4rem;
  772. padding: 0.06rem 0 0.06rem 0.12rem;
  773. min-height: 5rem;
  774. resize: none;
  775. border: 0px solid #b4b4b4;
  776. }
  777. }
  778. .control {
  779. width: 90%;
  780. margin: 0.15rem auto 0.4rem;
  781. height: .88rem;
  782. line-height: 0.88rem;
  783. }
  784. .save {
  785. border-radius: 3px;
  786. width: 48%;
  787. color: #fff;
  788. text-align: center;
  789. height: .88rem;
  790. line-height: 0.88rem;
  791. background: #3e82f5;
  792. float: right;
  793. }
  794. .cancel {
  795. border-radius: 3px;
  796. width: 48%;
  797. background: #acabab;
  798. color: #fff;
  799. text-align: center;
  800. height: .88rem;
  801. line-height: 0.88rem;
  802. float: left;
  803. }
  804. .infoul2 {
  805. .name {
  806. width: 1.7rem;
  807. }
  808. .text {
  809. width: 5.3rem;
  810. }
  811. input {
  812. width: 5.3rem;
  813. }
  814. .nolabel {
  815. position: relative;
  816. width: auto;
  817. text-align: center;
  818. color: #666;
  819. font-size: 0.24rem;
  820. display: inline-block;
  821. vertical-align: top;
  822. padding: 2px 4px;
  823. margin: 0.02rem 3px 0px;
  824. background: #f2f3f7;
  825. border-radius: 5px;
  826. }
  827. .label {
  828. max-width: 3rem;
  829. padding: 2px 4px;
  830. margin: 0.08rem 3px 0 3px;
  831. background: #5078cb;
  832. border-radius: 5px;
  833. text-align: center;
  834. color: #fff;
  835. font-size: 0.24rem;
  836. display: inline-block;
  837. vertical-align: top;
  838. }
  839. .labelKuang {
  840. background: #fff;
  841. border: 1px solid #b4b4b4;
  842. border-radius: 3px;
  843. overflow: hidden;
  844. height: 0.53rem;
  845. line-height: 0.53rem;
  846. display: inline-block;
  847. vertical-align: top;
  848. margin: 0px 3px 3px 3px;
  849. font-size: 0px;
  850. }
  851. .Updatelabel {
  852. padding: 0 4px;
  853. color: #666;
  854. font-size: 0.26rem;
  855. height: 100%;
  856. display: inline-block;
  857. vertical-align: top;
  858. max-width: 3rem;
  859. }
  860. .updatespan {
  861. background: #b5b5b5;
  862. color: #fff;
  863. font-size: 0.26rem;
  864. padding:0 2px;
  865. height: 100%;
  866. display: inline-block;
  867. vertical-align: top;
  868. }
  869. .addBtn {
  870. background-image: url('/images/mobile/@2x/addBtn.png');
  871. background-size: 100% 100%;
  872. width: 1.4rem;
  873. height: 0.54rem;
  874. display: inline-block;
  875. vertical-align: middle;
  876. }
  877. .commit {
  878. }
  879. .inputText {
  880. width: 4.4rem;
  881. border-top-left-radius: 3px;
  882. border-bottom-left-radius: 3px;
  883. border: 1px solid #b4b4b4;
  884. height: 0.62rem;
  885. line-height: 0.62rem;
  886. vertical-align: top;
  887. display: inline-block;
  888. }
  889. button {
  890. display: inline-block;
  891. height: 0.62rem;
  892. width: 0.8rem;
  893. line-height: 0.62rem;
  894. font-size: 14px;
  895. font-weight: 400;
  896. text-align: center;
  897. background-color: #3f84f6;
  898. border: 1px solid #3f84f6;
  899. color: #fff;
  900. border-top-right-radius: 3px;
  901. border-bottom-right-radius: 3px;
  902. vertical-align: top;
  903. margin-left: -0.1rem;
  904. }
  905. .moreIcon {
  906. margin-top: 0.06rem;
  907. position: relative;
  908. img {
  909. width: 0.17rem;
  910. height: 0.3rem;
  911. }
  912. &:after {
  913. position: absolute;
  914. left: -10px;
  915. right: -10px;
  916. top: -10px;
  917. bottom: -10px;
  918. content: ' '
  919. }
  920. }
  921. }
  922. .noborder {
  923. border-top: 1px solid #d9d9d9;
  924. }
  925. .modal-content {
  926. position: absolute;
  927. height: 10rem;
  928. bottom: 0px;
  929. left: 0px;
  930. background: #fff;
  931. width: 100%;
  932. border-radius: 0px;
  933. box-shadow: 0 -9px 9px rgba(0,0,0,.5);
  934. .content-title {
  935. color: #666;
  936. font-size: .3rem;
  937. text-align: center;
  938. height: 1rem;
  939. line-height: 1rem;
  940. position: relative;
  941. i {
  942. font-size: 0.3rem;
  943. color: #999;
  944. position: absolute;
  945. right: 0.3rem;
  946. top: 50%;
  947. margin-top: -0.15rem;
  948. }
  949. }
  950. .content-title-label {
  951. color: #3f84f6;
  952. font-size: 0.28rem;
  953. height: 0.5rem;
  954. line-height: 0.5rem;
  955. border-bottom: 0.01rem solid #999;
  956. div {
  957. width: 33.3%;
  958. float: left;
  959. text-align: center;
  960. a {
  961. height: 0.5rem;
  962. line-height: 0.5rem;
  963. color: #333 !important;
  964. display: inline-block;
  965. width: 80%;
  966. overflow: hidden;
  967. text-overflow: ellipsis;
  968. white-space: nowrap;
  969. &.active {
  970. color: #3e82f5 !important;
  971. border-bottom: 1px solid #3e82f5;
  972. }
  973. }
  974. }
  975. }
  976. .content-info {
  977. overflow-y: auto;
  978. height: 8.5rem;
  979. width: 100%;
  980. .content-info-item {
  981. height: 0.86rem;
  982. line-height: 0.86rem;
  983. color: #333;
  984. font-size: 0.28rem;
  985. padding-left: 0.3rem;
  986. &.active {
  987. color: #3f84f6 !important
  988. }
  989. img {
  990. width: 0.3rem;
  991. height: 0.18rem;
  992. margin-left: 0.3rem;
  993. }
  994. }
  995. }
  996. }
  997. .none-state{
  998. text-align: center;
  999. padding:1.5rem 0;
  1000. background: #fff;
  1001. margin-top:.1rem;
  1002. width:100%;
  1003. img{
  1004. margin:0 auto;
  1005. width: 4.08rem;
  1006. height: 2.62rem;
  1007. }
  1008. p {
  1009. font-size: .32rem;
  1010. color: #999;
  1011. margin: 1.19rem 0 0 0;
  1012. }
  1013. a {
  1014. display: block;
  1015. font-size: .28rem;
  1016. color: #fff;
  1017. width: 1.88rem;
  1018. height: .54rem;
  1019. line-height: .54rem;
  1020. background: #418bf6;
  1021. margin: .7rem auto 0;
  1022. border-radius: .05rem;
  1023. }
  1024. }
  1025. }
  1026. </style>