information.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  1. <template name="sale">
  2. <view class="container">
  3. <view :style="statusBarHeight" class="status_bar">
  4. </view>
  5. <!-- 小程序头部兼容 -->
  6. <!-- #ifdef MP -->
  7. <!-- <view class="mp-search-box">
  8. <input @click="naviageToPage('/pages/product/search')" class="ser-input" type="text" value="输入关键字搜索" disabled />
  9. </view> -->
  10. <!-- #endif -->
  11. <!-- 头部轮播 -->
  12. <view class="carousel-section">
  13. <swiper class="screen-swiper header-swiper" ::class="dotStyle?'square-dot':'round-dot'"
  14. :indicator-dots="true" :circular="true" :autoplay="true" interval="5000" @change="swiperChange"
  15. indicator-color="#8799a3" indicator-active-color="#0081ff">
  16. <swiper-item class="swiper-item" v-for="(item,index) in carouselList" :key="index"
  17. :class="cardCur==index?'text-white':''" @click="naviageToPage(item.url)">
  18. <image :src="item.imgUrl"></image>
  19. <!-- <view style='position:absolute;top:50%;left:50%;transform: translate(-50%,-50%);'>11111</view> -->
  20. </swiper-item>
  21. </swiper>
  22. <!-- <view class="swiper-dots">
  23. <text class="num">{{swiperCurrent+1}}</text>
  24. <text class="sign">/</text>
  25. <text class="num">{{swiperLength}}</text>
  26. </view> -->
  27. </view>
  28. <!-- <swiper-up :list="infoList"></swiper-up> -->
  29. <view class="guess-section-wrap">
  30. <view class='flex justify-between'>
  31. <view class='title Medium'>工厂价格</view>
  32. <view class='Regular' style='color:#B2B3BB;' @click='more("/pages/sale/plant")'>更多</view>
  33. </view>
  34. <swiper class="screen-swiper header-swiper" :autoplay="true" interval="6000" duration="500" :circular="true"
  35. :acceleration="true" style="min-height: 820rpx;">
  36. <swiper-item class="" v-for="(item1,index) in factoryPriceData.list" :key="index">
  37. <view class=' guess-section-wrap-item clearfix' v-for='(item,index1) in item1' :key="index1">
  38. <view class='factory'>{{item.factory}}</view>
  39. <view class='wrap'>{{item.city}} {{item.factoryType}}</view>
  40. <view class='price'>
  41. <text class='currectprice'>{{item.price}}</text>
  42. <text class='currectprice-text'>较昨日</text>
  43. <image v-if='item.comparePrice>0' style="width:7.5px;height:9px;"
  44. src='../../static/img/homepage/shangsheng.png'></image>
  45. <image v-if='item.comparePrice<0' style="width:7.5px;height:9px;"
  46. src='../../static/img/homepage/xiajiang.png'></image>
  47. <text v-if='item.comparePrice>0' class='yesterday up'>{{item.comparePrice}}</text>
  48. <text v-if='item.comparePrice<0' class='yesterday down'>{{-item.comparePrice}}</text>
  49. <text v-if='item.comparePrice==0' class='yesterday'>-</text>
  50. </view>
  51. <view style='color:#B2B3BB;' class='flex'>
  52. <view class="port-number-style ">
  53. <image style='width:11px;height:11px;' src='../../static/img/homepage/water@3x.png'>
  54. </image>
  55. <={{item.waterContent}} </view>
  56. <view class="port-number-style">
  57. <image style='width:11px;height:11px;'
  58. src='../../static/img/homepage/unitweight@3x.png'></image>
  59. >={{item.bulkDensity}}
  60. </view>
  61. </view>
  62. </view>
  63. </swiper-item>
  64. </swiper>
  65. </view>
  66. <view class="guess-section-wrap">
  67. <view class='flex justify-between'>
  68. <view class='title Medium'>港口价格</view>
  69. <view class='Regular' style='color:#B2B3BB;' @click='more("/pages/sale/portprice")'>更多</view>
  70. </view>
  71. <!-- <uni-notice-bar scrollable="true" single="true" background-color="white" :portList="portList" ></uni-notice-bar> -->
  72. <swiper class="screen-swiper header-swiper-port" :autoplay="true" interval="6000" duration="500"
  73. :circular="true" :acceleration="true">
  74. <swiper-item class="" v-for="(item,index) in portList" :key="index">
  75. <view class='guess-section-wrap-item clearfix'>
  76. <!-- <view class='guess-section-wrap-item clearfix' v-for='(item,index1) in item1' :key="index1"> -->
  77. <view class='factory'>{{item.port}}</view>
  78. <view class='wrap'>{{item.goodsName}}</view>
  79. <view class='price'>
  80. <text class='currectprice '>{{item.price}}</text>
  81. 较昨日
  82. <image v-if='item.comparePrice>0' style="width:7.5px;height:9px;"
  83. src='../../static/img/homepage/shangsheng.png'></image>
  84. <image v-if='item.comparePrice<0' style="width:7.5px;height:9px;"
  85. src='../../static/img/homepage/xiajiang.png'></image>
  86. <text v-if='item.comparePrice>0' class='yesterday up'>{{item.comparePrice}}</text>
  87. <text v-if='item.comparePrice<0' class='yesterday down'>{{-item.comparePrice}}</text>
  88. <text v-if='item.comparePrice==0' class='yesterday'>-</text>
  89. </view>
  90. <view style='color:#B2B3BB;' class='flex'>
  91. <view class="port-number-style ">
  92. <image style='width:11px;height:11px;' src='../../static/img/homepage/water@3x.png'>
  93. </image>
  94. <={{item.waterContent}} </view>
  95. <view class="port-number-style">
  96. <image style='width:11px;height:11px;'
  97. src='../../static/img/homepage/unitweight@3x.png'></image>
  98. >={{item.bulkDensity}}
  99. </view>
  100. </view>
  101. </view>
  102. </swiper-item>
  103. </swiper>
  104. </view>
  105. <view class="guess-section-wrap1">
  106. <view style='padding:15px;' class='flex justify-between'>
  107. <view class='title Medium'>行业新闻</view>
  108. <view class='Regular' style='color:#B2B3BB;' @click="more('/pages/sale/newsinfo')">更多</view>
  109. </view>
  110. <view style='border-bottom:1px solid #EEEEEE;' class='guess-section-wrap-content1'>
  111. <view style='border-bottom:1px solid #eee;padding:15px;' class='flex justify-between'
  112. v-for='(item, index) in newsInfo' :key="index" @click="navToDetailPage(item.id)">
  113. <view>
  114. <view class="list-row-titel Regular">{{item.title}}</view>
  115. <view style='color:#B2B3BB;font-size:12px;' class="Regular"><text
  116. style='margin-right:5px;'>{{item.from}}</text>{{item.gmtUpdate}}</view>
  117. </view>
  118. <view>
  119. <image style='width:100px;height:72px;border-radius:5px;' :src='item.titleImg'></image>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <u-back-top :scroll-top="scrollTop" mode="circle" icon="arrow-upward"></u-back-top>
  125. </view>
  126. </template>
  127. <script>
  128. import {
  129. formatDate
  130. } from '@/common/date.js';
  131. import dragButton from "@/components/drag-button/drag-button.vue";
  132. import swiperUp from "@/components/swiperup.vue";
  133. import {
  134. mapState
  135. } from 'vuex';
  136. export default {
  137. components: {
  138. dragButton,
  139. swiperUp
  140. },
  141. name: "sale",
  142. data() {
  143. return {
  144. titleNViewBackground: '',
  145. swiperCurrent: 0,
  146. swiperLength: 0,
  147. carouselList: [],
  148. windowSpuList: [],
  149. categoryPickList: [],
  150. categoryButtomList: [],
  151. salesTop: [],
  152. saleInfo: [],
  153. portInfo: [],
  154. plantList: [],
  155. portList: [],
  156. banner: undefined,
  157. isVip: false,
  158. pages: 1, //页数
  159. limit: 10, //每次取条目数
  160. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  161. isLoadMore: false, //是否加载中
  162. showTran: true,
  163. list: [],
  164. scrollTop: 0,
  165. cardCur: 0,
  166. dotStyle: false,
  167. newsInfo: [],
  168. categoryList: [],
  169. pages: 1, //页数
  170. limit: 10, //每次取条目数
  171. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  172. TabCur: 0,
  173. category: 0,
  174. current: 0,
  175. infoList1: [],
  176. statusBarHeight: "height:",
  177. factoryPriceData: {},
  178. portPriceData: {}
  179. };
  180. },
  181. onShow() {
  182. uni.hideKeyboard()
  183. uni.showTabBar()
  184. this.pages = 1
  185. this.isLoadMore = false
  186. this.loadStatus = 'more'
  187. this.loadData()
  188. var userInfo = uni.getStorageSync("userInfo")
  189. var that = this
  190. uni.removeTabBarBadge({
  191. index: 4
  192. })
  193. this.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
  194. console.log("noticeNumber", res)
  195. if (res.data.data) {
  196. let name = 'myTip';
  197. let value = res.data.data.total;
  198. that.$store.commit('$uStore', {
  199. name,
  200. value
  201. });
  202. if (value != 0 && value) {
  203. uni.setTabBarBadge({
  204. index: 4,
  205. text: value + ""
  206. })
  207. }
  208. name = 'taskTip';
  209. value = res.data.data.total;
  210. that.$store.commit('$uStore', {
  211. name,
  212. value
  213. });
  214. // name = 'contractTip';
  215. // value = res.data.data.contractTip;
  216. // that.$store.commit('$uStore', {
  217. // name,
  218. // value
  219. // });
  220. }
  221. })
  222. },
  223. onLoad(options) {
  224. const value = uni.getStorageSync('launchFlag');
  225. if (value) {} else {
  226. uni.navigateTo({
  227. url: '/pages/index/index'
  228. });
  229. }
  230. var that = this
  231. uni.getSystemInfo({
  232. success: function(res) {
  233. console.log("statusBarHeight", res.statusBarHeight)
  234. that.statusBarHeight += res.statusBarHeight + "px"; //这就是状态栏的高度
  235. },
  236. });
  237. var infoList = [];
  238. // uni.request({
  239. // url: "https://hq.sinajs.cn/list=C0,C2109,C2111,C2201,C2203,C2205,C2207,A0,A2109,A2111,A2201,A2203,A2205,A2207",
  240. // // url: "https://hq.sinajs.cn/list=C2109",
  241. // header: {
  242. // 'content-type': 'application/x-www-form-urlencoded'
  243. // },
  244. // success: function(result) {
  245. // // resolve调用后,即可传递到调用方使用then或者async+await同步方式进行处理逻辑
  246. // var tmp = result.data.split('"')
  247. // for (var i = 1; i < tmp.length; i = i + 2) {
  248. // var list = tmp[i].split(",")
  249. // var data = {
  250. // goodsName: list[0],
  251. // newPrice: list[6],
  252. // openPrice: list[2]
  253. // }
  254. // if (data.goodsName) {
  255. // infoList.push(data)
  256. // }
  257. // }
  258. // let name = 'infoList';
  259. // let value = infoList;
  260. // that.$store.commit('$uStore', {
  261. // name,
  262. // value
  263. // });
  264. // // console.log("infoList",infoList)
  265. // },
  266. // fail: function(e) {
  267. // console.log('error in...')
  268. // // reject调用后,即可传递到调用方使用catch或者async+await同步方式进行处理逻辑
  269. // reject(e)
  270. // },
  271. // })
  272. uni.showTabBar()
  273. this.pages = 1
  274. this.isLoadMore = false
  275. this.loadStatus = 'more'
  276. this.loadData()
  277. var userInfo = uni.getStorageSync("userInfo")
  278. },
  279. onPageScroll(e) {
  280. this.scrollTop = e.scrollTop;
  281. },
  282. onReachBottom() { //上拉触底函数
  283. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  284. this.isLoadMore = true
  285. this.pages += 1
  286. this.getMoreData()
  287. }
  288. },
  289. onPullDownRefresh() {
  290. this.pages = 1
  291. this.isLoadMore = false
  292. this.loadStatus = 'loading'
  293. this.loadData()
  294. setTimeout(function() {
  295. uni.stopPullDownRefresh();
  296. }, 1000);
  297. },
  298. computed: {
  299. ...mapState(['hasLogin', 'userInfo'])
  300. },
  301. methods: {
  302. // makeportScrollData(valList) {
  303. // console.log(valList)
  304. // let _rowCount = valList.length;
  305. // let _pageSize = 2
  306. // let _newArray = []
  307. // if (_rowCount == null || _rowCount == "") {
  308. // this.portPriceData.totalPage = 0;
  309. // } else {
  310. // if (_pageSize != 0 && _rowCount % _pageSize == 0) {
  311. // this.portPriceData.totalPage = parseInt(_rowCount / _pageSize)
  312. // }
  313. // if (_pageSize != 0 && _rowCount % _pageSize != 0) {
  314. // this.portPriceData.totalPage = parseInt(_rowCount / _pageSize) + 1;
  315. // }
  316. // }
  317. // for (let i = 0; i < valList.length; i += 2) {
  318. // _newArray.push(valList.slice(i, i + 2))
  319. // }
  320. // this.portPriceData.list = _newArray
  321. // },
  322. makeScrollData(valList, size) {
  323. console.log(valList)
  324. let _rowCount = valList.length;
  325. let _pageSize = size
  326. let _newArray = []
  327. if (_rowCount == null || _rowCount == "") {
  328. if (size == 8) {
  329. this.factoryPriceData.totalPage = 0;
  330. } else {
  331. this.portPriceData.totalPage = 0;
  332. }
  333. } else {
  334. if (_pageSize != 0 && _rowCount % _pageSize == 0) {
  335. if (size == 8) {
  336. this.factoryPriceData.totalPage = parseInt(_rowCount / _pageSize)
  337. } else {
  338. this.portPriceData.totalPage = parseInt(_rowCount / _pageSize)
  339. }
  340. }
  341. if (_pageSize != 0 && _rowCount % _pageSize != 0) {
  342. if (size == 8) {
  343. this.factoryPriceData.totalPage = parseInt(_rowCount / _pageSize) + 1;
  344. } else {
  345. this.portPriceData.totalPage = parseInt(_rowCount / _pageSize) + 1;
  346. }
  347. }
  348. }
  349. for (let i = 0; i < valList.length; i += size) {
  350. _newArray.push(valList.slice(i, i + size))
  351. }
  352. if (size == 8) {
  353. this.factoryPriceData.list = _newArray
  354. } else {
  355. this.portPriceData.list = _newArray
  356. }
  357. },
  358. more(url) {
  359. console.log(url)
  360. uni.navigateTo({
  361. url: url
  362. })
  363. },
  364. DotStyle(e) {
  365. this.dotStyle = e.detail.value
  366. },
  367. cardSwiper(e) {
  368. this.cardCur = e.detail.current
  369. },
  370. hangqing() {
  371. uni.navigateTo({
  372. url: `/pageB/news/news`
  373. })
  374. },
  375. tabSelect(e) {
  376. this.TabCur = e.currentTarget.dataset.id;
  377. this.category = this.TabCur
  378. this.pages = 1
  379. this.loadData()
  380. },
  381. async loadData() {
  382. console.log("sale loadData pages " + this.pages)
  383. const that = this
  384. // 新闻类型
  385. // uni.showLoading({
  386. // title: '正在加载',
  387. // })
  388. that.$api.request('dict', 'getDictDataList', {
  389. dictType: "news_type"
  390. }, failres => {
  391. that.$api.msg(failres.errmsg)
  392. uni.hideLoading()
  393. }).then(res => {
  394. let data = res.data
  395. that.categoryList = data
  396. uni.hideLoading()
  397. })
  398. // 工厂价格
  399. that.$api.request('news', 'getFactoryPriceInfo', {
  400. category: this.category,
  401. page: 1,
  402. limit: 2
  403. }, failres => {
  404. that.$api.msg(failres.errmsg)
  405. this.isLoadMore = false
  406. this.loadStatus = 'nomore'
  407. if (this.pages > 1) {
  408. this.pages = 1
  409. }
  410. uni.hideLoading()
  411. }).then(res => {
  412. let data = res.data
  413. that.plantList = data
  414. that.makeScrollData(that.plantList, 8)
  415. uni.hideLoading()
  416. })
  417. // 港口价格
  418. that.$api.request('news', 'getPortPriceInfo', {
  419. category: this.category,
  420. page: 1,
  421. limit: 2
  422. }, failres => {
  423. that.$api.msg(failres.errmsg)
  424. this.isLoadMore = false
  425. this.loadStatus = 'nomore'
  426. if (this.pages > 1) {
  427. this.pages = 1
  428. }
  429. uni.hideLoading()
  430. }).then(res => {
  431. let data = res.data
  432. that.portList = data
  433. that.makeScrollData(that.portList, 2)
  434. uni.hideLoading()
  435. })
  436. // 新闻内容
  437. that.$api.request('news', 'getNewsInfo', {
  438. category: 2,
  439. page: 1,
  440. limit: 10
  441. }, failres => {
  442. that.$api.msg(failres.errmsg)
  443. this.isLoadMore = false
  444. this.loadStatus = 'nomore'
  445. if (this.pages > 1) {
  446. this.pages = 1
  447. }
  448. uni.hideLoading()
  449. }).then(res => {
  450. let data = res.data
  451. for (var k = 0; k < data.length; k++) {
  452. if (data[k].title.length > 20) {
  453. data[k].title = data[k].title.substring(0, 20) + "..."
  454. }
  455. let _date = new Date(data[k].gmtUpdate)
  456. data[k].gmtUpdate = this.$u.timeFormat(_date.getTime(), 'mm-dd hh:MM');
  457. }
  458. that.newsInfo = data
  459. uni.hideLoading()
  460. })
  461. that.$api.request('integral', 'getIndexData', failres => {
  462. that.$api.msg(failres.errmsg)
  463. this.isLoadMore = false
  464. this.loadStatus = 'nomore'
  465. if (this.pages > 1) {
  466. this.pages = 1
  467. }
  468. uni.hideLoading()
  469. uni.stopPullDownRefresh()
  470. }).then(res => {
  471. let data = res.data
  472. //橱窗
  473. that.windowSpuList = data.windowRecommend
  474. //轮播
  475. data.advertisement.t1.forEach(item => {
  476. if (!item.color) {
  477. item.color = 'rgb(205, 215, 218)'
  478. }
  479. })
  480. that.carouselList = data.advertisement.t1
  481. that.swiperLength = data.advertisement.t1.length
  482. that.titleNViewBackground = data.advertisement.t1[0].color
  483. //分类精选
  484. if (data.advertisement.t2) {
  485. that.categoryPickList = data.advertisement.t2
  486. }
  487. //横幅
  488. if (data.advertisement.t3 && data.advertisement.t3.length > 0) {
  489. that.banner = data.advertisement.t3[0]
  490. }
  491. //热销
  492. if (data.salesTop) {
  493. that.salesTop = data.salesTop
  494. }
  495. //销售信息
  496. if (data.saleInfo) {
  497. that.saleInfo = data.saleInfo
  498. }
  499. //价格简报
  500. if (data.portInfo) {
  501. that.portInfo = data.portInfo
  502. console.log("portInfo", that.portInfo)
  503. }
  504. //分类5Buttom
  505. if (data.advertisement.t4) {
  506. that.categoryButtomList = data.advertisement.t4
  507. }
  508. that.showTran = data.showTran
  509. that.list = data.message
  510. uni.setStorageSync("message", data.message);
  511. uni.setStorageSync("task", data.task);
  512. uni.setStorageSync('showTran', data.showTran);
  513. uni.hideLoading()
  514. uni.stopPullDownRefresh()
  515. })
  516. },
  517. //轮播图切换修改背景色
  518. swiperChange(e) {
  519. const index = e.detail.current;
  520. this.swiperCurrent = index;
  521. // this.titleNViewBackground = this.carouselList[index].color;
  522. },
  523. //详情
  524. navToDetailPage(item) {
  525. let id = item;
  526. uni.navigateTo({
  527. url: `/pageB/news/news_detail?id=${id}`
  528. })
  529. },
  530. naviageToPage(page) {
  531. uni.navigateTo({
  532. url: page,
  533. fail() {
  534. uni.switchTab({
  535. url: page
  536. })
  537. }
  538. })
  539. },
  540. getMoreData() {
  541. const that = this
  542. var pages = that.pages
  543. var limit = that.limit
  544. // uni.showLoading({
  545. // title: '正在加载'
  546. // })
  547. that.$api.request('news', 'getNewsInfo', {
  548. category: 2,
  549. page: pages,
  550. limit: limit
  551. }, failres => {
  552. that.$api.msg(failres.errmsg)
  553. that.isLoadMore = false
  554. that.loadStatus = 'nomore'
  555. if (that.pages > 1) {
  556. that.pages -= 1
  557. }
  558. uni.hideLoading()
  559. }).then(res => {
  560. let data = res.data
  561. if (data.length > 0) {
  562. for (var k = 0; k < data.length; k++) {
  563. if (data[k].title.length > 20) {
  564. data[k].title = data[k].title.substring(0, 20) + "..."
  565. }
  566. let _date = new Date(data[k].gmtUpdate)
  567. data[k].gmtUpdate = this.$u.timeFormat(_date.getTime(), 'mm-dd hh:MM');
  568. }
  569. that.newsInfo = that.newsInfo.concat(data)
  570. that.isLoadMore = false
  571. } else {
  572. if (that.pages > 1) {
  573. that.pages -= 1
  574. }
  575. that.isLoadMore = true
  576. that.loadStatus = 'nomore'
  577. }
  578. uni.hideLoading()
  579. })
  580. }
  581. },
  582. // #ifndef MP
  583. // 标题栏input搜索框点击
  584. onNavigationBarSearchInputClicked: async function(e) {
  585. uni.navigateTo({
  586. url: '/pageA/product/search'
  587. })
  588. },
  589. //点击导航栏 buttons 时触发
  590. // onNavigationBarButtonTap(e) {
  591. // const index = e.index;
  592. // if (index === 0) {
  593. // this.$api.msg('点击了扫描');
  594. // } else if (index === 1) {
  595. // // #ifdef APP-PLUS
  596. // const pages = getCurrentPages();
  597. // const page = pages[pages.length - 1];
  598. // const currentWebview = page.$getAppWebview();
  599. // currentWebview.hideTitleNViewButtonRedDot({
  600. // index
  601. // });
  602. // // #endif
  603. // uni.navigateTo({
  604. // url: '/pages/notice/notice'
  605. // })
  606. // }
  607. // }
  608. // #endif
  609. }
  610. </script>
  611. <style lang="scss" scoped>
  612. .container {
  613. margin: 10rpx 10rpx 10rpx 10rpx;
  614. }
  615. .cu-tag.badge {
  616. right: 26rpx;
  617. }
  618. .up,
  619. .down {
  620. // width: 8px;
  621. // height: 5px;
  622. vertical-align: middle;
  623. margin-left: 2px;
  624. }
  625. .gird-left,
  626. .gird-right {}
  627. .cu-tag.radius[class*="line"]::after {
  628. border-radius: 66rpx;
  629. }
  630. .flex {
  631. display: flex;
  632. }
  633. .text-white {
  634. color: #fff;
  635. }
  636. .cu-card {
  637. border-bottom: 1rpx solid #f8f8f8;
  638. text-align: center;
  639. }
  640. .factorytitle view {
  641. border-right: 1px solid #F8F8F8;
  642. }
  643. .factorytitle view:last-child {
  644. border-right: 1px solid transparent;
  645. }
  646. .factory {
  647. font-size: 26rpx;
  648. font-weight: 900;
  649. }
  650. .currectprice {
  651. color: rgba(253, 113, 79, 1);
  652. font-size: 18px;
  653. font-weight: 550;
  654. vertical-align: middle;
  655. margin-right: 10px;
  656. }
  657. .yesterday {
  658. font-size: 14px;
  659. font-weight: 600;
  660. vertical-align: middle;
  661. }
  662. .yesterday.up {
  663. color: rgba(253, 113, 79, 1);
  664. }
  665. .yesterday.down {
  666. color: #22C572;
  667. }
  668. .positive {
  669. color: #E63113;
  670. font-size: 26rpx;
  671. font-weight: 900;
  672. }
  673. .negative {
  674. color: #229453;
  675. font-size: 26rpx;
  676. font-weight: 900;
  677. }
  678. .wrap {
  679. font-size: 24rpx;
  680. color: rgba(0, 0, 0, 0.5);
  681. }
  682. .align-center {
  683. align-items: center;
  684. }
  685. .flex-direction-row {
  686. flex-direction: row;
  687. }
  688. .factoryItem {
  689. padding: 20rpx 0;
  690. }
  691. /* #ifdef MP */
  692. .mp-search-box {
  693. // position:relative;
  694. left: 0;
  695. top: 30upx;
  696. z-index: 9999;
  697. width: 100%;
  698. padding: 0 80upx;
  699. background: rgba(255, 170, 0, 0.6);
  700. .ser-input {
  701. flex: 1;
  702. height: 56upx;
  703. line-height: 56upx;
  704. text-align: center;
  705. font-size: 28upx;
  706. color: $font-color-base;
  707. border-radius: 10px;
  708. background: rgba(255, 255, 255, .6);
  709. }
  710. }
  711. .desc {
  712. width: 73%;
  713. margin-right: 2%;
  714. }
  715. .justify-between {
  716. justify-content: space-between;
  717. }
  718. page {
  719. .cate-section {
  720. position: relative;
  721. z-index: 5;
  722. border-radius: 16upx 16upx 0 0;
  723. margin-top: -20upx;
  724. }
  725. .carousel-section {
  726. padding: 0;
  727. .titleNview-placing {
  728. padding-top: 0;
  729. height: 0;
  730. }
  731. .carousel {
  732. .carousel-item {
  733. padding: 0;
  734. }
  735. }
  736. .swiper-dots {
  737. left: 50%;
  738. bottom: 5upx;
  739. transform: translateX(-50%);
  740. }
  741. }
  742. }
  743. /* #endif */
  744. .cuIcon-notification::before {
  745. color: #f37b1;
  746. }
  747. .cu-card.article>.cu-item .content>image {
  748. height: 3.4em;
  749. margin-right: 0rpx;
  750. margin-top: 24rpx;
  751. }
  752. .screen-swiper.price-swiper {
  753. height: 70rpx;
  754. min-height: 70rpx;
  755. background: #fff;
  756. margin-bottom: 10px;
  757. }
  758. .swiper-item {
  759. // border-radius: 5%;
  760. }
  761. .guess-section-wrap {
  762. padding: 28rpx 28rpx 0 28rpx;
  763. margin: 10px 0px;
  764. border-radius: 20rpx;
  765. background: #fff;
  766. overflow: hidden;
  767. }
  768. .guess-section-wrap1 {
  769. margin: 10px 0;
  770. border-radius: 5px;
  771. background: #fff;
  772. overflow: hidden;
  773. // height: 366px;
  774. }
  775. .guess-section-wrap-content {
  776. width: 1500px;
  777. // display:flex;
  778. }
  779. .guess-section-wrap-content.port {
  780. width: 3000px;
  781. }
  782. .guess-section-wrap-item {
  783. float: left;
  784. width: 42vw;
  785. background: #F9F9FA;
  786. padding: 14rpx;
  787. margin: 10rpx 0;
  788. border-radius: 3px;
  789. // width:50%;
  790. }
  791. .guess-section-wrap-item:nth-child(2n) {
  792. float: right;
  793. }
  794. .guess-section-wrap-item:first-child {
  795. // margin-left:2px;
  796. }
  797. .clearfix:after {
  798. content: "";
  799. display: block;
  800. clear: both;
  801. }
  802. .guess-section-wrap .price {
  803. color: #B2B3BB;
  804. display: flex;
  805. align-items: center;
  806. margin-top: 10rpx;
  807. }
  808. page {
  809. background: #f5f5f5;
  810. }
  811. .m-t {
  812. margin-top: 16upx;
  813. }
  814. .header-swiper {
  815. min-height: 270rpx;
  816. height: 270rpx;
  817. border-radius: 20rpx;
  818. }
  819. /* 头部 轮播图 */
  820. .carousel-section {
  821. position: relative;
  822. // padding-top: 10px;
  823. .titleNview-placing {
  824. height: var(--status-bar-height);
  825. padding-top: 44px;
  826. box-sizing: content-box;
  827. }
  828. .titleNview-background {
  829. position: absolute;
  830. top: 0;
  831. left: 0;
  832. width: 100%;
  833. height: 426upx;
  834. transition: .4s;
  835. }
  836. }
  837. .tab-scroll-view {
  838. width: 750rpx;
  839. height: 300rpx;
  840. flex-direction: row;
  841. white-space: nowrap;
  842. .tab-item {
  843. display: inline-block;
  844. width: 350rpx;
  845. height: 250rpx;
  846. font-size: 16px;
  847. -moz-box-shadow: 2px 2px 5px #ccc;
  848. -webkit-box-shadow: 2px 2px 5px #ccc;
  849. box-shadow: 2px 2px 5px #ccc;
  850. color: #555;
  851. margin: 10rpx;
  852. }
  853. }
  854. .carousel {
  855. width: 100%;
  856. height: 350upx;
  857. .carousel-item {
  858. width: 100%;
  859. height: 270rpx;
  860. // padding: 0 28upx;
  861. overflow: hidden;
  862. }
  863. image {
  864. width: 100%;
  865. height: 100%;
  866. // border-radius: 10upx;
  867. }
  868. }
  869. .swiper-dots {
  870. display: flex;
  871. position: absolute;
  872. left: 60upx;
  873. bottom: 15upx;
  874. width: 72upx;
  875. height: 36upx;
  876. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABkCAYAAADDhn8LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTk4MzlBNjE0NjU1MTFFOUExNjRFQ0I3RTQ0NEExQjMiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTk4MzlBNjA0NjU1MTFFOUExNjRFQ0I3RTQ0NEExQjMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6Q0E3RUNERkE0NjExMTFFOTg5NzI4MTM2Rjg0OUQwOEUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6Q0E3RUNERkI0NjExMTFFOTg5NzI4MTM2Rjg0OUQwOEUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Gh5BPAAACTUlEQVR42uzcQW7jQAwFUdN306l1uWwNww5kqdsmm6/2MwtVCp8CosQtP9vg/2+/gY+DRAMBgqnjIp2PaCxCLLldpPARRIiFj1yBbMV+cHZh9PURRLQNhY8kgWyL/WDtwujjI8hoE8rKLqb5CDJaRMJHokC6yKgSCR9JAukmokIknCQJpLOIrJFwMsBJELFcKHwM9BFkLBMKFxNcBCHlQ+FhoocgpVwwnv0Xn30QBJGMC0QcaBVJiAMiec/dcwKuL4j1QMsVCXFAJE4s4NQA3K/8Y6DzO4g40P7UcmIBJxbEesCKWBDg8wWxHrAiFgT4fEGsB/CwIhYE+AeBAAdPLOcV8HRmWRDAiQVcO7GcV8CLM8uCAE4sQCDAlHcQ7x+ABQEEAggEEAggEEAggEAAgQACASAQQCCAQACBAAIBBAIIBBAIIBBAIABe4e9iAe/xd7EAJxYgEGDeO4j3EODp/cOCAE4sYMyJ5cwCHs4rCwI4sYBxJ5YzC84rCwKcXxArAuthQYDzC2JF0H49LAhwYUGsCFqvx5EF2T07dMaJBetx4cRyaqFtHJ8EIhK0i8OJBQxcECuCVutxJhCRoE0cZwMRyRcFefa/ffZBVPogePihhyCnbBhcfMFFEFM+DD4m+ghSlgmDkwlOgpAl4+BkkJMgZdk4+EgaSCcpVX7bmY9kgXQQU+1TgE0c+QJZUUz1b2T4SBbIKmJW+3iMj2SBVBWz+leVfCQLpIqYbp8b85EskIxyfIOfK5Sf+wiCRJEsllQ+oqEkQfBxmD8BBgA5hVjXyrBNUQAAAABJRU5ErkJggg==);
  877. background-size: 100% 100%;
  878. .num {
  879. width: 36upx;
  880. height: 36upx;
  881. border-radius: 50px;
  882. font-size: 24upx;
  883. color: #fff;
  884. text-align: center;
  885. line-height: 36upx;
  886. }
  887. .sign {
  888. position: absolute;
  889. top: 0;
  890. left: 50%;
  891. line-height: 36upx;
  892. font-size: 12upx;
  893. color: #fff;
  894. transform: translateX(-50%);
  895. }
  896. }
  897. /* 分类 */
  898. .cate-section {
  899. display: flex;
  900. justify-content: space-around;
  901. align-items: center;
  902. flex-wrap: wrap;
  903. padding: 30upx 22upx;
  904. background: #fff;
  905. .cate-item {
  906. display: flex;
  907. flex-direction: column;
  908. align-items: center;
  909. font-size: $font-sm + 2upx;
  910. color: $font-color-dark;
  911. }
  912. /* 原图标颜色太深,不想改图了,所以加了透明度 */
  913. image {
  914. width: 68upx;
  915. height: 68upx;
  916. margin-bottom: 14upx;
  917. // border-radius: 50%;
  918. opacity: .7;
  919. // box-shadow: 4upx 4upx 20upx rgba(250, 67, 106, 0.3);
  920. }
  921. .grid_icon {
  922. font-size: 48upx;
  923. margin-bottom: 18upx;
  924. color: #fa436a;
  925. }
  926. }
  927. .ad-1 {
  928. width: 100%;
  929. height: 210upx;
  930. padding: 10upx 0;
  931. background: #fff;
  932. image {
  933. width: 100%;
  934. height: 100%;
  935. }
  936. }
  937. /* 销售信息 */
  938. .introduce-section {
  939. background: #fff;
  940. padding: 20upx 30upx;
  941. padding-bottom: 100upx;
  942. .guess-item {
  943. padding-bottom: 20upx;
  944. border-bottom: 1px solid #ccc;
  945. }
  946. .title {
  947. font-size: 28upx;
  948. color: $font-color-dark;
  949. font-weight: bold;
  950. height: 50upx;
  951. line-height: 50upx;
  952. flex: 2.5;
  953. }
  954. .title-tip {
  955. flex: 1;
  956. }
  957. .price-box {
  958. display: flex;
  959. align-items: baseline;
  960. height: 70upx;
  961. padding: 10upx 0;
  962. font-size: 26upx;
  963. color: $uni-color-primary;
  964. }
  965. .price {
  966. font-size: $font-lg + 2upx;
  967. }
  968. .m-price {
  969. margin: 0 12upx;
  970. color: $font-color-light;
  971. text-decoration: line-through;
  972. }
  973. .coupon-tip {
  974. align-items: center;
  975. padding: 4upx 10upx;
  976. background: $uni-color-primary;
  977. font-size: $font-sm;
  978. color: #fff;
  979. border-radius: 6upx;
  980. line-height: 1;
  981. transform: translateY(-4upx);
  982. }
  983. .bot-row {
  984. display: flex;
  985. align-items: center;
  986. height: 50upx;
  987. font-size: $font-sm;
  988. color: $font-color-light;
  989. view {
  990. flex: 1;
  991. }
  992. }
  993. .status_bar {
  994. width: 100%;
  995. }
  996. }
  997. .title {
  998. font-size: 34rpx;
  999. font-weight: 500;
  1000. color: #333333;
  1001. }
  1002. .list-row-titel {
  1003. text-overflow: -o-ellipsis-lastline;
  1004. overflow: hidden;
  1005. text-overflow: ellipsis;
  1006. display:
  1007. -webkit-box;
  1008. -webkit-line-clamp: 2;
  1009. -webkit-box-orient: vertical;
  1010. font-size: 16px;
  1011. height: 45px;
  1012. padding-right: 40rpx;
  1013. margin-bottom: 26rpx;
  1014. }
  1015. .header-swiper-port {
  1016. height: 120px;
  1017. min-height: 120px;
  1018. /deep/.uni-swiper-slide-frame {
  1019. width: 50% !important;
  1020. }
  1021. }
  1022. .port-number-style {
  1023. display: flex;
  1024. align-items: center;
  1025. margin-right: 14rpx;
  1026. }
  1027. /deep/.uni-swiper-wrapper {
  1028. border-radius: 20rpx;
  1029. }
  1030. .currectprice-text {
  1031. font-size: 24rpx;
  1032. }
  1033. .container {
  1034. margin: 20rpx !important;
  1035. }
  1036. </style>