index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="supplierState" :style="colorStyle">
  3. <view class="pictrue">
  4. <image v-if="type==0" :src="imgHost+'/statics/images/supplierApplyIng.png'"></image>
  5. <image v-else-if="type==1" :src="imgHost+'/statics/images/supplierApplySuccess.png'"></image>
  6. <image v-else :src="imgHost+'/statics/images/supplierApplyFail.png'"></image>
  7. </view>
  8. <view class="title">{{type==1?'恭喜,您的申请已通过!':type==2?'您的申请未通过!':'审核中'}}</view>
  9. <view class="info" v-if="type==0">您的申请正在审核中,请耐心等待!</view>
  10. <view class="info" v-else-if="type==2">请按提示修改您所填写的信息</view>
  11. <view class="webInfor" v-else>
  12. <view>后台网址:{{url}}</view>
  13. <view class="account">后台账号:{{account}}</view>
  14. <view>登录密码:{{pwd}}</view>
  15. <view>
  16. <!-- #ifndef H5 -->
  17. <text class='copy' @tap='copyWb'>复制</text>
  18. <!-- #endif -->
  19. <!-- #ifdef H5 -->
  20. <text class='copy copy-data' :data-clipboard-text="'网址:'+url+'\n账号:'+account+'\n密码:'+pwd">复制</text>
  21. <!-- #endif -->
  22. </view>
  23. </view>
  24. <button class="bnt bg-color acea-row row-center-wrapper" v-if="type==0 || type==2" @click="edit">{{type==0?'修改信息':'重新填写'}}</button>
  25. <button class="bnt on acea-row row-center-wrapper" :class="type==1?'ons':''" @click="back">返回上一页</button>
  26. </view>
  27. </template>
  28. <script>
  29. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  30. import { HTTP_REQUEST_URL } from '@/config/app';
  31. import colors from '@/mixins/color.js';
  32. import { userApply } from '@/api/user.js';
  33. export default{
  34. mixins: [colors],
  35. data(){
  36. return{
  37. imgHost:HTTP_REQUEST_URL,
  38. id:0,
  39. type:0,
  40. url:'',
  41. account:'',
  42. pwd:''
  43. }
  44. },
  45. onLoad(options){
  46. this.id = options.id;
  47. this.type = options.type || 0;
  48. this.supplierApply();
  49. // #ifdef H5
  50. this.$nextTick(function() {
  51. const clipboard = new ClipboardJS(".copy-data");
  52. clipboard.on("success", () => {
  53. this.$util.Tips({
  54. title: '复制成功'
  55. });
  56. });
  57. });
  58. // #endif
  59. },
  60. methods:{
  61. copyWb: function() {
  62. let that = this;
  63. uni.setClipboardData({
  64. data: '网址:'+this.url+'\n账号:'+this.account+'\n密码:'+this.pwd
  65. });
  66. },
  67. supplierApply(){
  68. userApply(this.id).then(res=>{
  69. let data = res.data;
  70. this.url = data.url;
  71. this.account = data.account;
  72. this.pwd = data.pwd;
  73. }).catch(err=>{
  74. return this.$util.Tips({
  75. title: err
  76. });
  77. })
  78. },
  79. edit(){
  80. uni.reLaunch({
  81. url: '/pages/users/supplier/index?id='+ this.id
  82. })
  83. },
  84. back(){
  85. if(this.type>0){
  86. uni.navigateBack({
  87. delta:1
  88. })
  89. }else{
  90. uni.reLaunch({
  91. url: '/pages/users/supplier/index?id=0'
  92. })
  93. }
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. page{
  100. background-color: #fff;
  101. }
  102. .supplierState{
  103. text-align: center;
  104. padding-top: 142rpx;
  105. .pictrue{
  106. width: 340rpx;
  107. height: 280rpx;
  108. margin: 0 auto;
  109. image{
  110. width: 100%;
  111. height: 100%;
  112. }
  113. }
  114. .title{
  115. font-weight: 600;
  116. color: #282828;
  117. font-size: 34rpx;
  118. }
  119. .info{
  120. color: #999999;
  121. font-size: 26rpx;
  122. margin-top: 18rpx;
  123. }
  124. .webInfor{
  125. width: 660rpx;
  126. background: #F9F9F9;
  127. border-radius: 20rpx;
  128. padding: 32rpx 28rpx;
  129. font-size: 28rpx;
  130. color: #333;
  131. margin: 40rpx auto 0 auto;
  132. text-align: left;
  133. word-wrap: break-word;
  134. position: relative;
  135. .account{
  136. margin: 6rpx 0;
  137. }
  138. .copy{
  139. background-color: #999;
  140. border-radius: 60rpx;
  141. padding: 3rpx 15rpx;
  142. color: #fff;
  143. font-size: 20rpx;
  144. position: absolute;
  145. right: 28rpx;
  146. bottom: 28rpx;
  147. }
  148. }
  149. .bnt{
  150. width: 507rpx;
  151. height: 85rpx;
  152. border-radius: 43rpx;
  153. color: #fff;
  154. font-size: 30rpx;
  155. margin: 70rpx auto 0 auto;
  156. border:1px solid var( --view-theme );
  157. &.on{
  158. color: #333333;
  159. border: 1px solid #CCC;
  160. margin-top: 24rpx;
  161. }
  162. &.ons{
  163. margin-top: 64rpx;
  164. }
  165. }
  166. }
  167. </style>