becomeVIP.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  1. <template>
  2. <view class="content hb column justify-center align-center bgf">
  3. <image :src="imgPath+'/app/image/becomevip.png'" mode="widthFix"></image>
  4. <view class="justify-start align-center fs24 base-color-9" v-if="userInfo.userId">
  5. <view>{{nameuser}}#</view>
  6. <view>{{userInfo.userId}}</view>
  7. </view>
  8. <view class="bolds">成为会员,享受更多权益</view>
  9. <!--#ifdef H5-->
  10. <view class="sure" @click="registerCourse">{{isVip==1?'您已成为会员':viptext}}</view>
  11. <!--#endif-->
  12. <!--#ifdef MP-WEIXIN-->
  13. <view class="base-bg-orange colorf ptb20 plr40 radius60"
  14. v-if="(userInfos==null||userInfos=='')&&imgname=='乐氏本源'" @click="nato()">授权用户信息</view>
  15. <view class="btns" v-else>
  16. <!-- <button
  17. class="author-btn"
  18. open-type="getUserInfo"
  19. :disabled="userdisabled"
  20. @getuserinfo="userInfologin" v-if="authType==0">{{isVip==1?'您已成为会员':'申请成为会员'}}</button>
  21. <button
  22. v-else
  23. class="author-btn"
  24. open-type="getPhoneNumber"
  25. @getphonenumber="phoneLogin" >{{isVip==1?'您已成为会员':'申请成为会员'}}</button> -->
  26. <button class="author-btn" @click="handleAgree()">{{viptext}}</button>
  27. </view>
  28. <!--#endif-->
  29. <!--#ifdef MP-WEIXIN-->
  30. <u-popup :show="userlogo" mode="bottom" round='12'>
  31. <view class="userlogo column">
  32. <view class="mtb30 justify-start align-center ml20">
  33. <u-avatar :src="imgPath+'/app/image/logo.png'" size="50"></u-avatar>
  34. <view class="bold mlr20">{{imgname}}</view>
  35. <view>申请</view>
  36. </view>
  37. <view class="bold fs36 ml20">授权你的昵称头像信息</view>
  38. <view class="mtb20 justify-between align-center plr20">
  39. <view class="justify-start align-center">
  40. <view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
  41. <view v-if="userinfos.nickname">√</view>
  42. </view>
  43. <view class="ml20">
  44. <view class="base-color-3 bold">第一步</view>
  45. <view class="fs24 base-color-9">请点击授权微信昵称</view>
  46. </view>
  47. </view>
  48. <view class="button-container">
  49. <input
  50. type="nickname"
  51. class="hidden-input"
  52. @blur="onNickNameInput"
  53. @input="onNickNameInput"
  54. />
  55. <button class="custom-button" :class="nameuser==''?'subname':'subavt'">{{nameuser?"已授权":'允许授权'}}</button>
  56. </view>
  57. </view>
  58. <view class="mtb20 justify-between align-center plr20 mt40">
  59. <view class="justify-start align-center">
  60. <view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
  61. <view v-if="userinfos.avatar">√</view>
  62. </view>
  63. <view class="ml20">
  64. <view class="base-color-3 bold">第二步</view>
  65. <view class="fs24 base-color-9">请点击授权微信头像</view>
  66. </view>
  67. </view>
  68. <view class="button-container">
  69. <button open-type="chooseAvatar" @chooseavatar="onChooseAvatar" class="hidden-input"
  70. v-if="nameuser">
  71. 允许授权
  72. </button>
  73. <button class="custom-button sub" @click="shouquan" v-if="nameuser==''">允许授权</button>
  74. <button class="custom-button " :class="avataruser==''?'subname':'subavt'"
  75. v-else>{{avataruser?"已授权":'允许授权'}}</button>
  76. </view>
  77. </view>
  78. <view class="submitname" @click="confimrname" :class="nameuser&&avataruser?'subact':'sub'">确定</view>
  79. </view>
  80. </u-popup>
  81. <!--#endif-->
  82. <!-- <view class="footer-tips">重庆云联融智提供技术支持</view> -->
  83. </view>
  84. </template>
  85. <script>
  86. import { loginByMp,registerCourses,loginByMiniApp,handleFsUserWx} from '@/api/courseLook'
  87. import {
  88. getConfigByKey
  89. } from "@/api/user.js"
  90. export default {
  91. data() {
  92. return {
  93. isVip: 0,
  94. isWechat: false,
  95. isLogin: false,
  96. companyid:'',
  97. companyUserId:'',
  98. userInfo:{},
  99. tagIds:[],
  100. isbecomevip:0,
  101. viptext:'申请成为会员',
  102. userlogo:false,
  103. userinfos:{
  104. nickname:'',
  105. avatar:""
  106. },
  107. headImg:'',
  108. authType:0,//0微信登录 1手机号登录
  109. userdisabled:false,
  110. projectId:'',
  111. H5course:{}
  112. }
  113. },
  114. computed: {
  115. imgPath() {
  116. return this.$store.state.imgpath
  117. },
  118. imgname() {
  119. return this.$store.state.logoname
  120. },
  121. appid() {
  122. return this.$store.state.appid
  123. },
  124. nameuser() {
  125. return this.userinfos.nickname
  126. },
  127. avataruser() {
  128. return this.userinfos.avatar
  129. },
  130. },
  131. onLoad(option) {
  132. uni.$on('usercode',(data)=>{
  133. console.log('huoqu ',data)
  134. this.goLogin(data)
  135. })
  136. uni.$on('vipMsg',(data)=>{
  137. console.log('vipMsg ',data)
  138. this.viptext=data
  139. })
  140. console.log(option)
  141. let path = 'https://userapp.moonxiang.com/prod-api'//存在文化
  142. uni.setStorageSync('requestPath',path)
  143. if(uni.getStorageSync('userInfo')&&uni.getStorageSync('userInfo')!='{}') {
  144. this.userInfo = uni.getStorageSync('userInfo')
  145. } else {
  146. this.userInfo = {}
  147. }
  148. // this.userInfo=JSON.parse(uni.getStorageSync('userInfo')) || {};
  149. //#ifdef MP-WEIXIN
  150. let obj=uni.getStorageSync('TOKEN_WEXIN');
  151. //#endif
  152. // #ifdef H5
  153. let obj=uni.getStorageSync('TOKEN_KEY');
  154. // #endif
  155. // let obj=uni.getStorageSync('AppToken');
  156. let becomeVip={}
  157. if(!option.becomeVip){
  158. const keys = decodeURIComponent(Object.keys(option)[0]);
  159. becomeVip=JSON.parse(keys.split('becomeVip=')[1])
  160. console.log(becomeVip)
  161. }else{
  162. becomeVip = option.becomeVip ? JSON.parse(decodeURIComponent(option.becomeVip)) : {}
  163. }
  164. this.isLogin = !!obj;
  165. this.companyid = becomeVip.companyId || ''
  166. this.companyUserId=becomeVip.companyUserId || 0
  167. this.projectId=becomeVip.projectId
  168. this.H5course.companyId=becomeVip.companyId
  169. this.H5course.companyUserId=becomeVip.companyUserId
  170. this.H5course.projectId=becomeVip.projectId
  171. uni.setStorageSync('H5course',this.H5course)
  172. console.log(this.H5course)
  173. //#ifdef MP-WEIXIN
  174. // if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userInfos')){
  175. // this.userlogo=true
  176. // }
  177. if(!uni.getStorageSync('userInfos')&&this.$store.state.logoname=='乐氏本源'){
  178. uni.navigateTo({
  179. url:'/pages_course/webview'
  180. })
  181. return
  182. }
  183. //#endif
  184. if(becomeVip.tagids==null||becomeVip.tagids==''){
  185. this.tagIds=[]
  186. }else{
  187. this.tagIds=becomeVip.tagids
  188. const arr =this.tagIds.split(",")
  189. .map(item => parseInt(item.trim(), 10))
  190. .filter(num => !isNaN(num)); // 过滤无效转换
  191. this.tagIds =arr
  192. // console.log(this.tagIds);
  193. }
  194. // this.isWechat = String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger"
  195. // this.code = option.code
  196. // #ifdef H5
  197. if(this.code&&!this.isLogin) {
  198. this.loginByMp()
  199. }
  200. // #endif
  201. },
  202. onShow() {
  203. this.getWebviewUrl()
  204. if(uni.getStorageSync('userInfo')&&uni.getStorageSync('userInfo')!='{}') {
  205. this.userInfo = uni.getStorageSync('userInfo')
  206. } else {
  207. this.userInfo = {}
  208. }
  209. //#ifdef MP-WEIXIN
  210. this.userinfos=uni.getStorageSync('userInfo')
  211. console.log(uni.getStorageSync('userinfos'))
  212. let obj=uni.getStorageSync('TOKEN_WEXIN');
  213. //#endif
  214. // #ifdef H5
  215. let obj=uni.getStorageSync('TOKEN_KEY');
  216. // #endif
  217. this.isLogin = !!obj;
  218. if(this.isLogin&&this.isVip!=1) {
  219. this.registerCourse()
  220. }
  221. },
  222. methods: {
  223. getWebviewUrl() {
  224. var data = {
  225. key: 'course.config'
  226. }
  227. getConfigByKey(data).then(res => {
  228. if (res.code == 200) {
  229. console.log("getConfigByKey====", JSON.parse(res.data))
  230. let data = JSON.parse(res.data,)
  231. uni.setStorageSync('setWebviewUrl',data.userCourseAuthDomain)
  232. }else{
  233. uni.showToast({
  234. icon:'none',
  235. title: res.msg,
  236. });
  237. }
  238. })
  239. },
  240. goLogin(data) {
  241. console.log('huoqu111',data)
  242. if(data){
  243. console.log('huoqu1222',data)
  244. uni.showLoading({
  245. title: '加载中'
  246. })
  247. uni.login({
  248. provider: "weixin",
  249. success: async loginRes => {
  250. console.log(loginRes)
  251. let code = loginRes.code // 获取开发code
  252. handleFsUserWx({
  253. code: code,
  254. appId:this.appid,
  255. userId:data.userId
  256. })
  257. .then( res => {
  258. if(res.code==200){
  259. console.log(res)
  260. uni.hideLoading();
  261. uni.showToast({
  262. icon:'none',
  263. title: "登录成功",
  264. });
  265. this.userinfos=uni.getStorageSync('userinfos')
  266. uni.getStorageSync('TOKEN_WEXIN');
  267. this.userInfo=uni.getStorageSync('userInfo');
  268. this.isLogin = true
  269. setTimeout(()=>{
  270. this.registerCourse()
  271. },200)
  272. }else if(res.code==406){
  273. uni.hideLoading();
  274. uni.showToast({
  275. icon:'none',
  276. title: '该用户已成为其他销售会员',
  277. });
  278. }else{
  279. uni.hideLoading();
  280. uni.showToast({
  281. icon:'none',
  282. title: res.msg,
  283. });
  284. }
  285. })
  286. },
  287. })
  288. }else{
  289. uni.navigateTo({
  290. url:'/pages_course/webview?H5course='+uni.getStorageSync('H5course')
  291. })
  292. }
  293. },
  294. shouquan(){
  295. if(this.userinfos.nickname==''){
  296. uni.showToast({
  297. icon:'none',
  298. title: "请先授权微信昵称",
  299. });
  300. }
  301. },
  302. confimrname(){
  303. if(this.userinfos.nickname==''){
  304. uni.showToast({
  305. icon:'none',
  306. title: "请授权微信昵称",
  307. });
  308. return
  309. }
  310. if(this.userinfos.avatar==''){
  311. uni.showToast({
  312. icon:'none',
  313. title: "请授权微信头像",
  314. });
  315. return
  316. }
  317. uni.setStorageSync('userInfos',this.userinfos)
  318. this.editUserA()
  319. this.userlogo=false
  320. },
  321. onChooseAvatar(e){
  322. this.userinfos.avatar=e.detail.avatarUrl
  323. console.log(e.detail.avatarUrl)
  324. uni.uploadFile({
  325. url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
  326. filePath: e.detail.avatarUrl,
  327. name: 'file',
  328. formData: {
  329. 'user': 'test' // 上传附带参数
  330. },
  331. success: (uploadFileRes) => {
  332. console.log(uploadFileRes)
  333. // 根据接口具体返回格式 赋值具体对应url
  334. var data=JSON.parse(uploadFileRes.data)
  335. this.headImg=uni.getStorageSync('requestPath')+data.fileName
  336. this.userinfos.avatar=data.url
  337. }
  338. });
  339. },
  340. onNickNameInput(e){
  341. console.log(e)
  342. this.userinfos.nickname=e.detail.value
  343. },
  344. nato(){
  345. uni.navigateTo({
  346. url:'/pages_course/webview'
  347. })
  348. },
  349. handleAgree(){
  350. console.log(144443)
  351. if(this.isVip==1){
  352. uni.showToast({
  353. title: '您已成为会员!',
  354. icon: 'none',
  355. duration: 2000,
  356. })
  357. }else{
  358. this.goLogin()
  359. uni.showToast({
  360. title: this.viptext,
  361. icon: 'none',
  362. duration: 2000,
  363. })
  364. }
  365. },
  366. userInfologin(e) {
  367. console.log(123333)
  368. this.userdisabled=true
  369. var that=this;
  370. uni.showLoading({
  371. title: "加载中..."
  372. });
  373. if (e.mp.detail.errMsg == 'getUserInfo:ok') {
  374. this.utils.getProvider()
  375. .then(provider => {
  376. if (!provider) {
  377. this.userdisabled=false
  378. reject()
  379. }
  380. // uni登录
  381. uni.login({
  382. provider: provider,
  383. success: async loginRes => {
  384. let code = loginRes.code // 获取开发code
  385. this.userinfos=uni.getStorageSync('userInfos')?uni.getStorageSync('userInfos'):this.userinfos
  386. loginByMiniApp({
  387. encryptedData: e.mp.detail.encryptedData,
  388. iv: e.mp.detail.iv,
  389. code: code,
  390. nickname:this.userinfos.nickname?this.userinfos.nickname:'',
  391. avatar:this.userinfos.avatar?this.userinfos.avatar:'',
  392. companyId : this.companyid || '',
  393. companyUserId:this.companyUserId || 0,
  394. authType:this.authType,
  395. appId:this.appid,
  396. projectId:this.projectId
  397. })
  398. .then( res => {
  399. if(res.code==200){
  400. // console.log(res)
  401. uni.hideLoading();
  402. uni.showToast({
  403. icon:'none',
  404. title: "登录成功",
  405. });
  406. uni.setStorageSync('TOKEN_WEXIN', res.token);
  407. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  408. this.userInfo=res.user;
  409. uni.hideLoading()
  410. this.userdisabled=false
  411. // this.isLogin = true
  412. setTimeout(()=>{
  413. this.checkUserInfoA()
  414. // this.registerCourse()
  415. },200)
  416. }else if(res.code==406){
  417. uni.hideLoading();
  418. uni.showToast({
  419. icon:'none',
  420. title: '该用户已成为其他销售会员',
  421. });
  422. }
  423. else{
  424. uni.hideLoading();
  425. uni.showToast({
  426. icon:'none',
  427. title: res.msg,
  428. });
  429. }
  430. })
  431. .catch(res=>{
  432. this.userdisabled=false
  433. })
  434. },
  435. fail() {
  436. this.userdisabled=false
  437. }
  438. })
  439. })
  440. .catch(err => {
  441. this.userdisabled=false
  442. uni.showToast({
  443. icon:'none',
  444. title: err,
  445. });
  446. })
  447. } else {
  448. this.userdisabled=false
  449. uni.showToast({
  450. title: '已拒绝授权',
  451. icon: 'none',
  452. duration: 2000,
  453. })
  454. }
  455. },
  456. // 微信用户手机号登录
  457. phoneLogin(e) {
  458. var that=this;
  459. uni.showLoading({
  460. title: "加载中..."
  461. });
  462. if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
  463. this.utils.getProvider()
  464. .then(provider => {
  465. if (!provider) {
  466. reject()
  467. }
  468. // uni登录
  469. uni.login({
  470. provider: provider,
  471. success: async loginRes => {
  472. let code = loginRes.code // 获取开发code
  473. this.userinfos=uni.getStorageSync('userInfos')?uni.getStorageSync('userInfos'):this.userinfos
  474. loginByMiniApp({
  475. encryptedData: e.mp.detail.encryptedData,
  476. iv: e.mp.detail.iv,
  477. code: code,
  478. nickname:this.userinfos.nickname?this.userinfos.nickname:'',
  479. avatar:this.userinfos.avatar?this.userinfos.avatar:'',
  480. companyId : this.companyid || '',
  481. companyUserId:this.companyUserId || 0,
  482. authType:this.authType,
  483. appId:this.appid,
  484. projectId:this.projectId
  485. })
  486. .then( res => {
  487. if(res.code==200){
  488. // console.log(res)
  489. uni.hideLoading();
  490. uni.showToast({
  491. icon:'none',
  492. title: "登录成功",
  493. });
  494. uni.setStorageSync('TOKEN_WEXIN', res.token);
  495. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  496. this.userInfo=res.user;
  497. uni.hideLoading()
  498. // this.isLogin = true
  499. // setTimeout(()=>{
  500. // this.registerCourse()
  501. // },200)
  502. setTimeout(()=>{
  503. this.checkUserInfoA()
  504. // this.registerCourse()
  505. },200)
  506. }else if(res.code==406){
  507. uni.hideLoading();
  508. uni.showToast({
  509. icon:'none',
  510. title: '该用户已成为其他销售会员',
  511. });
  512. }
  513. else{
  514. uni.hideLoading();
  515. uni.showToast({
  516. icon:'none',
  517. title: res.msg,
  518. });
  519. }
  520. })
  521. }
  522. })
  523. })
  524. .catch(err => {
  525. uni.showToast({
  526. icon:'none',
  527. title: err,
  528. });
  529. })
  530. } else {
  531. uni.showToast({
  532. title: '已拒绝授权',
  533. icon: 'none',
  534. duration: 2000,
  535. })
  536. }
  537. },
  538. getWechatCode() {
  539. if (this.isWechat) {
  540. // let appid = "wx961fadab9bcb792b"; //微信APPid(福本源)
  541. // let appid = "wx93ce67750e3cfba3"; //微信APPid(云联融智)
  542. // let appid = "wxea1da2b708ab3c2f"; //微信APPid(蜂巢快药)
  543. // let appid = "wx3de90a39feb8107a"; //微信APPid(云联精选看课)
  544. // let appid = "wxec49f9d783abf233"; //微信APPid(惠名大药房)
  545. // let appid = "wx5a0f7e1932e2689e"; //微信APPid(同顺堂)
  546. // let appid = "wxe0b82a0018449a62"; //微信APPid(良苗)
  547. // let appid = "wx568ea6b70350c585"; //微信APPid(倍力优)
  548. let appid = "wx0d021524695f1943"; //微信APPid(百年康城)
  549. // let appid = "wx090c5f399d65456e"; //微信APPid(青岛市德瑞康)
  550. // let appid = "wx52298c1781d5cc99"; //微信APPid(金慷建)
  551. let code = this.getUrlCode().code; //是否存在code
  552. let local = window.location.href;
  553. if (code == null || code === "") {
  554. let urlPaths = local.split("/registerCourse");
  555. uni.setStorageSync('beforLoginPage', urlPaths[1]);
  556. //不存在就打开上面的地址进行授权
  557. window.location.href =
  558. "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
  559. appid +
  560. "&redirect_uri=" +
  561. encodeURIComponent(local) +
  562. "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
  563. } else {
  564. this.code = code;
  565. this.loginByMp()
  566. }
  567. }else{
  568. uni.showToast({
  569. title: '请在微信浏览器中打开',
  570. icon:'error'
  571. })
  572. }
  573. },
  574. getUrlCode() {
  575. // 截取url中的code方法
  576. var url = location.search;
  577. var theRequest = new Object();
  578. if (url.indexOf("?") != -1) {
  579. var str = url.substr(1);
  580. var strs = str.split("&");
  581. for (var i = 0; i < strs.length; i++) {
  582. theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1];
  583. }
  584. }
  585. return theRequest;
  586. },
  587. loginByMp() {
  588. if (this.code == null) {
  589. return;
  590. }
  591. uni.showLoading({
  592. title: "处理中..."
  593. });
  594. loginByMp({code:this.code}).then(res => {
  595. uni.hideLoading();
  596. if (res.code == 200) {
  597. uni.setStorageSync('TOKEN_KEY', res.token);
  598. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  599. this.userInfo= res.user
  600. let beforLoginUrl = uni.getStorageSync('beforLoginPage');
  601. this.isLogin = true
  602. this.registerCourse()
  603. } else {
  604. uni.showToast({
  605. title: res.msg,
  606. icon: 'none'
  607. });
  608. }
  609. },
  610. err => {}
  611. );
  612. },
  613. // 成为会员
  614. registerCourse() {
  615. console.log(123333)
  616. this.isVip = 0
  617. // 确保从本地存储重新获取最新数据
  618. // if(uni.getStorageSync('userInfo')){
  619. // this.userInfo=JSON.parse(uni.getStorageSync('userInfo'));
  620. // }
  621. // if (!this.userInfo.userId) {
  622. // // 空值检查
  623. // uni.showToast({ title: '用户未登录或信息不完整', icon: 'none' });
  624. // return;
  625. // }
  626. if(this.tagIds==null){
  627. this.tagIds=""
  628. }
  629. // console.log(this.tagIds)
  630. const data={
  631. userId:this.userInfo.userId,
  632. companyUserId:this.companyUserId,
  633. companyId:this.companyid,
  634. tagIds:this.tagIds,
  635. projectId:this.projectId
  636. }
  637. if(this.isLogin) {
  638. registerCourses(data).then(res=>{
  639. if(res.code == 200) {
  640. this.isVip = 1
  641. this.isbecomevip=1
  642. this.viptext='您已成为会员'
  643. uni.showToast({
  644. title: '注册成功',
  645. icon:'none'
  646. })
  647. } else {
  648. this.isbecomevip=1
  649. // console.log(this.isbecomevip)
  650. this.viptext=res.msg
  651. uni.showToast({
  652. icon:'none',
  653. title: res.msg
  654. })
  655. }
  656. })
  657. } else {
  658. // #ifdef H5
  659. this.getWechatCode()
  660. // #endif
  661. }
  662. }
  663. }
  664. }
  665. </script>
  666. <style lang="scss" scoped>
  667. .subname{
  668. background-color: #00aa00;
  669. color: #fff;
  670. }
  671. .subavt{
  672. background-color: #fff;
  673. border: 2rpx #0a0 solid;
  674. color: #00aa00;
  675. }
  676. .boxweixin{
  677. width: 44rpx;
  678. height: 44rpx;
  679. border-radius: 50%;
  680. text-align: center;
  681. line-height: 34rpx;
  682. color: #0a0;
  683. }
  684. .boxnosel{
  685. border: #757575 4rpx solid;
  686. }
  687. .boxsel{
  688. border: #0a0 4rpx solid;
  689. }
  690. .button-container {
  691. position: relative;
  692. width: 240rpx;
  693. }
  694. .hidden-input {
  695. position: absolute;
  696. top: 0;
  697. left: 0;
  698. width: 100%;
  699. height: 100%;
  700. opacity: 0;
  701. z-index: 2;
  702. }
  703. .custom-button {
  704. position: relative;
  705. z-index: 1;
  706. /* 其他样式 */
  707. width:100%;
  708. margin: 0 auto;
  709. height: 80rpx;
  710. line-height: 60rpx;
  711. font-size: 28rpx;
  712. padding: 10rpx 20rpx;
  713. }
  714. .submitname{
  715. width: 90%;
  716. margin: 0 auto;
  717. text-align: center;
  718. padding: 30rpx;
  719. margin-top: 40rpx;
  720. }
  721. .sub{
  722. background-color: #f0f0f0;
  723. color: #0a0;
  724. }
  725. .subact{
  726. background-color: #0a0;
  727. color: #fff;
  728. }
  729. .userlogo{
  730. height: 760rpx;
  731. }
  732. .getlogo{
  733. width:240rpx;
  734. background-color: #fff;
  735. // padding: 10rpx 20rpx;
  736. }
  737. ::v-deep .u-popup {
  738. flex: 0 !important;
  739. }
  740. // .submitname{
  741. // width: 60%;
  742. // background-color: #05a8ee;
  743. // color: #fff;
  744. // margin: 0 auto;
  745. // border-radius: 80rpx;
  746. // text-align: center;
  747. // padding: 20rpx;
  748. // margin-top: 40rpx;
  749. // }
  750. .userlogo{
  751. height: 760rpx;
  752. }
  753. .getlogo{
  754. width:calc(60% - 40rpx);
  755. margin: 0 auto;
  756. background-color: #fff;
  757. padding: 10rpx 20rpx;
  758. image{
  759. width: 80rpx !important;
  760. height: 80rpx !important;
  761. }
  762. }
  763. .footer-tips {
  764. // margin-top: 14rpx;
  765. position: fixed;
  766. width: 100%;
  767. bottom: 44rpx;
  768. text-align: center;
  769. font-family: PingFang SC,PingFang SC;
  770. font-weight: 500;
  771. font-size: 12px;
  772. color: #bbb;
  773. transform: scale(0.8);
  774. }
  775. .content {
  776. image {
  777. width: 300rpx;
  778. height: 300rpx;
  779. }
  780. }
  781. .bolds {
  782. color: #999;
  783. font-size: 16px;
  784. height: auto;
  785. line-height: inherit;
  786. margin-bottom: 0;
  787. width: 304px;
  788. word-break: break-all;
  789. text-align: center;
  790. margin: 50rpx 0 100rpx 0;
  791. }
  792. .sure {
  793. width: 500rpx;
  794. background-color: #1777ff;
  795. line-height: 88rpx;
  796. text-align: center;
  797. border-radius: 8rpx;
  798. color: #fff;
  799. }
  800. .btns{
  801. position: relative;
  802. width: 630rpx;
  803. height: 80rpx;
  804. .author-btn{
  805. z-index:100;
  806. position: absolute;
  807. width: 630rpx;
  808. height: 80rpx;
  809. line-height: 80rpx;
  810. text-align: center;
  811. background: #1777ff;
  812. border-radius: 40rpx;
  813. font-size: 30rpx;
  814. font-family: PingFang SC;
  815. font-weight: 500;
  816. color: rgba(255, 255, 255, 1);
  817. }
  818. }
  819. </style>