diff --git a/core/app.js b/core/app.js index 49b80cf..8a277e0 100644 --- a/core/app.js +++ b/core/app.js @@ -165,7 +165,7 @@ export const setCartTotalNum = (value) => { * 该方法只能在tabbar页面中调用, 其他页面调用会报错 */ export const setCartTabBadge = () => { - const cartTabbarIndex = 2 + const cartTabbarIndex = 3 const cartTotal = getCartTotalNum() if (cartTotal > 0) { uni.setTabBarBadge({ diff --git a/pages/cart/index.vue b/pages/cart/index.vue index f58e929..1a89b4e 100644 --- a/pages/cart/index.vue +++ b/pages/cart/index.vue @@ -43,8 +43,8 @@ {{ item.goods.skuInfo.goods_price }} - - + @@ -61,35 +61,7 @@ - - 为您推荐 - - - - - - - - - {{item.selling_point}} - {{item.goods_name}} - - - 包邮 - - - - {{item.goods_price_min}} - 到手价 - ¥{{item.line_price_min}} - - - - - + @@ -124,7 +96,7 @@ + + diff --git a/pages/goods/detail.vue b/pages/goods/detail.vue index f2d8527..18b5385 100644 --- a/pages/goods/detail.vue +++ b/pages/goods/detail.vue @@ -125,7 +125,7 @@ - 服务 + 商家 @@ -201,7 +201,10 @@ - + + + {{ cartTotal > 99 ? '99+' : cartTotal }} + @@ -218,13 +221,16 @@ @@ -443,6 +449,7 @@ + @@ -452,11 +459,14 @@ import * as GoodsApi from '@/api/goods' import * as goodsCar from '@/api/cart.js' import SkuPopup from './components/SkuPopup' + import setPrice from './components/setPrice' import * as address from '@/api/address.js' + import * as CartApi from '@/api/cart' export default { components: { SkuPopup, - GoodsPosterPopup + GoodsPosterPopup, + setPrice }, data() { return { @@ -497,6 +507,8 @@ selectShop: {}, // 获取商品海报图api方法 posterApiCall: GoodsApi.poster, + // 购物车总数量 + cartTotal: 0, } }, onLoad(options) { @@ -513,6 +525,7 @@ this.getServeList() this.getGoodsDetail() this.cityInfo = uni.getStorageSync("cityInfo"); + this.getCartTotal() uni.$on("onenPrice", function(selectShop) { that.openPirce(); that.isTodo = false; @@ -538,6 +551,40 @@ } }, methods: { + getprice(e) { + console.log(e) + GoodsApi.editGoodsPrice(params).then(res => { + if (res.status == 200) { + that.$toast("设置成功"); + this.$refs.setRange.afterSale = false; + setTimeout(() => { + // that.getGoodsDetail(1); + }, 500) + } + }) + .catch() + }, + setPirce() { + console.log(this.$refs.setRange) + this.$refs.setRange.afterSale = true; + }, + // 获取购物车总数量 + getCartTotal() { + const app = this + return new Promise((resolve, reject) => { + CartApi.total() + .then(result => { + app.cartTotal = result.data.cartTotal + resolve(result) + }) + .catch(reject) + }) + }, + + // 更新购物车数量 + onAddCart(total) { + this.getCartTotal() + }, //修改商品价格 async toUnpdatePrice() { const that = this; @@ -741,7 +788,7 @@ }, copyNum(msg) { uni.setClipboardData({ - data: (typeof msg=='number')?msg.toString():msg, // 这里是个坑接受字符串类型 value转化为字符串 + data: (typeof msg == 'number') ? msg.toString() : msg, // 这里是个坑接受字符串类型 value转化为字符串 success: function() { //调用方法成功 uni.showToast({ @@ -1934,4 +1981,22 @@ } } } + + .uni-tabbar__badge { + width: auto; + height: 16px; + line-height: 16px; + border-radius: 16px; + min-width: 16px; + padding: 0 2px; + font-size: 12px; + text-align: center; + white-space: nowrap; + position: absolute; + top: -5px; + right: 1px; + background-color: #f43530; + color: #ffffff; + transform: translate(40%, -20%); + } diff --git a/pages/index/index.vue b/pages/index/index.vue index c41ab20..8f69321 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1021,7 +1021,7 @@ .logo { height: 50rpx; - width: auto; + width: 200rpx; position: absolute; left: 36rpx; top: 25rpx; diff --git a/pages/member/index.vue b/pages/member/index.vue index d946484..36a1df8 100644 --- a/pages/member/index.vue +++ b/pages/member/index.vue @@ -32,13 +32,13 @@ - + 天天免邮 - + 超低会员价 @@ -50,19 +50,19 @@ - + 退换免运费 - + 促销福利 - + 极速售后 @@ -86,7 +86,7 @@ - + 双倍积分 @@ -103,7 +103,7 @@ 限时活动价 - + {{item.month}}个月 @@ -145,7 +145,10 @@ 原价 ¥{{choseItem.price}} - + + ¥{{choseItem.price}}开卡{{choseItem.month}}个月 + + ¥{{choseItem.price}}开卡{{choseItem.month}}个月 @@ -175,12 +178,14 @@ choseItem: {}, payType: 'wechat', type: 'hy', + user: '' } }, onShow() { this.getMemberInfo() }, onLoad(options) { + this.user = uni.getStorageSync('userInfo') this.type = options.type }, methods: { @@ -630,4 +635,4 @@ } } } - \ No newline at end of file + diff --git a/pages/news/consult/index.vue b/pages/news/consult/index.vue index 0565a82..3cf65c5 100644 --- a/pages/news/consult/index.vue +++ b/pages/news/consult/index.vue @@ -11,7 +11,7 @@ {{cityInfo.fuwu_hours}}天服务总时长 {{cityInfo.fuwu_num}}天服务总数 - {{cityInfo.star}}次为我服务次数 + {{cityInfo.service_num_for_me}}次为我服务次数 diff --git a/pages/news1/help.vue b/pages/news1/help.vue index 7a1e06b..0ea34d7 100644 --- a/pages/news1/help.vue +++ b/pages/news1/help.vue @@ -5,7 +5,9 @@ - + + + {{ item.name }} @@ -61,21 +63,21 @@ that.itemList = res.data.list; that.itemList.map(item => { if (item.child.length > 0) { - if (parseInt(item.child.length % 4) == 1 && item.child.length < 3) { + if (parseInt(item.child.length % 4) == 1) { item.child.push({}, {}, {}) } - if (parseInt(item.child.length % 4) == 2 && item.child.length < 3) { + if (parseInt(item.child.length % 4) == 2) { item.child.push({}, {}) } if (parseInt(item.child.length % 4) == 3) { item.child.push({}) } - if (parseInt(item.child.length % 4) == 1 && item.child.length > 4) { + if (parseInt(item.child.length % 4) == 1) { item.child.push({}) } } item.childArr = [] - item.childArr = item.child.slice(0, 9) + item.childArr = item.child.slice(0, 4) }) } @@ -137,7 +139,13 @@ align-items: center; flex-direction: column; position: relative; + // border-bottom: 1px solid #dfdbdb; + .helpImg { + width: 50rpx; + height: 50rpx; + border-radius: 50%; + } .titleIcon { width: 50upx; diff --git a/pages/news3/components/afterSales.vue b/pages/news3/components/afterSales.vue index 446a4f0..b52454a 100644 --- a/pages/news3/components/afterSales.vue +++ b/pages/news3/components/afterSales.vue @@ -122,7 +122,7 @@ export default{ .filterTitle{ font-size: 32upx; font-family: PingFang SC, PingFang SC; - font-weight: 500; + font-weight: 700; color: #303030; text-align: center; } diff --git a/pages/news3/components/category.vue b/pages/news3/components/category.vue index 492e421..12f5b7e 100644 --- a/pages/news3/components/category.vue +++ b/pages/news3/components/category.vue @@ -76,6 +76,11 @@