Commit ea4878b3 authored by June_Q's avatar June_Q

fix:已知bug

parent 09ecf4df
......@@ -56,3 +56,13 @@ export function newsDel(id) {
needMask: true
})
}
/**
* 获取未读消息数量
*/
export function unReadCounts() {
return request({
url: 'zsxcx/getInformationNoCountZS.htm',
method: 'post'
})
}
......@@ -235,8 +235,8 @@ export default {
try{
const skuData = this.skuData
console.log(skuData)
if(skuData.length === 0) return
if(this.totalCounts === 0) return this.$toast({title: '请选择购买数量'})
if(!skuData.length) return
if(!this.totalCounts) return this.$toast({title: '请选择购买数量'})
if(!this.judgePay(skuData)) return this.$toast({title: '购买数量不能少于起购数量'})
const sku_ids = []
const cart_numbers = []
......
......@@ -56,7 +56,7 @@ export default {
const max = this.max
const min = this.min
const newVal_number = ~~newVal
if(max && newVal_number >= max) return
if(max && newVal_number > max) return
if(newVal_number < min) return
this.$emit('change', {
params: this.params,
......
const env = {
release: 'https://www.gelifood.com', // 正式版
trial: 'https://www.gelifood.com', // 体验版
develop: 'https://d.gelifood.com' // 开发版
develop: 'https://www.gelifood.com' // 开发版
}
// 不考虑其他端小程序直接这样配置
......
......@@ -54,7 +54,7 @@
"setting" : {
"urlCheck" : false,
"es6" : true,
"postcss" : false,
"postcss" : true,
"minified" : true
},
"usingComponents" : true,
......
......@@ -83,13 +83,16 @@
<!-- 功能与服务 -->
<view class="server-wrap">
<view class="title font-28 font-bold pt-3">功能与服务</view>
<!-- <view
<view
class="server-item font-28 flex j-between a-center py-3"
@click="nav('news')"
>
<text>消息中心</text>
<icon class="right_arrow" />
</view> -->
<view class="flex j-end a-center">
<text class="mr-1 primaryColor" v-show="unReadNewsNum">{{unReadNewsNum}}</text>
<icon class="right_arrow" />
</view>
</view>
<view
class="server-item font-28 flex j-between a-center py-3"
@click="phoneCall"
......@@ -123,6 +126,7 @@ import { baseUrl } from '@/config/index.js'
import { makePhoneCall } from '@/utils/common.js'
import { orderNum } from '@/apis/order.js'
import { uncommentNum } from '@/apis/comment.js'
import { unReadCounts } from '@/apis/news.js'
export default {
data() {
return {
......@@ -132,7 +136,8 @@ export default {
wait_receive: 0,
wait_send: 0
},
commentCounts: 0
commentCounts: 0,
unReadNewsNum: 0
}
},
......@@ -170,6 +175,7 @@ export default {
this.setUserInfo()
this.getOrderNum()
this.getCommentNum()
this.getUnReadNewsNum()
} else {
this.orderNum = {
wait_pay: 0,
......@@ -249,6 +255,18 @@ export default {
console.log(e)
//TODO handle the exception
}
},
// 获取未读消息数量
async getUnReadNewsNum() {
try{
const { status, data } = await unReadCounts()
if(status) {
this.unReadNewsNum = data
}
}catch(e){
console.log(e)
}
}
}
}
......
......@@ -68,6 +68,7 @@ export default {
async getDetail() {
const { status, data } = await newsDetail(this.id)
if(status) {
!data.abstract && data.text && (data.abstract = this.dealText(data.text));
this.detail = data
newsStatus(data.id)
}
......@@ -77,6 +78,13 @@ export default {
preview(src, e) {
// do something
},
dealText(text) {
if(!text) return ''
const reg = /<[^<>]+>/g;
text = text.replace(reg, '').replace(/&nbsp;/ig, '');
return text;
}
}
}
</script>
......@@ -89,5 +97,9 @@ export default {
.cover {
background-color: $mainBg;
}
.article-introduct {
width: 100%;
@include text-ellipsis(2);
}
}
</style>
<template>
<view class="news-wrapper w-100 pt-2 isIphoneX">
<view class="news-wrapper w-100 isIphoneX">
<template v-if="list.length === 0">
<empty-view text="暂无消息" />
</template>
......@@ -15,6 +15,7 @@
v-for="news in list"
:key="news.id"
@longpress="pressItem(news.id)"
@click="handleDetail(news.text_id)"
>
<view class="w-100 flex j-between a-center shop-info_wrap">
<view class="shop-info_inner flex a-center flex-1">
......@@ -40,10 +41,7 @@
<view class="font-24 descColor">{{news.read_status === '0' ? '未读' : '已读'}}</view>
</view>
<view class="desc font-24 descColor mb-2">{{news.abstract}}</view>
<view
class="w-100 btn"
@click.stop="handleDetail(news.text_id)"
>查看详情</view>
<view class="w-100 btn">查看详情</view>
</view>
</pull-list>
</template>
......@@ -81,12 +79,11 @@ export default {
// 长按id
pressItem(id) {
console.log(id)
uni.showActionSheet({
itemList: ['删除'],
uni.showModal({
content: '您确定要删除吗?',
confirmColor: '#FF661A',
success: res => {
const { tapIndex } = res
if(tapIndex === 0) {
if(res.confirm) {
newsDel(id)
.then(({status, msg}) => {
if(status) {
......@@ -129,7 +126,7 @@ export default {
overflow: hidden;
.list-item {
width: 690rpx;
margin:0 auto;
margin: 30rpx auto;
border-radius: 8rpx;
background-color: #fff;
.shop-info_wrap {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment