fix:修复订单bug

merge-requests/82/head
张征 2 years ago
parent 1240635f5c
commit 3137da82c3

@ -93,11 +93,14 @@
:class="!isAccount ? 'flex-column' : ''" :class="!isAccount ? 'flex-column' : ''"
> >
<el-checkbox v-model="defaultAddress"></el-checkbox> <el-checkbox v-model="defaultAddress"></el-checkbox>
<div class="address__edit--btns flex flex-middle" :class="isAccount?'clearmargin':''"> <div
class="address__edit--btns flex flex-middle"
:class="isAccount ? 'clearmargin' : ''"
>
<UiButton <UiButton
v-if="addressList[0].id && !isAccount" v-if="addressList[0].id && !isAccount"
type="grey" type="grey"
@click="isOperation = false" @click="onCanceloperation()"
>取消</UiButton >取消</UiButton
> >
<UiButton type="yellow_panel" @click="onAddAddress" <UiButton type="yellow_panel" @click="onAddAddress"
@ -206,6 +209,18 @@ export default {
this.getAddressData(); this.getAddressData();
}, },
methods: { methods: {
onCanceloperation() {
let vm = this;
vm.isOperation = false;
vm.$set(vm.selectData.area, "value", "");
vm.$set(vm.selectData.city, "value", "");
vm.$set(vm.selectData.province, "value", "");
vm.$set(vm, "detailAddress", "");
vm.$set(vm, "defaultAddress", "");
vm.$set(vm, "addressUser", "");
vm.$set(vm, "addressPhone", "");
vm.$emit("onSaveSuccess");
},
onEdit() { onEdit() {
let vm = this; let vm = this;
let curIndex = vm.addressList.findIndex( let curIndex = vm.addressList.findIndex(
@ -260,8 +275,10 @@ export default {
}, },
async onAddAddress() { async onAddAddress() {
let vm = this; let vm = this;
let curItem = vm.addressList.find((item) => item.id == vm.curAddressListItem.id); let curItem = vm.addressList.find(
console.log(vm.selectData) (item) => item.id == vm.curAddressListItem.id
);
console.log(vm.selectData);
if (!vm.selectData?.area?.code) { if (!vm.selectData?.area?.code) {
vm.$message.error("请选择所在区域~"); vm.$message.error("请选择所在区域~");
return; return;
@ -274,7 +291,7 @@ export default {
vm.$message.error("请输入收货人~"); vm.$message.error("请输入收货人~");
return; return;
} }
if (!IsPhone(vm.addressPhone)&&vm.addressPhone!=curItem.phone) { if (!IsPhone(vm.addressPhone) && vm.addressPhone != curItem.phone) {
vm.$message.error("请输入收货人手机号码~"); vm.$message.error("请输入收货人手机号码~");
return; return;
} }
@ -413,7 +430,7 @@ export default {
margin-right: 38px; margin-right: 38px;
} }
} }
.clearmargin{ .clearmargin {
margin: 0 0 0 20px; margin: 0 0 0 20px;
} }
} }

@ -55,6 +55,10 @@ export default {
cursor: pointer; cursor: pointer;
background: #ffffff; background: #ffffff;
&:hover{
box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.10000000149011612);
}
&__img { &__img {
width: 232px; width: 232px;
height: 232px; height: 232px;

@ -62,11 +62,11 @@
/> />
<span>消息</span> <span>消息</span>
<div <div
v-if="messageCount > 0" v-if="unreadCount > 0"
class="wrap-content-message__tip flex flex-center flex-middle" class="wrap-content-message__tip flex flex-center flex-middle"
:class="{ 'wrap-content-message__tip--more': messageCount > 9 }" :class="{ 'wrap-content-message__tip--more': unreadCount > 9 }"
> >
{{ messageCount }} {{ unreadCount }}
</div> </div>
</div> </div>
</template> </template>
@ -149,17 +149,19 @@ export default {
value: MENU_VALUE.LOGON_OUT, value: MENU_VALUE.LOGON_OUT,
}, },
], ],
messageCount: 0, //
}; };
}, },
computed: { computed: {
...mapState(["userInfo", "token"]), ...mapState(["userInfo", "token","unreadCount"]),
menuIcon() { menuIcon() {
return this.menuVisible return this.menuVisible
? require("~/assets/img/layout/icon-up-light.png") ? require("~/assets/img/layout/icon-up-light.png")
: require("~/assets/img/layout/icon-up.png"); : require("~/assets/img/layout/icon-up.png");
}, },
}, },
mounted() {
this.$startWebSockets()
},
methods: { methods: {
onLoginClick() { onLoginClick() {
this.$isLoginValidate(); this.$isLoginValidate();

@ -11,7 +11,7 @@
<main class="main"> <main class="main">
<h3 class="title">消息通知</h3> <h3 class="title">消息通知</h3>
<section class="section"> <section class="section">
<!-- <div class="section__item flex" v-for="item in 3" :key="item.id"> <div class="section__item flex" v-for="item in socketMsgData" :key="item.id">
<img <img
class="section__item-img" class="section__item-img"
src="https://img1.baidu.com/it/u=3384796346,381674655&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500" src="https://img1.baidu.com/it/u=3384796346,381674655&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"
@ -19,19 +19,19 @@
/> />
<div class="section__item-content flex flex-column"> <div class="section__item-content flex flex-column">
<div class="section__item-content--title flex"> <div class="section__item-content--title flex">
<span>{{ item.payload.title || `马士兵严选上新啦` }}</span> <span>{{ JSON.parse(item.payload).title || `` }}</span>
<span class="section__item-content--time">{{ <span class="section__item-content--time">{{
item.createTimeStamp item.createTimeStamp
}}</span> }}</span>
</div> </div>
<div class="section__item-content--txt"> <div class="section__item-content--txt">
{{ {{
item.payload.content || JSON.parse(item.payload).content ||
`马士兵严选上新啦!!走过路过不要错过,大家快来看看...` ``
}} }}
</div> </div>
</div> </div>
</div> --> </div>
</section> </section>
</main> </main>
</div> </div>
@ -46,7 +46,7 @@ export default {
...mapState(["token","socketMsgData"]), ...mapState(["token","socketMsgData"]),
}, },
mounted(){ mounted(){
console.log(`socketMsgData`,this.$store) console.log(`socketMsgData`,this.$store.state)
}, },
methods: {}, methods: {},
}; };

@ -52,7 +52,7 @@
<label>运费</label> <label>运费</label>
<UiMoney :money="orderInfo.shippingAmount" float/> <UiMoney :money="orderInfo.shippingAmount" float/>
</p> </p>
<p> <p v-if="orderInfo.orderStatus > 2">
<label> <label>
{{orderInfo.orderStatus == 1 ? '应付款:' : '实付款:'}} {{orderInfo.orderStatus == 1 ? '应付款:' : '实付款:'}}
</label> </label>

@ -72,7 +72,6 @@ export default {
}, },
mounted() { mounted() {
this.getTabBarVisible(); this.getTabBarVisible();
this.$startWebSockets()
}, },
methods: { methods: {
getTabBarVisible() { getTabBarVisible() {

@ -12,7 +12,7 @@ function guid() {
Vue.prototype.$startWebSockets = function () { Vue.prototype.$startWebSockets = function () {
console.log(); console.log();
let token = this.$cookies.get(TOKEN_KEY); let token = this.$cookies.get(TOKEN_KEY);
if (token) { if (token&&!Vue.prototype.Socket) {
let url = `wss://k8s-horse-gateway.mashibing.cn/ws?client=${token}&type=1`; let url = `wss://k8s-horse-gateway.mashibing.cn/ws?client=${token}&type=1`;
Vue.prototype.Socket = new WebSocket(url); Vue.prototype.Socket = new WebSocket(url);
Vue.prototype.Socket.onopen = () => { Vue.prototype.Socket.onopen = () => {
@ -48,6 +48,9 @@ Vue.prototype.$startWebSockets = function () {
// 获取消息列表 // 获取消息列表
if (msg.traceType == 2) { if (msg.traceType == 2) {
this.$store.commit("setSocketMsgData", msg.content); this.$store.commit("setSocketMsgData", msg.content);
setTimeout(()=>{
console.log(this.$store.state)
},500)
} }
// 接收消息 // 接收消息
@ -57,10 +60,6 @@ Vue.prototype.$startWebSockets = function () {
`{"traceId":"${traceId}",traceType:1,"content":{"size": 100}}` `{"traceId":"${traceId}",traceType:1,"content":{"size": 100}}`
); );
} }
setTimeout(()=>{
console.log(this.$store.state)
},500)
}; };
} }
}; };

Loading…
Cancel
Save