invite-frend-new.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>首页-邀请好友-创业帮</title>
  6. <meta name="keywords" content="首页-邀请好友-创业帮">
  7. <meta name="description" content="首页-邀请好友-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="首页-邀请好友-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. <style>
  17. @keyframes scale1-11 {
  18. 0% {
  19. transform: scale(.9);
  20. }
  21. 100% {
  22. transform: scale(1);
  23. }
  24. }
  25. @keyframes transX {
  26. 0% {
  27. transform: translateX(0);
  28. }
  29. 100% {
  30. transform: translateX(-100vw);
  31. }
  32. }
  33. @keyframes -transX {
  34. 0% {
  35. transform: translateX(-100vw);
  36. }
  37. 80% {
  38. transform: translateX(0);
  39. }
  40. 100% {
  41. transform: translateX(0);
  42. }
  43. }
  44. @keyframes transY {
  45. 0% {
  46. transform: translateY(18px);
  47. }
  48. 100% {
  49. transform: translateY(0px) ;
  50. }
  51. }
  52. @keyframes -transY {
  53. 0% {
  54. transform: translateY(0px);
  55. opacity:1;
  56. }
  57. 70% {
  58. transform: translateY(16px);
  59. opacity:1;
  60. }
  61. 90% {
  62. transform: translateY(16px);
  63. opacity:.5;
  64. }
  65. 100% {
  66. transform: translateY(18px);
  67. opacity:0;
  68. }
  69. }
  70. .transimg{
  71. animation: transX .5s ease-in-out;
  72. animation-fill-mode:forwards;
  73. }
  74. .openimg{
  75. animation: scale1-11 .5s ease-in-out;
  76. }
  77. .transimgy{
  78. animation: transY .5s ease-in-out;
  79. animation-fill-mode:forwards;
  80. }
  81. .-transimg{
  82. animation: -transX .5s ease-in-out;
  83. }
  84. .-transimgy{
  85. animation: -transY .5s ease-in-out;
  86. }
  87. .z-in{z-index:999;}
  88. .invited-new .invited_title_panel .card .qrcode{
  89. top:57%;
  90. }
  91. .iphonetitle{
  92. opacity:0;
  93. position:inherit !important;
  94. }
  95. .van-nav-bar{background-color:rgba(0,0,0,0);}
  96. .invited-new .bgimg img{filter:blur(30px);}
  97. </style>
  98. </head>
  99. <body class="pb0 ovh invited-new pt0">
  100. <div class="iphonetitle"> </div>
  101. <div id="app" v-cloak>
  102. <van-nav-bar class="f14 mall_title f16" right-text="保存本地" title="" @click-left="backbtn" @click-right="savelocal" left-arrow v-if="toptitleisshow" v-cloak>
  103. <template #left>
  104. <van-icon name="arrow-left" color="#333" size="20"></van-icon>
  105. </template>
  106. </van-nav-bar>
  107. <div class="bgimg abs" style="opacity:1"><img :src="piclist[index2].PicPath" alt=""></div>
  108. <div class="invited_title_panel rel">
  109. <div class="card abs" style="height:auto;"></div>
  110. <div class="card abs invite-test" style="height:auto;z-index:999;" @touchstart="gtouchstart" @touchend="gtouchend">
  111. <div>
  112. <div class="abs showel" style="width:90%;height:93%;z-index:-8;top:10%;" ref="show1"></div>
  113. <div class="abs showel" style="width:80%;z-index:-9;height:96%;top:10%;" ref="show2"></div>
  114. </div>
  115. <div class="right abs arrow" @click="rightclick" style="z-index:1000;"><img class="abs" src="./static/images/invited-right.png" alt=""></div>
  116. <div class="left abs arrow" @click="leftclick" style="z-index:1000;"><img class="abs" src="./static/images/invited-left.png" alt=""></div>
  117. <div class="abs" style="top:0;width:100%;" :class="rightclickan" v-cloak v-if="bgisshow"><img :src="piclist[index1].PicPath" alt="" style="border-radius:16px;z-index:11;">
  118. <div class="qrcode abs tc"><img :src="userinfo.InvitePhoto" alt="">
  119. <div class="f12 mt8" :class="index1 === 1? 'cfff' : 'c333'">{{userinfo.RealName}}</div>
  120. <div class="f12" style="white-space: nowrap;" :class="index1 === 1? 'cfff' : 'c333'">推荐码:{{userinfo.MakerCode}}</div>
  121. </div>
  122. </div>
  123. <div class="rel" :class="rightclickan1" v-cloak><img :src="piclist[index].PicPath" alt="" style="border-radius:16px;z-index:99;">
  124. <div class="qrcode abs tc"><img :src="userinfo.InvitePhoto" alt="">
  125. <div class="f12 mt8" :class="index === 1? 'cfff' : 'c333'">{{userinfo.RealName}}</div>
  126. <div class="f12" style="white-space: nowrap;" :class="index === 1? 'cfff' : 'c333'">推荐码:{{userinfo.MakerCode}}</div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. <button class="abs invited_bottom_panel f14 c333" @click="sharebtn" style="border-radius:999px;">立即分享</button>
  132. <van-popup class="bgcf7f7f7" v-model="show" position="bottom" :style="{ height: '28%' }">
  133. <div class="sharepanel rel">
  134. <div class="f12 c999 tc">分享到</div>
  135. <van-grid class="grad" :column-num="2">
  136. <van-grid-item text="微信" @click="weixin">
  137. <template #icon>
  138. <svg class="icon" aria-hidden="true">
  139. <use xlink:href="#icon-weixin"> </use>
  140. </svg>
  141. </template>
  142. </van-grid-item>
  143. <van-grid-item text="微信朋友圈" @click="weixinfriend">
  144. <template #icon>
  145. <svg class="icon" aria-hidden="true">
  146. <use xlink:href="#icon-pengyouquan"></use>
  147. </svg>
  148. </template>
  149. </van-grid-item>
  150. </van-grid>
  151. <div class="tc mt16 cencal abs bgcfff f14 c333" @click="show = false">取消 </div>
  152. </div>
  153. </van-popup>
  154. </div>
  155. <script src="./static/js/klm-vv.min.js"></script>
  156. <script src="./static/js/appfunc.min.js"></script>
  157. <script src="./static/js/klm-axios-config.js"></script>
  158. <script src="./static/js/publicfn.js"></script>
  159. <script src="./static/js/iconfont.js"></script>
  160. <script>
  161. function OnStart(){
  162. PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  163. };
  164. //--- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  165. // 在 #app 标签下渲染一个按钮组件
  166. let app = new Vue({
  167. el: '#app',
  168. data() {
  169. return {
  170. bgisshow:false,
  171. toptitleisshow:true,
  172. userinfo:{},
  173. piclist:[],
  174. show:false,
  175. picindex:0,
  176. isclick:false,
  177. leisclick:false,
  178. upan:'',
  179. rightbtn:'',
  180. index:0,
  181. index1:1,
  182. index2:0,
  183. pagX:0,
  184. pagX1:0,
  185. }
  186. },
  187. created() {
  188. this.getuserinfo();
  189. this.getpiclist();
  190. },
  191. computed:{
  192. rightclickan(){
  193. return this.upan;
  194. },
  195. rightclickan1(){
  196. return this.rightbtn;
  197. }
  198. },
  199. methods: {
  200. rightclick(){
  201. const that = this;
  202. this.bgisshow = true;
  203. if(!that.isclick){
  204. if(that.index === (that.piclist.length - 1)){
  205. that.index2 = 0;
  206. }else{
  207. that.index2++;
  208. };
  209. setTimeout(()=>{
  210. if(that.index === (that.piclist.length - 1)){
  211. that.index1 = 1;
  212. that.index = 0;
  213. }else{
  214. that.index++;
  215. that.index1++;
  216. if(that.index1 === that.piclist.length){
  217. that.index1 = 0;
  218. };
  219. };
  220. },500);
  221. setTimeout(()=>{
  222. that.isclick = false;
  223. that.upan = '';
  224. that.rightbtn = '';
  225. this.bgisshow = false;
  226. },500);
  227. };
  228. that.upan = 'transimgy';
  229. that.rightbtn = 'transimg';
  230. that.isclick = true;
  231. },
  232. leftclick(){
  233. const that = this;
  234. this.bgisshow = true;
  235. if(!that.isclick){
  236. if(that.index === 0){
  237. that.index2 = that.piclist.length;
  238. that.index = that.piclist.length;
  239. };
  240. if(that.index1 === 0){
  241. that.index1 = that.piclist.length;
  242. };
  243. that.index1--;
  244. that.index2--;
  245. that.index--;
  246. setTimeout(()=>{
  247. that.isclick = false;
  248. that.upan = '';
  249. that.rightbtn = '';
  250. this.bgisshow = false;
  251. },500);
  252. };
  253. that.rightbtn = '-transimg z-in';
  254. that.upan = '-transimgy';
  255. that.isclick = true;
  256. },
  257. gtouchstart(e){
  258. this.pagX = e.changedTouches[0].clientX;
  259. },
  260. gtouchend(e){
  261. this.pagX1 = e.changedTouches[0].clientX;
  262. if((this.pagX1 - this.pagX) > 50){
  263. this.leftclick();
  264. };
  265. if((this.pagX1 - this.pagX) < -50){
  266. this.rightclick();
  267. };
  268. },
  269. async getuserinfo(){
  270. const Id = PublicLib.getCookieInfo('userId');
  271. const res = await getRequest('api/v1/users/mycard?t='+Math.random(6),JSON.stringify({Id}));
  272. if(res.status !== '1') tips('获取个人信息失败!请刷新重试');
  273. //- 个人信息
  274. this.userinfo = res.data;
  275. },
  276. async getpiclist(){
  277. const Id = PublicLib.getCookieInfo('userId');
  278. const res = await getRequest('api/v1/UserInviteFriends/InviteFriendsPhotoList?t='+Math.random(6),JSON.stringify({Id}));
  279. if(res.status !== '1') tips('获取图片列表失败!请刷新重试');
  280. this.piclist = res.data;
  281. },
  282. //- 后端图片合成方法
  283. async putionvitedpic(){
  284. const UserId = PublicLib.getCookieInfo('userId');
  285. const res = await getRequest('api/v1/UserInviteFriends/InviteFriendsList?t='+Math.random(6),JSON.stringify({UserId,photoId:this.piclist[this.index].Id}));
  286. if(res.status !== '1') tips(res.info);
  287. return res.data.ReferenceQrCode;
  288. },
  289. pageindex(index){
  290. this.picindex = index;
  291. },
  292. //- 点击保存
  293. savelocal:undebounce(async function(){
  294. const that = this;
  295. PublicLib.SaveToSd({PicPath:await that.putionvitedpic()});
  296. console.log(await that.putionvitedpic());
  297. }),
  298. //- 点击分享
  299. sharebtn(){
  300. this.show = true;
  301. },
  302. //- 分享微信
  303. async weixin(){
  304. const that = this;
  305. PublicLib.ShareAppMessageImage({PicturePath:await that.putionvitedpic()});
  306. },
  307. //- 分享微信朋友圈
  308. async weixinfriend(){
  309. const that = this;
  310. PublicLib.ShareTimelineImage({PicturePath:await that.putionvitedpic()});
  311. },
  312. backbtn(){
  313. PublicLib.GoBack({Level:1});
  314. },
  315. },
  316. });
  317. </script>
  318. </body>
  319. </html>