index.vue 7.8 KB

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