Commit 7956d42d by honghong

支付,退款

parent b536ed2d
...@@ -25,14 +25,14 @@ const queryInviteListGet = (params) =>{ ...@@ -25,14 +25,14 @@ const queryInviteListGet = (params) =>{
return ApiHttp('/xinrenli/Inviter/list',params,'GET') return ApiHttp('/xinrenli/Inviter/list',params,'GET')
} }
// 查询邀请列表 // 查询邀请列表
const addInviterGet = (params) =>{ const addInviterPOST = (params) =>{
return ApiHttp('/xinrenli/Inviter',params,'POST') return ApiHttp('/xinrenli/Inviter',params,'POST')
} }
export { export {
addUserFeedback, addUserFeedback,
couponListGet, couponListGet,
queryInviteListGet, queryInviteListGet,
addInviterGet, addInviterPOST,
userCouponList, userCouponList,
userCouponListLose userCouponListLose
} }
\ No newline at end of file
...@@ -28,10 +28,6 @@ const orderDetailMsgNew = (params) => { ...@@ -28,10 +28,6 @@ const orderDetailMsgNew = (params) => {
const myNeedList = (params) => { const myNeedList = (params) => {
return ApiHttp('/xinrenli/order/MyNeeds',params,'GET') return ApiHttp('/xinrenli/order/MyNeeds',params,'GET')
} }
// 上传图片视频
// const = () => {
// return ApiHttp('/system/oss/upload')
// }
// 新增订单(发布) // 新增订单(发布)
const addOrderFunction = (params) =>{ const addOrderFunction = (params) =>{
...@@ -42,12 +38,31 @@ const addOrderFunction = (params) =>{ ...@@ -42,12 +38,31 @@ const addOrderFunction = (params) =>{
const updateOrderFunction = (params) =>{ const updateOrderFunction = (params) =>{
return ApiHttp('/xinrenli/order/edit',params,'POST') return ApiHttp('/xinrenli/order/edit',params,'POST')
} }
// 重新发布接口
const againSubmitOrder = (params) =>{
return ApiHttp('/xinrenli/order/edit',params,'POST')
}
//取消订单 //取消订单
const removeOrderFunction = (params) =>{ const removeOrderFunction = (params) =>{
return ApiHttp('/xinrenli/order/remove',params,'GET') return ApiHttp('/xinrenli/order/remove',params,'GET')
} }
//生成支付订单
const createPayOrder = (params) =>{
return ApiHttp('/xinrenli/order/orderPay',params,'GET')
}
//退款
const refundFunction = (params) =>{
return ApiHttp('/xinrenli/order/refund',params,'POST')
}
//查询用户折扣列表
const userDiscountList = (params) =>{
return ApiHttp('/xinrenli/userDiscount/list',params,'GET')
}
export { export {
updateUserMsg, updateUserMsg,
userNeedSquare, userNeedSquare,
...@@ -56,6 +71,10 @@ export { ...@@ -56,6 +71,10 @@ export {
orderDetailMsgNew, orderDetailMsgNew,
myNeedList, myNeedList,
addOrderFunction, addOrderFunction,
againSubmitOrder,
updateOrderFunction, updateOrderFunction,
removeOrderFunction removeOrderFunction,
createPayOrder,
refundFunction,
userDiscountList
} }
\ No newline at end of file
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<img class="avatar-img" :src="item.userHead" alt=""> <img class="avatar-img" :src="item.userHead" alt="">
<view class="flex-1 margin-left-one"> <view class="flex-1 margin-left-one">
<view class="d-flex a-center j-sb"> <view class="d-flex a-center j-sb">
<view class="nickname">{{item.createUser ? item.createUser : ''}}</view> <view class="nickname">{{item.userName ? item.userName : ''}}</view>
<view class="font">{{item.createTime | formatDate}}</view> <view class="font">{{item.modifyTime | formatDate}}</view>
</view> </view>
<view class="evaluateText">{{item.content}}</view> <view class="evaluateText">{{item.content}}</view>
</view> </view>
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
<view class="evaluateTip d-flex j-sb a-center"> <view class="evaluateTip d-flex j-sb a-center">
<view class="d-flex a-center"> <view class="d-flex a-center">
<image class="img" src="../static/logoLogin.png" mode="widthFix"></image> <image class="img" src="../static/logoLogin.png" mode="widthFix"></image>
<view class="evaluate-name">{{ item.createUser}}</view> <view class="evaluate-name">{{ item.createUser ? item.createUser : '官方发布'}}</view>
</view> </view>
<view class="font">{{item.createTime | formatDate}}</view> <view class="font">{{item.createTime | formatDate}}</view>
</view> </view>
<view class="evaluate-title">{{item.title}}</view> <view class="evaluate-title">{{item.title}}</view>
<view class="evaluateText" :class="{lineclamp2:item.contentAll}"> {{item.content}} </view> <view class="evaluateText" :class="{lineclamp2:item.contentAll}" v-html="item.content"></view>
<!-- <view class="" v-if="item.isMore"> <!-- <view class="" v-if="item.isMore">
<view class="rightText" v-if="item.contentAll" @click="changeAllFun(item, index)">全部</view> <view class="rightText" v-if="item.contentAll" @click="changeAllFun(item, index)">全部</view>
<view class="rightText" v-else @click="changeAllFun(item, index)">收起</view> <view class="rightText" v-else @click="changeAllFun(item, index)">收起</view>
...@@ -100,6 +100,12 @@ ...@@ -100,6 +100,12 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.evaluate .evaluateCenter .evaluateItem { .evaluate .evaluateCenter .evaluateItem {
// display: inline-block; // display: inline-block;
background: #ffa;
background-color: #FFFFFF;
padding: 30rpx 20rpx;
border-radius: 10rpx;
margin: 10px 20rpx 0 20rpx;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
} }
// 展开收起 // 展开收起
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
</template> </template>
<script> <script>
import apiBaseConfig from '@/config/index.js'; import apiBaseConfig from '@/config/index.js';
import {createPayOrder} from '@/api/system/index.js'
export default { export default {
data() { data() {
return { return {
...@@ -26,10 +27,12 @@ ...@@ -26,10 +27,12 @@
}, },
onLoad() {}, onLoad() {},
methods: { methods: {
jump(){ async jump(){
this.$uniGo.navigateTo({ const data_back = await createPayOrder()
url: `/demand/prosperity/index` console.log(data_back,'支付')
}); // this.$uniGo.navigateTo({
// url: `/demand/prosperity/index`
// });
} }
} }
} }
......
<template> <template>
<view class="content"> <view class="content">
<view class="content-bgcolor"> <view class="content-bgcolor">
<view class="content-bgcolor-table"> <view class="content-bgcolor-table">
<view class=""> <view class="">
<text></text>灯泡灯芯坏了 <text></text>{{detailInfo.title}}
</view> </view>
<view class=""> <view class="">
维修时间:2023-02-23 维修时间:{{detailInfo.repairTime | formatDate}}
</view> </view>
</view> </view>
<view class="content-bgcolor-matter"> <view class="content-bgcolor-matter">
说明:有一个字不是特别亮,希望换一盏灯希望换一盏灯希望换一盏灯, 说明:{{detailInfo.remark ? detailInfo.remark : ''}}
有一个字不是特别亮,有一个字不是特别亮,希望换一盏灯希望换一盏灯有一个字不是特别亮, </view>
希望换一盏灯,有一个字不是特别亮,希望换一盏灯有一个字不是特别亮, <view class="content-bgcolor-photo">
希望换一盏灯希望换一盏灯 <image class="content-bgcolor-photo-graph" :src="v.url" mode=""
</view> v-for="(v ,index) in detailInfo.pictureList" :key="index"></image>
<view class="content-bgcolor-photo"> </view>
<image class="content-bgcolor-photo-graph" src="@/static/logo.png" mode="" v-for="(v ,index) in 5" <view class="content-bgcolor-payment">
:key="index"></image> <view class="">
</view> 已沟通审核通过,待支付
<view class="content-bgcolor-payment"> </view>
<view class=""> <view class="">
已沟通审核通过,待支付 {{detailInfo.actualAmount ? detailInfo.actualAmount : 0}}
</view> </view>
<view class=""> </view>
300元
</view>
</view>
</view>
<view class="content-discounts" @click="jump(1)">
<view class="">
选择优惠券
</view>
<view class="">
{{times}}
<image src="@/static/icon/jt.png" mode=""></image>
</view>
</view> </view>
<view class="content-discounts"> <view class="content-discounts" @click="jump(1)">
<view class=""> <view class="">
您当前可享1单9折优惠,是否使用 选择优惠券
</view>
<view class="">
{{payInfo.fullSubtraction ? payInfo.fullSubtraction : 0}}
<image src="@/static/icon/jt.png" mode=""></image>
</view>
</view>
<view class="content-discounts" v-if="discountList.length && discountList[0].discountRatio">
<view class="">
您当前可享1单{{Number(discountList[0].discountRatio)*10}}折优惠,是否使用
</view> </view>
<view class=""> <view class="">
<u-switch v-model="isUse" activeColor="#D6E1FF" inactiveColor="#F1F1F1" @change="changeUse"></u-switch> <u-switch v-model="isUse" activeColor="#D6E1FF" inactiveColor="#F1F1F1" @change="changeUse"></u-switch>
</view> </view>
</view> </view>
<view class="content-accomplish"> <view class="content-accomplish">
<view class=""> <view class="">
截止1小时内支付完成 <text>00:59:42</text> 截止1小时内支付完成 <text>00:59:42</text>
</view> </view>
<button @click="jump(2)">立即支付 300.00元</button> <button @click="jump(2)">立即支付 {{sumPrice}}</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import apiBaseConfig from '@/config/index.js'; import {createPayOrder,userDiscountList} from '@/api/system/index.js'
export default { import apiBaseConfig from '@/config/index.js';
data() { export default {
return { data() {
imgBgUrl: apiBaseConfig.imgBgUrl, return {
globalData: getApp().globalData, imgBgUrl: apiBaseConfig.imgBgUrl,
scrollTopHeader: 0, globalData: getApp().globalData,
times:'0', scrollTopHeader: 0,
isUse:true isUse: true,
}; detailInfo: {}, //详情数据
}, payInfo:{},
onLoad() {}, discountList:[]
methods: {
jump(val) { };
if(val == 1){ },
this.$uniGo.navigateTo({ created() {
url: `/my/coupon/index?type=pay` this.getDisCountList()
}); },
}else{ onLoad(option) {
this.$uniGo.navigateTo({ let that = this
url: `/demand/confirm/index` if (option.detailInfo) {
}); this.detailInfo = JSON.parse(decodeURIComponent(option.detailInfo))
} }
uni.$on('payInfo', res => {
console.log(res,'打算今年');
that.payInfo = res
})
},
onUnload() {
uni.$off('payInfo')
},
computed:{
sumPrice(){
let that = this
// 1.判断优惠券是否有值并且价格大于优惠券时
console.log(that.payInfo.fullSubtraction,that.detailInfo.actualAmount,'第三句话')
if(that.payInfo.fullSubtraction && Number(that.detailInfo.actualAmount) > Number(that.payInfo.fullSubtraction)){
console.log('优质',that.detailInfo.actualAmount - that.payInfo.fullSubtraction)
// 判断是否使用折扣(使用×折扣)
return that.isUse ? Number((that.detailInfo.actualAmount - that.payInfo.fullSubtraction) * that.discountList[0].discountRatio).toFixed(2): Number(that.detailInfo.actualAmount - that.payInfo.fullSubtraction).toFixed(2)
}else{
console.log('物质')
return that.detailInfo.actualAmount && that.isUse ? Number(that.detailInfo.actualAmount * that.discountList[0].discountRatio).toFixed(2) : that.detailInfo.actualAmount
// return that.detailInfo.actualAmount && that.isUse ? Number(that.detailInfo.actualAmount * 0.1).toFixed(2) : that.detailInfo.actualAmount
}
}
},
methods: {
async getDisCountList(){
const data_back = await userDiscountList({useStatus:0})
console.log(data_back,'折扣列表')
const {code,rows} = data_back
if(code === 200){
this.discountList = rows
}
},
// 支付接口
async handlePay(){
let that = this
let orderQuery = {
orderId:that.detailInfo.id,//订单的id
couponId:that.payInfo.id ? that.payInfo.id : '',//优惠券的id
discountId:that.isUse && that.discountList.length ? that.discountList[0].id : '',//折扣的id
}
const data_back = await createPayOrder(orderQuery)
console.log(data_back,'单靠')
const {code,data} = data_back
if(code === 200){
uni.requestPayment({
provider:'wxpay',
nonceStr: data.nonceStr, // 随机字符串
package: data.packageValue, // 固定值
timeStamp:data.timeStamp, // 时间戳(单位:秒)
signType: data.signType,
paySign: data.paySign,
success: (res) => {
console.log(res,'成功')
if (res.errMsg == 'requestPayment:ok') {
that.$uniGo.navigateTo({
url:'/demand/prosperity/index'
})
}
},
fail(err) {
console.log('失败')
if (err.errMsg == 'requestPayment:fail cancel') {
}
}
})
}
}, },
changeUse(e){ jump(val) {
if (val == 1) {
this.$uniGo.navigateTo({
url: `/my/coupon/index?type=pay`
});
} else {
this.handlePay()
// this.$uniGo.navigateTo({
// url: `/demand/confirm/index`
// });
}
},
changeUse(e) {
let that = this let that = this
that.isUse = e that.isUse = e
} }
} }
} }
</script> </script>
<style> <style>
page { page {
background: #F7F8F9; background: #F7F8F9;
} }
.u-switch__node{
.u-switch__node {
background: #888888 !important; background: #888888 !important;
} }
.u-switch__node--on{
.u-switch__node--on {
background: #2C66FF !important; background: #2C66FF !important;
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
padding: 20rpx; padding: 20rpx;
&-bgcolor { &-bgcolor {
background: #ffffff; background: #ffffff;
padding: 20rpx; padding: 20rpx;
border-radius: 8rpx; border-radius: 8rpx;
&-table { &-table {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
>view:nth-child(1) { >view:nth-child(1) {
display: flex; display: flex;
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
>text { >text {
width: 6rpx; width: 6rpx;
height: 36rpx; height: 36rpx;
background: #2C66FF; background: #2C66FF;
border-radius: 3rpx; border-radius: 3rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
} }
>view:nth-child(2) { >view:nth-child(2) {
font-size: 20rpx; font-size: 20rpx;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
} }
} }
&-matter { &-matter {
margin-top: 24rpx; margin-top: 24rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #444444; color: #444444;
line-height: 36rpx; line-height: 36rpx;
} }
&-photo { &-photo {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: flex-start; justify-content: flex-start;
&-graph { &-graph {
margin-top: 20rpx; margin-top: 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
width: 210rpx; width: 210rpx;
height: 210rpx; height: 210rpx;
} }
&-graph:nth-child(3n) { &-graph:nth-child(3n) {
margin-right: 0rpx; margin-right: 0rpx;
} }
} }
&-payment { &-payment {
margin-top: 20rpx; margin-top: 20rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
>view:nth-child(1) { >view:nth-child(1) {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #444444; color: #444444;
} }
>view:nth-child(2) { >view:nth-child(2) {
font-size: 26rpx; font-size: 26rpx;
font-weight: 600; font-weight: 600;
color: #F55726; color: #F55726;
} }
} }
} }
&-discounts { &-discounts {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-top: 23rpx; margin-top: 23rpx;
padding: 20rpx 23rpx; padding: 20rpx 23rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx; border-radius: 10rpx;
>view:nth-child(1) { >view:nth-child(1) {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
} }
>view:nth-child(2) { >view:nth-child(2) {
font-size: 26rpx; font-size: 26rpx;
font-weight: 500; font-weight: 500;
color: #F55726; color: #F55726;
display: flex; display: flex;
align-items: center; align-items: center;
>image { >image {
width: 34rpx; width: 34rpx;
height: 34rpx; height: 34rpx;
} }
} }
} }
&-accomplish { &-accomplish {
// margin-top: 286rpx; // margin-top: 286rpx;
// width: ca 100%; // width: ca 100%;
width: calc(100% - 20rpx * 2); width: calc(100% - 20rpx * 2);
text-align: center; text-align: center;
position: absolute; position: absolute;
bottom: 98rpx; bottom: 98rpx;
>view:nth-child(1) { >view:nth-child(1) {
font-size: 18rpx; font-size: 18rpx;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
>text { >text {
margin-left: 8rpx; margin-left: 8rpx;
font-size: 18rpx; font-size: 18rpx;
font-weight: 400; font-weight: 400;
color: #FD0100; color: #FD0100;
} }
} }
>button { >button {
margin-top: 20rpx; margin-top: 20rpx;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
background: #2C66FF; background: #2C66FF;
border-radius: 10rpx; border-radius: 10rpx;
width: 100%; width: 100%;
font-size: 26rpx; font-size: 26rpx;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
} }
} }
} }
</style> </style>
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
//重新发布和修改按钮事件 //重新发布和修改按钮事件
async handleSubmit(data){ async handleSubmit(data){
let that = this let that = this
if(that.detailInfo.status == 1){
that.$set(data,'status',0)
}
const back_data = await updateOrderFunction(data) const back_data = await updateOrderFunction(data)
const {code} = back_data const {code} = back_data
if(code == 200){ if(code == 200){
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<text></text> <text></text>
<view>可用优惠券{{cantotal}}</view> <view>可用优惠券{{cantotal}}</view>
</view> </view>
<view class="index-content-item-qu" @click="optionData.type === 'pay'?jump():null"> <view class="index-content-item-qu" @click="optionData.type === 'pay'?jump(item):null">
<image class="index-content-item-qu-bg" src="@/static/icon/xy01.png" mode=""></image> <image class="index-content-item-qu-bg" src="@/static/icon/xy01.png" mode=""></image>
<view class="index-content-item-qu-bl"> <view class="index-content-item-qu-bl">
<text class="index-content-item-qu-bl-tl">满减优惠券</text> <text class="index-content-item-qu-bl-tl">满减优惠券</text>
...@@ -78,16 +78,16 @@ ...@@ -78,16 +78,16 @@
optionData: {}, optionData: {},
title: '', title: '',
queryParams:{ queryParams:{
pageNum:1, // pageNum:1,
pageSize:10, // pageSize:10,
deleteStatus:0, deleteStatus:0,
useStatus:0 useStatus:0
},//优惠券有效参数 },//优惠券有效参数
useCouponList:[],//可使用的优惠券列表 useCouponList:[],//可使用的优惠券列表
cantotal:0, cantotal:0,
loseParams:{ loseParams:{
pageNum:1, // pageNum:1,
pageSize:10, // pageSize:10,
deleteStatus:1, deleteStatus:1,
useStatus:1 useStatus:1
}, },
...@@ -140,22 +140,21 @@ ...@@ -140,22 +140,21 @@
break; break;
} }
}, },
jump() { jump(data) {
console.log('22222') uni.$emit('payInfo',data)
// 获取所有页面栈实例列表 // 获取所有页面栈实例列表
let pages = getCurrentPages(); // let pages = getCurrentPages();
// 上一页页面实例 // // 上一页页面实例
let prevPage = pages[pages.length - 2]; // let prevPage = pages[pages.length - 2];
// 修改上一页data里面的times参数值为100 // // 修改上一页data里面的times参数值为100
prevPage.$vm.times = 100; // prevPage.$vm.times = 100;
//uni.navigateTo跳转的返回,默认1为返回上一级 //uni.navigateTo跳转的返回,默认1为返回上一级
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}); });
console.log('1111111')
} }
} }
}; };
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<text></text> <text></text>
<view> <view>
我已邀请: 我已邀请:
<text>3位用户</text> <text>{{total}}位用户</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -34,42 +34,64 @@ ...@@ -34,42 +34,64 @@
--> -->
</view> </view>
<view> <view>
<button class="invite-btn" data-name="shareBtn" open-type="share">继续邀请新用户</button> <button class="invite-btn" open-type="share">继续邀请新用户</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import apiBaseConfig from '@/config/index.js'; import apiBaseConfig from '@/config/index.js';
import { queryInviteListGet,addInviterGet } from '@/api/my/index.js' import {
queryInviteListGet,
addInviterGet
} from '@/api/my/index.js'
export default { export default {
data() { data() {
return { return {
imgBgUrl: apiBaseConfig.imgBgUrl, imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData, globalData: getApp().globalData,
scrollTopHeader: 0 scrollTopHeader: 0,
inviteList: [],
total: 0
}; };
}, },
//分享 onShareAppMessage(options) {
onShareAppMessage() { var that = this;
return { // 设置菜单中的转发按钮触发转发事件时的转发内容
title: '分享的标题', var shareObj = {
success() { title: "新人力小程序", // 默认是小程序的名称(可以写slogan等)
addInviterGet().then(res => { path: '/my/login/login', // 默认是当前页面,必须是以‘/'开头的完整路径
};
}) // 来自页面内的按钮的转发
} if (options.from == 'button') {
var eData = options.target.dataset;
console.log(eData.name); // shareBtn
// 此处可以修改 shareObj 中的内容
shareObj.path = '/my/login/login';
} }
console.log("shareObj",shareObj)
// 返回shareObj
return shareObj;
}, },
onLoad() { onLoad() {
wx.hideShareMenu()
this.getList() this.getList()
}, },
methods: { methods: {
// 获取邀请列表 // 获取邀请列表
getList(){ async getList() {
queryInviteListGet().then(res => { const data_back = await queryInviteListGet()
console.log(data_back, '第三节')
}) const {
code,
rows,
total
} = data_back
if (code == 200 && total > 0) {
this.inviteList = rows
this.total = total
}
} }
} }
}; };
......
...@@ -16,14 +16,12 @@ ...@@ -16,14 +16,12 @@
<image class="img" <image class="img"
src="https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500" src="https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
mode="widthFix"></image> mode="widthFix"></image>
<view class="evaluate-name">张三</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>
</view> </view>
<view class="evaluateText text-indent"> <view class="evaluateText text-indent" v-html="articleData.content"></view>
{{articleData.content}}
</view>
</view> </view>
</view> </view>
<view class="bgWhite"> <view class="bgWhite">
...@@ -34,7 +32,7 @@ ...@@ -34,7 +32,7 @@
</view> </view>
<view class="comment-box"> <view class="comment-box">
<view class="paddding-x-two comment-box-height d-flex a-center j-sb"> <view class="paddding-x-two comment-box-height d-flex a-center j-sb">
<input v-model="content" class="send-input" type="text" placeholder="评论一下吧"> <input v-model="evalQuery.content" class="send-input" type="text" placeholder="评论一下吧">
<view class="send-btn-box" @click="handleSend">发送</view> <view class="send-btn-box" @click="handleSend">发送</view>
</view> </view>
</view> </view>
...@@ -47,37 +45,6 @@ ...@@ -47,37 +45,6 @@
export default { export default {
data() { data() {
return { return {
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://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://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://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: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
],
articleData:{}, articleData:{},
userQuery:{ userQuery:{
pageNum:1, pageNum:1,
...@@ -85,11 +52,14 @@ ...@@ -85,11 +52,14 @@
articleId:null articleId:null
}, },
userEvalList:[], userEvalList:[],
content:'',//评论的内容 evalQuery:{
content:'',//评论的内容
articleId:'',//文章id
deleteStatus:0
}
} }
}, },
onLoad(option) { onLoad(option) {
console.log(option.id,'接受的')
this.getDetail(option.id) this.getDetail(option.id)
this.getUserEvalList(option.id) this.getUserEvalList(option.id)
}, },
...@@ -97,7 +67,6 @@ ...@@ -97,7 +67,6 @@
getDetail(id){ getDetail(id){
let that = this let that = this
articleDetail(id).then(res=>{ articleDetail(id).then(res=>{
console.log(res,'文章详情')
if(res.code == 200){ if(res.code == 200){
that.articleData = res.data that.articleData = res.data
} }
...@@ -107,7 +76,6 @@ ...@@ -107,7 +76,6 @@
let that = this let that = this
that.userQuery.articleId = id that.userQuery.articleId = id
userEvaluateGet(that.userQuery).then(res=>{ userEvaluateGet(that.userQuery).then(res=>{
console.log(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
...@@ -115,13 +83,29 @@ ...@@ -115,13 +83,29 @@
} }
}) })
}, },
handleSend(){ async handleSend(){
let that = this let that = this
that.content = that.content.trim() if(that.evalQuery.content){
if(that.content){ that.$set(that.evalQuery,'content',that.evalQuery.content.trim())
addUserEvaluate({content:this.content.trim()}).then(res=>{ that.$set(that.evalQuery,'articleId',that.articleData.id)
console.log('发送',res) const data_back = await addUserEvaluate(that.evalQuery)
}) const {code} = data_back
if(code === 200){
that.evalQuery.content = ''
uni.showToast({
title:'评论成功!',
icon:'none',
duration:2000,
success() {
let clearTime = setTimeout(() => {
clearTimeout(clearTime)
that.$uniGo.navigateBack({
delta:1
})
}, 1000)
}
})
}
}else{ }else{
return uni.showToast({ return uni.showToast({
title:'不可发布空白内容', title:'不可发布空白内容',
......
...@@ -40,15 +40,15 @@ ...@@ -40,15 +40,15 @@
截止1小时内支付完成<text>{{isEndTime}}</text> 截止1小时内支付完成<text>{{isEndTime}}</text>
</view> </view>
</view> </view>
<view class="" @click.stop="payment"> <view class="" @click.stop="payment(item)">
<button class="buttoncl">支付</button> <button class="buttoncl">支付</button>
</view> </view>
</view> </view>
<!-- // 已接单 --> <!-- // 已接单 -->
<view class="buttoncolor" v-if="subscript == '3'"> <view class="buttoncolor" v-if="subscript == '3'">
<button class="buttoncl" @click.stop="abolish(2)">退款</button> <button class="buttoncl" @click.stop="abolish(2,item)">退款</button>
<button class="buttonclde" @click.stop="abolish(3)">详情</button> <button class="buttonclde" @click.stop="abolish(3,item)">详情</button>
<button class="buttonclde" @click.stop="abolish(4)">已退款</button> <button class="buttonclde" @click.stop="abolish(4,item)">已退款</button>
</view> </view>
</view> </view>
</view> </view>
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
title: '确认取消订单吗', title: '确认取消订单吗',
titbut: '取消订单', titbut: '取消订单',
currentId:'',//当前的id currentId:'',//当前的id
actualAmount:0,//实付金饿
} }
}, },
...@@ -114,15 +115,16 @@ ...@@ -114,15 +115,16 @@
}); });
}, },
// 跳转支付界面 // 跳转支付界面
payment() { payment(data) {
this.$uniGo.navigateTo({ this.$uniGo.navigateTo({
url: `/demand/payment/index` url: `/demand/payment/index?detailInfo=${encodeURIComponent(JSON.stringify(data))}`
}); });
}, },
// 取消订单1 立即退款2 // 取消订单1 立即退款2
abolish(val,data) { abolish(val,data) {
console.log(data.id,'数控') console.log(data.id,data.actualAmount,'数控')
this.currentId = data.id this.currentId = data.id
this.actualAmount = data.actualAmount
if (val == 1) { if (val == 1) {
this.title = '确认取消订单吗' this.title = '确认取消订单吗'
this.titbut = '1' this.titbut = '1'
...@@ -154,7 +156,7 @@ ...@@ -154,7 +156,7 @@
}, },
// 取消订单2 立即退款3 // 取消订单2 立即退款3
aindexst(val) { aindexst(val) {
this.$emit('getVal',val,this.currentId) this.$emit('getVal',val,this.currentId,this.actualAmount)
this.show = false this.show = false
} }
} }
......
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
import { import {
myNeedList, myNeedList,
orderDetailList, orderDetailList,
removeOrderFunction removeOrderFunction,
refundFunction
} from '../../api/system/index.js' } from '../../api/system/index.js'
import apiBaseConfig from '@/config/index.js'; import apiBaseConfig from '@/config/index.js';
import uniGo from '@/utils/unIGO.js'; import uniGo from '@/utils/unIGO.js';
...@@ -150,12 +151,35 @@ ...@@ -150,12 +151,35 @@
}) })
} }
}, },
// 立即退款接口
async handleRefund(id,price){
const data_back = await refundFunction({refundeAmount:price,orderId:id})
console.log(data_back,'退款')
const {
code
} = back_data
if (code == 200) {
uni.showToast({
title: '退款成功!',
icon: 'none',
duration: 2000,
success() {
setTimeout(() => {
that.getMyNeedList()
}, 1000)
}
})
}
},
// 取消订单2 立即退款3 // 取消订单2 立即退款3
handleStatus(val, id) { handleStatus(val,id,price) {
console.log(val, id, '装订好') console.log(val,id,price, '装订好')
let that = this let that = this
if (val == 2) { if (val == 2) {
that.handleCancle(id) that.handleCancle(id)
}else if(val == 3){
that.handleRefund(id,price)
} }
} }
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<view class="content-in-info-r"> <view class="content-in-info-r">
<view class="content-in-info-r-t baiyin-flex"> <view class="content-in-info-r-t baiyin-flex">
<text v-if="nameDisabled">{{nickname}}</text> <text v-if="nameDisabled">{{nickname}}</text>
<input v-else confirm-type="确定" @confirm="inputNameConfirm" maxlength="15" type="text" value="用户名称1" /> <input v-else confirm-type="确定" @confirm="inputNameConfirm" maxlength="15" type="text" :value="nickname" />
<image src="@/static/icon/my02.png" mode="" @click="nameDisabled = !nameDisabled"></image> <image src="@/static/icon/my02.png" mode="" @click="nameDisabled = !nameDisabled"></image>
</view> </view>
<view class="content-in-info-r-b" v-if="mobile">手机号:{{mobile}}</view> <view class="content-in-info-r-b" v-if="mobile">手机号:{{mobile}}</view>
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
globalData: getApp().globalData, globalData: getApp().globalData,
scrollTopHeader: 0, scrollTopHeader: 0,
nameDisabled: true, nameDisabled: true,
nickname:this.$store.state.login.userInfo.user.nickname, nickname:'用户名称',
mobile:'',//手机号 mobile:'',//手机号
list: [ list: [
{ {
...@@ -124,6 +124,7 @@ export default { ...@@ -124,6 +124,7 @@ export default {
}; };
}, },
onLoad() { onLoad() {
this.nickname = this.$store.state.login.userInfo.user.nickname
console.log(this.$store.state.login.userInfo.user.nickname,'D撒') console.log(this.$store.state.login.userInfo.user.nickname,'D撒')
let mobile = uni.getStorageSync('mobile') let mobile = uni.getStorageSync('mobile')
this.mobile = mobile this.mobile = mobile
......
...@@ -105,21 +105,18 @@ ...@@ -105,21 +105,18 @@
] ]
} }
}, },
onLoad() { onReachBottom() {
let that = this
if(that.total <= that.queryParams.pageNum * that.queryParams.pageSize) return
that.queryParams.pageNum++
that.getArticleList()
},
onShow() {
this.getArticleList() this.getArticleList()
}, },
methods: { methods: {
async getArticleList(){ async getArticleList(){
let that = this let that = this
// userArticleGet(that.queryParams).then(res=>{
// console.log('文章列表',res.rows)
// if(res.code == 200){
// if(res.total > 0){
// that.articleList = res.rows
// that.total = res.total
// }
// }
// })
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) {
...@@ -142,10 +139,10 @@ ...@@ -142,10 +139,10 @@
<style> <style>
.friends-list-box { .friends-list-box {
background-color: #FFFFFF; /* background-color: #FFFFFF;
padding: 30rpx 20rpx; padding: 30rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
margin: 10px 20rpx 0 20rpx; margin: 10px 20rpx 0 20rpx;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1); */
} }
</style> </style>
...@@ -63,6 +63,23 @@ const ApiHttp = (url, params, method, isToken = true) => { ...@@ -63,6 +63,23 @@ const ApiHttp = (url, params, method, isToken = true) => {
if (code === 200) { if (code === 200) {
resolve(data); resolve(data);
} else if (code === 401) { } else if (code === 401) {
uni.clearStorageSync();
uni.showModal({
title: '请登录',
content: '您需要登录才能使用该功能',
success: (res) => {
if (res.confirm) {
uni.reLaunch({
url: '/my/login/login'
})
} else if (res.cancel) {
uni.navigateBack()
}
}
})
resolve(data); resolve(data);
} else { } else {
if (url == '/group-buy/by-consumer-order/leader/refunde' || if (url == '/group-buy/by-consumer-order/leader/refunde' ||
...@@ -75,6 +92,7 @@ const ApiHttp = (url, params, method, isToken = true) => { ...@@ -75,6 +92,7 @@ const ApiHttp = (url, params, method, isToken = true) => {
title: msg || '系统内部错误', title: msg || '系统内部错误',
icon: "none" icon: "none"
}) })
if (url == '/system/xcxLogin' || url == 'system/getPhone') { if (url == '/system/xcxLogin' || url == 'system/getPhone') {
uni.clearStorageSync(); uni.clearStorageSync();
store.dispatch('loginOut') store.dispatch('loginOut')
......
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