refund.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="content">
  3. <!-- <view class="order-item">
  4. <scroll-view v-if="item.cartInfo.length > 1" class="goods-box" scroll-x>
  5. <view v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex" class="goods-item">
  6. <image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
  7. </view>
  8. </scroll-view>
  9. <view v-if="item.cartInfo.length === 1" class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex">
  10. <image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
  11. <view class="right">
  12. <text class="title clamp">{{ goodsItem.productInfo.store_name }}</text>
  13. <text class="attr-box">{{ goodsItem.attrInfo ? goodsItem.attrInfo.suk : '' }} x {{ goodsItem.cart_num }}</text>
  14. <text class="price">{{ goodsItem.productInfo.price }}</text>
  15. </view>
  16. </view>
  17. </view> -->
  18. <view class="row b-b">
  19. <text class="tit">退款理由</text>
  20. <picker mode="selector" :range="value" @change="bindChange">
  21. <view class="refund" v-if="refund">{{ refund || '请选择退款理由' }}</view>
  22. <view class="noRefund" v-else>请选择退款理由</view>
  23. </picker>
  24. </view>
  25. <view class="row b-b">
  26. <text class="tit">备注说明</text>
  27. <input class="input" type="text" v-model="reason" placeholder="请填写备注" placeholder-class="placeholder" />
  28. </view>
  29. <button class="add-btn" @click="confirm">提交</button>
  30. </view>
  31. </template>
  32. <script>
  33. import { refund, refundReason, orderDetail } from '@/api/patient.js';
  34. export default {
  35. data() {
  36. return {
  37. refund: '', //退款理由
  38. reason: '', //备注
  39. value: ['1', '2', '3', '4', '5', '6', '7', '8', 9, 10, 11, 12, 13],
  40. orderId: '',
  41. item: {}
  42. };
  43. },
  44. onLoad(option) {
  45. this.orderId = option.id;
  46. this.refundReason();
  47. this.loadOrder();
  48. },
  49. methods: {
  50. // 切换选中事件
  51. bindChange(e) {
  52. this.refund = this.value[e.detail.value];
  53. console.log(e);
  54. },
  55. // 加载退款理由
  56. refundReason() {
  57. refundReason({}).then(e => {
  58. this.value = e.data;
  59. });
  60. },
  61. loadOrder() {
  62. orderDetail({}, this.orderId).then(e => {
  63. this.item = e.data;
  64. console.log(e);
  65. });
  66. },
  67. //提交
  68. confirm() {
  69. let obj = this;
  70. refund({
  71. text: obj.refund,
  72. uni: obj.orderId,
  73. refund_reason_wap_explain: obj.reason,
  74. }).then(function(e) {
  75. obj.$api.msg('提交成功');
  76. uni.navigateBack();
  77. });
  78. }
  79. }
  80. };
  81. </script>
  82. <style lang="scss">
  83. page {
  84. background: $page-color-base;
  85. padding-top: 16rpx;
  86. }
  87. .row {
  88. display: flex;
  89. align-items: center;
  90. position: relative;
  91. padding: 0 30rpx;
  92. height: 110rpx;
  93. background: #fff;
  94. .refund {
  95. font-size: 30rpx;
  96. color: $font-color-dark;
  97. }
  98. .noRefund{
  99. font-size: 30rpx;
  100. color: $font-color-light;
  101. }
  102. .tit {
  103. flex-shrink: 0;
  104. width: 120rpx;
  105. font-size: 30rpx;
  106. color: $font-color-dark;
  107. }
  108. .input {
  109. flex: 1;
  110. font-size: 30rpx;
  111. color: $font-color-dark;
  112. }
  113. .iconlocation {
  114. font-size: 36rpx;
  115. color: $font-color-light;
  116. }
  117. }
  118. .add-btn {
  119. display: flex;
  120. align-items: center;
  121. justify-content: center;
  122. width: 690rpx;
  123. height: 80rpx;
  124. margin: 60rpx auto;
  125. font-size: $font-lg;
  126. color: #fff;
  127. background-color: $base-color;
  128. border-radius: 10rpx;
  129. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  130. }
  131. /* 多条商品 */
  132. .order-item {
  133. display: flex;
  134. flex-direction: column;
  135. padding-left: 30rpx;
  136. background: #fff;
  137. margin-top: 16rpx;
  138. .goods-box {
  139. height: 160rpx;
  140. padding: 20rpx 0;
  141. white-space: nowrap;
  142. .goods-item {
  143. width: 120rpx;
  144. height: 120rpx;
  145. display: inline-block;
  146. margin-right: 24rpx;
  147. }
  148. .goods-img {
  149. display: block;
  150. width: 100%;
  151. height: 100%;
  152. }
  153. }
  154. /* 单条商品 */
  155. .goods-box-single {
  156. display: flex;
  157. padding: 20rpx 0;
  158. .goods-img {
  159. display: block;
  160. width: 120rpx;
  161. height: 120rpx;
  162. }
  163. .right {
  164. flex: 1;
  165. display: flex;
  166. flex-direction: column;
  167. padding: 0 30rpx 0 24rpx;
  168. overflow: hidden;
  169. .title {
  170. font-size: $font-base + 2rpx;
  171. color: $font-color-dark;
  172. line-height: 1;
  173. }
  174. .attr-box {
  175. font-size: $font-sm + 2rpx;
  176. color: $font-color-light;
  177. padding: 10rpx 12rpx;
  178. }
  179. .price {
  180. font-size: $font-base + 2rpx;
  181. color: $font-color-dark;
  182. &:before {
  183. content: '¥';
  184. font-size: $font-sm;
  185. margin: 0 2rpx 0 8rpx;
  186. }
  187. }
  188. }
  189. }
  190. }
  191. </style>