index.vue 35 KB

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