refundOrderProduct.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="content">
  3. <view class="inner">
  4. <view class="goods-list">
  5. <view v-if="order!=null&&order.isPackage!=1" class="item" v-for="(item,index) in items" :key="index">
  6. <image class="goods-img" :src="JSON.parse(item.jsonInfo).image" mode="aspectFit"></image>
  7. <view class="info">
  8. <view class="top">
  9. <view class="title ellipsis2">{{ JSON.parse(item.jsonInfo).productName}}</view>
  10. <view class="spec">{{JSON.parse(item.jsonInfo).sku}}</view>
  11. </view>
  12. <view class="price-num">
  13. <view class="price-box">
  14. <text class="unit">¥</text>
  15. <text class="price">{{JSON.parse(item.jsonInfo).price.toFixed(2)}}</text>
  16. </view>
  17. <view class="num">x{{JSON.parse(item.jsonInfo).num}}</view>
  18. </view>
  19. </view>
  20. </view>
  21. <view v-if="order!=null&&order.isPackage==1&&order.packageJson!=null" class="item">
  22. <image class="goods-img" :src="JSON.parse(order.packageJson).imgUrl" mode="aspectFit"></image>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 底部按钮 -->
  27. <view class="btn-box">
  28. <view class="text">提交申请后,客服会与您电话沟通,请保持手机通畅</view>
  29. <view class="btns">
  30. <view class="left"></view>
  31. <view class="right">
  32. <view class="btn cancel" v-if="order.status==2 || order.status==3" @click="submit(0)">仅退款</view>
  33. <view class="btn cancel" v-if="order.status==4" @click="submit(1)">退款退货</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. getStoreOrderItems, //获取订单项列表
  42. } from '@/api/order.js'
  43. export default {
  44. data() {
  45. return {
  46. order: {},
  47. items: [],
  48. }
  49. },
  50. onLoad(option) {
  51. this.orderId = option.orderId;
  52. this.getStoreOrder()
  53. },
  54. methods: {
  55. checkChange(item) {
  56. item.checked = !item.checked;
  57. },
  58. submit(type) {
  59. uni.redirectTo({
  60. url: '/pages_shopping/live/refundOrder?orderId=' + this.order.orderId + "&type=" + type + "&orderCode=" +
  61. this.order.orderCode
  62. })
  63. },
  64. getStoreOrder() {
  65. var data = {
  66. orderId: this.orderId
  67. };
  68. getStoreOrderItems(data).then(res => {
  69. if (res.code == 200) {
  70. console.log("获取订单项列表>>>", res)
  71. this.order = res.order;
  72. this.items = res.items;
  73. } else {
  74. uni.showToast({
  75. icon: 'none',
  76. title: "请求失败",
  77. });
  78. }
  79. });
  80. },
  81. }
  82. }
  83. </script>
  84. <style lang="scss">
  85. .content {
  86. margin-bottom: 170rpx;
  87. .inner {
  88. padding: 20rpx;
  89. .goods-list {
  90. .item {
  91. box-sizing: border-box;
  92. height: 221rpx;
  93. background: #FFFFFF;
  94. padding: 30rpx;
  95. display: flex;
  96. align-items: center;
  97. &:last-child {
  98. margin-bottom: 0;
  99. }
  100. .goods-img {
  101. width: 160rpx;
  102. height: 160rpx;
  103. background: #FFFFFF;
  104. margin-right: 30rpx;
  105. flex-shrink: 0;
  106. }
  107. .info {
  108. width: calc(100% - 160rpx);
  109. height: 160rpx;
  110. display: flex;
  111. flex-direction: column;
  112. justify-content: space-between;
  113. .top {
  114. .title {
  115. font-size: 28rpx;
  116. font-family: PingFang SC;
  117. font-weight: 500;
  118. color: #111111;
  119. line-height: 1.4;
  120. .tag {
  121. display: inline-block;
  122. padding: 0 6rpx;
  123. height: 30rpx;
  124. background: linear-gradient(90deg, #2ed9c8 0%, #2BC7B9 100%);
  125. border-radius: 4rpx;
  126. margin-right: 10rpx;
  127. font-size: 22rpx;
  128. font-family: PingFang SC;
  129. font-weight: bold;
  130. color: #FFFFFF;
  131. line-height: 30rpx;
  132. float: left;
  133. margin-top: 7rpx;
  134. }
  135. }
  136. .spec {
  137. font-size: 24rpx;
  138. font-family: PingFang SC;
  139. font-weight: 500;
  140. color: #999999;
  141. line-height: 1;
  142. margin-top: 14rpx;
  143. }
  144. }
  145. .price-num {
  146. display: flex;
  147. align-items: center;
  148. justify-content: space-between;
  149. .price-box {
  150. display: flex;
  151. align-items: flex-end;
  152. .unit {
  153. font-size: 24rpx;
  154. font-family: PingFang SC;
  155. font-weight: 500;
  156. color: #111111;
  157. line-height: 1.2;
  158. margin-right: 5rpx;
  159. }
  160. .price {
  161. font-size: 32rpx;
  162. font-family: PingFang SC;
  163. font-weight: 500;
  164. color: #111111;
  165. line-height: 1;
  166. }
  167. }
  168. .num {
  169. font-size: 24rpx;
  170. font-family: PingFang SC;
  171. font-weight: bold;
  172. color: #666666;
  173. }
  174. }
  175. }
  176. }
  177. }
  178. }
  179. .btn-box {
  180. width: 100%;
  181. height: 160rpx;
  182. position: fixed;
  183. bottom: 0;
  184. background: #FFFFFF;
  185. .text {
  186. font-size: 24rpx;
  187. font-family: PingFang SC;
  188. font-weight: 500;
  189. color: #999999;
  190. line-height: 1;
  191. padding: 28rpx 0;
  192. text-align: center;
  193. }
  194. .btns {
  195. padding: 0rpx 30rpx;
  196. display: flex;
  197. flex-direction: row;
  198. justify-content: space-between;
  199. align-items: center;
  200. .left {
  201. font-size: 24rpx;
  202. font-family: PingFang SC;
  203. font-weight: 500;
  204. color: #999999;
  205. }
  206. .right {
  207. display: flex;
  208. flex-direction: row;
  209. justify-content: flex-end;
  210. align-items: center;
  211. .btn {
  212. width: 155rpx;
  213. height: 64rpx;
  214. line-height: 64rpx;
  215. font-size: 26rpx;
  216. font-family: PingFang SC;
  217. font-weight: 500;
  218. text-align: center;
  219. border-radius: 32rpx;
  220. margin-left: 15rpx;
  221. &.cancel {
  222. border: 1px solid #DDDDDD;
  223. color: #666666;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }
  230. </style>