checkIn-popUp-window.vue 9.5 KB

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