index.vue 7.9 KB

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