多租户商城-商户小程序端
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.

366 lines
10 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
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" :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. <div class="product-info-content">
  25. <div class="product-name-row">
  26. <label class="product-name">{{item.productName}}</label>
  27. <image class="product-star" src="https://wechat.hnthee.com/ceres-local-file/image/icon_star.png"></image>
  28. <label class="product-star-text">3.5</label>
  29. </div>
  30. <div class="product-sku-row">
  31. <label class="product-sku-name">规格</label>
  32. </div>
  33. <div class="product-price-row">
  34. <div class="price-warp">
  35. <!-- #ifdef MP-WEIXIN -->
  36. <img class="iconImg" v-if="item.activityType == 1" src="../../../static/images/groupBuyIcon.png">
  37. <img class="iconImg" v-if="item.activityType == 2" src="../../../static/images/spikeIcon.png">
  38. <img class="iconImg" v-if="item.activityType == 4" src="../../../static/images/spikeIcon.png">
  39. <img class="iconImg" v-if="item.activityType == 3" src="../../../static/images/discountListIcon.png">
  40. <img class="iconImg" v-if="item.activityType == 5" src="../../../static/images/discountListIcon.png">
  41. <img class="iconImg" v-if="item.activityType == 9" src="../../../static/images/memberCenterIcon.png">
  42. <img class="iconImg" v-if="item.activityType == 8" src="https://zk-cereshop.oss-cn-shenzhen.aliyuncs.com/zkthink/2022-02-15/d0d8d96f28904167b271de4ae924d1a8_sceneMarketing.png">
  43. <!-- #endif -->
  44. <!-- #ifdef H5 || APP-PLUS -->
  45. <image class="iconImg" v-if="item.activityType == 1" src="../../../static/images/groupBuyIcon.png"></image>
  46. <image class="iconImg" v-if="item.activityType == 2" src="../../../static/images/spikeIcon.png"></image>
  47. <image class="iconImg" v-if="item.activityType == 4" src="../../../static/images/spikeIcon.png"></image>
  48. <image class="iconImg" v-if="item.activityType == 3" src="../../../static/images/discountListIcon.png"></image>
  49. <image class="iconImg" v-if="item.activityType == 5" src="../../../static/images/discountListIcon.png"></image>
  50. <image class="iconImg" v-if="item.activityType == 9" src="../../../static/images/memberCenterIcon.png"></image>
  51. <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>
  52. <!-- #endif -->
  53. <div class="price">
  54. ¥ {{item.price}}
  55. </div>
  56. <!-- <div class="original-price">-->
  57. <!-- ¥ {{item.originalPrice}}-->
  58. <!-- </div>-->
  59. </div>
  60. <image class="product-add" src="https://wechat.hnthee.com/ceres-local-file/image/icon_add.png"></image>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="pagination new-pagination"></div>
  68. </div>
  69. <button v-show="componentContent.showMore" class="btn-more" @click="jumpProList(componentContent.productData)">查看全部 <span class="icon iconfont icon-arrow-right"></span></button>
  70. </div>
  71. </view>
  72. </template>
  73. <script>
  74. import {commonMixin} from '../mixin'
  75. export default {
  76. mixins: [commonMixin],
  77. data () {
  78. return {
  79. }
  80. },
  81. computed: {
  82. },
  83. methods:{
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .header {
  89. .top-box {
  90. display: flex;
  91. align-items: center;
  92. justify-content: space-between;
  93. padding-left: 30upx;
  94. width: 100%;
  95. .logo {
  96. // width: 280upx;
  97. height: 70upx;
  98. margin-top: 0upx;
  99. }
  100. .search-btn {
  101. height: 66upx;
  102. background: rgba(255, 255, 255, 1);
  103. border-radius: 33upx;
  104. display: flex;
  105. flex-direction: row;
  106. align-items: center;
  107. margin-right: 30upx;
  108. .search-icon {
  109. width: 60upx;
  110. height: 60upx;
  111. }
  112. }
  113. }
  114. }
  115. .tabs-nav-warp{
  116. margin-top: 20upx;
  117. padding:0 30upx;
  118. overflow: hidden;
  119. .tabs-nav{
  120. .ul{
  121. display: flex;
  122. flex-wrap: nowrap;
  123. justify-content: space-between;
  124. padding-left: 20upx;
  125. padding-right: 20upx;
  126. .li{
  127. flex: 1 0 auto;
  128. margin-left: 5upx;
  129. margin-right: 5upx;
  130. font-size: 30upx;
  131. color: #252744;
  132. position: relative;
  133. padding-bottom: 15upx;
  134. padding-left: 27upx;
  135. padding-right: 27upx;
  136. padding-top: 15upx;
  137. text-align: center;
  138. &:first-child{
  139. margin-left: 0;
  140. }
  141. &.on{
  142. // &:after{
  143. // content: '';
  144. // width: 100%;
  145. // height: 4upx;
  146. // background: #252744;
  147. // position: absolute;
  148. // left: 0;
  149. // bottom: 0;
  150. // }
  151. background: #252744;
  152. box-shadow: 0upx 7upx 14upx 0upx #C5C8ED;
  153. border-radius: 40upx;
  154. color: white;
  155. }
  156. }
  157. }
  158. }
  159. }
  160. .hom-pro-list{
  161. ::v-deep .swiper-wrapper{
  162. position: static;
  163. }
  164. /**横向滑动**/
  165. .product-swiper{
  166. height: auto;
  167. overflow: hidden;
  168. margin: 5upx 34upx;
  169. &+.btn-more{
  170. margin-top: 20upx;
  171. }
  172. .title{
  173. padding: 22upx 0upx 0 0;
  174. label{
  175. background-image: none;
  176. color: #A56C4C;
  177. font-style: italic;
  178. padding: 0;
  179. }
  180. }
  181. &-box {
  182. margin-top: 18upx;
  183. margin-bottom: 18upx;
  184. margin-left: 18upx;
  185. margin-right: 18upx;
  186. height: 100%;
  187. width: 100%;
  188. display: flex;
  189. }
  190. &-warp{
  191. height: 540upx;
  192. width: 386upx !important;
  193. margin-left: 18upx;
  194. margin-right: 18upx;
  195. }
  196. &-item {
  197. height: 540upx;
  198. width: 386upx !important;
  199. position: relative;
  200. }
  201. &-img {
  202. width: 286upx;
  203. height: 306upx;
  204. margin-left: auto;
  205. margin-right: auto;
  206. background: #F6F6F8;
  207. border: 2upx solid #FFFFFF;
  208. border-radius: 30upx;
  209. position: relative;
  210. padding: 20upx;
  211. z-index: 2;
  212. .img {
  213. width: 100%;
  214. height: 100%;
  215. object-fit: contain;
  216. }
  217. }
  218. &-info {
  219. width: 386upx;
  220. height: 430upx;
  221. position: absolute;
  222. top: 110upx;
  223. background: #FDFDFD;
  224. box-shadow: 0upx 15upx 30upx 0upx #F6F6F6;
  225. border-radius: 30upx;
  226. text-align: center;
  227. .product-info-content {
  228. margin-top: 270upx;
  229. .product-name-row{
  230. width: 100%;
  231. height: 33upx;
  232. line-height: 33upx;
  233. display: flex;
  234. flex-direction: row;
  235. flex-wrap: nowrap;
  236. align-content: center;
  237. justify-content: flex-start;
  238. align-items: center;
  239. .product-name{
  240. width: 100%;
  241. height: auto;
  242. font-size: 28upx;
  243. font-family: Source Han Sans CN;
  244. font-weight: bold;
  245. color: #252744;
  246. display: block;
  247. overflow: hidden;
  248. text-overflow:ellipsis;
  249. white-space: nowrap;
  250. line-height: 28upx;
  251. margin-left: 30upx;
  252. text-align: left;
  253. }
  254. .product-star{
  255. width: 33upx;
  256. height: 33upx;
  257. }
  258. .product-star-text{
  259. width: auto;
  260. height: 28upx;
  261. line-height: 28upx;
  262. font-size: 20rpx;
  263. font-family: Source Han Sans CN;
  264. font-weight: bold;
  265. color: #A5A5AD;
  266. margin-right: 30upx;
  267. margin-left: 5upx;
  268. }
  269. }
  270. .product-sku-row{
  271. width: 100%;
  272. height: 28upx;
  273. line-height: 28upx;
  274. margin-top: 15upx;
  275. display: flex;
  276. flex-direction: row;
  277. flex-wrap: nowrap;
  278. align-content: center;
  279. justify-content: flex-start;
  280. align-items: center;
  281. .product-sku-name{
  282. font-size: 24rpx;
  283. font-family: Source Han Sans CN;
  284. font-weight: 400;
  285. color: #90919C;
  286. margin-left: 30upx;
  287. }
  288. }
  289. .product-price-row{
  290. width: 100%;
  291. height: 76upx;
  292. line-height: 76upx;
  293. display: flex;
  294. flex-direction: row;
  295. flex-wrap: nowrap;
  296. align-content: center;
  297. justify-content: flex-start;
  298. align-items: center;
  299. .price-warp{
  300. display: flex;
  301. justify-content: center;
  302. align-items: center;
  303. line-height: 28upx;
  304. margin-left: 30upx;
  305. display: flex;
  306. justify-content: flex-start;
  307. align-items: center;
  308. line-height: 14px;
  309. margin-left: 15px;
  310. width: 100%;
  311. flex-direction: row;
  312. flex-wrap: nowrap;
  313. width: 100%;
  314. .iconImg {
  315. width: 58rpx;
  316. height: 36rpx;
  317. margin-right: 10rpx;
  318. }
  319. .price{
  320. font-size: 28rpx;
  321. font-family: Source Han Sans CN;
  322. font-weight: bold;
  323. color: #252744;
  324. margin-right: 10upx;
  325. }
  326. .original-price{
  327. font-size: 16upx;
  328. color: #ccc;
  329. text-decoration: line-through;
  330. }
  331. }
  332. .product-add{
  333. width: 76upx;
  334. height: 76upx;
  335. }
  336. }
  337. }
  338. }
  339. }
  340. }
  341. </style>