EnterpriseInfo.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. <template>
  2. <div id="recommend-fragment-self">
  3. <div class="recommend-product">
  4. <ul class="main-list clearfix">
  5. <li>
  6. <div>
  7. <div class="list">
  8. <div class="information-list">
  9. <div>主营产品&nbsp;:</div>
  10. <div v-if="storeInfo.description" :title="storeInfo.description">{{storeInfo.description | introduceFilter}}</div>
  11. <div v-else>—</div>
  12. </div>
  13. <div class="information-list">
  14. <div>应用领域&nbsp;:</div>
  15. <div v-if="storeInfo.storeApplication" :title="storeInfo.storeApplication">{{storeInfo.storeApplication | introduceFilter}}</div>
  16. <div v-else>—</div>
  17. </div>
  18. <div class="information-list">
  19. <div>电话&nbsp;:</div><div>{{storeInfo.enterprise.enTel || '—'}}</div>
  20. </div>
  21. <div class="information-list">
  22. <div>传真&nbsp;:</div><div>{{storeInfo.enterprise.enFax || '—'}}</div>
  23. </div>
  24. <div class="information-list">
  25. <div>手机&nbsp;:</div><div>{{storeInfo.enterprise.enPhone || '—'}}</div>
  26. </div>
  27. <div class="information-list">
  28. <div>微信&nbsp;:</div><div>{{storeInfo.enterprise.enWeixin || '—'}}</div>
  29. </div>
  30. <div class="information-list" style="padding-bottom: 10px;">
  31. <div>Q Q&nbsp;:</div><div>{{storeInfo.enterprise.enQQ || '—'}}</div>
  32. </div>
  33. <!--<div class="information-list">
  34. <div>资质审核&nbsp;:</div><div>营业执照&nbsp;&nbsp;<img src="/images/store/home/logo-qualification.jpg"></div>
  35. </div>-->
  36. </div>
  37. <div class="introduce">
  38. <div><h4>企业简介</h4></div>
  39. <p class="intro-content" v-if="storeInfo.enterprise.description">
  40. <span class="info" v-text="getIntro(storeInfo.enterprise.description)"></span>
  41. <span class="look" @click="dialogVisible = true" v-if="showMore">查看更多 <img src="/images/store/home/angle-right.png" style="margin-top:-2px;"></span>
  42. </p>
  43. <p v-else class="empty-introduce">暂无简介</p>
  44. </div>
  45. <div class="introduce qualification">
  46. <div><h4 class="prof">资质证明</h4><span @click="dialogCertificate = true">查看 <img src="/images/store/home/angle-right.png"></span></div>
  47. <!--<qualification-certificate></qualification-certificate>-->
  48. </div>
  49. <div class="product-show">
  50. <recommend-list></recommend-list>
  51. </div>
  52. </div>
  53. </li>
  54. <li>
  55. <div style="width: 962px; margin-left: 3px;">
  56. <!--<recommend-list></recommend-list>-->
  57. <commodity-list></commodity-list>
  58. </div>
  59. </li>
  60. </ul>
  61. <div class="remind-area">
  62. <img src="/images/store/store-reminds.png" alt="">
  63. 所有报价、库存信息的真实性及准确性均由店铺负责,如有疑问请点击
  64. <a @click="goLink" class="link-seller">联系卖家</a>
  65. </div>
  66. </div>
  67. <!--企业简介-->
  68. <el-dialog class="dialog-description"
  69. :visible.sync="dialogVisible"
  70. size="tiny">
  71. <div>
  72. <div class="header">
  73. <span><img src="/images/store/home/blue.png">企业简介</span>
  74. <span class="close" @click="dialogVisible = false">&times;</span>
  75. </div>
  76. <div class='content'>
  77. <p v-if="storeInfo.enterprise.description">{{storeInfo.enterprise.description}}</p>
  78. <p v-else class="empty-introduce">暂无简介</p>
  79. </div>
  80. </div>
  81. </el-dialog>
  82. <!--资质证明-->
  83. <el-dialog class="dialog-description certificate"
  84. :visible.sync="dialogCertificate"
  85. size="tiny">
  86. <div>
  87. <div class="header">
  88. <span><img src="/images/store/home/blue.png">资质证明</span>
  89. <span class="close" @click="dialogCertificate = false">&times;</span></div>
  90. <div class="content" style="height: 270px; width: 1070px; padding: 0 50px;"><qualification-certificate></qualification-certificate></div>
  91. </div>
  92. </el-dialog>
  93. <!--联系卖家-->
  94. <link-saler-box
  95. :tel="tel"
  96. v-if="showLinkBox"
  97. @cancelAction="showLinkBox = false">
  98. </link-saler-box>
  99. </div>
  100. </template>
  101. <script>
  102. import Buy from '~components/common/buyOrCar/buyComponent.vue'
  103. import RecommendList from './RecommendList.vue'
  104. import CommodityList from './CommodityList.vue'
  105. import QualificationCertificate from './QualificationCertificate.vue'
  106. import LinkSalerBox from '~components/common/LinkSalerBox.vue'
  107. export default {
  108. name: 'product-recommend-self',
  109. data () {
  110. return {
  111. dialogVisible: false,
  112. dialogCertificate: false,
  113. showMore: false,
  114. showLinkBox: false
  115. }
  116. },
  117. components: {
  118. RecommendList,
  119. Buy,
  120. CommodityList,
  121. QualificationCertificate,
  122. LinkSalerBox
  123. },
  124. computed: {
  125. commodities () {
  126. return this.$store.state.shop.recommend.products.data
  127. },
  128. storeInfo () {
  129. return this.$store.state.shop.storeInfo.store.data
  130. }
  131. },
  132. filters: {
  133. introduceFilter: function (title) {
  134. if (title === '') {
  135. return title
  136. }
  137. let len = 0
  138. let index = 0
  139. for (let i = 0; i < title.length; i++) {
  140. if (index === 0 && title.charAt(i).charCodeAt(0) > 255) {
  141. len = len + 2
  142. } else {
  143. len++
  144. }
  145. if (len > 20) {
  146. index = i
  147. break
  148. }
  149. }
  150. if (index > 0) {
  151. return title.substring(0, index) + '...'
  152. } else {
  153. return title
  154. }
  155. }
  156. },
  157. methods: {
  158. // 店铺简介
  159. getIntro (text) {
  160. let realLength = this.baseUtils.getRealLen(text)
  161. if (realLength > 495) {
  162. this.showMore = true
  163. text = this.baseUtils.cutOutString(text, 495) + '...'
  164. } else {
  165. this.showMore = false
  166. }
  167. return text
  168. },
  169. // 联系卖家
  170. goLink: function () {
  171. this.baseUtils.goLinkUser(this, this.storeInfo.enUU)
  172. },
  173. buyNow: function (isBuy, item) {
  174. if (!this.$store.state.option.user.logged) {
  175. this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
  176. if (response.data) {
  177. this.$router.push('/auth/login')
  178. }
  179. })
  180. } else {
  181. if (item) {
  182. if (isBuy) {
  183. this.$http.post('trade/order/buyNow', [{
  184. uuid: item.comUuid,
  185. batchCode: item.batchCode,
  186. number: item.minBuyQty,
  187. storeid: item.storeId,
  188. storeUuid: item.storeUuid,
  189. currencyName: item.currency,
  190. minPackQty: item.minPackQty ? item.minPackQty : item.minBuyQty
  191. }])
  192. .then(response => {
  193. // window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.orderid)
  194. if (response.data.success) {
  195. if (response.data.message) {
  196. this.$message({
  197. message: response.data.message,
  198. type: 'success'
  199. })
  200. let _self = this
  201. window.setTimeout(function () {
  202. window.location.href = '/user#/order/pay/' + _self.enidfilter(response.data.data.orderid)
  203. }, 1000)
  204. } else {
  205. window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.data.orderid)
  206. }
  207. } else {
  208. if (response.data.data && response.data.data.unvailable === 1) {
  209. this.$message.error('产品信息已失效,请刷新界面')
  210. } else {
  211. this.$message.error(response.data.message)
  212. }
  213. }
  214. }, err => {
  215. console.log(err)
  216. if (item.minBuyQty > item.reserve) {
  217. this.$message.error('商品' + item.code + '的库存已经不满足起订量')
  218. }
  219. })
  220. } else {
  221. // this.$store.dispatch('user/addCar', {uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty})
  222. this.$http.post('trade/cart/add', {
  223. uuid: item.comUuid,
  224. batchCode: item.batchCode,
  225. number: item.minBuyQty,
  226. storeid: item.storeId,
  227. storeUuid: item.storeUuid,
  228. currencyName: item.currency,
  229. minPackQty: item.minPackQty ? item.minPackQty : item.minBuyQty
  230. })
  231. .then(response => {
  232. if (response.data.success) {
  233. if (response.data.message) {
  234. this.$message({
  235. message: '添加购物车成功,但商品信息有更新',
  236. type: 'success'
  237. })
  238. } else {
  239. this.$message({
  240. message: '添加购物车成功',
  241. type: 'success'
  242. })
  243. }
  244. } else {
  245. this.$message.error(response.data.message)
  246. }
  247. })
  248. }
  249. }
  250. }
  251. },
  252. enidfilter: function (str) {
  253. if (str) {
  254. let encryptStr = '' // 最终返回的加密后的字符串
  255. // 产生三位随机数
  256. let num = ''
  257. for (let i = 0; i < 3; i++) {
  258. num += Math.floor(Math.random() * 10)
  259. }
  260. encryptStr += num // 产生3位随机数
  261. // 16位加密
  262. let tempspit = ''
  263. let strspit = str.toString().toLowerCase()
  264. if (strspit.match(/^[-+]?\d*$/) === null) { // 非整数字符,对每一个字符都转换成16进制,然后拼接
  265. /**
  266. * Unicode汉字、英文字母、数字的unicode范围
  267. *汉字:[0x4e00,0x9fa5](或十进制[19968,40869])
  268. *数字:[0x30,0x39](或十进制[48, 57])
  269. *小写字母:[0x61,0x7a](或十进制[97, 122])
  270. *大写字母:[0x41,0x5a](或十进制[65, 90]
  271. * 'a'的Unicode编码:'&#97;',charCodeAt()的值是97
  272. * '码'的Unicode编码:'\u7801', new String('码').charCodeAt()的值是30721,30721的16进制表示是7801
  273. */
  274. let s = strspit.split('')
  275. for (let i = 0; i < s.length; i++) {
  276. s[i] = s[i].charCodeAt() // 先转换成Unicode编码
  277. s[i] = s[i].toString(16)
  278. // 因为在服务器是每两位当做一个字符进行解析的,所以这里每个字符的Unicode编码范围必须在0——255之间。数字和大小写满足该要求,特殊字符则不一定,如果后续有特殊字符的要求,需要重写编码器和解码器
  279. if (s[i].length === 1) {
  280. s[i] = '0' + s[i]
  281. }
  282. tempspit = tempspit + s[i]
  283. }
  284. tempspit = tempspit + '{' + 1 // 1代表字符
  285. } else { // 数字直接转换成16进制
  286. strspit = parseInt(strspit)
  287. .toString(16)
  288. tempspit = strspit + '{' + 0 // 0代表纯数字
  289. }
  290. let temp = tempspit.split('{') // 对要加密的字符转换成16进制
  291. let numLength = temp[0].length // 转换后的字符长度
  292. numLength = numLength.toString(16) // 字符长度换算成16进制
  293. if (numLength.length === 1) { // 如果是1,补一个0
  294. numLength = '0' + numLength
  295. } else if (numLength.length > 3) { // 转换后的16进制字符长度如果大于2位数,则返回,不支持
  296. return ''
  297. }
  298. encryptStr += numLength
  299. if (temp[1] === '0') {
  300. encryptStr += 0
  301. } else if (temp[1] === '1') {
  302. encryptStr += 1
  303. }
  304. encryptStr += temp[0]
  305. if (encryptStr.length < 20) { // 如果小于20位,补上随机数
  306. // 产生三位随机数
  307. let numtwo = ''
  308. for (let i = 0; i < 20 - encryptStr.length; i++) {
  309. numtwo += Math.floor(Math.random() * 10)
  310. }
  311. let ran = numtwo // 产生3位随机数
  312. encryptStr += ran
  313. }
  314. return encryptStr
  315. }
  316. }
  317. }
  318. }
  319. </script>
  320. <style lang="scss" scoped>
  321. #recommend-fragment-self {
  322. min-width: 1190px;
  323. background: #ece9ec;
  324. margin:-18px 0px 0 0px;
  325. .recommend-product {
  326. position: relative;
  327. width: 1190px;
  328. margin: 0 auto;
  329. padding-bottom: 50px;
  330. .main-list {
  331. width: 100%;
  332. /*overflow: hidden;*/
  333. > li {
  334. position: relative;
  335. float: left;
  336. width: 962px;
  337. margin-left: 9px;
  338. &:first-child {
  339. width: 218px;
  340. /*height: 356px;*/
  341. /*background: #fff;*/
  342. margin: -5px 0 0 1px;
  343. border-radius: 5px;
  344. .list{
  345. margin-top: -20px;
  346. height: 170px;
  347. border-radius: 5px;
  348. background: #fff;
  349. .information-list {
  350. font-size: 12px;
  351. color: #333;
  352. margin-bottom: 3px;
  353. /*background: #fff;*/
  354. &:first-child{
  355. /*padding-top: 10px;*/
  356. }
  357. div:first-child {
  358. width: 72px;
  359. text-align: right;
  360. line-height: 20px;
  361. }
  362. div:last-child {
  363. width: 158px;
  364. line-height: 20px;
  365. padding: 0px 0px 0px 6px;
  366. }
  367. }
  368. .information-list > div {
  369. display: table-cell;
  370. }
  371. }
  372. .introduce {
  373. margin-top: 15px;
  374. width: 100%;
  375. height: 336px;
  376. font-size: 12px;
  377. line-height: 15px;
  378. color: #333;
  379. background: #fff;
  380. border-radius: 5px;
  381. p{
  382. span.info{
  383. font-size: 12px;
  384. color: #333;
  385. word-break: break-all;
  386. word-wrap:break-word;
  387. }
  388. span.look {
  389. color: #3c7df5;
  390. cursor: pointer;
  391. }
  392. }
  393. div{
  394. overflow: hidden;
  395. height: 35px;
  396. h4 {
  397. float: left;
  398. background: url(/images/store/home/detail1.png) no-repeat 15% 10%;
  399. font-size: 14px;
  400. padding: 0 0 5px 30px;
  401. margin:10px 0;
  402. }
  403. h4.prof {
  404. background: url("/images/store/home/prof.png") no-repeat 15% 10%;
  405. }
  406. span{
  407. float: right;
  408. margin-top: 10px;
  409. padding-right: 10px;
  410. font-size: 12px;
  411. color: #3c7df5;
  412. cursor: pointer;
  413. img{
  414. margin-top: -3px;
  415. }
  416. }
  417. }
  418. p {
  419. margin: -7px 0px 0px 9px;
  420. text-indent: 2em;
  421. width: 200px;
  422. line-height: 19px;
  423. height: 308px;
  424. overflow: hidden;
  425. }
  426. .empty-introduce{
  427. text-align: center;
  428. line-height: 153px;
  429. color: #666;
  430. }
  431. }
  432. .qualification {
  433. height: 35px;
  434. min-height: 35px;
  435. }
  436. .product-show{
  437. margin-top: 8px;
  438. }
  439. }
  440. }
  441. }
  442. }
  443. }
  444. </style>