123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- <template>
- <view class="container">
- <!-- <view class="top-box">
- <view class="top-l">
- <view class="l-l"> {{ value.toFixed(1) }} </view>
- <view class="l-r">
- <u-rate :count="count" v-model="value"></u-rate>
- <p>根据近90天评价计其所得</p>
- </view>
- </view>
- <view class="top-r">
- <span>更多</span>
- <u-icon name="arrow-right" color="#9B9B9B" size="18"></u-icon>
- </view>
- </view> -->
- <view class="content-box">
- <view class="top-box">
- <u-tabs :current="list1Current" :list="list1" lineWidth="30" lineColor="$uni-bg-color-primary"
- :activeStyle="{
- color: '#000',
- fontSize: '28rpx',
- transform: 'scale(1.05)',
- marginBottom: '15rpx',
- }" :inactiveStyle="{
- color: '#333',
- fontSize: '30rpx',
- transform: 'scale(1)',
- marginBottom: '15rpx',
-
- }" @click="handlerSelectItem1"></u-tabs>
- </view>
- <view class="item-box">
- <view class="item" :class="current == index ? 'act-item' : ''" v-for="(item, index) of contentList"
- :key="index" @click="handlerSelectItem(item, index)">{{ item.name }}{{ item.numb }}</view>
- </view>
- <!-- <view class="item-radio-box">
- <u-radio-group v-model="radiovalue1" placement="row">
- <u-radio
- :customStyle="{ margin: '8px' }"
- v-for="(item, index) in radiolist1"
- :key="index"
- :label="item.name"
- :name="item.name"
- >
- </u-radio>
- </u-radio-group>
- </view> -->
- </view>
- <evaluateItem :dataList="dataList"></evaluateItem>
- </view>
- </template>
- <script>
- import evaluateItem from './components/evaluateItem.vue';
- import {
- getEvaluateListApi,
- getMerchantQueryApi
- } from '@/api/merchant/evaluate';
- import {
- mapGetters
- } from 'vuex';
- export default {
- data() {
- return {
- merchantId: "",
- list1Current: 0,
- current: 0,
- count: 5,
- value: 2,
- score:"0",
- list1: [{
- name: '未回复的评价',
- },
- {
- name: '全部评价',
- },
- ],
- contentList: [{
- name: '全部',
- numb: 360,
- },
- {
- name: '五星',
- numb: 21,
- value: 5,
- },
- {
- name: '四星',
- numb: 50,
- value: 4,
- },
- {
- name: '三星',
- numb: 88,
- value: 3,
- },
- {
- name: '二星',
- numb: 72,
- value: 2,
- },
- {
- name: '一星',
- numb: 218,
- value: 1,
- },
- ],
- radiolist1: [{
- name: '有内容的评价',
- disabled: false,
- },
- {
- name: '有图片的评价',
- disabled: false,
- },
- ],
- // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
- radiovalue1: '有内容的评价',
- dataList: [],
- };
- },
- components: {
- evaluateItem,
- },
- created() {
- // 获取商家id
- let merchantInfo = this.$store.state.data.merchantInfo;
- this.merchantId = merchantInfo.merchant.id;
- this.getEvaluateList(this.merchantId, this.list1Current, this.current);
- },
- methods: {
-
- handlerSelectItem1(item) {
- this.list1Current = item.index
- this.getEvaluateList(this.merchantId, item.index,this.score);
- },
- handlerSelectItem(item, index) {
- console.log(item, index)
- this.current = index
- this.score = item.value
- this.contentList = [...this.contentList]
- this.getEvaluateList(this.merchantId, this.list1Current, item.value);
- },
- async getEvaluateList(merchantId, isRecover, score) {
- let res = await getMerchantQueryApi({
- merchantId,
- isRecover,
- score
- });
- if (res.code == "OK") {
- this.dataList = res.data
- console.log("dasd")
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .container {
- background-color: #f5f5f5 !important;
- min-height: calc(100vh - 20rpx);
- padding-bottom: 20rpx;
- .top-box {
- background-color: #fff;
- padding: 20rpx 40rpx;
- display: flex;
- justify-content: space-between;
- .top-l {
- display: flex;
- align-items: center;
- .l-l {
- margin-right: 20rpx;
- font-size: 42rpx;
- color: #d32625;
- font-weight: bold;
- }
- .l-r {
- p {
- margin-top: 20rpx;
- font-size: 24rpx;
- color: #afafaf;
- }
- }
- }
- .top-r {
- display: flex;
- align-items: center;
- color: #afafaf;
- font-size: 26rpx;
- }
- }
- .content-box {
- padding: 0 20rpx 20rpx;
- background-color: #fff;
- margin: 10rpx 0;
- .item-box {
- display: grid;
- grid-template-columns: 32% 32% 32%;
- justify-content: space-between;
- .item,
- .act-item {
- border: 2rpx solid #e0e0e0;
- padding: 10rpx 30rpx;
- text-align: center;
- margin: 20rpx;
- font-size: 26rpx;
- color: #999999;
- }
- .act-item {
- border: 2rpx solid #87afcc !important;
- color: #87afcc !important;
- }
- }
- .item-radio-box {}
- }
- }
- </style>
|