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