refund.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view class="wrap">
  3. <navbar :iSimmersive="false" title-color="#ffffff" background="#1b43c4" :placeholder="true" title="退款详情"></navbar>
  4. <info v-if="isError"></info>
  5. <view v-if="!isError">
  6. <view class="goods">
  7. <view class="title">
  8. <text>{{order.item.length}}件商品</text>
  9. </view>
  10. <view class="goods-box">
  11. <view
  12. class="goods-item clear"
  13. v-for="(value,index) in order.item"
  14. :key="index"
  15. >
  16. <view class="goods-img">
  17. <image :src="value.thumb_image">
  18. </view>
  19. <view class="goods-info">
  20. <view class="t">
  21. <text>{{value.title}}</text>
  22. <text>{{value.sell_price}}</text>
  23. </view>
  24. <view class="b">
  25. <text>{{value.spec}}</text>
  26. <text>× {{value.nums}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="order">
  33. <view class="list clear">
  34. <view class="list-box clear">
  35. <view>商品金额:</view>
  36. <view>{{order.real_amount}}</view>
  37. </view>
  38. <view class="list-box clear">
  39. <view>运费金额:</view>
  40. <view>{{order.payable_freight}}</view>
  41. </view>
  42. <view class="list-box clear">
  43. <view>订单总额:</view>
  44. <view class="money">{{order.order_amount}}</view>
  45. </view>
  46. <view class="list-box clear" v-if="!order.is_refund">
  47. <textarea @blur="bindTextAreaBlur" placeholder="请填写退款说明" maxlength="200" style="width: 100%; height: 100rpx;"></textarea>
  48. </view>
  49. <view class="list-box clear" v-else>
  50. <view style="width: 100%;">拒绝原因:</view>
  51. <view style="width: 100%;text-align: left;word-wrap:break-word;line-height: 30rpx;">
  52. <text>{{order.refund_msg}}</text>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="btn" v-if="!order.is_refund">
  58. <view @click="onSubmit">申请退款</view>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. import info from '@/components/tool/info.vue'
  65. import subscribe from "@/common/subscribe";
  66. export default {
  67. components:{
  68. info
  69. },
  70. data(){
  71. return {
  72. isError: false,
  73. isSubmit: false,
  74. orderId: 0,
  75. message: "",
  76. order:{
  77. item: [],
  78. order_amount: "",
  79. order_no: "",
  80. payable_freight: '',
  81. payable_amount: "",
  82. promotions: "",
  83. real_amount: "",
  84. is_refund:false,
  85. order_status: ""
  86. }
  87. };
  88. },
  89. onLoad(options) {
  90. this.isError = false;
  91. this.orderId = options.id;
  92. this.$http.getOrderRefund({
  93. id: this.orderId
  94. }).then((res)=>{
  95. if(res.status){
  96. this.order = res.data;
  97. }else{
  98. this.$utils.msg(res.info);
  99. }
  100. this.isError = false;
  101. }).catch((err)=>{
  102. this.isError = true;
  103. });
  104. subscribe.refund();
  105. },
  106. methods: {
  107. bindTextAreaBlur: function (e) {
  108. this.message = e.detail.value;
  109. },
  110. onSubmit(){
  111. if(this.isSubmit){
  112. return false;
  113. }
  114. this.$utils.showLoading();
  115. this.isSubmit = true;
  116. this.$http.sendOrderRefund({
  117. id: this.orderId,
  118. message: this.message
  119. }).then(res=>{
  120. this.$utils.hideLoading();
  121. if(res.status){
  122. this.$utils.msg(res.info);
  123. this.order.is_refund = true;
  124. this.$utils.redirectTo('order/detail',{
  125. id: this.orderId
  126. });
  127. }else{
  128. this.$utils.msg(res.info);
  129. }
  130. this.isSubmit = false;
  131. }).catch(err=>{
  132. this.$utils.hideLoading();
  133. this.isSubmit = false;
  134. this.$utils.msg("网络出错,请检查网络是否连接");
  135. });
  136. }
  137. }
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. .money{ color: #fc4141; }
  142. .goods{
  143. background-color: #fff;
  144. margin-top: 30rpx;
  145. padding-bottom: 20rpx;
  146. .title{
  147. width: 100%;
  148. margin: 0 auto;
  149. color: #666;
  150. font-size: 28rpx;
  151. height: 80rpx;
  152. line-height: 80rpx;
  153. border-bottom: 1px solid #eee;
  154. text {
  155. padding-left: 20rpx;
  156. }
  157. }
  158. .goods-box{
  159. padding: 0 30rpx;
  160. .goods-item {
  161. padding-top: 10px;
  162. .goods-img {
  163. width: 150rpx;
  164. height: 150rpx;
  165. display: inline-block;
  166. float: left;
  167. image {
  168. width: 100%;
  169. height: 100%;
  170. }
  171. }
  172. .goods-info {
  173. display: inline-block;
  174. width: 72%;
  175. font-size: 28rpx;
  176. float: right;
  177. .t {
  178. width: 100%;
  179. height: 90rpx;
  180. text:first-child{
  181. float: left;
  182. display: -webkit-box;overflow: hidden;-webkit-line-clamp: 2;
  183. -webkit-box-orient: vertical;
  184. width: 70%;
  185. }
  186. text:last-child{
  187. width: 30%;
  188. float: right;
  189. text-align: right;
  190. }
  191. }
  192. .b{
  193. width: 100%;
  194. height: 80rpx;
  195. font-size: 26rpx;
  196. text:first-child{
  197. float: left;
  198. color: #999;
  199. }
  200. text:last-child{
  201. float: right;
  202. color: #666;
  203. }
  204. }
  205. }
  206. }
  207. }
  208. }
  209. .order{
  210. background-color: #fff;
  211. margin-top: 30rpx;
  212. padding-bottom: 20rpx;
  213. .list {
  214. width: 100%;
  215. .list-box{
  216. width: 92%;
  217. height: auto !important;
  218. height: 80rpx;
  219. min-height: 80rpx;
  220. line-height: 80rpx;
  221. margin: 0 auto;
  222. font-size: 28rpx; color: #333;
  223. border-bottom: 1px solid #ebedf0;
  224. padding: 10rpx 0;
  225. view{ display: inline-block; }
  226. view:first-child { float: left; }
  227. view:last-child { float: right; }
  228. }
  229. }
  230. }
  231. .btn{
  232. width: 90%;
  233. margin: 40rpx auto;
  234. margin-top: 40rpx;
  235. view {
  236. background-color: #1b43c4;
  237. border-radius: 30rpx;
  238. font-size: 28rpx;
  239. text-align: center;
  240. height: 80rpx;
  241. line-height: 80rpx;
  242. color: #fff;
  243. }
  244. }
  245. </style>