orderDetail

This commit is contained in:
““shijing 2021-08-26 16:47:56 +08:00
parent 415aee3070
commit 353114b6a6
7 changed files with 514 additions and 84 deletions

View File

@ -44,7 +44,7 @@ const install = (Vue, vm) => {
let tjfk = (params={})=>vm.$u.post('index.php/api/order/payment_voucher', params);//提交付款凭证 let tjfk = (params={})=>vm.$u.post('index.php/api/order/payment_voucher', params);//提交付款凭证
let getCode = (id)=>vm.$u.get(`/index.php/api/login/getnum/type/mobphone/to/${id}`);//获取注册码 let getCode = (id)=>vm.$u.get(`/index.php/api/login/getnum/type/mobphone/to/${id}`);//获取注册码
let register = (params={})=>vm.$u.post('/index.php/api/login/reg', params);//注册 let register = (params={})=>vm.$u.post('/index.php/api/login/reg', params);//注册
let getCodeRepass = (id)=>vm.$u.get(`/index.php/api/login/getpwdnum/type/mobphone/to/${id}`);//获取验证码 let getCodeRepass = (id,params)=>vm.$u.get(`/index.php/api/login/getpwdnum/type/mobphone/to/${id}`,params);//获取验证码
let changepwd = ( params)=>vm.$u.post(`/index.php/api/login/changepwd`, params);//修改密码 let changepwd = ( params)=>vm.$u.post(`/index.php/api/login/changepwd`, params);//修改密码
vm.$u.api = { vm.$u.api = {

View File

@ -152,6 +152,15 @@
"backgroundColorTop":"#f3f3f3", "backgroundColorTop":"#f3f3f3",
"backgroundColorBottom":"#ffffff" "backgroundColorBottom":"#ffffff"
} }
},{
"path" : "pages/user/order_list/orderDetail",
"style" : {
"enablePullDownRefresh": true,
"navigationBarTitleText":"订单详情",
"navigationBarBackgroundColor":"#f8f8f8",
"backgroundColorTop":"#f3f3f3",
"backgroundColorBottom":"#ffffff"
}
} }
,{ ,{
"path" : "pages/user/setting/setting", "path" : "pages/user/setting/setting",

View File

@ -17,7 +17,7 @@
<input placeholder="请输入验证码" v-model="code" placeholder-style="color: rgba(255,255,255,0.8);"/> <input placeholder="请输入验证码" v-model="code" placeholder-style="color: rgba(255,255,255,0.8);"/>
</view> </view>
<view class="password"> <view class="password">
<input placeholder="请输入密码" v-model="passwd" password=true placeholder-style="color: rgba(255,255,255,0.8);"/> <input placeholder="请输入密码" v-model="password" password=true placeholder-style="color: rgba(255,255,255,0.8);"/>
</view> </view>
<view class="btn" @tap="doReg">立即注册</view> <view class="btn" @tap="doReg">立即注册</view>
<view class="res"> <view class="res">
@ -36,7 +36,7 @@
phoneNumber:"", phoneNumber:"",
userName:"", userName:"",
code:'', code:'',
passwd:"", password:"",
getCodeText:'获取验证码', getCodeText:'获取验证码',
getCodeBtnColor:"#ffffff", getCodeBtnColor:"#ffffff",
getCodeisWaiting:false getCodeisWaiting:false
@ -103,38 +103,24 @@
}) })
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: function (loginRes) { success: function (wxLoginRes) {
let params = {username:that.userName,mobphone:that.phoneNumber,code:loginRes.code,phone_code:that.code}; let params = {username:that.userName,mobphone:that.phoneNumber,code:wxLoginRes.code,phone_code:that.code,password:that.password};
that.$u.api.register(params).then(res=>{ that.$u.api.register(params).then(registerRes=>{
uni.hideLoading(); uni.hideLoading();
debugger; debugger;
if(res.code===0){ if(registerRes.code===0){
uni.reLaunch({ that.toLogin();
url:'/pages/tabBar/home/home'
})
that.$u.vuex('vuex_token', res.data.token)
that.$u.api.getInfo().then(res => {
that.$u.vuex('vuex_user', res.data)
if(res.data.icon===""){
that.$u.vuex('vuex_user.icon', '/static/img/face.jpg')
}else{
that.$u.vuex('vuex_user.icon', that.vuex_host + 'public/' + res.data.icon)
}
})
}else{} }else{}
console.log(res)
}) })
}, },
}) })
//使 //使
// setTimeout(()=>{ // setTimeout(()=>{
// uni.getStorage({ // uni.getStorage({
// key: 'UserList', // key: 'UserList',
// success:(res)=>{ // success:(res)=>{
// //md5 // //md5
// res.data.push({username:this.phoneNumber,passwd:md5(this.passwd)}) // res.data.push({username:this.phoneNumber,password:md5(this.password)})
// uni.setStorage({ // uni.setStorage({
// key: 'UserList', // key: 'UserList',
// data: res.data, // data: res.data,
@ -153,7 +139,7 @@
// //UserList // //UserList
// uni.setStorage({ // uni.setStorage({
// key: 'UserList', // key: 'UserList',
// data: [{username:this.phoneNumber,passwd:md5(this.passwd)}], // data: [{username:this.phoneNumber,password:md5(this.password)}],
// success: function () { // success: function () {
// uni.hideLoading() // uni.hideLoading()
// uni.showToast({title: '',icon:"success"}); // uni.showToast({title: '',icon:"success"});

View File

@ -96,56 +96,43 @@
uni.hideLoading(); uni.hideLoading();
debugger; debugger;
if(res.code===0){ if(res.code===0){
uni.reLaunch({ that.toLogin();
url:'/pages/tabBar/home/home'
})
that.$u.vuex('vuex_token', res.data.token)
that.$u.api.getInfo().then(res => {
that.$u.vuex('vuex_user', res.data)
if(res.data.icon===""){
that.$u.vuex('vuex_user.icon', '/static/img/face.jpg')
}else{
that.$u.vuex('vuex_user.icon', that.vuex_host + 'public/' + res.data.icon)
}
})
}else{} }else{}
console.log(res)
}) })
//使 //使
setTimeout(()=>{ // setTimeout(()=>{
uni.getStorage({ // uni.getStorage({
key: 'UserList', // key: 'UserList',
success: (res)=>{ // success: (res)=>{
uni.hideLoading() // uni.hideLoading()
for(let i in res.data){ // for(let i in res.data){
let row = res.data[i]; // let row = res.data[i];
if(row.username==this.phoneNumber){ // if(row.username==this.phoneNumber){
//md5 // //md5
res.data[i].passwd = md5(this.passwd); // res.data[i].passwd = md5(this.passwd);
uni.setStorage({ // uni.setStorage({
key: 'UserList', // key: 'UserList',
data: res.data, // data: res.data,
success: function () { // success: function () {
uni.showToast({title: '密码已重置',icon:"success"}); // uni.showToast({title: '',icon:"success"});
setTimeout(()=>{ // setTimeout(()=>{
uni.navigateBack(); // uni.navigateBack();
},1000) // },1000)
} // }
}); // });
return ; // return ;
} // }
} // }
uni.showToast({title: '手机号码未注册',icon:"none"}); // uni.showToast({title: '',icon:"none"});
}, // },
fail:function(e){ // fail:function(e){
uni.hideLoading() // uni.hideLoading()
uni.showToast({title: '手机号码未注册',icon:"none"}); // uni.showToast({title: '',icon:"none"});
} // }
}); // });
},1000) // },1000)
} }

View File

@ -84,7 +84,6 @@
</view> </view>
<view class="text">{{row.text}}</view> <view class="text">{{row.text}}</view>
</view> </view>
<view @click="changePwd">修改密码</view>
</view> </view>
</view> </view>
<!-- 占位 --> <!-- 占位 -->
@ -206,11 +205,6 @@
} }
}, },
changePwd(){
uni.navigateTo({
url:'/pages/login/login'
})
},
toMyQR(){ toMyQR(){
uni.navigateTo({ uni.navigateTo({
url:'../../user/myQR/myQR' url:'../../user/myQR/myQR'

View File

@ -0,0 +1,436 @@
<template>
<view>
<!-- <view class="block">订单信息:</view> -->
<view class="block">
<view class="nominal">订单状态:</view>
<view style="margin-left:auto">
<uni-tag v-if="row.pay_status==0" text='待付款' :inverted="true" type="default" size="small"></uni-tag>
<uni-tag v-if="row.pay_status==2" text='付款确认失败' :inverted="true" type="error" size="small"></uni-tag>
<uni-tag style="margin-left:4upx" v-if="row.pay_status==1 && row.shipping_status==0" text='待发货' :inverted="true" type="default" size="small"></uni-tag>
<uni-tag style="margin-left:4upx" v-if="row.invoice_status==2 && row.if_invoice!=0" text='待开票' :inverted="true" type="default" size="small"></uni-tag>
<uni-tag style="margin-left:4upx" v-if="row.shipping_status==1 && row.receive_status==0" text='待收货' :inverted="true" type="default" size="small"></uni-tag>
<uni-tag style="margin-left:4upx" v-if="row.receive_status>0" text="已完成" :inverted="true"type="default" size="small"></uni-tag>
</view>
</view>
<view class="block">
<view class="marginBottom20"> <view class="buyer">{{row.linkman}}</view> {{row.telphone}}</view>
<view class="grayColor address"> 地址{{row.address}}</view>
</view>
<view class="block">
<view class="order-info" v-for="row in row.shop_db" v-bind:key="row.id" @click="toGoods(row)">
<view class="left">
<image :src="row.picurl"></image>
</view>
<view class="right">
<view class="name">
{{row.full_title}}
</view>
<view class="price-number">
<view class="number">数量{{row._num}}</view>
<view class="price">单价<text style="font-size: 26upx;">{{row._price}}</text></view>
</view>
</view>
</view>
</view>
<view class="block">
<view class="marginBottom20"><view class="grayColor">订单编号:</view>{{row.order_sn}}</view>
<view><view class="grayColor">下单时间:</view>{{row.create_time}}</view>
</view>
<view class="block">
<view :class="[row.if_invoice!==0?'marginBottom20':'']"><view class="grayColor">发票类型:</view> <text v-if="row.if_invoice==0"></text> <text v-else-if="row.if_invoice==1">普票</text> <text v-else>专票</text></view>
<view v-if="row.if_invoice!==0"><view class="grayColor">开票状态:</view> <text v-if="row.invoice_status==1" style="color:green">已开</text><text v-else style="color:gray">待开</text></view>
</view>
<view class="block">
<view class="marginBottom20 flexSpaceBetween"><view class="grayColor">商品总额:</view><text>{{goodMoney}}</text></view>
<view class="marginBottom20 flexSpaceBetween"><view class="grayColor">运费:</view><text>{{row.real_freight}}</text></view>
<view class="marginBottom20" style="text-align: right;"><text>合计:</text><text style="color: red;font-weight: bold;">{{row.totalmoney}}</text></view>
<view class="btns">
<view class="default" @tap="cancelOrder" v-if="row.pay_status!=0&&row.shipping_status==0">取消订单</view>
<view class="pay" @tap="toUppay" v-if="row.pay_status==0||row.pay_status==2">上传付款凭证</view></block>
<view class="default" @tap="qrsh" v-if="row.shipping_status==1 && row.receive_status==0">确认收货</view>
<view class="default" @tap="seeImg" v-if="row.voucher_url!=''">查看付款</view>
<view class="primary" @tap="applayInvoice" v-if="row.if_invoice==0&&row.voucher_url==''">提交开票</view>
<view class="primary" @tap="qrfp" v-if="row.invoice_status ==1 && row.receive_invoice_status ==0">确认收票</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
amount: 0,
goodMoney:0.00,
orderName: '',
paytype: 'alipay', //
imageValue: [],
row: {},
count: 1,
name: 'file',
url: '',
filepath: [],
rpath:[]
};
},
onLoad(e) {
uni.getStorage({
key: 'orderDetail',
success: (res) => {
// debugger;
let row = JSON.parse(res.data);
this.row = row;
this.goodMoney = (row.totalmoney-row.real_freight).toFixed(2)
this.url = this.vuex_host +
'index.php/index/attachment/upload?dir=images&from=base64&module=index'
}
})
},
methods: {
toGoods(row) {
uni.navigateTo({
url: '../../goods/goods?id='+row.id
});
},
doDeposit() {
///
uni.showLoading({
title: '支付中...'
});
setTimeout(() => {
uni.hideLoading();
uni.showToast({
title: '支付成功'
});
setTimeout(() => {
uni.redirectTo({
url: '../../pay/success/success?amount=' + this.amount
});
}, 300);
}, 700)
},
cancelOrder(){
var that = this
uni.showModal({
content: '确认取消订单吗?',
success: function (res) {
if (res.confirm) {
that.$u.api.qxdd(this.row).then(res=>{
uni.showToast({
title: '取消成功',
icon:'none'
});
})
}
}
});
},
qrsh(){
var that = this
uni.showModal({
content: '确认收货吗?',
success: function (res) {
if (res.confirm) {
that.$u.api.qrsh(this.row.id).then(res=>{
uni.showToast({
title: '确认成功',
icon:'none'
});
})
}
}
});
},
seeImg(){
let urls = this.row.voucher_url.split(',')
for(var i=0;i<urls.length;i++){
urls[i] = this.vuex_host + '/public/' + urls[i];
}
uni.previewImage({
current:urls[0],
urls: urls
});
},
applayInvoice(){
uni.showLoading({
title:'正在获取订单...'
})
setTimeout(()=>{
uni.setStorage({
key:'paymentOrder',
data:this.row,
success: () => {
uni.hideLoading();
uni.navigateTo({
url:'/pages/invoice/apply'
})
}
})
},500)
},
toUppay(){
uni.showLoading({
title:'正在获取订单...'
})
setTimeout(()=>{
uni.setStorage({
key:'paymentOrder',
data:this.row,
success: () => {
uni.hideLoading();
uni.navigateTo({
url:'../../pay/payment/uppayment'
})
}
})
},500)
},
}
}
</script>
<style lang="scss">
page{
background: #f9f9f9;
}
.block {
width: 94%;
box-sizing: border-box;
background: #ffffff;
margin: 0 3% 10px;
padding: 30upx 20upx;
border-radius: 10px;
font-size: 28upx;
.marginBottom20{
margin-bottom: 20upx;
}
.flexSpaceBetween{
display: flex;
justify-content: space-between;
}
.buyer{
color: #000000;
font-weight: bold;
margin-right: 10px;
display: inline-block;
}
.grayColor{
display: inline-block;
margin-right: 20upx;
font-size: 26upx;
color:#666666;
width: 130rpx;
}
.address{
width: 100%;
}
.title {
width: 100%;
font-size: 34upx;
}
.content {
.nominal {
color: gray;
}
.orderinfo {
width: 100%;
border-bottom: solid 1upx #eee;
.order-info {
width: 100%;
display: flex;
margin-top: 4upx;
.left {
flex-shrink: 0;
width: 25vw;
height: 20vw;
image {
width: 25vw;
height: 20vw;
border-radius: 10upx;
}
}
.right {
width: 100%;
margin-left: 10upx;
position: relative;
.name {
width: 100%;
font-size: 28upx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.spec {
color: #a7a7a7;
font-size: 22upx;
}
.price-number {
position: absolute;
bottom: 0;
width: 100%;
display: flex;
justify-content: flex-end;
font-size: 22upx;
color: #333;
display: flex;
align-items: flex-end;
.price {
font-size: 24upx;
margin-right: 5upx;
}
}
}
}
}
.pay-list {
width: 100%;
border-bottom: solid 1upx #eee;
.row {
width: 100%;
height: 120upx;
display: flex;
align-items: center;
.left {
width: 100upx;
flex-shrink: 0;
display: flex;
align-items: center;
image {
width: 80upx;
height: 80upx;
}
}
.center {
width: 100%;
font-size: 30upx;
}
.right {
width: 100upx;
flex-shrink: 0;
display: flex;
justify-content: flex-end;
}
}
}
}
}
.order-info{
width: 100%;
display: flex;
margin-top: 4upx;
.left{
flex-shrink: 0;
width: 25vw;
height: 20vw;
image{
width: 25vw;
height: 20vw;
border-radius: 10upx;
}
}
.right{
width: 100%;
margin-left: 10upx;
position: relative;
.name{
width: 100%;
font-size: 28upx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.spec{
color: #a7a7a7;
font-size: 22upx;
}
.price-number{
position: absolute;
bottom: 0;
width: 100%;
// display: flex;
// justify-content: flex-end;
font-size: 22upx;
color: #333;
// display: flex;
// align-items: flex-end;
.price{
color: #333333;
font-size: 24upx;
margin-right: 5upx;
}
}
}
}
.detail{
display: flex;
justify-content: flex-end;
align-items: flex-end;
height: 46upx;
font-size: 26upx;
.sum{
padding: 0 8upx;
display: flex;
align-items: flex-end;
.price{
font-size: 30upx;
}
}
}
.btns{
height: 80upx;
display: flex;
align-items: center;
justify-content: flex-end;
view{
min-width: 120upx;
height: 50upx;
padding: 0 20upx;
border-radius: 30upx;
display: flex;
justify-content: center;
align-items: center;
font-size: 28upx;
margin-left: 20upx;
}
.default{
border: solid 1upx #ccc;
color: #666;
}
.primary{
border: solid 1upx #0055ff;
color: #0055ff;
}
.pay{
border: solid 1upx #ec652f;
color: #ec652f;
}
}
</style>

View File

@ -21,13 +21,13 @@
<span v-if="row.if_invoice==0" style="color:darkblue">不开票</span> <span v-if="row.if_invoice==0" style="color:darkblue">不开票</span>
<span v-else-if="row.if_invoice==1" > <span v-else-if="row.if_invoice==1" >
<text style="color:darkblue">普票</text> <text style="color:darkblue">普票</text>
<!-- <text v-if="row.invoice_status==1" style="color:green">(已开)</text> <text v-if="row.invoice_status==1" style="color:green">(已开)</text>
<text v-else style="color:gray">(待开)</text> --> <text v-else style="color:gray">(待开)</text>
</span> </span>
<span v-else> <span v-else>
<text style="color:darkblue">专票</text> <text style="color:darkblue">专票</text>
<!-- <text v-if="row.invoice_status==1" style="color:green">(已开)</text> <text v-if="row.invoice_status==1" style="color:green">(已开)</text>
<text v-else style="color:gray">(待开)</text> --> <text v-else style="color:gray">(待开)</text>
</span> </span>
<view style="margin-left:auto"> <view style="margin-left:auto">
<uni-tag v-if="row.pay_status==0" text='待付款' :inverted="true" type="default" size="small"></uni-tag> <uni-tag v-if="row.pay_status==0" text='待付款' :inverted="true" type="default" size="small"></uni-tag>
@ -39,7 +39,7 @@
</view> </view>
</view> </view>
<view class="order-info" v-for="row in row.shop_db" v-bind:key="row.id"> <view class="order-info" v-for="row in row.shop_db" v-bind:key="row.id" @click="orderDetail(row,index)">
<view class="left"> <view class="left">
<image :src="row.picurl"></image> <image :src="row.picurl"></image>
</view> </view>
@ -56,12 +56,13 @@
</view> </view>
<view style="text-align: right;"> <view style="text-align: right;">
<view class="number" style="font-size: 24upx;">收货人:{{row.linkman}} {{row.telphone}} {{row.address}}</view> <!-- <view class="number" style="font-size: 24upx;">收货人:{{row.linkman}} {{row.telphone}} {{row.address}}</view> -->
<view class="number" style="font-size: 24upx;">订单号:{{row.order_sn}}<span style="color:red">|{{row.create_time}}</span></view> <view class="number" style="font-size: 24upx;">收货人:{{row.linkman}} {{row.telphone}}</view>
<!-- <view class="number" style="font-size: 24upx;">订单号:{{row.order_sn}}<span style="color:red">|{{row.create_time}}</span></view> -->
</view> </view>
<view class="detail"> <!-- <view class="detail">
<view class="number">{{row.shop_db.length}}件商品</view><view class="sum">合计<view class="price">{{row.totalmoney}}</view></view><view class="nominal">(含运费 {{row.real_freight}})</view> <view class="number">{{row.shop_db.length}}件商品</view><view class="sum">合计<view class="price">{{row.totalmoney}}</view></view><view class="nominal">(含运费 {{row.real_freight}})</view>
</view> </view> -->
<view class="btns"> <view class="btns">
<view class="default" @tap="cancelOrder(row.id, index)" v-if="row.pay_status!=0&&row.shipping_status==0">取消订单</view> <view class="default" @tap="cancelOrder(row.id, index)" v-if="row.pay_status!=0&&row.shipping_status==0">取消订单</view>
<view class="pay" @tap="toUppay(row)" v-if="row.pay_status==0||row.pay_status==2">上传付款凭证</view></block> <view class="pay" @tap="toUppay(row)" v-if="row.pay_status==0||row.pay_status==2">上传付款凭证</view></block>
@ -325,6 +326,23 @@
} }
}) })
},500) },500)
},
orderDetail(row,index){
uni.showLoading({
title:'正在获取订单...'
})
setTimeout(()=>{
uni.setStorage({
key:'orderDetail',
data:JSON.stringify(this.list[index]),
success: () => {
uni.hideLoading();
uni.navigateTo({
url:'./orderDetail'
})
}
})
},500)
} }
} }
} }