diff --git a/api/product.js b/api/product.js index 7a3512b..fe2cfaa 100644 --- a/api/product.js +++ b/api/product.js @@ -1,5 +1,5 @@ import request from '@/utils/request.js'; -import { getStorageFun, TOKEN_NAME } from '@/utils/auth.js'; +import {getStorageFun,TOKEN_NAME} from '@/utils/auth.js'; /** * 搜索商品 @@ -7,9 +7,9 @@ import { getStorageFun, TOKEN_NAME } from '@/utils/auth.js'; */ export function searchList(params) { return request({ - url: "/goods/searchList", - method: "get", - data: params, + url: "/goods/searchList", + method: "get", + data:params, }); } @@ -20,10 +20,10 @@ export function searchList(params) { */ export function getGoodsDetail(params) { return request({ - url: "/goods/getGoodsDetail", - method: "get", - data: params, - }); + url: "/goods/getGoodsDetail", + method: "get", + data:params, + }); } @@ -33,22 +33,22 @@ export function getGoodsDetail(params) { */ export function addGoods(params) { return request({ - url: "/cart/addGoods", - method: "post", - data: params, - }); + url: "/cart/addGoods", + method: "post", + data:params, + }); } -/** - * 查询规格 - * @param {Object} params - */ + /** + * 查询规格 + * @param {Object} params + */ export function getGoodsSpecs(params) { return request({ - url: "/goods/getGoodsSpecs", - method: "get", - data: params, - }); -} + url: "/goods/getGoodsSpecs", + method: "get", + data:params, + }); + } // 查询商品评价 export function getGoodsReviewsList(params) { return request({ @@ -119,6 +119,14 @@ export function getSeckillGoodsList(params) { }); } +export function getGoodsSpecsInfo(params) { + return request({ + url: "/goods/getGoodsSpecsInfo", + method: "get", + data: params, + }); +} + // 商品标签 export function getGoodsTags(params) { return request({ diff --git a/main.js b/main.js index e6b4156..ec1e5e4 100644 --- a/main.js +++ b/main.js @@ -38,6 +38,23 @@ import { createI18n } from 'vue-i18n' const i18n = createI18n(i18nConfig) export function createApp() { const app = createSSRApp(App) + // #ifdef H5 + app.component('AsyncError', { + props: ['error'], + mounted() { + console.error('[AsyncPageError]', this.error) + }, + render() { + const detail = import.meta.env.DEV && this.error + ? `:${this.error.message || String(this.error)}` + : '' + return h('div', { + class: 'uni-async-error', + onClick: () => window.location.reload() + }, `页面加载失败${detail},点击屏幕重试`) + } + }) + // #endif // #ifndef MP-WEIXIN app.use(VueClipboard); // #endif diff --git a/package.json b/package.json index d01314e..ec4feed 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "echarts": "^5.1.2", "qs-canvas": "^1.0.11", "tabber-component": "^1.1.1", - "vue-clipboard2": "^0.3.3" + "vue-clipboard2": "^0.3.3", + "vue-i18n": "^9.14.1" } } diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index 2257b7d..447f3e8 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -5,37 +5,25 @@ + shape="circle" width="54" height="54" bgColor="#f1f6ff00"> {{ currentUserData.nickname || '信任桥用户' }} - + {{ currentUserData.agentName }} - + + style="margin-right: 8rpx; margin-top: 6rpx" shape="circle" width="14" + height="14" bgColor="#f1f6ff00"> {{ currentUserData.gradeName }} @@ -58,17 +46,20 @@ 邀请码:{{ currentUserData.inviteCode }} - + - + - + @@ -84,20 +75,24 @@ 我的订单 全部 - + - + {{ item.title }} - + - + {{ item.title }} @@ -168,7 +163,11 @@ 服务工具 - + + + + {{ item.title }} @@ -236,6 +235,7 @@ import CustomTabBar from '@/components/custom-tab-bar.vue'; import { getStatistics } from '@/api/order.js'; import { getUserInfo } from '@/api/auth.js'; import { CUSTOMER_SERVICE_PHONE_NUMBER } from '@/utils/config.js'; +import { getUnreadCount as getKefuUnreadCount } from "@/uni_modules/hashmall-customer-service/js_sdk/api.js"; export default { computed: { @@ -411,7 +411,9 @@ export default { }, // 角标统计 serviceShow: false, // 我的客服弹框 openShow: false, // 暂未开放 - platformType: true + platformType: true, + kefuUnreadCount: 0, + kefuUnreadTimer: null, }; }, onShow() { @@ -426,16 +428,45 @@ export default { this.getStatistics(); this.getUserInfo(); + this.startKefuUnreadPolling(); }, - mounted() {}, + onHide() { + this.stopKefuUnreadPolling(); + }, + onUnload() { + this.stopKefuUnreadPolling(); + }, + mounted() { }, methods: { copyData, + async refreshKefuUnreadCount() { + const userId = this.currentUserData && this.currentUserData.id; + if (!userId) { + this.kefuUnreadCount = 0; + return; + } + try { + this.kefuUnreadCount = await getKefuUnreadCount(userId); + } catch (error) { + this.kefuUnreadCount = 0; + } + }, + startKefuUnreadPolling() { + this.stopKefuUnreadPolling(); + this.refreshKefuUnreadCount(); + this.kefuUnreadTimer = setInterval(() => this.refreshKefuUnreadCount(), 15000); + }, + stopKefuUnreadPolling() { + if (this.kefuUnreadTimer) clearInterval(this.kefuUnreadTimer); + this.kefuUnreadTimer = null; + }, // 查询用户等级 async getUserInfo() { const result = await getUserInfo(); if (result && result.bizcode === 100) { const data = result.data; this.currentUserData = result.data || {}; + this.refreshKefuUnreadCount(); if (!this.currentUserData?.isNewUser) { this.applyList = this.applyList.filter((item) => item.id !== 5); } @@ -464,7 +495,7 @@ export default { // 客服 if (item.id === 7) { uni.navigateTo({ - url: '/pages/rwa_package/setting/kefu?type=5257' + url: "/pages/rwa_package/setting/kefu", }); } else if (item.id === 9) { // 实名认证 @@ -557,274 +588,299 @@ export default { \ No newline at end of file diff --git a/pages/mine_package/mine_order/mine_order.vue b/pages/mine_package/mine_order/mine_order.vue index b6e2132..1d9670c 100644 --- a/pages/mine_package/mine_order/mine_order.vue +++ b/pages/mine_package/mine_order/mine_order.vue @@ -134,7 +134,8 @@ @click="onAfterSaleDetail(item)"> 售后详情 - 评价 + 评价 ¥{{ orderInfo.adPrice }} - + @@ -232,13 +233,13 @@ {{ item.type }} - + " v-for="(oItem, oIndex) in item.items" :key="oItem.id || oItem.n" + @click="clickSpecification(index, item, oItem)"> {{ oItem.n }} @@ -338,7 +339,7 @@ - - diff --git a/uni_modules/hashmall-customer-service/components/hashmall-customer-service/hashmall-customer-service.vue b/uni_modules/hashmall-customer-service/components/hashmall-customer-service/hashmall-customer-service.vue new file mode 100644 index 0000000..24903ef --- /dev/null +++ b/uni_modules/hashmall-customer-service/components/hashmall-customer-service/hashmall-customer-service.vue @@ -0,0 +1,2124 @@ +