invite-frend.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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. .van-nav-bar__title{font-weight:normal;color:#333 !important;}
  98. .van-share-sheet__options{justify-content:space-around !important;}
  99. </style>
  100. </head>
  101. <body class="pb0 ovh invited-new pt0">
  102. <div class="iphonetitle"> </div>
  103. <div id="app" v-cloak>
  104. <van-nav-bar class="f14 mall_title f16" right-text="保存本地" title="邀请好友" @click-left="backbtn" @click-right="savelocal" left-arrow v-if="toptitleisshow" v-cloak>
  105. <template #left>
  106. <van-icon name="arrow-left" color="#333" size="20"></van-icon>
  107. </template>
  108. </van-nav-bar>
  109. <div class="bgimg abs" style="opacity:1"><img :src="piclist[index2].PicPath" alt=""></div>
  110. <div class="invited_title_panel rel">
  111. <div class="card abs" style="height:auto;"></div>
  112. <div class="card abs invite-test" style="height:auto;z-index:999;" @touchstart="gtouchstart" @touchend="gtouchend">
  113. <div>
  114. <div class="abs showel" style="width:90%;height:93%;z-index:-8;top:10%;" ref="show1"></div>
  115. <div class="abs showel" style="width:80%;z-index:-9;height:96%;top:10%;" ref="show2"></div>
  116. </div>
  117. <div class="right abs arrow" @click="rightclick" style="z-index:1000;"><img class="abs" src="./static/images/invited-right.png" alt=""></div>
  118. <div class="left abs arrow" @click="leftclick" style="z-index:1000;"><img class="abs" src="./static/images/invited-left.png" alt=""></div>
  119. <div class="abs" style="top:0;width:100%; min-height:20vh" :class="rightclickan" v-cloak v-if="bgisshow"><img :src="piclist[index1].PicPath" alt="" style="border-radius:16px;z-index:11;">
  120. <div class="qrcode abs tc"><img :src="userinfo.InvitePhoto" alt="">
  121. <div class="f12 mt8" :class="index1 === 1? 'cfff' : 'c333'">{{userinfo.RealName}}</div>
  122. <div class="f12" style="white-space: nowrap;" :class="index1 === 1? 'cfff' : 'c333'">推荐码:{{userinfo.MakerCode}}</div>
  123. </div>
  124. </div>
  125. <div class="rel" :class="rightclickan1" v-cloak><img :src="piclist[index].PicPath" alt="" style="border-radius:16px;z-index:99;">
  126. <div class="qrcode abs tc"><img :src="userinfo.InvitePhoto" alt="">
  127. <div class="f12 mt8" :class="index === 1? 'cfff' : 'c333'">{{userinfo.RealName}}</div>
  128. <div class="f12" style="white-space: nowrap;" :class="index === 1? 'cfff' : 'c333'">推荐码:{{userinfo.MakerCode}}</div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. <button class="abs invited_bottom_panel f14 c333" @click="sharebtn" style="border-radius:999px;z-index:999;">立即分享</button>
  134. <van-share-sheet v-model="show" title="立即分享给好友" :options="options" @select="weixin"></van-share-sheet>
  135. </div>
  136. <script src="./static/js/klm-vv.min.js"></script>
  137. <script src="./static/js/appfunc.min.js"></script>
  138. <script src="./static/js/klm-axios-config.js"></script>
  139. <script src="./static/js/publicfn.js"></script>
  140. <script src="./static/js/iconfont.js"></script>
  141. <script>
  142. function OnStart(){
  143. PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  144. };
  145. //--- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
  146. // 在 #app 标签下渲染一个按钮组件
  147. let app = new Vue({
  148. el: '#app',
  149. data() {
  150. return {
  151. options: [
  152. { name: '微信', icon: 'wechat' },
  153. { name: '微信朋友圈', icon: 'wechat-moments' },
  154. ],
  155. bgisshow:true,
  156. toptitleisshow:true,
  157. userinfo:{},
  158. piclist:[],
  159. show:false,
  160. picindex:0,
  161. isclick:false,
  162. leisclick:false,
  163. upan:'',
  164. rightbtn:'',
  165. index:0,
  166. index1:1,
  167. index2:0,
  168. pagX:0,
  169. pagX1:0,
  170. }
  171. },
  172. created() {
  173. this.getuserinfo();
  174. this.getpiclist();
  175. },
  176. computed:{
  177. rightclickan(){
  178. return this.upan;
  179. },
  180. rightclickan1(){
  181. return this.rightbtn;
  182. }
  183. },
  184. methods: {
  185. rightclick(){
  186. const that = this;
  187. this.bgisshow = true;
  188. if(!that.isclick){
  189. if(that.index === (that.piclist.length - 1)){
  190. that.index2 = 0;
  191. }else{
  192. that.index2++;
  193. };
  194. setTimeout(()=>{
  195. if(that.index === (that.piclist.length - 1)){
  196. that.index1 = 1;
  197. that.index = 0;
  198. }else{
  199. that.index++;
  200. that.index1++;
  201. if(that.index1 === that.piclist.length){
  202. that.index1 = 0;
  203. };
  204. };
  205. },500);
  206. setTimeout(()=>{
  207. that.isclick = false;
  208. that.upan = '';
  209. that.rightbtn = '';
  210. this.bgisshow = false;
  211. },500);
  212. };
  213. that.upan = 'transimgy';
  214. that.rightbtn = 'transimg';
  215. that.isclick = true;
  216. },
  217. leftclick(){
  218. const that = this;
  219. this.bgisshow = true;
  220. if(!that.isclick){
  221. if(that.index === 0){
  222. that.index2 = that.piclist.length;
  223. that.index = that.piclist.length;
  224. };
  225. if(that.index1 === 0){
  226. that.index1 = that.piclist.length;
  227. };
  228. that.index1--;
  229. that.index2--;
  230. that.index--;
  231. setTimeout(()=>{
  232. that.isclick = false;
  233. that.upan = '';
  234. that.rightbtn = '';
  235. this.bgisshow = false;
  236. },500);
  237. };
  238. that.rightbtn = '-transimg z-in';
  239. that.upan = '-transimgy';
  240. that.isclick = true;
  241. },
  242. gtouchstart(e){
  243. this.pagX = e.changedTouches[0].clientX;
  244. },
  245. gtouchend(e){
  246. this.pagX1 = e.changedTouches[0].clientX;
  247. if((this.pagX1 - this.pagX) > 50){
  248. this.leftclick();
  249. };
  250. if((this.pagX1 - this.pagX) < -50){
  251. this.rightclick();
  252. };
  253. },
  254. async getuserinfo(){
  255. const Id = PublicLib.getCookieInfo('userId');
  256. const res = await getRequest('api/v1/users/mycard?t='+Math.random(6),JSON.stringify({Id}));
  257. if(res.status !== '1') tips('获取个人信息失败!请刷新重试');
  258. //- 个人信息
  259. this.userinfo = res.data;
  260. },
  261. async getpiclist(){
  262. const Id = PublicLib.getCookieInfo('userId');
  263. const res = await getRequest('api/v1/UserInviteFriends/InviteFriendsPhotoList?t='+Math.random(6),JSON.stringify({Id}));
  264. if(res.status !== '1') tips('获取图片列表失败!请刷新重试');
  265. this.piclist = res.data;
  266. },
  267. //- 后端图片合成方法
  268. async putionvitedpic(){
  269. const UserId = PublicLib.getCookieInfo('userId');
  270. const res = await getRequest('api/v1/UserInviteFriends/InviteFriendsList?t='+Math.random(6),JSON.stringify({UserId,photoId:this.piclist[this.index].Id}));
  271. if(res.status !== '1') tips(res.info);
  272. return res.data.ReferenceQrCode;
  273. },
  274. pageindex(index){
  275. this.picindex = index;
  276. },
  277. //- 点击保存
  278. savelocal:undebounce(async function(){
  279. const that = this;
  280. PublicLib.SaveToSd({PicPath:await that.putionvitedpic()});
  281. console.log(await that.putionvitedpic());
  282. }),
  283. //- 点击分享
  284. sharebtn(){
  285. this.show = true;
  286. },
  287. //- 分享微信
  288. async weixin(option){
  289. const that = this;
  290. if(option.name === '微信'){
  291. PublicLib.ShareAppMessageImage({PicturePath:await that.putionvitedpic()});
  292. }else{
  293. PublicLib.ShareTimelineImage({PicturePath:await that.putionvitedpic()});
  294. }
  295. //- 好友
  296. },
  297. backbtn(){
  298. PublicLib.GoBack({Level:1});
  299. },
  300. },
  301. });
  302. </script>
  303. </body>
  304. </html>