outorder.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <view class="app">
  3. <view></view>
  4. <view></view>
  5. <view class="box-nav">
  6. <view class="bn fx-r">
  7. <view v-for="(item,index) of navList" :key="index" class="bn-item fx-h fx-bc fx-ac" @tap="tapChange(index)">
  8. <view class="bni" :class="[current == index ? 'select':'']">
  9. {{item.name}}
  10. </view>
  11. <view class="ii" v-if="item.count > 0"></view>
  12. </view>
  13. </view>
  14. </view>
  15. <scroll-view scroll-y class="scroll" :style="'height: calc(100vh - 45vw - ' + statusBarHeight + 'px - 44px);'" @scrolltolower="onBottom">
  16. <view class="app-body">
  17. <template v-for="item in orderList">
  18. <view class="order-item" v-if="item.pageType == 'order'" @tap="tapItem(item)">
  19. <view class="order-itop fx-r">
  20. <view class="order-id">{{ item.order_id }}</view>
  21. <view class="fx-g1"></view>
  22. <view class="status" v-if="item.status == 0">已过期</view>
  23. <view class="status" v-if="item.status == 1">待支付</view>
  24. <view class="status" v-if="item.status == 2">待审核</view>
  25. <view class="status" v-if="item.status == 3">完成</view>
  26. </view>
  27. <view class="goods-item fx-r fx-bc">
  28. <image :src="item.image" class="img" mode="aspectFill"></image>
  29. <view class="info">
  30. <view class="title">{{ item.name }}</view>
  31. <view class="price">¥{{ item.price }}</view>
  32. </view>
  33. <view class="fx-g1"></view>
  34. <view class="count">x1</view>
  35. </view>
  36. <view class="collection">
  37. <view class="cinfo fx-r fx-bc ">
  38. <view class="label">买家</view>
  39. <image :src="item.buy_avatar" class="avatar"></image>
  40. <view class="nickname">{{item.buy_nickname }} </view>
  41. <view class="mobile">{{item.buy_mobile }}</view>
  42. </view>
  43. <view class="cinfo fx-r fx-bc ">
  44. <view class="label">ID号:</view>
  45. <view class="uid">{{ item.uid }}</view>
  46. </view>
  47. <view class="cinfo fx-r fx-bs">
  48. <view class="label">打款凭证:</view>
  49. <image @tap.stop="tapOpenImg(item.upload_image)" class="proof" mode="aspectFill" :src="item.upload_image"></image>
  50. </view>
  51. </view>
  52. <template v-if="item.status == 2">
  53. <view class="order-btn" v-if="item.appeal == 0">
  54. <view class="btn" @tap.stop="tapExplain(item)">申述</view>
  55. <view class="btn" @tap.stop="tapPass(item)">通过</view>
  56. </view>
  57. <view class="order-btn" v-if="item.appeal == 1">
  58. <view class="btn" @tap.stop="tapNoExplain(item)">取消申述</view>
  59. <view class="btn" @tap.stop="tapPass(item)">通过</view>
  60. </view>
  61. </template>
  62. </view>
  63. <view class="order-item" v-if="item.pageType == 'buy'">
  64. <view class="order-itop fx-r">
  65. <view class="order-id">{{ item.order_id }}</view>
  66. <view class="fx-g1"></view>
  67. <view class="status" >售卖中</view>
  68. </view>
  69. <view class="goods-item fx-r fx-bc">
  70. <image :src="item.image" class="img" mode="aspectFill"></image>
  71. <view class="info fx-g1">
  72. <view class="fm fx-r">
  73. <view class="title">{{ item.name }}</view>
  74. <view class="fx-g1"></view>
  75. <view class="price">¥{{ item.price }}</view>
  76. </view>
  77. <view class="mtitle">售卖时间:{{ utils.date('Y-m-d',item.hanging_time) }}</view>
  78. <view class="mtitle">来源:{{ item.nickname }}</view>
  79. </view>
  80. </view>
  81. <view class="collection">
  82. <view class="cinfo fx-r fx-bc">
  83. <view class="label">挂售价:{{ item.hanging_price }}</view>
  84. <view class="tag" v-if="item.lt_type == 1" style="color: red;font-size: 14px; margin-left: 10px;" >[瘦身]</view>
  85. <view class="tag" v-if="item.lt_type == 2">[拆单]</view>
  86. </view>
  87. <view class="cinfo">
  88. <view class="label">挂售时间:{{ utils.date('Y-m-d',item.add_time) }}</view>
  89. </view>
  90. </view>
  91. </view>
  92. </template>
  93. <u-empty
  94. v-if="orderList.length == 0"
  95. mode="data"
  96. icon="/static/img/no-empty.png"
  97. ></u-empty>
  98. <view v-if="orderList.length > 0">
  99. <view class="loading fx-r fx-ac fx-bc" v-if="page.isFrite && !page.isFoot">
  100. <image src="/static/img/xloading.png"></image>
  101. <text>正在载入更多...</text>
  102. </view>
  103. <view class="loading complete" :hidden="!page.isFoot">已加载全部</view>
  104. </view>
  105. </view>
  106. </scroll-view>
  107. </view>
  108. </template>
  109. <script>
  110. import {mapState,mapMutations } from 'vuex';
  111. export default {
  112. computed: mapState(['user']),
  113. name : "outorder",
  114. data() {
  115. return {
  116. statusBarHeight : 20,
  117. page:{
  118. isFirst:false,
  119. isLoad:false,
  120. isFoot:false,
  121. page:1
  122. },
  123. orderList: [],
  124. current : 0,
  125. navList : [
  126. {"name" : "全部","code" : "","count" : 0},
  127. {"name" : "售卖中","code" : "buy","count" : 0},
  128. {"name" : "待支付","code" : "nopay","count" : 0},
  129. {"name" : "待审核","code" : "audit","count" : 0},
  130. ]
  131. }
  132. },
  133. methods: {
  134. /**
  135. * 加载基础配置
  136. */
  137. initView:function(){
  138. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  139. this.getData(true);
  140. this.ckInit();
  141. },
  142. tapChange:function(ev){
  143. this.current = ev;
  144. this.getData(true);
  145. },
  146. onBottom() {
  147. if(this.page.isFoot || this.page.isLoad) {
  148. return;
  149. }
  150. this.page.page ++;
  151. this.getData();
  152. },
  153. /**
  154. * 待支付
  155. */
  156. tapPay:function(item){
  157. uni.navigateTo({
  158. url:"/pages/guild/order/hallpay?id=" + item.id
  159. })
  160. },
  161. /**
  162. * 判断是否红点
  163. */
  164. ckInit:function(){
  165. this
  166. .request
  167. .get("auctionOrderSellerInit")
  168. .then(res => {
  169. if(res.code == 200) {
  170. for(let i in this.navList) {
  171. if(this.navList[i].code == 'buy') {
  172. this.navList[i].count = res.data.buyCount;
  173. }
  174. if(this.navList[i].code == 'nopay') {
  175. this.navList[i].count = res.data.nopayCount;
  176. }
  177. if(this.navList[i].code == 'audit') {
  178. this.navList[i].count = res.data.auditCount;
  179. }
  180. }
  181. }
  182. });
  183. },
  184. getData:function(isPull = false){
  185. if(this.page.isLoad) return;
  186. this.page.isLoad = true;
  187. if(isPull) {
  188. this.page.page = 1;
  189. this.page.isLoad = false;
  190. this.page.isFoot = false;
  191. }
  192. uni.showLoading({ title: '获取数据中..' });
  193. var post = {};
  194. post.page = this.page.page;
  195. post.type = this.navList[this.current].code;
  196. this
  197. .request
  198. .post("auctionOrderSeller",post)
  199. .then(res => {
  200. uni.hideLoading();
  201. this.page.isFirst = true;
  202. this.page.isLoad = false;
  203. if(res.code == 200) {
  204. if(isPull) {
  205. this.orderList = res.data.list;
  206. } else {
  207. this.orderList = this.orderList.concat(res.data.list);
  208. }
  209. //是否到底
  210. if(res.data.list.length != res.data.pageSize) {
  211. this.page.isFoot = true;
  212. }
  213. } else {
  214. uni.showModal({title: '系统提示',content: res.msg,showCancel: false});
  215. }
  216. //that.CountDowm();
  217. })
  218. .catch(res=>{
  219. uni.hideLoading();
  220. uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
  221. });
  222. },
  223. /**
  224. * 打开图片
  225. */
  226. tapOpenImg:function(img){
  227. uni.previewImage({
  228. current:0,
  229. urls:[img]
  230. });
  231. },
  232. /**
  233. * 申诉
  234. * @param {Object} item
  235. */
  236. tapExplain:function(item) {
  237. this.utils.showModal("提交申诉后会导订单被冻结,是否继续提交申诉?",()=>{
  238. uni.showLoading({ title: '提交中..' });
  239. this
  240. .request
  241. .post("auctionPlead",{id : item.id})
  242. .then(res => {
  243. uni.hideLoading();
  244. if(res.code == 200) {
  245. this.getData(true);
  246. } else {
  247. this.utils.Tip(res.msg);
  248. }
  249. })
  250. .catch(res=>{
  251. uni.hideLoading();
  252. uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
  253. });
  254. });
  255. },
  256. /**
  257. * 取消申诉
  258. * @param {Object} item
  259. */
  260. tapNoExplain:function(item){
  261. this.utils.showModal("提交撤销申诉后会订单被解冻,是否继续提交取消申诉?",()=>{
  262. uni.showLoading({ title: '提交中..' });
  263. this
  264. .request
  265. .post("auctionRevoke",{id : item.id})
  266. .then(res => {
  267. uni.hideLoading();
  268. if(res.code == 200) {
  269. this.getData(true);
  270. } else {
  271. this.utils.Tip(res.msg);
  272. }
  273. })
  274. .catch(res=>{
  275. uni.hideLoading();
  276. uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
  277. });
  278. });
  279. },
  280. /**
  281. * 审核通过
  282. * @param {Object} item
  283. */
  284. tapPass:function(item) {
  285. this.utils.showModal("确定要审核通过吗?",()=>{
  286. uni.showLoading({ title: '提交中..' });
  287. this
  288. .request
  289. .post("auctionAdopt",{id : item.id})
  290. .then(res => {
  291. uni.hideLoading();
  292. if(res.code == 200) {
  293. this.getData(true);
  294. } else {
  295. this.utils.Tip(res.msg);
  296. }
  297. })
  298. .catch(res=>{
  299. uni.hideLoading();
  300. uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
  301. });
  302. });
  303. },
  304. /**
  305. * 查看详情
  306. * @param {Object} item
  307. */
  308. tapItem:function(item) {
  309. uni.navigateTo({
  310. url:"/pages/guild/order/outOrderItem?id=" + item.id
  311. })
  312. },
  313. },
  314. }
  315. </script>
  316. <style lang="scss">
  317. .navlist{
  318. width: 100%;
  319. background: #fff;
  320. height: 40px;
  321. }
  322. .app-body{
  323. position: relative;
  324. z-index: 9;
  325. .order-item {
  326. display: flex;
  327. flex-direction: column;
  328. background: #fff;
  329. margin-top: 9px;
  330. .order-itop{
  331. display: flex;
  332. align-items: center;
  333. height: 45px;
  334. font-size: 16px;
  335. color: #303133;
  336. position: relative;
  337. padding: 0 17px;
  338. .order-id{
  339. font-size: 14px;
  340. color:#787878;
  341. }
  342. .status{
  343. color: #dc262b;
  344. font-size: 14px;
  345. }
  346. }
  347. .goods-item{
  348. padding: 11px 17px;
  349. background: #f7f7f7;
  350. .img{
  351. width: 68px;
  352. height: 68px;
  353. }
  354. .info{
  355. margin-left: 20px;
  356. .title{
  357. font-size: 16px;
  358. color: #303133;
  359. margin-bottom: 20rpx;
  360. }
  361. .price{
  362. display: inline;
  363. font-size: 14px;
  364. color: #303133;
  365. }
  366. .mtitle{font-size: 12px;color: #787878}
  367. }
  368. .count{
  369. font-size: 16px;
  370. color: #787878;
  371. }
  372. }
  373. .collection{
  374. padding: 10px;
  375. border-bottom: 1px solid #f1f1f1;
  376. .cinfo{
  377. margin-top: 10px;
  378. .label{
  379. font-size: 13px;
  380. font-weight: 500;
  381. color: #6d7c88;
  382. }
  383. .avatar{
  384. margin-left: 5px;
  385. width: 24px;
  386. height: 24px;
  387. border-radius: 50%;
  388. }
  389. .nickname{
  390. margin-left: 5px;
  391. font-size: 17px;
  392. font-weight: 700;
  393. color: #333;
  394. }
  395. .mobile{
  396. margin-left: 6px;
  397. font-size: 12px;
  398. font-weight: 500;
  399. color: #999;
  400. }
  401. .uid {
  402. font-size: 13px;
  403. font-weight: 500;
  404. color: #6d7c88;
  405. }
  406. .proof{
  407. width: 81px;
  408. height: 80px;
  409. border-radius: 10px;
  410. margin-left: 20px;
  411. }
  412. }
  413. }
  414. .order-foot{
  415. display: flex;
  416. justify-content: flex-end;
  417. align-items: baseline;
  418. padding: 11px 17px;
  419. font-size: 14px;
  420. color: #909399;
  421. border-bottom: 1px solid #f1f1f1;
  422. .i2{
  423. margin: 0 4px;
  424. color: #303133;
  425. }
  426. .price{
  427. font-size: 18px;
  428. color: #303133;
  429. }
  430. }
  431. .order-btn{
  432. padding: 0 17px;
  433. display: flex;
  434. justify-content: flex-end;
  435. align-items: center;
  436. height: 57px;
  437. position: relative;
  438. .btn{
  439. width: 91px;
  440. height: 30px;
  441. margin: 0;
  442. margin-left: 13px;
  443. padding: 0;
  444. text-align: center;
  445. line-height: 30px;
  446. font-size: 14px;
  447. color: #303133;
  448. background: #fff;
  449. border-radius: 100px;
  450. border: 1px solid #fd3b39;
  451. border-radius: 28px;
  452. color: #dc262b;
  453. }
  454. }
  455. }
  456. }
  457. .box-nav{width:100%;height:50px;background-color:#fff;border-top:1px #f5f5f5 solid;position: relative;z-index: 9;}
  458. .bn{align-items:center;height:50px}
  459. .bn-item{width:25%;text-align:center;position:relative;height:50px;background: #fff;}
  460. .bni{color:#3F3E3E;font-size:14px;box-sizing:border-box;position:relative}
  461. .select{width:100%;color:#ef4034}
  462. .select::after{content:"";position:absolute;bottom:-5px;left:50%;transform:translate(-50%,-50%);background:#ef4034;width:24px;height:2px}
  463. .bn-item .ii{position: absolute;width: 10px;height: 10px;border-radius: 50%;background: red;right: 20%;top: 10px;}
  464. </style>