index.vue 5.9 KB

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