orderRefund.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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 class="good" v-if="listStyle == 2" v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex">
  18. <view class="img-wrapper"><image :src="goodsItem.productInfo.image" mode=""></image></view>
  19. <view class="good-infoo">
  20. <view class="good-name ellipsis">{{ goodsItem.productInfo.store_name }}</view>
  21. <view class="create-time">下单时间:{{item.add_time_y}}</view>
  22. </view>
  23. <view class="good-infot">
  24. <view class="good-price">¥{{ goodsItem.productInfo.price }}</view>
  25. <view class="good-num">X{{ goodsItem.cart_num }}</view>
  26. </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. <input class="input" type="text" v-model="reason" placeholder="请输入货物状态" placeholder-class="placeholder" />
  54. </view>
  55. <view class="row b-b">
  56. <text class="tit">退款原因</text>
  57. <picker mode="selector" :range="status" @change="bindChange">
  58. <view class="refund" v-if="refundStatus">{{ refundStatus || '请选择' }}</view>
  59. <view class="noRefund" v-else>请选择退款原因</view>
  60. </picker>
  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. console.log('this.refundStatus',this.refundStatus)
  116. },
  117. bind2Change(e) {
  118. this.refundMethods = this.methods[e.detail.value];
  119. },
  120. // 加载退款理由
  121. refundReason() {
  122. refundReason({}).then(e => {
  123. this.status = e.data;
  124. });
  125. },
  126. loadOrder() {
  127. orderDetail({}, this.orderId).then(e => {
  128. this.item = e.data;
  129. console.log(this.item)
  130. });
  131. },
  132. //提交
  133. confirm() {
  134. let obj = this;
  135. if (!obj.refundStatus) {
  136. uni.showModal({
  137. title: '错误',
  138. content: '请填写退货理由',
  139. showCancel: false
  140. });
  141. return false;
  142. }
  143. refund({
  144. text: obj.refundStatus,
  145. uni: obj.orderId,
  146. refund_reason_wap_explain: obj.reason
  147. }).then(function(e) {
  148. uni.showToast({
  149. title: '提交成功',
  150. duration: 1500
  151. });
  152. });
  153. },
  154. putImg() {
  155. console.log('dianji')
  156. this.isUp = !this.isUp
  157. }
  158. }
  159. };
  160. </script>
  161. <style lang="scss">
  162. page {
  163. background: $page-color-base;
  164. padding-top: 16rpx;
  165. }
  166. .orderDetial {
  167. .row {
  168. .input {
  169. text-align: right;
  170. }
  171. }
  172. }
  173. .row {
  174. display: flex;
  175. align-items: center;
  176. position: relative;
  177. padding: 0 30rpx;
  178. height: 110rpx;
  179. background: #fff;
  180. .refund {
  181. font-size: 30rpx;
  182. color: $font-color-dark;
  183. padding-left: 128rpx;
  184. }
  185. .noRefund {
  186. font-size: 30rpx;
  187. color: $font-color-light;
  188. padding-left: 128rpx;
  189. }
  190. .tit {
  191. flex-shrink: 0;
  192. width: 120rpx;
  193. font-size: 30rpx;
  194. color: $font-color-dark;
  195. }
  196. .input {
  197. flex: 1;
  198. font-size: 30rpx;
  199. color: $font-color-dark;
  200. padding-left: 128rpx;
  201. &.payColor {
  202. color: $color-red;
  203. }
  204. }
  205. .iconlocation {
  206. font-size: 36rpx;
  207. color: $font-color-light;
  208. }
  209. }
  210. .add-btn {
  211. display: flex;
  212. align-items: center;
  213. justify-content: center;
  214. width: 690rpx;
  215. height: 80rpx;
  216. margin: 60rpx auto;
  217. font-size: $font-lg;
  218. color: #fff;
  219. background-color: $base-color;
  220. border-radius: 10rpx;
  221. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  222. }
  223. /* 多条商品 */
  224. .order-item {
  225. display: flex;
  226. flex-direction: column;
  227. // padding-left: 30rpx;
  228. background: #fff;
  229. margin-top: 16rpx;
  230. .goods-box {
  231. height: 160rpx;
  232. padding: 20rpx 0;
  233. white-space: nowrap;
  234. .goods-item {
  235. width: 120rpx;
  236. height: 120rpx;
  237. display: inline-block;
  238. margin-right: 24rpx;
  239. }
  240. .goods-img {
  241. display: block;
  242. width: 100%;
  243. height: 100%;
  244. }
  245. }
  246. /* 单条商品 */
  247. .goods-box-single {
  248. display: flex;
  249. padding: 20rpx 0;
  250. .goods-img {
  251. display: block;
  252. width: 120rpx;
  253. height: 120rpx;
  254. }
  255. .right {
  256. flex: 1;
  257. display: flex;
  258. flex-direction: column;
  259. padding: 0 30rpx 0 24rpx;
  260. overflow: hidden;
  261. .title {
  262. font-size: $font-base + 2rpx;
  263. color: $font-color-dark;
  264. line-height: 1;
  265. }
  266. .attr-box {
  267. font-size: $font-sm + 2rpx;
  268. color: $font-color-light;
  269. padding: 10rpx 12rpx;
  270. }
  271. .price {
  272. font-size: $font-base + 2rpx;
  273. color: $font-color-dark;
  274. &:before {
  275. content: '¥';
  276. font-size: $font-sm;
  277. margin: 0 2rpx 0 8rpx;
  278. }
  279. }
  280. }
  281. }
  282. }
  283. .refund-num {
  284. margin: 20rpx 0;
  285. width: 750rpx;
  286. height: 100rpx;
  287. background: #ffffff;
  288. line-height: 100rpx;
  289. view {
  290. display: inline-block;
  291. }
  292. .num-title {
  293. font-size: 30rpx;
  294. font-family: PingFangSC;
  295. font-weight: 500;
  296. color: #333333;
  297. padding-left: 30rpx;
  298. }
  299. .num {
  300. padding-left: 133rpx;
  301. font-size: 30rpx;
  302. font-family: PingFang SC;
  303. font-weight: bold;
  304. color: #901b21;
  305. }
  306. }
  307. .good {
  308. // margin-top: 21rpx;
  309. margin-bottom: 18rpx;
  310. width: 750rpx;
  311. height: 220rpx;
  312. background: #ffffff;
  313. padding: 30rpx 29rpx;
  314. display: flex;
  315. position: relative;
  316. .img-wrapper {
  317. width: 160rpx;
  318. height: 160rpx;
  319. image {
  320. width: 100%;
  321. height: 100%;
  322. border-radius: 5rpx;
  323. }
  324. }
  325. .good-infoo {
  326. padding-left: 20rpx;
  327. .good-name {
  328. width: 282rpx;
  329. font-size: 26rpx;
  330. font-family: PingFang SC;
  331. font-weight: 400;
  332. color: #1d2023;
  333. line-height: 40rpx;
  334. margin-bottom: 40rpx;
  335. }
  336. .create-time {
  337. height: 21rpx;
  338. font-size: 22rpx;
  339. font-family: PingFang SC;
  340. font-weight: 400;
  341. color: #999999;
  342. }
  343. }
  344. .good-infot {
  345. position: absolute;
  346. right: 29rpx;
  347. text-align: right;
  348. font-size: 26rpx;
  349. font-family: PingFang SC;
  350. font-weight: 400;
  351. color: #666666;
  352. .good-num {
  353. font-size: 22rpx;
  354. }
  355. }
  356. }
  357. .pushpic {
  358. margin-top: 20rpx;
  359. width: 750rpx;
  360. height: 284rpx;
  361. background: #FFFFFF;
  362. padding: 30rpx 0 0 30rpx;
  363. .up-title {
  364. font-size: 30rpx;
  365. font-family: PingFang SC;
  366. font-weight: 400;
  367. color: #3F454B;
  368. line-height: 1;
  369. padding-bottom: 35rpx;
  370. }
  371. .up {
  372. .up-bg {
  373. width: 160rpx;
  374. height: 160rpx;
  375. background: #fff;
  376. border: 2rpx #999999 dashed;
  377. border-radius: 10rpx;
  378. position: relative;
  379. image {
  380. width: 36rpx;
  381. height: 36rpx;
  382. position: absolute;
  383. top: 44rpx;
  384. left:64rpx;
  385. }
  386. .up-tap {
  387. position: absolute;
  388. // width: 94rpx;
  389. height: 23rpx;
  390. font-size: 24rpx;
  391. font-family: PingFangSC;
  392. font-weight: 500;
  393. color: #888888;
  394. top: 93rpx;
  395. left:33rpx;
  396. }
  397. }
  398. .up-img {
  399. width: 160rpx;
  400. height: 160rpx;
  401. background: #fff;
  402. // border: 2rpx #999999 dashed;
  403. border-radius: 10rpx;
  404. image {
  405. width: 100%;
  406. height: 100%;
  407. border-radius: 10rpx;
  408. }
  409. }
  410. }
  411. }
  412. </style>