Merge branch 'feature/task1.0.0-0507-zz' into feature/task1.0.0

merge-requests/82/head
张征 3 years ago
commit 30e2d194fa

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

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

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

@ -11,7 +11,7 @@
<main class="main">
<h3 class="title">消息通知</h3>
<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
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"
@ -19,19 +19,19 @@
/>
<div class="section__item-content flex flex-column">
<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">{{
item.createTimeStamp
}}</span>
</div>
<div class="section__item-content--txt">
{{
item.payload.content ||
`马士兵严选上新啦!!走过路过不要错过,大家快来看看...`
JSON.parse(item.payload).content ||
``
}}
</div>
</div>
</div> -->
</div>
</section>
</main>
</div>
@ -46,7 +46,7 @@ export default {
...mapState(["token","socketMsgData"]),
},
mounted(){
console.log(`socketMsgData`,this.$store)
console.log(`socketMsgData`,this.$store.state)
},
methods: {},
};

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

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

@ -12,7 +12,7 @@ function guid() {
Vue.prototype.$startWebSockets = function () {
console.log();
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`;
Vue.prototype.Socket = new WebSocket(url);
Vue.prototype.Socket.onopen = () => {
@ -48,6 +48,9 @@ Vue.prototype.$startWebSockets = function () {
// 获取消息列表
if (msg.traceType == 2) {
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}}`
);
}
setTimeout(()=>{
console.log(this.$store.state)
},500)
};
}
};

Loading…
Cancel
Save