goodsList.vue 11 KB

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