sellout.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <template>
  2. <view class="">
  3. <!-- <view class="out-wrapper">
  4. 卖出
  5. </view> -->
  6. <view class="jg" style="height: 20rpx;"></view>
  7. <empty v-if="loaded === true && list.length === 0"></empty>
  8. <view class="out-wrapper" v-for="item in list" :class="{'outt': item.status == 2}">
  9. <view class="out-top flex">
  10. <view class="buy-info flex">
  11. <view class="fsz">卖家:</view>
  12. <image :src="item.user.avatar" mode="" class="user-logo fsz"></image>
  13. <view class="user-name fsz clamp">{{item.user.real_name}}</view>
  14. <view class="user-phone fsz">
  15. {{item.user.phone}}
  16. </view>
  17. </view>
  18. <view class="buy-status">{{item.status | status}}</view>
  19. </view>
  20. <view class="item-info">
  21. <view class="info-data">
  22. <view class="info-tit">编号:</view>
  23. <view class="info-val">{{item.order_id}}</view>
  24. </view>
  25. <view class="info-data">
  26. <view class="info-tit">价值:</view>
  27. <view class="info-val">300</view>
  28. </view>
  29. </view>
  30. <view class="upimg">
  31. <view class="up-tit">
  32. 打款凭证:
  33. </view>
  34. <view class="img-wrap" v-if="item.pay_evaluation" @click="lookimg(item.pay_evaluation)">
  35. <image :src="item.pay_evaluation" mode=""></image>
  36. </view>
  37. <view class="" style="color: #0F253A;font-weight: bold;font-size: 26rpx;" v-else>
  38. 买家未上传支付凭证
  39. </view>
  40. </view>
  41. <template v-if="item.status == 2">
  42. <view class="mc-btn pass" @click="passPackage(item)">
  43. 通过
  44. </view>
  45. <!-- <view class="mc-btn fail" @click="openrefuse(item)">
  46. 拒绝
  47. </view> -->
  48. </template>
  49. </view>
  50. <uni-load-more :status="loadingType"></uni-load-more>
  51. <uni-popup ref="refuse" type="center">
  52. <view class="refuse-box">
  53. <view class="box-tit">
  54. 请输入拒绝原因
  55. </view>
  56. <textarea v-model="resone" placeholder="请输入拒绝原因" class="resone-wrapper" focus />
  57. <view class="btn-wrap">
  58. <view class="btn" @click="refusFali">
  59. 取消
  60. </view>
  61. <view class="btn" style="color: #000000;" @click="refusOk">
  62. 确定
  63. </view>
  64. </view>
  65. </view>
  66. </uni-popup>
  67. <uni-popup ref="lookimg" type="center">
  68. <view class="pop-wrap" style="position: relative;" >
  69. <movable-area class="popup-box">
  70. <movable-view class="popup-item" :scale="true" direction="all">
  71. <image :src="chooseImg" mode=""></image>
  72. </movable-view>
  73. </movable-area>
  74. <image src="../../static/icon/close.png" mode="" class="close" style="width: 80rpx;height: 80rpx;" @click="closePup"></image>
  75. </view>
  76. </uni-popup>
  77. </view>
  78. </template>
  79. <script>
  80. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  81. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  82. import empty from '@/components/empty';
  83. import { packageOrder, packageAudit } from '@/api/package.js'
  84. import {
  85. tabbar,
  86. tabbar1
  87. } from "@/utils/tabbar.js";
  88. export default {
  89. components: {
  90. uniLoadMore,
  91. empty,
  92. uniPopup
  93. },
  94. filters: {
  95. status(val) {
  96. let str = ''
  97. // 状态:0-预约,1-待支付,2-待审核,3-释放中,4-释放完成,5-重新发放,6-完成,-1-没抢到,-2-审核无效
  98. switch (val) {
  99. case 0:
  100. str = '预约'
  101. break;
  102. case 1:
  103. str = '待支付'
  104. break;
  105. case 2:
  106. str = '待审核'
  107. break;
  108. case 3:
  109. str = '释放中'
  110. break;
  111. case 4:
  112. str = '释放完成'
  113. break;
  114. case 5:
  115. str = '重新发放'
  116. break;
  117. case 6:
  118. str = '完成'
  119. break;
  120. case -1:
  121. str = '没抢到'
  122. break;
  123. case -2:
  124. str = '审核无效'
  125. break;
  126. default:
  127. str = ''
  128. }
  129. return str
  130. }
  131. },
  132. data() {
  133. return {
  134. resone: '', //拒绝理由
  135. tabbar: tabbar,
  136. tabbar1: tabbar1,
  137. current: 2,
  138. list: [],
  139. loadingType: 'more',
  140. page: 1,
  141. limit: 10,
  142. loaded: false,
  143. chooseImg: '',//选择要查看的图片
  144. choose_order: '',
  145. chooseIndex: 0,
  146. }
  147. },
  148. onLoad() {
  149. console.log('卖出')
  150. this.loadData()
  151. },
  152. //上拉加载更多
  153. onReachBottom() {
  154. this.loadData()
  155. },
  156. methods: {
  157. reload() {
  158. this.list = []
  159. this.page = 1
  160. this.loadingType = 'more'
  161. this.loadData()
  162. },
  163. lookimg(src) {
  164. console.log(src,'chooseImg++++++')
  165. this.chooseImg = src
  166. this.$refs.lookimg.open()
  167. },
  168. loadData() {
  169. let obj = this
  170. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  171. return
  172. }
  173. obj.loadingType = 'loading'
  174. packageOrder({
  175. page: obj.page,
  176. limit: obj.limit,
  177. status: 2
  178. }).then(({
  179. data
  180. }) => {
  181. console.log(data)
  182. obj.list = data.data
  183. obj.page++
  184. if (obj.limit == data.data.length) {
  185. obj.loadingType = 'more'
  186. } else {
  187. obj.loadingType = 'noMore'
  188. }
  189. obj.loaded = true
  190. })
  191. },
  192. openrefuse(item) {
  193. this.choose_order = item.id
  194. this.chooseIndex = this.list.indexOf(item)
  195. this.$refs.refuse.open()
  196. },
  197. //取消拒绝
  198. refusFali() {
  199. this.resone = ''
  200. this.$refs.refuse.close()
  201. },
  202. //确定拒绝
  203. refusOk() {
  204. let obj = this
  205. if(obj.resone == '') {
  206. obj.$api.msg('请输入拒绝理由')
  207. return
  208. }
  209. packageAudit({
  210. re: obj.resone,
  211. id: obj.choose_order,
  212. status: -2
  213. }).then(res => {
  214. obj.resone = ''
  215. obj.$refs.refuse.close()
  216. obj.list[obj.chooseIndex].status = -2
  217. // obj.page = 0
  218. // obj.list = []
  219. // obj.loaded = false
  220. // obj.loadingType = 'more'
  221. // obj.loadData()
  222. })
  223. },
  224. closePup() {
  225. this.chooseImg = ''
  226. this.$refs.lookimg.close()
  227. },
  228. passPackage(item) {
  229. let index = this.list.indexOf(item)
  230. console.log(index,'index')
  231. packageAudit({
  232. re: '',
  233. id: item.id,
  234. status: 3
  235. }).then(res => {
  236. uni.showToast({
  237. title:'审核通过',
  238. duration:2000
  239. });
  240. console.log(res)
  241. this.list[index].status = 3
  242. // this.reload()
  243. })
  244. }
  245. }
  246. }
  247. </script>
  248. <style lang="scss" scoped>
  249. .outt {
  250. height: 392rpx;
  251. }
  252. .out-wrapper {
  253. width: 690rpx;
  254. // height: 392rpx;
  255. background: #FFFFFF;
  256. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  257. border-radius: 20rpx;
  258. margin: 0 auto 20rpx;
  259. padding: 30rpx;
  260. position: relative;
  261. .outt {
  262. height: 392rpx;
  263. }
  264. .out-top {
  265. line-height: 46rpx;
  266. justify-content: space-between;
  267. .buy-info {
  268. width: 450rpx;
  269. font-size: 32rpx;
  270. font-family: PingFang SC;
  271. font-weight: bold;
  272. color: #0F253A;
  273. justify-content: flex-start;
  274. .fsz {
  275. flex-shrink: 0;
  276. }
  277. .user-name {
  278. max-width: 180rpx;
  279. }
  280. .user-phone {
  281. padding-left: 10rpx;
  282. font-size: 24rpx;
  283. font-family: PingFang SC;
  284. font-weight: 500;
  285. color: #999999;
  286. }
  287. .user-logo {
  288. display: block;
  289. width: 46rpx;
  290. height: 46rpx;
  291. border-radius: 50%;
  292. // background-color: red;
  293. // padding-right: 10rpx;
  294. margin-right: 10rpx;
  295. }
  296. }
  297. .buy-status {
  298. font-size: 26rpx;
  299. font-family: PingFang SC;
  300. font-weight: 500;
  301. color: #6D7C88;
  302. }
  303. }
  304. .item-info {
  305. width: 100%;
  306. margin-top: 28rpx;
  307. line-height: 50rpx;
  308. font-size: 26rpx;
  309. font-family: PingFang SC;
  310. display: flex;
  311. flex-wrap: wrap;
  312. .info-data {
  313. width: 100%;
  314. display: flex;
  315. .info-tit {
  316. font-weight: 500;
  317. color: #6D7C88;
  318. }
  319. .info-val {
  320. color: #0F253A;
  321. font-weight: bold;
  322. }
  323. }
  324. }
  325. .upimg {
  326. padding-top: 10rpx;
  327. display: flex;
  328. .up-tit {
  329. display: inline-block;
  330. font-size: 26rpx;
  331. font-family: PingFang SC;
  332. font-weight: 500;
  333. color: #6D7C88;
  334. }
  335. .img-wrap {
  336. width: 153rpx;
  337. height: 152rpx;
  338. border-radius: 20rpx;
  339. image {
  340. border-radius: 20rpx;
  341. width: 153rpx;
  342. height: 152rpx;
  343. background-color: #ccc;
  344. }
  345. }
  346. }
  347. .mc-btn {
  348. width: 144rpx;
  349. line-height: 50rpx;
  350. border-radius: 25px;
  351. background: #FFFFFF;
  352. font-size: 26rpx;
  353. font-family: PingFang SC;
  354. font-weight: 500;
  355. text-align: center;
  356. position: absolute;
  357. bottom: 47rpx;
  358. }
  359. .pass {
  360. color: #FF4C4C;
  361. border: 2px solid #FF4C4C;
  362. right: 36rpx;
  363. }
  364. .fail {
  365. color: #999999;
  366. border: 2px solid #EBEBEB;
  367. right: 36rpx;
  368. }
  369. }
  370. .refuse-box {
  371. width: 549rpx;
  372. height: 437rpx;
  373. background: #FFFFFF;
  374. border-radius: 14rpx;
  375. .box-tit {
  376. line-height: 120rpx;
  377. text-align: center;
  378. font-size: 37rpx;
  379. font-family: PingFang SC;
  380. font-weight: bold;
  381. color: #333333;
  382. }
  383. .resone-wrapper {
  384. width: 494rpx;
  385. height: 181rpx;
  386. margin: auto;
  387. background: rgba(224, 224, 224, 0.35);
  388. border-radius: 10px;
  389. padding: 10rpx;
  390. font-size: 28rpx;
  391. }
  392. .btn-wrap {
  393. margin-top: 60rpx;
  394. display: flex;
  395. .btn {
  396. width: 50%;
  397. font-size: 37rpx;
  398. font-family: PingFang SC;
  399. font-weight: 500;
  400. color: #999999;
  401. text-align: center;
  402. }
  403. }
  404. }
  405. .pop-wrap {
  406. width: 522rpx;
  407. height: 800rpx;
  408. // background-color: red;
  409. }
  410. .popup-box {
  411. width: 522rpx;
  412. height: 800rpx;
  413. border-radius: 20rpx;
  414. position: relative;
  415. overflow: hidden;
  416. background-color: #fff;
  417. .popup-item {
  418. width: 100%;
  419. height: 100%;
  420. image {
  421. width: 100%;
  422. // height: 100%;
  423. }
  424. }
  425. }
  426. .close {
  427. display: block;
  428. width: 40rpx;
  429. height: 40rpx;
  430. border: 50%;
  431. position: absolute;
  432. // background-color: red;
  433. bottom: -100rpx;
  434. left: 0;
  435. right: 0;
  436. margin: 0 auto;
  437. }
  438. </style>