Commit 95b3abe0 by Lin

feat: 优化代码

2 parents e963b604 668dc98c
Showing 112 changed files with 113 additions and 129 deletions
...@@ -4,3 +4,5 @@ ...@@ -4,3 +4,5 @@
/.DS_Store /.DS_Store
/.hbuilderx /.hbuilderx
node_modules node_modules
assets/images/sprite.png
assets/css/sprite.scss
This diff could not be displayed because it is too large.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type

3.24 MB | W: | H:

3.41 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
No preview for this file type

24.7 KB | W: | H:

9.49 KB | W: | H:

assets/spritesmith/active-msg.png
assets/spritesmith/active-msg.png
assets/spritesmith/active-msg.png
assets/spritesmith/active-msg.png
  • 2-up
  • Swipe
  • Onion skin

46.7 KB | W: | H:

22.3 KB | W: | H:

assets/spritesmith/ai-bazaar.png
assets/spritesmith/ai-bazaar.png
assets/spritesmith/ai-bazaar.png
assets/spritesmith/ai-bazaar.png
  • 2-up
  • Swipe
  • Onion skin

58.2 KB | W: | H:

26 KB | W: | H:

assets/spritesmith/bao.png
assets/spritesmith/bao.png
assets/spritesmith/bao.png
assets/spritesmith/bao.png
  • 2-up
  • Swipe
  • Onion skin

50.3 KB | W: | H:

25.7 KB | W: | H:

assets/spritesmith/customer-1.png
assets/spritesmith/customer-1.png
assets/spritesmith/customer-1.png
assets/spritesmith/customer-1.png
  • 2-up
  • Swipe
  • Onion skin

121 KB | W: | H:

49.6 KB | W: | H:

assets/spritesmith/customer-2.png
assets/spritesmith/customer-2.png
assets/spritesmith/customer-2.png
assets/spritesmith/customer-2.png
  • 2-up
  • Swipe
  • Onion skin

24.6 KB | W: | H:

10.5 KB | W: | H:

assets/spritesmith/info-icon.png
assets/spritesmith/info-icon.png
assets/spritesmith/info-icon.png
assets/spritesmith/info-icon.png
  • 2-up
  • Swipe
  • Onion skin

36.9 KB | W: | H:

20.1 KB | W: | H:

assets/spritesmith/learn-bg.png
assets/spritesmith/learn-bg.png
assets/spritesmith/learn-bg.png
assets/spritesmith/learn-bg.png
  • 2-up
  • Swipe
  • Onion skin

362 KB | W: | H:

168 KB | W: | H:

assets/spritesmith/locker-icon.png
assets/spritesmith/locker-icon.png
assets/spritesmith/locker-icon.png
assets/spritesmith/locker-icon.png
  • 2-up
  • Swipe
  • Onion skin

74.9 KB | W: | H:

35.6 KB | W: | H:

assets/spritesmith/no-insurance-data.png
assets/spritesmith/no-insurance-data.png
assets/spritesmith/no-insurance-data.png
assets/spritesmith/no-insurance-data.png
  • 2-up
  • Swipe
  • Onion skin

80.4 KB | W: | H:

51.9 KB | W: | H:

assets/spritesmith/prompt.png
assets/spritesmith/prompt.png
assets/spritesmith/prompt.png
assets/spritesmith/prompt.png
  • 2-up
  • Swipe
  • Onion skin

57.2 KB | W: | H:

21 KB | W: | H:

assets/spritesmith/scene-0.png
assets/spritesmith/scene-0.png
assets/spritesmith/scene-0.png
assets/spritesmith/scene-0.png
  • 2-up
  • Swipe
  • Onion skin

47.5 KB | W: | H:

16.3 KB | W: | H:

assets/spritesmith/scene-1.png
assets/spritesmith/scene-1.png
assets/spritesmith/scene-1.png
assets/spritesmith/scene-1.png
  • 2-up
  • Swipe
  • Onion skin

76.9 KB | W: | H:

24.9 KB | W: | H:

assets/spritesmith/scene-7.png
assets/spritesmith/scene-7.png
assets/spritesmith/scene-7.png
assets/spritesmith/scene-7.png
  • 2-up
  • Swipe
  • Onion skin

31.7 KB | W: | H:

17.5 KB | W: | H:

assets/spritesmith/short-course-learn-room.png
assets/spritesmith/short-course-learn-room.png
assets/spritesmith/short-course-learn-room.png
assets/spritesmith/short-course-learn-room.png
  • 2-up
  • Swipe
  • Onion skin

15.9 KB | W: | H:

5.65 KB | W: | H:

assets/spritesmith/store-daily-report.png
assets/spritesmith/store-daily-report.png
assets/spritesmith/store-daily-report.png
assets/spritesmith/store-daily-report.png
  • 2-up
  • Swipe
  • Onion skin

58 KB | W: | H:

16.9 KB | W: | H:

assets/spritesmith/topTipsRightIcon.png
assets/spritesmith/topTipsRightIcon.png
assets/spritesmith/topTipsRightIcon.png
assets/spritesmith/topTipsRightIcon.png
  • 2-up
  • Swipe
  • Onion skin

13.3 KB | W: | H:

4.85 KB | W: | H:

assets/spritesmith/wage-appeal.png
assets/spritesmith/wage-appeal.png
assets/spritesmith/wage-appeal.png
assets/spritesmith/wage-appeal.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -30,14 +30,14 @@ ...@@ -30,14 +30,14 @@
<view class="fab-content-idle"> <view class="fab-content-idle">
<image <image
class="idle-mascot-svg" class="idle-mascot-svg"
src="/static/images/ai-assistant/side-sparkle-rise-export.svg" src="https://img02.glsx.com.cn/weapp/resource/app-tape/ai-assistant/side-sparkle-rise-export.svg"
mode="scaleToFill" mode="scaleToFill"
></image> ></image>
</view> </view>
<view class="fab-content-active"> <view class="fab-content-active">
<image <image
class="thinking-orb-svg" class="thinking-orb-svg"
src="/static/images/ai-assistant/122-eye-blink.svg" src="https://img02.glsx.com.cn/weapp/resource/app-tape/ai-assistant/122-eye-blink.svg"
mode="scaleToFill" mode="scaleToFill"
></image> ></image>
<!-- <view class="thinking-capsule-bg"></view> --> <!-- <view class="thinking-capsule-bg"></view> -->
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<text class="help-menu-action-text">✨ 帮我回答顾客刚才的问题(近1分钟)</text> <text class="help-menu-action-text">✨ 帮我回答顾客刚才的问题(近1分钟)</text>
<image <image
class="help-menu-action-arrow" class="help-menu-action-arrow"
src="/static/images/ai-assistant/Vector.png" src="https://img02.glsx.com.cn/weapp/resource/app-tape/ai-assistant/Vector.png"
mode="aspectFit" mode="aspectFit"
/> />
</view> </view>
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<text class="help-menu-action-text">🌟 介绍下谈客助手该如何使用</text> <text class="help-menu-action-text">🌟 介绍下谈客助手该如何使用</text>
<image <image
class="help-menu-action-arrow" class="help-menu-action-arrow"
src="/static/images/ai-assistant/Vector.png" src="https://img02.glsx.com.cn/weapp/resource/app-tape/ai-assistant/Vector.png"
mode="aspectFit" mode="aspectFit"
/> />
</view> </view>
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
<text class="help-menu-action-text">🌟 {{ item.query }}</text> <text class="help-menu-action-text">🌟 {{ item.query }}</text>
<image <image
class="help-menu-action-arrow" class="help-menu-action-arrow"
src="/static/images/ai-assistant/Vector.png" src="https://img02.glsx.com.cn/weapp/resource/app-tape/ai-assistant/Vector.png"
mode="aspectFit" mode="aspectFit"
/> />
</view> </view>
...@@ -1423,7 +1423,7 @@ export default { ...@@ -1423,7 +1423,7 @@ export default {
} }
.result-head.question-content-head { .result-head.question-content-head {
height: 53px; height: 53px;
padding: 28px 24px 16px 24px; padding: 16px 24px;
align-items: center; align-items: center;
flex-shrink: 0; flex-shrink: 0;
} }
......
...@@ -32,10 +32,10 @@ export default { ...@@ -32,10 +32,10 @@ export default {
type: String, type: String,
default: 'uuid' default: 'uuid'
}, },
// default: 销售顾问;seller: 转化人员/驻店零售 /** 转化人员(驻店零售)模式,与 OrderPopup 转化人员选择项一致 */
employeeType: { sellerUser: {
type: String, type: Boolean,
default: 'default' default: false
} }
}, },
data () { data () {
......
<template> <template>
<view class="entrance-box"> <view class="entrance-box">
<template v-if="entranceList.length"> <template v-if="displayEntranceList.length">
<view class="entrance-container"> <view class="entrance-container">
<scroll-view <scroll-view
v-if="scrollable" v-if="scrollable"
...@@ -12,18 +12,20 @@ ...@@ -12,18 +12,20 @@
<view class="entrance-list entrance-list-scroll"> <view class="entrance-list entrance-list-scroll">
<view <view
class="entrance-item" class="entrance-item"
v-for="(item, index) in entranceList" v-for="(item, index) in displayEntranceList"
:key="index" :key="index"
@click="handleClick(item)" @click="handleClick(item)"
> >
<view :class="['sprite-icon', `icon-${item.icon}`]"></view> <image v-if="item.iconImage" class="entrance-icon" :src="item.iconImage" mode="aspectFit" />
<view v-else :class="['sprite-icon', `icon-${item.icon}`]"></view>
<view class="entrance-name">{{ item.label }}</view> <view class="entrance-name">{{ item.label }}</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view v-else :class="['entrance-list', `entrance-list-${type}`]"> <view v-else :class="['entrance-list', `entrance-list-${type}`]">
<view class="entrance-item" v-for="(item, index) in entranceList" :key="index" @click="handleClick(item)"> <view class="entrance-item" v-for="(item, index) in displayEntranceList" :key="index" @click="handleClick(item)">
<view :class="['sprite-icon', `icon-${item.icon}`]"></view> <image v-if="item.iconImage" class="entrance-icon" :src="item.iconImage" mode="aspectFit" />
<view v-else :class="['sprite-icon', `icon-${item.icon}`]"></view>
<view class="entrance-name">{{ item.label }}</view> <view class="entrance-name">{{ item.label }}</view>
</view> </view>
</view> </view>
...@@ -51,6 +53,11 @@ export default { ...@@ -51,6 +53,11 @@ export default {
scrollable: { scrollable: {
type: Boolean, type: Boolean,
default: false default: false
},
// 轻改限时产品活动 tab 激活时,控制服务中心入口展示
showOnActivityTab: {
type: Boolean,
default: false
} }
}, },
data() { data() {
...@@ -68,7 +75,12 @@ export default { ...@@ -68,7 +75,12 @@ export default {
this.getEntranceList() this.getEntranceList()
}, },
computed: { computed: {
displayEntranceList() {
return this.entranceList.filter(e => {
if (e.showOnActivityTab) return this.showOnActivityTab
return true
})
}
}, },
methods: { methods: {
// 请求工资申诉入口权限,并设置显示开关 // 请求工资申诉入口权限,并设置显示开关
...@@ -200,6 +212,17 @@ export default { ...@@ -200,6 +212,17 @@ export default {
noInterception: true noInterception: true
}, },
{ {
iconImage: require('@/assets/images/common/icon-menu-sever.png'),
name: 'ServiceCenter',
label: '服务中心',
page: '/pages/common/serviceDetail/index',
eventCode: 'app_service_center',
sceneType: [1],
showOnActivityTab: true,
pageDirect: true,
noInterception: true
},
{
icon: 'negotiation-detail', icon: 'negotiation-detail',
name: 'NegotiationDetail', name: 'NegotiationDetail',
label: '洽谈明细', label: '洽谈明细',
...@@ -290,6 +313,11 @@ export default { ...@@ -290,6 +313,11 @@ export default {
margin-top: toRpx(8); margin-top: toRpx(8);
white-space: nowrap; white-space: nowrap;
} }
.entrance-icon {
width: calc(100vmin * (1173 / 768) * 0.04092071611253197);
height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
}
} }
.developing { .developing {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<view class="car-list-inner"> <view class="car-list-inner">
<view <view
v-for="(item, index) in carModelTabs" v-for="(item, index) in carModelTabs"
:key="item.carSeriesId || 'all'" :key="item.carSeriesId"
:class="['car-item', { active: carModelIndex === index }]" :class="['car-item', { active: carModelIndex === index }]"
@click="handleCarModelClick(index)" @click="handleCarModelClick(index)"
> >
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<!-- 展业工具 --> <!-- 展业工具 -->
<view class="tools-box"> <view class="tools-box">
<Entrance scrollable @entranceClick="handleEntranceClick" /> <Entrance scrollable :show-on-activity-tab="showOnActivityTab" @entranceClick="handleEntranceClick" />
</view> </view>
</view> </view>
</template> </template>
...@@ -79,13 +79,6 @@ ...@@ -79,13 +79,6 @@
<script> <script>
import Entrance from '@/components/Entrance.vue' import Entrance from '@/components/Entrance.vue'
const GOODS_COVER = require('@/assets/images/common/goods-activity-cover.png')
/** 前端虚拟 Tab:接口 carSeriesList 不含此项,仅用于 UI 展示「全部车型」 */
const ALL_CAR_SERIES_TAB = {
carSeriesId: '__ALL__',
carSeriesName: '全部车型'
}
export default { export default {
name: 'ActivityTime', name: 'ActivityTime',
...@@ -97,6 +90,10 @@ export default { ...@@ -97,6 +90,10 @@ export default {
activityProductList: { activityProductList: {
type: Array, type: Array,
default: () => [] default: () => []
},
showOnActivityTab: {
type: Boolean,
default: false
} }
}, },
data() { data() {
...@@ -119,7 +116,7 @@ export default { ...@@ -119,7 +116,7 @@ export default {
} }
], ],
activityTypeIndex: 0, activityTypeIndex: 0,
carModelIndex: 0, // 0 对应「全部车型」,切换活动类型或数据刷新时重置至此 carModelIndex: 0,
goodsIndex: 0 goodsIndex: 0
} }
}, },
...@@ -138,26 +135,15 @@ export default { ...@@ -138,26 +135,15 @@ export default {
} }
}) })
}, },
// 当前活动类型下的原始车型列表(接口数据,不含虚拟 Tab) // 车型标签栏,无车型数据时不展示
carSeriesList() {
return this.activityProductList[this.activityTypeIndex]?.carSeriesList ?? []
},
// 车型标签栏:首位注入「全部车型」,无车型数据时不展示标签栏
carModelTabs() { carModelTabs() {
if (!this.carSeriesList.length) return [] return this.activityProductList[this.activityTypeIndex]?.carSeriesList ?? []
return [ALL_CAR_SERIES_TAB, ...this.carSeriesList]
}, },
selectedCarTab() { selectedCarTab() {
return this.carModelTabs[this.carModelIndex] ?? null return this.carModelTabs[this.carModelIndex] ?? null
}, },
isAllCarModelSelected() {
return this.selectedCarTab?.carSeriesId === ALL_CAR_SERIES_TAB.carSeriesId
},
// 全部车型:合并当前活动类型下所有 productList;具体车型:取选中项 productList
goodsList() { goodsList() {
const productList = this.isAllCarModelSelected const productList = this.selectedCarTab?.productList ?? []
? this.carSeriesList.flatMap(series => series.productList ?? [])
: (this.selectedCarTab?.productList ?? [])
return productList.map(product => this.mapProductItem(product)) return productList.map(product => this.mapProductItem(product))
}, },
selectedGoods() { selectedGoods() {
...@@ -174,7 +160,7 @@ export default { ...@@ -174,7 +160,7 @@ export default {
} }
}, },
watch: { watch: {
// 接口数据更新时重置选中态,默认回到首个活动类型 + 全部车型 // 接口数据更新时重置选中态,默认回到首个活动类型 + 首个车型
activityProductList() { activityProductList() {
this.resetTabSelection() this.resetTabSelection()
}, },
...@@ -188,7 +174,7 @@ export default { ...@@ -188,7 +174,7 @@ export default {
methods: { methods: {
resetTabSelection() { resetTabSelection() {
this.activityTypeIndex = 0 this.activityTypeIndex = 0
this.carModelIndex = 0 // 重置为「全部车型」 this.carModelIndex = 0
this.goodsIndex = 0 this.goodsIndex = 0
}, },
formatPrice(value) { formatPrice(value) {
...@@ -217,13 +203,13 @@ export default { ...@@ -217,13 +203,13 @@ export default {
startTime: product.startTime, startTime: product.startTime,
endTime: product.endTime, endTime: product.endTime,
thumbImageUrl: product.thumbImageUrl, thumbImageUrl: product.thumbImageUrl,
cover: GOODS_COVER cover: ''
} }
}, },
handleActivityTypeClick(index) { handleActivityTypeClick(index) {
if (this.activityTypeIndex === index) return if (this.activityTypeIndex === index) return
this.activityTypeIndex = index this.activityTypeIndex = index
this.carModelIndex = 0 // 切换活动类型后默认选中「全部车型」 this.carModelIndex = 0
this.goodsIndex = 0 this.goodsIndex = 0
}, },
handleCarModelClick(index) { handleCarModelClick(index) {
...@@ -242,7 +228,7 @@ export default { ...@@ -242,7 +228,7 @@ export default {
const payload = { const payload = {
...goods, ...goods,
activityTypeLabel: this.activityTypeList[this.activityTypeIndex]?.label || '', activityTypeLabel: this.activityTypeList[this.activityTypeIndex]?.label || '',
carSeriesName: this.isAllCarModelSelected ? '全部车型' : (this.selectedCarTab?.carSeriesName || '') carSeriesName: this.selectedCarTab?.carSeriesName || ''
} }
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/actuvityDetail?row=${encodeURIComponent(JSON.stringify(payload))}`, url: `/pages/common/actuvityDetail?row=${encodeURIComponent(JSON.stringify(payload))}`,
...@@ -400,9 +386,8 @@ export default { ...@@ -400,9 +386,8 @@ export default {
flex-wrap: nowrap; flex-wrap: nowrap;
gap: 12px; gap: 12px;
height: $goods-item-height; height: $goods-item-height;
// 仅保留上下 padding 给 box-shadow 留空间,左右与上方主图/car-list 对齐 padding: $shadow-space;
padding: $shadow-space 0; box-sizing: content-box;
box-sizing: border-box;
} }
.goods-item { .goods-item {
......
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
pointClassification: ['C001', 'C003', 'C002'], pointClassification: ['C001', 'C003', 'C002'],
pointClassName: ['培训类', '行为类', '学习类'], pointClassName: ['培训类', '行为类', '学习类'],
statistics: {}, statistics: {},
levelImg: [require('@/assets/images/point/bronze.png'), require('@/assets/images/point/silver.png'), require('@/assets/images/point/gold.png'), require('@/assets/images/point/masonry.png')], levelImg: [require('@/assets/images/point/time_grey.webp'), require('@/assets/images/point/silver.webp'), require('@/assets/images/point/gold.webp'), require('@/assets/images/point/masonry.webp')],
detail: [], detail: [],
currentIndex: 0, currentIndex: 0,
pointList: [] pointList: []
......
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
<view :class="{ 'star-desc': true, grey: !badgeList.includes(item.medalType) && !isHigh }">{{ item.levelDesc }}</view> <view :class="{ 'star-desc': true, grey: !badgeList.includes(item.medalType) && !isHigh }">{{ item.levelDesc }}</view>
<view class="star-coupon" v-if="item.couponName"> <view class="star-coupon" v-if="item.couponName">
<view class="coupon-box"> <view class="coupon-box">
<image :src="require('@/assets/images/point/coupon_bg.png')" v-if="badgeList.includes(item.medalType) || isHigh"></image> <image :src="require('@/assets/images/point/coupon_bg.webp')" v-if="badgeList.includes(item.medalType) || isHigh"></image>
<image :src="require('@/assets/images/point/coupon_grey.png')" v-else></image> <image :src="require('@/assets/images/point/coupon_grey.webp')" v-else></image>
<view :class="{ 'coupon-title': true, grey: !badgeList.includes(item.medalType) && !isHigh }">{{ item.couponName }}</view> <view :class="{ 'coupon-title': true, grey: !badgeList.includes(item.medalType) && !isHigh }">{{ item.couponName }}</view>
<view :class="{ 'coupon-num': true, grey: !badgeList.includes(item.medalType) && !isHigh }">{{ item.couponCount }}张</view> <view :class="{ 'coupon-num': true, grey: !badgeList.includes(item.medalType) && !isHigh }">{{ item.couponCount }}张</view>
</view> </view>
...@@ -77,8 +77,8 @@ ...@@ -77,8 +77,8 @@
<script> <script>
const GROUP_LIST = [ const GROUP_LIST = [
{ title: '学习之星', style: 'background: #FFFAED;', medalType: 1, logo: require('@/assets/images/point/study_star.png'), logo_grey: require('@/assets/images/point/study_grey.png'), content: '月度学习类积分排名前10名' }, { title: '学习之星', style: 'background: #FFFAED;', medalType: 1, logo: require('@/assets/images/point/study_star.png'), logo_grey: require('@/assets/images/point/study_grey.png'), content: '月度学习类积分排名前10名' },
{ title: '全勤之星', style: 'background: #FFFAED;', medalType: 2, logo: require('@/assets/images/point/time_star.png'), logo_grey: require('@/assets/images/point/time_grey.png'), content: '当月全勤准时打卡,不包含请假特批' }, { title: '全勤之星', style: 'background: #FFFAED;', medalType: 2, logo: require('@/assets/images/point/time_star.webp'), logo_grey: require('@/assets/images/point/time_grey.webp'), content: '当月全勤准时打卡,不包含请假特批' },
{ title: '平板接待精英', style: 'background: #FFFAED;', medalType: 3, logo: require('@/assets/images/point/elite_star.png'), logo_grey: require('@/assets/images/point/elite_grey.png'), content: '平板接待月度无扣分记录' } { title: '平板接待精英', style: 'background: #FFFAED;', medalType: 3, logo: require('@/assets/images/point/elite_star.webp'), logo_grey: require('@/assets/images/point/elite_grey.webp'), content: '平板接待月度无扣分记录' }
] ]
import point from '@/mixin/point' import point from '@/mixin/point'
import pointTrack from '@/mixin/pointTrack' import pointTrack from '@/mixin/pointTrack'
......
...@@ -1225,7 +1225,7 @@ export default { ...@@ -1225,7 +1225,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: toRpx(24); margin-bottom: toRpx(24);
background: url(../../../../assets/images/point/coupon-address.png) no-repeat; background: url(../../../../assets/images/point/coupon-address.webp) no-repeat;
// background-size: 100% auto; // background-size: 100% auto;
// background-image: linear-gradient(90deg, #ffffff99 0%, #ffffffeb 23%, #F5F7FA 100%); // background-image: linear-gradient(90deg, #ffffff99 0%, #ffffffeb 23%, #F5F7FA 100%);
border-radius: toRpx(16); border-radius: toRpx(16);
......
...@@ -67,14 +67,14 @@ const POINT_LIST = [ ...@@ -67,14 +67,14 @@ const POINT_LIST = [
{ {
id: 0, id: 0,
title: '积分排行', title: '积分排行',
src: require('@/assets/images/point/point_bg.png'), src: require('@/assets/images/point/point_bg.webp'),
style: 'background: #fef2cb99;', style: 'background: #fef2cb99;',
isCrown: true isCrown: true
}, },
{ {
id: 1, id: 1,
title: '学习之星', title: '学习之星',
src: require('@/assets/images/point/study_bg.png'), src: require('@/assets/images/point/study_bg.webp'),
style: 'background-image: linear-gradient(270deg, #c2d8fc59 0%, #d1e9ff59 100%);' style: 'background-image: linear-gradient(270deg, #c2d8fc59 0%, #d1e9ff59 100%);'
}, },
{ {
...@@ -101,8 +101,8 @@ export default { ...@@ -101,8 +101,8 @@ export default {
selectItem: {}, selectItem: {},
detail: [], detail: [],
currentIndex: 0, currentIndex: 0,
pointImg: [require('@/assets/images/point/bronze_ranking.png'), require('@/assets/images/point/silver_ranking.png'), require('@/assets/images/point/masonry_ranking.png')], pointImg: [require('@/assets/images/point/bronze_ranking.webp'), require('@/assets/images/point/silver_ranking.webp'), require('@/assets/images/point/masonry_ranking.webp')],
starImg: [require('@/assets/images/point/study_star.png'), require('@/assets/images/point/time_star.png'), require('@/assets/images/point/elite_star.png')], starImg: [require('@/assets/images/point/study_star.png'), require('@/assets/images/point/time_star.webp'), require('@/assets/images/point/elite_star.webp')],
pointList: [] pointList: []
} }
}, },
......
...@@ -119,8 +119,8 @@ ...@@ -119,8 +119,8 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
const START_LIST = [{ title: '学习之星', medalType: 1, logo: require('@/assets/images/point/study_star.png'), logo_grey: require('@/assets/images/point/study_grey.png'), }, const START_LIST = [{ title: '学习之星', medalType: 1, logo: require('@/assets/images/point/study_star.png'), logo_grey: require('@/assets/images/point/study_grey.png'), },
{ title: '全勤之星', medalType: 2, logo: require('@/assets/images/point/time_star.png'), logo_grey: require('@/assets/images/point/time_grey.png'), }, { title: '全勤之星', medalType: 2, logo: require('@/assets/images/point/time_star.webp'), logo_grey: require('@/assets/images/point/time_grey.webp'), },
{ title: '平板接待精英', medalType: 4, logo: require('@/assets/images/point/elite_star.png'), logo_grey: require('@/assets/images/point/elite_grey.png'), }] { title: '平板接待精英', medalType: 4, logo: require('@/assets/images/point/elite_star.webp'), logo_grey: require('@/assets/images/point/elite_grey.webp'), }]
import pointTrack from '@/mixin/pointTrack' import pointTrack from '@/mixin/pointTrack'
export default { export default {
mixins: [pointTrack], mixins: [pointTrack],
...@@ -139,28 +139,28 @@ export default { ...@@ -139,28 +139,28 @@ export default {
titleStyle: 'background: linear-gradient(129deg, #88696B 13%, #665253 91%);color: transparent; background-clip: text;-webkit-background-clip: text; ', titleStyle: 'background: linear-gradient(129deg, #88696B 13%, #665253 91%);color: transparent; background-clip: text;-webkit-background-clip: text; ',
subTitleStyle: 'color: #995737;background-image: linear-gradient(94deg, #ffffff3d 2%, #ffffff66 51%, #ffffff1f 99%);', subTitleStyle: 'color: #995737;background-image: linear-gradient(94deg, #ffffff3d 2%, #ffffff66 51%, #ffffff1f 99%);',
style: 'background-image: linear-gradient(138deg, #F5E7DE 0%, #F1DBCF 20%, #F1DACD 39%, #EACEC0 40%, #EACDBF 70%, #F3DBD0 100%);', style: 'background-image: linear-gradient(138deg, #F5E7DE 0%, #F1DBCF 20%, #F1DACD 39%, #EACEC0 40%, #EACDBF 70%, #F3DBD0 100%);',
logo: require('@/assets/images/point/bronze.png'), logo: require('@/assets/images/point/time_grey.webp'),
}, },
{ {
title: '白银级熟手', title: '白银级熟手',
titleStyle: 'background: linear-gradient(129deg, #4A668F 13%, #333B43 91%);color: transparent; background-clip: text;webkit-background-clip: text;', titleStyle: 'background: linear-gradient(129deg, #4A668F 13%, #333B43 91%);color: transparent; background-clip: text;webkit-background-clip: text;',
subTitleStyle: 'color: #556985;background-image: linear-gradient(94deg, #ffffff3d 2%, #ffffff66 51%, #ffffff1f 99%);', subTitleStyle: 'color: #556985;background-image: linear-gradient(94deg, #ffffff3d 2%, #ffffff66 51%, #ffffff1f 99%);',
style: 'background-image: linear-gradient(138deg, #EDF0F5 0%, #E0E7EF 25%, #E4EAF2 39%, #DDE4ED 40%, #CCD7E6 74%, #D8E1ED 100%);', style: 'background-image: linear-gradient(138deg, #EDF0F5 0%, #E0E7EF 25%, #E4EAF2 39%, #DDE4ED 40%, #CCD7E6 74%, #D8E1ED 100%);',
logo: require('@/assets/images/point/silver.png'), logo: require('@/assets/images/point/silver.webp'),
}, },
{ {
title: '黄金级能手', title: '黄金级能手',
titleStyle: 'background: linear-gradient(129deg, #B17813 13%, #794308 91%);color: transparent; background-clip: text;webkit-background-clip: text;', titleStyle: 'background: linear-gradient(129deg, #B17813 13%, #794308 91%);color: transparent; background-clip: text;webkit-background-clip: text;',
subTitleStyle: 'color: #855A1B;background-image: linear-gradient(94deg, #ffffff3d 2%, #ffffff66 51%, #ffffff1f 99%);', subTitleStyle: 'color: #855A1B;background-image: linear-gradient(94deg, #ffffff3d 2%, #ffffff66 51%, #ffffff1f 99%);',
style: 'background-image: linear-gradient(138deg, #F7EFD7 0%, #F1E3C0 25%, #F1E4C1 39%, #EAD6A8 40%, #EAD6A6 74%, #F0E3C0 100%);', style: 'background-image: linear-gradient(138deg, #F7EFD7 0%, #F1E3C0 25%, #F1E4C1 39%, #EAD6A8 40%, #EAD6A6 74%, #F0E3C0 100%);',
logo: require('@/assets/images/point/gold.png'), logo: require('@/assets/images/point/gold.webp'),
}, },
{ {
title: '钻石级专家', title: '钻石级专家',
titleStyle: 'background: linear-gradient(111deg, #E7E8FD 11%, #C7CDF2 53%, #F4D8E8 100%);color: transparent; background-clip: text;webkit-background-clip: text;', titleStyle: 'background: linear-gradient(111deg, #E7E8FD 11%, #C7CDF2 53%, #F4D8E8 100%);color: transparent; background-clip: text;webkit-background-clip: text;',
subTitleStyle: 'color: #E7E8FD;background-image: linear-gradient(94deg, #ffffff3d 2%, #ffffff66 51%, #ffffff1f 99%);', subTitleStyle: 'color: #E7E8FD;background-image: linear-gradient(94deg, #ffffff3d 2%, #ffffff66 51%, #ffffff1f 99%);',
style: 'background-image: linear-gradient(138deg, #7162B6 0%, #433C94 25%, #313279 39%, #272A5B 40%, #2F356B 74%, #363E7A 100%);', style: 'background-image: linear-gradient(138deg, #7162B6 0%, #433C94 25%, #313279 39%, #272A5B 40%, #2F356B 74%, #363E7A 100%);',
logo: require('@/assets/images/point/masonry.png'), logo: require('@/assets/images/point/masonry.webp'),
} }
], ],
starList: [], starList: [],
...@@ -409,12 +409,12 @@ export default { ...@@ -409,12 +409,12 @@ export default {
} }
.claimed-bg { .claimed-bg {
background: url(../../../../assets//images/boutique/coupon-1.png) no-repeat; background: url(../../../../assets//images/boutique/coupon-1.webp) no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.unclaimed-bg { .unclaimed-bg {
background: url(../../../../assets//images/boutique/coupon-2.png) no-repeat; background: url(../../../../assets//images/boutique/coupon-2.webp) no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
......
...@@ -104,7 +104,11 @@ ...@@ -104,7 +104,11 @@
<!-- 限时产品活动 --> <!-- 限时产品活动 -->
<view v-show="currentHomeContentTab && currentHomeContentTab.key === 'activity'" class="right-content-box flex right-content-box-scene1"> <view v-show="currentHomeContentTab && currentHomeContentTab.key === 'activity'" class="right-content-box flex right-content-box-scene1">
<view class="tab-container"> <view class="tab-container">
<ActivityTime :activityProductList="activityProductList" @entranceClick="entranceClick" /> <ActivityTime
:activityProductList="activityProductList"
:show-on-activity-tab="currentHomeContentTab && currentHomeContentTab.key === 'activity'"
@entranceClick="entranceClick"
/>
<view class="line"></view> <view class="line"></view>
<CustomerSide :customerProfile="customerProfileList" /> <CustomerSide :customerProfile="customerProfileList" />
</view> </view>
...@@ -726,9 +730,8 @@ export default { ...@@ -726,9 +730,8 @@ export default {
* 查询策略首页数据状态(营销活动和客户列表是否有数据) * 查询策略首页数据状态(营销活动和客户列表是否有数据)
*/ */
async getStrategyStatus() { async getStrategyStatus() {
this.$store.state.boutique.boutiqueActivityData = [] // 清空 boutiqueActivityData
const res = await uni.$api.activityApi.getActivityStatusAPI({merchantId: uni.$storage.get('userInfo').shopMerchantId}) const res = await uni.$api.activityApi.getActivityStatusAPI({merchantId: uni.$storage.get('userInfo').shopMerchantId})
console.log('查询策略首页数据状态(营销活动和客户列表是否有数据):', res)
console.log('%c查询策略首页数据状态(营销活动和客户列表是否有数据):', 'color: green;', res) console.log('%c查询策略首页数据状态(营销活动和客户列表是否有数据):', 'color: green;', res)
if (!res) return if (!res) return
...@@ -774,10 +777,9 @@ export default { ...@@ -774,10 +777,9 @@ export default {
* @desc 查询预学习首页弹框信息 * @desc 查询预学习首页弹框信息
*/ */
async getPrelearnHome() { async getPrelearnHome() {
if (this.sceneType != 1) return
try { try {
const res = await uni.$api.commonApi.getPrelernHomePopupAPI() const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
console.log('getPrelernHomePopupAPI res***', res); console.log('预学习:查询预学习首页弹框信息***', res);
if (!res) return if (!res) return
this.prelearnData = res this.prelearnData = res
this.showPreStudyPopup = res.shouldPopup this.showPreStudyPopup = res.shouldPopup
...@@ -987,7 +989,7 @@ export default { ...@@ -987,7 +989,7 @@ export default {
} }
if (item.page) if (item.page)
return uni.navigateTo({ return uni.navigateTo({
url: `${item.page}?componentName=${item.name}` url: item.pageDirect ? item.page : `${item.page}?componentName=${item.name}`
}) })
let pageName = { let pageName = {
0: 'equity', 0: 'equity',
......
...@@ -68,7 +68,6 @@ export default { ...@@ -68,7 +68,6 @@ export default {
try { try {
const res = await uni.$api.commonApi.getPrelernHomePopupAPI() const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
console.log('getPrelernHomePopupAPI res***', res) console.log('getPrelernHomePopupAPI res***', res)
if (!res) return if (!res) return
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "展业助手", "name" : "展业助手",
"appid" : "__UNI__D3BD3DF", "appid" : "__UNI__D3BD3DF",
"description" : "", "description" : "",
"versionName" : "2.26.0", "versionName" : "2.25.4",
"versionCode" : 2260, "versionCode" : 2254,
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App特有相关 */ /* 5+App特有相关 */
......
...@@ -54,8 +54,7 @@ ...@@ -54,8 +54,7 @@
<template v-else> <template v-else>
<view :class="['sku-box', isPreview ? 'preview' : '']"> <view :class="['sku-box', isPreview ? 'preview' : '']">
<sku-box :currentCar="currentCarId" :defaultTabId="tabId" <sku-box :currentCar="currentCarId" :defaultTabId="tabId"
:show="show && !showActivity && (tabIndex != tabs.length - 1)" @changePreView="changePreView" :show="show && (tabIndex != tabs.length - 1)" @changePreView="changePreView" ref="sku" />
ref="sku" />
</view> </view>
</template> </template>
<view class="coupon-btn flex" v-if="!isPreview" @click="couponPopupRef.open(customerType, customerInfo)"> <view class="coupon-btn flex" v-if="!isPreview" @click="couponPopupRef.open(customerType, customerInfo)">
...@@ -287,6 +286,7 @@ export default { ...@@ -287,6 +286,7 @@ export default {
this.isSelect = false this.isSelect = false
this.updateViewKey = Date.now() this.updateViewKey = Date.now()
this.clearCanvas() this.clearCanvas()
if ( !this.$refs.sku && !this.hasBeforeActivity && !this.hasAfterActivity) this.changeTab(0, true, false)
}, },
changePreView(e, leave = true, clearBoard = true) { changePreView(e, leave = true, clearBoard = true) {
let { currentItem } = this, let { currentItem } = this,
...@@ -365,13 +365,15 @@ export default { ...@@ -365,13 +365,15 @@ export default {
let skuIndex = 0 let skuIndex = 0
if (this.hasBeforeActivity || this.hasAfterActivity) skuIndex = 1 if (this.hasBeforeActivity || this.hasAfterActivity) skuIndex = 1
if (this.hasBeforeActivity && this.hasAfterActivity) skuIndex = 2 if (this.hasBeforeActivity && this.hasAfterActivity) skuIndex = 2
if (this.tabIndex == skuIndex && this.currentItem.carModelName) this.previewLeave(this.currentItem) if (this.tabIndex == skuIndex && this.currentItem && this.currentItem.carModelName) this.previewLeave(this.currentItem)
let goods = this.$refs.goodsBox let goods = this.$refs.goodsBox
let skuRef = this.$refs.sku
this.tabIndex = index this.tabIndex = index
this.currentItem = null this.currentItem = null
this.tabListId = this.tabs[index].id this.tabListId = this.tabs[index].id
setTimeout(() => { setTimeout(() => {
if (changeCar && goods && [0, 1].includes(this.tabListId)) goods.changeCar(this.currentCarId) if (changeCar && goods && [0, 1].includes(this.tabListId)) goods.changeCar(this.currentCarId)
if (skuRef && skuIndex == index) skuRef.changeCar(this.currentCarId)
this.clearCanvas() this.clearCanvas()
}, 100) }, 100)
}, },
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<image <image
v-else v-else
class="image-box photo" class="image-box photo"
src="../../assets/images/boutique/photos.png" src="../../assets/images/boutique/photos.webp"
/> />
<view class="gradient-overlay"></view> <view class="gradient-overlay"></view>
<view class="box-desc"> <view class="box-desc">
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
></view> ></view>
</view> </view>
<view <view
v-if="item.type === 'single' && hasActivityPrice(item.activityPrice)" v-if="item.type === 'single' && hasMinSellPrice(item.minSellPrice)"
class="min-price" class="min-price"
>活动价 ¥ {{ item.activityPrice }}</view> >活动价 ¥ {{ item.minSellPrice }}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
<view class="child-name">{{ child.name }}</view> <view class="child-name">{{ child.name }}</view>
</view> </view>
<view <view
v-if="hasActivityPrice(child.activityPrice)" v-if="hasMinSellPrice(child.minSellPrice)"
class="min-price" class="min-price"
>活动价 ¥ {{ child.activityPrice }}</view> >活动价 ¥ {{ child.minSellPrice }}</view>
</view> </view>
<view class="card-right"> <view class="card-right">
<view class="current-price">¥ {{ child.sellPrice }}</view> <view class="current-price">¥ {{ child.sellPrice }}</view>
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
} }
}, },
methods: { methods: {
hasActivityPrice(value) { hasMinSellPrice(value) {
return value != null && value !== '' return value != null && value !== ''
}, },
shouldShowMarketingIcon(item) { shouldShowMarketingIcon(item) {
......
...@@ -214,8 +214,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -214,8 +214,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
}, },
{ {
label: '到店日期', label: '到店日期',
valueKey: 'inviteDate', valueKey: 'arrivalDate',
key: 'inviteDate', key: 'arrivalDate',
type: 'date' type: 'date'
}, },
{ {
...@@ -296,10 +296,8 @@ export default { ...@@ -296,10 +296,8 @@ export default {
merchantName: '', merchantName: '',
sellerName: '', sellerName: '',
sellerUserId: '', sellerUserId: '',
inviteDate: '',
filingDate: '' filingDate: ''
} }
this.inviteDateTouched = false
if (this.customerId) this.findVisitsInfo() if (this.customerId) this.findVisitsInfo()
}, },
async findVisitsInfo () { async findVisitsInfo () {
...@@ -307,10 +305,8 @@ export default { ...@@ -307,10 +305,8 @@ export default {
id: this.customerId id: this.customerId
}) })
if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD") if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD") if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD")
this.customerInfo = res this.customerInfo = res
this.inviteDateTouched = !!res.inviteDate
}, },
backPage () { backPage () {
uni.navigateBack({ uni.navigateBack({
...@@ -360,14 +356,7 @@ export default { ...@@ -360,14 +356,7 @@ export default {
} }
}, },
bindDateChange (e, valueKey) { bindDateChange (e, valueKey) {
const value = e.detail.value this.customerInfo[valueKey] = e.detail.value
this.customerInfo[valueKey] = value
if (valueKey === 'arrivalDate' && !this.inviteDateTouched) {
this.customerInfo.inviteDate = value
}
if (valueKey === 'inviteDate') {
this.inviteDateTouched = true
}
}, },
inputBlur (e, val) { inputBlur (e, val) {
const standNoVal = this.customerInfo.standNo const standNoVal = this.customerInfo.standNo
...@@ -445,8 +434,6 @@ export default { ...@@ -445,8 +434,6 @@ export default {
merchantId:params.merchantId, merchantId:params.merchantId,
employeeName:params.employeeName, employeeName:params.employeeName,
sellerMerchantId:params.sellerMerchantId, sellerMerchantId:params.sellerMerchantId,
sellerUserId: params.sellerUserId,
sellerName: customerInfo.sellerName,
preliminaryOrders: [ preliminaryOrders: [
{ {
sceneType:1, sceneType:1,
...@@ -463,7 +450,7 @@ export default { ...@@ -463,7 +450,7 @@ export default {
employeeName:params.employeeName, employeeName:params.employeeName,
userId:params.userId, userId:params.userId,
deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期 deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期
inviteDate: params.inviteDate ? params.inviteDate + ' 00:00:00' : params.inviteDate, //到店日期 inviteDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //到店日期
createdDate: params.filingDate, //建档日期 createdDate: params.filingDate, //建档日期
sellerUserld: params.sellerUserId, sellerUserld: params.sellerUserId,
sellerName: customerInfo.sellerName, sellerName: customerInfo.sellerName,
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</view> </view>
<!-- 成功图片 --> <!-- 成功图片 -->
<image class="success-icon" :src="require('@/assets/images/studyCenter/success.png')" mode="aspectFit" /> <image class="success-icon" :src="require('@/assets/images/studyCenter/success.webp')" mode="aspectFit" />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<!-- 左侧排行榜 --> <!-- 左侧排行榜 -->
<view class="left-panel"> <view class="left-panel">
<view class="top-image-wrapper"> <view class="top-image-wrapper">
<image class="panel-image" :src="require('@/assets/images/studyCenter/Leaderboard-bg.png')" <image class="panel-image" :src="require('@/assets/images/studyCenter/Leaderboard-bg.webp')"
mode="scaleToFill" /> mode="scaleToFill" />
</view> </view>
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -49,7 +49,6 @@ class AudioRecorder() { ...@@ -49,7 +49,6 @@ class AudioRecorder() {
// 定义错误码常量 // 定义错误码常量
companion object { companion object {
private const val TAG = "uni-recorder-x"
const val ERROR_RECORDING_IN_PROGRESS = 1001 const val ERROR_RECORDING_IN_PROGRESS = 1001
const val ERROR_NO_SUPPORTED_SAMPLE_RATE = 1107602 const val ERROR_NO_SUPPORTED_SAMPLE_RATE = 1107602
const val ERROR_BUFFER_SIZE_CALCULATION_FAILED = 1107603 const val ERROR_BUFFER_SIZE_CALCULATION_FAILED = 1107603
...@@ -152,7 +151,7 @@ class AudioRecorder() { ...@@ -152,7 +151,7 @@ class AudioRecorder() {
} else { } else {
this.filePath = null this.filePath = null
} }
Log.i(TAG, "startRecording: format=$format, saveToFile=$saveToFile, path=$filePath") Log.d("AudioRecorder", "File path set to: $filePath")
// 检测并调整采样率 // 检测并调整采样率
...@@ -287,7 +286,6 @@ class AudioRecorder() { ...@@ -287,7 +286,6 @@ class AudioRecorder() {
} }
} }
} catch (e: IOException) { } catch (e: IOException) {
Log.e(TAG, "write failed: path=$filePath, ${e.message}")
notifyError(ERROR_FILE_WRITE_FAILED, "录音过程中写入文件出错: ${e.message}") notifyError(ERROR_FILE_WRITE_FAILED, "录音过程中写入文件出错: ${e.message}")
} finally { } finally {
// 清理资源 // 清理资源
...@@ -556,10 +554,6 @@ class AudioRecorder() { ...@@ -556,10 +554,6 @@ class AudioRecorder() {
} }
audioRecord = null audioRecord = null
val savedPath = filePath
val fileSize = savedPath?.let { File(it).takeIf { f -> f.exists() }?.length() } ?: -1L
Log.i(TAG, "stopRecording: path=$savedPath, size=$fileSize bytes")
mainHandler.post { mainHandler.post {
recordingListener?.onRecordingStopped() recordingListener?.onRecordingStopped()
} }
......
...@@ -8,8 +8,6 @@ import Base64 from "android.util.Base64"; ...@@ -8,8 +8,6 @@ import Base64 from "android.util.Base64";
export { RecorderManagerFailImpl } export { RecorderManagerFailImpl }
const LOG_TAG = '[uni-recorder-x]'
// NOTE 避免被 vue Proxy 污染 // NOTE 避免被 vue Proxy 污染
const DEFAULT_DURATION = 1000 * 60 const DEFAULT_DURATION = 1000 * 60
const MAX_DURATION = DEFAULT_DURATION * 10 const MAX_DURATION = DEFAULT_DURATION * 10
...@@ -77,9 +75,7 @@ class RecorderManagerImpl implements RecorderManager, RecordingListener, AudioDa ...@@ -77,9 +75,7 @@ class RecorderManagerImpl implements RecorderManager, RecordingListener, AudioDa
this.manager.setRecordingListener(this) this.manager.setRecordingListener(this)
this.manager.setAudioDataListener(this) this.manager.setAudioDataListener(this)
this.manager.setMaxRecordingDuration(options.duration!.toLong()) this.manager.setMaxRecordingDuration(options.duration!.toLong())
const filePath = createFile(options.format! as string, options.saveDir) this.manager.startRecording(format, createFile(options.format! as string, options.saveDir))
console.log(`${LOG_TAG} start: format=${options.format}, sampleRate=${options.sampleRate}, channels=${options.numberOfChannels}, filePath=${filePath}`)
this.manager.startRecording(format, filePath)
} }
// override pause() : void { // override pause() : void {
// this.manager.pauseRecording() // this.manager.pauseRecording()
...@@ -88,7 +84,6 @@ class RecorderManagerImpl implements RecorderManager, RecordingListener, AudioDa ...@@ -88,7 +84,6 @@ class RecorderManagerImpl implements RecorderManager, RecordingListener, AudioDa
// this.manager.resumeRecording() // this.manager.resumeRecording()
// } // }
override stop() { override stop() {
console.log(`${LOG_TAG} stop: filePath=${this.manager.getFilePath()}`)
this.manager.stopRecording() this.manager.stopRecording()
} }
...@@ -156,15 +151,11 @@ class RecorderManagerImpl implements RecorderManager, RecordingListener, AudioDa ...@@ -156,15 +151,11 @@ class RecorderManagerImpl implements RecorderManager, RecordingListener, AudioDa
// } // }
override onRecordingStarted() { override onRecordingStarted() {
const filePath = this.manager.getFilePath()! let res = new RecorderManagerOnStartResultCallback(this.manager.getFilePath()!)
console.log(`${LOG_TAG} onStart: filePath=${filePath}`)
let res = new RecorderManagerOnStartResultCallback(filePath)
this.startCallback?.(res) this.startCallback?.(res)
} }
override onRecordingStopped() { override onRecordingStopped() {
const filePath = this.manager.getFilePath()! this.stopCallback?.(new RecorderManagerOnStopResultCallback(this.manager.getFilePath()!))
console.log(`${LOG_TAG} onStop: filePath=${filePath}`)
this.stopCallback?.(new RecorderManagerOnStopResultCallback(filePath))
} }
override onRecordingPaused() { override onRecordingPaused() {
// this.pauseCallback?.("") // this.pauseCallback?.("")
...@@ -173,7 +164,6 @@ class RecorderManagerImpl implements RecorderManager, RecordingListener, AudioDa ...@@ -173,7 +164,6 @@ class RecorderManagerImpl implements RecorderManager, RecordingListener, AudioDa
// this.resumeCallback?.("") // this.resumeCallback?.("")
} }
override onRecordingError(errorCode : Int, errorMessage : String) { override onRecordingError(errorCode : Int, errorMessage : String) {
console.log(`${LOG_TAG} onError: code=${errorCode}, msg=${errorMessage}`)
var error : IRecorderManagerFail var error : IRecorderManagerFail
if ([1107601, 1107602, 1107603, 1107604, 1107605, 1107606, 1107607, 1107608].indexOf(errorCode) >= 0) { if ([1107601, 1107602, 1107603, 1107604, 1107605, 1107606, 1107607, 1107608].indexOf(errorCode) >= 0) {
error = new RecorderManagerFailImpl(errorCode, RecorderManagerUniErrors[errorCode]!) error = new RecorderManagerFailImpl(errorCode, RecorderManagerUniErrors[errorCode]!)
......
...@@ -11,13 +11,10 @@ export interface StateChangeRes extends RecorderManagerOnStopResult { ...@@ -11,13 +11,10 @@ export interface StateChangeRes extends RecorderManagerOnStopResult {
export function onRecorderStateChange(state : RecorderState, res ?: StateChangeRes) : void { export function onRecorderStateChange(state : RecorderState, res ?: StateChangeRes) : void {
} }
const LOG_TAG = '[uni-recorder-x]'
export function createFile( format : string, saveDir ?: string | null) : string { export function createFile( format : string, saveDir ?: string | null) : string {
var dirPath : string var dirPath : string
if (saveDir != null && saveDir!.length > 0) { if (saveDir != null && saveDir!.length > 0) {
dirPath = saveDir! dirPath = saveDir!
console.log(`${LOG_TAG} createFile: 使用自定义目录 saveDir=${saveDir}`)
} else { } else {
let context = UTSAndroid.getAppContext() let context = UTSAndroid.getAppContext()
var parentPath = UTSAndroid.getAppCachePath() var parentPath = UTSAndroid.getAppCachePath()
...@@ -36,8 +33,6 @@ export function createFile( format : string, saveDir ?: string | null) : string ...@@ -36,8 +33,6 @@ export function createFile( format : string, saveDir ?: string | null) : string
} }
const random = UUID.randomUUID().toString().replace(/-/g, '').substring(0, 8) const random = UUID.randomUUID().toString().replace(/-/g, '').substring(0, 8)
const fileName = `${Date.now()}_${random}.${format.toLocaleLowerCase()}` const fileName = `${Date.now()}_${random}.${format.toLocaleLowerCase()}`
const filePath = `${dir.path}/${fileName}` return `${dir.path}/${fileName}`
console.log(`${LOG_TAG} createFile: 生成录音文件 path=${filePath}`)
return filePath
} }
export const supportFormats = ['aac'] export const supportFormats = ['aac']
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!