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

364 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 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" v-if="false">
  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. overflow-x: auto;
  190. }
  191. &-warp{
  192. height: 540upx;
  193. width: 386upx !important;
  194. margin-left: 18upx;
  195. margin-right: 18upx;
  196. }
  197. &-item {
  198. height: 540upx;
  199. width: 386upx !important;
  200. position: relative;
  201. }
  202. &-img {
  203. width: 286upx;
  204. height: 306upx;
  205. margin-left: auto;
  206. margin-right: auto;
  207. background: #F6F6F8;
  208. border: 2upx solid #FFFFFF;
  209. border-radius: 30upx;
  210. position: relative;
  211. padding: 20upx;
  212. z-index: 2;
  213. .img {
  214. width: 100%;
  215. height: 100%;
  216. object-fit: contain;
  217. }
  218. }
  219. &-info {
  220. width: 386upx;
  221. height: 430upx;
  222. position: absolute;
  223. top: 110upx;
  224. background: #FDFDFD;
  225. box-shadow: 0upx 15upx 30upx 0upx #F6F6F6;
  226. border-radius: 30upx;
  227. text-align: center;
  228. .product-info-content {
  229. margin-top: 270upx;
  230. .product-name-row{
  231. width: 100%;
  232. height: 33upx;
  233. line-height: 33upx;
  234. display: flex;
  235. flex-direction: row;
  236. flex-wrap: nowrap;
  237. align-content: center;
  238. justify-content: flex-start;
  239. align-items: center;
  240. .product-name{
  241. width: 100%;
  242. height: auto;
  243. font-size: 28upx;
  244. font-family: Source Han Sans CN;
  245. font-weight: bold;
  246. color: #252744;
  247. display: block;
  248. overflow: hidden;
  249. text-overflow:ellipsis;
  250. white-space: nowrap;
  251. line-height: 28upx;
  252. margin-left: 30upx;
  253. text-align: left;
  254. }
  255. .product-star{
  256. width: 33upx;
  257. height: 33upx;
  258. }
  259. .product-star-text{
  260. width: auto;
  261. height: 28upx;
  262. line-height: 28upx;
  263. font-size: 20rpx;
  264. font-family: Source Han Sans CN;
  265. font-weight: bold;
  266. color: #A5A5AD;
  267. margin-right: 30upx;
  268. margin-left: 5upx;
  269. }
  270. }
  271. .product-sku-row{
  272. width: 100%;
  273. height: 28upx;
  274. line-height: 28upx;
  275. margin-top: 15upx;
  276. display: flex;
  277. flex-direction: row;
  278. flex-wrap: nowrap;
  279. align-content: center;
  280. justify-content: flex-start;
  281. align-items: center;
  282. .product-sku-name{
  283. font-size: 24rpx;
  284. font-family: Source Han Sans CN;
  285. font-weight: 400;
  286. color: #90919C;
  287. margin-left: 30upx;
  288. }
  289. }
  290. .product-price-row{
  291. width: 100%;
  292. height: 76upx;
  293. line-height: 76upx;
  294. display: flex;
  295. flex-direction: row;
  296. flex-wrap: nowrap;
  297. align-content: center;
  298. justify-content: space-between;
  299. align-items: center;
  300. margin-top: 20upx;
  301. .price-warp{
  302. display: flex;
  303. align-items: center;
  304. line-height: 28upx;
  305. margin-left: 30upx;
  306. justify-content: flex-start;
  307. width: auto;
  308. flex-direction: row;
  309. flex-wrap: nowrap;
  310. .iconImg {
  311. width: 58rpx;
  312. height: 36rpx;
  313. margin-right: 10rpx;
  314. }
  315. .price{
  316. font-size: 28rpx;
  317. font-family: Source Han Sans CN;
  318. font-weight: bold;
  319. color: #252744;
  320. margin-right: 10upx;
  321. }
  322. .original-price{
  323. font-size: 16upx;
  324. color: #ccc;
  325. text-decoration: line-through;
  326. }
  327. }
  328. .product-add{
  329. width: 76upx;
  330. height: 76upx;
  331. margin-right: 30upx;
  332. }
  333. }
  334. }
  335. }
  336. }
  337. }
  338. </style>