小程序完善
This commit is contained in:
parent
c39ae9419e
commit
6ad7a2ea20
@ -59,6 +59,7 @@
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import request from "../../utils/request";
|
||||
import config from "@/config";
|
||||
import {setJSONData} from '@/utils/auth'
|
||||
export default {
|
||||
components: {
|
||||
tabBarVue,
|
||||
@ -149,9 +150,10 @@
|
||||
})
|
||||
},
|
||||
gotoShopDetail(row) {
|
||||
setJSONData("shopInfo",row)
|
||||
// 直接把那一行的数据转发过去
|
||||
uni.navigateTo({
|
||||
url: '/pages-shop/shopDetail/shopDetail?info=' + encodeURIComponent(JSON.stringify(row))
|
||||
url: '/pages-shop/shopDetail/shopDetail?id='+row.id
|
||||
})
|
||||
},
|
||||
gotoPage(menu) {
|
||||
|
@ -3,24 +3,26 @@
|
||||
<v-navigation-bar background-color="#fff" title-color="#333" title="我的评价"></v-navigation-bar>
|
||||
<view class="body">
|
||||
<view v-for="(item, index) in evaluateList" :key="index" class="item">
|
||||
<view class="date">07-06</view>
|
||||
<view class="date">{{ item.commentTime }}</view>
|
||||
<view class="message">
|
||||
<!-- 这家修理厂的喷漆工艺非常不错,特别均匀,师傅也很细心。如果您需要做喷漆或者维修服务,不要错过这里!-->
|
||||
{{item.commentDesc}}
|
||||
</view>
|
||||
<view class="rate">
|
||||
<!-- 设置尺寸大小 -->
|
||||
<uni-rate allow-half :value="item.commentStar"/>
|
||||
<uni-rate :readonly="true" allow-half :value="item.commentStar"/>
|
||||
</view>
|
||||
<view class="shopInfo">
|
||||
<image class="shopImg" :src="item.image" mode="aspectFill"></image>
|
||||
<view class="shopInfo_content">
|
||||
<!-- <view class="shopName">顺捷汽车维修搭电救援补胎中心</view>-->
|
||||
<view class="shopName">{{ item.tenantName }}</view>
|
||||
<!-- <view class="shopAddress">济南市历下区福瑞达历下护理院东南门旁</view>-->
|
||||
<view class="shopAddress">{{ item.goodsTitle }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="no-data" v-if="evaluateList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -47,6 +49,26 @@
|
||||
this.getAppraisePage()
|
||||
},
|
||||
methods:{
|
||||
/**
|
||||
* 时间戳转文字
|
||||
* */
|
||||
timestampToDate(timestamp) {
|
||||
let date = new Date(timestamp); // 将时间戳转换为Date对象
|
||||
let year = date.getFullYear(); // 获取年份
|
||||
let month = date.getMonth() + 1; // 获取月份,需要+1因为月份是从0开始计算的
|
||||
let day = date.getDate(); // 获取日
|
||||
let hours = date.getHours(); // 获取小时
|
||||
let minutes = date.getMinutes(); // 获取分钟
|
||||
let seconds = date.getSeconds(); // 获取秒钟
|
||||
// 格式化月份、日期、小时、分钟、秒
|
||||
month = month < 10 ? '0' + month : month;
|
||||
day = day < 10 ? '0' + day : day;
|
||||
hours = hours < 10 ? '0' + hours : hours;
|
||||
minutes = minutes < 10 ? '0' + minutes : minutes;
|
||||
seconds = seconds < 10 ? '0' + seconds : seconds;
|
||||
// 拼接成 yyyy-MM-dd HH:mm:ss 格式
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; // 返回格式化后的时间字符串
|
||||
},
|
||||
async getAppraisePage(){
|
||||
const res = await request({
|
||||
url: "/userClient/repair/order/getAppraise",
|
||||
@ -58,6 +80,7 @@
|
||||
})
|
||||
this.evaluateList = res.data.records
|
||||
this.evaluateList.forEach(item => {
|
||||
item.commentTime = this.timestampToDate(item.commentTime)
|
||||
item.image = require("../static/inImage.jpg")
|
||||
})
|
||||
}
|
||||
@ -130,5 +153,8 @@
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
.no-data{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<text>服务评价</text>
|
||||
<uni-rate allow-half="true" v-model="formData.commentStar"></uni-rate>
|
||||
</view>
|
||||
<textarea class="message" v-model="formData.commentDesc" placeholder="可在此输入当前维修厂的服务评价" />
|
||||
<textarea class="message" v-model="formData.commentDesc" placeholder="请输入本次服务的评价或建议!" />
|
||||
<view class="submit" @click="submit">提交评价</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -46,14 +46,34 @@
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.formData['id'] = this.info.id
|
||||
request({
|
||||
url: "/userClient/repair/order/appraise",
|
||||
method: "post",
|
||||
data: this.formData
|
||||
}).then(res => {
|
||||
uni.navigateBack()
|
||||
}).catch(()=>{})
|
||||
if(null==this.formData.commentStar || ""==this.formData.commentStar){
|
||||
uni.showToast({
|
||||
title: '请对本次服务打分!',
|
||||
icon: 'none'
|
||||
})
|
||||
}else if(null==this.formData.commentDesc || ""==this.formData.commentDesc){
|
||||
uni.showToast({
|
||||
title: '请输入本次服务的评价或建议!',
|
||||
icon: 'none'
|
||||
})
|
||||
}else{
|
||||
this.formData['id'] = this.info.id
|
||||
request({
|
||||
url: "/userClient/repair/order/appraise",
|
||||
method: "post",
|
||||
data: this.formData
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: '评价成功!',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},500)
|
||||
}).catch(()=>{
|
||||
uni.navigateBack()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -113,6 +133,7 @@
|
||||
.message {
|
||||
padding: 30rpx 0;
|
||||
height: 400rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.submit {
|
||||
width: 510rpx;
|
||||
|
@ -39,10 +39,12 @@
|
||||
<view class="line3">
|
||||
<view v-if="item.orderStatus == '0'" @click="goPay(item)" class="showOrder">支付</view>
|
||||
<view v-if="item.goodsType == '2'" @click="gotoDetail(item)" class="showOrder">查看订单</view>
|
||||
<view @click="gotoEvaluate(item)" class="evaluate" v-if="item.goodsType == '2' && item.orderStatus === '1' && !item.commentDesc">评价订单</view>
|
||||
<view @click="gotoEvaluate(item)" class="evaluate" v-if="item.orderStatus === '1' && !item.commentDesc">评价订单</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="no-data" v-if="orderList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0" @change="popupChange">
|
||||
@ -382,5 +384,8 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.no-data{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -66,21 +66,37 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<view class="btn" @click="gotoReservation">开始预约</view>
|
||||
<view class="btn" @click="toggle('bottom')">开始预约</view>
|
||||
</view>
|
||||
<view>
|
||||
<!-- 普通弹窗 -->
|
||||
<uni-popup ref="popup" background-color="#fff">
|
||||
<view :class="{ 'popup-height': type === 'left' || type === 'right' }">
|
||||
<view class="popup-content">
|
||||
<text class="text">{{info.corpName}}申请获取您的个人信息、车辆信息。</text>
|
||||
</view>
|
||||
<view class="popup-button">
|
||||
<button type="default" @click="cancelReservation">取消</button>
|
||||
<button type="primary" @click="gotoReservation">授权</button>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import request from "../../utils/request";
|
||||
import {getToken} from '@/utils/auth.js'
|
||||
import {getJSONData,getToken} from '@/utils/auth'
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: 'center',
|
||||
shopName:"",
|
||||
// busiList: [{
|
||||
// title: '钣金喷漆维修',
|
||||
// desc: '钣金喷漆维修是一个汽车修理的技术手段,此方面汽车钣金等于汽车钣金修理,指汽车发生碰撞后要对车身进行修复,也即除对车身进行防腐和装饰的喷涂工作外其余的所有工作。如汽车车身损伤的分析,汽车车身的测量,汽车车身钣金的整形,拉伸矫正,去应力焊接,以及汽车车身附件装配,调整等工作。',
|
||||
@ -103,24 +119,58 @@
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
this.info = JSON.parse(decodeURIComponent(data.info))
|
||||
if(data.id){
|
||||
this.info = getJSONData("shopInfo")
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getServer()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 弹出层
|
||||
* @param type 位置
|
||||
*/
|
||||
toggle(type) {
|
||||
this.type = type
|
||||
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
|
||||
this.$refs.popup.open(type)
|
||||
},
|
||||
/**
|
||||
* 取消授权
|
||||
*/
|
||||
cancelReservation(){
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
// 去预约
|
||||
gotoReservation() {
|
||||
if(getToken()){
|
||||
uni.navigateTo({
|
||||
url: '/pages/myReservation/addReservation?info=' + encodeURIComponent(JSON.stringify(this.info))
|
||||
})
|
||||
//授权信息,需要调后台接口插入数据
|
||||
uni.showLoading();
|
||||
request({
|
||||
url: "/app-api/base/user-car/empowerUserInfo",
|
||||
method: 'get',
|
||||
tenantIdFlag: false,
|
||||
params:{tenantId:this.info.tenantId}
|
||||
}).then(res=>{
|
||||
uni.hideLoading();
|
||||
if(res.code==200){
|
||||
uni.navigateTo({
|
||||
url: '/pages/myReservation/addReservation?id=' + this.info.id
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '授权失败,请联系客户经理!',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
//未登录去登录
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 取能提供的服务
|
||||
async getServer() {
|
||||
@ -360,3 +410,21 @@
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.popup-content {
|
||||
@include flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 15px;
|
||||
height: 50px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.popup-button {
|
||||
@include flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 15px;
|
||||
height: 50px;
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
@ -29,8 +29,8 @@
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue';
|
||||
import request from "../../utils/request";
|
||||
import config from "config";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,setJSONData} from '@/utils/auth.js'
|
||||
import {getUserInfoRequest} from "@/utils/common";
|
||||
import {getToken,setJSONData} from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
|
@ -102,8 +102,7 @@
|
||||
import request from '../../utils/request';
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import config from "@/config";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,getUserInfo} from '@/utils/auth.js'
|
||||
import {getToken,getUserInfo,getJSONData} from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -139,7 +138,7 @@
|
||||
// }, ],
|
||||
dateList:[],
|
||||
chooseDate: '06-06',
|
||||
chooseTime: '11:00',
|
||||
chooseTime: '09:00',
|
||||
timeList: [{
|
||||
time: '09:00',
|
||||
disabled: false
|
||||
@ -183,28 +182,20 @@
|
||||
};
|
||||
},
|
||||
onLoad(data){
|
||||
this.info = JSON.parse(decodeURIComponent(data.info))
|
||||
this.info = getJSONData("shopInfo")
|
||||
this.formData.corpId = this.info.id
|
||||
this.getServer(this.info.id)
|
||||
this.initCarList()
|
||||
this.initDateList()
|
||||
},
|
||||
onShow() {
|
||||
if(!getToken()){
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}else{
|
||||
console.log("已登录")
|
||||
this.getUserInfos()
|
||||
}
|
||||
this.initCarList()
|
||||
this.initDateList()
|
||||
},
|
||||
methods: {
|
||||
//获取当前登录用户信息
|
||||
async getUserInfos() {
|
||||
console.log("获取用户信息")
|
||||
getUserInfo()
|
||||
},
|
||||
initDateList(){
|
||||
const daysOfWeek = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
const currentDate = new Date();
|
||||
|
@ -8,6 +8,9 @@
|
||||
<reservationOrderVue v-for="(item, index) in orderList" :key="index" :orderInfo="item">
|
||||
</reservationOrderVue>
|
||||
</view>
|
||||
<view class="no-data" v-if="orderList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
@ -119,5 +122,8 @@
|
||||
flex-direction: column;
|
||||
row-gap: 20rpx;
|
||||
}
|
||||
.no-data{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user