优化代码
This commit is contained in:
parent
dec1fbbb39
commit
f285d03a39
|
@ -53,7 +53,7 @@ export default {
|
||||||
},
|
},
|
||||||
changeCount(e, id) {
|
changeCount(e, id) {
|
||||||
this.$emit("changeNumber", e, id);
|
this.$emit("changeNumber", e, id);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -38,16 +38,20 @@ export default {
|
||||||
list: {
|
list: {
|
||||||
url: "/wxapp/Useraddress/getalladdress",
|
url: "/wxapp/Useraddress/getalladdress",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
edit: {
|
edit: {
|
||||||
url: "/wxapp/Useraddress/applyaddress"
|
url: "/wxapp/Useraddress/applyaddress",
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
detail: {
|
detail: {
|
||||||
url: "/wxapp/Useraddress/addressinfo",
|
url: "/wxapp/Useraddress/addressinfo",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
url: "/wxapp/Useraddress/deleteaddress"
|
url: "/wxapp/Useraddress/deleteaddress",
|
||||||
|
auth: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -55,23 +59,29 @@ export default {
|
||||||
cart: {
|
cart: {
|
||||||
count: {
|
count: {
|
||||||
url: "/wxapp/order/myshoppingcarcount",
|
url: "/wxapp/order/myshoppingcarcount",
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
toCart: {
|
toCart: {
|
||||||
url: "/wxapp/order/addshoppingcar",
|
url: "/wxapp/order/addshoppingcar",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
add: {
|
add: {
|
||||||
url: "/wxapp/order/shoppingcarpush",
|
url: "/wxapp/order/shoppingcarpush",
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
sub: {
|
sub: {
|
||||||
url: "/wxapp/order/shoppingcarsend",
|
url: "/wxapp/order/shoppingcarsend",
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
url: "/wxapp/order/deleteshoppingcar",
|
url: "/wxapp/order/deleteshoppingcar",
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
url: "/wxapp/order/myshoppingcar",
|
url: "/wxapp/order/myshoppingcar",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
insurance: {
|
insurance: {
|
||||||
|
@ -96,14 +106,17 @@ export default {
|
||||||
project: {
|
project: {
|
||||||
url: "/wxapp/project/applyinfo",
|
url: "/wxapp/project/applyinfo",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
business: {
|
business: {
|
||||||
url: "/wxapp/project/applyinfob",
|
url: "/wxapp/project/applyinfob",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
afterMarket: {
|
afterMarket: {
|
||||||
url: "/wxapp/project/applyguarantee",
|
url: "/wxapp/project/applyguarantee",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
distribution: {
|
distribution: {
|
||||||
config: {
|
config: {
|
||||||
|
@ -113,10 +126,12 @@ export default {
|
||||||
url: "/wxapp/index/getallcar"
|
url: "/wxapp/index/getallcar"
|
||||||
},
|
},
|
||||||
submit: {
|
submit: {
|
||||||
url: "/wxapp/project/distribution"
|
url: "/wxapp/project/distribution",
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
pay: {
|
pay: {
|
||||||
url: "/wxapp/wxpay/payorderd"
|
url: "/wxapp/wxpay/payorderd",
|
||||||
|
auth: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -124,33 +139,40 @@ export default {
|
||||||
pay: {
|
pay: {
|
||||||
url: "/wxapp/wxpay/payordera",
|
url: "/wxapp/wxpay/payordera",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
createOrder: {
|
createOrder: {
|
||||||
url: "/wxapp/order/submitordera",
|
url: "/wxapp/order/submitordera",
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
createDemandOrder: {
|
createDemandOrder: {
|
||||||
url: "/wxapp/orderb/addorder"
|
url: "/wxapp/orderb/addorder",
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
// 购买订单
|
// 购买订单
|
||||||
t1: {
|
t1: {
|
||||||
url: "/wxapp/order/getmyorder",
|
url: "/wxapp/order/getmyorder",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
// 报/议价订单
|
// 报/议价订单
|
||||||
t2: {
|
t2: {
|
||||||
url: "/wxapp/orderb/getmyorderblist",
|
url: "/wxapp/orderb/getmyorderblist",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
// 货运订单
|
// 货运订单
|
||||||
t3: {
|
t3: {
|
||||||
url: "/wxapp/project/freightorder",
|
url: "/wxapp/project/freightorder",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
// 退款订单
|
// 退款订单
|
||||||
t4: {
|
t4: {
|
||||||
url: "/wxapp/order/getmyorder",
|
url: "/wxapp/order/getmyorder",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
detail: {
|
detail: {
|
||||||
|
@ -158,6 +180,7 @@ export default {
|
||||||
t1: {
|
t1: {
|
||||||
url: "/user/workerorderb/orderinfo",
|
url: "/user/workerorderb/orderinfo",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
|
auth: true,
|
||||||
},
|
},
|
||||||
// 报/议价订单
|
// 报/议价订单
|
||||||
t2: {
|
t2: {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="immerse-main" :style="{ paddingTop: safePt + utils.rpx2px(20) + 'px' }">
|
<view class="immerse-main" :style="{ paddingTop: safePt + utils.rpx2px(20) + 'px' }">
|
||||||
<view class="head-title">
|
<view class="head-title">
|
||||||
<text class="title">熊熊建材安装<text class="color">师傅版</text></text>
|
<text class="title">熊熊建材安装<text class="color">用户版</text></text>
|
||||||
<text class="desc">将好师傅交给用户让好服务走进万家</text>
|
<text class="desc">将好师傅交给用户让好服务走进万家</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="section">
|
<view class="section">
|
||||||
|
|
|
@ -57,11 +57,14 @@ export default {
|
||||||
...mapState({
|
...mapState({
|
||||||
indexCateId: (state) => state.system.indexCateId,
|
indexCateId: (state) => state.system.indexCateId,
|
||||||
cartCount: (state) => state.cart.count,
|
cartCount: (state) => state.cart.count,
|
||||||
|
isLogin: (state) => state.user.token.length > 0,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
async onLoad() {
|
async onLoad() {
|
||||||
let pageConfig = getApp().globalData.pageConfig;
|
let pageConfig = getApp().globalData.pageConfig;
|
||||||
this.$store.dispatch("cart/updateCount");
|
if (this.isLogin) {
|
||||||
|
this.$store.dispatch("cart/updateCount");
|
||||||
|
}
|
||||||
|
|
||||||
let x = pageConfig.windowWidth - this.$utils.rpx2px(94);
|
let x = pageConfig.windowWidth - this.$utils.rpx2px(94);
|
||||||
let y = pageConfig.windowHeight - this.$utils.rpx2px(94);
|
let y = pageConfig.windowHeight - this.$utils.rpx2px(94);
|
||||||
|
|
|
@ -48,12 +48,15 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
cartCount: (state) => state.cart.count,
|
cartCount: (state) => state.cart.count,
|
||||||
|
isLogin: (state) => state.user.token.length > 0,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.pageConfig = getApp().globalData.pageConfig;
|
this.pageConfig = getApp().globalData.pageConfig;
|
||||||
this.$store.dispatch("cart/updateCount");
|
if (this.isLogin) {
|
||||||
this.$store.dispatch("cart/briefCart");
|
this.$store.dispatch("cart/updateCount");
|
||||||
|
this.$store.dispatch("cart/briefCart");
|
||||||
|
}
|
||||||
|
|
||||||
if (!e.id) {
|
if (!e.id) {
|
||||||
this.$utils.toast("参数错误");
|
this.$utils.toast("参数错误");
|
||||||
|
|
|
@ -4,7 +4,10 @@ export default {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
state: {
|
||||||
count: 0,
|
count: 0,
|
||||||
briefCart: {},
|
briefCart: {
|
||||||
|
ids: [],
|
||||||
|
list: {},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
getters: {},
|
getters: {},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
|
Loading…
Reference in New Issue