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

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