pageSpecial.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template name="pagesProduct">
  2. <view>
  3. <view class="container-pages clearfix">
  4. <scroll-view scroll-x>
  5. <view class="tui-goods__list">
  6. <view class="tui-goods__item">
  7. <view class="tui-group-name">
  8. <view class="tui-group-title"><text>精彩直播</text></view>
  9. <view class="iconfont icon-xiayibu"></view>
  10. </view>
  11. <view class="tui-goods__main" :class="flIndex == 0 ? 'one' : ''" v-for="(live, flIndex) in tempData.liveList" :key="flIndex">
  12. <view class="tui-goods__imgbox" v-if="flIndex === 0">
  13. <image :src="live.image" mode="" class="tui-goods__img"></image>
  14. <view class="tui-goods__name">{{ live.liveTitle }}</view>
  15. <view class="tui-goods__statu">
  16. <text class="iconfont icon-weikaishi" v-if="live.liveStatus == '1'"></text>
  17. <image :src="iconLive" mode="widthFix" class="icon-live" v-if="live.liveStatus == '2'"></image>
  18. <text class="iconfont icon-jieshu" v-if="live.liveStatus == '3'"></text>
  19. <text>{{ live.liveStatus | statusType }}</text>
  20. </view>
  21. </view>
  22. <view class="tui-goods__text" v-if="flIndex > 0">{{ live.liveTitle }}</view>
  23. </view>
  24. </view>
  25. <view class="tui-goods__item">
  26. <view class="tui-group-name">
  27. <view class="tui-group-title"><text>最新活动</text></view>
  28. <view class="iconfont icon-xiayibu"></view>
  29. </view>
  30. <view class="tui-goods__main" :class="flIndex == 0 ? 'one' : ''" v-for="(cmImage, flIndex) in tempData.cmImageList" :key="flIndex">
  31. <view class="tui-goods__imgbox" v-if="flIndex === 0">
  32. <image :src="cmImage.image" mode="" class="tui-goods__img"></image>
  33. <view class="tui-goods__name">{{ cmImage.title }}</view>
  34. </view>
  35. <view class="tui-goods__text" v-if="flIndex > 0">{{ cmImage.title }}</view>
  36. </view>
  37. </view>
  38. <view class="tui-goods__item">
  39. <view class="tui-group-name">
  40. <view class="tui-group-title"><text>热门文章</text></view>
  41. <view class="iconfont icon-xiayibu"></view>
  42. </view>
  43. <view class="tui-goods__main" :class="flIndex == 0 ? 'one' : ''" v-for="(info, flIndex) in tempData.infoList" :key="flIndex">
  44. <view class="tui-goods__imgbox" v-if="flIndex === 0">
  45. <image :src="info.guidanceImage" mode="" class="tui-goods__img"></image>
  46. <view class="tui-goods__name">{{ info.title }}</view>
  47. </view>
  48. <view class="tui-goods__text" v-if="flIndex > 0">{{ info.title }}</view>
  49. </view>
  50. </view>
  51. </view>
  52. </scroll-view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import { mapState,mapMutations} from 'vuex';
  58. export default{
  59. name:"pagesProduct",
  60. props:{
  61. templateData:{
  62. type:Object
  63. }
  64. },
  65. data() {
  66. return{
  67. tempData:{},
  68. iconLive:'https://static-b.caimei365.com/app/img/icon/icon-live.gif'
  69. }
  70. },
  71. filters: {
  72. statusType:function(value) {
  73. switch (value) {
  74. case '1':
  75. return '未开始';
  76. break;
  77. case '2':
  78. return '直播中';
  79. break;
  80. case '3':
  81. return '已结束';
  82. break;
  83. }
  84. },
  85. NumFormat:function(value) {//处理金额
  86. return Number(value).toFixed(2);
  87. },
  88. },
  89. created(){
  90. this.initData(this.templateData)
  91. },
  92. methods:{
  93. initData(data){
  94. this.tempData = data
  95. },
  96. NavToDetailPage(floor) {//跳转
  97. /**
  98. * 页面跳转类型
  99. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  100. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  101. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  102. **/
  103. if(floor.linkType){
  104. const typeMap = {
  105. 1:`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}&title=${floor.title}`,
  106. 2:`/pages/goods/instrument-details?id=${floor.linkParam.id}`,
  107. 4:`/h5/pages/activity/activity?id=${floor.linkParam.id}`,
  108. 5:`/pages/goods/product?id=${floor.linkParam.id}`,
  109. 7:`/supplier/pages/user/my-shop?shopId=${floor.linkParam.id}`,
  110. 8:`/h5/pages/activity/activity-list`,
  111. 9:`/second/pages/form/introduce`,
  112. 10:`/second/pages/product/product-list`,
  113. 11:`/second/pages/form/form`,
  114. 12:`/pages/search/search?keyWord=${floor.title}`,
  115. 13:`/h5/pages/article/page?link=${floor.link}`,
  116. 14:`/h5/pages/article/page?link=${floor.link}`,
  117. 15:`/h5/pages/article/page?link=${floor.link}`,
  118. 17:`/pages/login/register-select`,
  119. 18:`/h5/pages/article/page?link=${floor.link}`,
  120. 19:`/pages/search/search-supplier?keyWord=${floor.title}`
  121. }
  122. const url = typeMap[floor.linkType];
  123. this.$api.navigateTo(url)
  124. }
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss">
  130. .container-pages{
  131. width: 100%;
  132. height:508rpx;
  133. padding: 24rpx;
  134. float: left;
  135. background-color: #F7F7F7;
  136. margin-top: 16rpx;
  137. box-sizing: border-box;
  138. background-color: #F7F7F7;
  139. overflow: hidden;
  140. display: flex;
  141. align-items: center;
  142. .tui-goods__list {
  143. display: flex;
  144. align-items: center;
  145. }
  146. .tui-goods__item {
  147. background-color: #fff;
  148. width: 307rpx;
  149. height: 460rpx;
  150. border-radius: 16rpx;
  151. box-sizing: border-box;
  152. margin-right: 16rpx;
  153. padding: 17rpx;
  154. }
  155. .tui-group-name{
  156. width: 100%;
  157. height: 36rpx;
  158. float: left;
  159. margin-bottom: 13rpx;
  160. .tui-group-title{
  161. font-size: 26rpx;
  162. line-height: 36rpx;
  163. float: left;
  164. color: #333333;
  165. }
  166. .icon-xiayibu{
  167. font-size: 26rpx;
  168. line-height: 36rpx;
  169. float: right;
  170. color: #909090;
  171. }
  172. }
  173. .tui-goods__main{
  174. width: 100%;
  175. height: auto;
  176. float: left;
  177. position: relative;
  178. &.one{
  179. margin-bottom: 14rpx;
  180. }
  181. }
  182. .tui-goods__imgbox {
  183. width: 273rpx;
  184. height: 273rpx;
  185. box-sizing: border-box;
  186. border-radius: 8rpx;
  187. }
  188. .tui-goods__img {
  189. max-width: 273rpx;
  190. max-height: 273rpx;
  191. border-radius: 8rpx;
  192. display: block;
  193. }
  194. .tui-goods__name{
  195. width: 100%;
  196. height: 48rpx;
  197. float: left;
  198. line-height: 48rpx;
  199. box-sizing: border-box;
  200. padding-left: 12rpx;
  201. font-size: $font-size-24;
  202. color: #FFFFFF;
  203. background-color: rgba(0,0,0,0.4);
  204. position: absolute;
  205. bottom: 0;
  206. left: 0;
  207. white-space: nowrap;
  208. text-overflow: ellipsis;
  209. overflow: hidden;
  210. border-radius:0 0 8rpx 8rpx;
  211. }
  212. .tui-goods__statu{
  213. padding-left: 45rpx;
  214. padding-right: 10rpx;
  215. height: 35rpx;
  216. position: absolute;
  217. top: 17rpx;
  218. left: 17rpx;
  219. background-color: rgba(0,0,0,0.4);
  220. border-radius: 18rpx;
  221. line-height: 35rpx;
  222. color: #FFFFFF;
  223. text-align: right;
  224. font-size: $font-size-20;
  225. .icon-live{
  226. width: 17rpx;
  227. height: 17rpx;
  228. display: block;
  229. margin: 0 auto;
  230. position: absolute;
  231. left: 15rpx;
  232. top: 9rpx;
  233. }
  234. .iconfont{
  235. width: 35rpx;
  236. height: 35rpx;
  237. line-height: 35rpx;
  238. display: block;
  239. position: absolute;
  240. left: 10rpx;
  241. font-size: $font-size-26;
  242. &.icon-weikaishi{
  243. color: #E56D00;
  244. }
  245. &.icon-jieshu{
  246. color: #333333;
  247. }
  248. }
  249. }
  250. .tui-goods__text{
  251. width: 100%;
  252. height: 44rpx;
  253. float: left;
  254. line-height: 44rpx;
  255. box-sizing: border-box;
  256. padding-left: 12rpx;
  257. font-size: $font-size-24;
  258. color: #666666;
  259. white-space: nowrap;
  260. text-overflow: ellipsis;
  261. overflow: hidden;
  262. position: relative;
  263. &::before{
  264. content: '';
  265. width: 8rpx;
  266. height: 8rpx;
  267. border-radius: 50%;
  268. background-color: #cccccc;
  269. position: absolute;
  270. left: 0;
  271. top: 18rpx;
  272. }
  273. }
  274. }
  275. </style>