refundOrderProduct.vue 5.8 KB

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