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