goodsList.vue 8.2 KB

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