sigin-in.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view>
  3. <view class="sign_conent_box">
  4. <view class="sign_conent">
  5. <view class="sign_conent_title">
  6. 你已连续签到
  7. <span class="sign_conent_title_span">{{qdjl}}</span>
  8. 天
  9. </view>
  10. <view class="ft12 mt10" style="color: #999;">签到领看币,新剧抢先看。连续签到7天领惊喜礼包</view>
  11. <view class="sign_list_aligns">
  12. <scroll-view class="scroll-view_H" scroll-x="true">
  13. <view class="scroll_view_items" v-for="(item, index) in sign_list" :key="index">
  14. <!-- -->
  15. <view class="scroll_view_itemsv">
  16. <view class="scroll_view_item">
  17. <view class="scroll_view_item_img_box">
  18. <image v-if="item.xz==2" :src="statics.xuanzhong" class="scroll_view_item_img" mode=""></image>
  19. <image v-if="item.xz==1" :src="statics.yuanq" class="scroll_view_item_img" mode=""></image>
  20. <view v-if="item.xz==1" class="scroll_view_item_top">{{ item.discount }}</view>
  21. </view>
  22. <view class="scroll_view_item_tips">{{ item.day }}</view>
  23. </view>
  24. <view class="scroll_xian" v-show="index !== sign_list.length - 1"></view>
  25. </view>
  26. </view>
  27. </scroll-view>
  28. </view>
  29. <view class="sign_conent_btn" @click="cksigin()">今日签到</view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. props: {
  37. sign_list: {},
  38. qdjl: 0,
  39. tdsy: 0,
  40. },
  41. data() {
  42. return {};
  43. },
  44. methods: {
  45. cksigin() {
  46. if(uni.getStorageSync("userinfo")){
  47. let this_=this
  48. let data = {};
  49. data.tdsy=this.tdsy
  50. data.token = uni.getStorageSync("userinfo").token
  51. data.uid = uni.getStorageSync("userinfo").id
  52. uni.request({
  53. url: this.configs.webUrl+'/api/user/qingdao',
  54. data: data,
  55. success: data => {
  56. uni.showModal({
  57. title: '温馨提示',
  58. content: data.data.msg,
  59. showCancel: false,
  60. success: res => {
  61. if(data.data.code==1){
  62. this_.$emit('cksigin')
  63. }
  64. }
  65. });
  66. },
  67. fail: (data, code) => {
  68. }
  69. });
  70. }else{
  71. uni.showModal({
  72. title: '温馨提示',
  73. content: '请先登录',
  74. showCancel: true,
  75. confirmText: "登录",
  76. success: function (res) {
  77. if (res.confirm) {
  78. uni.navigateTo({
  79. url:'/pages/login/login'
  80. })
  81. } else if (res.cancel) {
  82. //uni.navigateBack();
  83. }
  84. }
  85. });
  86. }
  87. },
  88. }
  89. };
  90. </script>
  91. <style lang="scss">
  92. .sign_conent_box {
  93. width: 100%;
  94. display: flex;
  95. justify-content: center;
  96. margin-top: 30upx;
  97. .sign_conent {
  98. width: 686upx;
  99. // background: white;
  100. // border-radius: 20upx;
  101. padding: 0upx 0upx;
  102. box-sizing: border-box;
  103. .sign_conent_title {
  104. width: 100%;
  105. font-size: 36upx;
  106. font-weight: bold;
  107. color: #333333;
  108. .sign_conent_title_span {
  109. color: #ff6526 !important;
  110. }
  111. }
  112. .sign_list_aligns {
  113. width: 100%;
  114. padding: 30upx 0 30upx 0;
  115. box-sizing: border-box;
  116. .scroll-view_H {
  117. width: 100%;
  118. display: flex;
  119. white-space: nowrap;
  120. .scroll_view_items {
  121. display: inline-block;
  122. }
  123. .scroll_view_itemsv {
  124. display: flex;
  125. }
  126. .scroll_view_item {
  127. .scroll_view_item_img_box {
  128. width: 60upx;
  129. height: 30upx;
  130. position: relative;
  131. .scroll_view_item_top {
  132. font-size: 24upx;
  133. color: #bfbfbf;
  134. // font-weight: bold;
  135. position: absolute;
  136. top: 14upx;
  137. width: 100%;
  138. text-align: center;
  139. z-index: 1;
  140. }
  141. .scroll_view_item_bottom {
  142. font-size: 12upx;
  143. color: #ffe29d;
  144. position: absolute;
  145. bottom: 18upx;
  146. left: 42upx;
  147. z-index: 2;
  148. }
  149. }
  150. .scroll_view_item_tips {
  151. width: 60upx;
  152. text-align: center;
  153. font-size: 24upx;
  154. padding-top: 40upx;
  155. color: #333333;
  156. }
  157. .scroll_view_item_img {
  158. width: 60upx;
  159. height: 60upx;
  160. position: absolute;
  161. top: 0;
  162. left: 0;
  163. z-index: 0;
  164. }
  165. }
  166. .scroll_xian {
  167. width: 40upx;
  168. height: 4upx;
  169. background: #bfbfbf;
  170. margin-top: 30upx;
  171. }
  172. }
  173. }
  174. .sign_conent_btn {
  175. width: 100%;
  176. border-radius: 45upx;
  177. background: linear-gradient(270deg, #fcae3a 0%, #f15d25 100%);
  178. color: #ffffff;
  179. text-align: center;
  180. padding: 22upx 0;
  181. font-size: 32upx;
  182. }
  183. }
  184. }
  185. </style>