becomeVIP.vue 22 KB

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