sellerGoodsList.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <template name="goods">
  2. <view class="goods-template">
  3. <!-- 商品列表 -->
  4. <view class="goods-list">
  5. <view v-for="(item, index) in goodsData" :key="index" class="goods-item">
  6. <view class="shoptitle">
  7. <view v-if="item.promotions" class="floor-item-act">
  8. <view class="floor-tags">{{item.promotions.name}}</view>
  9. </view>
  10. <view class="title-text">{{item.shopName}}</view>
  11. </view>
  12. <view class="productlist" v-for="(pros,idx) in item.cartList" :key="idx">
  13. <view class="goods-pros-t">
  14. <view class="pros-img">
  15. <image :src="pros.image" alt="" />
  16. <text class="tips" v-if="pros.productType == 2 || pros.productType == 1">赠品</text>
  17. </view>
  18. <view class="pros-product">
  19. <view class="producttitle">{{ pros.name }}</view>
  20. <view class="productspec" v-if="pros.productCategory!=2">规格:{{ pros.unit }}</view>
  21. <view class="productspec" v-if="pros.productCode!='' && pros.productCode!=null">
  22. <view >商品编码:{{pros.productCode}}</view>
  23. </view>
  24. <view class="productprice">
  25. <view class="price"><text>¥{{ pros.price | NumFormat }}</text></view>
  26. <view class="count"><text class="small">x</text>{{ pros.number }}</view>
  27. </view>
  28. <view class="floor-item-act">
  29. <template v-if="pros.actStatus == 1 && pros.promotions">
  30. <view v-if="PromotionsFormat(pros.promotions)" class="floor-tags">
  31. {{pros.promotions.name}}
  32. <text v-if ="pros.promotions!=null">
  33. :¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
  34. </text>
  35. </view>
  36. <view v-else-if="pros.promotions.type !=3" class="floor-tags">{{ pros.promotions.name }}</view>
  37. </template>
  38. <template v-if="pros.svipProductFlag == 1">
  39. <view class="svip-tags">
  40. <view class="tags">SVIP</view>
  41. <view class="price">{{ pros.svipPriceTag }}</view>
  42. </view>
  43. </template>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="goods-pros-m">
  49. <view class="m-text">留言:</view>
  50. <view class="m-input">
  51. <input type="text"
  52. v-model="remark[index]"
  53. @change="changeHandle(index)"
  54. placeholder-class="placeholder"
  55. maxlength="50"
  56. placeholder="选填,最多不超过50个汉字"/>
  57. </view>
  58. </view>
  59. <view class="goods-pros-b">
  60. <view class="sum-none" v-if="item.reducedPrice>0">
  61. <text class="money-sign">¥</text>
  62. <text class="money">{{ item.originalPrice | NumFormat }}</text>
  63. <text class="money-reduced">减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
  64. </view>
  65. <view class="sum">合计:<text class="money">¥{{ ( item.originalPrice -item.reducedPrice ) | NumFormat }}</text></view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. export default{
  73. name:'goods',
  74. props:{
  75. goodsData:{
  76. type:Array
  77. }
  78. },
  79. data() {
  80. return{
  81. remark:[]
  82. }
  83. },
  84. created(){
  85. },
  86. filters:{
  87. NumFormat(value) {//处理金额
  88. return Number(value).toFixed(2)
  89. },
  90. },
  91. watch: {
  92. goodsData: {
  93. handler: function (el) {//监听对象的变换使用 function,箭头函数容易出现this指向不正确
  94. this.goodsData = el
  95. },
  96. deep: true
  97. }
  98. },
  99. computed: {
  100. },
  101. methods:{
  102. PromotionsFormat(promo){//促销活动类型数据处理
  103. if(promo!=null){
  104. if(promo.type == 1 && promo.mode == 1){
  105. return true
  106. }else{
  107. return false
  108. }
  109. }
  110. return false
  111. },
  112. changeHandle (index) {//输入框的值被改变后
  113. this.goodsData[index].note = this.remark[index]
  114. this.$emit('handleGoodList',this.goodsData)
  115. }
  116. },
  117. }
  118. </script>
  119. <style lang="scss">
  120. .goods-template{
  121. width: 100%;
  122. height: auto;
  123. background: #FFFFFF;
  124. float: left;
  125. margin-top: 24rpx;
  126. .goods-list{
  127. width: 100%;
  128. height: auto;
  129. background:#F7F7F7;
  130. .goods-item{
  131. width: 702rpx;
  132. padding: 0 24rpx;
  133. background: #FFFFFF;
  134. margin-bottom: 24rpx;
  135. &:last-child{
  136. margin-bottom: 0;
  137. }
  138. }
  139. .shoptitle{
  140. display: flex;
  141. align-items: center;
  142. height: 80rpx;
  143. line-height: 80rpx;
  144. .title-text{
  145. width: 400rpx;
  146. overflow: hidden;
  147. text-overflow:ellipsis;
  148. white-space: nowrap;
  149. float: left;
  150. font-size: $font-size-28;
  151. color: $text-color;
  152. text-align: left;
  153. line-height: 56rpx;
  154. font-weight: bold;
  155. }
  156. .floor-item-act{
  157. height: 56rpx;
  158. text-align: center;
  159. box-sizing: border-box;
  160. float: left;
  161. padding: 12rpx 0;
  162. margin-right: 12rpx;
  163. }
  164. }
  165. .productlist{
  166. width: 100%;
  167. height: auto;
  168. }
  169. .goods-pros-t{
  170. display: flex;
  171. align-items: center;
  172. width: 100%;
  173. height: auto;
  174. padding:12rpx 0;
  175. .pros-img{
  176. width: 210rpx;
  177. height: 100%;
  178. border-radius: 10rpx;
  179. margin:0 26rpx 0 0;
  180. position: relative;
  181. .tips{
  182. display: inline-block;
  183. width: 80rpx;
  184. height: 40rpx;
  185. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  186. line-height: 40rpx;
  187. text-align: center;
  188. font-size: $font-size-24;
  189. color: #FFFFFF;
  190. border-radius:10rpx 0 10rpx 0 ;
  191. position: absolute;
  192. top:0;
  193. left: 0;
  194. }
  195. image{
  196. width: 210rpx;
  197. height: 210rpx;
  198. border-radius: 10rpx;
  199. border:1px solid #f3f3f3;
  200. }
  201. }
  202. }
  203. .pros-product{
  204. width: 468rpx;
  205. height: 100%;
  206. line-height: 40rpx;
  207. font-size: $font-size-26;
  208. position: relative;
  209. .producttitle{
  210. width: 100%;
  211. display: inline-block;
  212. height: auto;
  213. text-overflow:ellipsis;
  214. display: -webkit-box;
  215. word-break: break-all;
  216. -webkit-box-orient: vertical;
  217. -webkit-line-clamp: 2;
  218. overflow: hidden;
  219. margin-bottom: 8rpx;
  220. }
  221. .productspec{
  222. height: 40rpx;
  223. color: #999999;
  224. line-height: 40rpx;
  225. text-overflow:ellipsis;
  226. display: -webkit-box;
  227. word-break: break-all;
  228. -webkit-box-orient: vertical;
  229. -webkit-line-clamp: 2;
  230. overflow: hidden;
  231. }
  232. .productprice{
  233. height: 54rpx;
  234. line-height: 54rpx;
  235. width: 100%;
  236. float: left;
  237. .price{
  238. line-height: 54rpx;
  239. font-size: $font-size-28;
  240. width: 48%;
  241. color: #FF2A2A;
  242. float: left;
  243. }
  244. .count{
  245. height: 100%;
  246. float: right;
  247. position: relative;
  248. .small{
  249. color: #666666;
  250. }
  251. }
  252. }
  253. .floor-item-act{
  254. width: 100%;
  255. height: 56rpx;
  256. text-align: center;
  257. box-sizing: border-box;
  258. float: left;
  259. padding:0 0 10rpx 0;
  260. }
  261. }
  262. .goods-pros-m{
  263. height: 76rpx;
  264. line-height: 76rpx;
  265. font-size: $font-size-26;
  266. color: $text-color;
  267. margin-top: 12rpx;
  268. .m-text{
  269. width: 62rpx;
  270. float: left;
  271. padding-right: 20rpx;
  272. font-weight:bold;
  273. }
  274. .m-input{
  275. display: -webkit-box;
  276. display: -webkit-flex;
  277. display: flex;
  278. -webkit-box-align: center;
  279. -webkit-align-items: center;
  280. align-items: center;
  281. position: relative;
  282. width: 576rpx;
  283. height: 36rpx;
  284. padding: 20rpx;
  285. background: #fff;
  286. border-radius: 10rpx;
  287. border: 2rpx solid #b2b2b2;
  288. input{
  289. width: 100%;
  290. height: 100%;
  291. // background: #F7F7F7;
  292. font-size: $font-size-26;
  293. line-height: 36rpx;
  294. color: #333333;
  295. min-height: 36rpx;
  296. }
  297. }
  298. }
  299. .goods-pros-b{
  300. width:100%;
  301. height: auto;
  302. padding: 10rpx 0;
  303. .sum-none{
  304. width: 100%;
  305. height: 48rpx;
  306. line-height: 48rpx;
  307. color: $text-color;
  308. float: left;
  309. text-align: right;
  310. .money{
  311. font-size: $font-size-26;
  312. color: #999999;
  313. text-decoration: line-through;
  314. }
  315. .money-sign{
  316. font-size: $font-size-26;
  317. color: #999999;
  318. text-decoration: line-through;
  319. }
  320. .money-reduced{
  321. margin-left: 10rpx;
  322. font-size: $font-size-26;
  323. color: $color-system;
  324. .iconfont{
  325. font-size: $font-size-34;
  326. }
  327. }
  328. }
  329. .sum{
  330. width: 100%;
  331. height: 48rpx;
  332. font-size: $font-size-28;
  333. line-height: 48rpx;
  334. color: $text-color;
  335. display: flex;
  336. justify-content: flex-end;
  337. .money{
  338. color: #FF2A2A;
  339. font-size: $font-size-28;
  340. }
  341. }
  342. }
  343. }
  344. }
  345. </style>