Browse Source

fix:修复群众点单评论报错问题

master
xiaohei 4 months ago
parent
commit
f11fc6883a
5 changed files with 34 additions and 49 deletions
  1. +5
    -1
      index.html
  2. +2
    -2
      src/App.vue
  3. +17
    -43
      src/packages/people/pages/masses-appraise/masses-appraise.vue
  4. +4
    -2
      src/packages/people/pages/masses-detail/masses-detail.vue
  5. +6
    -1
      src/pages.json

+ 5
- 1
index.html View File

@@ -2,7 +2,10 @@
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="720000">
<meta http-equiv="refresh" content="1300">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
@@ -10,6 +13,7 @@
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->


+ 2
- 2
src/App.vue View File

@@ -15,7 +15,7 @@
}

let params = {
"version": "1.0.11"
"version": "1.2.24"
}

// 路由中判断 version 是否是最新版本
@@ -25,7 +25,7 @@
//如果有更新,保存最新版本
localStorage.setItem('version',params.version)
//帮用户刷新页面
window.location.reload();
window.location.reload(true);
}
// 微信API支持Promise风格


+ 17
- 43
src/packages/people/pages/masses-appraise/masses-appraise.vue View File

@@ -1,35 +1,33 @@
<template>
<view style="height: 100%">
<view>
<custom-nav-bar position="fixed" color="black" left-text="评价" left-arrow />

<view class="appraise flex flex-v-center">
<view class="mr-25">满意度:</view>
<van-rate :value="form.appraiseStar" :size="22" gutter="36rpx" icon="/images/void-icon2.png"
void-icon="/images/rate-icon.png" @change="headleChange" />
<block v-for="item in 5" :key="item">
<image src="/static/images/void-icon2.png" v-if="form.appraiseStar >= item" @click="headleChange(item)" style="width: 36rpx;height: 36rpx;margin-right: 10rpx;" mode=""></image>
<image src="/static/images/rate-icon.png" v-else @click="headleChange(item)" style="width: 36rpx;height: 36rpx;margin-right: 10rpx;" mode=""></image>
</block>
</view>

<view class="division"></view>

<!-- 描述 -->
<view class="describe">
<view>描述</view>
<textarea class="textarea" placeholder="请输入" @input="headleInput" maxlength="300" :value="form.title"
data-name="appraiseContent" focus auto-height></textarea>
<view class="form-image">
<van-uploader @after-read="afterRead" :file-list="fileList" :deletable="true" max-count="9"
@delete="imageDelete">
<van-uploader :after-read="afterRead" v-model="fileList" :deletable="true" max-count="9"
:delete="imageDelete">
<image class="camera" src="/static/images/icon9.png"></image>
</van-uploader>
</view>
</view>

<view class="van-button">
<van-button v-if="form.appraiseContent === '' && form.appraiseStar === 0"
custom-style="color:#000;background-color:#D9E2EE;border-radius: 8rpx;" block>
<van-button color="#fe3b53" v-if="form.appraiseContent === '' && form.appraiseStar === 0" block>
提交评价
</van-button>
<van-button @tap.native="submit" v-if="form.appraiseContent !== '' || form.appraiseStar !== 0"
custom-style="color:#fff;background-color:#FE3B53;border-radius: 8rpx;" block>
<van-button color="#fe3b53" @tap.native="submit" v-if="form.appraiseContent !== '' || form.appraiseStar !== 0" block>
提交评价
</van-button>
</view>
@@ -61,23 +59,18 @@
};
},
onLoad(options) {
this.setData({
options
});
this.options = options
},
methods: {
headleChange(event) {
this.setData({
...this.form,
['form.appraiseStar']: event.detail
});
this.form.appraiseStar = event
},

// 上传图片
async afterRead(event) {
const {
file
} = event.detail;
} = event;
const res = await getApp().globalData.upload({
file
});
@@ -88,21 +81,9 @@
});
return false;
}
const {
fileList
} = this;
const {
appealEnclosure
} = this;
const url = res.data;
fileList.push({
url
});
appealEnclosure.push(url);
this.setData({
fileList,
appealEnclosure
});
// this.fileList.push({url});
this.appealEnclosure.push(url);
},

// 清楚对应的image图片
@@ -110,11 +91,8 @@
const {
index
} = event.detail;
const Image = this.fileList;
Image.splice(index, 1);
this.setData({
fileList: Image
});
this.fileList.splice(index, 1);
this.appealEnclosure.splice(index,1)
},

headleInput(event) {
@@ -125,10 +103,7 @@
name
} = event.currentTarget.dataset;
this.form[name] = value;
this.setData({
...this.form,
[name]: this[name]
});
this[name] = this[name]
},

// 提交
@@ -249,6 +224,5 @@
bottom: 0;
z-index: 99;
background-color: #fff;
padding: 20px 50rpx 50rpx 50rpx;
}
</style>

+ 4
- 2
src/packages/people/pages/masses-detail/masses-detail.vue View File

@@ -83,8 +83,10 @@
</view>
<view class="flex detail-appraise-title flex-v-center">
<view>满意度:</view>
<van-rate readonly :value="messsDetail.appraiseStar" :size="12" gutter="2rpx" icon="/images/void-icon2.png"
void-icon="/images/rate-icon.png" />
<block v-for="item in 5" :key="item">
<image src="/static/images/void-icon2.png" v-if="messsDetail.appraiseStar >= item" style="width: 36rpx;height: 36rpx;margin-right: 10rpx;" mode=""></image>
<image src="/static/images/rate-icon.png" v-else style="width: 36rpx;height: 36rpx;margin-right: 10rpx;" mode=""></image>
</block>
</view>
<view class="mt-28">
<view>{{ messsDetail.appraiseContent || '暂无评价' }}</view>


+ 6
- 1
src/pages.json View File

@@ -408,7 +408,12 @@
{
"path": "pages/my-masses/my-masses-appraise",
"name": "my",
"style": {}
"style": {
"navigationBarTitleText": "测试",
"navigationStyle": "default",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/my-masses/my-masses-reply",


Loading…
Cancel
Save