Browse Source

内部测试版

master
zmt 3 years ago
parent
commit
812c221e51
  1. 2
      README.md
  2. 29
      nxTemp/apis/userAPI.js
  3. 16
      pages/index/index.vue
  4. 61
      pages/message/center_list.vue
  5. 35
      pages/message/detail.vue

2
README.md

@ -128,7 +128,5 @@ B组件 触发($emit)
```
{"id":148,"order_no":"SS20220209134238527851","member_id":290,"member_img":"https://thirdwx.qlogo.cn/mmopen/vi_32/0xr8AUjv3nia5XQpHpe8ibNoOe3GVuREbolOicnGBhWxxVWO0wFxjLjvPWEQehCLS5WEEyJYEWqKtNaxfbE7BDqjQ/132","member_name":"Kahing","member_phone":"13500071371","team_charge_man_name":"","score":"12","schedule_son_id":23,"is_set_score":true}
{"brand_id":63,"order_no":"SS20220209134238527851","member_id":290,"member_img":"https://thirdwx.qlogo.cn/mmopen/vi_32/0xr8AUjv3nia5XQpHpe8ibNoOe3GVuREbolOicnGBhWxxVWO0wFxjLjvPWEQehCLS5WEEyJYEWqKtNaxfbE7BDqjQ/132","member_name":"Kahing","member_phone":"13500071371","team_charge_man_name":"","score":23,"is_set_score":true,"match_id":80}
```

29
nxTemp/apis/userAPI.js

@ -113,3 +113,32 @@ export function rankOcondList(data) {
export function rankSave(data) {
return http.post(`${config.baseUrl}/gaMatchAssistant/rankData/save`,data);
}
/**
* @description: 消息中心-消息列表
* @param {*}
* brand_id, order_no , rank_data{id,val}
*/
export function msgList(data) {
return http.post(`${config.baseUrl}/matchAssistant/msgCenter/list`,data);
}
/**
* @description: 消息中心-未读消息数量
* @param {*}
* brand_id, order_no , rank_data{id,val}
*/
export function msgNum(data) {
return http.post(`${config.baseUrl}/matchAssistant/msgCenter/notReadNum`,data);
}
/**
* @description: 消息中心-消息详情
* @param {*}
* brand_id, order_no , rank_data{id,val}
*/
export function msgGet(data) {
return http.post(`${config.baseUrl}/matchAssistant/msgCenter/get`,data);
}

16
pages/index/index.vue

@ -14,7 +14,7 @@
<view class="item flex_row flex_start bg-white padding solid-bottom" @click="jumpPage('messageList')">
<image src="../../static/images/index/index_bell.png" mode=""></image>
<view class="text-m text-left">消息中心</view>
<view class="bandage">99</view>
<view class="bandage" v-if="unReadNum">{{unReadNum}}</view>
<image src="../../static/images/index/arrow_right.png" mode=""></image>
</view>
@ -33,11 +33,13 @@
</template>
<script>
import { mapState,mapActions,mapGetters } from 'vuex'
import {msgNum} from "../../nxTemp/apis/userAPI.js"
export default {
data() {
return {
address:"",
login:false
login:false,
unReadNum:""
};
},
computed:{
@ -45,7 +47,7 @@
...mapGetters(['hasLogin']),
},
onLoad(opt) {
this.updateMsgNum()
},
onUnload() {
@ -55,6 +57,14 @@
jumpPage(name){
this.$Router.push({name:name})
},
updateMsgNum(){
console.log(123);
msgNum(this.postData).then(res => {
this.unReadNum = res
}).catch(e=>{
this.$tools.showNone(e.errMsg)
})
},
async clickEvent(){
if(this.hasLogin)this.jumpPage('eventList');
else await this.$tools.showModal("该功能需要登录后才能查看,是否跳转去登录界面?",()=>{this.jumpPage('login')})

61
pages/message/center_list.vue

@ -2,34 +2,77 @@
<view class="content flex_col flex_start">
<!-- item -->
<view class="item flex_col flex_start_y bg-white padding " v-for="i in 3" @click="jumpPage('messageDetail')">
<view class="item flex_col flex_start_y bg-white padding " v-for="(i,k) in pageList" @click="jumpDetail(i)">
<view class="title flex_row flex_start">
<view class="text-m text-left">消息中心</view>
<view class="bandage"></view>
<view class="text-m text-left">{{i.msg_title}}</view>
<view class="bandage" v-if="!i.is_read"></view>
</view>
<view class="time">2020.06.22</view>
<view class="time">{{i.updated_at}}</view>
</view>
</view>
</template>
<script>
<script>
import {msgList} from "../../nxTemp/apis/userAPI.js"
export default {
data() {
return {
address:"",
login:true
login:true,
postData:{
page:1,
page_size:10
},
listLoadFinished:false,
listTotal:0,
pageList:[],
no_data_txt:"还没有任何赛事~"
};
},
onLoad(parms) {
this.updateList()
},
onUnload() {
this.resetPostData()
},
onReachBottom(){
console.log("onReachBottom");
this.updatePage()
},
methods: {
methods: {
updateList(){
if(this.listLoadFinished)return this.$tools.showNone("已加载完毕")
msgList(this.postData).then(res => {
this.$tools.showNone("已更新");
this.pageList.push(...res.list)
checkListLoadFinished(res,this);
}).catch(e=>{
this.$tools.showNone(e.errMsg)
})
function checkListLoadFinished(res,that){
if(that.pageList.length == res.total)that.listLoadFinished = true
else that.postData.page++
}
},
//
resetPostData(){
this.postData = {
page:1,
page_size:10
}
},
jumpPage(name){
this.$Router.push({name:name})
},
jumpDetail(i){
let {id,msg_optid} = i
this.$Router.push({
name:"messageDetail",
params:{
id,msg_optid
}
})
},
}
}

35
pages/message/detail.vue

@ -4,30 +4,47 @@
<!-- title -->
<view class="title_item flex_col flex_start_y bg-white padding " >
<view class="title flex_row flex_start">
<view class="text-m text-left">欧轩智能商家助手功能更新</view>
<view class="text-m text-left">{{data.msg_title}}</view>
<view class="bandage"></view>
</view>
<view class="time">2020.06.22</view>
<view class="time">{{data.updated_at}}</view>
</view>
<rich-text class="txt" :nodes="txt"></rich-text>
<rich-text class="txt" :nodes="data.msg_content"></rich-text>
</view>
</template>
<script>
<script>
import {msgGet} from "../../nxTemp/apis/userAPI.js"
export default {
data() {
return {
txt:"欧轩智能商家助手将于2020.09.16上线!欧轩智能商家助手将于2020.09.16上线!欧轩智能商家助手将于2020.09.16上线!欧轩智能商家助手将于上线欧轩智能商家助手将于上线欧轩智能商家助手将于2020.09.16上线!欧轩智能商家助手将于欧轩智能商家助手将于上线欧轩智能商家助手将于2020.09.16上线欧轩智能商家助手将于2020.09.16上线!",
login:true
txt:"",
login:true,
opts:"",
data:""
};
},
onLoad(parms) {
onLoad(opts) {
this.setOnloadOpts(opts)
this.updatePage()
},
onUnload() {
},
methods: {
methods: {
//
updatePage() {
msgGet(this.opts).then(res => {
this.data = res
}).catch(e=>{
this.$tools.showNone(e.errMsg)
})
},
setOnloadOpts(opts){
console.log("onLoad:",opts);
this.opts = opts
},
jumpPage(){
this.$Router.push({name:"login"})
},

Loading…
Cancel
Save