Commit ea4878b3 authored by June_Q's avatar June_Q

fix:已知bug

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