becomeVIP.vue 22 KB

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