v2.28.1 抖音团购优化

This commit is contained in:
磷叶 2026-02-27 11:29:31 +08:00
parent 2a8c98fbea
commit 739b8e0310
6 changed files with 63 additions and 14 deletions

View File

@ -1,9 +1,9 @@
const install = (Vue, vm) => { const install = (Vue, vm) => {
uni.setStorageSync('deptId', 100); uni.setStorageSync('deptId', 100);
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
baseUrl: 'http://192.168.1.3:4101', //键辉本地 // baseUrl: 'http://192.168.1.3:4101', //键辉本地
// baseUrl: 'http://192.168.2.221:4101', //景森本地 // baseUrl: 'http://192.168.2.221:4101', //景森本地
// baseUrl: 'https://ele.ccttiot.com/prod-api', //线上 小鹿appid wx8a05cf95418a6859 小兔骑骑appidwx38f96c87621a87ab 遇福兴https://fu.chuantewulian.cn wxcb1d6a5d9dca8bbe baseUrl: 'https://ele.ccttiot.com/prod-api', //线上 小鹿appid wx8a05cf95418a6859 小兔骑骑appidwx38f96c87621a87ab 遇福兴https://fu.chuantewulian.cn wxcb1d6a5d9dca8bbe
// baseUrl: 'https://cc.ccttiot.com/prod-api', //叉车线上 // baseUrl: 'https://cc.ccttiot.com/prod-api', //叉车线上
// baseUrl:'https://ysd.chuantewulian.cn/prod-api', //嵛山岛线上api 嵛山岛appidwx4d178f8c80348214 // baseUrl:'https://ysd.chuantewulian.cn/prod-api', //嵛山岛线上api 嵛山岛appidwx4d178f8c80348214
loadingText: '努力加载中~', loadingText: '努力加载中~',

View File

@ -102,11 +102,15 @@
areaId:'', areaId:'',
channelId:'', channelId:'',
zfflag:true, zfflag:true,
area: {} area: {},
redirectUrl: '',
redirectRemark: ''
} }
}, },
onLoad(option) { onLoad(option) {
this.areaId = option.areaId this.areaId = option.areaId
this.redirectUrl = option.redirectUrl
this.redirectRemark = option.redirectRemark
this.getAreaDetail() this.getAreaDetail()
this.gethuiyuan() this.gethuiyuan()
this.getchannelid() this.getchannelid()
@ -219,7 +223,7 @@
}, },
goVerify() { goVerify() {
uni.navigateTo({ uni.navigateTo({
url: '/page_user/verify/index?areaId=' + this.areaId, url: `/page_user/verify/index?areaId=${this.areaId}&redirectUrl=${this.redirectUrl}&redirectRemark=${this.redirectRemark}`,
}) })
} }
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar title="我的会员" :border-bottom="false" :background="bgc" back-icon-color="#111827" title-color="#111827" <u-navbar title="我的卡包" :border-bottom="false" :background="bgc" back-icon-color="#111827" title-color="#111827"
title-size="34" title-bold height="44" :custom-back="btnfh"> title-size="34" title-bold height="44" :custom-back="btnfh">
</u-navbar> </u-navbar>
@ -69,13 +69,21 @@ export default {
bgc: { bgc: {
backgroundColor: "#F7F8FA", backgroundColor: "#F7F8FA",
}, },
type:'' type: '',
redirectUrl: '',
redirectRemark: ''
} }
}, },
onLoad(e) { onLoad(e) {
if(e.type){ if (e.type) {
this.type = e.type this.type = e.type
} }
if (e.redirectUrl) {
this.redirectUrl = decodeURIComponent(e.redirectUrl)
}
if (e.redirectRemark) {
this.redirectRemark = decodeURIComponent(e.redirectRemark)
}
}, },
onShow() { onShow() {
this.getlist() this.getlist()
@ -133,12 +141,14 @@ page {
padding: 16rpx 24rpx; padding: 16rpx 24rpx;
background: #FFFFFF; background: #FFFFFF;
margin-bottom: 2rpx; margin-bottom: 2rpx;
display: flex;
justify-content: flex-end;
gap: 32rpx;
} }
.jilu { .jilu {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end;
font-size: 28rpx; font-size: 28rpx;
color: #4297F3; color: #4297F3;
font-weight: 500; font-weight: 500;

View File

@ -1423,8 +1423,10 @@
}, },
// //
btnhuiyuan(){ btnhuiyuan(){
let redirectUrl = encodeURIComponent('/page_fenbao/storedlist/trueorder');
let redirectRemark = '前往下单';
uni.navigateTo({ uni.navigateTo({
url:'/page_fenbao/huiyuan/index?areaId=' + this.bikeobj.areaId url:`/page_fenbao/huiyuan/index?areaId=${this.bikeobj.areaId}&redirectUrl=${redirectUrl}&redirectRemark=${redirectRemark}`
}) })
}, },
// //

View File

@ -7,7 +7,8 @@
<text class="success-title">核销成功</text> <text class="success-title">核销成功</text>
<text class="success-coupon-name">{{ couponName }}</text> <text class="success-coupon-name">{{ couponName }}</text>
<view class="success-btns"> <view class="success-btns">
<view class="success-btn primary" @click="onViewCard">查看卡券</view> <view v-if="redirectUrl && redirectRemark" class="success-btn primary" @click="onRedirect">{{ redirectRemark }}</view>
<view v-else class="success-btn primary" @click="onViewCard">查看卡券</view>
<view class="success-btn secondary" @click="onContinueVerify">继续核销</view> <view class="success-btn secondary" @click="onContinueVerify">继续核销</view>
</view> </view>
</view> </view>
@ -18,6 +19,7 @@
/** /**
* 核销成功弹窗 * 核销成功弹窗
* 展示核销成功的卡券名称提供查看卡券继续核销两个操作 * 展示核销成功的卡券名称提供查看卡券继续核销两个操作
* 若传入 redirectUrlredirectRemark则额外显示重定向按钮按钮文字为 redirectRemark
*/ */
export default { export default {
name: 'VerifySuccessPopup', name: 'VerifySuccessPopup',
@ -29,6 +31,14 @@ export default {
couponName: { couponName: {
type: String, type: String,
default: '' default: ''
},
redirectUrl: {
type: String,
default: ''
},
redirectRemark: {
type: String,
default: ''
} }
}, },
computed: { computed: {
@ -47,6 +57,9 @@ export default {
}, },
onContinueVerify() { onContinueVerify() {
this.$emit('continueVerify') this.$emit('continueVerify')
},
onRedirect() {
this.$emit('redirect')
} }
} }
} }

View File

@ -96,8 +96,11 @@
<verify-success-popup <verify-success-popup
v-model="successPopupVisible" v-model="successPopupVisible"
:coupon-name="successCouponName" :coupon-name="successCouponName"
:redirect-url="redirectUrl"
:redirect-remark="redirectRemark"
@viewCard="onViewCard" @viewCard="onViewCard"
@continueVerify="onContinueVerify" @continueVerify="onContinueVerify"
@redirect="onRedirect"
/> />
</view> </view>
</template> </template>
@ -151,7 +154,9 @@ export default {
appId: '1', appId: '1',
areaId: null, areaId: null,
successPopupVisible: false, successPopupVisible: false,
successCouponName: '' successCouponName: '',
redirectUrl: '',
redirectRemark: ''
} }
}, },
computed: { computed: {
@ -162,6 +167,10 @@ export default {
onLoad(options) { onLoad(options) {
this.appId = this.$store.state.appid || '1' this.appId = this.$store.state.appid || '1'
this.areaId = options.areaId this.areaId = options.areaId
if (options.redirectUrl) {
this.redirectUrl = decodeURIComponent(options.redirectUrl)
}
this.redirectRemark = options.redirectRemark
this.initDefaultArea() this.initDefaultArea()
}, },
methods: { methods: {
@ -259,7 +268,7 @@ export default {
}) })
uni.hideLoading() uni.hideLoading()
if (res.code === 200) { if (res.code === 200) {
this.successCouponName = item.skuTitle || (item.vip && item.vip.name) || '卡券' this.successCouponName = item?.vip?.name
this.successPopupVisible = true this.successPopupVisible = true
this.couponCode = '' this.couponCode = ''
this.preparePayload = null this.preparePayload = null
@ -282,6 +291,17 @@ export default {
this.couponCode = '' this.couponCode = ''
this.preparePayload = null this.preparePayload = null
this.prepareItemList = [] this.prepareItemList = []
},
/** 重定向redirectRemark 按钮点击) */
onRedirect() {
this.successPopupVisible = false
if (this.redirectUrl) {
if (this.redirectUrl.startsWith('http')) {
uni.redirectTo({ url: '/page_fenbao/webview?url=' + encodeURIComponent(this.redirectUrl) })
} else {
uni.redirectTo({ url: this.redirectUrl.startsWith('/') ? this.redirectUrl : '/' + this.redirectUrl })
}
}
} }
} }
} }