Merge branch 'dev'
# Conflicts: # config.js
This commit is contained in:
commit
14cd3aafdd
@ -17,10 +17,13 @@
|
||||
<view class="navigationBarTitle" :style="{ color: titleColor }">
|
||||
{{ title }}
|
||||
</view>
|
||||
<view v-if="showClear" @click="clearNoReadFun" class="navigationBarIcon" :style="{ color: titleColor }">
|
||||
<image src="@/static/images/clear.jpg" mode="" class="clear-icon"></image>
|
||||
</view>
|
||||
</template>
|
||||
<view class="navigationBarBackExtra">
|
||||
<slot name="extra">
|
||||
</slot?>
|
||||
</slot>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -45,6 +48,10 @@
|
||||
leftTitle: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
showClear: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -77,7 +84,10 @@
|
||||
methods: {
|
||||
back() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
},
|
||||
clearNoReadFun(){
|
||||
this.$emit('clearNoRead')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -108,5 +118,13 @@
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.navigationBarIcon {
|
||||
display: flex;
|
||||
}
|
||||
.clear-icon{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,8 +1,8 @@
|
||||
// 应用全局配置
|
||||
module.exports = {
|
||||
// baseUrl: 'https://www.nuoyunr.com',
|
||||
// baseUrl: 'http://192.168.1.4:48080',
|
||||
baseUrl: "http://localhost:48080",
|
||||
// baseUrl: 'http://192.168.1.17:48080',
|
||||
baseUrl: "http://192.168.1.4:48080",
|
||||
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
|
||||
baseImageUrl: 'https://www.nuoyunr.com/minio/',
|
||||
wsUrl: 'wss://www.nuoyunr.com',
|
||||
|
@ -18,7 +18,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
<view style="text-align: center" v-if="activeList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<!-- 输入框示例 -->
|
||||
@ -34,8 +36,7 @@
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import request from "@/utils/request";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,setUserInfo,getUserInfo} from '@/utils/auth.js'
|
||||
import {getToken,getUserInfo} from '@/utils/auth'
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar,
|
||||
@ -75,14 +76,8 @@ export default {
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}else{
|
||||
console.log("已登录")
|
||||
if(!getUserInfo()){
|
||||
console.log("没有用户信息")
|
||||
this.getUserInfos()
|
||||
}else{
|
||||
this.customInfo = JSON.parse(getUserInfo())
|
||||
this.getActive()
|
||||
}
|
||||
//直接取缓存中的用户信息
|
||||
this.customInfo = JSON.parse(getUserInfo())
|
||||
}
|
||||
},
|
||||
onLoad(data) {
|
||||
@ -118,24 +113,6 @@ export default {
|
||||
console.log("index",this.index)
|
||||
this.joinKkylAct()
|
||||
},
|
||||
//获取当前登录用户信息
|
||||
async getUserInfos() {
|
||||
request({
|
||||
url: "/userClient/customer/getUserCustomer",
|
||||
method: 'get',
|
||||
params:{}
|
||||
}).then(res=>{
|
||||
if(!res.data){
|
||||
uni.reLaunch({
|
||||
url: '/pages/my/register'
|
||||
})
|
||||
}else{
|
||||
setUserInfo(JSON.stringify(res.data))
|
||||
this.customInfo = res.data
|
||||
this.getActive()
|
||||
}
|
||||
})
|
||||
},
|
||||
//查询营销活动列表
|
||||
async getActive() {
|
||||
this.activeList=[]
|
||||
@ -240,7 +217,6 @@ export default {
|
||||
uni.showToast({
|
||||
title:'支付成功'
|
||||
})
|
||||
this.getUserInfos()
|
||||
}
|
||||
// 支付成功后的回调函数, res.errMsg = 'requestPayment:ok'
|
||||
},
|
||||
|
@ -11,7 +11,7 @@
|
||||
<div class="body">
|
||||
<rich-text style="width: 100%" :nodes="richTextHtml | formatRichText" />
|
||||
</div>
|
||||
<view class="fixed-button" @click="toActivity">参与<br/>活动</view>
|
||||
<view v-if="toUrl" class="fixed-button" @click="toActivity">参与<br/>活动</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -33,7 +33,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
richTextHtml: ''
|
||||
richTextHtml: '',
|
||||
toUrl:null,
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
@ -49,10 +50,9 @@ export default {
|
||||
})
|
||||
const data = res.data
|
||||
this.richTextHtml = data.content
|
||||
// this.richTextHtml = data.content.replace(/(<img[^>]+src=")([^":]*?)(")/g, (match, p1, p2, p3) => {
|
||||
// return `${p1}${config.baseImageUrl}/${p2}${p3}`;
|
||||
// });
|
||||
// this.richTextHtml = `data:text/html;charset=utf-8,${encodeURIComponent(this.richTextHtml)}`
|
||||
if(data.toUrl){
|
||||
this.toUrl = data.toUrl
|
||||
}
|
||||
}catch {}
|
||||
},
|
||||
toActivity(){
|
||||
|
@ -23,7 +23,7 @@
|
||||
<text class="menu-title">{{menu.title}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="info" v-if="infoList.length>0" @click="gotoNotice">
|
||||
<image class="info-icon" src="@/static/icons/homeInfo.png" mode="aspectFit"></image>
|
||||
<view class="infoList">
|
||||
<view v-for="(item, index) in infoList" :key="item.id" class="infoItem">
|
||||
@ -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,
|
||||
@ -77,11 +78,11 @@
|
||||
icon: require('@/static/icons/homeMenuIcon/menu2.png'),
|
||||
path: '/pages/myCar/myCar'
|
||||
},
|
||||
{
|
||||
title: '活动礼包',
|
||||
icon: require('@/static/icons/homeMenuIcon/menu3.png'),
|
||||
path: '/pages-home/home/active'
|
||||
},
|
||||
// {
|
||||
// title: '活动礼包',
|
||||
// icon: require('@/static/icons/homeMenuIcon/menu3.png'),
|
||||
// path: '/pages-home/home/active'
|
||||
// },
|
||||
{
|
||||
title: '操作指南',
|
||||
icon: require('@/static/icons/homeMenuIcon/menu4.png'),
|
||||
@ -97,28 +98,6 @@
|
||||
title: '车辆机件“焕新上岗”,武汉公交修旧创效出实招'
|
||||
},
|
||||
],
|
||||
// shopList: [{
|
||||
// id: 1,
|
||||
// title: '顺捷汽车维修搭电救援补胎中心',
|
||||
// address: '济南市历下区福瑞达历下护理院东南门旁',
|
||||
// distance: '1.9km',
|
||||
// image: ''
|
||||
// },
|
||||
// {
|
||||
// id: 2,
|
||||
// title: '顺捷汽车维修搭电救援补胎中心',
|
||||
// address: '济南市历下区福瑞达历下护理院东南门旁',
|
||||
// distance: '1.9km',
|
||||
// image: ''
|
||||
// },
|
||||
// {
|
||||
// id: 3,
|
||||
// title: '顺捷汽车维修搭电救援补胎中心',
|
||||
// address: '济南市历下区福瑞达历下护理院东南门旁',
|
||||
// distance: '1.9km',
|
||||
// image: ''
|
||||
// },
|
||||
// ]
|
||||
shopList: [],
|
||||
bannerList: [],
|
||||
richTextHtml: null
|
||||
@ -127,8 +106,29 @@
|
||||
onShow() {
|
||||
this.getCompanyPage()
|
||||
this.getBannerList()
|
||||
this.getNoticeList()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 查通知公告
|
||||
*/
|
||||
async getNoticeList(){
|
||||
const res = await request({
|
||||
url: "/app-api/base/notice/pageList",
|
||||
method: "get",
|
||||
params: {
|
||||
pageNo:1,
|
||||
pageSize:2,
|
||||
type:1,
|
||||
parentServer: "weixiu",
|
||||
server: "wx"
|
||||
},
|
||||
tenantIdFlag:false
|
||||
})
|
||||
if(res.code==200){
|
||||
this.infoList = res.data.records
|
||||
}
|
||||
},
|
||||
swiperChangeFun(e) {
|
||||
console.log('e', e)
|
||||
this.bannerIndex = e.detail.current
|
||||
@ -148,10 +148,19 @@
|
||||
item.url = config.baseImageUrl + item.url
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 跳转通知公告列表页
|
||||
*/
|
||||
gotoNotice(){
|
||||
uni.navigateTo({
|
||||
url: '/pages-shop/notice/notice'
|
||||
})
|
||||
},
|
||||
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}}
|
||||
{{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;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -11,38 +11,43 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderList">
|
||||
<view v-for="(item, index) in orderList" :key="index" class="orderItem">
|
||||
<view class="line1">
|
||||
<view class="orderNo">
|
||||
订单编号:{{ item.orderNo }}
|
||||
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" bindscrolltolower="onReachBottom"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<view v-for="(item, index) in orderList" :key="index" class="orderItem">
|
||||
<view class="line1">
|
||||
<view class="orderNo">
|
||||
订单编号:{{ item.orderNo }}
|
||||
</view>
|
||||
<text class="orderStatus" :class="['status_'+item.orderStatus]">
|
||||
{{ getStatus(item.orderStatus,item.mainStatus,item.payType) }}
|
||||
</text>
|
||||
</view>
|
||||
<text class="orderStatus" :class="['status_' + item.status]">
|
||||
{{ getStatus(item.orderStatus) }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="orderInfo">
|
||||
<image class="orderInfoIcon" src="@/static/icons/Frame28.png" mode="aspectFit"></image>
|
||||
<text class="orderInfoText">{{ item.goodsTitle }}</text>
|
||||
</view>
|
||||
<view class="orderInfo">
|
||||
<image class="orderInfoIcon" src="@/static/icons/Frame27.png" mode="aspectFit"></image>
|
||||
<text class="orderInfoText">{{ item.tenantName | 蓝安-中鑫之宝 }}</text>
|
||||
</view>
|
||||
<view class="line2">
|
||||
<view>
|
||||
共计
|
||||
<text class="orderAmountUnit">¥</text>
|
||||
<text class="orderAmount">{{ item.payMoney }}</text>
|
||||
<view class="orderInfo">
|
||||
<image class="orderInfoIcon" src="@/static/icons/Frame28.png" mode="aspectFit"></image>
|
||||
<text class="orderInfoText">{{ item.goodsTitle }}</text>
|
||||
</view>
|
||||
<view class="orderInfo">
|
||||
<image class="orderInfoIcon" src="@/static/icons/Frame27.png" mode="aspectFit"></image>
|
||||
<text class="orderInfoText">{{ item.tenantName || "蓝安-中鑫之宝" }}</text>
|
||||
</view>
|
||||
<view class="line2" >
|
||||
<view v-if="item.payMoney">
|
||||
共计
|
||||
<text class="orderAmountUnit">¥</text>
|
||||
<text class="orderAmount">{{ item.payMoney }}</text>
|
||||
</view>
|
||||
<text >{{ formatTimestamp(item.createTime) }}</text>
|
||||
</view>
|
||||
<view class="line3">
|
||||
<view v-if="item.orderStatus == '0' && item.payType == '01'" @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.orderStatus === '1' && !item.commentDesc">评价订单</view>
|
||||
</view>
|
||||
<text>{{ formatTimestamp(item.createTime) }}</text>
|
||||
</view>
|
||||
<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 class="no-data" v-if="orderList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0" @change="popupChange">
|
||||
@ -66,6 +71,7 @@ import request from '../../utils/request';
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
||||
import drawQrcode from 'weapp-qrcode';
|
||||
import {getToken,getUserInfo} from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -76,38 +82,41 @@ export default {
|
||||
return {
|
||||
payShow: false,
|
||||
activeKey: 0,
|
||||
pageNum: 1,
|
||||
totalPages: 0,
|
||||
imageUrl: '',
|
||||
tabList: [{
|
||||
id: 0,
|
||||
title: '全部订单'
|
||||
},
|
||||
tabList: [
|
||||
{
|
||||
id: 0,
|
||||
title: '维修中'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '维修中'
|
||||
title: '待支付'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '待评价'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '全部订单'
|
||||
},
|
||||
],
|
||||
orderList: [],
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered:false,
|
||||
changeActive: false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.orderList = []
|
||||
this.getList()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.pageNum >= this.totalPages) {
|
||||
uni.showToast({
|
||||
title: '没有下一页数据',
|
||||
icon: 'none'
|
||||
onLoad() {
|
||||
if(!getToken()){
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
} else {
|
||||
this.pageNum++
|
||||
}else {
|
||||
this.orderList = []
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
@ -125,19 +134,47 @@ export default {
|
||||
// 组合成日期时间字符串
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
},
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottom() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.pageNo * this.pageSize >= this.total) {
|
||||
uni.$u.toast('没有更多数据了')
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.pageNo++
|
||||
//此处调用自己获取数据列表的方法
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh(){
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.messageList = []
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
let data = {
|
||||
pageSize: 20,
|
||||
pageNo: this.pageNum
|
||||
pageSize: this.pageSize,
|
||||
pageNo: this.pageNo
|
||||
}
|
||||
switch (this.activeKey) {
|
||||
case 0:
|
||||
//维修中
|
||||
data.selectType = "working"
|
||||
break;
|
||||
case 1:
|
||||
data.status = "06"
|
||||
//待支付
|
||||
data.selectType = "waitingPay"
|
||||
break;
|
||||
case 2:
|
||||
data.status = '00'
|
||||
//待评价
|
||||
data.selectType = 'waitingComment'
|
||||
break
|
||||
default:
|
||||
break
|
||||
@ -147,31 +184,70 @@ export default {
|
||||
}
|
||||
this.changeActive = false
|
||||
await request({
|
||||
url: '/userClient/order/page',
|
||||
url: '/app-api/repair/order-info/page',
|
||||
method: 'get',
|
||||
params: data
|
||||
params: data,
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.orderList = this.orderList.concat(res.rows)
|
||||
let total = res.total
|
||||
this.totalPages = Math.ceil(total / this.pageSize);
|
||||
//判断 如果获取的数据的页码不是第一页,就让之前赋值获取过的数组数据 concat连接 刚获取的第n页数据
|
||||
if (this.pageNo != 1) {
|
||||
this.orderList = this.orderList.concat(res.data.records)
|
||||
} else {
|
||||
this.orderList = res.data.records
|
||||
}
|
||||
//将获取的总条数赋值
|
||||
this.total = res.data.total
|
||||
this.isTriggered = false
|
||||
}
|
||||
})
|
||||
},
|
||||
changeTabFun(id) {
|
||||
this.activeKey = id
|
||||
this.changeActive = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.getList()
|
||||
},
|
||||
getStatus(status) {
|
||||
switch (status) {
|
||||
case '0':
|
||||
return '待支付'
|
||||
case '1':
|
||||
return '已支付'
|
||||
default:
|
||||
break;
|
||||
/**
|
||||
* 获取工单的状态
|
||||
* @param orderStatus 订单是否支付 0未支付 1已支付
|
||||
* @param mainStatus 工单主状态
|
||||
* @param payType 支付方式
|
||||
* @returns {string}
|
||||
*/
|
||||
getStatus(orderStatus,mainStatus,payType) {
|
||||
let str = "";
|
||||
if("0"==orderStatus){
|
||||
//未支付的情况下,返回工单的状态
|
||||
if("04"==mainStatus){
|
||||
//待派工
|
||||
str = "待派工"
|
||||
}else if("05"==mainStatus){
|
||||
//维修中
|
||||
str = "维修中"
|
||||
}else if("01"==mainStatus){
|
||||
//待结算
|
||||
if(!payType){
|
||||
str = "待结算"
|
||||
}else{
|
||||
str = "待支付"
|
||||
}
|
||||
}else if("06"==mainStatus){
|
||||
//挂单/记账
|
||||
str = "挂单/记账"
|
||||
}else if("02"==mainStatus){
|
||||
//已结账
|
||||
str = "已结账"
|
||||
}else if("03"==mainStatus){
|
||||
//已作废
|
||||
str = "已作废"
|
||||
}
|
||||
}else{
|
||||
//已支付
|
||||
str = "已支付"
|
||||
}
|
||||
return str;
|
||||
},
|
||||
async goPay(data) {
|
||||
let that = this
|
||||
@ -226,10 +302,6 @@ export default {
|
||||
uni.navigateTo({
|
||||
url: '/pages-order/orderDetail/orderDetail?ticketsId=' + row.goodsId
|
||||
})
|
||||
}else {
|
||||
uni.navigateTo({
|
||||
url: '/pages-order/orderDetail/orderDetail'
|
||||
})
|
||||
}
|
||||
},
|
||||
gotoEvaluate(row) {
|
||||
@ -251,8 +323,8 @@ export default {
|
||||
|
||||
.body {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
padding: 24rpx 32rpx;
|
||||
height: 100%;
|
||||
padding: 0 32rpx;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
@ -292,8 +364,10 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 20rpx;
|
||||
height: calc(100% - 65px);
|
||||
|
||||
.orderItem {
|
||||
margin-bottom:10rpx;
|
||||
padding: 30rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
@ -382,5 +456,8 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.no-data{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
195
pages-shop/notice/notice.vue
Normal file
195
pages-shop/notice/notice.vue
Normal file
@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<VNavigationBar background-color="#fff" title-color="#333" title="通知公告"></VNavigationBar>
|
||||
<view class="body">
|
||||
<view class="messageList">
|
||||
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" bindscrolltolower="onReachBottom"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<view v-for="(item, index) in messageList" :key="index" class="messageItem" @click="readNotice(item)">
|
||||
<image class="messageIcon" src="../../static/icons/message-icon1.png" mode="aspectFit"></image>
|
||||
<view class="messageContent">
|
||||
<view class="messageTitle" >{{item.title}}</view>
|
||||
<!-- <view class="messageContent_content">{{item.templateContent}}</view>-->
|
||||
<view class="messageContent_content" style="text-align: right">{{formatTime(item.createTime)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="text-align: center" v-if="messageList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png"></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import request from "@/utils/request";
|
||||
import {formatTimestamp} from "@/utils/utils";
|
||||
import {setJSONData} from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type:"center",
|
||||
messageList: [],
|
||||
pageNo: 1,
|
||||
pageSize: 15,
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered:false,
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
|
||||
},
|
||||
onShow(){
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
/**
|
||||
* 看通知公告详情
|
||||
*/
|
||||
readNotice(item){
|
||||
setJSONData("notice",item)
|
||||
uni.navigateTo({
|
||||
url: "/pages-shop/notice/noticeContent",
|
||||
})
|
||||
},
|
||||
formatTime(value){
|
||||
return formatTimestamp(value)
|
||||
},
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottom() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.pageNo * this.pageSize >= this.total) {
|
||||
uni.$u.toast('没有更多数据了')
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.pageNo++
|
||||
//此处调用自己获取数据列表的方法
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh(){
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.messageList = []
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
async getList(){
|
||||
await request({
|
||||
url: "/app-api/base/notice/pageList",
|
||||
method: "GET",
|
||||
params:{
|
||||
pageNo:this.pageNo,
|
||||
pageSize:this.pageSize,
|
||||
type:1,
|
||||
parentServer: "weixiu",
|
||||
server: "wx"
|
||||
},
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
//判断 如果获取的数据的页码不是第一页,就让之前赋值获取过的数组数据 concat连接 刚获取的第n页数据
|
||||
if (this.pageNo != 1) {
|
||||
this.messageList = this.messageList.concat(res.data.records)
|
||||
} else {
|
||||
this.messageList = res.data.records
|
||||
}
|
||||
//将获取的总条数赋值
|
||||
this.total = res.data.total
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.body {
|
||||
flex: 1;
|
||||
height: calc(100vh - env(safe-area-inset-top));
|
||||
overflow: auto;
|
||||
}
|
||||
.messageList {
|
||||
padding: 0 32rpx;
|
||||
height: 100%;
|
||||
}
|
||||
.messageItem {
|
||||
padding: 30rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
column-gap: 20rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
|
||||
.messageIcon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.messageContent {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
.messageTitle {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.messageContent_content {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #858BA0;
|
||||
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
.popup-content {
|
||||
padding: 15px;
|
||||
height: auto;
|
||||
margin: auto;
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.popup-content-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.popup-info {
|
||||
margin-top: 30rpx;
|
||||
color: #fff;
|
||||
background-color: #f2f6fc;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
</style>
|
85
pages-shop/notice/noticeContent.vue
Normal file
85
pages-shop/notice/noticeContent.vue
Normal file
@ -0,0 +1,85 @@
|
||||
|
||||
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- <web-view :src="richTextHtml"></web-view>-->
|
||||
<VNavigationBar titleColor="rgba(0,0,0,0.9)" backgroundColor="#fff" title="通知公告详情"></VNavigationBar>
|
||||
<div class="body">
|
||||
<rich-text style="width: 100%" :nodes="richTextHtml | formatRichText" />
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "../../utils/request";
|
||||
import config from '@/config'
|
||||
import parser from 'rich-text-parser'
|
||||
import VNavigationBar from "../../components/VNavigationBar.vue";
|
||||
import {getJSONData} from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
name: "content",
|
||||
components: {VNavigationBar},
|
||||
filters: {
|
||||
formatRichText(html) { // 控制小程序中图片大小
|
||||
// console.log(html)
|
||||
const nodes = parser.getRichTextJson(html)
|
||||
return nodes.children
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
richTextHtml: '',
|
||||
toUrl:null,
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
let notice = getJSONData("notice")
|
||||
this.richTextHtml = notice.content
|
||||
},
|
||||
methods:{
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
img{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.body{
|
||||
padding: 15rpx;
|
||||
flex: 1;
|
||||
height: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
.fixed-button {
|
||||
position: fixed;
|
||||
bottom: 3rem; /* 距离底部的距离 */
|
||||
right: 2rem; /* 距离右边的距离 */
|
||||
z-index: 1000; /* 确保按钮在其他元素之上 */
|
||||
width: 80px; /* 按钮直径 */
|
||||
height: 80px; /* 按钮直径 */
|
||||
background-color: #f00; /* 按钮背景颜色 */
|
||||
color: #fff; /* 文字颜色 */
|
||||
border-radius: 50%; /* 圆形 */
|
||||
display: flex; /* 使用弹性盒子布局 */
|
||||
justify-content: center; /* 水平居中文本 */
|
||||
align-items: center; /* 垂直居中文本 */
|
||||
font-size: 18px; /* 字体大小 */
|
||||
text-align: center; /* 文字水平居中 */
|
||||
line-height: normal; /* 使用默认行高 */
|
||||
font-family: 'Arial', sans-serif; /* 选择字体 */
|
||||
}
|
||||
|
||||
/* 为了确保文本垂直居中并且分行 */
|
||||
.fixed-button br {
|
||||
content: '';
|
||||
display: block;
|
||||
}
|
||||
</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,59 @@
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
this.info = JSON.parse(decodeURIComponent(data.info))
|
||||
if(data.id){
|
||||
this.info = getJSONData("shopInfo")
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.cancelReservation()
|
||||
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,systemCode:"04"}
|
||||
}).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 +411,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>
|
||||
|
18
pages.json
18
pages.json
@ -34,6 +34,12 @@
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/myCar/scan-frame",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/my/myInfo",
|
||||
"style": {
|
||||
@ -139,6 +145,18 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "notice/notice",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "notice/noticeContent",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1,24 +1,32 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<VNavigationBar background-color="rgba(0,0,0,0)" title-color="rgba(0,0,0,0)"></VNavigationBar>
|
||||
<VNavigationBar title="操作指南" background-color="#fff" title-color="#333"></VNavigationBar>
|
||||
<view class="body">
|
||||
<view class="title">如何在小程序上下单车辆维修</view>
|
||||
<view class="content"></view>
|
||||
<view class="title">{{guideObj.title}}</view>
|
||||
<rich-text style="width: 100%" :nodes="guideObj.content" />
|
||||
<!-- <view class="content">{{guideObj.content}}</view>-->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import {getJSONData} from '@/utils/auth'
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
guideObj:{
|
||||
title:"",
|
||||
content:"",
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.guideObj = getJSONData("guideObj")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -34,13 +42,14 @@
|
||||
height: 0;
|
||||
margin: 32rpx;
|
||||
padding: 30rpx;
|
||||
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 20rpx;
|
||||
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,27 +2,98 @@
|
||||
<view class="container">
|
||||
<v-navigation-bar title="操作指南" background-color="#fff" title-color="#333"></v-navigation-bar>
|
||||
<view class="body">
|
||||
<view @click="gotoDetail(item)" v-for="(item,index) in data" :key="index" class="guideItem">
|
||||
<text class="guide_content">如何在小程序上下单车辆维修</text>
|
||||
<image class="guideIcon" src="../../static/icons/homeInfoMore.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" bindscrolltolower="onReachBottom"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<view @click="gotoDetail(item)" v-for="(item,index) in dataList" :key="index" class="guideItem">
|
||||
<text class="guide_content">{{ item.title }}</text>
|
||||
<image class="guideIcon" src="../../static/icons/homeInfoMore.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view style="text-align: center" v-if="dataList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import request from "@/utils/request";
|
||||
import {setJSONData} from '@/utils/auth'
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
data: [{}, {}]
|
||||
dataList: [],
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered:false,
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
gotoDetail() {
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottom() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.pageNo * this.pageSize >= this.total) {
|
||||
uni.$u.toast('没有更多数据了')
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.pageNo++
|
||||
//此处调用自己获取数据列表的方法
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh(){
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.dataList = []
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
async getList(){
|
||||
await request({
|
||||
url: "/app-api/base/notice/pageList",
|
||||
method: "GET",
|
||||
params:{
|
||||
pageNo:this.pageNo,
|
||||
pageSize:this.pageSize,
|
||||
type:3,
|
||||
parentServer:"weixiu",
|
||||
server:"wx"
|
||||
},
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
//判断 如果获取的数据的页码不是第一页,就让之前赋值获取过的数组数据 concat连接 刚获取的第n页数据
|
||||
if (this.pageNo != 1) {
|
||||
this.dataList = this.dataList.concat(res.data.records)
|
||||
} else {
|
||||
this.dataList = res.data.records
|
||||
}
|
||||
//将获取的总条数赋值
|
||||
this.total = res.data.total
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 查看详情页
|
||||
*/
|
||||
gotoDetail(item) {
|
||||
setJSONData("guideObj",item)
|
||||
uni.navigateTo({
|
||||
url: '/pages/guideList/guideDetail'
|
||||
})
|
||||
@ -35,36 +106,36 @@
|
||||
.container {
|
||||
background-color: #F3F5F7;
|
||||
height: 100%;
|
||||
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
.body {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
padding: 0 0 20rpx;
|
||||
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
.guideItem {
|
||||
margin: 20rpx 32rpx 0;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
column-gap: 10rpx;
|
||||
|
||||
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
|
||||
|
||||
.guide_content {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
|
||||
.guideIcon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
|
@ -5,9 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getToken
|
||||
} from "@/utils/auth";
|
||||
import { setInviteId ,removeInviteId} from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -15,17 +13,41 @@
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.reLaunch({
|
||||
url: '/pages-home/home/home'
|
||||
})
|
||||
onLoad(query) {
|
||||
const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容
|
||||
let theRequest = this.getUrlValue(q)
|
||||
if(theRequest.hasOwnProperty("inviteId")){
|
||||
//扫码邀请过来的,设置邀请者code
|
||||
setInviteId(theRequest['inviteId'])
|
||||
//先登录
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}else{
|
||||
removeInviteId()
|
||||
uni.reLaunch({
|
||||
url: '/pages-home/home/home'
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
//解析参数
|
||||
getUrlValue(url) {
|
||||
var theRequest = new Object();
|
||||
if (url.indexOf("?") != -1) {
|
||||
//有参数
|
||||
var str = url.split("?")[1];
|
||||
var strs = str.split("&");
|
||||
for (var i = 0; i < strs.length; i++) {
|
||||
theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
|
||||
}
|
||||
}
|
||||
return theRequest
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
<script>
|
||||
import request from '../../utils/request';
|
||||
import {setToken} from '@/utils/auth.js'
|
||||
import {setToken,setUserInfo,getInviteId} from '@/utils/auth.js'
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
@ -66,36 +66,9 @@
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
async getsxshenfen(){
|
||||
let data = {
|
||||
roleCode : this.shenfen
|
||||
}
|
||||
let res = await request({
|
||||
url:'/appInspection/userOwn/updateRole',
|
||||
method:'post',
|
||||
params: data
|
||||
})
|
||||
if(res.code == 200){
|
||||
uni.redirectTo({
|
||||
url: '/pages/detection/my'
|
||||
})
|
||||
}
|
||||
},
|
||||
getshenfen(text){
|
||||
this.shenfen = text
|
||||
|
||||
},
|
||||
open() {
|
||||
// console.log('open');
|
||||
},
|
||||
|
||||
close() {
|
||||
// this.show = false
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/detection/my'
|
||||
// })
|
||||
// // console.log('close');
|
||||
},
|
||||
/**
|
||||
* 《用户协议》、《隐私政策》
|
||||
*/
|
||||
goPolicy() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/PrivacyPolicy"
|
||||
@ -114,21 +87,6 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
async getAppinfo(){
|
||||
let res = await request({
|
||||
url:'/getAppInfo',
|
||||
method:'get',
|
||||
})
|
||||
console.log('getappinfo',res);
|
||||
},
|
||||
//授权
|
||||
authorize() {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "请阅读并勾选用户协议",
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
shibai(){
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
@ -155,21 +113,16 @@
|
||||
code: uni.getStorageSync('c1'),
|
||||
encryptedIv: e.detail.iv,
|
||||
encryptedData: e.detail.encryptedData,
|
||||
inviteId: uni.getStorageSync('inviteId') ? uni.getStorageSync('inviteId') : null
|
||||
inviteId: getInviteId() ? getInviteId() : null
|
||||
},
|
||||
success: (rex) => {
|
||||
if (rex.data.code == 0) {
|
||||
//设置token
|
||||
setToken(rex.data.data.token)
|
||||
if (rex.data.data.ifNeedFill) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/my/register'
|
||||
})
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages-home/home/home'
|
||||
})
|
||||
}
|
||||
setUserInfo(JSON.stringify(rex.data.data.userinfo))
|
||||
uni.reLaunch({
|
||||
url: '/pages-home/home/home'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
@ -196,104 +149,6 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
userinfo(){
|
||||
console.log('执行了');
|
||||
request({
|
||||
url: '/getAppInfo',
|
||||
method: 'get',
|
||||
|
||||
}).then((res)=>{
|
||||
let userJson = {}
|
||||
userJson.userId = res.user.userId
|
||||
console.log('身份信息',res,res.role.length);
|
||||
uni.setStorageSync('role',res.role)
|
||||
uni.setStorageSync('userinfo',res.user)
|
||||
if(!res.role||res.role.length==0){
|
||||
this.show = true
|
||||
}else{
|
||||
uni.reLaunch({
|
||||
url: '/pages/detection/my'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
getxz(index){
|
||||
this.activeid = index
|
||||
},
|
||||
goregister(){
|
||||
uni.redirectTo({
|
||||
url:'/pages/login/register'
|
||||
})
|
||||
},
|
||||
goforgot(){
|
||||
uni.redirectTo({
|
||||
url:'/pages/login/forgot'
|
||||
})
|
||||
},
|
||||
goselect(){
|
||||
console.log('执行');
|
||||
uni.redirectTo({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
},
|
||||
// 验证码方法
|
||||
sendVerificationCode() {
|
||||
let reg = /^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9]))\d{8}$/;
|
||||
if (!reg.test(this.tel)) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入正确的11位手机号'
|
||||
})
|
||||
this.tel = '';
|
||||
return false;
|
||||
}
|
||||
if (this.isButtonDisabled) {
|
||||
return; // 如果按钮已禁用,则直接返回
|
||||
}
|
||||
const data = {
|
||||
phone:this.tel,
|
||||
}
|
||||
request({
|
||||
url: '/loginSmsCode',
|
||||
method: 'post',
|
||||
params: data
|
||||
}).then((res)=>{
|
||||
console.log('验证码',res);
|
||||
if(res.code == 200){
|
||||
uni.showToast({
|
||||
title:'验证码已发送 请注意查收',
|
||||
icon:'none'
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'网络不佳请稍后再试',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.disableButton(); // 禁用按钮
|
||||
this.startCountdown(); // 启动倒计时
|
||||
|
||||
},
|
||||
disableButton() {
|
||||
this.isButtonDisabled = true;
|
||||
},
|
||||
enableButton() {
|
||||
this.isButtonDisabled = false;
|
||||
},
|
||||
startCountdown() {
|
||||
let countdown = setInterval(() => {
|
||||
this.countdownTime--;
|
||||
if (this.countdownTime === 0) {
|
||||
clearInterval(countdown);
|
||||
this.enableButton(); // 启用按钮
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,9 @@
|
||||
<view class="cardLabel">余额</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="no-data" v-if="customInfo.couponList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
<!-- <view class="cardItemBottom">-->
|
||||
<!-- <view class="useSm">使用说明</view>-->
|
||||
<!-- <view class="useBtn">去使用</view>-->
|
||||
@ -239,5 +242,8 @@
|
||||
bottom: 2rpx;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
.no-data{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,22 +1,39 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<VNavigationBar background-color="#fff" title-color="#333" title="消息中心"></VNavigationBar>
|
||||
<view class="body">
|
||||
<view class="messageList">
|
||||
<view v-for="(item, index) in messageList" :key="index" class="messageItem">
|
||||
<image class="messageIcon" src="../../static/icons/message-icon1.png" mode="aspectFit"></image>
|
||||
<view class="messageContent">
|
||||
<view class="messageTitle">系统通知</view>
|
||||
<view class="messageContent_content">节日快乐!在这美好的时刻,送上我最真挚的祝福:愿你的每一天都充满阳光和欢笑,每一步都走向成功和辉煌。</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="container">
|
||||
<VNavigationBar background-color="#fff" title-color="#333" title="消息中心" :showClear="showClear" @clearNoRead="clearNoReadFun"></VNavigationBar>
|
||||
<view class="body">
|
||||
<view class="messageList">
|
||||
<scroll-view style="height: 100%;" scroll-y="true" class="itemContent" bindscrolltolower="onReachBottom"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<view v-for="(item, index) in messageList" :key="index" class="messageItem" @click="readNotice(item)">
|
||||
<image class="messageIcon" src="../../static/icons/message-icon1.png" mode="aspectFit"></image>
|
||||
<view class="messageContent">
|
||||
<view :class="{'messageTitle':item.readStatus,'noReadTitle':!item.readStatus}" >系统通知</view>
|
||||
<view class="messageContent_content">{{item.templateContent}}</view>
|
||||
<view class="messageContent_content" style="text-align: right">{{formatTime(item.createTime)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="text-align: center" v-if="messageList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png"></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 普通弹窗 -->
|
||||
<uni-popup ref="popup" background-color="#fff" >
|
||||
<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
|
||||
<text class="text popup-content-text">{{ nowReadItem.templateContent }}</text>
|
||||
<button class="button popup-info" @click="dialogToggle"><text
|
||||
class="button-text info-text">知道了</text></button>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import request from "@/utils/request";
|
||||
import {formatTimestamp} from "@/utils/utils";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -24,9 +41,123 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
messageList: [{}, {}]
|
||||
type:"center",
|
||||
messageList: [],
|
||||
pageNo: 1,
|
||||
pageSize: 15,
|
||||
total: 0,
|
||||
//下来刷新状态
|
||||
isTriggered:false,
|
||||
//是否显示一键清空
|
||||
showClear:true,
|
||||
nowReadItem:{},
|
||||
};
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
|
||||
},
|
||||
onShow(){
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
/**
|
||||
* 点击阅读消息
|
||||
*/
|
||||
async readNotice(item) {
|
||||
this.nowReadItem = item
|
||||
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
|
||||
this.$refs.popup.open(this.type)
|
||||
//直接请求后台已读
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/update-read",
|
||||
method: "PUT",
|
||||
params:{ids:this.nowReadItem.id},
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
if(res.code==200){
|
||||
this.onRefresherrefresh()
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 消息设置为已读
|
||||
*/
|
||||
dialogToggle(){
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
/**
|
||||
* 一键清空未读消息
|
||||
*/
|
||||
async clearNoReadFun(){
|
||||
console.log("清空了")
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/update-all-read",
|
||||
method: "PUT",
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
if(res.code==200){
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.onRefresherrefresh()
|
||||
},500)
|
||||
}
|
||||
})
|
||||
},
|
||||
formatTime(value){
|
||||
return formatTimestamp(value)
|
||||
},
|
||||
/**
|
||||
* 上滑加载数据
|
||||
*/
|
||||
onReachBottom() {
|
||||
//判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕
|
||||
if (this.pageNo * this.pageSize >= this.total) {
|
||||
uni.$u.toast('没有更多数据了')
|
||||
return
|
||||
}
|
||||
//页码+1,调用获取数据的方法获取第二页数据
|
||||
this.pageNo++
|
||||
//此处调用自己获取数据列表的方法
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 下拉刷新数据
|
||||
*/
|
||||
onRefresherrefresh(){
|
||||
this.isTriggered = true
|
||||
this.pageNo = 1
|
||||
this.total = 0
|
||||
this.messageList = []
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
async getList(){
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/my-page",
|
||||
method: "GET",
|
||||
params:{
|
||||
pageNo:this.pageNo,
|
||||
pageSize:this.pageSize
|
||||
},
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
//判断 如果获取的数据的页码不是第一页,就让之前赋值获取过的数组数据 concat连接 刚获取的第n页数据
|
||||
if (this.pageNo != 1) {
|
||||
this.messageList = this.messageList.concat(res.data.list)
|
||||
} else {
|
||||
this.messageList = res.data.list
|
||||
}
|
||||
//将获取的总条数赋值
|
||||
this.total = res.data.total
|
||||
this.isTriggered = false
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -37,11 +168,12 @@
|
||||
flex-direction: column;
|
||||
.body {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
height: calc(100vh - env(safe-area-inset-top));
|
||||
overflow: auto;
|
||||
}
|
||||
.messageList {
|
||||
padding: 0 32rpx;
|
||||
height: 100%;
|
||||
}
|
||||
.messageItem {
|
||||
padding: 30rpx 0;
|
||||
@ -49,18 +181,30 @@
|
||||
align-items: center;
|
||||
column-gap: 20rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
|
||||
|
||||
.messageIcon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.noReadTitle {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.noReadTitle:after{
|
||||
content: "*";
|
||||
color: red;
|
||||
display: block; /* 或者其他的块级显示类型,比如 inline-block, table 等 */
|
||||
position: absolute; /* 或者 absolute 或者 fixed,取决于你的布局需求 */
|
||||
z-index: 1; /* 确保它在元素的上方 */
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.messageContent {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
.messageTitle {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
@ -68,11 +212,37 @@
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #858BA0;
|
||||
|
||||
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
.popup-content {
|
||||
padding: 15px;
|
||||
height: auto;
|
||||
margin: auto;
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.popup-content-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.popup-info {
|
||||
margin-top: 30rpx;
|
||||
color: #fff;
|
||||
background-color: #f2f6fc;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -6,22 +6,23 @@
|
||||
<view class="body-top">
|
||||
<image class="userBmg" src="../../static/images/image1.png" mode="widthFix"></image>
|
||||
<view class="userInfo">
|
||||
<image class="avatar" src="../../static/images/avatar.png" mode="aspectFit"></image>
|
||||
<text class="customInfo">{{customInfo.cusName}}</text>
|
||||
<image v-if="''==customInfo.avatar || null == customInfo.avatar" class="avatar" src="../../static/images/avatar.png" mode="aspectFit"></image>
|
||||
<image v-else class="avatar" :src="imgUrlPrex+customInfo.avatar" mode="scaleToFill"></image>
|
||||
<text class="customInfo">{{customInfo.nickname}}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="level">
|
||||
<image class="levelIcon" src="" mode="aspectFit"></image>
|
||||
<view class="levelInfo">
|
||||
<text class="levelNum">{{customInfo.levelName}}</text>
|
||||
<!-- <text class="levelQy">当前可享受4项权益</text> -->
|
||||
</view>
|
||||
<view class="showQyBtn" @click="showEquity">
|
||||
查看权益
|
||||
<image class="showQyBtnIcon" src="../../static/icons/icon1.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="level">-->
|
||||
<!-- <image class="levelIcon" src="" mode="aspectFit"></image>-->
|
||||
<!-- <view class="levelInfo">-->
|
||||
<!-- <text class="levelNum">{{customInfo.levelName}}</text>-->
|
||||
<!-- <!– <text class="levelQy">当前可享受4项权益</text> –>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="showQyBtn" @click="showEquity">-->
|
||||
<!-- 查看权益-->
|
||||
<!-- <image class="showQyBtnIcon" src="../../static/icons/icon1.png" mode="aspectFit"></image>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<view class="menu1">
|
||||
<view @click="goToPage('/pages/myCar/myCar')" style="background: linear-gradient( 90deg, #DEE5FC 0%, #CAD6FA 100%);"
|
||||
class="menu1-item menu-myCar">
|
||||
@ -42,9 +43,6 @@
|
||||
<view @click="goToPage(item.path)" v-for="(item, index) in menuCard1" :key="item.title" class="menu-item">
|
||||
<image class="menu-item-icon" :src="item.icon" mode="aspectFit"></image>
|
||||
<text class="menu-item-title">{{ item.title }}</text>
|
||||
<text class="messageNum" v-if="item.title === '消息中心'">
|
||||
{{ '12' }}
|
||||
</text>
|
||||
<image class="menu-item-more" src="../../static/icons/homeInfoMore.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
@ -53,6 +51,9 @@
|
||||
<view @click="goToPage(item.path)" v-for="(item, index) in menuCard2" :key="item.title" class="menu-item">
|
||||
<image class="menu-item-icon" :src="item.icon" mode="aspectFit"></image>
|
||||
<text class="menu-item-title">{{ item.title }}</text>
|
||||
<text class="messageNum" v-if="item.title == '消息中心' && noReadNum>0">
|
||||
{{ noReadNum }}
|
||||
</text>
|
||||
<image class="menu-item-more" src="../../static/icons/homeInfoMore.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
@ -65,8 +66,8 @@
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
||||
import request from "@/utils/request";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,setUserInfo,getUserInfo} from '@/utils/auth.js'
|
||||
import config from '@/config'
|
||||
import {getToken,getUserInfo} from '@/utils/auth'
|
||||
export default {
|
||||
components: {
|
||||
tabBarVue,
|
||||
@ -79,17 +80,17 @@
|
||||
})
|
||||
}else{
|
||||
console.log("已登录")
|
||||
if(!getUserInfo()){
|
||||
this.getServer()
|
||||
}else{
|
||||
this.customInfo = JSON.parse(getUserInfo())
|
||||
}
|
||||
//直接取缓存中的用户信息
|
||||
this.customInfo = JSON.parse(getUserInfo())
|
||||
//查未读消息数量
|
||||
this.getNoReadNum()
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//用户信息
|
||||
customInfo:{},
|
||||
imgUrlPrex:config.baseImageUrl,
|
||||
menuCard1: [
|
||||
{ title: '我的资料', icon: require('@/static/icons/my-menu-icon1.png'), path: '/pages/my/myInfo' },
|
||||
{ title: '我的卡券', icon: require('@/static/icons/my-menu-icon5.png'), path: "/pages/my/cardRoll" },
|
||||
@ -97,9 +98,10 @@
|
||||
],
|
||||
menuCard2: [
|
||||
{ title: '消息中心', icon: require('@/static/icons/my-menu-icon2.png'), path: '/pages/my/message' },
|
||||
{ title: '客服中心', icon: require('@/static/icons/my-menu-icon4.png') },
|
||||
// { title: '客服中心', icon: require('@/static/icons/my-menu-icon4.png') },
|
||||
{ title: '操作指南', icon: require('@/static/icons/my-menu-icon5.png'), path: "/pages/guideList/guideList" },
|
||||
]
|
||||
],
|
||||
noReadNum:0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -113,23 +115,17 @@
|
||||
url: '/pages/my/myEquity'
|
||||
})
|
||||
},
|
||||
//获取当前登录用户信息
|
||||
async getServer() {
|
||||
request({
|
||||
url: "/userClient/customer/getUserCustomer",
|
||||
method: 'get',
|
||||
params:{}
|
||||
}).then(res=>{
|
||||
if(!res.data){
|
||||
uni.reLaunch({
|
||||
url: '/pages/my/register'
|
||||
})
|
||||
}else{
|
||||
setUserInfo(JSON.stringify(res.data))
|
||||
this.customInfo = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
async getNoReadNum(){
|
||||
await request({
|
||||
url: "/app-api/system/notify-message/get-unread-count",
|
||||
method: "GET",
|
||||
tenantIdFlag:false
|
||||
}).then((res) => {
|
||||
if(res.code==200){
|
||||
this.noReadNum = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -171,6 +167,7 @@
|
||||
.avatar {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
|
@ -2,45 +2,116 @@
|
||||
<view class="container">
|
||||
<VNavigationBarVue titleColor="#333" backgroundColor="#fff" title="我的资料"></VNavigationBarVue>
|
||||
<view class="body">
|
||||
<!-- <view class="formItem">-->
|
||||
<!-- <text class="formLabel">头像</text>-->
|
||||
<!-- <image class="avatar" src="../../static/images/avatar.png" mode="aspectFit"></image>-->
|
||||
<!-- </view>-->
|
||||
<view class="formItem">
|
||||
<text class="formLabel">姓名</text>
|
||||
<text class="formValue">{{ customInfo.cusName }}</text>
|
||||
<!-- <image class="formBtn" src="../../static/icons/homeInfoMore.png" mode="aspectFit"></image>-->
|
||||
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">姓名</text>
|
||||
<input type="text" style="text-align: right" placeholder="请输入姓名" v-model="customInfo.nickname"/>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">手机号</text>
|
||||
<text class="formValue">{{ customInfo.phoneNumber }}</text>
|
||||
<!-- <image class="formBtn" src="../../static/icons/homeInfoMore.png" mode="aspectFit"></image>-->
|
||||
<text class="formValue">{{ customInfo.mobile }}</text>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">联系地址</text>
|
||||
<text class="formValue">{{ customInfo.address }}</text>
|
||||
<!-- <image class="formBtn" src="../../static/icons/homeInfoMore.png" mode="aspectFit"></image>-->
|
||||
<text class="formLabel">头像</text>
|
||||
<view class="dl-avatar-box">
|
||||
<u-upload
|
||||
:action="uploadUrl"
|
||||
:headers="headers"
|
||||
:file-list="fileList"
|
||||
:max-count="1"
|
||||
:show-upload-btn="true"
|
||||
@after-read="afterRead"
|
||||
@delete="deleteFile"
|
||||
></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
<button type="primary" @click="submit">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBarVue from '../../components/VNavigationBar.vue';
|
||||
import config from '@/config'
|
||||
import request from "@/utils/request";
|
||||
import upload from '@/utils/upload'
|
||||
import {getUserInfo,setUserInfo} from '@/utils/auth'
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBarVue
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
customInfo:{}
|
||||
uploadUrl: config.baseUrl+"/app-api/infra/file/upload",
|
||||
headers: {},
|
||||
fileList: [],
|
||||
customInfo:{
|
||||
id:"",
|
||||
nickname:"",
|
||||
mobile:"",
|
||||
avatar:""
|
||||
}
|
||||
};
|
||||
},
|
||||
onShow(data) {
|
||||
onLoad(data) {
|
||||
//当前登录用户信息
|
||||
this.customInfo = JSON.parse(uni.getStorageSync('customerInfo'))
|
||||
this.customInfo = JSON.parse(getUserInfo())
|
||||
console.log(this.customInfo)
|
||||
if(this.customInfo && ""!=this.customInfo.avatar && null!=this.customInfo.avatar){
|
||||
this.fileList = [
|
||||
{
|
||||
url:config.baseImageUrl+this.customInfo.avatar
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
afterRead(file) {
|
||||
//上传
|
||||
// uploadFileApi 为上传到服务端的接口 count大于1 使用 await
|
||||
upload({
|
||||
url:'/app-api/infra/file/upload',
|
||||
filePath: file.file.url
|
||||
}).then((res)=>{
|
||||
this.fileList=[{
|
||||
url: config.baseImageUrl+res.data
|
||||
}]
|
||||
console.log(this.fileList)
|
||||
})
|
||||
},
|
||||
deleteFile(file, index) {
|
||||
console.log('删除文件');
|
||||
this.fileList.splice(index, 1);
|
||||
},
|
||||
async submit(){
|
||||
if(this.fileList.length>0){
|
||||
this.customInfo.avatar = this.fileList[0].url.replace(config.baseImageUrl,"")
|
||||
}
|
||||
let res = await request({
|
||||
url: '/app-api/system/user/update',
|
||||
method: 'PUT',
|
||||
data: this.customInfo,
|
||||
tenantIdFlag: false
|
||||
})
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
//更新数据
|
||||
setUserInfo(JSON.stringify(this.customInfo))
|
||||
setTimeout(()=>{
|
||||
// 操作成功返回上一个页面
|
||||
uni.navigateBack();
|
||||
},500)
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: '修改失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -48,30 +119,30 @@
|
||||
.container {
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
|
||||
|
||||
.body {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
.formItem {
|
||||
box-sizing: border-box;
|
||||
width: 686rpx;
|
||||
margin: 0 auto;
|
||||
padding: 40rpx;
|
||||
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
column-gap: 20rpx;
|
||||
|
||||
|
||||
border-bottom: 1rpx solid #DDDDDD;
|
||||
}
|
||||
|
||||
|
||||
.formLabel {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
|
||||
.formValue {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
@ -79,15 +150,14 @@
|
||||
font-size: 32rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
|
||||
.formBtn {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 108rpx;
|
||||
height: 108rpx;
|
||||
|
||||
.dl-avatar-box {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -3,9 +3,27 @@
|
||||
<VNavigationBar title="车辆详情" background-color="#fff" title-color="#333"></VNavigationBar>
|
||||
<view class="body">
|
||||
<view class="card">
|
||||
<button type="primary" @click="openCameraScan">识别行驶证</button>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">车牌号</text>
|
||||
<input type="text" style="text-align: right" placeholder="请输入文本" v-model="car.licenseNumber"/>
|
||||
<text class="formLabel require">是否车主</text>
|
||||
<view>
|
||||
<radio-group v-model="car.isOwner" @change="radioChange">
|
||||
<radio value="1" :checked="car.isOwner=='1'">是</radio>
|
||||
<radio value="0" :checked="car.isOwner=='0'">否</radio>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel require">车牌号</text>
|
||||
<input type="text" style="text-align: right" placeholder="请输入车牌号" v-model="car.licenseNumber"/>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">车架号</text>
|
||||
<input type="text" style="text-align: right" placeholder="请输入车架号" v-model="car.vin"/>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">发动机号码</text>
|
||||
<input type="text" style="text-align: right" placeholder="请输入发动机号码" v-model="car.engineNumber"/>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">品牌</text>
|
||||
@ -15,13 +33,7 @@
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">型号</text>
|
||||
<input type="text" style="text-align: right" placeholder="请输入文本" v-model="car.carModelInput"/>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">车辆类别</text>
|
||||
<picker @change="categoryChange" :value="categoryIndex" :range="categoryNamesComputed">
|
||||
<view class="uni-input">{{ categoryNamesComputed[categoryIndex] }}</view>
|
||||
</picker>
|
||||
<input type="text" style="text-align: right" placeholder="请输入型号" v-model="car.carModelInput"/>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">车辆性质</text>
|
||||
@ -29,6 +41,12 @@
|
||||
<view class="uni-input">{{ natureNamesComputed[natureIndex] }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">车辆类别</text>
|
||||
<picker @change="categoryChange" :value="categoryIndex" :range="categoryNamesComputed">
|
||||
<view class="uni-input">{{ categoryNamesComputed[categoryIndex] }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">注册日期</text>
|
||||
<picker
|
||||
@ -42,22 +60,21 @@
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<!-- <view class="formItem">-->
|
||||
<!-- <text class="formLabel">车辆图片</text>-->
|
||||
<view class="formItem">
|
||||
<text class="formLabel">行驶证</text>
|
||||
<u-upload
|
||||
:action="uploadUrl"
|
||||
:headers="headers"
|
||||
:file-list="fileList"
|
||||
:max-count="1"
|
||||
:show-upload-btn="true"
|
||||
@after-read="afterRead"
|
||||
@delete="deleteFile"
|
||||
@success="uploadSuccess"
|
||||
@fail="uploadFail"
|
||||
></u-upload>
|
||||
|
||||
<!-- <u-upload-->
|
||||
<!-- :action="uploadUrl"-->
|
||||
<!-- :headers="headers"-->
|
||||
<!-- :file-list="fileList"-->
|
||||
<!-- :max-count="3"-->
|
||||
<!-- :show-upload-btn="true"-->
|
||||
<!-- @after-read="afterRead"-->
|
||||
<!-- @delete="deleteFile"-->
|
||||
<!-- @success="uploadSuccess"-->
|
||||
<!-- @fail="uploadFail"-->
|
||||
<!-- ></u-upload>-->
|
||||
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer">
|
||||
@ -70,7 +87,7 @@
|
||||
删除
|
||||
</view>
|
||||
<view class="line" v-if="bo1"></view>
|
||||
<view class="btnItem edit" v-if="bo1" @click="update">
|
||||
<view class="btnItem edit" v-if="bo1" @click="submit">
|
||||
<uni-icons type="compose" color="#0174F6"></uni-icons>
|
||||
保存
|
||||
</view>
|
||||
@ -80,7 +97,10 @@
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue';
|
||||
import request from "../../utils/request";
|
||||
import request from "@/utils/request";
|
||||
import config from '@/config'
|
||||
import upload from '@/utils/upload'
|
||||
import {getJSONData} from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -88,36 +108,41 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
// uploadUrl: 'https://your-server.com/upload',
|
||||
// headers: {},
|
||||
// fileList: [],
|
||||
|
||||
uploadUrl: config.baseUrl+"/app-api/infra/file/upload",
|
||||
headers: {},
|
||||
fileList: [],
|
||||
car: {
|
||||
id:"",
|
||||
//是否车主
|
||||
isOwner:"1",
|
||||
// 车牌号
|
||||
licenseNumber: '',
|
||||
// 型号
|
||||
carModelInput: '',
|
||||
// 车架号
|
||||
vin: '',
|
||||
// 发动机号码
|
||||
engineNumber: '',
|
||||
// 品牌id
|
||||
carBrand:'',
|
||||
// 车辆类别 字典字段
|
||||
carCategory:'',
|
||||
// 型号
|
||||
carModelInput: '',
|
||||
// 车辆性质 字典字段
|
||||
carNature:'',
|
||||
// 车辆类别 字典字段
|
||||
carCategory:'',
|
||||
// 注册日期
|
||||
carRegisterDate:'2024-09-24',
|
||||
|
||||
|
||||
carRegisterDate:'',
|
||||
},
|
||||
bo1: false,
|
||||
bo2: true,
|
||||
categoryIndex: 0,
|
||||
natureIndex: 0,
|
||||
brandIndex: 0,
|
||||
//可选车辆类别范围
|
||||
categoryList: [],
|
||||
//可选车辆性质范围
|
||||
natureList: [],
|
||||
//可选车辆品牌范围
|
||||
brandList: []
|
||||
|
||||
};
|
||||
},
|
||||
// 计算属性,将对象数组转换为字符串数组
|
||||
@ -133,13 +158,25 @@ export default {
|
||||
return this.categoryList.map(item => item.label);
|
||||
}
|
||||
},
|
||||
|
||||
onShow(){
|
||||
this.getCameraPhoto()
|
||||
},
|
||||
onLoad(options) {
|
||||
// 如果是修改
|
||||
if (options.car) {
|
||||
if (options.id) {
|
||||
// 有数据为编辑 或 删除
|
||||
this.car = JSON.parse(decodeURIComponent(options.car));
|
||||
this.car = getJSONData("carInfo");
|
||||
console.log('初始化页面数据', this.car)
|
||||
if(this.car.carRegisterDate){
|
||||
this.car.carRegisterDate = this.timestampToDate(this.car.carRegisterDate)
|
||||
}
|
||||
this.fileList = [
|
||||
{
|
||||
url:config.baseImageUrl+this.car.carLicenseImg
|
||||
}
|
||||
]
|
||||
this.$forceUpdate()
|
||||
console.log('初始化页面数据', this.fileList)
|
||||
this.bo1 = true;
|
||||
this.bo2 = false;
|
||||
} else {
|
||||
@ -147,28 +184,91 @@ export default {
|
||||
this.bo1 = false;
|
||||
this.bo2 = true;
|
||||
}
|
||||
|
||||
// 初始化
|
||||
this.getCategoryList();
|
||||
this.getNatureList();
|
||||
this.getBrandList();
|
||||
|
||||
},
|
||||
methods: {
|
||||
// afterRead(file) {
|
||||
// console.log('文件读取完成');
|
||||
// },
|
||||
// deleteFile(file, index) {
|
||||
// console.log('删除文件');
|
||||
// this.fileList.splice(index, 1);
|
||||
// },
|
||||
// uploadSuccess(res, file) {
|
||||
// console.log('上传成功', res);
|
||||
// },
|
||||
// uploadFail(error, file) {
|
||||
// console.log('上传失败', error);
|
||||
// },
|
||||
radioChange(event){
|
||||
this.car.isOwner = event.detail.value
|
||||
},
|
||||
/**
|
||||
* 时间戳转文字
|
||||
* */
|
||||
timestampToDate(timestamp) {
|
||||
const date = new Date(timestamp); // 如果timestamp是数值,可以直接作为Date构造函数的参数
|
||||
const year = date.getFullYear();
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
/**
|
||||
* ocr识别内容自动赋值
|
||||
* */
|
||||
getCameraPhoto(){
|
||||
let pages = getCurrentPages();
|
||||
let currPage = pages[pages.length-1];
|
||||
if(typeof(currPage.data.driveLicense) != undefined && currPage.data.driveLicense != null){
|
||||
let driveLicense = currPage.data.driveLicense;
|
||||
this.fileList=[{
|
||||
url: driveLicense.imgUrl
|
||||
}]
|
||||
this.car.licenseNumber = driveLicense.plateNo
|
||||
this.car.vin = driveLicense.vin
|
||||
this.car.engineNumber = driveLicense.engineNo
|
||||
this.car.carRegisterDate = driveLicense.registerDate
|
||||
//车辆品牌自动定位
|
||||
this.brandList.forEach((item, index) => {
|
||||
if (item.brandName == driveLicense.brand) {
|
||||
this.brandIndex = index;
|
||||
this.car.carBrand = this.brandList[index].id;
|
||||
}
|
||||
})
|
||||
//车辆性质自动定位
|
||||
this.natureList.forEach((item, index) => {
|
||||
if (item.label == driveLicense.useCharacter) {
|
||||
this.natureIndex = index;
|
||||
this.car.carNature = this.natureList[index].value;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 打开摄像头
|
||||
*/
|
||||
openCameraScan(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/myCar/scan-frame'
|
||||
});
|
||||
},
|
||||
// 调用OCR服务进行文字识别
|
||||
recognizeText(imagePath) {
|
||||
|
||||
},
|
||||
afterRead(file) {
|
||||
//上传
|
||||
// uploadFileApi 为上传到服务端的接口 count大于1 使用 await
|
||||
upload({
|
||||
url:'/app-api/infra/file/upload',
|
||||
filePath: file.file.url
|
||||
}).then((res)=>{
|
||||
this.fileList.push({
|
||||
url: config.baseImageUrl+res.data
|
||||
})
|
||||
console.log(this.fileList)
|
||||
})
|
||||
},
|
||||
deleteFile(file, index) {
|
||||
console.log('删除文件');
|
||||
this.fileList.splice(index, 1);
|
||||
},
|
||||
uploadSuccess(res, file) {
|
||||
console.log('上传成功', res);
|
||||
},
|
||||
uploadFail(error, file) {
|
||||
console.log('上传失败', error);
|
||||
},
|
||||
// 品牌选择事件
|
||||
brandChange(event) {
|
||||
// 下标
|
||||
@ -191,19 +291,17 @@ export default {
|
||||
//
|
||||
this.car.carNature = this.natureList[newIndex].value;
|
||||
},
|
||||
|
||||
// 日期选择 事件
|
||||
bindDateChange1(e) {
|
||||
this.car.carRegisterDate = e.target.value; // 更新选择的日期到data中的date变量
|
||||
|
||||
},
|
||||
|
||||
// 查询下拉 车辆类别
|
||||
async getCategoryList() {
|
||||
let res = await request({
|
||||
url: '/admin-api/system/dict-data/type?type=car_category',
|
||||
url: '/app-api/system/dict-data/type?type=car_category',
|
||||
method: 'get',
|
||||
noTenantId: false
|
||||
tenantIdFlag: false
|
||||
})
|
||||
if (res.code == 200) {
|
||||
console.log('车辆类别', res.data)
|
||||
@ -225,9 +323,9 @@ export default {
|
||||
// 查询下拉 车辆性质
|
||||
async getNatureList() {
|
||||
let res = await request({
|
||||
url: '/admin-api/system/dict-data/type?type=car_nature',
|
||||
url: '/app-api/system/dict-data/type?type=car_nature',
|
||||
method: 'get',
|
||||
noTenantId: false
|
||||
tenantIdFlag: false
|
||||
})
|
||||
if (res.code == 200) {
|
||||
console.log('车辆性质', res.data)
|
||||
@ -266,45 +364,56 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
// 新增或修改
|
||||
async submit() {
|
||||
if(this.fileList.length>0){
|
||||
this.car.carLicenseImg = this.fileList[0].url.replace(config.baseImageUrl,"")
|
||||
}
|
||||
let res = await request({
|
||||
url: '/userClient/base/myCar/create',
|
||||
url: '/app-api/base/user-car/createOrUpdate',
|
||||
method: 'POST',
|
||||
data: this.car,
|
||||
tenantIdFlag: false
|
||||
})
|
||||
if (res.code == 200) {
|
||||
// 新增成功返回上一个页面
|
||||
|
||||
uni.navigateBack();
|
||||
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
// 操作成功返回上一个页面
|
||||
uni.navigateBack();
|
||||
},500)
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: '保存失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
//删除
|
||||
async del() {
|
||||
let res = await request({
|
||||
url: `/userClient/base/myCar/delete?id=${this.car.id}`,
|
||||
method: 'Delete',
|
||||
|
||||
url: `/app-api/base/user-car/delById?id=${this.car.id}`,
|
||||
method: 'delete',
|
||||
tenantIdFlag: false
|
||||
})
|
||||
if (res.code == 200) {
|
||||
// 新增成功返回上一个页面 并且上一个页面重新初始化 获取数据 怎么写
|
||||
uni.navigateBack();
|
||||
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
// 删除成功返回上一个页面
|
||||
uni.navigateBack();
|
||||
},500)
|
||||
}else {
|
||||
uni.showToast({
|
||||
title: '删除失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 修改
|
||||
async update() {
|
||||
let res = await request({
|
||||
url: `/userClient/base/myCar/update`,
|
||||
data: this.car,
|
||||
method: 'Put',
|
||||
})
|
||||
if (res.code == 200) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -345,6 +454,11 @@ export default {
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.require {
|
||||
content: "*";
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.labelVal {
|
||||
|
@ -9,9 +9,12 @@
|
||||
<view class="carInfo">
|
||||
<view class="carNum">{{ item.licenseNumber}}</view>
|
||||
<view class="name">品牌:{{ item.brandName }}</view>
|
||||
<view class="phone">型号:{{ item.carModelInput }}</view>
|
||||
<view class="phone">型号:{{ item.carModel || "" }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="no-data" v-if="carList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@ -26,8 +29,7 @@
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue';
|
||||
import request from "../../utils/request";
|
||||
import config from "config";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
||||
import {getToken,setJSONData} from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
@ -41,12 +43,12 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
carList: [
|
||||
{
|
||||
carNum: '鲁A 781NB',
|
||||
name: '魏书豪',
|
||||
phone: '15726786903',
|
||||
image: ''
|
||||
}
|
||||
// {
|
||||
// carNum: '鲁A 781NB',
|
||||
// name: '魏书豪',
|
||||
// phone: '15726786903',
|
||||
// image: ''
|
||||
// }
|
||||
]
|
||||
};
|
||||
},
|
||||
@ -60,34 +62,27 @@ export default {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}else{
|
||||
console.log("已登录")
|
||||
this.getUserInfos()
|
||||
}
|
||||
// 页面显示时执行初始化操作
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//获取当前登录用户信息
|
||||
async getUserInfos() {
|
||||
console.log("获取用户信息")
|
||||
getUserInfoRequest()
|
||||
},
|
||||
getList(){
|
||||
request({
|
||||
url: '/userClient/base/myCar/get',
|
||||
url: '/app-api/base/user-car/getMyCar',
|
||||
method: 'GET',
|
||||
tenantIdFlag: false
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
this.carList = res.data;
|
||||
console.log('图片路径', config.baseImageUrl+this.carList[0].logoImg)
|
||||
})
|
||||
},
|
||||
|
||||
gotoDetail(item) {
|
||||
if (item){
|
||||
setJSONData("carInfo",item)
|
||||
uni.navigateTo({
|
||||
url: `/pages/myCar/carDetail?car=${encodeURIComponent(JSON.stringify(item))}`
|
||||
url: `/pages/myCar/carDetail?id=`+item.id
|
||||
});
|
||||
}
|
||||
else {
|
||||
@ -120,6 +115,9 @@ export default {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.no-data{
|
||||
text-align: center;
|
||||
}
|
||||
.carItem {
|
||||
box-sizing: border-box;
|
||||
width: 686rpx;
|
||||
|
106
pages/myCar/scan-frame.vue
Normal file
106
pages/myCar/scan-frame.vue
Normal file
@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<VNavigationBar title="车辆详情" background-color="#fff" title-color="#333"></VNavigationBar>
|
||||
<view class="body">
|
||||
<camera device-position="back" flash="auto" @error="error" style="width: 100%; height: 500upx;">
|
||||
<cover-image src="@/static/images/scan-img.png" class="scan-img"></cover-image>
|
||||
</camera>
|
||||
<view class="scan-text">请将行驶证放置白色框内</view>
|
||||
<button type="primary" @click="takePhoto">识别</button>
|
||||
<view class="scan-img-box"><image mode="widthFix" class="photos-box" :src="src"></image></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue';
|
||||
import request from "@/utils/request";
|
||||
import config from '@/config'
|
||||
import upload from '@/utils/upload'
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
src: "",
|
||||
imgUrl:"",
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
takePhoto() {
|
||||
const ctx = uni.createCameraContext();
|
||||
ctx.takePhoto({
|
||||
quality: 'high',
|
||||
success: (res) => {
|
||||
this.src = res.tempImagePath
|
||||
uni.showLoading({
|
||||
title: 'OCR自动识别中...'
|
||||
});
|
||||
//上传服务器
|
||||
upload({
|
||||
url:'/app-api/infra/file/upload',
|
||||
filePath: res.tempImagePath
|
||||
}).then((res)=>{
|
||||
this.imgUrl = config.baseImageUrl+res.data
|
||||
//识别内容
|
||||
request({
|
||||
url: '/app-api/base/user-car/vehicleLicenseOCR',
|
||||
method: 'POST',
|
||||
data: this.imgUrl,
|
||||
tenantIdFlag: false
|
||||
}).then((res)=>{
|
||||
res.data['imgUrl'] = this.imgUrl
|
||||
uni.hideLoading();
|
||||
let pages = getCurrentPages();
|
||||
let prevPage = pages[pages.length - 2];
|
||||
prevPage.setData({
|
||||
"driveLicense": res.data,
|
||||
})
|
||||
uni.navigateBack();
|
||||
console.log(res)
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
error(e) {
|
||||
console.log(e.detail);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
|
||||
.container {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
background-color: #f3f5f7;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.body {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
overflow: auto;
|
||||
|
||||
.scan-img {
|
||||
opacity: 0.4;
|
||||
width: 100%;
|
||||
height: 500 upx;
|
||||
}
|
||||
|
||||
.scan-text {
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
line-height: 60 upx;
|
||||
}
|
||||
|
||||
.scan-img-box{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -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>
|
||||
@ -18,8 +21,7 @@
|
||||
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
||||
import reservationOrderVue from '../../components/reservationOrder/reservationOrder.vue'
|
||||
import request from "@/utils/request";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
||||
import {getToken} from '@/utils/auth.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -54,15 +56,10 @@
|
||||
})
|
||||
}else{
|
||||
console.log("已登录")
|
||||
this.getUserInfos()
|
||||
}
|
||||
this.getBookingPage()
|
||||
},
|
||||
methods: {
|
||||
//获取当前登录用户信息
|
||||
async getUserInfos() {
|
||||
getUserInfoRequest()
|
||||
},
|
||||
async getBookingPage(){
|
||||
const res = await request({
|
||||
url: "/userClient/repair/booking/page",
|
||||
@ -119,5 +116,8 @@
|
||||
flex-direction: column;
|
||||
row-gap: 20rpx;
|
||||
}
|
||||
.no-data{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
BIN
static/icons/bottom.png
Normal file
BIN
static/icons/bottom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 699 B |
BIN
static/icons/date.png
Normal file
BIN
static/icons/date.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
static/icons/orderIng.png
Normal file
BIN
static/icons/orderIng.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
BIN
static/images/clear.png
Normal file
BIN
static/images/clear.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
static/images/nothing.png
Normal file
BIN
static/images/nothing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
BIN
static/images/scan-img.png
Normal file
BIN
static/images/scan-img.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
@ -1,6 +1,7 @@
|
||||
const TokenKey = 'App-Token'
|
||||
const UserInfo = 'customerInfo'
|
||||
const TenantIdKey = 'TENANT_ID'
|
||||
const InviteIdKey = 'INVITE_ID'
|
||||
export function getToken() {
|
||||
return uni.getStorageSync(TokenKey)
|
||||
}
|
||||
@ -19,6 +20,15 @@ export function setTenantId(TenantId) {
|
||||
export function getTenantId(){
|
||||
return uni.getStorageSync(TenantIdKey)
|
||||
}
|
||||
export function setInviteId(InviteId) {
|
||||
return uni.setStorageSync(InviteIdKey, InviteId);
|
||||
}
|
||||
export function getInviteId(){
|
||||
return uni.getStorageSync(InviteIdKey)
|
||||
}
|
||||
export function removeInviteId(){
|
||||
return uni.removeStorageSync(InviteIdKey)
|
||||
}
|
||||
|
||||
export function hasRole(roleCode) {
|
||||
const roleList = uni.getStorageSync('role')
|
||||
@ -38,3 +48,46 @@ export function getUserInfo() {
|
||||
export function setUserInfo(userInfo) {
|
||||
return uni.setStorageSync(UserInfo, userInfo)
|
||||
}
|
||||
|
||||
export function getJSONData(keyStr) {
|
||||
if(uni.getStorageSync(keyStr)){
|
||||
return JSON.parse(uni.getStorageSync(keyStr))
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
export function setJSONData(keyStr,dataObj) {
|
||||
return uni.setStorageSync(keyStr, JSON.stringify(dataObj))
|
||||
}
|
||||
|
||||
// 设置本地存储,并设置一个过期时间(单位为秒)
|
||||
export function setStorageWithExpiry(key, value, ttl) {
|
||||
const now = new Date();
|
||||
// 计算过期时间
|
||||
const item = {
|
||||
value: value,
|
||||
expiry: now.getTime() + ttl * 1000,
|
||||
};
|
||||
// 将数据对象转换为字符串存储
|
||||
uni.setStorageSync(key, JSON.stringify(item));
|
||||
}
|
||||
|
||||
// 获取本地存储的数据,检查是否过期
|
||||
export function getStorageWithExpiry(key) {
|
||||
// 从本地存储获取数据
|
||||
const itemStr = uni.getStorageSync(key);
|
||||
if (!itemStr) {
|
||||
return null; // 未找到数据
|
||||
}
|
||||
const item = JSON.parse(itemStr);
|
||||
const now = new Date();
|
||||
// 检查项目是否过期
|
||||
if (now.getTime() > item.expiry) {
|
||||
// 如果过期,从存储中移除该项
|
||||
uni.removeStorageSync(key);
|
||||
return null;
|
||||
}
|
||||
return item.value; // 数据未过期,返回数据
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ const request = config => {
|
||||
// 设置租户
|
||||
const isTanantId = (config.headers || {}).isTanantId === false
|
||||
config.header = config.header || {}
|
||||
if(!config.hasOwnProperty("noTenantId")){
|
||||
if(!config.hasOwnProperty("tenantIdFlag")){
|
||||
//请求设置了不需要租户,不拼接,,走进这里的是没设置不需要租户的
|
||||
if(getTenantId() && !isTanantId){
|
||||
config.header['tenant-id'] = getTenantId()
|
||||
|
@ -20,6 +20,7 @@ const upload = config => {
|
||||
url = url.slice(0, -1)
|
||||
config.url = url
|
||||
}
|
||||
console.log("参数",config)
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
timeout: config.timeout || timeout,
|
||||
|
135
utils/utils.js
135
utils/utils.js
@ -1,3 +1,9 @@
|
||||
import request from '@/utils/request';
|
||||
import {
|
||||
setStorageWithExpiry,
|
||||
getStorageWithExpiry
|
||||
} from '@/utils/auth'
|
||||
|
||||
function getWXStatusHeight() {
|
||||
// #ifdef MP-WEIXIN
|
||||
// 获取距上
|
||||
@ -22,6 +28,135 @@ function getWXStatusHeight() {
|
||||
// #endif
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单的状态获取订单的文字展示状态
|
||||
* @param ticketsStatus 订单状态
|
||||
* @param workStatus 维修工作状态
|
||||
*/
|
||||
function getOrderStatusText(ticketsStatus,workStatus){
|
||||
let str = "";
|
||||
if("04"==ticketsStatus){
|
||||
//待派工
|
||||
str = "待派工"
|
||||
}else if("05"==ticketsStatus){
|
||||
//维修中
|
||||
str = "维修中"
|
||||
}else if("01"==ticketsStatus){
|
||||
//待结算
|
||||
str = "待结算"
|
||||
}else if("06"==ticketsStatus){
|
||||
//挂单/记账
|
||||
str = "挂单/记账"
|
||||
}else if("02"==ticketsStatus){
|
||||
//已结账
|
||||
str = "已结账"
|
||||
}else if("03"==ticketsStatus){
|
||||
//已作废
|
||||
str = "已作废"
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询字典可选值
|
||||
* @param dictCode
|
||||
*/
|
||||
function getDictByCode(dictCode){
|
||||
let dictArray = getStorageWithExpiry(dictCode);
|
||||
if(null==dictArray || undefined==dictArray){
|
||||
request({
|
||||
url: '/app-api/system/dict-data/type',
|
||||
method: 'get',
|
||||
tenantIdFlag:false,
|
||||
params:{type:dictCode}
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
setStorageWithExpiry(dictCode,res.data,3600)
|
||||
return res.data
|
||||
}
|
||||
})
|
||||
}else{
|
||||
return dictArray
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 翻译字典
|
||||
* @param dictCode
|
||||
*/
|
||||
async function getDictTextByCodeAndValue(dictCode,value){
|
||||
return new Promise((resolve, reject) => {
|
||||
let dictArray = getStorageWithExpiry(dictCode);
|
||||
console.log(dictCode, 'dictCode')
|
||||
console.log(value, 'value')
|
||||
if (null == dictArray || undefined == dictArray) {
|
||||
request({
|
||||
url: '/app-api/system/dict-data/type',
|
||||
method: 'get',
|
||||
tenantIdFlag: false,
|
||||
params: {type: dictCode}
|
||||
}).then((res) => {
|
||||
console.log(res, 98)
|
||||
console.log(res, 98)
|
||||
if (res.code == 200) {
|
||||
setStorageWithExpiry(dictCode, res.data, 3600)
|
||||
dictArray = res.data
|
||||
let dictObj = dictArray.find(item => item.value == value)
|
||||
console.log(dictObj, "dictObj")
|
||||
if (dictObj) {
|
||||
resolve(dictObj.label);
|
||||
// return dictObj.label
|
||||
} else {
|
||||
resolve("未知数据")
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let dictObj = dictArray.find(item => item.value == value)
|
||||
console.log(dictObj, "dictObj")
|
||||
if (dictObj) {
|
||||
resolve(dictObj.label);
|
||||
} else {
|
||||
resolve("未知数据")
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function formatTimestamp(timestamp) {
|
||||
// 将时间戳转换为Date对象
|
||||
const date = new Date(timestamp);
|
||||
// 获取年月日时分秒
|
||||
const year = date.getFullYear();
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const hours = date.getHours().toString().padStart(2, '0');
|
||||
const minutes = date.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = date.getSeconds().toString().padStart(2, '0');
|
||||
// 组合成日期时间字符串
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
|
||||
function formatDate(timestamp) {
|
||||
// 将时间戳转换为Date对象
|
||||
const date = new Date(timestamp);
|
||||
// 获取年月日时分秒
|
||||
const year = date.getFullYear();
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
// 组合成日期时间字符串
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export {
|
||||
getWXStatusHeight,
|
||||
getOrderStatusText,
|
||||
getDictByCode,
|
||||
getDictTextByCodeAndValue,
|
||||
formatTimestamp,
|
||||
formatDate,
|
||||
}
|
Loading…
Reference in New Issue
Block a user