pageSpecial.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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" @click="LiveGoPath">
  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" @click="LiveGoPath">
  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" @click="NewActivityList">
  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" @click="NewActivityListPath(cmImage)">
  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" @click="NavArticlePath('https://www.caimei365.com/info/center-3-1.html')">
  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" @click="NavArticlePath(info.link)">
  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. NavArticlePath(LINK){
  97. this.$api.navigateTo(`/h5/pages/article/page?link=${LINK}`)
  98. },
  99. NewActivityList(){
  100. this.$api.navigateTo('/h5/pages/activity/activity-list')
  101. },
  102. NewActivityListPath(pros){
  103. this.$api.FlooryNavigateTo(pros)
  104. },
  105. LiveGoPath(){//查看直播
  106. uni.navigateToMiniProgram({
  107. appId: 'wx92d650b253f8f2e3',
  108. path: '/pages/index/index',
  109. extraData: {
  110. 'data1': 'test'
  111. },
  112. envVersion: 'develop',
  113. success(res) {
  114. // 打开成功
  115. console.log(res)
  116. }
  117. })
  118. }
  119. }
  120. }
  121. </script>
  122. <style lang="scss">
  123. .container-pages{
  124. width: 100%;
  125. height:508rpx;
  126. padding: 24rpx;
  127. float: left;
  128. background-color: #F7F7F7;
  129. margin-top: 16rpx;
  130. box-sizing: border-box;
  131. background-color: #F7F7F7;
  132. overflow: hidden;
  133. display: flex;
  134. align-items: center;
  135. .tui-goods__list {
  136. display: flex;
  137. align-items: center;
  138. }
  139. .tui-goods__item {
  140. background-color: #fff;
  141. width: 307rpx;
  142. height: 460rpx;
  143. border-radius: 16rpx;
  144. box-sizing: border-box;
  145. margin-right: 16rpx;
  146. padding: 17rpx;
  147. }
  148. .tui-group-name{
  149. width: 100%;
  150. height: 36rpx;
  151. float: left;
  152. margin-bottom: 13rpx;
  153. .tui-group-title{
  154. font-size: 26rpx;
  155. line-height: 36rpx;
  156. float: left;
  157. color: #333333;
  158. }
  159. .icon-xiayibu{
  160. font-size: 26rpx;
  161. line-height: 36rpx;
  162. float: right;
  163. color: #909090;
  164. }
  165. }
  166. .tui-goods__main{
  167. width: 100%;
  168. height: auto;
  169. float: left;
  170. position: relative;
  171. &.one{
  172. margin-bottom: 14rpx;
  173. }
  174. }
  175. .tui-goods__imgbox {
  176. width: 273rpx;
  177. height: 273rpx;
  178. box-sizing: border-box;
  179. border-radius: 8rpx;
  180. }
  181. .tui-goods__img {
  182. max-width: 273rpx;
  183. max-height: 273rpx;
  184. border-radius: 8rpx;
  185. display: block;
  186. }
  187. .tui-goods__name{
  188. width: 100%;
  189. height: 48rpx;
  190. float: left;
  191. line-height: 48rpx;
  192. box-sizing: border-box;
  193. padding-left: 12rpx;
  194. font-size: $font-size-24;
  195. color: #FFFFFF;
  196. background-color: rgba(0,0,0,0.4);
  197. position: absolute;
  198. bottom: 0;
  199. left: 0;
  200. white-space: nowrap;
  201. text-overflow: ellipsis;
  202. overflow: hidden;
  203. border-radius:0 0 8rpx 8rpx;
  204. }
  205. .tui-goods__statu{
  206. padding-left: 45rpx;
  207. padding-right: 10rpx;
  208. height: 35rpx;
  209. position: absolute;
  210. top: 17rpx;
  211. left: 17rpx;
  212. background-color: rgba(0,0,0,0.4);
  213. border-radius: 18rpx;
  214. line-height: 35rpx;
  215. color: #FFFFFF;
  216. text-align: right;
  217. font-size: $font-size-20;
  218. .icon-live{
  219. width: 17rpx;
  220. height: 17rpx;
  221. display: block;
  222. margin: 0 auto;
  223. position: absolute;
  224. left: 15rpx;
  225. top: 9rpx;
  226. }
  227. .iconfont{
  228. width: 35rpx;
  229. height: 35rpx;
  230. line-height: 35rpx;
  231. display: block;
  232. position: absolute;
  233. left: 10rpx;
  234. font-size: $font-size-26;
  235. &.icon-weikaishi{
  236. color: #E56D00;
  237. }
  238. &.icon-jieshu{
  239. color: #333333;
  240. }
  241. }
  242. }
  243. .tui-goods__text{
  244. width: 100%;
  245. height: 44rpx;
  246. float: left;
  247. line-height: 44rpx;
  248. box-sizing: border-box;
  249. padding-left: 12rpx;
  250. font-size: $font-size-24;
  251. color: #666666;
  252. white-space: nowrap;
  253. text-overflow: ellipsis;
  254. overflow: hidden;
  255. position: relative;
  256. &::before{
  257. content: '';
  258. width: 8rpx;
  259. height: 8rpx;
  260. border-radius: 50%;
  261. background-color: #cccccc;
  262. position: absolute;
  263. left: 0;
  264. top: 18rpx;
  265. }
  266. }
  267. }
  268. </style>