index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <view>
  3. <view class="wrap">
  4. <view class="u-tabs-box" style="width:100%">
  5. <u-tabs :list="list" :is-scroll="false" :current="current" @change="handleFilterBrand"></u-tabs>
  6. </view>
  7. <view class="page-box" v-if="pages!=0">
  8. <view class="order" v-for="(res,index) in orderList" :key="index">
  9. <view class="order-one">
  10. </view>
  11. <text class="order-one-text">核销金额:¥{{res.amount}}</text>
  12. <view class="order-one-view">
  13. {{b2bStatus}}
  14. </view>
  15. <view class="order-one-xian">
  16. </view>
  17. <view class="order-two">
  18. <view class="">
  19. 创建时间
  20. </view>
  21. <view class="">
  22. {{res.createTime}}
  23. </view>
  24. </view>
  25. <view class="order-two" v-if="res.agentAuditTime != null">
  26. <view class="">
  27. 审核时间
  28. </view>
  29. <view class="">
  30. {{res.agentAuditTime}}
  31. </view>
  32. </view>
  33. <view class="order-two">
  34. <view class="">
  35. {{res.brandName}}轮胎
  36. </view>
  37. <view class="">
  38. ¥{{res.amount}}
  39. </view>
  40. </view>
  41. <view class="order-two">
  42. <view class="">
  43. 当前状态
  44. </view>
  45. <view v-if="res.status == 0">
  46. 待审核
  47. </view>
  48. <view v-else-if="res.status == 1">
  49. 审核未通过
  50. </view>
  51. <view v-else-if="res.status == 2">
  52. 审核通过
  53. </view>
  54. <view v-else-if="res.status == 3">
  55. 已过期
  56. </view>
  57. <view v-else-if="res.status == 4">
  58. 已审核
  59. </view>
  60. </view>
  61. </view>
  62. <u-loadmore :status="status" />
  63. </view>
  64. <view v-else style="margin-top: 100rpx;">
  65. <u-empty text="暂无数据" mode="list"></u-empty>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import {
  72. request
  73. } from '../../../common/request/request'
  74. require("promise.prototype.finally").shim()
  75. export default {
  76. data() {
  77. return {
  78. orderList: [
  79. ],
  80. length: '',
  81. status: '没',
  82. pages: '',
  83. b2bStatus: '',
  84. list: [{
  85. name: "待审核"
  86. }, {
  87. name: "已审核"
  88. }, {
  89. name: "已失效"
  90. }],
  91. current: 0,
  92. current3: 0,
  93. current2: 1
  94. };
  95. },
  96. onLoad() {},
  97. created() {
  98. this.getDate()
  99. },
  100. methods: {
  101. // 获取列表数据
  102. getDate() {
  103. uni.showLoading({
  104. title: '加载中...'
  105. });
  106. request({
  107. url: '/myapp/storeSelectCoupon',
  108. method: 'post',
  109. data: {
  110. storeId: this.$store.state.storeInfo.storeId,
  111. "size": 10, //门店0
  112. "current": this.current2,
  113. "status": this.current3,
  114. 'userId': this.$store.state.storeInfo.userId
  115. }
  116. }).then(res => {
  117. this.orderList = this.orderList.concat(res.data.data.records)
  118. // 页数
  119. this.pages = res.data.data.pages
  120. this.orderList = this.orderList.concat(res.data.data.records)
  121. for (let i = 0; i < res.data.data.records.length; i++) {
  122. if (res.data.data.records[i].status == 0) {
  123. this.b2bStatus = "待审核"
  124. } else if (res.data.data.records[i].status == 2) {
  125. this.b2bStatus = "已审核"
  126. } else {
  127. this.b2bStatus = "已失效"
  128. }
  129. }
  130. }).catch(err => {
  131. })
  132. .finally(() => {
  133. setTimeout(() => {
  134. uni.hideLoading();
  135. this.loading = false;
  136. }, 300)
  137. })
  138. },
  139. handleFilterBrand: function(v2) {
  140. this.current = v2
  141. if (v2 == 0) {
  142. this.current1 = 0
  143. this.current3 = 0
  144. } else if (v2 == 1) {
  145. this.current1 = 4
  146. this.current3 = 4
  147. } else {
  148. this.current1 = 3
  149. this.current3 = 3
  150. }
  151. this.current2 = 1
  152. request({
  153. url: '/myapp/storeSelectCoupon',
  154. method: 'post',
  155. data: {
  156. storeId: this.$store.state.storeInfo.storeId,
  157. "size": 10, //门店0
  158. "current": this.current2,
  159. "status": this.current1,
  160. 'userId': this.$store.state.storeInfo.userId
  161. }
  162. }).then(res => {
  163. this.orderList = res.data.data.records
  164. // 页数
  165. this.pages = res.data.data.pages
  166. // this.orderList = this.orderList.concat(res.data.data.records)
  167. for (let i = 0; i < res.data.data.records.length; i++) {
  168. if (res.data.data.records[i].status == 0) {
  169. this.b2bStatus = "待审核"
  170. } else if (res.data.data.records[i].status == 2) {
  171. this.b2bStatus = "已审核"
  172. } else {
  173. this.b2bStatus = "已失效"
  174. }
  175. }
  176. }).catch(err => {
  177. })
  178. .finally(() => {
  179. setTimeout(() => {
  180. uni.hideLoading();
  181. this.loading = false;
  182. }, 300)
  183. })
  184. }
  185. },
  186. onReachBottom() {
  187. setTimeout(() => {
  188. if (this.current2 > this.pages) {
  189. this.status = 'nomore'
  190. } else {
  191. this.current2 = ++this.current2;
  192. this.status = 'loading';
  193. this.getDate()
  194. }
  195. }, 2000)
  196. }
  197. }
  198. </script>
  199. <style>
  200. /* #ifndef H5 */
  201. page {
  202. height: 100%;
  203. background-color: #f2f2f2;
  204. }
  205. /* #endif */
  206. </style>
  207. <style lang="scss" scoped>
  208. .u-tabs-box {
  209. width: 100%;
  210. // padding-left:30rpx;
  211. }
  212. .order-one-view {
  213. width: 120rpx;
  214. line-height: 40rpx;
  215. background-color: #0094FE;
  216. position: relative;
  217. left: 575rpx;
  218. top: -35rpx;
  219. border-top-left-radius: 50rpx;
  220. border-bottom-left-radius: 50rpx;
  221. font-size: 24rpx;
  222. color: #fff;
  223. text-align: center;
  224. }
  225. // 插件代码
  226. .order {
  227. width: 710rpx;
  228. background-color: #ffffff;
  229. margin: 20rpx auto;
  230. border-radius: 20rpx;
  231. box-sizing: border-box;
  232. padding: 20rpx;
  233. font-size: 28rpx;
  234. .top {
  235. display: flex;
  236. justify-content: space-between;
  237. .left {
  238. display: flex;
  239. align-items: center;
  240. .store {
  241. margin: 0 10rpx;
  242. font-size: 32rpx;
  243. font-weight: bold;
  244. }
  245. }
  246. .right {
  247. color: $u-type-warning-dark;
  248. }
  249. }
  250. .item {
  251. display: flex;
  252. margin: 20rpx 0 0;
  253. .left {
  254. margin-right: 20rpx;
  255. image {
  256. width: 200rpx;
  257. height: 200rpx;
  258. border-radius: 10rpx;
  259. }
  260. }
  261. .content {
  262. .title {
  263. font-size: 28rpx;
  264. line-height: 50rpx;
  265. }
  266. .type {
  267. margin: 10rpx 0;
  268. font-size: 24rpx;
  269. color: $u-tips-color;
  270. }
  271. .delivery-time {
  272. color: #e5d001;
  273. font-size: 24rpx;
  274. }
  275. }
  276. .right {
  277. margin-left: 10rpx;
  278. padding-top: 20rpx;
  279. text-align: right;
  280. .decimal {
  281. font-size: 24rpx;
  282. margin-top: 4rpx;
  283. }
  284. .number {
  285. color: $u-tips-color;
  286. font-size: 24rpx;
  287. }
  288. }
  289. }
  290. .total {
  291. margin-top: 20rpx;
  292. text-align: right;
  293. font-size: 24rpx;
  294. .total-price {
  295. font-size: 32rpx;
  296. }
  297. }
  298. .bottom {
  299. display: flex;
  300. margin-top: 40rpx;
  301. padding: 0 10rpx;
  302. justify-content: space-between;
  303. align-items: center;
  304. .btn {
  305. line-height: 52rpx;
  306. width: 160rpx;
  307. border-radius: 26rpx;
  308. border: 2rpx solid $u-border-color;
  309. font-size: 26rpx;
  310. text-align: center;
  311. color: $u-type-info-dark;
  312. }
  313. .evaluate {
  314. color: $u-type-warning-dark;
  315. border-color: $u-type-warning-dark;
  316. }
  317. }
  318. }
  319. .centre {
  320. text-align: center;
  321. margin: 200rpx auto;
  322. font-size: 32rpx;
  323. image {
  324. width: 164rpx;
  325. height: 164rpx;
  326. border-radius: 50%;
  327. margin-bottom: 20rpx;
  328. }
  329. .tips {
  330. font-size: 24rpx;
  331. color: #999999;
  332. margin-top: 20rpx;
  333. }
  334. .btn {
  335. margin: 80rpx auto;
  336. width: 200rpx;
  337. border-radius: 32rpx;
  338. line-height: 64rpx;
  339. color: #ffffff;
  340. font-size: 26rpx;
  341. background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
  342. }
  343. }
  344. .wrap {
  345. display: flex;
  346. flex-direction: column;
  347. height: calc(100vh - var(--window-top));
  348. width: 100%;
  349. }
  350. .swiper-box {
  351. flex: 1;
  352. }
  353. .swiper-item {
  354. height: 100%;
  355. }
  356. // 手敲代码
  357. .order-one {
  358. width: 6rpx;
  359. height: 30rpx;
  360. margin-top: 5rpx;
  361. margin-right: 30rpx;
  362. background-color: #0292FD;
  363. float: left;
  364. }
  365. .order-two {
  366. display: flex;
  367. justify-content: space-between;
  368. margin-top: 15rpx;
  369. font-size: 24rpx;
  370. color: #6A6A6A;
  371. }
  372. // 线
  373. .order-one-xian {
  374. width: 642rpx;
  375. height: 1rpx;
  376. border-bottom: 1rpx solid #E7E8EA;
  377. margin: 0 auto;
  378. margin-top: -20rpx;
  379. margin-bottom: 30rpx;
  380. }
  381. .order-one-text {
  382. font-size: 28rpx;
  383. font-weight: bold;
  384. color: #000;
  385. }
  386. </style>