service-auth.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="Body">
  3. <navbar ref="navbar" :config="config" backColor="#666"></navbar>
  4. <view class="top">
  5. <view class="title">
  6. 授权 <text>{{checkInfo.thirdApplicationName}}</text> 获取以下信息:
  7. </view>
  8. <view class="info">
  9. <!-- v-if="checkInfo.showBaseData" -->
  10. <view class="info-item">
  11. <view class="circle"></view>
  12. <view class="">获取你的账号信息(头像、昵称、手机号)</view>
  13. </view>
  14. <!-- v-if="checkInfo.showRealNameData" -->
  15. <view class="info-item">
  16. <view class="circle"></view>
  17. <view class="">使用身份信息(姓名、证件号码)办理业务</view>
  18. </view>
  19. <!-- v-if="checkInfo.showBusinessData" -->
  20. <view class="info-item">
  21. <view class="circle"></view>
  22. <view class="">提供企业信息(名称、社会信用统一代码)办理业务</view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="footer">
  27. <button class="agree-btn" @click="agree()">同意授权</button>
  28. <button class="close-btn" @click="close()">暂不授权</button>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. let app = getApp()
  34. export default {
  35. data() {
  36. return {
  37. config: {
  38. back: true, //false是tolbar页面 是则不写
  39. title: '服务授权',
  40. color: '#1a1a1a',
  41. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  42. backgroundColor: [1, '#fff'],
  43. backTabPage: '/pages/home'
  44. },
  45. statusBarHeight: app.globalData.statusBarHeight,
  46. authInfo: {},
  47. checkInfo: {}
  48. }
  49. },
  50. onLoad(options) {
  51. console.log(uni.getStorageSync('authInfo'), 33333)
  52. this.authInfo = uni.getStorageSync('authInfo')
  53. this.checkInfo = uni.getStorageSync('checkInfo')
  54. },
  55. onUnload() {
  56. uni.removeStorageSync('authInfo')
  57. uni.removeStorageSync('checkInfo')
  58. },
  59. methods: {
  60. agree() {
  61. this.$yghttp.post('/auth/confirmAuth', this.authInfo).then(res => {
  62. console.log(res, 666666)
  63. if (res.code == 200) {
  64. uni.redirectTo({
  65. url: `/pages/web-view/Apps?path=${encodeURIComponent(res.data.redirect)}`
  66. });
  67. }
  68. })
  69. },
  70. close() {
  71. try {
  72. uni.removeStorageSync('authInfo')
  73. uni.removeStorageSync('checkInfo')
  74. } catch (err) {
  75. console.log('未缓存信息')
  76. }
  77. uni.switchTab({
  78. url: '/pages/home'
  79. })
  80. }
  81. },
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .Body {
  86. position: absolute;
  87. top: 0;
  88. left: 0;
  89. bottom: 0;
  90. right: 0;
  91. background:url("/static/czd/service-authBg.png");
  92. background-size: 100% 100%;
  93. }
  94. .lgoin-nav {
  95. width: 100%;
  96. background-color: #fff;
  97. position: fixed;
  98. left: 0;
  99. right: 0;
  100. top: 0;
  101. z-index: 0;
  102. }
  103. .top {
  104. padding: 200rpx 60rpx;
  105. margin-bottom: 150rpx;
  106. .title {
  107. color: #191919;
  108. margin-bottom: 40rpx;
  109. font-size: 28rpx;
  110. text {
  111. margin: 0 10rpx;
  112. font-size: 42rpx;
  113. font-weight: bold;
  114. color: #191919;
  115. }
  116. }
  117. .info {
  118. .info-item {
  119. display: flex;
  120. // align-items: center;
  121. color: #191919;
  122. margin-bottom: 10rpx;
  123. .circle {
  124. width: 6rpx;
  125. margin-right: 10rpx;
  126. height: 6rpx;
  127. border-radius: 50%;
  128. background-color: #AAAAAA;
  129. margin-top: 16rpx;
  130. }
  131. }
  132. }
  133. }
  134. .footer {
  135. position: fixed;
  136. bottom: 300rpx;
  137. width: 100%;
  138. .agree-btn {
  139. width: 670rpx;
  140. height: 81rpx;
  141. background: linear-gradient(180deg, #29b1a1 0%, #2ba7bd 100%);
  142. border-radius: 40px;
  143. box-shadow: 0rpx 3rpx 10rpx 0rpx rgba(12, 41, 146, 0.26);
  144. color: #fff;
  145. line-height: 81rpx;
  146. font-size: 30rpx;
  147. margin: 0 auto 26rpx;
  148. }
  149. .close-btn {
  150. width: 670rpx;
  151. height: 81rpx;
  152. background: #ffffff;
  153. border: 2rpx solid #2aacb1;
  154. border-radius: 40rpx;
  155. line-height: 81rpx;
  156. font-size: 30rpx;
  157. margin:auto;
  158. }
  159. }
  160. </style>