index.vue 35 KB

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