refundOrderProduct.vue 7.0 KB

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