多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
7.8 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="header">
  3. <view class="tabs-nav-warp">
  4. <scroll-view class="tabs-nav" scroll-x="true">
  5. <view class="ul">
  6. <view class="li" :class="{'on':activeTab===0}" @click="tabChange(0)" v-if="componentContent.firstClassify">
  7. {{ componentContent.firstClassify }}
  8. </view>
  9. <view class="li" :class="{'on':activeTab===index+beginIndex}" v-for="(item,index) in classifyData" :key="index" @click="tabChange(index+beginIndex,item.id)">
  10. {{item.categoryName}}
  11. </view>
  12. </view>
  13. </scroll-view>
  14. </view>
  15. <div class="hom-pro-list" v-if="productData.length>0">
  16. <div class="product-swiper">
  17. <div class="product-swiper-box">
  18. <div class="product-swiper-warp" v-for="(item,index) in productData.slice(0, 3)" :key="index">
  19. <div class=" product-swiper-item" @click="jumpProductDetail(item)">
  20. <div class="product-swiper-img">
  21. <img class="img pic-img default-img" :src="item.image" onerror="this.src='url(https://ceres.zkthink.com/static/root/default.png) no-repeat center';this.οnerrοr=null">
  22. </div>
  23. <div class="product-swiper-info">
  24. <label class="product-name">{{item.productName}}</label>
  25. <div class="price-warp">
  26. <!-- #ifdef MP-WEIXIN -->
  27. <img class="iconImg" v-if="item.activityType == 1" src="../../../static/images/groupBuyIcon.png">
  28. <img class="iconImg" v-if="item.activityType == 2" src="../../../static/images/spikeIcon.png">
  29. <img class="iconImg" v-if="item.activityType == 4" src="../../../static/images/spikeIcon.png">
  30. <img class="iconImg" v-if="item.activityType == 3" src="../../../static/images/discountListIcon.png">
  31. <img class="iconImg" v-if="item.activityType == 5" src="../../../static/images/discountListIcon.png">
  32. <img class="iconImg" v-if="item.activityType == 9" src="../../../static/images/memberCenterIcon.png">
  33. <img class="iconImg" v-if="item.activityType == 8" src="https://zk-cereshop.oss-cn-shenzhen.aliyuncs.com/zkthink/2022-02-15/d0d8d96f28904167b271de4ae924d1a8_sceneMarketing.png">
  34. <!-- #endif -->
  35. <!-- #ifdef H5 || APP-PLUS -->
  36. <image class="iconImg" v-if="item.activityType == 1" src="../../../static/images/groupBuyIcon.png"></image>
  37. <image class="iconImg" v-if="item.activityType == 2" src="../../../static/images/spikeIcon.png"></image>
  38. <image class="iconImg" v-if="item.activityType == 4" src="../../../static/images/spikeIcon.png"></image>
  39. <image class="iconImg" v-if="item.activityType == 3" src="../../../static/images/discountListIcon.png"></image>
  40. <image class="iconImg" v-if="item.activityType == 5" src="../../../static/images/discountListIcon.png"></image>
  41. <image class="iconImg" v-if="item.activityType == 9" src="../../../static/images/memberCenterIcon.png"></image>
  42. <image class="iconImg" v-if="item.activityType == 8" src="https://zk-cereshop.oss-cn-shenzhen.aliyuncs.com/zkthink/2022-02-15/d0d8d96f28904167b271de4ae924d1a8_sceneMarketing.png"></image>
  43. <!-- #endif -->
  44. <div class="price">
  45. ¥ {{item.price}}
  46. </div>
  47. <!-- <div class="original-price">-->
  48. <!-- ¥ {{item.originalPrice}}-->
  49. <!-- </div>-->
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="pagination new-pagination"></div>
  56. </div>
  57. <button v-show="componentContent.showMore" class="btn-more" @click="jumpProList(componentContent.productData)">查看全部 <span class="icon iconfont icon-arrow-right"></span></button>
  58. </div>
  59. </view>
  60. </template>
  61. <script>
  62. import {commonMixin} from '../mixin'
  63. export default {
  64. mixins: [commonMixin],
  65. data () {
  66. return {
  67. }
  68. },
  69. computed: {
  70. },
  71. methods:{
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .header {
  77. .top-box {
  78. display: flex;
  79. align-items: center;
  80. justify-content: space-between;
  81. padding-left: 30upx;
  82. width: 100%;
  83. .logo {
  84. // width: 280upx;
  85. height: 70upx;
  86. margin-top: 0upx;
  87. }
  88. .search-btn {
  89. height: 66upx;
  90. background: rgba(255, 255, 255, 1);
  91. border-radius: 33upx;
  92. display: flex;
  93. flex-direction: row;
  94. align-items: center;
  95. margin-right: 30upx;
  96. .search-icon {
  97. width: 60upx;
  98. height: 60upx;
  99. }
  100. }
  101. }
  102. }
  103. .tabs-nav-warp{
  104. margin-top: 20upx;
  105. padding:0 30upx;
  106. overflow: hidden;
  107. .tabs-nav{
  108. .ul{
  109. display: flex;
  110. flex-wrap: nowrap;
  111. justify-content: space-between;
  112. padding-left: 20upx;
  113. padding-right: 20upx;
  114. .li{
  115. flex: 1 0 auto;
  116. margin-left: 5upx;
  117. margin-right: 5upx;
  118. font-size: 30upx;
  119. color: #252744;
  120. position: relative;
  121. padding-bottom: 15upx;
  122. padding-left: 27upx;
  123. padding-right: 27upx;
  124. padding-top: 15upx;
  125. text-align: center;
  126. &:first-child{
  127. margin-left: 0;
  128. }
  129. &.on{
  130. // &:after{
  131. // content: '';
  132. // width: 100%;
  133. // height: 4upx;
  134. // background: #252744;
  135. // position: absolute;
  136. // left: 0;
  137. // bottom: 0;
  138. // }
  139. background: #252744;
  140. box-shadow: 0upx 7upx 14upx 0upx #C5C8ED;
  141. border-radius: 40upx;
  142. color: white;
  143. }
  144. }
  145. }
  146. }
  147. }
  148. .hom-pro-list{
  149. ::v-deep .swiper-wrapper{
  150. position: static;
  151. }
  152. /**横向滑动**/
  153. .product-swiper{
  154. width: 100%;
  155. height: auto;
  156. padding: 5upx 34upx 0;
  157. background-size: 710upx 454upx;
  158. box-sizing: border-box;
  159. position: relative;
  160. &+.btn-more{
  161. margin-top: 20upx;
  162. }
  163. .title{
  164. padding: 22upx 0upx 0 0;
  165. label{
  166. background-image: none;
  167. color: #A56C4C;
  168. font-style: italic;
  169. padding: 0;
  170. }
  171. }
  172. &-box {
  173. padding-bottom: 20upx;
  174. display: flex;
  175. }
  176. &-warp{
  177. padding: 0 5upx;
  178. }
  179. &-item {
  180. width: 220upx;
  181. position: relative;
  182. background-color: #FFFFFF;
  183. }
  184. &-img {
  185. width: 220upx;
  186. height: 220upx;
  187. position: relative;
  188. &:after{
  189. content: '';
  190. display: block;
  191. width: 54upx;
  192. height: 54upx;
  193. background: url("../../../static/images/newProduct/flag-new.png") no-repeat;
  194. background-size: 100% 100%;
  195. position: absolute;
  196. top: 0;
  197. left: 0;
  198. }
  199. .img {
  200. width: 100%;
  201. height: 100%;
  202. object-fit: contain;
  203. }
  204. }
  205. &-info {
  206. background-color: #FFFFFF;
  207. padding: 10upx;
  208. text-align: center;
  209. .product-name{
  210. font-size: 20upx;
  211. color: #333;
  212. display: block;
  213. overflow: hidden;
  214. text-overflow:ellipsis;
  215. white-space: nowrap;
  216. margin-bottom: 6upx;
  217. line-height: 28upx;
  218. }
  219. .price-warp{
  220. display: flex;
  221. justify-content: center;
  222. align-items: center;
  223. line-height: 28upx;
  224. .iconImg {
  225. width: 58rpx;
  226. height: 36rpx;
  227. margin-right: 10rpx;
  228. }
  229. .price{
  230. color: #C83732;
  231. font-size: 20upx;
  232. margin-right: 10upx;
  233. }
  234. .original-price{
  235. font-size: 16upx;
  236. color: #ccc;
  237. text-decoration: line-through;
  238. }
  239. }
  240. }
  241. }
  242. }
  243. </style>