refundOrderProduct.vue 6.7 KB

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