index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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'">{{$t(`秒杀`)}}</span>
  7. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</span>
  8. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</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">{{$t(`¥`)}}</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 acea-row row-center-wrapper" @click.stop="goCartDuo(item)"
  29. v-if="item.spec_type">
  30. {{$t(`选规格`)}}
  31. <text class="num" v-if="isLogin && item.cart_num">{{item.cart_num}}</text>
  32. </view>
  33. <!-- 单规格 -->
  34. <view class="iconfont icon-gouwuche6 acea-row row-center-wrapper"
  35. v-if="!item.spec_type && !item.cart_num" @click.stop="goCartDan(item,index)"></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)"></view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="bnt acea-row row-center-wrapper end" v-else>{{$t(`已售罄`)}}</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. },
  68. data() {
  69. return {
  70. addIng: false
  71. };
  72. },
  73. created() {},
  74. mounted() {},
  75. methods: {
  76. goDetail(item) {
  77. this.$emit('detail', item);
  78. },
  79. goCartDuo(item) {
  80. this.$emit('gocartduo', item);
  81. },
  82. goCartDan(item, index) {
  83. this.$emit('gocartdan', item, index);
  84. },
  85. CartNumDes(index, item) {
  86. if (this.addIng) return
  87. this.addIng = true
  88. this.$emit('ChangeCartNumDan', false, index, item);
  89. },
  90. CartNumAdd(index, item) {
  91. console.log('2')
  92. if (this.addIng) return
  93. this.addIng = true
  94. this.$emit('ChangeCartNumDan', true, index, item);
  95. }
  96. }
  97. };
  98. </script>
  99. <style lang="scss">
  100. .goodsList {
  101. padding: 0 30rpx;
  102. .item {
  103. width: 100%;
  104. box-sizing: border-box;
  105. margin-bottom: 63rpx;
  106. .pictrue {
  107. width: 140rpx;
  108. height: 140rpx;
  109. border-radius: 10rpx;
  110. position: relative;
  111. border-radius: 22rpx;
  112. image {
  113. width: 100%;
  114. height: 100%;
  115. border-radius: 22rpx;
  116. }
  117. }
  118. .pictxt {
  119. width: 372rpx;
  120. .text {
  121. font-size: 26rpx;
  122. font-family: PingFang SC;
  123. font-weight: 500;
  124. color: #333333;
  125. }
  126. .bottom {
  127. margin-top: 22rpx;
  128. .money {
  129. font-size: 34rpx;
  130. font-weight: 800;
  131. .sign {
  132. font-size: 24rpx;
  133. }
  134. .y_money {
  135. font-size: 20rpx;
  136. color: #999999;
  137. margin-left: 14rpx;
  138. font-weight: normal;
  139. text-decoration: line-through;
  140. }
  141. .vip {
  142. font-size: 22rpx;
  143. color: #333333;
  144. font-weight: normal;
  145. margin-left: 14rpx;
  146. image {
  147. width: 38rpx;
  148. height: 18rpx;
  149. margin-right: 6rpx;
  150. }
  151. }
  152. }
  153. .cart {
  154. height: 46rpx;
  155. .pictrue {
  156. color: var(--view-theme);
  157. font-size: 46rpx;
  158. width: 46rpx;
  159. height: 46rpx;
  160. text-align: center;
  161. line-height: 46rpx;
  162. &.icon-jiahao {
  163. color: var(--view-theme);
  164. }
  165. }
  166. .num {
  167. font-size: 30rpx;
  168. color: #333333;
  169. font-weight: bold;
  170. width: 60rpx;
  171. text-align: center;
  172. }
  173. }
  174. .icon-gouwuche6 {
  175. width: 46rpx;
  176. height: 46rpx;
  177. background-color: var(--view-theme);
  178. border-radius: 50%;
  179. color: #fff;
  180. font-size: 30rpx;
  181. }
  182. .bnt {
  183. padding: 0 20rpx;
  184. height: 45rpx;
  185. background: var(--view-theme);
  186. border-radius: 23rpx;
  187. font-size: 22rpx;
  188. color: #fff;
  189. position: relative;
  190. &.end {
  191. background: #cccccc;
  192. }
  193. .num {
  194. min-width: 14rpx;
  195. background-color: #fff;
  196. color: var(--view-theme);
  197. border-radius: 15px;
  198. position: absolute;
  199. right: -13rpx;
  200. top: -11rpx;
  201. font-size: 16rpx;
  202. padding: 0 10rpx;
  203. border: 1px solid var(--view-theme);
  204. }
  205. }
  206. }
  207. }
  208. }
  209. }
  210. </style>