index.vue 34 KB

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