mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-11-13 04:18:53 +08:00
Merge branch 'feat/appointment-goods'
This commit is contained in:
408
App.vue
408
App.vue
@@ -1,202 +1,206 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import config from '@/config/config'
|
import config from '@/config/config'
|
||||||
import { getClipboardData } from '@/js_sdk/h5-copy/h5-copy.js'
|
import { getClipboardData } from '@/js_sdk/h5-copy/h5-copy.js'
|
||||||
import APPUpdate from '@/plugins/APPUpdate'
|
import APPUpdate from '@/plugins/APPUpdate'
|
||||||
import storage from '@/utils/storage'
|
import storage from '@/utils/storage'
|
||||||
import { getThemeSetting } from '@/api/common.js'
|
import { getThemeSetting } from '@/api/common.js'
|
||||||
import {
|
import {
|
||||||
applyTabBarStyle,
|
applyTabBarStyle,
|
||||||
cacheTheme,
|
cacheTheme,
|
||||||
loadCachedTheme,
|
loadCachedTheme,
|
||||||
normalizeTheme,
|
normalizeTheme,
|
||||||
} from '@/utils/theme'
|
} from '@/utils/theme'
|
||||||
import { onLaunch, onShow } from '@dcloudio/uni-app'
|
import { onLaunch, onShow } from '@dcloudio/uni-app'
|
||||||
import { useStore } from '@/store'
|
import { useStore } from '@/store'
|
||||||
import { handleAppLaunchScene } from '@/utils/distributionBind.js'
|
import { handleAppLaunchScene } from '@/utils/distributionBind.js'
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
wx.onAppRoute(() => {})
|
wx.onAppRoute((res) => {
|
||||||
// #endif
|
applyTabBarStyle(store.state.theme && store.state.theme.mainColor, res && res.path)
|
||||||
|
})
|
||||||
onLaunch((val) => {
|
// #endif
|
||||||
initTheme()
|
|
||||||
handleAppLaunchScene(val)
|
onLaunch((val) => {
|
||||||
if (val?.query?.inviter) {
|
initTheme()
|
||||||
storage.setInviter(val.query.inviter)
|
handleAppLaunchScene(val)
|
||||||
}
|
if (val?.query?.inviter) {
|
||||||
|
storage.setInviter(val.query.inviter)
|
||||||
// #ifdef APP-PLUS
|
}
|
||||||
plus.globalEvent.addEventListener('newintent', () => {
|
|
||||||
checkArguments()
|
// #ifdef APP-PLUS
|
||||||
})
|
plus.globalEvent.addEventListener('newintent', () => {
|
||||||
// #endif
|
checkArguments()
|
||||||
|
})
|
||||||
// #ifdef MP-WEIXIN
|
// #endif
|
||||||
applyUpdateWeChat()
|
|
||||||
// #endif
|
// #ifdef MP-WEIXIN
|
||||||
})
|
applyUpdateWeChat()
|
||||||
|
// #endif
|
||||||
onShow(() => {
|
})
|
||||||
// #ifndef H5
|
|
||||||
if (config.enableGetClipboard) {
|
onShow(() => {
|
||||||
getClipboard()
|
applyTabBarStyle(store.state.theme && store.state.theme.mainColor)
|
||||||
}
|
|
||||||
// #endif
|
// #ifndef H5
|
||||||
|
if (config.enableGetClipboard) {
|
||||||
// #ifdef APP-PLUS
|
getClipboard()
|
||||||
if (storage.getShow()) {
|
}
|
||||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
// #endif
|
||||||
uni.navigateTo({ url: '/pages/tabbar/screen/fullScreen' })
|
|
||||||
}
|
// #ifdef APP-PLUS
|
||||||
}
|
if (storage.getShow()) {
|
||||||
// #endif
|
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||||
})
|
uni.navigateTo({ url: '/pages/tabbar/screen/fullScreen' })
|
||||||
|
}
|
||||||
function initTheme() {
|
}
|
||||||
const cached = loadCachedTheme()
|
// #endif
|
||||||
if (cached) {
|
})
|
||||||
store.commit('SET_THEME', cached)
|
|
||||||
applyTabBarStyle(cached.mainColor)
|
function initTheme() {
|
||||||
}
|
const cached = loadCachedTheme()
|
||||||
getThemeSetting()
|
if (cached) {
|
||||||
.then((res) => {
|
store.commit('SET_THEME', cached)
|
||||||
if (res.data?.success && res.data.result?.settingValue) {
|
applyTabBarStyle(cached.mainColor)
|
||||||
try {
|
}
|
||||||
const raw = JSON.parse(res.data.result.settingValue)
|
getThemeSetting()
|
||||||
const theme = normalizeTheme(raw)
|
.then((res) => {
|
||||||
store.commit('SET_THEME', theme)
|
if (res.data?.success && res.data.result?.settingValue) {
|
||||||
cacheTheme(theme)
|
try {
|
||||||
applyTabBarStyle(theme.mainColor)
|
const raw = JSON.parse(res.data.result.settingValue)
|
||||||
} catch (e) {
|
const theme = normalizeTheme(raw)
|
||||||
// 主题配置解析失败时使用缓存
|
store.commit('SET_THEME', theme)
|
||||||
}
|
cacheTheme(theme)
|
||||||
}
|
applyTabBarStyle(theme.mainColor)
|
||||||
})
|
} catch (e) {
|
||||||
.catch(() => {})
|
// 主题配置解析失败时使用缓存
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function applyUpdateWeChat() {
|
})
|
||||||
const updateManager = uni.getUpdateManager()
|
.catch(() => {})
|
||||||
|
}
|
||||||
updateManager.onCheckForUpdate(() => {})
|
|
||||||
|
function applyUpdateWeChat() {
|
||||||
updateManager.onUpdateReady(() => {
|
const updateManager = uni.getUpdateManager()
|
||||||
uni.showModal({
|
|
||||||
title: '更新提示',
|
updateManager.onCheckForUpdate(() => {})
|
||||||
content: '发现新版本,是否重启应用?',
|
|
||||||
success(res) {
|
updateManager.onUpdateReady(() => {
|
||||||
if (res.confirm) {
|
uni.showModal({
|
||||||
updateManager.applyUpdate()
|
title: '更新提示',
|
||||||
}
|
content: '发现新版本,是否重启应用?',
|
||||||
},
|
success(res) {
|
||||||
})
|
if (res.confirm) {
|
||||||
})
|
updateManager.applyUpdate()
|
||||||
|
}
|
||||||
updateManager.onUpdateFailed(() => {})
|
},
|
||||||
}
|
})
|
||||||
|
})
|
||||||
function launch() {
|
|
||||||
try {
|
updateManager.onUpdateFailed(() => {})
|
||||||
const value = uni.getStorageSync('launchFlag')
|
}
|
||||||
if (!value) {
|
|
||||||
// uni.navigateTo({ url: '/pages/index/agreement' })
|
function launch() {
|
||||||
} else {
|
try {
|
||||||
const w = plus.webview.open(
|
const value = uni.getStorageSync('launchFlag')
|
||||||
'/hybrid/html/advertise/advertise.html',
|
if (!value) {
|
||||||
'本地地址',
|
// uni.navigateTo({ url: '/pages/index/agreement' })
|
||||||
{
|
} else {
|
||||||
top: 0,
|
const w = plus.webview.open(
|
||||||
bottom: 0,
|
'/hybrid/html/advertise/advertise.html',
|
||||||
zindex: 999,
|
'本地地址',
|
||||||
},
|
{
|
||||||
'fade-in',
|
top: 0,
|
||||||
500,
|
bottom: 0,
|
||||||
)
|
zindex: 999,
|
||||||
setTimeout(() => {
|
},
|
||||||
plus.webview.close(w)
|
'fade-in',
|
||||||
APPUpdate()
|
500,
|
||||||
}, 3000)
|
)
|
||||||
}
|
setTimeout(() => {
|
||||||
} catch (e) {
|
plus.webview.close(w)
|
||||||
uni.setStorage({
|
APPUpdate()
|
||||||
key: 'launchFlag',
|
}, 3000)
|
||||||
data: true,
|
}
|
||||||
success() {
|
} catch (e) {
|
||||||
console.log('error时存储launchFlag')
|
uni.setStorage({
|
||||||
},
|
key: 'launchFlag',
|
||||||
})
|
data: true,
|
||||||
}
|
success() {
|
||||||
}
|
console.log('error时存储launchFlag')
|
||||||
|
},
|
||||||
async function getClipboard() {
|
})
|
||||||
const res = await getClipboardData()
|
}
|
||||||
if (res.indexOf(config.shareLink) != -1 && res != store.state.shareLink) {
|
}
|
||||||
store.state.shareLink = res
|
|
||||||
uni.showModal({
|
async function getClipboard() {
|
||||||
title: '提示',
|
const res = await getClipboardData()
|
||||||
content: '检测到一个分享链接是否跳转?',
|
if (res.indexOf(config.shareLink) != -1 && res != store.state.shareLink) {
|
||||||
confirmText: '跳转',
|
store.state.shareLink = res
|
||||||
success(callback) {
|
uni.showModal({
|
||||||
if (callback.confirm) {
|
title: '提示',
|
||||||
const path = res.split(config.shareLink)[1]
|
content: '检测到一个分享链接是否跳转?',
|
||||||
if (path.indexOf('tabbar') != -1) {
|
confirmText: '跳转',
|
||||||
uni.switchTab({ url: path })
|
success(callback) {
|
||||||
} else {
|
if (callback.confirm) {
|
||||||
uni.navigateTo({ url: path })
|
const path = res.split(config.shareLink)[1]
|
||||||
}
|
if (path.indexOf('tabbar') != -1) {
|
||||||
}
|
uni.switchTab({ url: path })
|
||||||
},
|
} else {
|
||||||
})
|
uni.navigateTo({ url: path })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
function checkArguments() {
|
})
|
||||||
// #ifdef APP-PLUS
|
}
|
||||||
setTimeout(() => {
|
}
|
||||||
const args = plus.runtime.arguments
|
|
||||||
if (args) {
|
function checkArguments() {
|
||||||
const argsStr = decodeURIComponent(args)
|
// #ifdef APP-PLUS
|
||||||
const path = argsStr.split('//')[1]
|
setTimeout(() => {
|
||||||
if (path.indexOf('tabbar') != -1) {
|
const args = plus.runtime.arguments
|
||||||
uni.switchTab({ url: `/${path}` })
|
if (args) {
|
||||||
} else {
|
const argsStr = decodeURIComponent(args)
|
||||||
uni.navigateTo({ url: `/${path}` })
|
const path = argsStr.split('//')[1]
|
||||||
}
|
if (path.indexOf('tabbar') != -1) {
|
||||||
}
|
uni.switchTab({ url: `/${path}` })
|
||||||
})
|
} else {
|
||||||
// #endif
|
uni.navigateTo({ url: `/${path}` })
|
||||||
}
|
}
|
||||||
</script>
|
}
|
||||||
|
})
|
||||||
<style lang="scss">
|
// #endif
|
||||||
@import "uview-plus/index.scss";
|
}
|
||||||
@import "@/styles/uview-form-fix.scss";
|
</script>
|
||||||
|
|
||||||
// -------适配底部安全区 苹果x系列刘海屏
|
<style lang="scss">
|
||||||
|
@import "uview-plus/index.scss";
|
||||||
// #ifdef MP-WEIXIN
|
@import "@/styles/uview-form-fix.scss";
|
||||||
.mp-iphonex-bottom {
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom);
|
// -------适配底部安全区 苹果x系列刘海屏
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
|
||||||
box-sizing: content-box;
|
// #ifdef MP-WEIXIN
|
||||||
height: auto !important;
|
.mp-iphonex-bottom {
|
||||||
padding-top: 10rpx;
|
padding-bottom: constant(safe-area-inset-bottom);
|
||||||
}
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
box-sizing: content-box;
|
||||||
// #endif
|
height: auto !important;
|
||||||
|
padding-top: 10rpx;
|
||||||
body {
|
}
|
||||||
background-color: $bg-color;
|
|
||||||
}
|
// #endif
|
||||||
|
|
||||||
/************************ */
|
body {
|
||||||
.w200 {
|
background-color: $bg-color;
|
||||||
width: 200rpx !important;
|
}
|
||||||
}
|
|
||||||
|
/************************ */
|
||||||
.flex1 {
|
.w200 {
|
||||||
flex: 1; //必须父级设置flex
|
width: 200rpx !important;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
.flex1 {
|
||||||
|
flex: 1; //必须父级设置flex
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="poster-panel">
|
<view class="poster-panel">
|
||||||
<view class="poster-hint">点击海报预览后可保存到相册</view>
|
<view v-if="posterList.length" class="poster-hint">点击海报预览后可保存到相册</view>
|
||||||
|
|
||||||
<view v-if="loading" class="loading-wrap">
|
<view v-if="loading" class="loading-wrap">
|
||||||
<text class="loading-text">海报生成中...</text>
|
<text class="loading-text">海报生成中...</text>
|
||||||
@@ -226,8 +226,10 @@ async function generatePosters() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// #ifndef MP-WEIXIN
|
// #ifndef MP-WEIXIN
|
||||||
loadError.value = '请在微信小程序中生成海报'
|
{
|
||||||
return
|
loadError.value = '请在微信小程序中生成海报'
|
||||||
|
return
|
||||||
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@@ -463,23 +465,38 @@ function saveCurrentPoster() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.loading-wrap {
|
.loading-wrap {
|
||||||
padding: 120rpx 0;
|
display: flex;
|
||||||
text-align: center;
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 80rpx 48rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-text {
|
.loading-text {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
line-height: 1.6;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.retry-btn {
|
||||||
|
margin-top: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.retry-btn,
|
.retry-btn,
|
||||||
.save-btn {
|
.save-btn {
|
||||||
display: inline-block;
|
display: inline-flex;
|
||||||
padding: 12rpx 40rpx;
|
align-items: center;
|
||||||
border-radius: 30rpx;
|
justify-content: center;
|
||||||
|
height: 64rpx;
|
||||||
|
padding: 0 40rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
background: linear-gradient(90deg, #ff9f3f, #ff6b35);
|
background: linear-gradient(90deg, #ff9f3f, #ff6b35);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poster-swiper {
|
.poster-swiper {
|
||||||
|
|||||||
@@ -7,6 +7,12 @@
|
|||||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
|
||||||
/>
|
/>
|
||||||
<title></title>
|
<title></title>
|
||||||
|
<!-- H5 构建会把 process.env 替换成空对象,但运行时仍会读取 process,浏览器中不存在该变量 -->
|
||||||
|
<script>
|
||||||
|
if (typeof process === "undefined") {
|
||||||
|
window.process = { env: {} };
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<!--preload-links-->
|
<!--preload-links-->
|
||||||
<!--app-context-->
|
<!--app-context-->
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
v-model="bindForm.cardSecret"
|
v-model="bindForm.cardSecret"
|
||||||
border="none"
|
border="none"
|
||||||
maxlength="128"
|
maxlength="128"
|
||||||
password
|
|
||||||
placeholder="请输入兑换码(卡密)"
|
placeholder="请输入兑换码(卡密)"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
padding: 2rpx 20rpx;
|
padding: 2rpx 20rpx;
|
||||||
}
|
}
|
||||||
.list {
|
.list {
|
||||||
|
padding-bottom: calc(140rpx + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
|
||||||
|
|
||||||
.item:hover {
|
.item:hover {
|
||||||
background: #ededed;
|
background: #ededed;
|
||||||
}
|
}
|
||||||
@@ -115,21 +118,28 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-bar {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 99;
|
||||||
|
padding: 20rpx 30rpx calc(20rpx + constant(safe-area-inset-bottom));
|
||||||
|
padding: 20rpx 30rpx calc(20rpx + env(safe-area-inset-bottom));
|
||||||
|
background: $page-color-base;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
background: $light-color;
|
background: $light-color;
|
||||||
position: fixed;
|
width: 100%;
|
||||||
width: 690rpx;
|
|
||||||
bottom: calc(60rpx + constant(safe-area-inset-bottom));
|
|
||||||
bottom: calc(60rpx + env(safe-area-inset-bottom));
|
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
left: 30rpx;
|
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
z-index: 99;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.btn-text {
|
.btn-text {
|
||||||
|
|||||||
@@ -1,138 +1,135 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="address">
|
<view class="address">
|
||||||
|
|
||||||
<u-empty class="empty" v-if="addressList.length == 0" text="暂无收货地址" mode="address"></u-empty>
|
<u-empty class="empty" v-if="addressList.length == 0" text="暂无收货地址" mode="address"></u-empty>
|
||||||
<view class="list" v-else>
|
<view class="list" v-else>
|
||||||
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
||||||
<view class="basic" @click="selectAddressData(item)">
|
<view class="basic" @click="selectAddressData(item)">
|
||||||
<text>{{ item.name }}</text>
|
<text>{{ item.name }}</text>
|
||||||
<text>{{ item.mobile }}</text>
|
<text>{{ item.mobile }}</text>
|
||||||
<text class="default" v-show="item.isDefault">默认</text>
|
<text class="default" v-show="item.isDefault">默认</text>
|
||||||
<view>
|
<view>
|
||||||
<div class="region">
|
<div class="region">
|
||||||
<span v-if="item.consigneeAddressPath[0]">{{item.consigneeAddressPath[0]}}</span>
|
<span v-if="item.consigneeAddressPath[0]">{{item.consigneeAddressPath[0]}}</span>
|
||||||
<span v-if="item.consigneeAddressPath[1]">{{item.consigneeAddressPath[1]}}</span>
|
<span v-if="item.consigneeAddressPath[1]">{{item.consigneeAddressPath[1]}}</span>
|
||||||
<span v-if="item.consigneeAddressPath[2]">{{item.consigneeAddressPath[2]}}</span>
|
<span v-if="item.consigneeAddressPath[2]">{{item.consigneeAddressPath[2]}}</span>
|
||||||
<span v-if="item.consigneeAddressPath[3]">{{item.consigneeAddressPath[3]}}</span>
|
<span v-if="item.consigneeAddressPath[3]">{{item.consigneeAddressPath[3]}}</span>
|
||||||
<span>{{ item.detail }}</span>
|
<span>{{ item.detail }}</span>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="edit">
|
<view class="edit">
|
||||||
<view class="relative" @click="setDefault(item)">
|
<view class="relative" @click="setDefault(item)">
|
||||||
<view v-if="item.isDefault" class="alifont icon-xuanzhong"></view>
|
<view v-if="item.isDefault" class="alifont icon-xuanzhong"></view>
|
||||||
<text v-else class="unchecked"></text>
|
<text v-else class="unchecked"></text>
|
||||||
<text>{{ item.isDefault ? "默认地址" : "设为默认" }}</text>
|
<text>{{ item.isDefault ? "默认地址" : "设为默认" }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="relative">
|
<view class="relative">
|
||||||
<view class="alifont icon-bianji-copy"></view>
|
<view class="alifont icon-bianji-copy"></view>
|
||||||
<text class="mr-40" @click="addAddress(item.id)">编辑</text>
|
<text class="mr-40" @click="addAddress(item.id)">编辑</text>
|
||||||
<view class="alifont icon-lajitong"></view>
|
<view class="alifont icon-lajitong" @click.stop="removeAddress(item.id)"></view>
|
||||||
<text @click="removeAddress(item.id)">删除</text>
|
<text @click.stop="removeAddress(item.id)">删除</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="height: 100px"></view>
|
<view style="height: 100px"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @click="addAddress('')">
|
<view class="btn" @click="addAddress('')">
|
||||||
<u-icon name="plus-circle" color="#ffffff" size="18"></u-icon>
|
<u-icon name="plus-circle" color="#ffffff" size="18"></u-icon>
|
||||||
<text class="btn-text">添加新收货人</text>
|
<text class="btn-text">添加新收货人</text>
|
||||||
</view>
|
</view>
|
||||||
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
</view>
|
||||||
</view>
|
</template>
|
||||||
</template>
|
|
||||||
|
<script setup lang="ts">
|
||||||
<script setup lang="ts">
|
import { ref } from 'vue'
|
||||||
import { ref } from 'vue'
|
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||||
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app'
|
import { useStore } from '@/store'
|
||||||
import { useStore } from '@/store'
|
import * as API_Trade from '@/api/trade'
|
||||||
import * as API_Trade from '@/api/trade'
|
import * as API_Address from '@/api/address.js'
|
||||||
import * as API_Address from '@/api/address.js'
|
|
||||||
|
const store = useStore()
|
||||||
const store = useStore()
|
|
||||||
|
const addressList = ref<any[]>([])
|
||||||
const addressList = ref<any[]>([])
|
const routerVal = ref<Record<string, string>>({})
|
||||||
const showAction = ref(false)
|
const params = { pageNumber: 1, pageSize: 1000 }
|
||||||
const removeList = [{ text: '确定' }]
|
|
||||||
const tips = { text: '确定要删除该收货人信息吗?' }
|
onPullDownRefresh(() => {
|
||||||
const removeId = ref('')
|
addressList.value = []
|
||||||
const routerVal = ref<Record<string, string>>({})
|
getAddressList()
|
||||||
const params = { pageNumber: 1, pageSize: 1000 }
|
})
|
||||||
|
|
||||||
onPullDownRefresh(() => {
|
onLoad((val) => {
|
||||||
addressList.value = []
|
routerVal.value = val || {}
|
||||||
getAddressList()
|
})
|
||||||
})
|
|
||||||
|
onShow(() => {
|
||||||
onLoad((val) => {
|
addressList.value = []
|
||||||
routerVal.value = val || {}
|
getAddressList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onShow(() => {
|
function hideLoadingIfNeeded() {
|
||||||
addressList.value = []
|
if (store.state.isShowToast) uni.hideLoading()
|
||||||
getAddressList()
|
}
|
||||||
})
|
|
||||||
|
async function selectAddressData(val: any) {
|
||||||
function hideLoadingIfNeeded() {
|
await API_Trade.setAddressId(val.id, routerVal.value.way)
|
||||||
if (store.state.isShowToast) uni.hideLoading()
|
uni.navigateBack({ delta: 1 })
|
||||||
}
|
}
|
||||||
|
|
||||||
async function selectAddressData(val: any) {
|
function getAddressList() {
|
||||||
await API_Trade.setAddressId(val.id, routerVal.value.way)
|
uni.showLoading()
|
||||||
uni.navigateBack({ delta: 1 })
|
API_Address.getAddressList(params.pageNumber, params.pageSize).then((res) => {
|
||||||
}
|
res.data.result.records.forEach((item: any) => {
|
||||||
|
item.consigneeAddressPath = item.consigneeAddressPath.split(',')
|
||||||
function getAddressList() {
|
})
|
||||||
uni.showLoading()
|
addressList.value = res.data.result.records
|
||||||
API_Address.getAddressList(params.pageNumber, params.pageSize).then((res) => {
|
hideLoadingIfNeeded()
|
||||||
res.data.result.records.forEach((item: any) => {
|
})
|
||||||
item.consigneeAddressPath = item.consigneeAddressPath.split(',')
|
}
|
||||||
})
|
|
||||||
addressList.value = res.data.result.records
|
function removeAddress(id: string) {
|
||||||
hideLoadingIfNeeded()
|
uni.showModal({
|
||||||
})
|
title: '提示',
|
||||||
}
|
content: '确定要删除该收货人信息吗?',
|
||||||
|
success: (res) => {
|
||||||
function removeAddress(id: string) {
|
if (!res.confirm) return
|
||||||
removeId.value = id
|
API_Address.deleteAddress(id).then((result) => {
|
||||||
showAction.value = true
|
if (result.statusCode == 200) {
|
||||||
}
|
uni.showToast({ icon: 'none', title: '删除成功' })
|
||||||
|
getAddressList()
|
||||||
function deleteAddressMessage() {
|
} else {
|
||||||
API_Address.deleteAddress(removeId.value).then((res) => {
|
uni.showToast({ icon: 'none', title: result.data.message, duration: 2000 })
|
||||||
if (res.statusCode == 200) {
|
}
|
||||||
uni.showToast({ icon: 'none', title: '删除成功' })
|
})
|
||||||
getAddressList()
|
},
|
||||||
} else {
|
})
|
||||||
uni.showToast({ icon: 'none', title: res.data.message, duration: 2000 })
|
}
|
||||||
}
|
|
||||||
})
|
function addAddress(id: string) {
|
||||||
}
|
if (id) {
|
||||||
|
uni.navigateTo({
|
||||||
function addAddress(id: string) {
|
url: `/pages/mine/address/add?id=${id}&way=${routerVal.value.way}&type=order`,
|
||||||
if (id) {
|
})
|
||||||
uni.navigateTo({
|
} else {
|
||||||
url: `/pages/mine/address/add?id=${id}&way=${routerVal.value.way}&type=order`,
|
uni.navigateTo({
|
||||||
})
|
url: `/pages/mine/address/add?way=${routerVal.value.way}&type=order`,
|
||||||
} else {
|
})
|
||||||
uni.navigateTo({
|
}
|
||||||
url: `/pages/mine/address/add?way=${routerVal.value.way}&type=order`,
|
}
|
||||||
})
|
|
||||||
}
|
function setDefault(item: any) {
|
||||||
}
|
delete item.updateBy
|
||||||
|
delete item.updateTime
|
||||||
function setDefault(item: any) {
|
delete item.deleteFlag
|
||||||
delete item.updateBy
|
if (!item.isDefault) item.isDefault = true
|
||||||
delete item.updateTime
|
API_Address.editAddress(item).then(() => {
|
||||||
delete item.deleteFlag
|
uni.showToast({ title: '设置默认地址成功', icon: 'none' })
|
||||||
if (!item.isDefault) item.isDefault = true
|
getAddressList()
|
||||||
API_Address.editAddress(item).then(() => {
|
})
|
||||||
uni.showToast({ title: '设置默认地址成功', icon: 'none' })
|
}
|
||||||
getAddressList()
|
</script>
|
||||||
})
|
|
||||||
}
|
<style lang="scss" scoped>
|
||||||
</script>
|
@import "./address.scss";
|
||||||
|
</style>
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import "./address.scss";
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -26,20 +26,19 @@
|
|||||||
<view class="relative">
|
<view class="relative">
|
||||||
<view class="alifont icon-bianji-copy"></view>
|
<view class="alifont icon-bianji-copy"></view>
|
||||||
<text class="mr-40" @click="addAddress(item.id)">编辑</text>
|
<text class="mr-40" @click="addAddress(item.id)">编辑</text>
|
||||||
<view class="alifont icon-lajitong"></view>
|
<view class="alifont icon-lajitong" @click.stop="removeAddress(item.id)"></view>
|
||||||
<text @click="removeAddress(item.id)">删除</text>
|
<text @click.stop="removeAddress(item.id)">删除</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="height: 100px"></view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="btn" @click="addAddress('')">
|
<view class="btn-bar">
|
||||||
<u-icon name="plus-circle" color="#ffffff" size="18"></u-icon>
|
<view class="btn" @click="addAddress('')">
|
||||||
<text class="btn-text">添加新收货人</text>
|
<u-icon name="plus-circle" color="#ffffff" size="18"></u-icon>
|
||||||
|
<text class="btn-text">添加新收货人</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -53,10 +52,6 @@ import * as API_Address from '@/api/address.js'
|
|||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
const addressList = ref<any[]>([])
|
const addressList = ref<any[]>([])
|
||||||
const showAction = ref(false)
|
|
||||||
const removeList = [{ text: '确定' }]
|
|
||||||
const tips = { text: '确定要删除该收货人信息吗?' }
|
|
||||||
const removeId = ref('')
|
|
||||||
const routerVal = ref<Record<string, string>>({})
|
const routerVal = ref<Record<string, string>>({})
|
||||||
const params = { pageNumber: 1, pageSize: 1000 }
|
const params = { pageNumber: 1, pageSize: 1000 }
|
||||||
|
|
||||||
@@ -96,18 +91,20 @@ function getAddressList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function removeAddress(id: string) {
|
function removeAddress(id: string) {
|
||||||
removeId.value = id
|
uni.showModal({
|
||||||
showAction.value = true
|
title: '提示',
|
||||||
}
|
content: '确定要删除该收货人信息吗?',
|
||||||
|
success: (res) => {
|
||||||
function deleteAddressMessage() {
|
if (!res.confirm) return
|
||||||
API_Address.deleteAddress(removeId.value).then((res) => {
|
API_Address.deleteAddress(id).then((result) => {
|
||||||
if (res.statusCode == 200) {
|
if (result.statusCode == 200) {
|
||||||
uni.showToast({ icon: 'none', title: '删除成功' })
|
uni.showToast({ icon: 'none', title: '删除成功' })
|
||||||
getAddressList()
|
getAddressList()
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ icon: 'none', title: res.data.message, duration: 2000 })
|
uni.showToast({ icon: 'none', title: result.data.message, duration: 2000 })
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="height: 100px"></view>
|
<view style="height: 100px"></view>
|
||||||
</view>
|
</view>
|
||||||
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
<u-action-sheet
|
||||||
|
:actions="removeList"
|
||||||
|
:description="tips.text"
|
||||||
|
cancel-text="取消"
|
||||||
|
v-model:show="showAction"
|
||||||
|
@select="deleteAddressMessage"
|
||||||
|
></u-action-sheet>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -31,7 +37,7 @@ const store = useStore()
|
|||||||
|
|
||||||
const storeAddressList = ref<any[]>([])
|
const storeAddressList = ref<any[]>([])
|
||||||
const showAction = ref(false)
|
const showAction = ref(false)
|
||||||
const removeList = [{ text: '确定' }]
|
const removeList = [{ name: '确定' }]
|
||||||
const tips = { text: '确定要删除该收货人信息吗?' }
|
const tips = { text: '确定要删除该收货人信息吗?' }
|
||||||
const removeId = ref('')
|
const removeId = ref('')
|
||||||
const routerVal = ref<Record<string, string>>({})
|
const routerVal = ref<Record<string, string>>({})
|
||||||
|
|||||||
@@ -1,330 +1,325 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="myTracks">
|
<view class="myTracks">
|
||||||
<u-navbar
|
<u-navbar
|
||||||
title="我的足迹"
|
title="我的足迹"
|
||||||
:fixed="true"
|
:fixed="true"
|
||||||
:placeholder="true"
|
:placeholder="true"
|
||||||
:auto-back="true"
|
:auto-back="true"
|
||||||
>
|
>
|
||||||
<template #right>
|
<template #right>
|
||||||
<view class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</view>
|
<view class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</view>
|
||||||
</template>
|
</template>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<view class="tracks-tip">
|
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="isEmpty"></u-empty>
|
||||||
<u-icon name="volume" color="#f9ae3d" size="19"></u-icon>
|
<view v-else class="tracks-list" :class="{ 'is-editing': isEdit }">
|
||||||
<text class="tracks-tip-text">右划删除浏览记录</text>
|
<u-swipe-action
|
||||||
</view>
|
v-for="(item, index) in trackList"
|
||||||
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="isEmpty"></u-empty>
|
:key="item.id || index"
|
||||||
<view v-else class="tracks-list">
|
class="myTracks-swipe"
|
||||||
<block v-for="(item, index) in trackList" :key="index">
|
>
|
||||||
<view
|
<u-swipe-action-item
|
||||||
class="myTracks-title"
|
:show="item.show"
|
||||||
v-if="getStoreName(item)"
|
:name="index"
|
||||||
@click="navigateToStore(item)"
|
@click="deleteTracks"
|
||||||
>{{ getStoreName(item) }}</view>
|
@open="openSwipe"
|
||||||
<u-swipe-action class="myTracks-swipe">
|
:options="swipeOptions"
|
||||||
<u-swipe-action-item
|
>
|
||||||
:show="item.show"
|
<view class="myTracks-item">
|
||||||
:name="index"
|
<u-checkbox-group v-if="isEdit" class="store-line-check">
|
||||||
@click="deleteTracks"
|
<u-checkbox
|
||||||
@open="openSwipe"
|
usedAlone
|
||||||
:options="swipeOptions"
|
shape="circle"
|
||||||
>
|
:active-color="lightColor"
|
||||||
<view class="myTracks-item">
|
v-model:checked="item.checked"
|
||||||
<u-checkbox-group v-if="isEdit" class="store-line-check">
|
@change="onTrackCheckChange(item)"
|
||||||
<u-checkbox
|
></u-checkbox>
|
||||||
usedAlone
|
</u-checkbox-group>
|
||||||
shape="circle"
|
<view class="myTracks-item-img" @click.stop="navigateToDetail(item)">
|
||||||
:active-color="lightColor"
|
<image v-if="item.thumbnail" class="track-thumb-img" mode="aspectFill" :src="item.thumbnail"></image>
|
||||||
v-model:checked="item.checked"
|
</view>
|
||||||
@change="onTrackCheckChange(item)"
|
<view class="myTracks-item-content" @click.stop="navigateToDetail(item)">
|
||||||
></u-checkbox>
|
<view class="myTracks-item-title">{{ item.goodsName }}</view>
|
||||||
</u-checkbox-group>
|
<view
|
||||||
<view class="myTracks-item-img" @click.stop="navigateToDetail(item)">
|
v-if="getStoreName(item)"
|
||||||
<image class="track-thumb" :src="item.thumbnail"></image>
|
class="myTracks-item-store"
|
||||||
</view>
|
@click.stop="navigateToStore(item)"
|
||||||
<view class="myTracks-item-content" @click.stop="navigateToDetail(item)">
|
>{{ getStoreName(item) }}</view>
|
||||||
<view class="myTracks-item-title">
|
<view class="myTracks-item-price">¥{{ unitPrice(item.price) }}</view>
|
||||||
{{ item.goodsName }}
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="myTracks-item-price">
|
</u-swipe-action-item>
|
||||||
¥{{ unitPrice(item.price) }}
|
</u-swipe-action>
|
||||||
</view>
|
<view v-if="isEdit" class="submit" @click="deleteSelectedTracks">删除所选</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</u-swipe-action-item>
|
</view>
|
||||||
</u-swipe-action>
|
</template>
|
||||||
<view class="myTracks-divider"></view>
|
|
||||||
</block>
|
<script setup lang="ts">
|
||||||
<view v-if="isEdit" class="submit" @click="deleteSelectedTracks">
|
import { ref, computed } from 'vue'
|
||||||
删除所选
|
import { onShow, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||||
</view>
|
import { useStore } from '@/store'
|
||||||
</view>
|
import { unitPrice } from '@/utils/filters.js'
|
||||||
|
import { myTrackList, deleteHistoryListId } from '@/api/members.js'
|
||||||
</view>
|
import { getStoreBaseInfo } from '@/api/store.js'
|
||||||
</template>
|
|
||||||
|
const store = useStore()
|
||||||
<script setup lang="ts">
|
const lightColor = computed(() => store.getters.lightColor)
|
||||||
import { ref, computed } from 'vue'
|
|
||||||
import { onShow, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
|
const isEdit = ref(false)
|
||||||
import { useStore } from '@/store'
|
const isEmpty = ref(false)
|
||||||
import { unitPrice } from '@/utils/filters.js'
|
const params = ref({
|
||||||
import { myTrackList, deleteHistoryListId } from '@/api/members.js'
|
pageNumber: 1,
|
||||||
import { getStoreBaseInfo } from '@/api/store.js'
|
pageSize: 10,
|
||||||
|
order: 'desc',
|
||||||
const store = useStore()
|
sort: 'updateTime',
|
||||||
const lightColor = computed(() => store.getters.lightColor)
|
})
|
||||||
|
const swipeOptions = [{ text: '删除', style: { backgroundColor: '#dd524d' } }]
|
||||||
const isEdit = ref(false)
|
const trackList = ref<any[]>([])
|
||||||
const isEmpty = ref(false)
|
const storeNameMap = ref<Record<string, string>>({})
|
||||||
const params = ref({
|
|
||||||
pageNumber: 1,
|
onReachBottom(() => {
|
||||||
pageSize: 10,
|
params.value.pageNumber++
|
||||||
order: 'desc',
|
fetchTrackList()
|
||||||
sort: 'updateTime',
|
})
|
||||||
})
|
|
||||||
const swipeOptions = [{ text: '删除', style: { backgroundColor: '#dd524d' } }]
|
onShow(() => {
|
||||||
const trackList = ref<any[]>([])
|
params.value.pageNumber = 1
|
||||||
const storeNameMap = ref<Record<string, string>>({})
|
trackList.value = []
|
||||||
|
fetchTrackList()
|
||||||
onReachBottom(() => {
|
})
|
||||||
params.value.pageNumber++
|
|
||||||
fetchTrackList()
|
onPullDownRefresh(() => {
|
||||||
})
|
params.value.pageNumber = 1
|
||||||
|
trackList.value = []
|
||||||
onShow(() => {
|
fetchTrackList()
|
||||||
params.value.pageNumber = 1
|
})
|
||||||
trackList.value = []
|
|
||||||
fetchTrackList()
|
function getStoreName(item: any) {
|
||||||
})
|
return item.storeName || storeNameMap.value[item.storeId] || ''
|
||||||
|
}
|
||||||
onPullDownRefresh(() => {
|
|
||||||
params.value.pageNumber = 1
|
async function enrichStoreNames(records: any[]) {
|
||||||
trackList.value = []
|
const storeIds = [
|
||||||
fetchTrackList()
|
...new Set(
|
||||||
})
|
records
|
||||||
|
.filter((item) => !item.storeName && item.storeId)
|
||||||
function getStoreName(item: any) {
|
.map((item) => item.storeId)
|
||||||
return item.storeName || storeNameMap.value[item.storeId] || ''
|
),
|
||||||
}
|
].filter((storeId) => !storeNameMap.value[storeId])
|
||||||
|
|
||||||
async function enrichStoreNames(records: any[]) {
|
await Promise.all(
|
||||||
const storeIds = [
|
storeIds.map(async (storeId) => {
|
||||||
...new Set(
|
try {
|
||||||
records
|
const res = await getStoreBaseInfo(storeId)
|
||||||
.filter((item) => !item.storeName && item.storeId)
|
const name = res.data?.result?.storeName
|
||||||
.map((item) => item.storeId)
|
if (name) {
|
||||||
),
|
storeNameMap.value[storeId] = name
|
||||||
].filter((storeId) => !storeNameMap.value[storeId])
|
}
|
||||||
|
} catch {
|
||||||
await Promise.all(
|
// ignore
|
||||||
storeIds.map(async (storeId) => {
|
}
|
||||||
try {
|
})
|
||||||
const res = await getStoreBaseInfo(storeId)
|
)
|
||||||
const name = res.data?.result?.storeName
|
}
|
||||||
if (name) {
|
|
||||||
storeNameMap.value[storeId] = name
|
function onTrackCheckChange(_val: any) {
|
||||||
}
|
// 勾选状态由 v-model:checked 维护
|
||||||
} catch {
|
}
|
||||||
// ignore
|
|
||||||
}
|
function deleteSelectedTracks() {
|
||||||
})
|
const ids = trackList.value.filter((item) => item.checked).map((item) => item.goodsId)
|
||||||
)
|
if (!ids.length) {
|
||||||
}
|
uni.showToast({ title: '请选择删除数据', icon: 'none' })
|
||||||
|
return
|
||||||
function onTrackCheckChange(_val: any) {
|
}
|
||||||
// 勾选状态由 v-model:checked 维护
|
deleteTracks(0, ids)
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteSelectedTracks() {
|
function navigateToStore(val: any) {
|
||||||
const ids = trackList.value.filter((item) => item.checked).map((item) => item.goodsId)
|
uni.navigateTo({ url: `/pages/product/shopPage?id=${val.storeId}` })
|
||||||
if (!ids.length) {
|
}
|
||||||
uni.showToast({ title: '请选择删除数据', icon: 'none' })
|
|
||||||
return
|
function openSwipe(index: number) {
|
||||||
}
|
trackList.value[index].show = true
|
||||||
deleteTracks(0, ids)
|
trackList.value.forEach((val, idx) => {
|
||||||
}
|
if (index !== idx) val.show = false
|
||||||
|
})
|
||||||
function navigateToStore(val: any) {
|
}
|
||||||
uni.navigateTo({ url: `/pages/product/shopPage?id=${val.storeId}` })
|
|
||||||
}
|
function navigateToDetail(item: any) {
|
||||||
|
uni.navigateTo({
|
||||||
function openSwipe(index: number) {
|
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||||
trackList.value[index].show = true
|
})
|
||||||
trackList.value.forEach((val, idx) => {
|
}
|
||||||
if (index !== idx) val.show = false
|
|
||||||
})
|
function fetchTrackList() {
|
||||||
}
|
uni.showLoading({ title: '加载中' })
|
||||||
|
myTrackList(params.value).then(async (res) => {
|
||||||
function navigateToDetail(item: any) {
|
uni.stopPullDownRefresh()
|
||||||
uni.navigateTo({
|
uni.hideLoading()
|
||||||
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
if (res.statusCode === 200) {
|
||||||
})
|
const records = res.data.result.records || []
|
||||||
}
|
records.forEach((item: any) => {
|
||||||
|
item.show = false
|
||||||
function fetchTrackList() {
|
item.checked = false
|
||||||
uni.showLoading({ title: '加载中' })
|
})
|
||||||
myTrackList(params.value).then(async (res) => {
|
|
||||||
uni.stopPullDownRefresh()
|
if (!records.length) {
|
||||||
uni.hideLoading()
|
if (trackList.value.length === 0) {
|
||||||
if (res.statusCode === 200) {
|
isEmpty.value = true
|
||||||
const records = res.data.result.records || []
|
}
|
||||||
records.forEach((item: any) => {
|
} else {
|
||||||
item.show = false
|
isEmpty.value = false
|
||||||
item.checked = false
|
await enrichStoreNames(records)
|
||||||
})
|
trackList.value.push(...records)
|
||||||
|
}
|
||||||
if (!records.length) {
|
}
|
||||||
if (trackList.value.length === 0) {
|
})
|
||||||
isEmpty.value = true
|
}
|
||||||
}
|
|
||||||
} else {
|
function deleteTracks(e: any, ids?: any) {
|
||||||
isEmpty.value = false
|
const index = typeof e === 'object' ? (e.name != null ? e.name : e.index) : e
|
||||||
await enrichStoreNames(records)
|
const goodsId = ids || trackList.value[index]?.goodsId
|
||||||
trackList.value.push(...records)
|
if (!goodsId) return
|
||||||
}
|
deleteHistoryListId(goodsId).then((res) => {
|
||||||
}
|
if (res.data.code === 200) {
|
||||||
})
|
trackList.value = []
|
||||||
}
|
params.value.pageNumber = 1
|
||||||
|
fetchTrackList()
|
||||||
function deleteTracks(e: any, ids?: any) {
|
} else {
|
||||||
const index = typeof e === 'object' ? (e.name != null ? e.name : e.index) : e
|
uni.showToast({
|
||||||
const goodsId = ids || trackList.value[index]?.goodsId
|
title: res.data.message,
|
||||||
if (!goodsId) return
|
duration: 2000,
|
||||||
deleteHistoryListId(goodsId).then((res) => {
|
icon: 'none',
|
||||||
if (res.data.code === 200) {
|
})
|
||||||
trackList.value = []
|
}
|
||||||
params.value.pageNumber = 1
|
})
|
||||||
fetchTrackList()
|
}
|
||||||
} else {
|
</script>
|
||||||
uni.showToast({
|
|
||||||
title: res.data.message,
|
<style lang="scss" scoped>
|
||||||
duration: 2000,
|
.submit {
|
||||||
icon: 'none',
|
position: fixed;
|
||||||
})
|
bottom: calc(20rpx + constant(safe-area-inset-bottom));
|
||||||
}
|
bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||||
})
|
left: 10%;
|
||||||
}
|
width: 80%;
|
||||||
</script>
|
height: 80rpx;
|
||||||
|
color: #fff;
|
||||||
<style lang="scss" scoped>
|
border-radius: 100px;
|
||||||
.submit {
|
display: flex;
|
||||||
position: fixed;
|
align-items: center;
|
||||||
bottom: calc(20rpx + constant(safe-area-inset-bottom));
|
justify-content: center;
|
||||||
bottom: calc(20rpx + env(safe-area-inset-bottom));
|
background: $light-color;
|
||||||
left: 10%;
|
z-index: 99;
|
||||||
width: 80%;
|
}
|
||||||
height: 80rpx;
|
|
||||||
color: #fff;
|
.myTracks {
|
||||||
border-radius: 100px;
|
width: 100%;
|
||||||
display: flex;
|
min-height: 100vh;
|
||||||
align-items: center;
|
background: #f5f5f5;
|
||||||
justify-content: center;
|
padding-top: 2rpx;
|
||||||
background: $light-color;
|
box-sizing: border-box;
|
||||||
z-index: 99;
|
}
|
||||||
}
|
|
||||||
|
.tracks-list {
|
||||||
.myTracks {
|
padding: 20rpx 24rpx 40rpx;
|
||||||
width: 100%;
|
box-sizing: border-box;
|
||||||
padding-top: 2rpx;
|
|
||||||
}
|
&.is-editing {
|
||||||
|
padding-bottom: calc(140rpx + constant(safe-area-inset-bottom));
|
||||||
.tracks-tip {
|
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
|
||||||
display: flex;
|
}
|
||||||
align-items: center;
|
}
|
||||||
padding: 18rpx 24rpx;
|
|
||||||
background: #fdf6ec;
|
.myTracks-swipe {
|
||||||
}
|
display: block;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
.tracks-tip-text {
|
border-radius: 16rpx;
|
||||||
margin-left: 10rpx;
|
overflow: hidden;
|
||||||
font-size: 28rpx;
|
background: #fff;
|
||||||
color: #f9ae3d;
|
}
|
||||||
line-height: 1.4;
|
|
||||||
}
|
:deep(.u-swipe-action),
|
||||||
|
:deep(.u-swipe-action-item),
|
||||||
.tracks-list {
|
:deep(.u-swipe-action-item__content) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.myTracks-swipe,
|
:deep(.u-swipe-action-item__content) {
|
||||||
:deep(.u-swipe-action),
|
overflow: hidden;
|
||||||
:deep(.u-swipe-action-item),
|
background: #fff;
|
||||||
:deep(.u-swipe-action-item__content) {
|
}
|
||||||
width: 100%;
|
|
||||||
}
|
.myTracks-item {
|
||||||
|
width: 100%;
|
||||||
:deep(.u-swipe-action-item__content) {
|
padding: 24rpx;
|
||||||
overflow: hidden;
|
background-color: #fff;
|
||||||
}
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
.myTracks-title {
|
align-items: center;
|
||||||
width: 100%;
|
}
|
||||||
height: 110rpx;
|
|
||||||
padding: 0 20rpx;
|
.store-line-check {
|
||||||
font-size: 28rpx;
|
margin-right: 16rpx;
|
||||||
color: #666;
|
flex-shrink: 0;
|
||||||
font-weight: bold;
|
}
|
||||||
background-color: #fff;
|
|
||||||
display: flex;
|
.myTracks-item-img {
|
||||||
align-items: center;
|
width: 160rpx;
|
||||||
box-sizing: border-box;
|
height: 160rpx;
|
||||||
}
|
margin-right: 20rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
.myTracks-item {
|
border-radius: 12rpx;
|
||||||
width: 100%;
|
background: #f3f4f6;
|
||||||
min-height: 226rpx;
|
overflow: hidden;
|
||||||
padding: 30rpx 20rpx;
|
|
||||||
background-color: #fff;
|
.track-thumb-img {
|
||||||
box-sizing: border-box;
|
width: 100%;
|
||||||
display: flex;
|
height: 100%;
|
||||||
align-items: center;
|
display: block;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.store-line-check {
|
|
||||||
margin-right: 16rpx;
|
.myTracks-item-content {
|
||||||
flex-shrink: 0;
|
flex: 1;
|
||||||
}
|
min-width: 0;
|
||||||
|
min-height: 160rpx;
|
||||||
.myTracks-item-img {
|
display: flex;
|
||||||
margin-right: 20rpx;
|
flex-direction: column;
|
||||||
flex-shrink: 0;
|
justify-content: space-between;
|
||||||
|
}
|
||||||
.track-thumb {
|
|
||||||
width: 130rpx;
|
.myTracks-item-title {
|
||||||
height: 130rpx;
|
font-size: 28rpx;
|
||||||
border-radius: 8rpx;
|
color: #333;
|
||||||
display: block;
|
line-height: 1.4;
|
||||||
}
|
display: -webkit-box;
|
||||||
}
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
.myTracks-item-content {
|
overflow: hidden;
|
||||||
flex: 1;
|
}
|
||||||
min-width: 0;
|
|
||||||
display: flex;
|
.myTracks-item-store {
|
||||||
flex-direction: column;
|
margin-top: 8rpx;
|
||||||
justify-content: center;
|
font-size: 24rpx;
|
||||||
}
|
color: #999;
|
||||||
|
line-height: 1.4;
|
||||||
.myTracks-item-title {
|
overflow: hidden;
|
||||||
font-size: 28rpx;
|
white-space: nowrap;
|
||||||
color: #333;
|
text-overflow: ellipsis;
|
||||||
line-height: 1.4;
|
}
|
||||||
}
|
|
||||||
|
.myTracks-item-price {
|
||||||
.myTracks-item-price {
|
margin-top: 12rpx;
|
||||||
font-size: 28rpx;
|
font-size: 32rpx;
|
||||||
color: $light-color;
|
font-weight: 600;
|
||||||
padding-top: 10rpx;
|
color: $light-color;
|
||||||
}
|
line-height: 1.2;
|
||||||
|
}
|
||||||
.myTracks-divider {
|
|
||||||
width: 100%;
|
.edit {
|
||||||
height: 20rpx;
|
padding-right: 32rpx;
|
||||||
background: #f5f5f5;
|
}
|
||||||
}
|
</style>
|
||||||
|
|
||||||
.edit {
|
|
||||||
padding-right: 32rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -56,7 +56,6 @@
|
|||||||
|
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<view class="submit" @click="submit">保存</view>
|
<view class="submit" @click="submit">保存</view>
|
||||||
<view class="submit light" @click="quiteLoginOut">退出登录</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-datetime-picker
|
<u-datetime-picker
|
||||||
@@ -84,7 +83,6 @@
|
|||||||
import { ref, reactive, computed } from 'vue'
|
import { ref, reactive, computed } from 'vue'
|
||||||
import { onShow } from '@dcloudio/uni-app'
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
import { useStore } from '@/store'
|
import { useStore } from '@/store'
|
||||||
import { quiteLoginOut } from '@/utils/filters.js'
|
|
||||||
import { saveUserInfo } from '@/api/members.js'
|
import { saveUserInfo } from '@/api/members.js'
|
||||||
import { upload } from '@/api/common.js'
|
import { upload } from '@/api/common.js'
|
||||||
import storage from '@/utils/storage.js'
|
import storage from '@/utils/storage.js'
|
||||||
@@ -211,31 +209,40 @@ onShow(() => {
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background: #fff;
|
background: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
.person-msg {
|
.person-msg {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #fff;
|
background: #f5f5f5;
|
||||||
padding-bottom: 180rpx;
|
padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.head {
|
.head {
|
||||||
padding: 40rpx 0 20rpx;
|
margin-bottom: 20rpx;
|
||||||
color: $font-color-light;
|
padding: 48rpx 0 32rpx;
|
||||||
font-size: $font-sm;
|
background: #fff;
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
line-height: 2em;
|
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 144rpx;
|
width: 144rpx;
|
||||||
height: 144rpx;
|
height: 144rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
background: #f3f4f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
view {
|
||||||
|
margin-top: 16rpx;
|
||||||
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,13 +251,13 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.u-form-item) {
|
:deep(.u-form-item) {
|
||||||
padding: 0 30rpx;
|
padding: 0 32rpx;
|
||||||
min-height: 100rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.u-form-item__body) {
|
:deep(.u-form-item__body) {
|
||||||
min-height: 100rpx;
|
min-height: 108rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
padding: 16rpx 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.u-form-item__body__left__content__label) {
|
:deep(.u-form-item__body__left__content__label) {
|
||||||
@@ -258,8 +265,13 @@ page {
|
|||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.u-form-item__body__right) {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.u-form-item__body__right__content__slot) {
|
:deep(.u-form-item__body__right__content__slot) {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -271,7 +283,8 @@ page {
|
|||||||
|
|
||||||
:deep(.u-input__content__field-wrapper__field) {
|
:deep(.u-input__content__field-wrapper__field) {
|
||||||
font-size: 28rpx !important;
|
font-size: 28rpx !important;
|
||||||
color: #666 !important;
|
color: #333 !important;
|
||||||
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sex-row {
|
.sex-row {
|
||||||
@@ -288,16 +301,20 @@ page {
|
|||||||
|
|
||||||
.form-value {
|
.form-value {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #666;
|
color: #333;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bind-mobile {
|
.bind-mobile {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: $main-color;
|
color: $light-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
@@ -307,10 +324,10 @@ page {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
padding: 16rpx 32rpx calc(16rpx + env(safe-area-inset-bottom));
|
||||||
padding: 24rpx 30rpx calc(24rpx + env(safe-area-inset-bottom));
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.04);
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit {
|
.submit {
|
||||||
@@ -318,18 +335,9 @@ page {
|
|||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 100px;
|
border-radius: 40rpx;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
background: $light-color;
|
background: $light-color;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit + .submit {
|
|
||||||
margin-left: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.light {
|
|
||||||
background: rgba($color: $light-color, $alpha: 0.2) !important;
|
|
||||||
color: $light-color !important;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -159,7 +159,7 @@
|
|||||||
title="申请原因"
|
title="申请原因"
|
||||||
@confirm="reasonSelectConfirm"
|
@confirm="reasonSelectConfirm"
|
||||||
></u-picker>
|
></u-picker>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="toastRef" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ const sku = ref<any>({})
|
|||||||
const reasonSelectShow = ref(false)
|
const reasonSelectShow = ref(false)
|
||||||
const reasonList = ref<any[]>([])
|
const reasonList = ref<any[]>([])
|
||||||
const applyInfo = ref<any>({})
|
const applyInfo = ref<any>({})
|
||||||
const uToast = ref<any>(null)
|
const toastRef = ref<any>(null)
|
||||||
const isAppointmentAfterSale = ref(false)
|
const isAppointmentAfterSale = ref(false)
|
||||||
|
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
@@ -335,8 +335,8 @@ function onUploadAfterRead(event: any) {
|
|||||||
|
|
||||||
function showToast(message: string, type = 'error') {
|
function showToast(message: string, type = 'error') {
|
||||||
const text = message || (type === 'success' ? '操作成功' : '操作失败')
|
const text = message || (type === 'success' ? '操作成功' : '操作失败')
|
||||||
if (uToast.value) {
|
if (toastRef.value) {
|
||||||
uToast.value.show({ message: text, type })
|
toastRef.value.show({ message: text, type })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
@confirm="onTimeConfirm"
|
@confirm="onTimeConfirm"
|
||||||
@close="timeshow = false"
|
@close="timeshow = false"
|
||||||
/>
|
/>
|
||||||
<u-toast ref="uToast"/>
|
<u-toast ref="toastRef"/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ const form = reactive({
|
|||||||
})
|
})
|
||||||
const serviceDetail = reactive<{ sn: string }>({ sn: '' })
|
const serviceDetail = reactive<{ sn: string }>({ sn: '' })
|
||||||
const sku = ref<any>({})
|
const sku = ref<any>({})
|
||||||
const uToast = ref<any>(null)
|
const toastRef = ref<any>(null)
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
sku.value = storage.getAfterSaleData()
|
sku.value = storage.getAfterSaleData()
|
||||||
@@ -136,15 +136,15 @@ function onSubmit() {
|
|||||||
delete submitForm.courierCompany
|
delete submitForm.courierCompany
|
||||||
|
|
||||||
if (form.logisticsId == '') {
|
if (form.logisticsId == '') {
|
||||||
uToast.value?.show({ title: '请选择快递公司', type: 'error' })
|
toastRef.value?.show({ title: '请选择快递公司', type: 'error' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (form.logisticsNo == '') {
|
if (form.logisticsNo == '') {
|
||||||
uToast.value?.show({ title: '请填写快递单号', type: 'error' })
|
toastRef.value?.show({ title: '请填写快递单号', type: 'error' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (form.mDeliverTime == '') {
|
if (form.mDeliverTime == '') {
|
||||||
uToast.value?.show({ title: '请选择发货时间', type: 'error' })
|
toastRef.value?.show({ title: '请选择发货时间', type: 'error' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ function onSubmit() {
|
|||||||
fillShipInfo(serviceDetail.sn, submitForm).then((res) => {
|
fillShipInfo(serviceDetail.sn, submitForm).then((res) => {
|
||||||
hideLoadingIfNeeded()
|
hideLoadingIfNeeded()
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
uToast.value?.show({
|
toastRef.value?.show({
|
||||||
title: '提交成功',
|
title: '提交成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
back: true,
|
back: true,
|
||||||
|
|||||||
@@ -417,7 +417,11 @@ function openOrder(order: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function changeTab(e: any) {
|
function changeTab(e: any) {
|
||||||
tabCurrentIndex.value = e.target.current
|
// H5 的 swiper change 把下标放在 detail.current。
|
||||||
|
// 读 target.current 会得到 undefined,选中态被清掉,列表就停在「全部」。
|
||||||
|
const current = Number(e?.detail?.current ?? e?.target?.current)
|
||||||
|
if (!Number.isInteger(current) || current < 0 || current >= navList.length) return
|
||||||
|
tabCurrentIndex.value = current
|
||||||
}
|
}
|
||||||
|
|
||||||
function tabClick(index: number) {
|
function tabClick(index: number) {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<verification-codes :items="verificationCodeItems" />
|
<verification-codes :items="verificationCodeItems" />
|
||||||
</view>
|
</view>
|
||||||
<view v-else-if="isECouponOrder" class="card-key-entry">
|
<view v-else-if="isECouponOrder" class="card-key-entry">
|
||||||
<view v-if="ecouponCardKeyDelivered" class="card-key-entry__btn" @click="goCardKeyDetail">
|
<view v-if="ecouponCardKeyDelivered" class="btn" @click="goCardKeyDetail">
|
||||||
查看卡密
|
查看卡密
|
||||||
</view>
|
</view>
|
||||||
<view v-else-if="order.orderStatus === 'CANCELLED'" class="card-key-entry__tip">
|
<view v-else-if="order.orderStatus === 'CANCELLED'" class="card-key-entry__tip">
|
||||||
@@ -1055,17 +1055,14 @@ page,
|
|||||||
|
|
||||||
.card-key-entry {
|
.card-key-entry {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-key-entry__btn {
|
.btn {
|
||||||
display: inline-block;
|
width: 100%;
|
||||||
padding: 20rpx 80rpx;
|
height: 80rpx;
|
||||||
border: 2rpx solid $main-color;
|
line-height: 80rpx;
|
||||||
border-radius: 12rpx;
|
border-radius: 40rpx;
|
||||||
color: $main-color;
|
font-size: 30rpx;
|
||||||
font-size: 28rpx;
|
}
|
||||||
font-weight: 600;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-key-entry__tip {
|
.card-key-entry__tip {
|
||||||
|
|||||||
@@ -11,15 +11,21 @@
|
|||||||
<div class="step-list">
|
<div class="step-list">
|
||||||
<div
|
<div
|
||||||
class="step-item"
|
class="step-item"
|
||||||
:class="{ active: current == index }"
|
:class="{ active: current == index, done: current > index }"
|
||||||
v-for="(item, index) in entrySteps"
|
v-for="(item, index) in flowSteps"
|
||||||
:key="index"
|
:key="item.value"
|
||||||
>
|
>
|
||||||
{{ item.title }}
|
<div class="step-mark">{{ index + 1 }}</div>
|
||||||
|
<div class="step-title">{{ item.title }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="submit" @click="keepOn()">开始填写</div>
|
<div v-if="statusTip" class="status-tip" :class="statusTip.value">
|
||||||
<div class="notice" @click="getEntryNotice">查看店铺入驻协议</div>
|
{{ statusTip.title }}
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
|
<div v-if="showFillButton" class="submit" @click="keepOn()">开始填写</div>
|
||||||
|
<div class="notice" @click="getEntryNotice">查看店铺入驻协议</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -36,8 +42,15 @@ const store = useStore()
|
|||||||
|
|
||||||
const themeStyle = computed(() => getThemeStyle(store.state.theme))
|
const themeStyle = computed(() => getThemeStyle(store.state.theme))
|
||||||
|
|
||||||
const current = ref(999)
|
const current = ref(-1)
|
||||||
const companyData = ref<any>('')
|
const companyData = ref<any>('')
|
||||||
|
const showFillButton = computed(() => companyData.value?.storeDisable !== 'OPEN')
|
||||||
|
const flowSteps = computed(() =>
|
||||||
|
entrySteps.value.filter((item) => item.value === 'APPLY' || item.value === 'APPLYING')
|
||||||
|
)
|
||||||
|
const statusTip = computed(() =>
|
||||||
|
entrySteps.value.find((item) => item.value !== 'APPLY' && item.value !== 'APPLYING')
|
||||||
|
)
|
||||||
|
|
||||||
const entrySteps = ref([
|
const entrySteps = ref([
|
||||||
{
|
{
|
||||||
@@ -137,54 +150,103 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.entry-content {
|
.entry-content {
|
||||||
padding: 32rpx 80rpx calc(40rpx + env(safe-area-inset-bottom));
|
padding: 48rpx 48rpx calc(40rpx + env(safe-area-inset-bottom));
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
font-weight: 500;
|
font-weight: 600;
|
||||||
font-size: 56rpx;
|
font-size: 48rpx;
|
||||||
color: #333;
|
color: #222;
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-list {
|
.step-list {
|
||||||
margin: 80rpx 0;
|
margin-top: 64rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-item {
|
.step-item {
|
||||||
padding: 30rpx 20rpx;
|
display: flex;
|
||||||
font-size: 40rpx;
|
align-items: center;
|
||||||
font-weight: bold;
|
padding: 18rpx 0;
|
||||||
color: #666;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-item.active {
|
.step-mark {
|
||||||
|
width: 48rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #f2f2f2;
|
||||||
|
color: #999;
|
||||||
|
font-size: 26rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-item.done .step-mark,
|
||||||
|
.step-item.active .step-mark {
|
||||||
|
background: var(--theme-light, #ff6b35);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-item.done .step-title {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-item.active .step-title {
|
||||||
|
color: var(--theme-light, #ff6b35);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-tip {
|
||||||
|
margin-top: 24rpx;
|
||||||
|
padding: 24rpx 28rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 1.5;
|
||||||
color: var(--theme-light, #ff6b35);
|
color: var(--theme-light, #ff6b35);
|
||||||
background: var(--theme-light-10, rgba(255, 107, 53, 0.1));
|
background: var(--theme-light-10, rgba(255, 107, 53, 0.1));
|
||||||
border-radius: 20rpx;
|
}
|
||||||
|
|
||||||
|
.status-tip.REFUSED {
|
||||||
|
color: var(--theme-primary, #ff3c2a);
|
||||||
|
background: #fff1f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-tip.CLOSED {
|
||||||
|
color: #666;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
margin-top: 72rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit,
|
.submit,
|
||||||
.notice {
|
.notice {
|
||||||
font-weight: bold;
|
height: 88rpx;
|
||||||
font-size: 28rpx;
|
line-height: 88rpx;
|
||||||
height: 92rpx;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
letter-spacing: 4rpx;
|
font-size: 30rpx;
|
||||||
line-height: 92rpx;
|
border-radius: 44rpx;
|
||||||
border-radius: 20rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit {
|
.submit {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin-top: 120rpx;
|
|
||||||
background: var(--theme-light, #ff6b35);
|
background: var(--theme-light, #ff6b35);
|
||||||
|
margin-bottom: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notice {
|
.notice {
|
||||||
margin-top: 40rpx;
|
|
||||||
color: #333;
|
color: #333;
|
||||||
background: $bg-color;
|
background: #f5f5f5;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,25 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view v-if="bargainLog.length != 0">
|
<view v-if="bargainLog.length != 0" class="list">
|
||||||
<view v-for="(item,index) in bargainLog" class="flex" :key="index">
|
<view v-for="(item,index) in bargainLog" class="card" :key="index">
|
||||||
<view class="goods-img">
|
<view class="goods-img">
|
||||||
<u-image radius="20rpx" width="230rpx" height="230rpx" :src="item.thumbnail"></u-image>
|
<u-image radius="12rpx" width="160rpx" height="160rpx" :src="item.thumbnail"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods">
|
<view class="goods">
|
||||||
<view class="wes-2">
|
<view class="head">
|
||||||
{{item.goodsName}}
|
<view class="goods-name wes-2">{{ item.goodsName }}</view>
|
||||||
|
<text class="tips" :class="item.status">{{ statusWay[item.status] }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="surplus">
|
<view class="foot">
|
||||||
还剩<text class="surplusPrice">{{unitPrice(item.surplusPrice)}}元</text>
|
<view class="surplus">
|
||||||
</view>
|
还剩<text class="surplusPrice">{{ unitPrice(item.surplusPrice) }}</text>元
|
||||||
|
</view>
|
||||||
<view @click="navigateToBargainDetail(item)" v-if="item.status == 'START'" class="buy">
|
<view v-if="item.status == 'START'" class="buy" @click="navigateToBargainDetail(item)">
|
||||||
继续免费领
|
继续免费领
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="tips-box">
|
|
||||||
<view class="tips" :class="[item.status]">
|
|
||||||
{{statusWay[item.status]}}
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -76,67 +73,90 @@ function navigateToBargainDetail(val: any) {
|
|||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
page {
|
page {
|
||||||
background: #fff;
|
background: #f5f5f5;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.box {
|
.box {
|
||||||
padding: 0 32rpx;
|
min-height: 100vh;
|
||||||
|
padding: 20rpx 24rpx 40rpx;
|
||||||
|
background: #f5f5f5;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
padding: 24rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
.goods-img {
|
.goods-img {
|
||||||
width: 230rpx;
|
width: 160rpx;
|
||||||
height: 230rpx;
|
height: 160rpx;
|
||||||
flex: 0 0 230rpx;
|
flex: 0 0 160rpx;
|
||||||
}
|
border-radius: 12rpx;
|
||||||
.buy {
|
overflow: hidden;
|
||||||
background: $light-color;
|
background: #f5f5f5;
|
||||||
color: #fff;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 10rpx 0;
|
|
||||||
border-radius: 100rpx;
|
|
||||||
width: 200rpx;
|
|
||||||
font-size: 24rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
}
|
|
||||||
.tips-box {
|
|
||||||
flex: 1;
|
|
||||||
justify-content: center;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.tips {
|
|
||||||
color: #999;
|
|
||||||
|
|
||||||
margin-top: 20rpx;
|
|
||||||
}
|
|
||||||
.surplusPrice {
|
|
||||||
font-size: 40rpx;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: $light-color;
|
|
||||||
}
|
|
||||||
.surplus {
|
|
||||||
color: #333;
|
|
||||||
font-size: 26rpx;
|
|
||||||
margin-top: 12rpx;
|
|
||||||
}
|
}
|
||||||
.goods {
|
.goods {
|
||||||
margin: 0 20rpx;
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
margin-left: 20rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 2;
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
|
min-height: 160rpx;
|
||||||
}
|
}
|
||||||
.flex {
|
.head {
|
||||||
border-bottom: 1rpx solid #f7f7f7;
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
.goods-name {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.tips {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 1.4;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.foot {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20rpx 0;
|
justify-content: space-between;
|
||||||
margin: 10rpx 0;
|
margin-top: 16rpx;
|
||||||
|
}
|
||||||
|
.surplus {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
color: #666;
|
||||||
|
font-size: 24rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.surplusPrice {
|
||||||
|
margin: 0 6rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: $light-color;
|
||||||
|
}
|
||||||
|
.buy {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
padding: 0 28rpx;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
background: $light-color;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
.SUCCESS {
|
.SUCCESS {
|
||||||
color: $light-color;
|
color: $light-color;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/node_modules/uview-plus/components/u-image/u-image.vue b/node_modules/uview-plus/components/u-image/u-image.vue
|
diff --git a/node_modules/uview-plus/components/u-image/u-image.vue b/node_modules/uview-plus/components/u-image/u-image.vue
|
||||||
index 24e3b10..b59b657 100644
|
index 24e3b10..1360704 100644
|
||||||
--- a/node_modules/uview-plus/components/u-image/u-image.vue
|
--- a/node_modules/uview-plus/components/u-image/u-image.vue
|
||||||
+++ b/node_modules/uview-plus/components/u-image/u-image.vue
|
+++ b/node_modules/uview-plus/components/u-image/u-image.vue
|
||||||
@@ -26,7 +26,7 @@
|
@@ -26,7 +26,7 @@
|
||||||
@@ -20,20 +20,7 @@ index 24e3b10..b59b657 100644
|
|||||||
class="u-image__error"
|
class="u-image__error"
|
||||||
:style="{
|
:style="{
|
||||||
borderRadius: shape == 'circle' ? '50%' : addUnit(radius),
|
borderRadius: shape == 'circle' ? '50%' : addUnit(radius),
|
||||||
@@ -108,7 +108,12 @@
|
@@ -126,6 +126,12 @@
|
||||||
// 图片加载完成时,去掉背景颜色,因为如果是png图片,就会显示灰色的背景
|
|
||||||
backgroundStyle: {},
|
|
||||||
// 用于fade模式的控制组件显示与否
|
|
||||||
+ // #ifdef MP-WEIXIN
|
|
||||||
+ show: true
|
|
||||||
+ // #endif
|
|
||||||
+ // #ifndef MP-WEIXIN
|
|
||||||
show: false
|
|
||||||
+ // #endif
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
@@ -126,6 +131,12 @@
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -46,6 +33,39 @@ index 24e3b10..b59b657 100644
|
|||||||
transStyle() {
|
transStyle() {
|
||||||
let style = {};
|
let style = {};
|
||||||
// 通过调用addUnit()方法,如果有单位,如百分比,px单位等,直接返回,如果是纯粹的数值,则加上rpx单位
|
// 通过调用addUnit()方法,如果有单位,如百分比,px单位等,直接返回,如果是纯粹的数值,则加上rpx单位
|
||||||
|
diff --git a/node_modules/uview-plus/components/u-modal/props.js b/node_modules/uview-plus/components/u-modal/props.js
|
||||||
|
index 0f0177b..1aacecf 100644
|
||||||
|
--- a/node_modules/uview-plus/components/u-modal/props.js
|
||||||
|
+++ b/node_modules/uview-plus/components/u-modal/props.js
|
||||||
|
@@ -105,7 +105,7 @@ export const props = defineMixin({
|
||||||
|
// 内容样式
|
||||||
|
contentStyle: {
|
||||||
|
type: Object,
|
||||||
|
- default: () => defProps.modal.contentStyle
|
||||||
|
+ default: () => ({ ...(defProps.modal.contentStyle || {}) })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
diff --git a/node_modules/uview-plus/components/u-modal/u-modal.vue b/node_modules/uview-plus/components/u-modal/u-modal.vue
|
||||||
|
index eab8f72..bfd3da0 100644
|
||||||
|
--- a/node_modules/uview-plus/components/u-modal/u-modal.vue
|
||||||
|
+++ b/node_modules/uview-plus/components/u-modal/u-modal.vue
|
||||||
|
@@ -142,9 +142,12 @@
|
||||||
|
emits: ["confirm", "cancel", "close", "update:show", 'cancelOnAsync'],
|
||||||
|
computed: {
|
||||||
|
contentStyleCpu() {
|
||||||
|
- let style = this.contentStyle;
|
||||||
|
- style.paddingTop = `${this.title ? 12 : 25}px`
|
||||||
|
- return style;
|
||||||
|
+ // 不要改 props 上的 contentStyle。那个对象是默认配置里的共享引用,
|
||||||
|
+ // 渲染时写入会反向触发父组件更新,购物车页会因此无限循环。
|
||||||
|
+ return {
|
||||||
|
+ ...(this.contentStyle || {}),
|
||||||
|
+ paddingTop: `${this.title ? 12 : 25}px`
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
diff --git a/node_modules/uview-plus/components/u-navbar/theme-vars.scss b/node_modules/uview-plus/components/u-navbar/theme-vars.scss
|
diff --git a/node_modules/uview-plus/components/u-navbar/theme-vars.scss b/node_modules/uview-plus/components/u-navbar/theme-vars.scss
|
||||||
index d057ee6..791a092 100644
|
index d057ee6..791a092 100644
|
||||||
--- a/node_modules/uview-plus/components/u-navbar/theme-vars.scss
|
--- a/node_modules/uview-plus/components/u-navbar/theme-vars.scss
|
||||||
|
|||||||
@@ -35,14 +35,35 @@ export function loadCachedTheme() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function applyTabBarStyle(mainColor) {
|
const TAB_BAR_ROUTES = [
|
||||||
if (!mainColor) return;
|
"pages/tabbar/home/index",
|
||||||
try {
|
"pages/tabbar/category/category",
|
||||||
uni.setTabBarStyle({
|
"pages/tabbar/cart/cartList",
|
||||||
selectedColor: mainColor,
|
"pages/tabbar/user/my",
|
||||||
});
|
];
|
||||||
} catch (e) {
|
|
||||||
// 非 tabBar 页面可能报错,忽略
|
function normalizeRoute(route = "") {
|
||||||
|
return String(route).replace(/^\//, "").split("?")[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
function currentRoute() {
|
||||||
|
const pages = typeof getCurrentPages === "function" ? getCurrentPages() : [];
|
||||||
|
const page = pages[pages.length - 1];
|
||||||
|
return (page && page.route) || "";
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isTabBarRoute(route) {
|
||||||
|
return TAB_BAR_ROUTES.includes(normalizeRoute(route || currentRoute()));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function applyTabBarStyle(mainColor, route) {
|
||||||
|
if (!mainColor || !isTabBarRoute(route)) return;
|
||||||
|
const task = uni.setTabBarStyle({
|
||||||
|
selectedColor: mainColor,
|
||||||
|
fail() {},
|
||||||
|
});
|
||||||
|
if (task && typeof task.catch === "function") {
|
||||||
|
task.catch(() => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user