index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <!-- 奖励明细页面 -->
  3. <view class="header">
  4. <view class="header-one">
  5. </view>
  6. <view class="content">
  7. <view style="width: 100%;">
  8. <view style="width: 340rpx;height: 80rpx;text-align: center;padding-top: 25rpx;padding-left: 20rpx;float: left;margin-top: 0;margin-left: 30rpx;">
  9. <view style="float: left;">
  10. <text @tap="$u.throttle(whole, 500)">全部</text>
  11. <view v-if="bottoma == true" style="width: 100%;height: 1rpx;background-color: #FFFFFF;border-radius: 10rpx;"></view>
  12. <view v-else></view>
  13. </view>
  14. <view style="float: left;margin-left: 70rpx;">
  15. <text @click="brand">品牌</text>
  16. <view v-if="bottomb == true" style="width: 100%;height: 1rpx;background-color: #FFFFFF;border-radius: 10rpx;"></view>
  17. <view v-else></view>
  18. </view>
  19. <view style="float: left;margin-left: 70rpx;">
  20. <text @click="time_s">时间</text>
  21. <view v-if="bottomc == true" style="width: 100%;height: 1rpx;background-color: #FFFFFF;border-radius: 10rpx;"></view>
  22. <view v-else></view>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- <u-tabs style="width: 500rpx;" bg-color="#0095ff" inactive-color="#FFFFFF" active-color="#fff" :list="list"
  27. :is-scroll="false" :current="current" @change="change"></u-tabs> -->
  28. <!-- <u-select :mask-close-able="false" @cancel="clear" style=" color: #fff;" @confirm="confirm" v-model="showBrand"
  29. value-name="brandId" label-name="brandName" :list="brandList"></u-select> -->
  30. <u-action-sheet :mask-close-able="false" :list="list_a" @click="click" @close="close" v-model="showBrand"></u-action-sheet>
  31. <u-calendar :mask-close-able="false" style=" color: #fff;" @click="calendar" @change="changetime" v-model="showDate" :mode="mode">
  32. </u-calendar>
  33. <view>
  34. <u-search style="width: 320rpx;" placeholder="请输入胎号或规格" v-model="input" :clearabled="true" @change="handleSearch"
  35. :show-action="false" :animation="true"></u-search>
  36. </view>
  37. </view>
  38. <view v-if="count!=0">
  39. <view class="content-one" v-for="(item,index) in datalist" :key="index">
  40. <view class="content-one-view">
  41. </view>
  42. <view class="content-one-text">获得奖励:{{item.money}}元</view>
  43. <view class="content-two">
  44. <view class="">
  45. 轮胎型号
  46. </view>
  47. <view class="">
  48. {{item.tireModel}}
  49. </view>
  50. </view>
  51. <view class="content-two">
  52. <view class="">
  53. 扫码胎号
  54. </view>
  55. <view class="">
  56. {{item.tyreNum}}
  57. </view>
  58. </view>
  59. <view class="content-two">
  60. <view class="">
  61. 奖励类型
  62. </view>
  63. <view class="">
  64. {{getWay}}
  65. </view>
  66. </view>
  67. <view class="content-two">
  68. <view class="">
  69. 获得时间
  70. </view>
  71. <view class="">
  72. {{item.createTime}}
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <view v-else style="margin-top: 400rpx;">
  78. <u-empty text="暂无数据" mode="list"></u-empty>
  79. </view>
  80. <u-loadmore v-if="datalist.length>3" :status="status" />
  81. </view>
  82. </template>
  83. <script>
  84. import {
  85. request
  86. } from '../../../common/request/request'
  87. require("promise.prototype.finally").shim()
  88. export default {
  89. data() {
  90. return {
  91. datalist: [],
  92. status: 'loadmore',
  93. getWay: '',
  94. input: '',
  95. bottoma: true,
  96. bottomb: false,
  97. bottomc: false,
  98. list: [{
  99. name: '全部'
  100. }, {
  101. name: '品牌'
  102. }, {
  103. name: '时间',
  104. }],
  105. list_a: [],
  106. brandList: JSON.parse(JSON.stringify([])),
  107. current: 0,
  108. // 默认页数
  109. current1: 1,
  110. showBrand: false,
  111. showDate: false,
  112. mode: 'range',
  113. // 开始时间
  114. startTime: '',
  115. // 结束时间
  116. endTime: '',
  117. pages: '',
  118. count: '',
  119. datalength: '',
  120. label: '',
  121. };
  122. },
  123. created() {
  124. this.whole()
  125. this.getBrandList()
  126. },
  127. methods: {
  128. // 获取奖励明细
  129. data() {
  130. uni.showLoading({
  131. title: '加载中...'
  132. });
  133. request({
  134. url: '/myPage/getPageScanRewordList',
  135. method: 'post',
  136. data: {
  137. storeId: this.$store.state.storeInfo.storeId,
  138. userId: this.$store.state.storeInfo.userId,
  139. searchKey: this.input,
  140. current: this.current1,
  141. size: '10',
  142. brandCode: this.label,
  143. startTime: this.startTime,
  144. endTime: this.endTime
  145. }
  146. }).then(res => {
  147. this.count = res.data.count
  148. this.datalist = this.datalist.concat(res.data.data)
  149. // 判断扫码类型
  150. for (var i = 0; i < res.data.data.length; i++) {
  151. if (res.data.data[i].getWay == 0) {
  152. this.getWay = "门店扫码"
  153. } else {
  154. this.getWay = "车主扫码"
  155. }
  156. }
  157. }).catch(err => {
  158. })
  159. .finally(() => {
  160. uni.hideLoading();
  161. this.loading = false;
  162. })
  163. },
  164. calendar() {
  165. },
  166. // 全部事件
  167. whole() {
  168. this.datalist = []
  169. this.label=null
  170. this.startTime =null
  171. this.endTime =null
  172. this.bottoma = true
  173. this.bottomb = false
  174. this.bottomc = false
  175. this.current1 = 1
  176. this.data()
  177. },
  178. // 品牌事件
  179. brand() {
  180. this.showBrand = true
  181. this.bottomb = true
  182. this.bottoma = false
  183. this.bottomc = false
  184. },
  185. // 时间事件
  186. time_s() {
  187. this.showDate = true
  188. this.bottoma = false
  189. this.bottomc = true
  190. this.bottomb = false
  191. },
  192. // 时间选择器获取时间
  193. changetime(e) {
  194. this.current1 = 1
  195. this.startTime = e.startDate + ' 00:00:00'
  196. this.endTime = e.endDate + ' 23:59:59'
  197. this.datalist = []
  198. uni.showLoading({
  199. title: '加载中...'
  200. });
  201. this.data()
  202. },
  203. // 获取品牌列表
  204. getBrandList() {
  205. request({
  206. url: '/baseReq/getBrandListByStoreId',
  207. method: 'post',
  208. data: {
  209. storeId: this.$store.state.storeInfo.storeId,
  210. userId: this.$store.state.storeInfo.userId
  211. }
  212. }).then(res => {
  213. this.brandList = JSON.parse(JSON.stringify(res.data.data))
  214. for (var i = 0; i < this.brandList.length; i++) {
  215. this.list_a.push({
  216. brandCode: this.brandList[i].brandCode,
  217. text: this.brandList[i].brandName,
  218. color: '#000',
  219. fontSize: 28
  220. })
  221. }
  222. }).catch(err => {
  223. })
  224. .finally(() => {
  225. setTimeout(() => {
  226. uni.hideLoading();
  227. this.loading = false;
  228. }, 1000)
  229. })
  230. },
  231. // 搜索框
  232. handleSearch(e) {
  233. this.datalist = []
  234. this.current1=1
  235. this.data()
  236. },
  237. // 点击获取品牌
  238. click(e) {
  239. this.datalist = []
  240. this.label = this.list_a[e].text
  241. this.data()
  242. },
  243. // 点击取消按钮
  244. close() {
  245. this.whole()
  246. },
  247. change(index) {
  248. this.current = index;
  249. if (this.current == 1) {
  250. this.showBrand = true
  251. this.datalist = []
  252. } else if (this.current == 2) {
  253. this.showDate = true
  254. this.datalist = []
  255. }
  256. this.current1 = 1
  257. this.datalist = []
  258. this.data()
  259. }
  260. },
  261. onReachBottom() {
  262. this.current1++
  263. this.status = 'loading';
  264. if (this.datalist.length >= this.count) {
  265. this.status = 'nomore';
  266. } else {
  267. this.data()
  268. }
  269. }
  270. }
  271. </script>
  272. <style lang="scss" scoped>
  273. .header {
  274. height: 400rpx;
  275. width: 100%;
  276. background: #0094FE;
  277. color: #fff;
  278. font-size: 28rpx;
  279. }
  280. .header-one {
  281. text-align: center;
  282. padding-top: 10rpx;
  283. }
  284. .header-one>text {
  285. font-size: 52rpx;
  286. }
  287. .content {
  288. display: flex;
  289. justify-content: space-between;
  290. width: 700rpx;
  291. margin-top: 80rpx;
  292. }
  293. .content-one {
  294. width: 690rpx;
  295. height: 315rpx;
  296. background: #FFFFFF;
  297. box-shadow: 0px 0px 24px 0px rgba(101, 176, 249, 0.41);
  298. border-radius: 20rpx;
  299. margin: 0 auto;
  300. margin-top: 30rpx;
  301. }
  302. .content-one-view {
  303. width: 6rpx;
  304. height: 30rpx;
  305. background: #0292FD;
  306. position: relative;
  307. top: 20rpx;
  308. left: 30rpx;
  309. }
  310. .content-one-text {
  311. // position: relative;
  312. // top: -8rpx;
  313. // left: 60rpx;
  314. margin-left: 50rpx;
  315. margin-top: -14rpx;
  316. font-size: 30rpx;
  317. font-weight: bold;
  318. color: #000;
  319. }
  320. .content-one-time {
  321. position: relative;
  322. top: -40rpx;
  323. left: 530rpx;
  324. font-size: 13rpx;
  325. color: #626262;
  326. }
  327. .content-two {
  328. display: flex;
  329. justify-content: space-between;
  330. font-size: 26rpx;
  331. color: #6A6A6A;
  332. margin-top: 25rpx;
  333. margin-left: 30rpx;
  334. margin-right: 30rpx;
  335. }
  336. </style>