refundOrderProduct.vue 6.6 KB

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