index.vue 7.6 KB

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