| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <template>
- <view class="center">
- <view class="zhil">
- <view class="pf">评分</view>
- <view><uniRate text="1" size="20" margin="10" :value="evaluate_fraction" @change="rateChange1"></uniRate></view>
- </view>
- <view class="pjnr">
- <text>评价内容</text><input type="text" v-model="evaluate" />
- </view>
- <view class="item-left">评价图片:</view>
- <view class="item-right">
- <image :src="cardimg" mode="" class="upload-img" @click.stop="imgsub" v-if="cardimg"></image>
- <image src="https://zhibo.liuniu946.com/img/phone.png" class="upload-img" mode="" v-if="!cardimg" @click.stop="imgsub"></image>
- </view>
- <view class="button" @click="submit('/pages/course/success')">
- 提交评价
- </view>
- <view class="button" @click="nav('/pages/course/myEvaluate')">
- 我的评价
- </view>
- </view>
- </template>
- <script>
- import { setEvaluate,uploads } from '@/api/course.js';
- import uniRate from '@/components/uni-rate/uni-rate.vue';
- export default {
- components: {
- uniRate
- },
- data(){
- return{
- cardimg: '',
- id: '',
- evaluate_fraction: '',//评分
- evaluate: '',//评价内容
- evaluate_imgs: '',//图片
- }
- },
- onLoad(option) {
- this.id = option.id;
- },
- methods: {
- imgsub() {
- console.log('上传照片')
- uploads({
- filename: ''
- }).then(data => {
- console.log("data",data);
- this.evaluate_imgs = data[0].url;
- })
- },
- submit(url){
- console.log(this.evaluate_fraction)
- setEvaluate({
- timetable_id: this.id,
- evaluate_fraction: this.evaluate_fraction,
- evaluate: this.evaluate,
- evaluate_imgs: this.evaluate_imgs
- }).then(() =>{
- uni.navigateTo({
- url: url
- })
- }).catch(err =>{
- console.log(err)
- })
- },
- nav(url) {
- uni.navigateTo({
- url: url
- })
- },
- rateChange1(val) {
- this.evaluate_fraction = val.value;
- },
- }
- }
- </script>
- <style>
- .pf{
- margin-bottom: 20rpx;
- }
- .button{
- height: 200rpx;
- }
- .zhil {
- font-size: 28rpx !important;
- padding: 15rpx 15rpx;
- height: 100rpx;
- }
- </style>
|