pageSpecial.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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. console.log(this.tempData)
  96. },
  97. NavToDetailPage(floor) {//跳转
  98. /**
  99. * 页面跳转类型
  100. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  101. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  102. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  103. **/
  104. if(floor.linkType){
  105. const typeMap = {
  106. 1:`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}&title=${floor.title}`,
  107. 2:`/pages/goods/instrument-details?id=${floor.linkParam.id}`,
  108. 4:`/h5/pages/activity/activity?id=${floor.linkParam.id}`,
  109. 5:`/pages/goods/product?id=${floor.linkParam.id}`,
  110. 7:`/supplier/pages/user/my-shop?shopId=${floor.linkParam.id}`,
  111. 8:`/h5/pages/activity/activity-list`,
  112. 9:`/second/pages/form/introduce`,
  113. 10:`/second/pages/product/product-list`,
  114. 11:`/second/pages/form/form`,
  115. 12:`/pages/search/search?keyWord=${floor.title}`,
  116. 13:`/h5/pages/article/page?link=${floor.link}`,
  117. 14:`/h5/pages/article/page?link=${floor.link}`,
  118. 15:`/h5/pages/article/page?link=${floor.link}`,
  119. 17:`/pages/login/register-select`,
  120. 18:`/h5/pages/article/page?link=${floor.link}`,
  121. 19:`/pages/search/search-supplier?keyWord=${floor.title}`
  122. }
  123. const url = typeMap[floor.linkType];
  124. this.$api.navigateTo(url)
  125. }
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang="scss">
  131. .container-pages{
  132. width: 100%;
  133. height:508rpx;
  134. padding: 24rpx;
  135. float: left;
  136. background-color: #F7F7F7;
  137. margin-top: 16rpx;
  138. box-sizing: border-box;
  139. background-color: #F7F7F7;
  140. overflow: hidden;
  141. display: flex;
  142. align-items: center;
  143. .tui-goods__list {
  144. display: flex;
  145. align-items: center;
  146. }
  147. .tui-goods__item {
  148. background-color: #fff;
  149. width: 307rpx;
  150. height: 460rpx;
  151. border-radius: 16rpx;
  152. box-sizing: border-box;
  153. margin-right: 16rpx;
  154. padding: 17rpx;
  155. }
  156. .tui-group-name{
  157. width: 100%;
  158. height: 36rpx;
  159. float: left;
  160. margin-bottom: 13rpx;
  161. .tui-group-title{
  162. font-size: 26rpx;
  163. line-height: 36rpx;
  164. float: left;
  165. color: #333333;
  166. }
  167. .icon-xiayibu{
  168. font-size: 26rpx;
  169. line-height: 36rpx;
  170. float: right;
  171. color: #909090;
  172. }
  173. }
  174. .tui-goods__main{
  175. width: 100%;
  176. height: auto;
  177. float: left;
  178. position: relative;
  179. &.one{
  180. margin-bottom: 14rpx;
  181. }
  182. }
  183. .tui-goods__imgbox {
  184. width: 273rpx;
  185. height: 273rpx;
  186. box-sizing: border-box;
  187. border-radius: 8rpx;
  188. }
  189. .tui-goods__img {
  190. max-width: 273rpx;
  191. max-height: 273rpx;
  192. border-radius: 8rpx;
  193. display: block;
  194. }
  195. .tui-goods__name{
  196. width: 100%;
  197. height: 48rpx;
  198. float: left;
  199. line-height: 48rpx;
  200. box-sizing: border-box;
  201. padding-left: 12rpx;
  202. font-size: $font-size-24;
  203. color: #FFFFFF;
  204. background-color: rgba(0,0,0,0.4);
  205. position: absolute;
  206. bottom: 0;
  207. left: 0;
  208. white-space: nowrap;
  209. text-overflow: ellipsis;
  210. overflow: hidden;
  211. border-radius:0 0 8rpx 8rpx;
  212. }
  213. .tui-goods__statu{
  214. padding-left: 45rpx;
  215. padding-right: 10rpx;
  216. height: 35rpx;
  217. position: absolute;
  218. top: 17rpx;
  219. left: 17rpx;
  220. background-color: rgba(0,0,0,0.4);
  221. border-radius: 18rpx;
  222. line-height: 35rpx;
  223. color: #FFFFFF;
  224. text-align: right;
  225. font-size: $font-size-20;
  226. .icon-live{
  227. width: 17rpx;
  228. height: 17rpx;
  229. display: block;
  230. margin: 0 auto;
  231. position: absolute;
  232. left: 15rpx;
  233. top: 9rpx;
  234. }
  235. .iconfont{
  236. width: 35rpx;
  237. height: 35rpx;
  238. line-height: 35rpx;
  239. display: block;
  240. position: absolute;
  241. left: 10rpx;
  242. font-size: $font-size-26;
  243. &.icon-weikaishi{
  244. color: #E56D00;
  245. }
  246. &.icon-jieshu{
  247. color: #333333;
  248. }
  249. }
  250. }
  251. .tui-goods__text{
  252. width: 100%;
  253. height: 44rpx;
  254. float: left;
  255. line-height: 44rpx;
  256. box-sizing: border-box;
  257. padding-left: 12rpx;
  258. font-size: $font-size-24;
  259. color: #666666;
  260. white-space: nowrap;
  261. text-overflow: ellipsis;
  262. overflow: hidden;
  263. position: relative;
  264. &::before{
  265. content: '';
  266. width: 8rpx;
  267. height: 8rpx;
  268. border-radius: 50%;
  269. background-color: #cccccc;
  270. position: absolute;
  271. left: 0;
  272. top: 18rpx;
  273. }
  274. }
  275. }
  276. </style>