sellout.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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" @click="call(item.user.phone)">
  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">{{item.price}}</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. call(phone) {
  158. uni.makePhoneCall({
  159. phoneNumber: phone,
  160. fail() {
  161. this.$api.msg('请稍后再试')
  162. }
  163. })
  164. },
  165. reload() {
  166. this.list = []
  167. this.page = 1
  168. this.loadingType = 'more'
  169. this.loadData()
  170. },
  171. lookimg(src) {
  172. console.log(src,'chooseImg++++++')
  173. this.chooseImg = src
  174. this.$refs.lookimg.open()
  175. },
  176. loadData() {
  177. let obj = this
  178. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  179. return
  180. }
  181. obj.loadingType = 'loading'
  182. packageOrder({
  183. page: obj.page,
  184. limit: obj.limit,
  185. status: 2
  186. }).then(({
  187. data
  188. }) => {
  189. console.log(data)
  190. obj.list = data.data
  191. obj.page++
  192. if (obj.limit == data.data.length) {
  193. obj.loadingType = 'more'
  194. } else {
  195. obj.loadingType = 'noMore'
  196. }
  197. obj.loaded = true
  198. })
  199. },
  200. openrefuse(item) {
  201. this.choose_order = item.id
  202. this.chooseIndex = this.list.indexOf(item)
  203. this.$refs.refuse.open()
  204. },
  205. //取消拒绝
  206. refusFali() {
  207. this.resone = ''
  208. this.$refs.refuse.close()
  209. },
  210. //确定拒绝
  211. refusOk() {
  212. let obj = this
  213. if(obj.resone == '') {
  214. obj.$api.msg('请输入拒绝理由')
  215. return
  216. }
  217. packageAudit({
  218. re: obj.resone,
  219. id: obj.choose_order,
  220. status: -2
  221. }).then(res => {
  222. obj.resone = ''
  223. obj.$refs.refuse.close()
  224. obj.list[obj.chooseIndex].status = -2
  225. })
  226. },
  227. closePup() {
  228. this.chooseImg = ''
  229. this.$refs.lookimg.close()
  230. },
  231. passPackage(item) {
  232. let index = this.list.indexOf(item)
  233. console.log(index,'index')
  234. packageAudit({
  235. re: '',
  236. id: item.id,
  237. status: 3
  238. }).then(res => {
  239. uni.showToast({
  240. title:'审核通过',
  241. duration:2000
  242. });
  243. console.log(res)
  244. this.list[index].status = 3
  245. // this.reload()
  246. })
  247. }
  248. }
  249. }
  250. </script>
  251. <style lang="scss" scoped>
  252. .outt {
  253. height: 392rpx;
  254. }
  255. .out-wrapper {
  256. width: 690rpx;
  257. // height: 392rpx;
  258. background: #FFFFFF;
  259. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  260. border-radius: 20rpx;
  261. margin: 0 auto 20rpx;
  262. padding: 30rpx;
  263. position: relative;
  264. .outt {
  265. height: 392rpx;
  266. }
  267. .out-top {
  268. line-height: 46rpx;
  269. justify-content: space-between;
  270. .buy-info {
  271. width: 450rpx;
  272. font-size: 32rpx;
  273. font-family: PingFang SC;
  274. font-weight: bold;
  275. color: #0F253A;
  276. justify-content: flex-start;
  277. .fsz {
  278. flex-shrink: 0;
  279. }
  280. .user-name {
  281. max-width: 180rpx;
  282. }
  283. .user-phone {
  284. padding-left: 10rpx;
  285. font-size: 24rpx;
  286. font-family: PingFang SC;
  287. font-weight: 500;
  288. color: #999999;
  289. }
  290. .user-logo {
  291. display: block;
  292. width: 46rpx;
  293. height: 46rpx;
  294. border-radius: 50%;
  295. // background-color: red;
  296. // padding-right: 10rpx;
  297. margin-right: 10rpx;
  298. }
  299. }
  300. .buy-status {
  301. font-size: 26rpx;
  302. font-family: PingFang SC;
  303. font-weight: 500;
  304. color: #6D7C88;
  305. }
  306. }
  307. .item-info {
  308. width: 100%;
  309. margin-top: 28rpx;
  310. line-height: 50rpx;
  311. font-size: 26rpx;
  312. font-family: PingFang SC;
  313. display: flex;
  314. flex-wrap: wrap;
  315. .info-data {
  316. width: 100%;
  317. display: flex;
  318. .info-tit {
  319. font-weight: 500;
  320. color: #6D7C88;
  321. }
  322. .info-val {
  323. color: #0F253A;
  324. font-weight: bold;
  325. }
  326. }
  327. }
  328. .upimg {
  329. padding-top: 10rpx;
  330. display: flex;
  331. .up-tit {
  332. display: inline-block;
  333. font-size: 26rpx;
  334. font-family: PingFang SC;
  335. font-weight: 500;
  336. color: #6D7C88;
  337. }
  338. .img-wrap {
  339. width: 153rpx;
  340. height: 152rpx;
  341. border-radius: 20rpx;
  342. image {
  343. border-radius: 20rpx;
  344. width: 153rpx;
  345. height: 152rpx;
  346. background-color: #ccc;
  347. }
  348. }
  349. }
  350. .mc-btn {
  351. width: 144rpx;
  352. line-height: 50rpx;
  353. border-radius: 25px;
  354. background: #FFFFFF;
  355. font-size: 26rpx;
  356. font-family: PingFang SC;
  357. font-weight: 500;
  358. text-align: center;
  359. position: absolute;
  360. bottom: 47rpx;
  361. }
  362. .pass {
  363. color: #FF4C4C;
  364. border: 2px solid #FF4C4C;
  365. right: 36rpx;
  366. }
  367. .fail {
  368. color: #999999;
  369. border: 2px solid #EBEBEB;
  370. right: 36rpx;
  371. }
  372. }
  373. .refuse-box {
  374. width: 549rpx;
  375. height: 437rpx;
  376. background: #FFFFFF;
  377. border-radius: 14rpx;
  378. .box-tit {
  379. line-height: 120rpx;
  380. text-align: center;
  381. font-size: 37rpx;
  382. font-family: PingFang SC;
  383. font-weight: bold;
  384. color: #333333;
  385. }
  386. .resone-wrapper {
  387. width: 494rpx;
  388. height: 181rpx;
  389. margin: auto;
  390. background: rgba(224, 224, 224, 0.35);
  391. border-radius: 10px;
  392. padding: 10rpx;
  393. font-size: 28rpx;
  394. }
  395. .btn-wrap {
  396. margin-top: 60rpx;
  397. display: flex;
  398. .btn {
  399. width: 50%;
  400. font-size: 37rpx;
  401. font-family: PingFang SC;
  402. font-weight: 500;
  403. color: #999999;
  404. text-align: center;
  405. }
  406. }
  407. }
  408. .pop-wrap {
  409. width: 522rpx;
  410. height: 800rpx;
  411. // background-color: red;
  412. }
  413. .popup-box {
  414. width: 522rpx;
  415. height: 800rpx;
  416. border-radius: 20rpx;
  417. position: relative;
  418. overflow: hidden;
  419. background-color: #fff;
  420. .popup-item {
  421. width: 100%;
  422. height: 100%;
  423. image {
  424. width: 100%;
  425. // height: 100%;
  426. }
  427. }
  428. }
  429. .close {
  430. display: block;
  431. width: 40rpx;
  432. height: 40rpx;
  433. border: 50%;
  434. position: absolute;
  435. // background-color: red;
  436. bottom: -100rpx;
  437. left: 0;
  438. right: 0;
  439. margin: 0 auto;
  440. }
  441. </style>