Commit 0d4e104b by honghong

支付时间倒计时,修改bug

parent dcb62df5
...@@ -86,11 +86,11 @@ ...@@ -86,11 +86,11 @@
return item.url; return item.url;
}); });
console.log(photoList, '第三') console.log(photoList, '第三')
// uni.previewImage({ uni.previewImage({
// current: inx, current: inx,
// urls: photoList, urls: photoList,
// loop: true loop: true
// }) })
} }
} }
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
<u-datetime-picker ref="datePicker" :formatter="formatter" v-model="formInfo.repairTime" <u-datetime-picker ref="datePicker" :formatter="formatter" v-model="formInfo.repairTime"
:show="showTime" mode="date" @confirm="handleConfirmDate" @cancel="handleClose"> :show="showTime" mode="date" @confirm="handleConfirmDate" @cancel="handleClose">
</u-datetime-picker> </u-datetime-picker>
<input type="text" v-model="formInfo.repairTime" placeholder="请选择时间"> <view class="time-text">{{formInfo.repairTime ? formInfo.repairTime : '请选择时间'}}</view>
<!-- <input type="text" v-model="formInfo.repairTime" placeholder="请选择时间"> -->
<u-icon name="arrow-down-fill" color="#000000" size="28"></u-icon> <u-icon name="arrow-down-fill" color="#000000" size="28"></u-icon>
</view> </view>
</u--input> </u--input>
...@@ -65,20 +66,20 @@ ...@@ -65,20 +66,20 @@
<view class="form-item-name">上传视频</view> <view class="form-item-name">上传视频</view>
</view> </view>
<view> <view>
<view class="video-box" style="" v-if="formInfo.videoList.length"> <view class="video-box" style="" v-if="formInfo.videoList.length">
<video id="myVideo" :src="formInfo.videoList[0].url" <video id="myVideo" :src="formInfo.videoList[0].url" @error="videoErrorCallback"
@error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls :danmu-list="danmuList" enable-danmu controls
:show-fullscreen-btn='false'></video> :show-fullscreen-btn='false'></video>
<view class="position-icon" @click="delVideoList"> <view class="position-icon" @click="delVideoList">
<u-icon name="close-circle-fill" color="#D9001B" size="32"></u-icon> <u-icon name="close-circle-fill" color="#D9001B" size="32"></u-icon>
</view> </view>
</view> </view>
<comUpload v-else :afterWidth="350" @getVal="getVideoList" <comUpload v-else :afterWidth="350" @getVal="getVideoList" ref="videoRef"
ref="videoRef" :acceptType="acceptType" :maxCount="1" :multiple="isMultiple"> :acceptType="acceptType" :maxCount="1" :multiple="isMultiple">
</comUpload> </comUpload>
</view> </view>
...@@ -137,7 +138,12 @@ ...@@ -137,7 +138,12 @@
statusBtn: Number, statusBtn: Number,
detailData: Object detailData: Object
}, },
data() { data() {
const mobile = (rule, value, callback) => {
return /^1[3-9]\d{9}$/.test(value) ? callback() : callback(new Error('请输入正确的手机号码'))
}
return { return {
showTime: false, //时间选择器是否显示 showTime: false, //时间选择器是否显示
acceptType: 'video', acceptType: 'video',
...@@ -156,19 +162,36 @@ ...@@ -156,19 +162,36 @@
linkman: { linkman: {
type: 'string', type: 'string',
required: true, required: true,
message: '请填写备注说明', message: '请填写联系人',
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}, },
phone: [{
type: 'string',
required: true,
message: '请输入正确的联系人手机号码',
max: 11,
min: 11,
trigger: 'blur'
},
{
// 自定义验证函数,见上说明
validator: mobile,
message: '手机号码不正确',
// 触发器可以同时用blur和change
trigger: ['change', 'blur'],
}
],
repairAddress: { repairAddress: {
type: 'string', type: 'string',
required: true, required: true,
message: '请填写备注说明', message: '请填写维修地址',
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}, },
budget: { budget: {
type: 'string', type: 'number',
required: true, required: true,
message: '请填写备注说明', message: '请填写预算金额',
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}, },
}, },
...@@ -176,6 +199,11 @@ ...@@ -176,6 +199,11 @@
}; };
}, },
//如果是自己封装的组件就是mounted()
//如果不是组件就是onReady()
mounted() {
this.$refs.form.setRules(this.rules);
},
watch: { watch: {
detailData: { detailData: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
...@@ -216,6 +244,7 @@ ...@@ -216,6 +244,7 @@
url: data.url, url: data.url,
fileType: 'picture' fileType: 'picture'
}) })
// that.formInfo.pictureList = photoList
}, },
//删除照片 //删除照片
delPhotoItem(index) { delPhotoItem(index) {
...@@ -224,7 +253,6 @@ ...@@ -224,7 +253,6 @@
// 获取上传视频的值 // 获取上传视频的值
getVideoList(data) { getVideoList(data) {
let that = this let that = this
console.log(data, '有的哈桑')
let videoList = [] let videoList = []
videoList.push({ videoList.push({
url: data.url, url: data.url,
...@@ -232,27 +260,36 @@ ...@@ -232,27 +260,36 @@
}) })
that.formInfo.videoList = videoList that.formInfo.videoList = videoList
}, },
delVideoList(){ delVideoList() {
console.log('删除',this.formInfo.videoList)
this.formInfo.videoList.splice(0, 1) this.formInfo.videoList.splice(0, 1)
console.log('删除后',this.formInfo.videoList)
}, },
// 上传音频事件 // 上传音频事件
getVoiceList(data) { getVoiceList(data) {
let that = this let that = this
that.showPopup = false that.showPopup = false
console.log(data, '有的哈桑')
let voiceList = [] let voiceList = []
voiceList.push({ voiceList.push({
url: data.url, url: data.url,
fileType: 'video' fileType: 'voice'
}) })
that.formInfo.voiceList = voiceList that.formInfo.voiceList = voiceList
}, },
//确认修改和重新发布按钮 //确认修改和重新发布按钮
handleUpdateForm() { handleUpdateForm() {
this.$emit('submit', this.formInfo) let that = this
that.$refs.form.validate().then(res => {
if (res) {
if (that.formInfo.pictureList.length || that.formInfo.videoList.length || that.formInfo
.voiceList.length) {
that.$emit('submit', that.formInfo)
} else {
uni.$u.toast('图片、视频、音频选其一必填')
}
}
}).catch(errors => {
uni.$u.toast('校验失败')
})
}, },
async handleAdd() { async handleAdd() {
let that = this let that = this
...@@ -374,20 +411,23 @@ ...@@ -374,20 +411,23 @@
.video-box { .video-box {
width: 373rpx; width: 373rpx;
height: 210rpx; height: 210rpx;
position:relative; position: relative;
video{ video {
width:100%; width: 100%;
height:100% height: 100%
} }
} }
.position-icon { .position-icon {
position: absolute; position: absolute;
top:-10rpx; top: -10rpx;
right:-10rpx; right: -10rpx;
}
.time-text{
color:#666666;
font-size:24rpx;
} }
@import url("@/css/form.css"); @import url("@/css/form.css");
......
...@@ -84,8 +84,6 @@ ...@@ -84,8 +84,6 @@
async afterRead(event) { async afterRead(event) {
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file) let lists = [].concat(event.file)
console.log(lists,'点九三')
let fileListLen = this[`fileList${event.name}`].length let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => { lists.map((item) => {
this[`fileList${event.name}`].push({ this[`fileList${event.name}`].push({
...@@ -115,11 +113,9 @@ ...@@ -115,11 +113,9 @@
'Authorization': `Bearer ${uni.getStorageSync('token')}` 'Authorization': `Bearer ${uni.getStorageSync('token')}`
}, },
success: (res) => { success: (res) => {
console.log(res.data, '单价')
const { const {
data data
} = JSON.parse(res.data); } = JSON.parse(res.data);
console.log(data, '大街上可能')
this.$emit('getVal', data); this.$emit('getVal', data);
setTimeout(() => { setTimeout(() => {
......
...@@ -24,34 +24,40 @@ ...@@ -24,34 +24,40 @@
<view class="">预算金额</view> <view class="">预算金额</view>
<view class="">{{detailData.budget}}</view> <view class="">{{detailData.budget}}</view>
</view> </view>
<view class="content-photograph" v-if="detailData && detailData.pictureList && detailData.pictureList.length"> <view class="content-photograph" >
<view class="">上传图片 <view class="">上传图片
</view> </view>
<view class="content-photograph-photo"> <view>
<image class="content-photograph-photo-img" :src="v.url" mode="" v-for="(v ,index) in detailData.pictureList" <view class="content-photograph-photo" v-if="detailData && detailData.pictureList && detailData.pictureList.length">
:key="index"></image> <image class="content-photograph-photo-img" :src="v.url" mode=""
v-for="(v ,index) in detailData.pictureList" :key="index"></image>
</view>
<view class="noData-text" v-else>暂无数据</view>
</view> </view>
</view> </view>
<view class="content-frequency" v-if="detailData && detailData.videoList && detailData.videoList.length"> <view class="content-frequency" >
<view class=""> <view class="">
上传视频 上传视频
</view> </view>
<view v-for="(v ,index) in detailData.videoList" :key="index"> <view v-if="detailData && detailData.videoList && detailData.videoList.length">
<video id="myVideo" <view v-for="(v ,index) in detailData.videoList" :key="index">
:src="v.url" <video class="video-box" id="myVideo" :src="v.url" @error="videoErrorCallback" :danmu-list="danmuList" enable-danmu
@error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls controls :show-fullscreen-btn='false'></video>
:show-fullscreen-btn='false'></video> </view>
</view>
<view class="noData-text" v-else>暂无数据</view>
</view> </view>
</view> <view class="content-voice" >
<view class="content-voice" v-if="detailData && detailData.voiceList && detailData.voiceList.length">
<view class=""> <view class="">
语音描述 语音描述
</view> </view>
<!-- class="content-voice-audio" --> <!-- class="content-voice-audio" -->
<view class="margin-y-two"> <view class="margin-y-two" v-if="detailData && detailData.voiceList && detailData.voiceList.length">
<free-audio <free-audio audioId='audio1' :url='detailData.voiceList[0].url' :isDel="false"></free-audio>
audioId='audio1' :url='detailData.voiceList[0].url' :isDel="false"></free-audio>
</view> </view>
<view class="noData-text" v-else>暂无数据</view>
</view> </view>
<view class="content-remarks"> <view class="content-remarks">
<view class=""> <view class="">
...@@ -63,7 +69,8 @@ ...@@ -63,7 +69,8 @@
<view class="font-bold"> <view class="font-bold">
<text></text>订单已驳回 <text></text>订单已驳回
</view> </view>
<view class="paddding-x-two">驳回理由:{{detailData && detailData.reasonsForRejection ? detailData.reasonsForRejection : '暂无'}}</view> <view class="paddding-x-two">
驳回理由:{{detailData && detailData.reasonsForRejection ? detailData.reasonsForRejection : '暂无'}}</view>
<!-- <u--textarea v-model="detailData.value1" placeholder="请输入内容" disabled></u--textarea> --> <!-- <u--textarea v-model="detailData.value1" placeholder="请输入内容" disabled></u--textarea> -->
</view> </view>
<view class="content-reject" v-if="subscript == 3 && detailData.status== 5"> <view class="content-reject" v-if="subscript == 3 && detailData.status== 5">
...@@ -175,15 +182,11 @@ ...@@ -175,15 +182,11 @@
&-frequency { &-frequency {
padding: 30rpx 0rpx; padding: 30rpx 0rpx;
>view { .video-box {
display: flex;
>video {
margin-top: 20rpx; margin-top: 20rpx;
width: 373rpx; width: 373rpx;
height: 210rpx; height: 210rpx;
} }
}
} }
&-voice { &-voice {
......
...@@ -16,24 +16,23 @@ ...@@ -16,24 +16,23 @@
{{orderDetail && orderDetail.actualAmount ? orderDetail.actualAmount : ''}} {{orderDetail && orderDetail.actualAmount ? orderDetail.actualAmount : ''}}
</view> </view>
</view> </view>
<view class="content-photograph" > <view class="content-photograph">
<view class=""> <view class="">
图片说明 图片说明
</view> </view>
<view class="content-photograph-photo"> <view class="content-photograph-photo" v-if="orderDetail && orderDetail.pictureList.length">
<image class="content-photograph-photo-graph" :src="v.url" mode="" <image class="content-photograph-photo-graph" :src="v.url" mode=""
v-for="(v ,index) in orderDetail.fileVos" :key="v.id" v-if="v.fileType == 'picture'"></image> v-for="(v ,index) in orderDetail.pictureList" :key="v.id"></image>
</view> </view>
<view class="noData-text">暂无数据</view> <view v-else class="noData-text">暂无数据</view>
</view> </view>
<view class="content-frequency"> <view class="content-frequency">
<view class=""> <view class="">
视频说明 视频说明
</view> </view>
<view v-if="orderDetail && orderDetail.fileVos.length && v.fileType == 'video'" v-for="(v ,index) in orderDetail.fileVos" :key="v.id" > <view v-if="orderDetail && orderDetail.videoList.length" v-for="(v ,index) in orderDetail.videoList"
<video v-if="v.fileType == 'video'" id="myVideo" :key="v.id">
:src="v.url" <video :src="v.url" @error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls
@error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls
:show-fullscreen-btn='false'></video> :show-fullscreen-btn='false'></video>
</view> </view>
<view class="noData-text">暂无数据</view> <view class="noData-text">暂无数据</view>
...@@ -42,11 +41,11 @@ ...@@ -42,11 +41,11 @@
<view class=""> <view class="">
语音说明 语音说明
</view> </view>
<view class="margin-top-two"> <view class="margin-top-two" v-if="orderDetail && orderDetail.voiceList.length">
<free-audio startPic='../../static/stopStatus.png' endPic='../../static/startStatus.png' audioId='audio1' <free-audio startPic='../../static/stopStatus.png' endPic='../../static/startStatus.png'
:url='path' :isDel="false"></free-audio> audioId='audio1' :url='orderDetail.voiceList[0].url' :isDel="false"></free-audio>
<view class="noData-text">暂无数据</view>
</view> </view>
<view v-else class="noData-text">暂无数据</view>
<!-- <view class="content-voice-audio" @click="doPlay()"></view> --> <!-- <view class="content-voice-audio" @click="doPlay()"></view> -->
</view> </view>
<view class="content-remarks"> <view class="content-remarks">
...@@ -67,7 +66,7 @@ ...@@ -67,7 +66,7 @@
import apiBaseConfig from '@/config/index.js'; import apiBaseConfig from '@/config/index.js';
import freeAudio from '../../components/chengpeng-audio/free-audio.vue' import freeAudio from '../../components/chengpeng-audio/free-audio.vue'
export default { export default {
components:{ components: {
freeAudio freeAudio
}, },
data() { data() {
...@@ -75,12 +74,12 @@ ...@@ -75,12 +74,12 @@
imgBgUrl: apiBaseConfig.imgBgUrl, imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData, globalData: getApp().globalData,
scrollTopHeader: 0, scrollTopHeader: 0,
orderDetail:{}, orderDetail: {},
path:'https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3' path: 'https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3'
}; };
}, },
onLoad(option) { onLoad(option) {
console.log(option.id,'结束') console.log(option.id, '结束')
this.getDetailData(option.id) this.getDetailData(option.id)
this.timer = null; this.timer = null;
this.innerAudioContext = uni.createInnerAudioContext(); this.innerAudioContext = uni.createInnerAudioContext();
...@@ -103,11 +102,16 @@ ...@@ -103,11 +102,16 @@
}) })
}, },
methods: { methods: {
async getDetailData(id){ async getDetailData(id) {
let that = this let that = this
const data_back = await orderDetailMsgNew({id:id}) const data_back = await orderDetailMsgNew({
console.log(data_back,'返沪') id: id
const {code,data} = data_back })
console.log(data_back, '返沪')
const {
code,
data
} = data_back
that.orderDetail = data that.orderDetail = data
// orderDetailMsgNew({id:id}).then(res=>{ // orderDetailMsgNew({id:id}).then(res=>{
// console.log(res.data,'详情') // console.log(res.data,'详情')
......
...@@ -30,12 +30,16 @@ import commentList from '@/components/comment/comment.vue' ...@@ -30,12 +30,16 @@ import commentList from '@/components/comment/comment.vue'
Vue.component('comment-list', commentList) Vue.component('comment-list', commentList)
// 时间过滤器 // 时间过滤器
Vue.filter('formatDate', date => { Vue.filter("formatDate", (date) => {
let newDate = new Date(date); let d = new Date(date);
let year = newDate.getFullYear(); let month = (d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1);
let month = newDate.getMonth().toString().padStart(2, 0); let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate();
let day = newDate.getDay().toString().padStart(2, 0); let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours();
return year + '-' + month + '-' + day; let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes();
let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds();
let times;
times = d.getFullYear() + '-' + month + '-' + day;
return times
}) })
uni.$u.setConfig({ uni.$u.setConfig({
config: { config: {
......
<template> <template>
<view class="index"> <view class="index">
<com-navbar :title="title" :titleStyle="{ color: '#000000', fontSize: '32rpx' }" /> <com-navbar :title="title" :titleStyle="{ color: '#000000', fontSize: '32rpx' }" />
<view class="index-content"> <view class="index-content" v-if="useCouponList.length && couponLoseList.length">
<view class="index-content-item" v-for="(item,index) in useCouponList"> <view class="index-content-item" v-for="(item,index) in useCouponList">
<view class="index-content-item-nav baiyin-flex baiyin-flex-c-b"> <view class="index-content-item-nav baiyin-flex baiyin-flex-c-b">
<text></text> <text></text>
...@@ -65,6 +65,12 @@ ...@@ -65,6 +65,12 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<view v-else class="diagram">
<image src="@/static/icon/qst.png" mode=""></image>
<view class="">
暂无优惠券
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -394,6 +400,22 @@ ...@@ -394,6 +400,22 @@
} }
} }
} }
}
.diagram {
text-align: center;
margin-top: 335rpx;
>image {
width: 396rpx;
height: 243rpx;
}
>view {
margin-top: 20rpx;
font-size: 24rpx;
font-weight: 400;
color: #444444;
}
} }
} }
</style> </style>
...@@ -2,10 +2,8 @@ ...@@ -2,10 +2,8 @@
<view> <view>
<view style="padding-bottom: 100rpx;"> <view style="padding-bottom: 100rpx;">
<view class="padding-x-four d-flex flex-wrap j-sb flex-content"> <view class="padding-x-four d-flex flex-wrap j-sb flex-content">
<view v-for="item in 5"> <view v-for="(item,index) in articleData.fileVos" @click="handlePreview(item,index)">
<image class="evaluateListImgItem" <image class="evaluateListImgItem" :src="item.url" mode="scaleToFill"></image>
src="https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
mode="scaleToFill"></image>
</view> </view>
</view> </view>
<view class="paddding-x-two"> <view class="paddding-x-two">
...@@ -13,10 +11,9 @@ ...@@ -13,10 +11,9 @@
<view class="evaluate-title">{{articleData.title}}</view> <view class="evaluate-title">{{articleData.title}}</view>
<view class="d-flex a-center j-sb margin-top-two"> <view class="d-flex a-center j-sb margin-top-two">
<view class="d-flex a-center"> <view class="d-flex a-center">
<image class="img" <image class="img" src="../../static/logoLogin.png" mode="widthFix"></image>
src="https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500" <view class="evaluate-name">{{articleData.createUser ? articleData.createUser : '官方发布'}}
mode="widthFix"></image> </view>
<view class="evaluate-name">{{articleData.createUser ? articleData.createUser : '官方'}}</view>
</view> </view>
<view class="eval-time">发布于{{ articleData.createTime | formatDate}}</view> <view class="eval-time">发布于{{ articleData.createTime | formatDate}}</view>
...@@ -24,7 +21,7 @@ ...@@ -24,7 +21,7 @@
<view class="evaluateText text-indent" v-html="articleData.content"></view> <view class="evaluateText text-indent" v-html="articleData.content"></view>
</view> </view>
</view> </view>
<view class="bgWhite"> <view class="bgWhite" v-if="userEvalList.length">
<view class="padding-aval"> <view class="padding-aval">
<comment-list :personEvalList="userEvalList"></comment-list> <comment-list :personEvalList="userEvalList"></comment-list>
</view> </view>
...@@ -41,21 +38,25 @@ ...@@ -41,21 +38,25 @@
</template> </template>
<script> <script>
import {articleDetail,userEvaluateGet,addUserEvaluate} from '../../api/order/index.js' import {
articleDetail,
userEvaluateGet,
addUserEvaluate
} from '../../api/order/index.js'
export default { export default {
data() { data() {
return { return {
articleData:{}, articleData: {},
userQuery:{ userQuery: {
pageNum:1, pageNum: 1,
pageSize:10, pageSize: 10,
articleId:null articleId: null
}, },
userEvalList:[], userEvalList: [],
evalQuery:{ evalQuery: {
content:'',//评论的内容 content: '', //评论的内容
articleId:'',//文章id articleId: '', //文章id
deleteStatus:0 deleteStatus: 0
} }
} }
}, },
...@@ -64,55 +65,69 @@ ...@@ -64,55 +65,69 @@
this.getUserEvalList(option.id) this.getUserEvalList(option.id)
}, },
methods: { methods: {
getDetail(id){ getDetail(id) {
let that = this let that = this
articleDetail(id).then(res=>{ articleDetail(id).then(res => {
if(res.code == 200){ if (res.code == 200) {
that.articleData = res.data that.articleData = res.data
} }
}) })
}, },
getUserEvalList(id){ getUserEvalList(id) {
let that = this let that = this
that.userQuery.articleId = id that.userQuery.articleId = id
userEvaluateGet(that.userQuery).then(res=>{ userEvaluateGet(that.userQuery).then(res => {
if(res.code == 200){ if (res.code == 200) {
if(res.total > 0){ if (res.total > 0) {
this.userEvalList = res.rows this.userEvalList = res.rows
} }
} }
}) })
}, },
async handleSend(){ async handleSend() {
let that = this let that = this
if(that.evalQuery.content){ if (that.evalQuery.content) {
that.$set(that.evalQuery,'content',that.evalQuery.content.trim()) that.$set(that.evalQuery, 'content', that.evalQuery.content.trim())
that.$set(that.evalQuery,'articleId',that.articleData.id) that.$set(that.evalQuery, 'articleId', that.articleData.id)
const data_back = await addUserEvaluate(that.evalQuery) const data_back = await addUserEvaluate(that.evalQuery)
const {code} = data_back const {
if(code === 200){ code
} = data_back
if (code === 200) {
that.evalQuery.content = '' that.evalQuery.content = ''
uni.showToast({ uni.showToast({
title:'评论成功!', title: '评论成功!',
icon:'none', icon: 'none',
duration:2000, duration: 2000,
success() { success() {
let clearTime = setTimeout(() => { let clearTime = setTimeout(() => {
clearTimeout(clearTime) clearTimeout(clearTime)
that.$uniGo.navigateBack({ that.$uniGo.navigateBack({
delta:1 delta: 1
}) })
}, 1000) }, 1000)
} }
}) })
} }
}else{ } else {
return uni.showToast({ return uni.showToast({
title:'不可发布空白内容', title: '不可发布空白内容',
icon:'none' icon: 'none'
}) })
} }
},
//图片预览
handlePreview(item, index) {
let that = this
var photoList = that.articleData.fileVos.map(item => { // item 获取到的图片地址
return item.url;
});
uni.previewImage({
current: index,
urls: photoList,
loop: true
})
} }
} }
} }
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
已沟通审核通过,待支付<text>{{item.actualAmount ? item.actualAmount : 0}}</text> 已沟通审核通过,待支付<text>{{item.actualAmount ? item.actualAmount : 0}}</text>
</view> </view>
<view class=""> <view class="">
截止1小时内支付完成<text>{{isEndTime}}</text> 截止1小时内支付完成<text v-if="isEndTime">{{isEndTime}}</text>
</view> </view>
</view> </view>
<view class="" @click.stop="payment(item)"> <view class="" @click.stop="payment(item)">
...@@ -47,8 +47,9 @@ ...@@ -47,8 +47,9 @@
</view> </view>
<!-- // 已接单 --> <!-- // 已接单 -->
<view class="buttoncolor" v-if="subscript == '3'"> <view class="buttoncolor" v-if="subscript == '3'">
<button v-if="item.status == 3" style="background: red;" class="buttoncl" @click.stop="abolish(2,item)">退款</button> <button v-if="item.status == 3" style="background: red;" class="buttoncl"
<button v-else-if="item.status == 6" class="buttonclde buttonGray" @click.stop="abolish(2,item)">退款</button>
<button v-else-if="item.status == 6" class="buttonclde buttonGray"
@click.stop="abolish(4,item)">已退款</button> @click.stop="abolish(4,item)">已退款</button>
<button class="buttoncl" @click.stop="abolish(3,item)">详情</button> <button class="buttoncl" @click.stop="abolish(3,item)">详情</button>
</view> </view>
...@@ -78,36 +79,60 @@ ...@@ -78,36 +79,60 @@
data() { data() {
return { return {
timer: "", //定时器 timer: "", //定时器
isEndTime: "01:00:00", //倒计时要有个初始值 isEndTime: "", //倒计时要有个初始值
imgBgUrl: apiBaseConfig.imgBgUrl, imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData, globalData: getApp().globalData,
show: false, show: false,
title: '确认取消订单吗', title: '确认取消订单吗',
titbut: '取消订单', titbut: '取消订单',
currentId: '', //当前的id currentId: '', //当前的id
actualAmount: 0, //实付金饿 actualAmount: 0, //实付金额
countdownh: '',
countdownm: '',
countdowns: '',
timer: null, //重复执行
} }
}, },
mounted() { mounted() {
this.timer = setInterval(() => { if(this.subscript == 2){
this.countDown() this.list.map(item=>{
}, 1000) this.timer = setInterval(() => {
this.showtime(item.modifyTime)
}, 1000)
})
}
}, },
methods: { methods: {
// 1小时倒计时 showtime(modifyTime) {
countDown() { //获取当前时间
let allTime = 0; var curTime = new Date();
let h = this.isEndTime.substring(0, 2); var curTimeDate = curTime.getTime(); //当前时间戳
let m = this.isEndTime.substring(3, 5); // 发起支付的时间
let s = this.isEndTime.substring(6, 8); var startTime = new Date(modifyTime);
allTime = Number(h) * 60 * 60 + Number(m) * 60 + Number(s); // 发起支付的时间+1小时
if (allTime <= 0) return clearInterval(this.timer); //执行倒计时结束逻辑 var addHour = startTime.setHours(startTime.getHours() + 1)
allTime--; console.log(addHour,'大伤脑筋')
h = parseInt(allTime / 3600) < 10 ? '0' + String(parseInt(allTime / 3600)) : parseInt(allTime / 3600); console.log(new Date(addHour),'大伤脑筋111')
m = parseInt(allTime / 60) < 10 ? '0' + String(parseInt(allTime / 60)) : parseInt(allTime / 60); var lefttime = addHour - curTimeDate,
s = allTime % 60 < 10 ? '0' + String(allTime % 60) : allTime % 60; leftd = Math.floor(lefttime / (1000 * 60 * 60 * 24)), //计算天数
this.isEndTime = h + ":" + m + ":" + s; lefth = Math.floor((lefttime / (1000 * 60 * 60) % 24) + leftd * 24) < 10 ? "0" + Math.floor((lefttime /
(1000 * 60 * 60) % 24) + leftd * 24) : Math.floor((lefttime / (1000 * 60 * 60) % 24) + leftd *
24), //计算小时数
leftm = Math.floor(lefttime / (1000 * 60) % 60) < 10 ? "0" + Math.floor(lefttime / (1000 * 60) % 60) :
Math.floor(lefttime / (1000 * 60) % 60), //计算分钟数
lefts = Math.floor(lefttime / 1000 % 60) < 10 ? "0" + Math.floor(lefttime / 1000 % 60) : Math.floor(
lefttime / 1000 % 60); //计算秒数
this.countdownh = lefth //返回倒计时的字符串
this.countdownm = leftm //返回倒计时的字符串
this.countdowns = lefts //返回倒计时的字符串
// 倒计时结束时,显示00:00:00
if (lefttime < 0) {
this.countdownh = this.countdownm = this.countdowns = "00"
}
this.isEndTime = this.countdownh + '时' + this.countdownm + '分' + this.countdowns + '秒'
}, },
// 跳转详情页 // 跳转详情页
jump(data) { jump(data) {
...@@ -276,7 +301,8 @@ ...@@ -276,7 +301,8 @@
color: #FD0100; color: #FD0100;
line-height: 44rpx; line-height: 44rpx;
} }
.buttonGray{
.buttonGray {
border: 1rpx solid #666666 !important; border: 1rpx solid #666666 !important;
color: #666666 !important; color: #666666 !important;
} }
......
...@@ -107,15 +107,26 @@ ...@@ -107,15 +107,26 @@
onReachBottom() { onReachBottom() {
let that = this let that = this
if(that.total < that.queryParams.pageNum * that.queryParams.pageSize) return that.nomore = 'nomore' if(that.total < that.queryParams.pageNum * that.queryParams.pageSize) return that.nomore = 'nomore'
that.queryParams.pageNum++
that.getSquare()
}, },
methods: { methods: {
getSquare(){ getSquare(){
let that = this
userNeedSquare(this.queryParams).then(res=>{ userNeedSquare(this.queryParams).then(res=>{
console.log(res,'需求广场') console.log(res,'需求广场')
if(res.code == 200){ if(res.code == 200){
if(res.total > 0){ if(res.total > 0){
this.userNeedList = res.rows that.total = res.total
this.total = res.total if(that.total <= that.queryParams.pageNum){
that.loadStatus = 'nomore'
}
if(that.queryParams.pageNum == 1){
that.userNeedList = res.rows
}else{
that.userNeedList = [...that.userNeedList,...res.rows]
}
} }
} }
}) })
......
<template> <template>
<view class="content"> <view class="content">
<image class="content-bg" src="@/static/icon/my01.png" mode=""></image> <image class="content-bg" src="@/static/icon/my01.png" mode=""></image>
<view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 158rpx)` }"></view> <view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 158rpx)` }"></view>
<view class="content-in"> <view class="content-in">
<view class="content-in-info baiyin-flex baiyin-flex-c-b"> <view class="content-in-info baiyin-flex baiyin-flex-c-b">
<button class="content-in-info-l" type="balanced" open-type="chooseAvatar" @chooseavatar="onChooseavatar"> <button class="content-in-info-l" type="balanced" open-type="chooseAvatar"
<image v-if="!headImgUrl" src="@/static/icon/my03.png" mode=""></image> @chooseavatar="onChooseavatar">
<image v-else :src="headImgUrl" mode=""></image> <image v-if="!headImgUrl" src="@/static/icon/my03.png" mode=""></image>
</button> <image v-else :src="headImgUrl" mode=""></image>
<view v-if="token" class="content-in-info-r"> </button>
<view class="content-in-info-r-t baiyin-flex"> <view v-if="token" class="content-in-info-r flex-1">
<text v-if="nameDisabled">{{nickname}}</text> <view class="content-in-info-r-t baiyin-flex">
<input v-else confirm-type="确定" @confirm="inputNameConfirm" maxlength="15" type="text" :value="nickname" /> <text class="flex-1" v-if="nameDisabled">{{nickname}}</text>
<image src="@/static/icon/my02.png" mode="" @click="nameDisabled = !nameDisabled"></image> <input v-else confirm-type="确定" @confirm="inputNameConfirm" maxlength="15" type="text"
</view> :value="nickname" />
<view class="content-in-info-r-b" v-if="mobile">手机号:{{mobile}}</view> <image src="@/static/icon/my02.png" mode="" @click="nameDisabled = !nameDisabled"></image>
</view>
<view class="content-in-info-r-b" v-else> </view>
未登录 <view class="content-in-info-r-b" v-if="mobile">手机号:{{mobile}}</view>
</view> </view>
</view> <view class="content-in-info-r-b" v-else>
<view class="content-in-item baiyin-flex baiyin-flex-c-sb baiyin-flex-c-b" v-for="(item, index) in list" :key="index" @click="index != 0 ? clickJumpNPage(item) : null"> 未登录
<!-- 联系客服生成 --> </view>
<button class="content-in-item-btn" v-if="index === 0" open-type="contact"></button> </view>
<view class="baiyin-flex baiyin-flex-c-b"> <view class="content-in-item baiyin-flex baiyin-flex-c-sb baiyin-flex-c-b" v-for="(item, index) in list"
<image :src="item.icon" mode=""></image> :key="index" @click="index != 0 ? clickJumpNPage(item) : null">
<text>{{ item.title }}</text> <!-- 联系客服生成 -->
</view> <button class="content-in-item-btn" v-if="index === 0" open-type="contact"></button>
<image src="@/static/icon/my09.png" mode=""></image> <view class="baiyin-flex baiyin-flex-c-b">
</view> <image :src="item.icon" mode=""></image>
<view class="content-in-btn" @click="handleLogin"> <text>{{ item.title }}</text>
<u-button </view>
:text="token ? '退出登录' : '登录'" <image src="@/static/icon/my09.png" mode=""></image>
color="#EA654E" </view>
:customStyle="{ <view class="content-in-btn" @click="handleLogin">
width: '560rpx', <u-button :text="token ? '退出登录' : '登录'" color="#EA654E" :customStyle="{
height: '80rpx', width: '560rpx',
borderRadius: '10rpx', height: '80rpx',
padding: '0rpx', borderRadius: '10rpx',
margin: '178rpx 0rpx 0rpx 65rpx' padding: '0rpx',
}" margin: '178rpx 0rpx 0rpx 65rpx'
></u-button> }"></u-button>
</view> </view>
</view> </view>
<com-navbar :leftIcon="false" bgColor="transparent" title="我的" :titleStyle="{ color: '#ffffff', fontSize: '34rpx' }" /> <com-navbar :leftIcon="false" bgColor="transparent" title="我的"
<com-tabbar :titleStyle="{ color: '#ffffff', fontSize: '34rpx' }" />
:list="[ <com-tabbar :list="[
{ {
name: '首页', name: '首页',
icon: '/static/tabbar/tb1.png', icon: '/static/tabbar/tb1.png',
selectIcon: '/static/tabbar/td1.png', selectIcon: '/static/tabbar/td1.png',
url: '/pages/home/index', url: '/pages/home/index',
type: 'type' type: 'type'
}, },
{ {
name: '我的需求', name: '我的需求',
icon: '/static/tabbar/tb2.png', icon: '/static/tabbar/tb2.png',
selectIcon: '/static/tabbar/td2.png', selectIcon: '/static/tabbar/td2.png',
url: '/pages/demand/index', url: '/pages/demand/index',
type: 'type' type: 'type'
}, },
{ {
name: '发布', name: '发布',
icon: '/static/tabbar/fb.png', icon: '/static/tabbar/fb.png',
selectIcon: '/static/tabbar/fb.png', selectIcon: '/static/tabbar/fb.png',
url: '/pages/release/index', url: '/pages/release/index',
type: 'type' type: 'type'
}, },
{ {
name: '动态', name: '动态',
icon: '/static/tabbar/tb3.png', icon: '/static/tabbar/tb3.png',
selectIcon: '/static/tabbar/td3.png', selectIcon: '/static/tabbar/td3.png',
url: '/pages/order/index', url: '/pages/order/index',
type: 'type' type: 'type'
}, },
{ {
name: '我的', name: '我的',
icon: '/static/tabbar/tb4.png', icon: '/static/tabbar/tb4.png',
selectIcon: '/static/tabbar/td4.png', selectIcon: '/static/tabbar/td4.png',
url: '', url: '',
type: 'myCenter' type: 'myCenter'
} }
]" ]" />
/> </view>
</view> </template>
</template>
<script>
<script> import apiBaseConfig from '@/config/index.js';
import apiBaseConfig from '@/config/index.js'; import {
import { mapMutations } from 'vuex'; mapMutations
import {updateUserMsg} from '@/api/system/index.js' } from 'vuex';
export default { import {
data() { updateUserMsg
return { } from '@/api/system/index.js'
imgBgUrl: apiBaseConfig.imgBgUrl, export default {
globalData: getApp().globalData, data() {
scrollTopHeader: 0, return {
nameDisabled: true, imgBgUrl: apiBaseConfig.imgBgUrl,
nickname:'用户名称', globalData: getApp().globalData,
mobile:'',//手机号 scrollTopHeader: 0,
list: [ nameDisabled: true,
{ nickname: '用户名称',
icon: require('@/static/icon/my04.png'), mobile: '', //手机号
title: '联系客服' list: [{
}, icon: require('@/static/icon/my04.png'),
{ title: '联系客服'
icon: require('@/static/icon/my05.png'), },
title: '意见反馈', {
url: '/my/feedback/index' icon: require('@/static/icon/my05.png'),
}, title: '意见反馈',
{ url: '/my/feedback/index'
icon: require('@/static/icon/my06.png'), },
title: '我的邀请', {
url: '/my/invite/index' icon: require('@/static/icon/my06.png'),
}, title: '我的邀请',
{ url: '/my/invite/index'
icon: require('@/static/icon/my07.png'),
title: '用户协议',
url: '/my/agreeOn/index'
},
{
icon: require('@/static/icon/my08.png'),
title: '我的优惠券',
url: '/my/coupon/index?type=coupon'
}
],
token:'',
uploadUrl: apiBaseConfig.upload,
headImgUrl:''
};
},
onLoad() {
let that = this
console.log(that.$store.state.login.userInfo.user,'打死你')
if(that.$store.state.login.userInfo && that.$store.state.login.userInfo.user && that.$store.state.login.userInfo.user.nickname){
that.nickname = that.$store.state.login.userInfo.user.nickname
}
if(that.$store.state.login.userInfo && that.$store.state.login.userInfo.user && that.$store.state.login.userInfo.user.headImgUrl){
that.headImgUrl = that.$store.state.login.userInfo.user.headImgUrl
}
let token = uni.getStorageSync('token')
console.log('token',token)
if(token){
that.token = token
}
let mobile = uni.getStorageSync('mobile')
that.mobile = mobile
},
methods: {
onChooseavatar(e) {
console.log(e,'1211');
// return;
let that = this;
const { avatarUrl } = e.detail;
that.fdsa = avatarUrl;
that.uploadFilePromise(avatarUrl)
},
uploadFilePromise(url) {
let that = this
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.uploadUrl, // 仅为示例,非真实的接口地址
filePath: url,
name: 'file',
header: {
'Authorization': `Bearer ${uni.getStorageSync('token')}`
}, },
success: (res) => { {
const { icon: require('@/static/icon/my07.png'),
data title: '用户协议',
} = JSON.parse(res.data); url: '/my/agreeOn/index'
that.updateUser({headImgUrl:data.url}) },
{
setTimeout(() => { icon: require('@/static/icon/my08.png'),
resolve(data.url) title: '我的优惠券',
}, 1000) url: '/my/coupon/index?type=coupon'
} }
}); ],
}) token: '',
}, uploadUrl: apiBaseConfig.upload,
inputNameConfirm(e) { headImgUrl: ''
console.log('======inputNameConfirm:', e.detail.value); };
},
onLoad() {
let that = this let that = this
this.updateUser({nickname:e.detail.value}) console.log(that.$store.state.login.userInfo.user, '打死你')
}, if (that.$store.state.login.userInfo && that.$store.state.login.userInfo.user && that.$store.state.login
async updateUser(data){ .userInfo.user.nickname) {
let that = this that.nickname = that.$store.state.login.userInfo.user.nickname
const back_data = await updateUserMsg(data) }
console.log(back_data)
const {code} = back_data if (that.$store.state.login.userInfo && that.$store.state.login.userInfo.user && that.$store.state.login
if(code === 200){ .userInfo.user.headImgUrl) {
uni.showToast({ that.headImgUrl = that.$store.state.login.userInfo.user.headImgUrl
title:'修改成功!', }
icon:'none' let token = uni.getStorageSync('token')
console.log('token', token)
if (token) {
that.token = token
}
let mobile = uni.getStorageSync('mobile')
that.mobile = mobile
},
methods: {
...mapMutations(['upDateUserInfoMount']),
onChooseavatar(e) {
console.log(e, '1211');
// return;
let that = this;
const {
avatarUrl
} = e.detail;
that.fdsa = avatarUrl;
that.uploadFilePromise(avatarUrl)
},
uploadFilePromise(url) {
let that = this
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.uploadUrl, // 仅为示例,非真实的接口地址
filePath: url,
name: 'file',
header: {
'Authorization': `Bearer ${uni.getStorageSync('token')}`
},
success: (res) => {
const {
data
} = JSON.parse(res.data);
this.headImgUrl = data.url
that.updateUser({
headImgUrl: data.url
})
setTimeout(() => {
resolve(data.url)
}, 1000)
}
});
}) })
} },
}, inputNameConfirm(e) {
clickJumpNPage(row) { console.log('======inputNameConfirm:', e.detail.value);
if (row.url) { let that = this
this.$uniGo.navigateTo({ this.updateUser({
url: row.url nickname: e.detail.value
}); })
} },
}, async updateUser(data) {
handleLogin(){ let that = this
if(this.token){ const back_data = await updateUserMsg(data)
uni.showModal({ console.log(back_data)
content: '是否要退出登录', const {
success: (res) => { code
if (res.confirm) { } = back_data
uni.showToast({ if (code === 200) {
title:'退出成功!', uni.showToast({
icon:'none' title: '修改成功!',
}) icon: 'none'
//执行退出 })
uni.clearStorageSync() that.upDateUserInfoMount()
this.token = uni.getStorageSync('token') }
} },
} clickJumpNPage(row) {
}) if (row.url) {
}else{ this.$uniGo.navigateTo({
this.$uniGo.navigateTo({ url: row.url
url:'/my/login/login' });
}) }
} },
handleLogin() {
} if (this.token) {
} uni.showModal({
}; content: '是否要退出登录',
</script> success: (res) => {
if (res.confirm) {
<style> uni.showToast({
page { title: '退出成功!',
background-color: #f7f8f9; icon: 'none'
} })
</style> //执行退出
<style lang="scss" scoped> uni.clearStorageSync()
.content { this.token = uni.getStorageSync('token')
&-bg { }
width: 100%; }
height: 340rpx; })
position: absolute; } else {
top: 0%; this.$uniGo.navigateTo({
left: 0%; url: '/my/login/login'
z-index: -1; })
} }
&-in {
width: calc(100% - 30rpx * 2); }
margin: 0rpx 30rpx 0; }
&-info { };
padding: 35rpx 30rpx; </script>
background-color: #ffffff;
border-radius: 14rpx; <style>
margin-bottom: 16rpx; page {
&-l { background-color: #f7f8f9;
width: 120rpx; }
height: 120rpx; </style>
margin: 0 30rpx 0 0; <style lang="scss" scoped>
padding: 0rpx; .content {
border: none; &-bg {
outline: none; width: 100%;
background: transparent; height: 340rpx;
image { position: absolute;
width: 100%; top: 0%;
height: 100%; left: 0%;
border-radius: 50%; z-index: -1;
} }
}
&-l::after { &-in {
border: none; width: calc(100% - 30rpx * 2);
} margin: 0rpx 30rpx 0;
&-r {
&-t { &-info {
margin-bottom: 17rpx; padding: 35rpx 30rpx;
input, background-color: #ffffff;
text { border-radius: 14rpx;
font-size: 36rpx; margin-bottom: 16rpx;
font-family: AlibabaPuHuiTi-Medium, AlibabaPuHuiTi;
font-weight: 500; &-l {
color: #666666; width: 120rpx;
margin-right: 34rpx; height: 120rpx;
} margin: 0 30rpx 0 0;
image { padding: 0rpx;
width: 32rpx; border: none;
height: 32rpx; outline: none;
margin-top: 5rpx; background: transparent;
}
} image {
&-b { width: 100%;
font-size: 24rpx; height: 100%;
font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi; border-radius: 50%;
font-weight: 400; }
color: #666666; }
}
} &-l::after {
} border: none;
&-item { }
padding: 26rpx 22rpx;
background-color: #ffffff; &-r {
border-radius: 10rpx; &-t {
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(0, 0, 0, 0.05); margin-bottom: 17rpx;
margin-bottom: 16rpx;
position: relative; input,
&-btn { text {
position: absolute; font-size: 36rpx;
top: 0%; font-family: AlibabaPuHuiTi-Medium, AlibabaPuHuiTi;
left: 0%; font-weight: 500;
padding: 0rpx; color: #666666;
width: 100%; margin-right: 34rpx;
height: 100%; }
outline: none;
border: none; image {
background: transparent; width: 32rpx;
border-radius: 10rpx; height: 32rpx;
} margin-top: 5rpx;
&-btn::after { }
outline: none; }
border: none;
} &-b {
> image { font-size: 24rpx;
width: 34rpx; font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
height: 34rpx; font-weight: 400;
} color: #666666;
> view { }
font-size: 24rpx; }
font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi; }
font-weight: 400;
color: #333333; &-item {
image { padding: 26rpx 22rpx;
margin-right: 12rpx; background-color: #ffffff;
width: 28rpx; border-radius: 10rpx;
height: 28rpx; box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(0, 0, 0, 0.05);
} margin-bottom: 16rpx;
} position: relative;
}
&-item:last-child { &-btn {
margin-bottom: 0rpx; position: absolute;
} top: 0%;
} left: 0%;
} padding: 0rpx;
width: 100%;
height: 100%;
outline: none;
border: none;
background: transparent;
border-radius: 10rpx;
}
&-btn::after {
outline: none;
border: none;
}
>image {
width: 34rpx;
height: 34rpx;
}
>view {
font-size: 24rpx;
font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
font-weight: 400;
color: #333333;
image {
margin-right: 12rpx;
width: 28rpx;
height: 28rpx;
}
}
}
&-item:last-child {
margin-bottom: 0rpx;
}
}
}
</style> </style>
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
暂无数据 暂无数据
</view> </view>
</view> </view>
<u-loadmore iconSize="50px" @loadmore="loadMore" color="#6A6C6F" fontSize="24rpx" :nomore-text="nomoreText" :loading-text="loadingText" line :status="loadStatus" />
<com-navbar :leftIcon="false" :homeShow="false" bgColor="#fff" title="动态" <com-navbar :leftIcon="false" :homeShow="false" bgColor="#fff" title="动态"
:titleStyle="{ color: '#000', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" /> :titleStyle="{ color: '#000', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" />
<com-tabbar :list=" [{ <com-tabbar :list=" [{
...@@ -63,57 +65,14 @@ ...@@ -63,57 +65,14 @@
}, },
articleList:[],//文章列表 articleList:[],//文章列表
total:0,//总数 total:0,//总数
loadStatus:'loading',//加载时的状态(loadmore/ loading / nomore)
evaluateList: [{ loadingText: '正在加载',
name: '马保国', nomoreText: '已经到底了'
image: 'https://slzh-oss.oss-cn-beijing.aliyuncs.com/usercenter/template/2c94809a787cec070179e01ec0ba02a9.jpg',
time: '2021.06.06',
content: '服务好,景色好,山河锦绣,树木茂盛,空气清新,鸟语花香,人杰地灵服务好,景色好,山河锦绣,树木茂盛,空气清新,鸟语花香,人杰地灵服务好,景色好,山河锦绣,树木茂盛,空气清新,鸟语花香,人杰地灵服务好,景色好,山河锦绣,树木茂盛,空气清新,鸟语花香,人杰地灵服务好,景色好,山河锦绣,树木茂盛,空气清新,鸟语花香,人杰地灵',
imageList: [{
url: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
},
{
url: 'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
},
{
url: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
},
{
url: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
},
{
url: 'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
},
{
url: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
},
]
}],
personEvalList: [{
avatar: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
nickname: '李哈哈',
date: '2022-01-31',
content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
{
avatar: 'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
nickname: '李小乖',
date: '2022-05-11',
content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
{
avatar: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
nickname: '李哈哈',
date: '2022-01-31',
content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
]
} }
}, },
onReachBottom() { onReachBottom() {
let that = this let that = this
if(that.total <= that.queryParams.pageNum * that.queryParams.pageSize) return if(that.total <= that.queryParams.pageNum * that.queryParams.pageSize) return that.loadStatus = 'nomore'
that.queryParams.pageNum++ that.queryParams.pageNum++
that.getArticleList() that.getArticleList()
}, },
...@@ -126,8 +85,17 @@ ...@@ -126,8 +85,17 @@
const data_back = await userArticleGet(that.queryParams); const data_back = await userArticleGet(that.queryParams);
const {code,total,rows} = data_back; const {code,total,rows} = data_back;
if(code === 200 && total > 0) { if(code === 200 && total > 0) {
that.articleList = rows
that.total = total that.total = total
if(that.total < that.queryParams.pageSize){
that.loadStatus = 'nomore'
}else{
that.loadStatus = 'loading'
}
if(that.queryParams.pageNum == 1){
that.articleList = rows
}else{
that.articleList = [...that.articleList,...rows]
}
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment