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

407 lines
9.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years 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(http://36.138.125.206:8081/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="http://36.138.125.206:8081/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="http://36.138.125.206:8081/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: 50upx;
  142. padding: 0 30upx;
  143. overflow: hidden;
  144. .tabs-nav {
  145. height: 90rpx;
  146. .ul {
  147. display: flex;
  148. flex-wrap: nowrap;
  149. justify-content: space-between;
  150. padding-left: 20upx;
  151. padding-right: 20upx;
  152. .li {
  153. flex: 1 0 auto;
  154. margin-left: 5upx;
  155. margin-right: 5upx;
  156. font-size: 30upx;
  157. color: #252744;
  158. position: relative;
  159. padding-bottom: 15upx;
  160. padding-left: 27upx;
  161. padding-right: 27upx;
  162. padding-top: 15upx;
  163. text-align: center;
  164. &:first-child {
  165. margin-left: 0;
  166. }
  167. &.on {
  168. // &:after{
  169. // content: '';
  170. // width: 100%;
  171. // height: 4upx;
  172. // background: #252744;
  173. // position: absolute;
  174. // left: 0;
  175. // bottom: 0;
  176. // }
  177. background: #252744;
  178. box-shadow: 0upx 7upx 30upx 0upx #C5C8ED;
  179. border-radius: 40upx;
  180. color: white;
  181. }
  182. }
  183. }
  184. }
  185. }
  186. .hom-pro-list {
  187. ::v-deep .swiper-wrapper {
  188. position: static;
  189. }
  190. /**横向滑动**/
  191. .product-swiper {
  192. height: auto;
  193. overflow: hidden;
  194. margin: 5upx 34upx;
  195. &+.btn-more {
  196. margin-top: 20upx;
  197. }
  198. .title {
  199. padding: 22upx 0upx 0 0;
  200. label {
  201. background-image: none;
  202. color: #A56C4C;
  203. font-style: italic;
  204. padding: 0;
  205. }
  206. }
  207. &-box {
  208. margin-top: 18upx;
  209. margin-bottom: 18upx;
  210. margin-left: 18upx;
  211. margin-right: 18upx;
  212. height: 100%;
  213. width: 100%;
  214. display: flex;
  215. overflow-x: auto;
  216. }
  217. &-warp {
  218. height: 540upx;
  219. width: 386upx !important;
  220. margin-left: 18upx;
  221. margin-right: 18upx;
  222. }
  223. &-item {
  224. height: 540upx;
  225. width: 386upx !important;
  226. position: relative;
  227. }
  228. &-img {
  229. width: 286upx;
  230. height: 306upx;
  231. margin-left: auto;
  232. margin-right: auto;
  233. background: #F6F6F8;
  234. border: 2upx solid #FFFFFF;
  235. border-radius: 30upx;
  236. position: relative;
  237. padding: 20upx;
  238. z-index: 2;
  239. .img {
  240. width: 100%;
  241. height: 100%;
  242. object-fit: contain;
  243. }
  244. }
  245. &-info {
  246. width: 386upx;
  247. height: 430upx;
  248. position: absolute;
  249. top: 110upx;
  250. background: #FDFDFD;
  251. box-shadow: 0upx 15upx 30upx 0upx #F6F6F6;
  252. border-radius: 30upx;
  253. text-align: center;
  254. .product-info-content {
  255. margin-top: 270upx;
  256. .product-name-row {
  257. width: 100%;
  258. height: 33upx;
  259. line-height: 33upx;
  260. display: flex;
  261. flex-direction: row;
  262. flex-wrap: nowrap;
  263. align-content: center;
  264. justify-content: flex-start;
  265. align-items: center;
  266. .product-name {
  267. width: 100%;
  268. height: auto;
  269. font-size: 28upx;
  270. font-family: Source Han Sans CN;
  271. font-weight: bold;
  272. color: #252744;
  273. display: block;
  274. overflow: hidden;
  275. text-overflow: ellipsis;
  276. white-space: nowrap;
  277. line-height: 28upx;
  278. margin-left: 30upx;
  279. text-align: left;
  280. }
  281. .product-star {
  282. width: 33upx;
  283. height: 33upx;
  284. }
  285. .product-star-text {
  286. width: auto;
  287. height: 28upx;
  288. line-height: 28upx;
  289. font-size: 20upx;
  290. font-family: Source Han Sans CN;
  291. font-weight: bold;
  292. color: #A5A5AD;
  293. margin-right: 30upx;
  294. margin-left: 5upx;
  295. }
  296. }
  297. .product-sku-row {
  298. width: 100%;
  299. height: 28upx;
  300. line-height: 28upx;
  301. margin-top: 15upx;
  302. display: flex;
  303. flex-direction: row;
  304. flex-wrap: nowrap;
  305. align-content: center;
  306. justify-content: flex-start;
  307. align-items: center;
  308. .product-sku-name {
  309. font-size: 24upx;
  310. font-family: Source Han Sans CN;
  311. font-weight: 400;
  312. color: #90919C;
  313. margin-left: 30upx;
  314. }
  315. }
  316. .product-price-row {
  317. width: 100%;
  318. height: 76upx;
  319. line-height: 76upx;
  320. display: flex;
  321. flex-direction: row;
  322. flex-wrap: nowrap;
  323. align-content: center;
  324. justify-content: space-between;
  325. align-items: center;
  326. margin-top: 20upx;
  327. .price-warp {
  328. display: flex;
  329. align-items: center;
  330. line-height: 28upx;
  331. margin-left: 30upx;
  332. justify-content: flex-start;
  333. width: auto;
  334. flex-direction: row;
  335. flex-wrap: nowrap;
  336. .iconImg {
  337. width: 58rpx;
  338. height: 36rpx;
  339. margin-right: 10rpx;
  340. }
  341. .price {
  342. font-size: 28rpx;
  343. font-family: Source Han Sans CN;
  344. font-weight: bold;
  345. color: #252744;
  346. margin-right: 10upx;
  347. }
  348. .original-price {
  349. font-size: 16upx;
  350. color: #ccc;
  351. text-decoration: line-through;
  352. }
  353. }
  354. .product-add {
  355. width: 76upx;
  356. height: 76upx;
  357. margin-right: 30upx;
  358. }
  359. }
  360. }
  361. }
  362. }
  363. }
  364. </style>