activity.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="content">
  3. <no-none v-if='list.length<=0'></no-none>
  4. <block v-else>
  5. <view @click="enit(item.id)" style="margin-top: 30rpx;" class="item" v-for="(item,index) of list" :key='index'>
  6. <view class="border-b item-title flex-y-center">
  7. <view class="item-type flex-center" :class="item.type=='实体大转盘'?'item-type-one':item.type=='大转盘'?'item-type-one':'item-type-two'">
  8. {{item.type}}
  9. </view>
  10. <text>{{item.title}}</text>
  11. </view>
  12. <view class="item-bottom flex-y-center">
  13. <view class="flex-grow-1">
  14. <view class="box-pack-between item-bottom-right">
  15. <text><text class="item-bottom-number">奖品数量</text>:{{item.num}}</text>
  16. </view>
  17. <view class="box-pack-between item-bottom-right">
  18. <text><text class="item-bottom-number">活动说明</text>:{{item.explain}}</text>
  19. </view>
  20. <view class="box-pack-between item-bottom-right flex-y-center">
  21. <text><text class="item-bottom-number">活动时间</text>:{{item.start_time}}~{{item.end_time}}
  22. </text>
  23. <text class="iconfont icongengduo"></text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </block>
  29. <view style="height: 75px;"></view>
  30. <navigator style="margin-bottom:0" url='./add' class="bottom-bar flex-center">
  31. <button formType="submit" class="flex-center ft28">+新增活动</button>
  32. </navigator>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. defaultIndex: 0,
  40. list: [],
  41. page: 1,
  42. $test: this.$test.$test,
  43. URL: getApp().globalData.URL,
  44. is_load: false,
  45. }
  46. },
  47. onLoad() {},
  48. onShow() {
  49. this.page = 1;
  50. this.list = [];
  51. this.http();
  52. },
  53. onReachBottom(e) {
  54. if (!this.is_load) {
  55. this.page = this.page + 1;
  56. this.http();
  57. }
  58. },
  59. methods: {
  60. enit(id) {
  61. uni.navigateTo({
  62. url: "./add?id=" + id
  63. })
  64. },
  65. previewImg(logourl) {
  66. let URL = this.URL + logourl;
  67. uni.previewImage({
  68. urls: [URL]
  69. });
  70. },
  71. bindDetail(index) {
  72. uni.setStorageSync("shake-key", this.list[index])
  73. uni.navigateTo({
  74. url: "./detail?id=" + id
  75. })
  76. },
  77. http() {
  78. let url = "lottery/lists";
  79. this.request({
  80. url,
  81. data: {
  82. token: uni.getStorageSync("token"),
  83. page: this.page,
  84. limit: 10,
  85. },
  86. showLoading:true,
  87. }).then(res => {
  88. console.log(res, "res")
  89. if (res.code === "200") {
  90. this.list = this.list.concat(res.data.list);
  91. res.data.list.length == 0 ? (this.is_load = true) : (this.is_load = false)
  92. }
  93. });
  94. },
  95. },
  96. }
  97. </script>
  98. <style lang="scss">
  99. page {
  100. background: #F5F7FA;
  101. }
  102. .item {
  103. width: 690rpx;
  104. background: #ffffff;
  105. margin: 0 auto;
  106. padding: 0rpx 24rpx;
  107. opacity: 1;
  108. border-radius: 8rpx;
  109. box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(213, 213, 213, 0.04);
  110. .item-title {
  111. opacity: 1;
  112. font-size: 28rpx;
  113. font-family: PingFang SC, PingFang SC-Medium;
  114. font-weight: 500;
  115. color: #333333;
  116. padding: 24rpx 0;
  117. .item-type {
  118. margin-right: 16rpx;
  119. // width: 78rpx;
  120. height: 36rpx;
  121. font-size: 21rpx;
  122. opacity: 1;
  123. border-radius: 4rpx;
  124. color: #FFFFFF;
  125. padding: 0 10rpx;
  126. border-bottom: 1rpx solid #F1F1F1;
  127. }
  128. .item-type-one {
  129. background: linear-gradient(134deg, #FF8C1A 2%, #FF8C1A 98%);
  130. }
  131. .item-type-two {
  132. background: linear-gradient(134deg, #f06767 2%, #f58484 98%);
  133. }
  134. .item-type-three {
  135. background: linear-gradient(134deg, #febe07 2%, #ffcc3e 98%);
  136. }
  137. }
  138. .item-bottom {
  139. font-size: 26rpx;
  140. padding: 20rpx 0 10rpx 0;
  141. color: #666666;
  142. .item-bottom-left {
  143. width: 90rpx;
  144. height: 90rpx;
  145. margin-right: 24rpx;
  146. min-width: 90rpx;
  147. margin-bottom: 16rpx;
  148. }
  149. .item-bottom-right {
  150. margin-bottom: 16rpx;
  151. .item-bottom-number {
  152. color: #99A0AD;
  153. }
  154. }
  155. }
  156. }
  157. .icongengduo {
  158. color: #999;
  159. font-size: 28rpx;
  160. }
  161. .bottom-bar {
  162. position: fixed;
  163. bottom: 0px;
  164. width: 100%;
  165. z-index: 1000;
  166. background: #FFFFFF;
  167. padding: 30rpx 0;
  168. }
  169. .bottom-bar button {
  170. text-align: center;
  171. width: 690rpx;
  172. height: 90rpx;
  173. background: linear-gradient(132deg, #3387FF 0%, #3387FF 100%);
  174. box-shadow: 0px 2rpx 12rpx #3387FF;
  175. opacity: 1;
  176. border-radius: 10rpx;
  177. color: #fff;
  178. }
  179. .label {
  180. min-width: 90rpx;
  181. height: 44rpx;
  182. line-height: 44rpx;
  183. padding: 0 10rpx;
  184. color: #FFFFFF;
  185. font-size: 24rpx;
  186. background-color: #1E9FFF;
  187. margin-left: 20rpx;
  188. text-align: center;
  189. }
  190. </style>