sorce.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view class="content">
  3. <view class="param">
  4. <view class="proMiao">评价</view>
  5. <textarea class="proINname proIMi" v-model="evaluate" placeholder="请输入评价"/>
  6. <view class="proName">评分</view>
  7. <input class="proINname" v-model="score" placeholder="请输入评分"/>
  8. <view class="project">
  9. <view class="butt quxiao" @click="quxiao">取消</view>
  10. <view class="butt queren" @click="addScore">确定</view>
  11. </view>
  12. <view style="width: 100%;height: 60rpx;"></view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. evaluate:'',//评价
  21. score:'',//评分
  22. projectId:'',//项目id
  23. }
  24. },
  25. onLoad(option) {
  26. this.projectId=option.proId
  27. },
  28. methods: {
  29. //取消
  30. quxiao(){
  31. uni.switchTab({
  32. url:'/pages/project/index'
  33. })
  34. },
  35. //评分
  36. addScore(){
  37. let that = this
  38. if (!that.evaluate) {
  39. that.$queue.showToast("请输入评价");
  40. }else if (!that.score) {
  41. that.$queue.showToast("请输入评分");
  42. }else {
  43. uni.showLoading({
  44. title: '加载中',
  45. mask: true, // 是否显示透明蒙层,防止触摸穿透
  46. });
  47. var data={
  48. projectId: that.projectId,
  49. evaluate: that.evaluate,
  50. score:that.score
  51. }
  52. that.$Request.postT('/api/sysProject/evaluate',data).then(res => {
  53. if (res.code==200) {
  54. uni.showToast({
  55. title: '评价成功',
  56. icon: 'none',
  57. duration:800
  58. });
  59. uni.hideLoading()
  60. setTimeout(function() {
  61. uni.switchTab({
  62. url:'/pages/project/index'
  63. })
  64. }, 1000)
  65. } else {
  66. uni.hideLoading();
  67. uni.showToast({
  68. title: res.message,
  69. icon: 'none',
  70. duration:800
  71. });
  72. }
  73. });
  74. }
  75. }
  76. }
  77. }
  78. </script>
  79. <style>
  80. .content {
  81. display: flex;
  82. flex-direction: column;
  83. align-items: center;
  84. justify-content: center;
  85. }
  86. .param{
  87. margin: 20rpx 0 0 0;
  88. width: 100%;
  89. background-color: rgba(255, 255, 255, 1);
  90. font-size: 28rpx;
  91. font-weight: 400;
  92. line-height: 41rpx;
  93. color: rgba(0, 0, 0, 1);
  94. }
  95. .proName{
  96. margin: 23rpx 0 0 20rpx;
  97. }
  98. .proINname{
  99. margin: 25rpx 0 0 21rpx;
  100. width: 709rpx;
  101. height: 90rpx;
  102. border-radius: 13rpx;
  103. background: rgba(245, 248, 252, 1);
  104. border: 1rpx solid rgba(229, 229, 229, 1);
  105. font-size: 28rpx;
  106. line-height: 90rpx;
  107. /* color: rgba(179, 179, 179, 1); */
  108. }
  109. .proIMi{
  110. height: 315rpx;
  111. }
  112. .proMiao{
  113. margin: 31rpx 0 0 20rpx;
  114. }
  115. .project{
  116. display: flex;
  117. margin: 61rpx 0 0 0;
  118. justify-content: space-evenly;
  119. }
  120. .butt{
  121. width: 330rpx;
  122. height: 90rpx;
  123. border-radius: 117rpx;
  124. font-size: 32rpx;
  125. line-height: 90rpx;
  126. text-align: center;
  127. }
  128. .quxiao{
  129. border: 1rpx solid rgba(0, 97, 255, 1);
  130. color: rgba(0, 97, 255, 1);
  131. }
  132. .queren{
  133. background: rgba(0, 97, 255, 1);
  134. color: rgba(255, 255, 255, 1);
  135. }
  136. </style>