refund.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <view class="content">
  3. <view class="noOrder" v-if="dataList.length <1">
  4. 暂无数据~~
  5. </view>
  6. <view class="card" v-for="(item,index) in dataList" :key="index">
  7. <!-- 1 -->
  8. <view class="row" v-if="type === 1">
  9. <view class="col-name">取宠代理</view>
  10. <view class="col-money">{{item.senders[0].user.name}}</view>
  11. </view>
  12. <view class="row" v-if="type === 1">
  13. <view class="col-name">派送代理</view>
  14. <view class="col-money">{{item.senders[1].user.name}}</view>
  15. </view>
  16. <view class="row" v-if="type === 1">
  17. <view class="col-name">结算金额</view>
  18. <view class="col-money">{{item.settle_amount}}</view>
  19. </view>
  20. <view class="row" v-if="type === 1">
  21. <view class="col-name">订单金额</view>
  22. <view class="col-money">{{item.real_amount}}</view>
  23. </view>
  24. <view class="row" v-if="type === 1">
  25. <view class="col-name">订单编号</view>
  26. <view class="col-money">{{item.no}}</view>
  27. </view>
  28. <view class="row" v-if="type === 1">
  29. <view class="col-name">提交时间</view>
  30. <view class="col-money">
  31. {{item.settle_submit_at?$u.timeFormat(item.settle_submit_at, 'yyyy年mm月dd日 hh时MM分'):"-"}}
  32. </view>
  33. </view>
  34. <view class="btn" v-if="type === 1">
  35. <view class="btn-dom" @click="settlement(item.id)">
  36. 结算
  37. </view>
  38. </view>
  39. <!-- 2 -->
  40. <view class="row" v-if="type === 2">
  41. <view class="col-name">反馈者昵称</view>
  42. <view class="col-money">{{item.user.nickname}}</view>
  43. </view>
  44. <view class="row" v-if="type === 2">
  45. <view class="col-name">反馈者手机号</view>
  46. <view class="col-money">{{item.user.mobile}}</view>
  47. </view>
  48. <view class="row" v-if="type === 2">
  49. <view class="col-name">反馈时间</view>
  50. <view class="col-money">{{item.created_at_text}}</view>
  51. </view>
  52. <view class="row" v-if="type === 2">
  53. <view class="col-name">反馈内容</view>
  54. <view class="col-money">{{item.body}}</view>
  55. </view>
  56. <view class="btn" v-if="type === 2">
  57. <view class="btn-dom" @click="feedback(item.id)">
  58. 已处理
  59. </view>
  60. </view>
  61. <!-- 处理弹窗 -->
  62. <u-modal v-model="showfeedback" cancel-text="取消" confirm-text="确定" show-cancel-button="true"
  63. @cancel="feedbackcancel" @confirm="feedbackconfirm">
  64. <view class="feedbackconent">
  65. <textarea v-model="feedbackconent" placeholder="请输入反馈信息" class="feedbackconent-input" />
  66. </view>
  67. </u-modal>
  68. <!-- 3 -->
  69. <view class="row" v-if="type === 3">
  70. <view class="col-name">退款账号</view>
  71. <view class="col-money">{{item.user.username}}</view>
  72. </view>
  73. <view class="row" v-if="type === 3">
  74. <view class="col-name">退款金额</view>
  75. <view class="col-money">{{item.refund_amount}}</view>
  76. </view>
  77. <view class="row" v-if="type === 3">
  78. <view class="col-name">订单金额</view>
  79. <view class="col-money">{{item.real_amount}}</view>
  80. </view>
  81. <view class="row" v-if="type === 3">
  82. <view class="col-name">订单编号</view>
  83. <view class="col-money">{{item.id}}</view>
  84. </view>
  85. <view class="row" v-if="type === 3">
  86. <view class="col-name">退款时间</view>
  87. <view class="col-money">{{item.refund_apply_at}}</view>
  88. </view>
  89. <view class="row" v-if="type === 3">
  90. <view class="col-name">退款原因</view>
  91. <view class="col-money">{{item.refund_reason}}</view>
  92. </view>
  93. <view class="image" v-if="type === 3">
  94. <image v-for="(iitem,index) in item.refund_images" :src="iitem" class="image-dom" :key="index"></image>
  95. </view>
  96. <view class="btn" v-if="type === 3">
  97. <view class="btn-dom" @click="refuse(item.id)">
  98. 拒绝
  99. </view>
  100. <view class="btn-dom" @click="agree(item.id)">
  101. 同意
  102. </view>
  103. </view>
  104. <!-- 4 -->
  105. <view class="row" v-if="type === 4">
  106. <view class="col-name">退款账号</view>
  107. <view class="col-money">{{item.user.username}}</view>
  108. </view>
  109. <view class="row" v-if="type === 4">
  110. <view class="col-name">退款金额</view>
  111. <view class="col-money">{{item.refund_amount}}</view>
  112. </view>
  113. <view class="row" v-if="type === 4">
  114. <view class="col-name">订单金额</view>
  115. <view class="col-money">{{item.real_amount}}</view>
  116. </view>
  117. <view class="row" v-if="type === 4">
  118. <view class="col-name">订单编号</view>
  119. <view class="col-money">{{item.no}}</view>
  120. </view>
  121. <view class="row" v-if="type === 4">
  122. <view class="col-name">退款时间</view>
  123. <view class="col-money">{{item.refund_apply_at}}</view>
  124. </view>
  125. <view class="row" v-if="type === 4">
  126. <view class="col-name">退款原因</view>
  127. <view class="col-money">{{item.refund_reason}}</view>
  128. </view>
  129. <view class="row" v-if="type === 4 && item.refund_status !== -1">
  130. <view class="col-name">退款状态</view>
  131. <view class="col-money yellow">
  132. {{item.refund_status === 0?"审核中":""}}
  133. {{item.refund_status === 1?"通过":""}}
  134. {{item.refund_status === 2?"驳回":""}}
  135. </view>
  136. </view>
  137. <view class="btn" v-if="type === 4 && item.status === 80">
  138. <view class="btn-dom" @click="delorder(item.id)">
  139. 删除
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </template>
  145. <script>
  146. export default {
  147. data() {
  148. return {
  149. type: 1,
  150. // 页码
  151. page: 1,
  152. // 数量
  153. limit: 10,
  154. // 获取数据
  155. dataList: [],
  156. // 处理反馈
  157. showfeedback: false,
  158. // 反馈内容
  159. feedbackId: '',
  160. feedbackconent: ''
  161. }
  162. },
  163. onLoad(e) {
  164. this.type = Number(e.type)
  165. if (this.type === 1) {
  166. uni.setNavigationBarTitle({
  167. title: "待结算"
  168. })
  169. }
  170. if (this.type === 2) {
  171. uni.setNavigationBarTitle({
  172. title: "待处理的反馈意见"
  173. })
  174. }
  175. if (this.type === 3) {
  176. uni.setNavigationBarTitle({
  177. title: "待处理退款"
  178. })
  179. }
  180. if (this.type === 4) {
  181. uni.setNavigationBarTitle({
  182. title: "售后管理"
  183. })
  184. }
  185. // 获取数据
  186. this.getData()
  187. },
  188. // 下拉刷新
  189. onPullDownRefresh() {
  190. this.getData();
  191. },
  192. methods: {
  193. // 点击删除订单
  194. delorder(id){
  195. this.request("/admin_order/order_delete",{id:id},"GET").then(res=>{
  196. if(res.code === 1){
  197. this.$u.toast('操作成功')
  198. this.getData()
  199. }
  200. })
  201. },
  202. // 点击拒绝退款
  203. refuse(id){
  204. let _this = this
  205. uni.showModal({
  206. title:"确定要拒绝退款吗?",
  207. showCancel:true,
  208. success(e) {
  209. if(e.confirm){
  210. _this.request("/admin_order/deal_refund",{id:id,status:2},"GET").then(res=>{
  211. if(res.code === 1){
  212. _this.$u.toast("操作成功")
  213. _this.getData()
  214. }
  215. })
  216. }
  217. }
  218. })
  219. },
  220. // 点击同意退款
  221. agree(id){
  222. let _this = this
  223. uni.showModal({
  224. title:"确定要同意退款吗?",
  225. showCancel:true,
  226. success(e) {
  227. if(e.confirm){
  228. _this.request("/admin_order/deal_refund",{id:id,status:1},"GET").then(res=>{
  229. if(res.code === 1){
  230. _this.$u.toast("操作成功")
  231. _this.getData()
  232. }
  233. })
  234. }
  235. }
  236. })
  237. },
  238. // 确认反馈
  239. feedbackconfirm(id) {
  240. if(this.feedbackconent === ""){
  241. this.$u.toast('请输入反馈内容')
  242. return false
  243. }
  244. this.request('/admin_order/deal_feedback', {
  245. id: this.feedbackId,
  246. body: this.feedbackconent
  247. }, "GET").then(res => {
  248. if (res.code === 1) {
  249. this.feedbackconent = "";
  250. this.getData()
  251. }
  252. })
  253. },
  254. // 取消反馈
  255. feedbackcancel() {
  256. this.feedbackconent = '';
  257. },
  258. // 点击处理反馈
  259. feedback(id) {
  260. let _this = this;
  261. this.showfeedback = true;
  262. this.feedbackId = id;
  263. console.log(id);
  264. },
  265. // 点击结算
  266. settlement(id) {
  267. let _this = this;
  268. console.log(id);
  269. uni.showModal({
  270. title: '提示',
  271. content: '是否结算此订单?',
  272. cancelText: "驳回",
  273. confirmText: "通过",
  274. success: function(res) {
  275. if (res.confirm) {
  276. console.log('用户点击确定');
  277. _this.request("/admin_order/deal_settle", {
  278. id: id,
  279. status: 1
  280. }, "GET").then(res => {
  281. console.log(res)
  282. if (res.code === 1) {
  283. _this.getData()
  284. }
  285. })
  286. } else if (res.cancel) {
  287. console.log('用户点击取消');
  288. _this.request("/admin_order/deal_settle", {
  289. id: id,
  290. status: 2
  291. }, "GET").then(res => {
  292. console.log(res)
  293. if (res.code === 1) {
  294. _this.getData()
  295. }
  296. })
  297. }
  298. }
  299. });
  300. },
  301. // 获取数据
  302. getData() {
  303. let url = "";
  304. if (this.type === 1) {
  305. url = "/admin_order/wait_settle"
  306. }
  307. if (this.type === 2) {
  308. url = "/admin_order/feedback"
  309. }
  310. if (this.type === 3) {
  311. url = "/admin_order/refund"
  312. }
  313. if (this.type === 4) {
  314. url = "/admin_order/service"
  315. }
  316. this.request(url, {
  317. page: this.page,
  318. limit: this.limit
  319. }, "GET").then(res => {
  320. uni.stopPullDownRefresh();
  321. if (res.code === 1) {
  322. this.dataList = res.data.data;
  323. }
  324. })
  325. }
  326. }
  327. }
  328. </script>
  329. <style lang="scss">
  330. .content {
  331. min-height: 100vh;
  332. background-color: #F8F8F8;
  333. display: flex;
  334. flex-direction: column;
  335. align-items: center;
  336. justify-content: flex-start;
  337. // 输入反馈
  338. .feedbackconent {
  339. height: 300rpx;
  340. font-size: 30rpx;
  341. padding: 10rpx;
  342. .feedbackconent-input {
  343. width: 100%;
  344. height: 100%;
  345. }
  346. .feedbackconent-input::-webkit-input-placeholder {
  347. color: red;
  348. font-size: 30rpx;
  349. }
  350. }
  351. .card {
  352. width: 90%;
  353. background-color: #FFFFFF;
  354. margin: 20rpx 0;
  355. padding: 30rpx;
  356. border-radius: 20rpx;
  357. .row {
  358. display: flex;
  359. flex-direction: row;
  360. align-items: center;
  361. justify-content: flex-start;
  362. margin-bottom: 20rpx;
  363. .col-name {
  364. width: 30%;
  365. }
  366. .col-money {
  367. width: 70%;
  368. }
  369. .yellow {
  370. color: #F6B301;
  371. }
  372. }
  373. .image {
  374. display: flex;
  375. flex-direction: row;
  376. align-items: center;
  377. justify-content: flex-start;
  378. .image-dom {
  379. width: 120rpx;
  380. height: 120rpx;
  381. border: 1px #eee solid;
  382. margin-right: 20rpx;
  383. flex-wrap: wrap;
  384. }
  385. }
  386. .btn {
  387. display: flex;
  388. flex-direction: row;
  389. align-items: center;
  390. justify-content: flex-end;
  391. .btn-dom {
  392. background-color: #F6B301;
  393. color: #FFFFFF;
  394. padding: 10rpx 20rpx;
  395. border-radius: 30rpx;
  396. margin-left: 50rpx;
  397. }
  398. }
  399. }
  400. }
  401. </style>