goodsEstimation.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="container">
  3. <view class="top-box">
  4. <view class="top-rate">
  5. <view class="title">评价得分:</view>
  6. <u-rate count="5" v-model="queryParams.score"></u-rate>
  7. </view>
  8. <view class="content-box">
  9. <view class="title">评价内容:</view>
  10. <view class="comment-box">
  11. <u--textarea v-model="queryParams.content" count placeholder="请输入评价内容" ></u--textarea>
  12. </view>
  13. </view>
  14. </view>
  15. <button class="btn" @click="handlerContextSumbit">提交</button>
  16. </view>
  17. </template>
  18. <script>
  19. import { goodsCommentsAdd } from "@/api/client/business.js"
  20. export default {
  21. data(){
  22. return{
  23. queryParams:{
  24. score:2,//评价打分
  25. content:'测试打分111',//评价内容
  26. goodsId: "1748379280745975820", // 商品id
  27. orderId: "1763028797466587137", // 订单id
  28. merchantId: "9", // 商家id
  29. },
  30. }
  31. },
  32. methods:{
  33. // 测试提交
  34. handlerContextSumbit(){
  35. console.log('@@@@queryParams',this.queryParams);
  36. return
  37. goodsCommentsAdd(this.queryParams).then(res=>{
  38. console.log('@@@@res',res);
  39. if(res.code == 200){
  40. uni.showToast({
  41. title:"评论成功",
  42. icon:'none'
  43. })
  44. uni.navigateBack(-1)
  45. }else{
  46. uni.showToast({
  47. title:res.msg,
  48. icon:'none'
  49. })
  50. }
  51. })
  52. },
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scope>
  57. .container{
  58. padding: 20rpx;
  59. .top-box{
  60. padding: 20rpx;
  61. border-radius: 20rpx;
  62. box-shadow: 0 5rpx 12rpx 0 rgba(0,0,0,0.2);
  63. background-color: #fff;
  64. .top-rate{
  65. display: flex;
  66. align-items: center;
  67. }
  68. .content-box{
  69. margin-top: 20rpx;
  70. .comment-box{
  71. margin-top: 20rpx;
  72. }
  73. }
  74. .title{
  75. color: #000;
  76. font-size: 28rpx;
  77. }
  78. }
  79. .btn{
  80. margin-top: 20rpx;
  81. background-color: #F57F32;
  82. color: #fff;
  83. font-size:28rpx;
  84. border-radius: 20rpx;
  85. box-shadow: 0 5rpx 10rpx 0 rgba(245,127,50, 0.8);
  86. }
  87. }
  88. </style>