index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <!-- 分类三商品列表 -->
  3. <view class="goodsList">
  4. <view class="item acea-row row-between-wrapper" v-for="(item,index) in tempArr" :key='index' @click="goDetail(item)">
  5. <view class="pictrue">
  6. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '1'">秒杀</span>
  7. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '2'">砍价</span>
  8. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '3'">拼团</span>
  9. <!-- <image :src="item.image" mode=""></image> -->
  10. <lazyLoad :src="item.image" width="100%" height="100%"></lazyLoad>
  11. </view>
  12. <view class="pictxt">
  13. <view class="text line2">{{item.store_name}}</view>
  14. <!-- #ifdef H5 || APP-PLUS -->
  15. <slot name="center" :item="item"></slot>
  16. <!-- #endif -->
  17. <!-- #ifdef MP -->
  18. <slot name="center{{index}}"></slot>
  19. <!-- #endif -->
  20. <view class="bottom acea-row row-between-wrapper">
  21. <view class="money font-color">
  22. <text class="sign">¥</text>{{item.price}}
  23. <!-- <span class="vip" v-if="item.vip_price">
  24. <image src="../../static/images/vip01.png"></image>
  25. ¥{{item.vip_price}}
  26. </span>
  27. <text class="y_money" v-else>¥{{item.ot_price}}</text> -->
  28. </view>
  29. <view v-if="item.stock>0">
  30. <view class="iconfont icon-gouwuche6 acea-row row-center-wrapper" v-if="(item.activity && (item.activity.type === '1' || item.activity.type === '2' || item.activity.type === '3')) || item.product_type!=0 || item.custom_form.length"></view>
  31. <view v-else>
  32. <!-- 多规格 -->
  33. <view class="bnt acea-row row-center-wrapper" @click.stop="goCartDuo(item)" v-if="item.spec_type">
  34. 选规格
  35. <text class="num" v-if="isLogin && item.cart_num">{{item.cart_num}}</text>
  36. </view>
  37. <!-- 单规格 -->
  38. <view v-if="!item.spec_type && !item.cart_num">
  39. <view v-if="item.cart_button">
  40. <view class="bnt acea-row row-center-wrapper end" v-if="item.is_presale_product && (item.presale_pay_status == 1 || item.presale_pay_status == 3)">
  41. {{item.presale_pay_status === 1?'未开始':'已结束'}}
  42. </view>
  43. <view v-else class="iconfont icon-gouwuche6 acea-row row-center-wrapper" @click.stop="goCartDan(item,index)"></view>
  44. </view>
  45. <view v-else class="bnt acea-row row-center-wrapper">立即购买</view>
  46. </view>
  47. <view class="cart acea-row row-middle" v-if="!item.spec_type && item.cart_num">
  48. <view class="pictrue iconfont icon-jianhao acea-row row-center-wrapper" @click.stop="CartNumDes(index,item)"></view>
  49. <view class="num">{{item.cart_num}}</view>
  50. <view class="pictrue iconfont icon-jiahao acea-row row-center-wrapper" @click.stop="CartNumAdd(index,item)"></view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="bnt acea-row row-center-wrapper end" v-else>已售罄</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import lazyLoad from '@/components/muqian-lazyLoad/muqian-lazyLoad.vue'
  62. export default {
  63. name: 'd_goodList',
  64. props: {
  65. dataConfig: {
  66. type: Object,
  67. default: () => {}
  68. },
  69. tempArr:{
  70. type: Array,
  71. default: () => []
  72. },
  73. isLogin:{
  74. type: Boolean,
  75. default:false
  76. }
  77. },
  78. components:{
  79. lazyLoad
  80. },
  81. data() {
  82. return {
  83. };
  84. },
  85. created() {},
  86. mounted() {},
  87. methods: {
  88. goDetail(item){
  89. this.$emit('detail',item);
  90. },
  91. goCartDuo(item){
  92. this.$emit('gocartduo',item);
  93. },
  94. goCartDan(item,index){
  95. this.$emit('gocartdan',item,index);
  96. },
  97. CartNumDes(index,item){
  98. this.$emit('ChangeCartNumDan', false,index,item);
  99. },
  100. CartNumAdd(index,item){
  101. if(item.is_limit && item.cart_num>=item.limit_num){
  102. this.$util.Tips({
  103. title: "购买最多不能超过"+item.limit_num
  104. });
  105. }else{
  106. this.$emit('ChangeCartNumDan', true,index,item);
  107. }
  108. }
  109. }
  110. };
  111. </script>
  112. <style lang="scss">
  113. .goodsList{
  114. padding: 0 30rpx;
  115. .item{
  116. width: 100%;
  117. box-sizing: border-box;
  118. margin-bottom: 63rpx;
  119. .pictrue{
  120. width: 140rpx;
  121. height: 140rpx;
  122. border-radius: 10rpx;
  123. position: relative;
  124. border-radius: 22rpx;
  125. image{
  126. width: 100%;
  127. height: 100%;
  128. border-radius: 22rpx;
  129. }
  130. }
  131. .pictxt{
  132. width: 372rpx;
  133. .text{
  134. font-size:26rpx;
  135. font-family:PingFang SC;
  136. font-weight:500;
  137. color: #333333;
  138. }
  139. .bottom{
  140. margin-top: 22rpx;
  141. .money{
  142. font-size: 34rpx;
  143. font-weight: 800;
  144. width: 212rpx;
  145. .sign{
  146. font-size: 24rpx;
  147. }
  148. .y_money{
  149. font-size: 20rpx;
  150. color: #999999;
  151. margin-left: 14rpx;
  152. font-weight: normal;
  153. text-decoration: line-through;
  154. }
  155. .vip{
  156. font-size: 22rpx;
  157. color: #333333;
  158. font-weight: normal;
  159. margin-left: 14rpx;
  160. image{
  161. width: 38rpx;
  162. height: 18rpx;
  163. margin-right: 6rpx;
  164. }
  165. }
  166. }
  167. .cart{
  168. height: 46rpx;
  169. .pictrue{
  170. color: var(--view-theme);
  171. font-size:46rpx;
  172. width: 46rpx;
  173. height: 46rpx;
  174. text-align: center;
  175. line-height: 46rpx;
  176. &.icon-jiahao{
  177. color: var(--view-theme);
  178. }
  179. }
  180. .num{
  181. font-size: 30rpx;
  182. color: #333333;
  183. font-weight: bold;
  184. width: 60rpx;
  185. text-align: center;
  186. }
  187. }
  188. .icon-gouwuche6{
  189. width: 46rpx;
  190. height: 46rpx;
  191. background-color: var(--view-theme);
  192. border-radius: 50%;
  193. color: #fff;
  194. font-size: 30rpx;
  195. }
  196. .bnt{
  197. padding: 0 20rpx;
  198. height: 45rpx;
  199. background:var(--view-theme);
  200. border-radius:23rpx;
  201. font-size: 22rpx;
  202. color: #fff;
  203. position: relative;
  204. &.end{
  205. background:#cccccc;
  206. }
  207. .num{
  208. min-width: 14rpx;
  209. background-color: #fff;
  210. color: var(--view-theme);
  211. border-radius: 15px;
  212. position: absolute;
  213. right: -13rpx;
  214. top: -11rpx;
  215. font-size: 16rpx;
  216. padding: 0 10rpx;
  217. border: 1px solid var(--view-theme);
  218. }
  219. }
  220. }
  221. }
  222. }
  223. }
  224. </style>