activity.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992
  1. <template>
  2. <view class="content">
  3. <view class="detail-cont">
  4. <view class="title">{{item.title}}</view>
  5. <view class="info">
  6. <view class="reads">阅读数:{{item.views}}</view>
  7. <view class="time">{{item.publishTime}}</view>
  8. </view>
  9. <!-- 正文 -->
  10. <view class="full-text">
  11. <view v-html="item.contents"></view>
  12. </view>
  13. </view>
  14. <!-- 最近阅读 -->
  15. <view class="recent-reads">
  16. <!-- <view class="left">
  17. <text class="label">最近阅读</text>
  18. <view class="peop-box" @click="showUsers">
  19. <view class="head-box">
  20. <view class="head" v-for="(subitem,j) in views" :key="j">
  21. <image :src="subitem.avatar==null?'/static/images/detault_head.jpg':subitem.avatar" mode=""></image>
  22. </view>
  23. </view>
  24. <image class="arrow" src="/static/images/arrow_gray.png" mode=""></image>
  25. </view>
  26. </view> -->
  27. <!-- <view class="share-btn" v-if="!isExpiry&&collectType!=1">
  28. <image src="/static/images/share.png" mode=""></image>
  29. <text>分享</text>
  30. <button class="share" data-name="shareBtn" open-type="share">分享</button>
  31. </view> -->
  32. <view class="recent-reads">
  33. <view class="thumb-up-fill x-c" v-if="collectType==1 || !isExpiry">已点赞</view>
  34. <view class="thumb-up x-c" v-if="collectType!=1&&isExpiry" @click="handleReceive">点赞</view>
  35. <!-- <u-icon name="thumb-up-fill" color="#1BB99D" size="32" v-if="collectType==1"></u-icon>
  36. <u-icon name="thumb-up" color="#333" size="32" v-if="collectType!=1&&isExpiry" @click="handleReceive"></u-icon> -->
  37. </view>
  38. </view>
  39. <!-- 咨询按钮 -->
  40. <!-- <view class="inquiry">
  41. <view class="content">
  42. <image src="/static/images/consult.png" mode=""></image>
  43. <text class="text">咨询</text>
  44. <button class="contact-btn" open-type="contact"></button>
  45. </view>
  46. </view> -->
  47. <view>
  48. <u-popup :show="show" mode="center" bgColor="transparent" :closeOnClickOverlay="false" overlayOpacity="0.7">
  49. <view class="popup-box">
  50. <image class="activity_jb" src="https://cdn.his.cdwjyyh.com/minapp/course/activity_jb.png"
  51. mode="heightFix"></image>
  52. <text class="popup-tit">恭喜您获得</text>
  53. <view class="con">
  54. <view class="numbox color_FB2205"><text class="num">+{{coinAmount||0}}</text>芳华币</view>
  55. <view>您的芳华币总额:<text class="color_FB2205" style="font-weight: 600;">{{balance||0}}</text></view>
  56. </view>
  57. <!-- <view class="popup-tips">赶紧去芳华未来APP,兑换好物吧~</view> -->
  58. <view class="popbtn x-c" @click="show=false">我知道啦</view>
  59. </view>
  60. <!-- <view class="popup-tips" style="color: #FFFFFF;margin-top: 60rpx;">兑换提示:请前往芳华未来APP兑换</view> -->
  61. <!-- <view class="popup-tips" style="color: #FFC05C;text-decoration-line: underline;" @click="navTo">如何下载芳华未来APP?</view> -->
  62. </u-popup>
  63. <u-popup :show="userlogo" mode="bottom" round='12'>
  64. <view class="userlogo column">
  65. <view class="mtb30 justify-start align-center ml20">
  66. <u-avatar src="/static/logo.png" size="50"></u-avatar>
  67. <view class="bold mlr20">坤德精选a</view>
  68. <view>申请</view>
  69. </view>
  70. <view class="bold fs36 ml20">授权你的昵称头像信息</view>
  71. <view class="mtb20 justify-between align-center plr20">
  72. <view class="justify-start align-center">
  73. <view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
  74. <view v-if="userinfos.nickname">
  75. <u-icon name="checkbox-mark" color="#00aa00" size="22"></u-icon>
  76. </view>
  77. </view>
  78. <view class="ml20">
  79. <view class="base-color-3 bold">第一步</view>
  80. <view class="fs32 base-color-9">请点击授权微信昵称</view>
  81. </view>
  82. </view>
  83. <view class="button-container">
  84. <input
  85. type="nickname"
  86. class="hidden-input"
  87. @blur="onNickNameInput"
  88. @input="onNickNameInput"
  89. />
  90. <button class="custom-button" :class="nameuser==''?'subname':'subavt'">{{nameuser?"已授权":'允许授权'}}</button>
  91. </view>
  92. </view>
  93. <!-- <view class="mtb20 justify-between align-center plr20 mt40">
  94. <view class="justify-start align-center">
  95. <view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
  96. <view v-if="userinfos.avatar">√</view>
  97. </view>
  98. <view class="ml20">
  99. <view class="base-color-3 bold">第二步</view>
  100. <view class="fs32 base-color-9">请点击授权微信头像</view>
  101. </view>
  102. </view>
  103. <view class="button-container">
  104. <button open-type="chooseAvatar" @chooseavatar="onChooseAvatar" class="hidden-input"
  105. v-if="nameuser">
  106. 允许授权
  107. </button>
  108. <button class="custom-button sub" @click="shouquan" v-if="nameuser==''">允许授权</button>
  109. <button class="custom-button " :class="avataruser==''?'subname':'subavt'"
  110. v-else>{{avataruser?"已授权":'允许授权'}}</button>
  111. </view>
  112. </view> -->
  113. <view class="submitname" @click="confimrname" :class="nameuser&&avataruser?'subact':'sub'">确定</view>
  114. </view>
  115. </u-popup>
  116. <u-popup :show="showPhonePopup" mode="bottom" round="12" :closeOnClickOverlay="false" @close="showPhonePopup=false">
  117. <view class="column" style="padding: 40rpx; min-height: 400rpx; background: #fff; border-radius: 24rpx 24rpx 0 0;">
  118. <view style="text-align: center; font-weight: bold; font-size: 36rpx; margin-bottom: 30rpx;">授权手机号</view>
  119. <view style="text-align: center; color: #666; font-size: 30rpx; margin-bottom: 50rpx;">为了提供更好的服务,我们需要获取您的手机号</view>
  120. <view style="display: flex; flex-direction: column; gap: 20rpx;">
  121. <button
  122. open-type="getPhoneNumber"
  123. @getphonenumber="getPhoneNumber"
  124. style="width: 100%; background: #00aa00; color: #fff; border-radius: 44rpx; height: 88rpx; line-height: 88rpx; font-size: 32rpx;"
  125. >
  126. 一键授权
  127. </button>
  128. <!-- <view
  129. @click="showPhonePopup=false"
  130. style="width: 100%; text-align: center; height: 88rpx; line-height: 88rpx; color: #999; font-size: 30rpx;"
  131. >
  132. 暂不授权
  133. </view> -->
  134. </view>
  135. </view>
  136. </u-popup>
  137. </view>
  138. </view>
  139. </template>
  140. <script>
  141. import {mapGetters} from 'vuex';
  142. import { getLuckyBagInfo, receiveLuckyBag,loginByMp,editUser,isAddCompanyUser,registerQwFsUserFinish,handleFsUserWx,setIPhoneNumber,getByAppId}from '@/api/course.js';
  143. import {getArticleByArticleId,updateView} from '@/api/article'
  144. export default {
  145. data() {
  146. return {
  147. articleId:'',
  148. item:{},
  149. views:[],
  150. showPhonePopup: false,
  151. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  152. show: false,
  153. status: 0,
  154. recordId: '',
  155. urlOption: {},
  156. sortLink: '',
  157. isLogin: false,
  158. isLoginH5: 1, // 1服务号授权
  159. authType: 1, //授权方式
  160. collectType: 0, // 领取状态(0-已发放 1-已领取 2-已失效)
  161. isExpiry: true, // false 失效 true 有效
  162. coinAmount: 0,
  163. balance: 0,
  164. chatId: '',
  165. userlogo:false,
  166. imgname:'',
  167. userinfos:{
  168. nickname:"",
  169. avatar:""
  170. },
  171. btnLoading: false,
  172. registerLoading: false,
  173. errMSg: '',
  174. code:'',
  175. goReceive: 0
  176. };
  177. },
  178. computed: {
  179. ...mapGetters(['coureLogin']),
  180. nameuser() {
  181. return this.userinfos.nickname
  182. },
  183. avataruser() {
  184. return this.userinfos.avatar
  185. },
  186. },
  187. watch: {
  188. coureLogin: {
  189. immediate: true, // 页面一进入就检查一次
  190. handler(val) {
  191. if (val == 2 && this.isLogin) {
  192. console.log("注册AppToken失效,请重新登录")
  193. uni.removeStorageSync('web_userInfo');
  194. uni.removeStorageSync('auto_userInfo');
  195. uni.removeStorageSync('TOKEN_WEXIN');
  196. this.isLogin = false
  197. this.goReceive = 0
  198. this.goLogin()
  199. }
  200. }
  201. }
  202. },
  203. //发送给朋友
  204. onShareAppMessage(res) {
  205. return {
  206. title: this.item.title,
  207. imageUrl: this.item.imageUrl,
  208. path: '/pages/healthy/detail=?articleId'+this.articleId,
  209. }
  210. },
  211. onLoad(option) {
  212. this.articleId=option.articleId||275;
  213. this.urlOption = option.link ? JSON.parse(decodeURIComponent(option.link)) : {};
  214. this.sortLink = this.urlOption.link || ''
  215. this.chatId = this.urlOption.chatId || ''
  216. this.recordId =this.urlOption.businessId || ''
  217. console.log(this.sortLink)
  218. uni.$on('usercode', (data) => {
  219. if (data) {
  220. this.code = data.code
  221. this.loginFsUserWx(data)
  222. }
  223. })
  224. this.getLuckyBagInfo()
  225. const user = uni.getStorageSync('auto_userInfo')&&JSON.stringify(uni.getStorageSync('auto_userInfo'))!='{}' ? JSON.parse(uni.getStorageSync('auto_userInfo')):'';
  226. this.utils.isLoginCourse().then(
  227. isLogin => {
  228. this.isLogin = isLogin
  229. if (this.isLogin&&user) {
  230. } else {
  231. this.goReceive = 0
  232. this.goLogin()
  233. }
  234. },
  235. rej => {}
  236. );
  237. // if(this.utils.checkToken()){
  238. // this.updateView();
  239. // }
  240. },
  241. beforeDestroy() {
  242. uni.$off('usercode')
  243. },
  244. onUnload() {
  245. uni.$off('usercode')
  246. },
  247. onShow() {
  248. this.getArticleByArticleId();
  249. },
  250. methods:{
  251. updateView(){
  252. updateView(this.articleId).then(
  253. res => {
  254. },
  255. rej => {}
  256. );
  257. },
  258. getArticleByArticleId(){
  259. let data = {articleId:this.articleId};
  260. getArticleByArticleId(data).then(
  261. res => {
  262. if(res.code==200){
  263. this.item=res.data;
  264. this.views=res.views;
  265. }else{
  266. uni.showToast({
  267. icon:'none',
  268. title: "请求失败",
  269. });
  270. }
  271. },
  272. rej => {}
  273. );
  274. },
  275. // 查看阅读用户
  276. showUsers() {
  277. uni.navigateTo({
  278. url: './readUsers?articleId='+this.articleId
  279. })
  280. },
  281. getPhoneNumber(e) {
  282. if (e.detail.errMsg === 'getPhoneNumber:ok') {
  283. uni.showLoading({ title: '授权中...' });
  284. uni.login({
  285. provider: 'weixin',
  286. success: (loginRes) => {
  287. const params = {
  288. code: loginRes.code,
  289. encryptedData: e.detail.encryptedData,
  290. iv: e.detail.iv,
  291. appId: getApp().globalData.appId
  292. };
  293. setIPhoneNumber(params).then(res => {
  294. uni.hideLoading();
  295. if (res.code === 200|| res.code == 20003) {
  296. uni.showToast({ title: '授权成功', icon: 'success' });
  297. uni.setStorageSync('auto_userInfo', JSON.stringify(res.user));
  298. uni.setStorageSync('web_userInfo', res.user);
  299. this.showPhonePopup = false;
  300. this.registerQwFsUserFinish()
  301. } else {
  302. uni.showToast({ title: res.msg || '授权失败', icon: 'none' });
  303. }
  304. }).catch(() => {
  305. uni.hideLoading();
  306. uni.showToast({ title: '授权失败', icon: 'none' });
  307. });
  308. },
  309. fail: () => {
  310. uni.hideLoading();
  311. uni.showToast({ title: '获取登录凭证失败', icon: 'none' });
  312. }
  313. });
  314. } else {
  315. uni.showToast({ title: '您取消了授权', icon: 'none' });
  316. }
  317. },
  318. registerQwFsUserFinish() {
  319. uni.showLoading({
  320. title: '领取中...'
  321. });
  322. registerQwFsUserFinish(this.urlOption).then(res=>{
  323. uni.hideLoading()
  324. if(res.code==200) {
  325. this.receiveLuckyBag()
  326. } else {
  327. if (this.chatId) {
  328. this.userlogo = true
  329. } else {
  330. this.getAddCompanyUser()
  331. }
  332. }
  333. }).catch(()=>{
  334. uni.hideLoading()
  335. })
  336. },
  337. getAddCompanyUser() {
  338. if(this.registerLoading) return;
  339. uni.showLoading({
  340. title: '注册中'
  341. })
  342. this.registerLoading = true
  343. isAddCompanyUser(this.urlOption).then(res=>{
  344. this.registerLoading = false
  345. uni.hideLoading()
  346. if(res.code==200) {
  347. this.receiveLuckyBag()
  348. } else {
  349. uni.showToast({
  350. title: res.msg,
  351. icon: 'none'
  352. });
  353. }
  354. }).catch(()=>{
  355. this.registerLoading = false
  356. uni.hideLoading()
  357. })
  358. },
  359. //修改用户昵称以及头像
  360. editUserA(){
  361. this.userinfos=uni.getStorageSync('web_userInfo')?uni.getStorageSync('web_userInfo'):this.userinfos
  362. const data={
  363. nickName:this.userinfos.nickname,
  364. // avatar:this.userinfos.avatar,
  365. }
  366. editUser(data).then(res=>{
  367. if(res.code==200){
  368. this.isLogin = true
  369. uni.showToast({
  370. icon:'none',
  371. title:'修改成功!',
  372. });
  373. setTimeout(()=>{
  374. this.getAddCompanyUser()
  375. },100)
  376. }else{
  377. uni.removeStorageSync('web_userInfo')
  378. uni.showToast({
  379. icon:'none',
  380. title:res.msg+'请重新领取福袋',
  381. });
  382. }
  383. })
  384. },
  385. shouquan(){
  386. if(this.userinfos.nickname==''){
  387. uni.showToast({
  388. icon:'none',
  389. title: "请先授权微信昵称",
  390. });
  391. }
  392. },
  393. confimrname(){
  394. if(this.userinfos.nickname==''){
  395. uni.showToast({
  396. icon:'none',
  397. title: "请授权微信昵称",
  398. });
  399. return
  400. }
  401. // if(this.userinfos.avatar==''){
  402. // uni.showToast({
  403. // icon:'none',
  404. // title: "请授权微信头像",
  405. // });
  406. // return
  407. // }
  408. uni.setStorageSync('web_userInfo',this.userinfos)
  409. this.editUserA()
  410. this.userlogo=false
  411. },
  412. onNickNameInput(e){
  413. console.log(e)
  414. this.userinfos.nickname=e.detail.value
  415. },
  416. onChooseAvatar(e){
  417. this.userinfos.avatar=e.detail.avatarUrl
  418. uni.uploadFile({
  419. url: 'https://h5api.his.cdwjyyh.com'+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
  420. filePath: e.detail.avatarUrl,
  421. name: 'file',
  422. formData: {
  423. 'user': 'test' // 上传附带参数
  424. },
  425. success: (uploadFileRes) => {
  426. console.log(uploadFileRes)
  427. // 根据接口具体返回格式 赋值具体对应url
  428. var data=JSON.parse(uploadFileRes.data)
  429. this.headImg=uni.getStorageSync('requestPath')+data.fileName
  430. this.userinfos.avatar=data.url
  431. }
  432. });
  433. },
  434. handleReceive() {
  435. if(this.collectType!=1&&this.isExpiry) {
  436. if(this.errMSg){
  437. uni.showToast({
  438. icon:'none',
  439. title: this.errMSg,
  440. });
  441. return
  442. }
  443. const user = uni.getStorageSync('auto_userInfo')&&JSON.stringify(uni.getStorageSync('auto_userInfo'))!='{}' ? JSON.parse(uni.getStorageSync('auto_userInfo')):'';
  444. this.utils.isLoginCourse().then(
  445. isLogin => {
  446. this.isLogin = isLogin
  447. if (this.isLogin&&user) {
  448. if(user&&user.phone) {
  449. this.registerQwFsUserFinish()
  450. } else {
  451. this.showPhonePopup = true
  452. }
  453. } else {
  454. this.goReceive =1
  455. this.goLogin()
  456. }
  457. },
  458. rej => {}
  459. );
  460. } else {
  461. this.collectType==1
  462. }
  463. },
  464. receiveLuckyBag() {
  465. if(this.btnLoading) {
  466. return
  467. }
  468. uni.showLoading({
  469. title: '领取中...',
  470. });
  471. this.btnLoading = true
  472. const param = {
  473. ...this.urlOption,
  474. recordId: this.recordId
  475. }
  476. receiveLuckyBag(param).then(res => {
  477. uni.hideLoading()
  478. this.btnLoading = false
  479. if(res.code == 200) {
  480. this.coinAmount = res.data.coinAmount || 0
  481. this.balance = res.data.balance || 0
  482. this.collectType = 1
  483. // this.show = true
  484. uni.showToast({
  485. title: "恭喜您获得"+this.coinAmount+"芳华币。",
  486. icon: 'none'
  487. });
  488. } else {
  489. uni.showModal({
  490. title: '领取失败',
  491. content: res.msg,
  492. showCancel: false,
  493. success: function (res) {
  494. if (res.confirm) {
  495. console.log('用户点击确定');
  496. } else if (res.cancel) {
  497. console.log('用户点击取消');
  498. }
  499. }
  500. });
  501. }
  502. }).catch(()=>{
  503. this.btnLoading = false
  504. })
  505. },
  506. navTo() {
  507. this.show = false
  508. uni.navigateTo({
  509. url: '/pages_course/appDownload'
  510. })
  511. },
  512. getLuckyBagInfo() {
  513. this.errMSg = ''
  514. uni.hideLoading()
  515. getLuckyBagInfo({
  516. recordId: this.recordId
  517. }).then(res => {
  518. if (res.code == 200) {
  519. this.collectType = res.data.collectType || 0; //领取状态(0-已发放 1-已领取 2-已失效)
  520. this.isExpiry = res.data.isExpiry; //false 失效 true 有效
  521. } else {
  522. this.errMSg = res.msg
  523. uni.showToast({
  524. title: res.msg,
  525. icon: 'none'
  526. });
  527. }
  528. })
  529. },
  530. goLogin() {
  531. getByAppId(getApp().globalData.appId).then(res=>{
  532. if(res.code == 200) {
  533. this.authType = res.config.authType || 1
  534. if(this.authType == 1) {
  535. this.code = ''
  536. this.goWXLogin()
  537. } else if(this.authType==2) {
  538. this.loginFsUserWx()
  539. }
  540. } else {
  541. uni.showToast({
  542. title: res.msg,
  543. icon: 'error'
  544. })
  545. }
  546. }).catch((err)=>{
  547. uni.showToast({
  548. title: JSON.stringify(err),
  549. icon: 'error'
  550. })
  551. })
  552. },
  553. goWXLogin() {
  554. this.utils.getProvider().then(provider => {
  555. console.log('当前的环境商', provider)
  556. if (!provider) {
  557. reject()
  558. }
  559. uni.login({
  560. provider: provider,
  561. success: async loginRes => {
  562. console.log(loginRes)
  563. uni.getUserInfo({
  564. provider: provider,
  565. success: (infoRes) => {
  566. uni.showToast({
  567. title: '登录中...',
  568. icon: 'loading'
  569. });
  570. loginByMp({
  571. code: loginRes.code,
  572. encryptedData: infoRes.encryptedData,
  573. iv: infoRes.iv,
  574. appId: getApp().globalData.appId
  575. }).then(res => {
  576. uni.hideLoading();
  577. if (res.code == 200) {
  578. // this.checkUserInfoA()
  579. this.$store.commit('setCoureLogin', 1);
  580. uni.setStorageSync('AppTokenmini_RTCourse', res.token);
  581. uni.setStorageSync('auto_userInfo', JSON.stringify(res.user));
  582. this.isLogin = true
  583. if(this.goReceive == 1) {
  584. if(res.user&&res.user.phone) {
  585. this.registerQwFsUserFinish()
  586. } else {
  587. this.showPhonePopup = true
  588. }
  589. }
  590. } else {
  591. uni.showToast({
  592. title: res.msg,
  593. icon: 'none'
  594. });
  595. }
  596. }).catch(err => {
  597. uni.hideLoading();
  598. uni.showToast({
  599. icon: 'none',
  600. title: "登录失败,请重新登录",
  601. });
  602. });
  603. }
  604. });
  605. }
  606. })
  607. }).catch(err => {})
  608. },
  609. async loginFsUserWx(data) {
  610. if (data) {
  611. console.log('huoqu1222', data)
  612. uni.showLoading({
  613. title: '登录中'
  614. })
  615. uni.login({
  616. provider: "weixin",
  617. success: async loginRes => {
  618. console.log(loginRes)
  619. let code = loginRes.code // 获取开发code
  620. handleFsUserWx({
  621. code: code,
  622. appId: getApp().globalData.appId,
  623. userId: data.userId
  624. })
  625. .then(res => {
  626. uni.hideLoading();
  627. if (res.code == 200) {
  628. this.code = ''
  629. console.log("loginFsUserWx:", res)
  630. let token = uni.getStorageSync('TOKEN_WEXIN');
  631. let user = uni.getStorageSync('web_userInfo')
  632. this.$store.commit('setCoureLogin', 1);
  633. uni.setStorageSync('AppTokenmini_RTCourse', token);
  634. uni.setStorageSync('auto_userInfo', JSON.stringify(user));
  635. this.isLogin = true
  636. if(this.goReceive == 1) {
  637. if(user&&user.phone) {
  638. this.registerQwFsUserFinish()
  639. } else {
  640. this.showPhonePopup = true
  641. }
  642. }
  643. } else {
  644. uni.showToast({
  645. icon: 'none',
  646. title: res.msg,
  647. });
  648. }
  649. })
  650. },
  651. })
  652. } else {
  653. uni.setStorageSync('H5course', {
  654. companyId: this.urlOption.companyId,
  655. companyUserId: this.urlOption.companyUserId,
  656. })
  657. await this.$store.dispatch('getWebviewUrl');
  658. uni.navigateTo({
  659. url: '/pages_course/webview'
  660. })
  661. }
  662. }
  663. }
  664. }
  665. </script>
  666. <style lang="scss">
  667. page{
  668. height: 100%;
  669. }
  670. .content{
  671. height: 100%;
  672. display: flex;
  673. flex-direction: column;
  674. }
  675. .thumb-up {
  676. width: 80%;
  677. height: 88rpx;
  678. background: linear-gradient( 90deg, #0050F1 0%, #36A9F7 100%);
  679. border-radius: 100rpx;
  680. color: #fff;
  681. }
  682. .thumb-up-fill {
  683. width: 80%;
  684. height: 88rpx;
  685. background: #FFFFFF;
  686. border-radius: 100rpx;
  687. border: 2rpx solid #0070FD;
  688. color: #0070FD;
  689. }
  690. .detail-cont{
  691. flex: 1;
  692. padding: 40upx;
  693. overflow-y: auto;
  694. .title{
  695. font-size: 40upx;
  696. font-family: PingFang SC;
  697. // font-weight: bold;
  698. color: #222222;
  699. line-height: 70upx;
  700. }
  701. .info{
  702. display: flex;
  703. align-items: center;
  704. font-size: 24upx;
  705. font-family: PingFang SC;
  706. font-weight: 500;
  707. color: #999999;
  708. line-height: 48upx;
  709. margin: 23upx 0;
  710. .reads{
  711. margin-right: 30upx;
  712. }
  713. }
  714. .full-text{
  715. font-size: 36upx;
  716. font-family: PingFang SC;
  717. // font-weight: 500;
  718. color: #222222;
  719. line-height: 60upx;
  720. }
  721. }
  722. .recent-reads{
  723. width: 100%;
  724. flex-shrink: 0;
  725. box-sizing: border-box;
  726. height: 121upx;
  727. background: #FFFFFF;
  728. border-top: 1px solid #F0F0F0;
  729. display: flex;
  730. align-items: center;
  731. justify-content: center;
  732. .left{
  733. display: flex;
  734. align-items: center;
  735. .label{
  736. font-size: 28upx;
  737. font-family: PingFang SC;
  738. font-weight: 500;
  739. color: #666666;
  740. line-height: 1;
  741. margin-right: 20upx;
  742. }
  743. .peop-box{
  744. display: flex;
  745. align-items: center;
  746. .head-box{
  747. margin-right: 28upx;
  748. display: flex;
  749. align-items: center;
  750. .head{
  751. width: 48upx;
  752. height: 48upx;
  753. border-radius: 50%;
  754. overflow: hidden;
  755. box-shadow: 0 0 0 1px #fff;
  756. margin-right: -10upx;
  757. image{
  758. width: 100%;
  759. height: 100%;
  760. }
  761. }
  762. }
  763. .arrow{
  764. width: 13upx;
  765. height: 23upx;
  766. }
  767. }
  768. }
  769. .share-btn{
  770. position: relative;
  771. width: 240upx;
  772. height: 80upx;
  773. line-height: 80upx;
  774. font-size: 30upx;
  775. font-family: PingFang SC;
  776. font-weight: 500;
  777. color: #FFFFFF;
  778. background: #1BB99D;
  779. border-radius: 40upx;
  780. display: flex;
  781. align-items: center;
  782. justify-content: center;
  783. image{
  784. width: 32upx;
  785. height: 32upx;
  786. margin-right: 15upx;
  787. }
  788. .share{
  789. position: absolute;
  790. width: 100%;
  791. height: 100%;
  792. opacity: 0;
  793. }
  794. }
  795. }
  796. .inquiry{
  797. width: 131upx;
  798. height: 131upx;
  799. position: fixed;
  800. right: 22upx;
  801. bottom: 193upx;
  802. z-index: 99;
  803. .content{
  804. position: relative;
  805. image{
  806. width: 100%;
  807. height: 100%;
  808. position: absolute;
  809. top: 0;
  810. left: 0;
  811. z-index: 9;
  812. }
  813. .text{
  814. position: absolute;
  815. top: 70upx;
  816. left: 50%;
  817. transform: translateX(-50%);
  818. z-index: 10;
  819. font-size: 22upx;
  820. font-family: PingFang SC;
  821. font-weight: bold;
  822. color: #1BB99D;
  823. line-height: 1;
  824. }
  825. }
  826. }
  827. .contact-btn{
  828. display: inline-block;
  829. position: absolute;
  830. top: 0;
  831. left: 0;
  832. width: 100%;
  833. height: 100%;
  834. opacity: 0;
  835. z-index: 9999;
  836. }
  837. .subname{
  838. background-color: #00aa00;
  839. color: #fff;
  840. }
  841. .subavt{
  842. background-color: #fff;
  843. border: 2rpx #0a0 solid;
  844. color: #00aa00;
  845. }
  846. .boxweixin{
  847. width: 44rpx;
  848. height: 44rpx;
  849. border-radius: 50%;
  850. text-align: center;
  851. line-height: 34rpx;
  852. color: #0a0;
  853. }
  854. .boxnosel{
  855. border: #757575 4rpx solid;
  856. }
  857. .boxsel{
  858. border: #0a0 4rpx solid;
  859. }
  860. .button-container {
  861. position: relative;
  862. width: 240rpx;
  863. }
  864. .hidden-input {
  865. position: absolute;
  866. top: 0;
  867. left: 0;
  868. width: 100%;
  869. height: 100%;
  870. opacity: 0;
  871. z-index: 2;
  872. }
  873. .custom-button {
  874. position: relative;
  875. z-index: 1;
  876. /* 其他样式 */
  877. width:100%;
  878. margin: 0 auto;
  879. height: 80rpx;
  880. line-height: 60rpx;
  881. font-size: 28rpx;
  882. padding: 10rpx 20rpx;
  883. }
  884. .submitname{
  885. width: 90%;
  886. margin: 0 auto;
  887. text-align: center;
  888. padding: 30rpx;
  889. margin-top: 40rpx;
  890. }
  891. .sub{
  892. background-color: #f0f0f0;
  893. color: #0a0;
  894. }
  895. .subact{
  896. background-color: #0a0;
  897. color: #fff;
  898. }
  899. .userlogo{
  900. height: 760rpx;
  901. }
  902. .color_FB2205 {
  903. color: #FB2205;
  904. }
  905. .popup-box {
  906. width: 518rpx;
  907. min-height: 568rpx;
  908. background: linear-gradient(180deg, #FFE7AC 0%, #FFFFFF 100%);
  909. border-radius: 56rpx 56rpx 56rpx 56rpx;
  910. position: relative;
  911. display: flex;
  912. align-items: center;
  913. flex-direction: column;
  914. box-shadow: 0 0 30px -6px rgba(255, 231, 206, 1);
  915. .activity_jb {
  916. height: 184rpx;
  917. margin-top: -130rpx;
  918. position: relative;
  919. }
  920. .popup-tit {
  921. font-family: PingFang SC;
  922. font-weight: 600;
  923. font-size: 40rpx;
  924. color: #000000;
  925. line-height: 80rpx;
  926. }
  927. .con {
  928. margin-top: 16rpx;
  929. width: 438rpx;
  930. min-height: 170rpx;
  931. padding: 16rpx 0;
  932. background: #FFE8AE;
  933. border-radius: 16rpx 16rpx 16rpx 16rpx;
  934. font-family: PingFang SC;
  935. font-weight: 400;
  936. font-size: 28rpx;
  937. color: #333333;
  938. display: flex;
  939. flex-direction: column;
  940. align-items: center;
  941. justify-content: center;
  942. }
  943. .numbox {
  944. font-weight: 600;
  945. margin-bottom: 12rpx;
  946. }
  947. .num {
  948. font-size: 68rpx;
  949. margin-right: 10rpx;
  950. }
  951. .popbtn {
  952. width: 358rpx;
  953. height: 88rpx;
  954. background: linear-gradient(90deg, #F82D31 0%, #FD6C05 100%);
  955. box-shadow: 0rpx 8rpx 0rpx 0rpx #FEBC92;
  956. border-radius: 64rpx 64rpx 64rpx 64rpx;
  957. margin-top: 55rpx;
  958. font-family: PingFang SC, PingFang SC;
  959. font-weight: 600;
  960. font-size: 32rpx;
  961. color: #FFFFFF;
  962. }
  963. }
  964. .popup-tips {
  965. margin-top: 20rpx;
  966. font-family: PingFang SC;
  967. font-weight: 400;
  968. font-size: 24rpx;
  969. color: #666666;
  970. text-align: center;
  971. }
  972. </style>