goodsList.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template name="goods">
  2. <view class="goods-template">
  3. <!-- 商品列表 -->
  4. <view class="goods-list">
  5. <view v-for="(item, index) in shopOrderData" :key="index" class="goods-item clearfix">
  6. <view class="shoptitle">
  7. <view class="title-logo"><image :src="item.shopLogo" mode=""></image></view>
  8. <view class="title-text">{{item.shopName}}</view>
  9. </view>
  10. <view class="productlist" v-for="(pros,idx) in item.orderProductList" :key="idx">
  11. <view class="goods-pros-t">
  12. <view class="pros-left">
  13. <view class="pros-img"><image :src="pros.productImage" alt="" /></view>
  14. </view>
  15. <view class="pros-product">
  16. <view class="producttitle">{{pros.name}}</view>
  17. <view class="productspec product-view" v-if="pros.productCategory != 2">规格:{{pros.productUnit ? pros.productUnit : ''}}</view>
  18. <view class="floor-item-act" v-if="pros.ladderPriceFlag == 1"><view class="tag">活动价</view></view>
  19. <view class="product-view">
  20. <view class="view-num red">¥{{pros.price | NumFormat}}</view>
  21. </view>
  22. <view class="product-view">
  23. <view class="view-num right">x {{pros.num}}</view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="goods-pros-m" v-if="item.note">
  29. <view class="m-text">留言:</view>
  30. <view class="m-input">
  31. <view class="text">{{item.note ? item.note : ''}}</view>
  32. </view>
  33. </view>
  34. <view class="goods-pros-b">
  35. <view class="count">共{{item.itemCount}}件商品</view>
  36. <view class="sum">
  37. <view class="sum-money" :class="item.promotionFullReduction == 0 ? 'none' : ''">
  38. 商品总额:<text class="money">¥{{item.totalAmount | NumFormat}}</text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default{
  48. name:"goods",
  49. props:{
  50. shopOrderData:{
  51. type:Array
  52. },
  53. information:{
  54. type:Object
  55. }
  56. },
  57. data() {
  58. return{
  59. initData:[],
  60. }
  61. },
  62. created(){
  63. this.initData = this.shopOrderData
  64. },
  65. filters:{
  66. NumFormat(value) {//处理金额
  67. return Number(value).toFixed(2);
  68. },
  69. formatIncludedTax(value) {
  70. if (value === '1') {
  71. return '不含税 ';
  72. } else if (value === '2') {
  73. return '含税';
  74. } else {
  75. return '';
  76. }
  77. },
  78. },
  79. computed: {
  80. },
  81. methods:{
  82. goShophome(id){
  83. this.$api.navigateTo(`/supplier/pages/user/my-shop?shopId=${id}`)
  84. },
  85. details(pros){
  86. if(pros.validFlag == 9){
  87. return
  88. }else{
  89. console.log(pros)
  90. this.$api.navigateTo(`/pages/goods/product?id=${pros.organizeProductId}`)
  91. }
  92. },
  93. PromotionsFormat(promo){//促销活动类型数据处理
  94. if(promo!=null){
  95. if(promo.type == 1 && promo.mode == 1){
  96. return true
  97. }else{
  98. return false
  99. }
  100. }
  101. return false
  102. },
  103. }
  104. }
  105. </script>
  106. <style lang="scss">
  107. .goods-template{
  108. width: 100%;
  109. height: auto;
  110. background: #FFFFFF;
  111. float: left;
  112. margin-top: 24rpx;
  113. .goods-list{
  114. width: 100%;
  115. height: auto;
  116. background: #F7F7F7;
  117. .goods-item{
  118. width: 702rpx;
  119. padding:24rpx;
  120. height: auto;
  121. background: #FFFFFF;
  122. margin-bottom: 24rpx;
  123. &:last-child{
  124. margin-bottom: 0;
  125. }
  126. }
  127. .shoptitle{
  128. width: 100%;
  129. float: left;
  130. height: 56rpx;
  131. line-height: 56rpx;
  132. margin-bottom: 12rpx;
  133. .title-logo{
  134. width: 48rpx;
  135. height: 48rpx;
  136. float: left;
  137. border-radius: 8rpx;
  138. border: 1px solid #e1e1e1;
  139. margin-right: 8rpx;
  140. image{
  141. border-radius: 8rpx;
  142. width: 48rpx;
  143. height: 48rpx;
  144. }
  145. }
  146. .title-text{
  147. width: 400rpx;
  148. overflow: hidden;
  149. text-overflow:ellipsis;
  150. white-space: nowrap;
  151. float: left;
  152. font-size: $font-size-28;
  153. color: $text-color;
  154. text-align: left;
  155. line-height: 56rpx;
  156. font-weight: bold;
  157. .iconfont{
  158. color: #999999;
  159. font-size: 28rpx;
  160. margin-left: 10rpx;
  161. }
  162. .paymenttext{
  163. color: #f9a94b;
  164. font-size: $font-size-22;
  165. margin-left: 20rpx;
  166. }
  167. }
  168. }
  169. .productlist{
  170. width: 100%;
  171. height: auto;
  172. border-bottom: 2rpx solid #e1e1e1;
  173. padding: 10rpx;
  174. box-sizing: border-box;
  175. }
  176. .goods-pros-t{
  177. display: flex;
  178. width: 100%;
  179. height: auto;
  180. margin: 20rpx 0;
  181. .pros-left{
  182. width: 210rpx;
  183. height: 100%;
  184. margin:0 26rpx 0 0;
  185. }
  186. .pros-img{
  187. width: 210rpx;
  188. height: 210rpx;
  189. border-radius: 10rpx;
  190. border:1px solid #f3f3f3;
  191. position: relative;
  192. image{
  193. width: 210rpx;
  194. height: 210rpx;
  195. border-radius: 10rpx;
  196. }
  197. }
  198. }
  199. .pros-product{
  200. width: 468rpx;
  201. height: 100%;
  202. line-height: 36rpx;
  203. font-size: $font-size-26;
  204. position: relative;
  205. .product-view{
  206. &.allPrice{
  207. width: 100%;
  208. }
  209. .view-num{
  210. flex: 1;
  211. text-align: left;
  212. font-size: $font-size-26;
  213. color: #999999;
  214. line-height: 44rpx;
  215. float: left;
  216. &.right{
  217. float: right;
  218. }
  219. &.red{
  220. color: $color-system;
  221. font-weight: bold;
  222. &.disabled{
  223. color: #999999;
  224. text-decoration: line-through;
  225. }
  226. }
  227. }
  228. }
  229. .producttitle{
  230. width: 100%;
  231. display: inline-block;
  232. height: auto;
  233. text-overflow:ellipsis;
  234. display: -webkit-box;
  235. word-break: break-all;
  236. -webkit-box-orient: vertical;
  237. -webkit-line-clamp: 2;
  238. overflow: hidden;
  239. margin-bottom: 8rpx;
  240. }
  241. .productspec{
  242. height: 44rpx;
  243. color: #999999;
  244. line-height: 44rpx;
  245. }
  246. .productprice{
  247. height: 48rpx;
  248. position: absolute;
  249. width: 100%;
  250. bottom: 0;
  251. .price{
  252. line-height: 48rpx;
  253. font-size: $font-size-28;
  254. width: 48%;
  255. color: #FF2A2A;
  256. float: left;
  257. }
  258. .count{
  259. height: 100%;
  260. float: right;
  261. position: relative;
  262. .small{
  263. color: #666666;
  264. }
  265. }
  266. }
  267. .floor-item-act{
  268. width: 100%;
  269. height: 30rpx;
  270. margin-top: 8rpx;
  271. float: left;
  272. .tag{
  273. display: inline-block;
  274. width: 80rpx;
  275. height: 30rpx;
  276. background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png)top center no-repeat;
  277. background-size: contain;
  278. font-size: 22rpx;
  279. line-height: 30rpx;
  280. text-align: center;
  281. color: #f83c6c;
  282. float: left;
  283. }
  284. }
  285. }
  286. .goods-pros-m{
  287. width: 100%;
  288. height: auto;
  289. line-height: 76rpx;
  290. font-size: $font-size-26;
  291. color: $text-color;
  292. float: left;
  293. .m-text{
  294. width: 62rpx;
  295. float: left;
  296. padding-right: 20rpx;
  297. font-weight:bold;
  298. }
  299. .m-input{
  300. display: -webkit-box;
  301. display: -webkit-flex;
  302. display: flex;
  303. -webkit-box-align: center;
  304. -webkit-align-items: center;
  305. align-items: center;
  306. position: relative;
  307. width: 620rpx;
  308. height: auto;
  309. padding: 20rpx 0 10rpx 0;
  310. background: #FFFFFF;
  311. .text{
  312. width: 100%;
  313. height: 100%;
  314. font-size: $font-size-26;
  315. line-height: 36rpx;
  316. color: #333333;
  317. }
  318. }
  319. }
  320. .goods-pros-b{
  321. width:100%;
  322. height: 80rpx;
  323. margin-top: 12rpx;
  324. float: left;
  325. .count{
  326. float: left;
  327. font-size: $font-size-26;
  328. line-height: 80rpx;
  329. color: $text-color;
  330. display: flex;
  331. justify-content: flex-end;
  332. font-weight: bold;
  333. }
  334. .sum{
  335. width: 520rpx;
  336. float: right;
  337. .sum-money{
  338. width: 100%;
  339. height: 40rpx;
  340. font-size: $font-size-28;
  341. line-height: 40rpx;
  342. color: $text-color;
  343. display: flex;
  344. justify-content: flex-end;
  345. &.none{
  346. height: 80rpx;
  347. line-height: 80rpx;
  348. }
  349. .money{
  350. color: $color-system;
  351. font-size: $font-size-28;
  352. }
  353. }
  354. }
  355. }
  356. }
  357. }
  358. </style>