goodsList.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template name="goods">
  2. <view class="goods-template">
  3. <!-- 商品列表 -->
  4. <view class="goods-list">
  5. <view v-for="(item, index) in list" :key="index" class="goods-item clearfix">
  6. <view class="shoptitle">
  7. <!-- <view class="title-text" v-if="information.secondHandOrderFlag == 1"
  8. >{{ item.shopName }}
  9. </view> -->
  10. <view class="title-text" @click="goShophome(item)">
  11. {{ item.shopName }} <label class="iconfont icon-jinrudianpu"></label>
  12. </view>
  13. </view>
  14. <view class="productlist" v-for="(i, o) in item.orderProductList" :key="o">
  15. <view class="goods-pros-t " @click="details(i)">
  16. <view class="pros-left">
  17. <view class="pros-img">
  18. <image :src="i.image" alt="" />
  19. </view>
  20. </view>
  21. <view class="pros-product">
  22. <view class="producttitle">{{ i.name }}</view>
  23. <view class="productspec product-view" v-if="i.productCategory != 2"
  24. >规格:{{ i.productUnit ? i.productUnit : '' }}</view
  25. >
  26. <view class="product-view">
  27. <view class="view-num red">¥{{ i.price | NumFormat }}</view>
  28. <view class="view-num right">x {{ i.num }}</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="goods-pros-m" v-if="item.note">
  34. <view class="m-text">留言:</view>
  35. <view class="m-input">
  36. <view class="text">{{ item.note ? item.note : '' }}</view>
  37. </view>
  38. </view>
  39. <view class="goods-pros-b clearfix">
  40. <view class="pros-price-view">
  41. <view class="price-view-le">商品总额:</view>
  42. <view class="price-view-ri">¥{{ item.totalAmount | NumFormat }}</view>
  43. </view>
  44. <view class="pros-price-view" @click="popupShow = true">
  45. <view class="price-view-le">运费:</view>
  46. <view class="price-view-ri">{{ item.postageInfo }}</view>
  47. </view>
  48. <view class="pros-price-view">
  49. <view class="price-view-le">应付金额:</view>
  50. <view class="price-view-ri">¥{{ item.realPay | NumFormat }}</view>
  51. </view>
  52. <view class="pros-price-view">
  53. <view class="price-view-le">已付金额:</view>
  54. <view class="price-view-ri">¥{{ item.receiptAmount | NumFormat }}</view>
  55. </view>
  56. <view class="pros-price-view">
  57. <view class="price-view-le">待付金额:</view>
  58. <view class="price-view-ri red">¥{{ item.obligation | NumFormat }}</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. name: 'goods',
  68. props: {
  69. shopOrderData: {
  70. type: Object
  71. },
  72. information: {
  73. type: Object
  74. }
  75. },
  76. data() {
  77. return {
  78. list: [],
  79. vipFlag: 0,
  80. }
  81. },
  82. created() {
  83. this.initGetStotage(this.shopOrderData)
  84. },
  85. filters: {
  86. NumFormat(value) {
  87. //处理金额
  88. return Number(value).toFixed(2)
  89. },
  90. formatIncludedTax(value) {
  91. if (value === '1') {
  92. return '不含税 '
  93. } else if (value === '2') {
  94. return '含税'
  95. } else {
  96. return ''
  97. }
  98. }
  99. },
  100. computed: {},
  101. methods: {
  102. async initGetStotage(data) {
  103. const userInfo = await this.$api.getStorage()
  104. this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
  105. this.list = [data]
  106. },
  107. goShophome(shop) {
  108. if(shop.shopType === 2){
  109. return
  110. }
  111. this.$api.navigateTo(`/pages/supplier/user/my-shop?shopId=${shop.shopId}`)
  112. },
  113. details(pros) {
  114. if (pros.validFlag == 9) {
  115. return
  116. } else {
  117. this.$api.navigateTo(`/pages/goods/product?id=${pros.productId}`)
  118. }
  119. },
  120. clickPopupShow(pros) {
  121. console.log(pros)
  122. this.$emit('popupClick', pros)
  123. },
  124. PromotionsFormat(promo) {
  125. //促销活动类型数据处理
  126. if (promo != null) {
  127. if (promo.type == 1 && promo.mode == 1) {
  128. return true
  129. } else {
  130. return false
  131. }
  132. }
  133. return false
  134. }
  135. }
  136. }
  137. </script>
  138. <style lang="scss">
  139. .goods-template {
  140. width: 100%;
  141. height: auto;
  142. background: #ffffff;
  143. float: left;
  144. margin-top: 24rpx;
  145. .goods-list {
  146. width: 100%;
  147. height: auto;
  148. background: #f7f7f7;
  149. .goods-item {
  150. width: 702rpx;
  151. padding: 24rpx;
  152. height: auto;
  153. background: #ffffff;
  154. margin-bottom: 24rpx;
  155. &:last-child {
  156. margin-bottom: 0;
  157. }
  158. }
  159. .shoptitle {
  160. width: 100%;
  161. float: left;
  162. height: 56rpx;
  163. line-height: 56rpx;
  164. margin-bottom: 12rpx;
  165. .floor-item-act{
  166. height: 56rpx;
  167. text-align: center;
  168. box-sizing: border-box;
  169. float: left;
  170. padding: 10rpx 0;
  171. margin-right: 12rpx;
  172. .floor-tags{
  173. height: 28rpx;
  174. border-radius: 6rpx;
  175. background-color: #FFFFFF;
  176. line-height: 28rpx;
  177. color: $color-system;
  178. text-align: center;
  179. display: inline-block;
  180. padding:0 6rpx;
  181. font-size: $font-size-20;
  182. border: 1px solid #FF5B00;
  183. float: left;
  184. }
  185. }
  186. .title-text {
  187. width: 400rpx;
  188. overflow: hidden;
  189. text-overflow: ellipsis;
  190. white-space: nowrap;
  191. float: left;
  192. font-size: $font-size-28;
  193. color: $text-color;
  194. text-align: left;
  195. line-height: 56rpx;
  196. font-weight: bold;
  197. .iconfont {
  198. color: #999999;
  199. font-size: 28rpx;
  200. margin-left: 10rpx;
  201. }
  202. .paymenttext {
  203. color: #f9a94b;
  204. font-size: $font-size-22;
  205. margin-left: 20rpx;
  206. }
  207. }
  208. }
  209. .productlist {
  210. width: 100%;
  211. height: auto;
  212. padding: 0;
  213. box-sizing: border-box;
  214. }
  215. .goods-pros-t {
  216. display: flex;
  217. width: 100%;
  218. height: auto;
  219. margin: 20rpx 0;
  220. .pros-left {
  221. width: 210rpx;
  222. height: 100%;
  223. margin: 0 26rpx 0 0;
  224. }
  225. .pros-img {
  226. width: 210rpx;
  227. height: 210rpx;
  228. border-radius: 10rpx;
  229. border: 1px solid #f3f3f3;
  230. position: relative;
  231. .tips {
  232. display: inline-block;
  233. width: 80rpx;
  234. height: 40rpx;
  235. background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
  236. line-height: 40rpx;
  237. text-align: center;
  238. font-size: $font-size-24;
  239. color: #ffffff;
  240. border-radius: 10rpx 0 10rpx 0;
  241. position: absolute;
  242. top: 0;
  243. left: 0;
  244. }
  245. image {
  246. width: 210rpx;
  247. height: 210rpx;
  248. border-radius: 10rpx;
  249. }
  250. }
  251. }
  252. .product-info {
  253. padding: 10rpx 0;
  254. .product-view {
  255. font-size: $font-size-24;
  256. color: #999999;
  257. overflow: hidden;
  258. height: 44rpx;
  259. line-height: 44rpx;
  260. float: left;
  261. width: 50%;
  262. .view-num {
  263. float: left;
  264. .text{
  265. color: #333333;
  266. }
  267. }
  268. }
  269. }
  270. .pros-product {
  271. width: 468rpx;
  272. height: 100%;
  273. line-height: 36rpx;
  274. font-size: $font-size-26;
  275. position: relative;
  276. .product-view {
  277. &.allPrice {
  278. width: 100%;
  279. }
  280. .view-num {
  281. flex: 1;
  282. text-align: left;
  283. font-size: $font-size-26;
  284. color: #999999;
  285. line-height: 44rpx;
  286. float: left;
  287. &.right {
  288. float: right;
  289. }
  290. &.red {
  291. color: #ff2000;
  292. font-weight: bold;
  293. &.none {
  294. text-decoration: line-through;
  295. color: #999999;
  296. }
  297. }
  298. }
  299. }
  300. .producttitle {
  301. width: 100%;
  302. display: inline-block;
  303. height: auto;
  304. text-overflow: ellipsis;
  305. display: -webkit-box;
  306. word-break: break-all;
  307. -webkit-box-orient: vertical;
  308. -webkit-line-clamp: 2;
  309. overflow: hidden;
  310. margin-bottom: 8rpx;
  311. }
  312. .productspec {
  313. height: 44rpx;
  314. color: #999999;
  315. line-height: 44rpx;
  316. text-overflow: ellipsis;
  317. display: -webkit-box;
  318. word-break: break-all;
  319. -webkit-box-orient: vertical;
  320. -webkit-line-clamp: 1;
  321. overflow: hidden;
  322. margin-bottom: 25rpx;
  323. }
  324. .productprice {
  325. height: 48rpx;
  326. position: absolute;
  327. width: 100%;
  328. bottom: 0;
  329. .price {
  330. line-height: 48rpx;
  331. font-size: $font-size-28;
  332. width: 48%;
  333. color: #ff2a2a;
  334. float: left;
  335. .price {
  336. line-height: 48rpx;
  337. font-size: $font-size-28;
  338. width: 48%;
  339. color: #ff2a2a;
  340. float: left;
  341. font-weight: bold;
  342. }
  343. }
  344. .count {
  345. height: 100%;
  346. float: right;
  347. position: relative;
  348. .small {
  349. color: #666666;
  350. }
  351. }
  352. }
  353. .floor-item-act {
  354. width: 100%;
  355. height: 56rpx;
  356. text-align: center;
  357. box-sizing: border-box;
  358. float: left;
  359. padding: 10rpx 0 0 0;
  360. }
  361. .floor-item-act {
  362. height: 56rpx;
  363. text-align: center;
  364. box-sizing: border-box;
  365. float: left;
  366. padding: 10rpx 0;
  367. margin-right: 12rpx;
  368. }
  369. }
  370. .goods-pros-m {
  371. width: 100%;
  372. height: auto;
  373. line-height: 76rpx;
  374. font-size: $font-size-26;
  375. color: $text-color;
  376. float: left;
  377. .m-text {
  378. width: 62rpx;
  379. float: left;
  380. padding-right: 20rpx;
  381. font-weight: bold;
  382. }
  383. .m-input {
  384. display: -webkit-box;
  385. display: -webkit-flex;
  386. display: flex;
  387. -webkit-box-align: center;
  388. -webkit-align-items: center;
  389. align-items: center;
  390. position: relative;
  391. width: 620rpx;
  392. height: auto;
  393. padding: 20rpx 0 10rpx 0;
  394. background: #ffffff;
  395. .text {
  396. width: 100%;
  397. height: 100%;
  398. font-size: $font-size-26;
  399. line-height: 36rpx;
  400. color: #333333;
  401. }
  402. }
  403. }
  404. .goods-pros-b {
  405. width: 100%;
  406. padding-top: 12rpx;
  407. float: left;
  408. .pros-price-view{
  409. width: 100%;
  410. height: 44rpx;
  411. font-size: 24rpx;
  412. line-height: 44rpx;
  413. .price-view-le{
  414. float: left;
  415. color: #999999;
  416. text-align: left;
  417. }
  418. .price-view-ri{
  419. float: right;
  420. color: #333333;
  421. text-align: right;
  422. &.red{
  423. color: #F94B4B;
  424. }
  425. }
  426. }
  427. .pros-price-btn{
  428. width: 100%;
  429. height: 48rpx;
  430. .btn{
  431. width: 168rpx;
  432. height: 48rpx;
  433. line-height: 46rpx;
  434. box-sizing: border-box;
  435. border: 2rpx solid #e1e1e1;
  436. border-radius: 8rpx;
  437. text-align: center;
  438. color: #b2b2b2;
  439. margin: 0 auto;
  440. font-size: $font-size-24;
  441. .iconfont {
  442. }
  443. }
  444. }
  445. }
  446. }
  447. }
  448. </style>