goodsList.vue 11 KB

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