Merge branch 'fix/im-0526' into msb_test

feature/ad-0531-ch
ch 3 years ago
commit 3672052d81

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

@ -99,8 +99,8 @@ export default {
methods: { methods: {
getList(id) { getList(id) {
let list = this.list.filter((item) => item.id == id); let list = this.list.filter((item) => item.id == id);
console.log(`list[0]?.list`, list[0]?.list); // console.log(`list[0]?.list`, list[0]?.list);
return list[0]?.list; return list[0]?.list || [];
}, },
// //
async getCategroyData() { async getCategroyData() {

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-04 17:48:12 * @Date: 2022-05-04 17:48:12
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-04 17:53:11 * @LastEditTime: 2022-05-26 10:38:16
* @Description: file content * @Description: file content
--> -->
@ -13,28 +13,27 @@
<section class="section"> <section class="section">
<div <div
class="section__item flex" class="section__item flex"
v-for="item in socketMsgData" v-for="item in msgData"
:key="item.id" :key="item.id"
@click="handleDetail(item)"
> >
<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="item.payload.productImageUrls ? item.payload.productImageUrls[0] : require('@/assets/img/account/im/system.png')"
alt="消息通知" alt="消息通知"
/> />
<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>{{ JSON.parse(item.payload).title || `` }}</span> <span>{{ item.payload.title || `` }}</span>
<span class="section__item-content--time">{{ <span class="section__item-content--time">{{item.createTimeStamp}}</span>
item.createTimeStamp
}}</span>
</div> </div>
<div class="section__item-content--txt"> <div class="section__item-content--txt">
{{ JSON.parse(item.payload).content || `` }} {{ item.payload.content || `` }}
</div> </div>
</div> </div>
</div> </div>
<UiEmpty <UiEmpty
v-if="!socketMsgData.length" v-if="!msgData.length"
desc="暂无消息通知" desc="暂无消息通知"
:icon="require('@/assets/img/account/order/empty.png')" :icon="require('@/assets/img/account/order/empty.png')"
> >
@ -44,20 +43,42 @@
</div> </div>
</template> </template>
<script> <script>
import { mapState } from "vuex"; // import { mapState } from "vuex";
import UiEmpty from "@/components/UiEmpty.vue"; import UiEmpty from "@/components/UiEmpty.vue";
import {FormatDate} from '@/plugins/utils'
export default { export default {
components: { UiEmpty }, components: { UiEmpty },
data() { data() {
return {}; return {};
}, },
computed: { computed: {
...mapState(["token", "socketMsgData"]), msgData(){
return this.$store.state.socketMsgData.map(i => {
i.payload = JSON.parse(i.payload);
i.createTimeStamp = FormatDate(i.createTimeStamp, 'mm-dd hh:ii:ss')
return i;
}).reverse();
},
// ...mapState(["token", "socketMsgData"]),
}, },
mounted() { mounted() {
console.log(`socketMsgData`, this.$store.state); console.log(`socketMsgData`, this.$store.state);
}, },
methods: {}, methods: {
/**
* 点击详情跳转
*/
handleDetail(item){
if(['orderPay','orderDelivery','orderCancel'].includes(item.payload.customType)){
this.$router.push(`/account/order/detail?id=${item.payload.primaryId}`)
}else if(['refundFail','refundSuccess'].includes(item.payload.customType)){
this.$message.warning('请在移动端查看售后详情~');
}else if(item.payload.linkJump){
window.location.href = item.payload.linkJump;
}
}
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -87,8 +108,8 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
&-img { &-img {
width: 110px; width: 50px;
height: 110px; height: 50px;
margin-right: 20px; margin-right: 20px;
} }

@ -495,7 +495,6 @@ export default {
num: this.curBuyNum, num: this.curBuyNum,
activityType: 1, activityType: 1,
}; };
console.log(query);
this.$router.push({ this.$router.push({
path: "/order/submit", path: "/order/submit",
query, query,

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-03 23:04:45 * @Date: 2022-05-03 23:04:45
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-09 09:49:53 * @LastEditTime: 2022-05-25 17:48:31
* @Description: file content * @Description: file content
*/ */
let axios = null let axios = null
@ -31,6 +31,7 @@ export default function({app, $axios, req}) {
return Promise.reject({message:'请求出错'}); return Promise.reject({message:'请求出错'});
}); });
$axios.defaults.timeout = 3000;
axios = $axios; axios = $axios;
} }
export { axios } export { axios }

@ -2,12 +2,14 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-04 17:11:07 * @Date: 2022-05-04 17:11:07
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-10 14:30:24 * @LastEditTime: 2022-05-25 17:48:35
* @Description: file content * @Description: file content
*/ */
let axiosTk = null; let axiosTk = null;
export default function ({$axios, store, route}, inject) { export default function ({$axios, store, route}, inject) {
const $axiosTk = $axios.create(); const $axiosTk = $axios.create();
$axiosTk.defaults.timeout = 3000;
$axiosTk.onRequest( config =>{ $axiosTk.onRequest( config =>{
if(!store.state.token){ if(!store.state.token){
location.href = '/'; location.href = '/';

Loading…
Cancel
Save