Commit 76b833dc by honghong

优惠券列表接口对接详情接口修改

parent 2b28a6b6
...@@ -11,6 +11,15 @@ const addUserFeedback = (params) => { ...@@ -11,6 +11,15 @@ const addUserFeedback = (params) => {
const couponListGet = (params) =>{ const couponListGet = (params) =>{
return ApiHttp('/xinrenli/coupon/list',params,'GET') return ApiHttp('/xinrenli/coupon/list',params,'GET')
} }
// 用户优惠卷有效查询接口
const userCouponList = (params) => {
return ApiHttp('/xinrenli/userCoupon/list',params,'GET')
}
// 用户优惠卷无效查询接口
const userCouponListLose = (params) => {
return ApiHttp('/xinrenli/userCoupon/listLose',params,'GET')
}
// 查询邀请列表 // 查询邀请列表
const queryInviteListGet = (params) =>{ const queryInviteListGet = (params) =>{
return ApiHttp('/xinrenli/Inviter/list',params,'GET') return ApiHttp('/xinrenli/Inviter/list',params,'GET')
...@@ -23,5 +32,7 @@ export { ...@@ -23,5 +32,7 @@ export {
addUserFeedback, addUserFeedback,
couponListGet, couponListGet,
queryInviteListGet, queryInviteListGet,
addInviterGet addInviterGet,
userCouponList,
userCouponListLose
} }
\ No newline at end of file
...@@ -10,6 +10,10 @@ const userNeedSquare = (params) => { ...@@ -10,6 +10,10 @@ const userNeedSquare = (params) => {
const orderDetailMsg = (params) => { const orderDetailMsg = (params) => {
return ApiHttp('/xinrenli/order/',params,'GET') return ApiHttp('/xinrenli/order/',params,'GET')
} }
// 获取订单详细信息(最新首页详情)
const orderDetailMsgNew = (params) => {
return ApiHttp('/xinrenli/order/particulars',params,'GET')
}
//我的需求 //我的需求
const myNeedList = (params) => { const myNeedList = (params) => {
...@@ -23,13 +27,20 @@ const addOrderFunction = (params) =>{ ...@@ -23,13 +27,20 @@ const addOrderFunction = (params) =>{
// 修改订单(发布) // 修改订单(发布)
const updateOrderFunction = (params) =>{ const updateOrderFunction = (params) =>{
return ApiHttp('/xinrenli/order',params,'PUT') return ApiHttp('/xinrenli/order/edit',params,'POST')
}
//取消订单
const removeOrderFunction = (params) =>{
return ApiHttp('/xinrenli/order/remove',params,'GET')
} }
export { export {
userNeedSquare, userNeedSquare,
orderDetailMsg, orderDetailMsg,
orderDetailMsgNew,
myNeedList, myNeedList,
addOrderFunction, addOrderFunction,
updateOrderFunction updateOrderFunction,
removeOrderFunction
} }
\ No newline at end of file
import { import {
ApiHttp ApiHttp
} from '@/utils/request.js' } from '@/utils/request.js'
// 程序静默登录
const login = (params) => { const login = (params) => {
return ApiHttp('/system/xcxLogin', params, 'POST') return ApiHttp('/xcxLogin', params, 'GET')
} }
// 获取手机号
const loginPhone = (params) => { const loginPhone = (params) => {
return ApiHttp('/system/getPhone', params, 'POST') return ApiHttp('/xcxPhoneLogin', params, 'POST')
} }
const loginOut = (params) => { const loginOut = (params) => {
......
let hostUrl = 'http://xinrenli.nyinhong.com', // 测试 // let hostUrl = 'http://xinrenli.nyinhong.com', // 测试
// let hostUrl = 'http://192.168.0.109:7001', // UAT let hostUrl = 'http://192.168.0.175:7001', // UAT
// // let hostUrl = 'https://pepsibdp.masterkong.com.cn', // prd // // let hostUrl = 'https://pepsibdp.masterkong.com.cn', // prd
api = '/api', api = '',
// api = '/api',
imgApi = '/admimage/'; imgApi = '/admimage/';
// let hostUrl = '', // let hostUrl = '',
......
<template> <template>
<view class="content"> <view class="content">
<view class="content-textarea"> <view class="content-textarea">
<view class="">标题</view> <view class="">标题</view>
<view class="">{{detailData.title}}</view> <view class="">{{detailData.title}}</view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class="">联系人</view> <view class="">联系人</view>
<view class="">{{detailData.linkman}}</view> <view class="">{{detailData.linkman}}</view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class="">联系电话</view> <view class="">联系电话</view>
<view class="">{{detailData.phone}}</view> <view class="">{{detailData.phone}}</view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class="">维修时间</view> <view class="">维修时间</view>
<view class="">{{detailData.repairTime | formatDate}}</view> <view class="">{{detailData.repairTime | formatDate}}</view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class="">维修地址</view> <view class="">维修地址</view>
<view class="">{{detailData.repairAddress}}</view> <view class="">{{detailData.repairAddress}}</view>
</view> </view>
<view class="content-textarea"> <view class="content-textarea">
<view class="">预算金额</view> <view class="">预算金额</view>
<view class="">{{detailData.budget}}</view> <view class="">{{detailData.budget}}</view>
</view> </view>
<view class="content-photograph"> <view class="content-photograph">
<view class="">上传图片 <view class="">上传图片
</view>
<view class="content-photograph-photo">
<image class="content-photograph-photo-img" src="../../static/logo.png" mode="" v-for="(v ,index) in 5"
:key="index"></image>
</view>
</view>
<view class="content-frequency">
<view class="">
上传视频
</view>
<view v-for="(v ,index) in 2" :key="index">
<video id="myVideo"
src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4"
@error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls
:show-fullscreen-btn='false'></video>
</view>
</view>
<view class="content-voice">
<view class="">
语音描述
</view>
<view class="content-voice-audio">
</view>
</view>
<view class="content-remarks">
<view class="">
备注
</view>
<u--textarea v-model="detailData.remark" placeholder="请输入内容" disabled></u--textarea>
</view>
<view class="content-reject" v-if="detailData.status == 1">
<view class="font-bold">
<text></text>订单已驳回
</view> </view>
<view class="paddding-x-two">驳回理由:沟通金额没有谈妥</view> <view class="content-photograph-photo">
<!-- <u--textarea v-model="detailData.value1" placeholder="请输入内容" disabled></u--textarea> --> <image class="content-photograph-photo-img" src="../../static/logo.png" mode="" v-for="(v ,index) in 5"
</view> :key="index"></image>
<view class="content-reject" v-if="subscript == 3 && subs== '1'"> </view>
<view class=""> </view>
<text style="background:#2C66FF"></text>该订单已提交退款,等待商家致电…… <view class="content-frequency">
</view> <view class="">
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea> 上传视频
</view> </view>
<view class="content-reject" v-if="subscript == 3 && subs== '2'"> <view v-for="(v ,index) in 2" :key="index">
<view class=""> <video id="myVideo"
<text></text>该订单已退款 src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4"
</view> @error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea> :show-fullscreen-btn='false'></video>
</view> </view>
</view> </view>
</view> <view class="content-voice">
</template> <view class="">
语音描述
</view>
<view class="content-voice-audio">
</view>
</view>
<view class="content-remarks">
<view class="">
备注
</view>
<u--textarea v-model="detailData.remark" placeholder="请输入内容" disabled></u--textarea>
</view>
<view class="content-reject" v-if="detailData.status == 1">
<view class="font-bold">
<text></text>订单已驳回
</view>
<view class="paddding-x-two">驳回理由:沟通金额没有谈妥</view>
<!-- <u--textarea v-model="detailData.value1" placeholder="请输入内容" disabled></u--textarea> -->
</view>
<view class="content-reject" v-if="subscript == 3 && subs== '1'">
<view class="">
<text style="background:#2C66FF"></text>该订单已提交退款,等待商家致电……
</view>
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea>
</view>
<view class="content-reject" v-if="subscript == 3 && subs== '2'">
<view class="">
<text></text>该订单已退款
</view>
<u--textarea v-model="value1" placeholder="请输入内容" disabled></u--textarea>
</view>
</view>
</view>
</template>
<script> <script>
import {orderDetailMsg} from '../../api/system/index.js' import {
import apiBaseConfig from '@/config/index.js'; orderDetailMsgNew
export default { } from '../../api/system/index.js'
data() { import apiBaseConfig from '@/config/index.js';
return { export default {
imgBgUrl: apiBaseConfig.imgBgUrl, data() {
globalData: getApp().globalData, return {
imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData,
scrollTopHeader: 0, scrollTopHeader: 0,
detailInfo:{},//接收的参数 detailInfo: {}, //接收的参数
subscript: '0', subscript: '0',
subs: '1', subs: '1',
detailData:{} detailData: {}
}; };
}, },
onLoad(option) { onLoad(option) {
if(option.detailInfo){ if (option.detailInfo) {
this.detailInfo = JSON.parse(decodeURIComponent(option.detailInfo)) this.detailInfo = JSON.parse(decodeURIComponent(option.detailInfo))
console.log(this.detailInfo,'结束') console.log(this.detailInfo, '结束')
this.getOrder() this.getOrder()
} }
return return
this.subs = option.subs this.subs = option.subs
}, },
methods: { methods: {
//获取订单详情列表 //获取订单详情列表
getOrder(){ async getOrder() {
let that = this let that = this
orderDetailMsg({id:that.detailInfo.id}).then(res=>{ const data_back = await orderDetailMsgNew({
console.log('订单详情',res) id: that.detailInfo.id
if(res.code == 200){
that.detailData = res.data
}
}) })
}, console.log(data_back, '订单详情')
const {
} code,
} data
</script> } = data_back
if (code === 200) {
<style lang="scss" scoped> that.detailData = data
.content { }
padding: 0rpx 40rpx 160rpx; // orderDetailMsgNew({id:that.detailInfo.id}).then(res=>{
// console.log('订单详情',res)
&-textarea { // if(res.code == 200){
display: flex; // that.detailData = res.data
justify-content: space-between; // }
padding: 30rpx 10rpx; // })
border-bottom: 1rpx solid #E7E7E7; },
>view { }
font-size: 26rpx; }
font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi; </script>
font-weight: 400;
color: #333333; <style lang="scss" scoped>
} .content {
} padding: 0rpx 40rpx 160rpx;
&-photograph { &-textarea {
padding: 30rpx 0rpx; display: flex;
justify-content: space-between;
&-photo { padding: 30rpx 10rpx;
display: flex; border-bottom: 1rpx solid #E7E7E7;
flex-wrap: wrap;
justify-content: flex-start; >view {
font-size: 26rpx;
&-img { font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
margin-top: 20rpx; font-weight: 400;
margin-right: 20rpx; color: #333333;
width: 210rpx; }
height: 210rpx; }
}
&-img:nth-child(3n){ &-photograph {
margin-right: 0rpx; padding: 30rpx 0rpx;
}
} &-photo {
} display: flex;
flex-wrap: wrap;
&-frequency { justify-content: flex-start;
padding: 30rpx 0rpx;
&-img {
>view { margin-top: 20rpx;
display: flex; margin-right: 20rpx;
width: 210rpx;
>video { height: 210rpx;
margin-top: 20rpx; }
width: 373rpx;
height: 210rpx; &-img:nth-child(3n) {
} margin-right: 0rpx;
} }
} }
}
&-voice {
padding: 30rpx 0rpx; &-frequency {
padding: 30rpx 0rpx;
&-audio {
margin-top: 20rpx; >view {
background: #F5F5F5; display: flex;
border-radius: 6rpx;
height: 68rpx; >video {
} margin-top: 20rpx;
} width: 373rpx;
height: 210rpx;
&-remarks { }
>view { }
margin-bottom: 20rpx; }
}
} &-voice {
padding: 30rpx 0rpx;
&-reject {
margin-top: 30rpx; &-audio {
margin-top: 20rpx;
>view { background: #F5F5F5;
display: flex; border-radius: 6rpx;
margin-bottom: 20rpx; height: 68rpx;
font-size: 28rpx; }
// font-weight: 700; }
color: #333333;
&-remarks {
>text { >view {
width: 6rpx; margin-bottom: 20rpx;
height: 36rpx; }
background: #FD0000; }
border-radius: 3rpx;
margin-right: 10rpx; &-reject {
} margin-top: 30rpx;
}
} >view {
display: flex;
margin-bottom: 20rpx;
font-size: 28rpx;
// font-weight: 700;
color: #333333;
>text {
width: 6rpx;
height: 36rpx;
background: #FD0000;
border-radius: 3rpx;
margin-right: 10rpx;
}
}
}
} }
</style> </style>
...@@ -61,7 +61,8 @@ ...@@ -61,7 +61,8 @@
<script> <script>
import { import {
orderDetailMsg orderDetailMsg,
orderDetailMsgNew
} from '../../api/system/index.js' } from '../../api/system/index.js'
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'
...@@ -102,14 +103,18 @@ ...@@ -102,14 +103,18 @@
}) })
}, },
methods: { methods: {
getDetailData(id){ async getDetailData(id){
let that = this let that = this
orderDetailMsg({id:id}).then(res=>{ const data_back = await orderDetailMsgNew({id:id})
console.log(res.data,'详情') console.log(data_back,'返沪')
if(res.code == 200){ const {code,data} = data_back
that.orderDetail = res.data that.orderDetail = data
} // orderDetailMsgNew({id:id}).then(res=>{
}) // console.log(res.data,'详情')
// if(res.code == 200){
// that.orderDetail = res.data
// }
// })
}, },
// 播放 // 播放
doPlay() { doPlay() {
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<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">
<view class="index-content-item"> <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>
<view>可用优惠券(2)</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():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>
...@@ -14,15 +14,15 @@ ...@@ -14,15 +14,15 @@
<view class="index-content-item-qu-bl-lk"> <view class="index-content-item-qu-bl-lk">
<view class="index-content-item-qu-bl-lk-t"> <view class="index-content-item-qu-bl-lk-t">
<text></text> <text></text>
<text>200</text> <text>{{item.fullSubtraction}}</text>
优惠券 优惠券
</view> </view>
<view class="index-content-item-qu-bl-lk-b">有效期:2022.3.1-2022.12.31</view> <view class="index-content-item-qu-bl-lk-b">有效期:{{item.effectiveTime | formatDate}}-{{item.failureTime | formatDate}}</view>
</view> </view>
<template v-if="optionData.type === 'pay'"> <template v-if="optionData.type === 'pay'">
<view class="index-content-item-qu-bl-rk"> <view class="index-content-item-qu-bl-rk">
<view class="index-content-item-qu-bl-rk-a">订单金额满</view> <view class="index-content-item-qu-bl-rk-a">订单金额满</view>
<view class="index-content-item-qu-bl-rk-b">9999</view> <view class="index-content-item-qu-bl-rk-b">{{item.minUsed}}</view>
<view class="index-content-item-qu-bl-rk-c">可使用</view> <view class="index-content-item-qu-bl-rk-c">可使用</view>
<view class="index-content-item-qu-bl-rk-d">当前可使用</view> <view class="index-content-item-qu-bl-rk-d">当前可使用</view>
</view> </view>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<template v-if="optionData.type === 'coupon'"> <template v-if="optionData.type === 'coupon'">
<view class="index-content-item-qu-bl-rk"> <view class="index-content-item-qu-bl-rk">
<view class="index-content-item-qu-bl-rk-a index-content-item-qu-bl-rk-axl">订单金额满</view> <view class="index-content-item-qu-bl-rk-a index-content-item-qu-bl-rk-axl">订单金额满</view>
<view class="index-content-item-qu-bl-rk-b index-content-item-qu-bl-rk-bxl">9999</view> <view class="index-content-item-qu-bl-rk-b index-content-item-qu-bl-rk-bxl">{{item.minUsed}}</view>
<view class="index-content-item-qu-bl-rk-c index-content-item-qu-bl-rk-cxl">可使用</view> <view class="index-content-item-qu-bl-rk-c index-content-item-qu-bl-rk-cxl">可使用</view>
<view class="index-content-item-qu-bl-rk-d index-content-item-qu-bl-rk-dxl">去使用</view> <view class="index-content-item-qu-bl-rk-d index-content-item-qu-bl-rk-dxl">去使用</view>
</view> </view>
...@@ -43,22 +43,22 @@ ...@@ -43,22 +43,22 @@
<text></text> <text></text>
<view>不可用优惠券(2)</view> <view>不可用优惠券(2)</view>
</view> </view>
<view class="index-content-item-qu"> <view class="index-content-item-qu" v-for="(info,ix) in couponLoseList">
<image class="index-content-item-qu-bg" src="@/static/icon/xy02.png" mode=""></image> <image class="index-content-item-qu-bg" src="@/static/icon/xy02.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 index-content-item-qu-bl-tlx">满减优惠券</text> <text class="index-content-item-qu-bl-tl index-content-item-qu-bl-tlx">满减优惠券</text>
<view class="index-content-item-qu-bl-lk"> <view class="index-content-item-qu-bl-lk">
<view class="index-content-item-qu-bl-lk-t index-content-item-qu-bl-lk-tx"> <view class="index-content-item-qu-bl-lk-t index-content-item-qu-bl-lk-tx">
<text></text> <text></text>
<text>200</text> <text>{{info.fullSubtraction}}</text>
优惠券 优惠券
</view> </view>
<view class="index-content-item-qu-bl-lk-b index-content-item-qu-bl-lk-bx"> <view class="index-content-item-qu-bl-lk-b index-content-item-qu-bl-lk-bx">
有效期:2022.3.1-2022.12.31</view> 有效期:{{info.effectiveTime | formatDate}}-{{info.failureTime | formatDate}}</view>
</view> </view>
<view class="index-content-item-qu-bl-rk"> <view class="index-content-item-qu-bl-rk">
<view class="index-content-item-qu-bl-rk-a index-content-item-qu-bl-rk-ax">订单金额满</view> <view class="index-content-item-qu-bl-rk-a index-content-item-qu-bl-rk-ax">订单金额满</view>
<view class="index-content-item-qu-bl-rk-b index-content-item-qu-bl-rk-bx">200</view> <view class="index-content-item-qu-bl-rk-b index-content-item-qu-bl-rk-bx">{{info.minUsed}}</view>
<view class="index-content-item-qu-bl-rk-c index-content-item-qu-bl-rk-cx">可使用</view> <view class="index-content-item-qu-bl-rk-c index-content-item-qu-bl-rk-cx">可使用</view>
<view class="index-content-item-qu-bl-rk-d index-content-item-qu-bl-rk-dx">不可用</view> <view class="index-content-item-qu-bl-rk-d index-content-item-qu-bl-rk-dx">不可用</view>
</view> </view>
...@@ -70,13 +70,29 @@ ...@@ -70,13 +70,29 @@
</template> </template>
<script> <script>
import {couponListGet} from '../../api/my/index.js' import {couponListGet,userCouponList,userCouponListLose} from '../../api/my/index.js'
export default { export default {
data() { data() {
return { return {
scrollTopHeader: 0, scrollTopHeader: 0,
optionData: {}, optionData: {},
title: '' title: '',
queryParams:{
pageNum:1,
pageSize:10,
deleteStatus:0,
useStatus:0
},//优惠券有效参数
useCouponList:[],//可使用的优惠券列表
cantotal:0,
loseParams:{
pageNum:1,
pageSize:10,
deleteStatus:1,
useStatus:1
},
couponLoseList:[],
loseTotal:0
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -84,14 +100,35 @@ ...@@ -84,14 +100,35 @@
self.optionData = option; self.optionData = option;
console.log(option) console.log(option)
self.initial(); self.initial();
self.getCoupon() self.getCoupon()
self.getLoseCoupon()
}, },
methods: { methods: {
getCoupon(){ async getCoupon(){
couponListGet().then(res=>{ let that = this
console.log('优惠券',res) const back_data = await userCouponList(that.queryParams)
}) console.log(back_data,'优惠券')
}, const {code,rows,total} = back_data
that.cantotal = total
if(total > 0){
that.useCouponList =rows
}
},
async getLoseCoupon() {
let that = this
const back_data = await userCouponListLose(that.loseParams)
console.log(back_data, '失效优惠券')
const {
code,
rows,
total
} = back_data
that.loseTotal = total
if (total > 0) {
that.couponLoseList = rows
}
},
initial() { initial() {
let self = this; let self = this;
switch (self.optionData.type) { switch (self.optionData.type) {
......
...@@ -14,11 +14,15 @@ ...@@ -14,11 +14,15 @@
</template> </template>
<script> <script>
import {login} from '@/api/user.js'
export default { export default {
data() { data() {
return { return {
height:0 height:0,
loginParams:{
xcxCode:''
}
} }
}, },
onLoad() { onLoad() {
...@@ -29,7 +33,7 @@ ...@@ -29,7 +33,7 @@
that.height = res.windowHeight that.height = res.windowHeight
} }
}) })
// this.getUserInfo() this.getUserInfo()
}, },
methods: { methods: {
// 1.调用微信自带登录方法获取code // 1.调用微信自带登录方法获取code
...@@ -37,29 +41,27 @@ ...@@ -37,29 +41,27 @@
let that = this let that = this
uni.login({ uni.login({
success(res) { success(res) {
that.loginParams.code = res.code console.log(res,'获取code')
that.getSessionkeyAndOpenId() that.getSessionkeyAndOpenId(res.code)
}
})
uni.getUserInfo({
success(info) {
that.signature = info.signature
that.rawData = info.rawData
} }
}) })
}, },
// 2.获取sessionKey,openId // 2.获取sessionKey,openId
async getSessionkeyAndOpenId() { async getSessionkeyAndOpenId(code) {
const res = await this.$myRequest({ const back_data = await login({xcxCode:code})
url:`/xcxLogin?appid=${this.loginParams.appid}&code=${this.loginParams.code}`, console.log(back_data,'静默登录')
})
if(res.data.code == 200){
let dataObj = JSON.parse(res.data.data)
this.sessionKey = dataObj.sessionKey
this.openid = dataObj.openid
}
}, },
// async getSessionkeyAndOpenId() {
// const res = await this.$myRequest({
// url:`/xcxLogin?appid=${this.loginParams.appid}&code=${this.loginParams.code}`,
// })
// if(res.data.code == 200){
// let dataObj = JSON.parse(res.data.data)
// this.sessionKey = dataObj.sessionKey
// this.openid = dataObj.openid
// }
// },
// 3.授权手机号登录拿到encryptedData和iv // 3.授权手机号登录拿到encryptedData和iv
getPhoneNumber(e) { getPhoneNumber(e) {
// 同意登录 // 同意登录
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<!-- // 已发布 --> <!-- // 已发布 -->
<view class="buttoncolor" v-if="subscript == '0'"> <view class="buttoncolor" v-if="subscript == '0'">
<button class="buttoncl" @click.stop="handleAgainAdd(item)">修改</button> <button class="buttoncl" @click.stop="handleAgainAdd(item)">修改</button>
<button class="buttonclde" @click.stop="abolish(1)">取消订单</button> <button class="buttonclde" @click.stop="abolish(1,item)">取消订单</button>
</view> </view>
<!-- // 已驳回 --> <!-- // 已驳回 -->
<view class="d-flex a-end j-sb" v-if="subscript == '1'"> <view class="d-flex a-end j-sb" v-if="subscript == '1'">
...@@ -81,7 +81,8 @@ ...@@ -81,7 +81,8 @@
globalData: getApp().globalData, globalData: getApp().globalData,
show: false, show: false,
title: '确认取消订单吗', title: '确认取消订单吗',
titbut: '取消订单' titbut: '取消订单',
currentId:'',//当前的id
} }
}, },
...@@ -119,7 +120,9 @@ ...@@ -119,7 +120,9 @@
}); });
}, },
// 取消订单1 立即退款2 // 取消订单1 立即退款2
abolish(val) { abolish(val,data) {
console.log(data.id,'数控')
this.currentId = data.id
if (val == 1) { if (val == 1) {
this.title = '确认取消订单吗' this.title = '确认取消订单吗'
this.titbut = '1' this.titbut = '1'
...@@ -151,7 +154,7 @@ ...@@ -151,7 +154,7 @@
}, },
// 取消订单2 立即退款3 // 取消订单2 立即退款3
aindexst(val) { aindexst(val) {
// console.log(val) this.$emit('getVal',val,this.currentId)
this.show = false this.show = false
} }
} }
......
<template> <template>
<view class="content"> <view class="content">
<com-navbar :leftIcon="false" bgColor="#fff" title="需求" :titleStyle="{ color: '#000000', fontSize: '34rpx' }" /> <com-navbar :leftIcon="false" bgColor="#fff" title="需求" :titleStyle="{ color: '#000000', fontSize: '34rpx' }" />
<view ></view> <view></view>
<view class="content-tabs" :style="{ top: `calc(${globalData.statusBarHeight}rpx + 122rpx)` }"> <view class="content-tabs" :style="{ top: `calc(${globalData.statusBarHeight}rpx + 122rpx)` }">
<view class="content-tabs-text" v-for="(v,index) in list" @click="jump(index)" :key="index"> <view class="content-tabs-text" v-for="(v,index) in list" @click="jump(index)" :key="index">
<view class="" :style="subscript == index?'color: #000000;' : 'color: #444444;'"> <view class="" :style="subscript == index?'color: #000000;' : 'color: #444444;'">
{{v.name}} {{v.name}}
</view> </view>
<view v-show="subscript == index" class="content-tabs-text-area"></view> <view v-show="subscript == index" class="content-tabs-text-area"></view>
</view> </view>
</view> </view>
<template v-if="statusNeedList && statusNeedList.length"> <template v-if="statusNeedList && statusNeedList.length">
<comindex :list="statusNeedList" class="content-mindex" :subscript='subscript'></comindex> <comindex :list="statusNeedList" class="content-mindex" :subscript='subscript' @getVal="handleStatus"></comindex>
</template> </template>
<view v-else class="diagram"> <view v-else class="diagram">
<image src="@/static/icon/qst.png" mode=""></image> <image src="@/static/icon/qst.png" mode=""></image>
<view class=""> <view class="">
暂无数据 暂无数据
</view> </view>
</view> </view>
<com-tabbar :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: 'demand' type: 'demand'
}, { }, {
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: '/pages/my/index', url: '/pages/my/index',
type: 'type' type: 'type'
}]"></com-tabbar> }]"></com-tabbar>
</view> </view>
</template> </template>
<script> <script>
import {myNeedList} from '../../api/system/index.js' import {
import apiBaseConfig from '@/config/index.js'; myNeedList,
import uniGo from '@/utils/unIGO.js'; removeOrderFunction
import comindex from '@/pages/demand/components/index.vue' } from '../../api/system/index.js'
export default { import apiBaseConfig from '@/config/index.js';
data() { import uniGo from '@/utils/unIGO.js';
return { import comindex from '@/pages/demand/components/index.vue'
imgBgUrl: apiBaseConfig.imgBgUrl, export default {
globalData: getApp().globalData, data() {
title: 'Hello', return {
arr:[], imgBgUrl: apiBaseConfig.imgBgUrl,
list: [{ globalData: getApp().globalData,
name: '已发布' title: 'Hello',
}, { arr: [],
name: '已驳回' list: [{
}, { name: '已发布'
name: '待支付' }, {
}, { name: '已驳回'
name: '已接单' }, {
}], name: '待支付'
subscript: '0', }, {
needInfo:{ name: '已接单'
pageSize:1, }],
pageNum:10, subscript: '0',//状态
status:0 needInfo: {
pageSize: 1,
pageNum: 10,
status: 0,
deleteStatus:0
}, },
statusNeedList:[] statusNeedList: []
}
},
components: {
comindex
},
onLoad(option) {
// console.log(option, 'pppppp')
if(option.id){
this.subscript = option.id
} }
this.getMyNeedList() },
}, components: {
comindex
},
onLoad(option) {
// console.log(option, 'pppppp')
if (option.id) {
this.subscript = option.id
}
this.getMyNeedList()
},
methods: { methods: {
getMyNeedList(){ getMyNeedList() {
let that = this let that = this
that.needInfo.status = that.subscript that.needInfo.status = that.subscript
myNeedList(that.needInfo).then(res=>{ myNeedList(that.needInfo).then(res => {
console.log(res,'我的需求') console.log(res, '我的需求')
if(res.code == 200){ if (res.code == 200) {
if(res.total > 0){ if (res.total > 0) {
that.statusNeedList = res.rows that.statusNeedList = res.rows
}else{ } else {
that.statusNeedList = [] that.statusNeedList = []
} }
} }
}) })
}, },
jump(ind) { jump(ind) {
let that = this let that = this
this.subscript = ind this.subscript = ind
that.getMyNeedList() that.getMyNeedList()
} },
} // 取消订单接口
} async handleCancle(id){
</script> let that = this
const back_data = await removeOrderFunction({id:id})
<style lang="scss" scoped> console.log(back_data,'取消')
.content { const {code} = back_data
display: flex; if(code == 200){
flex-direction: column; uni.showToast({
align-items: center; title:'取消成功!',
justify-content: center; icon:'none',
duration:2000,
&-tabs { success() {
display: flex; setTimeout(()=>{
justify-content: space-around; that.getMyNeedList()
width: 100%; },1000)
position: fixed; }
padding-top: 20rpx; })
padding-bottom: 20rpx; }
top: -1rpx; },
z-index: 999; // 取消订单2 立即退款3
background-color: #f3f4f6; handleStatus(val,id){
console.log(val,id,'装订好')
&-text { let that = this
>view:nth-child(1) { if(val == 2){
font-size: 24rpx; that.handleCancle(id)
} }
}
&-area { }
width: 75rpx; }
height: 6rpx; </script>
background: #2C66FF;
} <style lang="scss" scoped>
} .content {
} display: flex;
flex-direction: column;
&-mindex { align-items: center;
margin-top: 60rpx; justify-content: center;
width: 100%;
margin-bottom: 150rpx; &-tabs {
} display: flex;
} justify-content: space-around;
width: 100%;
.diagram { position: fixed;
text-align: center; padding-top: 20rpx;
margin-top: 335rpx; padding-bottom: 20rpx;
top: -1rpx;
>image { z-index: 999;
width: 396rpx; background-color: #f3f4f6;
height: 243rpx;
} &-text {
>view:nth-child(1) {
>view { font-size: 24rpx;
margin-top: 20rpx; }
font-size: 24rpx;
font-weight: 400; &-area {
color: #444444; width: 75rpx;
} height: 6rpx;
} background: #2C66FF;
}
}
}
&-mindex {
margin-top: 60rpx;
width: 100%;
margin-bottom: 150rpx;
}
}
.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>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
暂无数据 暂无数据
</view> </view>
</view> </view>
<u-loadmore iconSize="50px" @loadmore="loadMore" color="#6A6C6F" fontSize="24rpx" :nomore-text="nomoreText" :loading-text="loadingText" line :status="loadStatus" /> <u-loadmore v-if="userNeedList && userNeedList.length" iconSize="50px" @loadmore="loadMore" color="#6A6C6F" fontSize="24rpx" :nomore-text="nomoreText" :loading-text="loadingText" line :status="loadStatus" />
</view> </view>
<com-navbar :leftIcon="false" :homeShow="false" bgColor="transparent" title="首页" <com-navbar :leftIcon="false" :homeShow="false" bgColor="transparent" title="首页"
:titleStyle="{ color: '#FFFFFF', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" /> :titleStyle="{ color: '#FFFFFF', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" />
......
...@@ -84,7 +84,8 @@ export default { ...@@ -84,7 +84,8 @@ export default {
}) })
} }
}, },
actions: { actions: {
async phoneLogin({ async phoneLogin({
commit commit
}, userInfo) { }, userInfo) {
...@@ -172,29 +173,6 @@ export default { ...@@ -172,29 +173,6 @@ export default {
} }
} }
commit('upDateLoginUserMount', obj.userInfo) commit('upDateLoginUserMount', obj.userInfo)
// login(params).then(back => {
// const {
// data: dataFrom
// } = back
// // headOrNot 1团长 2消费
// const {
// headOrNot
// } = dataFrom
// let role;
// headOrNot == 1 ? role = 'head' : role = 'consumer'
// let objForm = {
// token: dataFrom.token,
// userInfo: dataFrom,
// role,
// }
// commit("login", objForm);
// })
// console.log({
// code: rev.code,
// encryptedData: obj.encryptedData,
// iv: obj.iv,
// })
// return
dealerPhoneLogin({ dealerPhoneLogin({
code: rev.code, code: rev.code,
encryptedData: obj.encryptedData, encryptedData: obj.encryptedData,
......
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