cp-sc.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="ayuu">
  3. <view class="cpsahnty">
  4. <view class="cpsahtxt">
  5. <text>
  6. 上传体检报告
  7. </text>
  8. </view>
  9. <view class="fzddrew cpsahngc" @click="getimg">
  10. <image :src="img?img:'../../static/user/cp-sc.png'" mode="widthFix"></image>
  11. </view>
  12. </view>
  13. <view class="list-box">
  14. <view class="list-title">
  15. <view class="" style="font-weight: bold;">我已上传的测评报告:</view>
  16. <view class=""></view>
  17. </view>
  18. <view class="table-box">
  19. <uni-table border stripe emptyText="暂无更多数据" >
  20. <!-- 表头行 -->
  21. <uni-tr>
  22. <uni-th align="center">体检报告名称</uni-th>
  23. <uni-th align="center">测评结果</uni-th>
  24. </uni-tr>
  25. <!-- 表格数据行 -->
  26. <uni-tr v-for="(item,index) in reviewLogList" :key="index">
  27. <uni-td>报告{{index + 1}}</uni-td>
  28. <!-- <uni-td>
  29. <view class="td-view">
  30. <view class="">测评排队中</view>
  31. <view class="">[前方等待8人,还需1天]</view>
  32. </view>
  33. </uni-td> -->
  34. <uni-td>
  35. <view class="td-view" style="color: #ff0000;" @click="goTojg(item.id)">查看测评结果</view>
  36. </uni-td>
  37. </uni-tr>
  38. </uni-table>
  39. </view>
  40. </view>
  41. <view style="height: 120rpx;"></view>
  42. <view class="fzddrew fknbee">
  43. <view class="fzddrew fkdibr" style="background: #95bf7f;" @click="subInfo">
  44. <text>立即上传</text>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <style>
  50. page {
  51. background: #FAFAFA;
  52. }
  53. </style>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. img: '',
  59. reviewLogList: [],
  60. tempFilePaths: null
  61. }
  62. },
  63. onLoad() {
  64. this.user_id = uni.getStorageSync('id');
  65. this.vip_pay = uni.getStorageSync('is_vip');
  66. this.getReviewLog();
  67. },
  68. methods: {
  69. goTojg(id){
  70. uni.navigateTo({
  71. url: '/pages/user/cp-jg?id=' + id
  72. })
  73. },
  74. getReviewLog(){
  75. let that = this;
  76. that.$request.getReviewLog({}).then( res =>{
  77. console.log(res)
  78. if(res.code == 0){
  79. this.reviewLogList = res.data;
  80. }else{
  81. uni.showToast({
  82. title: res.message,
  83. icon: "none",
  84. })
  85. if(res.message == '请先登录'){
  86. uni.setStorageSync('userinfo',null);
  87. uni.setStorageSync('id','');
  88. uni.setStorageSync("token",'');
  89. setTimeout( () =>{
  90. uni.reLaunch({
  91. url:'/pages/lecturer/my'
  92. })
  93. },2000)
  94. }
  95. }
  96. }).catch( e =>{
  97. console.log(e)
  98. })
  99. },
  100. getimg() {
  101. let that = this;
  102. // chooseImage
  103. // 用户已经同意小程序使用相册
  104. uni.chooseMedia({
  105. count: 1,
  106. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  107. sourceType: ['album'], //从相册选择
  108. success: (res) => {
  109. console.log(res)
  110. let tempFiles = res.tempFiles;
  111. that.img = tempFiles[0].tempFilePath;
  112. that.tempFilePaths = tempFiles[0];
  113. },
  114. fail:(res) => {
  115. console.log(res)
  116. },
  117. })
  118. },
  119. // 提交信息
  120. subInfo(){
  121. let that = this;
  122. if(!that.img){
  123. uni.showToast({
  124. title:'请选择体检报告',
  125. icon:'none'
  126. })
  127. return
  128. }
  129. uni.showLoading({
  130. title:'加载中...',
  131. mask:true
  132. })
  133. setTimeout( () =>{
  134. uni.hideLoading();
  135. uni.navigateTo({
  136. url:'../user/cp-pay?tempFilePaths='+ JSON.stringify(that.tempFilePaths)
  137. })
  138. },2000)
  139. }
  140. }
  141. }
  142. </script>
  143. <style lang="scss" scoped>
  144. .ayuu{
  145. height: 100vh;
  146. overflow-y: auto;
  147. }
  148. .list-box{
  149. width: 100%;
  150. height: auto;
  151. margin-top: 20rpx;
  152. padding: 10rpx 20rpx;
  153. box-sizing: border-box;
  154. }
  155. .list-title{
  156. font-size: 28rpx;
  157. display: flex;
  158. align-items: center;
  159. justify-content: space-between;
  160. }
  161. .table-box{
  162. margin-top: 10rpx;
  163. padding: 20rpx 0;
  164. box-sizing: border-box;
  165. background: #fff;
  166. }
  167. .table-box /deep/ .uni-table-th{
  168. padding: 12rpx 10rpx;
  169. color: #000;
  170. }
  171. .td-view{
  172. text-align: center;
  173. }
  174. </style>