Shangchuanzjzp.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view>
  3. <customNav :shownav="true" title="" tinColor="#000000" jiantou="0" ></customNav>
  4. <view class="contentColumnC zhegnjimagBG" style="margin-top: 40rpx;margin-left: 10rpx;">
  5. <image v-if="zjImage==''" class="imagVwh" src="/static/defimags/111.png" mode="scaleToFill"></image>
  6. <myImage v-if="zjImage!=''" class="imagVwh" :mysrc="zjImage" mymode="scaleToFill"></myImage>
  7. <yhdslCropper ref="yhdslCropper" :quality="1" mode="scale" @uploadImg="uploadImg" :scale="scale"></yhdslCropper>
  8. </view>
  9. <view class="contentColumn" style="width: 90%;margin-left: 5%;margin-top: 60rpx;">
  10. <text v-if="index==1" class="tptitleText">{{$t('dache.jaszzm')}}</text>
  11. <text v-if="index==2" class="tptitleText">{{$t('dache.xingszzm')}}</text>
  12. <text v-if="index==3" class="tptitleText">{{$t('dache.cheldjtp')}}</text>
  13. <text class="tpdetealText" style="margin-top: 50rpx;">{{$t('dache.paisheyq')}}</text>
  14. <text v-if="index!=3" class="tpdetealText">{{$t('dache.paisheyqA')}}</text>
  15. <text v-if="index!=3" class="tpdetealText">{{$t('dache.paisheyqB')}}</text>
  16. <text v-if="index==3" class="tpdetealText">{{$t('dache.paisheyqC')}}</text>
  17. <text v-if="index==3" class="tpdetealText">{{$t('dache.paisheyqD')}}</text>
  18. </view>
  19. <view class="contentColumnC" style="margin-top: 60rpx;">
  20. <text class="bottomBt" @click="selectImg">{{$t('dache.qushangc')}}</text>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. UploadImage
  27. } from '@/pages/api/basic.js';
  28. import {
  29. updataUserMsg,
  30. } from '@/pages/api/login';
  31. import yhdslCropper from '@/components/yhdsl-cropper/yhdsl-cropper.vue';
  32. export default {
  33. components: {
  34. yhdslCropper
  35. },
  36. data() {
  37. return {
  38. scale:1.8,
  39. index:0,
  40. zjImage:''
  41. }
  42. },
  43. onLoad(option) {
  44. this.index = option.state;
  45. },
  46. methods: {
  47. selectImg(){
  48. console.log('userIconkl');
  49. this.$refs.yhdslCropper.chooseImage();
  50. },
  51. uploadImg(e) {
  52. //console.log('------------uploadImg:',e)
  53. var that = this;
  54. uni.uploadFile({
  55. url: this.$baseurl+UploadImage, //上传图片api
  56. filePath: e,
  57. name: 'file',
  58. header:{
  59. //"Authorization": userinfo.token
  60. },
  61. success: (res) => {
  62. let group = JSON.parse(res.data);
  63. that.zjImage=group.data;
  64. var usdata = {
  65. "avatar": that.zjImage};
  66. //that.updataUserMsg(usdata);
  67. }
  68. });
  69. },
  70. async updataUserMsg(data){
  71. await this.$http.post(`${updataUserMsg}`,data,true)
  72. .then(async r => {
  73. console.log('updataUserMsg',r)
  74. })
  75. .catch(err => {
  76. console.log(err)
  77. })
  78. },
  79. },
  80. }
  81. </script>
  82. <style lang="scss">
  83. @import '@/common/common.scss';
  84. page{
  85. background-color: #000000;
  86. }
  87. .zhegnjimagBG{
  88. width: 730rpx;
  89. height: 480rpx;
  90. background-size: 100% 100%;
  91. background-image: url('/static/imags/dache/zjbj@3x.png');
  92. }
  93. .imagVwh{
  94. width: 690rpx;
  95. height: 420rpx;
  96. }
  97. .tptitleText{
  98. font-size: 36rpx;
  99. color: white;
  100. font-weight: bold;
  101. }
  102. .tpdetealText{
  103. margin-top: 10rpx;
  104. font-size: 28rpx;
  105. color: white;
  106. }
  107. .bottomBt{
  108. width:90%;
  109. text-align: center;
  110. line-height: 86rpx;
  111. font-size: 32rpx;
  112. font-weight: bold;
  113. color: white;
  114. border-radius: 20rpx;
  115. background-color: #E86E48;
  116. margin-top: 20rpx;
  117. }
  118. </style>