index.vue 5.4 KB

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