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

main
huyuanxiang 2 years ago
parent 0d0817e7f2
commit 24115b68c3

@ -18,3 +18,6 @@ export const delAddr = (params) => request('/erp/addrManager/delete?id='+params,
export const getCode = (params) => request('/sys/randomImage/' + params, {}, 'get') 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: '', url: '',
id: 3 id: 3
}, },
{
name: '已取消',
icon: 'icon-erji',
url: '',
id: 5
},
// { // {
// name: '退款/售后', // name: '退款/售后',
// icon: 'icon-shouhou', // icon: 'icon-shouhou',

@ -7,6 +7,7 @@
<text :class="'iconfont ' + item.icon" :style="'color:' + colors"></text> <text :class="'iconfont ' + item.icon" :style="'color:' + colors"></text>
</view> </view>
<view style="color:#666">{{item.name}}</view> <view style="color:#666">{{item.name}}</view>
<view class="pos2" v-if="item._num > 0"> {{item._num}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -46,6 +47,19 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <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{ .my_order{
background-color: #fff; background-color: #fff;
margin-bottom: 20upx; margin-bottom: 20upx;
@ -55,6 +69,7 @@ export default {
align-items: center; align-items: center;
} }
.order_btns { .order_btns {
position: relative;
text-align: center; text-align: center;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

@ -34,8 +34,9 @@
</view> </view>
</template> </template>
<script> <script>
import { setUserInfo,setToken } from "@/utils/auth"; import { setUserInfo,setToken, getToken } from "@/utils/auth";
import { getCode, login} from '@/api/index.js' import { getCode, login} from '@/api/index.js'
const app = getApp()
export default { export default {
data() { data() {
@ -70,6 +71,12 @@ export default {
// #endif // #endif
}, },
onShow: function () { onShow: function () {
if (getToken()) {
uni.reLaunch({
url: '/pages/views/tabBar/category'
})
return
}
this.setbImg(); // this.setbImg(); //
this.getImgCode() this.getImgCode()
}, },
@ -143,6 +150,7 @@ export default {
}); });
}, },
onlogin(){ // token onlogin(){ // token
if (!this.tel || !this.password || !this.yzm) { if (!this.tel || !this.password || !this.yzm) {
uni.showToast({ uni.showToast({
icon:'none', icon:'none',
@ -162,15 +170,27 @@ export default {
}) })
login(params).then(res => { login(params).then(res => {
const result = res.result const result = res.result
setToken(result.token) if (result) {
setUserInfo(result.userInfo) setToken(result.token)
setTimeout(()=>{ setUserInfo(result.userInfo)
uni.hideLoading()
uni.showToast({ uni.showToast({
title:'登陆成功' 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, sumprice: 0,
address: null, address: null,
remark: '', remark: '',
isConfirm: false,
couponList: [ // couponList: [ //
{ {
money: 30, money: 30,
@ -267,8 +268,14 @@ export default {
"userId": getUserInfo().id "userId": getUserInfo().id
} }
console.log(params) if (this.isConfirm) return
this.isConfirm = true
uni.showLoading({
mask: true
})
addOrder(params).then(res => { addOrder(params).then(res => {
uni.hideLoading()
this.isConfirm = false
if (res.result) { if (res.result) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',

@ -230,6 +230,10 @@ import { getUserInfo } from '@/utils/auth';
}, },
jumpDetails() { // jumpDetails() { //
uni.showToast({
icon: "none",
title: "功能正在开发中,敬请期待"
})
return return
uni.navigateTo({ uni.navigateTo({
url: '/pages/views/order/orderDetails?status=' + this.active 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 myFootprint from "../../commponent/user/my-footprint";
import myServer from "../../commponent/user/my-server"; import myServer from "../../commponent/user/my-server";
import { ORDER_NAVS } from '../../../config/order.js' import { ORDER_NAVS } from '../../../config/order.js'
import { getStatusList } from '@/api/index.js'
export default { export default {
data() { data() {
return { 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 colors = app.globalData.newColor;
let oldcolor = this.colors; let oldcolor = this.colors;
let userdata = getUserInfo() || {}; let userdata = getUserInfo() || {};
this.getOrderStatus()
this.setData({ this.setData({
colors: colors, colors: colors,
userdata: userdata userdata: userdata
@ -203,6 +206,25 @@ export default {
*/ */
onShareAppMessage: function () {}, onShareAppMessage: function () {},
methods: { 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(){ onLogin(){
let token = getToken() let token = getToken()
if(getToken()){ if(getToken()){

Loading…
Cancel
Save