orderRefund.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <template>
  2. <view class="content">
  3. <view class="order-item">
  4. <scroll-view v-if="listStyle == 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="listStyle == 2" 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="good">
  19. <view class="img-wrapper"><image src="../../static/img/ex1.jpg" mode=""></image></view>
  20. <view class="good-infoo">
  21. <view class="good-name">子臣鸭汤调料粉商用专用配方特调底料</view>
  22. <view class="create-time">下单时间:2019-06-09</view>
  23. </view>
  24. <view class="good-infot">
  25. <view class="good-price">¥21</view>
  26. <view class="good-num">X99</view>
  27. </view>
  28. </view>
  29. <!-- <view class="orderDetial">
  30. <view class="row b-b flex">
  31. <text class="tit">订单总价</text>
  32. <view class="input">¥{{ item.total_price }}</view>
  33. </view>
  34. <view class="row b-b flex">
  35. <text class="tit">邮费</text>
  36. <view class="input">{{ item.pay_postage > 0 ? '¥' +item.pay_postage : '免邮费' }}</view>
  37. </view>
  38. <view class="row b-b flex" v-if="item.coupon_id > 0">
  39. <text class="tit">优惠券</text>
  40. <view class="input">-¥{{ item.coupon_price }}</view>
  41. </view>
  42. <view class="row b-b flex" v-if="item.use_integral > 0">
  43. <text class="tit">积分抵扣</text>
  44. <view class="input">-¥{{ item.use_integral }}</view>
  45. </view>
  46. <view class="row b-b flex">
  47. <text class="tit ">实付</text>
  48. <view class="input payColor">¥{{ item.pay_price }}</view>
  49. </view>
  50. </view> -->
  51. <view class="row b-b">
  52. <text class="tit">货物状态</text>
  53. <picker mode="selector" :range="status" @change="bindChange">
  54. <view class="refund" v-if="refundStatus">{{ refundStatus || '请选择' }}</view>
  55. <view class="noRefund" v-else>请选择</view>
  56. </picker>
  57. </view>
  58. <view class="row b-b">
  59. <text class="tit">退款原因</text>
  60. <input class="input" type="text" v-model="reason" placeholder="请输入退款原因" placeholder-class="placeholder" />
  61. </view>
  62. <view class="row b-b">
  63. <text class="tit">退款方式</text>
  64. <picker mode="selector" :range="methods" @change="bind2Change">
  65. <view class="refund" v-if="refundMethods">{{ refundMethods || '请选择' }}</view>
  66. <view class="noRefund" v-else>请选择</view>
  67. </picker>
  68. </view>
  69. <!-- <view class="refund-num">
  70. <view class="num-title">退款金额</view>
  71. <view class="num">¥{{refundNum}}</view>
  72. </view> -->
  73. <view class="pushpic">
  74. <view class="up-title">上传凭证:</view>
  75. <view class="up" @click="putImg()">
  76. <view class="up-bg" v-if="isUp">
  77. <image src="../../static/icon/uping.png" mode=""></image>
  78. <view class="up-tap">上传图片</view>
  79. </view>
  80. <view class="up-img" v-else>
  81. <image src="" mode=""></image>
  82. </view>
  83. </view>
  84. </view>
  85. <button class="add-btn" @click="confirm">提交申请</button>
  86. </view>
  87. </template>
  88. <script>
  89. import { refund, refundReason, orderDetail } from '@/api/order.js';
  90. export default {
  91. data() {
  92. return {
  93. refundStatus: '', //退款方式
  94. refundMethods: '', //退款方式
  95. reason: '', //退款理由
  96. status: ['代付款', '待发货', '待收货', '已完成'],
  97. orderId: '',
  98. item: {},
  99. listStyle: 2,
  100. refundNum: 0,
  101. methods: ['微信', '支付宝'],
  102. isUp: true,
  103. upImg: ''
  104. };
  105. },
  106. onLoad(option) {
  107. this.orderId = option.id;
  108. this.refundReason();
  109. this.loadOrder();
  110. },
  111. methods: {
  112. // 切换选中事件
  113. bindChange(e) {
  114. this.refundStatus = this.status[e.detail.value];
  115. },
  116. bind2Change(e) {
  117. this.refundMethods = this.methods[e.detail.value];
  118. },
  119. // 加载退款理由
  120. refundReason() {
  121. refundReason({}).then(e => {
  122. this.status = e.data;
  123. });
  124. },
  125. loadOrder() {
  126. orderDetail({}, this.orderId).then(e => {
  127. this.item = e.data;
  128. });
  129. },
  130. //提交
  131. confirm() {
  132. if (!obj.refund) {
  133. uni.showModal({
  134. title: '错误',
  135. content: '请填写退货理由',
  136. showCancel: false
  137. });
  138. return false;
  139. }
  140. let obj = this;
  141. refund({
  142. text: obj.refund,
  143. uni: obj.orderId,
  144. refund_reason_wap_explain: obj.reason
  145. }).then(function(e) {
  146. uni.showToast({
  147. title: '提交成功',
  148. duration: 1500
  149. });
  150. });
  151. },
  152. putImg() {
  153. console.log('dianji')
  154. this.isUp = !this.isUp
  155. }
  156. }
  157. };
  158. </script>
  159. <style lang="scss">
  160. page {
  161. background: $page-color-base;
  162. padding-top: 16rpx;
  163. }
  164. .orderDetial {
  165. .row {
  166. .input {
  167. text-align: right;
  168. }
  169. }
  170. }
  171. .row {
  172. display: flex;
  173. align-items: center;
  174. position: relative;
  175. padding: 0 30rpx;
  176. height: 110rpx;
  177. background: #fff;
  178. .refund {
  179. font-size: 30rpx;
  180. color: $font-color-dark;
  181. padding-left: 128rpx;
  182. }
  183. .noRefund {
  184. font-size: 30rpx;
  185. color: $font-color-light;
  186. padding-left: 128rpx;
  187. }
  188. .tit {
  189. flex-shrink: 0;
  190. width: 120rpx;
  191. font-size: 30rpx;
  192. color: $font-color-dark;
  193. }
  194. .input {
  195. flex: 1;
  196. font-size: 30rpx;
  197. color: $font-color-dark;
  198. padding-left: 128rpx;
  199. &.payColor {
  200. color: $color-red;
  201. }
  202. }
  203. .iconlocation {
  204. font-size: 36rpx;
  205. color: $font-color-light;
  206. }
  207. }
  208. .add-btn {
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. width: 690rpx;
  213. height: 80rpx;
  214. margin: 60rpx auto;
  215. font-size: $font-lg;
  216. color: #fff;
  217. background-color: $base-color;
  218. border-radius: 10rpx;
  219. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  220. }
  221. /* 多条商品 */
  222. .order-item {
  223. display: flex;
  224. flex-direction: column;
  225. padding-left: 30rpx;
  226. background: #fff;
  227. margin-top: 16rpx;
  228. .goods-box {
  229. height: 160rpx;
  230. padding: 20rpx 0;
  231. white-space: nowrap;
  232. .goods-item {
  233. width: 120rpx;
  234. height: 120rpx;
  235. display: inline-block;
  236. margin-right: 24rpx;
  237. }
  238. .goods-img {
  239. display: block;
  240. width: 100%;
  241. height: 100%;
  242. }
  243. }
  244. /* 单条商品 */
  245. .goods-box-single {
  246. display: flex;
  247. padding: 20rpx 0;
  248. .goods-img {
  249. display: block;
  250. width: 120rpx;
  251. height: 120rpx;
  252. }
  253. .right {
  254. flex: 1;
  255. display: flex;
  256. flex-direction: column;
  257. padding: 0 30rpx 0 24rpx;
  258. overflow: hidden;
  259. .title {
  260. font-size: $font-base + 2rpx;
  261. color: $font-color-dark;
  262. line-height: 1;
  263. }
  264. .attr-box {
  265. font-size: $font-sm + 2rpx;
  266. color: $font-color-light;
  267. padding: 10rpx 12rpx;
  268. }
  269. .price {
  270. font-size: $font-base + 2rpx;
  271. color: $font-color-dark;
  272. &:before {
  273. content: '¥';
  274. font-size: $font-sm;
  275. margin: 0 2rpx 0 8rpx;
  276. }
  277. }
  278. }
  279. }
  280. }
  281. .refund-num {
  282. margin: 20rpx 0;
  283. width: 750rpx;
  284. height: 100rpx;
  285. background: #ffffff;
  286. line-height: 100rpx;
  287. view {
  288. display: inline-block;
  289. }
  290. .num-title {
  291. font-size: 30rpx;
  292. font-family: PingFangSC;
  293. font-weight: 500;
  294. color: #333333;
  295. padding-left: 30rpx;
  296. }
  297. .num {
  298. padding-left: 133rpx;
  299. font-size: 30rpx;
  300. font-family: PingFang SC;
  301. font-weight: bold;
  302. color: #901b21;
  303. }
  304. }
  305. .good {
  306. // margin-top: 21rpx;
  307. margin-bottom: 18rpx;
  308. width: 750rpx;
  309. height: 220rpx;
  310. background: #ffffff;
  311. padding: 30rpx 29rpx;
  312. display: flex;
  313. position: relative;
  314. .img-wrapper {
  315. width: 160rpx;
  316. height: 160rpx;
  317. image {
  318. width: 100%;
  319. height: 100%;
  320. border-radius: 5rpx;
  321. }
  322. }
  323. .good-infoo {
  324. padding-left: 20rpx;
  325. .good-name {
  326. width: 282rpx;
  327. font-size: 26rpx;
  328. font-family: PingFang SC;
  329. font-weight: 400;
  330. color: #1d2023;
  331. line-height: 40rpx;
  332. margin-bottom: 40rpx;
  333. }
  334. .create-time {
  335. height: 21rpx;
  336. font-size: 22rpx;
  337. font-family: PingFang SC;
  338. font-weight: 400;
  339. color: #999999;
  340. }
  341. }
  342. .good-infot {
  343. position: absolute;
  344. right: 29rpx;
  345. text-align: right;
  346. font-size: 26rpx;
  347. font-family: PingFang SC;
  348. font-weight: 400;
  349. color: #666666;
  350. .good-num {
  351. font-size: 22rpx;
  352. }
  353. }
  354. }
  355. .pushpic {
  356. margin-top: 20rpx;
  357. width: 750rpx;
  358. height: 284rpx;
  359. background: #FFFFFF;
  360. padding: 30rpx 0 0 30rpx;
  361. .up-title {
  362. font-size: 30rpx;
  363. font-family: PingFang SC;
  364. font-weight: 400;
  365. color: #3F454B;
  366. line-height: 1;
  367. padding-bottom: 35rpx;
  368. }
  369. .up {
  370. .up-bg {
  371. width: 160rpx;
  372. height: 160rpx;
  373. background: #fff;
  374. border: 2rpx #999999 dashed;
  375. border-radius: 10rpx;
  376. position: relative;
  377. image {
  378. width: 36rpx;
  379. height: 36rpx;
  380. position: absolute;
  381. top: 44rpx;
  382. left:64rpx;
  383. }
  384. .up-tap {
  385. position: absolute;
  386. // width: 94rpx;
  387. height: 23rpx;
  388. font-size: 24rpx;
  389. font-family: PingFangSC;
  390. font-weight: 500;
  391. color: #888888;
  392. top: 93rpx;
  393. left:33rpx;
  394. }
  395. }
  396. .up-img {
  397. width: 160rpx;
  398. height: 160rpx;
  399. background: #fff;
  400. // border: 2rpx #999999 dashed;
  401. border-radius: 10rpx;
  402. image {
  403. width: 100%;
  404. height: 100%;
  405. border-radius: 10rpx;
  406. }
  407. }
  408. }
  409. }
  410. </style>