Task:指引功能/状态接口对接

This commit is contained in:
modendeveloper
2025-01-19 02:52:58 +08:00
parent 85854ea2f6
commit bd2338f16a
13 changed files with 359 additions and 269 deletions
+13
View File
@@ -586,3 +586,16 @@ export function getHistory(params) {
export function getUserLike(params) {
return request.get('/cart/guessYouLike',params)
}
/**
* 用户功能指引状态
* @param {*} params
* @returns
*/
export function queryUserGuide(params) {
return request.get('/user/guide/status', params)
}
export function setUserGuide(params) {
return request.post('/user/guide/status', params)
}
+3
View File
@@ -93,6 +93,8 @@
},
next() {
this.throttle(() => {
console.log(this.functionGuideData.step, this.maxStep);
if (this.functionGuideData.step == this.maxStep) {
this.jump()
return
@@ -103,6 +105,7 @@
},
setFunctionGuideState() {
this.show = false
this.$emit('hide')
},
/* 节流 */
+37 -1
View File
@@ -1,3 +1,4 @@
import { queryUserGuide, setUserGuide } from '@/api/user'
export default {
data() {
return {
@@ -18,9 +19,44 @@ export default {
}
},
onLoad() {
this.$refs.FunctionGuide.init()
// this.setGuide('countyFamousIndex', 0)
// this.setGuide('landmarkGoodsIndex', 0)
// this.setGuide('findFunIndex', 0)
// this.setGuide('wellnessFoodIndex', 0)
// this.setGuide('ichIndex', 0)
// this.setGuide('wenwanIndex', 0)
// this.setGuide('goodsIndex', 0)
// this.setGuide('index', 0)
},
methods: {
setGuide(type, status = 1) {
const params = {
guideName: type,
guideStatus: status
}
setUserGuide(params).then(res => {
if(type === 'index') {
this.queryGuide(type)
}
})
},
queryGuide(type) {
const params = {
guideName: type
}
queryUserGuide(params).then(res => {
const { data, success } = res
if(success && data.guideStatus === 0) {
this.$refs.FunctionGuide.init()
}
if(type === 'index' && data.guideStatus === 1) {
this.isOldUser = true
}
if(type === 'index' && data.guideStatus === 0) {
this.isOldUser = false
}
})
},
setFunctionGuideData(data) {
this.functionGuideData = {
...this.functionGuideData,
+6 -2
View File
@@ -137,7 +137,7 @@
</view>
</mescroll-body>
</view>
<FunctionGuide :maxStep="maxStep" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<FunctionGuide :maxStep="maxStep" @hide="setGuide(pageKeyId)" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
</view>
</template>
@@ -197,7 +197,7 @@ export default {
maxStep() {
const stepsMap = {
0: 1,
1: 1,
1: 2,
}
return stepsMap[this.type] || 1
}
@@ -230,6 +230,7 @@ export default {
this.getMapData()
}
this.init()
this.queryGuide(this.pageKeyId)
},
methods: {
showFunctionGuide() {
@@ -294,6 +295,9 @@ export default {
})
return
} else {
if(this.type === 1) {
this.$refs.FunctionGuide.show = false
}
return
}
},
+14 -13
View File
@@ -162,7 +162,7 @@
:show-avatar="false"
/>
</view>
<FunctionGuide :maxStep="3" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<FunctionGuide @hide="setGuide('findFunIndex')" :maxStep="3" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<xdd-tabbar :curr-index="4" />
</view>
</template>
@@ -226,6 +226,7 @@ export default {
this.getMapData()
})
this.getIcon()
this.queryGuide('findFunIndex')
},
onShow() {
const memCityName = uni.getStorageSync('cityName')
@@ -302,10 +303,10 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
top: res.top + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${res.height}px`,
}
})
})
@@ -363,10 +364,10 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${(res.height-13)*2}rpx`,
top: res.top + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${(res.height-20)}px`,
}
})
})
@@ -412,10 +413,10 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: (res.top-10)*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
top: (res.top) + 'px',
left: res.left+10 + 'px',
width: `${res.width-20}px`,
height: `${res.height-20}px`,
}
})
})
+18 -2
View File
@@ -296,11 +296,11 @@
</view>
</view>
<!-- v9 老用户弹窗 -->
<!-- :show="isOldUser && oldUserPopup.image && lotteryCanDraw" -->
<u-popup
mode="center"
bgColor="transparent"
:show="isOldUser && oldUserPopup.image && lotteryCanDraw"
>
<view class="popup-old-user flex flex-col ai-center">
<image
@@ -338,7 +338,7 @@
@ok="handleOk"
paddingBottom="200rpx"
/>
<FunctionGuide :maxStep="15" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<FunctionGuide :maxStep="15" @hide="setGuide('index')" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<xdd-tabbar :curr-index="0" @getElementData="elementData" @getIcon="getIcon"/>
</view>
</template>
@@ -416,6 +416,7 @@ export default {
// uni.hideTabBar()
const _this = this
_this.init()
_this.queryGuide('index')
uni.getSystemInfo({
success: (e) => {
let statusBar = 0
@@ -443,6 +444,7 @@ export default {
this.scrollTop = e.scrollTop
},
methods: {
elementData(e) {
this.tabIconPostion = e
},
@@ -1341,6 +1343,20 @@ export default {
this.$yrouter.push('/pages/shop/GoodSearch/index')
},
goGoodsCon(item) {
if(item.isFarmerShop) {
if (item.farmerShopId === 0) {
uni.showToast({
title: '店铺装修中~',
icon: 'none',
duration: 3000
})
return
}
uni.navigateTo({
url: '/pagesInn/inn/farmerStore?id=' + item.farmerShopId + '&isQianxian=1&from=famous&isFarmer=1'
})
return
}
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
+9 -8
View File
@@ -84,7 +84,7 @@
@changeFun="changeFun"
@ok="handleOk"
/>
<FunctionGuide :maxStep="2" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<FunctionGuide @hide="setGuide('landmarkGoodsIndex')" :maxStep="2" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
</view>
</template>
@@ -152,6 +152,7 @@ export default {
this.sceneId = decodeURIComponent(opts.scene).split('&')[0].split('=')[1]
}
this.getNavList()
this.queryGuide('landmarkGoodsIndex')
},
onHide() {
this.pageToHideHandle()
@@ -218,10 +219,10 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
top: res.top + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${res.height}px`,
}
})
})
@@ -283,9 +284,9 @@ export default {
btnGroupPosition: '',
position: {
top: (res.top - res.height + 41)*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${(res.height+41)*2}rpx`,
left: res.left + 'px',
width: `${res.width}px`,
height: `${(res.height+41)}px`,
}
})
})
+12 -9
View File
@@ -174,7 +174,7 @@
:show-avatar="false"
/>
</view>
<FunctionGuide :maxStep="2" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<FunctionGuide :maxStep="4" @hide="setGuide('countyFamousIndex')" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
</view>
</template>
@@ -234,6 +234,7 @@ export default {
userBindParent({spread: parseInt(this.partnerId)})
}
this.init()
this.queryGuide('countyFamousIndex')
},
methods: {
showFunctionGuide() {
@@ -288,10 +289,10 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
top: res.top + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${res.height}px`,
}
})
})
@@ -348,14 +349,16 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
top: res.top + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${res.height}px`,
}
})
})
return
} else {
this.$refs.FunctionGuide.show = false
}
return
}
+20 -12
View File
@@ -640,7 +640,7 @@
@changeFun="changeFun"
@ok="handleOk"
/>
<FunctionGuide :maxStep="2" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<FunctionGuide @hide="setGuide('countyFamousIndex')" :maxStep="2" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
</view>
</template>
@@ -768,6 +768,7 @@ export default {
// this.initPoster()
this.getListReq()
this.getsaleList()
this.queryGuide('countyFamousIndex')
},
methods: {
showFunctionGuide() {
@@ -775,6 +776,7 @@ export default {
if(this.functionGuideData.step == 1) {
this._step = this.functionGuideData.step
this.$nextTick(() => {
this.getElementData('#tab-wrap', res=>{
const imgs = [
{
@@ -822,20 +824,26 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
top: res.top + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${res.height}px`,
}
})
})
})
return
} else {
if(this.functionGuideData.step == 2) {
this._step = this.functionGuideData.step
this.activeIndex = 4
this.$nextTick(() => {
this.getElementData('#farmer1', res=>{
uni.pageScrollTo({
scrollTop: 100,
duration: 300
})
const imgs = [
{
url: this.webUrl + '/引导页素材/千县名品/Group 4/Group 4-1.png',
@@ -843,7 +851,7 @@ export default {
position: 'absolute',
zIndex: 99,
width: '366rpx',
top: 560*2+'rpx',
top: 460*2+'rpx',
left: 80*2+'rpx',
height: '167rpx',
/* px: ; */
@@ -856,7 +864,7 @@ export default {
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 540*2+'rpx',
top: 440*2+'rpx',
left: -60*2+'rpx',
right: 0,
margin: 'auto',
@@ -870,7 +878,7 @@ export default {
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 540*2+'rpx',
top: 440*2+'rpx',
left: 200*2+'rpx',
height: '46rpx',
},
@@ -882,10 +890,10 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
top: res.top - 100 + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${res.height}px`,
}
})
})
+6 -9
View File
@@ -161,7 +161,7 @@
</view>
</view>
</view>
<FunctionGuide :maxStep="1" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<FunctionGuide :maxStep="1" @hide="setGuide('wellnessFoodIndex')" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
</view>
</template>
@@ -198,6 +198,7 @@ export default {
},
onLoad() {
this.init()
this.queryGuide('wellnessFoodIndex')
},
methods: {
showFunctionGuide() {
@@ -248,17 +249,13 @@ export default {
},
]
this.getElementData('#news-wrap', res=>{
this.setFunctionGuideData({
imgs: imgs,
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 - 10 + 'rpx',
left: res.left*2 - 20 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
padding: '10rpx 20rpx'
top: res.top + 'px',
left: res.left + 'rpx',
width: `${res.width}px`,
height: `${res.height}px`,
}
})
})
+16 -9
View File
@@ -2,7 +2,7 @@
<view class="pkg-product-heritage">
<image style="width: 100%" :src="topImage" mode="widthFix" />
<view class="main-box" id="main-box">
<image style="width: 100%" :src="backgroundImage" mode="widthFix" />
<image style="width: 100%" :src="backgroundImage" mode="widthFix" @load="loadImg" />
<view
class="item"
:style="{ left: item.gx + 'rpx', top: item.gy + 'rpx' }"
@@ -18,7 +18,7 @@
</view>
</view>
<FunctionGuide :maxStep="1" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<FunctionGuide :maxStep="3" @hide='setGuide("ichIndex")' :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
</view>
</template>
@@ -50,13 +50,18 @@ export default {
},
onLoad() {
this.init();
this.queryGuide('ichIndex')
},
methods: {
loadImg(e) {
this.queryGuide('ichIndex')
},
showFunctionGuide() {
if(this._step == this.functionGuideData.step) return
if(this.functionGuideData.step == 1) {
this._step = this.functionGuideData.step
this.$nextTick(() => {
this.getElementData('#main-box', res=>{
const imgs = [
{
@@ -65,7 +70,7 @@ export default {
position: 'absolute',
zIndex: 99,
width: '468rpx',
top: 180*2+'rpx',
top: 80*2+'rpx',
left: res.left*2+'rpx',
height: '670rpx',
/* px: ; */
@@ -78,7 +83,7 @@ export default {
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 160*2+'rpx',
top: 60*2+'rpx',
left: -160*2+'rpx',
right: 0,
margin: 'auto',
@@ -92,7 +97,7 @@ export default {
position: 'absolute',
zIndex: 99,
width: '117rpx',
top: 160*2+'rpx',
top: 60*2+'rpx',
left: 160*2+'rpx',
height: '46rpx',
},
@@ -104,15 +109,17 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*4}rpx`,
top: res.top + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${res.height}px`,
}
})
})
})
return
} else {
this.$refs.FunctionGuide.show = false
return
}
},
+13 -13
View File
@@ -68,7 +68,7 @@
/>
</view>
</view>
<FunctionGuide :maxStep="2" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<FunctionGuide :maxStep="2" @hide="setGuide('ichIndex')" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
</view>
</template>
@@ -92,6 +92,7 @@ export default {
onLoad(opts) {
this.id = opts.id
this.getDetails()
this.queryGuide('ichIndex')
},
methods: {
showFunctionGuide() {
@@ -107,7 +108,7 @@ export default {
position: 'absolute',
zIndex: 99,
width: '405rpx',
top: 360*2+'rpx',
top: 350*2+'rpx',
left: res.left*2+'rpx',
height: '218rpx',
/* px: ; */
@@ -146,17 +147,17 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 -20 + 'rpx',
left: res.left*2 -10 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
padding: '20rpx 10rpx',
top: res.top + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${res.height}px`
}
})
})
return
} else {
this._step = this.functionGuideData.step
this.actived = 2
this.getElementData('#tab-btn2', res=>{
const imgs = [
{
@@ -165,7 +166,7 @@ export default {
position: 'absolute',
zIndex: 99,
width: '496rpx',
top: 360*2+'rpx',
top: 350*2+'rpx',
left: 60+'rpx',
height: '183rpx',
/* px: ; */
@@ -204,11 +205,10 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 -20 + 'rpx',
left: res.left*2 -10 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
padding: '20rpx 10rpx',
top: res.top + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${res.height}px`,
}
})
})
+6 -5
View File
@@ -36,7 +36,7 @@
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
<view class="text">暂无数据</view>
</view>
<FunctionGuide :maxStep="1" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
<FunctionGuide :maxStep="1" @hide="setGuide('wenwanIndex')" :guideData="functionGuideData" ref="FunctionGuide"></FunctionGuide>
</view>
</template>
@@ -62,6 +62,7 @@ export default {
},
onLoad(option) {
this.cityId = option.cityId;
this.queryGuide('wenwanIndex')
},
onShow() {
let memCityName = uni.getStorageSync("cityName")
@@ -133,10 +134,10 @@ export default {
tipsPosition: '420rpx',
btnGroupPosition: '',
position: {
top: res.top*2 + 'rpx',
left: res.left*2 + 'rpx',
width: `${res.width*2}rpx`,
height: `${res.height*2}rpx`,
top: res.top + 'px',
left: res.left + 'px',
width: `${res.width}px`,
height: `${res.height}px`,
}
})
})