This commit is contained in:
liuye
2024-06-26 15:48:44 +08:00
parent 225498b24d
commit cfc7bf3307
9 changed files with 260 additions and 162 deletions

View File

@@ -19,7 +19,7 @@ export default {
data() {
return {
tabList: [{name: '门店情况'}, {name: '我要评价'}],
tabIndex: 1,
tabIndex: 0,
barStyle: {
'width': '20px',
'height': '3px',
@@ -29,7 +29,10 @@ export default {
}
}
},
onLoad() {
onLoad(e) {
if(e.tabIndex) {
this.tabIndex = e.tabIndex
}
},
methods: {
change(e) {

View File

@@ -26,117 +26,42 @@
<div class="form-info">
<div class="form-title">评价清单</div>
<div class="mini-title">正面清单</div>
<div class="item">
<div class="label">(1)门店整洁美观</div>
<div class="item" v-for="(item, index) in positiveTypeList" :key="index">
<div class="label">({{index+1}}){{item.listType}}</div>
<div class="value">
<div class="radio" @click="positiveRadioClick('isNeat', 1)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="positiveForm.isNeat" >
<div class="radio" @click="positiveRadioClick(index, 1)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="item.status">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else>
</div>
<div class="radio" @click="positiveRadioClick('isNeat', 0)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="!positiveForm.isNeat" >
<div class="radio" @click="positiveRadioClick(index, 0)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="!item.status">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else>
</div>
</div>
</div>
<div class="item">
<div class="label">(2)有绿植安放</div>
<div class="value">
<div class="radio" @click="positiveRadioClick('isGreen', 1)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="positiveForm.isGreen" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else>
</div>
<div class="radio" @click="positiveRadioClick('isGreen', 0)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="!positiveForm.isGreen" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else >
</div>
</div>
</div>
<div class="item">
<div class="label">(3)其他</div>
<div class="value">
<div class="radio" @click="positiveRadioClick('isOther', 1)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="positiveForm.isOther" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else>
</div>
<div class="radio" @click="positiveRadioClick('isOther', 0)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="!positiveForm.isOther" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else >
</div>
</div>
</div>
<div class="mini-title">负面清单</div>
<div class="item">
<div class="label">(1)车辆乱停</div>
<div class="item" v-for="(item, index) in negativeTypeList" :key="index">
<div class="label">({{index+1}}){{item.listType}}</div>
<div class="value">
<div class="radio" @click="negativeRadioClick('isCar', 1)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="negativeForm.isCar" >
<div class="radio" @click="negativeRadioClick(index, 1)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="item.status">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else>
</div>
<div class="radio" @click="negativeRadioClick('isCar', 0)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="!negativeForm.isCar" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else >
<div class="radio" @click="negativeRadioClick(index, 0)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="!item.status">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else>
</div>
</div>
</div>
<div class="item">
<div class="label">(2)门头凌乱</div>
<div class="value">
<div class="radio" @click="negativeRadioClick('isDoor', 1)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="negativeForm.isDoor" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else>
</div>
<div class="radio" @click="negativeRadioClick('isDoor', 0)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="!negativeForm.isDoor" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else >
</div>
</div>
</div>
<div class="item">
<div class="label">(3)垃圾凌乱</div>
<div class="value">
<div class="radio" @click="negativeRadioClick('isGarbage', 1)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="negativeForm.isGarbage" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else>
</div>
<div class="radio" @click="negativeRadioClick('isGarbage', 0)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="!negativeForm.isGarbage" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else >
</div>
</div>
</div>
<div class="item">
<div class="label">(4)其他</div>
<div class="value">
<div class="radio" @click="negativeRadioClick('isOther', 1)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="negativeForm.isOther" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else>
</div>
<div class="radio" @click="negativeRadioClick('isOther', 0)">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-xz.png" alt="" v-if="!negativeForm.isOther" >
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/evaluate-form-wxz.png" alt="" v-else >
</div>
</div>
</div>
</div>
<div class="line-bg"></div>
<div class="text-area">
<div class="label">请填写评语</div>
<u-input type="textarea" trim v-model="form.remark" maxlength="300" height="400"
placeholder-style="color: #999999;font-size: 15px;"/>
placeholder-style="color: #999;font-size: 15px;"/>
<p>0/300</p>
</div>
<div class="line-bg"></div>
@@ -156,7 +81,7 @@
</template>
<script>
import {mapState} from 'vuex'
export default {
name: 'EvaluateForm',
appName: '我要评价',
@@ -166,26 +91,35 @@ export default {
remark: '',
file: []
},
positiveForm: {
isNeat: 1,
isGreen: 1,
isOther: 1
},
negativeForm: {
isCar: 0,
isDoor: 0,
isGarbage: 0,
isOther: 0
},
positiveTypeList: [],
negativeTypeList: [],
shopId: '',
shopInfo: {}
}
},
computed: {
...mapState(['user'])
},
onLoad(e) {
this.getTypeList()
this.shopId = e.shopId
this.getShopDetail()
},
methods: {
getTypeList() {
this.$loading()
this.$instance.post(`/app/appscorerules/list?status=1&size=100`).then(res => {
if (res?.data) {
res.data.records.map((item) => {
if(item.type == 1) {
this.positiveTypeList.push(item)
}else {
this.negativeTypeList.push(item)
}
})
}
}).finally(() => uni.hideLoading())
},
getShopDetail() {
this.$loading()
this.$instance.post(`/app/appshoparchives/queryDetailById?id=${this.shopId}`).then(res => {
@@ -195,22 +129,33 @@ export default {
}
}).finally(() => uni.hideLoading())
},
positiveRadioClick(name, val) {
this.positiveForm[name] = val
positiveRadioClick(index, val) {
console.log(index, val)
this.positiveTypeList[index].status = val
},
negativeRadioClick(name, val) {
this.negativeForm[name] = val
negativeRadioClick(index, val) {
this.negativeTypeList[index].status = val
},
add() {
if(!this.form.remark) {
return this.$u.toast('请填写评语')
}
this.$loading()
var imgUrlList = []
if(this.form.file.length) {
this.form.file.map((item) => {
imgUrlList.push(item.url)
})
}
var assessTypeList = this.positiveTypeList.concat(this.negativeTypeList)
this.$instance.post(`/app/appshopassess/addOrUpdate`, {
...this.form,
...this.positiveForm,
...this.negativeForm,
shopId: this.shopId
shopId: this.shopId,
pictureUrl: imgUrlList.length ? imgUrlList.join(',') : '',
evaluatorPhone: this.user.phone,
evaluator: this.user.name ? this.user.name : this.user.nickName,
evaluatorUrl: this.user.avatarUrl,
assessType: JSON.stringify(assessTypeList)
}).then(res => {
if (res?.data) {
this.$u.toast('提交成功')

View File

@@ -51,7 +51,7 @@
</div>
<div class="item" v-for="(item, index) in assessList" :key="index">
<div class="user-info">
<img :src="item.pictureUrl" alt="" class="user-img">
<img :src="item.evaluatorUrl ? item.evaluatorUrl : 'https://cdn.cunwuyun.cn/wxmp/fengdu/avatar.png'" alt="" class="user-img">
<div class="user-name">
<p>{{ item.evaluator }}</p>
<div>{{ item.evaluationTime.substring(0, 10) }}</div>
@@ -71,6 +71,9 @@
<span class="star-num">{{ item.storeScore }}</span>
</div>
<div class="text">{{ item.remark }}</div>
<div v-if="item.imgList && item.imgList.length">
<img :src="img" alt="" v-for="(img, indexs) in item.imgList" :key="indexs" class="img">
</div>
</div>
<AiEmpty v-if="!assessList.length" />
</div>
@@ -122,6 +125,12 @@ export default {
this.$loading()
this.$instance.post(`/app/appshopassess/list?shopId=${this.shopId}&current=${this.current}`).then(res => {
if (res?.data) {
res.data.records.map((item) => {
if(item.pictureUrl) {
item.imgList = item.pictureUrl.split(',')
}
})
this.assessList = this.current == 1 ? res.data.records : [this.list, res.data.records].flat()
this.pages = res.data.total
}
@@ -280,6 +289,7 @@ export default {
}
}
.item {
margin-bottom: 32px;
.user-info {
display: flex;
margin-bottom: 24px;
@@ -324,6 +334,12 @@ export default {
color: #323233;
line-height: 40px;
word-break: break-all;
margin-bottom: 16px;
}
.img {
width: 120px;
height: 120px;
margin: 0 8px 8px 0;
}
}
}

View File

@@ -13,15 +13,6 @@
<div>230</div>
</div>
</div>
<div class="item">
<div class="left">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/situation-mdzrs.png" alt="">
</div>
<div class="right">
<p>门店总人数</p>
<div>230</div>
</div>
</div>
<div class="item">
<div class="left">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/situation-zwgs.png" alt="">
@@ -40,6 +31,15 @@
<div>230</div>
</div>
</div>
<div class="item">
<div class="left">
<img src="https://cdn.cunwuyun.cn/wechat/fd-store/situation-wxmd.png" alt="">
</div>
<div class="right">
<p>五星门店</p>
<div>230</div>
</div>
</div>
</div>
<div class="title">
<div class="left">6月的五星门店<span>排名不分先后</span></div>