12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <template>
- <view class="container">
- <view class="top-box">
- <view class="top-rate">
- <view class="title">评价得分:</view>
- <u-rate count="5" v-model="queryParams.score"></u-rate>
- </view>
- <view class="content-box">
- <view class="title">评价内容:</view>
- <view class="comment-box">
- <u--textarea v-model="queryParams.content" count placeholder="请输入评价内容" ></u--textarea>
- </view>
- </view>
- </view>
- <button class="btn" @click="handlerContextSumbit">提交</button>
- </view>
- </template>
- <script>
- import { goodsCommentsAdd } from "@/api/client/business.js"
- export default {
- data(){
- return{
- queryParams:{
- score:2,//评价打分
- content:'测试打分111',//评价内容
- goodsId: "1748379280745975820", // 商品id
- orderId: "1763028797466587137", // 订单id
- merchantId: "9", // 商家id
- },
- }
- },
- methods:{
- // 测试提交
- handlerContextSumbit(){
- console.log('@@@@queryParams',this.queryParams);
- return
- goodsCommentsAdd(this.queryParams).then(res=>{
- console.log('@@@@res',res);
- if(res.code == 200){
- uni.showToast({
- title:"评论成功",
- icon:'none'
- })
- uni.navigateBack(-1)
- }else{
- uni.showToast({
- title:res.msg,
- icon:'none'
- })
- }
- })
- },
- }
- }
- </script>
- <style lang="scss" scope>
- .container{
- padding: 20rpx;
- .top-box{
- padding: 20rpx;
- border-radius: 20rpx;
- box-shadow: 0 5rpx 12rpx 0 rgba(0,0,0,0.2);
- background-color: #fff;
- .top-rate{
- display: flex;
- align-items: center;
- }
- .content-box{
- margin-top: 20rpx;
- .comment-box{
- margin-top: 20rpx;
- }
- }
- .title{
- color: #000;
- font-size: 28rpx;
- }
- }
- .btn{
- margin-top: 20rpx;
- background-color: #F57F32;
- color: #fff;
- font-size:28rpx;
- border-radius: 20rpx;
- box-shadow: 0 5rpx 10rpx 0 rgba(245,127,50, 0.8);
- }
- }
- </style>
|