index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <view>
  3. <view class="main_view">
  4. <image v-if="action_info.banner_img" :src="action_info.banner_img" class="banner_img"></image>
  5. <view class="active_title"> 活动内容 </view>
  6. <view class="clockin_box" v-if="active_rule.length > 0">
  7. <view class="box_title"> 邀请好友成功注册,即可获得奖励 </view>
  8. <view class="box_time_text"> 三步奖励到账 </view>
  9. <view class="box_text">
  10. <uni-steps mode="number" deactiveColor="#1aad19" :options="[{ title: '邀请新人好友' }, { title: '好友注册成功' }, { title: '奖励到账' }]" :active="3"></uni-steps>
  11. </view>
  12. <view class="box_time_text"> 活动时间 </view>
  13. <view class="box_time"> {{ action_info.start_time }} 至 {{ action_info.end_time }} </view>
  14. <navigator url="/pages/recruitment/record" class="score_record">我的奖励记录 &gt;</navigator>
  15. <button class="clockin_rule_btn" @click="showRule">活动规则 &gt;</button>
  16. </view>
  17. <view class="clockin_box" v-else>
  18. <view class="box_title"> 暂无拉新活动 </view>
  19. </view>
  20. <uni-popup ref="clockinRule" type="center">
  21. <view class="clockin_rule_box">
  22. <view class="clockin_rule_title">
  23. <text>签到规则</text>
  24. <view class="close_btn" @click="closeRule"> X </view>
  25. </view>
  26. <scroll-view class="clockin_rule_info" scroll-y="true">
  27. <rich-text :nodes="active_rule" class="rich_text"></rich-text>
  28. </scroll-view>
  29. </view>
  30. </uni-popup>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. status_bar_style: {},
  39. action_info: [],
  40. isReqing: false,
  41. listKey: 0,
  42. listLength: 0,
  43. active_id: 0,
  44. active_rule: "",
  45. };
  46. },
  47. onLoad(param) {
  48. // 存储分享标识
  49. if (param.share_uid) {
  50. uni.setStorageSync("share_uid", param.share_uid);
  51. console.log("share_uid", param.share_uid);
  52. }
  53. //分享按钮
  54. uni.showShareMenu({
  55. withShareTicket: true,
  56. menus: ["shareAppMessage", "shareTimeline"],
  57. });
  58. },
  59. onShareAppMessage(obj) {
  60. //获取当前用户信息
  61. let userInfo = uni.getStorageSync("userInfo");
  62. let param = "";
  63. if (userInfo.uid) {
  64. param = "?share_uid=" + userInfo.uid;
  65. }
  66. console.log(222, param);
  67. // 获取分享信息
  68. let shareList = getApp().globalData.shareList;
  69. // 获取分享信息
  70. let shareObj = {
  71. title: "999智控终端平台\n药优惠 得积分 兑豪礼",
  72. path: "/pages/recruitment/index",
  73. imageUrl: "",
  74. };
  75. // 循环列表
  76. for (let i in shareList) {
  77. if (shareList[i].pages == "pages/recruitment/index") {
  78. shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
  79. shareObj.title = shareList[i].title ? `999智控终端平台\n${shareList[i].title}` : shareObj.title;
  80. shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
  81. }
  82. }
  83. if (param) {
  84. shareObj.path += param;
  85. }
  86. // 返回分享信息
  87. return shareObj;
  88. },
  89. onShow() {
  90. // 登录提示
  91. if (!this.$checkAccess.alterLogin()) return;
  92. // 请求中,不允许刷新
  93. if (this.isReqing) return;
  94. // 设置请求中
  95. this.isReqing = true;
  96. // 请求列表
  97. this.$http.request("/api/recruitment/get_info", this.requestParam).then((re) => {
  98. // 设置非请求中
  99. this.isReqing = false;
  100. // 成功结果
  101. if (re.code == "success") {
  102. this.action_info = re.data;
  103. this.active_rule = this.action_info.active_rule;
  104. console.log(this.action_info.length);
  105. }
  106. });
  107. },
  108. methods: {
  109. showRule() {
  110. this.$refs.clockinRule.open("center");
  111. },
  112. closeRule() {
  113. this.$refs.clockinRule.close();
  114. },
  115. },
  116. };
  117. </script>
  118. <style lang="less">
  119. page {
  120. background-color: #ffffff;
  121. }
  122. .main_view {
  123. display: block;
  124. height: 1000rpx;
  125. background: linear-gradient(to bottom, #fc335f 0%, #fb7224 50%, #ffffff 100%);
  126. .banner_img {
  127. height: 450rpx;
  128. width: 100%;
  129. }
  130. .status_bar {
  131. width: 100%;
  132. height: 64rpx;
  133. display: block;
  134. padding-top: var(--status-bar-height);
  135. }
  136. .active_title {
  137. width: 700rpx;
  138. height: 80rpx;
  139. line-height: 80rpx;
  140. text-align: center;
  141. margin: 0rpx auto;
  142. border-radius: 30rpx;
  143. background-color: #f86526;
  144. color: #f9f9f9;
  145. }
  146. .clockin_box {
  147. z-index: 9;
  148. display: block;
  149. width: 700rpx;
  150. margin: 0rpx auto;
  151. position: relative;
  152. border-radius: 40rpx;
  153. background-color: #ffffff;
  154. box-shadow: 5rpx 5rpx 2rpx 0rpx #dddddd;
  155. .box_title {
  156. padding-top: 20rpx;
  157. height: 80rpx;
  158. color: #000000;
  159. text-align: center;
  160. line-height: 80rpx;
  161. }
  162. .box_text {
  163. padding-top: 20rpx;
  164. }
  165. .box_time_text {
  166. padding-top: 40rpx;
  167. text-align: center;
  168. color: #e15c21;
  169. }
  170. .box_time {
  171. padding-top: 20rpx;
  172. text-align: center;
  173. color: #555555;
  174. font-size: 25rpx;
  175. }
  176. .clockin_list {
  177. display: block;
  178. overflow: hidden;
  179. width: 100%;
  180. padding-top: 25rpx;
  181. .clockin_item {
  182. float: left;
  183. position: relative;
  184. width: 70rpx;
  185. height: 165rpx;
  186. text-align: center;
  187. margin-left: 25rpx;
  188. border-radius: 20rpx;
  189. margin-bottom: 20rpx;
  190. background-color: #f8f8f8;
  191. .what_day {
  192. display: block;
  193. height: 40rpx;
  194. font-size: 24rpx;
  195. line-height: 60rpx;
  196. }
  197. .score_one {
  198. display: block;
  199. height: 60rpx;
  200. margin: 10rpx auto;
  201. position: relative;
  202. .score_icon {
  203. display: block;
  204. width: 60rpx;
  205. height: 60rpx;
  206. margin: 0rpx auto;
  207. }
  208. }
  209. .score_tow {
  210. display: block;
  211. height: 80rpx;
  212. margin: 10rpx auto;
  213. position: relative;
  214. .score_icon {
  215. display: block;
  216. width: 80rpx;
  217. height: 80rpx;
  218. margin: 0rpx auto;
  219. }
  220. .score_icon:nth-child(1) {
  221. top: 0rpx;
  222. left: 10rpx;
  223. width: 80rpx;
  224. height: 80rpx;
  225. position: absolute;
  226. }
  227. .score_icon:nth-child(2) {
  228. top: 0rpx;
  229. left: 55rpx;
  230. width: 80rpx;
  231. height: 80rpx;
  232. position: absolute;
  233. }
  234. }
  235. .score_the {
  236. width: 200rpx;
  237. display: block;
  238. height: 100rpx;
  239. margin: 10rpx auto;
  240. position: relative;
  241. .score_icon {
  242. display: block;
  243. width: 80rpx;
  244. height: 80rpx;
  245. margin: 0rpx auto;
  246. }
  247. .score_icon:nth-child(1) {
  248. top: 15rpx;
  249. left: 20rpx;
  250. width: 80rpx;
  251. height: 80rpx;
  252. position: absolute;
  253. }
  254. .score_icon:nth-child(2) {
  255. top: 15rpx;
  256. left: 95rpx;
  257. width: 80rpx;
  258. height: 80rpx;
  259. position: absolute;
  260. }
  261. .score_icon:nth-child(3) {
  262. top: 0rpx;
  263. left: 60rpx;
  264. width: 80rpx;
  265. height: 80rpx;
  266. position: absolute;
  267. }
  268. }
  269. .give_score {
  270. display: block;
  271. height: 30rpx;
  272. font-size: 24rpx;
  273. line-height: 40rpx;
  274. }
  275. .give_coupon {
  276. position: absolute;
  277. font-size: 20rpx;
  278. padding: 2px 5px;
  279. background-color: #f00;
  280. color: #fff;
  281. border-radius: 6px;
  282. display: inline-block;
  283. text-align: center;
  284. right: -15rpx;
  285. top: -15rpx;
  286. }
  287. }
  288. /*.clockin_item:nth-child(7){
  289. width: 315rpx;
  290. }*/
  291. .clockin_item.acitve {
  292. color: #ffffff;
  293. background-color: #e03519;
  294. }
  295. }
  296. .clockin_btn {
  297. width: 660rpx;
  298. color: #ffffff;
  299. font-size: 30rpx;
  300. margin-top: 20rpx;
  301. padding: 0rpx 0rpx;
  302. border-radius: 60rpx;
  303. background-color: #e03519;
  304. border: 0rpx solid transparent;
  305. }
  306. .clockin_btn.active {
  307. color: #ffffff;
  308. background-color: #aaaaaa;
  309. }
  310. .clockin_btn::after {
  311. border: 0rpx solid transparent;
  312. }
  313. .score_record {
  314. height: 60rpx;
  315. display: block;
  316. color: #999999;
  317. font-size: 24rpx;
  318. margin-top: 20rpx;
  319. text-align: center;
  320. line-height: 80rpx;
  321. }
  322. .clockin_rule_btn {
  323. color: #999999;
  324. overflow: hidden;
  325. font-size: 24rpx;
  326. text-align: center;
  327. line-height: 80rpx;
  328. padding: 0rpx 0rpx;
  329. background: transparent;
  330. }
  331. .clockin_rule_btn::after {
  332. border: 0rpx solid transparent;
  333. }
  334. }
  335. }
  336. .popup {
  337. overflow: hidden;
  338. }
  339. .clockin_rule_box {
  340. width: 500rpx;
  341. display: block;
  342. overflow: hidden;
  343. background: #ffffff;
  344. font-size: 26rpx;
  345. margin: 0rpx auto;
  346. line-height: 50rpx;
  347. border-radius: 10rpx;
  348. padding: 0rpx 25rpx;
  349. padding-bottom: 20rpx;
  350. background: linear-gradient(to bottom, #fc335f 0%, #fb7224 100%);
  351. .clockin_rule_title {
  352. color: #ffffff;
  353. height: 60rpx;
  354. font-size: 32rpx;
  355. line-height: 60rpx;
  356. text-align: center;
  357. margin-bottom: 10rpx;
  358. .close_btn {
  359. float: right;
  360. width: 40rpx;
  361. height: 40rpx;
  362. font-size: 24rpx;
  363. margin-top: 9rpx;
  364. line-height: 40rpx;
  365. border-radius: 50%;
  366. border: 1rpx solid #ffffff;
  367. }
  368. }
  369. .clockin_rule_info {
  370. display: block;
  371. height: 500rpx;
  372. font-size: 24rpx;
  373. line-height: 40rpx;
  374. border-radius: 10rpx;
  375. padding: 20rpx 20rpx;
  376. box-sizing: border-box;
  377. background-color: #ffffff;
  378. .rich_text {
  379. white-space: break-spaces;
  380. }
  381. }
  382. }
  383. </style>