checkIn-popUp-window.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. <template>
  2. <uv-popup ref="popup" mode="bottom" bgColor="none">
  3. <view class="content-box">
  4. <image class="close" @click="close()" src="@/static/me/job/rw_icon_guanbi.png"></image>
  5. <view class="bottomCompatibility">
  6. <view class="left-title">
  7. <image src="@/static/me/job/rw_wenzi_03.png"></image>
  8. <view class="checkInDays">
  9. <view>已签到 {{ signInfo.signDay }} 天
  10. <view class="line"></view> 签到提醒
  11. </view>
  12. <!-- <switch class="sign-switch" color="" :checked="signNotify" /> -->
  13. <!-- signNotify -->
  14. <uv-switch v-model="falg" size="30rpx" @change="toggleSignNotify" activeColor="#acf934"
  15. inactiveColor="#aecc87"></uv-switch>
  16. </view>
  17. </view>
  18. <view class="checkInContent">
  19. <view class="horizontal-box" v-for="(row, rowIndex) in signRewards" :key="rowIndex">
  20. <view v-for="(item, index) in row" :key="index" class="item-box" :class="[
  21. `item-box${item.id}`,
  22. item.type === 'one' ? 'item-box-one' : 'item-box-two',
  23. signInfo.signDay + 1 == item.day ? 'active' : '',
  24. signInfo.signDay >= item.day ? 'receivedIt' : '',
  25. ]">
  26. <view class="mask"></view>
  27. <view class="days"> {{ item.day }}天 </view>
  28. <view class="content" v-if="item.id !== 7">
  29. <image :src="getImagePath(item.icon)"></image>
  30. <view class="tit one-omit">{{ item.title }}</view>
  31. </view>
  32. <view v-else class="itemBox7Content">
  33. <view class="content" v-for="(subItem, subIndex) in item.items" :key="subIndex">
  34. <image :src="getImagePath(subItem.icon)"></image>
  35. <view class="tit one-omit">{{ subItem.title }}</view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view v-if="signInfo.signDay == 7" class="receiveBtn" @click="confirmSign(3)">
  42. 本周奖励全部领取
  43. </view>
  44. <view v-else-if="signInfo.isSigned" class="receiveBtn" @click="confirmSign(1)">
  45. 今日已签到
  46. </view>
  47. <view v-else class="receiveBtn" @click="confirmSign(2)">
  48. 签到领取奖励
  49. </view>
  50. </view>
  51. </view>
  52. </uv-popup>
  53. </template>
  54. <script>
  55. import uvPopup from "@/uni_modules/uv-popup/components/uv-popup/uv-popup.vue";
  56. export default {
  57. name: "checkInPopUpWindow",
  58. components: {
  59. uvPopup,
  60. },
  61. data() {
  62. return {
  63. falg: this.signNotify,
  64. signRewards: [
  65. [
  66. {
  67. id: 1,
  68. day: 1,
  69. type: "one",
  70. icon: "wd_icon_xingyuan.png",
  71. title: "海浪操作作秀",
  72. },
  73. {
  74. id: 2,
  75. day: 2,
  76. type: "one",
  77. icon: "wd_icon_xingyuan(1).png",
  78. title: "红玫瑰x3",
  79. },
  80. {
  81. id: 3,
  82. day: 3,
  83. type: "two",
  84. icon: "wd_icon_xingyuan.png",
  85. title: "海浪操作作秀",
  86. },
  87. ],
  88. [
  89. {
  90. id: 4,
  91. day: 6,
  92. type: "two",
  93. icon: "wd_icon_xingyuan(4).png",
  94. title: "樱花x3",
  95. },
  96. {
  97. id: 5,
  98. day: 5,
  99. type: "one",
  100. icon: "wd_icon_xingyuan(5).png",
  101. title: "海浪头像框",
  102. },
  103. {
  104. id: 6,
  105. day: 4,
  106. type: "one",
  107. icon: "wd_icon_xingyuan(1).png",
  108. title: "红玫瑰x3",
  109. },
  110. ],
  111. [
  112. {
  113. id: 7,
  114. day: 7,
  115. type: "one",
  116. items: [
  117. { icon: "wd_icon_xingyuan(1).png", title: "红玫瑰x3" },
  118. { icon: "wd_icon_xingyuan(4).png", title: "红玫瑰x3" },
  119. { icon: "wd_icon_xingyuan.png", title: "红玫瑰x3" },
  120. { icon: "wd_icon_xingyuan(1).png", title: "红玫瑰x3" },
  121. ],
  122. },
  123. ],
  124. ],
  125. };
  126. },
  127. props: {
  128. signInfo: {
  129. type: Object,
  130. default: () => { },
  131. },
  132. checkInDays: {
  133. type: Number || String,
  134. default: 1,
  135. },
  136. signNotify: {
  137. type: Boolean,
  138. default: true,
  139. },
  140. },
  141. methods: {
  142. open() {
  143. this.$refs.popup.open();
  144. },
  145. close() {
  146. this.$refs.popup.close();
  147. },
  148. toggleSignNotify(e) {
  149. this.$emit("toggleSignNotify", e);
  150. },
  151. confirmSign(type) {
  152. this.$emit("confirmSign", type);
  153. },
  154. getImagePath(iconName) {
  155. return `../../static/me/job/${iconName}`;
  156. },
  157. },
  158. };
  159. </script>
  160. <style scoped lang="scss">
  161. /* 添加样式 */
  162. .bottomCompatibility {
  163. height: --window-bottom;
  164. position: relative;
  165. left: 0;
  166. top: 0;
  167. }
  168. .content-box {
  169. min-height: 982rpx;
  170. background: url("@/static/me/job/rw_bg_tanchuang.png") top center / 100% auto no-repeat,
  171. linear-gradient(to bottom,
  172. rgba(0, 0, 0, 0) 0%,
  173. rgba(0, 0, 0, 0) 50%,
  174. #f1ffe5 50%,
  175. #f1ffe5 100%);
  176. box-sizing: border-box;
  177. padding: 30rpx;
  178. padding-top: 136rpx;
  179. .close {
  180. position: absolute;
  181. top: 6rpx;
  182. right: 30rpx;
  183. width: 54rpx;
  184. height: 54rpx;
  185. }
  186. .left-title {
  187. width: 360rpx;
  188. height: 142rpx;
  189. padding-bottom: 32rpx;
  190. image {
  191. width: 376rpx;
  192. height: 58rpx;
  193. }
  194. .checkInDays {
  195. display: flex;
  196. align-items: center;
  197. justify-content: space-between;
  198. margin-top: 20rpx;
  199. font-size: 28rpx;
  200. color: #333333;
  201. >view {
  202. display: flex;
  203. align-items: center;
  204. font-weight: 400;
  205. font-size: 28rpx;
  206. color: #8f9c78;
  207. font-family: PingFang SC-Medium;
  208. .line {
  209. width: 2rpx;
  210. height: 30rpx;
  211. background: #d9d9d9;
  212. display: inline-block;
  213. margin: 0 12rpx;
  214. }
  215. }
  216. }
  217. }
  218. .checkInContent {
  219. width: 100%;
  220. height: 560rpx;
  221. .horizontal-box {
  222. width: 100%;
  223. height: 192rpx;
  224. display: flex;
  225. align-items: start;
  226. justify-content: space-between;
  227. }
  228. .item-box {
  229. display: inline-block;
  230. background: #000;
  231. position: relative;
  232. left: 0;
  233. top: 0;
  234. padding-top: 30rpx;
  235. padding-bottom: 12rpx;
  236. box-sizing: border-box;
  237. .mask{
  238. position: absolute;
  239. top: 0;
  240. left: 0;
  241. width: 100%;
  242. height: 100%;
  243. z-index: 10;
  244. display: none;
  245. }
  246. &.receivedIt {
  247. .mask{
  248. display: block;
  249. }
  250. }
  251. .days {
  252. font-weight: 700;
  253. font-size: 18px;
  254. color: #8cd914;
  255. font-family: "Alimama ShuHeiTi-Bold";
  256. position: absolute;
  257. top: 8rpx;
  258. left: 18rpx;
  259. }
  260. .content {
  261. width: 100%;
  262. height: 100%;
  263. display: flex;
  264. align-items: center;
  265. justify-content: center;
  266. flex-direction: column;
  267. image {
  268. width: 76rpx;
  269. height: 76rpx;
  270. }
  271. .tit {
  272. max-width: 140rpx;
  273. display: inline-block;
  274. font-family: "PingFang SC-Medium";
  275. font-weight: 400;
  276. font-size: 28rpx;
  277. color: #2a3518;
  278. margin-top: 12rpx;
  279. text-align: center;
  280. }
  281. }
  282. .itemBox7Content {
  283. display: flex;
  284. align-items: center;
  285. }
  286. &.active {
  287. .days {
  288. color: #fff;
  289. }
  290. .content {
  291. .tit {
  292. color: #fff;
  293. }
  294. }
  295. }
  296. }
  297. .item-box-one {
  298. width: 226rpx;
  299. height: 172rpx;
  300. }
  301. .item-box-two {
  302. width: 212rpx;
  303. height: 188rpx;
  304. }
  305. .item-box1 {
  306. background: url("@/static/me/job/rw_bg_jiangli01_moren.png") center / 100% no-repeat;
  307. .mask{
  308. background: url("@/static/me/job/rw_bg_jiangli01_zhezhao.png") center / 100% no-repeat;
  309. }
  310. &.active {
  311. background: url("@/static/me/job/rw_bg_jiangli01_dianji.png") center / 100% no-repeat;
  312. transform: scale(1.07);
  313. }
  314. }
  315. .item-box2 {
  316. background: url("@/static/me/job/rw_bg_jiangli02_moren.png") center / 100% no-repeat;
  317. .mask{
  318. background: url("@/static/me/job/rw_bg_jiangli02_zhezhao.png") center / 100% no-repeat;
  319. }
  320. &.active {
  321. background: url("@/static/me/job/rw_bg_jiangli02_dianji.png") center / 100% no-repeat;
  322. transform: scale(1.07);
  323. }
  324. }
  325. .item-box3 {
  326. background: url("@/static/me/job/rw_bg_jiangli03_moren.png") center / 100% no-repeat;
  327. .mask{
  328. background: url("@/static/me/job/rw_bg_jiangli03_zhezhao.png") center / 100% no-repeat;
  329. }
  330. &.active {
  331. background: url("@/static/me/job/rw_bg_jiangli03_dianji.png") center / 100% no-repeat;
  332. transform: scale(1.07);
  333. }
  334. }
  335. .item-box4 {
  336. background: url("@/static/me/job/rw_bg_jiangli04_moren.png") center / 100% no-repeat;
  337. .mask{
  338. background: url("@/static/me/job/rw_bg_jiangli04_zhezhao.png") center / 100% no-repeat;
  339. }
  340. &.active {
  341. background: url("@/static/me/job/rw_bg_jiangli04_dianji.png") center / 100% no-repeat;
  342. transform: scale(1.07);
  343. }
  344. }
  345. .item-box5 {
  346. background: url("@/static/me/job/rw_bg_jiangli05_moren.png") center / 100% no-repeat;
  347. .mask{
  348. background: url("@/static/me/job/rw_bg_jiangli05_zhezhao.png") center / 100% no-repeat;
  349. }
  350. &.active {
  351. background: url("@/static/me/job/rw_bg_jiangli05_dianji.png") center / 100% no-repeat;
  352. transform: scale(1.07);
  353. }
  354. }
  355. .item-box6 {
  356. background: url("@/static/me/job/rw_bg_jiangli06_moren.png") center / 100% no-repeat;
  357. .mask{
  358. background: url("@/static/me/job/rw_bg_jiangli06_zhezhao.png") center / 100% no-repeat;
  359. }
  360. &.active {
  361. background: url("@/static/me/job/rw_bg_jiangli06_dianji.png") center / 100% no-repeat;
  362. transform: scale(1.07);
  363. }
  364. }
  365. .item-box7 {
  366. width: 100%;
  367. .mask{
  368. background: url("@/static/me/job/rw_bg_jiangli07_zhezhao.png") center / 100% no-repeat;
  369. }
  370. height: 172rpx;
  371. background: url("@/static/me/job/rw_bg_jiangli07_moren.png") center / 100% no-repeat;
  372. display: flex;
  373. align-items: center;
  374. justify-content: center;
  375. .itemBox7Content {
  376. display: flex;
  377. align-items: center;
  378. justify-content: space-between;
  379. width: 540rpx;
  380. }
  381. .tit {
  382. color: #4f3712;
  383. font-size: 28rpx;
  384. width: 130rpx;
  385. }
  386. &.active {
  387. background: url("@/static/me/job/rw_bg_jiangli07_dianji.png") center / 100% no-repeat;
  388. transform: scale(1.01);
  389. .tit {
  390. color: #fff;
  391. }
  392. }
  393. }
  394. }
  395. .receiveBtn {
  396. background: #acf934;
  397. border-radius: 126rpx;
  398. padding: 18rpx 0;
  399. display: flex;
  400. align-items: center;
  401. justify-content: center;
  402. width: 100%;
  403. margin-top: 30rpx;
  404. }
  405. .sign-switch {
  406. transform: scale(0.6);
  407. }
  408. }
  409. </style>