redPacket.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view class="content">
  3. <view class="header-img">
  4. <u-image src="/static/hbheader.jpg" width="750" height="578"></u-image>
  5. <!-- 滚动区域 -->
  6. <view class="scroll-list" v-if="slist.length">
  7. <scrollBox :list="slist" placeText="刚刚得到了1.5元 红包奖励" bgColor="rgba(250, 224, 188, 0.6)"></scrollBox>
  8. </view>
  9. <view class="amount-box">
  10. 345.5
  11. <text>元</text>
  12. </view>
  13. <view class="view-gz" @click="showModal = true">查看活动规则>></view>
  14. </view>
  15. <view class="list-box">
  16. <view class="codes flex align_center">
  17. <view @click="openImg('/static/codetemp.jpg')">
  18. <u-image src="/static/codetemp.jpg" width="160" height="160"></u-image>
  19. </view>
  20. <view>
  21. <view>扫描添加客服微信,领取待发放红包</view>
  22. <view>点击二维码查看大图,长按识别二维码</view>
  23. </view>
  24. </view>
  25. <view class="tabbox">
  26. <view class="tabhead flex align_center justify_between">
  27. <view :class="curTab==0?'active':''" @click="tabChange(0)">所有红包</view>
  28. <view :class="curTab==1?'active':''" @click="tabChange(1)">已发红包</view>
  29. <view :class="curTab==2?'active':''" @click="tabChange(2)">待发红包</view>
  30. </view>
  31. <swiper class="tablist">
  32. <swiper-item class="swiper-item" style="height: 100%;width: 100%;overflow: hidden;">
  33. <scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom">
  34. <view class="totalBar" v-if="curTab==1">共<text>20</text>个红包,合计<text>200</text>元</view>
  35. <view class="flex align_center justify_between itemlist" v-for="item in 12">
  36. <view class="flex align_center">
  37. <view class="imgs">
  38. <u-icon size="30" color="#fff" name="red-packet"></u-icon>
  39. </view>
  40. <view class="txts">
  41. <view class="txts-name">扫描VIN码下单得红包</view>
  42. <view class="txts-time">2022-10-28 12:36</view>
  43. </view>
  44. </view>
  45. <view class="amount">+0.50</view>
  46. </view>
  47. <view style="padding: 20upx;">
  48. <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  49. <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
  50. </view>
  51. </scroll-view>
  52. </swiper-item>
  53. </swiper>
  54. </view>
  55. </view>
  56. <!-- 活动规则 -->
  57. <u-popup v-model="showModal" closeable mode="center" border-radius="15" width="600rpx">
  58. <view style="padding: 20rpx;">
  59. <view style="text-align: center;padding: 20rpx 0pt;">活动规则</view>
  60. <view style="font-weight: bold;">【活动时间】</view>
  61. <view style="padding: 10rpx 20rpx;">即日起—2022年12月31日</view>
  62. <view style="font-weight: bold;">【活动内容】</view>
  63. <view style="padding: 10rpx 20rpx;">活动期间,凡是通过店内易码通货架取货和小程序下单的用户,即可获得最高百元现金红包。</view>
  64. <view style="font-weight: bold;">【领取方式】</view>
  65. <view style="padding: 10rpx 20rpx;">在活动页面,扫码或添加客服微信号,发送“姓名+修理厂名称+手机号+提现金额”,客服会在收到信息后1-3个工作日内,以微信红包的形式发放现金红包,您可在“已发放”“待发放”中查看红包金额。</view>
  66. <view style="font-weight: bold;">【注意】</view>
  67. <view style="padding: 10rpx 20rpx;">1.退货或已取消的订单不可领取红包;</view>
  68. <view style="padding: 10rpx 20rpx;">2.红包不可转让或为他人付款;</view>
  69. <view style="padding: 10rpx 20rpx;">3.活动仅限实名认证用户才能参与,因微信账号非实名导致用户无法收到和领取红包的,请联系腾讯客服完成实名认证;</view>
  70. <view style="padding: 10rpx 20rpx;">4.该活动最终解释权归广东易码通数字科技有限公司所有。</view>
  71. <view style="font-weight: bold;">【声明】</view>
  72. <view style="padding: 10rpx 20rpx;">广东易码通数字科技有限公司不会以任何理由向用户所要身份证、银行卡账户和密码等相关信息,请注意保护个人隐私。</view>
  73. </view>
  74. </u-popup>
  75. </view>
  76. </template>
  77. <script>
  78. import scrollBox from '@/components/scrollBox.vue'
  79. import { findUserReward, getRewardOrderList, getRewardRollList } from '@/api/rewardRule.js'
  80. export default {
  81. components: {
  82. scrollBox,
  83. },
  84. data() {
  85. return {
  86. showModal: false,
  87. rewardData: null, // 奖励信息
  88. slist:[],
  89. status: 'loading',
  90. noDataText: '暂无红包数据',
  91. pageNo: 1,
  92. pageSize: 30,
  93. total: 0,
  94. rewardStatus: ['','paid','un_paid'], //un_paid 未发放,paid 已发放
  95. list: [],
  96. curTab:'0'
  97. }
  98. },
  99. onLoad(){
  100. this.getScrollLog()
  101. this.getUserReward()
  102. this.getEwardOrder()
  103. },
  104. methods: {
  105. openImg(url){
  106. uni.previewImage({
  107. urls:[url]
  108. })
  109. },
  110. // 活动奖励信息
  111. getUserReward(){
  112. findUserReward().then(res => {
  113. this.rewardData = res.data
  114. })
  115. },
  116. tabChange(i){
  117. this.curTab = i
  118. this.getEwardOrder(1)
  119. },
  120. // 查询列表
  121. getEwardOrder (pageNo) {
  122. let _this = this
  123. if (pageNo) {
  124. this.pageNo = pageNo
  125. }
  126. // 状态条件
  127. let params = {
  128. pageNo: this.pageNo,
  129. pageSize: this.pageSize,
  130. rewardStatus: this.rewardStatus[this.curTab]
  131. }
  132. this.status = "loading"
  133. getRewardOrderList(params).then(res => {
  134. if (res.code == 200 || res.status == 204 || res.status == 200) {
  135. if(_this.pageNo>1){
  136. _this.list = _this.list.concat(res.data.list || [])
  137. }else{
  138. _this.list = res.data.list || []
  139. }
  140. _this.total = res.data.count || 0
  141. } else {
  142. _this.list = []
  143. _this.total = 0
  144. _this.noDataText = res.message
  145. }
  146. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  147. })
  148. },
  149. // scroll-view到底部加载更多
  150. onreachBottom() {
  151. if(this.list.length < this.total){
  152. this.pageNo += 1
  153. this.getEwardOrder()
  154. }else{
  155. this.status = "nomore"
  156. }
  157. },
  158. // 获取上方滚动扫描记录
  159. getScrollLog(){
  160. getRewardRollList({pageNo:1,pageSize:1000}).then(res => {
  161. this.slist = res.data.list || []
  162. this.slist.map(item => {
  163. item.placeText = item.userName + '刚刚得到了1.5元 红包奖励'
  164. })
  165. })
  166. },
  167. }
  168. }
  169. </script>
  170. <style lang="less">
  171. .content{
  172. padding: 0;
  173. background-color: #fae0bc;
  174. .header-img{
  175. position: relative;
  176. color: #fff;
  177. .amount-box{
  178. position: absolute;
  179. width: 100%;
  180. text-align: center;
  181. font-size: 80rpx;
  182. text{
  183. font-size: 40rpx;
  184. }
  185. top: 50%;
  186. color: #f5563d;
  187. }
  188. .view-gz{
  189. position: absolute;
  190. width: 100%;
  191. text-align: center;
  192. bottom: 45rpx;
  193. font-size: 30rpx;
  194. }
  195. .scroll-list{
  196. width:100%;
  197. position: absolute;
  198. left:10rpx;
  199. top:0;
  200. }
  201. }
  202. .list-box{
  203. padding: 30rpx;
  204. .codes{
  205. margin-bottom: 40rpx;
  206. > view{
  207. &:first-child{
  208. padding: 10rpx;
  209. background-color: #fff;
  210. }
  211. &:last-child{
  212. padding: 0 20rpx;
  213. > view{
  214. padding: 10rpx 0;
  215. font-size: 26rpx;
  216. }
  217. }
  218. }
  219. }
  220. .tabbox{
  221. background-color: #fff5e7;
  222. box-shadow: 0 0 10rpx #e75115;
  223. border-radius: 15rpx;
  224. .tabhead{
  225. border-bottom: 1rpx solid #f0b675;
  226. > view{
  227. width: 30%;
  228. color: #5a4f49;
  229. padding: 20rpx 0;
  230. text-align: center;
  231. }
  232. .active{
  233. color: #e7463c;
  234. border-bottom: 4rpx solid #e7463c;
  235. font-weight: bold;
  236. }
  237. }
  238. .tablist{
  239. height: 70vh;
  240. padding: 20rpx 0;
  241. .itemlist{
  242. border-bottom: 1rpx solid #fff;
  243. padding: 20rpx 30rpx;
  244. .txts-name{
  245. color: #e7463c;
  246. }
  247. .txts-time{
  248. font-size: 24rpx;
  249. color: #666;
  250. margin-top: 10rpx;
  251. }
  252. .amount{
  253. color: #e7463c;
  254. font-weight: bold;
  255. font-size: 32rpx;
  256. }
  257. }
  258. .txts{
  259. padding:0 20rpx;
  260. }
  261. .imgs{
  262. background-color: #fe9790;
  263. border-radius: 100rpx;
  264. padding: 10rpx;
  265. width: 50rpx;
  266. height: 50rpx;
  267. text-align: center;
  268. }
  269. }
  270. .totalBar{
  271. background-color: #fff;
  272. padding: 10rpx 20rpx;
  273. border-radius: 60rpx;
  274. margin: 0 30rpx;
  275. color: #e7463c;
  276. }
  277. }
  278. }
  279. }
  280. </style>