index.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <view class="PanKuContainer">
  3. <view
  4. class="goodList"
  5. >
  6. <view
  7. v-for="(item, i) in infoList"
  8. :key="i"
  9. class="goodItem"
  10. >
  11. <view class="skuContainer">
  12. <view
  13. class="header"
  14. :class="item.toggle ? 'open' : ''"
  15. @click="item.toggle = !item.toggle"
  16. >
  17. <!-- <view class="icon"></view>
  18. <view class="name">{{ item.attr }}</view> -->
  19. <view class="top">
  20. <view
  21. class="avatar"
  22. :style="{ backgroundImage: `url(${item.imgurl})` }"
  23. />
  24. <view class="info">
  25. <view class="name">{{ item.name }}</view>
  26. <view class="fixed">一年零一天不满意退钱</view>
  27. </view>
  28. </view>
  29. </view>
  30. <view v-if="item.toggle" class="skuList">
  31. <view class="skuHeader">
  32. <view class="type">规格</view>
  33. <view class="size">尺码</view>
  34. <view class="num">数量</view>
  35. </view>
  36. <view
  37. v-for="(btem, bi) in item.spec"
  38. :key="bi"
  39. class="skuItem"
  40. >
  41. <view class="type color">{{ btem.sex ? '男款' : '女款' }}</view>
  42. <view class="size color">{{ btem.size }}</view>
  43. <view class="num color">{{ btem.num }}</view>
  44. </view>
  45. </view>
  46. <view class="dataAll">
  47. <view class="sex">
  48. 男款:{{ item.men }}{{ unit }}
  49. /
  50. 女款:{{ item.women }}{{ unit }}
  51. </view>
  52. <view class="num">
  53. 未发合计:<text class="spec">{{ item.total }}{{ unit }}</text>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import { GetExpressInnage, publishRuKu } from "@/apis/stock.js"
  63. export default {
  64. data() {
  65. return {
  66. status: false,
  67. infoList: [],
  68. unit: '件',
  69. order_id: ''
  70. }
  71. },
  72. watch: {
  73. status(a) {
  74. this.unit = a ? '件' : '套'
  75. }
  76. },
  77. onLoad(e) {
  78. this.order_id = e.order_id
  79. this.getRuKuInfo()
  80. },
  81. methods: {
  82. // 获取详情
  83. getRuKuInfo() {
  84. let _this = this
  85. uni.showLoading()
  86. GetExpressInnage({ id: _this.order_id}).then(res => {
  87. uni.hideLoading()
  88. if (res.code === 200) {
  89. Object.keys(res.data).forEach(k => {
  90. if(res.data[k].spec.length > 0) {
  91. if(res.data[k].spec.length > 6) {
  92. res.data[k].toggle = false
  93. } else {
  94. res.data[k].toggle = true
  95. }
  96. res.data[k].attr = _this.changeKey(k)
  97. res.data[k].men = res.data[k].spec.filter(({ sex }) => sex).reduce((a, b) => a + Number(b.num), 0)
  98. res.data[k].women = res.data[k].spec.filter(({ sex }) => !sex).reduce((a, b) => a + Number(b.num), 0)
  99. res.data[k].total = res.data[k].spec.reduce((a, b) => a + Number(b.num), 0)
  100. _this.infoList.push(res.data[k])
  101. }
  102. })
  103. } else {
  104. uni.showModal({
  105. content: res.message || "获取详情失败",
  106. showCancel: false,
  107. success:function(){
  108. uni.navigateBack({
  109. delta: 1
  110. })
  111. }
  112. })
  113. }
  114. }).catch(() => {
  115. uni.showModal({
  116. content: "获取失败",
  117. showCancel: false,
  118. success:function(){
  119. uni.navigateBack({
  120. delta: 1
  121. })
  122. }
  123. })
  124. })
  125. },
  126. changeKey(k) {
  127. let out = ''
  128. switch(k) {
  129. case 'hard':
  130. out = '精装版'
  131. break;
  132. case 'new_old':
  133. out = '纯棉版'
  134. break;
  135. case 'old':
  136. out = '高腰版'
  137. break;
  138. case 'simple':
  139. out = '简约版'
  140. break;
  141. case 'youth':
  142. out = '青春版'
  143. break;
  144. default:
  145. out = '简约版'
  146. break
  147. }
  148. return out
  149. }
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. page{
  155. display: flex;
  156. flex-direction: column;
  157. }
  158. .PanKuContainer {
  159. width: 100%;
  160. flex: 1;
  161. background-color: #F9F9FB;
  162. // padding: 30rpx;
  163. .btn {
  164. width: 140rpx;
  165. height: 56rpx;
  166. border-radius: 8rpx;
  167. background-color: #EA4A41;
  168. color: #FFFFFF;
  169. font-size: 28rpx;
  170. line-height: 56rpx;
  171. text-align: center;
  172. text-align: center;
  173. }
  174. .beizhu {
  175. padding: 30rpx 35rpx;
  176. margin-bottom: 120rpx;
  177. background-color: #fff;
  178. color: #333;
  179. font-size: 28rpx;
  180. &_title {
  181. font-size: 32rpx;
  182. font-weight: bold;
  183. color: #333333;
  184. margin-bottom: 20rpx;
  185. }
  186. &_cont {
  187. background: #F8F8F8;
  188. border-radius: 24rpx;
  189. padding: 30rpx;
  190. }
  191. }
  192. .reviseBtn {
  193. position: fixed;
  194. bottom: 0;
  195. left: 0;
  196. right: 0;
  197. height: 100rpx;
  198. display: flex;
  199. align-items: center;
  200. justify-content: space-between;
  201. background: #FFFFFF;
  202. color: #FFFFFF;
  203. font-size: 32rpx;
  204. padding: 0 30rpx;
  205. .type {
  206. color: #999999;
  207. font-size: 28rpx;
  208. margin-right: 10rpx;
  209. }
  210. .all {
  211. color: #333333;
  212. font-size: 28rpx;
  213. }
  214. .num {
  215. font-size: 40rpx;
  216. color: #EA4A41;
  217. }
  218. .unit {
  219. font-size: 28rpx;
  220. color: #EA4A41;
  221. }
  222. .submitBtn {
  223. width: 192rpx;
  224. height: 68rpx;
  225. line-height: 68rpx;
  226. text-align: center;
  227. border-radius: 68rpx;
  228. background: linear-gradient(to right, #F97C55, #F44545);
  229. color: #FFFFFF;
  230. font-size: 28rpx;
  231. }
  232. }
  233. .goodList {
  234. width: 100%;
  235. .goodItem {
  236. width: 100%;
  237. margin-bottom: 30rpx;
  238. box-sizing: border-box;
  239. .top {
  240. width: 100%;
  241. display: flex;
  242. align-items: stretch;
  243. justify-content: space-between;
  244. // margin-bottom: 40rpx;
  245. .avatar {
  246. width: 160rpx;
  247. height: 130rpx;
  248. background-color: #eeeeee;
  249. background-position: center;
  250. background-size: cover;
  251. background-repeat: no-repeat;
  252. border-radius: 16rpx;
  253. }
  254. .info {
  255. display: flex;
  256. justify-content: center;
  257. flex-direction: column;
  258. flex: 1;
  259. overflow: hidden;
  260. margin-left: 20rpx;
  261. .name {
  262. color: #333333;
  263. font-size: 32rpx;
  264. font-weight: bold;
  265. line-height: 44rpx;
  266. margin-bottom: 20rpx;
  267. }
  268. .fixed {
  269. font-size: 28rpx;
  270. height: 48rpx;
  271. line-height: 48rpx;
  272. // border: 1px solid #F76454;
  273. box-sizing: border-box;
  274. width: 304rpx;
  275. border-radius: 8rpx;
  276. background: #FFF4F3;
  277. color: #FB231F;
  278. text-align: center;
  279. }
  280. }
  281. }
  282. .skuContainer {
  283. width: 100%;
  284. background-color: #ffffff;
  285. box-sizing: border-box;
  286. // border-radius: 24rpx;
  287. overflow: hidden;
  288. .header {
  289. width: 100%;
  290. height: 200rpx;
  291. padding: 0 30rpx;
  292. box-sizing: border-box;
  293. display: flex;
  294. align-items: center;
  295. justify-content: flex-start;
  296. border-bottom: 1px solid #EEEEEE;
  297. .icon {
  298. width: 30rpx;
  299. height: 30rpx;
  300. border-radius: 50%;
  301. background-color: rgba(234, 74, 65, 0.36);
  302. margin-right: 10rpx;
  303. display: flex;
  304. align-items: center;
  305. justify-content: center;
  306. &::before {
  307. content: "";
  308. display: block;
  309. width: 18rpx;
  310. height: 18rpx;
  311. border-radius: 50%;
  312. background-color: #EA4A41;
  313. }
  314. }
  315. .name {
  316. color: #333333;
  317. font-size: 32rpx;
  318. line-height: 44rpx;
  319. }
  320. &::after {
  321. display: block;
  322. content: "";
  323. margin-left: auto;
  324. width: 20rpx;
  325. height: 30rpx;
  326. background-image: url(../../static/new_my/arrow.png);
  327. background-position: center;
  328. background-size: cover;
  329. background-repeat: no-repeat;
  330. }
  331. &.open {
  332. &::after {
  333. transform: rotate(90deg) !important;
  334. }
  335. }
  336. }
  337. .skuList{
  338. width: 100%;
  339. .skuHeader, .skuItem {
  340. width: 100%;
  341. height: 100rpx;
  342. padding: 0 30rpx;
  343. box-sizing: border-box;
  344. display: flex;
  345. align-items: center;
  346. justify-content: space-between;
  347. border-bottom: 1px solid #EEEEEE;
  348. .type, .size, .num {
  349. flex: 1;
  350. overflow: hidden;
  351. display: flex;
  352. align-items: center;
  353. justify-content: center;
  354. }
  355. .color {
  356. font-weight: bold;
  357. color: #333;
  358. }
  359. .type {
  360. justify-content: flex-start;
  361. }
  362. .size{
  363. justify-content: center;
  364. }
  365. .num {
  366. justify-content: flex-end;
  367. }
  368. }
  369. .skuHeader {
  370. color: #999999;
  371. font-size: 28rpx;
  372. line-height: 40rpx;
  373. }
  374. }
  375. .dataAll {
  376. width: 100%;
  377. height: 116rpx;
  378. padding: 0 30rpx;
  379. box-sizing: border-box;
  380. display: flex;
  381. align-items: center;
  382. justify-content: space-between;
  383. .sex {
  384. color: #333333;
  385. font-size: 28rpx;
  386. }
  387. .num {
  388. color: #999999;
  389. font-size: 28rpx;
  390. .spec {
  391. color: #EA4A41 !important;
  392. font-size: 40rpx !important;
  393. font-weight: bolder;
  394. }
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. </style>