InviteFriends.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <view>
  3. <u-mask :show="show" @click="show = false">
  4. <u-image width="100%" height="500px" :mode="'widthFix'" src="/static/img/guide_point.png"></u-image>
  5. </u-mask>
  6. <u-navbar title="邀请好友"></u-navbar>
  7. <view class="InviteFriends">
  8. <view class="InviteFriends-head">
  9. <u-image width="274rpx" height="60rpx" src="/static/img/logo3.png"></u-image>
  10. <u-image class="textImg" width="662rpx" height="59rpx" src="/static/img/text.png"></u-image>
  11. <u-image width="100%" height="320rpx" src="/static/img/handshake.png"></u-image>
  12. </view>
  13. <view class="InviteFriends-main">
  14. <view class="InviteFriends-coupons">
  15. <h4>每邀请1位好友注册,将获得1张抵扣券</h4>
  16. <view class="coupons-price">
  17. <h2>5</h2><span>元</span>
  18. </view>
  19. <view class="coupons-line"></view>
  20. <view class="coupons-btn" @click="inviteFriendsBtn">
  21. <u-icon name="wechat-fill" custom-prefix="custom-icon" color="#fff" size="48"></u-icon>
  22. <span>分享至微信</span>
  23. </view>
  24. </view>
  25. <view class="InviteFriends-title">福利获取流程</view>
  26. <view class="InviteFriends-info">
  27. <view class="InviteFriends-info-row">
  28. <u-icon name="question-answer-fill" custom-prefix="custom-icon" color="#00B962" size="48"></u-icon>
  29. <p>1.发送链接给好友</p>
  30. </view>
  31. <view class="InviteFriends-info-row">
  32. <u-icon name="account-pin-circle-fill" custom-prefix="custom-icon" color="#00B962" size="48"></u-icon>
  33. <p>2.好友注册并登录51充电联盟</p>
  34. </view>
  35. <view class="InviteFriends-info-row">
  36. <u-icon name="gift-2-fill" custom-prefix="custom-icon" color="#00B962" size="48"></u-icon>
  37. <p>3.和好友一起领5元红包</p>
  38. </view>
  39. <view class="InviteFriends-tips">
  40. <span>*</span><p>邀请成功,你和好友各得5元红包,一年有效;邀请更多人,你可领最高500元红包,红包在本活动页兑换。</p>
  41. </view>
  42. </view>
  43. <view class="InviteFriends-title">我的奖励</view>
  44. <view class="InviteFriends-reward">
  45. <view class="reward-head">
  46. <p>成功邀请1人,已获得</p>
  47. <view class="reward-head-price">
  48. <h2>5</h2><span>元</span>
  49. </view>
  50. </view>
  51. <view class="reward-main">
  52. <view class="reward-list">
  53. <view class="reward-list-title">
  54. 成功邀请记录
  55. </view>
  56. <view class="rewardList">
  57. <view class="rewardList-item">
  58. <view class="u-flex">
  59. <u-avatar src="/static/img/head1.png" size="72"></u-avatar>
  60. <span>asdas</span>
  61. </view>
  62. <p>2022-05-30</p>
  63. </view>
  64. <view class="rewardList-item">
  65. <view class="u-flex">
  66. <u-avatar src="/static/img/head1.png" size="72"></u-avatar>
  67. <span>asdas</span>
  68. </view>
  69. <p>2022-05-30</p>
  70. </view>
  71. <view class="rewardList-item">
  72. <view class="u-flex">
  73. <u-avatar src="/static/img/head1.png" size="72"></u-avatar>
  74. <span>asdas</span>
  75. </view>
  76. <p>2022-05-30</p>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="InviteFriends-foot">
  83. *本活动最终解释权,归51充电联盟所有。
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import wx from 'weixin-js-sdk'
  91. import * as API_WeiXin from '@/apis/weixin'
  92. import * as API from '@/apis/friends.js'
  93. import * as WxJsApi from '@/utils/wxJsApi.js'
  94. export default {
  95. data() {
  96. return {
  97. id:"",
  98. code:"",
  99. show:false,
  100. }
  101. },
  102. onLoad(op) {
  103. this.id=op.id
  104. this.code=op.code
  105. this.get_wx_config();
  106. },
  107. onShow() {
  108. //this.inviteCouponList();
  109. },
  110. methods: {
  111. inviteCouponList(){
  112. uni.showLoading({
  113. title: "加载中",
  114. mask: true,
  115. })
  116. API.inviteCouponList().then((res) => {
  117. this.list = res.data.helpList
  118. uni.hideLoading()
  119. }).catch(error => {
  120. uni.showToast({
  121. title: error
  122. })
  123. })
  124. },
  125. inviteFriendsBtn(){
  126. this.show=true;
  127. },
  128. //获取微信jssdk配置信息
  129. get_wx_config() {
  130. WxJsApi.getWxConfig( ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareQZone']).then((res) => {
  131. // console.log(res)
  132. this.wxShare()
  133. }).catch(error => {
  134. console.log(error)
  135. })
  136. },
  137. //微信分享自定义
  138. wxShare() {
  139. var info=this.carhelp.getPersonInfo()
  140. var img=""//require("@/static/img/aboutus.png")
  141. console.log(this.nowItem);
  142. var ProjectName=process.car.ProjectName;
  143. var title="["+ProjectName+"]"+'和好友一起领5元红包'
  144. var desc="来自"+info.name+"的邀请"
  145. let joinUrl = window.location.href.split("#")[0]+"#/?friends=friends&id="+this.id+"&icode="+this.code+"&uid="+info.id;
  146. var _this = this;
  147. wx.ready(function() {
  148. wx.onMenuShareAppMessage({
  149. title: title,
  150. desc:desc ,
  151. link: joinUrl,
  152. imgUrl: img,
  153. success: function() {
  154. // 设置成功
  155. _this.$emit("wxShare",null);
  156. }
  157. })
  158. wx.onMenuShareTimeline({
  159. title: title,
  160. desc:desc ,
  161. link: joinUrl,
  162. imgUrl: img,
  163. success: function() {
  164. // 设置成功
  165. _this.$emit("wxShare",null);
  166. }
  167. })
  168. });
  169. }
  170. }
  171. }
  172. </script>
  173. <style>
  174. page{
  175. }
  176. </style>
  177. <style lang="scss" scoped>
  178. .InviteFriends{
  179. background-image: linear-gradient(0deg, #a2e9c9 , #01b963);
  180. }
  181. .InviteFriends-head{
  182. display: flex;
  183. flex-direction: column;
  184. align-items: center;
  185. padding-top: 36px;
  186. .textImg{
  187. margin:20px 0 10px;
  188. }
  189. }
  190. .InviteFriends-main{
  191. padding: 0 32px;
  192. }
  193. .InviteFriends-coupons{
  194. background-color: #fff;
  195. border-radius: 20px;
  196. padding: 20px;
  197. h4{
  198. font-size: 15px;
  199. font-weight: normal;
  200. text-align: center;
  201. }
  202. .coupons-price{
  203. display: flex;
  204. justify-content: center;
  205. align-items: flex-end;
  206. margin: 16px 0;
  207. h2{
  208. font-size: 44px;
  209. line-height: 44px;
  210. color:#FF9600;
  211. }
  212. span{
  213. font-size: 18px;
  214. margin-left: 2px;
  215. }
  216. }
  217. .coupons-line{
  218. height: 1px;
  219. border-bottom: 1px dashed #cacaca;
  220. position: relative;
  221. &:before{
  222. content: '';
  223. position: absolute;
  224. height: 15px;
  225. width: 15px;
  226. background-color:#2dc67f ;
  227. border-radius: 50%;
  228. left:-27px;
  229. top:-7px;
  230. }
  231. &:after{
  232. content: '';
  233. position: absolute;
  234. height: 15px;
  235. width: 15px;
  236. background-color:#2dc67f ;
  237. border-radius: 50%;
  238. right:-27px;
  239. top:-7px;
  240. }
  241. }
  242. .coupons-btn{
  243. background-color: #FF9600;
  244. margin-top: 20px;
  245. height: 50px;
  246. text-align: center;
  247. line-height: 50px;
  248. border-radius: 25px;
  249. font-size: 20px;
  250. color:#fff;
  251. span{
  252. margin-left: 8px;
  253. }
  254. }
  255. }
  256. .InviteFriends-title{
  257. color:#fff;
  258. margin: 40px 0 24px;
  259. font-size: 18px;
  260. }
  261. .InviteFriends-info{
  262. background-color: #fff;
  263. border-radius: 20px;
  264. padding: 20px;
  265. .InviteFriends-info-row{
  266. display: flex;
  267. align-items: center;
  268. margin-bottom: 20px;
  269. &:last-child{
  270. margin-bottom: 0;
  271. }
  272. p{
  273. margin-left: 12px;
  274. font-size: 16px;
  275. }
  276. }
  277. }
  278. .InviteFriends-tips{
  279. padding-left:30px;
  280. margin-top: -16px;
  281. span{
  282. float: left;
  283. color:#FF1C1C;
  284. }
  285. p{
  286. color:#999;
  287. }
  288. }
  289. .reward-head{
  290. background-color: #00B962;
  291. border-radius: 16px 16px 0 0;
  292. height: 75px;
  293. display: flex;
  294. justify-content: space-between;
  295. align-items: center;
  296. padding: 0 20px;
  297. margin: 0 4px;
  298. p{
  299. color:#fff;
  300. font-size: 17px;
  301. }
  302. .reward-head-price{
  303. color:#fff;
  304. display: flex;
  305. align-items: flex-end;
  306. h2{
  307. font-size: 36px;
  308. line-height: 36px;
  309. margin-right: 2px;
  310. }
  311. }
  312. }
  313. .reward-main{
  314. background-color: #fff;
  315. border-radius: 16px;
  316. padding: 24px;
  317. margin-top: -4px;
  318. .reward-info{
  319. display: flex;
  320. justify-content: space-between;
  321. .reward-info-item{
  322. width: 122px;
  323. height: 122px;
  324. display: flex;
  325. flex-direction: column;
  326. align-items: center;
  327. border:1px solid #CBE1D7 ;
  328. justify-content: center;
  329. border-radius: 12px;
  330. }
  331. p{
  332. font-size: 16px;
  333. color:#666;
  334. margin-bottom: 10px;
  335. }
  336. .reward-info-price{
  337. display: flex;
  338. align-items: flex-end;
  339. h2{
  340. font-size: 44px;
  341. line-height: 44px;
  342. margin-right: 2px;
  343. color:#00B962;
  344. }
  345. }
  346. .reward-info-item2{
  347. background-color:#E6EEEA;
  348. border: none;
  349. .reward-info-price h2{
  350. color:#333;
  351. }
  352. }
  353. }
  354. .reward-btn{
  355. height: 40px;
  356. width: 120px;
  357. border-radius: 20px;
  358. background-color: #00B962 ;
  359. line-height: 40px;
  360. color:#fff;
  361. text-align: center;
  362. font-size: 18px;
  363. margin: 20px auto;
  364. }
  365. }
  366. .reward-list{
  367. //border-top: 1px dashed #cacaca;
  368. padding-top: 20px;
  369. .reward-list-title{
  370. font-size: 18px;
  371. margin-bottom: 20px;
  372. }
  373. .rewardList-item{
  374. display: flex;
  375. justify-content: space-between;
  376. align-items: center;
  377. margin-top: 12px;
  378. span{
  379. margin-left: 12px;
  380. font-size: 16px;
  381. }
  382. p{
  383. color:#999;
  384. }
  385. }
  386. }
  387. .InviteFriends-foot{
  388. text-align: center;
  389. color:#2A9563;
  390. padding: 20px 0 64px;
  391. }
  392. </style>