refundOrderProduct.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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. let refundItems=this.items.filter(item => item.checked==true )
  76. if(this.order.isPackage==1) {
  77. const item = {
  78. ...JSON.parse(this.order.packageJson),
  79. payMoney:this.order.payMoney
  80. }
  81. refundItems= [item]
  82. }
  83. if(refundItems.length==0){
  84. uni.showToast({
  85. icon:'none',
  86. title: '请选择退款商品'
  87. });
  88. return;
  89. }
  90. uni.navigateTo({
  91. url: '/pages_user/user/refundOrder?type='+type+"&orderCode="+this.order.orderCode+"&isPackage="+this.order.isPackage+'&orderId='+this.orderId
  92. })
  93. // uni.navigateTo({
  94. // url: '/pages_user/user/refundOrder?type='+type+"&orderCode="+this.order.orderCode
  95. // })
  96. uni.setStorageSync('refundItems',refundItems)
  97. // console.log(refundItems)
  98. // uni.redirectTo({
  99. // url: '/pages_user/user/refundOrder?orderId='+this.order.id+"&type="+type+"&orderCode="+this.order.orderCode
  100. // })
  101. },
  102. getMyStoreOrderItemByOrderId(){
  103. var data={orderId:this.orderId};
  104. getMyStoreOrderItemByOrderId(data).then(res => {
  105. if(res.code==200){
  106. this.order=res.order;
  107. this.items=res.items;
  108. }else{
  109. uni.showToast({
  110. icon:'none',
  111. title: "请求失败",
  112. });
  113. }
  114. });
  115. },
  116. }
  117. }
  118. </script>
  119. <style lang="scss">
  120. .content{
  121. margin-bottom: 170upx;
  122. .inner{
  123. padding: 20upx;
  124. .goods-list{
  125. .item{
  126. box-sizing: border-box;
  127. height: 221upx;
  128. background: #FFFFFF;
  129. padding: 30upx;
  130. display: flex;
  131. align-items: center;
  132. &:last-child{
  133. margin-bottom: 0;
  134. }
  135. .goods-img{
  136. width: 160upx;
  137. height: 160upx;
  138. background: #FFFFFF;
  139. margin-right: 30upx;
  140. flex-shrink: 0;
  141. }
  142. .info{
  143. width: calc(100% - 160upx);
  144. height: 160upx;
  145. display: flex;
  146. flex-direction: column;
  147. justify-content: space-between;
  148. .top{
  149. .title{
  150. font-size: 28upx;
  151. font-family: PingFang SC;
  152. font-weight: 500;
  153. color: #111111;
  154. line-height: 1.4;
  155. .tag{
  156. display: inline-block;
  157. padding: 0 6upx;
  158. height: 30upx;
  159. background: linear-gradient(90deg, #66b2ef 0%, #2BC7B9 100%);
  160. border-radius: 4upx;
  161. margin-right: 10upx;
  162. font-size: 22upx;
  163. font-family: PingFang SC;
  164. font-weight: bold;
  165. color: #FFFFFF;
  166. line-height: 30upx;
  167. float: left;
  168. margin-top: 7upx;
  169. }
  170. }
  171. .spec{
  172. font-size: 24upx;
  173. font-family: PingFang SC;
  174. font-weight: 500;
  175. color: #999999;
  176. line-height: 1;
  177. margin-top: 14upx;
  178. }
  179. }
  180. .price-num{
  181. display: flex;
  182. align-items: center;
  183. justify-content: space-between;
  184. .price-box{
  185. display: flex;
  186. align-items: flex-end;
  187. .unit{
  188. font-size: 24upx;
  189. font-family: PingFang SC;
  190. font-weight: 500;
  191. color: #111111;
  192. line-height: 1.2;
  193. margin-right: 5upx;
  194. }
  195. .price{
  196. font-size: 32upx;
  197. font-family: PingFang SC;
  198. font-weight: 500;
  199. color: #111111;
  200. line-height: 1;
  201. }
  202. }
  203. .num{
  204. font-size: 24upx;
  205. font-family: PingFang SC;
  206. font-weight: bold;
  207. color: #666666;
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. .btn-box{
  215. width: 100%;
  216. height: 160upx;
  217. position: fixed;
  218. bottom: 0;
  219. background: #FFFFFF;
  220. .text{
  221. font-size: 24upx;
  222. font-family: PingFang SC;
  223. font-weight: 500;
  224. color: #999999;
  225. line-height: 1;
  226. padding: 28upx 0;
  227. text-align: center;
  228. }
  229. .btns{
  230. padding: 0upx 30upx;
  231. display: flex;
  232. flex-direction: row;
  233. justify-content: space-between;
  234. align-items: center;
  235. .left{
  236. font-size: 24upx;
  237. font-family: PingFang SC;
  238. font-weight: 500;
  239. color: #999999;
  240. }
  241. .right{
  242. display: flex;
  243. flex-direction: row;
  244. justify-content: flex-end;
  245. align-items: center;
  246. .btn{
  247. width: 155upx;
  248. height: 64upx;
  249. line-height: 64upx;
  250. font-size: 26upx;
  251. font-family: PingFang SC;
  252. font-weight: 500;
  253. text-align: center;
  254. border-radius: 32upx;
  255. margin-left: 15upx;
  256. &.cancel{
  257. border: 1px solid #DDDDDD;
  258. color: #666666;
  259. }
  260. }
  261. }
  262. }
  263. }
  264. }
  265. </style>