[fix]未发货页面状态展示

main
huyuanxiang 2 years ago
parent 0d0817e7f2
commit 24115b68c3

@ -17,4 +17,7 @@ export const editAddr = (params) => request('/erp/addrManager/edit', params, 'po
export const delAddr = (params) => request('/erp/addrManager/delete?id='+params, {} , 'delete')
export const getCode = (params) => request('/sys/randomImage/' + params, {}, 'get')
export const login = (params) => request('/sys/login', params, 'POST')
export const login = (params) => request('/sys/login', params, 'POST')
export const getStatusList = (params) => request('/erp/order/queryState', params, 'get')

@ -27,6 +27,12 @@ export const ORDER_NAVS = [
url: '',
id: 3
},
{
name: '已取消',
icon: 'icon-erji',
url: '',
id: 5
},
// {
// name: '退款/售后',
// icon: 'icon-shouhou',

@ -7,6 +7,7 @@
<text :class="'iconfont ' + item.icon" :style="'color:' + colors"></text>
</view>
<view style="color:#666">{{item.name}}</view>
<view class="pos2" v-if="item._num > 0"> {{item._num}}</view>
</view>
</view>
</view>
@ -46,6 +47,19 @@ export default {
};
</script>
<style lang="scss" scoped>
.pos2{
position: absolute;
right: 10upx;
top: 6upx;
background-color: #f94530;
color: #fff;
width: 40upx;
height: 40upx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
}
.my_order{
background-color: #fff;
margin-bottom: 20upx;
@ -55,6 +69,7 @@ export default {
align-items: center;
}
.order_btns {
position: relative;
text-align: center;
display: flex;
flex-direction: column;

@ -34,8 +34,9 @@
</view>
</template>
<script>
import { setUserInfo,setToken } from "@/utils/auth";
import { setUserInfo,setToken, getToken } from "@/utils/auth";
import { getCode, login} from '@/api/index.js'
const app = getApp()
export default {
data() {
@ -70,6 +71,12 @@ export default {
// #endif
},
onShow: function () {
if (getToken()) {
uni.reLaunch({
url: '/pages/views/tabBar/category'
})
return
}
this.setbImg(); //
this.getImgCode()
},
@ -143,6 +150,7 @@ export default {
});
},
onlogin(){ // token
if (!this.tel || !this.password || !this.yzm) {
uni.showToast({
icon:'none',
@ -162,15 +170,27 @@ export default {
})
login(params).then(res => {
const result = res.result
setToken(result.token)
setUserInfo(result.userInfo)
setTimeout(()=>{
uni.hideLoading()
if (result) {
setToken(result.token)
setUserInfo(result.userInfo)
uni.showToast({
title:'登陆成功'
})
}, 500)
uni.navigateBack(-1)
uni.navigateBack(-1)
} else {
uni.hideLoading()
uni.showToast({
title:res.message,
icon: 'none'
})
}
}).catch((e) => {
uni.hideLoading()
uni.showToast({
title:e.message,
icon: 'none'
})
})

@ -134,6 +134,7 @@ export default {
sumprice: 0,
address: null,
remark: '',
isConfirm: false,
couponList: [ //
{
money: 30,
@ -267,8 +268,14 @@ export default {
"userId": getUserInfo().id
}
console.log(params)
if (this.isConfirm) return
this.isConfirm = true
uni.showLoading({
mask: true
})
addOrder(params).then(res => {
uni.hideLoading()
this.isConfirm = false
if (res.result) {
uni.showToast({
icon: 'none',

@ -230,6 +230,10 @@ import { getUserInfo } from '@/utils/auth';
},
jumpDetails() { //
uni.showToast({
icon: "none",
title: "功能正在开发中,敬请期待"
})
return
uni.navigateTo({
url: '/pages/views/order/orderDetails?status=' + this.active

@ -65,7 +65,7 @@ import myOrder from "../../commponent/user/my-order";
import myFootprint from "../../commponent/user/my-footprint";
import myServer from "../../commponent/user/my-server";
import { ORDER_NAVS } from '../../../config/order.js'
import { getStatusList } from '@/api/index.js'
export default {
data() {
return {
@ -134,7 +134,9 @@ export default {
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {},
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
@ -154,6 +156,7 @@ export default {
let colors = app.globalData.newColor;
let oldcolor = this.colors;
let userdata = getUserInfo() || {};
this.getOrderStatus()
this.setData({
colors: colors,
userdata: userdata
@ -203,6 +206,25 @@ export default {
*/
onShareAppMessage: function () {},
methods: {
getOrderStatus() {
getStatusList({userId: getUserInfo().id}).then(res => {
const result = res.result
const obj = {
state0: result.unpaid,
state1: result.notSend,
state2: result.send,
// state3: result.complete,
// state4: result.other,
// state5: result.cancel,
}
const navs = ORDER_NAVS.slice(1).map((v, index) => {
v._num = obj['state' + v.id] || 0
return v
})
this.orderText = navs
})
},
onLogin(){
let token = getToken()
if(getToken()){

Loading…
Cancel
Save